com.google.android.libraries.places.api.model.kotlin

Top-level functions summary

AccessibilityOptions

Builds a new AccessibilityOptions.

AddressComponent
addressComponent(name: String, types: List<String>, actions: (AddressComponent.Builder.() -> Unit)?)

Builds a new AddressComponent.

AddressComponents

Builds a new AddressComponents.

AuthorAttribution

Builds a new AuthorAttribution.

AuthorAttributions

Returns an AuthorAttributions object using the provided authorAttributions list.

AutocompleteSessionToken

Builds a new AutocompleteSessionToken.

AutocompletePrediction

Builds a new AutocompletePrediction.

CircularBounds
circularBounds(center: LatLng, radius: Double)

Builds a new CircularBounds.

ConnectorAggregation
connectorAggregation(
    type: EVConnectorType,
    maxChargeRateKw: Double,
    count: Int,
    actions: (ConnectorAggregation.Builder.() -> Unit)?
)

Builds a new ConnectorAggregation.

EncodedPolyline
encodedPolyline(encodedPolyline: String)

Builds a new EncodedPolyline.

EVChargeOptions
evChargeOptions(
    connectorCount: Int,
    connectorAggregations: List<ConnectorAggregation>
)

Builds a new EVChargeOptions.

EVSearchOptions

Builds a new EVSearchOptions.

FuelOptions
fuelOptions(fuelPrices: List<FuelPrice>)

Builds a new FuelOptions.

FuelPrice
fuelPrice(type: FuelPrice.FuelType, price: Money, updateTime: Instant)

Builds a new FuelPrice.

Leg
leg(duration: Duration, distanceMeters: Int)

Builds a new Leg.

LocalDate
localDate(
    year: Int,
    month: @IntRange(from = 1, to = 12) Int,
    day: @IntRange(from = 1, to = 31) Int
)

Builds a new LocalDate.

LocalTime
localTime(
    hours: @IntRange(from = 0, to = 23) Int,
    minutes: @IntRange(from = 0, to = 59) Int
)

Builds a new LocalTime.

Money
money(currencyCode: String, units: Long, nanos: Int)

Builds a new Money.

inline OpeningHours

Builds a new OpeningHours.

ParkingOptions

Builds a new ParkingOptions.

PaymentOptions

Builds a new PaymentOptions.

inline Period
period(actions: Period.Builder.() -> Unit)

Builds a new Period.

PhotoMetadata
photoMetadata(photoReference: String, actions: (PhotoMetadata.Builder.() -> Unit)?)

Builds a new PhotoMetadata.

inline Place
place(actions: Place.Builder.() -> Unit)

Builds a new Place.

inline PlusCode
plusCode(actions: PlusCode.Builder.() -> Unit)

Builds a new PlusCode.

RectangularBounds

Builds a new RectangularBounds.

RectangularBounds
rectangularBounds(southwest: LatLng, northeast: LatLng)

Builds a new RectangularBounds.

Review
review(
    rating: Double,
    authorAttribution: AuthorAttribution,
    actions: (Review.Builder.() -> Unit)?
)

Builds a new Review.

RouteModifiers

Builds a new RouteModifiers.

RoutingParameters

Builds a new RoutingParameters.

RoutingSummary

Builds a new RoutingSummary.

SearchAlongRouteParameters

Builds a new SearchAlongRouteParameters.

SpecialDay
specialDay(date: LocalDate, actions: (SpecialDay.Builder.() -> Unit)?)

Builds a new SpecialDay.

SubDestination

Builds a new SubDestination.

TimeOfWeek
timeOfWeek(day: DayOfWeek, localTime: LocalTime, actions: (TimeOfWeek.Builder.() -> Unit)?)

Builds a new TimeOfWeek.

Top-level functions

accessibilityOptions

fun accessibilityOptions(actions: (AccessibilityOptions.Builder.() -> Unit)? = null): AccessibilityOptions

Builds a new AccessibilityOptions.

Parameters
actions: (AccessibilityOptions.Builder.() -> Unit)? = null

