Skip to content

Latest commit

 

History

History
365 lines (236 loc) · 10.2 KB

sandbox-data-management-client.md

File metadata and controls

365 lines (236 loc) · 10.2 KB

Sandbox Data Management Client

SandboxDataManagementClient allows communication with sandbox-specific API operations. Sandbox is a controlled environment used for testing and managing mocked data without impacting the live systems. It's worth noting that the sandbox APIs have more lax constraints in the data than the live APIs; for example, creating a property with the live APIs requires an address whereas the sandbox API does not.

View the examples package for specific usages of the SandboxDataManagementClient.

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

ClientConfiguration config = ClientConfiguration
        .builder()
        .key("KEY")
        .secret("SECRET")
        .build();

SandboxDataManagementClient client = 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

ClientConfiguration config = ClientConfiguration
        .builder()
        .key("KEY")
        .secret("SECRET")
        .environment(ClientEnvironement.SANDBOX_TEST)
        .build();

Initialize GraphQL Operation

SandboxPropertiesQuery propertiesQuery = SandboxPropertiesQuery.builder().build();

Execute the operation

try {
    SandboxPropertiesQuery.Data propertiesData = client.execute(propertiesQuery);
}
catch(ExpediaGroupServiceException e) {
    e.printStackTrace();
}

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 Class Name: SandboxPropertiesQuery

Operation Inputs:

Name Type Required
cursor String No
pageSize Int No
skipReservations Boolean! = false No (default: false)

Resources


SandboxProperty

Summary: Retrieves a single property from the sandbox environment.

Operation Class Name: SandboxPropertyQuery

Operation Inputs:

Name Type Required
id ID! Yes
skipReservations Boolean! = false No (default: false)

Resources


SandboxReservation

Summary: Retrieves a single reservation

Operation Class Name: SandboxReservationQuery

Operation Inputs:

Name Type Description Required
id ID! Reservation ID Yes

Resources




SandboxDataManagementClient - Mutations


SandboxCancelReservation

Summary: Cancels a reservation

Operation Class Name: SandboxCancelReservationMutation

Operation Inputs:

Name Type Required
input CancelReservationInput! Yes

Resources


SandboxChangeReservationStayDates

Summary: Updates the stay dates of a reservation.

Operation Class Name: SandboxChangeReservationStayDatesMutation

Operation Inputs:

Name Type Required
input ChangeReservationStayDatesInput! Yes

Resources


SandboxCreateProperty

Summary: Creates a new property in the sandbox environment.

Operation Class Name: SandboxCreatePropertyMutation

Operation Inputs:

Name Type Required
input CreatePropertyInput! Yes

Resources


SandboxCreateReservation

Summary: Creates a new reservation on a sandbox property

Operation Class Name: SandboxCreateReservationMutation

Operation Inputs:

Name Type Required
input CreateReservationInput! Yes

Resources


SandboxDeleteProperty

Summary: Deletes sandbox property

Operation Class Name: SandboxDeletePropertyMutation

Operation Inputs:

Name Type Required
input DeletePropertyInput! Yes

Resources


SandboxDeletePropertyReservations

Summary: Deletes all sandbox property's reservations

Operation Class Name: SandboxDeletePropertyReservationsMutation

Operation Inputs:

Name Type Required
input DeletePropertyReservationsInput! Yes

Resources


SandboxDeleteReservation

Summary: Deletes a single reservation on a sandbox property

Operation Class Name: SandboxDeleteReservationMutation

Operation Inputs:

Name Type Required
input DeleteReservationInput! Yes

Resources


SandboxUpdateProperty

Summary: Updates sandbox property data.

Operation Class Name: SandboxUpdatePropertyMutation

Operation Inputs:

Name Type Required
input UpdatePropertyInput! Yes

Resources


SandboxUpdateReservation

Summary: Updates single reservation on a sandbox property.

Operation Class Name: SandboxUpdateReservationMutation

Operation Inputs:

Name Type Required
input UpdateReservationInput! Yes

Resources