-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBrowseCarouselCardItem.py
More file actions
76 lines (60 loc) · 1.96 KB
/
Copy pathBrowseCarouselCardItem.py
File metadata and controls
76 lines (60 loc) · 1.96 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
from DialogFlowPy import UrlTypeHint
from DialogFlowPy.Image import Image
from DialogFlowPy.OpenUrlAction import OpenUrlAction
class BrowseCarouselCardItem(dict):
"""
{
'openUrIAction': {
object(OpenUrlAction)
},
'title': string,
'description': string,
'image': {
object(Image)
},
'footer': string
}
"""
def __init__(self, open_uri_action: OpenUrlAction, title: str, description: str, image: Image, footer: str):
super(BrowseCarouselCardItem, self).__init__()
self['openUriAction'] = open_uri_action
self['footer'] = footer
self['image'] = image
self['title'] = title
self['description'] = description
@property
def open_uri_action(self):
return self.get('openUriAction')
@open_uri_action.setter
def open_uri_action(self, open_uri_action: OpenUrlAction):
self['openUriAction'] = open_uri_action
def add_open_uri_action(self, url: str, url_type_hint: UrlTypeHint):
self.open_uri_action = OpenUrlAction(url=url, url_type_hint=url_type_hint)
return self.open_uri_action
@property
def title(self):
return self.get('title')
@title.setter
def title(self, title: str):
self['title'] = title
@property
def description(self):
return self.get('description')
@description.setter
def description(self, description):
self['description'] = description
@property
def image(self):
return self.get('image')
@image.setter
def image(self, image: Image):
self['image'] = image
def add_image(self, image_uri: str, accessibility_text: str = '') -> Image:
self['image'] = Image(image_uri=image_uri, accessibility_text=accessibility_text)
return self['image']
@property
def footer(self):
return self.get('footer')
@footer.setter
def footer(self, footer: str):
self['footer'] = footer