forked from amabnl/amadeus-ws-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extracted Profile Endpoints from Pull Request amabnl#336 of the main …
…Repository refactored code, removed duplicates and removed IDE specific comments
- Loading branch information
Patrick Kilter
committed
Feb 2, 2020
1 parent
3d5c76c
commit eddff2e
Showing
13 changed files
with
287 additions
and
0 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
19 changes: 19 additions & 0 deletions
19
src/Amadeus/Client/RequestCreator/Converter/Profile/CreateProfileConv.php
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 Amadeus\Client\RequestCreator\Converter\Profile; | ||
use Amadeus\Client\RequestCreator\Converter\BaseConverter; | ||
use Amadeus\Client\RequestOptions\ProfileCreateProfileOptions; | ||
use Amadeus\Client\Struct; | ||
|
||
class CreateProfileConv extends BaseConverter | ||
{ | ||
/** | ||
* @param ProfileCreateProfileOptions $requestOptions | ||
* @param int|string $version | ||
* @return Struct\Profile\ProfileCreateProfile | ||
*/ | ||
public function convert($requestOptions, $version) | ||
{ | ||
return new Struct\Profile\ProfileCreateProfile($requestOptions); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/Amadeus/Client/RequestCreator/Converter/Profile/DeleteProfileConv.php
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 Amadeus\Client\RequestCreator\Converter\Profile; | ||
use Amadeus\Client\RequestCreator\Converter\BaseConverter; | ||
use Amadeus\Client\RequestOptions\ProfileDeleteProfileOptions; | ||
use Amadeus\Client\Struct; | ||
|
||
class DeleteProfileConv extends BaseConverter | ||
{ | ||
/** | ||
* @param ProfileDeleteProfileOptions $requestOptions | ||
* @param int|string $version | ||
* @return Struct\Profile\ProfileDeleteProfile | ||
*/ | ||
public function convert($requestOptions, $version) | ||
{ | ||
return new Struct\Profile\ProfileDeleteProfile($requestOptions); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Amadeus/Client/RequestCreator/Converter/Profile/ReadProfileConv.php
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,18 @@ | ||
<?php | ||
|
||
namespace Amadeus\Client\RequestCreator\Converter\Profile; | ||
use Amadeus\Client\RequestCreator\Converter\BaseConverter; | ||
use Amadeus\Client\RequestOptions\ProfileReadProfileOptions; | ||
use Amadeus\Client\Struct; | ||
class ReadProfileConv extends BaseConverter | ||
{ | ||
/** | ||
* @param ProfileReadProfileOptions $requestOptions | ||
* @param int|string $version | ||
* @return Struct\Profile\ProfileReadProfile | ||
*/ | ||
public function convert($requestOptions, $version) | ||
{ | ||
return new Struct\Profile\ProfileReadProfile($requestOptions); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/Amadeus/Client/RequestCreator/Converter/Profile/UpdateProfileConv.php
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 Amadeus\Client\RequestCreator\Converter\Profile; | ||
use Amadeus\Client\RequestCreator\Converter\BaseConverter; | ||
use Amadeus\Client\RequestOptions\ProfileUpdateProfileOptions; | ||
use Amadeus\Client\Struct; | ||
|
||
class UpdateProfileConv extends BaseConverter | ||
{ | ||
/** | ||
* @param ProfileUpdateProfileOptions $requestOptions | ||
* @param int|string $version | ||
* @return Struct\Profile\ProfileUpdateProfile | ||
*/ | ||
public function convert($requestOptions, $version) | ||
{ | ||
return new Struct\Profile\ProfileUpdateProfile($requestOptions); | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/Amadeus/Client/RequestOptions/ProfileCreateProfileOptions.php
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,12 @@ | ||
<?php | ||
|
||
namespace Amadeus\Client\RequestOptions; | ||
|
||
class ProfileCreateProfileOptions extends Base | ||
{ | ||
public $Version; | ||
public $UniqueID; | ||
public $Profile; | ||
public $CompanyName; | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
src/Amadeus/Client/RequestOptions/ProfileDeleteProfileOptions.php
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,11 @@ | ||
<?php | ||
|
||
namespace Amadeus\Client\RequestOptions; | ||
|
||
class ProfileDeleteProfileOptions extends Base | ||
{ | ||
public $Version; | ||
public $UniqueID; | ||
public $DeleteRequests; | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
src/Amadeus/Client/RequestOptions/ProfileReadProfileOptions.php
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,11 @@ | ||
<?php | ||
|
||
namespace Amadeus\Client\RequestOptions; | ||
|
||
class ProfileReadProfileOptions extends Base | ||
{ | ||
public $Version; | ||
public $UniqueID; | ||
public $ReadRequests; | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
src/Amadeus/Client/RequestOptions/ProfileUpdateProfileOptions.php
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,11 @@ | ||
<?php | ||
|
||
namespace Amadeus\Client\RequestOptions; | ||
|
||
class ProfileUpdateProfileOptions extends Base | ||
{ | ||
public $Position; | ||
public $UniqueID=[]; | ||
public $Version; | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
src/Amadeus/Client/Struct/Profile/ProfileCreateProfile.php
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,22 @@ | ||
<?php | ||
|
||
namespace Amadeus\Client\Struct\Profile; | ||
use Amadeus\Client\Struct\BaseWsMessage; | ||
|
||
class ProfileCreateProfile extends BaseWsMessage | ||
{ | ||
public $Version; | ||
public $UniqueID; | ||
public $Profile; | ||
public $CompanyName; | ||
|
||
public function __construct($options) | ||
{ | ||
if (!is_null($options)) { | ||
$this->Version= $options->Version; | ||
$this->UniqueID= $options->UniqueID; | ||
$this->Profile= $options->Profile; | ||
$this->CompanyName= $options->CompanyName; | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/Amadeus/Client/Struct/Profile/ProfileDeleteProfile.php
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,20 @@ | ||
<?php | ||
|
||
namespace Amadeus\Client\Struct\Profile; | ||
use Amadeus\Client\Struct\BaseWsMessage; | ||
|
||
class ProfileDeleteProfile extends BaseWsMessage | ||
{ | ||
public $Version; | ||
public $UniqueID; | ||
public $DeleteRequests; | ||
|
||
public function __construct($options) | ||
{ | ||
if (!is_null($options)) { | ||
$this->Version= $options->Version; | ||
$this->UniqueID= $options->UniqueID; | ||
$this->DeleteRequests= $options->DeleteRequests; | ||
} | ||
} | ||
} |
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,22 @@ | ||
<?php | ||
|
||
namespace Amadeus\Client\Struct\Profile; | ||
use Amadeus\Client\Struct\BaseWsMessage; | ||
class ProfileReadProfile extends BaseWsMessage | ||
{ | ||
public $Version; | ||
|
||
public $UniqueID; | ||
|
||
public $ReadRequests; | ||
|
||
|
||
public function __construct($options) | ||
{ | ||
if (!is_null($options)) { | ||
$this->Version= $options->Version; | ||
$this->UniqueID= $options->UniqueID; | ||
$this->ReadRequests= $options->ReadRequests; | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/Amadeus/Client/Struct/Profile/ProfileUpdateProfile.php
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,23 @@ | ||
<?php | ||
|
||
namespace Amadeus\Client\Struct\Profile; | ||
use Amadeus\Client\Struct\BaseWsMessage; | ||
|
||
class ProfileUpdateProfile extends BaseWsMessage | ||
{ | ||
public $Position; | ||
//public $Root; | ||
public $UniqueID=[]; | ||
public $Version; | ||
|
||
public function __construct($options) | ||
{ | ||
if (!is_null($options)) { | ||
foreach ($options as $propName => $propValue) { | ||
if (property_exists($this, $propName)) { | ||
$this->$propName = $propValue; | ||
} | ||
} | ||
} | ||
} | ||
} |