@google-cloud/video-transcoder
Version:
Transcoder client for Node.js
802 lines (754 loc) • 2.51 MB
JavaScript
// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
(function(global, factory) { /* global define, require, module */
/* AMD */ if (typeof define === 'function' && define.amd)
define(["protobufjs/minimal"], factory);
/* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports)
module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal);
})(this, function($protobuf) {
"use strict";
// Common aliases
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
// Exported root namespace
var $root = $protobuf.roots._google_cloud_video_transcoder_protos || ($protobuf.roots._google_cloud_video_transcoder_protos = {});
$root.google = (function() {
/**
* Namespace google.
* @exports google
* @namespace
*/
var google = {};
google.cloud = (function() {
/**
* Namespace cloud.
* @memberof google
* @namespace
*/
var cloud = {};
cloud.video = (function() {
/**
* Namespace video.
* @memberof google.cloud
* @namespace
*/
var video = {};
video.transcoder = (function() {
/**
* Namespace transcoder.
* @memberof google.cloud.video
* @namespace
*/
var transcoder = {};
transcoder.v1 = (function() {
/**
* Namespace v1.
* @memberof google.cloud.video.transcoder
* @namespace
*/
var v1 = {};
v1.Job = (function() {
/**
* Properties of a Job.
* @memberof google.cloud.video.transcoder.v1
* @interface IJob
* @property {string|null} [name] Job name
* @property {string|null} [inputUri] Job inputUri
* @property {string|null} [outputUri] Job outputUri
* @property {string|null} [templateId] Job templateId
* @property {google.cloud.video.transcoder.v1.IJobConfig|null} [config] Job config
* @property {google.cloud.video.transcoder.v1.Job.ProcessingState|null} [state] Job state
* @property {google.protobuf.ITimestamp|null} [createTime] Job createTime
* @property {google.protobuf.ITimestamp|null} [startTime] Job startTime
* @property {google.protobuf.ITimestamp|null} [endTime] Job endTime
* @property {number|null} [ttlAfterCompletionDays] Job ttlAfterCompletionDays
* @property {Object.<string,string>|null} [labels] Job labels
* @property {google.rpc.IStatus|null} [error] Job error
* @property {google.cloud.video.transcoder.v1.Job.ProcessingMode|null} [mode] Job mode
* @property {number|null} [batchModePriority] Job batchModePriority
* @property {google.cloud.video.transcoder.v1.Job.OptimizationStrategy|null} [optimization] Job optimization
* @property {boolean|null} [fillContentGaps] Job fillContentGaps
*/
/**
* Constructs a new Job.
* @memberof google.cloud.video.transcoder.v1
* @classdesc Represents a Job.
* @implements IJob
* @constructor
* @param {google.cloud.video.transcoder.v1.IJob=} [properties] Properties to set
*/
function Job(properties) {
this.labels = {};
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* Job name.
* @member {string} name
* @memberof google.cloud.video.transcoder.v1.Job
* @instance
*/
Job.prototype.name = "";
/**
* Job inputUri.
* @member {string} inputUri
* @memberof google.cloud.video.transcoder.v1.Job
* @instance
*/
Job.prototype.inputUri = "";
/**
* Job outputUri.
* @member {string} outputUri
* @memberof google.cloud.video.transcoder.v1.Job
* @instance
*/
Job.prototype.outputUri = "";
/**
* Job templateId.
* @member {string|null|undefined} templateId
* @memberof google.cloud.video.transcoder.v1.Job
* @instance
*/
Job.prototype.templateId = null;
/**
* Job config.
* @member {google.cloud.video.transcoder.v1.IJobConfig|null|undefined} config
* @memberof google.cloud.video.transcoder.v1.Job
* @instance
*/
Job.prototype.config = null;
/**
* Job state.
* @member {google.cloud.video.transcoder.v1.Job.ProcessingState} state
* @memberof google.cloud.video.transcoder.v1.Job
* @instance
*/
Job.prototype.state = 0;
/**
* Job createTime.
* @member {google.protobuf.ITimestamp|null|undefined} createTime
* @memberof google.cloud.video.transcoder.v1.Job
* @instance
*/
Job.prototype.createTime = null;
/**
* Job startTime.
* @member {google.protobuf.ITimestamp|null|undefined} startTime
* @memberof google.cloud.video.transcoder.v1.Job
* @instance
*/
Job.prototype.startTime = null;
/**
* Job endTime.
* @member {google.protobuf.ITimestamp|null|undefined} endTime
* @memberof google.cloud.video.transcoder.v1.Job
* @instance
*/
Job.prototype.endTime = null;
/**
* Job ttlAfterCompletionDays.
* @member {number} ttlAfterCompletionDays
* @memberof google.cloud.video.transcoder.v1.Job
* @instance
*/
Job.prototype.ttlAfterCompletionDays = 0;
/**
* Job labels.
* @member {Object.<string,string>} labels
* @memberof google.cloud.video.transcoder.v1.Job
* @instance
*/
Job.prototype.labels = $util.emptyObject;
/**
* Job error.
* @member {google.rpc.IStatus|null|undefined} error
* @memberof google.cloud.video.transcoder.v1.Job
* @instance
*/
Job.prototype.error = null;
/**
* Job mode.
* @member {google.cloud.video.transcoder.v1.Job.ProcessingMode} mode
* @memberof google.cloud.video.transcoder.v1.Job
* @instance
*/
Job.prototype.mode = 0;
/**
* Job batchModePriority.
* @member {number} batchModePriority
* @memberof google.cloud.video.transcoder.v1.Job
* @instance
*/
Job.prototype.batchModePriority = 0;
/**
* Job optimization.
* @member {google.cloud.video.transcoder.v1.Job.OptimizationStrategy} optimization
* @memberof google.cloud.video.transcoder.v1.Job
* @instance
*/
Job.prototype.optimization = 0;
/**
* Job fillContentGaps.
* @member {boolean} fillContentGaps
* @memberof google.cloud.video.transcoder.v1.Job
* @instance
*/
Job.prototype.fillContentGaps = false;
// OneOf field names bound to virtual getters and setters
var $oneOfFields;
/**
* Job jobConfig.
* @member {"templateId"|"config"|undefined} jobConfig
* @memberof google.cloud.video.transcoder.v1.Job
* @instance
*/
Object.defineProperty(Job.prototype, "jobConfig", {
get: $util.oneOfGetter($oneOfFields = ["templateId", "config"]),
set: $util.oneOfSetter($oneOfFields)
});
/**
* Creates a new Job instance using the specified properties.
* @function create
* @memberof google.cloud.video.transcoder.v1.Job
* @static
* @param {google.cloud.video.transcoder.v1.IJob=} [properties] Properties to set
* @returns {google.cloud.video.transcoder.v1.Job} Job instance
*/
Job.create = function create(properties) {
return new Job(properties);
};
/**
* Encodes the specified Job message. Does not implicitly {@link google.cloud.video.transcoder.v1.Job.verify|verify} messages.
* @function encode
* @memberof google.cloud.video.transcoder.v1.Job
* @static
* @param {google.cloud.video.transcoder.v1.IJob} message Job message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Job.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.name != null && Object.hasOwnProperty.call(message, "name"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);
if (message.inputUri != null && Object.hasOwnProperty.call(message, "inputUri"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputUri);
if (message.outputUri != null && Object.hasOwnProperty.call(message, "outputUri"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputUri);
if (message.templateId != null && Object.hasOwnProperty.call(message, "templateId"))
writer.uint32(/* id 4, wireType 2 =*/34).string(message.templateId);
if (message.config != null && Object.hasOwnProperty.call(message, "config"))
$root.google.cloud.video.transcoder.v1.JobConfig.encode(message.config, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
if (message.state != null && Object.hasOwnProperty.call(message, "state"))
writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state);
if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime"))
$root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime"))
$root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim();
if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime"))
$root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim();
if (message.ttlAfterCompletionDays != null && Object.hasOwnProperty.call(message, "ttlAfterCompletionDays"))
writer.uint32(/* id 15, wireType 0 =*/120).int32(message.ttlAfterCompletionDays);
if (message.labels != null && Object.hasOwnProperty.call(message, "labels"))
for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i)
writer.uint32(/* id 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim();
if (message.error != null && Object.hasOwnProperty.call(message, "error"))
$root.google.rpc.Status.encode(message.error, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim();
if (message.mode != null && Object.hasOwnProperty.call(message, "mode"))
writer.uint32(/* id 20, wireType 0 =*/160).int32(message.mode);
if (message.batchModePriority != null && Object.hasOwnProperty.call(message, "batchModePriority"))
writer.uint32(/* id 21, wireType 0 =*/168).int32(message.batchModePriority);
if (message.optimization != null && Object.hasOwnProperty.call(message, "optimization"))
writer.uint32(/* id 22, wireType 0 =*/176).int32(message.optimization);
if (message.fillContentGaps != null && Object.hasOwnProperty.call(message, "fillContentGaps"))
writer.uint32(/* id 25, wireType 0 =*/200).bool(message.fillContentGaps);
return writer;
};
/**
* Encodes the specified Job message, length delimited. Does not implicitly {@link google.cloud.video.transcoder.v1.Job.verify|verify} messages.
* @function encodeDelimited
* @memberof google.cloud.video.transcoder.v1.Job
* @static
* @param {google.cloud.video.transcoder.v1.IJob} message Job message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
Job.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a Job message from the specified reader or buffer.
* @function decode
* @memberof google.cloud.video.transcoder.v1.Job
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {google.cloud.video.transcoder.v1.Job} Job
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Job.decode = function decode(reader, length, error) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.video.transcoder.v1.Job(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
if (tag === error)
break;
switch (tag >>> 3) {
case 1: {
message.name = reader.string();
break;
}
case 2: {
message.inputUri = reader.string();
break;
}
case 3: {
message.outputUri = reader.string();
break;
}
case 4: {
message.templateId = reader.string();
break;
}
case 5: {
message.config = $root.google.cloud.video.transcoder.v1.JobConfig.decode(reader, reader.uint32());
break;
}
case 8: {
message.state = reader.int32();
break;
}
case 12: {
message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
break;
}
case 13: {
message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
break;
}
case 14: {
message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32());
break;
}
case 15: {
message.ttlAfterCompletionDays = reader.int32();
break;
}
case 16: {
if (message.labels === $util.emptyObject)
message.labels = {};
var end2 = reader.uint32() + reader.pos;
key = "";
value = "";
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.string();
break;
case 2:
value = reader.string();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.labels[key] = value;
break;
}
case 17: {
message.error = $root.google.rpc.Status.decode(reader, reader.uint32());
break;
}
case 20: {
message.mode = reader.int32();
break;
}
case 21: {
message.batchModePriority = reader.int32();
break;
}
case 22: {
message.optimization = reader.int32();
break;
}
case 25: {
message.fillContentGaps = reader.bool();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a Job message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof google.cloud.video.transcoder.v1.Job
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {google.cloud.video.transcoder.v1.Job} Job
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
Job.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a Job message.
* @function verify
* @memberof google.cloud.video.transcoder.v1.Job
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
Job.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
var properties = {};
if (message.name != null && message.hasOwnProperty("name"))
if (!$util.isString(message.name))
return "name: string expected";
if (message.inputUri != null && message.hasOwnProperty("inputUri"))
if (!$util.isString(message.inputUri))
return "inputUri: string expected";
if (message.outputUri != null && message.hasOwnProperty("outputUri"))
if (!$util.isString(message.outputUri))
return "outputUri: string expected";
if (message.templateId != null && message.hasOwnProperty("templateId")) {
properties.jobConfig = 1;
if (!$util.isString(message.templateId))
return "templateId: string expected";
}
if (message.config != null && message.hasOwnProperty("config")) {
if (properties.jobConfig === 1)
return "jobConfig: multiple values";
properties.jobConfig = 1;
{
var error = $root.google.cloud.video.transcoder.v1.JobConfig.verify(message.config);
if (error)
return "config." + error;
}
}
if (message.state != null && message.hasOwnProperty("state"))
switch (message.state) {
default:
return "state: enum value expected";
case 0:
case 1:
case 2:
case 3:
case 4:
break;
}
if (message.createTime != null && message.hasOwnProperty("createTime")) {
var error = $root.google.protobuf.Timestamp.verify(message.createTime);
if (error)
return "createTime." + error;
}
if (message.startTime != null && message.hasOwnProperty("startTime")) {
var error = $root.google.protobuf.Timestamp.verify(message.startTime);
if (error)
return "startTime." + error;
}
if (message.endTime != null && message.hasOwnProperty("endTime")) {
var error = $root.google.protobuf.Timestamp.verify(message.endTime);
if (error)
return "endTime." + error;
}
if (message.ttlAfterCompletionDays != null && message.hasOwnProperty("ttlAfterCompletionDays"))
if (!$util.isInteger(message.ttlAfterCompletionDays))
return "ttlAfterCompletionDays: integer expected";
if (message.labels != null && message.hasOwnProperty("labels")) {
if (!$util.isObject(message.labels))
return "labels: object expected";
var key = Object.keys(message.labels);
for (var i = 0; i < key.length; ++i)
if (!$util.isString(message.labels[key[i]]))
return "labels: string{k:string} expected";
}
if (message.error != null && message.hasOwnProperty("error")) {
var error = $root.google.rpc.Status.verify(message.error);
if (error)
return "error." + error;
}
if (message.mode != null && message.hasOwnProperty("mode"))
switch (message.mode) {
default:
return "mode: enum value expected";
case 0:
case 1:
case 2:
break;
}
if (message.batchModePriority != null && message.hasOwnProperty("batchModePriority"))
if (!$util.isInteger(message.batchModePriority))
return "batchModePriority: integer expected";
if (message.optimization != null && message.hasOwnProperty("optimization"))
switch (message.optimization) {
default:
return "optimization: enum value expected";
case 0:
case 1:
case 2:
break;
}
if (message.fillContentGaps != null && message.hasOwnProperty("fillContentGaps"))
if (typeof message.fillContentGaps !== "boolean")
return "fillContentGaps: boolean expected";
return null;
};
/**
* Creates a Job message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof google.cloud.video.transcoder.v1.Job
* @static
* @param {Object.<string,*>} object Plain object
* @returns {google.cloud.video.transcoder.v1.Job} Job
*/
Job.fromObject = function fromObject(object) {
if (object instanceof $root.google.cloud.video.transcoder.v1.Job)
return object;
var message = new $root.google.cloud.video.transcoder.v1.Job();
if (object.name != null)
message.name = String(object.name);
if (object.inputUri != null)
message.inputUri = String(object.inputUri);
if (object.outputUri != null)
message.outputUri = String(object.outputUri);
if (object.templateId != null)
message.templateId = String(object.templateId);
if (object.config != null) {
if (typeof object.config !== "object")
throw TypeError(".google.cloud.video.transcoder.v1.Job.config: object expected");
message.config = $root.google.cloud.video.transcoder.v1.JobConfig.fromObject(object.config);
}
switch (object.state) {
default:
if (typeof object.state === "number") {
message.state = object.state;
break;
}
break;
case "PROCESSING_STATE_UNSPECIFIED":
case 0:
message.state = 0;
break;
case "PENDING":
case 1:
message.state = 1;
break;
case "RUNNING":
case 2:
message.state = 2;
break;
case "SUCCEEDED":
case 3:
message.state = 3;
break;
case "FAILED":
case 4:
message.state = 4;
break;
}
if (object.createTime != null) {
if (typeof object.createTime !== "object")
throw TypeError(".google.cloud.video.transcoder.v1.Job.createTime: object expected");
message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime);
}
if (object.startTime != null) {
if (typeof object.startTime !== "object")
throw TypeError(".google.cloud.video.transcoder.v1.Job.startTime: object expected");
message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime);
}
if (object.endTime != null) {
if (typeof object.endTime !== "object")
throw TypeError(".google.cloud.video.transcoder.v1.Job.endTime: object expected");
message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime);
}
if (object.ttlAfterCompletionDays != null)
message.ttlAfterCompletionDays = object.ttlAfterCompletionDays | 0;
if (object.labels) {
if (typeof object.labels !== "object")
throw TypeError(".google.cloud.video.transcoder.v1.Job.labels: object expected");
message.labels = {};
for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i)
message.labels[keys[i]] = String(object.labels[keys[i]]);
}
if (object.error != null) {
if (typeof object.error !== "object")
throw TypeError(".google.cloud.video.transcoder.v1.Job.error: object expected");
message.error = $root.google.rpc.Status.fromObject(object.error);
}
switch (object.mode) {
default:
if (typeof object.mode === "number") {
message.mode = object.mode;
break;
}
break;
case "PROCESSING_MODE_UNSPECIFIED":
case 0:
message.mode = 0;
break;
case "PROCESSING_MODE_INTERACTIVE":
case 1:
message.mode = 1;
break;
case "PROCESSING_MODE_BATCH":
case 2:
message.mode = 2;
break;
}
if (object.batchModePriority != null)
message.batchModePriority = object.batchModePriority | 0;
switch (object.optimization) {
default:
if (typeof object.optimization === "number") {
message.optimization = object.optimization;
break;
}
break;
case "OPTIMIZATION_STRATEGY_UNSPECIFIED":
case 0:
message.optimization = 0;
break;
case "AUTODETECT":
case 1:
message.optimization = 1;
break;
case "DISABLED":
case 2:
message.optimization = 2;
break;
}
if (object.fillContentGaps != null)
message.fillContentGaps = Boolean(object.fillContentGaps);
return message;
};
/**
* Creates a plain object from a Job message. Also converts values to other types if specified.
* @function toObject
* @memberof google.cloud.video.transcoder.v1.Job
* @static
* @param {google.cloud.video.transcoder.v1.Job} message Job
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
Job.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.labels = {};
if (options.defaults) {
object.name = "";
object.inputUri = "";
object.outputUri = "";
object.state = options.enums === String ? "PROCESSING_STATE_UNSPECIFIED" : 0;
object.createTime = null;
object.startTime = null;
object.endTime = null;
object.ttlAfterCompletionDays = 0;
object.error = null;
object.mode = options.enums === String ? "PROCESSING_MODE_UNSPECIFIED" : 0;
object.batchModePriority = 0;
object.optimization = options.enums === String ? "OPTIMIZATION_STRATEGY_UNSPECIFIED" : 0;
object.fillContentGaps = false;
}
if (message.name != null && message.hasOwnProperty("name"))
object.name = message.name;
if (message.inputUri != null && message.hasOwnProperty("inputUri"))
object.inputUri = message.inputUri;
if (message.outputUri != null && message.hasOwnProperty("outputUri"))
object.outputUri = message.outputUri;
if (message.templateId != null && message.hasOwnProperty("templateId")) {
object.templateId = message.templateId;
if (options.oneofs)
object.jobConfig = "templateId";
}
if (message.config != null && message.hasOwnProperty("config")) {
object.config = $root.google.cloud.video.transcoder.v1.JobConfig.toObject(message.config, options);
if (options.oneofs)
object.jobConfig = "config";
}
if (message.state != null && message.hasOwnProperty("state"))
object.state = options.enums === String ? $root.google.cloud.video.transcoder.v1.Job.ProcessingState[message.state] === undefined ? message.state : $root.google.cloud.video.transcoder.v1.Job.ProcessingState[message.state] : message.state;
if (message.createTime != null && message.hasOwnProperty("createTime"))
object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options);
if (message.startTime != null && message.hasOwnProperty("startTime"))
object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options);
if (message.endTime != null && message.hasOwnProperty("endTime"))
object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options);
if (message.ttlAfterCompletionDays != null && message.hasOwnProperty("ttlAfterCompletionDays"))
object.ttlAfterCompletionDays = message.ttlAfterCompletionDays;
var keys2;
if (message.labels && (keys2 = Object.keys(message.labels)).length) {
object.labels = {};
for (var j = 0; j < keys2.length; ++j)
object.labels[keys2[j]] = message.labels[keys2[j]];
}
if (message.error != null && message.hasOwnProperty("error"))
object.error = $root.google.rpc.Status.toObject(message.error, options);
if (message.mode != null && message.hasOwnProperty("mode"))
object.mode = options.enums === String ? $root.google.cloud.video.transcoder.v1.Job.ProcessingMode[message.mode] === undefined ? message.mode : $root.google.cloud.video.transcoder.v1.Job.ProcessingMode[message.mode] : message.mode;
if (message.batchModePriority != null && message.hasOwnProperty("batchModePriority"))
object.batchModePriority = message.batchModePriority;
if (message.optimization != null && message.hasOwnProperty("optimization"))
object.optimization = options.enums === String ? $root.google.cloud.video.transcoder.v1.Job.OptimizationStrategy[message.optimization] === undefined ? message.optimization : $root.google.cloud.video.transcoder.v1.Job.OptimizationStrategy[message.optimization] : message.optimization;
if (message.fillContentGaps != null && message.hasOwnProperty("fillContentGaps"))
object.fillContentGaps = message.fillContentGaps;
return object;
};
/**
* Converts this Job to JSON.
* @function toJSON
* @memberof google.cloud.video.transcoder.v1.Job
* @instance
* @returns {Object.<string,*>} JSON object
*/
Job.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for Job
* @function getTypeUrl
* @memberof google.cloud.video.transcoder.v1.Job
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
Job.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/google.cloud.video.transcoder.v1.Job";
};
/**
* ProcessingState enum.
* @name google.cloud.video.transcoder.v1.Job.ProcessingState
* @enum {number}
* @property {number} PROCESSING_STATE_UNSPECIFIED=0 PROCESSING_STATE_UNSPECIFIED value
* @property {number} PENDING=1 PENDING value
* @property {number} RUNNING=2 RUNNING value
* @prope