Skip to content

Commit eddff2e

Browse files
author
Patrick Kilter
committed
extracted Profile Endpoints from Pull Request amabnl#336 of the main Repository
refactored code, removed duplicates and removed IDE specific comments
1 parent 3d5c76c commit eddff2e

13 files changed

+287
-0
lines changed

src/Amadeus/Client.php

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,6 +1527,86 @@ public function priceXplorerExtremeSearch(
15271527
return $this->callMessage($msgName, $options, $messageOptions);
15281528
}
15291529

1530+
/**
1531+
* Profile_ReadProfile
1532+
*
1533+
* @param RequestOptions\ProfileReadProfileOptions $options
1534+
* @param array $messageOptions (OPTIONAL)
1535+
* @return Result
1536+
* @throws Client\InvalidMessageException
1537+
* @throws Client\RequestCreator\MessageVersionUnsupportedException
1538+
* @throws Exception
1539+
*/
1540+
public function profileReadProfile(
1541+
RequestOptions\ProfileReadProfileOptions $options,
1542+
$messageOptions = []
1543+
)
1544+
{
1545+
$msgName = 'Profile_ReadProfile';
1546+
1547+
return $this->callMessage($msgName, $options, $messageOptions);
1548+
}
1549+
1550+
/**
1551+
* Profile_CreateProfile
1552+
*
1553+
* @param RequestOptions\ProfileCreateProfileOptions $options
1554+
* @param array $messageOptions (OPTIONAL)
1555+
* @return Result
1556+
* @throws Client\InvalidMessageException
1557+
* @throws Client\RequestCreator\MessageVersionUnsupportedException
1558+
* @throws Exception
1559+
*/
1560+
public function profileCreateProfile(
1561+
RequestOptions\ProfileCreateProfileOptions $options,
1562+
$messageOptions = []
1563+
)
1564+
{
1565+
$msgName = 'Profile_CreateProfile';
1566+
1567+
return $this->callMessage($msgName, $options, $messageOptions);
1568+
}
1569+
1570+
/**
1571+
* Profile_CreateProfile
1572+
*
1573+
* @param RequestOptions\ProfileDeleteProfileOptions $options
1574+
* @param array $messageOptions (OPTIONAL)
1575+
* @return Result
1576+
* @throws Client\InvalidMessageException
1577+
* @throws Client\RequestCreator\MessageVersionUnsupportedException
1578+
* @throws Exception
1579+
*/
1580+
public function profileDeleteProfile(
1581+
RequestOptions\ProfileDeleteProfileOptions $options,
1582+
$messageOptions = []
1583+
)
1584+
{
1585+
$msgName = 'Profile_DeleteProfile';
1586+
1587+
return $this->callMessage($msgName, $options, $messageOptions);
1588+
}
1589+
1590+
/**
1591+
* Profile_UpdateProfile
1592+
*
1593+
* @param RequestOptions\ProfileUpdateProfileOptions $options
1594+
* @param array $messageOptions (OPTIONAL)
1595+
* @return Result
1596+
* @throws Client\InvalidMessageException
1597+
* @throws Client\RequestCreator\MessageVersionUnsupportedException
1598+
* @throws Exception
1599+
*/
1600+
public function profileUpdateProfile(
1601+
RequestOptions\ProfileUpdateProfileOptions $options,
1602+
$messageOptions = []
1603+
)
1604+
{
1605+
$msgName = 'Profile_UpdateProfile';
1606+
1607+
return $this->callMessage($msgName, $options, $messageOptions);
1608+
}
1609+
15301610
/**
15311611
* SalesReports_DisplayQueryReport
15321612
*
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace Amadeus\Client\RequestCreator\Converter\Profile;
4+
use Amadeus\Client\RequestCreator\Converter\BaseConverter;
5+
use Amadeus\Client\RequestOptions\ProfileCreateProfileOptions;
6+
use Amadeus\Client\Struct;
7+
8+
class CreateProfileConv extends BaseConverter
9+
{
10+
/**
11+
* @param ProfileCreateProfileOptions $requestOptions
12+
* @param int|string $version
13+
* @return Struct\Profile\ProfileCreateProfile
14+
*/
15+
public function convert($requestOptions, $version)
16+
{
17+
return new Struct\Profile\ProfileCreateProfile($requestOptions);
18+
}
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace Amadeus\Client\RequestCreator\Converter\Profile;
4+
use Amadeus\Client\RequestCreator\Converter\BaseConverter;
5+
use Amadeus\Client\RequestOptions\ProfileDeleteProfileOptions;
6+
use Amadeus\Client\Struct;
7+
8+
class DeleteProfileConv extends BaseConverter
9+
{
10+
/**
11+
* @param ProfileDeleteProfileOptions $requestOptions
12+
* @param int|string $version
13+
* @return Struct\Profile\ProfileDeleteProfile
14+
*/
15+
public function convert($requestOptions, $version)
16+
{
17+
return new Struct\Profile\ProfileDeleteProfile($requestOptions);
18+
}
19+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
namespace Amadeus\Client\RequestCreator\Converter\Profile;
4+
use Amadeus\Client\RequestCreator\Converter\BaseConverter;
5+
use Amadeus\Client\RequestOptions\ProfileReadProfileOptions;
6+
use Amadeus\Client\Struct;
7+
class ReadProfileConv extends BaseConverter
8+
{
9+
/**
10+
* @param ProfileReadProfileOptions $requestOptions
11+
* @param int|string $version
12+
* @return Struct\Profile\ProfileReadProfile
13+
*/
14+
public function convert($requestOptions, $version)
15+
{
16+
return new Struct\Profile\ProfileReadProfile($requestOptions);
17+
}
18+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace Amadeus\Client\RequestCreator\Converter\Profile;
4+
use Amadeus\Client\RequestCreator\Converter\BaseConverter;
5+
use Amadeus\Client\RequestOptions\ProfileUpdateProfileOptions;
6+
use Amadeus\Client\Struct;
7+
8+
class UpdateProfileConv extends BaseConverter
9+
{
10+
/**
11+
* @param ProfileUpdateProfileOptions $requestOptions
12+
* @param int|string $version
13+
* @return Struct\Profile\ProfileUpdateProfile
14+
*/
15+
public function convert($requestOptions, $version)
16+
{
17+
return new Struct\Profile\ProfileUpdateProfile($requestOptions);
18+
}
19+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
namespace Amadeus\Client\RequestOptions;
4+
5+
class ProfileCreateProfileOptions extends Base
6+
{
7+
public $Version;
8+
public $UniqueID;
9+
public $Profile;
10+
public $CompanyName;
11+
12+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Amadeus\Client\RequestOptions;
4+
5+
class ProfileDeleteProfileOptions extends Base
6+
{
7+
public $Version;
8+
public $UniqueID;
9+
public $DeleteRequests;
10+
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Amadeus\Client\RequestOptions;
4+
5+
class ProfileReadProfileOptions extends Base
6+
{
7+
public $Version;
8+
public $UniqueID;
9+
public $ReadRequests;
10+
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
namespace Amadeus\Client\RequestOptions;
4+
5+
class ProfileUpdateProfileOptions extends Base
6+
{
7+
public $Position;
8+
public $UniqueID=[];
9+
public $Version;
10+
11+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace Amadeus\Client\Struct\Profile;
4+
use Amadeus\Client\Struct\BaseWsMessage;
5+
6+
class ProfileCreateProfile extends BaseWsMessage
7+
{
8+
public $Version;
9+
public $UniqueID;
10+
public $Profile;
11+
public $CompanyName;
12+
13+
public function __construct($options)
14+
{
15+
if (!is_null($options)) {
16+
$this->Version= $options->Version;
17+
$this->UniqueID= $options->UniqueID;
18+
$this->Profile= $options->Profile;
19+
$this->CompanyName= $options->CompanyName;
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)