Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] Add some Enum types #57

Open
BeautyyuYanli opened this issue Nov 29, 2023 · 0 comments
Open

[feature request] Add some Enum types #57

BeautyyuYanli opened this issue Nov 29, 2023 · 0 comments

Comments

@BeautyyuYanli
Copy link

I'm using docx.v1.ListDocumentBlockRequest to get a docx.v1.Block. Then I'd like to write:

def get_text_block_by_type(block: docx.v1.Block) -> docx.v1.Text:
    name = FeishuBlockType(block.block_type).name
    value = block.__getattribute__(name)
    if isinstance(value, docx.v1.Text):
        return value
    else:
        return None

class FeishuBlockType(Enum):
    page = 1
    text = 2
    heading1 = 3
    heading2 = 4
    heading3 = 5
    heading4 = 6
    heading5 = 7
    heading6 = 8
    heading7 = 9
    heading8 = 10
    heading9 = 11
    bullet = 12
    ordered = 13
    code = 14
    quote = 15
    equation = 16
    todo = 17
    bitable = 18
    callout = 19
    chat_card = 20
    uml_diagram = 21
    divider = 22
    file = 23
    grid = 24
    grid_column = 25
    iframe = 26
    image = 27
    isv = 28
    mindnote = 29
    sheet = 30
    table = 31
    table_cell = 32
    view = 33
    quote_container = 34
    task = 35
    okr = 36
    okr_objective = 37
    okr_key_result = 38
    okr_progress = 39
    add_ons = 40
    jira_issue = 41
    wiki_catalog = 42

I belive it will be useful for developers to have the Enum types in lark_oapi , perticularly the fields like:

image
image
image

Relate to https://open.feishu.cn/document/server-docs/docs/docs/docx-v1/document/list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant