create

fun create(types: Set<PersonalLocationType>, place: Place, name: String = "", hasPrivateCharger: Boolean = false): PersonalLocation

Creates a new personal location with the given types.

Important: This is a Public Preview API. It may be changed or removed at any time.

This method ensures the uniqueness of PersonalLocationType.Home and PersonalLocationType.Work types. When a new personal location is created with one of these types, any existing location of the same type will have its type removed to maintain this uniqueness constraint. This behavior is also implemented in the add and update methods.

Return

The newly created personal location.

Parameters

types

The types of the personal location. Is required to be non-empty, otherwise the method throws an IllegalArgumentException.

place

The place for which a personal location is created.

name

The name of the personal location.

hasPrivateCharger

Whether the personal location has a private charger.