@@ -45,8 +45,8 @@ class Applications(PlivoResourceInterface):
4545 _resource_type = Application
4646
4747 @validate_args (
48- answer_url = [is_url ()],
4948 app_name = [of_type (six .text_type )],
49+ answer_url = [optional (is_url ())],
5050 answer_method = [optional (of_type (six .text_type ))],
5151 hangup_url = [optional (is_url ())],
5252 hangup_method = [optional (of_type (six .text_type ))],
@@ -60,8 +60,8 @@ class Applications(PlivoResourceInterface):
6060 log_incoming_messages = [optional (of_type_exact (bool ))],
6161 public_uri = [optional (of_type_exact (bool ))])
6262 def create (self ,
63- answer_url ,
6463 app_name ,
64+ answer_url = None ,
6565 answer_method = 'POST' ,
6666 hangup_url = None ,
6767 hangup_method = 'POST' ,
@@ -110,8 +110,8 @@ def list(self, subaccount=None, limit=20, offset=0):
110110 objects_type = Application , is_voice_request = True )
111111
112112 @validate_args (
113- answer_url = [is_url ()],
114113 app_id = [of_type (six .text_type )],
114+ answer_url = [optional (is_url ())],
115115 answer_method = [optional (of_type (six .text_type ))],
116116 hangup_url = [optional (is_url ())],
117117 hangup_method = [optional (of_type (six .text_type ))],
@@ -126,7 +126,7 @@ def list(self, subaccount=None, limit=20, offset=0):
126126 public_uri = [optional (of_type_exact (bool ))])
127127 def update (self ,
128128 app_id ,
129- answer_url ,
129+ answer_url = None ,
130130 answer_method = 'POST' ,
131131 hangup_url = None ,
132132 hangup_method = 'POST' ,
@@ -142,8 +142,28 @@ def update(self,
142142 if subaccount :
143143 if isinstance (subaccount , Subaccount ):
144144 subaccount = subaccount .id
145+
146+ # using localVariablesObject insteadof locals() because we need to remove app_id
147+ # as there is no support to update app_id, there is no way to remove an variable from locals() dictionary
148+ localVariablesObject = {
149+ 'self' : self ,
150+ 'answer_url' : answer_url ,
151+ 'answer_method' : answer_method ,
152+ 'hangup_url' : hangup_url ,
153+ 'hangup_method' : hangup_method ,
154+ 'fallback_answer_url' : fallback_answer_url ,
155+ 'fallback_method' : fallback_method ,
156+ 'message_url' : message_url ,
157+ 'message_method' : message_method ,
158+ 'default_number_app' : default_number_app ,
159+ 'default_endpoint_app' : default_endpoint_app ,
160+ 'subaccount' : subaccount ,
161+ 'log_incoming_messages' : log_incoming_messages ,
162+ 'public_uri' : public_uri
163+ }
164+
145165 return self .client .request ('POST' , ('Application' , app_id ),
146- to_param_dict (self .update , locals () ), is_voice_request = True )
166+ to_param_dict (self .update , localVariablesObject ), is_voice_request = True )
147167
148168 @validate_args (
149169 app_id = [of_type (six .text_type )],
0 commit comments