UNPKG

tencentcloud-sdk-nodejs-intl-en

Version:
476 lines (396 loc) • 15.7 kB
/* * Copyright (c) 2018 Tencent. All Rights Reserved. * * 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. */ const AbstractModel = require("../../common/abstract_model"); /** * SubmitImageToVideoViduJob request structure. * @class */ class SubmitImageToVideoViduJobRequest extends AbstractModel { constructor(){ super(); /** * <p>Whether to use recommended prompts, off by default<br>-true: Yes, the system automatically recommends prompts and uses prompt content to generate video. The number of recommended prompts is 1.<br>-false: No, generate video based on input prompt.<br>Note: Each task consumes 1 more point when recommended prompts are enabled.</p> * @type {boolean || null} */ this.IsRec = null; /** * <p>Voice type ID<br>Used to determine the voice type in the video. If left empty, the system will automatically recommend. Optional enumerated values reference list: supported timbre list<br>Voice clone functionality is not currently supported</p> * @type {string || null} */ this.VoiceId = null; /** * <p>Exercise range<br>Default: auto, available values: auto, small, medium, large<br>Note: This parameter does not take effect for q2 and q3 series models.</p> * @type {string || null} */ this.MovementAmplitude = null; /** * <p>bgm</p> * @type {boolean || null} */ this.Bgm = null; /** * <p>Audio type, required when audio is true, default is all<br>Note: This parameter currently only supports audio split for q2, q1, and 2.0 series models</p><p>Enumeration value:</p><ul><li>all: Sound effects + voice</li><li>speech_only: Voice only</li><li>sound_effect_only: Sound effects only</li></ul> * @type {string || null} */ this.AudioType = null; /** * <p>Metadata identification, a string in json format, passthrough field. You can customize the format or use the example format, for example:<br>{<br>&quot;Label&quot;: &quot;your_label&quot;,<br>&quot;ContentProducer&quot;: &quot;your_content_producer&quot;,<br>&quot;ContentPropagator&quot;: &quot;your_content_propagator&quot;,<br>&quot;ProduceID&quot;: &quot;your_product_id&quot;,<br>&quot;PropagateID&quot;: &quot;your_propagate_id&quot;,<br>&quot;ReservedCode1&quot;: &quot;your_reserved_code1&quot;,<br>&quot;ReservedCode2&quot;: &quot;your_reserved_code2&quot;<br>}<br>If empty, use the metadata identification generated by vidu by default.</p> * @type {string || null} */ this.MetaData = null; /** * <p>Callback protocol<br>You need to actively set Callback_url when creating a task. The request method is POST. Upon video generation completion, a Callback request containing the latest task status will be sent to this address. The content structure of the Callback request matches the return format of the query task API.<br>The "status" returned by the Callback includes the following states:</p><ul><li>success Task completed (e.g., if sending fails, Callback three times)</li><li>failed Task failure (e.g., if sending fails, Callback three times)</li></ul> * @type {string || null} */ this.CallbackUrl = null; /** * <p>Pass-through parameter<br>Without any processing, only data transmission<br>Note: Up to 1048576 characters</p> * @type {string || null} */ this.Payload = null; /** * <p>Off-peak mode, defaults to false. Available values:</p><ul><li>true: Generate video in off-peak mode;</li><li>false: Generate video instantly;<br>Note 1: Off-peak mode consumes lower points.<br>Note 2: Tasks submitted in off-peak mode will be processed within 48 hours. Uncompleted tasks will be canceled automatically, and the points of the task will be returned.</li></ul> * @type {boolean || null} */ this.OffPeak = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.IsRec = 'IsRec' in params ? params.IsRec : null; this.VoiceId = 'VoiceId' in params ? params.VoiceId : null; this.MovementAmplitude = 'MovementAmplitude' in params ? params.MovementAmplitude : null; this.Bgm = 'Bgm' in params ? params.Bgm : null; this.AudioType = 'AudioType' in params ? params.AudioType : null; this.MetaData = 'MetaData' in params ? params.MetaData : null; this.CallbackUrl = 'CallbackUrl' in params ? params.CallbackUrl : null; this.Payload = 'Payload' in params ? params.Payload : null; this.OffPeak = 'OffPeak' in params ? params.OffPeak : null; } } /** * Logo parameter * @class */ class LogoParam extends AbstractModel { constructor(){ super(); /** * Watermark URL Note: This field may return null, indicating that no valid values can be obtained. * @type {string || null} */ this.LogoUrl = null; /** * Watermark Base64 code is supported. Either the Base64 code or URL must be provided. If both are provided, the URL prevails. Note: This field may return null, indicating that no valid values can be obtained. * @type {string || null} */ this.LogoImage = null; /** * The coordinates of the watermark image in the generated image. The mark image will be expanded according to the coordinates. Note: This field may return null, indicating that no valid values can be obtained. * @type {LogoRect || null} */ this.LogoRect = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.LogoUrl = 'LogoUrl' in params ? params.LogoUrl : null; this.LogoImage = 'LogoImage' in params ? params.LogoImage : null; if (params.LogoRect) { let obj = new LogoRect(); obj.deserialize(params.LogoRect) this.LogoRect = obj; } } } /** * DescribeImageAnimateJob response structure. * @class */ class DescribeImageAnimateJobResponse extends AbstractModel { constructor(){ super(); /** * Task status. WAIT: waiting; RUN: running; FAIL: failed; DONE: successful. * @type {string || null} */ this.Status = null; /** * Error code. * @type {string || null} */ this.ErrorCode = null; /** * Error message. * @type {string || null} */ this.ErrorMessage = null; /** * Generated video URL. It is valid for 24 hours. * @type {string || null} */ this.ResultVideoUrl = null; /** * Masked video URL. * @type {string || null} */ this.MaskVideoUrl = null; /** * The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. * @type {string || null} */ this.RequestId = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.Status = 'Status' in params ? params.Status : null; this.ErrorCode = 'ErrorCode' in params ? params.ErrorCode : null; this.ErrorMessage = 'ErrorMessage' in params ? params.ErrorMessage : null; this.ResultVideoUrl = 'ResultVideoUrl' in params ? params.ResultVideoUrl : null; this.MaskVideoUrl = 'MaskVideoUrl' in params ? params.MaskVideoUrl : null; this.RequestId = 'RequestId' in params ? params.RequestId : null; } } /** * Input box * @class */ class LogoRect extends AbstractModel { constructor(){ super(); /** * X-axis coordinate of the upper left corner Note: This field may return null, indicating that no valid values can be obtained. * @type {number || null} */ this.X = null; /** * Y-axis coordinate of the upper left corner Note: This field may return null, indicating that no valid values can be obtained. * @type {number || null} */ this.Y = null; /** * Box width Note: This field may return null, indicating that no valid values can be obtained. * @type {number || null} */ this.Width = null; /** * Box height Note: This field may return null, indicating that no valid values can be obtained. * @type {number || null} */ this.Height = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.X = 'X' in params ? params.X : null; this.Y = 'Y' in params ? params.Y : null; this.Width = 'Width' in params ? params.Width : null; this.Height = 'Height' in params ? params.Height : null; } } /** * SubmitImageAnimateJob response structure. * @class */ class SubmitImageAnimateJobResponse extends AbstractModel { constructor(){ super(); /** * Task ID. * @type {string || null} */ this.JobId = null; /** * The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. * @type {string || null} */ this.RequestId = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.JobId = 'JobId' in params ? params.JobId : null; this.RequestId = 'RequestId' in params ? params.RequestId : null; } } /** * SubmitImageToVideoViduJob response structure. * @class */ class SubmitImageToVideoViduJobResponse extends AbstractModel { constructor(){ super(); /** * <p>Task ID.</p> * @type {string || null} */ this.JobId = null; /** * The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. * @type {string || null} */ this.RequestId = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.JobId = 'JobId' in params ? params.JobId : null; this.RequestId = 'RequestId' in params ? params.RequestId : null; } } /** * SubmitImageAnimateJob request structure. * @class */ class SubmitImageAnimateJobRequest extends AbstractModel { constructor(){ super(); /** * Image format: PNG, JPG, and JPEG formats are supported. Image resolution: The long edge resolution should not exceed 2056. Image size: The size should not exceed 10 MB. Image aspect ratio: The ratio of width to height should be in the range of 1:2 to 1:1.2. * @type {string || null} */ this.ImageUrl = null; /** * Image information after Base64 encoding. Image format: PNG, JPG, and JPEG formats are supported. Image resolution: The long side resolution should not exceed 2056. Image size: The size should not exceed 10 MB. Image aspect ratio: The ratio of width to height should be in the range of 1:2 to 1:1.2. * @type {string || null} */ this.ImageBase64 = null; /** * Action template ID. ke3: kemusan; tuziwu: rabbit dance; huajiangwu: paddling dance. * @type {string || null} */ this.TemplateId = null; /** * Whether the generated video retains the audio in the template. The default value is true. * @type {boolean || null} */ this.EnableAudio = null; /** * Whether to detect 12 body parts in the input image (head, neck, right shoulder, right elbow, right wrist, left shoulder, left elbow, left wrist, right hip, left hip, left knee, and right knee). They are not detected by default. * @type {boolean || null} */ this.EnableBodyJoins = null; /** * Whether the final video retains the background of the original image. (This parameter does not take effect when TemplateId is set to tuziwu or huajiangwu.) * @type {boolean || null} */ this.EnableSegment = null; /** * Whether to add a mark to the generated video. The default value is 0. 1: A mark is added. 0: No mark is added. Other values: A mark is added by default. It is recommended to use an obvious mark to indicate that the video is synthesized by AI. * @type {number || null} */ this.LogoAdd = null; /** * Mark text settings. By default, the text "Synthesized by AI" is added to the bottom right corner of the generated video. You can also use other text images. * @type {LogoParam || null} */ this.LogoParam = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.ImageUrl = 'ImageUrl' in params ? params.ImageUrl : null; this.ImageBase64 = 'ImageBase64' in params ? params.ImageBase64 : null; this.TemplateId = 'TemplateId' in params ? params.TemplateId : null; this.EnableAudio = 'EnableAudio' in params ? params.EnableAudio : null; this.EnableBodyJoins = 'EnableBodyJoins' in params ? params.EnableBodyJoins : null; this.EnableSegment = 'EnableSegment' in params ? params.EnableSegment : null; this.LogoAdd = 'LogoAdd' in params ? params.LogoAdd : null; if (params.LogoParam) { let obj = new LogoParam(); obj.deserialize(params.LogoParam) this.LogoParam = obj; } } } /** * DescribeImageAnimateJob request structure. * @class */ class DescribeImageAnimateJobRequest extends AbstractModel { constructor(){ super(); /** * Task ID. * @type {string || null} */ this.JobId = null; } /** * @private */ deserialize(params) { if (!params) { return; } this.JobId = 'JobId' in params ? params.JobId : null; } } module.exports = { SubmitImageToVideoViduJobRequest: SubmitImageToVideoViduJobRequest, LogoParam: LogoParam, DescribeImageAnimateJobResponse: DescribeImageAnimateJobResponse, LogoRect: LogoRect, SubmitImageAnimateJobResponse: SubmitImageAnimateJobResponse, SubmitImageToVideoViduJobResponse: SubmitImageToVideoViduJobResponse, SubmitImageAnimateJobRequest: SubmitImageAnimateJobRequest, DescribeImageAnimateJobRequest: DescribeImageAnimateJobRequest, }