// Copyright (c) 2017-2025 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.

package v20240523

import (
    tcerr "github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/errors"
    tchttp "github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/http"
    "github.com/tencentcloud/tencentcloud-sdk-go-intl-en/tencentcloud/common/json"
)

// Predefined struct for user
type DescribeImageAnimateJobRequestParams struct {
	// Task ID.
	JobId *string `json:"JobId,omitnil,omitempty" name:"JobId"`
}

type DescribeImageAnimateJobRequest struct {
	*tchttp.BaseRequest
	
	// Task ID.
	JobId *string `json:"JobId,omitnil,omitempty" name:"JobId"`
}

func (r *DescribeImageAnimateJobRequest) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DescribeImageAnimateJobRequest) FromJsonString(s string) error {
	f := make(map[string]interface{})
	if err := json.Unmarshal([]byte(s), &f); err != nil {
		return err
	}
	delete(f, "JobId")
	if len(f) > 0 {
		return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "DescribeImageAnimateJobRequest has unknown keys!", "")
	}
	return json.Unmarshal([]byte(s), &r)
}

// Predefined struct for user
type DescribeImageAnimateJobResponseParams struct {
	// Task status. WAIT: waiting; RUN: running; FAIL: failed; DONE: successful.
	Status *string `json:"Status,omitnil,omitempty" name:"Status"`

	// Error code.
	ErrorCode *string `json:"ErrorCode,omitnil,omitempty" name:"ErrorCode"`

	// Error message.
	ErrorMessage *string `json:"ErrorMessage,omitnil,omitempty" name:"ErrorMessage"`

	// Generated video URL. It is valid for 24 hours.
	ResultVideoUrl *string `json:"ResultVideoUrl,omitnil,omitempty" name:"ResultVideoUrl"`

	// Masked video URL.
	MaskVideoUrl *string `json:"MaskVideoUrl,omitnil,omitempty" name:"MaskVideoUrl"`

	// 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.
	RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}

type DescribeImageAnimateJobResponse struct {
	*tchttp.BaseResponse
	Response *DescribeImageAnimateJobResponseParams `json:"Response"`
}

func (r *DescribeImageAnimateJobResponse) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *DescribeImageAnimateJobResponse) FromJsonString(s string) error {
	return json.Unmarshal([]byte(s), &r)
}

type LogoParam struct {
	// Watermark URL
	// 
	// Note: This field may return null, indicating that no valid values can be obtained.
	LogoUrl *string `json:"LogoUrl,omitnil,omitempty" name:"LogoUrl"`

	// 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.
	LogoImage *string `json:"LogoImage,omitnil,omitempty" name:"LogoImage"`

	// 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.
	LogoRect *LogoRect `json:"LogoRect,omitnil,omitempty" name:"LogoRect"`
}

type LogoRect struct {
	// X-axis coordinate of the upper left corner
	// 
	// Note: This field may return null, indicating that no valid values can be obtained.
	X *int64 `json:"X,omitnil,omitempty" name:"X"`

	// Y-axis coordinate of the upper left corner
	// 
	// Note: This field may return null, indicating that no valid values can be obtained.
	Y *int64 `json:"Y,omitnil,omitempty" name:"Y"`

	// Box width
	// 
	// Note: This field may return null, indicating that no valid values can be obtained.
	Width *int64 `json:"Width,omitnil,omitempty" name:"Width"`

	// Box height
	// 
	// Note: This field may return null, indicating that no valid values can be obtained.
	Height *int64 `json:"Height,omitnil,omitempty" name:"Height"`
}

// Predefined struct for user
type SubmitImageAnimateJobRequestParams struct {
	// 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.
	ImageUrl *string `json:"ImageUrl,omitnil,omitempty" name:"ImageUrl"`

	// 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.
	ImageBase64 *string `json:"ImageBase64,omitnil,omitempty" name:"ImageBase64"`

	// Action template ID. ke3: kemusan; tuziwu: rabbit dance; huajiangwu: paddling dance.
	TemplateId *string `json:"TemplateId,omitnil,omitempty" name:"TemplateId"`

	// Whether the generated video retains the audio in the template. The default value is true.
	EnableAudio *bool `json:"EnableAudio,omitnil,omitempty" name:"EnableAudio"`

	// 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.
	EnableBodyJoins *bool `json:"EnableBodyJoins,omitnil,omitempty" name:"EnableBodyJoins"`

	// 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.)
	EnableSegment *bool `json:"EnableSegment,omitnil,omitempty" name:"EnableSegment"`

	// 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.
	LogoAdd *int64 `json:"LogoAdd,omitnil,omitempty" name:"LogoAdd"`

	// 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.
	LogoParam *LogoParam `json:"LogoParam,omitnil,omitempty" name:"LogoParam"`
}

type SubmitImageAnimateJobRequest struct {
	*tchttp.BaseRequest
	
	// 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.
	ImageUrl *string `json:"ImageUrl,omitnil,omitempty" name:"ImageUrl"`

	// 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.
	ImageBase64 *string `json:"ImageBase64,omitnil,omitempty" name:"ImageBase64"`

	// Action template ID. ke3: kemusan; tuziwu: rabbit dance; huajiangwu: paddling dance.
	TemplateId *string `json:"TemplateId,omitnil,omitempty" name:"TemplateId"`

	// Whether the generated video retains the audio in the template. The default value is true.
	EnableAudio *bool `json:"EnableAudio,omitnil,omitempty" name:"EnableAudio"`

	// 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.
	EnableBodyJoins *bool `json:"EnableBodyJoins,omitnil,omitempty" name:"EnableBodyJoins"`

	// 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.)
	EnableSegment *bool `json:"EnableSegment,omitnil,omitempty" name:"EnableSegment"`

	// 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.
	LogoAdd *int64 `json:"LogoAdd,omitnil,omitempty" name:"LogoAdd"`

	// 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.
	LogoParam *LogoParam `json:"LogoParam,omitnil,omitempty" name:"LogoParam"`
}

