add

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

Adds the place as a personal location with the given types. If a personal location with the same name and place already exists, the existing personal location is updated with the new types and returned.

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 personal location is added 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 create and update methods.

Return

The added 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.