Skip to content

Commit

Permalink
Merge pull request #287 from HubSpot/feature/newDiscoveries
Browse files Browse the repository at this point in the history
Discoveries for new clients
  • Loading branch information
ksvirkou-hubspot authored Dec 13, 2023
2 parents 62fc634 + b434c7a commit a9da954
Show file tree
Hide file tree
Showing 22 changed files with 302 additions and 17 deletions.
5 changes: 2 additions & 3 deletions lib/Discovery/Cms/Discovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
* @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()
* @method UrlRedirects\Discovery urlRedirects()
*/
class Discovery extends DiscoveryBase
{
}
class Discovery extends DiscoveryBase {}
13 changes: 13 additions & 0 deletions lib/Discovery/Cms/Pages/Discovery.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace HubSpot\Discovery\Cms\Pages;

use HubSpot\Client\Cms\Pages\Api\LandingPagesApi;
use HubSpot\Client\Cms\Pages\Api\SitePagesApi;
use HubSpot\Discovery\DiscoveryBase;

/**
* @method LandingPagesApi landingPagesApi()
* @method SitePagesApi sitePagesApi()
*/
class Discovery extends DiscoveryBase {}
5 changes: 2 additions & 3 deletions lib/Discovery/Crm/Discovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -22,6 +23,4 @@
* @method Tickets\Discovery tickets()
* @method Timeline\Discovery timeline()
*/
class Discovery extends DiscoveryBase
{
}
class Discovery extends DiscoveryBase {}
13 changes: 13 additions & 0 deletions lib/Discovery/Crm/Lists/Discovery.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace HubSpot\Discovery\Crm\Lists;

use HubSpot\Client\Crm\Lists\Api\ListsApi;
use HubSpot\Client\Crm\Lists\Api\MembershipsApi;
use HubSpot\Discovery\DiscoveryBase;

/**
* @method ListsApi listsApi()
* @method MembershipsApi membershipsApi()
*/
class Discovery extends DiscoveryBase {}
2 changes: 2 additions & 0 deletions lib/Discovery/Crm/Objects/Discovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
* @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()
* @method PublicObjectApi publicObjectApi()
* @method SearchApi searchApi()
* @method Tasks\Discovery tasks()
* @method Taxes\Discovery taxes()
*/
class Discovery extends DiscoveryBase
{
Expand Down
28 changes: 28 additions & 0 deletions lib/Discovery/Crm/Objects/Goals/Discovery.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace HubSpot\Discovery\Crm\Objects\Goals;

use HubSpot\Client\Crm\Objects\Goals\Api\BasicApi;
use HubSpot\Client\Crm\Objects\Goals\Api\BatchApi;
use HubSpot\Client\Crm\Objects\Goals\Api\GDPRApi;
use HubSpot\Client\Crm\Objects\Goals\Api\PublicObjectApi;
use HubSpot\Client\Crm\Objects\Goals\Api\SearchApi;
use HubSpot\Client\Crm\Objects\Goals\Configuration;
use HubSpot\Discovery\DiscoveryBase;

/**
* @method BasicApi basicApi()
* @method BatchApi batchApi()
* @method GDPRApi gdprApi()
* @method PublicObjectApi publicObjectApi()
* @method SearchApi searchApi()
*/
class Discovery extends DiscoveryBase
{
public function gdprApi()
{
$config = $this->config->convertToClientConfig(Configuration::class);

return new GDPRApi($this->client, $config);
}
}
28 changes: 28 additions & 0 deletions lib/Discovery/Crm/Objects/Taxes/Discovery.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace HubSpot\Discovery\Crm\Objects\Taxes;

use HubSpot\Client\Crm\Objects\Taxes\Api\BasicApi;
use HubSpot\Client\Crm\Objects\Taxes\Api\BatchApi;
use HubSpot\Client\Crm\Objects\Taxes\Api\GDPRApi;
use HubSpot\Client\Crm\Objects\Taxes\Api\PublicObjectApi;
use HubSpot\Client\Crm\Objects\Taxes\Api\SearchApi;
use HubSpot\Client\Crm\Objects\Taxes\Configuration;
use HubSpot\Discovery\DiscoveryBase;

/**
* @method BasicApi basicApi()
* @method BatchApi batchApi()
* @method GDPRApi gdprApi()
* @method PublicObjectApi publicObjectApi()
* @method SearchApi searchApi()
*/
class Discovery extends DiscoveryBase
{
public function gdprApi()
{
$config = $this->config->convertToClientConfig(Configuration::class);

return new GDPRApi($this->client, $config);
}
}
7 changes: 3 additions & 4 deletions lib/Discovery/Events/Discovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
11 changes: 11 additions & 0 deletions lib/Discovery/Events/Send/Discovery.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace HubSpot\Discovery\Events\Send;

use HubSpot\Client\Events\Send\Api\BehavioralEventsTrackingApi;
use HubSpot\Discovery\DiscoveryBase;

/**
* @method BehavioralEventsTrackingApi behavioralEventsTrackingApi()
*/
class Discovery extends DiscoveryBase {}
11 changes: 11 additions & 0 deletions lib/Discovery/Settings/BusinessUnits/Discovery.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

namespace HubSpot\Discovery\Settings\BusinessUnits;

use HubSpot\Client\Settings\BusinessUnits\Api\BusinessUnitApi;
use HubSpot\Discovery\DiscoveryBase;

/**
* @method BusinessUnitApi businessUnitApi()
*/
class Discovery extends DiscoveryBase {}
7 changes: 3 additions & 4 deletions lib/Discovery/Settings/Discovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
use HubSpot\Discovery\DiscoveryBase;

/**
* @method Users\Discovery users()
* @method BusinessUnits\Discovery businessUnits()
* @method Users\Discovery users()
*/
class Discovery extends DiscoveryBase
{
}
class Discovery extends DiscoveryBase {}
4 changes: 1 addition & 3 deletions lib/Discovery/Settings/Users/Discovery.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@
* @method TeamsApi teamsApi()
* @method UsersApi usersApi()
*/
class Discovery extends DiscoveryBase
{
}
class Discovery extends DiscoveryBase {}
1 change: 1 addition & 0 deletions tests/spec/Discovery/Cms/DiscoverySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function it_creates_clients()
$this->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);
Expand Down
28 changes: 28 additions & 0 deletions tests/spec/Discovery/Cms/Pages/DiscoverySpec.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace spec\HubSpot\Discovery\Cms\Pages;