func (r *SubmitImageAnimateJobRequest) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *SubmitImageAnimateJobRequest) FromJsonString(s string) error {
	f := make(map[string]interface{})
	if err := json.Unmarshal([]byte(s), &f); err != nil {
		return err
	}
	delete(f, "ImageUrl")
	delete(f, "ImageBase64")
	delete(f, "TemplateId")
	delete(f, "EnableAudio")
	delete(f, "EnableBodyJoins")
	delete(f, "EnableSegment")
	delete(f, "LogoAdd")
	delete(f, "LogoParam")
	if len(f) > 0 {
		return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SubmitImageAnimateJobRequest has unknown keys!", "")
	}
	return json.Unmarshal([]byte(s), &r)
}

// Predefined struct for user
type SubmitImageAnimateJobResponseParams struct {
	// Task ID.
	JobId *string `json:"JobId,omitnil,omitempty" name:"JobId"`

	// 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.
	RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}

type SubmitImageAnimateJobResponse struct {
	*tchttp.BaseResponse
	Response *SubmitImageAnimateJobResponseParams `json:"Response"`
}

func (r *SubmitImageAnimateJobResponse) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *SubmitImageAnimateJobResponse) FromJsonString(s string) error {
	return json.Unmarshal([]byte(s), &r)
}

// Predefined struct for user
type SubmitImageToVideoViduJobRequestParams struct {
	// <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>
	IsRec *bool `json:"IsRec,omitnil,omitempty" name:"IsRec"`

	// <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>
	VoiceId *string `json:"VoiceId,omitnil,omitempty" name:"VoiceId"`

	// <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>
	MovementAmplitude *string `json:"MovementAmplitude,omitnil,omitempty" name:"MovementAmplitude"`

	// <p>bgm</p>
	Bgm *bool `json:"Bgm,omitnil,omitempty" name:"Bgm"`

	// <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>
	AudioType *string `json:"AudioType,omitnil,omitempty" name:"AudioType"`

	// <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>
	MetaData *string `json:"MetaData,omitnil,omitempty" name:"MetaData"`

	// <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>
	CallbackUrl *string `json:"CallbackUrl,omitnil,omitempty" name:"CallbackUrl"`

	// <p>Pass-through parameter<br>Without any processing, only data transmission<br>Note: Up to 1048576 characters</p>
	Payload *string `json:"Payload,omitnil,omitempty" name:"Payload"`

	// <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>
	OffPeak *bool `json:"OffPeak,omitnil,omitempty" name:"OffPeak"`
}

type SubmitImageToVideoViduJobRequest struct {
	*tchttp.BaseRequest
	
	// <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>
	IsRec *bool `json:"IsRec,omitnil,omitempty" name:"IsRec"`

	// <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>
	VoiceId *string `json:"VoiceId,omitnil,omitempty" name:"VoiceId"`

	// <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>
	MovementAmplitude *string `json:"MovementAmplitude,omitnil,omitempty" name:"MovementAmplitude"`

	// <p>bgm</p>
	Bgm *bool `json:"Bgm,omitnil,omitempty" name:"Bgm"`

	// <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>
	AudioType *string `json:"AudioType,omitnil,omitempty" name:"AudioType"`

	// <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>
	MetaData *string `json:"MetaData,omitnil,omitempty" name:"MetaData"`

	// <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>
	CallbackUrl *string `json:"CallbackUrl,omitnil,omitempty" name:"CallbackUrl"`

	// <p>Pass-through parameter<br>Without any processing, only data transmission<br>Note: Up to 1048576 characters</p>
	Payload *string `json:"Payload,omitnil,omitempty" name:"Payload"`

	// <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>
	OffPeak *bool `json:"OffPeak,omitnil,omitempty" name:"OffPeak"`
}

func (r *SubmitImageToVideoViduJobRequest) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *SubmitImageToVideoViduJobRequest) FromJsonString(s string) error {
	f := make(map[string]interface{})
	if err := json.Unmarshal([]byte(s), &f); err != nil {
		return err
	}
	delete(f, "IsRec")
	delete(f, "VoiceId")
	delete(f, "MovementAmplitude")
	delete(f, "Bgm")
	delete(f, "AudioType")
	delete(f, "MetaData")
	delete(f, "CallbackUrl")
	delete(f, "Payload")
	delete(f, "OffPeak")
	if len(f) > 0 {
		return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SubmitImageToVideoViduJobRequest has unknown keys!", "")
	}
	return json.Unmarshal([]byte(s), &r)
}

// Predefined struct for user
type SubmitImageToVideoViduJobResponseParams struct {
	// <p>Task ID.</p>
	JobId *string `json:"JobId,omitnil,omitempty" name:"JobId"`

	// 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.
	RequestId *string `json:"RequestId,omitnil,omitempty" name:"RequestId"`
}

type SubmitImageToVideoViduJobResponse struct {
	*tchttp.BaseResponse
	Response *SubmitImageToVideoViduJobResponseParams `json:"Response"`
}

func (r *SubmitImageToVideoViduJobResponse) ToJsonString() string {
    b, _ := json.Marshal(r)
    return string(b)
}

// FromJsonString It is highly **NOT** recommended to use this function
// because it has no param check, nor strict type check
func (r *SubmitImageToVideoViduJobResponse) FromJsonString(s string) error {
	return json.Unmarshal([]byte(s), &r)
}