Skip to content

Commit

Permalink
Merge 8ecfe38 into 28f9fdd
Browse files Browse the repository at this point in the history
  • Loading branch information
amonger committed May 15, 2017
2 parents 28f9fdd + 8ecfe38 commit 9e74f53
Show file tree
Hide file tree
Showing 7 changed files with 255 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/Groups/OverseasAddress.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
* This file contains the Address Group model class.
*
* @package Frozensheep\RightmoveADF
* @author Jacob Wyke <jacob@frozensheep.com>
* @license MIT
*
*/

namespace Frozensheep\RightmoveADF\Groups;

use Frozensheep\RightmoveADF\Groups\GroupInterface;
use Frozensheep\Synthesize\Synthesizer;

/**
* Address Group Class
*
* Class to handle Address group.
*
* @package Frozensheep\RightmoveADF
*
*/
class OverseasAddress implements GroupInterface, \JsonSerializable {

use Synthesizer;

protected $arrSynthesize = array(
'country_code' => array('type' => 'string', 'required' => true, 'max' => 2),
'region' => array('type' => 'string', 'max' => 120),
'sub_region' => array('type' => 'string', 'max' => 120),
'town_city' => array('type' => 'string', 'max' => 120),
'latitude' => array('type' => 'float', 'max' => 90.0, 'min' => -90.0),
'longitude' => array('type' => 'float', 'max' => 180.0, 'min' => -180.0)
);
}
31 changes: 31 additions & 0 deletions src/Groups/OverseasBranch.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
* This file contains the Network Group model class.
*
* @package Frozensheep\RightmoveADF
* @author Jacob Wyke <jacob@frozensheep.com>
* @license MIT
*
*/

namespace Frozensheep\RightmoveADF\Groups;

use Frozensheep\RightmoveADF\Groups\GroupInterface;
use Frozensheep\Synthesize\Synthesizer;

/**
* Network Group Class
*
* Class to handle Network group.
*
* @package Frozensheep\RightmoveADF
*
*/
class OverseasBranch implements GroupInterface, \JsonSerializable {

use Synthesizer;

protected $arrSynthesize = array(
'branch_id' => array('type' => 'int', 'required' => true)
);
}
54 changes: 54 additions & 0 deletions src/Groups/OverseasDetails.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?php
/**
* This file contains the Details Group model class.
*
* @package Frozensheep\RightmoveADF
* @author Jacob Wyke <jacob@frozensheep.com>
* @license MIT
*
*/

namespace Frozensheep\RightmoveADF\Groups;

use Frozensheep\RightmoveADF\Groups\GroupInterface;
use Frozensheep\Synthesize\Synthesizer;
use Frozensheep\RightmoveADF\Values\Parkings;
use Frozensheep\RightmoveADF\Values\OutsideSpaces;
use Frozensheep\RightmoveADF\Values\AreaUnits;
use Frozensheep\RightmoveADF\Values\EntranceFloors;
use Frozensheep\RightmoveADF\Values\Conditions;
use Frozensheep\RightmoveADF\Values\Accessibilities;
use Frozensheep\RightmoveADF\Values\Heatings;
use Frozensheep\RightmoveADF\Values\Furnishings;
use Frozensheep\RightmoveADF\Values\CommercialuseClasses;
use Frozensheep\RightmoveADF\Groups\Room;

/**
* Details Group Class
*
* Class to handle Details group.
*
* @package Frozensheep\RightmoveADF
*
*/
class OverseasDetails implements GroupInterface, \JsonSerializable {

use Synthesizer;

protected $arrSynthesize = array(
'summary' => array('type' => 'string', 'required' => true, 'max' => 1000),
'description' => array('type' => 'string', 'required' => true, 'max' => 32000),
'features' => array('type' => 'objectarray', 'class' => 'Frozensheep\Synthesize\Type\StringObject', 'max' => 10),
'bedrooms' => array('type' => 'int', 'required' => true, 'min' => 0),
'bathrooms' => array('type' => 'int', 'min' => 0),
'reception_rooms' => array('type' => 'int', 'min' => 0),
'parking' => array('type' => 'objectarray', 'class' => 'Frozensheep\RightmoveADF\Values\Parkings'),
'outside_space' => array('type' => 'objectarray', 'class' => 'Frozensheep\RightmoveADF\Values\OutsideSpaces'),
'year_built' => array('type' => 'int'),
'internal_area' => array('type' => 'number'),
'internal_area_unit' => array('type' => 'enum', 'class' => 'Frozensheep\RightmoveADF\Values\AreaUnits'),
'land_area' => array('type' => 'number'),
'land_area_unit' => array('type' => 'enum', 'class' => 'Frozensheep\RightmoveADF\Values\AreaUnits'),
'floors' => array('type' => 'number')
);
}
35 changes: 35 additions & 0 deletions src/Groups/OverseasPrice.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
/**
* This file contains the Price Group model class.
*
* @package Frozensheep\RightmoveADF
* @author Jacob Wyke <jacob@frozensheep.com>
* @license MIT
*
*/

namespace Frozensheep\RightmoveADF\Groups;

use Frozensheep\RightmoveADF\Groups\GroupInterface;
use Frozensheep\Synthesize\Synthesizer;
use Frozensheep\RightmoveADF\Values\PriceQualifiers;
use Frozensheep\RightmoveADF\Values\RentFrequencies;
use Frozensheep\RightmoveADF\Values\TenureTypes;

