@@ -74,19 +74,23 @@ def get_conversation(self, dialog_id, date_from, date_to):
74
74
return self .request (method = 'GET' , url = '/v1/dialogs/{}/conversation' .format (dialog_id ), params = params ,
75
75
accept_json = True )
76
76
77
- def get_profile (self , dialog_id , client_id ):
77
+ def get_profile (self , dialog_id , client_id , name = None ):
78
78
dialog_id = self .unpack_id (dialog_id , 'dialog_id' )
79
79
client_id = self .unpack_id (client_id , 'client_id' )
80
- params = {'client_id' : client_id }
80
+ params = {'client_id' : client_id , 'name' : name }
81
81
return self .request (method = 'GET' , url = '/v1/dialogs/{}/profile' .format (dialog_id ), params = params ,
82
82
accept_json = True )
83
83
84
- def update_profile (self , dialog_id , client_id , name_values ):
84
+ def update_profile (self , dialog_id , name_values , client_id = None ):
85
85
dialog_id = self .unpack_id (dialog_id , 'dialog_id' )
86
86
client_id = self .unpack_id (client_id , 'client_id' )
87
- params = {'client_id' : client_id }
88
- return self .request (method = 'PUT' , url = '/v1/dialogs/{}/profile' .format (dialog_id ), params = params ,
89
- json = name_values , accept_json = True )
87
+ if isinstance (name_values , dict ):
88
+ name_values = list ({'name' : item [0 ], 'value' : item [1 ]} for item in name_values .items ())
89
+ params = {
90
+ 'client_id' : client_id ,
91
+ 'name_values' : name_values
92
+ }
93
+ return self .request (method = 'PUT' , url = '/v1/dialogs/{}/profile' .format (dialog_id ), json = params , accept_json = True )
90
94
91
95
def delete_dialog (self , dialog_id ):
92
96
dialog_id = self .unpack_id (dialog_id , 'dialog_id' )
0 commit comments