UNPKG

node-nlp

Version:

Library for NLU (Natural Language Understanding) done in Node.js

381 lines 10.8 kB
"use strict"; /* * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is * regenerated. */ Object.defineProperty(exports, "__esModule", { value: true }); const msRest = require("ms-rest-js"); const Mappers = require("../models/conversationsMappers"); const Parameters = require("../models/parameters"); /** Class representing a Conversations. */ class Conversations { /** * Create a Conversations. * @param {ConnectorClientContext} client Reference to the service client. */ constructor(client) { this.client = client; } getConversations(options, callback) { return this.client.sendOperationRequest({ options }, getConversationsOperationSpec, callback); } createConversation(parameters, options, callback) { return this.client.sendOperationRequest({ parameters, options }, createConversationOperationSpec, callback); } sendToConversation(conversationId, activity, options, callback) { return this.client.sendOperationRequest({ conversationId, activity, options }, sendToConversationOperationSpec, callback); } sendConversationHistory(conversationId, history, options, callback) { return this.client.sendOperationRequest({ conversationId, history, options }, sendConversationHistoryOperationSpec, callback); } updateActivity(conversationId, activityId, activity, options, callback) { return this.client.sendOperationRequest({ conversationId, activityId, activity, options }, updateActivityOperationSpec, callback); } replyToActivity(conversationId, activityId, activity, options, callback) { return this.client.sendOperationRequest({ conversationId, activityId, activity, options }, replyToActivityOperationSpec, callback); } deleteActivity(conversationId, activityId, options, callback) { return this.client.sendOperationRequest({ conversationId, activityId, options }, deleteActivityOperationSpec, callback); } getConversationMembers(conversationId, options, callback) { return this.client.sendOperationRequest({ conversationId, options }, getConversationMembersOperationSpec, callback); } getConversationPagedMembers(conversationId, options, callback) { return this.client.sendOperationRequest({ conversationId, options }, getConversationPagedMembersOperationSpec, callback); } deleteConversationMember(conversationId, memberId, options, callback) { return this.client.sendOperationRequest({ conversationId, memberId, options }, deleteConversationMemberOperationSpec, callback); } getActivityMembers(conversationId, activityId, options, callback) { return this.client.sendOperationRequest({ conversationId, activityId, options }, getActivityMembersOperationSpec, callback); } uploadAttachment(conversationId, attachmentUpload, options, callback) { return this.client.sendOperationRequest({ conversationId, attachmentUpload, options }, uploadAttachmentOperationSpec, callback); } } exports.Conversations = Conversations; // Operation Specifications const serializer = new msRest.Serializer(Mappers); const getConversationsOperationSpec = { httpMethod: "GET", path: "v3/conversations", queryParameters: [ Parameters.continuationToken ], responses: { 200: { bodyMapper: Mappers.ConversationsResult }, default: { bodyMapper: Mappers.ErrorResponse } }, serializer }; const createConversationOperationSpec = { httpMethod: "POST", path: "v3/conversations", requestBody: { parameterPath: "parameters", mapper: Object.assign({}, Mappers.ConversationParameters, { required: true }) }, responses: { 200: { bodyMapper: Mappers.ConversationResourceResponse }, 201: { bodyMapper: Mappers.ConversationResourceResponse }, 202: { bodyMapper: Mappers.ConversationResourceResponse }, default: { bodyMapper: Mappers.ErrorResponse } }, serializer }; const sendToConversationOperationSpec = { httpMethod: "POST", path: "v3/conversations/{conversationId}/activities", urlParameters: [ Parameters.conversationId ], requestBody: { parameterPath: "activity", mapper: Object.assign({}, Mappers.Activity, { required: true }) }, responses: { 200: { bodyMapper: Mappers.ResourceResponse }, 201: { bodyMapper: Mappers.ResourceResponse }, 202: { bodyMapper: Mappers.ResourceResponse }, default: { bodyMapper: Mappers.ErrorResponse } }, serializer }; const sendConversationHistoryOperationSpec = { httpMethod: "POST", path: "v3/conversations/{conversationId}/activities/history", urlParameters: [ Parameters.conversationId ], requestBody: { parameterPath: "history", mapper: Object.assign({}, Mappers.Transcript, { required: true }) }, responses: { 200: { bodyMapper: Mappers.ResourceResponse }, 201: { bodyMapper: Mappers.ResourceResponse }, 202: { bodyMapper: Mappers.ResourceResponse }, default: { bodyMapper: Mappers.ErrorResponse } }, serializer }; const updateActivityOperationSpec = { httpMethod: "PUT", path: "v3/conversations/{conversationId}/activities/{activityId}", urlParameters: [ Parameters.conversationId, Parameters.activityId ], requestBody: { parameterPath: "activity", mapper: Object.assign({}, Mappers.Activity, { required: true }) }, responses: { 200: { bodyMapper: Mappers.ResourceResponse }, 201: { bodyMapper: Mappers.ResourceResponse }, 202: { bodyMapper: Mappers.ResourceResponse }, default: { bodyMapper: Mappers.ErrorResponse } }, serializer }; const replyToActivityOperationSpec = { httpMethod: "POST", path: "v3/conversations/{conversationId}/activities/{activityId}", urlParameters: [ Parameters.conversationId, Parameters.activityId ], requestBody: { parameterPath: "activity", mapper: Object.assign({}, Mappers.Activity, { required: true }) }, responses: { 200: { bodyMapper: Mappers.ResourceResponse }, 201: { bodyMapper: Mappers.ResourceResponse }, 202: { bodyMapper: Mappers.ResourceResponse }, default: { bodyMapper: Mappers.ErrorResponse } }, serializer }; const deleteActivityOperationSpec = { httpMethod: "DELETE", path: "v3/conversations/{conversationId}/activities/{activityId}", urlParameters: [ Parameters.conversationId, Parameters.activityId ], responses: { 200: {}, 202: {}, default: { bodyMapper: Mappers.ErrorResponse } }, serializer }; const getConversationMembersOperationSpec = { httpMethod: "GET", path: "v3/conversations/{conversationId}/members", urlParameters: [ Parameters.conversationId ], responses: { 200: { bodyMapper: { serializedName: "parsedResponse", type: { name: "Sequence", element: { type: { name: "Composite", className: "ChannelAccount" } } } } }, default: { bodyMapper: Mappers.ErrorResponse } }, serializer }; const getConversationPagedMembersOperationSpec = { httpMethod: "GET", path: "v3/conversations/{conversationId}/pagedmembers", urlParameters: [ Parameters.conversationId ], queryParameters: [ Parameters.pageSize, Parameters.continuationToken ], responses: { 200: { bodyMapper: Mappers.PagedMembersResult }, default: {} }, serializer }; const deleteConversationMemberOperationSpec = { httpMethod: "DELETE", path: "v3/conversations/{conversationId}/members/{memberId}", urlParameters: [ Parameters.conversationId, Parameters.memberId ], responses: { 200: {}, 204: {}, default: { bodyMapper: Mappers.ErrorResponse } }, serializer }; const getActivityMembersOperationSpec = { httpMethod: "GET", path: "v3/conversations/{conversationId}/activities/{activityId}/members", urlParameters: [ Parameters.conversationId, Parameters.activityId ], responses: { 200: { bodyMapper: { serializedName: "parsedResponse", type: { name: "Sequence", element: { type: { name: "Composite", className: "ChannelAccount" } } } } }, default: { bodyMapper: Mappers.ErrorResponse } }, serializer }; const uploadAttachmentOperationSpec = { httpMethod: "POST", path: "v3/conversations/{conversationId}/attachments", urlParameters: [ Parameters.conversationId ], requestBody: { parameterPath: "attachmentUpload", mapper: Object.assign({}, Mappers.AttachmentData, { required: true }) }, responses: { 200: { bodyMapper: Mappers.ResourceResponse }, 201: { bodyMapper: Mappers.ResourceResponse }, 202: { bodyMapper: Mappers.ResourceResponse }, default: { bodyMapper: Mappers.ErrorResponse } }, serializer }; //# sourceMappingURL=conversations.js.map