use GuzzleHttp\Client;
use HubSpot\Client\Cms\Pages\Api\LandingPagesApi;
use HubSpot\Client\Cms\Pages\Api\SitePagesApi;
use HubSpot\Config;
use PhpSpec\ObjectBehavior;

class DiscoverySpec extends ObjectBehavior
{
public function let(Client $client, Config $config)
{
$this->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);
}
}
1 change: 1 addition & 0 deletions tests/spec/Discovery/Crm/DiscoverySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function it_creates_clients()
$this->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);
Expand Down
28 changes: 28 additions & 0 deletions tests/spec/Discovery/Crm/Lists/DiscoverySpec.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace spec\HubSpot\Discovery\Crm\Lists;

use GuzzleHttp\Client;
use HubSpot\Client\Crm\Lists\Api\ListsApi;
use HubSpot\Client\Crm\Lists\Api\MembershipsApi;
use HubSpot\Config;
use PhpSpec\ObjectBehavior;

class DiscoverySpec extends ObjectBehavior
{
public function let(Client $client, Config $config)
{
$this->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);
}
}
4 changes: 4 additions & 0 deletions tests/spec/Discovery/Crm/Objects/DiscoverySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
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;
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
Expand All @@ -43,11 +45,13 @@ 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);
$this->publicObjectApi()->shouldHaveType(PublicObjectApi::class);
$this->searchApi()->shouldHaveType(SearchApi::class);
$this->tasks()->shouldHaveType(TasksDiscovery::class);
$this->taxes()->shouldHaveType(TaxesDiscovery::class);
}
}
35 changes: 35 additions & 0 deletions tests/spec/Discovery/Crm/Objects/Goals/DiscoverySpec.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace spec\HubSpot\Discovery\Crm\Objects\Goals;

use GuzzleHttp\Client;
use HubSpot\Client\Crm\Objects\Goals\Api\BasicApi;
use HubSpot\Client\Crm\Objects\Goals\Api\BatchApi;
use HubSpot\Client\Crm\Objects\Goals\Api\GDPRApi;
use HubSpot\Client\Crm\Objects\Goals\Api\PublicObjectApi;
use HubSpot\Client\Crm\Objects\Goals\Api\SearchApi;
use HubSpot\Config;
use HubSpot\Discovery\Crm\Objects\Goals\Discovery;
use PhpSpec\ObjectBehavior;

class DiscoverySpec extends ObjectBehavior
{
public function let(Client $client, Config $config)
{
$this->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);
}
}
35 changes: 35 additions & 0 deletions tests/spec/Discovery/Crm/Objects/Taxes/DiscoverySpec.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace spec\HubSpot\Discovery\Crm\Objects\Taxes;

use GuzzleHttp\Client;
use HubSpot\Client\Crm\Objects\Taxes\Api\BasicApi;
use HubSpot\Client\Crm\Objects\Taxes\Api\BatchApi;
use HubSpot\Client\Crm\Objects\Taxes\Api\GDPRApi;
use HubSpot\Client\Crm\Objects\Taxes\Api\PublicObjectApi;
use HubSpot\Client\Crm\Objects\Taxes\Api\SearchApi;
use HubSpot\Config;
use HubSpot\Discovery\Crm\Objects\Taxes\Discovery;
use PhpSpec\ObjectBehavior;

class DiscoverySpec extends ObjectBehavior
{
public function let(Client $client, Config $config)
{
$this->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);
}
}
1 change: 1 addition & 0 deletions tests/spec/Discovery/Events/DiscoverySpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ public function it_is_initializable()
public function it_creates_clients()
{
$this->eventsApi()->shouldHaveType(EventsApi::class);
$this->send()->shouldHaveType(\HubSpot\Discovery\Events\Send\Discovery::class);
}
}
26 changes: 26 additions & 0 deletions tests/spec/Discovery/Events/Send/DiscoverySpec.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

namespace spec\HubSpot\Discovery\Events\Send;

use GuzzleHttp\Client;
use HubSpot\Client\Events\Send\Api\BehavioralEventsTrackingApi;
use HubSpot\Config;
use PhpSpec\ObjectBehavior;

class DiscoverySpec extends ObjectBehavior
{
public function let(Client $client, Config $config)
{
$this->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);
}
}
Loading

0 comments on commit a9da954

Please sign in to comment.