/**
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License.
 */

/**
 * Represents a request to start a new conversation with a Copilot Studio agent.
 * This request encapsulates all parameters needed to initiate a conversation.
 */
export interface StartRequest {
  /**
   * Optional locale code (e.g., 'en-US', 'fr-FR') for the conversation.
   * If not specified, the agent's default locale will be used.
   */
  locale?: string

  /**
   * Whether to emit a start conversation event.
   * When true, the agent will be notified that this is the beginning of a new conversation.
   * Default is true.
   */
  emitStartConversationEvent?: boolean

  /**
   * Optional conversation ID to use for this conversation.
   * If not specified, a new conversation ID will be generated by the service.
   */
  conversationId?: string
}

/**
 * Creates a StartRequest with default values.
 * @param emitStartConversationEvent Whether to emit a start conversation event. Defaults to true.
 * @param locale Optional locale for the conversation.
 * @param conversationId Optional conversation ID.
 * @returns A new StartRequest object.
 */
export function createStartRequest (
  emitStartConversationEvent: boolean = true,
  locale?: string,
  conversationId?: string
): StartRequest {
  return {
    emitStartConversationEvent,
    locale,
    conversationId
  }
}
