Skip to content

Latest commit

 

History

History
356 lines (231 loc) · 9.89 KB

sandbox-data-management-client.md

File metadata and controls

356 lines (231 loc) · 9.89 KB

Sandbox Client

SandboxDataManagementClient contains sandbox-specific API operations useful to manage sandbox datasets for testing purposes.

API Endpoint

This client is connected with https://api.sandbox.expediagroup.com/supply/lodging-sandbox/graphql endpoint by default.

You can refer to the configuration document to explore the full configuration options.

Initialize the Client

const config: ClientConfiguration = {
   key: 'YOUR_API_KEY',
   secret: 'YOUR_API_SECRET'
};

const sandboxClient = new SandboxDataManagementClient(config);

Set the Environment (Optional)

SandboxDataManagementClient can be configured to work in different environments, below is a list of the supported environments by this client:

Environment Corresponding API Endpoint
ClientEnvironment.SANDBOX_PROD https://api.sandbox.expediagroup.com/supply/lodging-sandbox/graphql
ClientEnvironment.SANDBOX_TEST https://test-api.sandbox.expediagroup.com/supply/lodging-sandbox/graphql

Configuration with Environment Example

const config: ClientConfiguration = {
   key: 'YOUR_API_KEY',
   secret: 'YOUR_API_SECRET',
   environment: ClientEnvironment.SANDBOX_TEST
};

Execute the operation

const sandboxPropertiesResponse = await sandboxClient.query({
    query: SandboxPropertiesDocument,
    variables: {
      skipReservations: true
    }
});

Available Operations

The SDK offers a set of queries & mutations you can execute using the SandboxDataManagementClient. Below is a list of the available operations.


SandboxDataManagementClient - Queries


SandboxProperties

Summary: Retrieves a paginated results of properties in the sandbox environment

Operation Document Name: SandboxPropertiesDocument

Operation Inputs:

Name Type Required
cursor String No
limit Int No
skipReservations Boolean! = false No (defaults false)

Resources


SandboxProperty

Summary: Retrieves a single property from the sandbox environment.

Operation Document Name: SandboxPropertyDocument

Operation Inputs:

Name Type Required
id ID! Yes
reservationsCursor String No
reservationsLimit Int No
skipReservations Boolean! = false No (defaults false)

Resources


SandboxReservation

Summary: Retrieves a single reservation

Operation Document Name: SandboxReservationDocument

Operation Inputs:

Name Type Description Required
id ID! Reservation ID Yes

Resources




SandboxDataManagementClient - Mutations


SandboxCancelReservation

Summary: Cancels a reservation

Operation Document Name: SandboxCancelReservationDocument

Operation Inputs:

Name Type Required
input CancelReservationInput! Yes

Resources


SandboxChangeReservationStayDates

Summary: Updates the stay dates of a reservation.

Operation Document Name: SandboxChangeReservationStayDatesDocument

Operation Inputs:

Name Type Required
input ChangeReservationStayDatesInput! Yes

Resources


SandboxCreateProperty

Summary: Creates a new property in the sandbox environment.

Operation Document Name: SandboxCreatePropertyDocument

Operation Inputs:

Name Type Required
input CreatePropertyInput! Yes

Resources


SandboxCreateReservation

Summary: Creates a new reservation on a sandbox property

Operation Document Name: SandboxCreateReservationDocument

Operation Inputs:

Name Type Required
input CreateReservationInput! Yes

Resources


SandboxDeleteProperty

Summary: Deletes sandbox property

Operation Document Name: SandboxDeletePropertyDocument

Operation Inputs:

Name Type Required
input DeletePropertyInput! Yes

Resources


SandboxDeletePropertyReservations

Summary: Deletes all sandbox property's reservations

Operation Document Name: SandboxDeletePropertyReservationsDocument

Operation Inputs:

Name Type Required
input DeletePropertyReservationsInput! Yes

Resources


SandboxDeleteReservation

Summary: Deletes a single reservation on a sandbox property

Operation Document Name: SandboxDeleteReservationDocument

Operation Inputs:

Name Type Required
input DeleteReservationInput! Yes

Resources


SandboxUpdateProperty

Summary: Updates sandbox property data.

Operation Document Name: SandboxUpdatePropertyDocument

Operation Inputs:

Name Type Required
input UpdatePropertyInput! Yes

Resources


SandboxUpdateReservation

Summary: Updates single reservation on a sandbox property.

Operation Document Name: SandboxUpdateReservationDocument

Operation Inputs:

Name Type Required
input UpdateReservationInput! Yes

Resources