the actions to apply to the AccessibilityOptions.Builder

Returns
AccessibilityOptions

the constructed AccessibilityOptions

addressComponent

fun addressComponent(name: String, types: List<String>, actions: (AddressComponent.Builder.() -> Unit)? = null): AddressComponent

Builds a new AddressComponent.

Parameters
name: String

the name of this address component

types: List<String>

the types of this address component

actions: (AddressComponent.Builder.() -> Unit)? = null

the actions to apply to the AddressComponent.Builder

Returns
AddressComponent

the constructed AddressComponent

See also

Address types

addressComponents

fun addressComponents(addressComponents: List<AddressComponent>): AddressComponents

Builds a new AddressComponents.

Parameters
addressComponents: List<AddressComponent>

the list of address components

Returns
AddressComponents

the constructed AddressComponents

authorAttribution

fun authorAttribution(name: String, actions: (AuthorAttribution.Builder.() -> Unit)? = null): AuthorAttribution

Builds a new AuthorAttribution.

Parameters
name: String

the name of the author

actions: (AuthorAttribution.Builder.() -> Unit)? = null

the actions to apply to the AuthorAttribution.Builder

Returns
AuthorAttribution

the constructed AuthorAttribution

authorAttributions

fun authorAttributions(authorAttributions: List<AuthorAttribution>): AuthorAttributions

Returns an AuthorAttributions object using the provided authorAttributions list.

autocompletePrediction

fun autocompletePrediction(placeId: String, actions: (AutocompletePrediction.Builder.() -> Unit)? = null): AutocompletePrediction

Builds a new AutocompletePrediction.

Parameters
placeId: String

the place's ID

actions: (AutocompletePrediction.Builder.() -> Unit)? = null

the actions to apply to the AutocompletePrediction.Builder

circularBounds

fun circularBounds(center: LatLng, radius: Double): CircularBounds

Builds a new CircularBounds.

Parameters
center: LatLng

the center of the circle, specified by its latitude-longitude coordinates

radius: Double

the radius of the circle, measured in metrics

See https://developers.google.com/maps/documentation/places/web-service/search-textual#location-bias for more info about usage and limitations.

Returns
CircularBounds

the constructed CircularBounds

connectorAggregation

fun connectorAggregation(
    type: EVConnectorType,
    maxChargeRateKw: Double,
    count: Int,
    actions: (ConnectorAggregation.Builder.() -> Unit)? = null
): ConnectorAggregation

Builds a new ConnectorAggregation.

Parameters
type: EVConnectorType

the connector type of this aggregation

maxChargeRateKw: Double

the static max charging rate in kw of each connector in the aggregation

count: Int

the number of connectors in this aggregation

actions: (ConnectorAggregation.Builder.() -> Unit)? = null

the actions to apply to the ConnectorAggregation.Builder

Returns
ConnectorAggregation

the constructed ConnectorAggregation

encodedPolyline

fun encodedPolyline(encodedPolyline: String): EncodedPolyline

Builds a new EncodedPolyline.

Parameters
encodedPolyline: String

the encoded polyline in string format

Returns
EncodedPolyline

the constructed EncodedPolyline

evChargeOptions

fun evChargeOptions(
    connectorCount: Int,
    connectorAggregations: List<ConnectorAggregation>
): EVChargeOptions

Builds a new EVChargeOptions.

Parameters
connectorCount: Int

the number of connectors at this station

connectorAggregations: List<ConnectorAggregation>

the EV charging information grouped by connector type and max charge rate

Returns
EVChargeOptions

the constructed EVChargeOptions

evSearchOptions

fun evSearchOptions(actions: (EVSearchOptions.Builder.() -> Unit)? = null): EVSearchOptions

Builds a new EVSearchOptions.

Parameters
actions: (EVSearchOptions.Builder.() -> Unit)? = null

the actions to apply to the EVSearchOptions.Builder

Returns
EVSearchOptions

the constructed EVSearchOptions

fuelOptions

fun fuelOptions(fuelPrices: List<FuelPrice>): FuelOptions

