bookunited/aqc-client
最新稳定版本:0.0.13
Composer 安装命令:
composer require bookunited/aqc-client
包简介
A client library for the Amadeus Quick Connect API
README 文档
README
bookunited/aqc-client is a PHP client library for the Amadeus Quick Connect API.
This project is currently aligned with Flight Offers Search API v2.14.
Requirements
- PHP
^8.3 - Composer
Installation
composer require bookunited/aqc-client
Quick Start
<?php
use Amadeus\Client\Client;
use Amadeus\Client\Configuration;
use Amadeus\Model\Collections\ExtendedTravelerCollection;
use Amadeus\Model\Collections\OriginDestinationCollection;
use Amadeus\Model\Collections\SourceCollection;
use Amadeus\Model\Enums\Source;
use Amadeus\Model\Enums\TravelerType;
use Amadeus\Model\Values\Date;
use Amadeus\Model\Values\DateTimeRange;
use Amadeus\Model\Values\ExtendedTravelerInfo;
use Amadeus\Model\Values\GetFlightOffersBody;
use Amadeus\Model\Values\IATA;
use Amadeus\Model\Values\OriginDestination;
use Amadeus\Requests\FlightOffersSearchRequest;
use Ramsey\Uuid\Uuid;
$client = new Client(
configuration: new Configuration(
endpoint: 'https://test.travel.api.amadeus.com',
clientId: 'your-client-id',
clientSecret: 'your-client-secret',
),
cache: $yourCache,
);
$request = new FlightOffersSearchRequest(
clientReference: Uuid::uuid4(),
getFlightOffersBody: new GetFlightOffersBody(
originDestinations: new OriginDestinationCollection([
new OriginDestination(
id: 1,
originLocationCode: new IATA('AMS'),
destinationLocationCode: new IATA('JFK'),
departureDateTimeRange: new DateTimeRange(new Date('2026-07-01')),
),
]),
travelers: new ExtendedTravelerCollection([
new ExtendedTravelerInfo(id: 1, travelerType: TravelerType::ADULT),
]),
sources: new SourceCollection([Source::GDS]),
),
);
$response = $client->get($request);
Development
Run the full verification pipeline:
./develop composer run verify
This runs formatting, static analysis, tests, and mutation testing.
统计信息
- 总下载量: 689
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 3
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2024-08-07