Manage Spaces

Pre-requisite: The user has to be signed in to perform the following operations.


Create Space

To create a space, you need to provide the following details:

  • request (required): The space information.
val address = Address(
  street = "123 Main St", // The street address
  city = "San Francisco", // The city
  state = "CA", // The state
  postalCode = "94105", // The postal code
  country = "US" // The country
)
val request = CreateSpaceRequest(
  name = "My Space", // The name of the space
  address = address, // The address of the space
)
InstaVision.spaceServices.createSpace(
  request = request,
  onSuccess = { space ->
    // The space object contains the space information of the new created space.
  },
  onError = { error ->
    // The error object contains the error code and message
  },
)

Get Spaces

To get the list of spaces, the following method can be called.

InstaVision.spaceServices.getSpaces(
  onSuccess = { spaces ->
    // The list of spaces is returned
  },
  onError = { error ->
    // The error object contains the error code and message
  }
)

Update Space

To update the space information, the following method can be called.

  • spaceId (required): The id of the space.
  • request (required): The updated space information.
val updatedSpace = UpdateSpaceRequest(
  name = "New Space Name" // The updated name of the space
)
InstaVision.spaceServices.updateSpace(
  spaceId = "spaceId",
  request = updatedSpace,
  onSuccess = { space ->
    // The space object contains the updated space information
  },
  onError = { error ->
    // The error object contains the error code and message
  }
)