Builds a new FuelOptions.

Parameters
fuelPrices: List<FuelPrice>

the last known fuel price for each type of fuel this station has

Returns
FuelOptions

the constructed FuelOptions

fuelPrice

fun fuelPrice(type: FuelPrice.FuelType, price: Money, updateTime: Instant): FuelPrice

Builds a new FuelPrice.

Parameters
type: FuelPrice.FuelType

the type of fuel

price: Money

the price of the fuel

updateTime: Instant

the time the fuel price was last updated

Returns
FuelPrice

the constructed FuelPrice

leg

fun leg(duration: Duration, distanceMeters: Int): Leg

Builds a new Leg.

Parameters
duration: Duration

the time it takes to finish this leg of the trip

distanceMeters: Int

the distance of this leg of the trip

Returns
Leg

the constructed Leg

localDate

fun localDate(
    year: Int,
    month: @IntRange(from = 1, to = 12) Int,
    day: @IntRange(from = 1, to = 31) Int
): LocalDate

Builds a new LocalDate.

Parameters
year: Int

the year field of the LocalDate

month: @IntRange(from = 1, to = 12) Int

the month field of the LocalDate

day: @IntRange(from = 1, to = 31) Int

the day field of the LocalDate

Returns
LocalDate

the constructed LocalDate

Throws
java.lang.IllegalArgumentException

If parameters are not within range: 1 <= month<= 12, 1 <= day<= 31, or if the day is not valid for the given month and year.

localTime

fun localTime(
    hours: @IntRange(from = 0, to = 23) Int,
    minutes: @IntRange(from = 0, to = 59) Int
): LocalTime

Builds a new LocalTime.

Parameters
hours: @IntRange(from = 0, to = 23) Int

the hours in 24 hour format (0 <= hours< 24)

minutes: @IntRange(from = 0, to = 59) Int

the minutes (0 <= minutes< 60)

Returns
LocalTime

the constructed LocalTime

Throws
java.lang.IllegalArgumentException

If parameters are not within range: 0 <= hours< 24, 0 <= minutes< 60, i.e. 00:00 to 23:59

money

fun money(currencyCode: String, units: Long, nanos: Int): Money

Builds a new Money.

Parameters
currencyCode: String

the three-letter currency code defined in ISO 4217

units: Long

the whole units of the amount

nanos: Int

the number of nano (1e-9) units of the amount

Returns
Money

the constructed Money

openingHours

inline fun openingHours(actions: OpeningHours.Builder.() -> Unit): OpeningHours

Builds a new OpeningHours.

Parameters
actions: OpeningHours.Builder.() -> Unit

the actions to apply to the OpeningHours.Builder

Returns
OpeningHours

the constructed OpeningHours

parkingOptions

fun parkingOptions(actions: (ParkingOptions.Builder.() -> Unit)? = null): ParkingOptions

Builds a new ParkingOptions.

Parameters
actions: (ParkingOptions.Builder.() -> Unit)? = null

the actions to apply to the ParkingOptions.Builder

Returns
ParkingOptions

the constructed ParkingOptions

paymentOptions

fun paymentOptions(actions: (PaymentOptions.Builder.() -> Unit)? = null): PaymentOptions

Builds a new PaymentOptions.

Parameters
actions: (PaymentOptions.Builder.() -> Unit)? = null

the actions to apply to the PaymentOptions.Builder

Returns
PaymentOptions

the constructed PaymentOptions

period

inline fun period(actions: Period.Builder.() -> Unit): Period

Builds a new Period.

Parameters
actions: Period.Builder.() -> Unit

the actions to apply to the Period.Builder

Returns
Period

the constructed Period

photoMetadata

fun photoMetadata(photoReference: String, actions: (PhotoMetadata.Builder.() -> Unit)? = null): PhotoMetadata

Builds a new PhotoMetadata.

Parameters
photoReference: String

the reference identifying the underlying photo

actions: (PhotoMetadata.Builder.() -> Unit)? = null

the actions to apply to the PhotoMetadata.Builder

Returns
PhotoMetadata

