From 62c1e7a8bde78edc6d83c90361e5bf8d09e50d37 Mon Sep 17 00:00:00 2001 From: Ivan Vanderbyl Date: Mon, 28 Feb 2022 09:09:15 +0200 Subject: [PATCH] Link to GoDoc --- README.md | 114 ++++-------------------------------------------------- 1 file changed, 8 insertions(+), 106 deletions(-) diff --git a/README.md b/README.md index 52b6a3d..ede37c3 100644 --- a/README.md +++ b/README.md @@ -16,119 +16,21 @@ go get github.com/airheartdev/duffel See the [examples/\*](/examples/) directory -## Usage +## Getting Started -### func \(\*API\) CreateOfferRequest +The easiest way to get started, assuming you have a Duffel account set up and an API key ready, is to create an API instance and make your first request: ```go -func (a *API) CreateOfferRequest(ctx context.Context, requestInput OfferRequestInput) (*OfferRequest, error) -``` - -### func \(\*API\) CreateOrder - -```go -func (a *API) CreateOrder(ctx context.Context, input CreateOrderInput) (*Order, error) -``` - -CreateOrder creates a new order\. - -### func \(\*API\) GetAircraft - -```go -func (a *API) GetAircraft(ctx context.Context, id string) (*Aircraft, error) -``` - -### func \(\*API\) GetAirline - -```go -func (a *API) GetAirline(ctx context.Context, id string) (*Airline, error) -``` - -### func \(\*API\) GetAirport - -```go -func (a *API) GetAirport(ctx context.Context, id string) (*Airport, error) -``` - -### func \(\*API\) GetOffer - -```go -func (a *API) GetOffer(ctx context.Context, id string) (*Offer, error) -``` - -GetOffer gets a single offer by ID\. - -### func \(\*API\) GetOfferRequest - -```go -func (a *API) GetOfferRequest(ctx context.Context, id string) (*OfferRequest, error) -``` - -### func \(\*API\) GetOrder - -```go -func (a *API) GetOrder(ctx context.Context, id string) (*Order, error) -``` - -CreateOrder creates a new order\. - -### func \(\*API\) GetSeatmaps - -```go -func (a *API) GetSeatmaps(ctx context.Context, offerID string) *Iter[Seatmap] -``` - -### func \(\*API\) ListAircraft - -```go -func (a *API) ListAircraft(ctx context.Context, params ...ListAirportsParams) *Iter[Aircraft] -``` - -### func \(\*API\) ListAirlines - -```go -func (a *API) ListAirlines(ctx context.Context, params ...ListAirportsParams) *Iter[Airline] -``` - -### func \(\*API\) ListAirports - -```go -func (a *API) ListAirports(ctx context.Context, params ...ListAirportsParams) *Iter[Airport] -``` - -### func \(\*API\) ListOfferRequests - -```go -func (a *API) ListOfferRequests(ctx context.Context) *Iter[OfferRequest] -``` - -### func \(\*API\) ListOffers - -```go -func (a *API) ListOffers(ctx context.Context, offerRequestId string, options ...ListOffersParams) *Iter[Offer] -``` - -ListOffers lists all the offers for an offer request\. Returns an iterator\. - -### func \(\*API\) ListOrders - -```go -func (a *API) ListOrders(ctx context.Context, params ...ListOrdersParams) *Iter[Order] -``` - -### func \(\*API\) UpdateOfferPassenger - -```go -func (a *API) UpdateOfferPassenger(ctx context.Context, offerRequestID, passengerID string, input *PassengerUpdateInput) (*OfferRequestPassenger, error) +// Create a new client: +client := duffel.New(os.Getenv("DUFFEL_TOKEN")) ``` -UpdateOfferPassenger updates a single offer passenger\. +For available methods, see: -### func \(\*API\) UpdateOrder +- [Documentation](https://pkg.go.dev/github.com/airheartdev/duffel#section-documentation) +- [Duffel API reference](https://duffel.com/docs/api/overview/welcome) -```go -func (a *API) UpdateOrder(ctx context.Context, id string, params OrderUpdateParams) (*Order, error) -``` +And familiarise yourself with the implementation notes: ### Monetary amounts