/*! Copyright (c) 2019, XAPPmedia */ import { AbstractBuilder } from "@xapp/patterns"; import { ApiAccessData, AudioPlayerEvent, AudioPlayerRequest, Device, InputUnknownRequest, IntentRequest, KnowledgeBaseResult, LanguageTag, LaunchRequest, OptionSelectRequest, PermissionRequest, PlaybackControlRequest, RequestSlotMap, SessionEndedRequest, SignInRequest } from "stentor-models"; /** * Builds a LaunchRequest * * @public */ export declare class LaunchRequestBuilder extends AbstractBuilder { private accessToken?; private deviceId; private channel?; private platform?; /** * Add a access token to the request. * * @param token - Access token for the request */ withAccessToken(token?: string): LaunchRequestBuilder; /** * Add a device ID to the request. * * @param deviceId - Device ID for the request */ withDeviceId(deviceId: string): LaunchRequestBuilder; /** * Set the platform for the request. * * @param platform - Platform for the request */ onPlatform(platform: string): LaunchRequestBuilder; /** * Set the channel for the request * * @param channel - Channel for the request * @returns */ onChannel(channel: string): LaunchRequestBuilder; /** * Build the request. */ build(): LaunchRequest; } /** * Builds an InputUnknownRequest * * @public */ export declare class InputUnknownRequestBuilder extends AbstractBuilder { private deviceId; private rawQuery; private channel?; private platform?; /** * Set the platform for the request. * * @param platform - Platform for the request */ onPlatform(platform: string): InputUnknownRequestBuilder; /** * Set the channel for the request * * @param channel - Channel for the request * @returns */ onChannel(channel: string): InputUnknownRequestBuilder; /** * Add a device ID to the request. * * @param deviceId - Device ID for the request */ withDeviceId(deviceId: string): InputUnknownRequestBuilder; /** * Set the raw query on the request. * * @param rawQuery - The raw query for the request */ withRawQuery(rawQuery: string): InputUnknownRequestBuilder; build(): InputUnknownRequest; } /** * Builds an IntentRequest. * * The defaults value for the required fields are typically the key name, for example * the default value for the intentId is "intentId". * * @public */ export declare class IntentRequestBuilder extends AbstractBuilder { private apiAccess; private attributes; private channel; private deviceId; private intentId; private isNewSession; private locale; private platform; private rawQuery; private slots; private userId; private canFulFill; private knowledgeBaseResult; private matchConfidence; private device; /** * Turns the request into a canfulfill intent request. */ canFulfill(): IntentRequestBuilder; /** * Set the platform for the request. * * @param platform - Platform for the request */ onPlatform(platform: string): IntentRequestBuilder; /** * Set the channel for the request * * @param channel - Channel for the request * @returns */ onChannel(channel: string): IntentRequestBuilder; /** * Set the raw query for the request. * * @param rawQuery - Raw query for the request */ withRawQuery(rawQuery: string): IntentRequestBuilder; /** * Set the optional match confidence * * @param confidence * @returns */ withMatchConfidence(confidence: number): IntentRequestBuilder; /** * Set the user ID for the request. * * @param userId - User ID for the request */ withUserId(userId: string): IntentRequestBuilder; /** * Set the API access data for the request. * * @param apiAccess - API access data for the request. */ withAPIAccess(apiAccess: ApiAccessData): IntentRequestBuilder; /** * Sets the intentId for the request. * * If not set, the default is intentId. * * @param intentId - Intent ID for the request. */ withIntentId(intentId: string): IntentRequestBuilder; /** * Add a device ID to the request. * * @param deviceId - Device ID for the request */ withDeviceId(deviceId: string): IntentRequestBuilder; /** * Sets the intent request to be for a resume intent. */ resumeIntent(): IntentRequestBuilder; /** * Sets the intent request to be for a NextIntent */ nextIntent(): IntentRequestBuilder; /** * Sets the intent request to be for a PreviousIntent */ previousIntent(): IntentRequestBuilder; /** * Sets the intent request to be for a LatestIntent */ latestIntent(): IntentRequestBuilder; /** * Sets the intent request to be for a RepeatIntent */ repeatIntent(): IntentRequestBuilder; /** * Sets the intent request to be for a CancelIntent */ cancel(): IntentRequestBuilder; /** * Sets the intent request to be for a HelpIntent */ help(): IntentRequestBuilder; /** * Add slots to the request. * * @param slots - Slots for the request. */ withSlots(slots: RequestSlotMap): IntentRequestBuilder; /** * Specify the locale for the request. * * @param locale - Locale for the intent request. */ withLocale(locale: LanguageTag): IntentRequestBuilder; /** * Add a knowledge base result. * * @param result * @returns */ withKnowledgeBaseResult(result: KnowledgeBaseResult): IntentRequestBuilder; /** * Append attributes to the request. * * @param attributes * @returns */ withAttributes(attributes: Record): IntentRequestBuilder; /** * Update any or all of the fields on request's device information. * * @param device * @returns */ updateDevice(device: Partial): IntentRequestBuilder; /** * Build the intent request. */ build(): IntentRequest; } /** * Build an AudioPlayerRequest */ export declare class AudioPlayerRequestBuilder extends AbstractBuilder { private event; private token; private offsetInMilliseconds; private errorType; private errorMessage; withEvent(event: AudioPlayerEvent): AudioPlayerRequestBuilder; /** * Sets request type to AudioPlayerPlaybackFailed and adds type & message to the request * @param type * @param message */ withFailure(type: string, message: string): AudioPlayerRequestBuilder; playbackStarted(): AudioPlayerRequestBuilder; playbackStopped(): AudioPlayerRequestBuilder; withOffset(offsetInMilliseconds: number): AudioPlayerRequestBuilder; withToken(token: string): AudioPlayerRequestBuilder; build(): AudioPlayerRequest; } /** * Builds a PlaybackControlRequest */ export declare class PlaybackControlRequestBuilder extends AbstractBuilder { private event; withNextEvent(): PlaybackControlRequestBuilder; withPreviousEvent(): PlaybackControlRequestBuilder; withPauseEvent(): PlaybackControlRequestBuilder; withPlayEvent(): PlaybackControlRequestBuilder; build(): PlaybackControlRequest; } /** * Builds a PermissionGrant */ export declare class PermissionGrantBuilder extends AbstractBuilder { build(): PermissionRequest; } /** * Builds a SessionEndedRequest */ export declare class SessionEndedRequestBuilder extends AbstractBuilder { build(): SessionEndedRequest; } /** * Builds a OptionSelect */ export declare class OptionSelectBuilder extends AbstractBuilder { private deviceId?; private token; /** * Add a device ID to the request. * * @param deviceId - Device ID for the request */ withDeviceId(deviceId: string): OptionSelectBuilder; /** * Set the selected token to the request. By default the value is "optionToken". * * @param token - Set the selected token for the request */ withSelectedToken(token: string): OptionSelectBuilder; build(): OptionSelectRequest; } /** * Builder for SignInRequests */ export declare class SignInRequestBuilder extends AbstractBuilder { private granted; notGranted(): SignInRequestBuilder; build(): SignInRequest; }