the constructed PhotoMetadata

place

inline fun place(actions: Place.Builder.() -> Unit): Place

Builds a new Place.

Parameters
actions: Place.Builder.() -> Unit

the actions to apply to the Place.Builder

Returns
Place

the constructed Place

plusCode

inline fun plusCode(actions: PlusCode.Builder.() -> Unit): PlusCode

Builds a new PlusCode.

Parameters
actions: PlusCode.Builder.() -> Unit

the actions to apply to the PlusCode.Builder

Returns
PlusCode

the constructed PlusCode

rectangularBounds

fun rectangularBounds(bounds: LatLngBounds): RectangularBounds

Builds a new RectangularBounds.

Parameters
bounds: LatLngBounds

the latitude/longitude aligned rectangle to apply to the RectangularBounds

Returns
RectangularBounds

the constructed RectangularBounds

rectangularBounds

fun rectangularBounds(southwest: LatLng, northeast: LatLng): RectangularBounds

Builds a new RectangularBounds.

Parameters
southwest: LatLng

the southwest corner of the RectangularBounds, specified by its latitude-longitude coordinates

northeast: LatLng

the northeast corner of the RectangularBounds, specified by its latitude-longitude coordinates

Returns
RectangularBounds

the constructed RectangularBounds

review

fun review(
    rating: Double,
    authorAttribution: AuthorAttribution,
    actions: (Review.Builder.() -> Unit)? = null
): Review

Builds a new Review.

Parameters
rating: Double

the rating of the review

authorAttribution: AuthorAttribution

the AuthorAttribution of the review

actions: (Review.Builder.() -> Unit)? = null

the actions to apply to the Review.Builder

Returns
Review

the constructed Review

routeModifiers

fun routeModifiers(actions: (RouteModifiers.Builder.() -> Unit)? = null): RouteModifiers

Builds a new RouteModifiers.

Parameters
actions: (RouteModifiers.Builder.() -> Unit)? = null

the actions to apply to the RouteModifiers.Builder

Returns
RouteModifiers

the constructed RouteModifiers

routingParameters

fun routingParameters(actions: (RoutingParameters.Builder.() -> Unit)? = null): RoutingParameters

Builds a new RoutingParameters.

Parameters
actions: (RoutingParameters.Builder.() -> Unit)? = null

the actions to apply to the RoutingParameters.Builder

Returns
RoutingParameters

the constructed RoutingParameters

routingSummary

fun routingSummary(legs: List<Leg>): RoutingSummary

Builds a new RoutingSummary.

Parameters
legs: List<Leg>

the legs of the trip

Returns
RoutingSummary

the constructed RoutingSummary

searchAlongRouteParameters

fun searchAlongRouteParameters(polyline: Polyline): SearchAlongRouteParameters

Builds a new SearchAlongRouteParameters.

Parameters
polyline: Polyline

the route to search along

specialDay

fun specialDay(date: LocalDate, actions: (SpecialDay.Builder.() -> Unit)? = null): SpecialDay

Builds a new SpecialDay.

Parameters
date: LocalDate

the LocalDate for which there may be exceptional hours

actions: (SpecialDay.Builder.() -> Unit)? = null

the actions to apply to the SpecialDay.Builder

Returns
SpecialDay

the constructed SpecialDay

subDestination

fun subDestination(id: String, name: String): SubDestination

Builds a new SubDestination.

Parameters
id: String

the id of the sub-destination

name: String

the resource name of the sub-destination

Returns
SubDestination

the constructed SubDestination

timeOfWeek

fun timeOfWeek(day: DayOfWeek, localTime: LocalTime, actions: (TimeOfWeek.Builder.() -> Unit)? = null): TimeOfWeek

Builds a new TimeOfWeek.

Parameters
day: DayOfWeek

the day of the week

localTime: LocalTime

the time in 24 hours format

actions: (TimeOfWeek.Builder.() -> Unit)? = null

the actions to apply to the TimeOfWeek.Builder

Returns
TimeOfWeek

the constructed TimeOfWeek