-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjob-result.js
86 lines (73 loc) · 1.95 KB
/
job-result.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
'use strict';
/**
* Result of a job
* received from createJob or readJob methods
*/
class JobResult{
/**
* Creates an instance
* @param {Object} opts
*/
constructor(opts, s3Service, awsRegion, outputBucketName){
if (!opts.Output || !opts.Input){
console.log(JSON.stringify(opts));
throw new Error('no Output or Input');
}
/**
* The identifier that Elastic Transcoder assigned to the job. You use this value to get settings for the job or to delete the job.
* @example
* 1463492156553-lf7b8g
* @type {string}
*/
this.Id = opts.Id;
/**
* The Amazon Resource Name (ARN) for the job.
* @example
* arn:aws:elastictranscoder:eu-west-1:081290220903:job/1463492156553-lf7b8g
* @type {string}
*/
this.Arn = opts.Arn;
/**
* The Id of the pipeline that you want Elastic Transcoder to use for transcoding
* @type {string}
*/
this.PipelineId = opts.PipelineId;
/**
* The status
* Submitted | Progressing | (Complete | Error)
* @type {string}
*/
this.Status = opts.Output.Status;
/**
* Information that further explains Status
* @type {string}
*/
this.StatusDetail = opts.Output.StatusDetail;
/**
* Duration of the output file, in seconds.
* @type {number}
*/
this.Duration = opts.Output.Duration;
/**
* File size of the output file, in bytes.
* @type {number}
*/
this.FileSize = opts.Output.FileSize;
/**
* Destination file, like out128/file.mp3
* @type {string}
*/
this.DstFile = opts.Output.Key;
/**
* Path, like https://s3-eu-west-1.amazonaws.com/rave-media/
* @type {string}
*/
this.DstPath = "https://" + s3Service + "-" + awsRegion + ".amazonaws.com/" + outputBucketName + "/";
/**
* Source file
* @type {string}
*/
this.SrcFile = opts.Input.Key;
}
}
module.exports = JobResult;