-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Secondary and Secondary Count endpoints for the US Address Enri…
…chment API
- Loading branch information
1 parent
eae24e3
commit 84ff5b4
Showing
8 changed files
with
221 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace SmartyStreets\PhpSdk\US_Enrichment\Secondary; | ||
use SmartyStreets\PhpSdk\ArrayUtil; | ||
|
||
class AliasesEntry { | ||
//region [ Fields ] | ||
|
||
public $smartyKey, | ||
$primaryNumber, | ||
$streetPredirection, | ||
$streetName, | ||
$streetSuffix, | ||
$streetPostdirection, | ||
$cityName, | ||
$stateAbbreviation, | ||
$zipcode, | ||
$plus4Code; | ||
|
||
//endregion | ||
|
||
public function __construct($obj = null){ | ||
if ($obj == null) | ||
return; | ||
$this->smartyKey = ArrayUtil::setField($obj, "smarty_key"); | ||
$this->primaryNumber = ArrayUtil::setField($obj, "primary_number"); | ||
$this->streetPredirection = ArrayUtil::setField($obj, "street_predirection"); | ||
$this->streetName = ArrayUtil::setField($obj, "street_name"); | ||
$this->streetSuffix = ArrayUtil::setField($obj, "street_suffix"); | ||
$this->streetPostdirection = ArrayUtil::setField($obj, "street_postdirection"); | ||
$this->cityName = ArrayUtil::setField($obj, "city_name"); | ||
$this->stateAbbreviation = ArrayUtil::setField($obj, "state_abbreviation"); | ||
$this->zipcode = ArrayUtil::setField($obj, "zipcode"); | ||
$this->plus4Code = ArrayUtil::setField($obj, "plus4_code"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace SmartyStreets\PhpSdk\US_Enrichment\Secondary; | ||
use SmartyStreets\PhpSdk\ArrayUtil; | ||
|
||
class RootAddressEntry { | ||
//region [ Fields ] | ||
|
||
public $secondaryCount, | ||
$smartyKey, | ||
$primaryNumber, | ||
$streetPredirection, | ||
$streetName, | ||
$streetSuffix, | ||
$streetPostdirection, | ||
$cityName, | ||
$stateAbbreviation, | ||
$zipcode, | ||
$plus4Code; | ||
|
||
//endregion | ||
|
||
public function __construct($obj = null){ | ||
if ($obj == null) | ||
return; | ||
$this->secondaryCount = ArrayUtil::setField($obj, "secondary_count"); | ||
$this->smartyKey = ArrayUtil::setField($obj, "smarty_key"); | ||
$this->primaryNumber = ArrayUtil::setField($obj, "primary_number"); | ||
$this->streetPredirection = ArrayUtil::setField($obj, "street_predirection"); | ||
$this->streetName = ArrayUtil::setField($obj, "street_name"); | ||
$this->streetSuffix = ArrayUtil::setField($obj, "street_suffix"); | ||
$this->streetPostdirection = ArrayUtil::setField($obj, "street_postdirection"); | ||
$this->cityName = ArrayUtil::setField($obj, "city_name"); | ||
$this->stateAbbreviation = ArrayUtil::setField($obj, "state_abbreviation"); | ||
$this->zipcode = ArrayUtil::setField($obj, "zipcode"); | ||
$this->plus4Code = ArrayUtil::setField($obj, "plus4_code"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace SmartyStreets\PhpSdk\US_Enrichment\Secondary; | ||
use SmartyStreets\PhpSdk\ArrayUtil; | ||
|
||
class SecondariesEntry { | ||
//region [ Fields ] | ||
|
||
public $smartyKey, | ||
$secondaryDesignator, | ||
$secondaryNumber, | ||
$plus4Code; | ||
|
||
//endregion | ||
|
||
public function __construct($obj = null){ | ||
if ($obj == null) | ||
return; | ||
$this->smartyKey = ArrayUtil::setField($obj, "smarty_key"); | ||
$this->secondaryDesignator = ArrayUtil::setField($obj, "secondary_designator"); | ||
$this->secondaryNumber = ArrayUtil::setField($obj, "secondary_number"); | ||
$this->plus4Code = ArrayUtil::setField($obj, "plus4_code"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
namespace SmartyStreets\PhpSdk\US_Enrichment; | ||
|
||
use SmartyStreets\PhpSdk\ArrayUtil; | ||
|
||
require_once(dirname(dirname(__FILE__)) . '/US_Enrichment/Secondary/RootAddressEntry.php'); | ||
require_once(dirname(dirname(__FILE__)) . '/US_Enrichment/Secondary/AliasesEntry.php'); | ||
require_once(dirname(dirname(__FILE__)) . '/US_Enrichment/Secondary/SecondariesEntry.php'); | ||
|
||
use SmartyStreets\PhpSdk\US_Enrichment\Secondary\RootAddressEntry; | ||
use SmartyStreets\PhpSdk\US_Enrichment\Secondary\AliasesEntry; | ||
use SmartyStreets\PhpSdk\US_Enrichment\Secondary\SecondariesEntry; | ||
|
||
class SecondaryAttributes { | ||
|
||
//region [ Fields ] | ||
|
||
public $rootAddress, | ||
$aliases, | ||
$secondaries; | ||
|
||
//endregion | ||
|
||
public function __construct($obj = null) { | ||
if ($obj == null) | ||
return; | ||
$this->createRootAddress(ArrayUtil::setField($obj, "root_address")); | ||
$this->createAliases(ArrayUtil::setField($obj, "aliases")); | ||
$this->createSecondaries(ArrayUtil::setField($obj, "secondaries")); | ||
} | ||
|
||
private function createRootAddress($rootAddress){ | ||
$this->rootAddress = new RootAddressEntry($rootAddress); | ||
} | ||
|
||
private function createAliases($aliasesArray){ | ||
foreach($aliasesArray as $value){ | ||
$this->aliases = new AliasesEntry($value); | ||
} | ||
} | ||
|
||
private function createSecondaries($secondariesArray){ | ||
foreach($secondariesArray as $value){ | ||
$this->secondaries = new SecondariesEntry($value); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
namespace SmartyStreets\PhpSdk\US_Enrichment; | ||
|
||
use SmartyStreets\PhpSdk\ArrayUtil; | ||
|
||
class SecondaryCountAttributes { | ||
|
||
//region [ Fields ] | ||
|
||
public $count; | ||
|
||
//endregion | ||
|
||
public function __construct($obj = null) { | ||
if ($obj == null) | ||
return; | ||
$this->count = ArrayUtil::setField($obj, "count"); | ||
} | ||
} |