// Code generated by Lark OpenAPI.

package larkverification

import (
	"context"
	"github.com/larksuite/oapi-sdk-go/v3/core"
	"net/http"
)

type V1 struct {
	Verification *verification // 认证信息
}

func New(config *larkcore.Config) *V1 {
	return &V1{
		Verification: &verification{config: config},
	}
}

type verification struct {
	config *larkcore.Config
}

// Get 获取认证信息
//
// - 获取企业主体名称、是否认证等信息。
//
// - 官网API文档链接:https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/verification-v1/verification/get
//
// - 使用Demo链接:https://github.com/larksuite/oapi-sdk-go/tree/v3_main/sample/apiall/verificationv1/get_verification.go
func (v *verification) Get(ctx context.Context, options ...larkcore.RequestOptionFunc) (*GetVerificationResp, error) {
	// 发起请求
	apiReq := &larkcore.ApiReq{
		PathParams:  larkcore.PathParams{},
		QueryParams: larkcore.QueryParams{},
	}
	apiReq.ApiPath = "/open-apis/verification/v1/verification"
	apiReq.HttpMethod = http.MethodGet
	apiReq.SupportedAccessTokenTypes = []larkcore.AccessTokenType{larkcore.AccessTokenTypeTenant}
	apiResp, err := larkcore.Request(ctx, apiReq, v.config, options...)
	if err != nil {
		return nil, err
	}
	// 反序列响应结果
	resp := &GetVerificationResp{ApiResp: apiResp}
	err = apiResp.JSONUnmarshalBody(resp, v.config)
	if err != nil {
		return nil, err
	}
	return resp, err
}
