UNPKG

2.6 kBJavaScriptView Raw
1"use strict";
2/**
3 * -------------------------------------------------------------------------------------------
4 * Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
5 * See License in the project root for license information.
6 * -------------------------------------------------------------------------------------------
7 */
8Object.defineProperty(exports, "__esModule", { value: true });
9exports.UploadResult = void 0;
10/**
11 * Class representing a successful file upload result
12 */
13var UploadResult = /** @class */ (function () {
14 /**
15 * @public
16 * @param {responseBody} responsebody - The response body from the completed upload response
17 * @param {location} location - The location value from the headers from the completed upload response
18 */
19 function UploadResult(responseBody, location) {
20 // Response body or the location parameter can be undefined.
21 this._location = location;
22 this._responseBody = responseBody;
23 }
24 Object.defineProperty(UploadResult.prototype, "location", {
25 /**
26 * @public
27 * Get of the location value.
28 * Location value is looked up in the response header
29 */
30 get: function () {
31 return this._location;
32 },
33 /**
34 * @public
35 * Set the location value
36 * Location value is looked up in the response header
37 */
38 set: function (location) {
39 this._location = location;
40 },
41 enumerable: false,
42 configurable: true
43 });
44 Object.defineProperty(UploadResult.prototype, "responseBody", {
45 /**
46 * @public
47 * Get The response body from the completed upload response
48 */
49 get: function () {
50 return this._responseBody;
51 },
52 /**
53 * @public
54 * Set the response body from the completed upload response
55 */
56 set: function (responseBody) {
57 this._responseBody = responseBody;
58 },
59 enumerable: false,
60 configurable: true
61 });
62 /**
63 * @public
64 * @param {responseBody} responseBody - The response body from the completed upload response
65 * @param {responseHeaders} responseHeaders - The headers from the completed upload response
66 */
67 UploadResult.CreateUploadResult = function (responseBody, responseHeaders) {
68 return new UploadResult(responseBody, responseHeaders.get("location"));
69 };
70 return UploadResult;
71}());
72exports.UploadResult = UploadResult;
73//# sourceMappingURL=UploadResult.js.map
\No newline at end of file