Skip to content

Commit

Permalink
Merge pull request #5 from larseijman/institutional-fund-endpoints
Browse files Browse the repository at this point in the history
Added institutional fund endpoints
  • Loading branch information
larseijman authored Mar 5, 2021
2 parents bcf9f0f + 13c4933 commit 0438db5
Show file tree
Hide file tree
Showing 33 changed files with 1,638 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Facades/InstitutionalFunds/Cik.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Leijman\FmpApiSdk\Facades\InstitutionalFunds;

use Illuminate\Support\Facades\Facade;

class Cik extends Facade
{
protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\InstitutionalFunds\Cik::class;
}
}
13 changes: 13 additions & 0 deletions src/Facades/InstitutionalFunds/CikList.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Leijman\FmpApiSdk\Facades\InstitutionalFunds;

use Illuminate\Support\Facades\Facade;

class CikList extends Facade
{
protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\InstitutionalFunds\CikList::class;
}
}
13 changes: 13 additions & 0 deletions src/Facades/InstitutionalFunds/CikSearch.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Leijman\FmpApiSdk\Facades\InstitutionalFunds;

use Illuminate\Support\Facades\Facade;

class CikSearch extends Facade
{
protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\InstitutionalFunds\CikSearch::class;
}
}
13 changes: 13 additions & 0 deletions src/Facades/InstitutionalFunds/CusipMapper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Leijman\FmpApiSdk\Facades\InstitutionalFunds;

use Illuminate\Support\Facades\Facade;

class CusipMapper extends Facade
{
protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\InstitutionalFunds\CusipMapper::class;
}
}
13 changes: 13 additions & 0 deletions src/Facades/InstitutionalFunds/EtfCountryWeightings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Leijman\FmpApiSdk\Facades\InstitutionalFunds;

use Illuminate\Support\Facades\Facade;

class EtfCountryWeightings extends Facade
{
protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\InstitutionalFunds\EtfCountryWeightings::class;
}
}
13 changes: 13 additions & 0 deletions src/Facades/InstitutionalFunds/EtfHolder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Leijman\FmpApiSdk\Facades\InstitutionalFunds;

use Illuminate\Support\Facades\Facade;

class EtfHolder extends Facade
{
protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\InstitutionalFunds\EtfHolder::class;
}
}
13 changes: 13 additions & 0 deletions src/Facades/InstitutionalFunds/EtfSectorWeightings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Leijman\FmpApiSdk\Facades\InstitutionalFunds;

use Illuminate\Support\Facades\Facade;

class EtfSectorWeightings extends Facade
{
protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\InstitutionalFunds\EtfSectorWeightings::class;
}
}
13 changes: 13 additions & 0 deletions src/Facades/InstitutionalFunds/Form13F.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Leijman\FmpApiSdk\Facades\InstitutionalFunds;

use Illuminate\Support\Facades\Facade;

class Form13F extends Facade
{
protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\InstitutionalFunds\Form13F::class;
}
}
13 changes: 13 additions & 0 deletions src/Facades/InstitutionalFunds/InstitutionalHolder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Leijman\FmpApiSdk\Facades\InstitutionalFunds;

use Illuminate\Support\Facades\Facade;

class InstitutionalHolder extends Facade
{
protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\InstitutionalFunds\InstitutionalHolder::class;
}
}
13 changes: 13 additions & 0 deletions src/Facades/InstitutionalFunds/MutualFundHolder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Leijman\FmpApiSdk\Facades\InstitutionalFunds;

use Illuminate\Support\Facades\Facade;

class MutualFundHolder extends Facade
{
protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\InstitutionalFunds\MutualFundHolder::class;
}
}
13 changes: 13 additions & 0 deletions src/Facades/InstitutionalFunds/SecRssFeed.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

namespace Leijman\FmpApiSdk\Facades\InstitutionalFunds;

use Illuminate\Support\Facades\Facade;

class SecRssFeed extends Facade
{
protected static function getFacadeAccessor()
{
return \Leijman\FmpApiSdk\InstitutionalFunds\SecRssFeed::class;
}
}
59 changes: 59 additions & 0 deletions src/InstitutionalFunds/Cik.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

