-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmetadata.py
More file actions
82 lines (80 loc) · 2.61 KB
/
metadata.py
File metadata and controls
82 lines (80 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
from slack_sdk.models.metadata import (
EntityMetadata,
EntityType,
ExternalRef,
EntityPayload,
EntityAttributes,
EntityTitle,
TaskEntityFields,
EntityStringField,
EntityTitle,
EntityAttributes,
TaskEntityFields,
EntityStringField,
EntityEditSupport,
EntityCustomField,
ExternalRef,
EntityFullSizePreview
)
# Update the URL here to match your app's domain
sample_task_unfurl_url = "https://work-objects-python.com/task"
sample_file_unfurl_url = "https://work-objects-python.com/file"
sample_entities = {
sample_task_unfurl_url: EntityMetadata(
entity_type="slack#/entities/task",
url=sample_task_unfurl_url,
app_unfurl_url=sample_task_unfurl_url,
external_ref=ExternalRef(id="sample_task_id"),
entity_payload=EntityPayload(
attributes=EntityAttributes(
title=EntityTitle(
text="My Task",
edit=EntityEditSupport(enabled=True),
)
),
fields=TaskEntityFields(
description=EntityStringField(
value="Hello World!",
edit=EntityEditSupport(enabled=True)
)
),
custom_fields=[
EntityCustomField(
key="hello-world",
label="hello-world",
value="hello-world",
type="string",
)
],
),
),
sample_file_unfurl_url: EntityMetadata(
entity_type="slack#/entities/file",
url=sample_file_unfurl_url,
app_unfurl_url=sample_file_unfurl_url,
external_ref=ExternalRef(id="sample_task_id"),
entity_payload=EntityPayload(
attributes=EntityAttributes(
full_size_preview=EntityFullSizePreview(is_supported=True, preview_url="https://muertoscoffeeco.com/cdn/shop/articles/Why-Roast-Coffee-scaled_1000x.jpg?v=1592234291"),
title=EntityTitle(
text="My File",
edit=EntityEditSupport(enabled=True),
)
),
fields=TaskEntityFields(
description=EntityStringField(
value="Hello World!",
edit=EntityEditSupport(enabled=True)
)
),
custom_fields=[
EntityCustomField(
key="hello-world",
label="hello-world",
value="hello-world",
type="string",
)
],
),
)
}