@@ -46,9 +46,10 @@ public function getRecord(string $id, string $moduleAPIName, ParameterMap $para
46
46
* @param string $id A string
47
47
* @param string $moduleAPIName A string
48
48
* @param BodyWrapper $request An instance of BodyWrapper
49
+ * @param HeaderMap $headerInstance An instance of HeaderMap
49
50
* @return APIResponse An instance of APIResponse
50
51
*/
51
- public function updateRecord (string $ id , string $ moduleAPIName , BodyWrapper $ request )
52
+ public function updateRecord (string $ id , string $ moduleAPIName , BodyWrapper $ request, HeaderMap $ headerInstance = null )
52
53
{
53
54
$ handlerInstance =new CommonAPIHandler ();
54
55
$ apiPath ="" ;
@@ -61,6 +62,7 @@ public function updateRecord(string $id, string $moduleAPIName, BodyWrapper $re
61
62
$ handlerInstance ->setCategoryMethod (Constants::REQUEST_CATEGORY_UPDATE );
62
63
$ handlerInstance ->setContentType ('application/json ' );
63
64
$ handlerInstance ->setRequest ($ request );
65
+ $ handlerInstance ->setHeader ($ headerInstance );
64
66
Utility::getFields ($ moduleAPIName );
65
67
$ handlerInstance ->setModuleAPIName ($ moduleAPIName );
66
68
return $ handlerInstance ->apiCall (ActionHandler::class, 'application/json ' );
@@ -72,9 +74,10 @@ public function updateRecord(string $id, string $moduleAPIName, BodyWrapper $re
72
74
* @param string $id A string
73
75
* @param string $moduleAPIName A string
74
76
* @param ParameterMap $paramInstance An instance of ParameterMap
77
+ * @param HeaderMap $headerInstance An instance of HeaderMap
75
78
* @return APIResponse An instance of APIResponse
76
79
*/
77
- public function deleteRecord (string $ id , string $ moduleAPIName , ParameterMap $ paramInstance =null )
80
+ public function deleteRecord (string $ id , string $ moduleAPIName , ParameterMap $ paramInstance =null , HeaderMap $ headerInstance = null )
78
81
{
79
82
$ handlerInstance =new CommonAPIHandler ();
80
83
$ apiPath ="" ;
@@ -86,6 +89,7 @@ public function deleteRecord(string $id, string $moduleAPIName, ParameterMap $p
86
89
$ handlerInstance ->setHttpMethod (Constants::REQUEST_METHOD_DELETE );
87
90
$ handlerInstance ->setCategoryMethod (Constants::REQUEST_METHOD_DELETE );
88
91
$ handlerInstance ->setParam ($ paramInstance );
92
+ $ handlerInstance ->setHeader ($ headerInstance );
89
93
return $ handlerInstance ->apiCall (ActionHandler::class, 'application/json ' );
90
94
91
95
}
@@ -142,9 +146,10 @@ public function createRecords(string $moduleAPIName, BodyWrapper $request)
142
146
* The method to update records
143
147
* @param string $moduleAPIName A string
144
148
* @param BodyWrapper $request An instance of BodyWrapper
149
+ * @param HeaderMap $headerInstance An instance of HeaderMap
145
150
* @return APIResponse An instance of APIResponse
146
151
*/
147
- public function updateRecords (string $ moduleAPIName , BodyWrapper $ request )
152
+ public function updateRecords (string $ moduleAPIName , BodyWrapper $ request, HeaderMap $ headerInstance = null )
148
153
{
149
154
$ handlerInstance =new CommonAPIHandler ();
150
155
$ apiPath ="" ;
@@ -156,6 +161,7 @@ public function updateRecords(string $moduleAPIName, BodyWrapper $request)
156
161
$ handlerInstance ->setContentType ('application/json ' );
157
162
$ handlerInstance ->setRequest ($ request );
158
163
$ handlerInstance ->setMandatoryChecker (true );
164
+ $ handlerInstance ->setHeader ($ headerInstance );
159
165
Utility::getFields ($ moduleAPIName );
160
166
$ handlerInstance ->setModuleAPIName ($ moduleAPIName );
161
167
return $ handlerInstance ->apiCall (ActionHandler::class, 'application/json ' );
@@ -166,9 +172,10 @@ public function updateRecords(string $moduleAPIName, BodyWrapper $request)
166
172
* The method to delete records
167
173
* @param string $moduleAPIName A string
168
174
* @param ParameterMap $paramInstance An instance of ParameterMap
175
+ * @param HeaderMap $headerInstance An instance of HeaderMap
169
176
* @return APIResponse An instance of APIResponse
170
177
*/
171
- public function deleteRecords (string $ moduleAPIName , ParameterMap $ paramInstance =null )
178
+ public function deleteRecords (string $ moduleAPIName , ParameterMap $ paramInstance =null , HeaderMap $ headerInstance = null )
172
179
{
173
180
$ handlerInstance =new CommonAPIHandler ();
174
181
$ apiPath ="" ;
@@ -178,6 +185,7 @@ public function deleteRecords(string $moduleAPIName, ParameterMap $paramInstanc
178
185
$ handlerInstance ->setHttpMethod (Constants::REQUEST_METHOD_DELETE );
179
186
$ handlerInstance ->setCategoryMethod (Constants::REQUEST_METHOD_DELETE );
180
187
$ handlerInstance ->setParam ($ paramInstance );
188
+ $ handlerInstance ->setHeader ($ headerInstance );
181
189
return $ handlerInstance ->apiCall (ActionHandler::class, 'application/json ' );
182
190
183
191
}
@@ -186,9 +194,10 @@ public function deleteRecords(string $moduleAPIName, ParameterMap $paramInstanc
186
194
* The method to upsert records
187
195
* @param string $moduleAPIName A string
188
196
* @param BodyWrapper $request An instance of BodyWrapper
197
+ * @param HeaderMap $headerInstance An instance of HeaderMap
189
198
* @return APIResponse An instance of APIResponse
190
199
*/
191
- public function upsertRecords (string $ moduleAPIName , BodyWrapper $ request )
200
+ public function upsertRecords (string $ moduleAPIName , BodyWrapper $ request, HeaderMap $ headerInstance = null )
192
201
{
193
202
$ handlerInstance =new CommonAPIHandler ();
194
203
$ apiPath ="" ;
@@ -200,6 +209,7 @@ public function upsertRecords(string $moduleAPIName, BodyWrapper $request)
200
209
$ handlerInstance ->setCategoryMethod (Constants::REQUEST_CATEGORY_ACTION );
201
210
$ handlerInstance ->setContentType ('application/json ' );
202
211
$ handlerInstance ->setRequest ($ request );
212
+ $ handlerInstance ->setHeader ($ headerInstance );
203
213
Utility::getFields ($ moduleAPIName );
204
214
$ handlerInstance ->setModuleAPIName ($ moduleAPIName );
205
215
return $ handlerInstance ->apiCall (ActionHandler::class, 'application/json ' );
@@ -233,9 +243,10 @@ public function getDeletedRecords(string $moduleAPIName, ParameterMap $paramIns
233
243
* The method to search records
234
244
* @param string $moduleAPIName A string
235
245
* @param ParameterMap $paramInstance An instance of ParameterMap
246
+ * @param HeaderMap $headerInstance An instance of HeaderMap
236
247
* @return APIResponse An instance of APIResponse
237
248
*/
238
- public function searchRecords (string $ moduleAPIName , ParameterMap $ paramInstance =null )
249
+ public function searchRecords (string $ moduleAPIName , ParameterMap $ paramInstance =null , HeaderMap $ headerInstance = null )
239
250
{
240
251
$ handlerInstance =new CommonAPIHandler ();
241
252
$ apiPath ="" ;
@@ -246,6 +257,7 @@ public function searchRecords(string $moduleAPIName, ParameterMap $paramInstanc
246
257
$ handlerInstance ->setHttpMethod (Constants::REQUEST_METHOD_GET );
247
258
$ handlerInstance ->setCategoryMethod (Constants::REQUEST_CATEGORY_READ );
248
259
$ handlerInstance ->setParam ($ paramInstance );
260
+ $ handlerInstance ->setHeader ($ headerInstance );
249
261
Utility::getFields ($ moduleAPIName );
250
262
$ handlerInstance ->setModuleAPIName ($ moduleAPIName );
251
263
return $ handlerInstance ->apiCall (ResponseHandler::class, 'application/json ' );
0 commit comments