@azure/communication-call-automation
Version:
Azure client library for Azure Communication Call Automation services
195 lines (194 loc) • 5.94 kB
JavaScript
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var callRecording_exports = {};
__export(callRecording_exports, {
CallRecordingImpl: () => CallRecordingImpl
});
module.exports = __toCommonJS(callRecording_exports);
var coreClient = __toESM(require("@azure/core-client"));
var Mappers = __toESM(require("../models/mappers.js"));
var Parameters = __toESM(require("../models/parameters.js"));
class CallRecordingImpl {
client;
/**
* Initialize a new instance of the class CallRecording class.
* @param client Reference to the service client
*/
constructor(client) {
this.client = client;
}
/**
* Start recording the call.
* @param startCallRecording The request body of start call recording request.
* @param options The options parameters.
*/
startRecording(startCallRecording, options) {
return this.client.sendOperationRequest(
{ startCallRecording, options },
startRecordingOperationSpec
);
}
/**
* Get call recording properties.
* @param recordingId The recording id.
* @param options The options parameters.
*/
getRecordingProperties(recordingId, options) {
return this.client.sendOperationRequest(
{ recordingId, options },
getRecordingPropertiesOperationSpec
);
}
/**
* Stop recording the call.
* @param recordingId The recording id.
* @param options The options parameters.
*/
stopRecording(recordingId, options) {
return this.client.sendOperationRequest(
{ recordingId, options },
stopRecordingOperationSpec
);
}
/**
* Pause recording the call.
* @param recordingId The recording id.
* @param options The options parameters.
*/
pauseRecording(recordingId, options) {
return this.client.sendOperationRequest(
{ recordingId, options },
pauseRecordingOperationSpec
);
}
/**
* Resume recording the call.
* @param recordingId The recording id.
* @param options The options parameters.
*/
resumeRecording(recordingId, options) {
return this.client.sendOperationRequest(
{ recordingId, options },
resumeRecordingOperationSpec
);
}
}
const serializer = coreClient.createSerializer(
Mappers,
/* isXml */
false
);
const startRecordingOperationSpec = {
path: "/calling/recordings",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.RecordingStateResponse
},
202: {
bodyMapper: Mappers.RecordingStateResponse
},
default: {
bodyMapper: Mappers.CommunicationErrorResponse
}
},
requestBody: Parameters.startCallRecording,
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.endpoint],
headerParameters: [
Parameters.contentType,
Parameters.accept,
Parameters.repeatabilityRequestID,
Parameters.repeatabilityFirstSent
],
mediaType: "json",
serializer
};
const getRecordingPropertiesOperationSpec = {
path: "/calling/recordings/{recordingId}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.RecordingStateResponse
},
default: {
bodyMapper: Mappers.CommunicationErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.endpoint, Parameters.recordingId],
headerParameters: [Parameters.accept],
serializer
};
const stopRecordingOperationSpec = {
path: "/calling/recordings/{recordingId}",
httpMethod: "DELETE",
responses: {
204: {},
default: {
bodyMapper: Mappers.CommunicationErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.endpoint, Parameters.recordingId],
headerParameters: [Parameters.accept],
serializer
};
const pauseRecordingOperationSpec = {
path: "/calling/recordings/{recordingId}:pause",
httpMethod: "POST",
responses: {
202: {},
default: {
bodyMapper: Mappers.CommunicationErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.endpoint, Parameters.recordingId],
headerParameters: [Parameters.accept],
serializer
};
const resumeRecordingOperationSpec = {
path: "/calling/recordings/{recordingId}:resume",
httpMethod: "POST",
responses: {
202: {},
default: {
bodyMapper: Mappers.CommunicationErrorResponse
}
},
queryParameters: [Parameters.apiVersion],
urlParameters: [Parameters.endpoint, Parameters.recordingId],
headerParameters: [Parameters.accept],
serializer
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
CallRecordingImpl
});
//# sourceMappingURL=callRecording.js.map