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

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 AssessDeviceRiskPremiumProRequestParams struct {
	// <p>Device fingerprint token, obtained after integration of the device fingerprint SDK into your website or application</p>
	DeviceToken *string `json:"DeviceToken,omitnil,omitempty" name:"DeviceToken"`

	// <p>User client IP address(IPv4 or IPv6)</p>
	UserIp *string `json:"UserIp,omitnil,omitempty" name:"UserIp"`
}

type AssessDeviceRiskPremiumProRequest struct {
	*tchttp.BaseRequest
	
	// <p>Device fingerprint token, obtained after integration of the device fingerprint SDK into your website or application</p>
	DeviceToken *string `json:"DeviceToken,omitnil,omitempty" name:"DeviceToken"`

	// <p>User client IP address(IPv4 or IPv6)</p>
	UserIp *string `json:"UserIp,omitnil,omitempty" name:"UserIp"`
}

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

// Predefined struct for user
type AssessDeviceRiskPremiumProResponseParams struct {
	// <p>The results of AssessDeviceRiskPremiumPro</p>
	Data *AssessDeviceRiskPremiumRsp `json:"Data,omitnil,omitempty" name:"Data"`

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

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

type AssessDeviceRiskPremiumRsp struct {
	// <p>Decision information</p>
	Decision *Decision `json:"Decision,omitnil,omitempty" name:"Decision"`

	// <p>The risk score information of the device</p>
	Score *DataScore `json:"Score,omitnil,omitempty" name:"Score"`

	// <p>The basic information of the device</p>
	Device *Device `json:"Device,omitnil,omitempty" name:"Device"`

	// <p>Basic IP environment information</p>
	// Note: This field may return null, indicating that no valid values can be obtained.
	Environment *Environment `json:"Environment,omitnil,omitempty" name:"Environment"`
}

// Predefined struct for user
type AssessDeviceRiskProRequestParams struct {
	// <p>Device fingerprint token, obtained after integration of the device fingerprint SDK into your website or application</p>
	DeviceToken *string `json:"DeviceToken,omitnil,omitempty" name:"DeviceToken"`

	// <p>User client IP address(IPv4 or IPv6)</p>
	UserIp *string `json:"UserIp,omitnil,omitempty" name:"UserIp"`
}

type AssessDeviceRiskProRequest struct {
	*tchttp.BaseRequest
	
	// <p>Device fingerprint token, obtained after integration of the device fingerprint SDK into your website or application</p>
	DeviceToken *string `json:"DeviceToken,omitnil,omitempty" name:"DeviceToken"`

	// <p>User client IP address(IPv4 or IPv6)</p>
	UserIp *string `json:"UserIp,omitnil,omitempty" name:"UserIp"`
}

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

// Predefined struct for user
type AssessDeviceRiskProResponseParams struct {
	// <p>The results of AssessDeviceRiskPro</p>
	Data *AssessDeviceRiskRsp `json:"Data,omitnil,omitempty" name:"Data"`

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

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

type AssessDeviceRiskRsp struct {
	// <p>The risk score information of the device</p>
	Score *DataScore `json:"Score,omitnil,omitempty" name:"Score"`

	// <p>The basic information of the device</p>
	Device *Device `json:"Device,omitnil,omitempty" name:"Device"`
}

// Predefined struct for user
type AssessEnvironmentRiskRequestParams struct {
	// <p>User client IP address(IPv4 or IPv6)</p>
	UserIp *string `json:"UserIp,omitnil,omitempty" name:"UserIp"`
}

type AssessEnvironmentRiskRequest struct {
	*tchttp.BaseRequest
	
	// <p>User client IP address(IPv4 or IPv6)</p>
	UserIp *string `json:"UserIp,omitnil,omitempty" name:"UserIp"`
}

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

// Predefined struct for user
type AssessEnvironmentRiskResponseParams struct {
	// <p>The results of AssessEnvironmentRisk</p>
	Data *AssessEnvironmentRiskRsp `json:"Data,omitnil,omitempty" name:"Data"`

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

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

type AssessEnvironmentRiskRsp struct {
	// <p>The risk score information of the IP environment</p>
	Score *DataScore `json:"Score,omitnil,omitempty" name:"Score"`

	// <p>The basic information of the IP environment</p>
	Environment *Environment `json:"Environment,omitnil,omitempty" name:"Environment"`
}

type DataScore struct {
	// <p>Risk level</p>
	RiskLevel *int64 `json:"RiskLevel,omitnil,omitempty" name:"RiskLevel"`

	// <p>Risk label</p>
	RiskLabels []*RiskLabel `json:"RiskLabels,omitnil,omitempty" name:"RiskLabels"`
}

type Decision struct {
	// <p>Decision result</p><ul><li>pass: Pass</li><li>review: Review</li><li>reject: Reject</li></ul>
	DecisionResult *string `json:"DecisionResult,omitnil,omitempty" name:"DecisionResult"`
}

type Device struct {
	// <p>The unique id of device returned by RCE</p>
	DeviceId *string `json:"DeviceId,omitnil,omitempty" name:"DeviceId"`

	// <p>The version of the application</p>
	AppVersion *string `json:"AppVersion,omitnil,omitempty" name:"AppVersion"`

	// <p>Device brand</p>
	Brand *string `json:"Brand,omitnil,omitempty" name:"Brand"`

	// <p>Client IP address</p>
	ClientIp *string `json:"ClientIp,omitnil,omitempty" name:"ClientIp"`

	// <p>Device model</p>
	Model *string `json:"Model,omitnil,omitempty" name:"Model"`

	// <p>Network type of the device</p>
	NetworkType *string `json:"NetworkType,omitnil,omitempty" name:"NetworkType"`

	// <p>The package name of the application</p>
	PackageName *string `json:"PackageName,omitnil,omitempty" name:"PackageName"`

	// <p>Device platform</p><p>Enumeration value:</p><ul><li>2: Android</li><li>3: IOS</li><li>4: H5</li><li>5: WeChat Mini Program</li></ul>
	Platform *string `json:"Platform,omitnil,omitempty" name:"Platform"`

	// <p>Device system version</p>
	SystemVersion *string `json:"SystemVersion,omitnil,omitempty" name:"SystemVersion"`

	// <p>The build version of SDK</p>
	SdkBuildVersion *string `json:"SdkBuildVersion,omitnil,omitempty" name:"SdkBuildVersion"`
}

type Environment struct {
	// <p>The geographical location of the IP address</p>
	Location *IPLocation `json:"Location,omitnil,omitempty" name:"Location"`

	// <p>The basic IP network information</p>
	Network *IPNetwork `json:"Network,omitnil,omitempty" name:"Network"`
}

type IPLocation struct {
	// <p>The country of the IP address</p>
	Country *string `json:"Country,omitnil,omitempty" name:"Country"`

	// <p>The region of the IP address</p>
	Region *string `json:"Region,omitnil,omitempty" name:"Region"`

	// <p>The city of the IP address</p>
	City *string `json:"City,omitnil,omitempty" name:"City"`

	// <p>The district of the IP address</p>
	District *string `json:"District,omitnil,omitempty" name:"District"`

	// <p>The longitude of the IP address</p>
	Longitude *string `json:"Longitude,omitnil,omitempty" name:"Longitude"`

	// <p>The latitude of the IP address</p>
	Latitude *string `json:"Latitude,omitnil,omitempty" name:"Latitude"`

	// <p>The timezone of the IP address</p>
	Timezone *string `json:"Timezone,omitnil,omitempty" name:"Timezone"`

	// <p>The zip code of the IP address</p>
	ZipCode *string `json:"ZipCode,omitnil,omitempty" name:"ZipCode"`
}

type IPNetwork struct {
	// <p>Internet service provider</p>
	ISP *string `json:"ISP,omitnil,omitempty" name:"ISP"`

	// <p>Autonomous system number</p>
	ASN *string `json:"ASN,omitnil,omitempty" name:"ASN"`

	// <p>IP registration organization name</p>
	Organization *string `json:"Organization,omitnil,omitempty" name:"Organization"`

	// <p>Whether it is a reserved IP address</p>
	IsReserved *bool `json:"IsReserved,omitnil,omitempty" name:"IsReserved"`

	// <p>Whether it is a gateway IP address</p>
	IsGateway *bool `json:"IsGateway,omitnil,omitempty" name:"IsGateway"`

	// <p>Whether it belongs to an anycast network</p>
	IsAnycast *bool `json:"IsAnycast,omitnil,omitempty" name:"IsAnycast"`

	// <p>Whether it is from a mobile network</p>
	IsMobile *bool `json:"IsMobile,omitnil,omitempty" name:"IsMobile"`

	// <p>Whether it is a dynamic IP address</p>
	IsDynamic *bool `json:"IsDynamic,omitnil,omitempty" name:"IsDynamic"`

	// <p>Whether it is a network egress</p>
	IsEgress *bool `json:"IsEgress,omitnil,omitempty" name:"IsEgress"`

	// <p>Whether it is used for domain name resolution</p>
	IsDNS *bool `json:"IsDNS,omitnil,omitempty" name:"IsDNS"`

	// <p>Whether it is an educational institution</p>
	IsEducation *bool `json:"IsEducation,omitnil,omitempty" name:"IsEducation"`

	// <p>Whether it is an organization</p>
	IsInstitution *bool `json:"IsInstitution,omitnil,omitempty" name:"IsInstitution"`

	// <p>Whether it is an enterprise dedicated line</p>
	IsCompany *bool `json:"IsCompany,omitnil,omitempty" name:"IsCompany"`

	// <p>Whether it is a residence broadband connection</p>
	IsResidence *bool `json:"IsResidence,omitnil,omitempty" name:"IsResidence"`

	// <p>Whether it is cloud service</p>
	IsCloudService *bool `json:"IsCloudService,omitnil,omitempty" name:"IsCloudService"`

	// <p>Whether it is infrastructure</p>
	IsInfrastructure *bool `json:"IsInfrastructure,omitnil,omitempty" name:"IsInfrastructure"`

	// <p>Whether it is an mail exchange service</p>
	IsMXServer *bool `json:"IsMXServer,omitnil,omitempty" name:"IsMXServer"`
}

type RiskLabel struct {
	// <p>The ID of the label</p>
	Id *string `json:"Id,omitnil,omitempty" name:"Id"`

	// <p>The reason of the label</p>
	Reason *string `json:"Reason,omitnil,omitempty" name:"Reason"`
}