/**
* Price Group Class
*
* Class to handle Price group.
*
* @package Frozensheep\RightmoveADF
*
*/
class OverseasPrice implements GroupInterface, \JsonSerializable {

use Synthesizer;

protected $arrSynthesize = array(
'price' => array('type' => 'number', 'required' => true, 'min' => 1),
'os_price_qualifier' => array('type' => 'enum', 'class' => 'Frozensheep\RightmoveADF\Values\PriceQualifiers')
);
}
48 changes: 48 additions & 0 deletions src/Groups/OverseasProperty.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?php
/**
* This file contains the Property Group model class.
*
* @package Frozensheep\RightmoveADF
* @author Jacob Wyke <jacob@frozensheep.com>
* @license MIT
*
*/

namespace Frozensheep\RightmoveADF\Groups;

use Frozensheep\RightmoveADF\Groups\GroupInterface;
use Frozensheep\Synthesize\Synthesizer;
use Frozensheep\RightmoveADF\Groups\Address;
use Frozensheep\RightmoveADF\Groups\Price;
use Frozensheep\RightmoveADF\Groups\Details;
use Frozensheep\RightmoveADF\Groups\Principal;
use Frozensheep\RightmoveADF\Values\PropertyTypes;
use Frozensheep\RightmoveADF\Values\Statuses;
use Frozensheep\RightmoveADF\Values\LetTypes;

/**
* Property Group Class
*
* Class to handle Property group.
*
* @package Frozensheep\RightmoveADF
*
*/
class OverseasProperty implements GroupInterface, \JsonSerializable {

use Synthesizer;

protected $arrSynthesize = array(
'agent_ref' => array('type' => 'string', 'required' => true, 'max' => 80),
'published' => array('type' => 'boolean', 'required' => true),
'property_type' => array('type' => 'enum', 'class' => 'Frozensheep\RightmoveADF\Values\PropertyTypes', 'required' => true),
'os_status' => array('type' => 'enum', 'class' => 'Frozensheep\RightmoveADF\Values\Statuses', 'required' => true),
'new_home' => array('type' => 'boolean'),
'address' => array('type' => 'object', 'class' => 'Frozensheep\RightmoveADF\Groups\OverseasAddress', 'required' => true),
'price_information' => array('type' => 'object', 'class' => 'Frozensheep\RightmoveADF\Groups\OverseasPrice', 'required' => true),
'details' => array('type' => 'object', 'class' => 'Frozensheep\RightmoveADF\Groups\OverseasDetails', 'required' => true),
'media' => array('type' => 'objectarray', 'class' => 'Frozensheep\RightmoveADF\Groups\Media', 'max' => 999),
'create_date' => array('type' => 'datetime', 'format' => 'd-m-Y H:i:s', 'autoinit' => false),
'update_date' => array('type' => 'datetime', 'format' => 'd-m-Y H:i:s', 'autoinit' => false)
);
}
46 changes: 46 additions & 0 deletions src/Groups/SendOverseasProperty.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php
/**
* This file contains the Send Property Request class.
*
* @package Frozensheep\RightmoveADF
* @author Jacob Wyke <jacob@frozensheep.com>
* @license MIT
*
*/

namespace Frozensheep\RightmoveADF\Request;

use Frozensheep\RightmoveADF\Request\RequestBase;
use Frozensheep\RightmoveADF\Groups\Network;
use Frozensheep\RightmoveADF\Groups\Branch;
use Frozensheep\RightmoveADF\Groups\Property;

/**
* Send Property Class
*
* Class for the send property request.
*
* @package Frozensheep\RightmoveADF
*
*/
class SendOverseasProperty extends RequestBase {

/**
* @var string $_strLiveURL The live request URL.
*/
protected $_strLiveURL = 'https://adfapi.rightmove.co.uk/v1/property/overseassendpropertydetails';

/**
* @var string $_strTestURL The test request URL.
*/
protected $_strTestURL = 'https://adfapi.adftest.rightmove.com/v1/property/overseassendpropertydetails';

/**
* @var array $arrSynthesize The synthesize array.
*/
protected $arrSynthesize = array(
'network' => array('type' => 'object', 'class' => 'Frozensheep\RightmoveADF\Groups\Network', 'required' => true),
'branch' => array('type' => 'object', 'class' => 'Frozensheep\RightmoveADF\Groups\OverseasBranch', 'required' => true),
'property' => array('type' => 'object', 'class' => 'Frozensheep\RightmoveADF\Groups\OverseasProperty', 'required' => true)
);
}
5 changes: 5 additions & 0 deletions src/RightmoveADF.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace Frozensheep\RightmoveADF;

use Frozensheep\RightmoveADF\Request\SendOverseasProperty;
use Frozensheep\Synthesize\Synthesizer;
use Frozensheep\RightmoveADF\Exception\UnknownRequestTypeException;
use Frozensheep\RightmoveADF\Curl;
Expand Down Expand Up @@ -56,6 +57,7 @@ class RightmoveADF {
const GetBrandPhoneLeads = 11;
const GetBranchPhoneLeads = 12;
const GetPropertyEmails = 13;
const SendOverseasProperty = 14;

/**
* @var array $arrSynthesize The synthesize array.
Expand Down Expand Up @@ -93,6 +95,9 @@ public static function createRequest($numRequestType){
case RightmoveADF::SendProperty:
return new SendProperty();
break;
case RightmoveADF::SendOverseasProperty:
return new SendOverseasProperty();
break;
case RightmoveADF::RemoveProperty:
return new RemoveProperty();
break;
Expand Down

0 comments on commit 9e74f53

Please sign in to comment.