namespace Leijman\FmpApiSdk\InstitutionalFunds;

use Leijman\FmpApiSdk\Contracts\Fmp;
use Leijman\FmpApiSdk\Exceptions\InvalidData;
use Leijman\FmpApiSdk\Requests\BaseRequest;

class Cik extends BaseRequest
{
const ENDPOINT = 'cik/{cik}';

/**
* @var string
*/
private $id;

/**
* Create constructor.
*
* @param Fmp $api
*/
public function __construct(Fmp $api)
{
parent::__construct($api);
}

/**
*
* @return string
*/
protected function getFullEndpoint(): string
{
return str_replace('{cik}', $this->id, self::ENDPOINT);
}

/**
* @param string $id
*
* @return Cik
*/
public function setCik(string $id): self
{
$this->id = $id;

return $this;
}

/**
* @return bool|void
* @throws InvalidData
*/
protected function validateParams(): void
{
if (empty($this->id)) {
throw InvalidData::invalidDataProvided('Please provide a CIK code to the query!');
}
}
}
30 changes: 30 additions & 0 deletions src/InstitutionalFunds/CikList.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

namespace Leijman\FmpApiSdk\InstitutionalFunds;

use Leijman\FmpApiSdk\Contracts\Fmp;
use Leijman\FmpApiSdk\Requests\BaseRequest;

class CikList extends BaseRequest
{
const ENDPOINT = 'cik_list';

/**
* Create constructor.
*
* @param Fmp $api
*/
public function __construct(Fmp $api)
{
parent::__construct($api);
}

/**
*
* @return string
*/
protected function getFullEndpoint(): string
{
return self::ENDPOINT;
}
}
59 changes: 59 additions & 0 deletions src/InstitutionalFunds/CikSearch.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

namespace Leijman\FmpApiSdk\InstitutionalFunds;

use Leijman\FmpApiSdk\Contracts\Fmp;
use Leijman\FmpApiSdk\Exceptions\InvalidData;
use Leijman\FmpApiSdk\Requests\BaseRequest;

class CikSearch extends BaseRequest
{
const ENDPOINT = 'cik-search/{name}';

/**
* @var string
*/
private $name;

/**
* Create constructor.
*
* @param Fmp $api
*/
public function __construct(Fmp $api)
{
parent::__construct($api);
}

/**
*
* @return string
*/
protected function getFullEndpoint(): string
{
return str_replace('{name}', $this->name, self::ENDPOINT);
}

/**
* @param string $name
*
* @return CikSearch
*/
public function setName(string $name): self
{
$this->name = $name;

return $this;
}

/**
* @return bool|void
* @throws InvalidData
*/
protected function validateParams(): void
{
if (empty($this->name)) {
throw InvalidData::invalidDataProvided('Please provide a name to the query!');
}
}
}
59 changes: 59 additions & 0 deletions src/InstitutionalFunds/CusipMapper.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

namespace Leijman\FmpApiSdk\InstitutionalFunds;

use Leijman\FmpApiSdk\Contracts\Fmp;
use Leijman\FmpApiSdk\Exceptions\InvalidData;
use Leijman\FmpApiSdk\Requests\BaseRequest;

class CusipMapper extends BaseRequest
{
const ENDPOINT = 'cusip/{cusip}';

/**
* @var string
*/
private $cusip;

/**
* Create constructor.
*
* @param Fmp $api
*/
public function __construct(Fmp $api)
{
parent::__construct($api);
}

/**
*
* @return string
*/
protected function getFullEndpoint(): string
{
return str_replace('{cusip}', $this->cusip, self::ENDPOINT);
}

/**
* @param string $cusip
*
* @return CusipMapper
*/
public function setCusip(string $cusip): self
{
$this->cusip = $cusip;

return $this;
}

/**
* @return bool|void
* @throws InvalidData
*/
protected function validateParams(): void
{
if (empty($this->cusip)) {
throw InvalidData::invalidDataProvided('Please provide a cusip to the query!');
}
}
}
Loading

0 comments on commit 0438db5

Please sign in to comment.