# Code generated by lark_sdk_gen. DO NOT EDIT.

from pylark.lark_request import RawRequestReq, _new_method_option
import attr
import typing
import io


@attr.s
class GetApplicationOrderReq(object):
    order_id: str = attr.ib(default="", metadata={"req_type": "query"})  # 订单ID


@attr.s
class GetApplicationOrderRespOrder(object):
    order_id: str = attr.ib(default="", metadata={"req_type": "json"})  # 订单ID，唯一标识
    price_plan_id: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 价格方案ID，唯一标识
    price_plan_type: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 价格方案类型 "trial" -试用；"permanent"-一次性付费；"per_year"-企业年付费；"per_month"-企业月付费；"per_seat_per_year"-按人按年付费；"per_seat_per_month"-按人按月付费；"permanent_count"-按次付费；
    seats: int = attr.ib(
        default=0, metadata={"req_type": "json"}
    )  # 实际购买人数 仅对price_plan_type为per_seat_per_year和per_seat_per_month 有效
    buy_count: int = attr.ib(default=0, metadata={"req_type": "json"})  # 购买数量 总是为1
    create_time: str = attr.ib(default="", metadata={"req_type": "json"})  # 订单创建时间戳
    pay_time: str = attr.ib(default="", metadata={"req_type": "json"})  # 订单支付时间戳
    status: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 订单当前状态，"normal" -正常；"refund"-已退款；
    buy_type: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 购买类型，"buy" - 普通购买;"upgrade"-为升级购买(仅price_plan_type 为per_year，per_month，per_seat_per_year，per_seat_per_month时可升级购买);"renew" - 续费购买；
    src_order_id: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 源订单ID，当前订单为升级购买时，即buy_type为upgrade时，此字段记录源订单等ID
    dst_order_id: str = attr.ib(
        default="", metadata={"req_type": "json"}
    )  # 升级后的新订单ID，当前订单如果做过升级购买，此字段记录升级购买后生成的新订单ID，当前订单仍然有效
    order_pay_price: int = attr.ib(
        default=0, metadata={"req_type": "json"}
    )  # 订单实际支付金额, 单位分
    tenant_key: str = attr.ib(default="", metadata={"req_type": "json"})  # 租户唯一标识


@attr.s
class GetApplicationOrderResp(object):
    order: GetApplicationOrderRespOrder = attr.ib(
        default=None, metadata={"req_type": "json"}
    )  # 订单信息


def _gen_get_application_order_req(request, options) -> RawRequestReq:
    return RawRequestReq(
        dataclass=GetApplicationOrderResp,
        scope="Application",
        api="GetApplicationOrder",
        method="GET",
        url="https://open.feishu.cn/open-apis/pay/v1/order/get",
        body=request,
        method_option=_new_method_option(options),
        need_tenant_access_token=True,
    )
