ojp-sdk
    Preparing search index...

    Class TripInfoRequest

    TripInfoRequest (TIR) class

    Instances are created via static methods below. Direct construction is intentionally disabled.

    • initWithJourneyRef - use journey reference and date

    Hierarchy

    Index

    Initialization

    • Creates a new TripInfoRequest with the given journey reference and date

      Parameters

      • journeyRef: string

        The journey reference ID (e.g. "ch:1:sjyid:100001:2179-001")

      • journeyDate: Date = ...

        The date of the journey (defaults to current date)

      Returns TripInfoRequest

      A new TripInfoRequest instance

      const request = TripInfoRequest.initWithJourneyRef('ch:1:sjyid:100001:2179-001');
      const response = await request.fetch(sdk);
    • Creates a new instance of the request class with a mock request XML string

      This method is used for testing purposes to simulate API requests with predefined XML payloads. When this mock is set, the request will use the provided XML instead of building a new one.

      Type Parameters

      • T_This extends { Default(): any }

      Parameters

      • this: T_This
      • mockText: string

        The XML string to use as the mock request

      Returns ReturnType<T_This["Default"]>

      A new instance of the request class with the mock set

      const mockRequest = LocationInformationRequest.initWithRequestMock('<OJP>...</OJP>');
      
    • Creates a new instance of the request class with a mock response XML string

      This method is used for testing purposes to simulate API responses with predefined XML payloads. When this mock is set, the request will use the provided XML response instead of making actual API calls.

      Type Parameters

      • T_This extends { Default(): any }

      Parameters

      • this: T_This
      • mockText: string

        The XML string to use as the mock response

      Returns ReturnType<T_This["Default"]>

      A new instance of the request class with the mock set

      const mockRequest = LocationInformationRequest.initWithResponseMock('<OJP>...</OJP>');
      

    Request Payload Modification

    • Enables track projection in the request payload

      This method modifies the request to include track projection data in the response. When enabled, the response will contain additional information about the vehicle's track and movement patterns.

      Returns void

      const request = TripInfoRequest.initWithJourneyRef('ch:1:sjyid:100001:2179-001');
      request.enableTrackProjection();

      const response = await request.fetch(sdk);

    Constructors

    • Parameters

      • journeyRef: string
      • operatingDayRef: string
      • Optionalparams: {
            includeCalls?: boolean;
            includePlacesContext?: boolean;
            includeService?: boolean;
            includeSituationsContext?: boolean;
            includeTrackProjection?: boolean;
        }

      Returns TripInfoRequest

    Properties

    mockRequestXML: string | null
    mockResponseXML: string | null
    payload: {
        journeyRef: string;
        operatingDayRef: string;
        params?: {
            includeCalls?: boolean;
            includePlacesContext?: boolean;
            includeService?: boolean;
            includeSituationsContext?: boolean;
            includeTrackProjection?: boolean;
        };
        requestTimestamp: string;
    }

    The payload object that gets serialized to XML for the request

    requestInfo: RequestInfo

    Methods

    • Builds the XML request string for the TIR

      Parameters

      • language: Language

        The language to use for the request (e.g. "en", "de")

      • requestorRef: string

        The requestor reference identifier

      • xmlConfig: XML_Config

        XML configuration options for building the request, default DefaultXML_Config OJP 2.0

      Returns string

      A formatted XML string representing the Location Information Request

    • Returns {
          includeCalls?: boolean;
          includePlacesContext?: boolean;
          includeService?: boolean;
          includeSituationsContext?: boolean;
          includeTrackProjection?: boolean;
      }