""" Code is generated by ucloud-model, DO NOT EDIT IT. """


from ucloud.core.typesystem import schema, fields
from ucloud.services.ubill.schemas import models

""" UBill API Schema
"""


"""
API: GetBalance

获取账户余额
"""


class GetBalanceRequestSchema(schema.RequestSchema):
    """GetBalance - 获取账户余额"""

    fields = {}


class GetBalanceResponseSchema(schema.ResponseSchema):
    """GetBalance - 获取账户余额"""

    fields = {
        "AccountInfo": models.AccountInfoSchema(),
    }


"""
API: GetBillDataFileUrl

生成账单数据文件下载的 url
"""


class GetBillDataFileUrlRequestSchema(schema.RequestSchema):
    """GetBillDataFileUrl - 生成账单数据文件下载的 url"""

    fields = {
        "BillPeriod": fields.Int(required=False, dump_to="BillPeriod"),
        "BillType": fields.Int(required=True, dump_to="BillType"),
        "BillingCycle": fields.Str(required=True, dump_to="BillingCycle"),
        "PaidType": fields.Int(required=False, dump_to="PaidType"),
        "RequireVersion": fields.Str(required=False, dump_to="RequireVersion"),
        "Version": fields.Str(required=False, dump_to="Version"),
    }


class GetBillDataFileUrlResponseSchema(schema.ResponseSchema):
    """GetBillDataFileUrl - 生成账单数据文件下载的 url"""

    fields = {
        "FileUrl": fields.Str(required=False, load_from="FileUrl"),
        "IsValid": fields.Str(required=False, load_from="IsValid"),
    }


"""
API: ListUBillDetail

获取某个账期内的所有消费。
"""


class ListUBillDetailRequestSchema(schema.RequestSchema):
    """ListUBillDetail - 获取某个账期内的所有消费。"""

    fields = {
        "BillingCycle": fields.Str(required=True, dump_to="BillingCycle"),
        "ChargeType": fields.Str(required=False, dump_to="ChargeType"),
        "Limit": fields.Int(required=False, dump_to="Limit"),
        "Offset": fields.Int(required=False, dump_to="Offset"),
        "OrderType": fields.Str(required=False, dump_to="OrderType"),
        "PaidState": fields.Int(required=False, dump_to="PaidState"),
        "ProjectName": fields.Str(required=False, dump_to="ProjectName"),
        "ResourceIds": fields.List(fields.Str()),
        "ResourceTypes": fields.List(fields.Str()),
        "ShowZero": fields.Int(required=False, dump_to="ShowZero"),
        "UserEmail": fields.Str(required=False, dump_to="UserEmail"),
    }


class ListUBillDetailResponseSchema(schema.ResponseSchema):
    """ListUBillDetail - 获取某个账期内的所有消费。"""

    fields = {
        "Items": fields.List(
            models.BillDetailItemSchema(), required=True, load_from="Items"
        ),
        "TotalCount": fields.Int(required=True, load_from="TotalCount"),
    }


"""
API: ListUBillOverview

账单总览。可按产品/项目/用户纬度获取某个账期内账单总览信息。
"""


class ListUBillOverviewRequestSchema(schema.RequestSchema):
    """ListUBillOverview - 账单总览。可按产品/项目/用户纬度获取某个账期内账单总览信息。"""

    fields = {
        "BillingCycle": fields.Str(required=True, dump_to="BillingCycle"),
        "Dimension": fields.Str(required=True, dump_to="Dimension"),
        "HideUnpaid": fields.Int(required=False, dump_to="HideUnpaid"),
    }


class ListUBillOverviewResponseSchema(schema.ResponseSchema):
    """ListUBillOverview - 账单总览。可按产品/项目/用户纬度获取某个账期内账单总览信息。"""

    fields = {
        "Items": fields.List(
            models.BillOverviewItemSchema(), required=True, load_from="Items"
        ),
        "TotalCount": fields.Int(required=True, load_from="TotalCount"),
        "TotalPaidAmount": fields.Str(
            required=False, load_from="TotalPaidAmount"
        ),
        "TotalPaidAmountReal": fields.Str(
            required=False, load_from="TotalPaidAmountReal"
        ),
        "TotalUnpaidAmount": fields.Str(
            required=False, load_from="TotalUnpaidAmount"
        ),
    }
