package com.heyu.api.alibaba.handle.facebody;


import com.aliyun.facebody20191230.models.PedestrianDetectAttributeRequest;
import com.aliyun.facebody20191230.models.PedestrianDetectAttributeResponse;
import com.aliyun.teautil.models.RuntimeOptions;
import com.heyu.api.data.annotation.CustomPath;
import com.heyu.api.alibaba.AlibabaBaseHandle;
import com.heyu.api.alibaba.request.facebody.APedestrianDetectAttributeRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * https://next.api.aliyun.com/api/facebody/2019-12-30/PedestrianDetectAttribute
 * 人体结构化属性
 */
@Component
@Slf4j
@CustomPath("pedestrianDetectAttribute")
public class APedestrianDetectAttributeHandle extends AlibabaBaseHandle<APedestrianDetectAttributeRequest, PedestrianDetectAttributeResponse> {


    @Autowired
    private com.aliyun.facebody20191230.Client client;

    @Override
    public String check(APedestrianDetectAttributeRequest aPedestrianDetectAttributeRequest) {
        return checkUrlBase64(aPedestrianDetectAttributeRequest);
    }

    @Override
    public PedestrianDetectAttributeResponse run(APedestrianDetectAttributeRequest aPedestrianDetectAttributeRequest, RuntimeOptions runtime) throws Exception {
        PedestrianDetectAttributeRequest pedestrianDetectAttributeRequest =new PedestrianDetectAttributeRequest();
        pedestrianDetectAttributeRequest.setImageURL(aPedestrianDetectAttributeRequest.getImageUrl());
        // 复制代码运行请自行打印 API 的返回值
        return client.pedestrianDetectAttributeWithOptions(pedestrianDetectAttributeRequest, runtime);
    }
}
