Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type Access
- type Address
- type AreaListParams
- type AreaListResponse
- type AreaService
- type AssetDetails
- type AssetDetailsLatestLocation
- type AssetDetailsLatestLocationLocation
- type AutocompleteService
- type AutocompleteSuggestParams
- type AutocompleteSuggestResponse
- type AutocompleteSuggestResponseItem
- type AutocompleteSuggestResponseItemOpeningHours
- type AutocompleteSuggestResponseItemOpeningHoursTimeRange
- type AutocompleteSuggestResponseItemOpeningHoursTimeRangeEndTime
- type AutocompleteSuggestResponseItemOpeningHoursTimeRangeStartTime
- type AutocompleteSuggestResponseItemScoring
- type AutosuggestService
- type AutosuggestSuggestParams
- type AutosuggestSuggestResponse
- type AutosuggestSuggestResponseItem
- type AutosuggestSuggestResponseItemOpeningHours
- type AutosuggestSuggestResponseItemOpeningHoursTimeRange
- type AutosuggestSuggestResponseItemOpeningHoursTimeRangeEndTime
- type AutosuggestSuggestResponseItemOpeningHoursTimeRangeStartTime
- type AutosuggestSuggestResponseItemScoring
- type BatchGetParams
- type BatchGetResponse
- type BatchGetResponseResponse
- type BatchNewParams
- type BatchNewParamsRequest
- type BatchNewResponse
- type BatchService
- type BrowseSearchParams
- type BrowseSearchResponse
- type BrowseSearchResponseItem
- type BrowseSearchResponseItemOpeningHours
- type BrowseSearchResponseItemOpeningHoursTimeRange
- type BrowseSearchResponseItemOpeningHoursTimeRangeEndTime
- type BrowseSearchResponseItemOpeningHoursTimeRangeStartTime
- type BrowseSearchResponseItemScoring
- type BrowseService
- type Categories
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type ContactObject
- type ContactObjectCategory
- type Contacts
- type DirectionComputeRouteParams
- type DirectionComputeRouteParamsAvoid
- type DirectionComputeRouteParamsEmissionClass
- type DirectionComputeRouteParamsExclude
- type DirectionComputeRouteParamsGeometry
- type DirectionComputeRouteParamsHazmatType
- type DirectionComputeRouteParamsMode
- type DirectionComputeRouteParamsOption
- type DirectionComputeRouteParamsOverview
- type DirectionComputeRouteParamsRoadInfo
- type DirectionComputeRouteParamsRouteType
- type DirectionComputeRouteResponse
- type DirectionComputeRouteResponseRoute
- type DirectionComputeRouteResponseRouteEndLocation
- type DirectionComputeRouteResponseRouteGeojson
- type DirectionComputeRouteResponseRouteGeojsonGeometry
- type DirectionComputeRouteResponseRouteLeg
- type DirectionComputeRouteResponseRouteLegDistance
- type DirectionComputeRouteResponseRouteLegDuration
- type DirectionComputeRouteResponseRouteLegEndLocation
- type DirectionComputeRouteResponseRouteLegStartLocation
- type DirectionComputeRouteResponseRouteLegStep
- type DirectionComputeRouteResponseRouteLegStepDistance
- type DirectionComputeRouteResponseRouteLegStepDuration
- type DirectionComputeRouteResponseRouteLegStepEndLocation
- type DirectionComputeRouteResponseRouteLegStepGeojson
- type DirectionComputeRouteResponseRouteLegStepGeojsonGeometry
- type DirectionComputeRouteResponseRouteLegStepManeuver
- type DirectionComputeRouteResponseRouteLegStepManeuverCoordinate
- type DirectionComputeRouteResponseRouteLegStepStartLocation
- type DirectionComputeRouteResponseRouteStartLocation
- type DirectionService
- type DiscoverGetParams
- type DiscoverGetResponse
- type DiscoverGetResponseItem
- type DiscoverGetResponseItemOpeningHours
- type DiscoverGetResponseItemOpeningHoursTimeRange
- type DiscoverGetResponseItemOpeningHoursTimeRangeEndTime
- type DiscoverGetResponseItemOpeningHoursTimeRangeStartTime
- type DiscoverGetResponseItemScoring
- type DiscoverService
- type DistanceMatrixJsonGetParams
- type DistanceMatrixJsonGetParamsApproaches
- type DistanceMatrixJsonGetParamsAvoid
- type DistanceMatrixJsonGetParamsMode
- type DistanceMatrixJsonGetResponse
- type DistanceMatrixJsonGetResponseRow
- type DistanceMatrixJsonGetResponseRowElement
- type DistanceMatrixJsonService
- type DistanceMatrixService
- type DocumentSubmission
- type DocumentTemplateContentRequestMetaOptionParam
- type DocumentTemplateContentRequestMetaParam
- type DocumentTemplateContentRequestParam
- type DocumentTemplateContentRequestType
- type DocumentTemplateContentRequestValidationParam
- type DocumentTemplateContentResponse
- type DocumentTemplateContentResponseMeta
- type DocumentTemplateContentResponseMetaOption
- type DocumentTemplateContentResponseValidation
- type Error
- type FleetifyDocumentTemplateDeleteParams
- type FleetifyDocumentTemplateDeleteResponse
- type FleetifyDocumentTemplateGetParams
- type FleetifyDocumentTemplateGetResponse
- type FleetifyDocumentTemplateGetResponseData
- type FleetifyDocumentTemplateListParams
- type FleetifyDocumentTemplateListResponse
- type FleetifyDocumentTemplateListResponseData
- type FleetifyDocumentTemplateNewParams
- type FleetifyDocumentTemplateNewResponse
- type FleetifyDocumentTemplateNewResponseData
- type FleetifyDocumentTemplateService
- func (r *FleetifyDocumentTemplateService) Delete(ctx context.Context, id string, body FleetifyDocumentTemplateDeleteParams, ...) (res *FleetifyDocumentTemplateDeleteResponse, err error)
- func (r *FleetifyDocumentTemplateService) Get(ctx context.Context, id string, query FleetifyDocumentTemplateGetParams, ...) (res *FleetifyDocumentTemplateGetResponse, err error)
- func (r *FleetifyDocumentTemplateService) List(ctx context.Context, query FleetifyDocumentTemplateListParams, ...) (res *FleetifyDocumentTemplateListResponse, err error)
- func (r *FleetifyDocumentTemplateService) New(ctx context.Context, params FleetifyDocumentTemplateNewParams, ...) (res *FleetifyDocumentTemplateNewResponse, err error)
- func (r *FleetifyDocumentTemplateService) Update(ctx context.Context, id string, params FleetifyDocumentTemplateUpdateParams, ...) (res *FleetifyDocumentTemplateUpdateResponse, err error)
- type FleetifyDocumentTemplateUpdateParams
- type FleetifyDocumentTemplateUpdateResponse
- type FleetifyDocumentTemplateUpdateResponseData
- type FleetifyRouteNewParams
- type FleetifyRouteNewParamsRouting
- type FleetifyRouteNewResponse
- type FleetifyRouteNewResponseData
- type FleetifyRouteNewResponseDataDriver
- type FleetifyRouteRedispatchParams
- type FleetifyRouteRedispatchParamsOperation
- type FleetifyRouteRedispatchParamsOperationData
- type FleetifyRouteRedispatchResponse
- type FleetifyRouteRedispatchResponseData
- type FleetifyRouteRedispatchResponseDataCompletion
- type FleetifyRouteRedispatchResponseDataDriver
- type FleetifyRouteRedispatchResponseDataSteps
- type FleetifyRouteRedispatchResponseDataStepsCompletion
- type FleetifyRouteRedispatchResponseDataStepsMeta
- type FleetifyRouteService
- func (r *FleetifyRouteService) New(ctx context.Context, params FleetifyRouteNewParams, ...) (res *FleetifyRouteNewResponse, err error)
- func (r *FleetifyRouteService) Redispatch(ctx context.Context, routeID string, params FleetifyRouteRedispatchParams, ...) (res *FleetifyRouteRedispatchResponse, err error)
- type FleetifyRouteStepCompleteParams
- type FleetifyRouteStepDeleteParams
- type FleetifyRouteStepDeleteResponse
- type FleetifyRouteStepNewParams
- type FleetifyRouteStepNewParamsMeta
- type FleetifyRouteStepNewParamsType
- type FleetifyRouteStepNewResponse
- type FleetifyRouteStepService
- func (r *FleetifyRouteStepService) Complete(ctx context.Context, stepID string, params FleetifyRouteStepCompleteParams, ...) (err error)
- func (r *FleetifyRouteStepService) Delete(ctx context.Context, stepID string, params FleetifyRouteStepDeleteParams, ...) (res *FleetifyRouteStepDeleteResponse, err error)
- func (r *FleetifyRouteStepService) New(ctx context.Context, routeID string, params FleetifyRouteStepNewParams, ...) (res *FleetifyRouteStepNewResponse, err error)
- func (r *FleetifyRouteStepService) Update(ctx context.Context, stepID string, params FleetifyRouteStepUpdateParams, ...) (res *FleetifyRouteStepUpdateResponse, err error)
- type FleetifyRouteStepUpdateParams
- type FleetifyRouteStepUpdateParamsMeta
- type FleetifyRouteStepUpdateParamsType
- type FleetifyRouteStepUpdateResponse
- type FleetifyService
- type GeocodeBatchNewParams
- type GeocodeBatchNewParamsBody
- type GeocodeBatchNewResponse
- type GeocodeBatchNewResponseItem
- type GeocodeBatchNewResponseItemScoring
- type GeocodeGetParams
- type GeocodeGetResponse
- type GeocodeGetResponseItem
- type GeocodeGetResponseItemOpeningHours
- type GeocodeGetResponseItemOpeningHoursTimeRange
- type GeocodeGetResponseItemOpeningHoursTimeRangeEndTime
- type GeocodeGetResponseItemOpeningHoursTimeRangeStartTime
- type GeocodeGetResponseItemScoring
- type GeocodeService
- func (r *GeocodeService) BatchNew(ctx context.Context, params GeocodeBatchNewParams, ...) (res *GeocodeBatchNewResponse, err error)
- func (r *GeocodeService) Get(ctx context.Context, query GeocodeGetParams, opts ...option.RequestOption) (res *GeocodeGetResponse, err error)
- func (r *GeocodeService) StructuredGet(ctx context.Context, query GeocodeStructuredGetParams, ...) (res *GeocodeStructuredGetResponse, err error)
- type GeocodeStructuredGetParams
- type GeocodeStructuredGetResponse
- type GeocodeStructuredGetResponseItem
- type GeocodeStructuredGetResponseItemOpeningHours
- type GeocodeStructuredGetResponseItemOpeningHoursTimeRange
- type GeocodeStructuredGetResponseItemOpeningHoursTimeRangeEndTime
- type GeocodeStructuredGetResponseItemOpeningHoursTimeRangeStartTime
- type GeocodeStructuredGetResponseItemScoring
- type Geofence
- type GeofenceBatchDeleteParams
- type GeofenceBatchListParams
- type GeofenceBatchListResponse
- type GeofenceBatchListResponseData
- type GeofenceBatchNewParams
- type GeofenceBatchNewResponse
- type GeofenceBatchNewResponseData
- type GeofenceBatchService
- func (r *GeofenceBatchService) Delete(ctx context.Context, params GeofenceBatchDeleteParams, ...) (res *SimpleResp, err error)
- func (r *GeofenceBatchService) List(ctx context.Context, query GeofenceBatchListParams, ...) (res *GeofenceBatchListResponse, err error)
- func (r *GeofenceBatchService) New(ctx context.Context, params GeofenceBatchNewParams, ...) (res *GeofenceBatchNewResponse, err error)
- type GeofenceCircleCenter
- type GeofenceConsolePreviewParams
- type GeofenceConsolePreviewResponse
- type GeofenceConsolePreviewResponseData
- type GeofenceConsoleSearchParams
- type GeofenceConsoleSearchResponse
- type GeofenceConsoleSearchResponseData
- type GeofenceConsoleSearchResponseDataResult
- type GeofenceConsoleService
- type GeofenceContainsParams
- type GeofenceContainsResponse
- type GeofenceContainsResponseData
- type GeofenceContainsResponseDataResultList
- type GeofenceContainsResponseDataResultListResult
- type GeofenceDeleteParams
- type GeofenceEntityCreateCircleCenterParam
- type GeofenceEntityCreateCircleParam
- type GeofenceEntityCreateIsochroneParam
- type GeofenceEntityCreateParam
- type GeofenceEntityCreatePolygonGeojsonParam
- type GeofenceEntityCreatePolygonParam
- type GeofenceEntityCreateType
- type GeofenceGetParams
- type GeofenceGetResponse
- type GeofenceGetResponseData
- type GeofenceListParams
- type GeofenceListResponse
- type GeofenceListResponseData
- type GeofenceNewParams
- type GeofenceNewResponse
- type GeofenceNewResponseData
- type GeofenceService
- func (r *GeofenceService) Contains(ctx context.Context, query GeofenceContainsParams, ...) (res *GeofenceContainsResponse, err error)
- func (r *GeofenceService) Delete(ctx context.Context, id string, body GeofenceDeleteParams, ...) (res *SimpleResp, err error)
- func (r *GeofenceService) Get(ctx context.Context, id string, query GeofenceGetParams, ...) (res *GeofenceGetResponse, err error)
- func (r *GeofenceService) List(ctx context.Context, query GeofenceListParams, opts ...option.RequestOption) (res *GeofenceListResponse, err error)
- func (r *GeofenceService) New(ctx context.Context, params GeofenceNewParams, opts ...option.RequestOption) (res *GeofenceNewResponse, err error)
- func (r *GeofenceService) Update(ctx context.Context, id string, params GeofenceUpdateParams, ...) (res *SimpleResp, err error)
- type GeofenceType
- type GeofenceUpdateParams
- type GeofenceUpdateParamsCircle
- type GeofenceUpdateParamsCircleCenter
- type GeofenceUpdateParamsIsochrone
- type GeofenceUpdateParamsPolygon
- type GeofenceUpdateParamsPolygonGeojson
- type GeofenceUpdateParamsType
- type IsochroneComputeParams
- type IsochroneComputeParamsMode
- type IsochroneComputeResponse
- type IsochroneComputeResponseFeature
- type IsochroneComputeResponseFeatureGeometry
- type IsochroneComputeResponseFeatureProperties
- type IsochroneService
- type JobParam
- type JobVolumeParam
- type Location
- type LocationParam
- type LookupByIDParams
- type LookupByIDResponse
- type LookupByIDResponseItem
- type LookupService
- type MapService
- type MapView
- type MdmGetDistanceMatrixStatusParams
- type MdmGetDistanceMatrixStatusResponse
- type MdmGetDistanceMatrixStatusResponseCode
- type MdmNewDistanceMatrixParams
- type MdmNewDistanceMatrixParamsArea
- type MdmNewDistanceMatrixParamsAvoid
- type MdmNewDistanceMatrixParamsDestinationsApproach
- type MdmNewDistanceMatrixParamsHazmatType
- type MdmNewDistanceMatrixParamsMode
- type MdmNewDistanceMatrixParamsOption
- type MdmNewDistanceMatrixParamsOriginsApproach
- type MdmNewDistanceMatrixParamsRouteType
- type MdmNewDistanceMatrixParamsSpliter
- type MdmNewDistanceMatrixResponse
- type MdmService
- func (r *MdmService) GetDistanceMatrixStatus(ctx context.Context, query MdmGetDistanceMatrixStatusParams, ...) (res *MdmGetDistanceMatrixStatusResponse, err error)
- func (r *MdmService) NewDistanceMatrix(ctx context.Context, params MdmNewDistanceMatrixParams, ...) (res *MdmNewDistanceMatrixResponse, err error)
- type MetaData
- type Metadata
- type Monitor
- type MonitorGeofenceConfig
- type MonitorIdleConfig
- type MonitorMatchFilter
- type MonitorSpeedingConfig
- type MonitorType
- type MultigeocodePlaceDeleteParams
- type MultigeocodePlaceDeleteResponse
- type MultigeocodePlaceGetParams
- type MultigeocodePlaceGetResponse
- type MultigeocodePlaceGetResponseDataSorce
- type MultigeocodePlaceNewParams
- type MultigeocodePlaceNewParamsDataSource
- type MultigeocodePlaceNewParamsPlace
- type MultigeocodePlaceNewParamsPlaceGeopoint
- type MultigeocodePlaceNewParamsPlacePoi
- type MultigeocodePlaceNewResponse
- type MultigeocodePlaceService
- func (r *MultigeocodePlaceService) Delete(ctx context.Context, docID string, body MultigeocodePlaceDeleteParams, ...) (res *MultigeocodePlaceDeleteResponse, err error)
- func (r *MultigeocodePlaceService) Get(ctx context.Context, docID string, query MultigeocodePlaceGetParams, ...) (res *MultigeocodePlaceGetResponse, err error)
- func (r *MultigeocodePlaceService) New(ctx context.Context, params MultigeocodePlaceNewParams, ...) (res *MultigeocodePlaceNewResponse, err error)
- func (r *MultigeocodePlaceService) Update(ctx context.Context, docID string, params MultigeocodePlaceUpdateParams, ...) (res *MultigeocodePlaceUpdateResponse, err error)
- type MultigeocodePlaceUpdateParams
- type MultigeocodePlaceUpdateParamsDataSource
- type MultigeocodePlaceUpdateResponse
- type MultigeocodeSearchParams
- type MultigeocodeSearchParamsAt
- type MultigeocodeSearchResponse
- type MultigeocodeSearchResponseEntity
- type MultigeocodeSearchResponseEntityDataSource
- type MultigeocodeService
- type NavigationGetRouteParams
- type NavigationGetRouteParamsApproaches
- type NavigationGetRouteParamsAvoid
- type NavigationGetRouteParamsGeometry
- type NavigationGetRouteParamsMode
- type NavigationGetRouteParamsOriginalShapeType
- type NavigationGetRouteParamsOverview
- type NavigationGetRouteResponse
- type NavigationGetRouteResponseRoute
- type NavigationGetRouteResponseRouteEndLocation
- type NavigationGetRouteResponseRouteGeojson
- type NavigationGetRouteResponseRouteLeg
- type NavigationGetRouteResponseRouteLegDistance
- type NavigationGetRouteResponseRouteLegDuration
- type NavigationGetRouteResponseRouteLegEndLocation
- type NavigationGetRouteResponseRouteLegStartLocation
- type NavigationGetRouteResponseRouteLegStep
- type NavigationGetRouteResponseRouteLegStepDistance
- type NavigationGetRouteResponseRouteLegStepDuration
- type NavigationGetRouteResponseRouteLegStepEndLocation
- type NavigationGetRouteResponseRouteLegStepGeojson
- type NavigationGetRouteResponseRouteLegStepIntersection
- type NavigationGetRouteResponseRouteLegStepIntersectionLane
- type NavigationGetRouteResponseRouteLegStepIntersectionLocation
- type NavigationGetRouteResponseRouteLegStepManeuver
- type NavigationGetRouteResponseRouteLegStepManeuverCoordinate
- type NavigationGetRouteResponseRouteLegStepManeuverVoiceInstruction
- type NavigationGetRouteResponseRouteLegStepRoadShieldType
- type NavigationGetRouteResponseRouteLegStepStartLocation
- type NavigationGetRouteResponseRouteStartLocation
- type NavigationService
- type OptimizationComputeParams
- type OptimizationComputeParamsApproaches
- type OptimizationComputeParamsDestination
- type OptimizationComputeParamsGeometries
- type OptimizationComputeParamsMode
- type OptimizationComputeParamsSource
- type OptimizationComputeResponse
- type OptimizationComputeResponseLocation
- type OptimizationComputeResponseTrip
- type OptimizationComputeResponseTripGeojson
- type OptimizationComputeResponseTripLeg
- type OptimizationComputeResponseTripLegStep
- type OptimizationComputeResponseTripLegStepGeojson
- type OptimizationComputeResponseWaypoint
- type OptimizationComputeResponseWaypointLocation
- type OptimizationDriverAssignmentAssignParams
- type OptimizationDriverAssignmentAssignParamsFilter
- type OptimizationDriverAssignmentAssignParamsOptions
- type OptimizationDriverAssignmentAssignParamsOptionsOrderAttributePriorityMapping
- type OptimizationDriverAssignmentAssignParamsOptionsVehicleAttributePriorityMapping
- type OptimizationDriverAssignmentAssignParamsOrder
- type OptimizationDriverAssignmentAssignParamsOrderDropoff
- type OptimizationDriverAssignmentAssignParamsOrderPickup
- type OptimizationDriverAssignmentAssignParamsOrderVehiclePreferences
- type OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesExcludeAllOfAttribute
- type OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesRequiredAllOfAttribute
- type OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesRequiredAnyOfAttribute
- type OptimizationDriverAssignmentAssignResponse
- type OptimizationDriverAssignmentAssignResponseResult
- type OptimizationDriverAssignmentAssignResponseResultAlternateAssignment
- type OptimizationDriverAssignmentAssignResponseResultAlternateAssignmentAssignment
- type OptimizationDriverAssignmentAssignResponseResultTrip
- type OptimizationDriverAssignmentAssignResponseResultTripVehicle
- type OptimizationDriverAssignmentAssignResponseResultTripVehicleSteps
- type OptimizationDriverAssignmentAssignResponseResultUnassignedOrder
- type OptimizationDriverAssignmentService
- type OptimizationReOptimizeParams
- type OptimizationReOptimizeParamsJobChanges
- type OptimizationReOptimizeParamsShipmentChanges
- type OptimizationReOptimizeParamsVehicleChanges
- type OptimizationService
- type OptimizationV2GetResultParams
- type OptimizationV2GetResultResponse
- type OptimizationV2GetResultResponseResult
- type OptimizationV2GetResultResponseResultRoute
- type OptimizationV2GetResultResponseResultRouteStep
- type OptimizationV2GetResultResponseResultSummary
- type OptimizationV2GetResultResponseResultUnassigned
- type OptimizationV2GetResultResponseStatus
- type OptimizationV2Service
- type OptimizationV2SubmitParams
- type OptimizationV2SubmitParamsDepot
- type OptimizationV2SubmitParamsLocations
- type OptimizationV2SubmitParamsOptions
- type OptimizationV2SubmitParamsOptionsConstraint
- type OptimizationV2SubmitParamsOptionsGrouping
- type OptimizationV2SubmitParamsOptionsGroupingOrderGrouping
- type OptimizationV2SubmitParamsOptionsGroupingRouteGrouping
- type OptimizationV2SubmitParamsOptionsObjective
- type OptimizationV2SubmitParamsOptionsObjectiveCustom
- type OptimizationV2SubmitParamsOptionsRouting
- type OptimizationV2SubmitParamsRelation
- type OptimizationV2SubmitParamsRelationStep
- type OptimizationV2SubmitParamsSolution
- type OptimizationV2SubmitParamsSolutionStep
- type OptimizationV2SubmitParamsUnassigned
- type OptimizationV2SubmitParamsZone
- type OptimizationV2SubmitParamsZoneGeometry
- type Pagination
- type PlaceItem
- type PlaceItemGeopoint
- type PlaceItemGeopointParam
- type PlaceItemParam
- type PlaceItemPoi
- type PlaceItemPoiParam
- type PolygonGeojson
- type Position
- type PostResponse
- type PostalcodeGetCoordinatesParams
- type PostalcodeGetCoordinatesParamsAt
- type PostalcodeGetCoordinatesParamsFormat
- type PostalcodeGetCoordinatesResponse
- type PostalcodeGetCoordinatesResponsePlaces
- type PostalcodeGetCoordinatesResponsePlacesBoundary
- type PostalcodeGetCoordinatesResponsePlacesBoundaryGeometry
- type PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygon
- type PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygonPolygon
- type PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygonPolygonPoint
- type PostalcodeGetCoordinatesResponsePlacesGeopoint
- type PostalcodeService
- type RestrictionDeleteParams
- type RestrictionDeleteResponse
- type RestrictionGetParams
- type RestrictionListByBboxParams
- type RestrictionListByBboxParamsRestrictionType
- type RestrictionListByBboxParamsSource
- type RestrictionListByBboxParamsState
- type RestrictionListByBboxParamsStatus
- type RestrictionListParams
- type RestrictionListParamsMode
- type RestrictionListParamsRestrictionType
- type RestrictionListParamsSource
- type RestrictionListParamsState
- type RestrictionListParamsStatus
- type RestrictionListResponse
- type RestrictionListResponseMeta
- type RestrictionNewParams
- type RestrictionNewParamsRestrictionType
- type RestrictionService
- func (r *RestrictionService) Delete(ctx context.Context, id int64, body RestrictionDeleteParams, ...) (res *RestrictionDeleteResponse, err error)
- func (r *RestrictionService) Get(ctx context.Context, id int64, query RestrictionGetParams, ...) (res *RichGroupResponse, err error)
- func (r *RestrictionService) List(ctx context.Context, query RestrictionListParams, opts ...option.RequestOption) (res *RestrictionListResponse, err error)
- func (r *RestrictionService) ListByBbox(ctx context.Context, query RestrictionListByBboxParams, ...) (res *[]RichGroupResponse, err error)
- func (r *RestrictionService) New(ctx context.Context, restrictionType RestrictionNewParamsRestrictionType, ...) (res *RichGroupResponse, err error)
- func (r *RestrictionService) SetState(ctx context.Context, id int64, params RestrictionSetStateParams, ...) (res *RichGroupResponse, err error)
- func (r *RestrictionService) Update(ctx context.Context, id int64, params RestrictionUpdateParams, ...) (res *RichGroupResponse, err error)
- type RestrictionSetStateParams
- type RestrictionSetStateParamsState
- type RestrictionUpdateParams
- type RestrictionsItemListParams
- type RestrictionsItemListParamsMode
- type RestrictionsItemListParamsRestrictionType
- type RestrictionsItemListParamsState
- type RestrictionsItemListParamsStatus
- type RestrictionsItemListResponse
- type RestrictionsItemListResponseCoordinate
- type RestrictionsItemListResponseGroupType
- type RestrictionsItemListResponseRestrictionType
- type RestrictionsItemListResponseSource
- type RestrictionsItemListResponseState
- type RestrictionsItemListResponseStatus
- type RestrictionsItemService
- type RevgeocodeGetParams
- type RevgeocodeGetResponse
- type RevgeocodeGetResponseItem
- type RevgeocodeGetResponseItemOpeningHours
- type RevgeocodeGetResponseItemOpeningHoursTimeRange
- type RevgeocodeGetResponseItemOpeningHoursTimeRangeEndTime
- type RevgeocodeGetResponseItemOpeningHoursTimeRangeStartTime
- type RevgeocodeGetResponseItemScoring
- type RevgeocodeService
- type RichGroupRequestDirection
- type RichGroupRequestParam
- type RichGroupRequestSegmentParam
- type RichGroupRequestTurnParam
- type RichGroupResponse
- type RichGroupResponseDirection
- type RichGroupResponseRestrictionType
- type RichGroupResponseState
- type RichGroupResponseStatus
- type RouteReportNewParams
- type RouteReportNewParamsOriginalShapeType
- type RouteReportNewResponse
- type RouteReportNewResponseMileage
- type RouteReportNewResponseMileageSegment
- type RouteReportNewResponseMileageSegmentCountry
- type RouteReportNewResponseMileageSegmentState
- type RouteReportNewResponseMileageSummary
- type RouteReportNewResponseRoadSummary
- type RouteReportNewResponseRoadSummarySegment
- type RouteReportNewResponseRoadSummarySegmentMaxSpeed
- type RouteReportNewResponseRoadSummarySegmentRoadClass
- type RouteReportNewResponseRoadSummarySummary
- type RouteReportService
- type RouteStepCompletionMode
- type RouteStepGeofenceConfig
- type RouteStepGeofenceConfigParam
- type RouteStepGeofenceConfigType
- type RouteStepsRequestMetaParam
- type RouteStepsRequestParam
- type RouteStepsRequestType
- type RouteStepsResponse
- type RouteStepsResponseCompletion
- type RouteStepsResponseMeta
- type RoutingResponse
- type SearchResponse
- type SearchResponseData
- type SearchResponseDataAsset
- type SearchResponseDataAssetRankingInfo
- type ShipmentDeliveryParam
- type ShipmentParam
- type ShipmentPickupParam
- type ShipmentVolumeParam
- type SimpleResp
- type SkynetAssetBindParams
- type SkynetAssetDeleteParams
- type SkynetAssetDeleteParamsCluster
- type SkynetAssetEventListParams
- type SkynetAssetEventListParamsCluster
- type SkynetAssetEventListResponse
- type SkynetAssetEventListResponseData
- type SkynetAssetEventListResponseDataList
- type SkynetAssetEventListResponseDataListPrevLocation
- type SkynetAssetEventListResponseDataListPrevLocationLocation
- type SkynetAssetEventListResponseDataListTriggeredLocation
- type SkynetAssetEventListResponseDataListTriggeredLocationLocation
- type SkynetAssetEventService
- type SkynetAssetGetParams
- type SkynetAssetGetParamsCluster
- type SkynetAssetGetResponse
- type SkynetAssetGetResponseData
- type SkynetAssetListParams
- type SkynetAssetListParamsCluster
- type SkynetAssetListResponse
- type SkynetAssetListResponseData
- type SkynetAssetLocationGetLastParams
- type SkynetAssetLocationGetLastParamsCluster
- type SkynetAssetLocationGetLastResponse
- type SkynetAssetLocationGetLastResponseData
- type SkynetAssetLocationListParams
- type SkynetAssetLocationListParamsCluster
- type SkynetAssetLocationListParamsGeometryType
- type SkynetAssetLocationListResponse
- type SkynetAssetLocationListResponseData
- type SkynetAssetLocationListResponseDataGeojson
- type SkynetAssetLocationListResponseDataGeojsonGeometry
- type SkynetAssetLocationListResponseDataSnappedPoint
- type SkynetAssetLocationListResponseDataSnappedPointLocation
- type SkynetAssetLocationService
- func (r *SkynetAssetLocationService) GetLast(ctx context.Context, id string, query SkynetAssetLocationGetLastParams, ...) (res *SkynetAssetLocationGetLastResponse, err error)
- func (r *SkynetAssetLocationService) List(ctx context.Context, id string, query SkynetAssetLocationListParams, ...) (res *SkynetAssetLocationListResponse, err error)
- type SkynetAssetNewParams
- type SkynetAssetNewParamsCluster
- type SkynetAssetNewResponse
- type SkynetAssetNewResponseData
- type SkynetAssetService
- func (r *SkynetAssetService) Bind(ctx context.Context, id string, params SkynetAssetBindParams, ...) (res *SimpleResp, err error)
- func (r *SkynetAssetService) Delete(ctx context.Context, id string, body SkynetAssetDeleteParams, ...) (res *SimpleResp, err error)
- func (r *SkynetAssetService) Get(ctx context.Context, id string, query SkynetAssetGetParams, ...) (res *SkynetAssetGetResponse, err error)
- func (r *SkynetAssetService) List(ctx context.Context, query SkynetAssetListParams, opts ...option.RequestOption) (res *SkynetAssetListResponse, err error)
- func (r *SkynetAssetService) New(ctx context.Context, params SkynetAssetNewParams, opts ...option.RequestOption) (res *SkynetAssetNewResponse, err error)
- func (r *SkynetAssetService) Track(ctx context.Context, id string, params SkynetAssetTrackParams, ...) (res *SimpleResp, err error)
- func (r *SkynetAssetService) Update(ctx context.Context, id string, params SkynetAssetUpdateParams, ...) (res *SimpleResp, err error)
- func (r *SkynetAssetService) UpdateAttributes(ctx context.Context, id string, params SkynetAssetUpdateAttributesParams, ...) (res *SimpleResp, err error)
- type SkynetAssetTrackParams
- type SkynetAssetTrackParamsCluster
- type SkynetAssetTrackParamsLocations
- type SkynetAssetTrackParamsLocationsLocation
- type SkynetAssetUpdateAttributesParams
- type SkynetAssetUpdateParams
- type SkynetAssetUpdateParamsCluster
- type SkynetConfigGetParams
- type SkynetConfigGetParamsCluster
- type SkynetConfigGetResponse
- type SkynetConfigGetResponseData
- type SkynetConfigGetResponseDataConfig
- type SkynetConfigService
- func (r *SkynetConfigService) Get(ctx context.Context, query SkynetConfigGetParams, opts ...option.RequestOption) (res *SkynetConfigGetResponse, err error)
- func (r *SkynetConfigService) TestWebhook(ctx context.Context, body SkynetConfigTestWebhookParams, ...) (res *SkynetConfigTestWebhookResponse, err error)
- func (r *SkynetConfigService) Update(ctx context.Context, params SkynetConfigUpdateParams, ...) (res *SimpleResp, err error)
- type SkynetConfigTestWebhookParams
- type SkynetConfigTestWebhookResponse
- type SkynetConfigUpdateParams
- type SkynetConfigUpdateParamsCluster
- type SkynetMonitorDeleteParams
- type SkynetMonitorGetParams
- type SkynetMonitorGetResponse
- type SkynetMonitorGetResponseData
- type SkynetMonitorListParams
- type SkynetMonitorListParamsCluster
- type SkynetMonitorListResponse
- type SkynetMonitorListResponseData
- type SkynetMonitorNewParams
- type SkynetMonitorNewParamsCluster
- type SkynetMonitorNewParamsGeofenceConfig
- type SkynetMonitorNewParamsIdleConfig
- type SkynetMonitorNewParamsMatchFilter
- type SkynetMonitorNewParamsSpeedingConfig
- type SkynetMonitorNewParamsType
- type SkynetMonitorNewResponse
- type SkynetMonitorNewResponseData
- type SkynetMonitorService
- func (r *SkynetMonitorService) Delete(ctx context.Context, id string, body SkynetMonitorDeleteParams, ...) (res *SimpleResp, err error)
- func (r *SkynetMonitorService) Get(ctx context.Context, id string, query SkynetMonitorGetParams, ...) (res *SkynetMonitorGetResponse, err error)
- func (r *SkynetMonitorService) List(ctx context.Context, query SkynetMonitorListParams, ...) (res *SkynetMonitorListResponse, err error)
- func (r *SkynetMonitorService) New(ctx context.Context, params SkynetMonitorNewParams, ...) (res *SkynetMonitorNewResponse, err error)
- func (r *SkynetMonitorService) Update(ctx context.Context, id string, params SkynetMonitorUpdateParams, ...) (res *SimpleResp, err error)
- type SkynetMonitorUpdateParams
- type SkynetMonitorUpdateParamsGeofenceConfig
- type SkynetMonitorUpdateParamsIdleConfig
- type SkynetMonitorUpdateParamsMatchFilter
- type SkynetMonitorUpdateParamsSpeedingConfig
- type SkynetMonitorUpdateParamsType
- type SkynetNamespacedApikeyDeleteParams
- type SkynetNamespacedApikeyDeleteResponse
- type SkynetNamespacedApikeyNewParams
- type SkynetNamespacedApikeyNewResponse
- type SkynetNamespacedApikeyNewResponseResult
- type SkynetNamespacedApikeyService
- func (r *SkynetNamespacedApikeyService) Delete(ctx context.Context, body SkynetNamespacedApikeyDeleteParams, ...) (res *SkynetNamespacedApikeyDeleteResponse, err error)
- func (r *SkynetNamespacedApikeyService) New(ctx context.Context, body SkynetNamespacedApikeyNewParams, ...) (res *SkynetNamespacedApikeyNewResponse, err error)
- type SkynetSearchAroundParams
- type SkynetSearchAroundParamsSortBy
- type SkynetSearchAroundParamsSortDrivingMode
- type SkynetSearchBoundParams
- type SkynetSearchBoundParamsSortBy
- type SkynetSearchBoundParamsSortDrivingMode
- type SkynetSearchPolygonGetParams
- type SkynetSearchPolygonGetParamsSortBy
- type SkynetSearchPolygonGetParamsSortDrivingMode
- type SkynetSearchPolygonNewParams
- type SkynetSearchPolygonNewParamsMatchFilter
- type SkynetSearchPolygonNewParamsPolygon
- type SkynetSearchPolygonNewParamsSort
- type SkynetSearchPolygonNewParamsSortSortDestination
- type SkynetSearchPolygonService
- type SkynetSearchService
- type SkynetService
- type SkynetSubscribeParams
- type SkynetSubscribeParamsAction
- type SkynetSubscribeParamsParams
- type SkynetSubscribeResponse
- type SkynetTripDeleteParams
- type SkynetTripDeleteParamsCluster
- type SkynetTripEndParams
- type SkynetTripEndParamsCluster
- type SkynetTripGetParams
- type SkynetTripGetParamsCluster
- type SkynetTripGetResponse
- type SkynetTripGetResponseData
- type SkynetTripGetResponseDataTrip
- type SkynetTripGetSummaryParams
- type SkynetTripGetSummaryParamsCluster
- type SkynetTripGetSummaryResponse
- type SkynetTripGetSummaryResponseData
- type SkynetTripGetSummaryResponseDataTrip
- type SkynetTripService
- func (r *SkynetTripService) Delete(ctx context.Context, id string, body SkynetTripDeleteParams, ...) (res *SimpleResp, err error)
- func (r *SkynetTripService) End(ctx context.Context, params SkynetTripEndParams, opts ...option.RequestOption) (res *SimpleResp, err error)
- func (r *SkynetTripService) Get(ctx context.Context, id string, query SkynetTripGetParams, ...) (res *SkynetTripGetResponse, err error)
- func (r *SkynetTripService) GetSummary(ctx context.Context, id string, query SkynetTripGetSummaryParams, ...) (res *SkynetTripGetSummaryResponse, err error)
- func (r *SkynetTripService) Start(ctx context.Context, params SkynetTripStartParams, ...) (res *SkynetTripStartResponse, err error)
- func (r *SkynetTripService) Update(ctx context.Context, id string, params SkynetTripUpdateParams, ...) (res *SimpleResp, err error)
- type SkynetTripStartParams
- type SkynetTripStartParamsCluster
- type SkynetTripStartParamsStop
- type SkynetTripStartResponse
- type SkynetTripStartResponseData
- type SkynetTripUpdateParams
- type SkynetTripUpdateParamsCluster
- type SkynetTripUpdateParamsStop
- type SnapToRoadService
- type SnapToRoadSnapParams
- type SnapToRoadSnapParamsApproaches
- type SnapToRoadSnapParamsAvoid
- type SnapToRoadSnapParamsGeometry
- type SnapToRoadSnapParamsMode
- type SnapToRoadSnapParamsOption
- type SnapToRoadSnapParamsRoadInfo
- type SnapToRoadSnapResponse
- type SnapToRoadSnapResponseGeojson
- type SnapToRoadSnapResponseGeojsonGeometry
- type SnapToRoadSnapResponseRoadInfo
- type SnapToRoadSnapResponseRoadInfoMaxSpeed
- type SnapToRoadSnapResponseSnappedPoint
- type SnapToRoadSnapResponseSnappedPointLocation
- type TrackLocation
- type TrackLocationLocation
- type TripStop
- type VehicleParam
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (NEXTBILLION_SDK_API_KEY, NEXTBILLION_SDK_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type Access ¶
type Access struct { // The latitude of the access point of the search result. Lat float64 `json:"lat"` // The longitude of the access point of the search result. Lng float64 `json:"lng"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Lat respjson.Field Lng respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An array returning the location coordinates of all the access points of the search result.
func (*Access) UnmarshalJSON ¶
type Address ¶
type Address struct { // The name of the primary locality of the place. City string `json:"city"` // A three-letter country code. CountryCode string `json:"countryCode"` // The localised country name. CountryName string `json:"countryName"` // A division of a state; typically, a secondary-level administrative division of a // country or equivalent. County string `json:"county"` // A division of city; typically an administrative unit within a larger city or a // customary name of a city's neighborhood. District string `json:"district"` // House number of the returned place, if available. HouseNumber string `json:"houseNumber"` // Assembled address value built out of the address components according to the // regional postal rules. These are the same rules for all endpoints. It may not // include all the input terms. Label string `json:"label"` // An alphanumeric string included in a postal address to facilitate mail sorting, // such as post code, postcode, or ZIP code. PostalCode string `json:"postalCode"` // The state division of a country. State string `json:"state"` // A country specific state code or state name abbreviation. For example, in the // United States it is the two letter state abbreviation: "CA" for California. StateCode string `json:"stateCode"` // Name of street of the returned place, if available. Street string `json:"street"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { City respjson.Field CountryCode respjson.Field CountryName respjson.Field County respjson.Field District respjson.Field HouseNumber respjson.Field Label respjson.Field PostalCode respjson.Field State respjson.Field StateCode respjson.Field Street respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Postal address of the result item.
func (*Address) UnmarshalJSON ¶
type AreaListParams ¶
type AreaListParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // contains filtered or unexported fields }
func (AreaListParams) URLQuery ¶
func (r AreaListParams) URLQuery() (v url.Values, err error)
URLQuery serializes AreaListParams's query parameters as `url.Values`.
type AreaListResponse ¶
type AreaListResponse struct { // Returns the code for the available area. Code string `json:"code"` // Returns available traveling modes for the given area. Modes []string `json:"modes"` // Returns the name of the available area. Name string `json:"name"` // Returns the offset from UTC time. Timezone float64 `json:"timezone"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Code respjson.Field Modes respjson.Field Name respjson.Field Timezone respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (AreaListResponse) RawJSON ¶
func (r AreaListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AreaListResponse) UnmarshalJSON ¶
func (r *AreaListResponse) UnmarshalJSON(data []byte) error
type AreaService ¶
type AreaService struct {
Options []option.RequestOption
}
AreaService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAreaService method instead.
func NewAreaService ¶
func NewAreaService(opts ...option.RequestOption) (r AreaService)
NewAreaService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AreaService) List ¶
func (r *AreaService) List(ctx context.Context, query AreaListParams, opts ...option.RequestOption) (res *[]AreaListResponse, err error)
Get available areas
type AssetDetails ¶
type AssetDetails struct { // ID of the asset. This is the same ID that was generated/provided at the time of // creating the asset. ID string `json:"id"` // A string dictionary object containing attributes of the asset. These attributes // were associated with the asset at the time of creating or updating it. // // attributes can be added to an asset using the _Update Asset Attributes_ method. Attributes any `json:"attributes"` // A UNIX epoch timestamp in seconds representing the time at which the asset was // created. CreatedAt int64 `json:"created_at"` // Description of the asset. The value would be the same as that provided for the // description parameter at the time of creating or updating the asset. Description string `json:"description"` // ID of the device that is linked to this asset. Please note that there can be // multiple device_id linked to a single asset. An empty response is returned if no // devices are linked to the asset. // // User can link a device to an asset using the _Bind Asset to Device_ method. DeviceID string `json:"device_id"` // An object with details of the last tracked location of the asset. LatestLocation AssetDetailsLatestLocation `json:"latest_location"` // Any valid json object data. Can be used to save customized data. Max size is // 65kb. MetaData MetaData `json:"meta_data"` // Name of the asset. The value would be the same as that provided for the name // parameter at the time of creating or updating the asset. Name string `json:"name"` // State of the asset. It will be "active" when the asset is in use or available // for use, and it will be "deleted" in case the asset has been deleted. State string `json:"state"` // **This parameter will be deprecated soon! Please move existing tags to // attributes parameter.** // // Tags of the asset. These were associated with the asset when it was created or // updated. tags can be used for filtering assets in operations like _Get Asset // List_ and asset **Search** methods. They can also be used for monitoring of // assets using **Monitor** methods after linking tags and asset. Tags []string `json:"tags"` // A UNIX epoch timestamp in seconds representing the last time when the asset was // tracked. TrackedAt int64 `json:"tracked_at"` // A UNIX epoch timestamp in seconds representing the time at which the asset was // last updated. UpdatedAt int64 `json:"updated_at"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Attributes respjson.Field CreatedAt respjson.Field Description respjson.Field DeviceID respjson.Field LatestLocation respjson.Field MetaData respjson.Field Name respjson.Field State respjson.Field Tags respjson.Field TrackedAt respjson.Field UpdatedAt respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with details of the asset properties.
func (AssetDetails) RawJSON ¶
func (r AssetDetails) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetDetails) UnmarshalJSON ¶
func (r *AssetDetails) UnmarshalJSON(data []byte) error
type AssetDetailsLatestLocation ¶
type AssetDetailsLatestLocation struct { // If available, this property returns the accuracy of the GPS information received // at the last tracked location. It is represented as an estimated horizontal // accuracy radius, in meters, at the 68th percentile confidence level. Accuracy float64 `json:"accuracy"` // If available in the GPS information, this property returns the altitude of the // asset at the last tracked location. It is represented as height, in meters, // above the WGS84 reference ellipsoid. Altitude float64 `json:"altitude"` // If available in the GPS information, this property returns the heading of the // asset calculated from true north in clockwise direction at the last tracked // location. Please note that the bearing is not affected by the device // orientation. // // The bearing will always be in the range of [0, 360). Bearing float64 `json:"bearing"` // An object with the coordinates of the last tracked location. Location AssetDetailsLatestLocationLocation `json:"location"` // If available in the GPS information, this property returns the speed of the // asset, in meters per second, at the last tracked location. Speed float64 `json:"speed"` // A UNIX epoch timestamp in milliseconds, representing the time at which the // location was tracked. Timestamp int64 `json:"timestamp"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Accuracy respjson.Field Altitude respjson.Field Bearing respjson.Field Location respjson.Field Speed respjson.Field Timestamp respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with details of the last tracked location of the asset.
func (AssetDetailsLatestLocation) RawJSON ¶
func (r AssetDetailsLatestLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetDetailsLatestLocation) UnmarshalJSON ¶
func (r *AssetDetailsLatestLocation) UnmarshalJSON(data []byte) error
type AssetDetailsLatestLocationLocation ¶
type AssetDetailsLatestLocationLocation struct { // Latitude of the tracked location of the asset. Lat float64 `json:"lat"` // Longitude of the tracked location of the asset. Lon float64 `json:"lon"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Lat respjson.Field Lon respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with the coordinates of the last tracked location.
func (AssetDetailsLatestLocationLocation) RawJSON ¶
func (r AssetDetailsLatestLocationLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*AssetDetailsLatestLocationLocation) UnmarshalJSON ¶
func (r *AssetDetailsLatestLocationLocation) UnmarshalJSON(data []byte) error
type AutocompleteService ¶
type AutocompleteService struct {
Options []option.RequestOption
}
AutocompleteService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAutocompleteService method instead.
func NewAutocompleteService ¶
func NewAutocompleteService(opts ...option.RequestOption) (r AutocompleteService)
NewAutocompleteService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AutocompleteService) Suggest ¶
func (r *AutocompleteService) Suggest(ctx context.Context, query AutocompleteSuggestParams, opts ...option.RequestOption) (res *AutocompleteSuggestResponse, err error)
Autocomplete
type AutocompleteSuggestParams ¶
type AutocompleteSuggestParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Specify the free-text search query. // // Please note that whitespace, urls, email addresses, or other out-of-scope // queries will yield no results. Q string `query:"q,required" json:"-"` // Specify the center of the search context expressed as coordinates. // // Please note that one of "at", "in=circle" or "in=bbox" should be provided for // relevant results. At param.Opt[string] `query:"at,omitzero" format:"latitude,longitude" json:"-"` // Search within a geographic area. This is a hard filter. Results will be returned // if they are located within the specified area. // // # A geographic area can be // // - a country (or multiple countries), provided as comma-separated // [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country // codes // // The country codes are to be provided in all uppercase. // // Format: countryCode:{countryCode}[,{countryCode}] // // - a circular area, provided as latitude, longitude, and radius (an integer with // meters as unit) // // Format: circle:{latitude},{longitude};r={radius} // // - a bounding box, provided as _west longitude_, _south latitude_, _east // longitude_, _north latitude_ // // Format: bbox:{west longitude},{south latitude},{east longitude},{north // latitude} // // Please provide one of 'at', 'in=circle' or 'in=bbox' input for a relevant // result. In param.Opt[string] `query:"in,omitzero" json:"-"` // Select the language to be used for result rendering from a list of // [BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) compliant language // codes. Lang param.Opt[string] `query:"lang,omitzero" json:"-"` // Sets the maximum number of results to be returned. Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // contains filtered or unexported fields }
func (AutocompleteSuggestParams) URLQuery ¶
func (r AutocompleteSuggestParams) URLQuery() (v url.Values, err error)
URLQuery serializes AutocompleteSuggestParams's query parameters as `url.Values`.
type AutocompleteSuggestResponse ¶
type AutocompleteSuggestResponse struct { // The results are presented as a JSON list of candidates in ranked order // (most-likely to least-likely) based on the matched location criteria. Items []AutocompleteSuggestResponseItem `json:"items"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Items respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (AutocompleteSuggestResponse) RawJSON ¶
func (r AutocompleteSuggestResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AutocompleteSuggestResponse) UnmarshalJSON ¶
func (r *AutocompleteSuggestResponse) UnmarshalJSON(data []byte) error
type AutocompleteSuggestResponseItem ¶
type AutocompleteSuggestResponseItem struct { // The unique identifier for the result item. ID string `json:"id"` // An array returning the location coordinates of all the access points of the // search result. Access Access `json:"access"` // Postal address of the result item. Address Address `json:"address"` // The list of categories assigned to this place. Categories []Categories `json:"categories"` // Contact information like phone, email or website. Contacts []Contacts `json:"contacts"` // The distance "as the crow flies" from the search center to this result item in // meters. Distance int64 `json:"distance"` // The bounding box enclosing the geometric shape (area or line) that an individual // result covers. place typed results have no mapView. MapView MapView `json:"mapView"` // Returns the operating hours of the place, if available. OpeningHours AutocompleteSuggestResponseItemOpeningHours `json:"openingHours"` // Returns the location coordinates of the result. Position Position `json:"position"` // Score of the result. A higher score indicates a closer match. Scoring AutocompleteSuggestResponseItemScoring `json:"scoring"` // The localized display name of this result item. Title string `json:"title"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Access respjson.Field Address respjson.Field Categories respjson.Field Contacts respjson.Field Distance respjson.Field MapView respjson.Field OpeningHours respjson.Field Position respjson.Field Scoring respjson.Field Title respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (AutocompleteSuggestResponseItem) RawJSON ¶
func (r AutocompleteSuggestResponseItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*AutocompleteSuggestResponseItem) UnmarshalJSON ¶
func (r *AutocompleteSuggestResponseItem) UnmarshalJSON(data []byte) error
type AutocompleteSuggestResponseItemOpeningHours ¶
type AutocompleteSuggestResponseItemOpeningHours struct { // A collection of attributes with details about the opening and closing hours for // each day of the week. TimeRanges []AutocompleteSuggestResponseItemOpeningHoursTimeRange `json:"timeRanges"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { TimeRanges respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the operating hours of the place, if available.
func (AutocompleteSuggestResponseItemOpeningHours) RawJSON ¶
func (r AutocompleteSuggestResponseItemOpeningHours) RawJSON() string
Returns the unmodified JSON received from the API
func (*AutocompleteSuggestResponseItemOpeningHours) UnmarshalJSON ¶
func (r *AutocompleteSuggestResponseItemOpeningHours) UnmarshalJSON(data []byte) error
type AutocompleteSuggestResponseItemOpeningHoursTimeRange ¶
type AutocompleteSuggestResponseItemOpeningHoursTimeRange struct { // Returns the closing time details. EndTime AutocompleteSuggestResponseItemOpeningHoursTimeRangeEndTime `json:"endTime"` // Returns the open time details. StartTime AutocompleteSuggestResponseItemOpeningHoursTimeRangeStartTime `json:"startTime"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { EndTime respjson.Field StartTime respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (AutocompleteSuggestResponseItemOpeningHoursTimeRange) RawJSON ¶
func (r AutocompleteSuggestResponseItemOpeningHoursTimeRange) RawJSON() string
Returns the unmodified JSON received from the API
func (*AutocompleteSuggestResponseItemOpeningHoursTimeRange) UnmarshalJSON ¶
func (r *AutocompleteSuggestResponseItemOpeningHoursTimeRange) UnmarshalJSON(data []byte) error
type AutocompleteSuggestResponseItemOpeningHoursTimeRangeEndTime ¶
type AutocompleteSuggestResponseItemOpeningHoursTimeRangeEndTime struct { // The date to which the subsequent closing time details belong to. Date string `json:"date"` // The hour of the day when the place closes. Hour int64 `json:"hour"` // The minute of the hour when the place closes. Minute int64 `json:"minute"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Date respjson.Field Hour respjson.Field Minute respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the closing time details.
func (AutocompleteSuggestResponseItemOpeningHoursTimeRangeEndTime) RawJSON ¶
func (r AutocompleteSuggestResponseItemOpeningHoursTimeRangeEndTime) RawJSON() string
Returns the unmodified JSON received from the API
func (*AutocompleteSuggestResponseItemOpeningHoursTimeRangeEndTime) UnmarshalJSON ¶
func (r *AutocompleteSuggestResponseItemOpeningHoursTimeRangeEndTime) UnmarshalJSON(data []byte) error
type AutocompleteSuggestResponseItemOpeningHoursTimeRangeStartTime ¶
type AutocompleteSuggestResponseItemOpeningHoursTimeRangeStartTime struct { // The date to which the subsequent open time details belong to. Date string `json:"date"` // The hour of the day when the place opens. Hour int64 `json:"hour"` // The minute of the hour when the place opens. Minute int64 `json:"minute"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Date respjson.Field Hour respjson.Field Minute respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the open time details.
func (AutocompleteSuggestResponseItemOpeningHoursTimeRangeStartTime) RawJSON ¶
func (r AutocompleteSuggestResponseItemOpeningHoursTimeRangeStartTime) RawJSON() string
Returns the unmodified JSON received from the API
func (*AutocompleteSuggestResponseItemOpeningHoursTimeRangeStartTime) UnmarshalJSON ¶
func (r *AutocompleteSuggestResponseItemOpeningHoursTimeRangeStartTime) UnmarshalJSON(data []byte) error
type AutocompleteSuggestResponseItemScoring ¶
type AutocompleteSuggestResponseItemScoring struct { // A breakdown of how closely individual field of the result matched with the // provided query q. FieldScore any `json:"fieldScore"` // A score, out of 1, indicating how closely the result matches with the provided // query q . QueryScore float64 `json:"queryScore"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { FieldScore respjson.Field QueryScore respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Score of the result. A higher score indicates a closer match.
func (AutocompleteSuggestResponseItemScoring) RawJSON ¶
func (r AutocompleteSuggestResponseItemScoring) RawJSON() string
Returns the unmodified JSON received from the API
func (*AutocompleteSuggestResponseItemScoring) UnmarshalJSON ¶
func (r *AutocompleteSuggestResponseItemScoring) UnmarshalJSON(data []byte) error
type AutosuggestService ¶
type AutosuggestService struct {
Options []option.RequestOption
}
AutosuggestService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAutosuggestService method instead.
func NewAutosuggestService ¶
func NewAutosuggestService(opts ...option.RequestOption) (r AutosuggestService)
NewAutosuggestService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*AutosuggestService) Suggest ¶
func (r *AutosuggestService) Suggest(ctx context.Context, query AutosuggestSuggestParams, opts ...option.RequestOption) (res *AutosuggestSuggestResponse, err error)
Autosuggest
type AutosuggestSuggestParams ¶
type AutosuggestSuggestParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Specify the free-text search query. // // Please note that whitespace, urls, email addresses, or other out-of-scope // queries will yield no results. Q string `query:"q,required" json:"-"` // Specify the center of the search context expressed as coordinates. // // Please note that one of "at", "in=circle" or "in=bbox" should be provided for // relevant results. At param.Opt[string] `query:"at,omitzero" format:"latitude,longitude" json:"-"` // Search within a geographic area. This is a hard filter. Results will be returned // if they are located within the specified area. // // # A geographic area can be // // - a country (or multiple countries), provided as comma-separated // [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country // codes // // The country codes are to be provided in all uppercase. // // Format: countryCode:{countryCode}[,{countryCode}] // // - a circular area, provided as latitude, longitude, and radius (an integer with // meters as unit) // // Format: circle:{latitude},{longitude};r={radius} // // - a bounding box, provided as _west longitude_, _south latitude_, _east // longitude_, _north latitude_ // // Format: bbox:{west longitude},{south latitude},{east longitude},{north // latitude} // // Please provide one of 'at', 'in=circle' or 'in=bbox' input for a relevant // result. In param.Opt[string] `query:"in,omitzero" json:"-"` // Select the language to be used for result rendering from a list of // [BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) compliant language // codes. Lang param.Opt[string] `query:"lang,omitzero" json:"-"` // Sets the maximum number of results to be returned. Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // contains filtered or unexported fields }
func (AutosuggestSuggestParams) URLQuery ¶
func (r AutosuggestSuggestParams) URLQuery() (v url.Values, err error)
URLQuery serializes AutosuggestSuggestParams's query parameters as `url.Values`.
type AutosuggestSuggestResponse ¶
type AutosuggestSuggestResponse struct { // The results are presented as a JSON list of candidates in ranked order // (most-likely to least-likely) based on the matched location criteria. Items []AutosuggestSuggestResponseItem `json:"items"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Items respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (AutosuggestSuggestResponse) RawJSON ¶
func (r AutosuggestSuggestResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*AutosuggestSuggestResponse) UnmarshalJSON ¶
func (r *AutosuggestSuggestResponse) UnmarshalJSON(data []byte) error
type AutosuggestSuggestResponseItem ¶
type AutosuggestSuggestResponseItem struct { // The unique identifier for the result item. ID string `json:"id"` // An array returning the location coordinates of all the access points of the // search result. Access Access `json:"access"` // Postal address of the result item. Address Address `json:"address"` // The list of categories assigned to this place. Categories []Categories `json:"categories"` // Contact information like phone, email or website. Contacts []Contacts `json:"contacts"` // The distance "as the crow flies" from the search center to this result item in // meters. Distance int64 `json:"distance"` // The bounding box enclosing the geometric shape (area or line) that an individual // result covers. place typed results have no mapView. MapView MapView `json:"mapView"` // Returns the operating hours of the place, if available. OpeningHours AutosuggestSuggestResponseItemOpeningHours `json:"openingHours"` // Returns the location coordinates of the result. Position Position `json:"position"` // Score of the result. A higher score indicates a closer match. Scoring AutosuggestSuggestResponseItemScoring `json:"scoring"` // The localized display name of this result item. Title string `json:"title"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Access respjson.Field Address respjson.Field Categories respjson.Field Contacts respjson.Field Distance respjson.Field MapView respjson.Field OpeningHours respjson.Field Position respjson.Field Scoring respjson.Field Title respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (AutosuggestSuggestResponseItem) RawJSON ¶
func (r AutosuggestSuggestResponseItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*AutosuggestSuggestResponseItem) UnmarshalJSON ¶
func (r *AutosuggestSuggestResponseItem) UnmarshalJSON(data []byte) error
type AutosuggestSuggestResponseItemOpeningHours ¶
type AutosuggestSuggestResponseItemOpeningHours struct { // A collection of attributes with details about the opening and closing hours for // each day of the week. TimeRanges []AutosuggestSuggestResponseItemOpeningHoursTimeRange `json:"timeRanges"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { TimeRanges respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the operating hours of the place, if available.
func (AutosuggestSuggestResponseItemOpeningHours) RawJSON ¶
func (r AutosuggestSuggestResponseItemOpeningHours) RawJSON() string
Returns the unmodified JSON received from the API
func (*AutosuggestSuggestResponseItemOpeningHours) UnmarshalJSON ¶
func (r *AutosuggestSuggestResponseItemOpeningHours) UnmarshalJSON(data []byte) error
type AutosuggestSuggestResponseItemOpeningHoursTimeRange ¶
type AutosuggestSuggestResponseItemOpeningHoursTimeRange struct { // Returns the closing time details. EndTime AutosuggestSuggestResponseItemOpeningHoursTimeRangeEndTime `json:"endTime"` // Returns the open time details. StartTime AutosuggestSuggestResponseItemOpeningHoursTimeRangeStartTime `json:"startTime"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { EndTime respjson.Field StartTime respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (AutosuggestSuggestResponseItemOpeningHoursTimeRange) RawJSON ¶
func (r AutosuggestSuggestResponseItemOpeningHoursTimeRange) RawJSON() string
Returns the unmodified JSON received from the API
func (*AutosuggestSuggestResponseItemOpeningHoursTimeRange) UnmarshalJSON ¶
func (r *AutosuggestSuggestResponseItemOpeningHoursTimeRange) UnmarshalJSON(data []byte) error
type AutosuggestSuggestResponseItemOpeningHoursTimeRangeEndTime ¶
type AutosuggestSuggestResponseItemOpeningHoursTimeRangeEndTime struct { // The date to which the subsequent closing time details belong to. Date string `json:"date"` // The hour of the day when the place closes. Hour int64 `json:"hour"` // The minute of the hour when the place closes. Minute int64 `json:"minute"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Date respjson.Field Hour respjson.Field Minute respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the closing time details.
func (AutosuggestSuggestResponseItemOpeningHoursTimeRangeEndTime) RawJSON ¶
func (r AutosuggestSuggestResponseItemOpeningHoursTimeRangeEndTime) RawJSON() string
Returns the unmodified JSON received from the API
func (*AutosuggestSuggestResponseItemOpeningHoursTimeRangeEndTime) UnmarshalJSON ¶
func (r *AutosuggestSuggestResponseItemOpeningHoursTimeRangeEndTime) UnmarshalJSON(data []byte) error
type AutosuggestSuggestResponseItemOpeningHoursTimeRangeStartTime ¶
type AutosuggestSuggestResponseItemOpeningHoursTimeRangeStartTime struct { // The date to which the subsequent open time details belong to. Date string `json:"date"` // The hour of the day when the place opens. Hour int64 `json:"hour"` // The minute of the hour when the place opens. Minute int64 `json:"minute"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Date respjson.Field Hour respjson.Field Minute respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the open time details.
func (AutosuggestSuggestResponseItemOpeningHoursTimeRangeStartTime) RawJSON ¶
func (r AutosuggestSuggestResponseItemOpeningHoursTimeRangeStartTime) RawJSON() string
Returns the unmodified JSON received from the API
func (*AutosuggestSuggestResponseItemOpeningHoursTimeRangeStartTime) UnmarshalJSON ¶
func (r *AutosuggestSuggestResponseItemOpeningHoursTimeRangeStartTime) UnmarshalJSON(data []byte) error
type AutosuggestSuggestResponseItemScoring ¶
type AutosuggestSuggestResponseItemScoring struct { // A breakdown of how closely individual field of the result matched with the // provided query q. FieldScore any `json:"fieldScore"` // A score, out of 1, indicating how closely the result matches with the provided // query q . QueryScore float64 `json:"queryScore"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { FieldScore respjson.Field QueryScore respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Score of the result. A higher score indicates a closer match.
func (AutosuggestSuggestResponseItemScoring) RawJSON ¶
func (r AutosuggestSuggestResponseItemScoring) RawJSON() string
Returns the unmodified JSON received from the API
func (*AutosuggestSuggestResponseItemScoring) UnmarshalJSON ¶
func (r *AutosuggestSuggestResponseItemScoring) UnmarshalJSON(data []byte) error
type BatchGetParams ¶
type BatchGetParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Specify the track ID of the batch that was returned in the response after // submitting a successful batch request. TrackID string `query:"track_id,required" json:"-"` // contains filtered or unexported fields }
func (BatchGetParams) URLQuery ¶
func (r BatchGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes BatchGetParams's query parameters as `url.Values`.
type BatchGetResponse ¶
type BatchGetResponse struct { // Displays the error message in case of a failed request or operation. Please note // that this parameter is not returned in the response in case of a successful // request. Msg string `json:"msg"` // An array of objects returning the results of all the individual routing queries // specified in the input. Each object represents the solution to an individual // query in the input. Responses []BatchGetResponseResponse `json:"responses"` // Returns the overall status of the API request. Its value will always be one of // success, failed, and pending. Status string `json:"status"` // Returns the unique ID of the batch processing task. TrackID string `json:"track_id"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Msg respjson.Field Responses respjson.Field Status respjson.Field TrackID respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (BatchGetResponse) RawJSON ¶
func (r BatchGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BatchGetResponse) UnmarshalJSON ¶
func (r *BatchGetResponse) UnmarshalJSON(data []byte) error
type BatchGetResponseResponse ¶
type BatchGetResponseResponse struct { // An object returning the routing solution of an individual query. The JSON format // and structure of the response would vary depending on the routing endpoint used // in each individual query. However, it will be consistent with standard response // for a given routing endpoint. Response any `json:"response"` // Returns the HTTP status code for the individual routing request. See the // [API Errors Codes](#api-error-codes) section below for more information. StatusCode int64 `json:"status_code"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Response respjson.Field StatusCode respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (BatchGetResponseResponse) RawJSON ¶
func (r BatchGetResponseResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BatchGetResponseResponse) UnmarshalJSON ¶
func (r *BatchGetResponseResponse) UnmarshalJSON(data []byte) error
type BatchNewParams ¶
type BatchNewParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // An array of objects to collect the details of individual routing queries that // will form a batch. Requests []BatchNewParamsRequest `json:"requests,omitzero"` // contains filtered or unexported fields }
func (BatchNewParams) MarshalJSON ¶
func (r BatchNewParams) MarshalJSON() (data []byte, err error)
func (BatchNewParams) URLQuery ¶
func (r BatchNewParams) URLQuery() (v url.Values, err error)
URLQuery serializes BatchNewParams's query parameters as `url.Values`.
func (*BatchNewParams) UnmarshalJSON ¶
func (r *BatchNewParams) UnmarshalJSON(data []byte) error
type BatchNewParamsRequest ¶
type BatchNewParamsRequest struct { // Specify the routing query in the form of a string. The supported attributes and // their formats are consistent with the standard routing endpoint that is being // used as part of the batch. Check the // [Sample Request](https://docs.nextbillion.ai/docs/navigation/batch-routing-api#sample-request-1) // section for an example request. Query param.Opt[string] `json:"query,omitzero"` // contains filtered or unexported fields }
func (BatchNewParamsRequest) MarshalJSON ¶
func (r BatchNewParamsRequest) MarshalJSON() (data []byte, err error)
func (*BatchNewParamsRequest) UnmarshalJSON ¶
func (r *BatchNewParamsRequest) UnmarshalJSON(data []byte) error
type BatchNewResponse ¶
type BatchNewResponse struct { // Displays the error message in case of a failed request or operation. Please note // that this parameter is not returned in the response in case of a successful // request. Msg string `json:"msg"` // Returns the overall status of the API request. Its value will belong to one of // success, failed, and pending. It can also contain HTTP error codes in case of a // failed request or operation. Status string `json:"status"` // Returns the unique ID of the batch processing task. Use this ID using the GET // request to retrieve the solution once the task processing is completed. TrackID string `json:"track_id"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Msg respjson.Field Status respjson.Field TrackID respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (BatchNewResponse) RawJSON ¶
func (r BatchNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BatchNewResponse) UnmarshalJSON ¶
func (r *BatchNewResponse) UnmarshalJSON(data []byte) error
type BatchService ¶
type BatchService struct {
Options []option.RequestOption
}
BatchService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBatchService method instead.
func NewBatchService ¶
func NewBatchService(opts ...option.RequestOption) (r BatchService)
NewBatchService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*BatchService) Get ¶
func (r *BatchService) Get(ctx context.Context, query BatchGetParams, opts ...option.RequestOption) (res *BatchGetResponse, err error)
Get Batch Result
func (*BatchService) New ¶
func (r *BatchService) New(ctx context.Context, params BatchNewParams, opts ...option.RequestOption) (res *BatchNewResponse, err error)
Create Batch Routing
type BrowseSearchParams ¶
type BrowseSearchParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Specify the center of the search context expressed as coordinates. // // Please note that one of "at", "in=circle" or "in=bbox" should be provided for // relevant results. At param.Opt[string] `query:"at,omitzero" format:"latitude,longitude" json:"-"` // This is a category filter consisting of a comma-separated list of categories. // Places with any assigned categories that match any of the requested categories // are included in the response. Categories param.Opt[string] `query:"categories,omitzero" json:"-"` // Search within a geographic area. This is a hard filter. Results will be returned // if they are located within the specified area. // // # A geographic area can be // // - a country (or multiple countries), provided as comma-separated // [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country // codes // // The country codes are to be provided in all uppercase. // // Format: countryCode:{countryCode}[,{countryCode}] // // - a circular area, provided as latitude, longitude, and radius (an integer with // meters as unit) // // Format: circle:{latitude},{longitude};r={radius} // // - a bounding box, provided as _west longitude_, _south latitude_, _east // longitude_, _north latitude_ // // Format: bbox:{west longitude},{south latitude},{east longitude},{north // latitude} // // Please provide one of 'at', 'in=circle' or 'in=bbox' input for a relevant // result. In param.Opt[string] `query:"in,omitzero" json:"-"` // Select the language to be used for result rendering from a list of // [BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) compliant language // codes. Lang param.Opt[string] `query:"lang,omitzero" json:"-"` // Sets the maximum number of results to be returned. Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // contains filtered or unexported fields }
func (BrowseSearchParams) URLQuery ¶
func (r BrowseSearchParams) URLQuery() (v url.Values, err error)
URLQuery serializes BrowseSearchParams's query parameters as `url.Values`.
type BrowseSearchResponse ¶
type BrowseSearchResponse struct { // The results are presented as a JSON list of candidates in ranked order // (most-likely to least-likely) based on the matched location criteria. Items []BrowseSearchResponseItem `json:"items"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Items respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (BrowseSearchResponse) RawJSON ¶
func (r BrowseSearchResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*BrowseSearchResponse) UnmarshalJSON ¶
func (r *BrowseSearchResponse) UnmarshalJSON(data []byte) error
type BrowseSearchResponseItem ¶
type BrowseSearchResponseItem struct { // The unique identifier for the result item. ID string `json:"id"` // An array returning the location coordinates of all the access points of the // search result. Access Access `json:"access"` // Postal address of the result item. Address Address `json:"address"` // The list of categories assigned to this place. Categories []Categories `json:"categories"` // Contact information like phone, email or website. Contacts []Contacts `json:"contacts"` // The distance "as the crow flies" from the search center to this result item in // meters. Distance int64 `json:"distance"` // The bounding box enclosing the geometric shape (area or line) that an individual // result covers. place typed results have no mapView. MapView MapView `json:"mapView"` // Returns the operating hours of the place, if available. OpeningHours BrowseSearchResponseItemOpeningHours `json:"openingHours"` // Returns the location coordinates of the result. Position Position `json:"position"` // Score of the result. A higher score indicates a closer match. Scoring BrowseSearchResponseItemScoring `json:"scoring"` // The localized display name of this result item. Title string `json:"title"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Access respjson.Field Address respjson.Field Categories respjson.Field Contacts respjson.Field Distance respjson.Field MapView respjson.Field OpeningHours respjson.Field Position respjson.Field Scoring respjson.Field Title respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (BrowseSearchResponseItem) RawJSON ¶
func (r BrowseSearchResponseItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*BrowseSearchResponseItem) UnmarshalJSON ¶
func (r *BrowseSearchResponseItem) UnmarshalJSON(data []byte) error
type BrowseSearchResponseItemOpeningHours ¶
type BrowseSearchResponseItemOpeningHours struct { // A collection of attributes with details about the opening and closing hours for // each day of the week. TimeRanges []BrowseSearchResponseItemOpeningHoursTimeRange `json:"timeRanges"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { TimeRanges respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the operating hours of the place, if available.
func (BrowseSearchResponseItemOpeningHours) RawJSON ¶
func (r BrowseSearchResponseItemOpeningHours) RawJSON() string
Returns the unmodified JSON received from the API
func (*BrowseSearchResponseItemOpeningHours) UnmarshalJSON ¶
func (r *BrowseSearchResponseItemOpeningHours) UnmarshalJSON(data []byte) error
type BrowseSearchResponseItemOpeningHoursTimeRange ¶
type BrowseSearchResponseItemOpeningHoursTimeRange struct { // Returns the closing time details. EndTime BrowseSearchResponseItemOpeningHoursTimeRangeEndTime `json:"endTime"` // Returns the open time details. StartTime BrowseSearchResponseItemOpeningHoursTimeRangeStartTime `json:"startTime"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { EndTime respjson.Field StartTime respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (BrowseSearchResponseItemOpeningHoursTimeRange) RawJSON ¶
func (r BrowseSearchResponseItemOpeningHoursTimeRange) RawJSON() string
Returns the unmodified JSON received from the API
func (*BrowseSearchResponseItemOpeningHoursTimeRange) UnmarshalJSON ¶
func (r *BrowseSearchResponseItemOpeningHoursTimeRange) UnmarshalJSON(data []byte) error
type BrowseSearchResponseItemOpeningHoursTimeRangeEndTime ¶
type BrowseSearchResponseItemOpeningHoursTimeRangeEndTime struct { // The date to which the subsequent closing time details belong to. Date string `json:"date"` // The hour of the day when the place closes. Hour int64 `json:"hour"` // The minute of the hour when the place closes. Minute int64 `json:"minute"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Date respjson.Field Hour respjson.Field Minute respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the closing time details.
func (BrowseSearchResponseItemOpeningHoursTimeRangeEndTime) RawJSON ¶
func (r BrowseSearchResponseItemOpeningHoursTimeRangeEndTime) RawJSON() string
Returns the unmodified JSON received from the API
func (*BrowseSearchResponseItemOpeningHoursTimeRangeEndTime) UnmarshalJSON ¶
func (r *BrowseSearchResponseItemOpeningHoursTimeRangeEndTime) UnmarshalJSON(data []byte) error
type BrowseSearchResponseItemOpeningHoursTimeRangeStartTime ¶
type BrowseSearchResponseItemOpeningHoursTimeRangeStartTime struct { // The date to which the subsequent open time details belong to. Date string `json:"date"` // The hour of the day when the place opens. Hour int64 `json:"hour"` // The minute of the hour when the place opens. Minute int64 `json:"minute"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Date respjson.Field Hour respjson.Field Minute respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the open time details.
func (BrowseSearchResponseItemOpeningHoursTimeRangeStartTime) RawJSON ¶
func (r BrowseSearchResponseItemOpeningHoursTimeRangeStartTime) RawJSON() string
Returns the unmodified JSON received from the API
func (*BrowseSearchResponseItemOpeningHoursTimeRangeStartTime) UnmarshalJSON ¶
func (r *BrowseSearchResponseItemOpeningHoursTimeRangeStartTime) UnmarshalJSON(data []byte) error
type BrowseSearchResponseItemScoring ¶
type BrowseSearchResponseItemScoring struct { // A breakdown of how closely individual field of the result matched with the // provided query q. FieldScore any `json:"fieldScore"` // A score, out of 1, indicating how closely the result matches with the provided // query q . QueryScore float64 `json:"queryScore"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { FieldScore respjson.Field QueryScore respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Score of the result. A higher score indicates a closer match.
func (BrowseSearchResponseItemScoring) RawJSON ¶
func (r BrowseSearchResponseItemScoring) RawJSON() string
Returns the unmodified JSON received from the API
func (*BrowseSearchResponseItemScoring) UnmarshalJSON ¶
func (r *BrowseSearchResponseItemScoring) UnmarshalJSON(data []byte) error
type BrowseService ¶
type BrowseService struct {
Options []option.RequestOption
}
BrowseService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewBrowseService method instead.
func NewBrowseService ¶
func NewBrowseService(opts ...option.RequestOption) (r BrowseService)
NewBrowseService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*BrowseService) Search ¶
func (r *BrowseService) Search(ctx context.Context, query BrowseSearchParams, opts ...option.RequestOption) (res *BrowseSearchResponse, err error)
Browse a search area using a free text query
type Categories ¶
type Categories struct { // Identifier number for an associated category. ID string `json:"id"` // Name of the place category in the result item language. Name string `json:"name"` // Whether or not it is a primary category. This field is visible only when the // value is 'true'. Primary string `json:"primary"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Name respjson.Field Primary respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (Categories) RawJSON ¶
func (r Categories) RawJSON() string
Returns the unmodified JSON received from the API
func (*Categories) UnmarshalJSON ¶
func (r *Categories) UnmarshalJSON(data []byte) error
type Client ¶
type Client struct { Options []option.RequestOption Fleetify FleetifyService Skynet SkynetService Geocode GeocodeService Optimization OptimizationService Geofence GeofenceService Discover DiscoverService Browse BrowseService Mdm MdmService Isochrone IsochroneService Restrictions RestrictionService RestrictionsItems RestrictionsItemService DistanceMatrix DistanceMatrixService Autocomplete AutocompleteService Map MapService Autosuggest AutosuggestService Directions DirectionService Batch BatchService Multigeocode MultigeocodeService Revgeocode RevgeocodeService RouteReport RouteReportService SnapToRoads SnapToRoadService Postalcode PostalcodeService Lookup LookupService Areas AreaService }
Client creates a struct with services and top level methods that help with interacting with the nextbillion-sdk API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (NEXTBILLION_SDK_API_KEY, NEXTBILLION_SDK_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type ContactObject ¶
type ContactObject struct { // The list of place categories this contact refers to. Categories []ContactObjectCategory `json:"categories"` // Optional label for the contact string, such as "Customer Service" or "Pharmacy // Fax". Label string `json:"label"` // Contact information, as specified by the contact type. Value string `json:"value"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Categories respjson.Field Label respjson.Field Value respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (ContactObject) RawJSON ¶
func (r ContactObject) RawJSON() string
Returns the unmodified JSON received from the API
func (*ContactObject) UnmarshalJSON ¶
func (r *ContactObject) UnmarshalJSON(data []byte) error
type ContactObjectCategory ¶
type ContactObjectCategory struct { // Identifier number for an associated category. For example: "900-9300-0000" ID string `json:"id"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (ContactObjectCategory) RawJSON ¶
func (r ContactObjectCategory) RawJSON() string
Returns the unmodified JSON received from the API
func (*ContactObjectCategory) UnmarshalJSON ¶
func (r *ContactObjectCategory) UnmarshalJSON(data []byte) error
type Contacts ¶
type Contacts struct { Email []ContactObject `json:"email"` Fax []ContactObject `json:"fax"` Mobile []ContactObject `json:"mobile"` Phone []ContactObject `json:"phone"` TollFree []ContactObject `json:"tollFree"` Www []ContactObject `json:"www"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Email respjson.Field Fax respjson.Field Mobile respjson.Field Phone respjson.Field TollFree respjson.Field Www respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (*Contacts) UnmarshalJSON ¶
type DirectionComputeRouteParams ¶
type DirectionComputeRouteParams struct { Destination string `json:"destination,required"` Origin string `json:"origin,required"` // Sets the number of alternative routes to return. It is effective only when // alternatives=true. Default to 3. // // Please note that adding alternative route count does not guarantee matching // number of routes to be returned if potential alternative routes do not exist. Altcount param.Opt[int64] `json:"altcount,omitzero"` // When true the API will return alternate routes. // // The alternatives is effective only when there are no waypoints included in the // request. // // You can set the number of alternate routes to be returned in the altcount // property. Alternatives param.Opt[bool] `json:"alternatives,omitzero"` // A semicolon-separated list indicating the side of the road from which to // approach waypoints in a requested route. // // When set to unrestricted a route can arrive at the waypoint from either side of // the road and when set to curb the route will arrive at the waypoint on the // driving side of the region. // // Please note the number of values provided must be one more than the number of // waypoints. The last value of approaches will determine the approach for the // destination. However, you can skip a coordinate and show its position in the // list with the ; separator. Approaches param.Opt[string] `json:"approaches,omitzero"` // Limits the search to road segments with given bearing, in degrees, towards true // north in clockwise direction. Each bearings should be in the format of // degree,range, where the degree should be a value between \[0, 360\] and range // should be a value between \[0, 180\]. // // Please note that the number of bearings should be two more than the number of // waypoints. This is to account for the bearing of origin and destination. If a // route can approach a waypoint or the destination from any direction, the bearing // for that point can be specified as "0,180". Bearings param.Opt[string] `json:"bearings,omitzero"` // Requires option=flexible. // // Specify if crossing an international border is expected for operations near // border areas. When set to false, the API will prohibit routes crossing the // borders. When set to true, the service will return routes which cross the // borders between countries, if required for the given set destination and // waypoints. // // This feature is available in North America region only. Please get in touch with // [support@nextbillion.ai](mailto:support@nextbillion.ai) to enquire/enable other // areas. CrossBorder param.Opt[bool] `json:"cross_border,omitzero"` // Requires option=flexible. // // Use this parameter to set a departure time, expressed as UNIX epoch timestamp in // seconds, for calculating the isochrone contour. The response will consider the // typical traffic conditions at the given time and return a contour which can be // reached under those traffic conditions. // // Please note that if no input is provided for this parameter then the traffic // conditions at the time of making the request are considered. DepartureTime param.Opt[int64] `json:"departure_time,omitzero"` // Requires option=flexible. // // An array of durations, in seconds, for which the driver can drive continuously // before taking a rest. Multiple drive time limits can be separated by a comma // character ",". After driving for the given duration the driver will take a rest // for a fixed period, specified in rest_times . Once the rest duration is over, // the subsequent driving duration starts and the process continues until all drive // times and rest periods are exhausted or if the driver reaches the destination. // This feature is useful in complying with Hours of Service regulations and // calculates actual ETAs with regulated driving periods. // // As an example, a drive_time_limits=\[500, 300\] means that driver can drive for // 500 seconds before the first rest period and then drive for another 300 seconds // before taking a rest next time. // // \- If the trip duration is smaller than the first input of drive_time_limits, // then there will be no rest actions scheduled by the service. // \- If the trip duration is larger than the scheduled time, then a "warning" is // returned in the response - along with details of last leg of the trip - to // indicate the same. DriveTimeLimits param.Opt[string] `json:"drive_time_limits,omitzero"` // Requires option=flexible. // // An array of durations, in seconds, for which the driver should rest after // completing the corresponding continuous driving interval (provided in // drive_time_limits). Multiple rest times can be separated by a comma character // ",". Ideally, the number of rest_times provided should be equal to the number of // drive_time_limits provided for proper scheduling of driver breaks. // // As an example, a rest_times=\[500, 300\] means that driver can rest for 500 // seconds after the first continuous driving session and rest for 300 seconds // after the next continuous driving session. // // \- If the number of rest_times provided are less than the number of // drive_time_limits, the service will schedule a rest period of "0" seconds after // each such drive time period which does not have a corresponding entry in // rest_times. // \- If the number of rest_times provided is more than the number of drive times // provided, the additional rest times are never applied. RestTimes param.Opt[string] `json:"rest_times,omitzero"` // Set this to true to receive additional details about the routes and each of its // legs (details of geometry, start & end locations) in the response. Steps param.Opt[bool] `json:"steps,omitzero"` // Requires option=flexible. // // Specify the total load per axle (including the weight of trailers and shipped // goods) of the truck, in tonnes. When used, the service will return routes which // are legally allowed to carry the load specified per axle. // // Please note this parameter is effective only when mode=truck. TruckAxleLoad param.Opt[float64] `json:"truck_axle_load,omitzero"` // Requires option=flexible. // // This defines the dimensions of a truck in centimeters (CM). This parameter is // effective only when the mode=truck. Maximum dimensions are as follows: // // \- Height = 1000 cm // \- Width = 5000 cm // \- Length = 5000 cm TruckSize param.Opt[string] `json:"truck_size,omitzero" format:"height,width,length"` // Requires option=flexible. // // This parameter defines the weight of the truck including trailers and shipped // goods in kilograms (KG). This parameter is effective only when mode=truck. TruckWeight param.Opt[int64] `json:"truck_weight,omitzero"` // Requires option=flexible. // // Specify the turn angles that can be taken safely by the vehicle. The permissible // turn angles are calculated as \[0 + turn_angle_range , 360 - turn_angle_range\]. // Please note that this parameter is effective only when avoid=sharp_turn. // // It is worth highlighting here that providing smaller angles might lead to 4xx // errors as route engine might not be able find routes satisfying the smaller turn // angle criteria for all turns in the route. TurnAngleRange param.Opt[int64] `json:"turn_angle_range,omitzero"` // Pipe-separated list of coordinate pairs Waypoints param.Opt[string] `json:"waypoints,omitzero"` // When option=fast (by default): // // Setting this will ensure the route avoids ferries, tolls, highways or nothing. // Multiple values should be separated by a pipe "|". If none is provided along // with other values, an error is returned as a valid route is not feasible. // // Please note that when this parameter is not provided in the input, ferries are // set to be avoided by default. When this parameter is provided, only the // mentioned objects are avoided. // // When option=flexible: // // Set this parameter to find alternative routes that bypass specified objects. Use // a pipe "|" to separate multiple values. This is a flexible filter; if no // alternative routes exist, the service will still provide a route that includes // the objects. For a strict filter, consider using the exclude parameter. // // \- This parameter is effective only when route_type=fastest. // \- Following objects are exceptions to the flexible filtering behavior of avoid // parameter: bbox, tunnel and geofence_id. When used, the service will return an // error in case there are no alternative routes available. // \- When using avoid=bbox users also need to specify the boundaries of the // bounding box to be avoided. Multiple bounding boxes can be specified // simultaneously. The perimeter of a bounding box can not exceed 500 KM. Format: // bbox=min_latitude,min_longtitude,max_latitude,max_longitude. Example: // avoid=bbox: 34.0635,-118.2547, 34.0679,-118.2478 | bbox: 34.0521,-118.2342, // 34.0478,-118.2437 // \- When using avoid=sharp_turn, default range of permissible turn angles is // \[120,240\] in the clockwise direction from the current road. In order to // override default range, please use turn_angle_range parameter. // \- When using avoid=geofence_id, only the the geofences created using // [NextBillion.ai](http://NextBillion.ai) Geofence API are valid. // \- When this parameter is not provided in the input, ferry routes are set to be // avoided by default. When this parameter is provided, only the mentioned // object(s) are avoided. // \- If none is provided along with other values, an error is returned as a valid // route is not feasible. // // Any of "toll", "ferry", "highway", "none", "sharp_turn", "uturn", // "service_road", "left_turn", "right_turn", "bbox", "geofence_id", "tunnel". Avoid DirectionComputeRouteParamsAvoid `json:"avoid,omitzero"` // Requires option=flexible. // // Specify the emission class to which the vehicle (engine) belongs to. The service // will use this setting to generate routes that are permissible for that engine // class. Only the emission classifications in the EU regions are supported // currently. Please reach out to // [support@nextbillion.ai](mailto:support@nextbillion.ai) to enable for your // region. // // Any of "euro0", "euro1", "euro2", "euro3", "euro4", "euro5", "euro6", "euro7", // "euro8", "euro9". EmissionClass DirectionComputeRouteParamsEmissionClass `json:"emission_class,omitzero"` // Requires option=flexible. // // This parameter serves as a mandatory filter, ensuring the service returns only // those routes that strictly avoid the object(s) indicated. Multiple values should // be separated by a pipe |). If no routes can be found that exclude the specified // object(s), the service will return an error. For a less strict filtering // approach, consider using the avoid parameter. // // \- This parameter is effective only when route_type=fastest. // \- When using exclude=sharp_turn, default range of permissible turn angles is // \[120,240\]. In order to override default range, please use turn_angle_range // parameter. // \- If none is provided along with other values, an error is returned as a valid // route is not feasible. // // Any of "toll", "ferry", "highway", "service_road", "uturn", "sharp_turn", // "left_turn", "right_turn", "none". Exclude DirectionComputeRouteParamsExclude `json:"exclude,omitzero"` // Sets the output format of the route geometry in the response. // // On providing polyline and polyline6 as input, respective encoded geometry is // returned. However, when geojson is provided as the input value, polyline encoded // geometry is returned in the response along with the geojson details of the // route. // // Any of "polyline", "polyline6", "geojson". Geometry DirectionComputeRouteParamsGeometry `json:"geometry,omitzero"` // Requires option=flexible. // // Specify the type of hazardous material being carried and the service will avoid // roads which are not suitable for the type of goods specified. Multiple values // can be separated using a pipe operator "|". // // Please note that this parameter is effective only when mode=truck. // // Any of "general", "circumstantial", "explosive", "harmful_to_water". HazmatType DirectionComputeRouteParamsHazmatType `json:"hazmat_type,omitzero"` // Set the driving mode the service should use to determine a route. In "car" mode, // the API will return a route that a car can take. Using "truck" mode will return // a route a truck can use, taking into account appropriate truck routing // restrictions. // // When mode=truck, following are the default dimensions that are used: // // \- truck_height = 214 centimeters // \- truck_width = 183 centimeters // \- truck_length = 519 centimeters // \- truck_weight = 5000 kg // // When option=flexible, you can use custom truck dimensions with truck_weight and // truck_size parameters. // // Note: Only the car profile is enabled by default. Please note that customized // profiles (including truck) might not be available for all regions. Please // contact your [NextBillion.ai](http://NextBillion.ai) account manager, sales // representative or reach out at // [support@nextbillion.ai](mailto:support@nextbillion.ai) in case you need // additional profiles. // // Any of "car", "truck". Mode DirectionComputeRouteParamsMode `json:"mode,omitzero"` // The option parameter specifies the version of the directions service to use. // Setting option=flexible activates the Flexible API, which supports advanced // features like truck routing, time-based routing, route type selection // (fastest/shortest), and segment-wise speed limits. If not set, the API defaults // to the Fast version for real-time routing. // // Any of "fast", "flexible". Option DirectionComputeRouteParamsOption `json:"option,omitzero"` // Specify the verbosity of route geometry. // // When set to full, the most detailed geometry available is returned. When set to // simplified, a simplified version of the full geometry is returned. No overview // geometry is returned when set to false. // // Any of "full", "simplified", "false". Overview DirectionComputeRouteParamsOverview `json:"overview,omitzero"` // Requires option=flexible. // // Use this parameter to receive additional information about the road segments // returned in the response. Currently, following inputs are supported: // // \- max_speed : segment-wise maximum speed information of roads in the // response. // \- toll_distance : returns the total distance travelled on the road segments // having tolls. // \- toll_cost: returns the range of toll charges, in local currency, that can be // incurred for the suggested route. // // Any of "max_speed", "toll_distance", "toll_cost". RoadInfo DirectionComputeRouteParamsRoadInfo `json:"road_info,omitzero"` // Requires option=flexible. // // Set the route type that needs to be returned. // // Any of "fastest", "shortest". RouteType DirectionComputeRouteParamsRouteType `json:"route_type,omitzero"` // contains filtered or unexported fields }
func (DirectionComputeRouteParams) MarshalJSON ¶
func (r DirectionComputeRouteParams) MarshalJSON() (data []byte, err error)
func (*DirectionComputeRouteParams) UnmarshalJSON ¶
func (r *DirectionComputeRouteParams) UnmarshalJSON(data []byte) error
type DirectionComputeRouteParamsAvoid ¶
type DirectionComputeRouteParamsAvoid string
When option=fast (by default):
Setting this will ensure the route avoids ferries, tolls, highways or nothing. Multiple values should be separated by a pipe "|". If none is provided along with other values, an error is returned as a valid route is not feasible.
Please note that when this parameter is not provided in the input, ferries are set to be avoided by default. When this parameter is provided, only the mentioned objects are avoided.
When option=flexible:
Set this parameter to find alternative routes that bypass specified objects. Use a pipe "|" to separate multiple values. This is a flexible filter; if no alternative routes exist, the service will still provide a route that includes the objects. For a strict filter, consider using the exclude parameter.
\- This parameter is effective only when route_type=fastest. \- Following objects are exceptions to the flexible filtering behavior of avoid parameter: bbox, tunnel and geofence_id. When used, the service will return an error in case there are no alternative routes available. \- When using avoid=bbox users also need to specify the boundaries of the bounding box to be avoided. Multiple bounding boxes can be specified simultaneously. The perimeter of a bounding box can not exceed 500 KM. Format: bbox=min_latitude,min_longtitude,max_latitude,max_longitude. Example: avoid=bbox: 34.0635,-118.2547, 34.0679,-118.2478 | bbox: 34.0521,-118.2342, 34.0478,-118.2437 \- When using avoid=sharp_turn, default range of permissible turn angles is \[120,240\] in the clockwise direction from the current road. In order to override default range, please use turn_angle_range parameter. \- When using avoid=geofence_id, only the the geofences created using [NextBillion.ai](http://NextBillion.ai) Geofence API are valid. \- When this parameter is not provided in the input, ferry routes are set to be avoided by default. When this parameter is provided, only the mentioned object(s) are avoided. \- If none is provided along with other values, an error is returned as a valid route is not feasible.
const ( DirectionComputeRouteParamsAvoidToll DirectionComputeRouteParamsAvoid = "toll" DirectionComputeRouteParamsAvoidFerry DirectionComputeRouteParamsAvoid = "ferry" DirectionComputeRouteParamsAvoidHighway DirectionComputeRouteParamsAvoid = "highway" DirectionComputeRouteParamsAvoidNone DirectionComputeRouteParamsAvoid = "none" DirectionComputeRouteParamsAvoidSharpTurn DirectionComputeRouteParamsAvoid = "sharp_turn" DirectionComputeRouteParamsAvoidUturn DirectionComputeRouteParamsAvoid = "uturn" DirectionComputeRouteParamsAvoidServiceRoad DirectionComputeRouteParamsAvoid = "service_road" DirectionComputeRouteParamsAvoidLeftTurn DirectionComputeRouteParamsAvoid = "left_turn" DirectionComputeRouteParamsAvoidRightTurn DirectionComputeRouteParamsAvoid = "right_turn" DirectionComputeRouteParamsAvoidBbox DirectionComputeRouteParamsAvoid = "bbox" DirectionComputeRouteParamsAvoidGeofenceID DirectionComputeRouteParamsAvoid = "geofence_id" DirectionComputeRouteParamsAvoidTunnel DirectionComputeRouteParamsAvoid = "tunnel" )
type DirectionComputeRouteParamsEmissionClass ¶
type DirectionComputeRouteParamsEmissionClass string
Requires option=flexible.
Specify the emission class to which the vehicle (engine) belongs to. The service will use this setting to generate routes that are permissible for that engine class. Only the emission classifications in the EU regions are supported currently. Please reach out to [support@nextbillion.ai](mailto:support@nextbillion.ai) to enable for your region.
const ( DirectionComputeRouteParamsEmissionClassEuro0 DirectionComputeRouteParamsEmissionClass = "euro0" DirectionComputeRouteParamsEmissionClassEuro1 DirectionComputeRouteParamsEmissionClass = "euro1" DirectionComputeRouteParamsEmissionClassEuro2 DirectionComputeRouteParamsEmissionClass = "euro2" DirectionComputeRouteParamsEmissionClassEuro3 DirectionComputeRouteParamsEmissionClass = "euro3" DirectionComputeRouteParamsEmissionClassEuro4 DirectionComputeRouteParamsEmissionClass = "euro4" DirectionComputeRouteParamsEmissionClassEuro5 DirectionComputeRouteParamsEmissionClass = "euro5" DirectionComputeRouteParamsEmissionClassEuro6 DirectionComputeRouteParamsEmissionClass = "euro6" DirectionComputeRouteParamsEmissionClassEuro7 DirectionComputeRouteParamsEmissionClass = "euro7" DirectionComputeRouteParamsEmissionClassEuro8 DirectionComputeRouteParamsEmissionClass = "euro8" DirectionComputeRouteParamsEmissionClassEuro9 DirectionComputeRouteParamsEmissionClass = "euro9" )
type DirectionComputeRouteParamsExclude ¶
type DirectionComputeRouteParamsExclude string
Requires option=flexible.
This parameter serves as a mandatory filter, ensuring the service returns only those routes that strictly avoid the object(s) indicated. Multiple values should be separated by a pipe |). If no routes can be found that exclude the specified object(s), the service will return an error. For a less strict filtering approach, consider using the avoid parameter.
\- This parameter is effective only when route_type=fastest. \- When using exclude=sharp_turn, default range of permissible turn angles is \[120,240\]. In order to override default range, please use turn_angle_range parameter. \- If none is provided along with other values, an error is returned as a valid route is not feasible.
const ( DirectionComputeRouteParamsExcludeToll DirectionComputeRouteParamsExclude = "toll" DirectionComputeRouteParamsExcludeFerry DirectionComputeRouteParamsExclude = "ferry" DirectionComputeRouteParamsExcludeHighway DirectionComputeRouteParamsExclude = "highway" DirectionComputeRouteParamsExcludeServiceRoad DirectionComputeRouteParamsExclude = "service_road" DirectionComputeRouteParamsExcludeUturn DirectionComputeRouteParamsExclude = "uturn" DirectionComputeRouteParamsExcludeSharpTurn DirectionComputeRouteParamsExclude = "sharp_turn" DirectionComputeRouteParamsExcludeLeftTurn DirectionComputeRouteParamsExclude = "left_turn" DirectionComputeRouteParamsExcludeRightTurn DirectionComputeRouteParamsExclude = "right_turn" DirectionComputeRouteParamsExcludeNone DirectionComputeRouteParamsExclude = "none" )
type DirectionComputeRouteParamsGeometry ¶
type DirectionComputeRouteParamsGeometry string
Sets the output format of the route geometry in the response.
On providing polyline and polyline6 as input, respective encoded geometry is returned. However, when geojson is provided as the input value, polyline encoded geometry is returned in the response along with the geojson details of the route.
const ( DirectionComputeRouteParamsGeometryPolyline DirectionComputeRouteParamsGeometry = "polyline" DirectionComputeRouteParamsGeometryPolyline6 DirectionComputeRouteParamsGeometry = "polyline6" DirectionComputeRouteParamsGeometryGeojson DirectionComputeRouteParamsGeometry = "geojson" )
type DirectionComputeRouteParamsHazmatType ¶
type DirectionComputeRouteParamsHazmatType string
Requires option=flexible.
Specify the type of hazardous material being carried and the service will avoid roads which are not suitable for the type of goods specified. Multiple values can be separated using a pipe operator "|".
Please note that this parameter is effective only when mode=truck.
const ( DirectionComputeRouteParamsHazmatTypeGeneral DirectionComputeRouteParamsHazmatType = "general" DirectionComputeRouteParamsHazmatTypeCircumstantial DirectionComputeRouteParamsHazmatType = "circumstantial" DirectionComputeRouteParamsHazmatTypeExplosive DirectionComputeRouteParamsHazmatType = "explosive" DirectionComputeRouteParamsHazmatTypeHarmfulToWater DirectionComputeRouteParamsHazmatType = "harmful_to_water" )
type DirectionComputeRouteParamsMode ¶
type DirectionComputeRouteParamsMode string
Set the driving mode the service should use to determine a route. In "car" mode, the API will return a route that a car can take. Using "truck" mode will return a route a truck can use, taking into account appropriate truck routing restrictions.
When mode=truck, following are the default dimensions that are used:
\- truck_height = 214 centimeters \- truck_width = 183 centimeters \- truck_length = 519 centimeters \- truck_weight = 5000 kg
When option=flexible, you can use custom truck dimensions with truck_weight and truck_size parameters.
Note: Only the car profile is enabled by default. Please note that customized profiles (including truck) might not be available for all regions. Please contact your [NextBillion.ai](http://NextBillion.ai) account manager, sales representative or reach out at [support@nextbillion.ai](mailto:support@nextbillion.ai) in case you need additional profiles.
const ( DirectionComputeRouteParamsModeCar DirectionComputeRouteParamsMode = "car" DirectionComputeRouteParamsModeTruck DirectionComputeRouteParamsMode = "truck" )
type DirectionComputeRouteParamsOption ¶
type DirectionComputeRouteParamsOption string
The option parameter specifies the version of the directions service to use. Setting option=flexible activates the Flexible API, which supports advanced features like truck routing, time-based routing, route type selection (fastest/shortest), and segment-wise speed limits. If not set, the API defaults to the Fast version for real-time routing.
const ( DirectionComputeRouteParamsOptionFast DirectionComputeRouteParamsOption = "fast" DirectionComputeRouteParamsOptionFlexible DirectionComputeRouteParamsOption = "flexible" )
type DirectionComputeRouteParamsOverview ¶
type DirectionComputeRouteParamsOverview string
Specify the verbosity of route geometry.
When set to full, the most detailed geometry available is returned. When set to simplified, a simplified version of the full geometry is returned. No overview geometry is returned when set to false.
const ( DirectionComputeRouteParamsOverviewFull DirectionComputeRouteParamsOverview = "full" DirectionComputeRouteParamsOverviewSimplified DirectionComputeRouteParamsOverview = "simplified" DirectionComputeRouteParamsOverviewFalse DirectionComputeRouteParamsOverview = "false" )
type DirectionComputeRouteParamsRoadInfo ¶
type DirectionComputeRouteParamsRoadInfo string
Requires option=flexible.
Use this parameter to receive additional information about the road segments returned in the response. Currently, following inputs are supported:
\- max_speed : segment-wise maximum speed information of roads in the response. \- toll_distance : returns the total distance travelled on the road segments having tolls. \- toll_cost: returns the range of toll charges, in local currency, that can be incurred for the suggested route.
const ( DirectionComputeRouteParamsRoadInfoMaxSpeed DirectionComputeRouteParamsRoadInfo = "max_speed" DirectionComputeRouteParamsRoadInfoTollDistance DirectionComputeRouteParamsRoadInfo = "toll_distance" DirectionComputeRouteParamsRoadInfoTollCost DirectionComputeRouteParamsRoadInfo = "toll_cost" )
type DirectionComputeRouteParamsRouteType ¶
type DirectionComputeRouteParamsRouteType string
Requires option=flexible.
Set the route type that needs to be returned.
const ( DirectionComputeRouteParamsRouteTypeFastest DirectionComputeRouteParamsRouteType = "fastest" DirectionComputeRouteParamsRouteTypeShortest DirectionComputeRouteParamsRouteType = "shortest" )
type DirectionComputeRouteResponse ¶
type DirectionComputeRouteResponse struct { // Displays the error message in case of a failed request or operation. Please note // that this parameter is not returned in the response in case of a successful // request. Msg string `json:"msg"` // An object containing details about the returned route. Will contain multiple // objects if more than one routes are present in the response. Route DirectionComputeRouteResponseRoute `json:"route"` // A string indicating the state of the response. On normal responses, the value // will be Ok. Indicative HTTP error codes are returned for different errors. See // the [API Errors Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Msg respjson.Field Route respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (DirectionComputeRouteResponse) RawJSON ¶
func (r DirectionComputeRouteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponse) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponse) UnmarshalJSON(data []byte) error
type DirectionComputeRouteResponseRoute ¶
type DirectionComputeRouteResponseRoute struct { // The distance, in meters, for the complete trip. Distance float64 `json:"distance"` // The duration, in seconds, of the complete trip. Duration float64 `json:"duration"` // Location coordinates of the point where the route ends. It is the same as the // destination in the input request. Returned only when steps is true in the input // request. EndLocation DirectionComputeRouteResponseRouteEndLocation `json:"end_location"` // An object with geoJSON details of the route. This object is returned when the // geometry field is set to geojson in the input request, otherwise it is not // present in the response. The contents of this object follow the // [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946). Geojson DirectionComputeRouteResponseRouteGeojson `json:"geojson"` // Encoded geometry of the returned route in the selected format and specified // overview verbosity. This parameter is configured in the input request. Geometry string `json:"geometry"` // An array of objects returning the details about each leg of the route. waypoints // split the route into legs. Legs []DirectionComputeRouteResponseRouteLeg `json:"legs"` // Location coordinates of the point where the route starts. It is the same as the // origin in the input request. Returned only when steps is true in the input // request. StartLocation DirectionComputeRouteResponseRouteStartLocation `json:"start_location"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Distance respjson.Field Duration respjson.Field EndLocation respjson.Field Geojson respjson.Field Geometry respjson.Field Legs respjson.Field StartLocation respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object containing details about the returned route. Will contain multiple objects if more than one routes are present in the response.
func (DirectionComputeRouteResponseRoute) RawJSON ¶
func (r DirectionComputeRouteResponseRoute) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponseRoute) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponseRoute) UnmarshalJSON(data []byte) error
type DirectionComputeRouteResponseRouteEndLocation ¶
type DirectionComputeRouteResponseRouteEndLocation struct { // latitude of the start_location. Latitude float64 `json:"latitude"` // longitude of the start_location. Longitude float64 `json:"longitude"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Latitude respjson.Field Longitude respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Location coordinates of the point where the route ends. It is the same as the destination in the input request. Returned only when steps is true in the input request.
func (DirectionComputeRouteResponseRouteEndLocation) RawJSON ¶
func (r DirectionComputeRouteResponseRouteEndLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponseRouteEndLocation) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponseRouteEndLocation) UnmarshalJSON(data []byte) error
type DirectionComputeRouteResponseRouteGeojson ¶
type DirectionComputeRouteResponseRouteGeojson struct { // An object with details of the geoJSON geometry of the route. Geometry DirectionComputeRouteResponseRouteGeojsonGeometry `json:"geometry"` // Property associated with the geoJSON shape. Properties string `json:"properties"` // Type of the geoJSON object. Type string `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Geometry respjson.Field Properties respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with geoJSON details of the route. This object is returned when the geometry field is set to geojson in the input request, otherwise it is not present in the response. The contents of this object follow the [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946).
func (DirectionComputeRouteResponseRouteGeojson) RawJSON ¶
func (r DirectionComputeRouteResponseRouteGeojson) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponseRouteGeojson) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponseRouteGeojson) UnmarshalJSON(data []byte) error
type DirectionComputeRouteResponseRouteGeojsonGeometry ¶
type DirectionComputeRouteResponseRouteGeojsonGeometry struct { // An array of coordinates in the [longitude, latitude] format, representing the // route geometry. Coordinates []float64 `json:"coordinates"` // Type of the geoJSON geometry. Type string `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Coordinates respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with details of the geoJSON geometry of the route.
func (DirectionComputeRouteResponseRouteGeojsonGeometry) RawJSON ¶
func (r DirectionComputeRouteResponseRouteGeojsonGeometry) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponseRouteGeojsonGeometry) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponseRouteGeojsonGeometry) UnmarshalJSON(data []byte) error
type DirectionComputeRouteResponseRouteLeg ¶
type DirectionComputeRouteResponseRouteLeg struct { // An object containing leg distance value, in meters. Distance DirectionComputeRouteResponseRouteLegDistance `json:"distance"` // An object containing leg duration value, in seconds. Duration DirectionComputeRouteResponseRouteLegDuration `json:"duration"` // Location coordinates of the point where the leg ends. Returned only when steps // is true in the input request. EndLocation DirectionComputeRouteResponseRouteLegEndLocation `json:"end_location"` // Location coordinates of the point where the leg starts. Returned only when steps // is true in the input request. StartLocation DirectionComputeRouteResponseRouteLegStartLocation `json:"start_location"` // An array of objects with details of each step of the legs. Returned only when // steps is true in the input request. An empty array is returned when steps is // false in the input request. Steps []DirectionComputeRouteResponseRouteLegStep `json:"steps"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Distance respjson.Field Duration respjson.Field EndLocation respjson.Field StartLocation respjson.Field Steps respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (DirectionComputeRouteResponseRouteLeg) RawJSON ¶
func (r DirectionComputeRouteResponseRouteLeg) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponseRouteLeg) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponseRouteLeg) UnmarshalJSON(data []byte) error
type DirectionComputeRouteResponseRouteLegDistance ¶
type DirectionComputeRouteResponseRouteLegDistance struct { Value float64 `json:"value"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Value respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object containing leg distance value, in meters.
func (DirectionComputeRouteResponseRouteLegDistance) RawJSON ¶
func (r DirectionComputeRouteResponseRouteLegDistance) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponseRouteLegDistance) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponseRouteLegDistance) UnmarshalJSON(data []byte) error
type DirectionComputeRouteResponseRouteLegDuration ¶
type DirectionComputeRouteResponseRouteLegDuration struct { Value float64 `json:"value"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Value respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object containing leg duration value, in seconds.
func (DirectionComputeRouteResponseRouteLegDuration) RawJSON ¶
func (r DirectionComputeRouteResponseRouteLegDuration) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponseRouteLegDuration) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponseRouteLegDuration) UnmarshalJSON(data []byte) error
type DirectionComputeRouteResponseRouteLegEndLocation ¶
type DirectionComputeRouteResponseRouteLegEndLocation struct { // Latitude of the end_location of the leg. Latitude float64 `json:"latitude"` // Longitude of the end_location of the leg. Longitude float64 `json:"longitude"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Latitude respjson.Field Longitude respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Location coordinates of the point where the leg ends. Returned only when steps is true in the input request.
func (DirectionComputeRouteResponseRouteLegEndLocation) RawJSON ¶
func (r DirectionComputeRouteResponseRouteLegEndLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponseRouteLegEndLocation) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponseRouteLegEndLocation) UnmarshalJSON(data []byte) error
type DirectionComputeRouteResponseRouteLegStartLocation ¶
type DirectionComputeRouteResponseRouteLegStartLocation struct { // Latitude of the start_location of the leg. Latitude float64 `json:"latitude"` // Longitude of the start_location of the leg. Longitude float64 `json:"longitude"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Latitude respjson.Field Longitude respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Location coordinates of the point where the leg starts. Returned only when steps is true in the input request.
func (DirectionComputeRouteResponseRouteLegStartLocation) RawJSON ¶
func (r DirectionComputeRouteResponseRouteLegStartLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponseRouteLegStartLocation) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponseRouteLegStartLocation) UnmarshalJSON(data []byte) error
type DirectionComputeRouteResponseRouteLegStep ¶
type DirectionComputeRouteResponseRouteLegStep struct { // An object containing step distance value, in meters. Distance DirectionComputeRouteResponseRouteLegStepDistance `json:"distance"` // An object containing step duration value, in seconds. Duration DirectionComputeRouteResponseRouteLegStepDuration `json:"duration"` // Location coordinates of the point where the step ends. EndLocation DirectionComputeRouteResponseRouteLegStepEndLocation `json:"end_location"` // An object with geoJSON details of the step.This object is returned when the // geometry field is set to geojson in the input request, otherwise it is not // present in the response. The contents of this object follow the // [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946). Geojson DirectionComputeRouteResponseRouteLegStepGeojson `json:"geojson"` // Encoded geometry of the step in the selected format. Geometry string `json:"geometry"` // An object with maneuver details for the step. Maneuver DirectionComputeRouteResponseRouteLegStepManeuver `json:"maneuver"` // Location coordinates of the point where the step starts. StartLocation DirectionComputeRouteResponseRouteLegStepStartLocation `json:"start_location"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Distance respjson.Field Duration respjson.Field EndLocation respjson.Field Geojson respjson.Field Geometry respjson.Field Maneuver respjson.Field StartLocation respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (DirectionComputeRouteResponseRouteLegStep) RawJSON ¶
func (r DirectionComputeRouteResponseRouteLegStep) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponseRouteLegStep) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponseRouteLegStep) UnmarshalJSON(data []byte) error
type DirectionComputeRouteResponseRouteLegStepDistance ¶
type DirectionComputeRouteResponseRouteLegStepDistance struct { Value float64 `json:"value"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Value respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object containing step distance value, in meters.
func (DirectionComputeRouteResponseRouteLegStepDistance) RawJSON ¶
func (r DirectionComputeRouteResponseRouteLegStepDistance) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponseRouteLegStepDistance) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponseRouteLegStepDistance) UnmarshalJSON(data []byte) error
type DirectionComputeRouteResponseRouteLegStepDuration ¶
type DirectionComputeRouteResponseRouteLegStepDuration struct { Value float64 `json:"value"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Value respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object containing step duration value, in seconds.
func (DirectionComputeRouteResponseRouteLegStepDuration) RawJSON ¶
func (r DirectionComputeRouteResponseRouteLegStepDuration) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponseRouteLegStepDuration) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponseRouteLegStepDuration) UnmarshalJSON(data []byte) error
type DirectionComputeRouteResponseRouteLegStepEndLocation ¶
type DirectionComputeRouteResponseRouteLegStepEndLocation struct { // Latitude of the end_location of the step. Latitude float64 `json:"latitude"` // Longitude of the end_location of the step. Longitude float64 `json:"longitude"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Latitude respjson.Field Longitude respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Location coordinates of the point where the step ends.
func (DirectionComputeRouteResponseRouteLegStepEndLocation) RawJSON ¶
func (r DirectionComputeRouteResponseRouteLegStepEndLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponseRouteLegStepEndLocation) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponseRouteLegStepEndLocation) UnmarshalJSON(data []byte) error
type DirectionComputeRouteResponseRouteLegStepGeojson ¶
type DirectionComputeRouteResponseRouteLegStepGeojson struct { // An object with details of the geoJSON geometry of the step. Geometry DirectionComputeRouteResponseRouteLegStepGeojsonGeometry `json:"geometry"` // Property associated with the geoJSON shape. Properties string `json:"properties"` // Type of the geoJSON object. Type string `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Geometry respjson.Field Properties respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with geoJSON details of the step.This object is returned when the geometry field is set to geojson in the input request, otherwise it is not present in the response. The contents of this object follow the [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946).
func (DirectionComputeRouteResponseRouteLegStepGeojson) RawJSON ¶
func (r DirectionComputeRouteResponseRouteLegStepGeojson) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponseRouteLegStepGeojson) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponseRouteLegStepGeojson) UnmarshalJSON(data []byte) error
type DirectionComputeRouteResponseRouteLegStepGeojsonGeometry ¶
type DirectionComputeRouteResponseRouteLegStepGeojsonGeometry struct { // An array of coordinates in the [longitude, latitude] format, representing the // step geometry. Coordinates []float64 `json:"coordinates"` // Type of the geoJSON geometry. Type string `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Coordinates respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with details of the geoJSON geometry of the step.
func (DirectionComputeRouteResponseRouteLegStepGeojsonGeometry) RawJSON ¶
func (r DirectionComputeRouteResponseRouteLegStepGeojsonGeometry) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponseRouteLegStepGeojsonGeometry) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponseRouteLegStepGeojsonGeometry) UnmarshalJSON(data []byte) error
type DirectionComputeRouteResponseRouteLegStepManeuver ¶
type DirectionComputeRouteResponseRouteLegStepManeuver struct { // The clockwise angle from true north to the direction of travel immediately after // the maneuver. Range of values is between 0-359. BearingAfter int64 `json:"bearing_after"` // The clockwise angle from true north to the direction of travel immediately // before the maneuver. Range of values is between 0-359. BearingBefore int64 `json:"bearing_before"` // A coordinate pair describing the location of the maneuver. Coordinate DirectionComputeRouteResponseRouteLegStepManeuverCoordinate `json:"coordinate"` // A string indicating the type of maneuver. ManeuverType string `json:"maneuver_type"` // Modifier associated with maneuver_type. Modifier string `json:"modifier"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { BearingAfter respjson.Field BearingBefore respjson.Field Coordinate respjson.Field ManeuverType respjson.Field Modifier respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with maneuver details for the step.
func (DirectionComputeRouteResponseRouteLegStepManeuver) RawJSON ¶
func (r DirectionComputeRouteResponseRouteLegStepManeuver) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponseRouteLegStepManeuver) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponseRouteLegStepManeuver) UnmarshalJSON(data []byte) error
type DirectionComputeRouteResponseRouteLegStepManeuverCoordinate ¶
type DirectionComputeRouteResponseRouteLegStepManeuverCoordinate struct { // Latitude of the maneuver location. Latitude float64 `json:"latitude"` // Longitude of the maneuver location. Longitude float64 `json:"longitude"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Latitude respjson.Field Longitude respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
A coordinate pair describing the location of the maneuver.
func (DirectionComputeRouteResponseRouteLegStepManeuverCoordinate) RawJSON ¶
func (r DirectionComputeRouteResponseRouteLegStepManeuverCoordinate) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponseRouteLegStepManeuverCoordinate) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponseRouteLegStepManeuverCoordinate) UnmarshalJSON(data []byte) error
type DirectionComputeRouteResponseRouteLegStepStartLocation ¶
type DirectionComputeRouteResponseRouteLegStepStartLocation struct { // Latitude of the start_location of the step. Latitude float64 `json:"latitude"` // Longitude of the start_location of the step. Longitude float64 `json:"longitude"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Latitude respjson.Field Longitude respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Location coordinates of the point where the step starts.
func (DirectionComputeRouteResponseRouteLegStepStartLocation) RawJSON ¶
func (r DirectionComputeRouteResponseRouteLegStepStartLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponseRouteLegStepStartLocation) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponseRouteLegStepStartLocation) UnmarshalJSON(data []byte) error
type DirectionComputeRouteResponseRouteStartLocation ¶
type DirectionComputeRouteResponseRouteStartLocation struct { // Latitude of the start_location. Latitude float64 `json:"latitude"` // Longitude of the start_location. Longitude float64 `json:"longitude"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Latitude respjson.Field Longitude respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Location coordinates of the point where the route starts. It is the same as the origin in the input request. Returned only when steps is true in the input request.
func (DirectionComputeRouteResponseRouteStartLocation) RawJSON ¶
func (r DirectionComputeRouteResponseRouteStartLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*DirectionComputeRouteResponseRouteStartLocation) UnmarshalJSON ¶
func (r *DirectionComputeRouteResponseRouteStartLocation) UnmarshalJSON(data []byte) error
type DirectionService ¶
type DirectionService struct {
Options []option.RequestOption
}
DirectionService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewDirectionService method instead.
func NewDirectionService ¶
func NewDirectionService(opts ...option.RequestOption) (r DirectionService)
NewDirectionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*DirectionService) ComputeRoute ¶
func (r *DirectionService) ComputeRoute(ctx context.Context, body DirectionComputeRouteParams, opts ...option.RequestOption) (res *DirectionComputeRouteResponse, err error)
Directions API is a service that computes a route with given coordinates.
type DiscoverGetParams ¶
type DiscoverGetParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Specify the free-text search query. // // Please note that whitespace, urls, email addresses, or other out-of-scope // queries will yield no results. Q string `query:"q,required" json:"-"` // Specify the center of the search context expressed as coordinates. // // Please note that one of "at", "in=circle" or "in=bbox" should be provided for // relevant results. At param.Opt[string] `query:"at,omitzero" format:"latitude,longitude" json:"-"` // Search within a geographic area. This is a hard filter. Results will be returned // if they are located within the specified area. // // # A geographic area can be // // - a country (or multiple countries), provided as comma-separated // [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country // codes // // The country codes are to be provided in all uppercase. // // Format: countryCode:{countryCode}[,{countryCode}] // // - a circular area, provided as latitude, longitude, and radius (an integer with // meters as unit) // // Format: circle:{latitude},{longitude};r={radius} // // - a bounding box, provided as _west longitude_, _south latitude_, _east // longitude_, _north latitude_ // // Format: bbox:{west longitude},{south latitude},{east longitude},{north // latitude} // // Please provide one of 'at', 'in=circle' or 'in=bbox' input for a relevant // result. In param.Opt[string] `query:"in,omitzero" json:"-"` // Select the language to be used for result rendering from a list of // [BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) compliant language // codes. Lang param.Opt[string] `query:"lang,omitzero" json:"-"` // Sets the maximum number of results to be returned. Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // contains filtered or unexported fields }
func (DiscoverGetParams) URLQuery ¶
func (r DiscoverGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes DiscoverGetParams's query parameters as `url.Values`.
type DiscoverGetResponse ¶
type DiscoverGetResponse struct { // The results are presented as a JSON list of candidates in ranked order // (most-likely to least-likely) based on the matched location criteria. Items []DiscoverGetResponseItem `json:"items"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Items respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (DiscoverGetResponse) RawJSON ¶
func (r DiscoverGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DiscoverGetResponse) UnmarshalJSON ¶
func (r *DiscoverGetResponse) UnmarshalJSON(data []byte) error
type DiscoverGetResponseItem ¶
type DiscoverGetResponseItem struct { // The unique identifier for the result item. ID string `json:"id"` // An array returning the location coordinates of all the access points of the // search result. Access Access `json:"access"` // Postal address of the result item. Address Address `json:"address"` // The list of categories assigned to this place. Categories []Categories `json:"categories"` // Contact information like phone, email or website. Contacts []Contacts `json:"contacts"` // The distance "as the crow flies" from the search center to this result item in // meters. Distance int64 `json:"distance"` // The bounding box enclosing the geometric shape (area or line) that an individual // result covers. place typed results have no mapView. MapView MapView `json:"mapView"` // Returns the operating hours of the place, if available. OpeningHours DiscoverGetResponseItemOpeningHours `json:"openingHours"` // Returns the location coordinates of the result. Position Position `json:"position"` // Score of the result. A higher score indicates a closer match. Scoring DiscoverGetResponseItemScoring `json:"scoring"` // The localized display name of this result item. Title string `json:"title"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Access respjson.Field Address respjson.Field Categories respjson.Field Contacts respjson.Field Distance respjson.Field MapView respjson.Field OpeningHours respjson.Field Position respjson.Field Scoring respjson.Field Title respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (DiscoverGetResponseItem) RawJSON ¶
func (r DiscoverGetResponseItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*DiscoverGetResponseItem) UnmarshalJSON ¶
func (r *DiscoverGetResponseItem) UnmarshalJSON(data []byte) error
type DiscoverGetResponseItemOpeningHours ¶
type DiscoverGetResponseItemOpeningHours struct { // A collection of attributes with details about the opening and closing hours for // each day of the week. TimeRanges []DiscoverGetResponseItemOpeningHoursTimeRange `json:"timeRanges"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { TimeRanges respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the operating hours of the place, if available.
func (DiscoverGetResponseItemOpeningHours) RawJSON ¶
func (r DiscoverGetResponseItemOpeningHours) RawJSON() string
Returns the unmodified JSON received from the API
func (*DiscoverGetResponseItemOpeningHours) UnmarshalJSON ¶
func (r *DiscoverGetResponseItemOpeningHours) UnmarshalJSON(data []byte) error
type DiscoverGetResponseItemOpeningHoursTimeRange ¶
type DiscoverGetResponseItemOpeningHoursTimeRange struct { // Returns the closing time details. EndTime DiscoverGetResponseItemOpeningHoursTimeRangeEndTime `json:"endTime"` // Returns the open time details. StartTime DiscoverGetResponseItemOpeningHoursTimeRangeStartTime `json:"startTime"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { EndTime respjson.Field StartTime respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (DiscoverGetResponseItemOpeningHoursTimeRange) RawJSON ¶
func (r DiscoverGetResponseItemOpeningHoursTimeRange) RawJSON() string
Returns the unmodified JSON received from the API
func (*DiscoverGetResponseItemOpeningHoursTimeRange) UnmarshalJSON ¶
func (r *DiscoverGetResponseItemOpeningHoursTimeRange) UnmarshalJSON(data []byte) error
type DiscoverGetResponseItemOpeningHoursTimeRangeEndTime ¶
type DiscoverGetResponseItemOpeningHoursTimeRangeEndTime struct { // The date to which the subsequent closing time details belong to. Date string `json:"date"` // The hour of the day when the place closes. Hour int64 `json:"hour"` // The minute of the hour when the place closes. Minute int64 `json:"minute"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Date respjson.Field Hour respjson.Field Minute respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the closing time details.
func (DiscoverGetResponseItemOpeningHoursTimeRangeEndTime) RawJSON ¶
func (r DiscoverGetResponseItemOpeningHoursTimeRangeEndTime) RawJSON() string
Returns the unmodified JSON received from the API
func (*DiscoverGetResponseItemOpeningHoursTimeRangeEndTime) UnmarshalJSON ¶
func (r *DiscoverGetResponseItemOpeningHoursTimeRangeEndTime) UnmarshalJSON(data []byte) error
type DiscoverGetResponseItemOpeningHoursTimeRangeStartTime ¶
type DiscoverGetResponseItemOpeningHoursTimeRangeStartTime struct { // The date to which the subsequent open time details belong to. Date string `json:"date"` // The hour of the day when the place opens. Hour int64 `json:"hour"` // The minute of the hour when the place opens. Minute int64 `json:"minute"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Date respjson.Field Hour respjson.Field Minute respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the open time details.
func (DiscoverGetResponseItemOpeningHoursTimeRangeStartTime) RawJSON ¶
func (r DiscoverGetResponseItemOpeningHoursTimeRangeStartTime) RawJSON() string
Returns the unmodified JSON received from the API
func (*DiscoverGetResponseItemOpeningHoursTimeRangeStartTime) UnmarshalJSON ¶
func (r *DiscoverGetResponseItemOpeningHoursTimeRangeStartTime) UnmarshalJSON(data []byte) error
type DiscoverGetResponseItemScoring ¶
type DiscoverGetResponseItemScoring struct { // A breakdown of how closely individual field of the result matched with the // provided query q. FieldScore any `json:"fieldScore"` // A score, out of 1, indicating how closely the result matches with the provided // query q . QueryScore float64 `json:"queryScore"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { FieldScore respjson.Field QueryScore respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Score of the result. A higher score indicates a closer match.
func (DiscoverGetResponseItemScoring) RawJSON ¶
func (r DiscoverGetResponseItemScoring) RawJSON() string
Returns the unmodified JSON received from the API
func (*DiscoverGetResponseItemScoring) UnmarshalJSON ¶
func (r *DiscoverGetResponseItemScoring) UnmarshalJSON(data []byte) error
type DiscoverService ¶
type DiscoverService struct {
Options []option.RequestOption
}
DiscoverService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewDiscoverService method instead.
func NewDiscoverService ¶
func NewDiscoverService(opts ...option.RequestOption) (r DiscoverService)
NewDiscoverService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*DiscoverService) Get ¶
func (r *DiscoverService) Get(ctx context.Context, query DiscoverGetParams, opts ...option.RequestOption) (res *DiscoverGetResponse, err error)
Discover matching places
type DistanceMatrixJsonGetParams ¶
type DistanceMatrixJsonGetParams struct { // "destinations" are the ending coordinates of your route. Ensure that // "destinations" are routable land locations. Multiple "destinations" should be // separated by a pipe symbol "|". Destinations string `query:"destinations,required" format:"latitude_1, longitue_1|latitude_2, longitude_2|..." json:"-"` // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // "origins" are the starting point of your route. Ensure that "origins" are // routable land locations. Multiple "origins" should be separated by a pipe symbol // "|". Origins string `query:"origins,required" format:"latitude_1,longitude_1|latitude_2,longitude_2|..." json:"-"` // Limits the search to segments with given bearing in degrees towards true north // in clockwise direction. Each "bearing" should be in the format of // "degree,range", where the "degree" should be a value between \[0, 360\] and // "range" should be a value between \[0, 180\]. Please note that the number of // "bearings" should be equal to the sum of the number of points in "origins" and // "destinations". If a route can approach a destination from any direction, the // bearing for that point can be specified as "0,180". Bearings param.Opt[string] `query:"bearings,omitzero" format:"degree_0,range_0;degree_1,range_1;..." json:"-"` // A prompt to modify the response in case no feasible route is available for a // given pair of origin and destination. When set to "true", a value of "-1" is // returned for those pairs in which: // // \- Either origin or the destination can not be snapped to a nearest road. Please // note that if all the origins and destinations in a request can't be snapped to // their nearest roads, a 4xx error is returned instead, as the entire request // failed. // // \- Both origin and destination can be snapped to the nearest road, but the // service can't find a valid route between them. However, a value of "0" is // returned if both the origin and destination are snapped to the same location. // // "false" is the default value. In this case, a "0" value is returned for all the // above cases. A 4xx error is returned, in this case as well, when all origins and // destinations in the request can't be snapped to their nearest road. RouteFailedPrompt param.Opt[bool] `query:"route_failed_prompt,omitzero" json:"-"` // A semicolon-separated list indicating the side of the road from which the route // will approach "destinations". When set to "unrestricted" a route can arrive at a // destination from either side of the road. When set to "curb" the route will // arrive at a destination on the driving side of the region. Please note the // number of values provided must be equal to the number of "destinations". // However, you can skip a coordinate and show its position in the list with the // ";" separator. The values provided for the "approaches" parameter are effective // for the "destinations" value at the same index. Example: "curb;;curb" will apply // curbside restriction on the "destinations" points provided at the first and // third index. // // Any of "unrestricted", "curb". Approaches DistanceMatrixJsonGetParamsApproaches `query:"approaches,omitzero" json:"-"` // Setting this will ensure the route avoids ferries, tolls, highways or nothing. // Multiple values should be separated by a pipe (|). If "none" is provided along // with other values, an error is returned as a valid route is not feasible. Please // note that when this parameter is not provided in the input, ferries are set to // be avoided by default. When this parameter is provided, only the mentioned // objects are avoided. // // Any of "toll", "ferry", "highway", "none". Avoid DistanceMatrixJsonGetParamsAvoid `query:"avoid,omitzero" json:"-"` // Set which driving mode the service should use to determine the "distance" and // "duration" values. For example, if you use "car", the API will return the // duration and distance of a route that a car can take. Using "truck" will return // the same for a route a truck can use, taking into account appropriate truck // routing restrictions. // // When "mode=truck", following are the default dimensions that are used: // // \- truck_height = 214 centimeters // // \- truck_width = 183 centimeters // // \- truck_length = 519 centimeters // // \- truck_weight = 5000 kg // // Please use the Distance Matrix Flexible version if you want to use custom truck // dimensions. // // Note: Only the "car" profile is enabled by default. Please note that customized // profiles (including "truck") might not be available for all regions. Please // contact your [NextBillion.ai](http://NextBillion.ai) account manager, sales // representative or reach out at // [support@nextbillion.ai](mailto:support@nextbillion.ai) in case you need // additional profiles. // // Any of "car", "truck". Mode DistanceMatrixJsonGetParamsMode `query:"mode,omitzero" json:"-"` // contains filtered or unexported fields }
func (DistanceMatrixJsonGetParams) URLQuery ¶
func (r DistanceMatrixJsonGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes DistanceMatrixJsonGetParams's query parameters as `url.Values`.
type DistanceMatrixJsonGetParamsApproaches ¶
type DistanceMatrixJsonGetParamsApproaches string
A semicolon-separated list indicating the side of the road from which the route will approach "destinations". When set to "unrestricted" a route can arrive at a destination from either side of the road. When set to "curb" the route will arrive at a destination on the driving side of the region. Please note the number of values provided must be equal to the number of "destinations". However, you can skip a coordinate and show its position in the list with the ";" separator. The values provided for the "approaches" parameter are effective for the "destinations" value at the same index. Example: "curb;;curb" will apply curbside restriction on the "destinations" points provided at the first and third index.
const ( DistanceMatrixJsonGetParamsApproachesUnrestricted DistanceMatrixJsonGetParamsApproaches = "unrestricted" DistanceMatrixJsonGetParamsApproachesCurb DistanceMatrixJsonGetParamsApproaches = "curb" )
type DistanceMatrixJsonGetParamsAvoid ¶
type DistanceMatrixJsonGetParamsAvoid string
Setting this will ensure the route avoids ferries, tolls, highways or nothing. Multiple values should be separated by a pipe (|). If "none" is provided along with other values, an error is returned as a valid route is not feasible. Please note that when this parameter is not provided in the input, ferries are set to be avoided by default. When this parameter is provided, only the mentioned objects are avoided.
const ( DistanceMatrixJsonGetParamsAvoidToll DistanceMatrixJsonGetParamsAvoid = "toll" DistanceMatrixJsonGetParamsAvoidFerry DistanceMatrixJsonGetParamsAvoid = "ferry" DistanceMatrixJsonGetParamsAvoidHighway DistanceMatrixJsonGetParamsAvoid = "highway" DistanceMatrixJsonGetParamsAvoidNone DistanceMatrixJsonGetParamsAvoid = "none" )
type DistanceMatrixJsonGetParamsMode ¶
type DistanceMatrixJsonGetParamsMode string
Set which driving mode the service should use to determine the "distance" and "duration" values. For example, if you use "car", the API will return the duration and distance of a route that a car can take. Using "truck" will return the same for a route a truck can use, taking into account appropriate truck routing restrictions.
When "mode=truck", following are the default dimensions that are used:
\- truck_height = 214 centimeters
\- truck_width = 183 centimeters
\- truck_length = 519 centimeters
\- truck_weight = 5000 kg
Please use the Distance Matrix Flexible version if you want to use custom truck dimensions.
Note: Only the "car" profile is enabled by default. Please note that customized profiles (including "truck") might not be available for all regions. Please contact your [NextBillion.ai](http://NextBillion.ai) account manager, sales representative or reach out at [support@nextbillion.ai](mailto:support@nextbillion.ai) in case you need additional profiles.
const ( DistanceMatrixJsonGetParamsModeCar DistanceMatrixJsonGetParamsMode = "car" DistanceMatrixJsonGetParamsModeTruck DistanceMatrixJsonGetParamsMode = "truck" )
type DistanceMatrixJsonGetResponse ¶
type DistanceMatrixJsonGetResponse struct { // Displays the error message in case of a failed request or operation. Please note // that this parameter is not returned in the response in case of a successful // request. Msg string `json:"msg"` // Container object for a response with an array of arrays structure. Rows []DistanceMatrixJsonGetResponseRow `json:"rows"` // A string indicating the state of the response. On normal responses, the value // will be Ok. Indicative HTTP error codes are returned for different errors. See // the [API Errors Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Msg respjson.Field Rows respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (DistanceMatrixJsonGetResponse) RawJSON ¶
func (r DistanceMatrixJsonGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DistanceMatrixJsonGetResponse) UnmarshalJSON ¶
func (r *DistanceMatrixJsonGetResponse) UnmarshalJSON(data []byte) error
type DistanceMatrixJsonGetResponseRow ¶
type DistanceMatrixJsonGetResponseRow struct { // An array of objects. Each elements array corresponds to a single origins // coordinate and contains objects with distance and duration values for each of // the destinations. The details in the first elements array correspond to the // first origins point and the first object corresponds to the first destinations // point and so on. Elements []DistanceMatrixJsonGetResponseRowElement `json:"elements"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Elements respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (DistanceMatrixJsonGetResponseRow) RawJSON ¶
func (r DistanceMatrixJsonGetResponseRow) RawJSON() string
Returns the unmodified JSON received from the API
func (*DistanceMatrixJsonGetResponseRow) UnmarshalJSON ¶
func (r *DistanceMatrixJsonGetResponseRow) UnmarshalJSON(data []byte) error
type DistanceMatrixJsonGetResponseRowElement ¶
type DistanceMatrixJsonGetResponseRowElement struct { // Distance of the route from an origin to a destination, in meters. Distance float64 `json:"distance"` // Duration of the trip from an origin to a destination, in seconds. Duration float64 `json:"duration"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Distance respjson.Field Duration respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (DistanceMatrixJsonGetResponseRowElement) RawJSON ¶
func (r DistanceMatrixJsonGetResponseRowElement) RawJSON() string
Returns the unmodified JSON received from the API
func (*DistanceMatrixJsonGetResponseRowElement) UnmarshalJSON ¶
func (r *DistanceMatrixJsonGetResponseRowElement) UnmarshalJSON(data []byte) error
type DistanceMatrixJsonService ¶
type DistanceMatrixJsonService struct {
Options []option.RequestOption
}
DistanceMatrixJsonService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewDistanceMatrixJsonService method instead.
func NewDistanceMatrixJsonService ¶
func NewDistanceMatrixJsonService(opts ...option.RequestOption) (r DistanceMatrixJsonService)
NewDistanceMatrixJsonService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*DistanceMatrixJsonService) Get ¶
func (r *DistanceMatrixJsonService) Get(ctx context.Context, query DistanceMatrixJsonGetParams, opts ...option.RequestOption) (res *DistanceMatrixJsonGetResponse, err error)
Nextbillion.ai Distance Matrix API computes distances and ETAs between a set of origins and destinations — could be for one-to-many or many-to-many scenarios. The API call returns a matrix of ETAs and distances for each origin and destination pair. For example, If the set is Origins {A,B} and Destinations {C,D,E} we can get the following set of results with distance (meters) and time (seconds) for each. The GET method can only handle up to 100 locations (1 location is either 1 origin or 1 destination).
func (*DistanceMatrixJsonService) New ¶
func (r *DistanceMatrixJsonService) New(ctx context.Context, opts ...option.RequestOption) (err error)
asfd
type DistanceMatrixService ¶
type DistanceMatrixService struct { Options []option.RequestOption Json DistanceMatrixJsonService }
DistanceMatrixService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewDistanceMatrixService method instead.
func NewDistanceMatrixService ¶
func NewDistanceMatrixService(opts ...option.RequestOption) (r DistanceMatrixService)
NewDistanceMatrixService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type DocumentSubmission ¶
type DocumentSubmission = any
type DocumentTemplateContentRequestMetaOptionParam ¶
type DocumentTemplateContentRequestMetaOptionParam struct { // Specify the label or name for the option. Label string `json:"label,required"` // Specify the value associated with the option. This value will be submitted when // the option is checked in the Driver app. Value string `json:"value,required"` // contains filtered or unexported fields }
The properties Label, Value are required.
func (DocumentTemplateContentRequestMetaOptionParam) MarshalJSON ¶
func (r DocumentTemplateContentRequestMetaOptionParam) MarshalJSON() (data []byte, err error)
func (*DocumentTemplateContentRequestMetaOptionParam) UnmarshalJSON ¶
func (r *DocumentTemplateContentRequestMetaOptionParam) UnmarshalJSON(data []byte) error
type DocumentTemplateContentRequestMetaParam ¶
type DocumentTemplateContentRequestMetaParam struct { // An array of objects to define options for a multi_choices or single_choice type // document field. Each object represents one option. Options []DocumentTemplateContentRequestMetaOptionParam `json:"options,omitzero,required"` // contains filtered or unexported fields }
An object to define additional information required for single_choice or multi_choices type document items.
The property Options is required.
func (DocumentTemplateContentRequestMetaParam) MarshalJSON ¶
func (r DocumentTemplateContentRequestMetaParam) MarshalJSON() (data []byte, err error)
func (*DocumentTemplateContentRequestMetaParam) UnmarshalJSON ¶
func (r *DocumentTemplateContentRequestMetaParam) UnmarshalJSON(data []byte) error
type DocumentTemplateContentRequestParam ¶
type DocumentTemplateContentRequestParam struct { // Specify the label or the name of the field. The label specified here can be used // as field name when rendering the document in the Driver app. Label string `json:"label,required"` // Specify the data type of the field. It corresponds to the type of information // that the driver needs to collect. // // Any of "string", "number", "date_time", "photos", "multi_choices", "signature", // "barcode", "single_choice". Type DocumentTemplateContentRequestType `json:"type,omitzero,required"` // Specify the name of the document field. A field'sname can be used for internal // references to the document field. Name param.Opt[string] `json:"name,omitzero"` // Specify if it is mandatory to fill the field. Default value is false. Required param.Opt[bool] `json:"required,omitzero"` // An object to define additional information required for single_choice or // multi_choices type document items. Meta DocumentTemplateContentRequestMetaParam `json:"meta,omitzero"` // Specify the validation rules for the field. This can be used to enforce data // quality and integrity checks. For example, if the field is a number type, // validation can define constraints like minimum / maximum number values. Validation DocumentTemplateContentRequestValidationParam `json:"validation,omitzero"` // contains filtered or unexported fields }
An object to collect the details of form fields - data structures, validation rules - for collecting required information after successfully executing a route step.
The properties Label, Type are required.
func (DocumentTemplateContentRequestParam) MarshalJSON ¶
func (r DocumentTemplateContentRequestParam) MarshalJSON() (data []byte, err error)
func (*DocumentTemplateContentRequestParam) UnmarshalJSON ¶
func (r *DocumentTemplateContentRequestParam) UnmarshalJSON(data []byte) error
type DocumentTemplateContentRequestType ¶
type DocumentTemplateContentRequestType string
Specify the data type of the field. It corresponds to the type of information that the driver needs to collect.
const ( DocumentTemplateContentRequestTypeString DocumentTemplateContentRequestType = "string" DocumentTemplateContentRequestTypeNumber DocumentTemplateContentRequestType = "number" DocumentTemplateContentRequestTypeDateTime DocumentTemplateContentRequestType = "date_time" DocumentTemplateContentRequestTypePhotos DocumentTemplateContentRequestType = "photos" DocumentTemplateContentRequestTypeMultiChoices DocumentTemplateContentRequestType = "multi_choices" DocumentTemplateContentRequestTypeSignature DocumentTemplateContentRequestType = "signature" DocumentTemplateContentRequestTypeBarcode DocumentTemplateContentRequestType = "barcode" DocumentTemplateContentRequestTypeSingleChoice DocumentTemplateContentRequestType = "single_choice" )
type DocumentTemplateContentRequestValidationParam ¶
type DocumentTemplateContentRequestValidationParam struct { // Specifies the maximum allowed value for number type document field. Input values // must be less than or equal to this threshold. Max param.Opt[int64] `json:"max,omitzero"` // Specifies the maximum number of items for multi_choices, photos type document // fields. The number of provided input items must be less than or equal to this // threshold. MaxItems param.Opt[int64] `json:"max_items,omitzero"` // Specifies the minimum allowed value for number type document field. Input values // must be greater than or equal to this threshold. Min param.Opt[int64] `json:"min,omitzero"` // Specifies the minimum number of items for multi_choices, photos type document // fields. The number of provided input items must be greater than or equal to this // threshold. MinItems param.Opt[int64] `json:"min_items,omitzero"` // contains filtered or unexported fields }
Specify the validation rules for the field. This can be used to enforce data quality and integrity checks. For example, if the field is a number type, validation can define constraints like minimum / maximum number values.
func (DocumentTemplateContentRequestValidationParam) MarshalJSON ¶
func (r DocumentTemplateContentRequestValidationParam) MarshalJSON() (data []byte, err error)
func (*DocumentTemplateContentRequestValidationParam) UnmarshalJSON ¶
func (r *DocumentTemplateContentRequestValidationParam) UnmarshalJSON(data []byte) error
type DocumentTemplateContentResponse ¶
type DocumentTemplateContentResponse struct { // Returns the label of the document field. Label string `json:"label"` // Returns the options configured for single_choice or multi_choices type document // items. Meta DocumentTemplateContentResponseMeta `json:"meta"` // Returns the name of the document field. Name string `json:"name"` // Indicates if the document field is mandatory or not. Required bool `json:"required"` // Returns the data type of the document field. It will always belong to one of // string, number, date_time, photos, multi_choices, signature, barcode, and // single_choice. Type string `json:"type"` // Returns the validation rules for number , multi_choices , and photos document // field types. Validation DocumentTemplateContentResponseValidation `json:"validation"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Label respjson.Field Meta respjson.Field Name respjson.Field Required respjson.Field Type respjson.Field Validation respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An array of objects returning the details of data structures and validation rules and other properties of all document fields. Each object represents one document field.
func (DocumentTemplateContentResponse) RawJSON ¶
func (r DocumentTemplateContentResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DocumentTemplateContentResponse) UnmarshalJSON ¶
func (r *DocumentTemplateContentResponse) UnmarshalJSON(data []byte) error
type DocumentTemplateContentResponseMeta ¶
type DocumentTemplateContentResponseMeta struct { // An array of objects returning the options for multi_choices or single_choice // type document field. Each object represents one configured option. Options []DocumentTemplateContentResponseMetaOption `json:"options"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Options respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the options configured for single_choice or multi_choices type document items.
func (DocumentTemplateContentResponseMeta) RawJSON ¶
func (r DocumentTemplateContentResponseMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*DocumentTemplateContentResponseMeta) UnmarshalJSON ¶
func (r *DocumentTemplateContentResponseMeta) UnmarshalJSON(data []byte) error
type DocumentTemplateContentResponseMetaOption ¶
type DocumentTemplateContentResponseMetaOption struct { // Returns the label for the option. Label string `json:"label"` // Returns the value associated with the option. This value gets submitted when the // option is checked in the Driver app. Value string `json:"value"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Label respjson.Field Value respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (DocumentTemplateContentResponseMetaOption) RawJSON ¶
func (r DocumentTemplateContentResponseMetaOption) RawJSON() string
Returns the unmodified JSON received from the API
func (*DocumentTemplateContentResponseMetaOption) UnmarshalJSON ¶
func (r *DocumentTemplateContentResponseMetaOption) UnmarshalJSON(data []byte) error
type DocumentTemplateContentResponseValidation ¶
type DocumentTemplateContentResponseValidation struct { // Returns the maximum allowed value for number type document item, as specified at // the time of configuring the field. This parameter is not present in the response // if it was not provided in the input. Max int64 `json:"max"` // Returns the maximum number of items required for multi_choices, photos type // document items. This parameter will not be present in the response if it was not // provided in the input. MaxItems string `json:"max_items"` // Returns the minimum allowed value for number type document item, as specified at // the time of configuring the field. This parameter is not present in the response // if it was not provided in the input. Min int64 `json:"min"` // Returns the minimum number of items required for multi_choices, photos type // document items. This parameter will not be present in the response if it was not // provided in the input. MinItems string `json:"min_items"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Max respjson.Field MaxItems respjson.Field Min respjson.Field MinItems respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the validation rules for number , multi_choices , and photos document field types.
func (DocumentTemplateContentResponseValidation) RawJSON ¶
func (r DocumentTemplateContentResponseValidation) RawJSON() string
Returns the unmodified JSON received from the API
func (*DocumentTemplateContentResponseValidation) UnmarshalJSON ¶
func (r *DocumentTemplateContentResponseValidation) UnmarshalJSON(data []byte) error
type FleetifyDocumentTemplateDeleteParams ¶
type FleetifyDocumentTemplateDeleteParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" json:"-"` // contains filtered or unexported fields }
func (FleetifyDocumentTemplateDeleteParams) URLQuery ¶
func (r FleetifyDocumentTemplateDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes FleetifyDocumentTemplateDeleteParams's query parameters as `url.Values`.
type FleetifyDocumentTemplateDeleteResponse ¶
type FleetifyDocumentTemplateDeleteResponse struct { // Returns the error message in case of a failed request. If the request is // successful, this field is not present in the response. Msg string `json:"msg"` // Returns the HTTP response code. Status int64 `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Msg respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (FleetifyDocumentTemplateDeleteResponse) RawJSON ¶
func (r FleetifyDocumentTemplateDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyDocumentTemplateDeleteResponse) UnmarshalJSON ¶
func (r *FleetifyDocumentTemplateDeleteResponse) UnmarshalJSON(data []byte) error
type FleetifyDocumentTemplateGetParams ¶
type FleetifyDocumentTemplateGetParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" json:"-"` // contains filtered or unexported fields }
func (FleetifyDocumentTemplateGetParams) URLQuery ¶
func (r FleetifyDocumentTemplateGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes FleetifyDocumentTemplateGetParams's query parameters as `url.Values`.
type FleetifyDocumentTemplateGetResponse ¶
type FleetifyDocumentTemplateGetResponse struct { // An object returning the details of the requested document template. Data FleetifyDocumentTemplateGetResponseData `json:"data"` // Returns the error message in case of a failed request. If the request is // successful, this field is not present in the response. Msg string `json:"msg"` // Returns the HTTP response code. Status int64 `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Msg respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (FleetifyDocumentTemplateGetResponse) RawJSON ¶
func (r FleetifyDocumentTemplateGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyDocumentTemplateGetResponse) UnmarshalJSON ¶
func (r *FleetifyDocumentTemplateGetResponse) UnmarshalJSON(data []byte) error
type FleetifyDocumentTemplateGetResponseData ¶
type FleetifyDocumentTemplateGetResponseData struct { // Returns the unique identifier of the document template. ID string `json:"id"` // An array of objects returning the details of data structures and validation // rules and other properties of all document fields. Each object represents one // document field. Content []DocumentTemplateContentResponse `json:"content"` // Returns the name of the document template as specified at the time of creating // the template. Name string `json:"name"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Content respjson.Field Name respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object returning the details of the requested document template.
func (FleetifyDocumentTemplateGetResponseData) RawJSON ¶
func (r FleetifyDocumentTemplateGetResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyDocumentTemplateGetResponseData) UnmarshalJSON ¶
func (r *FleetifyDocumentTemplateGetResponseData) UnmarshalJSON(data []byte) error
type FleetifyDocumentTemplateListParams ¶
type FleetifyDocumentTemplateListParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" json:"-"` // contains filtered or unexported fields }
func (FleetifyDocumentTemplateListParams) URLQuery ¶
func (r FleetifyDocumentTemplateListParams) URLQuery() (v url.Values, err error)
URLQuery serializes FleetifyDocumentTemplateListParams's query parameters as `url.Values`.
type FleetifyDocumentTemplateListResponse ¶
type FleetifyDocumentTemplateListResponse struct { // An array of objects returning the details of each document template associated // with the specified API key. Each object represents one document template. In // case there are no templates associated with the given key, a blank array is // returned. Data []FleetifyDocumentTemplateListResponseData `json:"data"` // Returns the error message in case of a failed request. If the request is // successful, this field is not present in the response. Msg string `json:"msg"` // Returns the HTTP response code. Status int64 `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Msg respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (FleetifyDocumentTemplateListResponse) RawJSON ¶
func (r FleetifyDocumentTemplateListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyDocumentTemplateListResponse) UnmarshalJSON ¶
func (r *FleetifyDocumentTemplateListResponse) UnmarshalJSON(data []byte) error
type FleetifyDocumentTemplateListResponseData ¶
type FleetifyDocumentTemplateListResponseData struct { // Returns the unique ID of the document template. ID string `json:"id"` // An array of objects returning the details of data structures and validation // rules and other properties of all document fields. Each object represents one // document field. Content []DocumentTemplateContentResponse `json:"content"` // Returns the name of the document template. Name string `json:"name"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Content respjson.Field Name respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An array of objects returning the details of each document template associated with the specified API key. Each object represents one document template. In case there are no templates associated with the given key, a blank array is returned.
func (FleetifyDocumentTemplateListResponseData) RawJSON ¶
func (r FleetifyDocumentTemplateListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyDocumentTemplateListResponseData) UnmarshalJSON ¶
func (r *FleetifyDocumentTemplateListResponseData) UnmarshalJSON(data []byte) error
type FleetifyDocumentTemplateNewParams ¶
type FleetifyDocumentTemplateNewParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" json:"-"` // A form field that drivers must complete when executing a route step. Defines the // data structure and validation rules for collecting required information during // route execution. Content []DocumentTemplateContentRequestParam `json:"content,omitzero,required"` // Specify a name for the document template to be created. Name string `json:"name,required"` // contains filtered or unexported fields }
func (FleetifyDocumentTemplateNewParams) MarshalJSON ¶
func (r FleetifyDocumentTemplateNewParams) MarshalJSON() (data []byte, err error)
func (FleetifyDocumentTemplateNewParams) URLQuery ¶
func (r FleetifyDocumentTemplateNewParams) URLQuery() (v url.Values, err error)
URLQuery serializes FleetifyDocumentTemplateNewParams's query parameters as `url.Values`.
func (*FleetifyDocumentTemplateNewParams) UnmarshalJSON ¶
func (r *FleetifyDocumentTemplateNewParams) UnmarshalJSON(data []byte) error
type FleetifyDocumentTemplateNewResponse ¶
type FleetifyDocumentTemplateNewResponse struct { // An object returning the details of the document template created. Data FleetifyDocumentTemplateNewResponseData `json:"data"` // Returns the error message in case of a failed request. If the request is // successful, this field is not present in the response. Msg string `json:"msg"` // Returns the HTTP response code. Status int64 `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Msg respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (FleetifyDocumentTemplateNewResponse) RawJSON ¶
func (r FleetifyDocumentTemplateNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyDocumentTemplateNewResponse) UnmarshalJSON ¶
func (r *FleetifyDocumentTemplateNewResponse) UnmarshalJSON(data []byte) error
type FleetifyDocumentTemplateNewResponseData ¶
type FleetifyDocumentTemplateNewResponseData struct { // Returns the unique ID of the document template created. ID string `json:"id"` // An array of objects returning the details of data structures and validation // rules and other properties of all document fields. Each object represents one // document field. Content []DocumentTemplateContentResponse `json:"content"` // Returns the name of the document template as specified in the input. Name string `json:"name"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Content respjson.Field Name respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object returning the details of the document template created.
func (FleetifyDocumentTemplateNewResponseData) RawJSON ¶
func (r FleetifyDocumentTemplateNewResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyDocumentTemplateNewResponseData) UnmarshalJSON ¶
func (r *FleetifyDocumentTemplateNewResponseData) UnmarshalJSON(data []byte) error
type FleetifyDocumentTemplateService ¶
type FleetifyDocumentTemplateService struct {
Options []option.RequestOption
}
FleetifyDocumentTemplateService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFleetifyDocumentTemplateService method instead.
func NewFleetifyDocumentTemplateService ¶
func NewFleetifyDocumentTemplateService(opts ...option.RequestOption) (r FleetifyDocumentTemplateService)
NewFleetifyDocumentTemplateService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*FleetifyDocumentTemplateService) Delete ¶
func (r *FleetifyDocumentTemplateService) Delete(ctx context.Context, id string, body FleetifyDocumentTemplateDeleteParams, opts ...option.RequestOption) (res *FleetifyDocumentTemplateDeleteResponse, err error)
Delete a document template
func (*FleetifyDocumentTemplateService) Get ¶
func (r *FleetifyDocumentTemplateService) Get(ctx context.Context, id string, query FleetifyDocumentTemplateGetParams, opts ...option.RequestOption) (res *FleetifyDocumentTemplateGetResponse, err error)
Retrieve template by ID
func (*FleetifyDocumentTemplateService) List ¶
func (r *FleetifyDocumentTemplateService) List(ctx context.Context, query FleetifyDocumentTemplateListParams, opts ...option.RequestOption) (res *FleetifyDocumentTemplateListResponse, err error)
Get all document templates
func (*FleetifyDocumentTemplateService) New ¶
func (r *FleetifyDocumentTemplateService) New(ctx context.Context, params FleetifyDocumentTemplateNewParams, opts ...option.RequestOption) (res *FleetifyDocumentTemplateNewResponse, err error)
Create Document template
func (*FleetifyDocumentTemplateService) Update ¶
func (r *FleetifyDocumentTemplateService) Update(ctx context.Context, id string, params FleetifyDocumentTemplateUpdateParams, opts ...option.RequestOption) (res *FleetifyDocumentTemplateUpdateResponse, err error)
Update a document template
type FleetifyDocumentTemplateUpdateParams ¶
type FleetifyDocumentTemplateUpdateParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" json:"-"` // Specify the document template name to be updated. Name param.Opt[string] `json:"name,omitzero"` // An object to collect the details of form fields to be updated - data structures, // validation rules. Please note that the details provided here will overwrite any // existing document fields in the given template. Content []DocumentTemplateContentRequestParam `json:"content,omitzero"` // contains filtered or unexported fields }
func (FleetifyDocumentTemplateUpdateParams) MarshalJSON ¶
func (r FleetifyDocumentTemplateUpdateParams) MarshalJSON() (data []byte, err error)
func (FleetifyDocumentTemplateUpdateParams) URLQuery ¶
func (r FleetifyDocumentTemplateUpdateParams) URLQuery() (v url.Values, err error)
URLQuery serializes FleetifyDocumentTemplateUpdateParams's query parameters as `url.Values`.
func (*FleetifyDocumentTemplateUpdateParams) UnmarshalJSON ¶
func (r *FleetifyDocumentTemplateUpdateParams) UnmarshalJSON(data []byte) error
type FleetifyDocumentTemplateUpdateResponse ¶
type FleetifyDocumentTemplateUpdateResponse struct { // An object returning the details of the updated document template. Data FleetifyDocumentTemplateUpdateResponseData `json:"data"` // Returns the error message in case of a failed request. If the request is // successful, this field is not present in the response. Msg string `json:"msg"` // Returns the HTTP response code. Status int64 `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Msg respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (FleetifyDocumentTemplateUpdateResponse) RawJSON ¶
func (r FleetifyDocumentTemplateUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyDocumentTemplateUpdateResponse) UnmarshalJSON ¶
func (r *FleetifyDocumentTemplateUpdateResponse) UnmarshalJSON(data []byte) error
type FleetifyDocumentTemplateUpdateResponseData ¶
type FleetifyDocumentTemplateUpdateResponseData struct { // Returns the unique ID of the document template. ID string `json:"id"` // An array of object returning the details of updated data structures and // validation rules for document fields. Each object represents one document field. Content []DocumentTemplateContentResponse `json:"content"` // Returns the updated name of the document template. Name string `json:"name"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Content respjson.Field Name respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object returning the details of the updated document template.
func (FleetifyDocumentTemplateUpdateResponseData) RawJSON ¶
func (r FleetifyDocumentTemplateUpdateResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyDocumentTemplateUpdateResponseData) UnmarshalJSON ¶
func (r *FleetifyDocumentTemplateUpdateResponseData) UnmarshalJSON(data []byte) error
type FleetifyRouteNewParams ¶
type FleetifyRouteNewParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" json:"-"` // Specify the e-mail address of the driver who should receive the route. The // e-mail address must be registered in // [NextBillion.ai Cloud Console](https://console.nextbillion.ai/). DriverEmail string `json:"driver_email,required"` // An array of objects to collect the details about the intermediate steps in the // route to be dispatched. Each object corresponds to a single step. The array must // begin with a start-type step and end with an end-type step, to form a valid // route. Steps []RouteStepsRequestParam `json:"steps,omitzero,required"` // Specify the total distance, in meters, for an informative display in Driver's // app. The distance specified here has no effect on the actual route that the // service generates. Distance param.Opt[int64] `json:"distance,omitzero"` // Specify the ID of the document template that should be used to collect proof of // completion for all steps in the route. In order to complete each route step, the // driver will need to submit a form generated by the rules defined in the given // document template. Use the // [Documents API](https://docs.nextbillion.ai/docs/dispatches/documents-api) to // create, read and manage document templates. // // Please note that the document template ID assigned to a route does not apply to // following step types - start, end, break, layover. DocumentTemplateID param.Opt[string] `json:"document_template_id,omitzero"` // Specify the Route Optimization request ID. When this ID is provided, all other // fields will be ignored (including the required fields) and the route // optimization result will be used to form the routes and corresponding steps. // // Please note that: // // - The driver's email ID must be provided in input vehicle.metadata as user_email // such that the route optimization result must contain a valid driver email, // step's arrival time, etc., to make a successful dispatch. // - Document Template for collecting proof of delivery or completion can not be // specified when using this field to dispatch a route. // - In case of an error at any part among the routes, the API will immediately // return the error with the index of the specific route or route step. // - On a successful dispatch, the API returns the last route, if there are many, // in the response payload. RoRequestID param.Opt[string] `json:"ro_request_id,omitzero"` // The routing object allows defining the routing characteristics that should be // used to generate a route when the Driver uses the in-app navigation. Only car // mode is supported currently. Routing FleetifyRouteNewParamsRouting `json:"routing,omitzero"` // contains filtered or unexported fields }
func (FleetifyRouteNewParams) MarshalJSON ¶
func (r FleetifyRouteNewParams) MarshalJSON() (data []byte, err error)
func (FleetifyRouteNewParams) URLQuery ¶
func (r FleetifyRouteNewParams) URLQuery() (v url.Values, err error)
URLQuery serializes FleetifyRouteNewParams's query parameters as `url.Values`.
func (*FleetifyRouteNewParams) UnmarshalJSON ¶
func (r *FleetifyRouteNewParams) UnmarshalJSON(data []byte) error
type FleetifyRouteNewParamsRouting ¶
type FleetifyRouteNewParamsRouting struct { // Specify the total load per axle (including the weight of trailers and shipped // goods) of the truck, in tonnes. When specified, the dispatched route uses only // those roads which can be used by a truck to carry the specified load per axle. // // Please note this parameter is effective only when mode=truck. TruckAxleLoad param.Opt[int64] `json:"truck_axle_load,omitzero"` // Specify the dimensions of a truck, in centimeters (cm), in the format of // <height, width, length>. When specified, the dispatched route uses only those // roads which allow trucks with specified dimensions. // // Please note this parameter is effective only when mode=truck. Also, the maximum // dimensions that can be specified are as follows: // // Height = 1000 cm // Width = 5000 cm // Length = 5000 cm TruckSize param.Opt[string] `json:"truck_size,omitzero"` // Specify the weight of the truck, including trailers and shipped goods, in // kilograms (kg). When specified, the dispatched route uses only those roads which // allow trucks with specified weight. // // Please note this parameter is effective only when mode=truck. Also, the maximum // weight that can be specified for a truck is 100,000 kgs. TruckWeight param.Opt[int64] `json:"truck_weight,omitzero"` // Specify the side of the road from which the route should approach the step // location. When set to unrestricted a route can arrive at the step location from // either side of the road and when set to curb the route will arrive at the step // location only from the driving side of the region. Use a semi-colon ; to specify // approach configurations for multiple steps. // // Any of "unrestricted", "curb". Approaches string `json:"approaches,omitzero"` // Setting this will ensure the generated route avoids the object(s) specified in // the input. Multiple values should be separated by a pipe (|). If none is // provided along with other values, an error is returned as a valid route is not // feasible. // // Any of "toll", "highway", "ferry", "sharp_turn", "uturn", "left_turn", // "right_turn", "service_road", "none". Avoid string `json:"avoid,omitzero"` // Specify the type of hazardous material being carried and the dispatch service // will avoid roads which are not suitable for the type of goods specified. // Multiple values can be separated using a pipe operator | . // // Please note that this parameter is effective only when mode=truck. // // Any of "general", "circumstantial", "explosive", "harmful_to_water". HazmatType string `json:"hazmat_type,omitzero"` // Specify the driving mode that the service should use to determine a route // // Any of "car". Mode string `json:"mode,omitzero"` // contains filtered or unexported fields }
The routing object allows defining the routing characteristics that should be used to generate a route when the Driver uses the in-app navigation. Only car mode is supported currently.
func (FleetifyRouteNewParamsRouting) MarshalJSON ¶
func (r FleetifyRouteNewParamsRouting) MarshalJSON() (data []byte, err error)
func (*FleetifyRouteNewParamsRouting) UnmarshalJSON ¶
func (r *FleetifyRouteNewParamsRouting) UnmarshalJSON(data []byte) error
type FleetifyRouteNewResponse ¶
type FleetifyRouteNewResponse struct { // An array of objects containing the details of each step in the dispatched route. // Each object represents a single step. Data FleetifyRouteNewResponseData `json:"data"` // Returns the status code of the response. Status int64 `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (FleetifyRouteNewResponse) RawJSON ¶
func (r FleetifyRouteNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyRouteNewResponse) UnmarshalJSON ¶
func (r *FleetifyRouteNewResponse) UnmarshalJSON(data []byte) error
type FleetifyRouteNewResponseData ¶
type FleetifyRouteNewResponseData struct { // Returns the unique ID of the dispatched route. ID string `json:"id"` // Returns the UNIX timestamp, in seconds precision, at which this route dispatch // request was created. CreatedAt int64 `json:"created_at"` // Returns the total route distance, in meters, for informative display in the // driver app. It is the same as the value provided for distance field in the input // request. Distance int64 `json:"distance"` // Returns the details of the document that was specified in the input for // collecting the proof-of-completion for all steps in the dispatched routes. Each // object represents a new field in the document. DocumentSnapshot []any `json:"document_snapshot"` // An object returning the details of the driver to whom the route was dispatched. Driver FleetifyRouteNewResponseDataDriver `json:"driver"` // Returns the route optimization request ID which was used to dispatch the route. // An empty string is returned if the corresponding input was not provided. RoRequestID string `json:"ro_request_id"` // An object returning the routing characteristics that are used to generate the // route and turn-by-turn navigation steps for the dispatched route. The route and // navigation steps are available when driver uses the in-app navigation. // // Please note the routing characteristics returned here are the same as those // configured in the input request. The fields which were not specified in the // input will be returned as blanks. Routing RoutingResponse `json:"routing"` // Returns a shorter unique ID of the dispatched route for easier referencing and // displaying purposes. ShortID string `json:"short_id"` // An array of objects containing the details of all steps to be performed as part // of the dispatched route. Each object represents a single step during the route. Steps []RouteStepsResponse `json:"steps"` // Returns the total number of steps in the dispatched route. TotalSteps int64 `json:"total_steps"` // Returns the UNIX timestamp, in seconds precision, at which this route dispatch // request was updated. UpdatedAt int64 `json:"updated_at"` // Returns the ID of the vehicle to which the route was dispatched. The vehicle ID // returned here is the same as the one used in the route optimization request for // the given vehicle. An empty string is returned if the ro_request_id was not // provided in the input. VehicleID string `json:"vehicle_id"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field CreatedAt respjson.Field Distance respjson.Field DocumentSnapshot respjson.Field Driver respjson.Field RoRequestID respjson.Field Routing respjson.Field ShortID respjson.Field Steps respjson.Field TotalSteps respjson.Field UpdatedAt respjson.Field VehicleID respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An array of objects containing the details of each step in the dispatched route. Each object represents a single step.
func (FleetifyRouteNewResponseData) RawJSON ¶
func (r FleetifyRouteNewResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyRouteNewResponseData) UnmarshalJSON ¶
func (r *FleetifyRouteNewResponseData) UnmarshalJSON(data []byte) error
type FleetifyRouteNewResponseDataDriver ¶
type FleetifyRouteNewResponseDataDriver struct { // Returns the ID of the driver as specified in the // [NextBillion.ai](http://NextBillion.ai) Cloud Console. ID string `json:"id"` // Returns the email of the driver as specified in the // [NextBillion.ai](http://NextBillion.ai) Cloud Console. Email string `json:"email"` // Returns the full name of the driver as specified in // [NextBillion.ai](http://NextBillion.ai) Cloud Console. Fullname string `json:"fullname"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Email respjson.Field Fullname respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object returning the details of the driver to whom the route was dispatched.
func (FleetifyRouteNewResponseDataDriver) RawJSON ¶
func (r FleetifyRouteNewResponseDataDriver) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyRouteNewResponseDataDriver) UnmarshalJSON ¶
func (r *FleetifyRouteNewResponseDataDriver) UnmarshalJSON(data []byte) error
type FleetifyRouteRedispatchParams ¶
type FleetifyRouteRedispatchParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" json:"-"` // A collection of objects with details of the steps to be modified. Each object // corresponds to a single step. Operations []FleetifyRouteRedispatchParamsOperation `json:"operations,omitzero,required"` // Specify the distance of the route. Distance param.Opt[float64] `json:"distance,omitzero"` // contains filtered or unexported fields }
func (FleetifyRouteRedispatchParams) MarshalJSON ¶
func (r FleetifyRouteRedispatchParams) MarshalJSON() (data []byte, err error)
func (FleetifyRouteRedispatchParams) URLQuery ¶
func (r FleetifyRouteRedispatchParams) URLQuery() (v url.Values, err error)
URLQuery serializes FleetifyRouteRedispatchParams's query parameters as `url.Values`.
func (*FleetifyRouteRedispatchParams) UnmarshalJSON ¶
func (r *FleetifyRouteRedispatchParams) UnmarshalJSON(data []byte) error
type FleetifyRouteRedispatchParamsOperation ¶
type FleetifyRouteRedispatchParamsOperation struct { Data FleetifyRouteRedispatchParamsOperationData `json:"data,omitzero,required"` // Specify the type of operation to be performed for the step. // // Any of "create", "update", "delete". Operation string `json:"operation,omitzero,required"` // contains filtered or unexported fields }
The properties Data, Operation are required.
func (FleetifyRouteRedispatchParamsOperation) MarshalJSON ¶
func (r FleetifyRouteRedispatchParamsOperation) MarshalJSON() (data []byte, err error)
func (*FleetifyRouteRedispatchParamsOperation) UnmarshalJSON ¶
func (r *FleetifyRouteRedispatchParamsOperation) UnmarshalJSON(data []byte) error
type FleetifyRouteRedispatchParamsOperationData ¶
type FleetifyRouteRedispatchParamsOperationData struct { // Specify the ID of the document template to be used for collecting proof of // completion for the step. It would be applied to step which not be bind to // document template. Use the // [Documents API](https://docs.nextbillion.ai/docs/dispatches/documents-api) to // create, read and manage the document templates. // // Please note that the document template ID can not be assigned to following step // types - start, end, break, layover. DocumentTemplateID param.Opt[string] `json:"document_template_id,omitzero"` // Specify the ID of the step to be updated or deleted. Either one of id or // short_id of the step can be provided. This input will be ignored when operation: // create . StepID param.Opt[string] `json:"step_id,omitzero"` // Specify the mode of completion to be used for the step. Currently, following // values are allowed: // // - manual: Steps must be marked as completed manually through the Driver App. // - geofence: Steps are marked as completed automatically based on the entry // conditions and geofence specified. // - geofence_manual_fallback: Steps will be marked as completed automatically // based on geofence and entry condition configurations but there will also be a // provision for manually updating the status in case, geofence detection fails. // // Any of "manual", "geofence", "geofence_manual_fallback". CompletionMode RouteStepCompletionMode `json:"completion_mode,omitzero"` Step RouteStepsRequestParam `json:"step,omitzero"` // contains filtered or unexported fields }
func (FleetifyRouteRedispatchParamsOperationData) MarshalJSON ¶
func (r FleetifyRouteRedispatchParamsOperationData) MarshalJSON() (data []byte, err error)
func (*FleetifyRouteRedispatchParamsOperationData) UnmarshalJSON ¶
func (r *FleetifyRouteRedispatchParamsOperationData) UnmarshalJSON(data []byte) error
type FleetifyRouteRedispatchResponse ¶
type FleetifyRouteRedispatchResponse struct { // An array of objects containing the details of each step in the dispatched route. // Each object represents a single step. Data FleetifyRouteRedispatchResponseData `json:"data"` // Returns the error message in case of a failed request. If the request is // successful, this field is not present in the response. Message string `json:"message"` // Returns the status code of the response. Status int64 `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Message respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (FleetifyRouteRedispatchResponse) RawJSON ¶
func (r FleetifyRouteRedispatchResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyRouteRedispatchResponse) UnmarshalJSON ¶
func (r *FleetifyRouteRedispatchResponse) UnmarshalJSON(data []byte) error
type FleetifyRouteRedispatchResponseData ¶
type FleetifyRouteRedispatchResponseData struct { // Returns the unique ID of the route. ID string `json:"id"` // Returns the number of steps already completed in the route. CompletedSteps int64 `json:"completed_steps"` // Returns the completion status of the route. Completion FleetifyRouteRedispatchResponseDataCompletion `json:"completion"` // Returns the UNIX timestamp, in seconds precision, at which this route dispatch // request was created. CreatedAt int64 `json:"created_at"` // Returns the total route distance, in meters, for informative display in the // driver app. It is the same as the value provided for distance field in the input // request. Distance int64 `json:"distance"` // Returns the details of the document that was specified in the input for // collecting the proof-of-completion for all steps in the dispatched routes. Each // object represents a new field in the document. DocumentSnapshot []any `json:"document_snapshot"` // An object returning the details of the driver to whom the route was dispatched. Driver FleetifyRouteRedispatchResponseDataDriver `json:"driver"` // Returns the route optimization request ID which was used to dispatch the route. // An empty string is returned if the corresponding input was not provided. RoRequestID string `json:"ro_request_id"` // An object returning the routing characteristics that are used to generate the // route and turn-by-turn navigation steps for the dispatched route. The route and // navigation steps are available when driver uses the in-app navigation. // // Please note the routing characteristics returned here are the same as those // configured in the input request. The fields which were not specified in the // input will be returned as blanks. Routing RoutingResponse `json:"routing"` // Returns a shorter unique ID of the route for easier referencing and displaying // purposes. ShortID string `json:"short_id"` Steps FleetifyRouteRedispatchResponseDataSteps `json:"steps"` // Returns the total number of steps in the dispatched route. TotalSteps int64 `json:"total_steps"` // Returns the UNIX timestamp, in seconds precision, at which this route dispatch // request was updated. UpdatedAt int64 `json:"updated_at"` // Returns the ID of the vehicle to which the route was dispatched. The vehicle ID // returned here is the same as the one used in the route optimization request for // the given vehicle. An empty string is returned if the ro_request_id was not // provided in the input. VehicleID string `json:"vehicle_id"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field CompletedSteps respjson.Field Completion respjson.Field CreatedAt respjson.Field Distance respjson.Field DocumentSnapshot respjson.Field Driver respjson.Field RoRequestID respjson.Field Routing respjson.Field ShortID respjson.Field Steps respjson.Field TotalSteps respjson.Field UpdatedAt respjson.Field VehicleID respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An array of objects containing the details of each step in the dispatched route. Each object represents a single step.
func (FleetifyRouteRedispatchResponseData) RawJSON ¶
func (r FleetifyRouteRedispatchResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyRouteRedispatchResponseData) UnmarshalJSON ¶
func (r *FleetifyRouteRedispatchResponseData) UnmarshalJSON(data []byte) error
type FleetifyRouteRedispatchResponseDataCompletion ¶
type FleetifyRouteRedispatchResponseDataCompletion struct { // Returns the status of the route. It can take one of the following values - // "scheduled", "completed". // // Any of "scheduled", "completed". Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the completion status of the route.
func (FleetifyRouteRedispatchResponseDataCompletion) RawJSON ¶
func (r FleetifyRouteRedispatchResponseDataCompletion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyRouteRedispatchResponseDataCompletion) UnmarshalJSON ¶
func (r *FleetifyRouteRedispatchResponseDataCompletion) UnmarshalJSON(data []byte) error
type FleetifyRouteRedispatchResponseDataDriver ¶
type FleetifyRouteRedispatchResponseDataDriver struct { // Returns the ID of the driver as specified in the // [NextBillion.ai](http://NextBillion.ai) Cloud Console. ID string `json:"id"` // Returns the email of the driver as specified in the // [NextBillion.ai](http://NextBillion.ai) Cloud Console. Email string `json:"email"` // Returns the full name of the driver as specified in // [NextBillion.ai](http://NextBillion.ai) Cloud Console. Fullname string `json:"fullname"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Email respjson.Field Fullname respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object returning the details of the driver to whom the route was dispatched.
func (FleetifyRouteRedispatchResponseDataDriver) RawJSON ¶
func (r FleetifyRouteRedispatchResponseDataDriver) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyRouteRedispatchResponseDataDriver) UnmarshalJSON ¶
func (r *FleetifyRouteRedispatchResponseDataDriver) UnmarshalJSON(data []byte) error
type FleetifyRouteRedispatchResponseDataSteps ¶
type FleetifyRouteRedispatchResponseDataSteps struct { // Returns the unique ID of the step. ID string `json:"id"` // Returns the postal address where the step is executed. Its value is the same as // that specified in the input request when configuring the step details. Address string `json:"address"` // Returns the scheduled arrival time of the driver at the step as an UNIX // timestamp, in seconds precision. It is the same as that specified in the input // request while configuring the step details. // // The timestamp returned here is only for informative display on the driver's app // and it does not impact or get affected by the route generated. Arrival int64 `json:"arrival"` // Returns the completion status of the step. Completion FleetifyRouteRedispatchResponseDataStepsCompletion `json:"completion"` // Returns the UNIX timestamp, in seconds precision, at which this step was // created. CreatedAt int64 `json:"created_at"` // Returns the details of the document that was used for collecting the proof of // completion for the step. In case no document template ID was provided for the // given step, then a null value is returned. Each object represents a new field in // the document. DocumentSnapshot []any `json:"document_snapshot"` // Returns the duration for layover or break type steps. Duration int64 `json:"duration"` // Returns the location coordinates where the step is executed. Location []float64 `json:"location"` // An object returning custom details about the step that were configured in the // input request while configuring the step details. The information returned here // will be available for display on the Driver's app under step details. Meta FleetifyRouteRedispatchResponseDataStepsMeta `json:"meta"` // Returns a unique short ID of the step for easier referencing and displaying // purposes. ShortID string `json:"short_id"` // Returns the step type. It can belong to one of the following: start, job , // pickup, delivery, break, layover , and end. For any given step, it would be the // same as that specified in the input request while configuring the step details. Type string `json:"type"` // Returns the UNIX timestamp, in seconds precision, at which this step was last // updated. UpdatedAt int64 `json:"updated_at"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Address respjson.Field Arrival respjson.Field Completion respjson.Field CreatedAt respjson.Field DocumentSnapshot respjson.Field Duration respjson.Field Location respjson.Field Meta respjson.Field ShortID respjson.Field Type respjson.Field UpdatedAt respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (FleetifyRouteRedispatchResponseDataSteps) RawJSON ¶
func (r FleetifyRouteRedispatchResponseDataSteps) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyRouteRedispatchResponseDataSteps) UnmarshalJSON ¶
func (r *FleetifyRouteRedispatchResponseDataSteps) UnmarshalJSON(data []byte) error
type FleetifyRouteRedispatchResponseDataStepsCompletion ¶
type FleetifyRouteRedispatchResponseDataStepsCompletion struct { // Returns the status of the step. It can take one of the following values - // "scheduled", "completed". Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the completion status of the step.
func (FleetifyRouteRedispatchResponseDataStepsCompletion) RawJSON ¶
func (r FleetifyRouteRedispatchResponseDataStepsCompletion) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyRouteRedispatchResponseDataStepsCompletion) UnmarshalJSON ¶
func (r *FleetifyRouteRedispatchResponseDataStepsCompletion) UnmarshalJSON(data []byte) error
type FleetifyRouteRedispatchResponseDataStepsMeta ¶
type FleetifyRouteRedispatchResponseDataStepsMeta struct { // Returns the customer name associated with the step. It can configured in the // input request using the metadata attribute of the step. CustomerName string `json:"customer_name"` // Returns the customer's phone number associated with the step. It can configured // in the input request using the metadata attribute of the step. CustomerPhoneNumber string `json:"customer_phone_number"` // Returns the custom instructions to carry out while performing the task. These // instructions can be provided at the time of configuring the step details in the // input request. Instructions string `json:"instructions"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { CustomerName respjson.Field CustomerPhoneNumber respjson.Field Instructions respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object returning custom details about the step that were configured in the input request while configuring the step details. The information returned here will be available for display on the Driver's app under step details.
func (FleetifyRouteRedispatchResponseDataStepsMeta) RawJSON ¶
func (r FleetifyRouteRedispatchResponseDataStepsMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyRouteRedispatchResponseDataStepsMeta) UnmarshalJSON ¶
func (r *FleetifyRouteRedispatchResponseDataStepsMeta) UnmarshalJSON(data []byte) error
type FleetifyRouteService ¶
type FleetifyRouteService struct { Options []option.RequestOption Steps FleetifyRouteStepService }
FleetifyRouteService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFleetifyRouteService method instead.
func NewFleetifyRouteService ¶
func NewFleetifyRouteService(opts ...option.RequestOption) (r FleetifyRouteService)
NewFleetifyRouteService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*FleetifyRouteService) New ¶
func (r *FleetifyRouteService) New(ctx context.Context, params FleetifyRouteNewParams, opts ...option.RequestOption) (res *FleetifyRouteNewResponse, err error)
Dispatch a new route
func (*FleetifyRouteService) Redispatch ¶
func (r *FleetifyRouteService) Redispatch(ctx context.Context, routeID string, params FleetifyRouteRedispatchParams, opts ...option.RequestOption) (res *FleetifyRouteRedispatchResponse, err error)
Re-dispatch route
type FleetifyRouteStepCompleteParams ¶
type FleetifyRouteStepCompleteParams struct { RouteID string `path:"routeID,required" json:"-"` // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" json:"-"` // Sets the status of the route step. Currently only completed is supported. // // Note: once marked completed, a step cannot transition to other statuses. You can // only update the document afterwards. Mode param.Opt[string] `json:"mode,omitzero"` // Sets the status of the route step. Currently only completed is supported. // // Note: once marked completed, a step cannot transition to other statuses. You can // only update the document afterwards. Status param.Opt[string] `json:"status,omitzero"` // A key-value map storing form submission data, where keys correspond to field // labels and values can be of any type depend on the type of according document // item. Document DocumentSubmission `json:"document,omitzero"` // contains filtered or unexported fields }
func (FleetifyRouteStepCompleteParams) MarshalJSON ¶
func (r FleetifyRouteStepCompleteParams) MarshalJSON() (data []byte, err error)
func (FleetifyRouteStepCompleteParams) URLQuery ¶
func (r FleetifyRouteStepCompleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes FleetifyRouteStepCompleteParams's query parameters as `url.Values`.
func (*FleetifyRouteStepCompleteParams) UnmarshalJSON ¶
func (r *FleetifyRouteStepCompleteParams) UnmarshalJSON(data []byte) error
type FleetifyRouteStepDeleteParams ¶
type FleetifyRouteStepDeleteParams struct { RouteID string `path:"routeID,required" json:"-"` // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" json:"-"` // contains filtered or unexported fields }
func (FleetifyRouteStepDeleteParams) URLQuery ¶
func (r FleetifyRouteStepDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes FleetifyRouteStepDeleteParams's query parameters as `url.Values`.
type FleetifyRouteStepDeleteResponse ¶
type FleetifyRouteStepDeleteResponse struct { // Returns the error message in case of a failed request. If the request is // successful, this field is not present in the response. Message string `json:"message"` // Returns the status code of the response. Status int64 `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Message respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (FleetifyRouteStepDeleteResponse) RawJSON ¶
func (r FleetifyRouteStepDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyRouteStepDeleteResponse) UnmarshalJSON ¶
func (r *FleetifyRouteStepDeleteResponse) UnmarshalJSON(data []byte) error
type FleetifyRouteStepNewParams ¶
type FleetifyRouteStepNewParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" json:"-"` // Specify the scheduled arrival time of the driver, as an UNIX timestamp in // seconds, at the step. Please note that: // // - Arrival time for each step should be equal to or greater than the previous // step. // - Past times can not be provided. // - The time provided is used only for informative display on the driver app and // it does not impact or get affected by the route generated. Arrival int64 `json:"arrival,required"` // Specify the location coordinates where the steps should be performed in // [latitude, longitude]. Location []float64 `json:"location,omitzero,required"` // Indicates the index at which to insert the step, starting from 0 up to the total // number of steps in the route. Position int64 `json:"position,required"` // Specify the step type. It can belong to one of the following: start, job , // pickup, delivery, end. A duration is mandatory when the step type is either // layover or a break. // // Any of "start", "job", "pickup", "delivery", "break", "layover", "end". Type FleetifyRouteStepNewParamsType `json:"type,omitzero,required"` // Specify the postal address for the step. Address param.Opt[string] `json:"address,omitzero"` // Specify the ID of the document template to be used for collecting proof of // completion for the step. If not specified, the document template specified at // the route level will be used for the step. Use the // [Documents API](https://docs.nextbillion.ai/docs/dispatches/documents-api) to // create, read and manage the document templates. // // Please note that the document template ID can not be assigned to following step // types - start, end, break, layover. DocumentTemplateID param.Opt[string] `json:"document_template_id,omitzero"` // Specify the duration of the layover or break type steps, in seconds. Please note // it is mandatory when step type is either "layover" or "break". Duration param.Opt[int64] `json:"duration,omitzero"` // Specify the mode of completion to be used for the step. Currently, following // values are allowed: // // - manual: Steps must be marked as completed manually through the Driver App. // - geofence: Steps are marked as completed automatically based on the entry // conditions and geofence specified. // - geofence_manual_fallback: Steps will be marked as completed automatically // based on geofence and entry condition configurations but there will also be a // provision for manually updating the status in case, geofence detection fails. // // Any of "manual", "geofence", "geofence_manual_fallback". CompletionMode RouteStepCompletionMode `json:"completion_mode,omitzero"` // Specify the configurations of the geofence which will be used to detect presence // of the driver and complete the tasks automatically. Please note that this // attribute is required when completion_mode is either "geofence" or // "geofence_manual_fallback". GeofenceConfig RouteStepGeofenceConfigParam `json:"geofence_config,omitzero"` // An object to specify any additional details about the task to be associated with // the step in the response. The information provided here will be available on the // Driver's app under step details. This attribute can be used to provide context // about or instructions to the driver for performing the task Meta FleetifyRouteStepNewParamsMeta `json:"meta,omitzero"` // contains filtered or unexported fields }
func (FleetifyRouteStepNewParams) MarshalJSON ¶
func (r FleetifyRouteStepNewParams) MarshalJSON() (data []byte, err error)
func (FleetifyRouteStepNewParams) URLQuery ¶
func (r FleetifyRouteStepNewParams) URLQuery() (v url.Values, err error)
URLQuery serializes FleetifyRouteStepNewParams's query parameters as `url.Values`.
func (*FleetifyRouteStepNewParams) UnmarshalJSON ¶
func (r *FleetifyRouteStepNewParams) UnmarshalJSON(data []byte) error
type FleetifyRouteStepNewParamsMeta ¶
type FleetifyRouteStepNewParamsMeta struct { // Specify the name of the customer for which the step has to be performed. CustomerName param.Opt[string] `json:"customer_name,omitzero"` // Specify the phone number of the person to be contacted when at step location. CustomerPhoneNumber param.Opt[string] `json:"customer_phone_number,omitzero"` // Specify custom instructions to be carried out while performing the step. Instructions param.Opt[string] `json:"instructions,omitzero"` // contains filtered or unexported fields }
An object to specify any additional details about the task to be associated with the step in the response. The information provided here will be available on the Driver's app under step details. This attribute can be used to provide context about or instructions to the driver for performing the task
func (FleetifyRouteStepNewParamsMeta) MarshalJSON ¶
func (r FleetifyRouteStepNewParamsMeta) MarshalJSON() (data []byte, err error)
func (*FleetifyRouteStepNewParamsMeta) UnmarshalJSON ¶
func (r *FleetifyRouteStepNewParamsMeta) UnmarshalJSON(data []byte) error
type FleetifyRouteStepNewParamsType ¶
type FleetifyRouteStepNewParamsType string
Specify the step type. It can belong to one of the following: start, job , pickup, delivery, end. A duration is mandatory when the step type is either layover or a break.
const ( FleetifyRouteStepNewParamsTypeStart FleetifyRouteStepNewParamsType = "start" FleetifyRouteStepNewParamsTypeJob FleetifyRouteStepNewParamsType = "job" FleetifyRouteStepNewParamsTypePickup FleetifyRouteStepNewParamsType = "pickup" FleetifyRouteStepNewParamsTypeDelivery FleetifyRouteStepNewParamsType = "delivery" FleetifyRouteStepNewParamsTypeBreak FleetifyRouteStepNewParamsType = "break" FleetifyRouteStepNewParamsTypeLayover FleetifyRouteStepNewParamsType = "layover" FleetifyRouteStepNewParamsTypeEnd FleetifyRouteStepNewParamsType = "end" )
type FleetifyRouteStepNewResponse ¶
type FleetifyRouteStepNewResponse struct { Data RouteStepsResponse `json:"data"` // Returns the error message in case of a failed request. If the request is // successful, this field is not present in the response. Message string `json:"message"` // Returns the status code of the response. Status int64 `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Message respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (FleetifyRouteStepNewResponse) RawJSON ¶
func (r FleetifyRouteStepNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyRouteStepNewResponse) UnmarshalJSON ¶
func (r *FleetifyRouteStepNewResponse) UnmarshalJSON(data []byte) error
type FleetifyRouteStepService ¶
type FleetifyRouteStepService struct {
Options []option.RequestOption
}
FleetifyRouteStepService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFleetifyRouteStepService method instead.
func NewFleetifyRouteStepService ¶
func NewFleetifyRouteStepService(opts ...option.RequestOption) (r FleetifyRouteStepService)
NewFleetifyRouteStepService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*FleetifyRouteStepService) Complete ¶
func (r *FleetifyRouteStepService) Complete(ctx context.Context, stepID string, params FleetifyRouteStepCompleteParams, opts ...option.RequestOption) (err error)
Complete a route step with document submission, or update the document of a completed route step.
When all steps are completed, the encapsulating route’s status will change to completed automatically.
Either Session Token must be provided to authenticate the request.
func (*FleetifyRouteStepService) Delete ¶
func (r *FleetifyRouteStepService) Delete(ctx context.Context, stepID string, params FleetifyRouteStepDeleteParams, opts ...option.RequestOption) (res *FleetifyRouteStepDeleteResponse, err error)
Delete a step
func (*FleetifyRouteStepService) New ¶
func (r *FleetifyRouteStepService) New(ctx context.Context, routeID string, params FleetifyRouteStepNewParams, opts ...option.RequestOption) (res *FleetifyRouteStepNewResponse, err error)
Insert a new step
func (*FleetifyRouteStepService) Update ¶
func (r *FleetifyRouteStepService) Update(ctx context.Context, stepID string, params FleetifyRouteStepUpdateParams, opts ...option.RequestOption) (res *FleetifyRouteStepUpdateResponse, err error)
Update a step
type FleetifyRouteStepUpdateParams ¶
type FleetifyRouteStepUpdateParams struct { RouteID string `path:"routeID,required" json:"-"` // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" json:"-"` // Specify the scheduled arrival time of the driver, as an UNIX timestamp in // seconds, at the step. Please note that: // // - Arrival time for each step should be equal to or greater than the previous // step. // - Past times can not be provided. // - The time provided is used only for informative display on the driver app and // it does not impact or get affected by the route generated. Arrival int64 `json:"arrival,required"` // Specify the new position of the step. Provide a position different from the // current position of the step to update sequence in which the step get completed. Position int64 `json:"position,required"` // Specify the postal address for the step. Address param.Opt[string] `json:"address,omitzero"` // Update the ID of the document template to be used for collecting proof of // completion for the step. If an empty string "" is provided, the current document // template associated to the step will be removed. DocumentTemplateID param.Opt[string] `json:"document_template_id,omitzero"` // Specify the duration of the layover or break type steps, in seconds. Please note // it is mandatory when step type is either "layover" or "break". Duration param.Opt[int64] `json:"duration,omitzero"` // Specify the mode of completion to be used for the step. Currently, following // values are allowed: // // - manual: Steps must be marked as completed manually through the Driver App. // - geofence: Steps are marked as completed automatically based on the entry // conditions and geofence specified. // - geofence_manual_fallback: Steps will be marked as completed automatically // based on geofence and entry condition configurations but there will also be a // provision for manually updating the status in case, geofence detection fails. // // Any of "manual", "geofence", "geofence_manual_fallback". CompletionMode RouteStepCompletionMode `json:"completion_mode,omitzero"` // Specify the configurations of the geofence which will be used to detect presence // of the driver and complete the tasks automatically. Please note that this // attribute is required when completion_mode is either "geofence" or // "geofence_manual_fallback". GeofenceConfig RouteStepGeofenceConfigParam `json:"geofence_config,omitzero"` // Specify the location coordinates where the steps should be performed in // [latitude, longitude]. Location []float64 `json:"location,omitzero"` // An object to specify any additional details about the task to be associated with // the step in the response. The information provided here will be available on the // Driver's app under step details. This attribute can be used to provide context // about or instructions to the driver for performing the task Meta FleetifyRouteStepUpdateParamsMeta `json:"meta,omitzero"` // Specify the step type. It can belong to one of the following: start, job , // pickup, delivery, end. A duration is mandatory when the step type is either // layover or a break. // // Any of "start", "job", "pickup", "delivery", "break", "layover", "end". Type FleetifyRouteStepUpdateParamsType `json:"type,omitzero"` // contains filtered or unexported fields }
func (FleetifyRouteStepUpdateParams) MarshalJSON ¶
func (r FleetifyRouteStepUpdateParams) MarshalJSON() (data []byte, err error)
func (FleetifyRouteStepUpdateParams) URLQuery ¶
func (r FleetifyRouteStepUpdateParams) URLQuery() (v url.Values, err error)
URLQuery serializes FleetifyRouteStepUpdateParams's query parameters as `url.Values`.
func (*FleetifyRouteStepUpdateParams) UnmarshalJSON ¶
func (r *FleetifyRouteStepUpdateParams) UnmarshalJSON(data []byte) error
type FleetifyRouteStepUpdateParamsMeta ¶
type FleetifyRouteStepUpdateParamsMeta struct { // Specify the name of the customer for which the step has to be performed. CustomerName param.Opt[string] `json:"customer_name,omitzero"` // Specify the phone number of the person to be contacted when at step location. CustomerPhoneNumber param.Opt[string] `json:"customer_phone_number,omitzero"` // Specify custom instructions to be carried out while performing the step. Instructions param.Opt[string] `json:"instructions,omitzero"` // contains filtered or unexported fields }
An object to specify any additional details about the task to be associated with the step in the response. The information provided here will be available on the Driver's app under step details. This attribute can be used to provide context about or instructions to the driver for performing the task
func (FleetifyRouteStepUpdateParamsMeta) MarshalJSON ¶
func (r FleetifyRouteStepUpdateParamsMeta) MarshalJSON() (data []byte, err error)
func (*FleetifyRouteStepUpdateParamsMeta) UnmarshalJSON ¶
func (r *FleetifyRouteStepUpdateParamsMeta) UnmarshalJSON(data []byte) error
type FleetifyRouteStepUpdateParamsType ¶
type FleetifyRouteStepUpdateParamsType string
Specify the step type. It can belong to one of the following: start, job , pickup, delivery, end. A duration is mandatory when the step type is either layover or a break.
const ( FleetifyRouteStepUpdateParamsTypeStart FleetifyRouteStepUpdateParamsType = "start" FleetifyRouteStepUpdateParamsTypeJob FleetifyRouteStepUpdateParamsType = "job" FleetifyRouteStepUpdateParamsTypePickup FleetifyRouteStepUpdateParamsType = "pickup" FleetifyRouteStepUpdateParamsTypeDelivery FleetifyRouteStepUpdateParamsType = "delivery" FleetifyRouteStepUpdateParamsTypeBreak FleetifyRouteStepUpdateParamsType = "break" FleetifyRouteStepUpdateParamsTypeLayover FleetifyRouteStepUpdateParamsType = "layover" FleetifyRouteStepUpdateParamsTypeEnd FleetifyRouteStepUpdateParamsType = "end" )
type FleetifyRouteStepUpdateResponse ¶
type FleetifyRouteStepUpdateResponse struct { Data RouteStepsResponse `json:"data"` // Returns the error message in case of a failed request. If the request is // successful, this field is not present in the response. Message string `json:"message"` // Returns the status code of the response. Status int64 `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Message respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (FleetifyRouteStepUpdateResponse) RawJSON ¶
func (r FleetifyRouteStepUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*FleetifyRouteStepUpdateResponse) UnmarshalJSON ¶
func (r *FleetifyRouteStepUpdateResponse) UnmarshalJSON(data []byte) error
type FleetifyService ¶
type FleetifyService struct { Options []option.RequestOption Routes FleetifyRouteService DocumentTemplates FleetifyDocumentTemplateService }
FleetifyService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFleetifyService method instead.
func NewFleetifyService ¶
func NewFleetifyService(opts ...option.RequestOption) (r FleetifyService)
NewFleetifyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
type GeocodeBatchNewParams ¶
type GeocodeBatchNewParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` Body []GeocodeBatchNewParamsBody // contains filtered or unexported fields }
func (GeocodeBatchNewParams) MarshalJSON ¶
func (r GeocodeBatchNewParams) MarshalJSON() (data []byte, err error)
func (GeocodeBatchNewParams) URLQuery ¶
func (r GeocodeBatchNewParams) URLQuery() (v url.Values, err error)
URLQuery serializes GeocodeBatchNewParams's query parameters as `url.Values`.
func (*GeocodeBatchNewParams) UnmarshalJSON ¶
func (r *GeocodeBatchNewParams) UnmarshalJSON(data []byte) error
type GeocodeBatchNewParamsBody ¶
type GeocodeBatchNewParamsBody struct { // Specify the free-text search query. Please note that whitespace, urls, email // addresses, or other out-of-scope queries will yield no results. Q string `json:"q,required"` // Specify the center of the search context expressed as coordinates. // // Please note that one of "at", "in=circle" or "in=bbox" should be provided for // relevant results. At param.Opt[string] `json:"at,omitzero" format:"latitude,longitude"` // Search within a geographic area. This is a hard filter. Results will be returned // if they are located within the specified area. // // # A geographic area can be // // - a country (or multiple countries), provided as comma-separated // [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country // codes // // The country codes are to be provided in all uppercase. // // Format: countryCode:{countryCode}[,{countryCode}] // // - a circular area, provided as latitude, longitude, and radius (an integer with // meters as unit) // // Format: circle:{latitude},{longitude};r={radius} // // - a bounding box, provided as _west longitude_, _south latitude_, _east // longitude_, _north latitude_ // // Format: bbox:{west longitude},{south latitude},{east longitude},{north // latitude} // // Please provide one of 'at', 'in=circle' or 'in=bbox' input for a relevant // result. In param.Opt[string] `json:"in,omitzero"` // Select the language to be used for result rendering from a list of // [BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) compliant language // codes. Lang param.Opt[string] `json:"lang,omitzero"` // Maximum number of results to be returned. Please note that the minimum value // that can be provided is 1 and the maximum that can be provided is 100. Limit param.Opt[int64] `json:"limit,omitzero"` // contains filtered or unexported fields }
The property Q is required.
func (GeocodeBatchNewParamsBody) MarshalJSON ¶
func (r GeocodeBatchNewParamsBody) MarshalJSON() (data []byte, err error)
func (*GeocodeBatchNewParamsBody) UnmarshalJSON ¶
func (r *GeocodeBatchNewParamsBody) UnmarshalJSON(data []byte) error
type GeocodeBatchNewResponse ¶
type GeocodeBatchNewResponse struct { // The results are presented as a JSON list of candidates in ranked order // (most-likely to least-likely) based on the matched location criteria. Items []GeocodeBatchNewResponseItem `json:"items"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Items respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeocodeBatchNewResponse) RawJSON ¶
func (r GeocodeBatchNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeocodeBatchNewResponse) UnmarshalJSON ¶
func (r *GeocodeBatchNewResponse) UnmarshalJSON(data []byte) error
type GeocodeBatchNewResponseItem ¶
type GeocodeBatchNewResponseItem struct { // The unique identifier for the result item. ID string `json:"id"` // An array returning the location coordinates of all the access points of the // search result. Access Access `json:"access"` // Postal address of the result item. Address Address `json:"address"` // The list of categories assigned to this place. Categories []Categories `json:"categories"` // Contact information like phone, email or website. Contacts []Contacts `json:"contacts"` // The distance "as the crow flies" from the search center to this result item in // meters. Distance int64 `json:"distance"` // The bounding box enclosing the geometric shape (area or line) that an individual // result covers. place typed results have no mapView. MapView MapView `json:"mapView"` // Returns the location coordinates of the result. Position Position `json:"position"` // Score of the result. A higher score indicates a closer match. Scoring GeocodeBatchNewResponseItemScoring `json:"scoring"` // The localized display name of this result item. Title string `json:"title"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Access respjson.Field Address respjson.Field Categories respjson.Field Contacts respjson.Field Distance respjson.Field MapView respjson.Field Position respjson.Field Scoring respjson.Field Title respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeocodeBatchNewResponseItem) RawJSON ¶
func (r GeocodeBatchNewResponseItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeocodeBatchNewResponseItem) UnmarshalJSON ¶
func (r *GeocodeBatchNewResponseItem) UnmarshalJSON(data []byte) error
type GeocodeBatchNewResponseItemScoring ¶
type GeocodeBatchNewResponseItemScoring struct { // A breakdown of how closely individual field of the result matched with the // provided query q. FieldScore any `json:"fieldScore"` // A score, out of 1, indicating how closely the result matches with the provided // query q . QueryScore float64 `json:"queryScore"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { FieldScore respjson.Field QueryScore respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Score of the result. A higher score indicates a closer match.
func (GeocodeBatchNewResponseItemScoring) RawJSON ¶
func (r GeocodeBatchNewResponseItemScoring) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeocodeBatchNewResponseItemScoring) UnmarshalJSON ¶
func (r *GeocodeBatchNewResponseItemScoring) UnmarshalJSON(data []byte) error
type GeocodeGetParams ¶
type GeocodeGetParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Specify the free-text search query. // // Please note that whitespace, urls, email addresses, or other out-of-scope // queries will yield no results. Q string `query:"q,required" json:"-"` // Specify the center of the search context expressed as coordinates. // // Please note that one of "at", "in=circle" or "in=bbox" should be provided for // relevant results. At param.Opt[string] `query:"at,omitzero" format:"latitude,longitude" json:"-"` // Search within a geographic area. This is a hard filter. Results will be returned // if they are located within the specified area. // // # A geographic area can be // // - a country (or multiple countries), provided as comma-separated // [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country // codes // // The country codes are to be provided in all uppercase. // // Format: countryCode:{countryCode}[,{countryCode}] // // - a circular area, provided as latitude, longitude, and radius (an integer with // meters as unit) // // Format: circle:{latitude},{longitude};r={radius} // // - a bounding box, provided as _west longitude_, _south latitude_, _east // longitude_, _north latitude_ // // Format: bbox:{west longitude},{south latitude},{east longitude},{north // latitude} // // Please provide one of 'at', 'in=circle' or 'in=bbox' input for a relevant // result. In param.Opt[string] `query:"in,omitzero" json:"-"` // Select the language to be used for result rendering from a list of // [BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) compliant language // codes. Lang param.Opt[string] `query:"lang,omitzero" json:"-"` // Sets the maximum number of results to be returned. Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // contains filtered or unexported fields }
func (GeocodeGetParams) URLQuery ¶
func (r GeocodeGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes GeocodeGetParams's query parameters as `url.Values`.
type GeocodeGetResponse ¶
type GeocodeGetResponse struct { // The results are presented as a JSON list of candidates in ranked order // (most-likely to least-likely) based on the matched location criteria. Items []GeocodeGetResponseItem `json:"items"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Items respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeocodeGetResponse) RawJSON ¶
func (r GeocodeGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeocodeGetResponse) UnmarshalJSON ¶
func (r *GeocodeGetResponse) UnmarshalJSON(data []byte) error
type GeocodeGetResponseItem ¶
type GeocodeGetResponseItem struct { // The unique identifier for the result item. ID string `json:"id"` // An array returning the location coordinates of all the access points of the // search result. Access Access `json:"access"` // Postal address of the result item. Address Address `json:"address"` // The list of categories assigned to this place. Categories []Categories `json:"categories"` // Contact information like phone, email or website. Contacts []Contacts `json:"contacts"` // The distance "as the crow flies" from the search center to this result item in // meters. Distance int64 `json:"distance"` // The bounding box enclosing the geometric shape (area or line) that an individual // result covers. place typed results have no mapView. MapView MapView `json:"mapView"` // Returns the operating hours of the place, if available. OpeningHours GeocodeGetResponseItemOpeningHours `json:"openingHours"` // Returns the location coordinates of the result. Position Position `json:"position"` // Score of the result. A higher score indicates a closer match. Scoring GeocodeGetResponseItemScoring `json:"scoring"` // The localized display name of this result item. Title string `json:"title"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Access respjson.Field Address respjson.Field Categories respjson.Field Contacts respjson.Field Distance respjson.Field MapView respjson.Field OpeningHours respjson.Field Position respjson.Field Scoring respjson.Field Title respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeocodeGetResponseItem) RawJSON ¶
func (r GeocodeGetResponseItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeocodeGetResponseItem) UnmarshalJSON ¶
func (r *GeocodeGetResponseItem) UnmarshalJSON(data []byte) error
type GeocodeGetResponseItemOpeningHours ¶
type GeocodeGetResponseItemOpeningHours struct { // A collection of attributes with details about the opening and closing hours for // each day of the week. TimeRanges []GeocodeGetResponseItemOpeningHoursTimeRange `json:"timeRanges"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { TimeRanges respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the operating hours of the place, if available.
func (GeocodeGetResponseItemOpeningHours) RawJSON ¶
func (r GeocodeGetResponseItemOpeningHours) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeocodeGetResponseItemOpeningHours) UnmarshalJSON ¶
func (r *GeocodeGetResponseItemOpeningHours) UnmarshalJSON(data []byte) error
type GeocodeGetResponseItemOpeningHoursTimeRange ¶
type GeocodeGetResponseItemOpeningHoursTimeRange struct { // Returns the closing time details. EndTime GeocodeGetResponseItemOpeningHoursTimeRangeEndTime `json:"endTime"` // Returns the open time details. StartTime GeocodeGetResponseItemOpeningHoursTimeRangeStartTime `json:"startTime"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { EndTime respjson.Field StartTime respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeocodeGetResponseItemOpeningHoursTimeRange) RawJSON ¶
func (r GeocodeGetResponseItemOpeningHoursTimeRange) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeocodeGetResponseItemOpeningHoursTimeRange) UnmarshalJSON ¶
func (r *GeocodeGetResponseItemOpeningHoursTimeRange) UnmarshalJSON(data []byte) error
type GeocodeGetResponseItemOpeningHoursTimeRangeEndTime ¶
type GeocodeGetResponseItemOpeningHoursTimeRangeEndTime struct { // The date to which the subsequent closing time details belong to. Date string `json:"date"` // The hour of the day when the place closes. Hour int64 `json:"hour"` // The minute of the hour when the place closes. Minute int64 `json:"minute"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Date respjson.Field Hour respjson.Field Minute respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the closing time details.
func (GeocodeGetResponseItemOpeningHoursTimeRangeEndTime) RawJSON ¶
func (r GeocodeGetResponseItemOpeningHoursTimeRangeEndTime) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeocodeGetResponseItemOpeningHoursTimeRangeEndTime) UnmarshalJSON ¶
func (r *GeocodeGetResponseItemOpeningHoursTimeRangeEndTime) UnmarshalJSON(data []byte) error
type GeocodeGetResponseItemOpeningHoursTimeRangeStartTime ¶
type GeocodeGetResponseItemOpeningHoursTimeRangeStartTime struct { // The date to which the subsequent open time details belong to. Date string `json:"date"` // The hour of the day when the place opens. Hour int64 `json:"hour"` // The minute of the hour when the place opens. Minute int64 `json:"minute"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Date respjson.Field Hour respjson.Field Minute respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the open time details.
func (GeocodeGetResponseItemOpeningHoursTimeRangeStartTime) RawJSON ¶
func (r GeocodeGetResponseItemOpeningHoursTimeRangeStartTime) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeocodeGetResponseItemOpeningHoursTimeRangeStartTime) UnmarshalJSON ¶
func (r *GeocodeGetResponseItemOpeningHoursTimeRangeStartTime) UnmarshalJSON(data []byte) error
type GeocodeGetResponseItemScoring ¶
type GeocodeGetResponseItemScoring struct { // A breakdown of how closely individual field of the result matched with the // provided query q. FieldScore any `json:"fieldScore"` // A score, out of 1, indicating how closely the result matches with the provided // query q . QueryScore float64 `json:"queryScore"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { FieldScore respjson.Field QueryScore respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Score of the result. A higher score indicates a closer match.
func (GeocodeGetResponseItemScoring) RawJSON ¶
func (r GeocodeGetResponseItemScoring) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeocodeGetResponseItemScoring) UnmarshalJSON ¶
func (r *GeocodeGetResponseItemScoring) UnmarshalJSON(data []byte) error
type GeocodeService ¶
type GeocodeService struct {
Options []option.RequestOption
}
GeocodeService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewGeocodeService method instead.
func NewGeocodeService ¶
func NewGeocodeService(opts ...option.RequestOption) (r GeocodeService)
NewGeocodeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*GeocodeService) BatchNew ¶
func (r *GeocodeService) BatchNew(ctx context.Context, params GeocodeBatchNewParams, opts ...option.RequestOption) (res *GeocodeBatchNewResponse, err error)
Batch Geocode
func (*GeocodeService) Get ¶
func (r *GeocodeService) Get(ctx context.Context, query GeocodeGetParams, opts ...option.RequestOption) (res *GeocodeGetResponse, err error)
Geocode
func (*GeocodeService) StructuredGet ¶
func (r *GeocodeService) StructuredGet(ctx context.Context, query GeocodeStructuredGetParams, opts ...option.RequestOption) (res *GeocodeStructuredGetResponse, err error)
Structured Geocode
type GeocodeStructuredGetParams ¶
type GeocodeStructuredGetParams struct { // Specify a valid // [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country // code in which the place being searched should be located. Please note that this // is a case-sensitive field and the country code should be in all uppercase. CountryCode string `query:"countryCode,required" json:"-"` // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Specify the center of the search context expressed as coordinates. // // Please note that one of "at", "in=circle" or "in=bbox" should be provided for // relevant results. At param.Opt[string] `query:"at,omitzero" format:"latitude,longitude" json:"-"` // Specify the city in which the place being searched should be located. City param.Opt[string] `query:"city,omitzero" json:"-"` // Specify the county division of the state in which the place being searched // should be located. County param.Opt[string] `query:"county,omitzero" json:"-"` // Specify the house number of the place being searched. HouseNumber param.Opt[string] `query:"houseNumber,omitzero" json:"-"` // Search within a geographic area. This is a hard filter. Results will be returned // if they are located within the specified area. // // # A geographic area can be // // - a circular area, provided as latitude, longitude, and radius (an integer with // meters as unit) // // Format: circle:{latitude},{longitude};r={radius} // // - a bounding box, provided as _west longitude_, _south latitude_, _east // longitude_, _north latitude_ // // Format: bbox:{west longitude},{south latitude},{east longitude},{north // latitude} // // Please provide one of 'at', 'in=circle' or 'in=bbox' input for a relevant // result. In param.Opt[string] `query:"in,omitzero" json:"-"` // Sets the maximum number of results to be returned. Limit param.Opt[int64] `query:"limit,omitzero" json:"-"` // Specify the postal code in which the place being searched should be located. PostalCode param.Opt[string] `query:"postalCode,omitzero" json:"-"` // Specify the state division of the country in which the place being searched // should be located. State param.Opt[string] `query:"state,omitzero" json:"-"` // Specify the name of the street in which the place being searched should be // located. Street param.Opt[string] `query:"street,omitzero" json:"-"` // contains filtered or unexported fields }
func (GeocodeStructuredGetParams) URLQuery ¶
func (r GeocodeStructuredGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes GeocodeStructuredGetParams's query parameters as `url.Values`.
type GeocodeStructuredGetResponse ¶
type GeocodeStructuredGetResponse struct { // The results are presented as a JSON list of candidates in ranked order // (most-likely to least-likely) based on the matched location criteria. Items []GeocodeStructuredGetResponseItem `json:"items"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Items respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeocodeStructuredGetResponse) RawJSON ¶
func (r GeocodeStructuredGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeocodeStructuredGetResponse) UnmarshalJSON ¶
func (r *GeocodeStructuredGetResponse) UnmarshalJSON(data []byte) error
type GeocodeStructuredGetResponseItem ¶
type GeocodeStructuredGetResponseItem struct { // The unique identifier for the result item. ID string `json:"id"` // An array returning the location coordinates of all the access points of the // search result. Access Access `json:"access"` // Postal address of the result item. Address Address `json:"address"` // The list of categories assigned to this place. Categories []Categories `json:"categories"` // Contact information like phone, email or website. Contacts []Contacts `json:"contacts"` // The distance "as the crow flies" from the search center to this result item in // meters. Distance int64 `json:"distance"` // The bounding box enclosing the geometric shape (area or line) that an individual // result covers. place typed results have no mapView. MapView MapView `json:"mapView"` // Returns the operating hours of the place, if available. OpeningHours GeocodeStructuredGetResponseItemOpeningHours `json:"openingHours"` // Returns the location coordinates of the result. Position Position `json:"position"` // Score of the result. A higher score indicates a closer match. Scoring GeocodeStructuredGetResponseItemScoring `json:"scoring"` // The localized display name of this result item. Title string `json:"title"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Access respjson.Field Address respjson.Field Categories respjson.Field Contacts respjson.Field Distance respjson.Field MapView respjson.Field OpeningHours respjson.Field Position respjson.Field Scoring respjson.Field Title respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeocodeStructuredGetResponseItem) RawJSON ¶
func (r GeocodeStructuredGetResponseItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeocodeStructuredGetResponseItem) UnmarshalJSON ¶
func (r *GeocodeStructuredGetResponseItem) UnmarshalJSON(data []byte) error
type GeocodeStructuredGetResponseItemOpeningHours ¶
type GeocodeStructuredGetResponseItemOpeningHours struct { // A collection of attributes with details about the opening and closing hours for // each day of the week. TimeRanges []GeocodeStructuredGetResponseItemOpeningHoursTimeRange `json:"timeRanges"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { TimeRanges respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the operating hours of the place, if available.
func (GeocodeStructuredGetResponseItemOpeningHours) RawJSON ¶
func (r GeocodeStructuredGetResponseItemOpeningHours) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeocodeStructuredGetResponseItemOpeningHours) UnmarshalJSON ¶
func (r *GeocodeStructuredGetResponseItemOpeningHours) UnmarshalJSON(data []byte) error
type GeocodeStructuredGetResponseItemOpeningHoursTimeRange ¶
type GeocodeStructuredGetResponseItemOpeningHoursTimeRange struct { // Returns the closing time details. EndTime GeocodeStructuredGetResponseItemOpeningHoursTimeRangeEndTime `json:"endTime"` // Returns the open time details. StartTime GeocodeStructuredGetResponseItemOpeningHoursTimeRangeStartTime `json:"startTime"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { EndTime respjson.Field StartTime respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeocodeStructuredGetResponseItemOpeningHoursTimeRange) RawJSON ¶
func (r GeocodeStructuredGetResponseItemOpeningHoursTimeRange) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeocodeStructuredGetResponseItemOpeningHoursTimeRange) UnmarshalJSON ¶
func (r *GeocodeStructuredGetResponseItemOpeningHoursTimeRange) UnmarshalJSON(data []byte) error
type GeocodeStructuredGetResponseItemOpeningHoursTimeRangeEndTime ¶
type GeocodeStructuredGetResponseItemOpeningHoursTimeRangeEndTime struct { // The date to which the subsequent closing time details belong to. Date string `json:"date"` // The hour of the day when the place closes. Hour int64 `json:"hour"` // The minute of the hour when the place closes. Minute int64 `json:"minute"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Date respjson.Field Hour respjson.Field Minute respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the closing time details.
func (GeocodeStructuredGetResponseItemOpeningHoursTimeRangeEndTime) RawJSON ¶
func (r GeocodeStructuredGetResponseItemOpeningHoursTimeRangeEndTime) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeocodeStructuredGetResponseItemOpeningHoursTimeRangeEndTime) UnmarshalJSON ¶
func (r *GeocodeStructuredGetResponseItemOpeningHoursTimeRangeEndTime) UnmarshalJSON(data []byte) error
type GeocodeStructuredGetResponseItemOpeningHoursTimeRangeStartTime ¶
type GeocodeStructuredGetResponseItemOpeningHoursTimeRangeStartTime struct { // The date to which the subsequent open time details belong to. Date string `json:"date"` // The hour of the day when the place opens. Hour int64 `json:"hour"` // The minute of the hour when the place opens. Minute int64 `json:"minute"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Date respjson.Field Hour respjson.Field Minute respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the open time details.
func (GeocodeStructuredGetResponseItemOpeningHoursTimeRangeStartTime) RawJSON ¶
func (r GeocodeStructuredGetResponseItemOpeningHoursTimeRangeStartTime) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeocodeStructuredGetResponseItemOpeningHoursTimeRangeStartTime) UnmarshalJSON ¶
func (r *GeocodeStructuredGetResponseItemOpeningHoursTimeRangeStartTime) UnmarshalJSON(data []byte) error
type GeocodeStructuredGetResponseItemScoring ¶
type GeocodeStructuredGetResponseItemScoring struct { // A breakdown of how closely individual field of the result matched with the // provided query q. FieldScore any `json:"fieldScore"` // A score, out of 1, indicating how closely the result matches with the provided // query q . QueryScore float64 `json:"queryScore"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { FieldScore respjson.Field QueryScore respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Score of the result. A higher score indicates a closer match.
func (GeocodeStructuredGetResponseItemScoring) RawJSON ¶
func (r GeocodeStructuredGetResponseItemScoring) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeocodeStructuredGetResponseItemScoring) UnmarshalJSON ¶
func (r *GeocodeStructuredGetResponseItemScoring) UnmarshalJSON(data []byte) error
type Geofence ¶
type Geofence struct { // ID of the geofence provided/generated at the time of creating the geofence. ID string `json:"id"` CircleCenter GeofenceCircleCenter `json:"circle_center"` // When the type of the geofence is circle, this property returns the radius of the // geofence in meters (m). CircleRadius float64 `json:"circle_radius"` // Time at which the geofence was created, expressed as a UNIX timestamp in // seconds. CreatedAt int64 `json:"created_at"` // An object with geoJSON details of the geofence. The contents of this object // follow the [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946). Geojson PolygonGeojson `json:"geojson"` // For a geofence based on isochrone contour determined using a specific driving // distance, this property returns the duration value, in meters. // // The value would be the same as that provided for the contours_meter parameter at // the time of creating or updating the geofence. IcContoursMeter int64 `json:"ic_contours_meter"` // For a geofence based on isochrone contour determined using a specific driving // duration, this property returns the duration value, in minutes. The value would // be the same as the value provided for the contours_minute parameter at the time // of creating or updating the geofence. IcContoursMinute int64 `json:"ic_contours_minute"` // For a geofence based on isochrone contour, this property returns the coordinates // of the location, in [latitude,longitude] format, which was used as the starting // point to identify the geofence boundary. // // The value would be the same as that provided for the coordinates parameter at // the time of creating or updating the geofence. IcCoordinates string `json:"ic_coordinates" format:"latitude,longitude"` // For a geofence based on isochrone contour, this property returns the denoise // value which would be the same as that provided for the denoise parameter at the // time of creating or updating the geofence. IcDenoise float64 `json:"ic_denoise"` // For a geofence based on isochrone contour, this property returns the departure // time, as a UNIX epoch timestamp in seconds, which was used to determine the // geofence boundary after taking into account the traffic conditions at the time. // // The value would be the same as that provided for the departure_time parameter at // the time of creating or updating the geofence. IcDepartureTime int64 `json:"ic_departure_time"` // For a geofence based on isochrone contour, this property returns the driving // mode used to determine the geofence boundary. // // The value would be the same as that provided for the mode parameter at the time // of creating or updating the geofence. IcMode float64 `json:"ic_mode"` // Metadata of the geofence added at the time of creating or updating it. MetaData any `json:"meta_data"` // Name of the geofence added at the time of creating or updating it. Name string `json:"name"` // An array of strings representing the tags associated with the geofence added at // the time of creating or updating it. Tags []string `json:"tags"` // Type of the geofence. // // Any of "circle", "polygon", "isochrone". Type GeofenceType `json:"type"` // Time at which the geofence was last updated, expressed as a UNIX timestamp in // seconds. UpdatedAt int64 `json:"updated_at"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field CircleCenter respjson.Field CircleRadius respjson.Field CreatedAt respjson.Field Geojson respjson.Field IcContoursMeter respjson.Field IcContoursMinute respjson.Field IcCoordinates respjson.Field IcDenoise respjson.Field IcDepartureTime respjson.Field IcMode respjson.Field MetaData respjson.Field Name respjson.Field Tags respjson.Field Type respjson.Field UpdatedAt respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with details of the geofence.
func (*Geofence) UnmarshalJSON ¶
type GeofenceBatchDeleteParams ¶
type GeofenceBatchDeleteParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // An array IDs of the geofence to be deleted. These are the IDs that were // generated/provided at the time of creating the respective geofences. IDs []string `json:"ids,omitzero"` // contains filtered or unexported fields }
func (GeofenceBatchDeleteParams) MarshalJSON ¶
func (r GeofenceBatchDeleteParams) MarshalJSON() (data []byte, err error)
func (GeofenceBatchDeleteParams) URLQuery ¶
func (r GeofenceBatchDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes GeofenceBatchDeleteParams's query parameters as `url.Values`.
func (*GeofenceBatchDeleteParams) UnmarshalJSON ¶
func (r *GeofenceBatchDeleteParams) UnmarshalJSON(data []byte) error
type GeofenceBatchListParams ¶
type GeofenceBatchListParams struct { // Comma(,) separated list of IDs of the geofences to be searched. IDs string `query:"ids,required" format:"ID_1,ID_2,ID_3,...." json:"-"` // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // contains filtered or unexported fields }
func (GeofenceBatchListParams) URLQuery ¶
func (r GeofenceBatchListParams) URLQuery() (v url.Values, err error)
URLQuery serializes GeofenceBatchListParams's query parameters as `url.Values`.
type GeofenceBatchListResponse ¶
type GeofenceBatchListResponse struct { Data GeofenceBatchListResponseData `json:"data,required"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeofenceBatchListResponse) RawJSON ¶
func (r GeofenceBatchListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceBatchListResponse) UnmarshalJSON ¶
func (r *GeofenceBatchListResponse) UnmarshalJSON(data []byte) error
type GeofenceBatchListResponseData ¶
type GeofenceBatchListResponseData struct { // An array of objects containing the details of the geofences returned matching // the IDs provided. Each object represents one geofence. List []Geofence `json:"list,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { List respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeofenceBatchListResponseData) RawJSON ¶
func (r GeofenceBatchListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceBatchListResponseData) UnmarshalJSON ¶
func (r *GeofenceBatchListResponseData) UnmarshalJSON(data []byte) error
type GeofenceBatchNewParams ¶
type GeofenceBatchNewParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // An array of objects to collect the details of the multiple geofences that need // to be created. Geofences []GeofenceEntityCreateParam `json:"geofences,omitzero"` // contains filtered or unexported fields }
func (GeofenceBatchNewParams) MarshalJSON ¶
func (r GeofenceBatchNewParams) MarshalJSON() (data []byte, err error)
func (GeofenceBatchNewParams) URLQuery ¶
func (r GeofenceBatchNewParams) URLQuery() (v url.Values, err error)
URLQuery serializes GeofenceBatchNewParams's query parameters as `url.Values`.
func (*GeofenceBatchNewParams) UnmarshalJSON ¶
func (r *GeofenceBatchNewParams) UnmarshalJSON(data []byte) error
type GeofenceBatchNewResponse ¶
type GeofenceBatchNewResponse struct { // A data object containing the IDs of the geofences created. Data GeofenceBatchNewResponseData `json:"data"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeofenceBatchNewResponse) RawJSON ¶
func (r GeofenceBatchNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceBatchNewResponse) UnmarshalJSON ¶
func (r *GeofenceBatchNewResponse) UnmarshalJSON(data []byte) error
type GeofenceBatchNewResponseData ¶
type GeofenceBatchNewResponseData struct { IDs []string `json:"ids"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { IDs respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
A data object containing the IDs of the geofences created.
func (GeofenceBatchNewResponseData) RawJSON ¶
func (r GeofenceBatchNewResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceBatchNewResponseData) UnmarshalJSON ¶
func (r *GeofenceBatchNewResponseData) UnmarshalJSON(data []byte) error
type GeofenceBatchService ¶
type GeofenceBatchService struct {
Options []option.RequestOption
}
GeofenceBatchService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewGeofenceBatchService method instead.
func NewGeofenceBatchService ¶
func NewGeofenceBatchService(opts ...option.RequestOption) (r GeofenceBatchService)
NewGeofenceBatchService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*GeofenceBatchService) Delete ¶
func (r *GeofenceBatchService) Delete(ctx context.Context, params GeofenceBatchDeleteParams, opts ...option.RequestOption) (res *SimpleResp, err error)
Delete Batch Geofence
func (*GeofenceBatchService) List ¶
func (r *GeofenceBatchService) List(ctx context.Context, query GeofenceBatchListParams, opts ...option.RequestOption) (res *GeofenceBatchListResponse, err error)
Batch Query of Geofence
func (*GeofenceBatchService) New ¶
func (r *GeofenceBatchService) New(ctx context.Context, params GeofenceBatchNewParams, opts ...option.RequestOption) (res *GeofenceBatchNewResponse, err error)
Batch Creation of Geofence
type GeofenceCircleCenter ¶
type GeofenceCircleCenter struct { // Latitude of the location. Lat float64 `json:"lat"` // Longitude of the location. Lon float64 `json:"lon"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Lat respjson.Field Lon respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeofenceCircleCenter) RawJSON ¶
func (r GeofenceCircleCenter) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceCircleCenter) UnmarshalJSON ¶
func (r *GeofenceCircleCenter) UnmarshalJSON(data []byte) error
type GeofenceConsolePreviewParams ¶
type GeofenceConsolePreviewParams struct { GeofenceEntityCreate GeofenceEntityCreateParam // contains filtered or unexported fields }
func (GeofenceConsolePreviewParams) MarshalJSON ¶
func (r GeofenceConsolePreviewParams) MarshalJSON() (data []byte, err error)
func (*GeofenceConsolePreviewParams) UnmarshalJSON ¶
func (r *GeofenceConsolePreviewParams) UnmarshalJSON(data []byte) error
type GeofenceConsolePreviewResponse ¶
type GeofenceConsolePreviewResponse struct { Data GeofenceConsolePreviewResponseData `json:"data"` Message string `json:"message"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Message respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeofenceConsolePreviewResponse) RawJSON ¶
func (r GeofenceConsolePreviewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceConsolePreviewResponse) UnmarshalJSON ¶
func (r *GeofenceConsolePreviewResponse) UnmarshalJSON(data []byte) error
type GeofenceConsolePreviewResponseData ¶
type GeofenceConsolePreviewResponseData struct { // An object with geoJSON details of the geofence. The contents of this object // follow the [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946). Geojson PolygonGeojson `json:"geojson"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Geojson respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeofenceConsolePreviewResponseData) RawJSON ¶
func (r GeofenceConsolePreviewResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceConsolePreviewResponseData) UnmarshalJSON ¶
func (r *GeofenceConsolePreviewResponseData) UnmarshalJSON(data []byte) error
type GeofenceConsoleSearchParams ¶
type GeofenceConsoleSearchParams struct { // string to be searched, will used to match name or id of geofence. Query string `query:"query,required" format:"key1=value&key" json:"-"` // contains filtered or unexported fields }
func (GeofenceConsoleSearchParams) URLQuery ¶
func (r GeofenceConsoleSearchParams) URLQuery() (v url.Values, err error)
URLQuery serializes GeofenceConsoleSearchParams's query parameters as `url.Values`.
type GeofenceConsoleSearchResponse ¶
type GeofenceConsoleSearchResponse struct { Data GeofenceConsoleSearchResponseData `json:"data,required"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeofenceConsoleSearchResponse) RawJSON ¶
func (r GeofenceConsoleSearchResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceConsoleSearchResponse) UnmarshalJSON ¶
func (r *GeofenceConsoleSearchResponse) UnmarshalJSON(data []byte) error
type GeofenceConsoleSearchResponseData ¶
type GeofenceConsoleSearchResponseData struct { Result []GeofenceConsoleSearchResponseDataResult `json:"result,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Result respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeofenceConsoleSearchResponseData) RawJSON ¶
func (r GeofenceConsoleSearchResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceConsoleSearchResponseData) UnmarshalJSON ¶
func (r *GeofenceConsoleSearchResponseData) UnmarshalJSON(data []byte) error
type GeofenceConsoleSearchResponseDataResult ¶
type GeofenceConsoleSearchResponseDataResult struct { // ID of goefence. Could be empty string. ID string `json:"id,required"` // Name of goefence. Could be empty string. Name string `json:"name,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Name respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeofenceConsoleSearchResponseDataResult) RawJSON ¶
func (r GeofenceConsoleSearchResponseDataResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceConsoleSearchResponseDataResult) UnmarshalJSON ¶
func (r *GeofenceConsoleSearchResponseDataResult) UnmarshalJSON(data []byte) error
type GeofenceConsoleService ¶
type GeofenceConsoleService struct {
Options []option.RequestOption
}
GeofenceConsoleService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewGeofenceConsoleService method instead.
func NewGeofenceConsoleService ¶
func NewGeofenceConsoleService(opts ...option.RequestOption) (r GeofenceConsoleService)
NewGeofenceConsoleService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*GeofenceConsoleService) Preview ¶
func (r *GeofenceConsoleService) Preview(ctx context.Context, body GeofenceConsolePreviewParams, opts ...option.RequestOption) (res *GeofenceConsolePreviewResponse, err error)
preview geofence geojson
func (*GeofenceConsoleService) Search ¶
func (r *GeofenceConsoleService) Search(ctx context.Context, query GeofenceConsoleSearchParams, opts ...option.RequestOption) (res *GeofenceConsoleSearchResponse, err error)
Console Geofence Search API
type GeofenceContainsParams ¶
type GeofenceContainsParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Pipe (|) separated coordinates, in [latitude,longitude] format, of the locations // to be searched against the geofences. Locations string `query:"locations,required" json:"-"` // A , separated list geofence IDs against which the locations will be searched. If // not provided, then the 'locations' will be searched against all your existing // geofences. // // Maximum length of the string can be 256 characters. Geofences param.Opt[string] `query:"geofences,omitzero" format:"geofenceID_1,geofenceID_2,...." json:"-"` // When true, an array with detailed information of geofences is returned. When // false, an array containing only the IDs of the geofences is returned. Verbose param.Opt[string] `query:"verbose,omitzero" json:"-"` // contains filtered or unexported fields }
func (GeofenceContainsParams) URLQuery ¶
func (r GeofenceContainsParams) URLQuery() (v url.Values, err error)
URLQuery serializes GeofenceContainsParams's query parameters as `url.Values`.
type GeofenceContainsResponse ¶
type GeofenceContainsResponse struct { Data GeofenceContainsResponseData `json:"data"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeofenceContainsResponse) RawJSON ¶
func (r GeofenceContainsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceContainsResponse) UnmarshalJSON ¶
func (r *GeofenceContainsResponse) UnmarshalJSON(data []byte) error
type GeofenceContainsResponseData ¶
type GeofenceContainsResponseData struct { // An array of objects containing each of the geofences provided in the geofences // input. If geofences in not provided then the array will return all the geofences // associated with the key ResultList []GeofenceContainsResponseDataResultList `json:"result_list"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ResultList respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeofenceContainsResponseData) RawJSON ¶
func (r GeofenceContainsResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceContainsResponseData) UnmarshalJSON ¶
func (r *GeofenceContainsResponseData) UnmarshalJSON(data []byte) error
type GeofenceContainsResponseDataResultList ¶
type GeofenceContainsResponseDataResultList struct { // An object with details of the geofence. GeofenceDetail Geofence `json:"geofence_detail"` // ID of the geofence provided/generated at the time of creating the geofence. GeofenceID string `json:"geofence_id"` // An array of objects with results of the contains check for each of the // coordinate points in locations against the geofence represented by geofence_id. Result []GeofenceContainsResponseDataResultListResult `json:"result"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { GeofenceDetail respjson.Field GeofenceID respjson.Field Result respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeofenceContainsResponseDataResultList) RawJSON ¶
func (r GeofenceContainsResponseDataResultList) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceContainsResponseDataResultList) UnmarshalJSON ¶
func (r *GeofenceContainsResponseDataResultList) UnmarshalJSON(data []byte) error
type GeofenceContainsResponseDataResultListResult ¶
type GeofenceContainsResponseDataResultListResult struct { // true when a coordinate point in locations is contained by this geofence. Contain bool `json:"contain"` // Index of the coordinate point in the input locations. LocationIndex int64 `json:"location_index"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Contain respjson.Field LocationIndex respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeofenceContainsResponseDataResultListResult) RawJSON ¶
func (r GeofenceContainsResponseDataResultListResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceContainsResponseDataResultListResult) UnmarshalJSON ¶
func (r *GeofenceContainsResponseDataResultListResult) UnmarshalJSON(data []byte) error
type GeofenceDeleteParams ¶
type GeofenceDeleteParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // contains filtered or unexported fields }
func (GeofenceDeleteParams) URLQuery ¶
func (r GeofenceDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes GeofenceDeleteParams's query parameters as `url.Values`.
type GeofenceEntityCreateCircleCenterParam ¶
type GeofenceEntityCreateCircleCenterParam struct { // Latitude of the center location. Lat float64 `json:"lat,required"` // Longitude of the center location. Lon float64 `json:"lon,required"` // contains filtered or unexported fields }
Coordinate of the location which will act as the center of a circular geofence.
The properties Lat, Lon are required.
func (GeofenceEntityCreateCircleCenterParam) MarshalJSON ¶
func (r GeofenceEntityCreateCircleCenterParam) MarshalJSON() (data []byte, err error)
func (*GeofenceEntityCreateCircleCenterParam) UnmarshalJSON ¶
func (r *GeofenceEntityCreateCircleCenterParam) UnmarshalJSON(data []byte) error
type GeofenceEntityCreateCircleParam ¶
type GeofenceEntityCreateCircleParam struct { // Coordinate of the location which will act as the center of a circular geofence. Center GeofenceEntityCreateCircleCenterParam `json:"center,omitzero,required"` // Radius of the circular geofence, in meters. Maximum value allowed is 50000 // meters. Radius float64 `json:"radius,required"` // contains filtered or unexported fields }
Provide the details to create a circular geofence. Please note that this object is mandatory when type is circle. When the type is not circle, the properties of this object will be ignored while creating the geofence.
The properties Center, Radius are required.
func (GeofenceEntityCreateCircleParam) MarshalJSON ¶
func (r GeofenceEntityCreateCircleParam) MarshalJSON() (data []byte, err error)
func (*GeofenceEntityCreateCircleParam) UnmarshalJSON ¶
func (r *GeofenceEntityCreateCircleParam) UnmarshalJSON(data []byte) error
type GeofenceEntityCreateIsochroneParam ¶
type GeofenceEntityCreateIsochroneParam struct { // Coordinates of the location, in [latitude,longitude] format, which would act as // the starting point for identifying the isochrone polygon or the boundary of // reachable area. This parameter is mandatory when type is isochrone. Coordinates string `json:"coordinates,required"` // The distance, in meters, for which an isochrone polygon needs to be determined. // When provided, the API would create a geofence representing the area that can be // reached after driving the given number of meters starting from the point // specified in coordinates. // // The maximum distance that can be specified is 60000 meters (60km). // // At least one of contours_meter or contours_minute is mandatory when type is // isochrone. ContoursMeter param.Opt[int64] `json:"contours_meter,omitzero"` // The duration, in minutes, for which an isochrone polygon needs to be determined. // When provided, the API would create a geofence representing the area that can be // reached after driving for the given number of minutes starting from the point // specified in coordinates. // // The maximum duration that can be specified is 40 minutes. // // At least one of contours_meter or contours_minute is mandatory when type is // isochrone. ContoursMinute param.Opt[int64] `json:"contours_minute,omitzero"` // A floating point value from 0.0 to 1.0 that can be used to remove smaller // contours. A value of 1.0 will only return the largest contour for a given value. // A value of 0.5 drops any contours that are less than half the area of the // largest contour in the set of contours for that same value. Denoise param.Opt[float64] `json:"denoise,omitzero"` // A UNIX epoch timestamp in seconds format that can be used to set the departure // time. The isochrone boundary will be determined based on the typical traffic // conditions at the given time. If no input is provided for this parameter then // the traffic conditions at the time of making the request are considered DepartureTime param.Opt[int64] `json:"departure_time,omitzero"` // Set which driving mode the service should use to determine the isochrone line. // // For example, if you use car, the API will return an isochrone polygon that a car // can cover within the specified time or after driving the specified distance. // Using truck will return an isochrone that a truck can reach after taking into // account appropriate truck routing restrictions. // // Any of "car", "truck". Mode string `json:"mode,omitzero"` // contains filtered or unexported fields }
Provide the details to create an isochrone based geofence. Use this object when type is isochrone. When the type is not isochrone, the properties of this object will be ignored while creating the geofence.
The property Coordinates is required.
func (GeofenceEntityCreateIsochroneParam) MarshalJSON ¶
func (r GeofenceEntityCreateIsochroneParam) MarshalJSON() (data []byte, err error)
func (*GeofenceEntityCreateIsochroneParam) UnmarshalJSON ¶
func (r *GeofenceEntityCreateIsochroneParam) UnmarshalJSON(data []byte) error
type GeofenceEntityCreateParam ¶
type GeofenceEntityCreateParam struct { // Specify the type of the geofence that is being created. // // Any of "circle", "polygon", "isochrone". Type GeofenceEntityCreateType `json:"type,omitzero,required"` // Set an unique ID for the new geofence. If not provided, an ID will be // automatically generated in UUID format. A valid custom*id can contain letters, // numbers, "-", & "*" only. // // Please note that the ID of a geofence can not be changed once it is created. CustomID param.Opt[string] `json:"custom_id,omitzero"` // Name of the geofence. Use this field to assign a meaningful, custom name to the // geofence being created. Name param.Opt[string] `json:"name,omitzero"` // Provide the details to create a circular geofence. Please note that this object // is mandatory when type is circle. When the type is not circle, the properties of // this object will be ignored while creating the geofence. Circle GeofenceEntityCreateCircleParam `json:"circle,omitzero"` // Provide the details to create an isochrone based geofence. Use this object when // type is isochrone. When the type is not isochrone, the properties of this object // will be ignored while creating the geofence. Isochrone GeofenceEntityCreateIsochroneParam `json:"isochrone,omitzero"` // Metadata of the geofence. Use this field to define custom attributes that // provide more context and information about the geofence being created like // country, group ID etc. // // The data being added should be in valid JSON object format (i.e. key and value // pairs). Max size allowed for the object is 65kb. MetaData any `json:"meta_data,omitzero"` // Provide the details to create a custom polygon type of geofence. Please note // that this object is mandatory when type is polygon. When the type is not // polygon, the properties of this object will be ignored while creating the // geofence. // // Self-intersecting polygons or polygons containing other polygons are invalid and // will be removed while processing the request. // // Area of the polygon should be less than 2000 km<sup>2</sup>. Polygon GeofenceEntityCreatePolygonParam `json:"polygon,omitzero"` // An array of strings to associate multiple tags to the geofence. tags can be used // to search or filter geofences (using Get Geofence List method). // // Create valid tags using a string consisting of alphanumeric characters (A-Z, // a-z, 0-9) along with the underscore ('\_') and hyphen ('-') symbols. Tags []string `json:"tags,omitzero"` // contains filtered or unexported fields }
The property Type is required.
func (GeofenceEntityCreateParam) MarshalJSON ¶
func (r GeofenceEntityCreateParam) MarshalJSON() (data []byte, err error)
func (*GeofenceEntityCreateParam) UnmarshalJSON ¶
func (r *GeofenceEntityCreateParam) UnmarshalJSON(data []byte) error
type GeofenceEntityCreatePolygonGeojsonParam ¶
type GeofenceEntityCreatePolygonGeojsonParam struct { // An array of coordinates in the [longitude, latitude] format, representing the // geofence boundary. Coordinates [][]float64 `json:"coordinates,omitzero,required"` // Type of the geoJSON geometry. Should always be Polygon. Type string `json:"type,required"` // contains filtered or unexported fields }
An object to collect geoJSON details of the geofence. The contents of this object follow the [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946).
The properties Coordinates, Type are required.
func (GeofenceEntityCreatePolygonGeojsonParam) MarshalJSON ¶
func (r GeofenceEntityCreatePolygonGeojsonParam) MarshalJSON() (data []byte, err error)
func (*GeofenceEntityCreatePolygonGeojsonParam) UnmarshalJSON ¶
func (r *GeofenceEntityCreatePolygonGeojsonParam) UnmarshalJSON(data []byte) error
type GeofenceEntityCreatePolygonParam ¶
type GeofenceEntityCreatePolygonParam struct { // An object to collect geoJSON details of the geofence. The contents of this // object follow the // [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946). Geojson GeofenceEntityCreatePolygonGeojsonParam `json:"geojson,omitzero,required"` // contains filtered or unexported fields }
Provide the details to create a custom polygon type of geofence. Please note that this object is mandatory when type is polygon. When the type is not polygon, the properties of this object will be ignored while creating the geofence.
Self-intersecting polygons or polygons containing other polygons are invalid and will be removed while processing the request.
Area of the polygon should be less than 2000 km<sup>2</sup>.
The property Geojson is required.
func (GeofenceEntityCreatePolygonParam) MarshalJSON ¶
func (r GeofenceEntityCreatePolygonParam) MarshalJSON() (data []byte, err error)
func (*GeofenceEntityCreatePolygonParam) UnmarshalJSON ¶
func (r *GeofenceEntityCreatePolygonParam) UnmarshalJSON(data []byte) error
type GeofenceEntityCreateType ¶
type GeofenceEntityCreateType string
Specify the type of the geofence that is being created.
const ( GeofenceEntityCreateTypeCircle GeofenceEntityCreateType = "circle" GeofenceEntityCreateTypePolygon GeofenceEntityCreateType = "polygon" GeofenceEntityCreateTypeIsochrone GeofenceEntityCreateType = "isochrone" )
type GeofenceGetParams ¶
type GeofenceGetParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // contains filtered or unexported fields }
func (GeofenceGetParams) URLQuery ¶
func (r GeofenceGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes GeofenceGetParams's query parameters as `url.Values`.
type GeofenceGetResponse ¶
type GeofenceGetResponse struct { Data GeofenceGetResponseData `json:"data"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeofenceGetResponse) RawJSON ¶
func (r GeofenceGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceGetResponse) UnmarshalJSON ¶
func (r *GeofenceGetResponse) UnmarshalJSON(data []byte) error
type GeofenceGetResponseData ¶
type GeofenceGetResponseData struct { // An object with details of the geofence. Geofence Geofence `json:"geofence"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Geofence respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeofenceGetResponseData) RawJSON ¶
func (r GeofenceGetResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceGetResponseData) UnmarshalJSON ¶
func (r *GeofenceGetResponseData) UnmarshalJSON(data []byte) error
type GeofenceListParams ¶
type GeofenceListParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Denotes page number. Use this along with the ps parameter to implement // pagination for your searched results. This parameter does not have a maximum // limit but would return an empty response in case a higher value is provided when // the result-set itself is smaller. Pn param.Opt[int64] `query:"pn,omitzero" json:"-"` // Denotes number of search results per page. Use this along with the pn parameter // to implement pagination for your searched results. Ps param.Opt[int64] `query:"ps,omitzero" json:"-"` // Comma (,) separated list of tags which will be used to filter the geofences. // // Please note only the geofences which have all the tags added to this parameter // will be included in the result. This parameter can accept a string with a // maximum length of 256 characters. Tags param.Opt[string] `query:"tags,omitzero" format:"value_1,value_2,..." json:"-"` // contains filtered or unexported fields }
func (GeofenceListParams) URLQuery ¶
func (r GeofenceListParams) URLQuery() (v url.Values, err error)
URLQuery serializes GeofenceListParams's query parameters as `url.Values`.
type GeofenceListResponse ¶
type GeofenceListResponse struct { Data GeofenceListResponseData `json:"data"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeofenceListResponse) RawJSON ¶
func (r GeofenceListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceListResponse) UnmarshalJSON ¶
func (r *GeofenceListResponse) UnmarshalJSON(data []byte) error
type GeofenceListResponseData ¶
type GeofenceListResponseData struct { List []Geofence `json:"list"` // An object with pagination details of the search results. Use this object to // implement pagination in your application. Page Pagination `json:"page"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { List respjson.Field Page respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeofenceListResponseData) RawJSON ¶
func (r GeofenceListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceListResponseData) UnmarshalJSON ¶
func (r *GeofenceListResponseData) UnmarshalJSON(data []byte) error
type GeofenceNewParams ¶
type GeofenceNewParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` GeofenceEntityCreate GeofenceEntityCreateParam // contains filtered or unexported fields }
func (GeofenceNewParams) MarshalJSON ¶
func (r GeofenceNewParams) MarshalJSON() (data []byte, err error)
func (GeofenceNewParams) URLQuery ¶
func (r GeofenceNewParams) URLQuery() (v url.Values, err error)
URLQuery serializes GeofenceNewParams's query parameters as `url.Values`.
func (*GeofenceNewParams) UnmarshalJSON ¶
func (r *GeofenceNewParams) UnmarshalJSON(data []byte) error
type GeofenceNewResponse ¶
type GeofenceNewResponse struct { // A data object containing the ID of the geofence created. Data GeofenceNewResponseData `json:"data"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (GeofenceNewResponse) RawJSON ¶
func (r GeofenceNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceNewResponse) UnmarshalJSON ¶
func (r *GeofenceNewResponse) UnmarshalJSON(data []byte) error
type GeofenceNewResponseData ¶
type GeofenceNewResponseData struct { // Unique ID of the geofence created. It will be the same as custom_id, if // provided. Else it will be an auto generated UUID. Please note this ID cannot be // updated. ID string `json:"id"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
A data object containing the ID of the geofence created.
func (GeofenceNewResponseData) RawJSON ¶
func (r GeofenceNewResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*GeofenceNewResponseData) UnmarshalJSON ¶
func (r *GeofenceNewResponseData) UnmarshalJSON(data []byte) error
type GeofenceService ¶
type GeofenceService struct { Options []option.RequestOption Console GeofenceConsoleService Batch GeofenceBatchService }
GeofenceService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewGeofenceService method instead.
func NewGeofenceService ¶
func NewGeofenceService(opts ...option.RequestOption) (r GeofenceService)
NewGeofenceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*GeofenceService) Contains ¶
func (r *GeofenceService) Contains(ctx context.Context, query GeofenceContainsParams, opts ...option.RequestOption) (res *GeofenceContainsResponse, err error)
Geofence Contains
func (*GeofenceService) Delete ¶
func (r *GeofenceService) Delete(ctx context.Context, id string, body GeofenceDeleteParams, opts ...option.RequestOption) (res *SimpleResp, err error)
Delete a Geofence
func (*GeofenceService) Get ¶
func (r *GeofenceService) Get(ctx context.Context, id string, query GeofenceGetParams, opts ...option.RequestOption) (res *GeofenceGetResponse, err error)
Get a Geofence
func (*GeofenceService) List ¶
func (r *GeofenceService) List(ctx context.Context, query GeofenceListParams, opts ...option.RequestOption) (res *GeofenceListResponse, err error)
Get Geofence List
func (*GeofenceService) New ¶
func (r *GeofenceService) New(ctx context.Context, params GeofenceNewParams, opts ...option.RequestOption) (res *GeofenceNewResponse, err error)
Create a geofence
func (*GeofenceService) Update ¶
func (r *GeofenceService) Update(ctx context.Context, id string, params GeofenceUpdateParams, opts ...option.RequestOption) (res *SimpleResp, err error)
Update a Geofence
type GeofenceType ¶
type GeofenceType string
Type of the geofence.
const ( GeofenceTypeCircle GeofenceType = "circle" GeofenceTypePolygon GeofenceType = "polygon" GeofenceTypeIsochrone GeofenceType = "isochrone" )
type GeofenceUpdateParams ¶
type GeofenceUpdateParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Use this parameter to update the name of a geofence. Users can assign meaningful // custom names to their geofences. Name param.Opt[string] `json:"name,omitzero"` // Use this object to update details of a circular geofence. Please note that this // object is mandatory only when type is circle. When the type is not circle, the // properties of this object will be ignored while creating the geofence. Circle GeofenceUpdateParamsCircle `json:"circle,omitzero"` // Use this object to update details of an isochrone based geofence. Please note // that this object is mandatory only when type is isochrone. When the type is not // isochrone, the properties of this object will be ignored while creating the // geofence. Isochrone GeofenceUpdateParamsIsochrone `json:"isochrone,omitzero"` // Updated the meta_data associated with a geofence. Use this field to define // custom attributes that provide more context and information about the geofence // being updated like country, group ID etc. // // The data being added should be in valid JSON object format (i.e. key and value // pairs). Max size allowed for the object is 65kb. MetaData any `json:"meta_data,omitzero"` // Use this object to update details of a custom polygon geofence. Please note that // this object is mandatory only when type is polygon. When the type is not // polygon, the properties of this object will be ignored while creating the // geofence. // // Self-intersecting polygons or polygons containing other polygons are invalid and // will be removed while processing the request. // // Area of the polygon should be less than 2000 km<sup>2</sup>. Polygon GeofenceUpdateParamsPolygon `json:"polygon,omitzero"` // Use this parameter to add/modify one or multiple tags of a geofence. tags can be // used to search or filter geofences (using Get Geofence List method). // // Valid values for updating tags consist of alphanumeric characters (A-Z, a-z, // 0-9) along with the underscore ('\_') and hyphen ('-') symbols. Tags []string `json:"tags,omitzero"` // Use this parameter to update the type of a geofence. Please note that you will // need to provide required details for creating a geofence of the new type. Check // other parameters of this method to know more. // // Any of "circle", "polygon", "isochrone". Type GeofenceUpdateParamsType `json:"type,omitzero"` // contains filtered or unexported fields }
func (GeofenceUpdateParams) MarshalJSON ¶
func (r GeofenceUpdateParams) MarshalJSON() (data []byte, err error)
func (GeofenceUpdateParams) URLQuery ¶
func (r GeofenceUpdateParams) URLQuery() (v url.Values, err error)
URLQuery serializes GeofenceUpdateParams's query parameters as `url.Values`.
func (*GeofenceUpdateParams) UnmarshalJSON ¶
func (r *GeofenceUpdateParams) UnmarshalJSON(data []byte) error
type GeofenceUpdateParamsCircle ¶
type GeofenceUpdateParamsCircle struct { // Use this parameter to update the coordinate of the location which will act as // the center of a circular geofence. Center GeofenceUpdateParamsCircleCenter `json:"center,omitzero,required"` // Use this parameter to update the radius of the circular geofence, in meters. // Maximum value allowed is 50000 meters. Radius param.Opt[float64] `json:"radius,omitzero"` // contains filtered or unexported fields }
Use this object to update details of a circular geofence. Please note that this object is mandatory only when type is circle. When the type is not circle, the properties of this object will be ignored while creating the geofence.
The property Center is required.
func (GeofenceUpdateParamsCircle) MarshalJSON ¶
func (r GeofenceUpdateParamsCircle) MarshalJSON() (data []byte, err error)
func (*GeofenceUpdateParamsCircle) UnmarshalJSON ¶
func (r *GeofenceUpdateParamsCircle) UnmarshalJSON(data []byte) error
type GeofenceUpdateParamsCircleCenter ¶
type GeofenceUpdateParamsCircleCenter struct { // Latitude of the center location. Lat param.Opt[float64] `json:"lat,omitzero"` // Longitude of the center location. Lon param.Opt[float64] `json:"lon,omitzero"` // contains filtered or unexported fields }
Use this parameter to update the coordinate of the location which will act as the center of a circular geofence.
func (GeofenceUpdateParamsCircleCenter) MarshalJSON ¶
func (r GeofenceUpdateParamsCircleCenter) MarshalJSON() (data []byte, err error)
func (*GeofenceUpdateParamsCircleCenter) UnmarshalJSON ¶
func (r *GeofenceUpdateParamsCircleCenter) UnmarshalJSON(data []byte) error
type GeofenceUpdateParamsIsochrone ¶
type GeofenceUpdateParamsIsochrone struct { // Use this parameter to update the distance, in meters, for which an isochrone // polygon needs to be determined. When provided, the API would create a geofence // representing the area that can be reached after driving the given number of // meters starting from the point specified in coordinates. // // The maximum distance that can be specified is 60000 meters (60km). // // At least one of contours_meter or contours_minute is mandatory when type is // isochrone. ContoursMeter param.Opt[int64] `json:"contours_meter,omitzero"` // Use this parameter to update the duration, in minutes, for which an isochrone // polygon needs to be determined. When provided, the API would create a geofence // representing the area that can be reached after driving for the given number of // minutes starting from the point specified in coordinates. // // The maximum duration that can be specified is 40 minutes. // // At least one of contours_meter or contours_minute is mandatory when type is // isochrone. ContoursMinute param.Opt[int64] `json:"contours_minute,omitzero"` // Use this parameter to update the coordinates of the location, in // [latitude,longitude] format, which would act as the starting point for // identifying the isochrone polygon or the boundary of reachable area. Coordinates param.Opt[string] `json:"coordinates,omitzero"` // A floating point value from 0.0 to 1.0 that can be used to remove smaller // contours. A value of 1.0 will only return the largest contour for a given value. // A value of 0.5 drops any contours that are less than half the area of the // largest contour in the set of contours for that same value. // // Use this parameter to update the denoise value of the isochrone geofence. Denoise param.Opt[float64] `json:"denoise,omitzero"` // Use this parameter to update the departure_time, expressed as UNIX epoch // timestamp in seconds. The isochrone boundary will be determined based on the // typical traffic conditions at the given time. // // If no input is provided for this parameter then, the traffic conditions at the // time of making the request are considered by default. Please note that because // of this behavior the geofence boundaries may change even if the departure_time // was not specifically provided at the time of updating the geofence. DepartureTime param.Opt[int64] `json:"departure_time,omitzero"` // Use this parameter to update the driving mode that the service should use to // determine the isochrone line. For example, if you use car, the API will return // an isochrone polygon that a car can cover within the specified time or after // driving the specified distance. Using truck will return an isochrone that a // truck can reach after taking into account appropriate truck routing // restrictions. Mode param.Opt[string] `json:"mode,omitzero"` // contains filtered or unexported fields }
Use this object to update details of an isochrone based geofence. Please note that this object is mandatory only when type is isochrone. When the type is not isochrone, the properties of this object will be ignored while creating the geofence.
func (GeofenceUpdateParamsIsochrone) MarshalJSON ¶
func (r GeofenceUpdateParamsIsochrone) MarshalJSON() (data []byte, err error)
func (*GeofenceUpdateParamsIsochrone) UnmarshalJSON ¶
func (r *GeofenceUpdateParamsIsochrone) UnmarshalJSON(data []byte) error
type GeofenceUpdateParamsPolygon ¶
type GeofenceUpdateParamsPolygon struct { // An object to collect geoJSON details of the polygon geofence. The contents of // this object follow the // [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946). Geojson GeofenceUpdateParamsPolygonGeojson `json:"geojson,omitzero"` // contains filtered or unexported fields }
Use this object to update details of a custom polygon geofence. Please note that this object is mandatory only when type is polygon. When the type is not polygon, the properties of this object will be ignored while creating the geofence.
Self-intersecting polygons or polygons containing other polygons are invalid and will be removed while processing the request.
Area of the polygon should be less than 2000 km<sup>2</sup>.
func (GeofenceUpdateParamsPolygon) MarshalJSON ¶
func (r GeofenceUpdateParamsPolygon) MarshalJSON() (data []byte, err error)
func (*GeofenceUpdateParamsPolygon) UnmarshalJSON ¶
func (r *GeofenceUpdateParamsPolygon) UnmarshalJSON(data []byte) error
type GeofenceUpdateParamsPolygonGeojson ¶
type GeofenceUpdateParamsPolygonGeojson struct { // Type of the geoJSON geometry. Should always be Polygon. Type param.Opt[string] `json:"type,omitzero"` // An array of coordinates in the [longitude, latitude] format, representing the // geofence boundary. Geometry [][]float64 `json:"geometry,omitzero"` // contains filtered or unexported fields }
An object to collect geoJSON details of the polygon geofence. The contents of this object follow the [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946).
func (GeofenceUpdateParamsPolygonGeojson) MarshalJSON ¶
func (r GeofenceUpdateParamsPolygonGeojson) MarshalJSON() (data []byte, err error)
func (*GeofenceUpdateParamsPolygonGeojson) UnmarshalJSON ¶
func (r *GeofenceUpdateParamsPolygonGeojson) UnmarshalJSON(data []byte) error
type GeofenceUpdateParamsType ¶
type GeofenceUpdateParamsType string
Use this parameter to update the type of a geofence. Please note that you will need to provide required details for creating a geofence of the new type. Check other parameters of this method to know more.
const ( GeofenceUpdateParamsTypeCircle GeofenceUpdateParamsType = "circle" GeofenceUpdateParamsTypePolygon GeofenceUpdateParamsType = "polygon" GeofenceUpdateParamsTypeIsochrone GeofenceUpdateParamsType = "isochrone" )
type IsochroneComputeParams ¶
type IsochroneComputeParams struct { // The distances, in meters, to use for each isochrone contour. You can specify up // to four contours. Distances must be in increasing order. The maximum distance // that can be specified is 60000 meters (60 km). ContoursMeters int64 `query:"contours_meters,required" json:"-"` // The times, in minutes, to use for each isochrone contour. You can specify up to // four contours. Times must be in increasing order. The maximum time that can be // specified is 40 minutes. ContoursMinutes int64 `query:"contours_minutes,required" json:"-"` // The coordinates of the location which acts as the starting point for which the // isochrone lines need to be determined. Coordinates string `query:"coordinates,required" format:"latitude,longitude" json:"-"` // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // The hex code of the color to fill isochrone contour. When requesting multiple // contours, it is recommended to provide color codes for each of the requested // contours, separated by a ",". If no colors are specified, the Isochrone API will // assign a random color scheme to the output. ContoursColors param.Opt[string] `query:"contours_colors,omitzero" format:"value_1,value_2,..." json:"-"` // A floating point value from 0.0 to 1.0 can be used to remove smaller contours. // The default is 1.0. A value of 1.0 will only return the largest contour for a // given value. A value of 0.5 drops any contours that are less than half the area // of the largest contour in the set of contours for that same value. Denoise param.Opt[float64] `query:"denoise,omitzero" json:"-"` // Use this parameter to set a departure time, expressed as UNIX epoch timestamp in // seconds, for calculating the isochrone contour. The response will consider the // typical traffic conditions at the given time and return a contour which can be // reached under those traffic conditions. Please note that if no input is provided // for this parameter then the traffic conditions at the time of making the request // are considered. DepartureTime param.Opt[int64] `query:"departure_time,omitzero" json:"-"` // A positive floating point value, in meters, used as the tolerance for // Douglas-Peucker generalization. There is no upper bound. If no value is // specified in the request, the Isochrone API will choose the most optimized // generalization to use for the request. Note that the generalization of contours // can lead to self-intersections, as well as intersections of adjacent contours. Generalize param.Opt[float64] `query:"generalize,omitzero" json:"-"` // Specify whether to return the contours as GeoJSON polygons (true) or linestrings // (false, default). When polygons=true, any contour that forms a ring is returned // as a polygon. Polygons param.Opt[bool] `query:"polygons,omitzero" json:"-"` // Set which driving mode the service should use to determine the contour. For // example, if you use "car", the API will return an isochrone contour that a car // can reach within the specified time or after driving the specified distance. // Using "truck" will return a contour that a truck can reach after taking into // account appropriate truck routing restrictions. // // Note: Only the "car" profile is enabled by default. Please note that customized // profiles (including "truck") might not be available for all regions. Please // contact your [NextBillion.ai](http://NextBillion.ai) account manager, sales // representative or reach out at // [support@nextbillion.ai](mailto:support@nextbillion.ai) in case you need // additional profiles. // // Any of "car", "truck". Mode IsochroneComputeParamsMode `query:"mode,omitzero" json:"-"` // contains filtered or unexported fields }
func (IsochroneComputeParams) URLQuery ¶
func (r IsochroneComputeParams) URLQuery() (v url.Values, err error)
URLQuery serializes IsochroneComputeParams's query parameters as `url.Values`.
type IsochroneComputeParamsMode ¶
type IsochroneComputeParamsMode string
Set which driving mode the service should use to determine the contour. For example, if you use "car", the API will return an isochrone contour that a car can reach within the specified time or after driving the specified distance. Using "truck" will return a contour that a truck can reach after taking into account appropriate truck routing restrictions.
Note: Only the "car" profile is enabled by default. Please note that customized profiles (including "truck") might not be available for all regions. Please contact your [NextBillion.ai](http://NextBillion.ai) account manager, sales representative or reach out at [support@nextbillion.ai](mailto:support@nextbillion.ai) in case you need additional profiles.
const ( IsochroneComputeParamsModeCar IsochroneComputeParamsMode = "car" IsochroneComputeParamsModeTruck IsochroneComputeParamsMode = "truck" )
type IsochroneComputeResponse ¶
type IsochroneComputeResponse struct { // A // [GeoJSON FeatureCollection](https://datatracker.ietf.org/doc/html/rfc7946#section-3.3) // object with details of the isochrone contours. Each feature object in this // collection represents an isochrone. Features []IsochroneComputeResponseFeature `json:"features"` // Displays the error message in case of a failed request or operation. Please note // that this parameter is not returned in the response in case of a successful // request. Msg string `json:"msg"` // A string indicating the state of the response. On normal responses, the value // will be Ok. Indicative HTTP error codes are returned for different errors. See // the [API Errors Codes](#api-error-codes) section below for more information. Status string `json:"status"` // Type of the GeoJSON object. As prescribed in // [GeoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946#section-1.4), // its value is FeatureCollection as the feature property contains a list of // geoJSON feature objects. Type string `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Features respjson.Field Msg respjson.Field Status respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (IsochroneComputeResponse) RawJSON ¶
func (r IsochroneComputeResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*IsochroneComputeResponse) UnmarshalJSON ¶
func (r *IsochroneComputeResponse) UnmarshalJSON(data []byte) error
type IsochroneComputeResponseFeature ¶
type IsochroneComputeResponseFeature struct { // A [GeoJSON geometry](https://datatracker.ietf.org/doc/html/rfc7946#page-7) // object with details of the contour line. Geometry IsochroneComputeResponseFeatureGeometry `json:"geometry"` // An object with details of how the isochrone contour can be drawn on a map. Properties IsochroneComputeResponseFeatureProperties `json:"properties"` // Type of the GeoJSON object. Its value is Feature as per the // [GeoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946#section-1.4) // object. Type string `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Geometry respjson.Field Properties respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (IsochroneComputeResponseFeature) RawJSON ¶
func (r IsochroneComputeResponseFeature) RawJSON() string
Returns the unmodified JSON received from the API
func (*IsochroneComputeResponseFeature) UnmarshalJSON ¶
func (r *IsochroneComputeResponseFeature) UnmarshalJSON(data []byte) error
type IsochroneComputeResponseFeatureGeometry ¶
type IsochroneComputeResponseFeatureGeometry struct { // An array of coordinate points, in [longitude,latitude] format representing the // isochrone contour line. Coordinates []float64 `json:"coordinates"` // Type of the geoJSON geometry. Type string `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Coordinates respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
A [GeoJSON geometry](https://datatracker.ietf.org/doc/html/rfc7946#page-7) object with details of the contour line.
func (IsochroneComputeResponseFeatureGeometry) RawJSON ¶
func (r IsochroneComputeResponseFeatureGeometry) RawJSON() string
Returns the unmodified JSON received from the API
func (*IsochroneComputeResponseFeatureGeometry) UnmarshalJSON ¶
func (r *IsochroneComputeResponseFeatureGeometry) UnmarshalJSON(data []byte) error
type IsochroneComputeResponseFeatureProperties ¶
type IsochroneComputeResponseFeatureProperties struct { // The hex code of the color of the isochrone contour line Color string `json:"color"` // The value of the metric used in this contour. See the metric property to // determine whether this is a time or distance contour. When the metric is time // this value denotes the travel time in minutes and when the metric is distance // this value denotes the travel distance in kilometers. Contour float64 `json:"contour"` // The hex code for the fill color of the isochrone contour line. Fill string `json:"fill"` // The hex code for the fill color of the isochrone contour line FillColor string `json:"fillColor"` // The fill opacity for the isochrone contour line. It is a float value starting // from 0.0 with a max value of 1.0. Higher number indicates a higher fill opacity. FillOpacity float64 `json:"fillOpacity"` // The metric that the contour represents - either distance or time Metric string `json:"metric"` // The opacity of the isochrone contour line. It is a float value starting from 0.0 // with a max value of 1.0. Higher number indicates a higher line opacity Opacity float64 `json:"opacity"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Color respjson.Field Contour respjson.Field Fill respjson.Field FillColor respjson.Field FillOpacity respjson.Field Metric respjson.Field Opacity respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with details of how the isochrone contour can be drawn on a map.
func (IsochroneComputeResponseFeatureProperties) RawJSON ¶
func (r IsochroneComputeResponseFeatureProperties) RawJSON() string
Returns the unmodified JSON received from the API
func (*IsochroneComputeResponseFeatureProperties) UnmarshalJSON ¶
func (r *IsochroneComputeResponseFeatureProperties) UnmarshalJSON(data []byte) error
type IsochroneService ¶
type IsochroneService struct {
Options []option.RequestOption
}
IsochroneService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewIsochroneService method instead.
func NewIsochroneService ¶
func NewIsochroneService(opts ...option.RequestOption) (r IsochroneService)
NewIsochroneService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*IsochroneService) Compute ¶
func (r *IsochroneService) Compute(ctx context.Context, query IsochroneComputeParams, opts ...option.RequestOption) (res *IsochroneComputeResponse, err error)
The NextBillion.ai Isochrone API computes areas that are reachable within a specified amount of time from a location, and returns the reachable regions as contours of polygons or lines that you can display on a map.
type JobParam ¶
type JobParam struct { // Provide an unique ID for the job. The IDs are case-sensitive. ID string `json:"id,required"` // An integer denoting the index (in the location array) of the location // coordinates where the job needs to be performed. The valid range of values is // \[0, length of location array). // // Please note the location_index is mandatory when using the jobs object. LocationIndex int64 `json:"location_index,required"` // Add a custom description for the job. Description param.Opt[string] `json:"description,omitzero"` // Specify whether the job route should follow LIFO (last in, first out). Use this // parameter when pickup or delivery jobs are involved and the loading or unloading // sequence of cargo is important. The default is false. FollowLifoOrder param.Opt[bool] `json:"follow_lifo_order,omitzero"` // Specify a joint order group ID that this job is associated with. Tasks having // the same joint order group ID are treated as a single unit: either all tasks in // the group are assigned, or none are. Users can add tasks of both jobs and // shipments types to a single joint order group by using the same unique ID. // Please note that: // // - Each job in a single joint order group will be fulfilled by a unique vehicle. // - Jobs belonging to a joint order group can be served in any sequence. // - Joint order settings will not be effective if \solution\ or \relations\ // attributes are also provided in the input request. JointOrder param.Opt[int64] `json:"joint_order,omitzero"` // It determines the allowable delay, in seconds, to begin a job after its // designated time window has concluded. Please note that this parameter would // override the constraint.max_visit_lateness (global) if both are specified. MaxVisitLateness param.Opt[int64] `json:"max_visit_lateness,omitzero"` // Specify the cost of keeping this job unassigned, namely, the cost of outsourcing // the job. When provided, the optimizer weighs the cost of assigning the job // against the cost of keeping it unassigned and chooses a solution with lower // cost. In the solution, the outsourcing_cost of unassigned jobs is added to the // total cost of the solution. // // If the outsourcing_cost is not provided, which is to say that the job can not be // outsourced, then the optimizer tries to fulfill the job irrespective of the cost // incurred, subject to other constraints. // // Please note that revenue and outsourcing_cost can not be specified // simultaneously for a job. Also, the outsourcing_cost would override the priority // settings of the job. OutsourcingCost param.Opt[int64] `json:"outsourcing_cost,omitzero"` // Specify the priority of this job. The valid values are in the range of \[0, // 100\]. Default value is 0. // // Please note that setting a priority will only decide whether this job will be // assigned or not, but has nothing to do with the sequence of job fulfilment. Priority param.Opt[int64] `json:"priority,omitzero"` // Specify the revenue earned by completing this job. The optimizer uses the // revenue input to identify the potential profit earned by fulfilling this job // after taking into account the costs incurred to do so. Theoptions.objective and // vehicles.costs input are taken into account to identify the costs of fulfilling // the job. // // In general, the optimizer will prefer fulfilling the tasks with higher profits // over the tasks with lower profits, should it need to reject some tasks in order // to honor other constraints. In case the profit from fulfilling a job is // negative, it will remain unassigned whatsoever. Revenue param.Opt[int64] `json:"revenue,omitzero"` // Use this parameter to prioritize completing a task relative to certain other // tasks. A task configured with a sequence_order of 2 will be done after the task // with sequence_order of 1, but before the task with sequence_order of 3. Valid // range of values for this input is \[0,100\]. // // Please note that: // // - Only the tasks within the same route are compared and ordered as per their // sequence_order. // // - Tasks without a sequence_order are not involved in the comparison. // // - Following is the precedence of sequence_order when used along side some of the // other constraints: // // - relations are prioritized over sequence_order comparisons. // // - sequence_order will override order_grouping configurations. SequenceOrder param.Opt[int64] `json:"sequence_order,omitzero"` // Use this attribute to define the time duration, in seconds, needed to complete // the job. Default value is 0. Service param.Opt[int64] `json:"service,omitzero"` // Specify the job set-up duration, in seconds. setup is the one-time effort needed // apart from working on the original task - for example, effort to record some // information for compliance, or effort to set-up the equipment, or perform any // other action for completing all steps required to fulfil the job. // // Please note that setup time is applied only once for a given task location. // setup time, unlike service time, is not repeated in case there are multiple // tasks at the same location. Setup param.Opt[int64] `json:"setup,omitzero"` // In case the job involves a delivery step, use this attribute to describe // delivery quantity. This attribute supports multidimensional quantities, to // support delivering quantities of different units/dimensions. It is recommended // to keep the dimensions of quantity for pickup/delivery consistent when defining // them in jobs and vehicles (in capacity attribute). // // Please note that the quantity of delivery will be added to the assigned // vehicle’s initial load. // // In case depots are being added, the delivery configured here can be fulfilled by // vehicles starting from specific depots. Refer to depot_ids and // vehicles.start_depot_ids to know more. Delivery []int64 `json:"delivery,omitzero"` // Specify the depots which can be used to fulfil this job. In case of a pickup // job, the assigned vehicle will deliver the goods to the depot specified here, at // the end of its trip. Conversely, in case of delivery jobs, the vehicle will load // the goods from the depot specified here, before starting the trip. // // **Note:** // // - If multiple IDs are provided for this field then any of the given depots can // be used to fulfil the job. // - If this field is not provided then the given job can be fulfilled by any // vehicle (subject to other constraints configured in the input). // - If the job does not have any delivery or pick-up step configured then depots // configuration will not have any impact on the given job. DepotIDs []string `json:"depot_ids,omitzero"` // Use this parameter to specify the type of loads which are incompatible with the // job’s load type. Once this property is configured, the job can only be serviced // by a vehicle which has not serviced any other task with an incompatible // load_types . Add multiple load types to indicate all the types which are // incompatible for this job. The incompatible load type considerations are ignored // for the first task of the route. // // For example, an input value of \[“groceries”, “food”\] means that current job’s // load is incompatible with both groceries and food type of loads. Consequently, // the optimizer will not assign this job to a vehicle which has served any task // with load_types as either groceries or food. // // Note: // // - This parameter is effective only when a pickup / delivery is configured for // the job. // - If the job is part of any relations then, configured incompatible_load_types // might be ignored. IncompatibleLoadTypes []string `json:"incompatible_load_types,omitzero"` // Use this parameter to specify the type of loads for the given job. Once this // property is configured, the job can not be served by a vehicle which has // serviced any task whose load is incompatible with any of theload_types provided // in this input. The load type considerations are ignored for the first task of // the route. // // For example, an input value of \[“groceries”, “food”\] means that job’s load // characteristics belong to either one or both types. Consequently, the optimizer // will assign this job to a vehicle which has served other tasks whose // incompatible_load_types do not contain either groceries or food. // // Note: // // - This parameter is effective only when a pickup / delivery is configured for // the job. // - If the job is part of any relations then, load_types might be ignored. LoadTypes []string `json:"load_types,omitzero"` // Specify any custom data that should be attached along with job fulfilment // details in the steps attribute of the optimized solution. Users can leverage // this property to provide additional details/context when sharing information // about the job with integrated systems (TMS, Fleet Management, Driver dispatch // etc). // // Please note that the metadata content must always be specified in akey : value // pair format, where the “key” is always a string. Metadata any `json:"metadata,omitzero"` // In case the job involves a pickup step, use this attribute to describe pickup // quantity. This attribute supports multidimensional quantities, to support // picking up quantities of different units/dimensions. It is recommended to keep // the dimensions of quantity for pickup/delivery consistent when defining them in // jobs and vehicles (in capacity attribute). // // Please note that the vehicle will continue to carry the picked-up quantity until // its last stop. // // In case depots are being added, the pickup configured here can be fulfilled by // vehicles ending at specific depots. Refer to depot_ids and // vehicles.end_depot_ids to know more. Pickup []int64 `json:"pickup,omitzero"` // Define the skills needed to complete the job. This attribute supports // multidimensional skills allowing users to add multiple skills. // // Read more about the behavior of this attribute in the // [Multi-Dimensional Parameters](#multi-dimensional-parameters) section. Skills []int64 `json:"skills,omitzero"` // Define time periods within which this job should be started. The time periods // should be expressed as a UNIX timestamp in seconds. // // Please note that the time periods should not overlap with each other and should // always follow the format of \[start_timestamp, end_timestamp\]. TimeWindows [][]int64 `json:"time_windows,omitzero"` // Specify the dimensions and alignment configurations for the cargo associated // with the task. These inputs will be used to arrange the items into the loading // compartment of the vehicle to utilize the three-dimensional space. If a job // consists of several different items, each with its own dimensions, please // specify the final characteristics for the task: total height, total length, // total width. // // Please note that vehicles which contain the volume input, will only be // considered for arranging such items. Volume JobVolumeParam `json:"volume,omitzero"` // An array of integers specifying the IDs of the zone(s) that this job belongs to. // The job can be fulfilled by all vehicles which are allowed to complete tasks in // the zone(s) assigned to this job. Please note following points about job zones: // // - If zone IDs are provided for any one of the jobs, then all other jobs should // also be specified with zone IDs. Zone IDs provided here will override any zone // geometries provided in the zones attribute and these IDs will be used for // allocating appropriate vehicles. // - Jobs can be auto-allocated to zones if this parameter is not specified while // the zone geometries (either zones.geometry or zones.geofence_id) are provided. // - Jobs not falling in any zones can be fulfilled by only those vehicles which // are allowed to take up tasks outside zones as well. Refer to vehicles // attribute for more information. Zones []int64 `json:"zones,omitzero"` // contains filtered or unexported fields }
The properties ID, LocationIndex are required.
func (JobParam) MarshalJSON ¶
func (*JobParam) UnmarshalJSON ¶
type JobVolumeParam ¶
type JobVolumeParam struct { // Cargo length, in meters. Depth param.Opt[float64] `json:"depth,omitzero"` // Cargo height, in meters. Height param.Opt[float64] `json:"height,omitzero"` // Cargo width, in meters. Width param.Opt[float64] `json:"width,omitzero"` // Refers to the orientation of the cargo in the loading compartment. It supports // the following values: // // - **" "** : A blank space to indicate that the dimension check for the cargo // should be skipped. This is also the default value. // - **strict :** In this orientation, the cargo must fit within the vehicle’s // dimensions exactly as is—no rotation is allowed. All dimensions of the cargo // must be less than or equal to the corresponding dimensions of the vehicle. If // any dimension exceeds that of the vehicle, the cargo cannot be loaded. // - **parallel :** With parallel orientation, the cargo can be rotated around any // one of the axes to help it fit into the loading compartment. For example, if // the cargo is wider than the vehicle, it can still be loaded by rotating it // around the vertical axis (so the width aligns with the vehicle’s depth) or the // horizontal axis (so the width aligns with the vehicle’s height). Using this // orientation, even a cargo whose one dimension is larger than the corresponding // dimension of the vehicle but smaller than other dimensions, can also be // loaded. // - **fixed_bottom :** In this orientation, the cargo can only be rotated around // the vertical axis, meaning its base stays fixed and it cannot be tilted or // turned over. The height of the cargo remains aligned with the vehicle’s height // and cannot be adjusted. As a result, if the cargo’s height exceeds the // vehicle’s available height, it cannot be loaded into the compartment. // // Any of "strict", "parallel", "fixed_bottom". Alignment string `json:"alignment,omitzero"` // contains filtered or unexported fields }
Specify the dimensions and alignment configurations for the cargo associated with the task. These inputs will be used to arrange the items into the loading compartment of the vehicle to utilize the three-dimensional space. If a job consists of several different items, each with its own dimensions, please specify the final characteristics for the task: total height, total length, total width.
Please note that vehicles which contain the volume input, will only be considered for arranging such items.
func (JobVolumeParam) MarshalJSON ¶
func (r JobVolumeParam) MarshalJSON() (data []byte, err error)
func (*JobVolumeParam) UnmarshalJSON ¶
func (r *JobVolumeParam) UnmarshalJSON(data []byte) error
type Location ¶
type Location struct { // Latitude of location. Lat float64 `json:"lat,required"` // Longitude of location. Lon float64 `json:"lon,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Lat respjson.Field Lon respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Location info.
func (Location) ToParam ¶
func (r Location) ToParam() LocationParam
ToParam converts this Location to a LocationParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with LocationParam.Overrides()
func (*Location) UnmarshalJSON ¶
type LocationParam ¶
type LocationParam struct { // Latitude of location. Lat float64 `json:"lat,required"` // Longitude of location. Lon float64 `json:"lon,required"` // contains filtered or unexported fields }
Location info.
The properties Lat, Lon are required.
func (LocationParam) MarshalJSON ¶
func (r LocationParam) MarshalJSON() (data []byte, err error)
func (*LocationParam) UnmarshalJSON ¶
func (r *LocationParam) UnmarshalJSON(data []byte) error
type LookupByIDParams ¶
type LookupByIDParams struct { // Specify the unique identifier of a specific POI, Street, Geography, Point // Address or other entities to retrieve its details. ID string `query:"id,required" json:"-"` // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // contains filtered or unexported fields }
func (LookupByIDParams) URLQuery ¶
func (r LookupByIDParams) URLQuery() (v url.Values, err error)
URLQuery serializes LookupByIDParams's query parameters as `url.Values`.
type LookupByIDResponse ¶
type LookupByIDResponse struct { // The results are presented as a JSON list of candidates in ranked order // (most-likely to least-likely) based on the matched location criteria. Items []LookupByIDResponseItem `json:"items"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Items respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (LookupByIDResponse) RawJSON ¶
func (r LookupByIDResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*LookupByIDResponse) UnmarshalJSON ¶
func (r *LookupByIDResponse) UnmarshalJSON(data []byte) error
type LookupByIDResponseItem ¶
type LookupByIDResponseItem struct { // The unique identifier for the result item. ID string `json:"id"` // An array returning the location coordinates of all the access points of the // search result. Access Access `json:"access"` // Postal address of the result item. Address Address `json:"address"` // The list of categories assigned to this place. Categories []Categories `json:"categories"` // Contact information like phone, email or website. Contacts []Contacts `json:"contacts"` // The bounding box enclosing the geometric shape (area or line) that an individual // result covers. place typed results have no mapView. MapView MapView `json:"mapView"` // Returns the location coordinates of the result. Position Position `json:"position"` // The localized display name of this result item. Title string `json:"title"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Access respjson.Field Address respjson.Field Categories respjson.Field Contacts respjson.Field MapView respjson.Field Position respjson.Field Title respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (LookupByIDResponseItem) RawJSON ¶
func (r LookupByIDResponseItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*LookupByIDResponseItem) UnmarshalJSON ¶
func (r *LookupByIDResponseItem) UnmarshalJSON(data []byte) error
type LookupService ¶
type LookupService struct {
Options []option.RequestOption
}
LookupService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewLookupService method instead.
func NewLookupService ¶
func NewLookupService(opts ...option.RequestOption) (r LookupService)
NewLookupService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*LookupService) ByID ¶
func (r *LookupService) ByID(ctx context.Context, query LookupByIDParams, opts ...option.RequestOption) (res *LookupByIDResponse, err error)
Lookup By ID
type MapService ¶
type MapService struct {
Options []option.RequestOption
}
MapService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMapService method instead.
func NewMapService ¶
func NewMapService(opts ...option.RequestOption) (r MapService)
NewMapService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*MapService) NewSegment ¶
func (r *MapService) NewSegment(ctx context.Context, opts ...option.RequestOption) (err error)
Road Segments
type MapView ¶
type MapView struct { // Longitude of the eastern-side of the box. East string `json:"east"` // Longitude of the northern-side of the box. North string `json:"north"` // Longitude of the southern-side of the box. South string `json:"south"` // Longitude of the western-side of the box. West string `json:"west"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { East respjson.Field North respjson.Field South respjson.Field West respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The bounding box enclosing the geometric shape (area or line) that an individual result covers. place typed results have no mapView.
func (*MapView) UnmarshalJSON ¶
type MdmGetDistanceMatrixStatusParams ¶
type MdmGetDistanceMatrixStatusParams struct { // Provide the unique ID that was returned on successful submission of the // Asynchronous Distance Matrix POST request. ID string `query:"id,required" json:"-"` // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // contains filtered or unexported fields }
func (MdmGetDistanceMatrixStatusParams) URLQuery ¶
func (r MdmGetDistanceMatrixStatusParams) URLQuery() (v url.Values, err error)
URLQuery serializes MdmGetDistanceMatrixStatusParams's query parameters as `url.Values`.
type MdmGetDistanceMatrixStatusResponse ¶
type MdmGetDistanceMatrixStatusResponse struct { // A code representing the status of the request. // // Any of "Ok", "Processing", "Failed". Code MdmGetDistanceMatrixStatusResponseCode `json:"code"` // Returns the GCS result of a successful task. Please note that this is an // internal field. // // _internal field, the gcs result of specific task if task is success._ OutputAddr string `json:"output_addr"` // Returns the link for the result file (csv format) once the task is completed // successfully. ResultLink string `json:"result_link"` // Returns the status detail of the result. Indicative error messages/codes are // returned in case of errors. See the [API Error Codes](#api-error-codes) section // below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Code respjson.Field OutputAddr respjson.Field ResultLink respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (MdmGetDistanceMatrixStatusResponse) RawJSON ¶
func (r MdmGetDistanceMatrixStatusResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*MdmGetDistanceMatrixStatusResponse) UnmarshalJSON ¶
func (r *MdmGetDistanceMatrixStatusResponse) UnmarshalJSON(data []byte) error
type MdmGetDistanceMatrixStatusResponseCode ¶
type MdmGetDistanceMatrixStatusResponseCode string
A code representing the status of the request.
const ( MdmGetDistanceMatrixStatusResponseCodeOk MdmGetDistanceMatrixStatusResponseCode = "Ok" MdmGetDistanceMatrixStatusResponseCodeProcessing MdmGetDistanceMatrixStatusResponseCode = "Processing" MdmGetDistanceMatrixStatusResponseCodeFailed MdmGetDistanceMatrixStatusResponseCode = "Failed" )
type MdmNewDistanceMatrixParams ¶
type MdmNewDistanceMatrixParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Use this option to switch to truck-specific routing or time based routing or if // you want to choose between the fastest and shortest route types. // // Any of "flexible". Option MdmNewDistanceMatrixParamsOption `query:"option,omitzero,required" json:"-"` // origins are the starting point of your route. Ensure that origins are routable // land locations. Multiple origins should be separated by a pipe symbol (|). // // **Format:** latitude_1,longitude_1|latitude_2,longitude_2|… Origins string `json:"origins,required"` // Specify if crossing an international border is expected for operations near // border areas. When set to false, the API will prohibit routes going back & forth // between countries. Consequently, routes within the same country will be // preferred if they are feasible for the given set of destination or waypoints . // When set to true, the routes will be allowed to go back & forth between // countries as needed. // // This feature is available in North America region only. Please get in touch with // [support@nextbillion.ai](mailto:support@nextbillion.ai) to enquire/enable other // areas. CrossBorder param.Opt[bool] `json:"cross_border,omitzero"` // This is a number in UNIX epoch timestamp in seconds format that can be used to // provide the departure time. The response will return the distance and duration // of the route based on typical traffic for at the given start time.If no input is // provided for this parameter then the traffic conditions at the time of making // the request are considered. // // Please note that when route_type is set to shortest then the departure_time will // be ineffective as the service will return the result for the shortest path // possible irrespective of the traffic conditions. DepartureTime param.Opt[int64] `json:"departure_time,omitzero"` // destinations are the ending coordinates of your route. Ensure that destinations // are routable land locations. Multiple destinations should be separated by a pipe // symbol (|). // // In case destinations are not provided or if it is left empty, then the input // value of origins will be copied to destinations to create the OD matrix pairs. // // **Format:** latitude_1,longitude_1|latitude_2,longitude_2|… Destinations param.Opt[string] `json:"destinations,omitzero"` // Specify the total load per axle (including the weight of trailers and shipped // goods) of the truck, in tonnes. When used, the service will return routes which // are legally allowed to carry the load specified per axle. // // Please note this parameter is effective only when mode=truck. TruckAxleLoad param.Opt[float64] `json:"truck_axle_load,omitzero"` // This defines the dimensions of a truck in centimeters (cm) in the format of // "height,width,length". This parameter is effective only when mode=truck and // option=flexible. Maximum dimensions are as follows: // // Height = 1000 cm Width = 5000 cm Length = 5000 cm TruckSize param.Opt[string] `json:"truck_size,omitzero"` // This parameter defines the weight of the truck including trailers and shipped // goods in kilograms (kg). This parameter is effective only when mode=truck and // option=flexible. TruckWeight param.Opt[int64] `json:"truck_weight,omitzero"` // Specify a spliter to split the matrix by. It accepts 2 values: // // - od_number_spliter: // // - straight_distance_spliter: // // Please note it is an internal, debug field only. // // _debug field. choose specific spliter to split matrix._ // // Any of "od_number_spliter", "straight_distance_spliter", "location_spliter". Spliter MdmNewDistanceMatrixParamsSpliter `query:"spliter,omitzero" json:"-"` // Provide the country that the coordinates belong to. // // _the input coordinates area._ // // Any of "singapore", "usa", "india". Area MdmNewDistanceMatrixParamsArea `json:"area,omitzero"` // Setting this will ensure the route avoids the object(s) specified as input. // Multiple values should be separated by a pipe (|). If none is provided along // with other values, an error is returned as a valid route is not feasible. // // - **Note:** // // - This parameter is effective only when route_type=fastest. // // - When this parameter is not provided in the input, ferries are set to be // avoided by default. When avoid input is provided, only the mentioned objects // are avoided. // // - When using avoid=bbox users also need to specify the boundaries of the // bounding box to be avoid. Multiple bounding boxes can be specified // simultaneously. Please note that bounding box is a hard filter and if it // blocks all possible routes between given locations, a 4xx error is returned. // // - **Format:** bbox: min_latitude,min_longtitude,max_latitude,max_longitude. // // - **Example:** avoid=bbox: 34.0635,-118.2547, 34.0679,-118.2478 | bbox: // 34.0521,-118.2342, 34.0478,-118.2437 // // - When using avoid=sharp_turn, default range of permissible turn angles is // \[120,240\]. // // Any of "toll", "ferry", "highway", "sharp_turn", "service_road", "bbox", // "left_turn", "right_turn", "none". Avoid MdmNewDistanceMatrixParamsAvoid `json:"avoid,omitzero"` // Specify the side of the road from which to approach destinations points. Please // note that the given approach will be applied to all the destinations. // // Any of "unrestricted", "curb". DestinationsApproach MdmNewDistanceMatrixParamsDestinationsApproach `json:"destinations_approach,omitzero"` // Specify the type of hazardous material being carried and the service will avoid // roads which are not suitable for the type of goods specified. Multiple values // can be separated using a pipe operator | . // // Please note that this parameter is effective only when mode=truck. // // Any of "general", "circumstantial", "explosive", "harmful_to_water". HazmatType MdmNewDistanceMatrixParamsHazmatType `json:"hazmat_type,omitzero"` // Set which driving mode the service should use to determine a route. // // For example, if you use car, the API will return a route that a car can take. // Using truck will return a route a truck can use, taking into account appropriate // truck routing restrictions. // // Any of "car", "truck". Mode MdmNewDistanceMatrixParamsMode `json:"mode,omitzero"` // Specify the side of the road from which to approach origins points. Please note // that the given approach will be applied to all the points provided as origins. // // Any of "unrestricted", "curb". OriginsApproach MdmNewDistanceMatrixParamsOriginsApproach `json:"origins_approach,omitzero"` // Set the route type that needs to be returned. Please note that route_type is // effective only when option=flexible. // // Any of "fastest", "shortest". RouteType MdmNewDistanceMatrixParamsRouteType `json:"route_type,omitzero"` // contains filtered or unexported fields }
func (MdmNewDistanceMatrixParams) MarshalJSON ¶
func (r MdmNewDistanceMatrixParams) MarshalJSON() (data []byte, err error)
func (MdmNewDistanceMatrixParams) URLQuery ¶
func (r MdmNewDistanceMatrixParams) URLQuery() (v url.Values, err error)
URLQuery serializes MdmNewDistanceMatrixParams's query parameters as `url.Values`.
func (*MdmNewDistanceMatrixParams) UnmarshalJSON ¶
func (r *MdmNewDistanceMatrixParams) UnmarshalJSON(data []byte) error
type MdmNewDistanceMatrixParamsArea ¶
type MdmNewDistanceMatrixParamsArea string
Provide the country that the coordinates belong to.
_the input coordinates area._
const ( MdmNewDistanceMatrixParamsAreaSingapore MdmNewDistanceMatrixParamsArea = "singapore" MdmNewDistanceMatrixParamsAreaUsa MdmNewDistanceMatrixParamsArea = "usa" MdmNewDistanceMatrixParamsAreaIndia MdmNewDistanceMatrixParamsArea = "india" )
type MdmNewDistanceMatrixParamsAvoid ¶
type MdmNewDistanceMatrixParamsAvoid string
Setting this will ensure the route avoids the object(s) specified as input. Multiple values should be separated by a pipe (|). If none is provided along with other values, an error is returned as a valid route is not feasible.
- **Note:**
This parameter is effective only when route_type=fastest.
When this parameter is not provided in the input, ferries are set to be avoided by default. When avoid input is provided, only the mentioned objects are avoided.
When using avoid=bbox users also need to specify the boundaries of the bounding box to be avoid. Multiple bounding boxes can be specified simultaneously. Please note that bounding box is a hard filter and if it blocks all possible routes between given locations, a 4xx error is returned.
**Format:** bbox: min_latitude,min_longtitude,max_latitude,max_longitude.
**Example:** avoid=bbox: 34.0635,-118.2547, 34.0679,-118.2478 | bbox: 34.0521,-118.2342, 34.0478,-118.2437
When using avoid=sharp_turn, default range of permissible turn angles is \[120,240\].
const ( MdmNewDistanceMatrixParamsAvoidToll MdmNewDistanceMatrixParamsAvoid = "toll" MdmNewDistanceMatrixParamsAvoidFerry MdmNewDistanceMatrixParamsAvoid = "ferry" MdmNewDistanceMatrixParamsAvoidHighway MdmNewDistanceMatrixParamsAvoid = "highway" MdmNewDistanceMatrixParamsAvoidSharpTurn MdmNewDistanceMatrixParamsAvoid = "sharp_turn" MdmNewDistanceMatrixParamsAvoidServiceRoad MdmNewDistanceMatrixParamsAvoid = "service_road" MdmNewDistanceMatrixParamsAvoidBbox MdmNewDistanceMatrixParamsAvoid = "bbox" MdmNewDistanceMatrixParamsAvoidLeftTurn MdmNewDistanceMatrixParamsAvoid = "left_turn" MdmNewDistanceMatrixParamsAvoidRightTurn MdmNewDistanceMatrixParamsAvoid = "right_turn" MdmNewDistanceMatrixParamsAvoidNone MdmNewDistanceMatrixParamsAvoid = "none" )
type MdmNewDistanceMatrixParamsDestinationsApproach ¶
type MdmNewDistanceMatrixParamsDestinationsApproach string
Specify the side of the road from which to approach destinations points. Please note that the given approach will be applied to all the destinations.
const ( MdmNewDistanceMatrixParamsDestinationsApproachUnrestricted MdmNewDistanceMatrixParamsDestinationsApproach = "unrestricted" MdmNewDistanceMatrixParamsDestinationsApproachCurb MdmNewDistanceMatrixParamsDestinationsApproach = "curb" )
type MdmNewDistanceMatrixParamsHazmatType ¶
type MdmNewDistanceMatrixParamsHazmatType string
Specify the type of hazardous material being carried and the service will avoid roads which are not suitable for the type of goods specified. Multiple values can be separated using a pipe operator | .
Please note that this parameter is effective only when mode=truck.
const ( MdmNewDistanceMatrixParamsHazmatTypeGeneral MdmNewDistanceMatrixParamsHazmatType = "general" MdmNewDistanceMatrixParamsHazmatTypeCircumstantial MdmNewDistanceMatrixParamsHazmatType = "circumstantial" MdmNewDistanceMatrixParamsHazmatTypeExplosive MdmNewDistanceMatrixParamsHazmatType = "explosive" MdmNewDistanceMatrixParamsHazmatTypeHarmfulToWater MdmNewDistanceMatrixParamsHazmatType = "harmful_to_water" )
type MdmNewDistanceMatrixParamsMode ¶
type MdmNewDistanceMatrixParamsMode string
Set which driving mode the service should use to determine a route.
For example, if you use car, the API will return a route that a car can take. Using truck will return a route a truck can use, taking into account appropriate truck routing restrictions.
const ( MdmNewDistanceMatrixParamsModeCar MdmNewDistanceMatrixParamsMode = "car" MdmNewDistanceMatrixParamsModeTruck MdmNewDistanceMatrixParamsMode = "truck" )
type MdmNewDistanceMatrixParamsOption ¶
type MdmNewDistanceMatrixParamsOption string
Use this option to switch to truck-specific routing or time based routing or if you want to choose between the fastest and shortest route types.
const (
MdmNewDistanceMatrixParamsOptionFlexible MdmNewDistanceMatrixParamsOption = "flexible"
)
type MdmNewDistanceMatrixParamsOriginsApproach ¶
type MdmNewDistanceMatrixParamsOriginsApproach string
Specify the side of the road from which to approach origins points. Please note that the given approach will be applied to all the points provided as origins.
const ( MdmNewDistanceMatrixParamsOriginsApproachUnrestricted MdmNewDistanceMatrixParamsOriginsApproach = "unrestricted" MdmNewDistanceMatrixParamsOriginsApproachCurb MdmNewDistanceMatrixParamsOriginsApproach = "curb" )
type MdmNewDistanceMatrixParamsRouteType ¶
type MdmNewDistanceMatrixParamsRouteType string
Set the route type that needs to be returned. Please note that route_type is effective only when option=flexible.
const ( MdmNewDistanceMatrixParamsRouteTypeFastest MdmNewDistanceMatrixParamsRouteType = "fastest" MdmNewDistanceMatrixParamsRouteTypeShortest MdmNewDistanceMatrixParamsRouteType = "shortest" )
type MdmNewDistanceMatrixParamsSpliter ¶
type MdmNewDistanceMatrixParamsSpliter string
Specify a spliter to split the matrix by. It accepts 2 values:
- od_number_spliter:
- straight_distance_spliter:
Please note it is an internal, debug field only.
_debug field. choose specific spliter to split matrix._
const ( MdmNewDistanceMatrixParamsSpliterOdNumberSpliter MdmNewDistanceMatrixParamsSpliter = "od_number_spliter" MdmNewDistanceMatrixParamsSpliterStraightDistanceSpliter MdmNewDistanceMatrixParamsSpliter = "straight_distance_spliter" MdmNewDistanceMatrixParamsSpliterLocationSpliter MdmNewDistanceMatrixParamsSpliter = "location_spliter" )
type MdmNewDistanceMatrixResponse ¶
type MdmNewDistanceMatrixResponse struct { // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages/codes are returned in case of // errors. See the [API Error Codes](#api-error-codes) section below for more // information. Code string `json:"code"` // Returns the error message in case a request fails. This field will not be // present in the response, if a request is successfully submitted. Message string `json:"message"` // A unique ID which can be used in the Asynchronous Distance Matrix GET method to // retrieve the final result. TaskID string `json:"task_id"` // Display the warnings, if any, for the given input parameters and values. In case // there are no warnings then this field would not be present in the response. Warning []string `json:"warning"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Code respjson.Field Message respjson.Field TaskID respjson.Field Warning respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (MdmNewDistanceMatrixResponse) RawJSON ¶
func (r MdmNewDistanceMatrixResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*MdmNewDistanceMatrixResponse) UnmarshalJSON ¶
func (r *MdmNewDistanceMatrixResponse) UnmarshalJSON(data []byte) error
type MdmService ¶
type MdmService struct {
Options []option.RequestOption
}
MdmService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMdmService method instead.
func NewMdmService ¶
func NewMdmService(opts ...option.RequestOption) (r MdmService)
NewMdmService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*MdmService) GetDistanceMatrixStatus ¶
func (r *MdmService) GetDistanceMatrixStatus(ctx context.Context, query MdmGetDistanceMatrixStatusParams, opts ...option.RequestOption) (res *MdmGetDistanceMatrixStatusResponse, err error)
Get massive distance matrix task status
func (*MdmService) NewDistanceMatrix ¶
func (r *MdmService) NewDistanceMatrix(ctx context.Context, params MdmNewDistanceMatrixParams, opts ...option.RequestOption) (res *MdmNewDistanceMatrixResponse, err error)
Create a massive distance matrix task
type Monitor ¶
type Monitor struct { // Unique ID of the monitor. This is the same ID that was generated at the time of // creating the monitor. ID string `json:"id"` // A UNIX epoch timestamp in seconds representing the time at which the monitor was // created. CreatedAt int64 `json:"created_at"` // Description of the monitor. The value would be the same as that provided for the // description parameter at the time of creating or updating the monitor. Description string `json:"description"` // An object returning the details of the geofence that are associated with the // monitor for an enter, exit or enter_and_exit type of monitor. GeofenceConfig MonitorGeofenceConfig `json:"geofence_config"` // Geofence IDs that are linked to the monitor. These IDs were associated with the // monitor at the time of creating or updating it. // // The monitor uses the geofences mentioned here to create events of type nature // for the eligible asset(s). Geofences []string `json:"geofences"` // An object returning the details of the idle activity constraints for a idle type // of monitor. IdleConfig MonitorIdleConfig `json:"idle_config"` // Use this object to update the attributes of the monitor. MatchFilter MonitorMatchFilter `json:"match_filter"` // Any valid json object data. Can be used to save customized data. Max size is // 65kb. MetaData Metadata `json:"meta_data"` // Name of the monitor. The value would be the same as that provided for the name // parameter at the time of creating or updating the monitor. Name string `json:"name"` // An object returning the details of the over-speeding constraints for a speeding // type of monitor. SpeedingConfig MonitorSpeedingConfig `json:"speeding_config"` // Tags of the monitor. The values would be the same as that provided for the tags // parameter at the time of creating or updating the monitor. Tags []string `json:"tags"` // Type of the monitor. It represents the type of asset activity that the monitor // is configured to detect. // // Any of "enter", "exit", "enter_and_exit", "speeding", "idle". Type MonitorType `json:"type"` // A UNIX epoch timestamp in seconds representing the time at which the monitor was // last updated. UpdatedAt int64 `json:"updated_at"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field CreatedAt respjson.Field Description respjson.Field GeofenceConfig respjson.Field Geofences respjson.Field IdleConfig respjson.Field MatchFilter respjson.Field MetaData respjson.Field Name respjson.Field SpeedingConfig respjson.Field Tags respjson.Field Type respjson.Field UpdatedAt respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (*Monitor) UnmarshalJSON ¶
type MonitorGeofenceConfig ¶
type MonitorGeofenceConfig struct { // An array of geofence IDs that are linked to the monitor. Geofences are // geographic boundaries that can be used to trigger events based on an asset's // location. GeofenceIDs []string `json:"geofence_ids"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { GeofenceIDs respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object returning the details of the geofence that are associated with the monitor for an enter, exit or enter_and_exit type of monitor.
func (MonitorGeofenceConfig) RawJSON ¶
func (r MonitorGeofenceConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (*MonitorGeofenceConfig) UnmarshalJSON ¶
func (r *MonitorGeofenceConfig) UnmarshalJSON(data []byte) error
type MonitorIdleConfig ¶
type MonitorIdleConfig struct { // This parameter returns the distance threshold that was used to determine if the // asset was idle or not. The value returned for this parameter is the same as that // provided while creating or updating a idle type monitor. DistanceTolerance float64 `json:"distance_tolerance"` // This parameter returns the time duration for which the monitor tracks the // distance covered by an asset before triggering an idle event. The value returned // for this parameter is the same as that provided while creating or updating a // idle type monitor. TimeTolerance int64 `json:"time_tolerance"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { DistanceTolerance respjson.Field TimeTolerance respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object returning the details of the idle activity constraints for a idle type of monitor.
func (MonitorIdleConfig) RawJSON ¶
func (r MonitorIdleConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (*MonitorIdleConfig) UnmarshalJSON ¶
func (r *MonitorIdleConfig) UnmarshalJSON(data []byte) error
type MonitorMatchFilter ¶
type MonitorMatchFilter struct { // A string type dictionary object to specify the attributes which will be used to // identify the asset(s) on which the monitor would be applied. Please note that // using this parameter overwrites the existing attributes of the monitor. // // If the attributes added to a monitor do not match fully with the attributes // added to any asset, the monitor will be ineffective. // // Please note that the maximum number of key:value pairs that // 'include_all_of_attributes' can take is 100. Also, the overall size of the // match_filter object should not exceed 65kb. IncludeAllOfAttributes any `json:"include_all_of_attributes"` // A string dictionary object to specify the attributes, separated by a ,. Only the // assets with any one of the attributes added to this parameter will be linked to // this monitor. Once an asset and a monitor are linked, the monitor will be able // to create events for the asset when an activity specified in type is detected. // // If no input is provided for this object or if the attributes added here do not // match at least one of the attributes added to any asset, the monitor will be // ineffective. // // Please note that the maximum number of key:value pairs that // include_any_of_attributes can take is 100. Also, the overall size of // match_filter object should not exceed 65kb. IncludeAnyOfAttributes any `json:"include_any_of_attributes"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { IncludeAllOfAttributes respjson.Field IncludeAnyOfAttributes respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Use this object to update the attributes of the monitor.
func (MonitorMatchFilter) RawJSON ¶
func (r MonitorMatchFilter) RawJSON() string
Returns the unmodified JSON received from the API
func (*MonitorMatchFilter) UnmarshalJSON ¶
func (r *MonitorMatchFilter) UnmarshalJSON(data []byte) error
type MonitorSpeedingConfig ¶
type MonitorSpeedingConfig struct { // This property returns the actual speed limit that the monitor uses as a // threshold for generating a speed limit event. The value returned for this // parameter is the same as that provided while creating or updating a speeding // type monitor. CustomerSpeedLimit int64 `json:"customer_speed_limit"` // This property returns the time duration value, in milliseconds, for which the // monitor will track the speed of the asset. An event is triggered if the speed // remains higher than the specified limit for a duration more than the tolerance // value. // // The value returned for this parameter is the same as that provided while // creating or updating a speeding type monitor. TimeTolerance int64 `json:"time_tolerance"` // A boolean value denoting if the administrative speed limit of the road was used // as speed limit threshold for triggering events. The value returned for this // parameter is the same as that provided while creating or updating a speeding // type monitor. UseAdminSpeedLimit bool `json:"use_admin_speed_limit"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { CustomerSpeedLimit respjson.Field TimeTolerance respjson.Field UseAdminSpeedLimit respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object returning the details of the over-speeding constraints for a speeding type of monitor.
func (MonitorSpeedingConfig) RawJSON ¶
func (r MonitorSpeedingConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (*MonitorSpeedingConfig) UnmarshalJSON ¶
func (r *MonitorSpeedingConfig) UnmarshalJSON(data []byte) error
type MonitorType ¶
type MonitorType string
Type of the monitor. It represents the type of asset activity that the monitor is configured to detect.
const ( MonitorTypeEnter MonitorType = "enter" MonitorTypeExit MonitorType = "exit" MonitorTypeEnterAndExit MonitorType = "enter_and_exit" MonitorTypeSpeeding MonitorType = "speeding" MonitorTypeIdle MonitorType = "idle" )
type MultigeocodePlaceDeleteParams ¶
type MultigeocodePlaceDeleteParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // contains filtered or unexported fields }
func (MultigeocodePlaceDeleteParams) URLQuery ¶
func (r MultigeocodePlaceDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes MultigeocodePlaceDeleteParams's query parameters as `url.Values`.
type MultigeocodePlaceDeleteResponse ¶
type MultigeocodePlaceDeleteResponse struct { // This could be “Ok” representing success or “not found” representing error in // processing the request. Msg string `json:"msg"` // Represents the status of the response. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Msg respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (MultigeocodePlaceDeleteResponse) RawJSON ¶
func (r MultigeocodePlaceDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*MultigeocodePlaceDeleteResponse) UnmarshalJSON ¶
func (r *MultigeocodePlaceDeleteResponse) UnmarshalJSON(data []byte) error
type MultigeocodePlaceGetParams ¶
type MultigeocodePlaceGetParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // contains filtered or unexported fields }
func (MultigeocodePlaceGetParams) URLQuery ¶
func (r MultigeocodePlaceGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes MultigeocodePlaceGetParams's query parameters as `url.Values`.
type MultigeocodePlaceGetResponse ¶
type MultigeocodePlaceGetResponse struct { // It displays the information about the current source and current status of the // place. Use the “Update Place” method to change these values, as needed. DataSorce MultigeocodePlaceGetResponseDataSorce `json:"dataSorce"` // The unique NextBillion ID for the result item. DocID string `json:"docId"` // This parameter represents the place details, including geographical information, // address and other related information. Place []PlaceItem `json:"place"` // It returns the system calculated weighted score of the place. It depends on how // ‘richly’ the place was defined at the time of creation. In order to modify the // score, use “Update Place” method and update information for parameters which are // not set currently. As an alternative, you can directly update the score to a // custom value. Score int64 `json:"score"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { DataSorce respjson.Field DocID respjson.Field Place respjson.Field Score respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (MultigeocodePlaceGetResponse) RawJSON ¶
func (r MultigeocodePlaceGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*MultigeocodePlaceGetResponse) UnmarshalJSON ¶
func (r *MultigeocodePlaceGetResponse) UnmarshalJSON(data []byte) error
type MultigeocodePlaceGetResponseDataSorce ¶
type MultigeocodePlaceGetResponseDataSorce struct { // This parameter represents the unique reference ID associated with the data // source. RefID string `json:"refId"` // This parameter represents the current dataset source of the information returned // in the result. Source string `json:"source"` // This parameter indicates if a place is currently discoverable by search API or // not. // // Any of "enable", "disable". Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { RefID respjson.Field Source respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
It displays the information about the current source and current status of the place. Use the “Update Place” method to change these values, as needed.
func (MultigeocodePlaceGetResponseDataSorce) RawJSON ¶
func (r MultigeocodePlaceGetResponseDataSorce) RawJSON() string
Returns the unmodified JSON received from the API
func (*MultigeocodePlaceGetResponseDataSorce) UnmarshalJSON ¶
func (r *MultigeocodePlaceGetResponseDataSorce) UnmarshalJSON(data []byte) error
type MultigeocodePlaceNewParams ¶
type MultigeocodePlaceNewParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // This parameter represents the place details, including geographical information, // address and other related information. Place []MultigeocodePlaceNewParamsPlace `json:"place,omitzero,required"` // When 2 places are located within 100 meters of each other and have more than 90% // of matching attributes (at least 11 out of 12 attributes in the “place” object), // they will be considered duplicates and any requests to add such a new place // would be rejected. Set force=true to override this duplicate check. You can use // this to create closely located POIs. For instance, places inside a mall, // university or a government building etc. Force param.Opt[bool] `json:"force,omitzero"` // Search score of the place. This is calculated based on how ‘richly’ the place is // defined. For instance, a place with - street name, city, state and country // attributes set might be ranked lower than a place which has values of - house, // building, street name, city, state and country attributes set. The score // determines the rank of the place among search results. You can also use this // field to set a custom score as per its relevance to rank it among the search // results from multiple data sources. Score param.Opt[int64] `json:"score,omitzero"` // It contains information about the dataset that returns the specific result DataSource MultigeocodePlaceNewParamsDataSource `json:"dataSource,omitzero"` // contains filtered or unexported fields }
func (MultigeocodePlaceNewParams) MarshalJSON ¶
func (r MultigeocodePlaceNewParams) MarshalJSON() (data []byte, err error)
func (MultigeocodePlaceNewParams) URLQuery ¶
func (r MultigeocodePlaceNewParams) URLQuery() (v url.Values, err error)
URLQuery serializes MultigeocodePlaceNewParams's query parameters as `url.Values`.
func (*MultigeocodePlaceNewParams) UnmarshalJSON ¶
func (r *MultigeocodePlaceNewParams) UnmarshalJSON(data []byte) error
type MultigeocodePlaceNewParamsDataSource ¶
type MultigeocodePlaceNewParamsDataSource struct { // This parameter represents the unique reference ID associated with the data // source. RefID param.Opt[string] `json:"refId,omitzero"` // This parameter represents the source of the data. Source param.Opt[string] `json:"source,omitzero"` // This parameter indicates if a place is searchable. // // Any of "enable", "disable". Status string `json:"status,omitzero"` // contains filtered or unexported fields }
It contains information about the dataset that returns the specific result
func (MultigeocodePlaceNewParamsDataSource) MarshalJSON ¶
func (r MultigeocodePlaceNewParamsDataSource) MarshalJSON() (data []byte, err error)
func (*MultigeocodePlaceNewParamsDataSource) UnmarshalJSON ¶
func (r *MultigeocodePlaceNewParamsDataSource) UnmarshalJSON(data []byte) error
type MultigeocodePlaceNewParamsPlace ¶
type MultigeocodePlaceNewParamsPlace struct { // This parameter represents the geographical coordinates of the place. It includes // the latitude and longitude values. Geopoint MultigeocodePlaceNewParamsPlaceGeopoint `json:"geopoint,omitzero,required"` // This parameter represents the complete address of the place, including the // street, city, state, postal code and country. Address param.Opt[string] `json:"address,omitzero"` // This parameter represents additional building information if applicable. Building param.Opt[string] `json:"building,omitzero"` // This parameter represents the city or town of the place. City param.Opt[string] `json:"city,omitzero"` // Country of the search context provided as comma-separated // [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country // codes. // // Note: Country codes should be provided in uppercase. Country param.Opt[string] `json:"country,omitzero"` // This parameter represents the district of the place. District param.Opt[string] `json:"district,omitzero"` // This parameter represents the house or building number of the place. House param.Opt[string] `json:"house,omitzero"` // This parameter represents the postal code or ZIP code of the place. PostalCode param.Opt[string] `json:"postalCode,omitzero"` // This parameter represents the state or region of the place. State param.Opt[string] `json:"state,omitzero"` // This parameter represents the street name of the place. Street param.Opt[string] `json:"street,omitzero"` // This parameter represents the sub-district or locality of the place. SubDistrict param.Opt[string] `json:"subDistrict,omitzero"` // This parameter represents a point of interest within the place. A Point of // Interest (POI) refers to a specific location or area that is of interest to // individuals for various reasons. It could be a landmark, tourist attraction, // business, or any other location that people might find important or intriguing. Poi MultigeocodePlaceNewParamsPlacePoi `json:"poi,omitzero"` // contains filtered or unexported fields }
The property Geopoint is required.
func (MultigeocodePlaceNewParamsPlace) MarshalJSON ¶
func (r MultigeocodePlaceNewParamsPlace) MarshalJSON() (data []byte, err error)
func (*MultigeocodePlaceNewParamsPlace) UnmarshalJSON ¶
func (r *MultigeocodePlaceNewParamsPlace) UnmarshalJSON(data []byte) error
type MultigeocodePlaceNewParamsPlaceGeopoint ¶
type MultigeocodePlaceNewParamsPlaceGeopoint struct { // This parameter represents the latitude value of the place. Lat param.Opt[float64] `json:"lat,omitzero"` // This parameter represents the longitude value of the place. Lng param.Opt[float64] `json:"lng,omitzero"` // contains filtered or unexported fields }
This parameter represents the geographical coordinates of the place. It includes the latitude and longitude values.
func (MultigeocodePlaceNewParamsPlaceGeopoint) MarshalJSON ¶
func (r MultigeocodePlaceNewParamsPlaceGeopoint) MarshalJSON() (data []byte, err error)
func (*MultigeocodePlaceNewParamsPlaceGeopoint) UnmarshalJSON ¶
func (r *MultigeocodePlaceNewParamsPlaceGeopoint) UnmarshalJSON(data []byte) error
type MultigeocodePlaceNewParamsPlacePoi ¶
type MultigeocodePlaceNewParamsPlacePoi struct { // A title that describes the point of interest. Title param.Opt[string] `json:"title,omitzero"` // contains filtered or unexported fields }
This parameter represents a point of interest within the place. A Point of Interest (POI) refers to a specific location or area that is of interest to individuals for various reasons. It could be a landmark, tourist attraction, business, or any other location that people might find important or intriguing.
func (MultigeocodePlaceNewParamsPlacePoi) MarshalJSON ¶
func (r MultigeocodePlaceNewParamsPlacePoi) MarshalJSON() (data []byte, err error)
func (*MultigeocodePlaceNewParamsPlacePoi) UnmarshalJSON ¶
func (r *MultigeocodePlaceNewParamsPlacePoi) UnmarshalJSON(data []byte) error
type MultigeocodePlaceNewResponse ¶
type MultigeocodePlaceNewResponse struct { // A unique NextBillion DocID will be created for the POI. Use this ID to search // this place through the “Get Place” method, to update attributes or ‘status’ // through the “Update Place” method or delete it using the “Delete Place” method. DocID string `json:"docId"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { DocID respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (MultigeocodePlaceNewResponse) RawJSON ¶
func (r MultigeocodePlaceNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*MultigeocodePlaceNewResponse) UnmarshalJSON ¶
func (r *MultigeocodePlaceNewResponse) UnmarshalJSON(data []byte) error
type MultigeocodePlaceService ¶
type MultigeocodePlaceService struct {
Options []option.RequestOption
}
MultigeocodePlaceService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMultigeocodePlaceService method instead.
func NewMultigeocodePlaceService ¶
func NewMultigeocodePlaceService(opts ...option.RequestOption) (r MultigeocodePlaceService)
NewMultigeocodePlaceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*MultigeocodePlaceService) Delete ¶
func (r *MultigeocodePlaceService) Delete(ctx context.Context, docID string, body MultigeocodePlaceDeleteParams, opts ...option.RequestOption) (res *MultigeocodePlaceDeleteResponse, err error)
The "Delete Place" method enables businesses to delete a previously created place
Use this method to delete a previously created place. Please note that the place associated with the specified docID only would be deleted. As a result, once a place is deleted, the search API can still return valid results from the default datasets or others, if present.
func (*MultigeocodePlaceService) Get ¶
func (r *MultigeocodePlaceService) Get(ctx context.Context, docID string, query MultigeocodePlaceGetParams, opts ...option.RequestOption) (res *MultigeocodePlaceGetResponse, err error)
Use this method to get the details of previously created custom places using its NextBillion ID.
func (*MultigeocodePlaceService) New ¶
func (r *MultigeocodePlaceService) New(ctx context.Context, params MultigeocodePlaceNewParams, opts ...option.RequestOption) (res *MultigeocodePlaceNewResponse, err error)
The "Add Place" method allows users to create custom places
Add place method provides the flexibility to create custom places in a way that suits your business needs. The newly created place and its attributes can be added to custom (proprietary) dataset - to the effect of building your own places dataset (s) - or, to a default dataset. Overcome inaccurate ‘POI’ details from default search provider by creating custom, highly accurate ‘POIs’.
func (*MultigeocodePlaceService) Update ¶
func (r *MultigeocodePlaceService) Update(ctx context.Context, docID string, params MultigeocodePlaceUpdateParams, opts ...option.RequestOption) (res *MultigeocodePlaceUpdateResponse, err error)
The "Update Place" method allows businesses to update the attributes of an existing place.
This method allows you to update the attributes of custom places. In effect, updating a place replaces the current information in search results with the updated information associated with the specific docID. Use this method to enhance the accuracy/usability of your search results with respect to the default dataset to suit your business needs.
If you want to prioritize a particular result in your search results, update the ‘score’ of that specific place. Alternatively, you can block places which are no longer needed by setting their status: ‘disable’.
type MultigeocodePlaceUpdateParams ¶
type MultigeocodePlaceUpdateParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Search score of the place. This is calculated based on how ‘richly’ the place is // defined. For instance, a place with street name, city, state and country // attributes set might be ranked lower than a place which has values of house, // building, street name, city, state and country attributes set. The score // determines the rank of the place among search results. You can also use this // field to set a custom score as per its relevance to rank it among the search // results from multiple data sources. Score param.Opt[int64] `json:"score,omitzero"` // dataSource values can be updated to enhance or prioritize the search results to // better suit specific business use cases. DataSource MultigeocodePlaceUpdateParamsDataSource `json:"dataSource,omitzero"` // This parameter represents the place details, including geographical information, // address and other related information. Place []PlaceItemParam `json:"place,omitzero"` // contains filtered or unexported fields }
func (MultigeocodePlaceUpdateParams) MarshalJSON ¶
func (r MultigeocodePlaceUpdateParams) MarshalJSON() (data []byte, err error)
func (MultigeocodePlaceUpdateParams) URLQuery ¶
func (r MultigeocodePlaceUpdateParams) URLQuery() (v url.Values, err error)
URLQuery serializes MultigeocodePlaceUpdateParams's query parameters as `url.Values`.
func (*MultigeocodePlaceUpdateParams) UnmarshalJSON ¶
func (r *MultigeocodePlaceUpdateParams) UnmarshalJSON(data []byte) error
type MultigeocodePlaceUpdateParamsDataSource ¶
type MultigeocodePlaceUpdateParamsDataSource struct { // This parameter represents the unique reference ID associated with the data // source. RefID param.Opt[string] `json:"refId,omitzero"` // 1. Move the place to a new dataset by setting the value to a unique dataset // name. You can also move the place to an existing dataset by using an existing // dataset name other than the current one. In both cases, the current // datasource will be replaced for the specified docID. // // 2. Update the place in an existing dataset by setting the name to the current // value. Source param.Opt[string] `json:"source,omitzero"` // Set this to either enable or disable to allow the place to be retrieved by a // search API or block it respectively. // // Any of "enable", "disable". Status string `json:"status,omitzero"` // contains filtered or unexported fields }
dataSource values can be updated to enhance or prioritize the search results to better suit specific business use cases.
func (MultigeocodePlaceUpdateParamsDataSource) MarshalJSON ¶
func (r MultigeocodePlaceUpdateParamsDataSource) MarshalJSON() (data []byte, err error)
func (*MultigeocodePlaceUpdateParamsDataSource) UnmarshalJSON ¶
func (r *MultigeocodePlaceUpdateParamsDataSource) UnmarshalJSON(data []byte) error
type MultigeocodePlaceUpdateResponse ¶
type MultigeocodePlaceUpdateResponse struct { // This could be “Ok” representing success or “not found” representing error in // processing the request. Msg string `json:"msg"` // Represents the status of the response. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Msg respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (MultigeocodePlaceUpdateResponse) RawJSON ¶
func (r MultigeocodePlaceUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*MultigeocodePlaceUpdateResponse) UnmarshalJSON ¶
func (r *MultigeocodePlaceUpdateResponse) UnmarshalJSON(data []byte) error
type MultigeocodeSearchParams ¶
type MultigeocodeSearchParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Specify the center of the search context expressed as coordinates. At MultigeocodeSearchParamsAt `json:"at,omitzero,required"` // A free-form, complete or incomplete string to be searched. It allows searching // for places using keywords or names. Query string `json:"query,required"` // Specifies the primary city of the place. City param.Opt[string] `json:"city,omitzero"` // Country of the search context provided as comma-separated // [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country // codes. // Note: Country codes should be provided in uppercase. Country param.Opt[string] `json:"country,omitzero"` // Specifies the district of the search place. District param.Opt[string] `json:"district,omitzero"` // Sets the maximum number of results to be returned. Limit param.Opt[int64] `json:"limit,omitzero"` // Filters the results to places within the specified radius from the 'at' // location. // // Note: Supports 'meter' (m) and 'kilometer' (km) units. If no radius is given, // the search method returns as many results as specified in limit. Radius param.Opt[string] `json:"radius,omitzero"` // Specifies the state of the search place. State param.Opt[string] `json:"state,omitzero"` // Specifies the street name of the search place. Street param.Opt[string] `json:"street,omitzero"` // Specifies the subDistrict of the search place. SubDistrict param.Opt[string] `json:"subDistrict,omitzero"` // contains filtered or unexported fields }
func (MultigeocodeSearchParams) MarshalJSON ¶
func (r MultigeocodeSearchParams) MarshalJSON() (data []byte, err error)
func (MultigeocodeSearchParams) URLQuery ¶
func (r MultigeocodeSearchParams) URLQuery() (v url.Values, err error)
URLQuery serializes MultigeocodeSearchParams's query parameters as `url.Values`.
func (*MultigeocodeSearchParams) UnmarshalJSON ¶
func (r *MultigeocodeSearchParams) UnmarshalJSON(data []byte) error
type MultigeocodeSearchParamsAt ¶
type MultigeocodeSearchParamsAt struct { // Latitude coordinate of the location Lat float64 `json:"lat,required"` // Longitude coordinate of the location. Lng float64 `json:"lng,required"` // contains filtered or unexported fields }
Specify the center of the search context expressed as coordinates.
The properties Lat, Lng are required.
func (MultigeocodeSearchParamsAt) MarshalJSON ¶
func (r MultigeocodeSearchParamsAt) MarshalJSON() (data []byte, err error)
func (*MultigeocodeSearchParamsAt) UnmarshalJSON ¶
func (r *MultigeocodeSearchParamsAt) UnmarshalJSON(data []byte) error
type MultigeocodeSearchResponse ¶
type MultigeocodeSearchResponse struct { // An array of objects containing the search result response. Each object // represents one place returned in the search response. An empty array would be // returned if no matching place is found. Entities []MultigeocodeSearchResponseEntity `json:"entities"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Entities respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (MultigeocodeSearchResponse) RawJSON ¶
func (r MultigeocodeSearchResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*MultigeocodeSearchResponse) UnmarshalJSON ¶
func (r *MultigeocodeSearchResponse) UnmarshalJSON(data []byte) error
type MultigeocodeSearchResponseEntity ¶
type MultigeocodeSearchResponseEntity struct { // It contains information about the dataset that returns the specific result DataSource MultigeocodeSearchResponseEntityDataSource `json:"dataSource"` // The unique NextBillion ID for the result item. This ID can be used as input in // “Get Place”, “Update Place”, “Delete Place” methods. DocID string `json:"docId"` // This parameter represents the place details, including geographical information, // address and other related information. Place []PlaceItem `json:"place"` // Integer value representing how good the result is. Higher score indicates a // better match between the search query and the result. This can be used to accept // or reject the results depending on how “relevant” a result is, for a given use // case Score int64 `json:"score"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { DataSource respjson.Field DocID respjson.Field Place respjson.Field Score respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (MultigeocodeSearchResponseEntity) RawJSON ¶
func (r MultigeocodeSearchResponseEntity) RawJSON() string
Returns the unmodified JSON received from the API
func (*MultigeocodeSearchResponseEntity) UnmarshalJSON ¶
func (r *MultigeocodeSearchResponseEntity) UnmarshalJSON(data []byte) error
type MultigeocodeSearchResponseEntityDataSource ¶
type MultigeocodeSearchResponseEntityDataSource struct { // This parameter represents the unique reference ID associated with the data // source. RefID string `json:"refId"` // This parameter represents the source of the data. Source string `json:"source"` // This parameter indicates if a place is searchable. // // Any of "enable", "disable". Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { RefID respjson.Field Source respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
It contains information about the dataset that returns the specific result
func (MultigeocodeSearchResponseEntityDataSource) RawJSON ¶
func (r MultigeocodeSearchResponseEntityDataSource) RawJSON() string
Returns the unmodified JSON received from the API
func (*MultigeocodeSearchResponseEntityDataSource) UnmarshalJSON ¶
func (r *MultigeocodeSearchResponseEntityDataSource) UnmarshalJSON(data []byte) error
type MultigeocodeService ¶
type MultigeocodeService struct { Options []option.RequestOption Place MultigeocodePlaceService }
MultigeocodeService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMultigeocodeService method instead.
func NewMultigeocodeService ¶
func NewMultigeocodeService(opts ...option.RequestOption) (r MultigeocodeService)
NewMultigeocodeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*MultigeocodeService) Search ¶
func (r *MultigeocodeService) Search(ctx context.Context, params MultigeocodeSearchParams, opts ...option.RequestOption) (res *MultigeocodeSearchResponse, err error)
The method enables searching for known places from multiple data sources
Use this method to find known places in default or your own custom (proprietary) dataset and get a combined search result. It accepts free-form, partially correct or even incomplete search texts. Results would be ranked based on the search score of a place.
type NavigationGetRouteParams ¶
type NavigationGetRouteParams struct { // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // "alternatives" is "true". Please note that adding alternative route count does // not guarantee matching number of routes to be returned if potential alternative // routes do not exist. Altcount param.Opt[int64] `query:"altcount,omitzero" json:"-"` // effective only when there are no "waypoints" included in the request. You can // set the number of alternate routes to be returned in the "altcount" property. Alternatives param.Opt[bool] `query:"alternatives,omitzero" json:"-"` // north in clockwise direction. Each "bearings" should be in the format of // "degree,range", where the "degree" should be a value between \[0, 360\] and // "range" should be a value between \[0, 180\]. Please note that the number of // "bearings" should be two more than the number of "waypoints". This is to account // for the bearing of "origin" and "destination". If a route can approach a // "waypoint" or the "destination" from any direction, the bearing for that point // can be specified as "0,180". Bearings param.Opt[string] `query:"bearings,omitzero" format:"degree0,range0;degree1,range1;..." json:"-"` // is a routable land location. Please note that this parameter is mandatory if the // "original_shape" parameter is not given. Destination param.Opt[string] `query:"destination,omitzero" format:"latitude,longitude" json:"-"` // [BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) compliant language // codes. Lang param.Opt[string] `query:"lang,omitzero" json:"-"` // land location. Please note that this parameter is mandatory if the geometry // parameter is not given. Origin param.Opt[string] `query:"origin,omitzero" format:"latitude,longitude" json:"-"` // route. Accepts "polyline" and "polyline6" encoded geometry as input. // "original_shape_type" becomes mandatory when "original_shape" is used. If this // parameter is provided, the only other parameters which will be considered are // "original_shape_type", "lang", "geometry". The rest of the parameters in the // input request will be ignored. Please note overview verbosity will always be // "full" when using this parameter. OriginalShape param.Opt[string] `query:"original_shape,omitzero" json:"-"` // "destination". It is a pipe-separated list of coordinate pairs. Please note that // the route returned will arrive at the "waypoints" in the sequence they are // provided in the input request. Please note that the maximum number of waypoints // that can be provided in a single request is 50 when using GET method and 200 // with POST method. Waypoints param.Opt[string] `query:"waypoints,omitzero" format:"latitude_1,longitude_1|latitude_2,longitude_2|..." json:"-"` // approach "waypoints" in a requested route. When set to "unrestricted" a route // can arrive at the waypoint from either side of the road and when set to "curb" // the route will arrive at the waypoint on the driving side of the region. Please // note the number of values provided must be one more than the number of // "waypoints". The last value of "approaches" will determine the approach for the // "destination". However, you can skip a coordinate and show its position in the // list with the ";" separator. // // Any of "unrestricted", "curb". Approaches NavigationGetRouteParamsApproaches `query:"approaches,omitzero" json:"-"` // Multiple values should be separated by a pipe (|). If "none" is provided along // with other values, an error is returned as a valid route is not feasible. Please // note that when this parameter is not provided in the input, ferries are set to // be avoided by default. When this parameter is provided, only the mentioned // objects are avoided. // // Any of "toll", "ferry", "highway", "none". Avoid NavigationGetRouteParamsAvoid `query:"avoid,omitzero" json:"-"` // “polyline“ and “polyline6“ as input, respective encoded geometry is returned. // However, when “geojson“ is provided as the input value, “polyline“ encoded // geometry is returned in the response along with the geojson details of the // route. // // Any of "polyline", "polyline6", "geojson". Geometry NavigationGetRouteParamsGeometry `query:"geometry,omitzero" json:"-"` // if you use "car", the API will return a route that a car can take. Using "truck" // will return a route a truck can use, taking into account appropriate truck // routing restrictions. // // When "mode=truck", following are the default dimensions that are used: // // \- truck_height = 214 centimeters // // \- truck_width = 183 centimeters // // \- truck_length = 519 centimeters // // \- truck_weight = 5000 kg // // Please use the Navigation Flexible version if you want to use custom truck // dimensions. // // Note: Only the "car" profile is enabled by default. Please note that customized // profiles (including "truck") might not be available for all regions. Please // contact your [NextBillion.ai](http://NextBillion.ai) account manager, sales // representative or reach out at // [support@nextbillion.ai](mailto:support@nextbillion.ai) in case you need // additional profiles. // // Any of "car", "truck". Mode NavigationGetRouteParamsMode `query:"mode,omitzero" json:"-"` // "original_shape" parameter. Please note that an error is returned when this // parameter is not specified while an input is added to "original_shape" // parameter. // // Any of "polyline", "polyline6". OriginalShapeType NavigationGetRouteParamsOriginalShapeType `query:"original_shape_type,omitzero" json:"-"` // geometry available is returned. When set to "simplified", a simplified version // of the full geometry is returned. No overview geometry is returned when set to // "false". // // Any of "full", "simplified", "false". Overview NavigationGetRouteParamsOverview `query:"overview,omitzero" json:"-"` // contains filtered or unexported fields }
func (NavigationGetRouteParams) URLQuery ¶
func (r NavigationGetRouteParams) URLQuery() (v url.Values, err error)
URLQuery serializes NavigationGetRouteParams's query parameters as `url.Values`.
type NavigationGetRouteParamsApproaches ¶
type NavigationGetRouteParamsApproaches string
A semicolon-separated list indicating the side of the road from which to approach "waypoints" in a requested route. When set to "unrestricted" a route can arrive at the waypoint from either side of the road and when set to "curb" the route will arrive at the waypoint on the driving side of the region. Please note the number of values provided must be one more than the number of "waypoints". The last value of "approaches" will determine the approach for the "destination". However, you can skip a coordinate and show its position in the list with the ";" separator.
const ()
type NavigationGetRouteParamsAvoid ¶
type NavigationGetRouteParamsAvoid string
Setting this will ensure the route avoids ferries, tolls, highways or nothing. Multiple values should be separated by a pipe (|). If "none" is provided along with other values, an error is returned as a valid route is not feasible. Please note that when this parameter is not provided in the input, ferries are set to be avoided by default. When this parameter is provided, only the mentioned objects are avoided.
const ()
type NavigationGetRouteParamsGeometry ¶
type NavigationGetRouteParamsGeometry string
Sets the output format of the route geometry in the response. On providing “polyline“ and “polyline6“ as input, respective encoded geometry is returned. However, when “geojson“ is provided as the input value, “polyline“ encoded geometry is returned in the response along with the geojson details of the route.
const ()
type NavigationGetRouteParamsMode ¶
type NavigationGetRouteParamsMode string
Set which driving mode the service should use to determine a route. For example, if you use "car", the API will return a route that a car can take. Using "truck" will return a route a truck can use, taking into account appropriate truck routing restrictions.
When "mode=truck", following are the default dimensions that are used:
\- truck_height = 214 centimeters
\- truck_width = 183 centimeters
\- truck_length = 519 centimeters
\- truck_weight = 5000 kg
Please use the Navigation Flexible version if you want to use custom truck dimensions.
Note: Only the "car" profile is enabled by default. Please note that customized profiles (including "truck") might not be available for all regions. Please contact your [NextBillion.ai](http://NextBillion.ai) account manager, sales representative or reach out at [support@nextbillion.ai](mailto:support@nextbillion.ai) in case you need additional profiles.
const ()
type NavigationGetRouteParamsOriginalShapeType ¶
type NavigationGetRouteParamsOriginalShapeType string
Specify the encoding format of route geometry provided in the request using "original_shape" parameter. Please note that an error is returned when this parameter is not specified while an input is added to "original_shape" parameter.
const ()
type NavigationGetRouteParamsOverview ¶
type NavigationGetRouteParamsOverview string
Specify the verbosity of route geometry. When set to "full", the most detailed geometry available is returned. When set to "simplified", a simplified version of the full geometry is returned. No overview geometry is returned when set to "false".
const ()
type NavigationGetRouteResponse ¶
type NavigationGetRouteResponse struct { // that this parameter is not returned in the response in case of a successful // request. Msg string `json:"msg"` // location to the destination. Each object represents one route. Routes []NavigationGetRouteResponseRoute `json:"routes"` // will be Ok. Indicative HTTP error codes are returned for different errors. See // the [API Errors Codes](#api-error-codes) section below for more information. Status string `json:"status"` Warning []string `json:"warning"` JSON struct { Msg respjson.Field Routes respjson.Field Status respjson.Field Warning respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (NavigationGetRouteResponse) RawJSON ¶
func (r NavigationGetRouteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponse) UnmarshalJSON ¶
func (r *NavigationGetRouteResponse) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRoute ¶
type NavigationGetRouteResponseRoute struct { float64 `json:"distance"` // maneuvers or loops, in meters. DistanceFull float64 `json:"distance_full"` Duration int64 `json:"duration"` EndLocation NavigationGetRouteResponseRouteEndLocation `json:"end_location"` Geojson NavigationGetRouteResponseRouteGeojson `json:"geojson"` // and specified overview verbosity. Please note the overview will always be full // when original_shape parameter is used in the input request. Geometry string `json:"geometry"` // split the route into legs. Legs []NavigationGetRouteResponseRouteLeg `json:"legs"` PredictedDuration float64 `json:"predicted_duration"` RawDuration float64 `json:"raw_duration"` SpecialObjects any `json:"special_objects"` StartLocation NavigationGetRouteResponseRouteStartLocation `json:"start_location"` Weight float64 `json:"weight"` JSON struct { Distance respjson.Field DistanceFull respjson.Field Duration respjson.Field EndLocation respjson.Field Geojson respjson.Field Geometry respjson.Field Legs respjson.Field PredictedDuration respjson.Field RawDuration respjson.Field SpecialObjects respjson.Field StartLocation respjson.Field Weight respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }Distance
func (NavigationGetRouteResponseRoute) RawJSON ¶
func (r NavigationGetRouteResponseRoute) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRoute) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRoute) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteEndLocation ¶
type NavigationGetRouteResponseRouteEndLocation struct { float64 `json:"latitude"` Longitude float64 `json:"longitude"` JSON struct { Latitude respjson.Field Longitude respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }Latitude
Location coordinates of the point where the route ends.
func (NavigationGetRouteResponseRouteEndLocation) RawJSON ¶
func (r NavigationGetRouteResponseRouteEndLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteEndLocation) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteEndLocation) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteGeojson ¶
type NavigationGetRouteResponseRouteGeojson struct { // "MultiPolygon", "GeometryCollection", "Feature", "FeatureCollection", "Link". Type string `json:"type"` JSON struct { Geometry respjson.Field Properties respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The GeoJSON representation of the route.
func (NavigationGetRouteResponseRouteGeojson) RawJSON ¶
func (r NavigationGetRouteResponseRouteGeojson) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteGeojson) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteGeojson) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteLeg ¶
type NavigationGetRouteResponseRouteLeg struct { NavigationGetRouteResponseRouteLegDistance `json:"distance"` Duration NavigationGetRouteResponseRouteLegDuration `json:"duration"` EndLocation NavigationGetRouteResponseRouteLegEndLocation `json:"end_location"` RawDuration any `json:"raw_duration"` StartLocation NavigationGetRouteResponseRouteLegStartLocation `json:"start_location"` Steps []NavigationGetRouteResponseRouteLegStep `json:"steps"` JSON struct { Distance respjson.Field Duration respjson.Field EndLocation respjson.Field RawDuration respjson.Field StartLocation respjson.Field Steps respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }Distance
func (NavigationGetRouteResponseRouteLeg) RawJSON ¶
func (r NavigationGetRouteResponseRouteLeg) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteLeg) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteLeg) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteLegDistance ¶
type NavigationGetRouteResponseRouteLegDistance struct { respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }JSON struct { Value
An object containing leg distance value, in meters.
func (NavigationGetRouteResponseRouteLegDistance) RawJSON ¶
func (r NavigationGetRouteResponseRouteLegDistance) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteLegDistance) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteLegDistance) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteLegDuration ¶
type NavigationGetRouteResponseRouteLegDuration struct { respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }JSON struct { Value
An object containing leg duration value, in seconds.
func (NavigationGetRouteResponseRouteLegDuration) RawJSON ¶
func (r NavigationGetRouteResponseRouteLegDuration) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteLegDuration) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteLegDuration) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteLegEndLocation ¶
type NavigationGetRouteResponseRouteLegEndLocation struct { float64 `json:"latitude"` Longitude float64 `json:"longitude"` JSON struct { Latitude respjson.Field Longitude respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }Latitude
Location coordinates of the point where the leg ends.
func (NavigationGetRouteResponseRouteLegEndLocation) RawJSON ¶
func (r NavigationGetRouteResponseRouteLegEndLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteLegEndLocation) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteLegEndLocation) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteLegStartLocation ¶
type NavigationGetRouteResponseRouteLegStartLocation struct { float64 `json:"latitude"` Longitude float64 `json:"longitude"` JSON struct { Latitude respjson.Field Longitude respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }Latitude
Location coordinates of the point where the leg starts.
func (NavigationGetRouteResponseRouteLegStartLocation) RawJSON ¶
func (r NavigationGetRouteResponseRouteLegStartLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteLegStartLocation) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteLegStartLocation) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteLegStep ¶
type NavigationGetRouteResponseRouteLegStep struct { NavigationGetRouteResponseRouteLegStepDistance `json:"distance"` // on the given segment. It can have two values: "left" & "right". DrivingSide string `json:"driving_side"` Duration NavigationGetRouteResponseRouteLegStepDuration `json:"duration"` EndLocation NavigationGetRouteResponseRouteLegStepEndLocation `json:"end_location"` Geojson NavigationGetRouteResponseRouteLegStepGeojson `json:"geojson"` Geometry string `json:"geometry"` // passes by along the step. For every step, the very first intersection // corresponds to the location of the maneuver. All intersections until the next // maneuver are listed in this object. Intersections []NavigationGetRouteResponseRouteLegStepIntersection `json:"intersections"` Maneuver NavigationGetRouteResponseRouteLegStepManeuver `json:"maneuver"` Name string `json:"name"` Reference string `json:"reference"` RoadShieldType NavigationGetRouteResponseRouteLegStepRoadShieldType `json:"road_shield_type"` StartLocation NavigationGetRouteResponseRouteLegStepStartLocation `json:"start_location"` JSON struct { Distance respjson.Field DrivingSide respjson.Field Duration respjson.Field EndLocation respjson.Field Geojson respjson.Field Geometry respjson.Field Intersections respjson.Field Maneuver respjson.Field Name respjson.Field Reference respjson.Field RoadShieldType respjson.Field StartLocation respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }Distance
func (NavigationGetRouteResponseRouteLegStep) RawJSON ¶
func (r NavigationGetRouteResponseRouteLegStep) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteLegStep) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteLegStep) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteLegStepDistance ¶
type NavigationGetRouteResponseRouteLegStepDistance struct { respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }JSON struct { Value
An object containing step distance value, in meters.
func (NavigationGetRouteResponseRouteLegStepDistance) RawJSON ¶
func (r NavigationGetRouteResponseRouteLegStepDistance) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteLegStepDistance) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteLegStepDistance) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteLegStepDuration ¶
type NavigationGetRouteResponseRouteLegStepDuration struct { respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }JSON struct { Value
An object containing step duration value, in seconds.
func (NavigationGetRouteResponseRouteLegStepDuration) RawJSON ¶
func (r NavigationGetRouteResponseRouteLegStepDuration) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteLegStepDuration) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteLegStepDuration) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteLegStepEndLocation ¶
type NavigationGetRouteResponseRouteLegStepEndLocation struct { float64 `json:"latitude"` Longitude float64 `json:"longitude"` JSON struct { Latitude respjson.Field Longitude respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }Latitude
Location coordinates of the point where the step ends.
func (NavigationGetRouteResponseRouteLegStepEndLocation) RawJSON ¶
func (r NavigationGetRouteResponseRouteLegStepEndLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteLegStepEndLocation) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteLegStepEndLocation) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteLegStepGeojson ¶
type NavigationGetRouteResponseRouteLegStepGeojson struct { respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }JSON struct { Geometry
The GeoJSON representation of the step.
func (NavigationGetRouteResponseRouteLegStepGeojson) RawJSON ¶
func (r NavigationGetRouteResponseRouteLegStepGeojson) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteLegStepGeojson) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteLegStepGeojson) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteLegStepIntersection ¶
type NavigationGetRouteResponseRouteLegStepIntersection struct { // intersection. The bearings describe all available roads at the intersection. Bearings []int64 `json:"bearings"` // intersection. The classes can indicate the road hierarchy, such as a motorway, // primary road, secondary road, etc. Classes []string `json:"classes"` // route. false indicates that the turn onto the respective road would violate a // restriction. Each entry value corresponds to the bearing angle at the same // index. Entry []bool `json:"entry"` IntersectionIn int64 `json:"intersection_in"` IntersectionOut int64 `json:"intersection_out"` // If no lane information is available for an intersection, the lanes property will // not be present. Lanes []NavigationGetRouteResponseRouteLegStepIntersectionLane `json:"lanes"` Location NavigationGetRouteResponseRouteLegStepIntersectionLocation `json:"location"` JSON struct { Bearings respjson.Field Classes respjson.Field Entry respjson.Field IntersectionIn respjson.Field IntersectionOut respjson.Field Lanes respjson.Field Location respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (NavigationGetRouteResponseRouteLegStepIntersection) RawJSON ¶
func (r NavigationGetRouteResponseRouteLegStepIntersection) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteLegStepIntersection) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteLegStepIntersection) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteLegStepIntersectionLane ¶
type NavigationGetRouteResponseRouteLegStepIntersectionLane struct { // permitted maneuvers or directions that can be taken from the lane. Common // indications include "turn left," "turn right," "go straight," "merge," "exit," // etc. Indications []string `json:"indications"` // considered valid for making the indicated maneuver or if there are any // restrictions or limitations associated with it. Valid bool `json:"valid"` JSON struct { Indications respjson.Field Valid respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (NavigationGetRouteResponseRouteLegStepIntersectionLane) RawJSON ¶
func (r NavigationGetRouteResponseRouteLegStepIntersectionLane) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteLegStepIntersectionLane) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteLegStepIntersectionLane) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteLegStepIntersectionLocation ¶
type NavigationGetRouteResponseRouteLegStepIntersectionLocation struct { float64 `json:"latitude"` Longitude float64 `json:"longitude"` Name string `json:"name"` JSON struct { Latitude respjson.Field Longitude respjson.Field Name respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }Latitude
A [longitude, latitude] pair describing the location of the intersection.
func (NavigationGetRouteResponseRouteLegStepIntersectionLocation) RawJSON ¶
func (r NavigationGetRouteResponseRouteLegStepIntersectionLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteLegStepIntersectionLocation) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteLegStepIntersectionLocation) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteLegStepManeuver ¶
type NavigationGetRouteResponseRouteLegStepManeuver struct { // the maneuver. Range of values is between 0-359. BearingAfter float64 `json:"bearing_after"` // before the maneuver. Range of values is between 0-359. BearingBefore float64 `json:"bearing_before"` Coordinate NavigationGetRouteResponseRouteLegStepManeuverCoordinate `json:"coordinate"` // on the action to take at the maneuver location, such as "Turn left," "Go // straight," "Exit the roundabout," etc. Instruction string `json:"instruction"` ManeuverType string `json:"maneuver_type"` // be muted or not. Muted bool `json:"muted"` // specific to roundabout maneuvers and indicates the count of roundabouts before // the current one. RoundaboutCount int64 `json:"roundabout_count"` // provides additional details about the voice instruction, including the distance // along the geometry where the instruction applies, the instruction text, and the // unit of measurement. VoiceInstruction []NavigationGetRouteResponseRouteLegStepManeuverVoiceInstruction `json:"voice_instruction"` JSON struct { BearingAfter respjson.Field BearingBefore respjson.Field Coordinate respjson.Field Instruction respjson.Field ManeuverType respjson.Field Muted respjson.Field RoundaboutCount respjson.Field VoiceInstruction respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with maneuver details for the step.
func (NavigationGetRouteResponseRouteLegStepManeuver) RawJSON ¶
func (r NavigationGetRouteResponseRouteLegStepManeuver) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteLegStepManeuver) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteLegStepManeuver) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteLegStepManeuverCoordinate ¶
type NavigationGetRouteResponseRouteLegStepManeuverCoordinate struct { float64 `json:"latitude"` Longitude float64 `json:"longitude"` Name string `json:"name"` JSON struct { Latitude respjson.Field Longitude respjson.Field Name respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }Latitude
A coordinate pair describing the location of the maneuver.
func (NavigationGetRouteResponseRouteLegStepManeuverCoordinate) RawJSON ¶
func (r NavigationGetRouteResponseRouteLegStepManeuverCoordinate) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteLegStepManeuverCoordinate) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteLegStepManeuverCoordinate) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteLegStepManeuverVoiceInstruction ¶
type NavigationGetRouteResponseRouteLegStepManeuverVoiceInstruction struct { string `json:"instruction"` Unit string `json:"unit"` JSON struct { DistanceAlongGeometry respjson.Field Instruction respjson.Field Unit respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }Instruction
func (NavigationGetRouteResponseRouteLegStepManeuverVoiceInstruction) RawJSON ¶
func (r NavigationGetRouteResponseRouteLegStepManeuverVoiceInstruction) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteLegStepManeuverVoiceInstruction) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteLegStepManeuverVoiceInstruction) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteLegStepRoadShieldType ¶
type NavigationGetRouteResponseRouteLegStepRoadShieldType struct { string `json:"image_url"` // road number. Label string `json:"label"` JSON struct { ImageURL respjson.Field Label respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }ImageURL
An object containing road shield information.
func (NavigationGetRouteResponseRouteLegStepRoadShieldType) RawJSON ¶
func (r NavigationGetRouteResponseRouteLegStepRoadShieldType) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteLegStepRoadShieldType) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteLegStepRoadShieldType) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteLegStepStartLocation ¶
type NavigationGetRouteResponseRouteLegStepStartLocation struct { float64 `json:"latitude"` Longitude float64 `json:"longitude"` JSON struct { Latitude respjson.Field Longitude respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }Latitude
Location coordinates of the point where the step starts.
func (NavigationGetRouteResponseRouteLegStepStartLocation) RawJSON ¶
func (r NavigationGetRouteResponseRouteLegStepStartLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteLegStepStartLocation) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteLegStepStartLocation) UnmarshalJSON(data []byte) error
type NavigationGetRouteResponseRouteStartLocation ¶
type NavigationGetRouteResponseRouteStartLocation struct { float64 `json:"latitude"` Longitude float64 `json:"longitude"` JSON struct { Latitude respjson.Field Longitude respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }Latitude
Location coordinates of the point where the route starts.
func (NavigationGetRouteResponseRouteStartLocation) RawJSON ¶
func (r NavigationGetRouteResponseRouteStartLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*NavigationGetRouteResponseRouteStartLocation) UnmarshalJSON ¶
func (r *NavigationGetRouteResponseRouteStartLocation) UnmarshalJSON(data []byte) error
type NavigationService ¶
type NavigationService struct {
}NavigationService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewNavigationService method instead.
func NewNavigationService ¶
func NewNavigationService(opts ...option.RequestOption) (r NavigationService)
NewNavigationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*NavigationService) GetRoute ¶
func (r *NavigationService) GetRoute(ctx context.Context, query NavigationGetRouteParams, opts ...option.RequestOption) (res *NavigationGetRouteResponse, err error)
Nextbillion.ai’s Navigation API is a service that computes a route between 2 places, and also returns detailed turn by turn instructions for the route.
The Navigation API can be used as an input into your Navigation app. Alternatively, you can directly use Nextbillion.ai’s Navigation SDK for a complete turn by turn navigation experience.
type OptimizationComputeParams ¶
type OptimizationComputeParams struct { // This is a pipe-separated list of coordinates. // // Minimum 3 pairs of coordinates and Maximum 12 pairs of coordinates are allowed. Coordinates string `query:"coordinates,required" format:"latitude,longitude" json:"-"` // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Indicates whether the returned route is a roundtrip. Roundtrip param.Opt[bool] `query:"roundtrip,omitzero" json:"-"` // Indicates whether the return geometry should be computed or not. WithGeometry param.Opt[bool] `query:"with_geometry,omitzero" json:"-"` // A semicolon-separated list indicating the side of the road from which to // approach waypoints in a requested route. If provided, the number of approaches // must be the same as the number of coordinates. However, you can skip a // coordinate and show its position in the list with the ; separator. // // Any of "unrestricted", "curb". Approaches OptimizationComputeParamsApproaches `query:"approaches,omitzero" json:"-"` // Specify the destination coordinate of the returned route. If the input is last, // the last coordinate will be the destination. // // Any of "any", "last". Destination OptimizationComputeParamsDestination `query:"destination,omitzero" json:"-"` // Sets the output format of the route geometry in the response. // // On providing polyline and polyline6 as input, respective encoded geometry is // returned. However, when geojson is provided as the input value, polyline encoded // geometry is returned in the response along with a geojson details of the route. // // Any of "polyline", "polyline6", "geojson". Geometries OptimizationComputeParamsGeometries `query:"geometries,omitzero" json:"-"` // Set which driving mode the service should use to determine a route. For example, // if you use "car", the API will return a route that a car can take. Using "truck" // will return a route a truck can use, taking into account appropriate truck // routing restrictions. // // When "mode=truck", following are the default dimensions that are used: // // \- truck_height = 214 centimeters // // \- truck_width = 183 centimeters // // \- truck_length = 519 centimeters // // \- truck_weight = 5000 kg // // Please use the Directions Flexible version if you want to use custom truck // dimensions. // // Note: Only the "car" profile is enabled by default. Please note that customized // profiles (including "truck") might not be available for all regions. Please // contact your [NextBillion.ai](http://NextBillion.ai) account manager, sales // representative or reach out at // [support@nextbillion.ai](mailto:support@nextbillion.ai) in case you need // additional profiles. // // Any of "car", "truck". Mode OptimizationComputeParamsMode `query:"mode,omitzero" json:"-"` // The coordinate at which to start the returned route. If this is not configured, // the return route’s destination will be the first coordinate. // // Any of "any", "first". Source OptimizationComputeParamsSource `query:"source,omitzero" json:"-"` // contains filtered or unexported fields }
func (OptimizationComputeParams) URLQuery ¶
func (r OptimizationComputeParams) URLQuery() (v url.Values, err error)
URLQuery serializes OptimizationComputeParams's query parameters as `url.Values`.
type OptimizationComputeParamsApproaches ¶
type OptimizationComputeParamsApproaches string
A semicolon-separated list indicating the side of the road from which to approach waypoints in a requested route. If provided, the number of approaches must be the same as the number of coordinates. However, you can skip a coordinate and show its position in the list with the ; separator.
const ( OptimizationComputeParamsApproachesUnrestricted OptimizationComputeParamsApproaches = "unrestricted" OptimizationComputeParamsApproachesCurb OptimizationComputeParamsApproaches = "curb" )
type OptimizationComputeParamsDestination ¶
type OptimizationComputeParamsDestination string
Specify the destination coordinate of the returned route. If the input is last, the last coordinate will be the destination.
const ( OptimizationComputeParamsDestinationAny OptimizationComputeParamsDestination = "any" OptimizationComputeParamsDestinationLast OptimizationComputeParamsDestination = "last" )
type OptimizationComputeParamsGeometries ¶
type OptimizationComputeParamsGeometries string
Sets the output format of the route geometry in the response.
On providing polyline and polyline6 as input, respective encoded geometry is returned. However, when geojson is provided as the input value, polyline encoded geometry is returned in the response along with a geojson details of the route.
const ( OptimizationComputeParamsGeometriesPolyline OptimizationComputeParamsGeometries = "polyline" OptimizationComputeParamsGeometriesPolyline6 OptimizationComputeParamsGeometries = "polyline6" OptimizationComputeParamsGeometriesGeojson OptimizationComputeParamsGeometries = "geojson" )
type OptimizationComputeParamsMode ¶
type OptimizationComputeParamsMode string
Set which driving mode the service should use to determine a route. For example, if you use "car", the API will return a route that a car can take. Using "truck" will return a route a truck can use, taking into account appropriate truck routing restrictions.
When "mode=truck", following are the default dimensions that are used:
\- truck_height = 214 centimeters
\- truck_width = 183 centimeters
\- truck_length = 519 centimeters
\- truck_weight = 5000 kg
Please use the Directions Flexible version if you want to use custom truck dimensions.
Note: Only the "car" profile is enabled by default. Please note that customized profiles (including "truck") might not be available for all regions. Please contact your [NextBillion.ai](http://NextBillion.ai) account manager, sales representative or reach out at [support@nextbillion.ai](mailto:support@nextbillion.ai) in case you need additional profiles.
const ( OptimizationComputeParamsModeCar OptimizationComputeParamsMode = "car" OptimizationComputeParamsModeTruck OptimizationComputeParamsMode = "truck" )
type OptimizationComputeParamsSource ¶
type OptimizationComputeParamsSource string
The coordinate at which to start the returned route. If this is not configured, the return route’s destination will be the first coordinate.
const ( OptimizationComputeParamsSourceAny OptimizationComputeParamsSource = "any" OptimizationComputeParamsSourceFirst OptimizationComputeParamsSource = "first" )
type OptimizationComputeResponse ¶
type OptimizationComputeResponse struct { // A string indicating the state of the response. This is a separate code than the // HTTP status code. On normal valid responses, the value will be Ok. Code string `json:"code"` // Contains the latitude and longitude of a location Location OptimizationComputeResponseLocation `json:"location"` // An array of 0 or 1 trip objects. Each object has the following schema. Trips []OptimizationComputeResponseTrip `json:"trips"` // Each waypoint is an input coordinate snapped to the road and path network. Waypoints []OptimizationComputeResponseWaypoint `json:"waypoints"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Code respjson.Field Location respjson.Field Trips respjson.Field Waypoints respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (OptimizationComputeResponse) RawJSON ¶
func (r OptimizationComputeResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationComputeResponse) UnmarshalJSON ¶
func (r *OptimizationComputeResponse) UnmarshalJSON(data []byte) error
type OptimizationComputeResponseLocation ¶
type OptimizationComputeResponseLocation struct { // Latitude coordinate of the location. Latitude float64 `json:"latitude"` // Longitude coordinate of the location. Longitude float64 `json:"longitude"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Latitude respjson.Field Longitude respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Contains the latitude and longitude of a location
func (OptimizationComputeResponseLocation) RawJSON ¶
func (r OptimizationComputeResponseLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationComputeResponseLocation) UnmarshalJSON ¶
func (r *OptimizationComputeResponseLocation) UnmarshalJSON(data []byte) error
type OptimizationComputeResponseTrip ¶
type OptimizationComputeResponseTrip struct { // Distance of the trip in meters. Distance float64 `json:"distance"` // Duration of the trip in seconds Duration float64 `json:"duration"` // The GeoJSON representation of the route. Geojson OptimizationComputeResponseTripGeojson `json:"geojson"` // polyline or polyline6 format of route geometry. Geometry string `json:"geometry"` Legs []OptimizationComputeResponseTripLeg `json:"legs"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Distance respjson.Field Duration respjson.Field Geojson respjson.Field Geometry respjson.Field Legs respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (OptimizationComputeResponseTrip) RawJSON ¶
func (r OptimizationComputeResponseTrip) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationComputeResponseTrip) UnmarshalJSON ¶
func (r *OptimizationComputeResponseTrip) UnmarshalJSON(data []byte) error
type OptimizationComputeResponseTripGeojson ¶
type OptimizationComputeResponseTripGeojson struct { // The encoded geometry of the geojson in the trip. Geometry string `json:"geometry"` // Additional properties associated with the trip. Properties string `json:"properties"` // The type of the GeoJSON object. // // Any of "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", // "MultiPolygon", "GeometryCollection", "Feature", "FeatureCollection", "Link". Type string `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Geometry respjson.Field Properties respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The GeoJSON representation of the route.
func (OptimizationComputeResponseTripGeojson) RawJSON ¶
func (r OptimizationComputeResponseTripGeojson) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationComputeResponseTripGeojson) UnmarshalJSON ¶
func (r *OptimizationComputeResponseTripGeojson) UnmarshalJSON(data []byte) error
type OptimizationComputeResponseTripLeg ¶
type OptimizationComputeResponseTripLeg struct { // Distance of leg in metres. Distance float64 `json:"distance"` // Duration of leg in seconds. Duration float64 `json:"duration"` // An array of step objects. Steps []OptimizationComputeResponseTripLegStep `json:"steps"` // Summary of the leg object. Summary string `json:"summary"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Distance respjson.Field Duration respjson.Field Steps respjson.Field Summary respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (OptimizationComputeResponseTripLeg) RawJSON ¶
func (r OptimizationComputeResponseTripLeg) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationComputeResponseTripLeg) UnmarshalJSON ¶
func (r *OptimizationComputeResponseTripLeg) UnmarshalJSON(data []byte) error
type OptimizationComputeResponseTripLegStep ¶
type OptimizationComputeResponseTripLegStep struct { // Distance of the step object in meters. Distance float64 `json:"distance"` // Duration of the step object in seconds. Duration float64 `json:"duration"` // The GeoJSON representation of the step. Geojson OptimizationComputeResponseTripLegStepGeojson `json:"geojson"` // Encoded geometry of the step in the selected format. Geometry string `json:"geometry"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Distance respjson.Field Duration respjson.Field Geojson respjson.Field Geometry respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (OptimizationComputeResponseTripLegStep) RawJSON ¶
func (r OptimizationComputeResponseTripLegStep) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationComputeResponseTripLegStep) UnmarshalJSON ¶
func (r *OptimizationComputeResponseTripLegStep) UnmarshalJSON(data []byte) error
type OptimizationComputeResponseTripLegStepGeojson ¶
type OptimizationComputeResponseTripLegStepGeojson struct { // The encoded geometry of the geojson in the step. Geometry string `json:"geometry"` // Additional properties associated with the step. Properties string `json:"properties"` // The type of the GeoJSON object. // // Any of "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", // "MultiPolygon", "GeometryCollection", "Feature", "FeatureCollection", "Link". Type string `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Geometry respjson.Field Properties respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The GeoJSON representation of the step.
func (OptimizationComputeResponseTripLegStepGeojson) RawJSON ¶
func (r OptimizationComputeResponseTripLegStepGeojson) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationComputeResponseTripLegStepGeojson) UnmarshalJSON ¶
func (r *OptimizationComputeResponseTripLegStepGeojson) UnmarshalJSON(data []byte) error
type OptimizationComputeResponseWaypoint ¶
type OptimizationComputeResponseWaypoint struct { // Describes the location of the waypoint. Location OptimizationComputeResponseWaypointLocation `json:"location"` // Name of the waypoint. Name string `json:"name"` // Denotes the ID of a trip. Starts with 0. TripsIndex int64 `json:"trips_index"` // Denotes the id of a waypoint. The first waypoint is denoted with 0. And onwards // with 1, 2 etc. WaypointIndex int64 `json:"waypoint_index"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Location respjson.Field Name respjson.Field TripsIndex respjson.Field WaypointIndex respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (OptimizationComputeResponseWaypoint) RawJSON ¶
func (r OptimizationComputeResponseWaypoint) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationComputeResponseWaypoint) UnmarshalJSON ¶
func (r *OptimizationComputeResponseWaypoint) UnmarshalJSON(data []byte) error
type OptimizationComputeResponseWaypointLocation ¶
type OptimizationComputeResponseWaypointLocation struct { // Latitude coordinate of the waypoint. Latitude float64 `json:"latitude"` // Longitude coordinate of the waypoint. Longitude float64 `json:"longitude"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Latitude respjson.Field Longitude respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Describes the location of the waypoint.
func (OptimizationComputeResponseWaypointLocation) RawJSON ¶
func (r OptimizationComputeResponseWaypointLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationComputeResponseWaypointLocation) UnmarshalJSON ¶
func (r *OptimizationComputeResponseWaypointLocation) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignParams ¶
type OptimizationDriverAssignmentAssignParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Specify the filtering criterion for the vehicles with respect to each order's // location. filter is a mandatory input for all requests. Filter OptimizationDriverAssignmentAssignParamsFilter `json:"filter,omitzero,required"` // Collects the details of open orders to be fulfilled. Each object represents one // order. All requests must include orders as a mandatory input. A maximum of 200 // orders is allowed per request. Orders []OptimizationDriverAssignmentAssignParamsOrder `json:"orders,omitzero,required"` // Collects the details of vehicles available to fulfill the orders. Each object // represents one vehicle. All requests must include vehicles as a mandatory input. // A maximum of 100 vehicles is allowed per request. Vehicles []VehicleParam `json:"vehicles,omitzero,required"` // Configure the assignment constraints and response settings. Options OptimizationDriverAssignmentAssignParamsOptions `json:"options,omitzero"` // contains filtered or unexported fields }
func (OptimizationDriverAssignmentAssignParams) MarshalJSON ¶
func (r OptimizationDriverAssignmentAssignParams) MarshalJSON() (data []byte, err error)
func (OptimizationDriverAssignmentAssignParams) URLQuery ¶
func (r OptimizationDriverAssignmentAssignParams) URLQuery() (v url.Values, err error)
URLQuery serializes OptimizationDriverAssignmentAssignParams's query parameters as `url.Values`.
func (*OptimizationDriverAssignmentAssignParams) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignParams) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignParamsFilter ¶
type OptimizationDriverAssignmentAssignParamsFilter struct { // Defines a driving_distance filter, in meters. If a vehicle needs to drive // further than this distance to reach a pickup location, it will not be assigned // to that order. Valid range of values for this filter is \[1, 10000\]. DrivingDistance param.Opt[float64] `json:"driving_distance,omitzero"` // Specify a duration, in seconds, which will be used to filter out ineligible // vehicles for each order. Any vehicle which would take more time than specified // here, to reach the pickup location of a given order, will be ruled out for // assignment for that particular order. Valid values for pickup_eta are \[1, // 3600\]. PickupEta param.Opt[int64] `json:"pickup_eta,omitzero"` // Specify a radius, in meters, which will be used to filter out ineligible // vehicles for each order. The pickup location of an order will act as the center // of the circle when identifying eligible vehicles. Valid values for radius are // \[1, 10000\]. Radius param.Opt[float64] `json:"radius,omitzero"` // contains filtered or unexported fields }
Specify the filtering criterion for the vehicles with respect to each order's location. filter is a mandatory input for all requests.
func (OptimizationDriverAssignmentAssignParamsFilter) MarshalJSON ¶
func (r OptimizationDriverAssignmentAssignParamsFilter) MarshalJSON() (data []byte, err error)
func (*OptimizationDriverAssignmentAssignParamsFilter) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignParamsFilter) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignParamsOptions ¶
type OptimizationDriverAssignmentAssignParamsOptions struct { // Specify the maximum number of potential, alternate vehicle assignments to be // returned for each order, apart from the vehicle which was assigned as // recommended. Please note that: // // - The maximum number of alternate assignments that can be requested are 3. // - It is not necessary that the service will return the specified number of // alternate assignments for each order. The number of alternate assignments // returned will depend on the number of vehicles provided in the input. // - Order which could not be assigned to any vehicles due to their filter or // attribute matching criteria will not be eligible for alternate assignments as // well. AlternateAssignments param.Opt[int64] `json:"alternate_assignments,omitzero"` // When **true**, the service returns the drop-off steps for each trip and related // details in the response. Defaults to **false**. DropoffDetails param.Opt[bool] `json:"dropoff_details,omitzero"` // Collection of rules for assigning custom priority to orders based on their // attributes. In case an order satisfies more than one rule, the highest priority // score from all the rules satisfied, would be the effective priority score for // such an order. OrderAttributePriorityMappings []OptimizationDriverAssignmentAssignParamsOptionsOrderAttributePriorityMapping `json:"order_attribute_priority_mappings,omitzero"` // Choose a travel cost that will be used by the service for assigning vehicles // efficiently from a set of qualifying ones. // // Any of "driving_eta", "driving_distance", "straight_line_distance". TravelCost string `json:"travel_cost,omitzero"` // Collection of rules for assigning custom priority to vehicles based on their // attributes. In case a vehicle satisfies more than one rule, the highest priority // score from all the rules satisfied, would be the effective priority score for // such a vehicle. VehicleAttributePriorityMappings []OptimizationDriverAssignmentAssignParamsOptionsVehicleAttributePriorityMapping `json:"vehicle_attribute_priority_mappings,omitzero"` // contains filtered or unexported fields }
Configure the assignment constraints and response settings.
func (OptimizationDriverAssignmentAssignParamsOptions) MarshalJSON ¶
func (r OptimizationDriverAssignmentAssignParamsOptions) MarshalJSON() (data []byte, err error)
func (*OptimizationDriverAssignmentAssignParamsOptions) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignParamsOptions) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignParamsOptionsOrderAttributePriorityMapping ¶
type OptimizationDriverAssignmentAssignParamsOptionsOrderAttributePriorityMapping struct { // Specify the name of the attribute. The attribute is compared to the keys (of // each key:value pair) in orders.attributes during evaluation. Attribute string `json:"attribute,required"` // Specify the operator to denote the relation between attribute and the value // specified above. The attribute , operator and value together constitute the // condition that an order must meet to assume the specified priority. We support // the following operators currently: // // - Equal to (==) // - Less than (<) // - Less tha equal to (<=) // - Greater than (>) // - Greater than equal to (>=) // - Contains (contains) // // Please note that when using "contains" operator only one value can be specified // and the corresponding attribute must contain multiple values when defined for an // order. Operator string `json:"operator,required"` // Specify the priority score that should be assigned when an order qualifies the // criteria specified above. A higher value indicates a higher priority. Valid // values are \[1,10\]. Priority string `json:"priority,required"` // Specify the desired value of the attribute to be applied for this order. value // provided here is compared to the values (of each key:value pair) in // orders.attributes during evaluation. Value string `json:"value,required"` // contains filtered or unexported fields }
The properties Attribute, Operator, Priority, Value are required.
func (OptimizationDriverAssignmentAssignParamsOptionsOrderAttributePriorityMapping) MarshalJSON ¶
func (r OptimizationDriverAssignmentAssignParamsOptionsOrderAttributePriorityMapping) MarshalJSON() (data []byte, err error)
func (*OptimizationDriverAssignmentAssignParamsOptionsOrderAttributePriorityMapping) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignParamsOptionsOrderAttributePriorityMapping) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignParamsOptionsVehicleAttributePriorityMapping ¶
type OptimizationDriverAssignmentAssignParamsOptionsVehicleAttributePriorityMapping struct { // Specify the name of the attribute. The attribute is compared to the keys (of // each key:value pair) in vehicles.attributes during evaluation. Attribute string `json:"attribute,required"` // Specify the operator to denote the relation between attribute and the value // specified above. The attribute , operator and value together constitute the // condition that a vehicle must meet to assume the specified priority. We support // the following operators currently: // // - Equal to (==) // - Less than (<) // - Less tha equal to (<=) // - Greater than (>) // - Greater than equal to (>=) // - Contains (contains) // // Please note that when using "contains" operator only one value can be specified // and the corresponding attribute must contain multiple values when defined for a // vehicle. Operator string `json:"operator,required"` // Specify the priority score that should be assigned when a vehicle qualifies the // criteria specified above. A higher value indicates a higher priority. Valid // values are \[1,10\]. Priority string `json:"priority,required"` // Specify the desired value of the attribute to be applied for this vehicle. value // provided here is compared to the values (of each key:value pair) in // vehicles.attributes during evaluation. Value string `json:"value,required"` // contains filtered or unexported fields }
The properties Attribute, Operator, Priority, Value are required.
func (OptimizationDriverAssignmentAssignParamsOptionsVehicleAttributePriorityMapping) MarshalJSON ¶
func (r OptimizationDriverAssignmentAssignParamsOptionsVehicleAttributePriorityMapping) MarshalJSON() (data []byte, err error)
func (*OptimizationDriverAssignmentAssignParamsOptionsVehicleAttributePriorityMapping) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignParamsOptionsVehicleAttributePriorityMapping) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignParamsOrder ¶
type OptimizationDriverAssignmentAssignParamsOrder struct { // Specify a unique ID for the order. ID string `json:"id,required"` // Specify the location coordinates of the pickup location of the order. This input // is mandatory for each order. Pickup OptimizationDriverAssignmentAssignParamsOrderPickup `json:"pickup,omitzero,required"` // Specify the priority for this order. A higher value indicates a higher priority. // When specified, it will override any priority score deduced from // order_attribute_priority_mappings for this order. Valid values are \[1, 10\] and // default is 0. Priority param.Opt[int64] `json:"priority,omitzero"` // Specify the service time, in seconds, for the order. Service time is the // duration that the driver is likely to wait at the pickup location after // arriving. The impact of the service time is realized in the ETA for the // "dropoff" type step. ServiceTime param.Opt[int64] `json:"service_time,omitzero"` // Specify custom attributes for the orders. Each attribute should be created as a // key:value pair. The **keys** provided can be used in // options.order_attribute_priority_mappings to assign a custom priority for this // order based on its attributes. // // The maximum number of key:value pairs that can be specified under attributes for // a given order, is limited to 30. Attributes any `json:"attributes,omitzero"` // Use this parameter to specify the location coordinates of the destination of the // trip or the intermediate stops to be completed before it. // // # Please note // // - The last location provided is treated as the destination of the trip. // - dropoffs is mandatory when dropoff_details is set to **true**. Dropoffs []OptimizationDriverAssignmentAssignParamsOrderDropoff `json:"dropoffs,omitzero"` // Define custom preferences for task assignment based on vehicle's attributes. If // multiple criteria are provided, they are evaluated using an AND // condition—meaning all specified criteria must be met individually for a vehicle // to be considered. // // For example, if required_all_of_attributes, required_any_of_attributes, and // exclude_all_of_attributes are all provided, an eligible vehicle must satisfy the // following to be considered for assignments: // // 1. Meet all conditions specified in required_all_of_attributes. // 2. Meet at least one of the conditions listed in required_any_of_attributes. // 3. Not meet any conditions mentioned in exclude_all_of_attributes. // // Consequently, a vehicle which does not have any attributes defined can't be // assigned to an order which has vehicle_preferences configured. VehiclePreferences OptimizationDriverAssignmentAssignParamsOrderVehiclePreferences `json:"vehicle_preferences,omitzero"` // contains filtered or unexported fields }
The properties ID, Pickup are required.
func (OptimizationDriverAssignmentAssignParamsOrder) MarshalJSON ¶
func (r OptimizationDriverAssignmentAssignParamsOrder) MarshalJSON() (data []byte, err error)
func (*OptimizationDriverAssignmentAssignParamsOrder) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignParamsOrder) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignParamsOrderDropoff ¶
type OptimizationDriverAssignmentAssignParamsOrderDropoff struct { // Latitude of the stop location. Lat param.Opt[float64] `json:"lat,omitzero"` // Longitude of the stop location. Lng param.Opt[float64] `json:"lng,omitzero"` // contains filtered or unexported fields }
func (OptimizationDriverAssignmentAssignParamsOrderDropoff) MarshalJSON ¶
func (r OptimizationDriverAssignmentAssignParamsOrderDropoff) MarshalJSON() (data []byte, err error)
func (*OptimizationDriverAssignmentAssignParamsOrderDropoff) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignParamsOrderDropoff) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignParamsOrderPickup ¶
type OptimizationDriverAssignmentAssignParamsOrderPickup struct { // Latitude of the pickup location. Lat param.Opt[float64] `json:"lat,omitzero"` // Longitude of the pickup location. Lng param.Opt[float64] `json:"lng,omitzero"` // contains filtered or unexported fields }
Specify the location coordinates of the pickup location of the order. This input is mandatory for each order.
func (OptimizationDriverAssignmentAssignParamsOrderPickup) MarshalJSON ¶
func (r OptimizationDriverAssignmentAssignParamsOrderPickup) MarshalJSON() (data []byte, err error)
func (*OptimizationDriverAssignmentAssignParamsOrderPickup) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignParamsOrderPickup) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignParamsOrderVehiclePreferences ¶
type OptimizationDriverAssignmentAssignParamsOrderVehiclePreferences struct { // An array of objects to add exclusion requirements for the order. A vehicle must // **not meet any of the conditions** specified here to be considered for // assignment. Each object represents a single condition. Please note that a // maximum of 10 conditions can be added here for a given order. ExcludeAllOfAttributes []OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesExcludeAllOfAttribute `json:"exclude_all_of_attributes,omitzero"` // An array of objects to add mandatory requirements for the order. A vehicle must // **meet** **all conditions** specified here to be considered for assignment. Each // object represents a single condition. Please note that a maximum of 10 // conditions can be added here for a given order. RequiredAllOfAttributes []OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesRequiredAllOfAttribute `json:"required_all_of_attributes,omitzero"` // An array of objects to add optional requirements for the order. A vehicle must // **meet** **at least one of the conditions** specified here to be considered for // assignment. Each object represents a single condition. Please note that a // maximum of 10 conditions can be added here for a given order. RequiredAnyOfAttributes []OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesRequiredAnyOfAttribute `json:"required_any_of_attributes,omitzero"` // contains filtered or unexported fields }
Define custom preferences for task assignment based on vehicle's attributes. If multiple criteria are provided, they are evaluated using an AND condition—meaning all specified criteria must be met individually for a vehicle to be considered.
For example, if required_all_of_attributes, required_any_of_attributes, and exclude_all_of_attributes are all provided, an eligible vehicle must satisfy the following to be considered for assignments:
1. Meet all conditions specified in required_all_of_attributes. 2. Meet at least one of the conditions listed in required_any_of_attributes. 3. Not meet any conditions mentioned in exclude_all_of_attributes.
Consequently, a vehicle which does not have any attributes defined can't be assigned to an order which has vehicle_preferences configured.
func (OptimizationDriverAssignmentAssignParamsOrderVehiclePreferences) MarshalJSON ¶
func (r OptimizationDriverAssignmentAssignParamsOrderVehiclePreferences) MarshalJSON() (data []byte, err error)
func (*OptimizationDriverAssignmentAssignParamsOrderVehiclePreferences) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignParamsOrderVehiclePreferences) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesExcludeAllOfAttribute ¶
type OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesExcludeAllOfAttribute struct { // Specify the name of the attribute. The attribute is compared to the keys (of // each key:value pair) in vehicles.attributes during evaluation. Attribute string `json:"attribute,required"` // Specify the operator to denote the relation between attribute and the value // specified above. The attribute , operator and value together constitute the // condition that a vehicle must meet to be eligible for assignment. Currently, we // support following operators currently: // // - Equal to (==) // - Less than (<) // - Less tha equal to (<=) // - Greater than (>) // - Greater than equal to (>=) // - Contains (contains) // // Please note that when using "contains" operator only one value can be specified // and the corresponding attribute must contain multiple values when defined for a // vehicle. Operator string `json:"operator,required"` // Specify the desired value of the attribute to be applied for this order. value // provided here is compared to the values (of each key:value pair) in // vehicles.attributes during evaluation. Value string `json:"value,required"` // contains filtered or unexported fields }
The properties Attribute, Operator, Value are required.
func (OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesExcludeAllOfAttribute) MarshalJSON ¶
func (r OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesExcludeAllOfAttribute) MarshalJSON() (data []byte, err error)
func (*OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesExcludeAllOfAttribute) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesExcludeAllOfAttribute) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesRequiredAllOfAttribute ¶
type OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesRequiredAllOfAttribute struct { // Specify the name of the attribute. The attribute is compared to the keys (of // each key:value pair) in vehicles.attributes during evaluation. Attribute string `json:"attribute,required"` // Specify the operator to denote the relation between attribute and the value // specified above. The attribute , operator and value together constitute the // condition that a vehicle must meet to be eligible for assignment. Currently, we // support following operators currently: // // - Equal to (==) // - Less than (<) // - Less tha equal to (<=) // - Greater than (>) // - Greater than equal to (>=) // - Contains (contains) // // Please note that when using "contains" operator only one value can be specified // and the corresponding attribute must contain multiple values when defined for a // vehicle. Operator string `json:"operator,required"` // Specify the desired value of the attribute to be applied for this order. value // provided here is compared to the values (of each key:value pair) in // vehicles.attributes during evaluation. Value string `json:"value,required"` // contains filtered or unexported fields }
The properties Attribute, Operator, Value are required.
func (OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesRequiredAllOfAttribute) MarshalJSON ¶
func (r OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesRequiredAllOfAttribute) MarshalJSON() (data []byte, err error)
func (*OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesRequiredAllOfAttribute) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesRequiredAllOfAttribute) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesRequiredAnyOfAttribute ¶
type OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesRequiredAnyOfAttribute struct { // Specify the name of the attribute. The attribute is compared to the keys (of // each key:value pair) in vehicles.attributes during evaluation. Attribute string `json:"attribute,required"` // Specify the operator to denote the relation between attribute and the value // specified above. The attribute , operator and value together constitute the // condition that a vehicle must meet to be eligible for assignment. Currently, we // support following operators currently: // // - Equal to (==) // - Less than (<) // - Less tha equal to (<=) // - Greater than (>) // - Greater than equal to (>=) // - Contains (contains) // // Please note that when using "contains" operator only one value can be specified // and the corresponding attribute must contain multiple values when defined for a // vehicle. Operator string `json:"operator,required"` // Specify the desired value of the attribute to be applied for this order. value // provided here is compared to the values (of each key:value pair) in // vehicles.attributes during evaluation. Value string `json:"value,required"` // contains filtered or unexported fields }
The properties Attribute, Operator, Value are required.
func (OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesRequiredAnyOfAttribute) MarshalJSON ¶
func (r OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesRequiredAnyOfAttribute) MarshalJSON() (data []byte, err error)
func (*OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesRequiredAnyOfAttribute) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignParamsOrderVehiclePreferencesRequiredAnyOfAttribute) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignResponse ¶
type OptimizationDriverAssignmentAssignResponse struct { // Displays indicative error message in case of a failed request or operation. // Please note that this parameter is not returned in the response in case of a // successful request. Message string `json:"message"` // An object containing the details of the assignments. Result OptimizationDriverAssignmentAssignResponseResult `json:"result"` // An integer indicating the HTTP response code. See the // [API Error Handling](https://docs.nextbillion.ai/optimization/driver-assignment-api#api-error-handling) // section below for more information. Status int64 `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Message respjson.Field Result respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (OptimizationDriverAssignmentAssignResponse) RawJSON ¶
func (r OptimizationDriverAssignmentAssignResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationDriverAssignmentAssignResponse) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignResponse) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignResponseResult ¶
type OptimizationDriverAssignmentAssignResponseResult struct { // An array of objects containing the details of the potential, alternate vehicle // assignments for the orders in the input. This attribute will not be returned in // the response if the alternate_assignments was not provided in the input. Each // object represents alternate assignments for a single order. AlternateAssignments []OptimizationDriverAssignmentAssignResponseResultAlternateAssignment `json:"alternate_assignments"` // A collection of vehicles IDs that were not assigned to any orders. A null value // is returned if there are no vehicles without an order assignment. AvailableVehicles []string `json:"available_vehicles"` // An collection of objects returning the trip details for each vehicle which was // assigned to an order. Each object corresponds to one vehicle. Trips []OptimizationDriverAssignmentAssignResponseResultTrip `json:"trips"` // A collection of objects listing the details of orders which remained unassigned. // Each object represents a single order. A null value is returned if there are no // unassigned orders. UnassignedOrders []OptimizationDriverAssignmentAssignResponseResultUnassignedOrder `json:"unassigned_orders"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { AlternateAssignments respjson.Field AvailableVehicles respjson.Field Trips respjson.Field UnassignedOrders respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object containing the details of the assignments.
func (OptimizationDriverAssignmentAssignResponseResult) RawJSON ¶
func (r OptimizationDriverAssignmentAssignResponseResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationDriverAssignmentAssignResponseResult) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignResponseResult) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignResponseResultAlternateAssignment ¶
type OptimizationDriverAssignmentAssignResponseResultAlternateAssignment struct { // An array of objects containing the details of the alternate vehicle assignments. // Each object represents an alternate vehicle assignment. Assignments []OptimizationDriverAssignmentAssignResponseResultAlternateAssignmentAssignment `json:"assignments"` // Returns the order ID associated with the alternate assignments. OrderID string `json:"order_id"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Assignments respjson.Field OrderID respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (OptimizationDriverAssignmentAssignResponseResultAlternateAssignment) RawJSON ¶
func (r OptimizationDriverAssignmentAssignResponseResultAlternateAssignment) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationDriverAssignmentAssignResponseResultAlternateAssignment) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignResponseResultAlternateAssignment) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignResponseResultAlternateAssignmentAssignment ¶
type OptimizationDriverAssignmentAssignResponseResultAlternateAssignmentAssignment struct { // Returns the ETA to the order's pickup location for the given vehicle. PickupEta int64 `json:"pickup_eta"` // Returns the vehicle ID which could potentially be assigned to the given order. VehicleID string `json:"vehicle_id"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { PickupEta respjson.Field VehicleID respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (OptimizationDriverAssignmentAssignResponseResultAlternateAssignmentAssignment) RawJSON ¶
func (r OptimizationDriverAssignmentAssignResponseResultAlternateAssignmentAssignment) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationDriverAssignmentAssignResponseResultAlternateAssignmentAssignment) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignResponseResultAlternateAssignmentAssignment) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignResponseResultTrip ¶
type OptimizationDriverAssignmentAssignResponseResultTrip struct { // Returns a unique trip ID. TripID string `json:"trip_id"` // Returns the details of the vehicle, assigned order and the trip steps. Vehicle OptimizationDriverAssignmentAssignResponseResultTripVehicle `json:"vehicle"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { TripID respjson.Field Vehicle respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (OptimizationDriverAssignmentAssignResponseResultTrip) RawJSON ¶
func (r OptimizationDriverAssignmentAssignResponseResultTrip) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationDriverAssignmentAssignResponseResultTrip) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignResponseResultTrip) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignResponseResultTripVehicle ¶
type OptimizationDriverAssignmentAssignResponseResultTripVehicle struct { // Returns the ID of the vehicle. ID string `json:"id"` // A collection of objects returning the sequence of steps that the vehicle needs // to perform for a trip. Steps OptimizationDriverAssignmentAssignResponseResultTripVehicleSteps `json:"steps"` // Location info. VehicleCurrentLocation Location `json:"vehicle_current_location"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Steps respjson.Field VehicleCurrentLocation respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the details of the vehicle, assigned order and the trip steps.
func (OptimizationDriverAssignmentAssignResponseResultTripVehicle) RawJSON ¶
func (r OptimizationDriverAssignmentAssignResponseResultTripVehicle) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationDriverAssignmentAssignResponseResultTripVehicle) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignResponseResultTripVehicle) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignResponseResultTripVehicleSteps ¶
type OptimizationDriverAssignmentAssignResponseResultTripVehicleSteps struct { // Returns the driving distance, in meters, to the step's location from previous // step's location. For the first step of a trip, distance indicates the driving // distance from vehicle_current_location to the step's location. Distance int64 `json:"distance"` // Returns the driving duration, in seconds, to the step's location from previous // step's location. For the first step of a trip, eta indicates the driving // duration from vehicle_current_location to the step's location. Eta int64 `json:"eta"` // Location info. Location Location `json:"location"` // Returns the ID of the order. In case the step type is **ongoing**, an empty // string is returned. OrderID string `json:"order_id"` // Returns the type of the step. Currently, it can take following values: // // - **pickup:** Indicates the pickup step for an order // - **dropoff:** Indicates the dropoff step for an order. It is returned only if // dropoff_details was **true** in the input request. // - **ongoing:** Indicates a step that the vehicle needs to complete on its // current trip. This is returned in the response only when remaining_waypoints // input was provided for the given vehicle. // - **intermediate_waypoint:** Indicates an intermediate stop that the vehicle // needs to complete in case multiple dropoffs are provided in the input. // // Any of "pickup", "dropoff", "ongoing". Type string `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Distance respjson.Field Eta respjson.Field Location respjson.Field OrderID respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
A collection of objects returning the sequence of steps that the vehicle needs to perform for a trip.
func (OptimizationDriverAssignmentAssignResponseResultTripVehicleSteps) RawJSON ¶
func (r OptimizationDriverAssignmentAssignResponseResultTripVehicleSteps) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationDriverAssignmentAssignResponseResultTripVehicleSteps) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignResponseResultTripVehicleSteps) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentAssignResponseResultUnassignedOrder ¶
type OptimizationDriverAssignmentAssignResponseResultUnassignedOrder struct { // Returns the ID of the order which remained unassigned. OrderID string `json:"order_id"` // Returns the most probable reason due to which the order remained unassigned. UnassignedReason string `json:"unassigned_reason"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { OrderID respjson.Field UnassignedReason respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (OptimizationDriverAssignmentAssignResponseResultUnassignedOrder) RawJSON ¶
func (r OptimizationDriverAssignmentAssignResponseResultUnassignedOrder) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationDriverAssignmentAssignResponseResultUnassignedOrder) UnmarshalJSON ¶
func (r *OptimizationDriverAssignmentAssignResponseResultUnassignedOrder) UnmarshalJSON(data []byte) error
type OptimizationDriverAssignmentService ¶
type OptimizationDriverAssignmentService struct {
Options []option.RequestOption
}
OptimizationDriverAssignmentService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewOptimizationDriverAssignmentService method instead.
func NewOptimizationDriverAssignmentService ¶
func NewOptimizationDriverAssignmentService(opts ...option.RequestOption) (r OptimizationDriverAssignmentService)
NewOptimizationDriverAssignmentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*OptimizationDriverAssignmentService) Assign ¶
func (r *OptimizationDriverAssignmentService) Assign(ctx context.Context, params OptimizationDriverAssignmentAssignParams, opts ...option.RequestOption) (res *OptimizationDriverAssignmentAssignResponse, err error)
Assigns available drivers (vehicles) to open orders based on specified criteria and constraints.
type OptimizationReOptimizeParams ¶
type OptimizationReOptimizeParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Specify the unique request ID that needs to be re-optimized. ExistingRequestID string `json:"existing_request_id,required"` // This section gathers information on modifications to the number of jobs or their // individual requirements for re-optimization. Any job from the original solution // not specified here will be re-planned without alteration during the // re-optimization process. JobChanges OptimizationReOptimizeParamsJobChanges `json:"job_changes,omitzero"` // Provide the list of locations to be used during re-optimization process. Please // note that // // - Providing the location input overwrites the list of locations used in the // original request. // - The location_indexes associated with all tasks and vehicles (both from the // original and new re-optimization input requests) will follow the updated list // of locations. // // As a best practice: // // 1. Don't provide the locations input when re-optimizing, if the original set // contains all the required location coordinates. // // 2. If any new location coordinates are required for re-optimization, copy the // full, original location list and update it in the following manner before // adding it to the re-optimization input: // // 1. Ensure to not update the indexes of locations which just need to be // "modified". // // 2. Add new location coordinates towards the end of the list. Locations []string `json:"locations,omitzero"` // This section gathers information on modifications to the number of shipments or // their individual requirements for re-optimization. Any shipment from the // original solution not specified here will be re-planned without alteration // during the re-optimization process. ShipmentChanges OptimizationReOptimizeParamsShipmentChanges `json:"shipment_changes,omitzero"` // This section gathers information on modifications to the number of vehicles or // individual vehicle configurations for re-optimizing an existing solution. Any // vehicle from the original solution not specified here will be reused without // alteration during the re-optimization process. VehicleChanges OptimizationReOptimizeParamsVehicleChanges `json:"vehicle_changes,omitzero"` // contains filtered or unexported fields }
func (OptimizationReOptimizeParams) MarshalJSON ¶
func (r OptimizationReOptimizeParams) MarshalJSON() (data []byte, err error)
func (OptimizationReOptimizeParams) URLQuery ¶
func (r OptimizationReOptimizeParams) URLQuery() (v url.Values, err error)
URLQuery serializes OptimizationReOptimizeParams's query parameters as `url.Values`.
func (*OptimizationReOptimizeParams) UnmarshalJSON ¶
func (r *OptimizationReOptimizeParams) UnmarshalJSON(data []byte) error
type OptimizationReOptimizeParamsJobChanges ¶
type OptimizationReOptimizeParamsJobChanges struct { // An array of objects to collect the details of the new jobs to be added during // re-optimization. Each object represents one job. Please make sure the IDs // provided for new jobs are unique with respect to the IDs of the jobs in the // original request. Add []JobParam `json:"add,omitzero"` // An array of objects to collect the modified details of existing jobs used in the // original request. Each object represents one job. Please make sure all the job // IDs provided here are same as the ones in the original request. Modify []JobParam `json:"modify,omitzero"` // An array of job IDs to be removed when during re-optimization. All job IDs // provided must have been part of the original request. Remove []string `json:"remove,omitzero"` // contains filtered or unexported fields }
This section gathers information on modifications to the number of jobs or their individual requirements for re-optimization. Any job from the original solution not specified here will be re-planned without alteration during the re-optimization process.
func (OptimizationReOptimizeParamsJobChanges) MarshalJSON ¶
func (r OptimizationReOptimizeParamsJobChanges) MarshalJSON() (data []byte, err error)
func (*OptimizationReOptimizeParamsJobChanges) UnmarshalJSON ¶
func (r *OptimizationReOptimizeParamsJobChanges) UnmarshalJSON(data []byte) error
type OptimizationReOptimizeParamsShipmentChanges ¶
type OptimizationReOptimizeParamsShipmentChanges struct { // An array of objects to collect the details of the new shipments to be added // during re-optimization. Each object represents one shipment. Please make sure // the IDs provided for new shipments are unique with respect to the IDs of the // shipments in the original request. Add []ShipmentParam `json:"add,omitzero"` // An array of objects to collect the modified details of existing shipments used // in the original request. Each object represents one shipment. Please make sure // all the shipment IDs provided here are same as the ones in the original request. Modify []ShipmentParam `json:"modify,omitzero"` // An array of shipment IDs to be removed when during re-optimization. All shipment // IDs provided must have been part of the original request. Remove []string `json:"remove,omitzero"` // contains filtered or unexported fields }
This section gathers information on modifications to the number of shipments or their individual requirements for re-optimization. Any shipment from the original solution not specified here will be re-planned without alteration during the re-optimization process.
func (OptimizationReOptimizeParamsShipmentChanges) MarshalJSON ¶
func (r OptimizationReOptimizeParamsShipmentChanges) MarshalJSON() (data []byte, err error)
func (*OptimizationReOptimizeParamsShipmentChanges) UnmarshalJSON ¶
func (r *OptimizationReOptimizeParamsShipmentChanges) UnmarshalJSON(data []byte) error
type OptimizationReOptimizeParamsVehicleChanges ¶
type OptimizationReOptimizeParamsVehicleChanges struct { // An array of objects to collect the details of the new vehicles to be added for // re-optimization. Each object represents one vehicle. Please make sure the IDs // provided for new vehicles are unique with respect to the IDs of the vehicles in // the original request. Add []VehicleParam `json:"add,omitzero"` Modify VehicleParam `json:"modify,omitzero"` // An array of vehicle IDs to be removed when during re-optimization. All vehicle // IDs provided must have been part of the original request. Remove []string `json:"remove,omitzero"` // contains filtered or unexported fields }
This section gathers information on modifications to the number of vehicles or individual vehicle configurations for re-optimizing an existing solution. Any vehicle from the original solution not specified here will be reused without alteration during the re-optimization process.
func (OptimizationReOptimizeParamsVehicleChanges) MarshalJSON ¶
func (r OptimizationReOptimizeParamsVehicleChanges) MarshalJSON() (data []byte, err error)
func (*OptimizationReOptimizeParamsVehicleChanges) UnmarshalJSON ¶
func (r *OptimizationReOptimizeParamsVehicleChanges) UnmarshalJSON(data []byte) error
type OptimizationService ¶
type OptimizationService struct { Options []option.RequestOption DriverAssignment OptimizationDriverAssignmentService V2 OptimizationV2Service }
OptimizationService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewOptimizationService method instead.
func NewOptimizationService ¶
func NewOptimizationService(opts ...option.RequestOption) (r OptimizationService)
NewOptimizationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*OptimizationService) Compute ¶
func (r *OptimizationService) Compute(ctx context.Context, query OptimizationComputeParams, opts ...option.RequestOption) (res *OptimizationComputeResponse, err error)
Nextbillion.ai Optimization API computes and returns an optimized route between an origin and destination which have multiple stop points in between. With NextBillion.ai's Route Optimization API you get.
Optimized routing between way points ¶
Highly accurate ETAs with customized routes ¶
Roundtrip optimization with customized destinations ¶
A list of all parameters is specified in the next section.
func (*OptimizationService) ReOptimize ¶
func (r *OptimizationService) ReOptimize(ctx context.Context, params OptimizationReOptimizeParams, opts ...option.RequestOption) (res *PostResponse, err error)
Re-optimization
type OptimizationV2GetResultParams ¶
type OptimizationV2GetResultParams struct { // The unique ID that was returned on successful submission of the Optimization // POST request. ID string `query:"id,required" json:"-"` // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // contains filtered or unexported fields }
func (OptimizationV2GetResultParams) URLQuery ¶
func (r OptimizationV2GetResultParams) URLQuery() (v url.Values, err error)
URLQuery serializes OptimizationV2GetResultParams's query parameters as `url.Values`.
type OptimizationV2GetResultResponse ¶
type OptimizationV2GetResultResponse struct { // Returns the description of the optimization job as given in the input POST // optimization request. This field will not be present in the response if no // description was provided in the input request. Description string `json:"description"` // Returns the message in case of errors or failures, otherwise a blank string is // returned. Message string `json:"message"` // An object containing the details of the optimized routes. Result OptimizationV2GetResultResponseResult `json:"result"` // It indicates the overall status or result of the API request denoting whether // the operation was successful or did it encounter any errors. // // Any of "Ok", "Error". Status OptimizationV2GetResultResponseStatus `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Description respjson.Field Message respjson.Field Result respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (OptimizationV2GetResultResponse) RawJSON ¶
func (r OptimizationV2GetResultResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationV2GetResultResponse) UnmarshalJSON ¶
func (r *OptimizationV2GetResultResponse) UnmarshalJSON(data []byte) error
type OptimizationV2GetResultResponseResult ¶
type OptimizationV2GetResultResponseResult struct { // A custom code representing the status of the result. A code other than 0, // represents an internal error. In case of codes other than 0, please verify the // parameter values, constraints and locations. If the issue does not resolve, // please reach out to NextBillion at // [support@nextbillion.ai](mailto:support@nextbillion.ai). Code int64 `json:"code"` // Returns the error message for unfulfilled optimization jobs. This field will not // be present in the response in case there are no errors. Error string `json:"error"` // An array of objects containing the details of each route in the optimized // solution. Each object represents one route. Routes []OptimizationV2GetResultResponseResultRoute `json:"routes"` // Returns all the routing profiles used in the solution. If no routing profiles // were provided in the input or if the vehicles tagged to profiles were not used // in the solution, the "default" routing properties are returned. Default routing // properties are indicated by options.routing in the input. RoutingProfiles any `json:"routing_profiles"` // An object to describe the summarized result of the optimization request. This // object can be useful to quickly get an overview of the important result // parameters. Summary OptimizationV2GetResultResponseResultSummary `json:"summary"` // An array of objects containing the details of unassigned tasks in the optimized // solution. Each object represents one task. Unassigned []OptimizationV2GetResultResponseResultUnassigned `json:"unassigned"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Code respjson.Field Error respjson.Field Routes respjson.Field RoutingProfiles respjson.Field Summary respjson.Field Unassigned respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object containing the details of the optimized routes.
func (OptimizationV2GetResultResponseResult) RawJSON ¶
func (r OptimizationV2GetResultResponseResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationV2GetResultResponseResult) UnmarshalJSON ¶
func (r *OptimizationV2GetResultResponseResult) UnmarshalJSON(data []byte) error
type OptimizationV2GetResultResponseResultRoute ¶
type OptimizationV2GetResultResponseResultRoute struct { // Returns the capacity configuration of the vehicle that was used for this route. // This field would return either the vehicle's capacity or one of the // alternative_capacities provided in the input request. AdoptedCapacity []int64 `json:"adopted_capacity"` // Returns the cost of the route. The unit of cost type depends on the value of // travel_cost attribute in the optimization request. Cost int64 `json:"cost"` // Returns the total quantities, for each dimension (or unit), of deliveries // performed in the route. Please note that when both shipments and jobs are // provided, this field corresponds to the sum of quantities delivered as part of // the assigned shipments and jobs on the route. Delivery []int64 `json:"delivery"` // Return the description of the assigned vehicle. It would be the same as that // provided in the description field of vehicles part of the input POST // optimization request. Description string `json:"description"` // Returns the total distance of the route, in meters. Distance float64 `json:"distance"` // Returns the total drive duration of the route, in seconds. Duration int64 `json:"duration"` // Returns the geometry of this route encoded in polyline format. Geometry string `json:"geometry"` // Returns the custom information that was provided when the vehicle was // configured. This field would not be present for the vehicles that were not // provided with any metadata. Metadata any `json:"metadata"` // Returns the total quantities, for each dimension (or unit), of pickups performed // in the route. Please note that when both shipments and jobs are provided, this // field corresponds to the sum of quantities picked-up as part of the assigned // shipments and jobs on the route. Pickup []int64 `json:"pickup"` // Returns the sum of priorities of all tasks on the route. Priority int64 `json:"priority"` // Returns the profile of the vehicle. Profile string `json:"profile"` // Returns the revenue earned by fulfilling the task on this route. Please note // this field is present only when the revenue inputs are provided in the input, // otherwise it is not present in the response. Revenue int64 `json:"revenue"` // Returns the total service time spent on the tasks or depots on the route, in // seconds. Service int64 `json:"service"` // Returns the total setup time, in seconds, for the tasks assigned on the route. Setup int64 `json:"setup"` // This attribute contains the details of all the steps involved in the route. It // is an array of objects with each object representing one step. Steps []OptimizationV2GetResultResponseResultRouteStep `json:"steps"` // Returns the ID of the vehicle that was assigned to the route. The value type // will be same as the value type provided in the input request. Vehicle string `json:"vehicle"` // Returns the total vehicle overtime for the route, in seconds. Please note this // field is present only when there is a non-zero value for vehicle overtime, // otherwise it is not present in the response. VehicleOvertime int64 `json:"vehicle_overtime"` // Returns the total waiting time of the vehicle on the route, in seconds. WaitingTime int64 `json:"waiting_time"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { AdoptedCapacity respjson.Field Cost respjson.Field Delivery respjson.Field Description respjson.Field Distance respjson.Field Duration respjson.Field Geometry respjson.Field Metadata respjson.Field Pickup respjson.Field Priority respjson.Field Profile respjson.Field Revenue respjson.Field Service respjson.Field Setup respjson.Field Steps respjson.Field Vehicle respjson.Field VehicleOvertime respjson.Field WaitingTime respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (OptimizationV2GetResultResponseResultRoute) RawJSON ¶
func (r OptimizationV2GetResultResponseResultRoute) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationV2GetResultResponseResultRoute) UnmarshalJSON ¶
func (r *OptimizationV2GetResultResponseResultRoute) UnmarshalJSON(data []byte) error
type OptimizationV2GetResultResponseResultRouteStep ¶
type OptimizationV2GetResultResponseResultRouteStep struct { // Returns the ID of the task. The ID returned here are the same values that were // provided for the given task in the jobs or the shipments objects of the input // POST optimization request. // // **Note:** Since both integer and string value types are supported for job IDs, // the value type returned for this field will depend on the value type provided in // the input request. ID string `json:"id"` // Returns the time at which the vehicle arrives at the step location. If // time_windows is provided for the task it will be returned as an UNIX timestamp // expressed in seconds. When time_windows is not provided, it is returned as the // total duration, in seconds, elapsed since the start of the route. // // Please note it includes all the other durations as well (setup, service, // waiting). Arrival int64 `json:"arrival"` // For step type "start" or "end", this field returns the ID of the depot relevant // to that step. For "start" steps, the field will contain the ID of the depot from // which the vehicle commenced its journey. Conversely, for "end" steps, the field // will hold the ID of the depot where the vehicle concluded its trip. // // Please note that start_depot_ids or end_depot_ids input for the vehicle must be // configured to get this field in the response for respective step types in a // route. Depot string `json:"depot"` // Returns the description of this step. The description returned here are the same // values that were provided for the given task in the jobs or the shipments // objects of the input POST optimization request. Description string `json:"description"` // Returns the distance covered, in meters, from the start of the route and up // until the current step. // // Please note that the value of this parameter accumulates with each step. In case // , the travel_cost: air_distance, then the distance here represents straight line // distance. Distance int64 `json:"distance"` // Returns the total drive time, in seconds, from the start of the route up until // the start of the step. Please note that this value does not include any other // category of durations (service, wait, setup) and the value of this parameter // accumulates with each step. Duration int64 `json:"duration"` // Returns the amount of time, in seconds, by which the vehicle is late when // arriving at this step. Please note this field is present only when there is a // non-zero value for vehicle lateness, otherwise it is not present in the // response. LateBy string `json:"late_by"` // Returns the load on the vehicle after completing this step. In case of multiple // dimensions, loads of each type are returned by a matching number of elements in // the array. Load []int64 `json:"load"` // Returns the location coordinates of the step in the \[latitude, longitude\] // format. // // The index of this location is also returned by the location_index parameter. Location []float64 `json:"location"` // Returns the index (in the location array) of the location coordinates where the // step is performed. The index will always be in the range of \[0, length of // location array). // // Actual coordinates are also returned by the location parameter. LocationIndex int64 `json:"location_index"` // Returns the custom information that was provided when the given task (job / // pickup / delivery) was configured. This field would not be present for the tasks // that were not provided with any metadata. It will also be not present for // “start” and “end” steps. Metadata any `json:"metadata"` // In case this step is part of a task group, this field returns the location // coordinates of the point, in \[latitude, longitude\] format, which was used as a // common stop for all grouped tasks. ProjectedLocation []float64 `json:"projected_location"` // When a vehicle is configured to make multiple runs to the depot (via // max_depot_runs), this field returns the iteration to which the step belongs to. // Each run will begin with a "start" step from the depot's location and conclude // with an "end" step at either the last task's or the configured end location. Run int64 `json:"run"` // Returns the service time, in seconds, for the task when the step type is not // start or end. // // When the step type is start or end , the field also returns the service time, in // seconds, spent at the depot when if the vehicle is starting or completing the // trip at one of the depots. Service int64 `json:"service"` // Returns the setup time, in seconds, for the task. Setup int64 `json:"setup"` // Returns the coordinates after snapping the location of this step to a nearby // road. Please note that this field will not be available in the response when // custom duration or distance matrix were used for cost calculations. SnappedLocation []float64 `json:"snapped_location"` // Returns the type of the step. Its value will always be one of the following: // start, job, pickup, delivery, end. In case the type is start or end, steps // object will not have the id field. Type string `json:"type"` // Returns the wait time of the vehicle at this step, in seconds. WaitingTime int64 `json:"waiting_time"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Arrival respjson.Field Depot respjson.Field Description respjson.Field Distance respjson.Field Duration respjson.Field LateBy respjson.Field Load respjson.Field Location respjson.Field LocationIndex respjson.Field Metadata respjson.Field ProjectedLocation respjson.Field Run respjson.Field Service respjson.Field Setup respjson.Field SnappedLocation respjson.Field Type respjson.Field WaitingTime respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
This attribute contains the details of all the steps involved in the route. It is an array of objects with each object representing one step.
func (OptimizationV2GetResultResponseResultRouteStep) RawJSON ¶
func (r OptimizationV2GetResultResponseResultRouteStep) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationV2GetResultResponseResultRouteStep) UnmarshalJSON ¶
func (r *OptimizationV2GetResultResponseResultRouteStep) UnmarshalJSON(data []byte) error
type OptimizationV2GetResultResponseResultSummary ¶
type OptimizationV2GetResultResponseResultSummary struct { // Returns the total cost of all the routes returned in the solution. The unit of // cost type depends on the value of travel_cost attribute in the optimization // request. Cost int64 `json:"cost"` // Returns the sum of all quantities that were delivered in the optimized solution. // If quantities of different dimensions were delivered, then a matching number of // elements is returned in the delivery array. // // Please note that when both shipments and jobs are provided, this field // corresponds to the sum of quantities delivered as part of all the assigned // shipments and jobs . Delivery []int64 `json:"delivery"` // Returns the total distance of all routes, in meters. It is equal to the sum of // distances of individual routes. Distance float64 `json:"distance"` // Returns the total drive time, in seconds, needed to cover all routes. Please // note that it does not include the service, setup or the waiting durations // elapsed on these routes. Duration int64 `json:"duration"` // Returns the total number of tasks across all routes that failed to start within // their scheduled time windows. NumLateVisits int64 `json:"num_late_visits"` // Returns the sum of all quantities that were picked-up in the optimized solution. // If quantities of different dimensions were picked-up, then a matching number of // elements is returned in the pickup array. // // Please note that when both shipments and jobs are provided, this field // corresponds to the sum of quantities picked-up as part of all the assigned // shipments and jobs . Pickup []int64 `json:"pickup"` // Returns the sum of priorities of all tasks that were assigned. Priority int64 `json:"priority"` // Returns the revenue earned by completing all the assigned tasks. Overall profit // earned by following the suggested route plan can be inferred by subtracting the // cost of the solution from the reported revenue. Revenue int64 `json:"revenue"` // Returns the total number of routes in the solution. Routes int64 `json:"routes"` // Returns the total service time, in seconds, for all the routes in the solution. // It is equal to the sum of service time of individual tasks that were assigned // and the time spent loading/unloading items at designated depots by all vehicles. Service int64 `json:"service"` // Returns the total setup time, in seconds, of all assigned tasks. It is equal to // the sum of setup time of individual tasks that were assigned. Setup int64 `json:"setup"` // Returns the total duration, in seconds, that tasks across all routes were // delayed from starting after their scheduled time windows had passed. TotalVisitLateness int64 `json:"total_visit_lateness"` // Returns the number of unfulfilled tasks in the solution. Unassigned int64 `json:"unassigned"` // Returns the sum of durations spent waiting, in seconds, by vehicles on all // routes. WaitingTime int64 `json:"waiting_time"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Cost respjson.Field Delivery respjson.Field Distance respjson.Field Duration respjson.Field NumLateVisits respjson.Field Pickup respjson.Field Priority respjson.Field Revenue respjson.Field Routes respjson.Field Service respjson.Field Setup respjson.Field TotalVisitLateness respjson.Field Unassigned respjson.Field WaitingTime respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object to describe the summarized result of the optimization request. This object can be useful to quickly get an overview of the important result parameters.
func (OptimizationV2GetResultResponseResultSummary) RawJSON ¶
func (r OptimizationV2GetResultResponseResultSummary) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationV2GetResultResponseResultSummary) UnmarshalJSON ¶
func (r *OptimizationV2GetResultResponseResultSummary) UnmarshalJSON(data []byte) error
type OptimizationV2GetResultResponseResultUnassigned ¶
type OptimizationV2GetResultResponseResultUnassigned struct { // Returns the ID of the unassigned task. The ID returned is the same as that // provided for the given task in the jobs or the shipments part in the input POST // optimization request. // // **Note:** Since both integer and string value types are supported for task IDs, // the value type returned for this field will depend on the value type provided in // the input request for the unassigned task. ID string `json:"id"` // Returns the location of the unassigned tasks in the \[latitude, longitude\] // format. Location []float64 `json:"location"` // Returns the cost of outsourcing the task. This is the same value as provided in // the input. The field is present only if a outsourcing_cost was provided for the // unassigned task. OutsourcingCost int64 `json:"outsourcing_cost"` // Returns the most likely reason due to which the task remained unassigned. The // optimization service can capture the following causes of tasks remaining // unassigned, among others: // // - unmatched skills of the tasks // - insufficient capacity of vehicle to accommodate the tasks // - time_window requirements of the tasks or the vehicles // - violation of vehicle’s max_activity_waiting_time constraint // - violation of vehicle’s max_tasks or max_stops constraints // - violation of vehicle’s max_distance or max_travel_time constraints // - task unassigned due to zone constraints // - task unassigned due to depot constraints // - task unassigned due to load type incompatibility constraints // - task unassigned due to max time in vehicle constraint // - task unassigned as it is unprofitable // - task unassigned due to low outsourcing cost // - task unassigned due to infeasible conditions specified in relations attribute Reason string `json:"reason"` // Returns the type of the task that was unassigned. Will always belong to one of // job, pickup, or delivery. Type string `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Location respjson.Field OutsourcingCost respjson.Field Reason respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (OptimizationV2GetResultResponseResultUnassigned) RawJSON ¶
func (r OptimizationV2GetResultResponseResultUnassigned) RawJSON() string
Returns the unmodified JSON received from the API
func (*OptimizationV2GetResultResponseResultUnassigned) UnmarshalJSON ¶
func (r *OptimizationV2GetResultResponseResultUnassigned) UnmarshalJSON(data []byte) error
type OptimizationV2GetResultResponseStatus ¶
type OptimizationV2GetResultResponseStatus string
It indicates the overall status or result of the API request denoting whether the operation was successful or did it encounter any errors.
const ( OptimizationV2GetResultResponseStatusOk OptimizationV2GetResultResponseStatus = "Ok" OptimizationV2GetResultResponseStatusError OptimizationV2GetResultResponseStatus = "Error" )
type OptimizationV2Service ¶
type OptimizationV2Service struct {
Options []option.RequestOption
}
OptimizationV2Service contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewOptimizationV2Service method instead.
func NewOptimizationV2Service ¶
func NewOptimizationV2Service(opts ...option.RequestOption) (r OptimizationV2Service)
NewOptimizationV2Service generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*OptimizationV2Service) GetResult ¶
func (r *OptimizationV2Service) GetResult(ctx context.Context, query OptimizationV2GetResultParams, opts ...option.RequestOption) (res *OptimizationV2GetResultResponse, err error)
Flexible GET
func (*OptimizationV2Service) Submit ¶
func (r *OptimizationV2Service) Submit(ctx context.Context, params OptimizationV2SubmitParams, opts ...option.RequestOption) (res *PostResponse, err error)
Flexible POST
type OptimizationV2SubmitParams ¶
type OptimizationV2SubmitParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // The locations object is used to define all the locations that will be used // during the optimization process. Read more about this attribute in the // [Location Object](#location-object) section. Locations OptimizationV2SubmitParamsLocations `json:"locations,omitzero,required"` // The vehicles attribute describes the characteristics and constraints of the // vehicles that will be used for fulfilling the tasks. Read more about this // attribute in the [Vehicle Object](#vehicle-object) section. Vehicles []VehicleParam `json:"vehicles,omitzero,required"` // Define the optimization job using any custom message. This description is // returned as is in the response. Description param.Opt[string] `json:"description,omitzero"` // The previous optimization request id used to retrieve solution for // reoptimization ExistingSolutionID param.Opt[string] `json:"existing_solution_id,omitzero"` // An array of arrays to denote the user-defined costs of traveling between each // pair of geographic coordinates mentioned in the location array. The number of // arrays should be equal to the number of coordinate points mentioned in the // location array and each array should contain the same number of elements as // well. Please note that cost_matrix is effective only when // travel_cost=customized. Read more about this attribute in the // [Custom Cost Matrix](#custom-cost-matrix) section. CostMatrix [][]int64 `json:"cost_matrix,omitzero"` // depots object is used to collect the details of a depot. Depots can be used as a // starting point and/or ending point for the routes and vehicles. They also can be // used to fulfil pickup and delivery typejobs . The loads which are to be // delivered at task locations will be picked from depots and loads picked-up from // task locations will be delivered back to the depots. A depot can be configured // using the following fields: Depots []OptimizationV2SubmitParamsDepot `json:"depots,omitzero"` // An array of arrays to denote the user-defined distances, in meters, for // travelling between each pair of geographic coordinates mentioned in the location // array. When this input is provided, actual distances between the locations will // be ignored in favor of the values provided in this input for any distance // calculations during the optimization process. The values provided here will also // be used for cost calculations when travel_cost is “distance”. // // The number of arrays in the input should be equal to the number of coordinate // points mentioned in the location array and each array, in turn, should contain // the same number of elements as well. // // **Note:** // // - duration_matrix is mandatory when usingdistance_matrix. // - When using distance_matrix route geometry will not be available in the // optimized solution. DistanceMatrix [][]int64 `json:"distance_matrix,omitzero"` // An array of arrays to denote the user-defined durations, in seconds, for // travelling between each pair of geographic coordinates mentioned in the location // array. When this input is provided, actual durations between the locations will // be ignored in favor of the values provided in the matrix for any ETA // calculations during the optimization process. The values provided in the matrix // will also be used for cost calculations when travel_cost is “duration”. // // The number of arrays in the input should be equal to the number of coordinate // points mentioned in the location array and each array, in turn, should contain // the same number of elements as well. // // Please note that, unlike distance_matrix, duration_matrix can be used // independently in following cases: // // - when travel_cost is “duration” // - when travel_cost is “customized” and a cost_matrix is provided // // Also, the route geometry will not be available in the optimized solution when // using duration_matrix. DurationMatrix [][]int64 `json:"duration_matrix,omitzero"` // jobs object is used to collect the details of a particular job or task that // needs to be completed as part of the optimization process. Each job can have // either a pickup or delivery step, but not both. Read more about this attribute // in the [Job Object](#job-object) section. // // Please note that either the jobs or the shipments attribute should be specified // to build a valid request. Jobs []JobParam `json:"jobs,omitzero"` // It represents the set of options that can be used to configure optimization // algorithms so that the solver provides a solution that meets the desired // business objectives. Options OptimizationV2SubmitParamsOptions `json:"options,omitzero"` // relations attribute is an array of individual relation objects. type parameter // and steps object are mandatory when using this attribute. // // Please note: // // - The soft constraints are **not** effective when using the relations attribute. // - In case a given relation can't be satisfied, the optimizer will flag all the // tasks involved in that "relation" as unassigned. // // Read more about this attribute in the [Relations Object](#relations-object) // section. Relations []OptimizationV2SubmitParamsRelation `json:"relations,omitzero"` // The shipments object is used to collect the details of shipments that need to be // completed as part of the optimization process. // // Each shipment should have a pickup and the corresponding delivery step. // // Please note that either the jobs or the shipments attribute should be specified // to build a valid request. Shipments []ShipmentParam `json:"shipments,omitzero"` // This attribute is related to the re-optimization feature. It allows for the // previous optimization result to be provided in case new orders are received and // the solution needs to be re-planned. The solution attribute should contain the // same routes as the previous optimization result. solution attribute is an array // of objects with each object corresponding to one route. Solution []OptimizationV2SubmitParamsSolution `json:"solution,omitzero"` // unassigned attribute is related to the re-optimization feature. This attribute // should contain the tasks that were not assigned during an earlier optimization // process. Please note that the unassigned part in request should be consistent // with the unassigned part in the previous optimization result. // // Users can reduce the number of unassigned tasks in the re-optimized solution, by // following strategies such as: // // - Extending the time windows for vehicles or tasks to give more flexibility // - Adding more vehicles to the optimization problem // - Adjusting the priority of different tasks to balance the workload more evenly // - Modifying other constraints or parameters to make the problem more solvable // // Ultimately, the goal is to minimize the number of unassigned tasks while still // meeting all the necessary constraints and objectives. Unassigned OptimizationV2SubmitParamsUnassigned `json:"unassigned,omitzero"` // An array of objects to specify geometry of all the zones involved. Each object // corresponds to a single zone. A valid zone can be a // [geoJSON](https://datatracker.ietf.org/doc/html/rfc7946#page-9) polygon, // multi-polygon or a geofence created using // [NextBillion.ai](http://NextBillion.ai)’s // [Geofence API](https://docs.nextbillion.ai/docs/tracking/api/geofence). // // # Please note that // // - Each zone should have a geometry specified either throughgeometry or through // the geofence_id parameter. // - When zone IDs are not provided for individual tasks (jobs or shipments) then // the API will automatically allocate zones based on the task’s geolocation and // the geometries of the zones provided here. Otherwise, if the zone IDs are // provided while configuring individual tasks, the zone IDs will override the // geometries provided here. Zones []OptimizationV2SubmitParamsZone `json:"zones,omitzero"` // contains filtered or unexported fields }
func (OptimizationV2SubmitParams) MarshalJSON ¶
func (r OptimizationV2SubmitParams) MarshalJSON() (data []byte, err error)
func (OptimizationV2SubmitParams) URLQuery ¶
func (r OptimizationV2SubmitParams) URLQuery() (v url.Values, err error)
URLQuery serializes OptimizationV2SubmitParams's query parameters as `url.Values`.
func (*OptimizationV2SubmitParams) UnmarshalJSON ¶
func (r *OptimizationV2SubmitParams) UnmarshalJSON(data []byte) error
type OptimizationV2SubmitParamsDepot ¶
type OptimizationV2SubmitParamsDepot struct { // Provide an unique ID for the depot. The IDs are case sensitive. ID string `json:"id,required"` // Specify the index of coordinates (in the location array) denoting the depot’s // location. The valid range of values is \[0, length of location array). If the // location index exceeds the count of input locations in the location array, the // API will report an error. // // Please note the location_index is mandatory when using the depots object. LocationIndex int64 `json:"location_index,required"` // Add a custom description for the depot. Description param.Opt[string] `json:"description,omitzero"` // Specify the time duration, in seconds, needed to load or unload the vehicle each // time it starts or arrives at a depot, respectively. Default value is 0. Service param.Opt[int64] `json:"service,omitzero"` // Specify the time-windows during which the depot is operational and allows // vehicles to be loaded / unloaded. The time periods should be expressed as a UNIX // timestamp in seconds. // // Please note that: // // - Multiple time-windows can be provided but those time windows should not // overlap with each other. // - Time windows should always be specified in the format of \[start_timestamp, // end_timestamp\]. // - Depot's time-windows are ineffective used when max_activity_waiting_time is // specified in the input. // - Using relations along with depot time-window is not allowed and the service // will return an error. TimeWindows [][]int64 `json:"time_windows,omitzero"` // contains filtered or unexported fields }
The properties ID, LocationIndex are required.
func (OptimizationV2SubmitParamsDepot) MarshalJSON ¶
func (r OptimizationV2SubmitParamsDepot) MarshalJSON() (data []byte, err error)
func (*OptimizationV2SubmitParamsDepot) UnmarshalJSON ¶
func (r *OptimizationV2SubmitParamsDepot) UnmarshalJSON(data []byte) error
type OptimizationV2SubmitParamsLocations ¶
type OptimizationV2SubmitParamsLocations struct { // Indicate all the location coordinates that will be used during optimization. The // coordinates should be specified in the format “latitude, longitude”. It is // recommended to avoid adding duplicate location coordinates to this array. In // case there are multiple tasks at the same location, users can repeat the index // of the location while configuring all such tasks. // // Please use this array to determine the index of a location when setting the // location_index parameter in jobs, shipments, vehicles or other parts of the // request. The length of this array determines the valid values for location_index // parameter. Location []string `json:"location,omitzero,required"` // A unique ID for the set of locations. It should be a positive integer. ID param.Opt[int64] `json:"id,omitzero"` // Describe if the location is curbside. An array of strings indicates the side of // the road from which to approach the location in the calculated route. If // provided, the number of approaches must be equal to the number of locations. // However, you can skip a coordinate and show its position in the list using “” // (empty string). Please note these values are case-sensitive. // // Any of "unrestricted", "curb", `""(empty string)`. Approaches []string `json:"approaches,omitzero"` // contains filtered or unexported fields }
The locations object is used to define all the locations that will be used during the optimization process. Read more about this attribute in the [Location Object](#location-object) section.
The property Location is required.
func (OptimizationV2SubmitParamsLocations) MarshalJSON ¶
func (r OptimizationV2SubmitParamsLocations) MarshalJSON() (data []byte, err error)
func (*OptimizationV2SubmitParamsLocations) UnmarshalJSON ¶
func (r *OptimizationV2SubmitParamsLocations) UnmarshalJSON(data []byte) error
type OptimizationV2SubmitParamsOptions ¶
type OptimizationV2SubmitParamsOptions struct { // This attribute defines both the soft and hard constraints for an optimization // job. // // Soft constraints are constraints that do not necessarily have to be satisfied, // but the optimization algorithm will try to satisfy them as much as possible. // Whereas the hard constraints are the constraints that will not be violated by // the solver. Users can use multiple constraints together. // // Please note that soft constraints are ineffective when using relations attribute // in a request. The hard constraint, max_activity_waiting_time, is effective only // when relation type is in_same_route and ineffective for all other types. Constraint OptimizationV2SubmitParamsOptionsConstraint `json:"constraint,omitzero"` // Set grouping rules for the tasks and routes. // // - Use order_grouping to group nearby tasks // - Use route_grouping to control route sequencing. Grouping OptimizationV2SubmitParamsOptionsGrouping `json:"grouping,omitzero"` // This attribute is used to configure the objective of the optimization job. Objective OptimizationV2SubmitParamsOptionsObjective `json:"objective,omitzero"` // This attribute is used to define the routing configurations for the optimization // job. Routing OptimizationV2SubmitParamsOptionsRouting `json:"routing,omitzero"` // contains filtered or unexported fields }
It represents the set of options that can be used to configure optimization algorithms so that the solver provides a solution that meets the desired business objectives.
func (OptimizationV2SubmitParamsOptions) MarshalJSON ¶
func (r OptimizationV2SubmitParamsOptions) MarshalJSON() (data []byte, err error)
func (*OptimizationV2SubmitParamsOptions) UnmarshalJSON ¶
func (r *OptimizationV2SubmitParamsOptions) UnmarshalJSON(data []byte) error
type OptimizationV2SubmitParamsOptionsConstraint ¶
type OptimizationV2SubmitParamsOptionsConstraint struct { // This is a hard constraint which specifies the maximum waiting time, in seconds, // for each step. It ensures that the vehicles do not have unreasonable wait times // between jobs or shipments. This feature is useful for use cases where avoiding // long wait times between jobs or shipments is a primary concern. // // Please note that the waiting time constraint applies to all tasks in the // optimization request, ensuring that no single task exceeds the specified maximum // waiting time. When being used together with relations attribute, this parameter // is effective only for in_same_route relation type. MaxActivityWaitingTime param.Opt[int64] `json:"max_activity_waiting_time,omitzero"` // This is a soft constraint for vehicle overtime. Overtime is defined as the time // that a vehicle spends to complete a set of jobs after its time window has ended. // max_vehicle_overtime attribute specifies the maximum amount of overtime a // vehicle can have, in seconds. If a vehicle’s overtime exceeds this value, it // will be considered a violation of this constraint. // // Please note that this constraint applies to all vehicles in the optimization // request. MaxVehicleOvertime param.Opt[int64] `json:"max_vehicle_overtime,omitzero"` // This is a soft constraint for permissible delay, in seconds, to complete a job // or shipment after its time window is over. If a job or shipment’s lateness // exceeds this value, it will be considered a violation of this constraint. // // Please note that this constraint applies to all tasks in the optimization // request. In case lateness duration needs to be applied for individual tasks, // please use the max_visit_lateness parameter under jobs and shipments MaxVisitLateness param.Opt[int64] `json:"max_visit_lateness,omitzero"` // contains filtered or unexported fields }
This attribute defines both the soft and hard constraints for an optimization job.
Soft constraints are constraints that do not necessarily have to be satisfied, but the optimization algorithm will try to satisfy them as much as possible. Whereas the hard constraints are the constraints that will not be violated by the solver. Users can use multiple constraints together.
Please note that soft constraints are ineffective when using relations attribute in a request. The hard constraint, max_activity_waiting_time, is effective only when relation type is in_same_route and ineffective for all other types.
func (OptimizationV2SubmitParamsOptionsConstraint) MarshalJSON ¶
func (r OptimizationV2SubmitParamsOptionsConstraint) MarshalJSON() (data []byte, err error)
func (*OptimizationV2SubmitParamsOptionsConstraint) UnmarshalJSON ¶
func (r *OptimizationV2SubmitParamsOptionsConstraint) UnmarshalJSON(data []byte) error
type OptimizationV2SubmitParamsOptionsGrouping ¶
type OptimizationV2SubmitParamsOptionsGrouping struct { // When specified, routes are built taking into account the distance to the nearest // tasks. A higher proximity factor helps build routes with closer distances // between neighboring tasks, whereas a lower proximity factor helps build routes // with farther distances between neighboring tasks. As a result, the total number // of routes in the solution can vary based on the configured proximity factor - // more routes for higher factor and less routes with lower factor. // // In practice, such routes are more resistant to changes in task time windows: // when the time window is postponed, the driver can drive to the next task and // then return to the previous one. // // Please note that: // // - Valid values are \[0,10\] // - Default value is 0.0. // - It is recommended to use values lower values, in the range of \[0, 1\]. Higher // values may adversely impact the solution metrics due to higher number of // resulting routes: costs, mileage etc. ProximityFactor param.Opt[float64] `json:"proximity_factor,omitzero"` // Specify the criteria for grouping nearby tasks. The grouped tasks will be // treated as one stop by the optimizer and no cost would be incurred when driver // travels to different tasks within a group. Users can use this feature to model // use cases like multiple deliveries in a building complex or a condo. // // Please note that when the multiple tasks are grouped together, only one setup // time is considered for all such tasks. The durations of this setup time is equal // to maximum setup time among all grouped tasks, if provided. On the other hand, // the service time is applied to each task individually, as per the input provided // when configuring those tasks. OrderGrouping OptimizationV2SubmitParamsOptionsGroupingOrderGrouping `json:"order_grouping,omitzero"` // Specify the criteria for prioritising routes in a zone over routes that are part // of another zone. As a result, all the tasks falling in a zone will be fulfilled // before any tasks that are part of a different zone. RouteGrouping OptimizationV2SubmitParamsOptionsGroupingRouteGrouping `json:"route_grouping,omitzero"` // contains filtered or unexported fields }
Set grouping rules for the tasks and routes.
- Use order_grouping to group nearby tasks - Use route_grouping to control route sequencing.
func (OptimizationV2SubmitParamsOptionsGrouping) MarshalJSON ¶
func (r OptimizationV2SubmitParamsOptionsGrouping) MarshalJSON() (data []byte, err error)
func (*OptimizationV2SubmitParamsOptionsGrouping) UnmarshalJSON ¶
func (r *OptimizationV2SubmitParamsOptionsGrouping) UnmarshalJSON(data []byte) error
type OptimizationV2SubmitParamsOptionsGroupingOrderGrouping ¶
type OptimizationV2SubmitParamsOptionsGroupingOrderGrouping struct { // Specify the straight line distance, in meters, which will be used to identify // the tasks that should be grouped together. The default value is null. GroupingDiameter param.Opt[float64] `json:"grouping_diameter,omitzero"` // contains filtered or unexported fields }
Specify the criteria for grouping nearby tasks. The grouped tasks will be treated as one stop by the optimizer and no cost would be incurred when driver travels to different tasks within a group. Users can use this feature to model use cases like multiple deliveries in a building complex or a condo.
Please note that when the multiple tasks are grouped together, only one setup time is considered for all such tasks. The durations of this setup time is equal to maximum setup time among all grouped tasks, if provided. On the other hand, the service time is applied to each task individually, as per the input provided when configuring those tasks.
func (OptimizationV2SubmitParamsOptionsGroupingOrderGrouping) MarshalJSON ¶
func (r OptimizationV2SubmitParamsOptionsGroupingOrderGrouping) MarshalJSON() (data []byte, err error)
func (*OptimizationV2SubmitParamsOptionsGroupingOrderGrouping) UnmarshalJSON ¶
func (r *OptimizationV2SubmitParamsOptionsGroupingOrderGrouping) UnmarshalJSON(data []byte) error
type OptimizationV2SubmitParamsOptionsGroupingRouteGrouping ¶
type OptimizationV2SubmitParamsOptionsGroupingRouteGrouping struct { // Specify a non-negative value which indicates the penalty of crossing zones on // the same route. Default penalty value is 0. // // A higher value, for example 30.0, will place a higher penalty on zone violations // and hence push the optimizer to prefer a solution without any zone violations, // where all tasks in a single region are fulfilled before any tasks in other // regions or outside the current region. Whereas a lower value, say 5.0, will // place a lower penalty allowing the optimizer to return solutions which may have // few violations, say a couple of routing zone violations in our example. A still // lower penalty factor, like 1.0, may have several zone violations. PenaltyFactor param.Opt[float64] `json:"penalty_factor,omitzero"` // Specify the diameter of the zone, routes within which will be prioritised before // routes falling in other zones. Please note that zone_diameter is the straight // line distance, in meters. ZoneDiameter param.Opt[float64] `json:"zone_diameter,omitzero"` // Specify the source for creating boundaries of the routing zones. The default // value is “system_generated”. // // - system_generated - Routing zone boundaries are created automatically by the // optimizer based on the zone_diameter provided. // - custom_definition - Custom routing zone boundaries should be provided by the // user in input using the zones attribute. An error would be returned if the // zones attribute is null or missing in the input request. // // Any of "system_generated", "custom_definition". ZoneSource string `json:"zone_source,omitzero"` // contains filtered or unexported fields }
Specify the criteria for prioritising routes in a zone over routes that are part of another zone. As a result, all the tasks falling in a zone will be fulfilled before any tasks that are part of a different zone.
func (OptimizationV2SubmitParamsOptionsGroupingRouteGrouping) MarshalJSON ¶
func (r OptimizationV2SubmitParamsOptionsGroupingRouteGrouping) MarshalJSON() (data []byte, err error)
func (*OptimizationV2SubmitParamsOptionsGroupingRouteGrouping) UnmarshalJSON ¶
func (r *OptimizationV2SubmitParamsOptionsGroupingRouteGrouping) UnmarshalJSON(data []byte) error
type OptimizationV2SubmitParamsOptionsObjective ¶
type OptimizationV2SubmitParamsOptionsObjective struct { // Choose where the optimizer should schedule the driver’s wait time. When set to // true the driver waits at the location of the task until its time window allows // him to start the task. When set to false the driver waits at the location of the // previous task and starts driving only at such a time that makes him arrive at // the next task location in time to start the task as soon as he reaches. AllowEarlyArrival param.Opt[bool] `json:"allow_early_arrival,omitzero"` // Specify whether to minimize the number of depots used in optimization routes. MinimiseNumDepots param.Opt[bool] `json:"minimise_num_depots,omitzero"` // Specify the number of seconds within which the optimizer should ideally solve // the optimization request. // // Please note that: // // - In case the specified time limit is not enough to generate a solution for a // given problem set, the optimizer will continue processing until it arrives at // a solution. // - It is recommended to specify a duration of at least 5-7 minutes in case the // input problem contains a large set of tasks or vehicles. SolvingTimeLimit param.Opt[int64] `json:"solving_time_limit,omitzero"` // The custom parameter is used to define special objectives apart from the simpler // travel cost minimization objectives. Custom OptimizationV2SubmitParamsOptionsObjectiveCustom `json:"custom,omitzero"` // If the input doesn’t include features of soft constraints, customized // objectives, re-optimization, relations, max travel cost or automatic fixed cost, // then user can select “optimal” to achieve a higher-speed and higher-quality // optimization. // // If “optimal” mode is unable to process some features in the input, then it will // still goes to “flexible” mode. // // Any of "flexible", "fast", "internal". SolverMode string `json:"solver_mode,omitzero"` // The travel_cost parameter specifies the type of cost used by the solver to // determine the routes. // // If the travel_cost parameter is set to distance, the solver will minimize the // total distance traveled by vehicles while determining a solution. This objective // would be useful in cases where the primary objective is to reduce fuel // consumption or travel expenses. // // If the travel_cost parameter is set to duration, the solver will minimize the // total time taken by the vehicles to complete all tasks while determining a // solution. This objective would be useful in cases where the primary objective is // to minimize completion time or maximize the number of orders fulfilled within a // given time window. // // If the travel_cost parameter is set to air_distance, the solver will try to // calculate the distance,in meters, between two points using the great-circle // distance formula (i.e., the shortest distance between two points on a sphere) // instead of the actual road distance. This would be useful in cases where the // delivery locations are far apart and the road distance between them is // significantly longer than the actual straight-line distance. For example, in // Drone Delivery services. // // If the travel_cost is set to customized the solver would use the custom cost // values provided by the user (in cost_matrix attribute) and prefer a solution // with lower overall cost. This enables the user to have greater control over the // routes preferred by the solver and hence the sequence in which the jobs are // completed. // // Any of "duration", "distance", "air_distance", "customized". TravelCost string `json:"travel_cost,omitzero"` // contains filtered or unexported fields }
This attribute is used to configure the objective of the optimization job.
func (OptimizationV2SubmitParamsOptionsObjective) MarshalJSON ¶
func (r OptimizationV2SubmitParamsOptionsObjective) MarshalJSON() (data []byte, err error)
func (*OptimizationV2SubmitParamsOptionsObjective) UnmarshalJSON ¶
func (r *OptimizationV2SubmitParamsOptionsObjective) UnmarshalJSON(data []byte) error
type OptimizationV2SubmitParamsOptionsObjectiveCustom ¶
type OptimizationV2SubmitParamsOptionsObjectiveCustom struct { // The type parameter accepts two inputs: // // - min: This type of customized objective will minimize the metric provided in // the value parameter. // - min-max: This type of customized objective will approximate an even // distribution of the metric provided in the value parameter, among all the // routes in solution. // // Please note that type is mandatory only when using custom attribute. // // Any of "min", "min-max". Type string `json:"type,omitzero,required"` // The value parameter accepts four inputs, two of them are valid for min type and // other two are valid for min-max type custom objective. Let’s look at the values // for min type objective: // // - vehicles: Solver will minimize the number of vehicles used in the solution. // - completion_time: Solver will minimize the total time taken to complete all // tasks. // // The next set of values are acceptable when type is set to min-max. // // - tasks: Solver will evenly distribute the tasks on each route. // - travel_cost: Solver will assign tasks such that the traveling cost of each // route is within a close range of other routes. The travel cost metric // considered here is the one set using objective.travel_cost . // // Please note that value is mandatory only when using custom attribute. The above // values provide flexibility to tune the optimization algorithm to fulfill // practical objectives beyond the relatively simpler time or distance minimization // approaches. // // Any of "vehicles", "completion_time", "travel_cost", "tasks". Value string `json:"value,omitzero,required"` // contains filtered or unexported fields }
The custom parameter is used to define special objectives apart from the simpler travel cost minimization objectives.
The properties Type, Value are required.
func (OptimizationV2SubmitParamsOptionsObjectiveCustom) MarshalJSON ¶
func (r OptimizationV2SubmitParamsOptionsObjectiveCustom) MarshalJSON() (data []byte, err error)
func (*OptimizationV2SubmitParamsOptionsObjectiveCustom) UnmarshalJSON ¶
func (r *OptimizationV2SubmitParamsOptionsObjectiveCustom) UnmarshalJSON(data []byte) error
type OptimizationV2SubmitParamsOptionsRouting ¶
type OptimizationV2SubmitParamsOptionsRouting struct { // Specify if crossing an international border is allowed for operations near // border areas. When set to false, the API will prohibit any routes crossing // international borders. When set to true, the service will return routes which // cross the borders between countries, if required for the given set locations // // This feature is available in North America region only. Please get in touch with // [support@nextbillion.ai](mailto:support@nextbillion.ai) to enquire/enable other // areas. CrossBorder param.Opt[bool] `json:"cross_border,omitzero"` // Specify if the optimizer should cache the matrix result set (containing ETAs and // distances) for the given set of locations in the request. Once the results are // cached, the optimizer can use it during the next 60 mins if exactly the same set // of locations are provided again. Please note that if a cached result is // retrieved, the timer is reset and that result will be available for another 60 // mins. // // If the users want to regenerate the result set, they can set this parameter to // true and optimizer will not use the cached results. // // This feature is helpful in expediting the optimization process and generate // results quickly. It also helps users to quickly simulate route plans for // different combinations of constraints for a given set of locations. DisableCache param.Opt[bool] `json:"disable_cache,omitzero"` // Specify the general time when the job needs to be carried out. The time should // be expressed as an UNIX timestamp in seconds format. The solver will take into // account the general traffic conditions at the given time to determine the routes // and their ETAs. TrafficTimestamp param.Opt[int64] `json:"traffic_timestamp,omitzero"` // Specify the total load per axle (including the weight of trailers and shipped // goods) of the truck, in tonnes. When used, the optimizer will use only those // routes which are legally allowed to carry the load specified per axle. // // Please note this parameter is effective only when mode=truck. TruckAxleLoad param.Opt[float64] `json:"truck_axle_load,omitzero"` // Specify the truck dimensions, in centimeters, in the format of // “height,width,length”. Please note that this parameter is effective only when // mode=truck. TruckSize param.Opt[string] `json:"truck_size,omitzero"` // Specify the truck weight including the trailers and shipped goods, in kilograms. // Please note that this parameter is effective only when mode=truck. TruckWeight param.Opt[int64] `json:"truck_weight,omitzero"` // Any of "taxi", "hov". Allow []string `json:"allow,omitzero"` // Specify the type of objects/maneuvers that the route should avoid. // // Please note that: // // - The values are case-sensitive. // - When using avoid:bbox feature, users need to specify the boundaries of the // bounding box to be avoided. Multiple bounding boxes can be provided // simultaneously. Please note that bounding box is a hard filter and if it // blocks all possible routes between given locations, a 4xx error is returned. // Mention the bounding box boundaries in the following format: bbox: // min_latitude,min_longitude,max_latitude,max_longitude. // - When using avoid=sharp_turn, the range of allowed turn angles is \[120,240\] // in the clockwise direction from the current road. Any roads with turn angles // outside the range will be avoided. // - If none is provided along with other values, an error is returned as a valid // route is not feasible. // // Any of "toll", "highway", "bbox", "left_turn", "right_turn", "sharp_turn", // "uturn", "service_road", "ferry", "none ". Avoid []string `json:"avoid,omitzero"` // Use this parameter to apply a single speed value for all ETA and drive time // calculations. In case, the travel_cost is set to duration then setting this // parameter also impacts the cost of the solution. // // Any of "avgspeed". Context string `json:"context,omitzero"` // Specify the type of hazardous material being carried and the service will avoid // roads which are not suitable for the type of goods specified. Provide multiple // values separated by a comma , . // // Please note that this parameter is effective only when mode=truck. // // Any of "general", "circumstantial", "explosive", "harmful_to_water". HazmatType []string `json:"hazmat_type,omitzero"` // Define the traveling mode to be used for determining the optimized routes. // // Any of "car", "truck". Mode string `json:"mode,omitzero"` // Defines all the vehicle profiles. profiles is implemented as a dictionary of // objects where each profile name is the unique key and the associated value is an // object describing the routing properties of that profile. All routing properties // available in options.routing can be added as values for a given profile. // // Please note: // // - The routing properties configured using options.routing (and not part of any // \profiles\) are considered as default route settings i.e. they are applied to // vehicles which are not associated with any profile. // // - The default route settings are independent from those defined for any profiles // . Consequently, for vehicles which are tagged to a given profile, only the // routing properties configured for the given profile will apply. // // - If the "mode" is not specified for any profile, by default it is considered to // be car . // // - "default" is a reserved keyword and can not be used as the name for any custom // profile. // // - profiles can't be nested in other profiles. // // - The number of profiles, including default route settings, are limited to // // - 15, if 0 < number of location <= 100 // // - 6, if 100 < number of location <= 600, // // - 2, if 600 < number of location <= 1200, // // - 1, if number of location > 1200 // // Routing profiles attribute is useful for configuring fleets containing multiple // vehicles types. Check // [Routing Profiles](https://docs.nextbillion.ai/docs/optimization/api/route-optimization-flexible/tutorials/routing-profiles) // tutorial to learn more. Profiles any `json:"profiles,omitzero"` // contains filtered or unexported fields }
This attribute is used to define the routing configurations for the optimization job.
func (OptimizationV2SubmitParamsOptionsRouting) MarshalJSON ¶
func (r OptimizationV2SubmitParamsOptionsRouting) MarshalJSON() (data []byte, err error)
func (*OptimizationV2SubmitParamsOptionsRouting) UnmarshalJSON ¶
func (r *OptimizationV2SubmitParamsOptionsRouting) UnmarshalJSON(data []byte) error
type OptimizationV2SubmitParamsRelation ¶
type OptimizationV2SubmitParamsRelation struct { // The steps property specifies the tasks or steps that are part of the relation // and must be carried out in a manner defined in the type parameter. Please note // you can add any number of steps here, except when relation type is precedence // where only 2 tasks can be added. Steps []OptimizationV2SubmitParamsRelationStep `json:"steps,omitzero,required"` // Specifies the type of relation constraint. The following types are supported: // // - in_same_route: Ensures that all steps are covered in the same route in // solution. // - in_sequence: Ensures that all steps are in the same route and their sequence // matches the order specified in the steps field. Insertion of new steps between // the steps specified, is allowed. // - in_direct_sequence: Similar to in_sequence, but insertion of new steps is not // allowed in the final route. // - precedence: Restricts the travel time between the first step and second step. // If the precedence requirement cannot be satisfied, then the task specified at // the second step will not be assigned. Only 2 steps can be specified in a // single precedence type relations. Please use multiple precedence relations to // apply restrictions on more than 2 tasks. // // If the vehicle field is specified in the relations input, all steps will be // served by that particular vehicle. Otherwise, the route can be allocated to any // feasible vehicle. // // Please note that the type field is mandatory when using the relations object. // // Any of "in_same_route", "in_sequence", "in_direct_sequence", "precedence". Type string `json:"type,omitzero,required"` // **Deprecated! Please use the** vehicle **parameter to specify the vehicle ID.** // // Specifies the ID of the vehicle that would fulfil the steps. ID should be // consistent with input IDs provided in the vehicles object. ID param.Opt[int64] `json:"id,omitzero"` // This attribute is effective only when precedence type relation is used. // max_duration restricts the travel time of the vehicle to go from location of // first task to the location of second task specified in steps object. The unit // for this parameter is seconds. It accepts values greater than 0 only. // // Please note that max_duration is a hard constraint. Hence, if aggressive // durations are provided such that the second task cannot be reached within the // specified max_duration, it might be done before the first task (usually in case // of jobs) or remain un-assigned (usually in case of shipments). MaxDuration param.Opt[int64] `json:"max_duration,omitzero"` // This attribute is effective only when precedence type relation is used. Use // min_duration to enforce a minimum time-gap between the two tasks specified in // steps object. When specified, the second task will get completed after a gap of // min_duration with respect to the first task. The unit for this parameter is // seconds. // // Please note that min_duration is implemented as a soft constraint and it can be // violated in presence of other relation types. The optimizer will tend to provide // solutions where min_duration is not violated, but it is not guaranteed. MinDuration param.Opt[int64] `json:"min_duration,omitzero"` // Specifies the ID of the vehicle that would fulfill the steps. Providing the same // vehicle ID to multiple ‘relations’ is prohibited. The vehicle ID provided here // should be consistent with ID provided in the vehicles attribute. Vehicle param.Opt[string] `json:"vehicle,omitzero"` // contains filtered or unexported fields }
The properties Steps, Type are required.
func (OptimizationV2SubmitParamsRelation) MarshalJSON ¶
func (r OptimizationV2SubmitParamsRelation) MarshalJSON() (data []byte, err error)
func (*OptimizationV2SubmitParamsRelation) UnmarshalJSON ¶
func (r *OptimizationV2SubmitParamsRelation) UnmarshalJSON(data []byte) error
type OptimizationV2SubmitParamsRelationStep ¶
type OptimizationV2SubmitParamsRelationStep struct { // Specifies the type of the step. The start and end step types have to be the // first and last steps, respectively, in a relation. // // Please note that the type is mandatory when using the relations object. // // Any of "start", "end", "job", "pickup", "delivery". Type string `json:"type,omitzero,required"` // This represents the ID of the task and should be consistent with the input IDs // provided in the jobs or shipments objects for a given step. The id is required // for all steps other than start and end. ID param.Opt[string] `json:"id,omitzero"` // contains filtered or unexported fields }
The property Type is required.
func (OptimizationV2SubmitParamsRelationStep) MarshalJSON ¶
func (r OptimizationV2SubmitParamsRelationStep) MarshalJSON() (data []byte, err error)
func (*OptimizationV2SubmitParamsRelationStep) UnmarshalJSON ¶
func (r *OptimizationV2SubmitParamsRelationStep) UnmarshalJSON(data []byte) error
type OptimizationV2SubmitParamsSolution ¶
type OptimizationV2SubmitParamsSolution struct { // Specify the cost of the route. Cost int64 `json:"cost,required"` // Describe the steps in this route. Steps []OptimizationV2SubmitParamsSolutionStep `json:"steps,omitzero,required"` // Specify the ID of the vehicle that was assigned to the route. This field is // mandatory when using the solution attribute and providing an empty string would // result in error. The IDs are case-sensitive. // // **Note:** Since the vehicles can be configured using either a string or an // integer ID, please ensure that the same value type is provided for this field as // was used in the original request. Vehicle string `json:"vehicle,required"` // Specify the description of the assigned vehicle. Description param.Opt[string] `json:"description,omitzero"` // Specify the total distance of the route, in meters. Distance param.Opt[int64] `json:"distance,omitzero"` // Specify the total drive duration of the route, in seconds. Duration param.Opt[int64] `json:"duration,omitzero"` // Specify the geometry of this route encoded in polyline format. Geometry param.Opt[string] `json:"geometry,omitzero"` // Specify the sum of priorities of all tasks on the route. Priority param.Opt[int64] `json:"priority,omitzero"` // Specify the total service time for the route, in seconds. Service param.Opt[int64] `json:"service,omitzero"` // Specify the total set-up duration, in seconds, needed for the tasks on the // route. Setup param.Opt[int64] `json:"setup,omitzero"` // Specify the total waiting time of the vehicle on the route, in seconds. WaitingTime param.Opt[int64] `json:"waiting_time,omitzero"` // Specify the total quantities, for each dimension (or unit), of deliveries // performed in the route. Delivery []int64 `json:"delivery,omitzero"` // Specify the total quantities, for each dimension (or unit), of pickups performed // in the route. Pickup []int64 `json:"pickup,omitzero"` // contains filtered or unexported fields }
The properties Cost, Steps, Vehicle are required.
func (OptimizationV2SubmitParamsSolution) MarshalJSON ¶
func (r OptimizationV2SubmitParamsSolution) MarshalJSON() (data []byte, err error)
func (*OptimizationV2SubmitParamsSolution) UnmarshalJSON ¶
func (r *OptimizationV2SubmitParamsSolution) UnmarshalJSON(data []byte) error
type OptimizationV2SubmitParamsSolutionStep ¶
type OptimizationV2SubmitParamsSolutionStep struct { // The ID of the step. This field is mandatory for all steps except for start and // end type. // // Please note that the ID provided here must also be present in either the jobs or // the shipments objects. // // **Note:** We have modified the data type of this field. The latest change is // backward compatible and both integer and string type IDs are valid for this // field, as long as they match the IDs of the jobs or shipments already // configured. ID string `json:"id,required"` // Specify the time at which the vehicle arrives at the step location. If // time_windows is provided, then arrival will be an UNIX timestamp expressed in // seconds. Otherwise, it will be the total duration, in seconds, elapsed since the // start of the route. // // Please note that arrival is mandatory when using the solution object. Arrival int64 `json:"arrival,required"` // Specify the type of the step. // // Any of "start", "end", "job", "pickup", "delivery", "break". Type string `json:"type,omitzero,required"` // Specify the description of this step. Description param.Opt[string] `json:"description,omitzero"` // Specify the distance covered, in meters, from the start of the route up until // the current step. // // Please note that the value of this parameter accumulates with each step. In case // , the travel_cost: air_distance, then the distance here should be the straight // line distance. Distance param.Opt[int64] `json:"distance,omitzero"` // Specify the drive time, in seconds, from the start of the route up until the // start of the step. Please note that the value of this parameter accumulates with // each step. Duration param.Opt[int64] `json:"duration,omitzero"` // Specify the index (in the location array) of the location coordinates where the // step is performed. The valid range of values is \[0, length of location array). // Alternatively, location property can also be used to specify the location. // // Please note that either location or location_index is mandatory. LocationIndex param.Opt[int64] `json:"location_index,omitzero"` // Specify the service time, in seconds, at this step. Service param.Opt[int64] `json:"service,omitzero"` // Specify the set-up duration, in seconds, needed at the step. Setup param.Opt[int64] `json:"setup,omitzero"` // Specify the wait time of the vehicle at this step, in seconds. WaitingTime param.Opt[int64] `json:"waiting_time,omitzero"` // Specify the load on the vehicle after completing this step. In case of multiple // dimensions, please specify the load for each type. Load []int64 `json:"load,omitzero"` // Specify the location coordinates of the step in the \[latitude, longitude\] // format. Alternatively, location_index property can also be used to specify the // location of the step. // // Please note that either location or location_index is mandatory. Location []float64 `json:"location,omitzero"` // contains filtered or unexported fields }
Describe details about a step of a route
The properties ID, Arrival, Type are required.
func (OptimizationV2SubmitParamsSolutionStep) MarshalJSON ¶
func (r OptimizationV2SubmitParamsSolutionStep) MarshalJSON() (data []byte, err error)
func (*OptimizationV2SubmitParamsSolutionStep) UnmarshalJSON ¶
func (r *OptimizationV2SubmitParamsSolutionStep) UnmarshalJSON(data []byte) error
type OptimizationV2SubmitParamsUnassigned ¶
type OptimizationV2SubmitParamsUnassigned struct { // Specify the unassigned job IDs from the previous optimization result. Please // note the IDs should also be present in the jobs part of the input. // // **Note:** We have modified the data type of this field. However, the latest // change is backward compatible and both integer and string type job IDs are valid // for this field, as long as they match the IDs of the jobs already configured. // Providing mixed value types in the array, will lead to an error. Jobs []string `json:"jobs,omitzero"` // Specify the unassigned shipment pickup & delivery IDs from the previous // optimization result. Both the pickup & delivery steps of a shipment should be // part of the same array. // // **Note:** We have modified the data type of this field. However, the latest // change is backward compatible and both integer and string type shipment IDs are // valid for this field, as long as they match the IDs of the shipments already // configured. Providing mixed value types in the array, will lead to an error. Shipments [][]string `json:"shipments,omitzero"` // contains filtered or unexported fields }
unassigned attribute is related to the re-optimization feature. This attribute should contain the tasks that were not assigned during an earlier optimization process. Please note that the unassigned part in request should be consistent with the unassigned part in the previous optimization result.
Users can reduce the number of unassigned tasks in the re-optimized solution, by following strategies such as:
- Extending the time windows for vehicles or tasks to give more flexibility - Adding more vehicles to the optimization problem - Adjusting the priority of different tasks to balance the workload more evenly - Modifying other constraints or parameters to make the problem more solvable
Ultimately, the goal is to minimize the number of unassigned tasks while still meeting all the necessary constraints and objectives.
func (OptimizationV2SubmitParamsUnassigned) MarshalJSON ¶
func (r OptimizationV2SubmitParamsUnassigned) MarshalJSON() (data []byte, err error)
func (*OptimizationV2SubmitParamsUnassigned) UnmarshalJSON ¶
func (r *OptimizationV2SubmitParamsUnassigned) UnmarshalJSON(data []byte) error
type OptimizationV2SubmitParamsZone ¶
type OptimizationV2SubmitParamsZone struct { // Provide an ID for the zone. This field is mandatory when adding zones. ID int64 `json:"id,required"` // Provide the ID of a pre-created geofence using the // [Geofence API](https://docs.nextbillion.ai/docs/tracking/api/geofence). // // Please note that one of geometry or geofence_id should be provided. GeofenceID param.Opt[string] `json:"geofence_id,omitzero"` // It is a [geoJSON object](https://datatracker.ietf.org/doc/html/rfc7946#page-9) // with details of the geographic boundaries of the zone. Only “Polygon” and // “MultiPolygon” geoJSON types are supported. // // Please note that one of geometry or geofence_id should be provided. Geometry OptimizationV2SubmitParamsZoneGeometry `json:"geometry,omitzero"` // contains filtered or unexported fields }
The property ID is required.
func (OptimizationV2SubmitParamsZone) MarshalJSON ¶
func (r OptimizationV2SubmitParamsZone) MarshalJSON() (data []byte, err error)
func (*OptimizationV2SubmitParamsZone) UnmarshalJSON ¶
func (r *OptimizationV2SubmitParamsZone) UnmarshalJSON(data []byte) error
type OptimizationV2SubmitParamsZoneGeometry ¶
type OptimizationV2SubmitParamsZoneGeometry struct { // Provide a description to identify the zone Description param.Opt[string] `json:"description,omitzero"` // An array of coordinates in the \[longitude, latitude\] format, representing the // zone boundary. Coordinates [][]float64 `json:"coordinates,omitzero"` // Type of the geoJSON geometry. Should always be Polygon or MultiPolygon. // // Any of "Polygon", "MultiPolygon". Type string `json:"type,omitzero"` // contains filtered or unexported fields }
It is a [geoJSON object](https://datatracker.ietf.org/doc/html/rfc7946#page-9) with details of the geographic boundaries of the zone. Only “Polygon” and “MultiPolygon” geoJSON types are supported.
Please note that one of geometry or geofence_id should be provided.
func (OptimizationV2SubmitParamsZoneGeometry) MarshalJSON ¶
func (r OptimizationV2SubmitParamsZoneGeometry) MarshalJSON() (data []byte, err error)
func (*OptimizationV2SubmitParamsZoneGeometry) UnmarshalJSON ¶
func (r *OptimizationV2SubmitParamsZoneGeometry) UnmarshalJSON(data []byte) error
type Pagination ¶
type Pagination struct { // A boolean value indicating whether there are more items available beyond the // current page. Hasmore bool `json:"hasmore"` // An integer value indicating the current page number (starting at 0). Page int64 `json:"page"` // An integer value indicating the maximum number of items retrieved per page. Size int64 `json:"size"` // An integer value indicating the total number of items available in the data set. // This parameter can be used to calculate the total number of pages available. Total int64 `json:"total"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Hasmore respjson.Field Page respjson.Field Size respjson.Field Total respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with pagination details of the search results. Use this object to implement pagination in your application.
func (Pagination) RawJSON ¶
func (r Pagination) RawJSON() string
Returns the unmodified JSON received from the API
func (*Pagination) UnmarshalJSON ¶
func (r *Pagination) UnmarshalJSON(data []byte) error
type PlaceItem ¶
type PlaceItem struct { // This parameter represents the complete address of the place, including the // street, city, state, postal code and country. Address string `json:"address"` // This parameter represents additional building information if applicable. Building string `json:"building"` // This parameter represents the city or town of the place. City string `json:"city"` // This parameter represents the country of the place. Country string `json:"country"` // This parameter represents the district of the place. District string `json:"district"` // This parameter represents the geographical coordinates of the place. It includes // the latitude and longitude values. Geopoint PlaceItemGeopoint `json:"geopoint"` // This parameter represents the house or building number of the place. House string `json:"house"` // This parameter represents a point of interest within the place. A Point of // Interest (POI) refers to a specific location or area that is of interest to // individuals for various reasons. It could be a landmark, tourist attraction, // business, or any other location that people might find important or intriguing. Poi PlaceItemPoi `json:"poi"` // This parameter represents the postal code or ZIP code of the place. PostalCode string `json:"postalCode"` // This parameter represents the state or region of the place. State string `json:"state"` // This parameter represents the street name of the place. Street string `json:"street"` // This parameter represents the sub-district or locality of the place. SubDistrict string `json:"subDistrict"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Address respjson.Field Building respjson.Field City respjson.Field Country respjson.Field District respjson.Field Geopoint respjson.Field House respjson.Field Poi respjson.Field PostalCode respjson.Field State respjson.Field Street respjson.Field SubDistrict respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (PlaceItem) ToParam ¶
func (r PlaceItem) ToParam() PlaceItemParam
ToParam converts this PlaceItem to a PlaceItemParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with PlaceItemParam.Overrides()
func (*PlaceItem) UnmarshalJSON ¶
type PlaceItemGeopoint ¶
type PlaceItemGeopoint struct { // This parameter represents the latitude value of the place. Lat float64 `json:"lat"` // This parameter represents the longitude value of the place. Lng float64 `json:"lng"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Lat respjson.Field Lng respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
This parameter represents the geographical coordinates of the place. It includes the latitude and longitude values.
func (PlaceItemGeopoint) RawJSON ¶
func (r PlaceItemGeopoint) RawJSON() string
Returns the unmodified JSON received from the API
func (*PlaceItemGeopoint) UnmarshalJSON ¶
func (r *PlaceItemGeopoint) UnmarshalJSON(data []byte) error
type PlaceItemGeopointParam ¶
type PlaceItemGeopointParam struct { // This parameter represents the latitude value of the place. Lat param.Opt[float64] `json:"lat,omitzero"` // This parameter represents the longitude value of the place. Lng param.Opt[float64] `json:"lng,omitzero"` // contains filtered or unexported fields }
This parameter represents the geographical coordinates of the place. It includes the latitude and longitude values.
func (PlaceItemGeopointParam) MarshalJSON ¶
func (r PlaceItemGeopointParam) MarshalJSON() (data []byte, err error)
func (*PlaceItemGeopointParam) UnmarshalJSON ¶
func (r *PlaceItemGeopointParam) UnmarshalJSON(data []byte) error
type PlaceItemParam ¶
type PlaceItemParam struct { // This parameter represents the complete address of the place, including the // street, city, state, postal code and country. Address param.Opt[string] `json:"address,omitzero"` // This parameter represents additional building information if applicable. Building param.Opt[string] `json:"building,omitzero"` // This parameter represents the city or town of the place. City param.Opt[string] `json:"city,omitzero"` // This parameter represents the country of the place. Country param.Opt[string] `json:"country,omitzero"` // This parameter represents the district of the place. District param.Opt[string] `json:"district,omitzero"` // This parameter represents the house or building number of the place. House param.Opt[string] `json:"house,omitzero"` // This parameter represents the postal code or ZIP code of the place. PostalCode param.Opt[string] `json:"postalCode,omitzero"` // This parameter represents the state or region of the place. State param.Opt[string] `json:"state,omitzero"` // This parameter represents the street name of the place. Street param.Opt[string] `json:"street,omitzero"` // This parameter represents the sub-district or locality of the place. SubDistrict param.Opt[string] `json:"subDistrict,omitzero"` // This parameter represents the geographical coordinates of the place. It includes // the latitude and longitude values. Geopoint PlaceItemGeopointParam `json:"geopoint,omitzero"` // This parameter represents a point of interest within the place. A Point of // Interest (POI) refers to a specific location or area that is of interest to // individuals for various reasons. It could be a landmark, tourist attraction, // business, or any other location that people might find important or intriguing. Poi PlaceItemPoiParam `json:"poi,omitzero"` // contains filtered or unexported fields }
func (PlaceItemParam) MarshalJSON ¶
func (r PlaceItemParam) MarshalJSON() (data []byte, err error)
func (*PlaceItemParam) UnmarshalJSON ¶
func (r *PlaceItemParam) UnmarshalJSON(data []byte) error
type PlaceItemPoi ¶
type PlaceItemPoi struct { // A title that describes the point of interest. Title string `json:"title"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Title respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
This parameter represents a point of interest within the place. A Point of Interest (POI) refers to a specific location or area that is of interest to individuals for various reasons. It could be a landmark, tourist attraction, business, or any other location that people might find important or intriguing.
func (PlaceItemPoi) RawJSON ¶
func (r PlaceItemPoi) RawJSON() string
Returns the unmodified JSON received from the API
func (*PlaceItemPoi) UnmarshalJSON ¶
func (r *PlaceItemPoi) UnmarshalJSON(data []byte) error
type PlaceItemPoiParam ¶
type PlaceItemPoiParam struct { // A title that describes the point of interest. Title param.Opt[string] `json:"title,omitzero"` // contains filtered or unexported fields }
This parameter represents a point of interest within the place. A Point of Interest (POI) refers to a specific location or area that is of interest to individuals for various reasons. It could be a landmark, tourist attraction, business, or any other location that people might find important or intriguing.
func (PlaceItemPoiParam) MarshalJSON ¶
func (r PlaceItemPoiParam) MarshalJSON() (data []byte, err error)
func (*PlaceItemPoiParam) UnmarshalJSON ¶
func (r *PlaceItemPoiParam) UnmarshalJSON(data []byte) error
type PolygonGeojson ¶
type PolygonGeojson struct { // An array of coordinates in the [longitude, latitude] format, representing the // geofence boundary. Coordinates [][]float64 `json:"coordinates"` // Type of the geoJSON geometry. Will always be Polygon. Type string `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Coordinates respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with geoJSON details of the geofence. The contents of this object follow the [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946).
func (PolygonGeojson) RawJSON ¶
func (r PolygonGeojson) RawJSON() string
Returns the unmodified JSON received from the API
func (*PolygonGeojson) UnmarshalJSON ¶
func (r *PolygonGeojson) UnmarshalJSON(data []byte) error
type Position ¶
type Position struct { // The latitude of the searched place. Lat string `json:"lat"` // The longitude of the searched place. Lng string `json:"lng"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Lat respjson.Field Lng respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the location coordinates of the result.
func (*Position) UnmarshalJSON ¶
type PostResponse ¶
type PostResponse struct { // A unique ID which can be used in the Optimization GET method to retrieve the // result of optimization. ID string `json:"id"` // Displays an acknowledgement message once the job is submitted. Message string `json:"message"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages/codes are returned in case of // errors. See the [API Error Codes](#api-error-codes) section below for more // information. Status string `json:"status"` // Display the warnings for the given input parameters, values and constraints. Warnings []string `json:"warnings"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Message respjson.Field Status respjson.Field Warnings respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (PostResponse) RawJSON ¶
func (r PostResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*PostResponse) UnmarshalJSON ¶
func (r *PostResponse) UnmarshalJSON(data []byte) error
type PostalcodeGetCoordinatesParams ¶
type PostalcodeGetCoordinatesParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Country containing the postal code or the location. It is mandatory if // postalcode is provided in the request. [See this example](#note). // // Please check the [API Query Limits](#api-query-limits) section below for a list // of the countries covered by the Geocode Postcode API. Users can provide either // the name or the alpha-2/3 code as per the // [ISO 3166-1 standard](https://en.wikipedia.org/wiki/ISO_3166-1) of a country // covered by the API as input for this parameter. Country param.Opt[string] `json:"country,omitzero"` // Provide the postal code for which the information is needed. At least one of // (postalcode + country) or at needs to be provided. Please note that only 1 // postal code can be requested. [See this example](#note). Postalcode param.Opt[string] `json:"postalcode,omitzero"` // Location coordinates that you want to get the postal code of. If not providing // postalcode in the request, at becomes mandatory. Please note that only 1 point // can be requested. [See this example](#note). At PostalcodeGetCoordinatesParamsAt `json:"at,omitzero"` // Specify the format in which the boundary details of the post code will be // returned. When specified, the boundary details will be returned in the geojson // format. When not specified, the boundary details are returned in general format. // // Any of "geojson". Format PostalcodeGetCoordinatesParamsFormat `json:"format,omitzero"` // contains filtered or unexported fields }
func (PostalcodeGetCoordinatesParams) MarshalJSON ¶
func (r PostalcodeGetCoordinatesParams) MarshalJSON() (data []byte, err error)
func (PostalcodeGetCoordinatesParams) URLQuery ¶
func (r PostalcodeGetCoordinatesParams) URLQuery() (v url.Values, err error)
URLQuery serializes PostalcodeGetCoordinatesParams's query parameters as `url.Values`.
func (*PostalcodeGetCoordinatesParams) UnmarshalJSON ¶
func (r *PostalcodeGetCoordinatesParams) UnmarshalJSON(data []byte) error
type PostalcodeGetCoordinatesParamsAt ¶
type PostalcodeGetCoordinatesParamsAt struct { // Latitude of the location. Lat param.Opt[float64] `json:"lat,omitzero"` // Longitude of the location. Lng param.Opt[float64] `json:"lng,omitzero"` // contains filtered or unexported fields }
Location coordinates that you want to get the postal code of. If not providing postalcode in the request, at becomes mandatory. Please note that only 1 point can be requested. [See this example](#note).
func (PostalcodeGetCoordinatesParamsAt) MarshalJSON ¶
func (r PostalcodeGetCoordinatesParamsAt) MarshalJSON() (data []byte, err error)
func (*PostalcodeGetCoordinatesParamsAt) UnmarshalJSON ¶
func (r *PostalcodeGetCoordinatesParamsAt) UnmarshalJSON(data []byte) error
type PostalcodeGetCoordinatesParamsFormat ¶
type PostalcodeGetCoordinatesParamsFormat string
Specify the format in which the boundary details of the post code will be returned. When specified, the boundary details will be returned in the geojson format. When not specified, the boundary details are returned in general format.
const (
PostalcodeGetCoordinatesParamsFormatGeojson PostalcodeGetCoordinatesParamsFormat = "geojson"
)
type PostalcodeGetCoordinatesResponse ¶
type PostalcodeGetCoordinatesResponse struct { // An object that contains details about the place that was provided in the input. Places PostalcodeGetCoordinatesResponsePlaces `json:"places"` // Returns a message, in case the input provided triggers any warnings. Warning []string `json:"warning"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Places respjson.Field Warning respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (PostalcodeGetCoordinatesResponse) RawJSON ¶
func (r PostalcodeGetCoordinatesResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*PostalcodeGetCoordinatesResponse) UnmarshalJSON ¶
func (r *PostalcodeGetCoordinatesResponse) UnmarshalJSON(data []byte) error
type PostalcodeGetCoordinatesResponsePlaces ¶
type PostalcodeGetCoordinatesResponsePlaces struct { // Returns the address of the postalcode returned. Address string `json:"address"` // An object containing the boundary details of the postal code area. This object // will not be returned in case the boundary information of the postal code // provided is not available (only for selected countries). // // Please note the contents of this object will change based on the format field in // the input. When the format field is not present in the input this object would // contain multipolygon - polygon - points objects depending on the boundary of the // given postal code. When the format field is present in the input, then the // contents of this object would match the // [geojson format and standard](https://datatracker.ietf.org/doc/html/rfc7946). Boundary PostalcodeGetCoordinatesResponsePlacesBoundary `json:"boundary"` // Name of the country containing the geographic coordinate point / postal code // provided in the input request. Country string `json:"country"` // Returns the [alpha-3 ISO code](https://www.iban.com/country-codes) of the // country containing the postalcode returned. CountryCode string `json:"countryCode"` // This property is returned only when the API is requested to fetch the postal // code containing the location coordinate provided in the at input parameter. // distance denotes the straight line distance, in meters, from the requested // location coordinate to the postal code centroid. Distance float64 `json:"distance"` // Name of the district or region containing the geographic coordinate point / // postal code provided in the input request. District string `json:"district"` // Refers to the geographic coordinate denoting the center of the postal code in // latitude, longitude format. Geopoint PostalcodeGetCoordinatesResponsePlacesGeopoint `json:"geopoint"` // Returns the postal code associated with the requested geographic coordinate // point or the postal code itself as provided in the input API request. Postalcode string `json:"postalcode"` // Name of the state or province containing the geographic coordinate point / // postal code provided in the input request. State string `json:"state"` // Name of the sub-district or sub-region containing the postal code or geographic // coordinate point / postal code provided in the input request Subdistrict string `json:"subdistrict"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Address respjson.Field Boundary respjson.Field Country respjson.Field CountryCode respjson.Field Distance respjson.Field District respjson.Field Geopoint respjson.Field Postalcode respjson.Field State respjson.Field Subdistrict respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object that contains details about the place that was provided in the input.
func (PostalcodeGetCoordinatesResponsePlaces) RawJSON ¶
func (r PostalcodeGetCoordinatesResponsePlaces) RawJSON() string
Returns the unmodified JSON received from the API
func (*PostalcodeGetCoordinatesResponsePlaces) UnmarshalJSON ¶
func (r *PostalcodeGetCoordinatesResponsePlaces) UnmarshalJSON(data []byte) error
type PostalcodeGetCoordinatesResponsePlacesBoundary ¶
type PostalcodeGetCoordinatesResponsePlacesBoundary struct { // An object with geoJSON details of the boundary. This object is returned when the // format field is set to geojson in the input request, otherwise it is not present // in the response. The contents of this object follow the // [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946). Geometry PostalcodeGetCoordinatesResponsePlacesBoundaryGeometry `json:"geometry"` // An array of objects containing information about all the polygons forming the // postal code area. In case, the postal code area is formed by multiple polygons // not containing each other, a matching count of polygon objects will be returned. // // Please note that this object is returned only when format field is not specified // in the input, otherwise it is not present in the response. Multipolygon []PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygon `json:"multipolygon"` // Property associated with the geoJSON shape. Properties string `json:"properties"` // Type of the geoJSON object. This parameter is returned when the format field is // set to geojson in the input request, otherwise it is not present in the // response. The contents of this object follow the // [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946). Type string `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Geometry respjson.Field Multipolygon respjson.Field Properties respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object containing the boundary details of the postal code area. This object will not be returned in case the boundary information of the postal code provided is not available (only for selected countries).
Please note the contents of this object will change based on the format field in the input. When the format field is not present in the input this object would contain multipolygon - polygon - points objects depending on the boundary of the given postal code. When the format field is present in the input, then the contents of this object would match the [geojson format and standard](https://datatracker.ietf.org/doc/html/rfc7946).
func (PostalcodeGetCoordinatesResponsePlacesBoundary) RawJSON ¶
func (r PostalcodeGetCoordinatesResponsePlacesBoundary) RawJSON() string
Returns the unmodified JSON received from the API
func (*PostalcodeGetCoordinatesResponsePlacesBoundary) UnmarshalJSON ¶
func (r *PostalcodeGetCoordinatesResponsePlacesBoundary) UnmarshalJSON(data []byte) error
type PostalcodeGetCoordinatesResponsePlacesBoundaryGeometry ¶
type PostalcodeGetCoordinatesResponsePlacesBoundaryGeometry struct { // An array of coordinates in the [longitude, latitude] format, representing the // coordinates points which lie on the boundary of the postal code area. Coordinates [][][]float64 `json:"coordinates"` // Type of the geoJSON geometry. Type string `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Coordinates respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with geoJSON details of the boundary. This object is returned when the format field is set to geojson in the input request, otherwise it is not present in the response. The contents of this object follow the [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946).
func (PostalcodeGetCoordinatesResponsePlacesBoundaryGeometry) RawJSON ¶
func (r PostalcodeGetCoordinatesResponsePlacesBoundaryGeometry) RawJSON() string
Returns the unmodified JSON received from the API
func (*PostalcodeGetCoordinatesResponsePlacesBoundaryGeometry) UnmarshalJSON ¶
func (r *PostalcodeGetCoordinatesResponsePlacesBoundaryGeometry) UnmarshalJSON(data []byte) error
type PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygon ¶
type PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygon struct { // An object containing the details of a single polygon that is a part of the // postal code area. In case the postal code area contains other polygon(s), the // details of such polygon(s) would be returned through an array of points object. Polygon []PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygonPolygon `json:"polygon"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Polygon respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygon) RawJSON ¶
func (r PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygon) RawJSON() string
Returns the unmodified JSON received from the API
func (*PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygon) UnmarshalJSON ¶
func (r *PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygon) UnmarshalJSON(data []byte) error
type PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygonPolygon ¶
type PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygonPolygon struct { // Represents an array of geographic coordinates that define a polygon boundary. Points []PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygonPolygonPoint `json:"points"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Points respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygonPolygon) RawJSON ¶
func (r PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygonPolygon) RawJSON() string
Returns the unmodified JSON received from the API
func (*PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygonPolygon) UnmarshalJSON ¶
func (r *PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygonPolygon) UnmarshalJSON(data []byte) error
type PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygonPolygonPoint ¶
type PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygonPolygonPoint struct { // Latitude of the coordinate. Lat float64 `json:"lat"` // Longitude of the coordinate. Lng float64 `json:"lng"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Lat respjson.Field Lng respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygonPolygonPoint) RawJSON ¶
func (r PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygonPolygonPoint) RawJSON() string
Returns the unmodified JSON received from the API
func (*PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygonPolygonPoint) UnmarshalJSON ¶
func (r *PostalcodeGetCoordinatesResponsePlacesBoundaryMultipolygonPolygonPoint) UnmarshalJSON(data []byte) error
type PostalcodeGetCoordinatesResponsePlacesGeopoint ¶
type PostalcodeGetCoordinatesResponsePlacesGeopoint struct { // Latitude of the location. Lat float64 `json:"lat"` // Longitude of the location. Lng float64 `json:"lng"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Lat respjson.Field Lng respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Refers to the geographic coordinate denoting the center of the postal code in latitude, longitude format.
func (PostalcodeGetCoordinatesResponsePlacesGeopoint) RawJSON ¶
func (r PostalcodeGetCoordinatesResponsePlacesGeopoint) RawJSON() string
Returns the unmodified JSON received from the API
func (*PostalcodeGetCoordinatesResponsePlacesGeopoint) UnmarshalJSON ¶
func (r *PostalcodeGetCoordinatesResponsePlacesGeopoint) UnmarshalJSON(data []byte) error
type PostalcodeService ¶
type PostalcodeService struct {
Options []option.RequestOption
}
PostalcodeService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPostalcodeService method instead.
func NewPostalcodeService ¶
func NewPostalcodeService(opts ...option.RequestOption) (r PostalcodeService)
NewPostalcodeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PostalcodeService) GetCoordinates ¶
func (r *PostalcodeService) GetCoordinates(ctx context.Context, params PostalcodeGetCoordinatesParams, opts ...option.RequestOption) (res *PostalcodeGetCoordinatesResponse, err error)
Retrieve coordinates by postal code
type RestrictionDeleteParams ¶
type RestrictionDeleteParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // contains filtered or unexported fields }
func (RestrictionDeleteParams) URLQuery ¶
func (r RestrictionDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes RestrictionDeleteParams's query parameters as `url.Values`.
type RestrictionDeleteResponse ¶
type RestrictionDeleteResponse struct { // It is the unique ID of the restriction. ID float64 `json:"id"` // Returns the state of the restriction. It would always be deleted. State string `json:"state"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field State respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (RestrictionDeleteResponse) RawJSON ¶
func (r RestrictionDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*RestrictionDeleteResponse) UnmarshalJSON ¶
func (r *RestrictionDeleteResponse) UnmarshalJSON(data []byte) error
type RestrictionGetParams ¶
type RestrictionGetParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // a internal parameter Transform param.Opt[bool] `query:"transform,omitzero" json:"-"` // contains filtered or unexported fields }
func (RestrictionGetParams) URLQuery ¶
func (r RestrictionGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes RestrictionGetParams's query parameters as `url.Values`.
type RestrictionListByBboxParams ¶
type RestrictionListByBboxParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Specifies the maximum latitude value for the bounding box. MaxLat float64 `query:"max_lat,required" json:"-"` // Specifies the maximum longitude value for the bounding box. MaxLon float64 `query:"max_lon,required" json:"-"` // Specifies the minimum latitude value for the bounding box. MinLat float64 `query:"min_lat,required" json:"-"` // Specifies the minimum longitude value for the bounding box. MinLon float64 `query:"min_lon,required" json:"-"` // This is internal parameter with a default value as false. Transform param.Opt[bool] `query:"transform,omitzero" json:"-"` // Specify the modes of travel that the restriction pertains to. // // Any of "0w", "2w", "3w", "4w", "6w". Mode []string `query:"mode,omitzero" json:"-"` // Specify the type of restrictions to fetch. // // Any of "turn", "parking", "fixedspeed", "maxspeed", "closure", "truck". RestrictionType RestrictionListByBboxParamsRestrictionType `query:"restriction_type,omitzero" json:"-"` // This parameter represents where the restriction comes from and cannot be // modified by clients sending requests to the API endpoint. // // For example, an API endpoint that returns a list of restrictions could include // the source parameter to indicate where each item comes from. This parameter can // be useful for filtering, sorting, or grouping the results based on their source. // // Any of "rrt", "pbf". Source RestrictionListByBboxParamsSource `query:"source,omitzero" json:"-"` // This parameter is used to filter restrictions based on their state i.e. whether // the restriction is currently enabled, disabled, or deleted. For example, users // can retrieve a list of all the deleted restrictions by setting state=deleted. // // Any of "enabled", "disabled", "deleted". State RestrictionListByBboxParamsState `query:"state,omitzero" json:"-"` // Restrictions can be active or inactive at a given time by virtue of their // nature. For example, maximum speed limits can be active on the roads leading to // schools during school hours and be inactive afterwards or certain road closure // restrictions be active during holidays/concerts and be inactive otherwise. // // Use this parameter to filter the restrictions based on their status at the time // of making the request i.e. whether they are in force or not. // // Any of "active", "inactive". Status RestrictionListByBboxParamsStatus `query:"status,omitzero" json:"-"` // contains filtered or unexported fields }
func (RestrictionListByBboxParams) URLQuery ¶
func (r RestrictionListByBboxParams) URLQuery() (v url.Values, err error)
URLQuery serializes RestrictionListByBboxParams's query parameters as `url.Values`.
type RestrictionListByBboxParamsRestrictionType ¶
type RestrictionListByBboxParamsRestrictionType string
Specify the type of restrictions to fetch.
const ( RestrictionListByBboxParamsRestrictionTypeTurn RestrictionListByBboxParamsRestrictionType = "turn" RestrictionListByBboxParamsRestrictionTypeParking RestrictionListByBboxParamsRestrictionType = "parking" RestrictionListByBboxParamsRestrictionTypeFixedspeed RestrictionListByBboxParamsRestrictionType = "fixedspeed" RestrictionListByBboxParamsRestrictionTypeMaxspeed RestrictionListByBboxParamsRestrictionType = "maxspeed" RestrictionListByBboxParamsRestrictionTypeClosure RestrictionListByBboxParamsRestrictionType = "closure" RestrictionListByBboxParamsRestrictionTypeTruck RestrictionListByBboxParamsRestrictionType = "truck" )
type RestrictionListByBboxParamsSource ¶
type RestrictionListByBboxParamsSource string
This parameter represents where the restriction comes from and cannot be modified by clients sending requests to the API endpoint.
For example, an API endpoint that returns a list of restrictions could include the source parameter to indicate where each item comes from. This parameter can be useful for filtering, sorting, or grouping the results based on their source.
const ( RestrictionListByBboxParamsSourceRrt RestrictionListByBboxParamsSource = "rrt" RestrictionListByBboxParamsSourcePbf RestrictionListByBboxParamsSource = "pbf" )
type RestrictionListByBboxParamsState ¶
type RestrictionListByBboxParamsState string
This parameter is used to filter restrictions based on their state i.e. whether the restriction is currently enabled, disabled, or deleted. For example, users can retrieve a list of all the deleted restrictions by setting state=deleted.
const ( RestrictionListByBboxParamsStateEnabled RestrictionListByBboxParamsState = "enabled" RestrictionListByBboxParamsStateDisabled RestrictionListByBboxParamsState = "disabled" RestrictionListByBboxParamsStateDeleted RestrictionListByBboxParamsState = "deleted" )
type RestrictionListByBboxParamsStatus ¶
type RestrictionListByBboxParamsStatus string
Restrictions can be active or inactive at a given time by virtue of their nature. For example, maximum speed limits can be active on the roads leading to schools during school hours and be inactive afterwards or certain road closure restrictions be active during holidays/concerts and be inactive otherwise.
Use this parameter to filter the restrictions based on their status at the time of making the request i.e. whether they are in force or not.
const ( RestrictionListByBboxParamsStatusActive RestrictionListByBboxParamsStatus = "active" RestrictionListByBboxParamsStatusInactive RestrictionListByBboxParamsStatus = "inactive" )
type RestrictionListParams ¶
type RestrictionListParams struct { // Specify the area name. It represents a region where restrictions can be applied. // // _The area it belongs to. See Area API_ Area string `query:"area,required" json:"-"` // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // The number of restrictions to be returned in the response. Please note that if // the limit is set to a number more than the total number of available // restrictions, then all restrictions would be returned together. Limit int64 `query:"limit,required" json:"-"` // An integer value indicating the number of items in the collection that need to // be skipped in the response. Please note that the offset starts from 0, so the // first item returned in the result would be the item at (offset + 1) position in // collection. // // Users can use offset along with limit to implement paginated result. Offset int64 `query:"offset,required" json:"-"` // The name of the restriction. This should be same as that provided while creating // or updating the restriction. Name param.Opt[string] `query:"name,omitzero" json:"-"` // a internal parameter Transform param.Opt[bool] `query:"transform,omitzero" json:"-"` // Specify the modes of travel that the restriction pertains to. // // Any of "0w", "2w", "3w", "4w", "6w". Mode RestrictionListParamsMode `query:"mode,omitzero" json:"-"` // Specify the type of restrictions to fetch. // // Any of "turn", "parking", "fixedspeed", "maxspeed", "closure", "truck". RestrictionType RestrictionListParamsRestrictionType `query:"restriction_type,omitzero" json:"-"` // It represents where it comes from, currently the possible values include "rrt", // "xsm" // // Any of "rrt", "pbf". Source RestrictionListParamsSource `query:"source,omitzero" json:"-"` // This parameter is used to filter restrictions based on their state i.e. whether // the restriction is currently enabled, disabled, or deleted. For example, users // can retrieve a list of all the deleted restrictions by setting state=deleted. // // Any of "enabled", "disabled", "deleted". State RestrictionListParamsState `query:"state,omitzero" json:"-"` // Restrictions can be active or inactive at a given time by virtue of their // nature. For example, maximum speed limits can be active on the roads leading to // schools during school hours and be inactive afterwards or certain road closure // restrictions be active during holidays/concerts and be inactive otherwise. // // Use this parameter to filter the restrictions based on their status at the time // of making the request i.e. whether they are in force or not. // // Any of "active", "inactive". Status RestrictionListParamsStatus `query:"status,omitzero" json:"-"` // contains filtered or unexported fields }
func (RestrictionListParams) URLQuery ¶
func (r RestrictionListParams) URLQuery() (v url.Values, err error)
URLQuery serializes RestrictionListParams's query parameters as `url.Values`.
type RestrictionListParamsMode ¶
type RestrictionListParamsMode string
Specify the modes of travel that the restriction pertains to.
const ( RestrictionListParamsMode0w RestrictionListParamsMode = "0w" RestrictionListParamsMode2w RestrictionListParamsMode = "2w" RestrictionListParamsMode3w RestrictionListParamsMode = "3w" RestrictionListParamsMode4w RestrictionListParamsMode = "4w" RestrictionListParamsMode6w RestrictionListParamsMode = "6w" )
type RestrictionListParamsRestrictionType ¶
type RestrictionListParamsRestrictionType string
Specify the type of restrictions to fetch.
const ( RestrictionListParamsRestrictionTypeTurn RestrictionListParamsRestrictionType = "turn" RestrictionListParamsRestrictionTypeParking RestrictionListParamsRestrictionType = "parking" RestrictionListParamsRestrictionTypeFixedspeed RestrictionListParamsRestrictionType = "fixedspeed" RestrictionListParamsRestrictionTypeMaxspeed RestrictionListParamsRestrictionType = "maxspeed" RestrictionListParamsRestrictionTypeClosure RestrictionListParamsRestrictionType = "closure" RestrictionListParamsRestrictionTypeTruck RestrictionListParamsRestrictionType = "truck" )
type RestrictionListParamsSource ¶
type RestrictionListParamsSource string
It represents where it comes from, currently the possible values include "rrt", "xsm"
const ( RestrictionListParamsSourceRrt RestrictionListParamsSource = "rrt" RestrictionListParamsSourcePbf RestrictionListParamsSource = "pbf" )
type RestrictionListParamsState ¶
type RestrictionListParamsState string
This parameter is used to filter restrictions based on their state i.e. whether the restriction is currently enabled, disabled, or deleted. For example, users can retrieve a list of all the deleted restrictions by setting state=deleted.
const ( RestrictionListParamsStateEnabled RestrictionListParamsState = "enabled" RestrictionListParamsStateDisabled RestrictionListParamsState = "disabled" RestrictionListParamsStateDeleted RestrictionListParamsState = "deleted" )
type RestrictionListParamsStatus ¶
type RestrictionListParamsStatus string
Restrictions can be active or inactive at a given time by virtue of their nature. For example, maximum speed limits can be active on the roads leading to schools during school hours and be inactive afterwards or certain road closure restrictions be active during holidays/concerts and be inactive otherwise.
Use this parameter to filter the restrictions based on their status at the time of making the request i.e. whether they are in force or not.
const ( RestrictionListParamsStatusActive RestrictionListParamsStatus = "active" RestrictionListParamsStatusInactive RestrictionListParamsStatus = "inactive" )
type RestrictionListResponse ¶
type RestrictionListResponse struct { // An array of objects containing the details of the restrictions returned. Each // object represents one restriction. Data []RichGroupResponse `json:"data"` Meta RestrictionListResponseMeta `json:"meta"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Meta respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (RestrictionListResponse) RawJSON ¶
func (r RestrictionListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*RestrictionListResponse) UnmarshalJSON ¶
func (r *RestrictionListResponse) UnmarshalJSON(data []byte) error
type RestrictionListResponseMeta ¶
type RestrictionListResponseMeta struct { // An integer value indicating the maximum number of items retrieved per "page". // This is the same number as provided for the limit parameter in input. Limit int64 `json:"limit"` // An integer value indicating the number of items in the collection that were // skipped to display the current response. Please note that the offset starts from // zero. Offset int64 `json:"offset"` // An integer value indicating the total number of items available in the data set. Total int64 `json:"total"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Limit respjson.Field Offset respjson.Field Total respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (RestrictionListResponseMeta) RawJSON ¶
func (r RestrictionListResponseMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*RestrictionListResponseMeta) UnmarshalJSON ¶
func (r *RestrictionListResponseMeta) UnmarshalJSON(data []byte) error
type RestrictionNewParams ¶
type RestrictionNewParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` RichGroupRequest RichGroupRequestParam // Use this parameter to decide the format for specifying the geofence coordinates. // If true, then the coordinates of geofence can be specified as // "latitude,longitude" format, otherwise they should be specified in // "longitude,latitude" format. Latlon param.Opt[bool] `query:"latlon,omitzero" json:"-"` // contains filtered or unexported fields }
func (RestrictionNewParams) MarshalJSON ¶
func (r RestrictionNewParams) MarshalJSON() (data []byte, err error)
func (RestrictionNewParams) URLQuery ¶
func (r RestrictionNewParams) URLQuery() (v url.Values, err error)
URLQuery serializes RestrictionNewParams's query parameters as `url.Values`.
func (*RestrictionNewParams) UnmarshalJSON ¶
func (r *RestrictionNewParams) UnmarshalJSON(data []byte) error
type RestrictionNewParamsRestrictionType ¶
type RestrictionNewParamsRestrictionType string
const ( RestrictionNewParamsRestrictionTypeTurn RestrictionNewParamsRestrictionType = "turn" RestrictionNewParamsRestrictionTypeParking RestrictionNewParamsRestrictionType = "parking" RestrictionNewParamsRestrictionTypeFixedspeed RestrictionNewParamsRestrictionType = "fixedspeed" RestrictionNewParamsRestrictionTypeMaxspeed RestrictionNewParamsRestrictionType = "maxspeed" RestrictionNewParamsRestrictionTypeClosure RestrictionNewParamsRestrictionType = "closure" RestrictionNewParamsRestrictionTypeTruck RestrictionNewParamsRestrictionType = "truck" )
type RestrictionService ¶
type RestrictionService struct {
Options []option.RequestOption
}
RestrictionService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRestrictionService method instead.
func NewRestrictionService ¶
func NewRestrictionService(opts ...option.RequestOption) (r RestrictionService)
NewRestrictionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*RestrictionService) Delete ¶
func (r *RestrictionService) Delete(ctx context.Context, id int64, body RestrictionDeleteParams, opts ...option.RequestOption) (res *RestrictionDeleteResponse, err error)
Delete a restriction by ID
func (*RestrictionService) Get ¶
func (r *RestrictionService) Get(ctx context.Context, id int64, query RestrictionGetParams, opts ...option.RequestOption) (res *RichGroupResponse, err error)
Get a restriction by id
func (*RestrictionService) List ¶
func (r *RestrictionService) List(ctx context.Context, query RestrictionListParams, opts ...option.RequestOption) (res *RestrictionListResponse, err error)
Get the paginated list of restrictions
func (*RestrictionService) ListByBbox ¶
func (r *RestrictionService) ListByBbox(ctx context.Context, query RestrictionListByBboxParams, opts ...option.RequestOption) (res *[]RichGroupResponse, err error)
Get restrictions by bbox
func (*RestrictionService) New ¶
func (r *RestrictionService) New(ctx context.Context, restrictionType RestrictionNewParamsRestrictionType, params RestrictionNewParams, opts ...option.RequestOption) (res *RichGroupResponse, err error)
Create a new restriction
func (*RestrictionService) SetState ¶
func (r *RestrictionService) SetState(ctx context.Context, id int64, params RestrictionSetStateParams, opts ...option.RequestOption) (res *RichGroupResponse, err error)
Set the state of a restriction by ID
func (*RestrictionService) Update ¶
func (r *RestrictionService) Update(ctx context.Context, id int64, params RestrictionUpdateParams, opts ...option.RequestOption) (res *RichGroupResponse, err error)
Update a restriction
type RestrictionSetStateParams ¶
type RestrictionSetStateParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Use this field to specify the new state of the restriction. Please note that // this method cannot update the state of restrictions that are currently in // 'deleted' state. // // Any of "enabled", "disabled", "deleted". State RestrictionSetStateParamsState `json:"state,omitzero,required"` // contains filtered or unexported fields }
func (RestrictionSetStateParams) MarshalJSON ¶
func (r RestrictionSetStateParams) MarshalJSON() (data []byte, err error)
func (RestrictionSetStateParams) URLQuery ¶
func (r RestrictionSetStateParams) URLQuery() (v url.Values, err error)
URLQuery serializes RestrictionSetStateParams's query parameters as `url.Values`.
func (*RestrictionSetStateParams) UnmarshalJSON ¶
func (r *RestrictionSetStateParams) UnmarshalJSON(data []byte) error
type RestrictionSetStateParamsState ¶
type RestrictionSetStateParamsState string
Use this field to specify the new state of the restriction. Please note that this method cannot update the state of restrictions that are currently in 'deleted' state.
const ( RestrictionSetStateParamsStateEnabled RestrictionSetStateParamsState = "enabled" RestrictionSetStateParamsStateDisabled RestrictionSetStateParamsState = "disabled" RestrictionSetStateParamsStateDeleted RestrictionSetStateParamsState = "deleted" )
type RestrictionUpdateParams ¶
type RestrictionUpdateParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` RichGroupRequest RichGroupRequestParam // Use this parameter to decide the format for specifying the geofence coordinates. // If true, then the coordinates of geofence can be specified as // "latitude,longitude" format, otherwise they should be specified in // "longitude,latitude" format. Latlon param.Opt[bool] `query:"latlon,omitzero" json:"-"` // contains filtered or unexported fields }
func (RestrictionUpdateParams) MarshalJSON ¶
func (r RestrictionUpdateParams) MarshalJSON() (data []byte, err error)
func (RestrictionUpdateParams) URLQuery ¶
func (r RestrictionUpdateParams) URLQuery() (v url.Values, err error)
URLQuery serializes RestrictionUpdateParams's query parameters as `url.Values`.
func (*RestrictionUpdateParams) UnmarshalJSON ¶
func (r *RestrictionUpdateParams) UnmarshalJSON(data []byte) error
type RestrictionsItemListParams ¶
type RestrictionsItemListParams struct { MaxLat float64 `query:"max_lat,required" json:"-"` MaxLon float64 `query:"max_lon,required" json:"-"` MinLat float64 `query:"min_lat,required" json:"-"` MinLon float64 `query:"min_lon,required" json:"-"` GroupID param.Opt[float64] `query:"group_id,omitzero" json:"-"` Source param.Opt[string] `query:"source,omitzero" json:"-"` // Any of "0w", "1w", "2w", "3w", "4w", "6w". Mode RestrictionsItemListParamsMode `query:"mode,omitzero" json:"-"` // Any of "turn", "parking", "fixedspeed", "maxspeed", "closure", "truck". RestrictionType RestrictionsItemListParamsRestrictionType `query:"restriction_type,omitzero" json:"-"` // Any of "enabled", "disabled", "deleted". State RestrictionsItemListParamsState `query:"state,omitzero" json:"-"` // Any of "active", "inactive". Status RestrictionsItemListParamsStatus `query:"status,omitzero" json:"-"` // contains filtered or unexported fields }
func (RestrictionsItemListParams) URLQuery ¶
func (r RestrictionsItemListParams) URLQuery() (v url.Values, err error)
URLQuery serializes RestrictionsItemListParams's query parameters as `url.Values`.
type RestrictionsItemListParamsMode ¶
type RestrictionsItemListParamsMode string
const ( RestrictionsItemListParamsMode0w RestrictionsItemListParamsMode = "0w" RestrictionsItemListParamsMode1w RestrictionsItemListParamsMode = "1w" RestrictionsItemListParamsMode2w RestrictionsItemListParamsMode = "2w" RestrictionsItemListParamsMode3w RestrictionsItemListParamsMode = "3w" RestrictionsItemListParamsMode4w RestrictionsItemListParamsMode = "4w" RestrictionsItemListParamsMode6w RestrictionsItemListParamsMode = "6w" )
type RestrictionsItemListParamsRestrictionType ¶
type RestrictionsItemListParamsRestrictionType string
const ( RestrictionsItemListParamsRestrictionTypeTurn RestrictionsItemListParamsRestrictionType = "turn" RestrictionsItemListParamsRestrictionTypeParking RestrictionsItemListParamsRestrictionType = "parking" RestrictionsItemListParamsRestrictionTypeFixedspeed RestrictionsItemListParamsRestrictionType = "fixedspeed" RestrictionsItemListParamsRestrictionTypeMaxspeed RestrictionsItemListParamsRestrictionType = "maxspeed" RestrictionsItemListParamsRestrictionTypeClosure RestrictionsItemListParamsRestrictionType = "closure" RestrictionsItemListParamsRestrictionTypeTruck RestrictionsItemListParamsRestrictionType = "truck" )
type RestrictionsItemListParamsState ¶
type RestrictionsItemListParamsState string
const ( RestrictionsItemListParamsStateEnabled RestrictionsItemListParamsState = "enabled" RestrictionsItemListParamsStateDisabled RestrictionsItemListParamsState = "disabled" RestrictionsItemListParamsStateDeleted RestrictionsItemListParamsState = "deleted" )
type RestrictionsItemListParamsStatus ¶
type RestrictionsItemListParamsStatus string
const ( RestrictionsItemListParamsStatusActive RestrictionsItemListParamsStatus = "active" RestrictionsItemListParamsStatusInactive RestrictionsItemListParamsStatus = "inactive" )
type RestrictionsItemListResponse ¶
type RestrictionsItemListResponse struct { ID float64 `json:"id,required"` Area string `json:"area,required"` Coordinate RestrictionsItemListResponseCoordinate `json:"coordinate,required"` GroupID float64 `json:"group_id,required"` // Any of "segment", "turn". GroupType RestrictionsItemListResponseGroupType `json:"group_type,required"` // Any of "0w", "1w", "2w", "3w", "4w", "6w". Mode []string `json:"mode,required"` RepeatOn string `json:"repeat_on,required"` // Any of "closure", "fixedspeed", "maxspeed", "turn", "truck". RestrictionType RestrictionsItemListResponseRestrictionType `json:"restriction_type,required"` // Any of "rrt", "pbf". Source RestrictionsItemListResponseSource `json:"source,required"` // Any of "enabled", "disabled", "deleted". State RestrictionsItemListResponseState `json:"state,required"` // Any of "active", "inactive". Status RestrictionsItemListResponseStatus `json:"status,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Area respjson.Field Coordinate respjson.Field GroupID respjson.Field GroupType respjson.Field Mode respjson.Field RepeatOn respjson.Field RestrictionType respjson.Field Source respjson.Field State respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (RestrictionsItemListResponse) RawJSON ¶
func (r RestrictionsItemListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*RestrictionsItemListResponse) UnmarshalJSON ¶
func (r *RestrictionsItemListResponse) UnmarshalJSON(data []byte) error
type RestrictionsItemListResponseCoordinate ¶
type RestrictionsItemListResponseCoordinate struct { Lat float64 `json:"lat"` Lon float64 `json:"lon"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Lat respjson.Field Lon respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (RestrictionsItemListResponseCoordinate) RawJSON ¶
func (r RestrictionsItemListResponseCoordinate) RawJSON() string
Returns the unmodified JSON received from the API
func (*RestrictionsItemListResponseCoordinate) UnmarshalJSON ¶
func (r *RestrictionsItemListResponseCoordinate) UnmarshalJSON(data []byte) error
type RestrictionsItemListResponseGroupType ¶
type RestrictionsItemListResponseGroupType string
const ( RestrictionsItemListResponseGroupTypeSegment RestrictionsItemListResponseGroupType = "segment" RestrictionsItemListResponseGroupTypeTurn RestrictionsItemListResponseGroupType = "turn" )
type RestrictionsItemListResponseRestrictionType ¶
type RestrictionsItemListResponseRestrictionType string
const ( RestrictionsItemListResponseRestrictionTypeClosure RestrictionsItemListResponseRestrictionType = "closure" RestrictionsItemListResponseRestrictionTypeFixedspeed RestrictionsItemListResponseRestrictionType = "fixedspeed" RestrictionsItemListResponseRestrictionTypeMaxspeed RestrictionsItemListResponseRestrictionType = "maxspeed" RestrictionsItemListResponseRestrictionTypeTurn RestrictionsItemListResponseRestrictionType = "turn" RestrictionsItemListResponseRestrictionTypeTruck RestrictionsItemListResponseRestrictionType = "truck" )
type RestrictionsItemListResponseSource ¶
type RestrictionsItemListResponseSource string
const ( RestrictionsItemListResponseSourceRrt RestrictionsItemListResponseSource = "rrt" RestrictionsItemListResponseSourcePbf RestrictionsItemListResponseSource = "pbf" )
type RestrictionsItemListResponseState ¶
type RestrictionsItemListResponseState string
const ( RestrictionsItemListResponseStateEnabled RestrictionsItemListResponseState = "enabled" RestrictionsItemListResponseStateDisabled RestrictionsItemListResponseState = "disabled" RestrictionsItemListResponseStateDeleted RestrictionsItemListResponseState = "deleted" )
type RestrictionsItemListResponseStatus ¶
type RestrictionsItemListResponseStatus string
const ( RestrictionsItemListResponseStatusActive RestrictionsItemListResponseStatus = "active" RestrictionsItemListResponseStatusInactive RestrictionsItemListResponseStatus = "inactive" )
type RestrictionsItemService ¶
type RestrictionsItemService struct {
Options []option.RequestOption
}
RestrictionsItemService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRestrictionsItemService method instead.
func NewRestrictionsItemService ¶
func NewRestrictionsItemService(opts ...option.RequestOption) (r RestrictionsItemService)
NewRestrictionsItemService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*RestrictionsItemService) List ¶
func (r *RestrictionsItemService) List(ctx context.Context, query RestrictionsItemListParams, opts ...option.RequestOption) (res *[]RestrictionsItemListResponse, err error)
Get restriction items by bbox
type RevgeocodeGetParams ¶
type RevgeocodeGetParams struct { // Specify the center of the search context expressed as coordinates. // // Please note that one of "at", "in=circle" or "in=bbox" should be provided for // relevant results. At string `query:"at,required" format:"latitude,longitude" json:"-"` // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Search within a geographic area. This is a hard filter. Results will be returned // if they are located within the specified area. // // # A geographic area can be // // - a country (or multiple countries), provided as comma-separated // [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) country // codes // // The country codes are to be provided in all uppercase. // // Format: countryCode:{countryCode}[,{countryCode}] // // - a circular area, provided as latitude, longitude, and radius (an integer with // meters as unit) // // Format: circle:{latitude},{longitude};r={radius} // // - a bounding box, provided as _west longitude_, _south latitude_, _east // longitude_, _north latitude_ // // Format: bbox:{west longitude},{south latitude},{east longitude},{north // latitude} In param.Opt[string] `query:"in,omitzero" json:"-"` // Select the language to be used for result rendering from a list of // [BCP 47](https://en.wikipedia.org/wiki/IETF_language_tag) compliant language // codes. Lang param.Opt[string] `query:"lang,omitzero" json:"-"` // contains filtered or unexported fields }
func (RevgeocodeGetParams) URLQuery ¶
func (r RevgeocodeGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes RevgeocodeGetParams's query parameters as `url.Values`.
type RevgeocodeGetResponse ¶
type RevgeocodeGetResponse struct { // The results are presented as a JSON list of candidates in ranked order // (most-likely to least-likely) based on the matched location criteria. Items []RevgeocodeGetResponseItem `json:"items"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Items respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (RevgeocodeGetResponse) RawJSON ¶
func (r RevgeocodeGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*RevgeocodeGetResponse) UnmarshalJSON ¶
func (r *RevgeocodeGetResponse) UnmarshalJSON(data []byte) error
type RevgeocodeGetResponseItem ¶
type RevgeocodeGetResponseItem struct { // The unique identifier for the result item. ID string `json:"id"` // An array returning the location coordinates of all the access points of the // search result. Access Access `json:"access"` // Postal address of the result item. Address Address `json:"address"` // The list of categories assigned to this place. Categories []Categories `json:"categories"` // Contact information like phone, email or website. Contacts []Contacts `json:"contacts"` // The distance "as the crow flies" from the search center to this result item in // meters. Distance int64 `json:"distance"` // The bounding box enclosing the geometric shape (area or line) that an individual // result covers. place typed results have no mapView. MapView MapView `json:"mapView"` // Returns the operating hours of the place, if available. OpeningHours RevgeocodeGetResponseItemOpeningHours `json:"openingHours"` // Returns the location coordinates of the result. Position Position `json:"position"` // Score of the result. A higher score indicates a closer match. Scoring RevgeocodeGetResponseItemScoring `json:"scoring"` // The localized display name of this result item. Title string `json:"title"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Access respjson.Field Address respjson.Field Categories respjson.Field Contacts respjson.Field Distance respjson.Field MapView respjson.Field OpeningHours respjson.Field Position respjson.Field Scoring respjson.Field Title respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (RevgeocodeGetResponseItem) RawJSON ¶
func (r RevgeocodeGetResponseItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*RevgeocodeGetResponseItem) UnmarshalJSON ¶
func (r *RevgeocodeGetResponseItem) UnmarshalJSON(data []byte) error
type RevgeocodeGetResponseItemOpeningHours ¶
type RevgeocodeGetResponseItemOpeningHours struct { // A collection of attributes with details about the opening and closing hours for // each day of the week. TimeRanges []RevgeocodeGetResponseItemOpeningHoursTimeRange `json:"timeRanges"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { TimeRanges respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the operating hours of the place, if available.
func (RevgeocodeGetResponseItemOpeningHours) RawJSON ¶
func (r RevgeocodeGetResponseItemOpeningHours) RawJSON() string
Returns the unmodified JSON received from the API
func (*RevgeocodeGetResponseItemOpeningHours) UnmarshalJSON ¶
func (r *RevgeocodeGetResponseItemOpeningHours) UnmarshalJSON(data []byte) error
type RevgeocodeGetResponseItemOpeningHoursTimeRange ¶
type RevgeocodeGetResponseItemOpeningHoursTimeRange struct { // Returns the closing time details. EndTime RevgeocodeGetResponseItemOpeningHoursTimeRangeEndTime `json:"endTime"` // Returns the open time details. StartTime RevgeocodeGetResponseItemOpeningHoursTimeRangeStartTime `json:"startTime"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { EndTime respjson.Field StartTime respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (RevgeocodeGetResponseItemOpeningHoursTimeRange) RawJSON ¶
func (r RevgeocodeGetResponseItemOpeningHoursTimeRange) RawJSON() string
Returns the unmodified JSON received from the API
func (*RevgeocodeGetResponseItemOpeningHoursTimeRange) UnmarshalJSON ¶
func (r *RevgeocodeGetResponseItemOpeningHoursTimeRange) UnmarshalJSON(data []byte) error
type RevgeocodeGetResponseItemOpeningHoursTimeRangeEndTime ¶
type RevgeocodeGetResponseItemOpeningHoursTimeRangeEndTime struct { // The date to which the subsequent closing time details belong to. Date string `json:"date"` // The hour of the day when the place closes. Hour int64 `json:"hour"` // The minute of the hour when the place closes. Minute int64 `json:"minute"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Date respjson.Field Hour respjson.Field Minute respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the closing time details.
func (RevgeocodeGetResponseItemOpeningHoursTimeRangeEndTime) RawJSON ¶
func (r RevgeocodeGetResponseItemOpeningHoursTimeRangeEndTime) RawJSON() string
Returns the unmodified JSON received from the API
func (*RevgeocodeGetResponseItemOpeningHoursTimeRangeEndTime) UnmarshalJSON ¶
func (r *RevgeocodeGetResponseItemOpeningHoursTimeRangeEndTime) UnmarshalJSON(data []byte) error
type RevgeocodeGetResponseItemOpeningHoursTimeRangeStartTime ¶
type RevgeocodeGetResponseItemOpeningHoursTimeRangeStartTime struct { // The date to which the subsequent open time details belong to. Date string `json:"date"` // The hour of the day when the place opens. Hour int64 `json:"hour"` // The minute of the hour when the place opens. Minute int64 `json:"minute"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Date respjson.Field Hour respjson.Field Minute respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the open time details.
func (RevgeocodeGetResponseItemOpeningHoursTimeRangeStartTime) RawJSON ¶
func (r RevgeocodeGetResponseItemOpeningHoursTimeRangeStartTime) RawJSON() string
Returns the unmodified JSON received from the API
func (*RevgeocodeGetResponseItemOpeningHoursTimeRangeStartTime) UnmarshalJSON ¶
func (r *RevgeocodeGetResponseItemOpeningHoursTimeRangeStartTime) UnmarshalJSON(data []byte) error
type RevgeocodeGetResponseItemScoring ¶
type RevgeocodeGetResponseItemScoring struct { // A breakdown of how closely individual field of the result matched with the // provided query q. FieldScore any `json:"fieldScore"` // A score, out of 1, indicating how closely the result matches with the provided // query q . QueryScore float64 `json:"queryScore"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { FieldScore respjson.Field QueryScore respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Score of the result. A higher score indicates a closer match.
func (RevgeocodeGetResponseItemScoring) RawJSON ¶
func (r RevgeocodeGetResponseItemScoring) RawJSON() string
Returns the unmodified JSON received from the API
func (*RevgeocodeGetResponseItemScoring) UnmarshalJSON ¶
func (r *RevgeocodeGetResponseItemScoring) UnmarshalJSON(data []byte) error
type RevgeocodeService ¶
type RevgeocodeService struct {
Options []option.RequestOption
}
RevgeocodeService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRevgeocodeService method instead.
func NewRevgeocodeService ¶
func NewRevgeocodeService(opts ...option.RequestOption) (r RevgeocodeService)
NewRevgeocodeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*RevgeocodeService) Get ¶
func (r *RevgeocodeService) Get(ctx context.Context, query RevgeocodeGetParams, opts ...option.RequestOption) (res *RevgeocodeGetResponse, err error)
Reverse Geocode
type RichGroupRequestDirection ¶
type RichGroupRequestDirection string
Represents the traffic direction on the segments to which the restriction will be applied.
const ( RichGroupRequestDirectionForward RichGroupRequestDirection = "forward" RichGroupRequestDirectionBackward RichGroupRequestDirection = "backward" RichGroupRequestDirectionBoth RichGroupRequestDirection = "both" )
type RichGroupRequestParam ¶
type RichGroupRequestParam struct { // Specify the area name. It represents a region where restrictions can be applied. // This is a custom field and it is recommended for the users to check with // [NextBillion.ai](www.nextbillion.ai) support for the right value. Alternatively, // users can invoke the _[Areas](#supported-areas)_ method to get a list of // available areas for them. Area string `json:"area,required"` // Specify a custom, descriptive name for the restriction. Name string `json:"name,required"` // Use this parameter to add any custom information about the restriction being // created. Comment param.Opt[string] `json:"comment,omitzero"` // Provide a UNIX epoch timestamp in seconds, representing the time when the // restriction should cease to be in-effect. EndTime param.Opt[float64] `json:"end_time,omitzero"` // Specify the maximum truck height, in centimeter, that will be allowed under the // restriction. A value of 0 indicates no limit. // // Please note this parameter is effective only when restriction_type is truck. At // least one of truck parameters - weight, height, width and truck - needs to be // provided when restriction type is truck. Height param.Opt[int64] `json:"height,omitzero"` // Specify the maximum truck length, in centimeter, that will be allowed under the // restriction. A value of 0 indicates no limit. // // Please note this parameter is effective only when restriction_type is truck. At // least one of truck parameters - weight, height, width and truck - needs to be // provided when restriction type is truck. Length param.Opt[int64] `json:"length,omitzero"` // It represents the days and times when the restriction is in effect. Users can // use this property to set recurring or one-time restrictions as per the // [given format](https://wiki.openstreetmap.org/wiki/Key:opening_hours) for // specifying the recurring schedule of the restriction. // // Please provided values as per the local time of the region where the restriction // is being applied. RepeatOn param.Opt[string] `json:"repeat_on,omitzero"` // Provide the the fixed speed of the segment where the restriction needs to be // applied. Please note that this parameter is mandatory when the restrictionType // is fixedspeed. Speed param.Opt[float64] `json:"speed,omitzero"` // Provide the the maximum speed of the segment where the restriction needs to be // applied. Please note that this parameter is mandatory when the restrictionType // is maxspeed. SpeedLimit param.Opt[float64] `json:"speed_limit,omitzero"` // Provide a UNIX epoch timestamp in seconds, representing the start time for the // restriction to be in-effect. StartTime param.Opt[float64] `json:"start_time,omitzero"` // Specify the maximum truck weight, in kilograms, that the restriction will allow. // A value of 0 indicates no limit. // // Please note this parameter is effective only when restriction_type is truck. At // least one of truck parameters - weight, height, width and truck - needs to be // provided for is truck restriction type. Weight param.Opt[int64] `json:"weight,omitzero"` // Specify the maximum truck width, in centimeter, that will be allowed under the // restriction. A value of 0 indicates no limit. // // Please note this parameter is effective only when restriction_type is truck. At // least one of truck parameters - weight, height, width and truck - needs to be // provided when restriction type is truck. Width param.Opt[int64] `json:"width,omitzero"` // Represents the traffic direction on the segments to which the restriction will // be applied. // // Any of "forward", "backward", "both". Direction RichGroupRequestDirection `json:"direction,omitzero"` // An array of coordinates denoting the boundary of an area in which the // restrictions are to be applied. The format in which coordinates should be listed // is defined by the latlon field. // // Geofences can be used to create all restriction types, except for a turn type // restriction. Please note that segments is not required when using geofence to // create restrictions. Geofence [][]float64 `json:"geofence,omitzero"` // Provide the driving modes for which the restriction should be effective. If the // value is an empty array or if it is not provided then the restriction would be // applied for all modes. // // Any of "0w", "2w", "3w", "4w", "6w". Mode []string `json:"mode,omitzero"` // An array of objects to collect the details of the segments of a road on which // the restriction has to be applied. Each object corresponds to a new segment. // // Please note that segments is mandatory for all restrtiction_type except turn. Segments []RichGroupRequestSegmentParam `json:"segments,omitzero"` // Specify a sequence of coordinates (track) where the restriction is to be // applied. The coordinates will be snapped to nearest road. Please note when using // tracks, segments and turns are not required. Tracks [][]float64 `json:"tracks,omitzero"` // An array of objects to collect the details of the turns of a road on which the // restriction has to be applied. Each object corresponds to a new turn. // // Please note that turns is mandatory for when restrtiction_type=turn. Turns []RichGroupRequestTurnParam `json:"turns,omitzero"` // contains filtered or unexported fields }
The properties Area, Name are required.
func (RichGroupRequestParam) MarshalJSON ¶
func (r RichGroupRequestParam) MarshalJSON() (data []byte, err error)
func (*RichGroupRequestParam) UnmarshalJSON ¶
func (r *RichGroupRequestParam) UnmarshalJSON(data []byte) error
type RichGroupRequestSegmentParam ¶
type RichGroupRequestSegmentParam struct { // An integer value representing the ID of the starting node of the segment. From param.Opt[float64] `json:"from,omitzero"` // An integer value representing the ID of the ending node of the segment. To param.Opt[float64] `json:"to,omitzero"` // contains filtered or unexported fields }
func (RichGroupRequestSegmentParam) MarshalJSON ¶
func (r RichGroupRequestSegmentParam) MarshalJSON() (data []byte, err error)
func (*RichGroupRequestSegmentParam) UnmarshalJSON ¶
func (r *RichGroupRequestSegmentParam) UnmarshalJSON(data []byte) error
type RichGroupRequestTurnParam ¶
type RichGroupRequestTurnParam struct { // An integer value that represents the ID of the starting node of the turn. From param.Opt[int64] `json:"from,omitzero"` // An integer value that represents the ID of the ending node of the turn. To param.Opt[int64] `json:"to,omitzero"` // An integer value that represents the ID of a node connecting from and to nodes // of the turn. Via param.Opt[int64] `json:"via,omitzero"` // contains filtered or unexported fields }
func (RichGroupRequestTurnParam) MarshalJSON ¶
func (r RichGroupRequestTurnParam) MarshalJSON() (data []byte, err error)
func (*RichGroupRequestTurnParam) UnmarshalJSON ¶
func (r *RichGroupRequestTurnParam) UnmarshalJSON(data []byte) error
type RichGroupResponse ¶
type RichGroupResponse struct { // Returns the unique ID of the restriction. This ID can be used for update, // delete, get operations on the restriction using the available API methods. ID int64 `json:"id"` // Returns the area to which the restriction belongs to. Area string `json:"area"` // Returns the details of the bounding box containing the restriction. Bbox any `json:"bbox"` // Returns the comments that were provided for the restriction at the time of // creating or updating the request. Comment string `json:"comment"` // The timestamp at which the restriction was created. CreateAt time.Time `json:"create_at" format:"date-time"` // Returns the direction of travel on the segments to which the restriction // applies. // // Any of "forward", "backward", "both". Direction RichGroupResponseDirection `json:"direction"` // The time when the restriction ceases to be in-effect. It is a UNIX timestamp. EndTime float64 `json:"end_time"` // Returns the list of coordinates representing the area that was used to apply the // given restriction. The geofence returned is same as that provided while creating // or updating the restriction. Geofence any `json:"geofence"` // Returns the highway information on which the restriction applies to. If no // highway is impacted by the restriction, then this field is not present in the // response. Highway string `json:"highway"` // Returns an array denoting all the traveling modes the restriction applies on. Mode []string `json:"mode"` // Returns the name of the restriction. This value is same as that provided at the // time of creating or updating the restriction. Name string `json:"name"` // Returns the time periods during which this restriction active or repeats on. The // time values follow a // [given format](https://wiki.openstreetmap.org/wiki/Key:opening_hours). RepeatOn string `json:"repeat_on"` // Returns the type of restriction. This is the same value as provided when // creating or updating the restriction. // // Any of "closure", "maxspeed", "fixedspeed", "parking", "turn", "truck". RestrictionType RichGroupResponseRestrictionType `json:"restriction_type"` // Returns the fixed speed of segments. This field is not present in the response // if the restriction type is not fixedspeed Speed float64 `json:"speed"` // Returns the maximum speed of segments. This field is not present in the response // if the restriction type is not maxspeed SpeedLimit float64 `json:"speed_limit"` // The time when the restriction starts to be in-effect. It is a UNIX timestamp. StartTime float64 `json:"start_time"` // Returns the state of the "restriction" itself - enabled, disabled or deleted. It // does not denote if the restriction is actually in effect or not. // // Any of "enabled", "disabled", "deleted". State RichGroupResponseState `json:"state"` // Returns the status of the restriction at the time of making the request i.e. // whether the restriction is in force or not. It will have one of the following // values: active or inactive. // // Please note that this field can not be directly influenced by the users. It will // always be calculated using the start_time, end_time and repeat_on parameters. // // Any of "active", "inactive". Status RichGroupResponseStatus `json:"status"` // The timestamp at which the restriction was updated. UpdateAt time.Time `json:"update_at" format:"date-time"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Area respjson.Field Bbox respjson.Field Comment respjson.Field CreateAt respjson.Field Direction respjson.Field EndTime respjson.Field Geofence respjson.Field Highway respjson.Field Mode respjson.Field Name respjson.Field RepeatOn respjson.Field RestrictionType respjson.Field Speed respjson.Field SpeedLimit respjson.Field StartTime respjson.Field State respjson.Field Status respjson.Field UpdateAt respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (RichGroupResponse) RawJSON ¶
func (r RichGroupResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*RichGroupResponse) UnmarshalJSON ¶
func (r *RichGroupResponse) UnmarshalJSON(data []byte) error
type RichGroupResponseDirection ¶
type RichGroupResponseDirection string
Returns the direction of travel on the segments to which the restriction applies.
const ( RichGroupResponseDirectionForward RichGroupResponseDirection = "forward" RichGroupResponseDirectionBackward RichGroupResponseDirection = "backward" RichGroupResponseDirectionBoth RichGroupResponseDirection = "both" )
type RichGroupResponseRestrictionType ¶
type RichGroupResponseRestrictionType string
Returns the type of restriction. This is the same value as provided when creating or updating the restriction.
const ( RichGroupResponseRestrictionTypeClosure RichGroupResponseRestrictionType = "closure" RichGroupResponseRestrictionTypeMaxspeed RichGroupResponseRestrictionType = "maxspeed" RichGroupResponseRestrictionTypeFixedspeed RichGroupResponseRestrictionType = "fixedspeed" RichGroupResponseRestrictionTypeParking RichGroupResponseRestrictionType = "parking" RichGroupResponseRestrictionTypeTurn RichGroupResponseRestrictionType = "turn" RichGroupResponseRestrictionTypeTruck RichGroupResponseRestrictionType = "truck" )
type RichGroupResponseState ¶
type RichGroupResponseState string
Returns the state of the "restriction" itself - enabled, disabled or deleted. It does not denote if the restriction is actually in effect or not.
const ( RichGroupResponseStateEnabled RichGroupResponseState = "enabled" RichGroupResponseStateDisabled RichGroupResponseState = "disabled" RichGroupResponseStateDeleted RichGroupResponseState = "deleted" )
type RichGroupResponseStatus ¶
type RichGroupResponseStatus string
Returns the status of the restriction at the time of making the request i.e. whether the restriction is in force or not. It will have one of the following values: active or inactive.
Please note that this field can not be directly influenced by the users. It will always be calculated using the start_time, end_time and repeat_on parameters.
const ( RichGroupResponseStatusActive RichGroupResponseStatus = "active" RichGroupResponseStatusInactive RichGroupResponseStatus = "inactive" )
type RouteReportNewParams ¶
type RouteReportNewParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Takes a route geometry as input and returns the route details. Accepts polyline // and polyline6 encoded geometry as input. // // **Note**: Route geometries generated from sources other than // [NextBillion.ai](http://NextBillion.ai) services, are not supported in this // version. OriginalShape string `json:"original_shape,required"` // Specify the encoding type of route geometry provided in original_shape input. // Please note that an error is returned when this parameter is not specified while // an input is added to original_shape parameter. // // Any of "polyline", "polyline6". OriginalShapeType RouteReportNewParamsOriginalShapeType `json:"original_shape_type,omitzero,required"` // contains filtered or unexported fields }
func (RouteReportNewParams) MarshalJSON ¶
func (r RouteReportNewParams) MarshalJSON() (data []byte, err error)
func (RouteReportNewParams) URLQuery ¶
func (r RouteReportNewParams) URLQuery() (v url.Values, err error)
URLQuery serializes RouteReportNewParams's query parameters as `url.Values`.
func (*RouteReportNewParams) UnmarshalJSON ¶
func (r *RouteReportNewParams) UnmarshalJSON(data []byte) error
type RouteReportNewParamsOriginalShapeType ¶
type RouteReportNewParamsOriginalShapeType string
Specify the encoding type of route geometry provided in original_shape input. Please note that an error is returned when this parameter is not specified while an input is added to original_shape parameter.
const ( RouteReportNewParamsOriginalShapeTypePolyline RouteReportNewParamsOriginalShapeType = "polyline" RouteReportNewParamsOriginalShapeTypePolyline6 RouteReportNewParamsOriginalShapeType = "polyline6" )
type RouteReportNewResponse ¶
type RouteReportNewResponse struct { // An array of objects returning encoded geometry of the routes. Each object // represents an individual route in the input. Geometry []string `json:"geometry"` // Returns the details of route segments in each state or country that the route // passes through. Each object represents an individual route in the input request. Mileage []RouteReportNewResponseMileage `json:"mileage"` // Displays the error message in case of a failed request or operation. Please note // that this parameter is not returned in the response in case of a successful // request. Msg string `json:"msg"` // An array of objects returning a summary of the route with information about // tolls, bridges, tunnels, segments, maximum speeds and more. Each array // represents an individual route in the input request. RoadSummary []RouteReportNewResponseRoadSummary `json:"road_summary"` // A string indicating the state of the response. On normal responses, the value // will be Ok. Indicative HTTP error codes are returned for different errors. See // the // [**API Errors Codes**](https://app.reapi.com/ws/hmx8aL45B5jjrJa8/p/vNNilNksLVz675pI/s/ealJmVGjTQv4x5Wi/edit/path/VYzo7gOlRsQQZo0U#api-error-codes) // section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Geometry respjson.Field Mileage respjson.Field Msg respjson.Field RoadSummary respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (RouteReportNewResponse) RawJSON ¶
func (r RouteReportNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*RouteReportNewResponse) UnmarshalJSON ¶
func (r *RouteReportNewResponse) UnmarshalJSON(data []byte) error
type RouteReportNewResponseMileage ¶
type RouteReportNewResponseMileage struct { // Returns the details of road segments that the route covers in different states // and countries. Segment RouteReportNewResponseMileageSegment `json:"segment"` // Returns a summary of distances that the route covers in different states and // countries. Summary RouteReportNewResponseMileageSummary `json:"summary"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Segment respjson.Field Summary respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (RouteReportNewResponseMileage) RawJSON ¶
func (r RouteReportNewResponseMileage) RawJSON() string
Returns the unmodified JSON received from the API
func (*RouteReportNewResponseMileage) UnmarshalJSON ¶
func (r *RouteReportNewResponseMileage) UnmarshalJSON(data []byte) error
type RouteReportNewResponseMileageSegment ¶
type RouteReportNewResponseMileageSegment struct { // An array of objects containing country-wise break up of the route segments. Each // object returns the segment details of a different country. Country []RouteReportNewResponseMileageSegmentCountry `json:"country"` // An array of objects containing state-wise break up of the route segments. Each // object returns the segment details of a different state. State []RouteReportNewResponseMileageSegmentState `json:"state"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Country respjson.Field State respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the details of road segments that the route covers in different states and countries.
func (RouteReportNewResponseMileageSegment) RawJSON ¶
func (r RouteReportNewResponseMileageSegment) RawJSON() string
Returns the unmodified JSON received from the API
func (*RouteReportNewResponseMileageSegment) UnmarshalJSON ¶
func (r *RouteReportNewResponseMileageSegment) UnmarshalJSON(data []byte) error
type RouteReportNewResponseMileageSegmentCountry ¶
type RouteReportNewResponseMileageSegmentCountry struct { // Represents the total distance of this segment, in meters. Distance float64 `json:"distance"` // Represents a sequence of ‘n’ consecutive vertices in the route geometry starting // from the offset, forming a continuous section of route with a distance indicated // in distancefield. Length int64 `json:"length"` // Represents the index value of the vertex of current segment's starting point in // route geometry. First vertex in the route geometry has an offset of 0. Offset int64 `json:"offset"` // Returns the name of the country in which the segment lies. Value string `json:"value"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Distance respjson.Field Length respjson.Field Offset respjson.Field Value respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (RouteReportNewResponseMileageSegmentCountry) RawJSON ¶
func (r RouteReportNewResponseMileageSegmentCountry) RawJSON() string
Returns the unmodified JSON received from the API
func (*RouteReportNewResponseMileageSegmentCountry) UnmarshalJSON ¶
func (r *RouteReportNewResponseMileageSegmentCountry) UnmarshalJSON(data []byte) error
type RouteReportNewResponseMileageSegmentState ¶
type RouteReportNewResponseMileageSegmentState struct { // Represents the real distance of this segment, in meters. Distance float64 `json:"distance"` // Represents a sequence of ‘n’ consecutive vertices in the route geometry starting // from the offset, forming a continuous section of route with a distance indicated // in distancefield. Length int64 `json:"length"` // Represents the index value of the vertex of current segment's starting point in // route geometry. First vertex in the route geometry has an offset of 0. Offset int64 `json:"offset"` // Returns the name of the state in which the segment lies. Value string `json:"value"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Distance respjson.Field Length respjson.Field Offset respjson.Field Value respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (RouteReportNewResponseMileageSegmentState) RawJSON ¶
func (r RouteReportNewResponseMileageSegmentState) RawJSON() string
Returns the unmodified JSON received from the API
func (*RouteReportNewResponseMileageSegmentState) UnmarshalJSON ¶
func (r *RouteReportNewResponseMileageSegmentState) UnmarshalJSON(data []byte) error
type RouteReportNewResponseMileageSummary ¶
type RouteReportNewResponseMileageSummary struct { // A break up of country-wise distances that the route covers in key:value pair // format. Country any `json:"country"` // A break up of state-wise distances that the route covers specified in key:value // pair format. State any `json:"state"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Country respjson.Field State respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns a summary of distances that the route covers in different states and countries.
func (RouteReportNewResponseMileageSummary) RawJSON ¶
func (r RouteReportNewResponseMileageSummary) RawJSON() string
Returns the unmodified JSON received from the API
func (*RouteReportNewResponseMileageSummary) UnmarshalJSON ¶
func (r *RouteReportNewResponseMileageSummary) UnmarshalJSON(data []byte) error
type RouteReportNewResponseRoadSummary ¶
type RouteReportNewResponseRoadSummary struct { // Returns the segment-wise road class and max speed information of the route. Segment RouteReportNewResponseRoadSummarySegment `json:"segment"` // Returns an overview of the route with information about trip distance, duration // and road class details among others. Summary RouteReportNewResponseRoadSummarySummary `json:"summary"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Segment respjson.Field Summary respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (RouteReportNewResponseRoadSummary) RawJSON ¶
func (r RouteReportNewResponseRoadSummary) RawJSON() string
Returns the unmodified JSON received from the API
func (*RouteReportNewResponseRoadSummary) UnmarshalJSON ¶
func (r *RouteReportNewResponseRoadSummary) UnmarshalJSON(data []byte) error
type RouteReportNewResponseRoadSummarySegment ¶
type RouteReportNewResponseRoadSummarySegment struct { // An array of objects returning the maximum speed of different segments that the // route goes through. MaxSpeed []RouteReportNewResponseRoadSummarySegmentMaxSpeed `json:"max_speed"` // An array of objects returning the details of road segments belonging to // different road classes that the route goes through. Each object refers to a // unique road class. RoadClass []RouteReportNewResponseRoadSummarySegmentRoadClass `json:"road_class"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { MaxSpeed respjson.Field RoadClass respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns the segment-wise road class and max speed information of the route.
func (RouteReportNewResponseRoadSummarySegment) RawJSON ¶
func (r RouteReportNewResponseRoadSummarySegment) RawJSON() string
Returns the unmodified JSON received from the API
func (*RouteReportNewResponseRoadSummarySegment) UnmarshalJSON ¶
func (r *RouteReportNewResponseRoadSummarySegment) UnmarshalJSON(data []byte) error
type RouteReportNewResponseRoadSummarySegmentMaxSpeed ¶
type RouteReportNewResponseRoadSummarySegmentMaxSpeed struct { // Returns the total distance of this segment, in meters. Distance int64 `json:"distance"` // Represents a sequence of ‘n’ consecutive vertices in the route geometry starting // from the offset, forming a continuous section of route where the maximum speed // is same and is indicated in value. Length int64 `json:"length"` // Represents the index value of the vertex of current segment's starting point in // route geometry. First vertex in the route geometry has an offset of 0. Offset int64 `json:"offset"` // Denotes the maximum speed of this segment, in kilometers per hour. - A value of // “-1” indicates that the speed is unlimited for this road segment. - A value of // “0” indicates that there is no information about the maximum speed for this road // segment. Value int64 `json:"value"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Distance respjson.Field Length respjson.Field Offset respjson.Field Value respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (RouteReportNewResponseRoadSummarySegmentMaxSpeed) RawJSON ¶
func (r RouteReportNewResponseRoadSummarySegmentMaxSpeed) RawJSON() string
Returns the unmodified JSON received from the API
func (*RouteReportNewResponseRoadSummarySegmentMaxSpeed) UnmarshalJSON ¶
func (r *RouteReportNewResponseRoadSummarySegmentMaxSpeed) UnmarshalJSON(data []byte) error
type RouteReportNewResponseRoadSummarySegmentRoadClass ¶
type RouteReportNewResponseRoadSummarySegmentRoadClass struct { // Returns the total distance of this segment, in meters. Distance int64 `json:"distance"` // Represents a sequence of ‘n’ consecutive vertices in the route geometry starting // from the offset, forming a continuous section of route with a distance indicated // in distancefield. Length int64 `json:"length"` // Represents the index value of the vertex of current segment's starting point in // route geometry. First vertex in the route geometry has an offset of 0. Offset int64 `json:"offset"` // Returns the road class name to which the segment belongs. Value string `json:"value"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Distance respjson.Field Length respjson.Field Offset respjson.Field Value respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (RouteReportNewResponseRoadSummarySegmentRoadClass) RawJSON ¶
func (r RouteReportNewResponseRoadSummarySegmentRoadClass) RawJSON() string
Returns the unmodified JSON received from the API
func (*RouteReportNewResponseRoadSummarySegmentRoadClass) UnmarshalJSON ¶
func (r *RouteReportNewResponseRoadSummarySegmentRoadClass) UnmarshalJSON(data []byte) error
type RouteReportNewResponseRoadSummarySummary ¶
type RouteReportNewResponseRoadSummarySummary struct { // Returns the total distance of the route , in meters. Distance float64 `json:"distance"` // Returns the total duration of the route, in seconds. Duration float64 `json:"duration"` // A boolean value indicating if there are any bridges in the given route. HasBridge bool `json:"has_bridge"` // A boolean value indicating if there are any roundabouts in the given route. HasRoundabout bool `json:"has_roundabout"` // A boolean value indicating if there are any tolls in the given route. HasToll bool `json:"has_toll"` // A boolean value indicating if there are any tunnels in the given route. HasTunnel bool `json:"has_tunnel"` // An object with details about the different types of road classes that the route // goes through. Distance traversed on a given road class is also returned. The // contents of this object follow the key:value pair format. RoadClass any `json:"road_class"` // Returns the total distance travelled on toll roads. This field is present in the // response only when the has_toll property is true. TollDistance float64 `json:"toll_distance"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Distance respjson.Field Duration respjson.Field HasBridge respjson.Field HasRoundabout respjson.Field HasToll respjson.Field HasTunnel respjson.Field RoadClass respjson.Field TollDistance respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Returns an overview of the route with information about trip distance, duration and road class details among others.
func (RouteReportNewResponseRoadSummarySummary) RawJSON ¶
func (r RouteReportNewResponseRoadSummarySummary) RawJSON() string
Returns the unmodified JSON received from the API
func (*RouteReportNewResponseRoadSummarySummary) UnmarshalJSON ¶
func (r *RouteReportNewResponseRoadSummarySummary) UnmarshalJSON(data []byte) error
type RouteReportService ¶
type RouteReportService struct {
Options []option.RequestOption
}
RouteReportService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRouteReportService method instead.
func NewRouteReportService ¶
func NewRouteReportService(opts ...option.RequestOption) (r RouteReportService)
NewRouteReportService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*RouteReportService) New ¶
func (r *RouteReportService) New(ctx context.Context, params RouteReportNewParams, opts ...option.RequestOption) (res *RouteReportNewResponse, err error)
Route Report
type RouteStepCompletionMode ¶
type RouteStepCompletionMode string
Specify the mode of completion to be used for the step. Currently, following values are allowed:
- manual: Steps must be marked as completed manually through the Driver App.
- geofence: Steps are marked as completed automatically based on the entry conditions and geofence specified.
- geofence_manual_fallback: Steps will be marked as completed automatically based on geofence and entry condition configurations but there will also be a provision for manually updating the status in case, geofence detection fails.
const ( RouteStepCompletionModeManual RouteStepCompletionMode = "manual" RouteStepCompletionModeGeofence RouteStepCompletionMode = "geofence" RouteStepCompletionModeGeofenceManualFallback RouteStepCompletionMode = "geofence_manual_fallback" )
type RouteStepGeofenceConfig ¶
type RouteStepGeofenceConfig struct { // Specify the radius of the cicular geofence, in meters. Once specified, the // service will create a geofence with task's location as the center of the circle // having the given radius. Valid values for radius are \[10, 5000\]. Radius float64 `json:"radius"` // Specify the type of the geofence. Currently, circle is the only suppoeted value. // // Any of "circle". Type RouteStepGeofenceConfigType `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Radius respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Specify the configurations of the geofence which will be used to detect presence of the driver and complete the tasks automatically. Please note that this attribute is required when completion_mode is either "geofence" or "geofence_manual_fallback".
func (RouteStepGeofenceConfig) RawJSON ¶
func (r RouteStepGeofenceConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (RouteStepGeofenceConfig) ToParam ¶
func (r RouteStepGeofenceConfig) ToParam() RouteStepGeofenceConfigParam
ToParam converts this RouteStepGeofenceConfig to a RouteStepGeofenceConfigParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with RouteStepGeofenceConfigParam.Overrides()
func (*RouteStepGeofenceConfig) UnmarshalJSON ¶
func (r *RouteStepGeofenceConfig) UnmarshalJSON(data []byte) error
type RouteStepGeofenceConfigParam ¶
type RouteStepGeofenceConfigParam struct { // Specify the radius of the cicular geofence, in meters. Once specified, the // service will create a geofence with task's location as the center of the circle // having the given radius. Valid values for radius are \[10, 5000\]. Radius param.Opt[float64] `json:"radius,omitzero"` // Specify the type of the geofence. Currently, circle is the only suppoeted value. // // Any of "circle". Type RouteStepGeofenceConfigType `json:"type,omitzero"` // contains filtered or unexported fields }
Specify the configurations of the geofence which will be used to detect presence of the driver and complete the tasks automatically. Please note that this attribute is required when completion_mode is either "geofence" or "geofence_manual_fallback".
func (RouteStepGeofenceConfigParam) MarshalJSON ¶
func (r RouteStepGeofenceConfigParam) MarshalJSON() (data []byte, err error)
func (*RouteStepGeofenceConfigParam) UnmarshalJSON ¶
func (r *RouteStepGeofenceConfigParam) UnmarshalJSON(data []byte) error
type RouteStepGeofenceConfigType ¶
type RouteStepGeofenceConfigType string
Specify the type of the geofence. Currently, circle is the only suppoeted value.
const (
RouteStepGeofenceConfigTypeCircle RouteStepGeofenceConfigType = "circle"
)
type RouteStepsRequestMetaParam ¶
type RouteStepsRequestMetaParam struct { // Specify the name of the customer for which the step has to be performed. CustomerName param.Opt[string] `json:"customer_name,omitzero"` // Specify the phone number of the person to be contacted when at step location. CustomerPhoneNumber param.Opt[string] `json:"customer_phone_number,omitzero"` // Specify custom instructions to be carried out while performing the step. Instructions param.Opt[string] `json:"instructions,omitzero"` // contains filtered or unexported fields }
An object to specify any additional details about the task to be associated with the step in the response. The information provided here will be available on the Driver's app under step details. This attribute can be used to provide context about or instructions to the driver for performing the task
func (RouteStepsRequestMetaParam) MarshalJSON ¶
func (r RouteStepsRequestMetaParam) MarshalJSON() (data []byte, err error)
func (*RouteStepsRequestMetaParam) UnmarshalJSON ¶
func (r *RouteStepsRequestMetaParam) UnmarshalJSON(data []byte) error
type RouteStepsRequestParam ¶
type RouteStepsRequestParam struct { // Specify the scheduled arrival time of the driver, as an UNIX timestamp in // seconds, at the step. Please note that: // // - Arrival time for each step should be equal to or greater than the previous // step. // - Past times can not be provided. // - The time provided is used only for informative display on the driver app and // it does not impact or get affected by the route generated. Arrival int64 `json:"arrival,required"` // Specify the location coordinates where the steps should be performed in // [latitude, longitude]. Location []float64 `json:"location,omitzero,required"` // Specify the step type. It can belong to one of the following: start, job , // pickup, delivery, end. A duration is mandatory when the step type is either // layover or a break. // // Any of "start", "job", "pickup", "delivery", "break", "layover", "end". Type RouteStepsRequestType `json:"type,omitzero,required"` // Specify the postal address for the step. Address param.Opt[string] `json:"address,omitzero"` // Specify the ID of the document template to be used for collecting proof of // completion for the step. If not specified, the document template specified at // the route level will be used for the step. Use the // [Documents API](https://docs.nextbillion.ai/docs/dispatches/documents-api) to // create, read and manage the document templates. // // Please note that the document template ID can not be assigned to following step // types - start, end, break, layover. DocumentTemplateID param.Opt[string] `json:"document_template_id,omitzero"` // Specify the duration of the layover or break type steps, in seconds. Please note // it is mandatory when step type is either "layover" or "break". Duration param.Opt[int64] `json:"duration,omitzero"` // Specify the mode of completion to be used for the step. Currently, following // values are allowed: // // - manual: Steps must be marked as completed manually through the Driver App. // - geofence: Steps are marked as completed automatically based on the entry // conditions and geofence specified. // - geofence_manual_fallback: Steps will be marked as completed automatically // based on geofence and entry condition configurations but there will also be a // provision for manually updating the status in case, geofence detection fails. // // Any of "manual", "geofence", "geofence_manual_fallback". CompletionMode RouteStepCompletionMode `json:"completion_mode,omitzero"` // Specify the configurations of the geofence which will be used to detect presence // of the driver and complete the tasks automatically. Please note that this // attribute is required when completion_mode is either "geofence" or // "geofence_manual_fallback". GeofenceConfig RouteStepGeofenceConfigParam `json:"geofence_config,omitzero"` // An object to specify any additional details about the task to be associated with // the step in the response. The information provided here will be available on the // Driver's app under step details. This attribute can be used to provide context // about or instructions to the driver for performing the task Meta RouteStepsRequestMetaParam `json:"meta,omitzero"` // contains filtered or unexported fields }
The properties Arrival, Location, Type are required.
func (RouteStepsRequestParam) MarshalJSON ¶
func (r RouteStepsRequestParam) MarshalJSON() (data []byte, err error)
func (*RouteStepsRequestParam) UnmarshalJSON ¶
func (r *RouteStepsRequestParam) UnmarshalJSON(data []byte) error
type RouteStepsRequestType ¶
type RouteStepsRequestType string
Specify the step type. It can belong to one of the following: start, job , pickup, delivery, end. A duration is mandatory when the step type is either layover or a break.
const ( RouteStepsRequestTypeStart RouteStepsRequestType = "start" RouteStepsRequestTypeJob RouteStepsRequestType = "job" RouteStepsRequestTypePickup RouteStepsRequestType = "pickup" RouteStepsRequestTypeDelivery RouteStepsRequestType = "delivery" RouteStepsRequestTypeBreak RouteStepsRequestType = "break" RouteStepsRequestTypeLayover RouteStepsRequestType = "layover" RouteStepsRequestTypeEnd RouteStepsRequestType = "end" )
type RouteStepsResponse ¶
type RouteStepsResponse struct { // Returns the unique ID of the step. ID string `json:"id"` // Returns the postal address where the step is executed. Its value is the same as // that specified in the input request when configuring the step details. Address string `json:"address"` // Returns the scheduled arrival time of the driver at the step as an UNIX // timestamp, in seconds precision. It is the same as that specified in the input // request while configuring the step details. // // The timestamp returned here is only for informative display on the driver's app // and it does not impact or get affected by the route generated. Arrival int64 `json:"arrival"` Completion RouteStepsResponseCompletion `json:"completion"` // Represents the timestamp of the creation in seconds since the Unix epoch. // Example: 1738743999. CreatedAt int64 `json:"created_at"` // Returns the details of the document that was used for collecting the proof of // completion for the step. In case no document template ID was provided for the // given step, then a null value is returned. Each object represents a new field in // the document. DocumentSnapshot []any `json:"document_snapshot"` // Returns the duration for layover or break type steps. Duration int64 `json:"duration"` // Returns the location coordinates where the step is executed. Location []float64 `json:"location"` // An object returning custom details about the step that were configured in the // input request while configuring the step details. The information returned here // will be available for display on the Driver's app under step details. Meta RouteStepsResponseMeta `json:"meta"` // Returns a unique short ID of the step for easier referencing and displaying // purposes. ShortID string `json:"short_id"` // Returns the step type. It can belong to one of the following: start, job , // pickup, delivery, break, layover , and end. For any given step, it would be the // same as that specified in the input request while configuring the step details. Type string `json:"type"` // Represents the timestamp of the last update in seconds since the Unix epoch. // Example: 1738743999. UpdatedAt int64 `json:"updated_at"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Address respjson.Field Arrival respjson.Field Completion respjson.Field CreatedAt respjson.Field DocumentSnapshot respjson.Field Duration respjson.Field Location respjson.Field Meta respjson.Field ShortID respjson.Field Type respjson.Field UpdatedAt respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (RouteStepsResponse) RawJSON ¶
func (r RouteStepsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*RouteStepsResponse) UnmarshalJSON ¶
func (r *RouteStepsResponse) UnmarshalJSON(data []byte) error
type RouteStepsResponseCompletion ¶
type RouteStepsResponseCompletion struct { // Represents the timestamp of the completion in seconds since the Unix epoch. // Example: 1738743999. CompletedAt int64 `json:"completed_at"` // Specify the mode of completion to be used for the step. Currently, following // values are allowed: // // - manual: Steps must be marked as completed manually through the Driver App. // - geofence: Steps are marked as completed automatically based on the entry // conditions and geofence specified. // - geofence_manual_fallback: Steps will be marked as completed automatically // based on geofence and entry condition configurations but there will also be a // provision for manually updating the status in case, geofence detection fails. // // Any of "manual", "geofence", "geofence_manual_fallback". CompletedByMode RouteStepCompletionMode `json:"completed_by_mode"` // Specify the mode of completion to be used for the step. Currently, following // values are allowed: // // - manual: Steps must be marked as completed manually through the Driver App. // - geofence: Steps are marked as completed automatically based on the entry // conditions and geofence specified. // - geofence_manual_fallback: Steps will be marked as completed automatically // based on geofence and entry condition configurations but there will also be a // provision for manually updating the status in case, geofence detection fails. // // Any of "manual", "geofence", "geofence_manual_fallback". CompletionMode RouteStepCompletionMode `json:"completion_mode"` // A key-value map storing form submission data, where keys correspond to field // labels and values can be of any type depend on the type of according document // item. Document DocumentSubmission `json:"document"` // Represents the timestamp of the last doc modification in seconds since the Unix // epoch. Example: 1738743999. DocumentModifiedAt int64 `json:"document_modified_at"` // Specify the configurations of the geofence which will be used to detect presence // of the driver and complete the tasks automatically. Please note that this // attribute is required when completion_mode is either "geofence" or // "geofence_manual_fallback". GeofenceConfig RouteStepGeofenceConfig `json:"geofence_config"` // Status of the step. // // Any of "scheduled", "completed", "canceled". Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { CompletedAt respjson.Field CompletedByMode respjson.Field CompletionMode respjson.Field Document respjson.Field DocumentModifiedAt respjson.Field GeofenceConfig respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (RouteStepsResponseCompletion) RawJSON ¶
func (r RouteStepsResponseCompletion) RawJSON() string
Returns the unmodified JSON received from the API
func (*RouteStepsResponseCompletion) UnmarshalJSON ¶
func (r *RouteStepsResponseCompletion) UnmarshalJSON(data []byte) error
type RouteStepsResponseMeta ¶
type RouteStepsResponseMeta struct { // Returns the customer name associated with the step. It can configured in the // input request using the metadata attribute of the step. CustomerName string `json:"customer_name"` // Returns the customer's phone number associated with the step. It can configured // in the input request using the metadata attribute of the step. CustomerPhoneNumber string `json:"customer_phone_number"` // Returns the custom instructions to carry out while performing the task. These // instructions can be provided at the time of configuring the step details in the // input request. Instructions string `json:"instructions"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { CustomerName respjson.Field CustomerPhoneNumber respjson.Field Instructions respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object returning custom details about the step that were configured in the input request while configuring the step details. The information returned here will be available for display on the Driver's app under step details.
func (RouteStepsResponseMeta) RawJSON ¶
func (r RouteStepsResponseMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*RouteStepsResponseMeta) UnmarshalJSON ¶
func (r *RouteStepsResponseMeta) UnmarshalJSON(data []byte) error
type RoutingResponse ¶
type RoutingResponse struct { // Returns the configuration of approaches for each step, that is used when // generating the route to help the driver with turn-by-turn navigation. Approaches string `json:"approaches"` // Returns the objects and maneuvers that will be avoided in the route that is // built when driver starts the in-app turn-by-turn navigation. Avoid string `json:"avoid"` // Returns the hazardous cargo type that the truck is carrying. The hazardous cargo // type is used to determine the compliant routes that the driver can take while // navigating the dispatched route. HazmatType string `json:"hazmat_type"` // Returns the driving mode that is used to build the route when driver starts the // in-app turn-by-turn navigation. Mode string `json:"mode"` // Returns the total load per axle of the truck, in tonnes, used to determine // compliant routes that the driver can take when he starts navigating the // dispatched route. TruckAxleLoad string `json:"truck_axle_load"` // Returns the truck dimensions, in centimeters, used to determine compliant routes // that the driver can take when he starts navigating the dispatched route. TruckSize string `json:"truck_size"` // Returns the truck weight that will determine compliant routes that can be used // by the driver during navigation. TruckWeight string `json:"truck_weight"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Approaches respjson.Field Avoid respjson.Field HazmatType respjson.Field Mode respjson.Field TruckAxleLoad respjson.Field TruckSize respjson.Field TruckWeight respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object returning the routing characteristics that are used to generate the route and turn-by-turn navigation steps for the dispatched route. The route and navigation steps are available when driver uses the in-app navigation.
Please note the routing characteristics returned here are the same as those configured in the input request. The fields which were not specified in the input will be returned as blanks.
func (RoutingResponse) RawJSON ¶
func (r RoutingResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*RoutingResponse) UnmarshalJSON ¶
func (r *RoutingResponse) UnmarshalJSON(data []byte) error
type SearchResponse ¶
type SearchResponse struct { // A data object containing the search result. Data SearchResponseData `json:"data"` // Displays the error message in case of a failed request. If the request is // successful, this field is not present in the response. Message string `json:"message"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Message respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SearchResponse) RawJSON ¶
func (r SearchResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SearchResponse) UnmarshalJSON ¶
func (r *SearchResponse) UnmarshalJSON(data []byte) error
type SearchResponseData ¶
type SearchResponseData struct { // An array of objects with details of the asset(s) returned in the search result. // Each object represents one asset Assets []SearchResponseDataAsset `json:"assets"` // An object with pagination details of the search results. Use this object to // implement pagination in your application. Page Pagination `json:"page"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Assets respjson.Field Page respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
A data object containing the search result.
func (SearchResponseData) RawJSON ¶
func (r SearchResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SearchResponseData) UnmarshalJSON ¶
func (r *SearchResponseData) UnmarshalJSON(data []byte) error
type SearchResponseDataAsset ¶
type SearchResponseDataAsset struct { // ID of asset which was last located inside the specified area in the input // request. This is the same ID that was generated/provided at the time of creating // the asset. ID string `json:"id"` // A UNIX timestamp in seconds representing the time at which the asset was // created. CreatedAt int64 `json:"created_at"` // Description of the asset. The value would be the same as that provided for the // description parameter at the time of creating or updating the asset. Description string `json:"description"` // An object with details of the tracked location. Please note that if there are no // tracking records for an asset, no location data will be returned. LatestLocation TrackLocation `json:"latest_location"` // Any valid json object data. Can be used to save customized data. Max size is // 65kb. MetaData MetaData `json:"meta_data"` // Name of asset. The value would be the same as that provided for the name // parameter at the time of creating or updating the asset. Name string `json:"name"` // An object returning the sorting details of the asset as per the configuration // specified in the input. RankingInfo SearchResponseDataAssetRankingInfo `json:"ranking_info"` // **This parameter will be deprecated soon! Please move existing tags to // attributes parameter.** // // Tags associated with the asset. Tags []string `json:"tags"` // A UNIX epoch timestamp in seconds representing the last time when the asset was // tracked. TrackedAt int64 `json:"tracked_at"` // A UNIX timestamp in seconds representing the time at which the asset was last // updated. UpdatedAt int64 `json:"updated_at"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field CreatedAt respjson.Field Description respjson.Field LatestLocation respjson.Field MetaData respjson.Field Name respjson.Field RankingInfo respjson.Field Tags respjson.Field TrackedAt respjson.Field UpdatedAt respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SearchResponseDataAsset) RawJSON ¶
func (r SearchResponseDataAsset) RawJSON() string
Returns the unmodified JSON received from the API
func (*SearchResponseDataAsset) UnmarshalJSON ¶
func (r *SearchResponseDataAsset) UnmarshalJSON(data []byte) error
type SearchResponseDataAssetRankingInfo ¶
type SearchResponseDataAssetRankingInfo struct { // Driving distance between the asset and the sort_destination. Distance float64 `json:"distance"` // Driving duration between the asset and the sort_destination. Please note this // field in not returned in the response when sort_by = straight_distance . Duration float64 `json:"duration"` // Index of the ranked asset. The index value starts from 0. Index int64 `json:"index"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Distance respjson.Field Duration respjson.Field Index respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object returning the sorting details of the asset as per the configuration specified in the input.
func (SearchResponseDataAssetRankingInfo) RawJSON ¶
func (r SearchResponseDataAssetRankingInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*SearchResponseDataAssetRankingInfo) UnmarshalJSON ¶
func (r *SearchResponseDataAssetRankingInfo) UnmarshalJSON(data []byte) error
type ShipmentDeliveryParam ¶
type ShipmentDeliveryParam struct { // Indicate the ID of this shipment delivery step. An error will be reported if // there are duplicate IDs for multiple shipment deliveries. The IDs are case // sensitive. Please note id is mandatory when using the shipments attribute. ID string `json:"id,required"` // Indicate the index of location for this shipment delivery. The index references // the locations present in the location array. The valid range of value is \[0, // length of location array). // // Please note location_index is mandatory when using the shipment attribute. LocationIndex int64 `json:"location_index,required"` // Specify a custom description for the shipment delivery step. Description param.Opt[string] `json:"description,omitzero"` // It determines the allowable delay, in seconds, to begin a shipment delivery // after its designated time window has concluded. Please note that this parameter // would override the constraint.max_visit_lateness (global) if both are specified. MaxVisitLateness param.Opt[int64] `json:"max_visit_lateness,omitzero"` // Use this parameter to prioritize completing the shipment delivery relative to // certain other tasks. A task configured with a sequence_order of 2 will be done // after the task with sequence_order of 1, but before the task with sequence_order // of 3. Valid range of values for this input is \[0,100\]. // // Please note that: // // - The shipment delivery's sequence order must be greater than or equal to its // corresponding pickup's sequence order. // // - Only the tasks within the same route are compared and ordered as per their // sequence_order. // // - Tasks without a sequence_order are not involved in the comparison. // // - Following is the precedence of sequence_order when used along side some of the // other constraints: // // - relations are prioritized over sequence_order comparisons. // // - sequence_order will override order_grouping configurations. SequenceOrder param.Opt[int64] `json:"sequence_order,omitzero"` // Provide the time duration, in seconds, needed to complete the shipment delivery. // Default value is 0. Service param.Opt[int64] `json:"service,omitzero"` // Specify the set-up duration, in seconds, for the delivery. setup is the one-time // effort needed apart from working on the original task- for example, effort to // record some information for compliance, or effort to set-up the equipment, or // perform any other action for completing all steps required to fulfil the job. // // Please note that setup time is applied only once for a given task location. // setup time, unlike service time, is not repeated in case there are multiple // tasks at the same location. Setup param.Opt[int64] `json:"setup,omitzero"` // Specify any custom data that should be attached along with delivery fulfilment // details in the step attribute of the optimized solution. Users can leverage this // property to provide additional details/context when sharing information about // the delivery step with integrated systems (TMS, Fleet Management, Driver // dispatch etc). // // Please note that the metadata content must always be specified in a key : value // pair format, where the “key” is always a string. Metadata any `json:"metadata,omitzero"` // Describe time periods within which the shipment delivery should start. The time // periods should be expressed as a UNIX timestamp in seconds. // // Please note that the time periods should not overlap with each other and should // always follow the format of \[start_timestamp, end_timestamp\]. TimeWindows [][]int64 `json:"time_windows,omitzero"` // contains filtered or unexported fields }
Specify the details of the delivery step of the shipment.
The properties ID, LocationIndex are required.
func (ShipmentDeliveryParam) MarshalJSON ¶
func (r ShipmentDeliveryParam) MarshalJSON() (data []byte, err error)
func (*ShipmentDeliveryParam) UnmarshalJSON ¶
func (r *ShipmentDeliveryParam) UnmarshalJSON(data []byte) error
type ShipmentParam ¶
type ShipmentParam struct { // Specify the details of the delivery step of the shipment. Delivery ShipmentDeliveryParam `json:"delivery,omitzero,required"` // Specify the details of the pickup step of the shipment. Pickup ShipmentPickupParam `json:"pickup,omitzero,required"` // Specify whether the shipment route should follow LIFO (last in, first out). Use // this parameter when the loading or unloading sequence of cargo is important. The // default value is \false\. FollowLifoOrder param.Opt[bool] `json:"follow_lifo_order,omitzero"` // Specify a joint order group ID that this shipment is associated with. Tasks // having the same joint order group ID are treated as a single unit: either all // tasks in the group are assigned, or none are. Users can add tasks of both jobs // and shipments types to a single joint order group by using the same unique ID. // Please note that: // // - Each shipment in a single joint order group will be fulfilled by a unique // vehicle. // - Shipments belonging to a joint order group can be served in any sequence while // maintaining the pickup -> delivery sequence for an individual shipment. // - Joint order settings will not be effective if \solution\ or \relations\ // attributes are also provided in the input request. JointOrder param.Opt[int64] `json:"joint_order,omitzero"` // Use this parameter to limit the drive time for which a shipment stays in the // vehicle. The time-in-vehicle calculations start once the pickup leg of shipment // is completed after serving any setup and service time that may have been // configured for it. For the delivery leg, time-in-vehicle calculations wouldn’t // consider any setup and service time that needs to be served for completing the // delivery. The service or setup times of other tasks performed in between will // also be not accumulated against the time-in-vehicle limit. // // Please note that this property would be overridden if any relations // configuration is used except for “precedence” type. If “precedence” type // relations is used then max_time_in_vehicle will override it. MaxTimeInVehicle param.Opt[int64] `json:"max_time_in_vehicle,omitzero"` // Specify the cost of keeping this shipment unassigned, namely, the cost of // outsourcing the shipment. When provided, the optimizer weighs the cost of // assigning the shipment against the cost of keeping it unassigned and chooses a // solution with lower cost. In the solution, the outsourcing_cost of unassigned // shipments is added to the total cost of the solution. // // If the outsourcing_cost is not provided, which is to say that the shipment can // not be outsourced, then the optimizer tries to fulfill the shipment irrespective // of the cost incurred, subject to other constraints. // // Please note that revenue and outsourcing_cost can not be specified // simultaneously for a shipment. Also, the outsourcing_cost would override the // priority settings of the shipment. OutsourcingCost param.Opt[int64] `json:"outsourcing_cost,omitzero"` // Describe the priority of this shipment. The valid values are in the range of // \[0, 100\]. Default value is 0. // // Please note that setting a priority will only decide whether this shipment will // be assigned or not, but has nothing to do with the sequence of fulfilling // shipments. Priority param.Opt[int64] `json:"priority,omitzero"` // Specify the revenue earned by completing this shipment. The optimizer uses the // revenue input to identify the potential profit earned by fulfilling this // shipment after taking into account the costs incurred to do so. // Theoptions.objective and vehicles.costs input are taken into account to identify // the costs of fulfilling the shipment. // // In general, the optimizer will prefer fulfilling the tasks with higher profits // over the tasks with lower profits, should it need to reject some tasks in order // to honor other constraints. In case the profit from fulfilling a shipment is // negative, it will remain unassigned whatsoever. Revenue param.Opt[int64] `json:"revenue,omitzero"` // This parameter defines the quantity that needs to be shipped. This attribute // supports multidimensional quantities, to support shipment of quantities of // different units/dimensions. It is recommended to keep the dimensions of amount // in shipments and that of capacity in vehicles consistent. // // Please note that the amount will be added to the assigned vehicle’s initial // load. // // Read more about the behavior of this attribute in the // [Multi-Dimensional Parameters](#multi-dimensional-parameters) section. Amount []int64 `json:"amount,omitzero"` // Use this parameter to specify the type of loads which are incompatible with the // shipment’s load type. Once this property is configured, the shipment can only be // serviced by a vehicle which has not serviced any other task with an incompatible // load_types . Add multiple load types to indicate all the types which are // incompatible for this shipment. The incompatible load type considerations are // ignored for the first task of the route. // // For example, an input value of \[“groceries”, “food”\] means that shipment’s // load is incompatible with both groceries and food type of loads. Consequently, // the optimizer will not assign this shipment to a vehicle which has served any // task with load_types as either groceries or food. // // Please note that if the shipment is part of any relations then, configured // incompatible_load_types might be ignored. IncompatibleLoadTypes []string `json:"incompatible_load_types,omitzero"` // Use this parameter to specify the type of loads for the given shipment. Once // this property is configured, the shipment can not be served by a vehicle which // has serviced any task whose load is incompatible with any of theload_types // provided in this input. The load type considerations are ignored for the first // task of the route. // // For example, an input value of \[“groceries”, “food”\] means that shipment’s // load characteristics belong to either one or both types. Consequently, the // optimizer will assign this shipment to a vehicle which has served other tasks // whose incompatible_load_types do not contain either groceries or food. // // Please note that if the shipment is part of any relations then, configured // load_types might be ignored. LoadTypes []string `json:"load_types,omitzero"` // Define the skills needed to complete the shipment. This attribute supports // multidimensional skills allowing users to add multiple skills for a shipment. // // Read more about the behavior of this attribute in the // [Multi-Dimensional Parameters](#multi-dimensional-parameters) section. Skills []int64 `json:"skills,omitzero"` // Specify the dimensions and alignment configurations for the cargo associated // with the shipment. These inputs will be used to arrange the items into the // loading compartment of the vehicle to utilize the three-dimensional space. If a // shipment consists of several different items, each with its own dimensions, // please specify the final characteristics for the task: total height, total // depth, total width. // // Please note that vehicles which contain the volume input, will only be // considered for arranging such items. Volume ShipmentVolumeParam `json:"volume,omitzero"` // An array of integers specifying the IDs of the zone(s) that this shipment // belongs to. The shipment can be fulfilled by all vehicles which are allowed to // complete tasks in the zone(s) assigned to this shipment. If the pickup and // delivery steps belong to different zones, then a vehicle should be allowed to // fulfil tasks in both zones to take up such shipments. Please note following // points about shipment zones: // // - If zone IDs are provided for any one of the shipments, then all other // shipments should also be specified with zone IDs. Zone IDs provided here will // override any zone geometries provided in the zones attribute and these IDs // will be used for allocating appropriate vehicles. // - Shipment steps can be auto-allocated to zones if this parameter is not // specified while the zone geometries (either zones.geometry or // zones.geofence_id) are provided. // - Shipments not falling in any zones can be fulfilled by only those vehicles // which are allowed to take up tasks outside zones as well. Refer to vehicles // attribute for more information. Zones []int64 `json:"zones,omitzero"` // contains filtered or unexported fields }
The properties Delivery, Pickup are required.
func (ShipmentParam) MarshalJSON ¶
func (r ShipmentParam) MarshalJSON() (data []byte, err error)
func (*ShipmentParam) UnmarshalJSON ¶
func (r *ShipmentParam) UnmarshalJSON(data []byte) error
type ShipmentPickupParam ¶
type ShipmentPickupParam struct { // Indicate the ID of this shipment pickup step. An error will be reported if there // are duplicate IDs for multiple shipment pick-ups. The IDs are case-sensitive. // Please note id is mandatory when using the shipments attribute. ID string `json:"id,required"` // Indicate the index of the location for this shipment pickup. The index // references the locations present in the location array. The valid range of value // is \[0, length of location array). LocationIndex int64 `json:"location_index,required"` // Specify a custom description for the shipment pickup step. Description param.Opt[string] `json:"description,omitzero"` // It determines the allowable delay, in seconds, to begin a shipment pickup after // its designated time window has concluded. Please note that this parameter would // override the constraint.max_visit_lateness (global) if both are specified. MaxVisitLateness param.Opt[int64] `json:"max_visit_lateness,omitzero"` // Use this parameter to prioritize completing the shipment pickup relative to // certain other tasks. A task configured with a sequence_order of 2 will be done // after the task with sequence_order of 1, but before the task with sequence_order // of 3. Valid range of values for this input is \[0,100\]. // // Please note that: // // - The shipment pickups's sequence order must be lesser than or equal to its // corresponding delivery's sequence order. // // - Only the tasks within the same route are compared and ordered as per their // sequence_order. // // - Tasks without a sequence_order are not involved in the comparison. // // - Following is the precedence of sequence_order when used along side some of the // other constraints: // // - relations are prioritized over sequence_order comparisons. // // - sequence_order will override order_grouping configurations. SequenceOrder param.Opt[int64] `json:"sequence_order,omitzero"` // Provide the time duration, in seconds, needed to complete the shipment pickup. // Default value is 0. Service param.Opt[int64] `json:"service,omitzero"` // Specify the set-up duration, in seconds, for the pickup. setup is the one-time // effort needed apart from working on the original task- for example, effort to // record some information for compliance, or effort to set-up the equipment, or // perform any other action for completing all steps required to fulfil the job. // // Please note that setup time is applied only once for a given task location. // setup time, unlike service time, is not repeated in case there are multiple // tasks at the same location. Setup param.Opt[int64] `json:"setup,omitzero"` // Specify any custom data that should be attached along with pickup fulfilment // details in the steps attribute of the optimized solution. Users can leverage // this property to provide additional details/context when sharing information // about the pickup step with integrated systems (TMS, Fleet Management, Driver // dispatch etc). // // Please note that the metadata content must always be specified in akey : value // pair format, where the “key” is always a string. Metadata any `json:"metadata,omitzero"` // Describe time periods within which the shipment pickup should be start. The time // periods should be expressed as a UNIX timestamp in seconds. // // Please note that the time periods should not overlap with each other and should // always follow the format of \[start_timestamp, end_timestamp\] TimeWindows [][]int64 `json:"time_windows,omitzero"` // contains filtered or unexported fields }
Specify the details of the pickup step of the shipment.
The properties ID, LocationIndex are required.
func (ShipmentPickupParam) MarshalJSON ¶
func (r ShipmentPickupParam) MarshalJSON() (data []byte, err error)
func (*ShipmentPickupParam) UnmarshalJSON ¶
func (r *ShipmentPickupParam) UnmarshalJSON(data []byte) error
type ShipmentVolumeParam ¶
type ShipmentVolumeParam struct { // Cargo length, in meters. Depth param.Opt[float64] `json:"depth,omitzero"` // Cargo height, in meters. Height param.Opt[float64] `json:"height,omitzero"` // Cargo width, in meters. Width param.Opt[float64] `json:"width,omitzero"` // Refers to the orientation of the cargo in the loading compartment. It supports // the following values: // // - **" "** : A blank space to indicate that the dimension check for the cargo // should be skipped. This is also the default value. // - **strict :** In this orientation, the cargo must fit within the vehicle’s // dimensions exactly as is—no rotation is allowed. All dimensions of the cargo // must be less than or equal to the corresponding dimensions of the vehicle. If // any dimension exceeds that of the vehicle, the cargo cannot be loaded. // - **parallel :** With parallel orientation, the cargo can be rotated around any // one of the axes to help it fit into the loading compartment. For example, if // the cargo is wider than the vehicle, it can still be loaded by rotating it // around the vertical axis (so the width aligns with the vehicle’s depth) or the // horizontal axis (so the width aligns with the vehicle’s height). Using this // orientation, even a cargo whose one dimension is larger than the corresponding // dimension of the vehicle but smaller than other dimensions, can also be // loaded. // - **fixed_bottom :** In this orientation, the cargo can only be rotated around // the vertical axis, meaning its base stays fixed and it cannot be tilted or // turned over. The height of the cargo remains aligned with the vehicle’s height // and cannot be adjusted. As a result, if the cargo’s height exceeds the // vehicle’s available height, it cannot be loaded into the compartment. // // Any of "strict", "parallel", "fixed_bottom". Alignment string `json:"alignment,omitzero"` // contains filtered or unexported fields }
Specify the dimensions and alignment configurations for the cargo associated with the shipment. These inputs will be used to arrange the items into the loading compartment of the vehicle to utilize the three-dimensional space. If a shipment consists of several different items, each with its own dimensions, please specify the final characteristics for the task: total height, total depth, total width.
Please note that vehicles which contain the volume input, will only be considered for arranging such items.
func (ShipmentVolumeParam) MarshalJSON ¶
func (r ShipmentVolumeParam) MarshalJSON() (data []byte, err error)
func (*ShipmentVolumeParam) UnmarshalJSON ¶
func (r *ShipmentVolumeParam) UnmarshalJSON(data []byte) error
type SimpleResp ¶
type SimpleResp struct { // Displays the error message in case of a failed request. If the request is // successful, this field is not present in the response. Message string `json:"message"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Message respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SimpleResp) RawJSON ¶
func (r SimpleResp) RawJSON() string
Returns the unmodified JSON received from the API
func (*SimpleResp) UnmarshalJSON ¶
func (r *SimpleResp) UnmarshalJSON(data []byte) error
type SkynetAssetBindParams ¶
type SkynetAssetBindParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Device ID to be linked to the asset identified by id. // // Please note that the device needs to be linked to an asset before using it in // the _Upload locations of an Asset_ method for sending GPS information about the // asset. DeviceID string `json:"device_id,required"` // contains filtered or unexported fields }
func (SkynetAssetBindParams) MarshalJSON ¶
func (r SkynetAssetBindParams) MarshalJSON() (data []byte, err error)
func (SkynetAssetBindParams) URLQuery ¶
func (r SkynetAssetBindParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetAssetBindParams's query parameters as `url.Values`.
func (*SkynetAssetBindParams) UnmarshalJSON ¶
func (r *SkynetAssetBindParams) UnmarshalJSON(data []byte) error
type SkynetAssetDeleteParams ¶
type SkynetAssetDeleteParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // the cluster of the region you want to use // // Any of "america". Cluster SkynetAssetDeleteParamsCluster `query:"cluster,omitzero" json:"-"` // contains filtered or unexported fields }
func (SkynetAssetDeleteParams) URLQuery ¶
func (r SkynetAssetDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetAssetDeleteParams's query parameters as `url.Values`.
type SkynetAssetDeleteParamsCluster ¶
type SkynetAssetDeleteParamsCluster string
the cluster of the region you want to use
const (
SkynetAssetDeleteParamsClusterAmerica SkynetAssetDeleteParamsCluster = "america"
)
type SkynetAssetEventListParams ¶
type SkynetAssetEventListParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Time before which the events triggered by the asset need to be retrieved. EndTime param.Opt[int64] `query:"end_time,omitzero" json:"-"` // Filter the events by monitor_id. When provided, only the events triggered by the // monitor will be returned in response. // // Please note that if the attributes of the asset identified by id and those of // the monitor do not match, then no events might be returned for this monitor_id. MonitorID param.Opt[string] `query:"monitor_id,omitzero" json:"-"` // Denotes page number. Use this along with the ps parameter to implement // pagination for your searched results. This parameter does not have a maximum // limit but would return an empty response in case a higher value is provided when // the result-set itself is smaller. Pn param.Opt[int64] `query:"pn,omitzero" json:"-"` // Denotes number of search results per page. Use this along with the pn parameter // to implement pagination for your searched results. Ps param.Opt[int64] `query:"ps,omitzero" json:"-"` // Time after which the events triggered by the asset need to be retrieved. StartTime param.Opt[int64] `query:"start_time,omitzero" json:"-"` // the cluster of the region you want to use // // Any of "america". Cluster SkynetAssetEventListParamsCluster `query:"cluster,omitzero" json:"-"` // contains filtered or unexported fields }
func (SkynetAssetEventListParams) URLQuery ¶
func (r SkynetAssetEventListParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetAssetEventListParams's query parameters as `url.Values`.
type SkynetAssetEventListParamsCluster ¶
type SkynetAssetEventListParamsCluster string
the cluster of the region you want to use
const (
SkynetAssetEventListParamsClusterAmerica SkynetAssetEventListParamsCluster = "america"
)
type SkynetAssetEventListResponse ¶
type SkynetAssetEventListResponse struct { // An object containing the information about the event history for the requested // asset. Data SkynetAssetEventListResponseData `json:"data"` // Displays the error message in case of a failed request. If the request is // successful, this field is not present in the response. Message string `json:"message"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Message respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetAssetEventListResponse) RawJSON ¶
func (r SkynetAssetEventListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetEventListResponse) UnmarshalJSON ¶
func (r *SkynetAssetEventListResponse) UnmarshalJSON(data []byte) error
type SkynetAssetEventListResponseData ¶
type SkynetAssetEventListResponseData struct { // An array of objects with each object on the list representing one event. List []SkynetAssetEventListResponseDataList `json:"list"` // An object with pagination details of the search results. Use this object to // implement pagination in your application. Page Pagination `json:"page"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { List respjson.Field Page respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object containing the information about the event history for the requested asset.
func (SkynetAssetEventListResponseData) RawJSON ¶
func (r SkynetAssetEventListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetEventListResponseData) UnmarshalJSON ¶
func (r *SkynetAssetEventListResponseData) UnmarshalJSON(data []byte) error
type SkynetAssetEventListResponseDataList ¶
type SkynetAssetEventListResponseDataList struct { // ID of the asset. This is the same ID that was generated/provided at the time of // creating the asset. AssetID string `json:"asset_id"` // Nature of the event triggered by the asset. It can have following values: // // - enter: When the asset enters a specific geofence // // - exit: When the asset moves out of a specific geofence. // // - speeding: When the asset exceeds the certain speed limit. // // - idle: When the asset exhibits idle or no activity. // // Any of "enter", "exit", "speeding", "idle". EventType string `json:"event_type"` // Additional information about the event. Currently, this object returns the speed // limit that was used to generate the over-speeding events, for a speeding type // event. // // It is worth highlighting that, when the use_admin_speed_limit is true, the speed // limit value will be obtained from the underlying road information. Whereas, if // the use_admin_speed_limit is false, the speed limit will be equal to the // customer_speed_limit value provided by the user when creating or updating the // monitor. Extra any `json:"extra"` // ID of the geofence associated with the event. GeofenceID string `json:"geofence_id"` // ID of the monitor associated with the event. MonitorID string `json:"monitor_id"` // Tags associated with the monitor. MonitorTags []string `json:"monitor_tags"` // An object with details of the asset at the last tracked location before the // event was triggered. PrevLocation SkynetAssetEventListResponseDataListPrevLocation `json:"prev_location"` // A UNIX epoch timestamp in milliseconds representing the time at which the event // was added/created. Timestamp int64 `json:"timestamp"` // An object with details of the asset at the location where the event was // triggered. TriggeredLocation SkynetAssetEventListResponseDataListTriggeredLocation `json:"triggered_location"` // A UNIX epoch timestamp in milliseconds representing the time at which the event // was triggered. TriggeredTimestamp int64 `json:"triggered_timestamp"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { AssetID respjson.Field EventType respjson.Field Extra respjson.Field GeofenceID respjson.Field MonitorID respjson.Field MonitorTags respjson.Field PrevLocation respjson.Field Timestamp respjson.Field TriggeredLocation respjson.Field TriggeredTimestamp respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetAssetEventListResponseDataList) RawJSON ¶
func (r SkynetAssetEventListResponseDataList) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetEventListResponseDataList) UnmarshalJSON ¶
func (r *SkynetAssetEventListResponseDataList) UnmarshalJSON(data []byte) error
type SkynetAssetEventListResponseDataListPrevLocation ¶
type SkynetAssetEventListResponseDataListPrevLocation struct { // If available, this property returns the heading of the asset from true north in // clockwise direction, at the prev_location tracked for the asset. Bearing float64 `json:"bearing"` // prev_location information of the asset. Location SkynetAssetEventListResponseDataListPrevLocationLocation `json:"location"` // Returns the custom data added during the location information upload. MetaData any `json:"meta_data"` // If available, this property returns the speed of the asset, in meters per // second, at the prev_location of the asset. Speed float64 `json:"speed"` // A UNIX epoch timestamp in milliseconds representing the time at which the asset // was at the prev_location. Timestamp int64 `json:"timestamp"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Bearing respjson.Field Location respjson.Field MetaData respjson.Field Speed respjson.Field Timestamp respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with details of the asset at the last tracked location before the event was triggered.
func (SkynetAssetEventListResponseDataListPrevLocation) RawJSON ¶
func (r SkynetAssetEventListResponseDataListPrevLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetEventListResponseDataListPrevLocation) UnmarshalJSON ¶
func (r *SkynetAssetEventListResponseDataListPrevLocation) UnmarshalJSON(data []byte) error
type SkynetAssetEventListResponseDataListPrevLocationLocation ¶
type SkynetAssetEventListResponseDataListPrevLocationLocation struct { // Latitude of the prev_location tracked for the asset. Lat float64 `json:"lat"` // Longitude of the prev_location tracked for the asset. Lon float64 `json:"lon"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Lat respjson.Field Lon respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
prev_location information of the asset.
func (SkynetAssetEventListResponseDataListPrevLocationLocation) RawJSON ¶
func (r SkynetAssetEventListResponseDataListPrevLocationLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetEventListResponseDataListPrevLocationLocation) UnmarshalJSON ¶
func (r *SkynetAssetEventListResponseDataListPrevLocationLocation) UnmarshalJSON(data []byte) error
type SkynetAssetEventListResponseDataListTriggeredLocation ¶
type SkynetAssetEventListResponseDataListTriggeredLocation struct { // If available, this property returns the heading of the asset from true north in // clockwise direction, when the event was triggered. Bearing float64 `json:"bearing"` // An object with information about the location at which the event was triggered. Location SkynetAssetEventListResponseDataListTriggeredLocationLocation `json:"location"` // Returns the custom data added during the location information upload. MetaData any `json:"meta_data"` // If available, this property returns the speed of the asset, in meters per // second, when the event was triggered. Speed float64 `json:"speed"` // A UNIX epoch timestamp in milliseconds representing the time at which the asset // was at the triggered_location. Timestamp int64 `json:"timestamp"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Bearing respjson.Field Location respjson.Field MetaData respjson.Field Speed respjson.Field Timestamp respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with details of the asset at the location where the event was triggered.
func (SkynetAssetEventListResponseDataListTriggeredLocation) RawJSON ¶
func (r SkynetAssetEventListResponseDataListTriggeredLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetEventListResponseDataListTriggeredLocation) UnmarshalJSON ¶
func (r *SkynetAssetEventListResponseDataListTriggeredLocation) UnmarshalJSON(data []byte) error
type SkynetAssetEventListResponseDataListTriggeredLocationLocation ¶
type SkynetAssetEventListResponseDataListTriggeredLocationLocation struct { // Latitude of the triggered_location of the event. Lat float64 `json:"lat"` // Longitude of the triggered_location of the event. Lon float64 `json:"lon"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Lat respjson.Field Lon respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with information about the location at which the event was triggered.
func (SkynetAssetEventListResponseDataListTriggeredLocationLocation) RawJSON ¶
func (r SkynetAssetEventListResponseDataListTriggeredLocationLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetEventListResponseDataListTriggeredLocationLocation) UnmarshalJSON ¶
func (r *SkynetAssetEventListResponseDataListTriggeredLocationLocation) UnmarshalJSON(data []byte) error
type SkynetAssetEventService ¶
type SkynetAssetEventService struct {
Options []option.RequestOption
}
SkynetAssetEventService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSkynetAssetEventService method instead.
func NewSkynetAssetEventService ¶
func NewSkynetAssetEventService(opts ...option.RequestOption) (r SkynetAssetEventService)
NewSkynetAssetEventService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SkynetAssetEventService) List ¶
func (r *SkynetAssetEventService) List(ctx context.Context, id string, query SkynetAssetEventListParams, opts ...option.RequestOption) (res *SkynetAssetEventListResponse, err error)
Event History of an Asset
type SkynetAssetGetParams ¶
type SkynetAssetGetParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // the cluster of the region you want to use // // Any of "america". Cluster SkynetAssetGetParamsCluster `query:"cluster,omitzero" json:"-"` // contains filtered or unexported fields }
func (SkynetAssetGetParams) URLQuery ¶
func (r SkynetAssetGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetAssetGetParams's query parameters as `url.Values`.
type SkynetAssetGetParamsCluster ¶
type SkynetAssetGetParamsCluster string
the cluster of the region you want to use
const (
SkynetAssetGetParamsClusterAmerica SkynetAssetGetParamsCluster = "america"
)
type SkynetAssetGetResponse ¶
type SkynetAssetGetResponse struct { // An object containing the information about the asset returned. Data SkynetAssetGetResponseData `json:"data"` // Displays the error message in case of a failed request. If the request is // successful, this field is not present in the response. Message string `json:"message"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Message respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetAssetGetResponse) RawJSON ¶
func (r SkynetAssetGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetGetResponse) UnmarshalJSON ¶
func (r *SkynetAssetGetResponse) UnmarshalJSON(data []byte) error
type SkynetAssetGetResponseData ¶
type SkynetAssetGetResponseData struct { // An object with details of the asset properties. Asset AssetDetails `json:"asset"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Asset respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object containing the information about the asset returned.
func (SkynetAssetGetResponseData) RawJSON ¶
func (r SkynetAssetGetResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetGetResponseData) UnmarshalJSON ¶
func (r *SkynetAssetGetResponseData) UnmarshalJSON(data []byte) error
type SkynetAssetListParams ¶
type SkynetAssetListParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Use this parameter to filter the assets by their attributes. Only the assets // having all the attributes added to this parameter, will be returned in the // response. Multiple attributes can be separated using pipes (|). // // Please note the attributes are case sensitive. Also, this parameter can not be // used in conjunction with include_any_of_attributes parameter. IncludeAllOfAttributes param.Opt[string] `query:"include_all_of_attributes,omitzero" format:"key_1:value_1|key_2:value_2" json:"-"` // Use this parameter to filter the assets by their attributes. Assets having at // least one of the attributes added to this parameter, will be returned in the // response. Multiple attributes can be separated using pipes (|). // // Please note the attributes are case sensitive. Also, this parameter can not be // used in conjunction with include_all_of_attributes parameter. IncludeAnyOfAttributes param.Opt[string] `query:"include_any_of_attributes,omitzero" format:"key1:value1|key2:value2|..." json:"-"` // Denotes page number. Use this along with the ps parameter to implement // pagination for your searched results. This parameter does not have a maximum // limit but would return an empty response in case a higher value is provided when // the result-set itself is smaller. Pn param.Opt[int64] `query:"pn,omitzero" json:"-"` // Denotes number of search results per page. Use this along with the pn parameter // to implement pagination for your searched results. Ps param.Opt[int64] `query:"ps,omitzero" json:"-"` // Provide a single field to sort the results by. Only updated_at or created_at // fields can be selected for ordering the results. // // By default, the result is sorted by created_at field in the descending order. // Allowed values for specifying the order are asc for ascending order and desc for // descending order. Sort param.Opt[string] `query:"sort,omitzero" format:"field:order" json:"-"` // **This parameter will be deprecated soon! Please use the // include_all_of_attributes or include_any_of_attributes parameters to provide // labels or markers for the assets to be retrieved.** // // tags can be used to filter the assets. Only those assets which have all the tags // provided, will be included in the result. In case multiple tags need to be // specified, use , to separate them. Tags param.Opt[string] `query:"tags,omitzero" json:"-"` // the cluster of the region you want to use // // Any of "america". Cluster SkynetAssetListParamsCluster `query:"cluster,omitzero" json:"-"` // contains filtered or unexported fields }
func (SkynetAssetListParams) URLQuery ¶
func (r SkynetAssetListParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetAssetListParams's query parameters as `url.Values`.
type SkynetAssetListParamsCluster ¶
type SkynetAssetListParamsCluster string
the cluster of the region you want to use
const (
SkynetAssetListParamsClusterAmerica SkynetAssetListParamsCluster = "america"
)
type SkynetAssetListResponse ¶
type SkynetAssetListResponse struct { // A data object containing the list of assets. Data SkynetAssetListResponseData `json:"data"` // Displays the error message in case of a failed request. If the request is // successful, this field is not present in the response. Message string `json:"message"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Message respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetAssetListResponse) RawJSON ¶
func (r SkynetAssetListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetListResponse) UnmarshalJSON ¶
func (r *SkynetAssetListResponse) UnmarshalJSON(data []byte) error
type SkynetAssetListResponseData ¶
type SkynetAssetListResponseData struct { // An array of objects, with each object representing one asset. List []AssetDetails `json:"list"` // An object with pagination details of the search results. Use this object to // implement pagination in your application. Page Pagination `json:"page"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { List respjson.Field Page respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
A data object containing the list of assets.
func (SkynetAssetListResponseData) RawJSON ¶
func (r SkynetAssetListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetListResponseData) UnmarshalJSON ¶
func (r *SkynetAssetListResponseData) UnmarshalJSON(data []byte) error
type SkynetAssetLocationGetLastParams ¶
type SkynetAssetLocationGetLastParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // the cluster of the region you want to use // // Any of "america". Cluster SkynetAssetLocationGetLastParamsCluster `query:"cluster,omitzero" json:"-"` // contains filtered or unexported fields }
func (SkynetAssetLocationGetLastParams) URLQuery ¶
func (r SkynetAssetLocationGetLastParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetAssetLocationGetLastParams's query parameters as `url.Values`.
type SkynetAssetLocationGetLastParamsCluster ¶
type SkynetAssetLocationGetLastParamsCluster string
the cluster of the region you want to use
const (
SkynetAssetLocationGetLastParamsClusterAmerica SkynetAssetLocationGetLastParamsCluster = "america"
)
type SkynetAssetLocationGetLastResponse ¶
type SkynetAssetLocationGetLastResponse struct { // An object containing the information about the last tracked location of the // requested asset. Data SkynetAssetLocationGetLastResponseData `json:"data"` // Displays the error message in case of a failed request. If the request is // successful, this field is not present in the response. Message string `json:"message"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Message respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetAssetLocationGetLastResponse) RawJSON ¶
func (r SkynetAssetLocationGetLastResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetLocationGetLastResponse) UnmarshalJSON ¶
func (r *SkynetAssetLocationGetLastResponse) UnmarshalJSON(data []byte) error
type SkynetAssetLocationGetLastResponseData ¶
type SkynetAssetLocationGetLastResponseData struct { // An object with details of the tracked location. Please note that if there are no // tracking records for an asset, no location data will be returned. Location TrackLocation `json:"location"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Location respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object containing the information about the last tracked location of the requested asset.
func (SkynetAssetLocationGetLastResponseData) RawJSON ¶
func (r SkynetAssetLocationGetLastResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetLocationGetLastResponseData) UnmarshalJSON ¶
func (r *SkynetAssetLocationGetLastResponseData) UnmarshalJSON(data []byte) error
type SkynetAssetLocationListParams ¶
type SkynetAssetLocationListParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Describe the geometry characteristics through a , separated list of properties. // // Setting mapmatch to 1 returns the geometry of the tracked points, snapped to the // nearest road. // // Setting interpolate to 1 smoothens the snapped geometry by adding more points, // as needed. Please note, mapmatch should be set to 1 for interpolate to be // effective. // // mode is used to set the transport mode for which the snapped route will be // determined. Allowed values for mode are car and truck. Correction param.Opt[string] `query:"correction,omitzero" format:"mapmatch=boolean,interpolate=boolean,mode=string" json:"-"` // Time until which the tracked locations of the asset need to be retrieved. EndTime param.Opt[int64] `query:"end_time,omitzero" json:"-"` // Denotes page number. Use this along with the ps parameter to implement // pagination for your searched results. This parameter does not have a maximum // limit but would return an empty response in case a higher value is provided when // the result-set itself is smaller. Pn param.Opt[int64] `query:"pn,omitzero" json:"-"` // Denotes number of search results per page. Use this along with the pn parameter // to implement pagination for your searched results. Ps param.Opt[int64] `query:"ps,omitzero" json:"-"` // Time after which the tracked locations of the asset need to be retrieved. StartTime param.Opt[int64] `query:"start_time,omitzero" json:"-"` // the cluster of the region you want to use // // Any of "america". Cluster SkynetAssetLocationListParamsCluster `query:"cluster,omitzero" json:"-"` // Set the geometry format to encode the path linking the tracked locations of the // asset. // // Please note that geometry_type is effective only when mapmatch property of // correction parameter is set to 1. // // Any of "polyline", "polyline6", "geojson". GeometryType SkynetAssetLocationListParamsGeometryType `query:"geometry_type,omitzero" json:"-"` // contains filtered or unexported fields }
func (SkynetAssetLocationListParams) URLQuery ¶
func (r SkynetAssetLocationListParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetAssetLocationListParams's query parameters as `url.Values`.
type SkynetAssetLocationListParamsCluster ¶
type SkynetAssetLocationListParamsCluster string
the cluster of the region you want to use
const (
SkynetAssetLocationListParamsClusterAmerica SkynetAssetLocationListParamsCluster = "america"
)
type SkynetAssetLocationListParamsGeometryType ¶
type SkynetAssetLocationListParamsGeometryType string
Set the geometry format to encode the path linking the tracked locations of the asset.
Please note that geometry_type is effective only when mapmatch property of correction parameter is set to 1.
const ( SkynetAssetLocationListParamsGeometryTypePolyline SkynetAssetLocationListParamsGeometryType = "polyline" SkynetAssetLocationListParamsGeometryTypePolyline6 SkynetAssetLocationListParamsGeometryType = "polyline6" SkynetAssetLocationListParamsGeometryTypeGeojson SkynetAssetLocationListParamsGeometryType = "geojson" )
type SkynetAssetLocationListResponse ¶
type SkynetAssetLocationListResponse struct { Data SkynetAssetLocationListResponseData `json:"data"` // Displays the error message in case of a failed request. If the request is // successful, this field is not present in the response. Message string `json:"message"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Message respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetAssetLocationListResponse) RawJSON ¶
func (r SkynetAssetLocationListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetLocationListResponse) UnmarshalJSON ¶
func (r *SkynetAssetLocationListResponse) UnmarshalJSON(data []byte) error
type SkynetAssetLocationListResponseData ¶
type SkynetAssetLocationListResponseData struct { // Distance of the path, in meters, formed by connecting all tracked locations // returned. // // Please note that distance is returned only when the mapmatch property of // correction parameter is set to 1. Distance float64 `json:"distance"` // An object with geoJSON details of the route. It is returned only when the // mapmatch property of the correction parameter is set to 1 and geometry_type is // geojson, otherwise it is not present in the response. The contents of this // object follow the // [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946). Geojson SkynetAssetLocationListResponseDataGeojson `json:"geojson"` // Geometry of tracked locations in the requested format. It is returned only if // the mapmatch property of the ‘correction’ parameter is set to 1. Geometry []string `json:"geometry"` // An array of objects with details of the tracked locations of the asset. Each // object represents one tracked location. List []TrackLocation `json:"list"` // An object with pagination details of the search results. Use this object to // implement pagination in your application. Page Pagination `json:"page"` // An array of objects with details about the snapped points for each of the // tracked locations returned for the asset. // // Please note that this property is returned only when the mapmatch property of // correction parameter is set to 1. SnappedPoints []SkynetAssetLocationListResponseDataSnappedPoint `json:"snapped_points"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Distance respjson.Field Geojson respjson.Field Geometry respjson.Field List respjson.Field Page respjson.Field SnappedPoints respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetAssetLocationListResponseData) RawJSON ¶
func (r SkynetAssetLocationListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetLocationListResponseData) UnmarshalJSON ¶
func (r *SkynetAssetLocationListResponseData) UnmarshalJSON(data []byte) error
type SkynetAssetLocationListResponseDataGeojson ¶
type SkynetAssetLocationListResponseDataGeojson struct { // An object with details of the geoJSON geometry of the route. Geometry SkynetAssetLocationListResponseDataGeojsonGeometry `json:"geometry"` // Type of the geoJSON object. Type string `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Geometry respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with geoJSON details of the route. It is returned only when the mapmatch property of the correction parameter is set to 1 and geometry_type is geojson, otherwise it is not present in the response. The contents of this object follow the [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946).
func (SkynetAssetLocationListResponseDataGeojson) RawJSON ¶
func (r SkynetAssetLocationListResponseDataGeojson) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetLocationListResponseDataGeojson) UnmarshalJSON ¶
func (r *SkynetAssetLocationListResponseDataGeojson) UnmarshalJSON(data []byte) error
type SkynetAssetLocationListResponseDataGeojsonGeometry ¶
type SkynetAssetLocationListResponseDataGeojsonGeometry struct { // An array of coordinates in the [longitude, latitude] format, representing the // route geometry. Coordinates []float64 `json:"coordinates"` // Type of the geoJSON geometry. Type string `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Coordinates respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with details of the geoJSON geometry of the route.
func (SkynetAssetLocationListResponseDataGeojsonGeometry) RawJSON ¶
func (r SkynetAssetLocationListResponseDataGeojsonGeometry) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetLocationListResponseDataGeojsonGeometry) UnmarshalJSON ¶
func (r *SkynetAssetLocationListResponseDataGeojsonGeometry) UnmarshalJSON(data []byte) error
type SkynetAssetLocationListResponseDataSnappedPoint ¶
type SkynetAssetLocationListResponseDataSnappedPoint struct { // The bearing angle of the snapped point from the original tracked location, in // radians. It indicates the direction of the snapped point. Bearing string `json:"bearing"` // The distance of the snapped point from the original tracked location, in meters. Distance float64 `json:"distance"` // The latitude and longitude coordinates of the snapped point. Location SkynetAssetLocationListResponseDataSnappedPointLocation `json:"location"` // The name of the street or road of the snapped point. Name string `json:"name"` // The index of the tracked location to which this snapped point corresponds to. OriginalIndex string `json:"originalIndex"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Bearing respjson.Field Distance respjson.Field Location respjson.Field Name respjson.Field OriginalIndex respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetAssetLocationListResponseDataSnappedPoint) RawJSON ¶
func (r SkynetAssetLocationListResponseDataSnappedPoint) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetLocationListResponseDataSnappedPoint) UnmarshalJSON ¶
func (r *SkynetAssetLocationListResponseDataSnappedPoint) UnmarshalJSON(data []byte) error
type SkynetAssetLocationListResponseDataSnappedPointLocation ¶
type SkynetAssetLocationListResponseDataSnappedPointLocation struct { // Latitude of the snapped point. Lat float64 `json:"lat"` // Longitude of the snapped point. Lon float64 `json:"lon"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Lat respjson.Field Lon respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The latitude and longitude coordinates of the snapped point.
func (SkynetAssetLocationListResponseDataSnappedPointLocation) RawJSON ¶
func (r SkynetAssetLocationListResponseDataSnappedPointLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetLocationListResponseDataSnappedPointLocation) UnmarshalJSON ¶
func (r *SkynetAssetLocationListResponseDataSnappedPointLocation) UnmarshalJSON(data []byte) error
type SkynetAssetLocationService ¶
type SkynetAssetLocationService struct {
Options []option.RequestOption
}
SkynetAssetLocationService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSkynetAssetLocationService method instead.
func NewSkynetAssetLocationService ¶
func NewSkynetAssetLocationService(opts ...option.RequestOption) (r SkynetAssetLocationService)
NewSkynetAssetLocationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SkynetAssetLocationService) GetLast ¶
func (r *SkynetAssetLocationService) GetLast(ctx context.Context, id string, query SkynetAssetLocationGetLastParams, opts ...option.RequestOption) (res *SkynetAssetLocationGetLastResponse, err error)
Track the last location of an asset
func (*SkynetAssetLocationService) List ¶
func (r *SkynetAssetLocationService) List(ctx context.Context, id string, query SkynetAssetLocationListParams, opts ...option.RequestOption) (res *SkynetAssetLocationListResponse, err error)
Track locations of an asset
type SkynetAssetNewParams ¶
type SkynetAssetNewParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Set a unique ID for the new asset. If not provided, an ID will be automatically // generated in UUID format. A valid custom*id can contain letters, numbers, "-", & // "*" only. // // Please note that the ID of an asset can not be changed once it is created. CustomID param.Opt[string] `json:"custom_id,omitzero"` // Description for the asset. Description param.Opt[string] `json:"description,omitzero"` // Name of the asset. Use this field to assign a meaningful, custom name to the // asset being created. Name param.Opt[string] `json:"name,omitzero"` // the cluster of the region you want to use // // Any of "america". Cluster SkynetAssetNewParamsCluster `query:"cluster,omitzero" json:"-"` // attributes can be used to store custom information about an asset in key:value // format. Use attributes to add any useful information or context to your assets // like the vehicle type, shift timing etc. Moreover, these attributes can be used // to filter assets in **Search**, **Monitor**, and _Get Asset List_ queries. // // Please note that the maximum number of key:value pairs that can be added to an // attributes object is 100. Also, the overall size of attributes object should not // exceed 65kb. Attributes any `json:"attributes,omitzero"` // Any valid json object data. Can be used to save customized data. Max size is // 65kb. MetaData MetaData `json:"meta_data,omitzero"` // **This parameter will be deprecated soon! Please use the attributes parameter to // add labels or markers for the asset.** // // Tags of the asset. tags can be used for filtering assets in operations like _Get // Asset List_ and asset **Search** methods. They can also be used for monitoring // of assets using the **Monitor** methods after linking tags and asset. // // Valid tags are strings consisting of alphanumeric characters (A-Z, a-z, 0-9) // along with the underscore ('\_') and hyphen ('-') symbols. Tags []string `json:"tags,omitzero"` // contains filtered or unexported fields }
func (SkynetAssetNewParams) MarshalJSON ¶
func (r SkynetAssetNewParams) MarshalJSON() (data []byte, err error)
func (SkynetAssetNewParams) URLQuery ¶
func (r SkynetAssetNewParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetAssetNewParams's query parameters as `url.Values`.
func (*SkynetAssetNewParams) UnmarshalJSON ¶
func (r *SkynetAssetNewParams) UnmarshalJSON(data []byte) error
type SkynetAssetNewParamsCluster ¶
type SkynetAssetNewParamsCluster string
the cluster of the region you want to use
const (
SkynetAssetNewParamsClusterAmerica SkynetAssetNewParamsCluster = "america"
)
type SkynetAssetNewResponse ¶
type SkynetAssetNewResponse struct { // An object containing the ID of the asset created. Data SkynetAssetNewResponseData `json:"data"` // Displays the error message in case of a failed request. If the request is // successful, this field is not present in the response. Message string `json:"message"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Message respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetAssetNewResponse) RawJSON ¶
func (r SkynetAssetNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetNewResponse) UnmarshalJSON ¶
func (r *SkynetAssetNewResponse) UnmarshalJSON(data []byte) error
type SkynetAssetNewResponseData ¶
type SkynetAssetNewResponseData struct { // Unique ID of the asset created. It will be the same as custom_id, if provided. // Else it will be an auto generated UUID. Please note this ID cannot be updated. ID string `json:"id"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object containing the ID of the asset created.
func (SkynetAssetNewResponseData) RawJSON ¶
func (r SkynetAssetNewResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetAssetNewResponseData) UnmarshalJSON ¶
func (r *SkynetAssetNewResponseData) UnmarshalJSON(data []byte) error
type SkynetAssetService ¶
type SkynetAssetService struct { Options []option.RequestOption Event SkynetAssetEventService Location SkynetAssetLocationService }
SkynetAssetService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSkynetAssetService method instead.
func NewSkynetAssetService ¶
func NewSkynetAssetService(opts ...option.RequestOption) (r SkynetAssetService)
NewSkynetAssetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SkynetAssetService) Bind ¶
func (r *SkynetAssetService) Bind(ctx context.Context, id string, params SkynetAssetBindParams, opts ...option.RequestOption) (res *SimpleResp, err error)
Bind asset to device
func (*SkynetAssetService) Delete ¶
func (r *SkynetAssetService) Delete(ctx context.Context, id string, body SkynetAssetDeleteParams, opts ...option.RequestOption) (res *SimpleResp, err error)
Delete an Asset
func (*SkynetAssetService) Get ¶
func (r *SkynetAssetService) Get(ctx context.Context, id string, query SkynetAssetGetParams, opts ...option.RequestOption) (res *SkynetAssetGetResponse, err error)
Get an Asset
func (*SkynetAssetService) List ¶
func (r *SkynetAssetService) List(ctx context.Context, query SkynetAssetListParams, opts ...option.RequestOption) (res *SkynetAssetListResponse, err error)
Get Asset List
func (*SkynetAssetService) New ¶
func (r *SkynetAssetService) New(ctx context.Context, params SkynetAssetNewParams, opts ...option.RequestOption) (res *SkynetAssetNewResponse, err error)
Create an Asset
func (*SkynetAssetService) Track ¶
func (r *SkynetAssetService) Track(ctx context.Context, id string, params SkynetAssetTrackParams, opts ...option.RequestOption) (res *SimpleResp, err error)
Upload track info
func (*SkynetAssetService) Update ¶
func (r *SkynetAssetService) Update(ctx context.Context, id string, params SkynetAssetUpdateParams, opts ...option.RequestOption) (res *SimpleResp, err error)
Update an Asset
func (*SkynetAssetService) UpdateAttributes ¶
func (r *SkynetAssetService) UpdateAttributes(ctx context.Context, id string, params SkynetAssetUpdateAttributesParams, opts ...option.RequestOption) (res *SimpleResp, err error)
Update asset attributes. (add)
type SkynetAssetTrackParams ¶
type SkynetAssetTrackParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // ID of the device used to upload the tracking information of the asset. // // Please note that the device_id used here must already be linked to the asset. // Use the _Bind Device to Asset_ method to link a device with your asset. DeviceID string `json:"device_id,required"` // An array of objects to collect the location tracking information for an asset. // Each object must correspond to details of only one location. Locations SkynetAssetTrackParamsLocations `json:"locations,omitzero,required"` // the cluster of the region you want to use // // Any of "america". Cluster SkynetAssetTrackParamsCluster `query:"cluster,omitzero" json:"-"` // contains filtered or unexported fields }
func (SkynetAssetTrackParams) MarshalJSON ¶
func (r SkynetAssetTrackParams) MarshalJSON() (data []byte, err error)
func (SkynetAssetTrackParams) URLQuery ¶
func (r SkynetAssetTrackParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetAssetTrackParams's query parameters as `url.Values`.
func (*SkynetAssetTrackParams) UnmarshalJSON ¶
func (r *SkynetAssetTrackParams) UnmarshalJSON(data []byte) error
type SkynetAssetTrackParamsCluster ¶
type SkynetAssetTrackParamsCluster string
the cluster of the region you want to use
const (
SkynetAssetTrackParamsClusterAmerica SkynetAssetTrackParamsCluster = "america"
)
type SkynetAssetTrackParamsLocations ¶
type SkynetAssetTrackParamsLocations struct { // An object to collect the coordinate details of the tracked location. Please note // this field is mandatory when uploading locations for an asset. Location SkynetAssetTrackParamsLocationsLocation `json:"location,omitzero,required"` // Use this parameter to provide the time, expressed as UNIX epoch timestamp in // milliseconds, when the location was tracked. Please note this field is mandatory // when uploading locations for an asset. Timestamp int64 `json:"timestamp,required"` // Use this parameter to provide the accuracy of the GPS information at the tracked // location. It is the estimated horizontal accuracy radius, in meters. Accuracy param.Opt[float64] `json:"accuracy,omitzero"` // Use this parameter to provide the altitude, in meters, of the asset at the // tracked location. Altitude param.Opt[float64] `json:"altitude,omitzero"` // Use this parameter to provide the battery level of the GPS device, as a // percentage, when the location is tracked. It should have a minimum value of 0 // and a maximum value of 100. BatteryLevel param.Opt[int64] `json:"battery_level,omitzero"` // Use this parameter to provide the heading of the asset, in radians, calculated // from true north in clockwise direction. This should always be in the range of // [0, 360). Bearing param.Opt[float64] `json:"bearing,omitzero"` // Use this parameter to provide the speed of the asset, in meters per second, at // the tracked location. Speed param.Opt[float64] `json:"speed,omitzero"` // NB tracking mode. TrackingMode param.Opt[string] `json:"tracking_mode,omitzero"` // Use this object to add any custom data about the location that is being // uploaded. Recommended to use the key:value format for adding the desired // information. // // Please note that the maximum size of meta_data object should not exceed 65Kb. MetaData any `json:"meta_data,omitzero"` // contains filtered or unexported fields }
An array of objects to collect the location tracking information for an asset. Each object must correspond to details of only one location.
The properties Location, Timestamp are required.
func (SkynetAssetTrackParamsLocations) MarshalJSON ¶
func (r SkynetAssetTrackParamsLocations) MarshalJSON() (data []byte, err error)
func (*SkynetAssetTrackParamsLocations) UnmarshalJSON ¶
func (r *SkynetAssetTrackParamsLocations) UnmarshalJSON(data []byte) error
type SkynetAssetTrackParamsLocationsLocation ¶
type SkynetAssetTrackParamsLocationsLocation struct { // Latitude of the tracked location of the asset. Lat float64 `json:"lat,required"` // Longitude of the tracked location of the asset. Lon float64 `json:"lon,required"` // contains filtered or unexported fields }
An object to collect the coordinate details of the tracked location. Please note this field is mandatory when uploading locations for an asset.
The properties Lat, Lon are required.
func (SkynetAssetTrackParamsLocationsLocation) MarshalJSON ¶
func (r SkynetAssetTrackParamsLocationsLocation) MarshalJSON() (data []byte, err error)
func (*SkynetAssetTrackParamsLocationsLocation) UnmarshalJSON ¶
func (r *SkynetAssetTrackParamsLocationsLocation) UnmarshalJSON(data []byte) error
type SkynetAssetUpdateAttributesParams ¶
type SkynetAssetUpdateAttributesParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // attributes can be used to add any useful information or context to your assets // like the vehicle type, shift timing etc. These attributes can also be used to // filter assets in **Search**, **Monitor**, and _Get Asset List_ queries. // // Provide the attributes to be added or updated, in key:value format. If an // existing key is provided in the input, then the value will be modified as per // the input value. If a new key is provided in the input, then the key would be // added to the existing set. The contents of any value field are neither altered // nor removed unless specifically referred to by its key in the input request. // // Please note that the maximum number of key:value pairs that can be added to an // attributes object is 100. Also, the overall size of attributes object should not // exceed 65kb. Attributes any `json:"attributes,omitzero,required"` // contains filtered or unexported fields }
func (SkynetAssetUpdateAttributesParams) MarshalJSON ¶
func (r SkynetAssetUpdateAttributesParams) MarshalJSON() (data []byte, err error)
func (SkynetAssetUpdateAttributesParams) URLQuery ¶
func (r SkynetAssetUpdateAttributesParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetAssetUpdateAttributesParams's query parameters as `url.Values`.
func (*SkynetAssetUpdateAttributesParams) UnmarshalJSON ¶
func (r *SkynetAssetUpdateAttributesParams) UnmarshalJSON(data []byte) error
type SkynetAssetUpdateParams ¶
type SkynetAssetUpdateParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Use this param to update the description of an asset. Description param.Opt[string] `json:"description,omitzero"` // Use this param to update the name of an asset. Users can assign meaningful // custom names to their assets. Name param.Opt[string] `json:"name,omitzero"` // the cluster of the region you want to use // // Any of "america". Cluster SkynetAssetUpdateParamsCluster `query:"cluster,omitzero" json:"-"` // Use this param to update the attributes of an asset in key:value format. Users // can maintain any useful information or context about the assets by utilising // this parameter. // // Please be careful when using this parameter while updating an asset as the new // attributes object provided will completely overwrite the old attributes object. // Use the _Update Asset Attributes_ method to add new or modify existing // attributes. // // Another point to note is that the overall size of the attributes object cannot // exceed 65kb and the maximum number of key:value pairs that can be added to this // object is 100. Attributes any `json:"attributes,omitzero"` // Any valid json object data. Can be used to save customized data. Max size is // 65kb. MetaData MetaData `json:"meta_data,omitzero"` // **This parameter will be deprecated soon! Please use the attributes parameter to // add labels or markers for the asset.** // // Use this param to update the tags of an asset. tags can be used to filter asset // in _Get Asset List_, **Search** and **Monitor** queries. Tags []string `json:"tags,omitzero"` // contains filtered or unexported fields }
func (SkynetAssetUpdateParams) MarshalJSON ¶
func (r SkynetAssetUpdateParams) MarshalJSON() (data []byte, err error)
func (SkynetAssetUpdateParams) URLQuery ¶
func (r SkynetAssetUpdateParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetAssetUpdateParams's query parameters as `url.Values`.
func (*SkynetAssetUpdateParams) UnmarshalJSON ¶
func (r *SkynetAssetUpdateParams) UnmarshalJSON(data []byte) error
type SkynetAssetUpdateParamsCluster ¶
type SkynetAssetUpdateParamsCluster string
the cluster of the region you want to use
const (
SkynetAssetUpdateParamsClusterAmerica SkynetAssetUpdateParamsCluster = "america"
)
type SkynetConfigGetParams ¶
type SkynetConfigGetParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // the cluster of the region you want to use // // Any of "america". Cluster SkynetConfigGetParamsCluster `query:"cluster,omitzero" json:"-"` // contains filtered or unexported fields }
func (SkynetConfigGetParams) URLQuery ¶
func (r SkynetConfigGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetConfigGetParams's query parameters as `url.Values`.
type SkynetConfigGetParamsCluster ¶
type SkynetConfigGetParamsCluster string
the cluster of the region you want to use
const (
SkynetConfigGetParamsClusterAmerica SkynetConfigGetParamsCluster = "america"
)
type SkynetConfigGetResponse ¶
type SkynetConfigGetResponse struct { // A data object containing the config response. Data SkynetConfigGetResponseData `json:"data"` // Displays the error message in case of a failed request. If the request is // successful, this field is not present in the response. Message string `json:"message"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Message respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetConfigGetResponse) RawJSON ¶
func (r SkynetConfigGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetConfigGetResponse) UnmarshalJSON ¶
func (r *SkynetConfigGetResponse) UnmarshalJSON(data []byte) error
type SkynetConfigGetResponseData ¶
type SkynetConfigGetResponseData struct { Config SkynetConfigGetResponseDataConfig `json:"config"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Config respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
A data object containing the config response.
func (SkynetConfigGetResponseData) RawJSON ¶
func (r SkynetConfigGetResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetConfigGetResponseData) UnmarshalJSON ¶
func (r *SkynetConfigGetResponseData) UnmarshalJSON(data []byte) error
type SkynetConfigGetResponseDataConfig ¶
type SkynetConfigGetResponseDataConfig struct { // An array of strings representing the list of webhooks. Webhooks are used to // receive information, through POST requests, whenever any event is triggered. Webhook []string `json:"webhook"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Webhook respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetConfigGetResponseDataConfig) RawJSON ¶
func (r SkynetConfigGetResponseDataConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetConfigGetResponseDataConfig) UnmarshalJSON ¶
func (r *SkynetConfigGetResponseDataConfig) UnmarshalJSON(data []byte) error
type SkynetConfigService ¶
type SkynetConfigService struct {
Options []option.RequestOption
}
SkynetConfigService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSkynetConfigService method instead.
func NewSkynetConfigService ¶
func NewSkynetConfigService(opts ...option.RequestOption) (r SkynetConfigService)
NewSkynetConfigService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SkynetConfigService) Get ¶
func (r *SkynetConfigService) Get(ctx context.Context, query SkynetConfigGetParams, opts ...option.RequestOption) (res *SkynetConfigGetResponse, err error)
Get webhook configuration
func (*SkynetConfigService) TestWebhook ¶
func (r *SkynetConfigService) TestWebhook(ctx context.Context, body SkynetConfigTestWebhookParams, opts ...option.RequestOption) (res *SkynetConfigTestWebhookResponse, err error)
Test webhook configurations
func (*SkynetConfigService) Update ¶
func (r *SkynetConfigService) Update(ctx context.Context, params SkynetConfigUpdateParams, opts ...option.RequestOption) (res *SimpleResp, err error)
Update webhook configuration
type SkynetConfigTestWebhookParams ¶
type SkynetConfigTestWebhookParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // contains filtered or unexported fields }
func (SkynetConfigTestWebhookParams) URLQuery ¶
func (r SkynetConfigTestWebhookParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetConfigTestWebhookParams's query parameters as `url.Values`.
type SkynetConfigTestWebhookResponse ¶
type SkynetConfigTestWebhookResponse struct { // A string indicating the state of the response. Please note this value will // always be Ok. // // The sample event information will be received on the webhook, if they were // successfully configured. If no event information is received by the webhook, // please reconfigure the webhook or else reach out to // [support@nextbillion.ai](mailto:support@nextbillion.ai) for help. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetConfigTestWebhookResponse) RawJSON ¶
func (r SkynetConfigTestWebhookResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetConfigTestWebhookResponse) UnmarshalJSON ¶
func (r *SkynetConfigTestWebhookResponse) UnmarshalJSON(data []byte) error
type SkynetConfigUpdateParams ¶
type SkynetConfigUpdateParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // the cluster of the region you want to use // // Any of "america". Cluster SkynetConfigUpdateParamsCluster `query:"cluster,omitzero" json:"-"` // Use this array to update information about the webhooks. Please note that the // webhooks will be overwritten every time this method is used. Webhook []string `json:"webhook,omitzero"` // contains filtered or unexported fields }
func (SkynetConfigUpdateParams) MarshalJSON ¶
func (r SkynetConfigUpdateParams) MarshalJSON() (data []byte, err error)
func (SkynetConfigUpdateParams) URLQuery ¶
func (r SkynetConfigUpdateParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetConfigUpdateParams's query parameters as `url.Values`.
func (*SkynetConfigUpdateParams) UnmarshalJSON ¶
func (r *SkynetConfigUpdateParams) UnmarshalJSON(data []byte) error
type SkynetConfigUpdateParamsCluster ¶
type SkynetConfigUpdateParamsCluster string
the cluster of the region you want to use
const (
SkynetConfigUpdateParamsClusterAmerica SkynetConfigUpdateParamsCluster = "america"
)
type SkynetMonitorDeleteParams ¶
type SkynetMonitorDeleteParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // contains filtered or unexported fields }
func (SkynetMonitorDeleteParams) URLQuery ¶
func (r SkynetMonitorDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetMonitorDeleteParams's query parameters as `url.Values`.
type SkynetMonitorGetParams ¶
type SkynetMonitorGetParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // contains filtered or unexported fields }
func (SkynetMonitorGetParams) URLQuery ¶
func (r SkynetMonitorGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetMonitorGetParams's query parameters as `url.Values`.
type SkynetMonitorGetResponse ¶
type SkynetMonitorGetResponse struct { // A data object containing the details of the monitor. Data SkynetMonitorGetResponseData `json:"data"` // Displays the error message in case of a failed request. If the request is // successful, this field is not present in the response. Message string `json:"message"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Message respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetMonitorGetResponse) RawJSON ¶
func (r SkynetMonitorGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetMonitorGetResponse) UnmarshalJSON ¶
func (r *SkynetMonitorGetResponse) UnmarshalJSON(data []byte) error
type SkynetMonitorGetResponseData ¶
type SkynetMonitorGetResponseData struct { Monitor Monitor `json:"monitor"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Monitor respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
A data object containing the details of the monitor.
func (SkynetMonitorGetResponseData) RawJSON ¶
func (r SkynetMonitorGetResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetMonitorGetResponseData) UnmarshalJSON ¶
func (r *SkynetMonitorGetResponseData) UnmarshalJSON(data []byte) error
type SkynetMonitorListParams ¶
type SkynetMonitorListParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Denotes page number. Use this along with the ps parameter to implement // pagination for your searched results. This parameter does not have a maximum // limit but would return an empty response in case a higher value is provided when // the result-set itself is smaller. Pn param.Opt[int64] `query:"pn,omitzero" json:"-"` // Denotes number of search results per page. Use this along with the pn parameter // to implement pagination for your searched results. Ps param.Opt[int64] `query:"ps,omitzero" json:"-"` // Provide a single field to sort the results by. Only updated_at or created_at // fields can be selected for ordering the results. // // By default, the result is sorted by created_at field in the descending order. // Allowed values for specifying the order are asc for ascending order and desc for // descending order. Sort param.Opt[string] `query:"sort,omitzero" format:"field:order" json:"-"` // tags can be used to filter the monitors. Only those monitors which have all the // tags provided here, will be included in the search result. In case multiple tags // need to be specified, use , to separate them. Tags param.Opt[string] `query:"tags,omitzero" json:"-"` // the cluster of the region you want to use // // Any of "america". Cluster SkynetMonitorListParamsCluster `query:"cluster,omitzero" json:"-"` // contains filtered or unexported fields }
func (SkynetMonitorListParams) URLQuery ¶
func (r SkynetMonitorListParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetMonitorListParams's query parameters as `url.Values`.
type SkynetMonitorListParamsCluster ¶
type SkynetMonitorListParamsCluster string
the cluster of the region you want to use
const (
SkynetMonitorListParamsClusterAmerica SkynetMonitorListParamsCluster = "america"
)
type SkynetMonitorListResponse ¶
type SkynetMonitorListResponse struct { // A data object containing the result. Data SkynetMonitorListResponseData `json:"data"` // Displays the error message in case of a failed request. If the request is // successful, this field is not present in the response. Message string `json:"message"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Message respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetMonitorListResponse) RawJSON ¶
func (r SkynetMonitorListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetMonitorListResponse) UnmarshalJSON ¶
func (r *SkynetMonitorListResponse) UnmarshalJSON(data []byte) error
type SkynetMonitorListResponseData ¶
type SkynetMonitorListResponseData struct { // An array of objects listing all the monitors. Each object represents one // monitor. List []Monitor `json:"list"` // An object with pagination details of the search results. Use this object to // implement pagination in your application. Page Pagination `json:"page"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { List respjson.Field Page respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
A data object containing the result.
func (SkynetMonitorListResponseData) RawJSON ¶
func (r SkynetMonitorListResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetMonitorListResponseData) UnmarshalJSON ¶
func (r *SkynetMonitorListResponseData) UnmarshalJSON(data []byte) error
type SkynetMonitorNewParams ¶
type SkynetMonitorNewParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Use this parameter to add tags to the monitor. tags can be used for filtering // monitors in the _Get Monitor List_ operation. They can also be used for easy // identification of monitors. // // Please note that valid tags are strings, consisting of alphanumeric characters // (A-Z, a-z, 0-9) along with the underscore ('\_') and hyphen ('-') symbols. Tags []string `json:"tags,omitzero,required"` // Specify the type of activity the monitor would detect. // // The monitor will be able to detect the specified type of activity and create // events for eligible asset. A monitor can detect following types of asset // activity: // // - enter: The monitor will create an event when a linked asset enters into the // specified geofence. // // - exit: The monitor will create an event when a linked asset exits the specified // geofence. // // - enter_and_exit: The monitor will create an event when a linked asset either // enters or exits the specified geofence. // // - speeding: The monitor will create an event when a linked asset exceeds a given // speed limit. // // - idle: The monitor will create an event when a linked asset exhibits idle // activity. // // Please note that assets and geofences can be linked to a monitor using the // match_filter and geofence_config attributes respectively. // // Any of "enter", "exit", "enter_and_exit", "speeding", "idle". Type SkynetMonitorNewParamsType `json:"type,omitzero,required"` // Set a unique ID for the new monitor. If not provided, an ID will be // automatically generated in UUID format. A valid custom*id can contain letters, // numbers, "-", & "*" only. // // Please note that the ID of an monitor can not be changed once it is created. CustomID param.Opt[string] `json:"custom_id,omitzero"` // Add a description for your monitor using this parameter. Description param.Opt[string] `json:"description,omitzero"` // Name of the monitor. Use this field to assign a meaningful, custom name to the // monitor being created. Name param.Opt[string] `json:"name,omitzero"` // the cluster of the region you want to use // // Any of "america". Cluster SkynetMonitorNewParamsCluster `query:"cluster,omitzero" json:"-"` // Geofences are geographic boundaries surrounding an area of interest. // geofence_config is used to specify the geofences for creating enter or exit type // of events based on the asset's location. When an asset associated with the // monitor enters the given geofence, an enter type event is created, whereas when // the asset moves out of the geofence an exit type event is created. // // Please note that this object is mandatory when the monitor type belongs to one // of enter, exit or enter_and_exit. GeofenceConfig SkynetMonitorNewParamsGeofenceConfig `json:"geofence_config,omitzero"` // **Deprecated. Please use the geofence_config to specify the geofence_ids for // this monitor.** // // An array of strings to collect the geofence IDs that should be linked to the // monitor. Geofences are geographic boundaries that can be used to trigger events // based on an asset's location. GeofenceIDs []string `json:"geofence_ids,omitzero"` // idle_config is used to set up constraints for creating idle events. When an // asset associated with the monitor has not moved a given distance within a given // time, the Live Tracking API can create events to denote such instances. Please // note that this object is mandatory when the monitor type is idle. // // Let's look at the properties of this object. IdleConfig SkynetMonitorNewParamsIdleConfig `json:"idle_config,omitzero"` // This object is used to identify the asset(s) on which the monitor would be // applied. MatchFilter SkynetMonitorNewParamsMatchFilter `json:"match_filter,omitzero"` // Any valid json object data. Can be used to save customized data. Max size is // 65kb. MetaData Metadata `json:"meta_data,omitzero"` // speeding_config is used to set up constraints for creating over-speed events. // When an asset associated with a monitor is traveling at a speed above the given // limits, the Live Tracking API can create events to denote such instances. There // is also an option to set up a tolerance before creating an event. Please note // that this object is mandatory when type=speeding. // // Let's look at the properties of this object. SpeedingConfig SkynetMonitorNewParamsSpeedingConfig `json:"speeding_config,omitzero"` // contains filtered or unexported fields }
func (SkynetMonitorNewParams) MarshalJSON ¶
func (r SkynetMonitorNewParams) MarshalJSON() (data []byte, err error)
func (SkynetMonitorNewParams) URLQuery ¶
func (r SkynetMonitorNewParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetMonitorNewParams's query parameters as `url.Values`.
func (*SkynetMonitorNewParams) UnmarshalJSON ¶
func (r *SkynetMonitorNewParams) UnmarshalJSON(data []byte) error
type SkynetMonitorNewParamsCluster ¶
type SkynetMonitorNewParamsCluster string
the cluster of the region you want to use
const (
SkynetMonitorNewParamsClusterAmerica SkynetMonitorNewParamsCluster = "america"
)
type SkynetMonitorNewParamsGeofenceConfig ¶
type SkynetMonitorNewParamsGeofenceConfig struct { // An array of strings to collect the geofence IDs that should be linked to the // monitor. Please note geofence_ids are mandatory when using the geofence_config // attribute. GeofenceIDs []string `json:"geofence_ids,omitzero,required"` // contains filtered or unexported fields }
Geofences are geographic boundaries surrounding an area of interest. geofence_config is used to specify the geofences for creating enter or exit type of events based on the asset's location. When an asset associated with the monitor enters the given geofence, an enter type event is created, whereas when the asset moves out of the geofence an exit type event is created.
Please note that this object is mandatory when the monitor type belongs to one of enter, exit or enter_and_exit.
The property GeofenceIDs is required.
func (SkynetMonitorNewParamsGeofenceConfig) MarshalJSON ¶
func (r SkynetMonitorNewParamsGeofenceConfig) MarshalJSON() (data []byte, err error)
func (*SkynetMonitorNewParamsGeofenceConfig) UnmarshalJSON ¶
func (r *SkynetMonitorNewParamsGeofenceConfig) UnmarshalJSON(data []byte) error
type SkynetMonitorNewParamsIdleConfig ¶
type SkynetMonitorNewParamsIdleConfig struct { // Use this parameter to configure a distance threshold that will be used to // determine if the asset was idle or not. If the asset moves by a distance less // than the value of this parameter within a certain time period, the monitor would // create an idle event against the asset. The distance_tolerance should be // provided in meters. // // Users can set an appropriate value for this parameter, along with appropriate // time_tolerance value, to avoid triggering idle events when the asset is crossing // a busy intersection or waiting at the traffic lights. DistanceTolerance float64 `json:"distance_tolerance,required"` // Use this parameter to configure a time duration for which the monitor would // track the distance covered by an asset before triggering an idle event. The // time_tolerance should be provided in milliseconds. // // If the distance covered by the asset during a time_tolerance is less than that // specified in distance_tolerance the asset will be assumed to be idle. // // Please observe that this attribute along with distance_tolerance parameter can // be used to control the "sensitivity" of the monitor with respect to idle alerts. // If the distance_tolerance is set a high value, then setting time_tolerance to a // low value may result in a situation where asset is always judged as idle. On the // contrary, it might never be judged as idle if distance_tolerance is set to a low // value but time_tolerance is set to a high value. // // It is recommended to use these properties with appropriate values to trigger // genuine idle events. The appropriate values might depend on the traffic // conditions, nature of operations that the asset is involved in, type of asset // and other factors. TimeTolerance param.Opt[int64] `json:"time_tolerance,omitzero"` // contains filtered or unexported fields }
idle_config is used to set up constraints for creating idle events. When an asset associated with the monitor has not moved a given distance within a given time, the Live Tracking API can create events to denote such instances. Please note that this object is mandatory when the monitor type is idle.
Let's look at the properties of this object.
The property DistanceTolerance is required.
func (SkynetMonitorNewParamsIdleConfig) MarshalJSON ¶
func (r SkynetMonitorNewParamsIdleConfig) MarshalJSON() (data []byte, err error)
func (*SkynetMonitorNewParamsIdleConfig) UnmarshalJSON ¶
func (r *SkynetMonitorNewParamsIdleConfig) UnmarshalJSON(data []byte) error
type SkynetMonitorNewParamsMatchFilter ¶
type SkynetMonitorNewParamsMatchFilter struct { // A string type dictionary object to specify the attributes. Only the assets // having all of the attributes added to this parameter will be linked to this // monitor. Once an asset is linked to a monitor, the monitor will be able to // create events for that asset whenever an activity specified in type is detected. // Multiple attributes should be separated by a comma ,. // // Please note that this parameter can not be used in conjunction with // include_any_of_attributes. Also, the maximum number of key:value pairs that this // parameter can take is 100 and the overall size of the match_filter object should // not exceed 65kb. IncludeAllOfAttributes any `json:"include_all_of_attributes,omitzero"` // A string type dictionary object to specify the attributes. The assets having at // least one of the attributes added to this parameter will be linked to this // monitor. Once an asset is linked to a monitor, the monitor will be able to // create events for that asset whenever an activity specified in type is detected. // Multiple attributes should be separated by a comma ,. // // Please note that this parameter can not be used in conjunction with // include_all_of_attributes. Also, the maximum number of key:value pairs that this // parameter can take is 100 and the overall size of the match_filter object should // not exceed 65kb. IncludeAnyOfAttributes any `json:"include_any_of_attributes,omitzero"` // contains filtered or unexported fields }
This object is used to identify the asset(s) on which the monitor would be applied.
func (SkynetMonitorNewParamsMatchFilter) MarshalJSON ¶
func (r SkynetMonitorNewParamsMatchFilter) MarshalJSON() (data []byte, err error)
func (*SkynetMonitorNewParamsMatchFilter) UnmarshalJSON ¶
func (r *SkynetMonitorNewParamsMatchFilter) UnmarshalJSON(data []byte) error
type SkynetMonitorNewParamsSpeedingConfig ¶
type SkynetMonitorNewParamsSpeedingConfig struct { // Use this parameter to establish the speed limit that will allow the monitor to // create events, depending on the time_tolerance value, when an asset's tracked // speed exceeds it. The speed limit should be specified in meters per second. // // Please note that customer_speed_limit is mandatory when use_admin_speed_limit is // false. However, when use_admin_speed_limit is true, customer_speed_limit is // ineffective. CustomerSpeedLimit param.Opt[int64] `json:"customer_speed_limit,omitzero"` // Use this parameter to configure a time tolerance before triggering an event. // Adding a tolerance would make the Tracking service wait for the specified time // before triggering the event. Consequently, an event is triggered only when the // time for which the asset has been over-speeding continuously, exceeds the // configured tolerance time. The unit for this parameter is milliseconds. // // It can be seen that this attribute is used to control the "sensitivity" of the // monitor with respect to speed alerts. Higher the value of time_tolerance the // less sensitive the monitor would be to instances of over-speeding. Conversely, // if 'time_tolerance' is set to 0, the monitor will be extremely sensitive and // will create an event as soon as tracking information with a speed value greater // than the specified limit is received. TimeTolerance param.Opt[int64] `json:"time_tolerance,omitzero"` // A boolean attribute to indicate which speed limit values should be used by the // monitor. When use_admin_speed_limit is true, the administrative speed limit of // the road on which the asset is located, will be used to generate events when the // asset’s tracked speed exceeds it. Whereas, when use_admin_speed_limit is false, // the customer_speed_limit specified will be used to generate events when the // asset's tracked speed exceeds it. // // Please note that if use_admin_speed_limit is false, customer_speed_limit is // mandatory, however, when use_admin_speed_limit is true then customer_speed_limit // is ineffective. UseAdminSpeedLimit param.Opt[bool] `json:"use_admin_speed_limit,omitzero"` // contains filtered or unexported fields }
speeding_config is used to set up constraints for creating over-speed events. When an asset associated with a monitor is traveling at a speed above the given limits, the Live Tracking API can create events to denote such instances. There is also an option to set up a tolerance before creating an event. Please note that this object is mandatory when type=speeding.
Let's look at the properties of this object.
func (SkynetMonitorNewParamsSpeedingConfig) MarshalJSON ¶
func (r SkynetMonitorNewParamsSpeedingConfig) MarshalJSON() (data []byte, err error)
func (*SkynetMonitorNewParamsSpeedingConfig) UnmarshalJSON ¶
func (r *SkynetMonitorNewParamsSpeedingConfig) UnmarshalJSON(data []byte) error
type SkynetMonitorNewParamsType ¶
type SkynetMonitorNewParamsType string
Specify the type of activity the monitor would detect.
The monitor will be able to detect the specified type of activity and create events for eligible asset. A monitor can detect following types of asset activity:
enter: The monitor will create an event when a linked asset enters into the specified geofence.
exit: The monitor will create an event when a linked asset exits the specified geofence.
enter_and_exit: The monitor will create an event when a linked asset either enters or exits the specified geofence.
speeding: The monitor will create an event when a linked asset exceeds a given speed limit.
idle: The monitor will create an event when a linked asset exhibits idle activity.
Please note that assets and geofences can be linked to a monitor using the match_filter and geofence_config attributes respectively.
const ( SkynetMonitorNewParamsTypeEnter SkynetMonitorNewParamsType = "enter" SkynetMonitorNewParamsTypeExit SkynetMonitorNewParamsType = "exit" SkynetMonitorNewParamsTypeEnterAndExit SkynetMonitorNewParamsType = "enter_and_exit" SkynetMonitorNewParamsTypeSpeeding SkynetMonitorNewParamsType = "speeding" SkynetMonitorNewParamsTypeIdle SkynetMonitorNewParamsType = "idle" )
type SkynetMonitorNewResponse ¶
type SkynetMonitorNewResponse struct { // A data object containing the ID of the monitor created. Data SkynetMonitorNewResponseData `json:"data"` // Displays the error message in case of a failed request. If the request is // successful, this field is not present in the response. Message string `json:"message"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Message respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetMonitorNewResponse) RawJSON ¶
func (r SkynetMonitorNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetMonitorNewResponse) UnmarshalJSON ¶
func (r *SkynetMonitorNewResponse) UnmarshalJSON(data []byte) error
type SkynetMonitorNewResponseData ¶
type SkynetMonitorNewResponseData struct { // Unique ID of the monitor created. Please note this ID cannot be updated. ID string `json:"id"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
A data object containing the ID of the monitor created.
func (SkynetMonitorNewResponseData) RawJSON ¶
func (r SkynetMonitorNewResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetMonitorNewResponseData) UnmarshalJSON ¶
func (r *SkynetMonitorNewResponseData) UnmarshalJSON(data []byte) error
type SkynetMonitorService ¶
type SkynetMonitorService struct {
Options []option.RequestOption
}
SkynetMonitorService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSkynetMonitorService method instead.
func NewSkynetMonitorService ¶
func NewSkynetMonitorService(opts ...option.RequestOption) (r SkynetMonitorService)
NewSkynetMonitorService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SkynetMonitorService) Delete ¶
func (r *SkynetMonitorService) Delete(ctx context.Context, id string, body SkynetMonitorDeleteParams, opts ...option.RequestOption) (res *SimpleResp, err error)
Delete a Monitor
func (*SkynetMonitorService) Get ¶
func (r *SkynetMonitorService) Get(ctx context.Context, id string, query SkynetMonitorGetParams, opts ...option.RequestOption) (res *SkynetMonitorGetResponse, err error)
Get a Monitor
func (*SkynetMonitorService) List ¶
func (r *SkynetMonitorService) List(ctx context.Context, query SkynetMonitorListParams, opts ...option.RequestOption) (res *SkynetMonitorListResponse, err error)
Get Monitor List
func (*SkynetMonitorService) New ¶
func (r *SkynetMonitorService) New(ctx context.Context, params SkynetMonitorNewParams, opts ...option.RequestOption) (res *SkynetMonitorNewResponse, err error)
Create a Monitor
func (*SkynetMonitorService) Update ¶
func (r *SkynetMonitorService) Update(ctx context.Context, id string, params SkynetMonitorUpdateParams, opts ...option.RequestOption) (res *SimpleResp, err error)
Update a Monitor
type SkynetMonitorUpdateParams ¶
type SkynetMonitorUpdateParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Use this parameter to update the description of the monitor. Description param.Opt[string] `json:"description,omitzero"` // Use this parameter to update the name of the monitor. Users can add meaningful // names to the monitors like "warehouse_exit", "depot_entry" etc. Name param.Opt[string] `json:"name,omitzero"` // geofence_config is used to update the set of geofences linked to the monitor for // creating enter or exit type of events based on the asset's location. Please note // that this object is mandatory when the monitor type belongs to one of enter, // exit or enter_and_exit. GeofenceConfig SkynetMonitorUpdateParamsGeofenceConfig `json:"geofence_config,omitzero"` // Use this parameter to update the geofences linked to the monitor by providing // the geofence id as , separated strings. Geofences are geographic boundaries that // can be used to trigger events based on an asset's location. GeofenceIDs []string `json:"geofence_ids,omitzero"` // idle_config is used to update the constraints for creating idle events. When an // asset associated with the monitor has not moved a given distance within a given // time, the Live Tracking API can create events to denote such instances. // // Please note that this object is mandatory when the monitor type is idle. IdleConfig SkynetMonitorUpdateParamsIdleConfig `json:"idle_config,omitzero"` // Use this object to update the attributes of the monitor. Please note that using // this property will overwrite the existing attributes that the monitor might be // using currently to match any asset(s). MatchFilter SkynetMonitorUpdateParamsMatchFilter `json:"match_filter,omitzero"` // Any valid json object data. Can be used to save customized data. Max size is // 65kb. MetaData Metadata `json:"meta_data,omitzero"` // speeding_config is used to update the tolerance values for creating over-speed // events. When an asset associated with a monitor is traveling at a speed above // the given limits, Live Tracking API creates events to indicate such instances. // // Please note that this object is mandatory when the monitor type is speeding. SpeedingConfig SkynetMonitorUpdateParamsSpeedingConfig `json:"speeding_config,omitzero"` // Use this parameter to update the tags of the monitor. tags can be used for // filtering monitors in the _Get Monitor List_ operation. They can also be used // for easy identification of monitors. Using this parameter overwrites the // existing tags of the monitor. // // Please note that valid tags are strings, consisting of alphanumeric characters // (A-Z, a-z, 0-9) along with the underscore ('\_') and hyphen ('-') symbols. Tags []string `json:"tags,omitzero"` // Use this parameter to update the type of the monitor. The monitor will be able // to detect the specified type of activity and create events for eligible asset. A // monitor can detect following types of asset activity: // // - enter: The monitor will create an event when a linked asset enters into the // specified geofence. // // - exit: The monitor will create an event when a linked asset exits the specified // geofence. // // - enter_and_exit: The monitor will create an event when a linked asset either // enters or exits the specified geofence. // // - speeding: The monitor will create an event when a linked asset exceeds a given // speed limit. // // - idle: The monitor will create an event when a linked asset exhibits idle // activity. // // Please note that assets and geofences can be linked to a monitor using the // match_filter and geofence_config attributes respectively. // // Any of "enter", "exit", "enter_and_exit", "speeding", "idle". Type SkynetMonitorUpdateParamsType `json:"type,omitzero"` // contains filtered or unexported fields }
func (SkynetMonitorUpdateParams) MarshalJSON ¶
func (r SkynetMonitorUpdateParams) MarshalJSON() (data []byte, err error)
func (SkynetMonitorUpdateParams) URLQuery ¶
func (r SkynetMonitorUpdateParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetMonitorUpdateParams's query parameters as `url.Values`.
func (*SkynetMonitorUpdateParams) UnmarshalJSON ¶
func (r *SkynetMonitorUpdateParams) UnmarshalJSON(data []byte) error
type SkynetMonitorUpdateParamsGeofenceConfig ¶
type SkynetMonitorUpdateParamsGeofenceConfig struct { // Use this array to update the geofence IDs that should be linked to the monitor. // Please note geofence_ids are mandatory when using the geofence_config attribute. GeofenceIDs []string `json:"geofence_ids,omitzero,required"` // contains filtered or unexported fields }
geofence_config is used to update the set of geofences linked to the monitor for creating enter or exit type of events based on the asset's location. Please note that this object is mandatory when the monitor type belongs to one of enter, exit or enter_and_exit.
The property GeofenceIDs is required.
func (SkynetMonitorUpdateParamsGeofenceConfig) MarshalJSON ¶
func (r SkynetMonitorUpdateParamsGeofenceConfig) MarshalJSON() (data []byte, err error)
func (*SkynetMonitorUpdateParamsGeofenceConfig) UnmarshalJSON ¶
func (r *SkynetMonitorUpdateParamsGeofenceConfig) UnmarshalJSON(data []byte) error
type SkynetMonitorUpdateParamsIdleConfig ¶
type SkynetMonitorUpdateParamsIdleConfig struct { // Use this parameter to update the distance threshold that will be used to // determine if the asset was idle or not. When the asset, within time_tolerance // duration, moves less than the value for this parameter, the monitor creates an // idle event against the asset. The distance_tolerance should be provided in // meters. // // Please note distance_tolerance is mandatory when idle_config attribute is used. DistanceTolerance float64 `json:"distance_tolerance,required"` // Use this parameter to update the time duration for which the monitor would track // the distance covered by an asset before triggering an idle event. The // time_tolerance should be provided in milliseconds. // // If the distance covered by the asset during a time_tolerance is less than that // specified in distance_tolerance the asset will be assumed to be idle. // // This attribute along with distance_tolerance parameter can be used to control // the "sensitivity" of the monitor with respect to idle alerts. It is recommended // to use these properties with appropriate values to trigger genuine idle events. // The appropriate values might depend on the traffic conditions, nature of // operations that the asset is involved in, type of asset and other factors. TimeTolerance param.Opt[int64] `json:"time_tolerance,omitzero"` // contains filtered or unexported fields }
idle_config is used to update the constraints for creating idle events. When an asset associated with the monitor has not moved a given distance within a given time, the Live Tracking API can create events to denote such instances.
Please note that this object is mandatory when the monitor type is idle.
The property DistanceTolerance is required.
func (SkynetMonitorUpdateParamsIdleConfig) MarshalJSON ¶
func (r SkynetMonitorUpdateParamsIdleConfig) MarshalJSON() (data []byte, err error)
func (*SkynetMonitorUpdateParamsIdleConfig) UnmarshalJSON ¶
func (r *SkynetMonitorUpdateParamsIdleConfig) UnmarshalJSON(data []byte) error
type SkynetMonitorUpdateParamsMatchFilter ¶
type SkynetMonitorUpdateParamsMatchFilter struct { // A string type dictionary object to specify the attributes. Only the assets // having all of the attributes added to this parameter will be linked to this // monitor. Once an asset is linked to a monitor, the monitor will be able to // create events for that asset whenever an activity specified in type is detected. // Multiple attributes should be separated by a comma ,. // // Please note that this parameter can not be used in conjunction with // include_any_of_attributes. Also, the maximum number of key:value pairs that this // parameter can take is 100 and the overall size of the match_filter object should // not exceed 65kb. IncludeAllOfAttributes any `json:"include_all_of_attributes,omitzero"` // A string type dictionary object to specify the attributes. The assets having at // least one of the attributes added to this parameter will be linked to this // monitor. Once an asset is linked to a monitor, the monitor will be able to // create events for that asset whenever an activity specified in type is detected. // Multiple attributes should be separated by a comma ,. // // Please note that this parameter can not be used in conjunction with // include_all_of_attributes. Also, the maximum number of key:value pairs that this // parameter can take is 100 and the overall size of the match_filter object should // not exceed 65kb. IncludeAnyOfAttributes any `json:"include_any_of_attributes,omitzero"` // contains filtered or unexported fields }
Use this object to update the attributes of the monitor. Please note that using this property will overwrite the existing attributes that the monitor might be using currently to match any asset(s).
func (SkynetMonitorUpdateParamsMatchFilter) MarshalJSON ¶
func (r SkynetMonitorUpdateParamsMatchFilter) MarshalJSON() (data []byte, err error)
func (*SkynetMonitorUpdateParamsMatchFilter) UnmarshalJSON ¶
func (r *SkynetMonitorUpdateParamsMatchFilter) UnmarshalJSON(data []byte) error
type SkynetMonitorUpdateParamsSpeedingConfig ¶
type SkynetMonitorUpdateParamsSpeedingConfig struct { // Use this parameter to update the speed limit value that the monitor will use to // create events, depending on the time_tolerance value. The speed limit should be // specified in meters per second. // // Please note that customer_speed_limit is mandatory when use_admin_speed_limit is // false. However, when use_admin_speed_limit is true, customer_speed_limit is // ineffective. CustomerSpeedLimit param.Opt[string] `json:"customer_speed_limit,omitzero"` // Use this parameter to update the time tolerance before triggering an event. // Adding a tolerance would make the Tracking service wait for the specified time // before triggering the event. Consequently, an event is triggered only when the // time for which the asset has been over-speeding continuously, exceeds the // configured tolerance time. The unit for this parameter is milliseconds. // // It can be seen that this attribute is used to control the "sensitivity" of the // monitor with respect to speed alerts. Higher the value of time_tolerance the // less sensitive the monitor would be to instances of over-speeding. Conversely, // if 'time_tolerance' is set to 0, the monitor will be extremely sensitive and // will create an event as soon as tracking information with a speed value greater // than the specified limit is received. TimeTolerance param.Opt[int64] `json:"time_tolerance,omitzero"` // Use this attribute to update which speed limit values will be used by the // monitor. When use_admin_speed_limit is true, the administrative speed limit of // the road on which the asset is located, is used to generate events when the // asset’s tracked speed exceeds it. Whereas, when use_admin_speed_limit is false, // the customer_speed_limit specified will be used to generate events when the // asset's tracked speed exceeds it. // // Please note that if use_admin_speed_limit is false, customer_speed_limit is // mandatory, otherwise when use_admin_speed_limit is true then // customer_speed_limit is ineffective. UseAdminSpeedLimit param.Opt[bool] `json:"use_admin_speed_limit,omitzero"` // contains filtered or unexported fields }
speeding_config is used to update the tolerance values for creating over-speed events. When an asset associated with a monitor is traveling at a speed above the given limits, Live Tracking API creates events to indicate such instances.
Please note that this object is mandatory when the monitor type is speeding.
func (SkynetMonitorUpdateParamsSpeedingConfig) MarshalJSON ¶
func (r SkynetMonitorUpdateParamsSpeedingConfig) MarshalJSON() (data []byte, err error)
func (*SkynetMonitorUpdateParamsSpeedingConfig) UnmarshalJSON ¶
func (r *SkynetMonitorUpdateParamsSpeedingConfig) UnmarshalJSON(data []byte) error
type SkynetMonitorUpdateParamsType ¶
type SkynetMonitorUpdateParamsType string
Use this parameter to update the type of the monitor. The monitor will be able to detect the specified type of activity and create events for eligible asset. A monitor can detect following types of asset activity:
enter: The monitor will create an event when a linked asset enters into the specified geofence.
exit: The monitor will create an event when a linked asset exits the specified geofence.
enter_and_exit: The monitor will create an event when a linked asset either enters or exits the specified geofence.
speeding: The monitor will create an event when a linked asset exceeds a given speed limit.
idle: The monitor will create an event when a linked asset exhibits idle activity.
Please note that assets and geofences can be linked to a monitor using the match_filter and geofence_config attributes respectively.
const ( SkynetMonitorUpdateParamsTypeEnter SkynetMonitorUpdateParamsType = "enter" SkynetMonitorUpdateParamsTypeExit SkynetMonitorUpdateParamsType = "exit" SkynetMonitorUpdateParamsTypeEnterAndExit SkynetMonitorUpdateParamsType = "enter_and_exit" SkynetMonitorUpdateParamsTypeSpeeding SkynetMonitorUpdateParamsType = "speeding" SkynetMonitorUpdateParamsTypeIdle SkynetMonitorUpdateParamsType = "idle" )
type SkynetNamespacedApikeyDeleteParams ¶
type SkynetNamespacedApikeyDeleteParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Please note for the delete namespace key operation another namespace key // cannot be used. // // The namespace created using this key can be managed using the APIs & Services > // Credentials section of user’s // [NextBillion Console](https://console.nextbillion.ai). Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Specify the key to be deleted. KeyToDelete string `query:"key_to_delete,required" json:"-"` // Specify the name of the namespace to which the \key_to_delete\ belongs. Please // note that a namespace key cannot be deleted using another namespace key. Namespace string `query:"namespace,required" json:"-"` // contains filtered or unexported fields }
func (SkynetNamespacedApikeyDeleteParams) URLQuery ¶
func (r SkynetNamespacedApikeyDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetNamespacedApikeyDeleteParams's query parameters as `url.Values`.
type SkynetNamespacedApikeyDeleteResponse ¶
type SkynetNamespacedApikeyDeleteResponse struct { // Its value is OK in case of a successful delete operation. Indicative error // messages are returned otherwise, for different errors. Msg string `json:"msg"` // A string indicating the state of the response. A successful delete operation ins // indicated by an HTTP code of200. See the // [API Error Codes](https://docs.nextbillion.ai/docs/tracking/api/live-tracking-api#api-error-codes) // section below for possible values in case of errors. Status int64 `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Msg respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetNamespacedApikeyDeleteResponse) RawJSON ¶
func (r SkynetNamespacedApikeyDeleteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetNamespacedApikeyDeleteResponse) UnmarshalJSON ¶
func (r *SkynetNamespacedApikeyDeleteResponse) UnmarshalJSON(data []byte) error
type SkynetNamespacedApikeyNewParams ¶
type SkynetNamespacedApikeyNewParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Specify a name for the namespace. If the namespace specified is unique then a // new namespace along with a new key is created. Whereas if the specified // namespace is not unique, a new key will be created in the existing namespace. // Please note that a namespace cannot be created using another namespace key. Namespace string `query:"namespace,required" json:"-"` // contains filtered or unexported fields }
func (SkynetNamespacedApikeyNewParams) MarshalJSON ¶
func (r SkynetNamespacedApikeyNewParams) MarshalJSON() (data []byte, err error)
func (SkynetNamespacedApikeyNewParams) URLQuery ¶
func (r SkynetNamespacedApikeyNewParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetNamespacedApikeyNewParams's query parameters as `url.Values`.
func (*SkynetNamespacedApikeyNewParams) UnmarshalJSON ¶
func (r *SkynetNamespacedApikeyNewParams) UnmarshalJSON(data []byte) error
type SkynetNamespacedApikeyNewResponse ¶
type SkynetNamespacedApikeyNewResponse struct { // Returns the error type in case of any error. If there is no error, then this // field is absent in the response. Error string `json:"error"` // Returns the error message in case of any error. If there is no error, then this // field is absent in the response. Message string `json:"message"` // An object to return the details about the namespace key created. Result SkynetNamespacedApikeyNewResponseResult `json:"result"` // Returns the API response code. Status int64 `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Error respjson.Field Message respjson.Field Result respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetNamespacedApikeyNewResponse) RawJSON ¶
func (r SkynetNamespacedApikeyNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetNamespacedApikeyNewResponse) UnmarshalJSON ¶
func (r *SkynetNamespacedApikeyNewResponse) UnmarshalJSON(data []byte) error
type SkynetNamespacedApikeyNewResponseResult ¶
type SkynetNamespacedApikeyNewResponseResult struct { // Returns the unique key created for the specified namespace. Apikey string `json:"apikey"` // Returns the time, expressed as UNIX epoch timestamp in seconds, when the // namespace key was created. CreatedAt int64 `json:"created_at"` // Returns the time, expressed as UNIX epoch timestamp in seconds, when the // namespace key will expire. ExpiresAt int64 `json:"expires_at"` // Returns the name of the namespace for which the key is created. Namespace string `json:"namespace"` // An internal subscription ID. SubID string `json:"sub_id"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Apikey respjson.Field CreatedAt respjson.Field ExpiresAt respjson.Field Namespace respjson.Field SubID respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object to return the details about the namespace key created.
func (SkynetNamespacedApikeyNewResponseResult) RawJSON ¶
func (r SkynetNamespacedApikeyNewResponseResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetNamespacedApikeyNewResponseResult) UnmarshalJSON ¶
func (r *SkynetNamespacedApikeyNewResponseResult) UnmarshalJSON(data []byte) error
type SkynetNamespacedApikeyService ¶
type SkynetNamespacedApikeyService struct {
Options []option.RequestOption
}
SkynetNamespacedApikeyService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSkynetNamespacedApikeyService method instead.
func NewSkynetNamespacedApikeyService ¶
func NewSkynetNamespacedApikeyService(opts ...option.RequestOption) (r SkynetNamespacedApikeyService)
NewSkynetNamespacedApikeyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SkynetNamespacedApikeyService) Delete ¶
func (r *SkynetNamespacedApikeyService) Delete(ctx context.Context, body SkynetNamespacedApikeyDeleteParams, opts ...option.RequestOption) (res *SkynetNamespacedApikeyDeleteResponse, err error)
Delete namespace under a parent key
func (*SkynetNamespacedApikeyService) New ¶
func (r *SkynetNamespacedApikeyService) New(ctx context.Context, body SkynetNamespacedApikeyNewParams, opts ...option.RequestOption) (res *SkynetNamespacedApikeyNewResponse, err error)
Create namespace under a parent key
type SkynetSearchAroundParams ¶
type SkynetSearchAroundParams struct { // Location coordinates of the point which would act as the center of the circular // area to be searched. Center string `query:"center,required" format:"latitude,longitude" json:"-"` // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Radius, in meters, of the circular area to be searched. Radius float64 `query:"radius,required" json:"-"` // **tags parameter will be deprecated soon! Please use the // include_any_of_attributes or include_all_of_attributes parameters to match // assets based on their labels or markers.** // // Use this parameter to filter the assets found inside the specified area by their // tags. Multiple tags can be separated using commas (,). // // Please note the tags are case sensitive. Filter param.Opt[string] `query:"filter,omitzero" format:"filter=tag:value_1,value_2..." json:"-"` // Use this parameter to filter the assets found inside the specified area by their // attributes. Only the assets having all the attributes that are added to this // parameter, will be returned in the search results. Multiple attributes can be // separated using pipes (|). // // Please note the attributes are case sensitive. Also, this parameter can not be // used in conjunction with include_any_of_attributes parameter. IncludeAllOfAttributes param.Opt[string] `query:"include_all_of_attributes,omitzero" format:"key_1:value_1|key_2:value_2" json:"-"` // Use this parameter to filter the assets found inside the specified area by their // attributes. Assets having at least one of the attributes added to this // parameter, will be returned in the search results. Multiple attributes can be // separated using pipes (|). // // Please note the attributes are case sensitive. Also, this parameter can not be // used in conjunction with include_all_of_attributes parameter. IncludeAnyOfAttributes param.Opt[string] `query:"include_any_of_attributes,omitzero" format:"key1:value1|key2:value2|..." json:"-"` // When true, the maximum limit is 20Km for around search API and 48000 Km2 for // other search methods. MaxSearchLimit param.Opt[bool] `query:"max_search_limit,omitzero" json:"-"` // Denotes page number. Use this along with the ps parameter to implement // pagination for your searched results. This parameter does not have a maximum // limit but would return an empty response in case a higher value is provided when // the result-set itself is smaller. Pn param.Opt[int64] `query:"pn,omitzero" json:"-"` // Denotes number of search results per page. Use this along with the pn parameter // to implement pagination for your searched results. Ps param.Opt[int64] `query:"ps,omitzero" json:"-"` // Specifies the location coordinates of the point which acts as destination for // sorting the assets in the search results. The service will sort each asset based // on the driving distance or travel time to this destination, from its current // location. Use the sort_by parameter to configure the metric that should be used // for sorting the assets. Please note that sort_destination is required when // sort_by is provided. SortDestination param.Opt[string] `query:"sort_destination,omitzero" format:"latitude,lontitude" json:"-"` // Specify the metric to sort the assets returned in the search result. The valid // values are: // // - **distance** : Sorts the assets by driving distance to the given // sort_destination . // - **duration** : Sorts the assets by travel time to the given sort_destination . // - **straight_distance** : Sort the assets by straight-line distance to the given // sort-destination . // // Any of "distance", "duration", "straight_distance". SortBy SkynetSearchAroundParamsSortBy `query:"sort_by,omitzero" json:"-"` // Specifies the driving mode to be used for determining travel duration or driving // distance for sorting the assets in search result. // // Any of "car", "truck". SortDrivingMode SkynetSearchAroundParamsSortDrivingMode `query:"sort_driving_mode,omitzero" json:"-"` // contains filtered or unexported fields }
func (SkynetSearchAroundParams) URLQuery ¶
func (r SkynetSearchAroundParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetSearchAroundParams's query parameters as `url.Values`.
type SkynetSearchAroundParamsSortBy ¶
type SkynetSearchAroundParamsSortBy string
Specify the metric to sort the assets returned in the search result. The valid values are:
- **distance** : Sorts the assets by driving distance to the given sort_destination .
- **duration** : Sorts the assets by travel time to the given sort_destination .
- **straight_distance** : Sort the assets by straight-line distance to the given sort-destination .
const ( SkynetSearchAroundParamsSortByDistance SkynetSearchAroundParamsSortBy = "distance" SkynetSearchAroundParamsSortByDuration SkynetSearchAroundParamsSortBy = "duration" SkynetSearchAroundParamsSortByStraightDistance SkynetSearchAroundParamsSortBy = "straight_distance" )
type SkynetSearchAroundParamsSortDrivingMode ¶
type SkynetSearchAroundParamsSortDrivingMode string
Specifies the driving mode to be used for determining travel duration or driving distance for sorting the assets in search result.
const ( SkynetSearchAroundParamsSortDrivingModeCar SkynetSearchAroundParamsSortDrivingMode = "car" SkynetSearchAroundParamsSortDrivingModeTruck SkynetSearchAroundParamsSortDrivingMode = "truck" )
type SkynetSearchBoundParams ¶
type SkynetSearchBoundParams struct { // Specify two, pipe (|) delimited location coordinates which would act as corners // of the bounding box area to be searched. The first one should be the southwest // coordinate of the bounds and the second one should be the northeast coordinate // of the bounds. Bound string `query:"bound,required" format:"latitude_1,longitude_2|latitude_1,longitude_2" json:"-"` // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // **tags parameter will be deprecated soon! Please use the // include_any_of_attributes or include_all_of_attributes parameters to match // assets based on their labels or markers.** // // Use this parameter to filter the assets found inside the specified area by their // tags. Multiple tags can be separated using commas (,). // // Please note the tags are case sensitive. Filter param.Opt[string] `query:"filter,omitzero" format:"filter=tag:value_1,value_2..." json:"-"` // Use this parameter to filter the assets found inside the specified area by their // attributes. Only the assets having all the attributes that are added to this // parameter, will be returned in the search results. Multiple attributes can be // separated using pipes (|). // // Please note the attributes are case sensitive. Also, this parameter can not be // used in conjunction with include_any_of_attributes parameter. IncludeAllOfAttributes param.Opt[string] `query:"include_all_of_attributes,omitzero" format:"key_1:value_1|key_2:value_2" json:"-"` // Use this parameter to filter the assets found inside the specified area by their // attributes. Assets having at least one of the attributes added to this // parameter, will be returned in the search results. Multiple attributes can be // separated using pipes (|). // // Please note the attributes are case sensitive. Also, this parameter can not be // used in conjunction with include_all_of_attributes parameter. IncludeAnyOfAttributes param.Opt[string] `query:"include_any_of_attributes,omitzero" format:"key1:value1|key2:value2|..." json:"-"` // When true, the maximum limit is 20Km for around search API and 48000 Km2 for // other search methods. MaxSearchLimit param.Opt[bool] `query:"max_search_limit,omitzero" json:"-"` // Denotes page number. Use this along with the ps parameter to implement // pagination for your searched results. This parameter does not have a maximum // limit but would return an empty response in case a higher value is provided when // the result-set itself is smaller. Pn param.Opt[int64] `query:"pn,omitzero" json:"-"` // Denotes number of search results per page. Use this along with the pn parameter // to implement pagination for your searched results. Ps param.Opt[int64] `query:"ps,omitzero" json:"-"` // Specifies the location coordinates of the point which acts as destination for // sorting the assets in the search results. The service will sort each asset based // on the driving distance or travel time to this destination, from its current // location. Use the sort_by parameter to configure the metric that should be used // for sorting the assets. Please note that sort_destination is required when // sort_by is provided. SortDestination param.Opt[string] `query:"sort_destination,omitzero" format:"latitude,lontitude" json:"-"` // Specify the metric to sort the assets returned in the search result. The valid // values are: // // - **distance** : Sorts the assets by driving distance to the given // sort_destination . // - **duration** : Sorts the assets by travel time to the given sort_destination . // - **straight_distance** : Sort the assets by straight-line distance to the given // sort-destination . // // Any of "distance", "duration", "straight_distance". SortBy SkynetSearchBoundParamsSortBy `query:"sort_by,omitzero" json:"-"` // Specifies the driving mode to be used for determining travel duration or driving // distance for sorting the assets in search result. // // Any of "car", "truck". SortDrivingMode SkynetSearchBoundParamsSortDrivingMode `query:"sort_driving_mode,omitzero" json:"-"` // contains filtered or unexported fields }
func (SkynetSearchBoundParams) URLQuery ¶
func (r SkynetSearchBoundParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetSearchBoundParams's query parameters as `url.Values`.
type SkynetSearchBoundParamsSortBy ¶
type SkynetSearchBoundParamsSortBy string
Specify the metric to sort the assets returned in the search result. The valid values are:
- **distance** : Sorts the assets by driving distance to the given sort_destination .
- **duration** : Sorts the assets by travel time to the given sort_destination .
- **straight_distance** : Sort the assets by straight-line distance to the given sort-destination .
const ( SkynetSearchBoundParamsSortByDistance SkynetSearchBoundParamsSortBy = "distance" SkynetSearchBoundParamsSortByDuration SkynetSearchBoundParamsSortBy = "duration" SkynetSearchBoundParamsSortByStraightDistance SkynetSearchBoundParamsSortBy = "straight_distance" )
type SkynetSearchBoundParamsSortDrivingMode ¶
type SkynetSearchBoundParamsSortDrivingMode string
Specifies the driving mode to be used for determining travel duration or driving distance for sorting the assets in search result.
const ( SkynetSearchBoundParamsSortDrivingModeCar SkynetSearchBoundParamsSortDrivingMode = "car" SkynetSearchBoundParamsSortDrivingModeTruck SkynetSearchBoundParamsSortDrivingMode = "truck" )
type SkynetSearchPolygonGetParams ¶
type SkynetSearchPolygonGetParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Define a custom polygon enclosing the area to be searched. It should be a pipe // (|) delimited list of location coordinates. // // Please ensure that the polygon provided is enclosed. This can be achieved by // making the last location coordinate in the list equal to the first location // coordinate of the list. // // Please note that the maximum area of the search polygon allowed is 3000 // km<sup>2</sup>. Polygon string `query:"polygon,required" format:"latitude_1,longitude_1|latitude_2,longitude_2|..." json:"-"` // **tags parameter will be deprecated soon! Please use the // include_any_of_attributes or include_all_of_attributes parameters to match // assets based on their labels or markers.** // // Use this parameter to filter the assets found inside the specified area by their // tags. Multiple tags can be separated using commas (,). // // Please note the tags are case sensitive. Filter param.Opt[string] `query:"filter,omitzero" format:"filter=tag:value_1,value_2..." json:"-"` // Use this parameter to filter the assets found inside the specified area by their // attributes. Only the assets having all the attributes that are added to this // parameter, will be returned in the search results. Multiple attributes can be // separated using pipes (|). // // Please note the attributes are case sensitive. Also, this parameter can not be // used in conjunction with include_any_of_attributes parameter. IncludeAllOfAttributes param.Opt[string] `query:"include_all_of_attributes,omitzero" format:"key_1:value_1|key_2:value_2" json:"-"` // Use this parameter to filter the assets found inside the specified area by their // attributes. Assets having at least one of the attributes added to this // parameter, will be returned in the search results. Multiple attributes can be // separated using pipes (|). // // Please note the attributes are case sensitive. Also, this parameter can not be // used in conjunction with include_all_of_attributes parameter. IncludeAnyOfAttributes param.Opt[string] `query:"include_any_of_attributes,omitzero" format:"key1:value1|key2:value2|..." json:"-"` // When true, the maximum limit is 20Km for around search API and 48000 Km2 for // other search methods. MaxSearchLimit param.Opt[bool] `query:"max_search_limit,omitzero" json:"-"` // Denotes page number. Use this along with the ps parameter to implement // pagination for your searched results. This parameter does not have a maximum // limit but would return an empty response in case a higher value is provided when // the result-set itself is smaller. Pn param.Opt[int64] `query:"pn,omitzero" json:"-"` // Denotes number of search results per page. Use this along with the pn parameter // to implement pagination for your searched results. Ps param.Opt[int64] `query:"ps,omitzero" json:"-"` // Specifies the location coordinates of the point which acts as destination for // sorting the assets in the search results. The service will sort each asset based // on the driving distance or travel time to this destination, from its current // location. Use the sort_by parameter to configure the metric that should be used // for sorting the assets. Please note that sort_destination is required when // sort_by is provided. SortDestination param.Opt[string] `query:"sort_destination,omitzero" format:"latitude,lontitude" json:"-"` // Specify the metric to sort the assets returned in the search result. The valid // values are: // // - **distance** : Sorts the assets by driving distance to the given // sort_destination . // - **duration** : Sorts the assets by travel time to the given sort_destination . // - **straight_distance** : Sort the assets by straight-line distance to the given // sort-destination . // // Any of "distance", "duration", "straight_distance". SortBy SkynetSearchPolygonGetParamsSortBy `query:"sort_by,omitzero" json:"-"` // Specifies the driving mode to be used for determining travel duration or driving // distance for sorting the assets in search result. // // Any of "car", "truck". SortDrivingMode SkynetSearchPolygonGetParamsSortDrivingMode `query:"sort_driving_mode,omitzero" json:"-"` // contains filtered or unexported fields }
func (SkynetSearchPolygonGetParams) URLQuery ¶
func (r SkynetSearchPolygonGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetSearchPolygonGetParams's query parameters as `url.Values`.
type SkynetSearchPolygonGetParamsSortBy ¶
type SkynetSearchPolygonGetParamsSortBy string
Specify the metric to sort the assets returned in the search result. The valid values are:
- **distance** : Sorts the assets by driving distance to the given sort_destination .
- **duration** : Sorts the assets by travel time to the given sort_destination .
- **straight_distance** : Sort the assets by straight-line distance to the given sort-destination .
const ( SkynetSearchPolygonGetParamsSortByDistance SkynetSearchPolygonGetParamsSortBy = "distance" SkynetSearchPolygonGetParamsSortByDuration SkynetSearchPolygonGetParamsSortBy = "duration" SkynetSearchPolygonGetParamsSortByStraightDistance SkynetSearchPolygonGetParamsSortBy = "straight_distance" )
type SkynetSearchPolygonGetParamsSortDrivingMode ¶
type SkynetSearchPolygonGetParamsSortDrivingMode string
Specifies the driving mode to be used for determining travel duration or driving distance for sorting the assets in search result.
const ( SkynetSearchPolygonGetParamsSortDrivingModeCar SkynetSearchPolygonGetParamsSortDrivingMode = "car" SkynetSearchPolygonGetParamsSortDrivingModeTruck SkynetSearchPolygonGetParamsSortDrivingMode = "truck" )
type SkynetSearchPolygonNewParams ¶
type SkynetSearchPolygonNewParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // An object to collect geoJSON details of a custom polygon. Please ensure that: // // - the polygon provided is enclosed. This can be achieved by making the last // location coordinate in the list equal to the first location coordinate of the // list. // // - the 'polygon' provided does not contain multiple rings. // // The contents of this object follow the // [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946). // // Please note that the maximum area of the search polygon allowed is 3000 // km<sup>2</sup>. Polygon SkynetSearchPolygonNewParamsPolygon `json:"polygon,omitzero,required"` // **tags parameter will be deprecated soon! Please use the // include_any_of_attributes or include_all_of_attributes parameters to match // assets based on their labels or markers.** // // Use this parameter to filter the assets found inside the specified area by their // tag. Multiple tag can be separated using comma (,). // // Please note the tags are case sensitive. Filter param.Opt[string] `json:"filter,omitzero"` // if ture, can get 16x bigger limitation in search. MaxSearchLimit param.Opt[bool] `json:"max_search_limit,omitzero"` // Denotes page number. Use this along with the ps parameter to implement // pagination for your searched results. This parameter does not have a maximum // limit but would return an empty response in case a higher value is provided when // the result-set itself is smaller. Pn param.Opt[int64] `json:"pn,omitzero"` // Denotes number of search results per page. Use this along with the pn parameter // to implement pagination for your searched results. Please note that ps has a // default value of 20 and accepts integers only in the range of [1, 100]. Ps param.Opt[int64] `json:"ps,omitzero"` // An object to define the attributes which will be used to filter the assets found // within the polygon. MatchFilter SkynetSearchPolygonNewParamsMatchFilter `json:"match_filter,omitzero"` Sort SkynetSearchPolygonNewParamsSort `json:"sort,omitzero"` // contains filtered or unexported fields }
func (SkynetSearchPolygonNewParams) MarshalJSON ¶
func (r SkynetSearchPolygonNewParams) MarshalJSON() (data []byte, err error)
func (SkynetSearchPolygonNewParams) URLQuery ¶
func (r SkynetSearchPolygonNewParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetSearchPolygonNewParams's query parameters as `url.Values`.
func (*SkynetSearchPolygonNewParams) UnmarshalJSON ¶
func (r *SkynetSearchPolygonNewParams) UnmarshalJSON(data []byte) error
type SkynetSearchPolygonNewParamsMatchFilter ¶
type SkynetSearchPolygonNewParamsMatchFilter struct { // Use this parameter to filter the assets found inside the specified area by their // attributes. Only the assets having all the attributes that are added to this // parameter, will be returned in the search results. Multiple attributes can be // separated using commas (,). // // Please note the attributes are case sensitive. Also, this parameter can not be // used in conjunction with include_any_of_attributes parameter. IncludeAllOfAttributes param.Opt[string] `json:"include_all_of_attributes,omitzero"` // Use this parameter to filter the assets found inside the specified area by their // attributes. Assets having at least one of the attributes added to this // parameter, will be returned in the search results. Multiple attributes can be // separated using commas (,). // // Please note the attributes are case sensitive. Also, this parameter can not be // used in conjunction with include_all_of_attributes parameter. IncludeAnyOfAttributes param.Opt[string] `json:"include_any_of_attributes,omitzero"` // contains filtered or unexported fields }
An object to define the attributes which will be used to filter the assets found within the polygon.
func (SkynetSearchPolygonNewParamsMatchFilter) MarshalJSON ¶
func (r SkynetSearchPolygonNewParamsMatchFilter) MarshalJSON() (data []byte, err error)
func (*SkynetSearchPolygonNewParamsMatchFilter) UnmarshalJSON ¶
func (r *SkynetSearchPolygonNewParamsMatchFilter) UnmarshalJSON(data []byte) error
type SkynetSearchPolygonNewParamsPolygon ¶
type SkynetSearchPolygonNewParamsPolygon struct { // An array of coordinates in the [longitude, latitude] format, representing the // polygon boundary. Coordinates []float64 `json:"coordinates,omitzero,required"` // Type of the geoJSON geometry. Should always be polygon. Type string `json:"type,required"` // contains filtered or unexported fields }
An object to collect geoJSON details of a custom polygon. Please ensure that:
- the polygon provided is enclosed. This can be achieved by making the last location coordinate in the list equal to the first location coordinate of the list.
- the 'polygon' provided does not contain multiple rings.
The contents of this object follow the [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946).
Please note that the maximum area of the search polygon allowed is 3000 km<sup>2</sup>.
The properties Coordinates, Type are required.
func (SkynetSearchPolygonNewParamsPolygon) MarshalJSON ¶
func (r SkynetSearchPolygonNewParamsPolygon) MarshalJSON() (data []byte, err error)
func (*SkynetSearchPolygonNewParamsPolygon) UnmarshalJSON ¶
func (r *SkynetSearchPolygonNewParamsPolygon) UnmarshalJSON(data []byte) error
type SkynetSearchPolygonNewParamsSort ¶
type SkynetSearchPolygonNewParamsSort struct { // Specify the metric to sort the assets returned in the search result. The valid // values are: // // - **distance** : Sorts the assets by driving distance to the given // sort_destination . // - **duration** : Sorts the assets by travel time to the given sort_destination . // - **straight_distance** : Sort the assets by straight-line distance to the given // sort-destination . // // Any of "distance", "duration", "straight_distance". SortBy string `json:"sort_by,omitzero"` // Specifies the location coordinates of the point which acts as destination for // sorting the assets in the search results. The service will sort each asset based // on the driving distance or travel time to this destination, from its current // location. Use the sort_by parameter to configure the metric that should be used // for sorting the assets. Please note that sort_destination is required when // sort_by is provided. SortDestination SkynetSearchPolygonNewParamsSortSortDestination `json:"sort_destination,omitzero"` // Specifies the driving mode to be used for determining travel duration or driving // distance for sorting the assets in search result. // // Any of "car", "truck". SortDrivingMode string `json:"sort_driving_mode,omitzero"` // contains filtered or unexported fields }
func (SkynetSearchPolygonNewParamsSort) MarshalJSON ¶
func (r SkynetSearchPolygonNewParamsSort) MarshalJSON() (data []byte, err error)
func (*SkynetSearchPolygonNewParamsSort) UnmarshalJSON ¶
func (r *SkynetSearchPolygonNewParamsSort) UnmarshalJSON(data []byte) error
type SkynetSearchPolygonNewParamsSortSortDestination ¶
type SkynetSearchPolygonNewParamsSortSortDestination struct { // Latitude of the destination location Lat float64 `json:"lat,required"` // Longitude of the destination location Lon float64 `json:"lon,required"` // contains filtered or unexported fields }
Specifies the location coordinates of the point which acts as destination for sorting the assets in the search results. The service will sort each asset based on the driving distance or travel time to this destination, from its current location. Use the sort_by parameter to configure the metric that should be used for sorting the assets. Please note that sort_destination is required when sort_by is provided.
The properties Lat, Lon are required.
func (SkynetSearchPolygonNewParamsSortSortDestination) MarshalJSON ¶
func (r SkynetSearchPolygonNewParamsSortSortDestination) MarshalJSON() (data []byte, err error)
func (*SkynetSearchPolygonNewParamsSortSortDestination) UnmarshalJSON ¶
func (r *SkynetSearchPolygonNewParamsSortSortDestination) UnmarshalJSON(data []byte) error
type SkynetSearchPolygonService ¶
type SkynetSearchPolygonService struct {
Options []option.RequestOption
}
SkynetSearchPolygonService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSkynetSearchPolygonService method instead.
func NewSkynetSearchPolygonService ¶
func NewSkynetSearchPolygonService(opts ...option.RequestOption) (r SkynetSearchPolygonService)
NewSkynetSearchPolygonService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SkynetSearchPolygonService) Get ¶
func (r *SkynetSearchPolygonService) Get(ctx context.Context, query SkynetSearchPolygonGetParams, opts ...option.RequestOption) (res *SearchResponse, err error)
Polygon Search
func (*SkynetSearchPolygonService) New ¶
func (r *SkynetSearchPolygonService) New(ctx context.Context, params SkynetSearchPolygonNewParams, opts ...option.RequestOption) (res *SearchResponse, err error)
Polygon Search
type SkynetSearchService ¶
type SkynetSearchService struct { Options []option.RequestOption Polygon SkynetSearchPolygonService }
SkynetSearchService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSkynetSearchService method instead.
func NewSkynetSearchService ¶
func NewSkynetSearchService(opts ...option.RequestOption) (r SkynetSearchService)
NewSkynetSearchService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SkynetSearchService) Around ¶
func (r *SkynetSearchService) Around(ctx context.Context, query SkynetSearchAroundParams, opts ...option.RequestOption) (res *SearchResponse, err error)
Around Search
func (*SkynetSearchService) Bound ¶
func (r *SkynetSearchService) Bound(ctx context.Context, query SkynetSearchBoundParams, opts ...option.RequestOption) (res *SearchResponse, err error)
Bound Search
type SkynetService ¶
type SkynetService struct { Options []option.RequestOption Asset SkynetAssetService Monitor SkynetMonitorService Trip SkynetTripService NamespacedApikeys SkynetNamespacedApikeyService Config SkynetConfigService Search SkynetSearchService }
SkynetService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSkynetService method instead.
func NewSkynetService ¶
func NewSkynetService(opts ...option.RequestOption) (r SkynetService)
NewSkynetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SkynetService) Subscribe ¶
func (r *SkynetService) Subscribe(ctx context.Context, body SkynetSubscribeParams, opts ...option.RequestOption) (res *SkynetSubscribeResponse, err error)
POST Action
type SkynetSubscribeParams ¶
type SkynetSubscribeParams struct { // Specify the behavior that needs to be achieved for the subscription. Following // values are accepted: // // - TRIP_SUBSCRIBE: Enable a trip subscription. // - TRIP_UNSUBSCRIBE: Unsubscribe from a trip // - HEARTBEAT: Enable heartbeat mechanism for a web-socket connection. The action // message need to be sent at a frequency higher than every 5 mins to keep the // connection alive. Alternatively, users can chose to respond to the ping frame // sent by web socket server to keep the connection alive. Refer to // [connection details](https://188--nbai-docs-stg.netlify.app/docs/tracking/api/live-tracking-api#connect-to-web-socket-server) // for more details. // // Any of "TRIP_SUBSCRIBE", "TRIP_UNSUBSCRIBE", "HEARTBEAT". Action SkynetSubscribeParamsAction `json:"action,omitzero,required"` // Specify a custom ID for the subscription. It can be used to reference a given // subscription in the downstream applications / systems. ID param.Opt[string] `json:"id,omitzero"` Params SkynetSubscribeParamsParams `json:"params,omitzero"` // contains filtered or unexported fields }
func (SkynetSubscribeParams) MarshalJSON ¶
func (r SkynetSubscribeParams) MarshalJSON() (data []byte, err error)
func (*SkynetSubscribeParams) UnmarshalJSON ¶
func (r *SkynetSubscribeParams) UnmarshalJSON(data []byte) error
type SkynetSubscribeParamsAction ¶
type SkynetSubscribeParamsAction string
Specify the behavior that needs to be achieved for the subscription. Following values are accepted:
- TRIP_SUBSCRIBE: Enable a trip subscription.
- TRIP_UNSUBSCRIBE: Unsubscribe from a trip
- HEARTBEAT: Enable heartbeat mechanism for a web-socket connection. The action message need to be sent at a frequency higher than every 5 mins to keep the connection alive. Alternatively, users can chose to respond to the ping frame sent by web socket server to keep the connection alive. Refer to [connection details](https://188--nbai-docs-stg.netlify.app/docs/tracking/api/live-tracking-api#connect-to-web-socket-server) for more details.
const ( SkynetSubscribeParamsActionTripSubscribe SkynetSubscribeParamsAction = "TRIP_SUBSCRIBE" SkynetSubscribeParamsActionTripUnsubscribe SkynetSubscribeParamsAction = "TRIP_UNSUBSCRIBE" SkynetSubscribeParamsActionHeartbeat SkynetSubscribeParamsAction = "HEARTBEAT" )
type SkynetSubscribeParamsParams ¶
type SkynetSubscribeParamsParams struct { // Specify the ID of an active trip that needs to be subscribed. The ID of a trip // is returned in the response when _Start A Trip_ request is acknowledged. // // This attribute is mandatory when action is set to either "TRIP_SUBSCRIBE" or // "TRIP_UNSUBSCRIBE" ID string `json:"id,required"` // contains filtered or unexported fields }
The property ID is required.
func (SkynetSubscribeParamsParams) MarshalJSON ¶
func (r SkynetSubscribeParamsParams) MarshalJSON() (data []byte, err error)
func (*SkynetSubscribeParamsParams) UnmarshalJSON ¶
func (r *SkynetSubscribeParamsParams) UnmarshalJSON(data []byte) error
type SkynetSubscribeResponse ¶
type SkynetSubscribeResponse struct { // Subscription ID as provided in the input action message. ID string `json:"id"` // Returns the error message when status: error. Otherwise, response doesn't // contain this field. Error string `json:"error"` // Status of the action. It can have only two values - "success" or "error". Status string `json:"status"` // Returns the UNIX timestamp, in milliseconds format, when the web-socket returns // the action response. Timestamp int64 `json:"timestamp"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Error respjson.Field Status respjson.Field Timestamp respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetSubscribeResponse) RawJSON ¶
func (r SkynetSubscribeResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetSubscribeResponse) UnmarshalJSON ¶
func (r *SkynetSubscribeResponse) UnmarshalJSON(data []byte) error
type SkynetTripDeleteParams ¶
type SkynetTripDeleteParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // the cluster of the region you want to use // // Any of "america". Cluster SkynetTripDeleteParamsCluster `query:"cluster,omitzero" json:"-"` // contains filtered or unexported fields }
func (SkynetTripDeleteParams) URLQuery ¶
func (r SkynetTripDeleteParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetTripDeleteParams's query parameters as `url.Values`.
type SkynetTripDeleteParamsCluster ¶
type SkynetTripDeleteParamsCluster string
the cluster of the region you want to use
const (
SkynetTripDeleteParamsClusterAmerica SkynetTripDeleteParamsCluster = "america"
)
type SkynetTripEndParams ¶
type SkynetTripEndParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Specify the ID of the trip to be ended. ID string `json:"id,required"` // the cluster of the region you want to use // // Any of "america". Cluster SkynetTripEndParamsCluster `query:"cluster,omitzero" json:"-"` // contains filtered or unexported fields }
func (SkynetTripEndParams) MarshalJSON ¶
func (r SkynetTripEndParams) MarshalJSON() (data []byte, err error)
func (SkynetTripEndParams) URLQuery ¶
func (r SkynetTripEndParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetTripEndParams's query parameters as `url.Values`.
func (*SkynetTripEndParams) UnmarshalJSON ¶
func (r *SkynetTripEndParams) UnmarshalJSON(data []byte) error
type SkynetTripEndParamsCluster ¶
type SkynetTripEndParamsCluster string
the cluster of the region you want to use
const (
SkynetTripEndParamsClusterAmerica SkynetTripEndParamsCluster = "america"
)
type SkynetTripGetParams ¶
type SkynetTripGetParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // the cluster of the region you want to use // // Any of "america". Cluster SkynetTripGetParamsCluster `query:"cluster,omitzero" json:"-"` // contains filtered or unexported fields }
func (SkynetTripGetParams) URLQuery ¶
func (r SkynetTripGetParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetTripGetParams's query parameters as `url.Values`.
type SkynetTripGetParamsCluster ¶
type SkynetTripGetParamsCluster string
the cluster of the region you want to use
const (
SkynetTripGetParamsClusterAmerica SkynetTripGetParamsCluster = "america"
)
type SkynetTripGetResponse ¶
type SkynetTripGetResponse struct { // An container for the trip returned by the service. Data SkynetTripGetResponseData `json:"data"` // Displays the error message in case of a failed request. If the request is // successful, this field is not present in the response. Message string `json:"message"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Message respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetTripGetResponse) RawJSON ¶
func (r SkynetTripGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetTripGetResponse) UnmarshalJSON ¶
func (r *SkynetTripGetResponse) UnmarshalJSON(data []byte) error
type SkynetTripGetResponseData ¶
type SkynetTripGetResponseData struct { // An object containing the returned trip details. Trip SkynetTripGetResponseDataTrip `json:"trip"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Trip respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An container for the trip returned by the service.
func (SkynetTripGetResponseData) RawJSON ¶
func (r SkynetTripGetResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetTripGetResponseData) UnmarshalJSON ¶
func (r *SkynetTripGetResponseData) UnmarshalJSON(data []byte) error
type SkynetTripGetResponseDataTrip ¶
type SkynetTripGetResponseDataTrip struct { // Returns the unique identifier of the trip. ID string `json:"id"` // Returns the ID of the asset linked to the trip when the trip was started or // updated. AssetID string `json:"asset_id"` // Returns the attributes provided for the trip at the time of starting or updating // it. Attributes any `json:"attributes"` // Returns the time, expressed as UNIX epoch timestamp in milliseconds, when the // trip was created. CreatedAt int64 `json:"created_at"` // Returns the custom description for the trip as provided at the time of starting // or updating the trip. Description string `json:"description"` // Returns the time, expressed as UNIX epoch timestamp in milliseconds, when the // trip ended. EndedAt int64 `json:"ended_at"` // Returns the metadata containing additional information about the trip as // provided at the time of starting or updating the trip. MetaData any `json:"meta_data"` // Returns the name for the trip as provided at the time of starting or updating // the trip. Name string `json:"name"` // An array of object returning the details of the locations tracked for the asset // during the trip which has ended. Each object represents a single location that // was tracked. // // Please note that this attribute will not be present in the response if no // locations were tracked/uploaded during the trip. Route []TrackLocation `json:"route"` // Returns the time, expressed as UNIX epoch timestamp in milliseconds, when the // trip started. StartedAt int64 `json:"started_at"` // Returns the current state of the trip. The value will be "active" if the trip is // still going on, otherwise the value returned would be "ended". State string `json:"state"` // An array of objects returning the details of the stops made during the trip. // Each object represents a single stop. Stops []TripStop `json:"stops"` // Returns the timeme, expressed as UNIX epoch timestamp in milliseconds, when the // trip was last updated. UpdatedAt int64 `json:"updated_at"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field AssetID respjson.Field Attributes respjson.Field CreatedAt respjson.Field Description respjson.Field EndedAt respjson.Field MetaData respjson.Field Name respjson.Field Route respjson.Field StartedAt respjson.Field State respjson.Field Stops respjson.Field UpdatedAt respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object containing the returned trip details.
func (SkynetTripGetResponseDataTrip) RawJSON ¶
func (r SkynetTripGetResponseDataTrip) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetTripGetResponseDataTrip) UnmarshalJSON ¶
func (r *SkynetTripGetResponseDataTrip) UnmarshalJSON(data []byte) error
type SkynetTripGetSummaryParams ¶
type SkynetTripGetSummaryParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // the cluster of the region you want to use // // Any of "america". Cluster SkynetTripGetSummaryParamsCluster `query:"cluster,omitzero" json:"-"` // contains filtered or unexported fields }
func (SkynetTripGetSummaryParams) URLQuery ¶
func (r SkynetTripGetSummaryParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetTripGetSummaryParams's query parameters as `url.Values`.
type SkynetTripGetSummaryParamsCluster ¶
type SkynetTripGetSummaryParamsCluster string
the cluster of the region you want to use
const (
SkynetTripGetSummaryParamsClusterAmerica SkynetTripGetSummaryParamsCluster = "america"
)
type SkynetTripGetSummaryResponse ¶
type SkynetTripGetSummaryResponse struct { // An container for the trip returned by the service. Data SkynetTripGetSummaryResponseData `json:"data"` // Displays the error message in case of a failed request. If the request is // successful, this field is not present in the response. Message string `json:"message"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Message respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetTripGetSummaryResponse) RawJSON ¶
func (r SkynetTripGetSummaryResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetTripGetSummaryResponse) UnmarshalJSON ¶
func (r *SkynetTripGetSummaryResponse) UnmarshalJSON(data []byte) error
type SkynetTripGetSummaryResponseData ¶
type SkynetTripGetSummaryResponseData struct { // An object containing the returned trip summary. Trip SkynetTripGetSummaryResponseDataTrip `json:"trip"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Trip respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An container for the trip returned by the service.
func (SkynetTripGetSummaryResponseData) RawJSON ¶
func (r SkynetTripGetSummaryResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetTripGetSummaryResponseData) UnmarshalJSON ¶
func (r *SkynetTripGetSummaryResponseData) UnmarshalJSON(data []byte) error
type SkynetTripGetSummaryResponseDataTrip ¶
type SkynetTripGetSummaryResponseDataTrip struct { // Returns the unique identifier of the trip. ID string `json:"id"` // An object with details of the asset properties. Asset AssetDetails `json:"asset"` // Returns the ID of the asset linked to the trip when the trip was started or // updated. AssetID string `json:"asset_id"` // Returns the attributes provided for the trip at the time of starting or updating // it. Attributes any `json:"attributes"` // Returns the time, expressed as UNIX epoch timestamp in milliseconds, when the // trip was created. CreatedAt int64 `json:"created_at"` // Returns the custom description for the trip as provided at the time of starting // or updating the trip. Description string `json:"description"` // Returns the total distance covered during the trip, in meters. Please note that // this field will be available in the response only if a minimum of 3 locations // were tracked during the trip. Distance float64 `json:"distance"` // Returns the total duration elapsed during the trip, in seconds. Please note that // this field will be available in the response only if a minimum of 3 locations // were tracked during the trip. Duration float64 `json:"duration"` // Returns the time, expressed as UNIX epoch timestamp in milliseconds, when the // trip ended. EndedAt int64 `json:"ended_at"` // Returns the geometry of the route that was taken during the trip, encoded in // polyline format. Please note that this field will be available in the response // only if a minimum of 3 locations were tracked during the trip. Geometry []string `json:"geometry"` // Returns the metadata containing additional information about the trip as // provided at the time of starting or updating the trip. MetaData any `json:"meta_data"` // Returns the name for the trip as provided at the time of starting or updating // the trip. Name string `json:"name"` // An array of object returning the details of the locations tracked for the asset // during the trip which has ended. Each object represents a single location that // was tracked. // // Please note that this attribute will not be present in the response if no // locations were tracked/uploaded during the trip. Route []TrackLocation `json:"route"` // Returns the time, expressed as UNIX epoch timestamp in milliseconds, when the // trip started. StartedAt int64 `json:"started_at"` // Returns the current state of the trip. The value will be "active" if the trip is // still going on, otherwise the value returned would be "ended". State string `json:"state"` // An array of objects returning the details of the stops made during the trip. // Each object represents a single stop. Stops []TripStop `json:"stops"` // Returns the timeme, expressed as UNIX epoch timestamp in milliseconds, when the // trip was last updated. UpdatedAt int64 `json:"updated_at"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Asset respjson.Field AssetID respjson.Field Attributes respjson.Field CreatedAt respjson.Field Description respjson.Field Distance respjson.Field Duration respjson.Field EndedAt respjson.Field Geometry respjson.Field MetaData respjson.Field Name respjson.Field Route respjson.Field StartedAt respjson.Field State respjson.Field Stops respjson.Field UpdatedAt respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object containing the returned trip summary.
func (SkynetTripGetSummaryResponseDataTrip) RawJSON ¶
func (r SkynetTripGetSummaryResponseDataTrip) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetTripGetSummaryResponseDataTrip) UnmarshalJSON ¶
func (r *SkynetTripGetSummaryResponseDataTrip) UnmarshalJSON(data []byte) error
type SkynetTripService ¶
type SkynetTripService struct {
Options []option.RequestOption
}
SkynetTripService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSkynetTripService method instead.
func NewSkynetTripService ¶
func NewSkynetTripService(opts ...option.RequestOption) (r SkynetTripService)
NewSkynetTripService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SkynetTripService) Delete ¶
func (r *SkynetTripService) Delete(ctx context.Context, id string, body SkynetTripDeleteParams, opts ...option.RequestOption) (res *SimpleResp, err error)
Deletes a specified trip from the system.
func (*SkynetTripService) End ¶
func (r *SkynetTripService) End(ctx context.Context, params SkynetTripEndParams, opts ...option.RequestOption) (res *SimpleResp, err error)
End a trip
func (*SkynetTripService) Get ¶
func (r *SkynetTripService) Get(ctx context.Context, id string, query SkynetTripGetParams, opts ...option.RequestOption) (res *SkynetTripGetResponse, err error)
Retrieves detailed information about a specific trip.
func (*SkynetTripService) GetSummary ¶
func (r *SkynetTripService) GetSummary(ctx context.Context, id string, query SkynetTripGetSummaryParams, opts ...option.RequestOption) (res *SkynetTripGetSummaryResponse, err error)
Get summary of an ended trip
func (*SkynetTripService) Start ¶
func (r *SkynetTripService) Start(ctx context.Context, params SkynetTripStartParams, opts ...option.RequestOption) (res *SkynetTripStartResponse, err error)
Add a new trip to the system with the provided data.
func (*SkynetTripService) Update ¶
func (r *SkynetTripService) Update(ctx context.Context, id string, params SkynetTripUpdateParams, opts ...option.RequestOption) (res *SimpleResp, err error)
Updates the data of a specified trip with the provided data.
type SkynetTripStartParams ¶
type SkynetTripStartParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Specify the ID of the asset which is making this trip. The asset will be linked // to this trip. AssetID string `json:"asset_id,required"` // Set a unique ID for the new trip. If not provided, an ID will be automatically // generated in UUID format. A valid custom_id can contain letters, numbers, “-”, & // “\_” only. // // Please note that the ID of a trip can not be changed once it is created. CustomID param.Opt[string] `json:"custom_id,omitzero"` // Add a custom description for the trip. Description param.Opt[string] `json:"description,omitzero"` // Specify a name for the trip. Name param.Opt[string] `json:"name,omitzero"` // the cluster of the region you want to use // // Any of "america". Cluster SkynetTripStartParamsCluster `query:"cluster,omitzero" json:"-"` // attributes can be used to store custom information about a trip in key:value // format. Use attributes to add any useful information or context to your trips // like the driver name, destination etc. // // Please note that the maximum number of key:value pairs that can be added to an // attributes object is 100. Also, the overall size of attributes object should not // exceed 65kb. Attributes any `json:"attributes,omitzero"` // An JSON object to collect additional details about the trip. Use this property // to add any custom information / context about the trip. The input will be passed // on to the response as-is and can be used to display useful information on, for // example, a UI app. MetaData any `json:"meta_data,omitzero"` // An array of objects to collect the details about all the stops that need to be // made before the trip ends. Each object represents one stop. Stops []SkynetTripStartParamsStop `json:"stops,omitzero"` // contains filtered or unexported fields }
func (SkynetTripStartParams) MarshalJSON ¶
func (r SkynetTripStartParams) MarshalJSON() (data []byte, err error)
func (SkynetTripStartParams) URLQuery ¶
func (r SkynetTripStartParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetTripStartParams's query parameters as `url.Values`.
func (*SkynetTripStartParams) UnmarshalJSON ¶
func (r *SkynetTripStartParams) UnmarshalJSON(data []byte) error
type SkynetTripStartParamsCluster ¶
type SkynetTripStartParamsCluster string
the cluster of the region you want to use
const (
SkynetTripStartParamsClusterAmerica SkynetTripStartParamsCluster = "america"
)
type SkynetTripStartParamsStop ¶
type SkynetTripStartParamsStop struct { // Specify the ID of the geofence indicating the area where the asset needs to make // a stop, during the trip. Only the IDs of geofences created using // [NextBillion.ai's Geofence API](https://docs.nextbillion.ai/docs/tracking/api/geofence#create-a-geofence) // are accepted. GeofenceID param.Opt[string] `json:"geofence_id,omitzero"` // Specify a custom name for the stop. Name param.Opt[string] `json:"name,omitzero"` // An JSON object to collect additional details about the stop. Use this property // to add any custom information / context about the stop. The input will be passed // on to the response as-is and can be used to display useful information on, for // example, a UI app. MetaData any `json:"meta_data,omitzero"` // contains filtered or unexported fields }
func (SkynetTripStartParamsStop) MarshalJSON ¶
func (r SkynetTripStartParamsStop) MarshalJSON() (data []byte, err error)
func (*SkynetTripStartParamsStop) UnmarshalJSON ¶
func (r *SkynetTripStartParamsStop) UnmarshalJSON(data []byte) error
type SkynetTripStartResponse ¶
type SkynetTripStartResponse struct { Data SkynetTripStartResponseData `json:"data"` // Displays the error message in case of a failed request. If the request is // successful, this field is not present in the response. Message string `json:"message"` // A string indicating the state of the response. On successful responses, the // value will be Ok. Indicative error messages are returned for different errors. // See the [API Error Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Message respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetTripStartResponse) RawJSON ¶
func (r SkynetTripStartResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetTripStartResponse) UnmarshalJSON ¶
func (r *SkynetTripStartResponse) UnmarshalJSON(data []byte) error
type SkynetTripStartResponseData ¶
type SkynetTripStartResponseData struct { // Returns the ID of the newly created trip. It will be same as the custom_id if // that input was provided in the input request. Use this ID to manage this trip // using other available Trip methods. ID string `json:"id"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SkynetTripStartResponseData) RawJSON ¶
func (r SkynetTripStartResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*SkynetTripStartResponseData) UnmarshalJSON ¶
func (r *SkynetTripStartResponseData) UnmarshalJSON(data []byte) error
type SkynetTripUpdateParams ¶
type SkynetTripUpdateParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Use this param to update the ID of the asset which made this trip. Please be // cautious when using this field as providing an ID other than what was provided // at the time of starting the trip, will link a new asset to the trip and un-link // the original asset, even if the trip is still active. AssetID string `json:"asset_id,required"` // Use this parameter to update the custom description of the trip. Description param.Opt[string] `json:"description,omitzero"` // Use this property to update the name of the trip. Name param.Opt[string] `json:"name,omitzero"` // the cluster of the region you want to use // // Any of "america". Cluster SkynetTripUpdateParamsCluster `query:"cluster,omitzero" json:"-"` // Use this field to update the attributes of the trip. Please note that when // updating the attributes field, previously added information will be overwritten. Attributes any `json:"attributes,omitzero"` // Use this JSON object to update additional details about the trip. This property // is used to add any custom information / context about the trip. // // Please note that updating the meta_data field will overwrite the previously // added information. MetaData any `json:"meta_data,omitzero"` // Use this object to update the details of the stops made during the trip. Each // object represents a single stop. // // Please note that when updating this field, the new stops will overwrite any // existing stops configured for the trip. Stops []SkynetTripUpdateParamsStop `json:"stops,omitzero"` // contains filtered or unexported fields }
func (SkynetTripUpdateParams) MarshalJSON ¶
func (r SkynetTripUpdateParams) MarshalJSON() (data []byte, err error)
func (SkynetTripUpdateParams) URLQuery ¶
func (r SkynetTripUpdateParams) URLQuery() (v url.Values, err error)
URLQuery serializes SkynetTripUpdateParams's query parameters as `url.Values`.
func (*SkynetTripUpdateParams) UnmarshalJSON ¶
func (r *SkynetTripUpdateParams) UnmarshalJSON(data []byte) error
type SkynetTripUpdateParamsCluster ¶
type SkynetTripUpdateParamsCluster string
the cluster of the region you want to use
const (
SkynetTripUpdateParamsClusterAmerica SkynetTripUpdateParamsCluster = "america"
)
type SkynetTripUpdateParamsStop ¶
type SkynetTripUpdateParamsStop struct { // Use this parameter to update the ID of the geofence indicating the area where // the asset needs to make a stop, during the trip. Only the IDs of geofences // created using // [NextBillion.ai's Geofence API](https://docs.nextbillion.ai/docs/tracking/api/geofence#create-a-geofence) // are accepted. // // Please note that updating this field will overwrite the previously added // information. GeofenceID param.Opt[string] `json:"geofence_id,omitzero"` // Use this filed to update the name of the stop. Name param.Opt[string] `json:"name,omitzero"` // Use this JSON object to update additional details about the stop. This property // is used to add any custom information / context about the stop. // // Please note that updating the meta_data field will overwrite the previously // added information. MetaData any `json:"meta_data,omitzero"` // contains filtered or unexported fields }
func (SkynetTripUpdateParamsStop) MarshalJSON ¶
func (r SkynetTripUpdateParamsStop) MarshalJSON() (data []byte, err error)
func (*SkynetTripUpdateParamsStop) UnmarshalJSON ¶
func (r *SkynetTripUpdateParamsStop) UnmarshalJSON(data []byte) error
type SnapToRoadService ¶
type SnapToRoadService struct {
Options []option.RequestOption
}
SnapToRoadService contains methods and other services that help with interacting with the nextbillion-sdk API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSnapToRoadService method instead.
func NewSnapToRoadService ¶
func NewSnapToRoadService(opts ...option.RequestOption) (r SnapToRoadService)
NewSnapToRoadService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*SnapToRoadService) Snap ¶
func (r *SnapToRoadService) Snap(ctx context.Context, query SnapToRoadSnapParams, opts ...option.RequestOption) (res *SnapToRoadSnapResponse, err error)
Nextbillion.ai Snap To Roads API takes a series of locations along a route, and returns the new locations on this route that are snapped to the best-matched roads where the trip took place. You can set various parameters, such as timestamps or radius, to optimize the result.
type SnapToRoadSnapParams ¶
type SnapToRoadSnapParams struct { // A key is a unique identifier that is required to authenticate a request to the // API. Key string `query:"key,required" format:"32 character alphanumeric string" json:"-"` // Pipe-separated list of coordinate points along a path which would be snapped to // a road. Path string `query:"path,required" format:"latitude_1,longitude_1|latitude_2,longitude_2|..." json:"-"` // Pipe separated radiuses, in meters (m), up to which a coordinate point can be // snapped. Please note, if no valid road is available within the specified radius, // the API would snap the points to nearest, most viable road. When using this // parameter, it is recommended to specify as many radius values as the number of // points in "path" parameter. If the same number of "radiuses" are not provided, // the API will use the default radius value of 25 meters for all locations. Radiuses param.Opt[string] `query:"radiuses,omitzero" format:"radius_1|radius_2|..." json:"-"` // Pipe-separated UNIX epoch timestamp in seconds for each location. If used, the // number of timestamps must be equal to the number of coordinate points in the // "path" parameter. The "timestamps" must increase monotonically starting from the // first timestamp. This means that each subsequent timestamp should either be more // than or equal to the preceding one. Timestamps param.Opt[string] `query:"timestamps,omitzero" format:"timestamps_1|timestamps_2|..." json:"-"` // Enable it to ignore locations outside the service boundary. When "true", the // service would ignore "path" coordinates points falling outside the accessible // area, which otherwise would cause an error when this parameter is "false". TolerateOutlier param.Opt[bool] `query:"tolerate_outlier,omitzero" json:"-"` // A semicolon-separated list indicating the side of the road from which to // approach the locations on the snapped route. When set to "unrestricted" a route // can arrive at the snapped location from either side of the road and when set to // "curb" the route will arrive at the snapped location on the driving side of the // region. Please note the number of values provided must be equal to the number of // coordinate points provided in the "path" parameter. However, you can skip a // coordinate and show its position in the list with the ";" separator. // // Any of "unrestricted", "curb". Approaches SnapToRoadSnapParamsApproaches `query:"approaches,omitzero" json:"-"` // Setting this will ensure the route avoids ferries, tolls, highways or nothing. // Multiple values should be separated by a pipe (|). If "none" is provided along // with other values, an error is returned as a valid route is not feasible. Please // note that when this parameter is not provided in the input, ferries are set to // be avoided by default. When this parameter is provided, only the mentioned // objects are avoided. // // Any of "toll", "ferry", "highway", "none". Avoid SnapToRoadSnapParamsAvoid `query:"avoid,omitzero" json:"-"` // Sets the output format of the route geometry in the response. Only the // "polyline" or "polyline6" encoded "geometry" of the snapped path is returned in // the response depending on the value provided in the input. When "geojson" is // selected as the input value, "polyline6" encoded geometry of the snapped path is // returned along with a "geojson" object. // // Any of "polyline", "polyline6", "geojson". Geometry SnapToRoadSnapParamsGeometry `query:"geometry,omitzero" json:"-"` // Set which driving mode the service should use to determine a route. For example, // if you use "car", the API will return a route that a car can take. Using "truck" // will return a route a truck can use, taking into account appropriate truck // routing restrictions. // // Note: Only the "car" profile is enabled by default. Please note that customized // profiles (including "truck") might not be available for all regions. Please // contact your [NextBillion.ai](http://NextBillion.ai) account manager, sales // representative or reach out at // [support@nextbillion.ai](mailto:support@nextbillion.ai) in case you need // additional profiles. // // Any of "car", "truck". Mode SnapToRoadSnapParamsMode `query:"mode,omitzero" json:"-"` // Include this parameter in the request to return segment-wise speed information // of the route returned in the response. // // Please note that returning speed information is a function of "road_info" // parameter, which is effective only when "option=flexible". However, the // resultant route might not contain all the locations provided in "path" input. // // Any of "flexible". Option SnapToRoadSnapParamsOption `query:"option,omitzero" json:"-"` // Use this parameter to receive segment-wise maximum speed information of the // route in the response. "max_speed" is the only allowed value. // // Any of "max_speed". RoadInfo SnapToRoadSnapParamsRoadInfo `query:"road_info,omitzero" json:"-"` // contains filtered or unexported fields }
func (SnapToRoadSnapParams) URLQuery ¶
func (r SnapToRoadSnapParams) URLQuery() (v url.Values, err error)
URLQuery serializes SnapToRoadSnapParams's query parameters as `url.Values`.
type SnapToRoadSnapParamsApproaches ¶
type SnapToRoadSnapParamsApproaches string
A semicolon-separated list indicating the side of the road from which to approach the locations on the snapped route. When set to "unrestricted" a route can arrive at the snapped location from either side of the road and when set to "curb" the route will arrive at the snapped location on the driving side of the region. Please note the number of values provided must be equal to the number of coordinate points provided in the "path" parameter. However, you can skip a coordinate and show its position in the list with the ";" separator.
const ( SnapToRoadSnapParamsApproachesUnrestricted SnapToRoadSnapParamsApproaches = "unrestricted" SnapToRoadSnapParamsApproachesCurb SnapToRoadSnapParamsApproaches = "curb" )
type SnapToRoadSnapParamsAvoid ¶
type SnapToRoadSnapParamsAvoid string
Setting this will ensure the route avoids ferries, tolls, highways or nothing. Multiple values should be separated by a pipe (|). If "none" is provided along with other values, an error is returned as a valid route is not feasible. Please note that when this parameter is not provided in the input, ferries are set to be avoided by default. When this parameter is provided, only the mentioned objects are avoided.
const ( SnapToRoadSnapParamsAvoidToll SnapToRoadSnapParamsAvoid = "toll" SnapToRoadSnapParamsAvoidFerry SnapToRoadSnapParamsAvoid = "ferry" SnapToRoadSnapParamsAvoidHighway SnapToRoadSnapParamsAvoid = "highway" SnapToRoadSnapParamsAvoidNone SnapToRoadSnapParamsAvoid = "none" )
type SnapToRoadSnapParamsGeometry ¶
type SnapToRoadSnapParamsGeometry string
Sets the output format of the route geometry in the response. Only the "polyline" or "polyline6" encoded "geometry" of the snapped path is returned in the response depending on the value provided in the input. When "geojson" is selected as the input value, "polyline6" encoded geometry of the snapped path is returned along with a "geojson" object.
const ( SnapToRoadSnapParamsGeometryPolyline SnapToRoadSnapParamsGeometry = "polyline" SnapToRoadSnapParamsGeometryPolyline6 SnapToRoadSnapParamsGeometry = "polyline6" SnapToRoadSnapParamsGeometryGeojson SnapToRoadSnapParamsGeometry = "geojson" )
type SnapToRoadSnapParamsMode ¶
type SnapToRoadSnapParamsMode string
Set which driving mode the service should use to determine a route. For example, if you use "car", the API will return a route that a car can take. Using "truck" will return a route a truck can use, taking into account appropriate truck routing restrictions.
Note: Only the "car" profile is enabled by default. Please note that customized profiles (including "truck") might not be available for all regions. Please contact your [NextBillion.ai](http://NextBillion.ai) account manager, sales representative or reach out at [support@nextbillion.ai](mailto:support@nextbillion.ai) in case you need additional profiles.
const ( SnapToRoadSnapParamsModeCar SnapToRoadSnapParamsMode = "car" SnapToRoadSnapParamsModeTruck SnapToRoadSnapParamsMode = "truck" )
type SnapToRoadSnapParamsOption ¶
type SnapToRoadSnapParamsOption string
Include this parameter in the request to return segment-wise speed information of the route returned in the response.
Please note that returning speed information is a function of "road_info" parameter, which is effective only when "option=flexible". However, the resultant route might not contain all the locations provided in "path" input.
const (
SnapToRoadSnapParamsOptionFlexible SnapToRoadSnapParamsOption = "flexible"
)
type SnapToRoadSnapParamsRoadInfo ¶
type SnapToRoadSnapParamsRoadInfo string
Use this parameter to receive segment-wise maximum speed information of the route in the response. "max_speed" is the only allowed value.
const (
SnapToRoadSnapParamsRoadInfoMaxSpeed SnapToRoadSnapParamsRoadInfo = "max_speed"
)
type SnapToRoadSnapResponse ¶
type SnapToRoadSnapResponse struct { // The total distance of the snapped path in meters. Distance int64 `json:"distance"` // A GeoJSON object with details of the snapped path. This object is returned when // the geometry field is set to geojson in the input request, otherwise it is not // present in the response. The contents of this object follow the // [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946). Geojson SnapToRoadSnapResponseGeojson `json:"geojson"` // An array of strings containing the encoded geometries of snapped paths in // polyline or polyline6 format. Geometry []string `json:"geometry"` // Displays the error message in case of a failed request or operation. Please note // that this parameter is not returned in the response in case of a successful // request. Msg string `json:"msg"` // An object containing the maximum speed information for each road segment present // in the route. RoadInfo SnapToRoadSnapResponseRoadInfo `json:"road_info"` // An array of objects. Each object provides the details of a path coordinate point // snapped to the nearest road. SnappedPoints []SnapToRoadSnapResponseSnappedPoint `json:"snappedPoints"` // A string indicating the state of the response. On normal responses, the value // will be Ok. Indicative HTTP error codes are returned for different errors. See // the [API Errors Codes](#api-error-codes) section below for more information. Status string `json:"status"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Distance respjson.Field Geojson respjson.Field Geometry respjson.Field Msg respjson.Field RoadInfo respjson.Field SnappedPoints respjson.Field Status respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Response Body
func (SnapToRoadSnapResponse) RawJSON ¶
func (r SnapToRoadSnapResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*SnapToRoadSnapResponse) UnmarshalJSON ¶
func (r *SnapToRoadSnapResponse) UnmarshalJSON(data []byte) error
type SnapToRoadSnapResponseGeojson ¶
type SnapToRoadSnapResponseGeojson struct { // An object with details of the geoJSON geometry of the snapped path. Geometry SnapToRoadSnapResponseGeojsonGeometry `json:"geometry"` // Properties associated with the geoJSON shape of the snapped path. Properties string `json:"properties"` // Type of the GeoJSON object. Type string `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Geometry respjson.Field Properties respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
A GeoJSON object with details of the snapped path. This object is returned when the geometry field is set to geojson in the input request, otherwise it is not present in the response. The contents of this object follow the [geoJSON standard](https://datatracker.ietf.org/doc/html/rfc7946).
func (SnapToRoadSnapResponseGeojson) RawJSON ¶
func (r SnapToRoadSnapResponseGeojson) RawJSON() string
Returns the unmodified JSON received from the API
func (*SnapToRoadSnapResponseGeojson) UnmarshalJSON ¶
func (r *SnapToRoadSnapResponseGeojson) UnmarshalJSON(data []byte) error
type SnapToRoadSnapResponseGeojsonGeometry ¶
type SnapToRoadSnapResponseGeojsonGeometry struct { // An array of coordinates in the [longitude, latitude] format, representing the // snapped path geometry. Coordinates []float64 `json:"coordinates"` // Type of the geoJSON geometry Type string `json:"type"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Coordinates respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with details of the geoJSON geometry of the snapped path.
func (SnapToRoadSnapResponseGeojsonGeometry) RawJSON ¶
func (r SnapToRoadSnapResponseGeojsonGeometry) RawJSON() string
Returns the unmodified JSON received from the API
func (*SnapToRoadSnapResponseGeojsonGeometry) UnmarshalJSON ¶
func (r *SnapToRoadSnapResponseGeojsonGeometry) UnmarshalJSON(data []byte) error
type SnapToRoadSnapResponseRoadInfo ¶
type SnapToRoadSnapResponseRoadInfo struct { // An array of objects containing maximum speed, in kilometers per hour, for each // segment of the route. Each object represents one road segment. MaxSpeed []SnapToRoadSnapResponseRoadInfoMaxSpeed `json:"max_speed"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { MaxSpeed respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object containing the maximum speed information for each road segment present in the route.
func (SnapToRoadSnapResponseRoadInfo) RawJSON ¶
func (r SnapToRoadSnapResponseRoadInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*SnapToRoadSnapResponseRoadInfo) UnmarshalJSON ¶
func (r *SnapToRoadSnapResponseRoadInfo) UnmarshalJSON(data []byte) error
type SnapToRoadSnapResponseRoadInfoMaxSpeed ¶
type SnapToRoadSnapResponseRoadInfoMaxSpeed struct { // length refers to a sequence of 'n' consecutive vertices in the route geometry // starting from the offset, forming a continuous section of route where the // maximum speed is the same and is indicated in value. Length int64 `json:"length"` // offset is the index value of the vertex of route geometry, which is the starting // point of the segment. Offset int64 `json:"offset"` // value denotes the maximum speed of this segment, in kilometers per hour. // // - A value of "-1" indicates that the speed is unlimited for this road segment. // - A value of "0" indicates that there is no information about the maximum speed // for this road segment. Value float64 `json:"value"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Length respjson.Field Offset respjson.Field Value respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SnapToRoadSnapResponseRoadInfoMaxSpeed) RawJSON ¶
func (r SnapToRoadSnapResponseRoadInfoMaxSpeed) RawJSON() string
Returns the unmodified JSON received from the API
func (*SnapToRoadSnapResponseRoadInfoMaxSpeed) UnmarshalJSON ¶
func (r *SnapToRoadSnapResponseRoadInfoMaxSpeed) UnmarshalJSON(data []byte) error
type SnapToRoadSnapResponseSnappedPoint ¶
type SnapToRoadSnapResponseSnappedPoint struct { // The bearing, calculated as the angle from true north in clockwise direction, of // the route leading to the next snapped point from the current snapped_point, in // radians. In case of the last snapped_point of the route, the bearing indicates // the direction of the route to the previous snapped_location. Bearing float64 `json:"bearing,required"` // The distance of the snapped point from the original input coordinate in meters. Distance float64 `json:"distance,required"` // The latitude and longitude coordinates of the snapped point. Location SnapToRoadSnapResponseSnappedPointLocation `json:"location,required"` // The name of the street or road that the input coordinate snapped to. Name string `json:"name,required"` // The index of the input path coordinate point to which this snapped point // corresponds to. OriginalIndex int64 `json:"originalIndex,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Bearing respjson.Field Distance respjson.Field Location respjson.Field Name respjson.Field OriginalIndex respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (SnapToRoadSnapResponseSnappedPoint) RawJSON ¶
func (r SnapToRoadSnapResponseSnappedPoint) RawJSON() string
Returns the unmodified JSON received from the API
func (*SnapToRoadSnapResponseSnappedPoint) UnmarshalJSON ¶
func (r *SnapToRoadSnapResponseSnappedPoint) UnmarshalJSON(data []byte) error
type SnapToRoadSnapResponseSnappedPointLocation ¶
type SnapToRoadSnapResponseSnappedPointLocation struct { // Latitude of the snapped point. Latitude float64 `json:"latitude,required"` // Longitude of the snapped point. Longitude float64 `json:"longitude,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Latitude respjson.Field Longitude respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
The latitude and longitude coordinates of the snapped point.
func (SnapToRoadSnapResponseSnappedPointLocation) RawJSON ¶
func (r SnapToRoadSnapResponseSnappedPointLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*SnapToRoadSnapResponseSnappedPointLocation) UnmarshalJSON ¶
func (r *SnapToRoadSnapResponseSnappedPointLocation) UnmarshalJSON(data []byte) error
type TrackLocation ¶
type TrackLocation struct { // If available, this property returns the accuracy of the GPS information received // at the tracked location. It is represented as an estimated horizontal accuracy // radius, in meters, at the 68th percentile confidence level. Accuracy float64 `json:"accuracy"` // If available in the GPS information, this property returns the altitude of the // asset at the tracked location. It is represented as height, in meters, above the // WGS84 reference ellipsoid. Altitude float64 `json:"altitude"` // Returns the battery level of the GPS device, as a percentage, when the location // was tracked. It has a minimum value of 0 and a maximum value of 100. BatteryLevel int64 `json:"battery_level"` // If available in the GPS information, this property returns the heading of the // asset calculated from true north in clockwise direction at the tracked location. // Please note that the bearing is not affected by the device orientation. // // The bearing will always be in the range of [0, 360). Bearing float64 `json:"bearing"` // An object with the coordinates of the last tracked location. Location TrackLocationLocation `json:"location"` // Specifies the custom data about the location that was added when the location // was uploaded. MetaData any `json:"meta_data"` // If available in the GPS information, this property returns the speed of the // asset, in meters per second, at the tracked location. Speed float64 `json:"speed"` // A UNIX epoch timestamp in milliseconds, representing the time at which the // location was tracked. Timestamp int64 `json:"timestamp"` // Internal parameter for tracking mode. TrackingMode string `json:"tracking_mode"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Accuracy respjson.Field Altitude respjson.Field BatteryLevel respjson.Field Bearing respjson.Field Location respjson.Field MetaData respjson.Field Speed respjson.Field Timestamp respjson.Field TrackingMode respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with details of the tracked location. Please note that if there are no tracking records for an asset, no location data will be returned.
func (TrackLocation) RawJSON ¶
func (r TrackLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrackLocation) UnmarshalJSON ¶
func (r *TrackLocation) UnmarshalJSON(data []byte) error
type TrackLocationLocation ¶
type TrackLocationLocation struct { // Latitude of the tracked location of the asset. Lat float64 `json:"lat"` // Longitude of the tracked location of the asset. Lon float64 `json:"lon"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Lat respjson.Field Lon respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
An object with the coordinates of the last tracked location.
func (TrackLocationLocation) RawJSON ¶
func (r TrackLocationLocation) RawJSON() string
Returns the unmodified JSON received from the API
func (*TrackLocationLocation) UnmarshalJSON ¶
func (r *TrackLocationLocation) UnmarshalJSON(data []byte) error
type TripStop ¶
type TripStop struct { // Returns the ID of the geofence that was used to indicate the area to make a // stop. GeofenceID string `json:"geofence_id"` // Returns any meta data that was added to provide additional information about the // stop. MetaData any `json:"meta_data"` // Returns the name of the stop that was provided when configuring this stop for // the trip. Name string `json:"name"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { GeofenceID respjson.Field MetaData respjson.Field Name respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (*TripStop) UnmarshalJSON ¶
type VehicleParam ¶
type VehicleParam struct { // Specify a unique ID for the vehicle. ID string `json:"id,required"` // Specify the location coordinates where the vehicle is currently located. This // input is mandatory for each vehicle. Location LocationParam `json:"location,omitzero,required"` // Specify the priority for this vehicle. A higher value indicates a higher // priority. When specified, it will override any priority score deduced from // vehicle_attribute_priority_mappings for this vehicle. Valid values are \[1, 10\] // and default is 0. Priority param.Opt[int64] `json:"priority,omitzero"` // Specify custom attributes for the vehicle. Each attribute should be created as a // key:value pair. These attributes can be used in the orders.vehicle_preferences // input to refine the search of vehicles for each order. // // The maximum number of key:value pairs that can be specified under attributes for // a given vehicle, is limited to 30. Attributes any `json:"attributes,omitzero"` // An array of objects to collect the location coordinates of the stops remaining // on an ongoing trip of the vehicle. The service can assign new orders to the // vehicle if they are cost-effective. Once a new order is assigned, the vehicle // must complete all the steps in the ongoing trip before proceeding to pickup the // newly assigned order. // // Please note that a maximum of 10 waypoints can be specified for a given vehicle. RemainingWaypoints []LocationParam `json:"remaining_waypoints,omitzero"` // contains filtered or unexported fields }
The properties ID, Location are required.
func (VehicleParam) MarshalJSON ¶
func (r VehicleParam) MarshalJSON() (data []byte, err error)
func (*VehicleParam) UnmarshalJSON ¶
func (r *VehicleParam) UnmarshalJSON(data []byte) error
Source Files
¶
- aliases.go
- area.go
- autocomplete.go
- autosuggest.go
- batch.go
- browse.go
- client.go
- direction.go
- discover.go
- distancematrix.go
- distancematrixjson.go
- field.go
- fleetify.go
- fleetifydocumenttemplate.go
- fleetifyroute.go
- fleetifyroutestep.go
- geocode.go
- geofence.go
- geofencebatch.go
- geofenceconsole.go
- isochrone.go
- lookup.go
- map.go
- mdm.go
- multigeocode.go
- multigeocodeplace.go
- navigation.go
- optimization.go
- optimizationdriverassignment.go
- optimizationv2.go
- postalcode.go
- restriction.go
- restrictionsitem.go
- revgeocode.go
- routereport.go
- skynet.go
- skynetasset.go
- skynetassetevent.go
- skynetassetlocation.go
- skynetconfig.go
- skynetmonitor.go
- skynetnamespacedapikey.go
- skynetsearch.go
- skynetsearchpolygon.go
- skynettrip.go
- snaptoroad.go
Directories
¶
Path | Synopsis |
---|---|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.21, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.21, and used by the Go 1.24 encoding/json package. |
packages
|
|
shared
|
|