Skip to content

Commit 219543f

Browse files
committed
add isSearchable property to attribute model
1 parent ad0920a commit 219543f

3 files changed

Lines changed: 19 additions & 9 deletions

File tree

identify/main/identify_sync_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ def create_attribute_for_traffic_type(self, traffic_type_id, attr_data):
7878
traffic_type_id,
7979
attr_data.get('displayName'),
8080
attr_data.get('description'),
81-
attr_data.get('dataType')
81+
attr_data.get('dataType'),
82+
attr_data.get('isSearchable')
8283
)
8384

8485
def delete_attribute_from_schema(self, traffic_type_id, attribute_id):

identify/resources/attribute.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,20 @@ class Attribute(BaseResource):
5050
'trafficTypeId': 'string',
5151
'displayName': 'string',
5252
'description': 'string',
53-
'dataType': 'string'
53+
'dataType': 'string',
54+
'isSearchable': 'string',
5455
}
5556

5657
def __init__(self, client, id, traffic_type_id, display_name=None,
57-
description=None, data_type=None):
58+
description=None, data_type=None, is_searchable=None):
5859
'''
5960
'''
6061
BaseResource.__init__(self, client, id)
6162
self._traffic_type_id = traffic_type_id
6263
self._display_name = display_name
6364
self._description = description
6465
self._data_type = data_type
66+
self._is_searchable = is_searchable
6567

6668
@property
6769
def id(self):
@@ -83,6 +85,10 @@ def description(self):
8385
def data_type(self):
8486
return self._data_type
8587

88+
@property
89+
def is_searchable(self):
90+
return self._is_searchable
91+
8692
@classmethod
8793
def _build_single_from_collection_response(cls, client, response):
8894
'''
@@ -93,12 +99,13 @@ def _build_single_from_collection_response(cls, client, response):
9399
response['trafficTypeId'],
94100
response['displayName'],
95101
response['description'],
96-
response['dataType']
102+
response['dataType'],
103+
response.get('isSearchable')
97104
)
98105

99106
@classmethod
100107
def create(cls, client, id, traffic_type_id, display_name, description,
101-
data_type):
108+
data_type, is_searchable):
102109
'''
103110
'''
104111
# TODO: Validate!
@@ -110,6 +117,7 @@ def create(cls, client, id, traffic_type_id, display_name, description,
110117
'trafficTypeId': traffic_type_id,
111118
'displayName': display_name,
112119
'description': description,
120+
'isSearchable': is_searchable,
113121
'dataType': None if data_type is None else data_type.upper()
114122
},
115123
trafficTypeId=traffic_type_id
@@ -121,7 +129,8 @@ def create(cls, client, id, traffic_type_id, display_name, description,
121129
response['trafficTypeId'],
122130
response['displayName'],
123131
response['description'],
124-
response['dataType']
132+
response['dataType'],
133+
response.get('isSearchable')
125134
)
126135

127136
except HTTPResponseError as e:

identify/resources/identity.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def create(cls, client, key, traffic_type_id, environment_id, values):
144144
)
145145

146146
@classmethod
147-
def create_many(cls, client, traffic_type_id, environment_id, entities):
147+
def create_many(cls, client, traffic_type_id, environment_id, identities):
148148
'''
149149
entities: { key: { attr_id: value, ...} }
150150
'''
@@ -157,9 +157,9 @@ def create_many(cls, client, traffic_type_id, environment_id, entities):
157157
'key': key,
158158
'trafficTypeId': traffic_type_id,
159159
'environmentId': environment_id,
160-
'values': entities[key]
160+
'values': identities[key]
161161
}
162-
for key in entities.keys()
162+
for key in identities.keys()
163163
],
164164
trafficTypeId=traffic_type_id,
165165
environmentId=environment_id

0 commit comments

Comments
 (0)