From 598b39e3926365b2997fac6db487af9aa8a8124d Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Wed, 13 Dec 2023 12:30:15 +0300 Subject: [PATCH 1/6] BusinessUnits --- lib/Discovery/Settings/BusinessUnits/Discovery.php | 11 +++++++++++ lib/Discovery/Settings/Discovery.php | 7 +++---- lib/Discovery/Settings/Users/Discovery.php | 4 +--- 3 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 lib/Discovery/Settings/BusinessUnits/Discovery.php diff --git a/lib/Discovery/Settings/BusinessUnits/Discovery.php b/lib/Discovery/Settings/BusinessUnits/Discovery.php new file mode 100644 index 000000000..2199abe60 --- /dev/null +++ b/lib/Discovery/Settings/BusinessUnits/Discovery.php @@ -0,0 +1,11 @@ + Date: Wed, 13 Dec 2023 12:39:22 +0300 Subject: [PATCH 2/6] cms pages --- lib/Discovery/Cms/Discovery.php | 1 + lib/Discovery/Cms/Pages/Discovery.php | 15 ++++++++++ tests/spec/Discovery/Cms/DiscoverySpec.php | 1 + .../Discovery/Cms/Pages/DiscoverySpec.php | 28 +++++++++++++++++++ .../Settings/BusinessUnits/DiscoverySpec.php | 26 +++++++++++++++++ 5 files changed, 71 insertions(+) create mode 100644 lib/Discovery/Cms/Pages/Discovery.php create mode 100644 tests/spec/Discovery/Cms/Pages/DiscoverySpec.php create mode 100644 tests/spec/Discovery/Settings/BusinessUnits/DiscoverySpec.php diff --git a/lib/Discovery/Cms/Discovery.php b/lib/Discovery/Cms/Discovery.php index da606e82d..7bc33beb4 100644 --- a/lib/Discovery/Cms/Discovery.php +++ b/lib/Discovery/Cms/Discovery.php @@ -9,6 +9,7 @@ * @method Blogs\Discovery blogs() * @method Domains\Discovery domains() * @method Hubdb\Discovery hubdb() + * @method Pages\Discovery pages() * @method Performance\Discovery performance() * @method SiteSearch\Discovery siteSearch() * @method SourceCode\Discovery sourceCode() diff --git a/lib/Discovery/Cms/Pages/Discovery.php b/lib/Discovery/Cms/Pages/Discovery.php new file mode 100644 index 000000000..d4e61cbdc --- /dev/null +++ b/lib/Discovery/Cms/Pages/Discovery.php @@ -0,0 +1,15 @@ +blogs()->shouldHaveType(\HubSpot\Discovery\Cms\Blogs\Discovery::class); $this->domains()->shouldHaveType(\HubSpot\Discovery\Cms\Domains\Discovery::class); $this->hubdb()->shouldHaveType(\HubSpot\Discovery\Cms\Hubdb\Discovery::class); + $this->pages()->shouldHaveType(\HubSpot\Discovery\Cms\Pages\Discovery::class); $this->performance()->shouldHaveType(\HubSpot\Discovery\Cms\Performance\Discovery::class); $this->siteSearch()->shouldHaveType(\HubSpot\Discovery\Cms\SiteSearch\Discovery::class); $this->sourceCode()->shouldHaveType(\HubSpot\Discovery\Cms\SourceCode\Discovery::class); diff --git a/tests/spec/Discovery/Cms/Pages/DiscoverySpec.php b/tests/spec/Discovery/Cms/Pages/DiscoverySpec.php new file mode 100644 index 000000000..7877422c1 --- /dev/null +++ b/tests/spec/Discovery/Cms/Pages/DiscoverySpec.php @@ -0,0 +1,28 @@ +beConstructedWith($client, $config); + } + + public function it_is_initializable() + { + $this->shouldHaveType(\HubSpot\Discovery\Cms\Pages\Discovery::class); + } + + public function it_creates_clients() + { + $this->landingPagesApi()->shouldHaveType(LandingPagesApi::class); + $this->sitePagesApi()->shouldHaveType(SitePagesApi::class); + } +} diff --git a/tests/spec/Discovery/Settings/BusinessUnits/DiscoverySpec.php b/tests/spec/Discovery/Settings/BusinessUnits/DiscoverySpec.php new file mode 100644 index 000000000..f3fdb6f85 --- /dev/null +++ b/tests/spec/Discovery/Settings/BusinessUnits/DiscoverySpec.php @@ -0,0 +1,26 @@ +beConstructedWith($client, $config); + } + + public function it_is_initializable() + { + $this->shouldHaveType(\HubSpot\Discovery\Settings\BusinessUnits\Discovery::class); + } + + public function it_creates_clients() + { + $this->businessUnitApi()->shouldHaveType(BusinessUnitApi::class); + } +} From 39ffdd6874737164d7c51712ed09f61e6dab1e52 Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Wed, 13 Dec 2023 12:57:21 +0300 Subject: [PATCH 3/6] cs fix --- lib/Discovery/Cms/Discovery.php | 4 +-- lib/Discovery/Cms/Pages/Discovery.php | 8 ++--- lib/Discovery/Crm/Objects/Discovery.php | 1 + lib/Discovery/Crm/Objects/Taxes/Discovery.php | 28 +++++++++++++++ .../Discovery/Crm/Objects/DiscoverySpec.php | 2 ++ .../Crm/Objects/Taxes/DiscoverySpec.php | 35 +++++++++++++++++++ 6 files changed, 70 insertions(+), 8 deletions(-) create mode 100644 lib/Discovery/Crm/Objects/Taxes/Discovery.php create mode 100644 tests/spec/Discovery/Crm/Objects/Taxes/DiscoverySpec.php diff --git a/lib/Discovery/Cms/Discovery.php b/lib/Discovery/Cms/Discovery.php index 7bc33beb4..e1bf52ccb 100644 --- a/lib/Discovery/Cms/Discovery.php +++ b/lib/Discovery/Cms/Discovery.php @@ -15,6 +15,4 @@ * @method SourceCode\Discovery sourceCode() * @method UrlRedirects\Discovery urlRedirects() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Cms/Pages/Discovery.php b/lib/Discovery/Cms/Pages/Discovery.php index d4e61cbdc..494faacd8 100644 --- a/lib/Discovery/Cms/Pages/Discovery.php +++ b/lib/Discovery/Cms/Pages/Discovery.php @@ -7,9 +7,7 @@ use HubSpot\Discovery\DiscoveryBase; /** - * @method LandingPagesApi landingPagesApi() - * @method SitePagesApi sitePagesApi() + * @method LandingPagesApi landingPagesApi() + * @method SitePagesApi sitePagesApi() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Objects/Discovery.php b/lib/Discovery/Crm/Objects/Discovery.php index 7e26e5d7b..3ec8ec0df 100644 --- a/lib/Discovery/Crm/Objects/Discovery.php +++ b/lib/Discovery/Crm/Objects/Discovery.php @@ -26,6 +26,7 @@ * @method PublicObjectApi publicObjectApi() * @method SearchApi searchApi() * @method Tasks\Discovery tasks() + * @method Taxes\Discovery taxes() */ class Discovery extends DiscoveryBase { diff --git a/lib/Discovery/Crm/Objects/Taxes/Discovery.php b/lib/Discovery/Crm/Objects/Taxes/Discovery.php new file mode 100644 index 000000000..4f3c66503 --- /dev/null +++ b/lib/Discovery/Crm/Objects/Taxes/Discovery.php @@ -0,0 +1,28 @@ +config->convertToClientConfig(Configuration::class); + + return new GDPRApi($this->client, $config); + } +} diff --git a/tests/spec/Discovery/Crm/Objects/DiscoverySpec.php b/tests/spec/Discovery/Crm/Objects/DiscoverySpec.php index c00878b66..2a78e3628 100644 --- a/tests/spec/Discovery/Crm/Objects/DiscoverySpec.php +++ b/tests/spec/Discovery/Crm/Objects/DiscoverySpec.php @@ -19,6 +19,7 @@ use HubSpot\Discovery\Crm\Objects\Notes\Discovery as NotesDiscovery; use HubSpot\Discovery\Crm\Objects\PostalMail\Discovery as PostalMailDiscovery; use HubSpot\Discovery\Crm\Objects\Tasks\Discovery as TasksDiscovery; +use HubSpot\Discovery\Crm\Objects\Taxes\Discovery as TaxesDiscovery; use PhpSpec\ObjectBehavior; class DiscoverySpec extends ObjectBehavior @@ -49,5 +50,6 @@ public function it_creates_clients() $this->publicObjectApi()->shouldHaveType(PublicObjectApi::class); $this->searchApi()->shouldHaveType(SearchApi::class); $this->tasks()->shouldHaveType(TasksDiscovery::class); + $this->taxes()->shouldHaveType(TaxesDiscovery::class); } } diff --git a/tests/spec/Discovery/Crm/Objects/Taxes/DiscoverySpec.php b/tests/spec/Discovery/Crm/Objects/Taxes/DiscoverySpec.php new file mode 100644 index 000000000..0ff0c3475 --- /dev/null +++ b/tests/spec/Discovery/Crm/Objects/Taxes/DiscoverySpec.php @@ -0,0 +1,35 @@ +beConstructedWith($client, $config); + } + + public function it_is_initializable() + { + $this->shouldHaveType(Discovery::class); + } + + public function it_creates_clients() + { + $this->basicApi()->shouldHaveType(BasicApi::class); + $this->batchApi()->shouldHaveType(BatchApi::class); + $this->gdprApi()->shouldHaveType(GDPRApi::class); + $this->publicObjectApi()->shouldHaveType(PublicObjectApi::class); + $this->searchApi()->shouldHaveType(SearchApi::class); + } +} From 9af90f1d5873099cdd2fde200b5ca51e884a2881 Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Wed, 13 Dec 2023 13:04:36 +0300 Subject: [PATCH 4/6] add Goals --- lib/Discovery/Crm/Objects/Discovery.php | 1 + lib/Discovery/Crm/Objects/Goals/Discovery.php | 28 +++++++++++++++ .../Discovery/Crm/Objects/DiscoverySpec.php | 2 ++ .../Crm/Objects/Goals/DiscoverySpec.php | 35 +++++++++++++++++++ 4 files changed, 66 insertions(+) create mode 100644 lib/Discovery/Crm/Objects/Goals/Discovery.php create mode 100644 tests/spec/Discovery/Crm/Objects/Goals/DiscoverySpec.php diff --git a/lib/Discovery/Crm/Objects/Discovery.php b/lib/Discovery/Crm/Objects/Discovery.php index 3ec8ec0df..ad3e4528e 100644 --- a/lib/Discovery/Crm/Objects/Discovery.php +++ b/lib/Discovery/Crm/Objects/Discovery.php @@ -20,6 +20,7 @@ * @method GDPRApi gdprApi() * @method Emails\Discovery emails() * @method FeedbackSubmissions\Discovery feedbackSubmissions() + * @method Goals\Discovery goals() * @method Meetings\Discovery meetings() * @method Notes\Discovery notes() * @method PostalMail\Discovery postalMail() diff --git a/lib/Discovery/Crm/Objects/Goals/Discovery.php b/lib/Discovery/Crm/Objects/Goals/Discovery.php new file mode 100644 index 000000000..574329859 --- /dev/null +++ b/lib/Discovery/Crm/Objects/Goals/Discovery.php @@ -0,0 +1,28 @@ +config->convertToClientConfig(Configuration::class); + + return new GDPRApi($this->client, $config); + } +} diff --git a/tests/spec/Discovery/Crm/Objects/DiscoverySpec.php b/tests/spec/Discovery/Crm/Objects/DiscoverySpec.php index 2a78e3628..d88ac5832 100644 --- a/tests/spec/Discovery/Crm/Objects/DiscoverySpec.php +++ b/tests/spec/Discovery/Crm/Objects/DiscoverySpec.php @@ -15,6 +15,7 @@ use HubSpot\Discovery\Crm\Objects\Discovery; use HubSpot\Discovery\Crm\Objects\Emails\Discovery as EmailsDiscovery; use HubSpot\Discovery\Crm\Objects\FeedbackSubmissions\Discovery as FeedbackSubmissionsDiscovery; +use HubSpot\Discovery\Crm\Objects\Goals\Discovery as GoalsDiscovery; use HubSpot\Discovery\Crm\Objects\Meetings\Discovery as MeetingsDiscovery; use HubSpot\Discovery\Crm\Objects\Notes\Discovery as NotesDiscovery; use HubSpot\Discovery\Crm\Objects\PostalMail\Discovery as PostalMailDiscovery; @@ -44,6 +45,7 @@ public function it_creates_clients() $this->gdprApi()->shouldHaveType(GDPRApi::class); $this->emails()->shouldHaveType(EmailsDiscovery::class); $this->feedbackSubmissions()->shouldHaveType(FeedbackSubmissionsDiscovery::class); + $this->goals()->shouldHaveType(GoalsDiscovery::class); $this->meetings()->shouldHaveType(MeetingsDiscovery::class); $this->notes()->shouldHaveType(NotesDiscovery::class); $this->postalMail()->shouldHaveType(PostalMailDiscovery::class); diff --git a/tests/spec/Discovery/Crm/Objects/Goals/DiscoverySpec.php b/tests/spec/Discovery/Crm/Objects/Goals/DiscoverySpec.php new file mode 100644 index 000000000..aa77a3537 --- /dev/null +++ b/tests/spec/Discovery/Crm/Objects/Goals/DiscoverySpec.php @@ -0,0 +1,35 @@ +beConstructedWith($client, $config); + } + + public function it_is_initializable() + { + $this->shouldHaveType(Discovery::class); + } + + public function it_creates_clients() + { + $this->basicApi()->shouldHaveType(BasicApi::class); + $this->batchApi()->shouldHaveType(BatchApi::class); + $this->gdprApi()->shouldHaveType(GDPRApi::class); + $this->publicObjectApi()->shouldHaveType(PublicObjectApi::class); + $this->searchApi()->shouldHaveType(SearchApi::class); + } +} From 4c0e7f98cefb303e0dcf28cedcfdff2605618124 Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Wed, 13 Dec 2023 14:24:43 +0300 Subject: [PATCH 5/6] Events send --- lib/Discovery/Events/Discovery.php | 7 +++-- lib/Discovery/Events/Send/Discovery.php | 11 ++++++++ tests/spec/Discovery/Events/DiscoverySpec.php | 1 + .../Discovery/Events/Send/DiscoverySpec.php | 26 +++++++++++++++++++ 4 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 lib/Discovery/Events/Send/Discovery.php create mode 100644 tests/spec/Discovery/Events/Send/DiscoverySpec.php diff --git a/lib/Discovery/Events/Discovery.php b/lib/Discovery/Events/Discovery.php index c7bcac952..e6367ea05 100644 --- a/lib/Discovery/Events/Discovery.php +++ b/lib/Discovery/Events/Discovery.php @@ -6,8 +6,7 @@ use HubSpot\Discovery\DiscoveryBase; /** - * @method EventsApi eventsApi() + * @method EventsApi eventsApi() + * @method Send\Discovery send() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Events/Send/Discovery.php b/lib/Discovery/Events/Send/Discovery.php new file mode 100644 index 000000000..c612cf285 --- /dev/null +++ b/lib/Discovery/Events/Send/Discovery.php @@ -0,0 +1,11 @@ +eventsApi()->shouldHaveType(EventsApi::class); + $this->send()->shouldHaveType(\HubSpot\Discovery\Events\Send\Discovery::class); } } diff --git a/tests/spec/Discovery/Events/Send/DiscoverySpec.php b/tests/spec/Discovery/Events/Send/DiscoverySpec.php new file mode 100644 index 000000000..7ab2ccb9e --- /dev/null +++ b/tests/spec/Discovery/Events/Send/DiscoverySpec.php @@ -0,0 +1,26 @@ +beConstructedWith($client, $config); + } + + public function it_is_initializable() + { + $this->shouldHaveType(\HubSpot\Discovery\Events\Send\Discovery::class); + } + + public function it_creates_clients() + { + $this->behavioralEventsTrackingApi()->shouldHaveType(BehavioralEventsTrackingApi::class); + } +} From b434c7a21689dd3eadf44d81b14edbac4327e529 Mon Sep 17 00:00:00 2001 From: ksvirkou-hubspot Date: Wed, 13 Dec 2023 14:33:27 +0300 Subject: [PATCH 6/6] CRM Lists --- lib/Discovery/Crm/Discovery.php | 5 ++-- lib/Discovery/Crm/Lists/Discovery.php | 13 +++++++++ tests/spec/Discovery/Crm/DiscoverySpec.php | 1 + .../Discovery/Crm/Lists/DiscoverySpec.php | 28 +++++++++++++++++++ 4 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 lib/Discovery/Crm/Lists/Discovery.php create mode 100644 tests/spec/Discovery/Crm/Lists/DiscoverySpec.php diff --git a/lib/Discovery/Crm/Discovery.php b/lib/Discovery/Crm/Discovery.php index 0af22eede..d0db150fd 100644 --- a/lib/Discovery/Crm/Discovery.php +++ b/lib/Discovery/Crm/Discovery.php @@ -12,6 +12,7 @@ * @method Extensions\Discovery extensions() * @method Imports\Discovery imports() * @method LineItems\Discovery lineItems() + * @method Lists\Discovery lists() * @method Objects\Discovery objects() * @method Owners\Discovery owners() * @method Pipelines\Discovery pipelines() @@ -22,6 +23,4 @@ * @method Tickets\Discovery tickets() * @method Timeline\Discovery timeline() */ -class Discovery extends DiscoveryBase -{ -} +class Discovery extends DiscoveryBase {} diff --git a/lib/Discovery/Crm/Lists/Discovery.php b/lib/Discovery/Crm/Lists/Discovery.php new file mode 100644 index 000000000..d5f71f905 --- /dev/null +++ b/lib/Discovery/Crm/Lists/Discovery.php @@ -0,0 +1,13 @@ +extensions()->shouldHaveType(\HubSpot\Discovery\Crm\Extensions\Discovery::class); $this->imports()->shouldHaveType(\HubSpot\Discovery\Crm\Imports\Discovery::class); $this->lineItems()->shouldHaveType(\HubSpot\Discovery\Crm\LineItems\Discovery::class); + $this->lists()->shouldHaveType(\HubSpot\Discovery\Crm\Lists\Discovery::class); $this->objects()->shouldHaveType(\HubSpot\Discovery\Crm\Objects\Discovery::class); $this->owners()->shouldHaveType(\HubSpot\Discovery\Crm\Owners\Discovery::class); $this->pipelines()->shouldHaveType(\HubSpot\Discovery\Crm\Pipelines\Discovery::class); diff --git a/tests/spec/Discovery/Crm/Lists/DiscoverySpec.php b/tests/spec/Discovery/Crm/Lists/DiscoverySpec.php new file mode 100644 index 000000000..fc9267ecc --- /dev/null +++ b/tests/spec/Discovery/Crm/Lists/DiscoverySpec.php @@ -0,0 +1,28 @@ +beConstructedWith($client, $config); + } + + public function it_is_initializable() + { + $this->shouldHaveType(\HubSpot\Discovery\Crm\Lists\Discovery::class); + } + + public function it_creates_clients() + { + $this->listsApi()->shouldHaveType(ListsApi::class); + $this->membershipsApi()->shouldHaveType(MembershipsApi::class); + } +}