// 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 v20250513

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"
)

type File3D struct {
	// Specifies the file format.
	Type *string `json:"Type,omitnil,omitempty" name:"Type"`

	// File Url (valid for 24 hours).
	Url *string `json:"Url,omitnil,omitempty" name:"Url"`

	// Preview image Url.
	PreviewImageUrl *string `json:"PreviewImageUrl,omitnil,omitempty" name:"PreviewImageUrl"`
}

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

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

func (r *QueryHunyuanTo3DProJobRequest) 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 *QueryHunyuanTo3DProJobRequest) 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", "QueryHunyuanTo3DProJobRequest has unknown keys!", "")
	}
	return json.Unmarshal([]byte(s), &r)
}

// Predefined struct for user
type QueryHunyuanTo3DProJobResponseParams 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 3D file array.
	ResultFile3Ds []*File3D `json:"ResultFile3Ds,omitnil,omitempty" name:"ResultFile3Ds"`

	// 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 QueryHunyuanTo3DProJobResponse struct {
	*tchttp.BaseResponse
	Response *QueryHunyuanTo3DProJobResponseParams `json:"Response"`
}

func (r *QueryHunyuanTo3DProJobResponse) 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 *QueryHunyuanTo3DProJobResponse) FromJsonString(s string) error {
	return json.Unmarshal([]byte(s), &r)
}

// Predefined struct for user
type SubmitHunyuanTo3DProJobRequestParams struct {
	// Generates 3D content, describes 3D content, chinese forward prompt content.
	// Supports up to 1024 utf-8 characters.
	// Text-To-3D. specifies image, image_url, or prompt is required. prompt and image/image_url cannot coexist.
	Prompt *string `json:"Prompt,omitnil,omitempty" name:"Prompt"`

	// Enter the Base64 code of the image.
	// Size: specifies the unilateral resolution requirement, not less than 128 and not greater than 5000. size should not exceed 8m (after encoding, it increases by about 30%, recommend actual input image size no more than 6m).
	// Valid values: jpg, png, jpeg, webp.
	// ImageBase64, ImageUrl, or Prompt is required. Prompt and ImageBase64/ImageUrl cannot coexist.
	ImageBase64 *string `json:"ImageBase64,omitnil,omitempty" name:"ImageBase64"`

	// Input image Url.
	// Size: specifies the unilateral resolution requirement, not less than 128 and not greater than 5000. size should not exceed 8m (after encoding, it increases by about 30%, recommend actual input image size no more than 6m).
	// Valid values: jpg, png, jpeg, webp.
	// Specifies either ImageBase64/ImageUrl or Prompt is required. Prompt and ImageBase64/ImageUrl cannot coexist.
	ImageUrl *string `json:"ImageUrl,omitnil,omitempty" name:"ImageUrl"`

	// Multi-Perspective model image. reference value for viewing angle:.
	// left view.
	// right view.
	// back view.
	// 
	// Each viewing angle allows only one image.
	// Image size limit: must not exceed 8M after encoding.
	// Image resolution limitation: specifies the unilateral resolution should be less than 5000 and greater than 128.
	// ●Supported image format: JPG or PNG
	MultiViewImages []*ViewImage `json:"MultiViewImages,omitnil,omitempty" name:"MultiViewImages"`

	// Specifies whether PBR material generation is enabled, false by default.
	EnablePBR *bool `json:"EnablePBR,omitnil,omitempty" name:"EnablePBR"`

	// Specifies the face count of the generated 3D model. default value is 500000.
	// Specifies the supported face count range. value range: 40000-1500000.
	FaceCount *int64 `json:"FaceCount,omitnil,omitempty" name:"FaceCount"`

	// Generation task type. default: Normal. valid values:.
	// Generates a textured geometry model.
	// LowPoly: specifies whether to generate a model with smart polygon reduction.
	// Geometry: specifies whether to generate a Geometry model without texture (white model). when this task is selected, the EnablePBR parameter does not take effect.
	// Sketch: enter a Sketch or line art to generate a model. in this mode, prompt and ImageUrl/ImageBase64 can be input together.
	GenerateType *string `json:"GenerateType,omitnil,omitempty" name:"GenerateType"`

	// This parameter only takes effect when LowPoly mode is selected from GenerateType.
	// 
	// Polygon type, indicates the model surface is composed of polygon grids, defaults to triangle. valid values:.
	// Specifies the triangle face.
	// quadrilateral: generates a mix of quadrangle and triangle faces.
	PolygonType *string `json:"PolygonType,omitnil,omitempty" name:"PolygonType"`
}

type SubmitHunyuanTo3DProJobRequest struct {
	*tchttp.BaseRequest
	
	// Generates 3D content, describes 3D content, chinese forward prompt content.
	// Supports up to 1024 utf-8 characters.
	// Text-To-3D. specifies image, image_url, or prompt is required. prompt and image/image_url cannot coexist.
	Prompt *string `json:"Prompt,omitnil,omitempty" name:"Prompt"`

	// Enter the Base64 code of the image.
	// Size: specifies the unilateral resolution requirement, not less than 128 and not greater than 5000. size should not exceed 8m (after encoding, it increases by about 30%, recommend actual input image size no more than 6m).
	// Valid values: jpg, png, jpeg, webp.
	// ImageBase64, ImageUrl, or Prompt is required. Prompt and ImageBase64/ImageUrl cannot coexist.
	ImageBase64 *string `json:"ImageBase64,omitnil,omitempty" name:"ImageBase64"`

	// Input image Url.
	// Size: specifies the unilateral resolution requirement, not less than 128 and not greater than 5000. size should not exceed 8m (after encoding, it increases by about 30%, recommend actual input image size no more than 6m).
	// Valid values: jpg, png, jpeg, webp.
	// Specifies either ImageBase64/ImageUrl or Prompt is required. Prompt and ImageBase64/ImageUrl cannot coexist.
	ImageUrl *string `json:"ImageUrl,omitnil,omitempty" name:"ImageUrl"`

	// Multi-Perspective model image. reference value for viewing angle:.
	// left view.
	// right view.
	// back view.
	// 
	// Each viewing angle allows only one image.
	// Image size limit: must not exceed 8M after encoding.
	// Image resolution limitation: specifies the unilateral resolution should be less than 5000 and greater than 128.
	// ●Supported image format: JPG or PNG
	MultiViewImages []*ViewImage `json:"MultiViewImages,omitnil,omitempty" name:"MultiViewImages"`

	// Specifies whether PBR material generation is enabled, false by default.
	EnablePBR *bool `json:"EnablePBR,omitnil,omitempty" name:"EnablePBR"`

	// Specifies the face count of the generated 3D model. default value is 500000.
	// Specifies the supported face count range. value range: 40000-1500000.
	FaceCount *int64 `json:"FaceCount,omitnil,omitempty" name:"FaceCount"`

	// Generation task type. default: Normal. valid values:.
	// Generates a textured geometry model.
	// LowPoly: specifies whether to generate a model with smart polygon reduction.
	// Geometry: specifies whether to generate a Geometry model without texture (white model). when this task is selected, the EnablePBR parameter does not take effect.
	// Sketch: enter a Sketch or line art to generate a model. in this mode, prompt and ImageUrl/ImageBase64 can be input together.
	GenerateType *string `json:"GenerateType,omitnil,omitempty" name:"GenerateType"`

	// This parameter only takes effect when LowPoly mode is selected from GenerateType.
	// 
	// Polygon type, indicates the model surface is composed of polygon grids, defaults to triangle. valid values:.
	// Specifies the triangle face.
	// quadrilateral: generates a mix of quadrangle and triangle faces.
	PolygonType *string `json:"PolygonType,omitnil,omitempty" name:"PolygonType"`
}

func (r *SubmitHunyuanTo3DProJobRequest) 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 *SubmitHunyuanTo3DProJobRequest) FromJsonString(s string) error {
	f := make(map[string]interface{})
	if err := json.Unmarshal([]byte(s), &f); err != nil {
		return err
	}
	delete(f, "Prompt")
	delete(f, "ImageBase64")
	delete(f, "ImageUrl")
	delete(f, "MultiViewImages")
	delete(f, "EnablePBR")
	delete(f, "FaceCount")
	delete(f, "GenerateType")
	delete(f, "PolygonType")
	if len(f) > 0 {
		return tcerr.NewTencentCloudSDKError("ClientError.BuildRequestError", "SubmitHunyuanTo3DProJobRequest has unknown keys!", "")
	}
	return json.Unmarshal([]byte(s), &r)
}

// Predefined struct for user
type SubmitHunyuanTo3DProJobResponseParams struct {
	// Task ID (valid period: 24 hours).
	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 SubmitHunyuanTo3DProJobResponse struct {
	*tchttp.BaseResponse
	Response *SubmitHunyuanTo3DProJobResponseParams `json:"Response"`
}

func (r *SubmitHunyuanTo3DProJobResponse) 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 *SubmitHunyuanTo3DProJobResponse) FromJsonString(s string) error {
	return json.Unmarshal([]byte(s), &r)
}

type ViewImage struct {
	// Viewing angle type.
	// Valid values: back, left, right.
	ViewType *string `json:"ViewType,omitnil,omitempty" name:"ViewType"`

	// Image Url.
	ViewImageUrl *string `json:"ViewImageUrl,omitnil,omitempty" name:"ViewImageUrl"`

	// base64 image address.
	ViewImageBase64 *string `json:"ViewImageBase64,omitnil,omitempty" name:"ViewImageBase64"`
}