From 709117f5933c2e51397afe270bbed84395a78847 Mon Sep 17 00:00:00 2001 From: Eric Durand-Tremblay Date: Wed, 16 Sep 2020 16:28:31 -0400 Subject: [PATCH] Equisoft/connect 9.23 --- .gitignore | 2 +- README.md | 11 +- docs/Api/EventsApi.md | 132 +- docs/Api/TasksApi.md | 132 +- docs/Model/GatewaysCredentials.md | 1 + docs/Model/GatewaysCredentialsWithSsn.md | 1 + docs/Model/InternalNotesCreateNoteResponse.md | 2 +- docs/Model/InternalNotesNote.md | 2 +- docs/Model/InternalNotesPatchNoteResponse.md | 2 +- docs/Model/LegacyContactContactPayloadItem.md | 2 + .../LegacyContactContactPayloadItemAllOf.md | 2 + lib/Api/EventsApi.php | 1615 +++++++++-------- lib/Api/GatewaysApi.php | 55 +- lib/Api/LegacyDocumentApi.php | 88 +- lib/Api/LegacyProvisioningApi.php | 22 +- lib/Api/MovementApi.php | 55 +- lib/Api/TasksApi.php | 1218 +++++++------ lib/Api/UsersApi.php | 11 +- lib/Model/GatewaysCredentials.php | 40 +- lib/Model/GatewaysCredentialsWithSsn.php | 30 + lib/Model/InternalNotesCreateNoteResponse.php | 6 +- lib/Model/InternalNotesNote.php | 7 +- lib/Model/InternalNotesNoteRevisionType.php | 4 +- lib/Model/InternalNotesPatchNoteResponse.php | 6 +- lib/Model/LegacyContactContactPayloadItem.php | 70 +- .../LegacyContactContactPayloadItemAllOf.php | 70 +- test/Api/EventsApiTest.php | 20 +- test/Api/TasksApiTest.php | 20 +- test/Model/GatewaysCredentialsTest.php | 7 + test/Model/GatewaysCredentialsWithSsnTest.php | 7 + ...gacyContactContactPayloadItemAllOfTest.php | 14 + .../LegacyContactContactPayloadItemTest.php | 14 + 32 files changed, 2016 insertions(+), 1652 deletions(-) diff --git a/.gitignore b/.gitignore index e2316dd4..92f7fdef 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,7 @@ composer.phar # Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file -composer.lock +# composer.lock # php-cs-fixer cache .php_cs.cache diff --git a/README.md b/README.md index de540a7c..d099f139 100644 --- a/README.md +++ b/README.md @@ -70,14 +70,15 @@ $apiInstance = new Equisoft\SDK\EquisoftConnect\Api\EventsApi( new GuzzleHttp\Client(), $config ); -$eventsCreateEventPayload = new \Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventPayload(); // \Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventPayload | +$eventId = 'eventId_example'; // string | Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. +$noteId = 56; // int | Note unique identifier. $acceptLanguage = 'acceptLanguage_example'; // string | Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 try { - $result = $apiInstance->createEvent($eventsCreateEventPayload, $acceptLanguage); + $result = $apiInstance->archiveEventInternalNote($eventId, $noteId, $acceptLanguage); print_r($result); } catch (Exception $e) { - echo 'Exception when calling EventsApi->createEvent: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling EventsApi->archiveEventInternalNote: ', $e->getMessage(), PHP_EOL; } ?> @@ -89,6 +90,7 @@ All URIs are relative to *http://localhost* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*EventsApi* | [**archiveEventInternalNote**](docs/Api/EventsApi.md#archiveeventinternalnote) | **POST** /crm/api/v1/events/{eventId}/notes/{noteId}/archive | Archive an internal note for and event. *EventsApi* | [**createEvent**](docs/Api/EventsApi.md#createevent) | **POST** /crm/api/v1/events | Create an event. *EventsApi* | [**createEventInternalNote**](docs/Api/EventsApi.md#createeventinternalnote) | **POST** /crm/api/v1/events/{eventId}/notes | Add an internal note to and event. *EventsApi* | [**deleteEvent**](docs/Api/EventsApi.md#deleteevent) | **DELETE** /crm/api/v1/events/{eventId} | Delete an event. @@ -100,7 +102,6 @@ Class | Method | HTTP request | Description *EventsApi* | [**listEvents**](docs/Api/EventsApi.md#listevents) | **GET** /crm/api/v1/events | List or search events. *EventsApi* | [**patchEvent**](docs/Api/EventsApi.md#patchevent) | **PATCH** /crm/api/v1/events/{eventId} | Partially update an event. *EventsApi* | [**patchEventInternalNote**](docs/Api/EventsApi.md#patcheventinternalnote) | **PATCH** /crm/api/v1/events/{eventId}/notes/{noteId} | Add an internal note to and event. -*EventsApi* | [**softDeleteEventInternalNote**](docs/Api/EventsApi.md#softdeleteeventinternalnote) | **POST** /crm/api/v1/events/{eventId}/notes/{noteId}/softDelete | Soft delete an internal note for and event. *EventsApi* | [**transferEventToCompleted**](docs/Api/EventsApi.md#transfereventtocompleted) | **POST** /crm/api/v1/events/{eventId}/transferToCompleted | Transfer an event to the completed/done calendar. *GatewaysApi* | [**createEquisoftAnalyzeAccess**](docs/Api/GatewaysApi.md#createequisoftanalyzeaccess) | **POST** /crm/api/v1/gateways/equisoftAnalyze/accesses | *GatewaysApi* | [**deleteEquisoftAnalyzeAccess**](docs/Api/GatewaysApi.md#deleteequisoftanalyzeaccess) | **DELETE** /crm/api/v1/gateways/equisoftAnalyze/accesses/{accessId} | @@ -122,6 +123,7 @@ Class | Method | HTTP request | Description *MovementApi* | [**deleteMovement**](docs/Api/MovementApi.md#deletemovement) | **DELETE** /crm/api/v1/movements/{movementId} | *MovementApi* | [**getMovementStatus**](docs/Api/MovementApi.md#getmovementstatus) | **GET** /crm/api/v1/movements/{movementId}/status | *MovementApi* | [**listMovements**](docs/Api/MovementApi.md#listmovements) | **GET** /crm/api/v1/movements | +*TasksApi* | [**archiveTaskInternalNote**](docs/Api/TasksApi.md#archivetaskinternalnote) | **POST** /crm/api/v1/tasks/{taskId}/notes/{noteId}/archive | Archive an internal note for a task. *TasksApi* | [**createTask**](docs/Api/TasksApi.md#createtask) | **POST** /crm/api/v1/tasks | Create a task. *TasksApi* | [**createTaskInternalNote**](docs/Api/TasksApi.md#createtaskinternalnote) | **POST** /crm/api/v1/tasks/{taskId}/notes | Add an internal note to a task. *TasksApi* | [**deleteTask**](docs/Api/TasksApi.md#deletetask) | **DELETE** /crm/api/v1/tasks/{taskId} | Delete a task. @@ -130,7 +132,6 @@ Class | Method | HTTP request | Description *TasksApi* | [**listTasks**](docs/Api/TasksApi.md#listtasks) | **GET** /crm/api/v1/tasks | List or search tasks. *TasksApi* | [**patchTask**](docs/Api/TasksApi.md#patchtask) | **PATCH** /crm/api/v1/tasks/{taskId} | Partially update a task. *TasksApi* | [**patchTaskInternalNote**](docs/Api/TasksApi.md#patchtaskinternalnote) | **PATCH** /crm/api/v1/tasks/{taskId}/notes/{noteId} | Add an internal note to a task. -*TasksApi* | [**softDeleteTaskInternalNote**](docs/Api/TasksApi.md#softdeletetaskinternalnote) | **POST** /crm/api/v1/tasks/{taskId}/notes/{noteId}/softDelete | Soft delete an internal note for a task. *TasksApi* | [**transferTaskToCompleted**](docs/Api/TasksApi.md#transfertasktocompleted) | **POST** /crm/api/v1/tasks/{taskId}/transferToCompleted | Transfer a task to completed/done. *UsersApi* | [**getCurrentUser**](docs/Api/UsersApi.md#getcurrentuser) | **GET** /crm/api/v1/users/me | Get informations about the current user diff --git a/docs/Api/EventsApi.md b/docs/Api/EventsApi.md index d3245503..ec8664b7 100644 --- a/docs/Api/EventsApi.md +++ b/docs/Api/EventsApi.md @@ -4,6 +4,7 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- +[**archiveEventInternalNote**](EventsApi.md#archiveEventInternalNote) | **POST** /crm/api/v1/events/{eventId}/notes/{noteId}/archive | Archive an internal note for and event. [**createEvent**](EventsApi.md#createEvent) | **POST** /crm/api/v1/events | Create an event. [**createEventInternalNote**](EventsApi.md#createEventInternalNote) | **POST** /crm/api/v1/events/{eventId}/notes | Add an internal note to and event. [**deleteEvent**](EventsApi.md#deleteEvent) | **DELETE** /crm/api/v1/events/{eventId} | Delete an event. @@ -15,11 +16,73 @@ Method | HTTP request | Description [**listEvents**](EventsApi.md#listEvents) | **GET** /crm/api/v1/events | List or search events. [**patchEvent**](EventsApi.md#patchEvent) | **PATCH** /crm/api/v1/events/{eventId} | Partially update an event. [**patchEventInternalNote**](EventsApi.md#patchEventInternalNote) | **PATCH** /crm/api/v1/events/{eventId}/notes/{noteId} | Add an internal note to and event. -[**softDeleteEventInternalNote**](EventsApi.md#softDeleteEventInternalNote) | **POST** /crm/api/v1/events/{eventId}/notes/{noteId}/softDelete | Soft delete an internal note for and event. [**transferEventToCompleted**](EventsApi.md#transferEventToCompleted) | **POST** /crm/api/v1/events/{eventId}/transferToCompleted | Transfer an event to the completed/done calendar. +## archiveEventInternalNote + +> object archiveEventInternalNote($eventId, $noteId, $acceptLanguage) + +Archive an internal note for and event. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Equisoft\SDK\EquisoftConnect\Api\EventsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$eventId = 'eventId_example'; // string | Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. +$noteId = 56; // int | Note unique identifier. +$acceptLanguage = 'acceptLanguage_example'; // string | Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 + +try { + $result = $apiInstance->archiveEventInternalNote($eventId, $noteId, $acceptLanguage); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EventsApi->archiveEventInternalNote: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **eventId** | **string**| Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. | + **noteId** | **int**| Note unique identifier. | + **acceptLanguage** | **string**| Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 | [optional] + +### Return type + +**object** + +### Authorization + +[OAuth2](../../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## createEvent > \Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventResponse createEvent($eventsCreateEventPayload, $acceptLanguage) @@ -686,7 +749,7 @@ $apiInstance = new Equisoft\SDK\EquisoftConnect\Api\EventsApi( $config ); $eventId = 'eventId_example'; // string | Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. -$noteId = 'noteId_example'; // string | Note unique identifier. +$noteId = 56; // int | Note unique identifier. $internalNotesPatchNotePayload = new \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload(); // \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload | $acceptLanguage = 'acceptLanguage_example'; // string | Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 @@ -705,7 +768,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **eventId** | **string**| Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. | - **noteId** | **string**| Note unique identifier. | + **noteId** | **int**| Note unique identifier. | **internalNotesPatchNotePayload** | [**\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload**](../Model/InternalNotesPatchNotePayload.md)| | **acceptLanguage** | **string**| Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 | [optional] @@ -727,69 +790,6 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## softDeleteEventInternalNote - -> object softDeleteEventInternalNote($eventId, $noteId, $acceptLanguage) - -Soft delete an internal note for and event. - -### Example - -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - - -$apiInstance = new Equisoft\SDK\EquisoftConnect\Api\EventsApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$eventId = 'eventId_example'; // string | Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. -$noteId = 'noteId_example'; // string | Note unique identifier. -$acceptLanguage = 'acceptLanguage_example'; // string | Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 - -try { - $result = $apiInstance->softDeleteEventInternalNote($eventId, $noteId, $acceptLanguage); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling EventsApi->softDeleteEventInternalNote: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **eventId** | **string**| Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. | - **noteId** | **string**| Note unique identifier. | - **acceptLanguage** | **string**| Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 | [optional] - -### Return type - -**object** - -### Authorization - -[OAuth2](../../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - ## transferEventToCompleted > \Equisoft\SDK\EquisoftConnect\Model\EventsTransferToCompletedResponse transferEventToCompleted($eventId) diff --git a/docs/Api/TasksApi.md b/docs/Api/TasksApi.md index 13de19b0..b9b065d0 100644 --- a/docs/Api/TasksApi.md +++ b/docs/Api/TasksApi.md @@ -4,6 +4,7 @@ All URIs are relative to *http://localhost* Method | HTTP request | Description ------------- | ------------- | ------------- +[**archiveTaskInternalNote**](TasksApi.md#archiveTaskInternalNote) | **POST** /crm/api/v1/tasks/{taskId}/notes/{noteId}/archive | Archive an internal note for a task. [**createTask**](TasksApi.md#createTask) | **POST** /crm/api/v1/tasks | Create a task. [**createTaskInternalNote**](TasksApi.md#createTaskInternalNote) | **POST** /crm/api/v1/tasks/{taskId}/notes | Add an internal note to a task. [**deleteTask**](TasksApi.md#deleteTask) | **DELETE** /crm/api/v1/tasks/{taskId} | Delete a task. @@ -12,11 +13,73 @@ Method | HTTP request | Description [**listTasks**](TasksApi.md#listTasks) | **GET** /crm/api/v1/tasks | List or search tasks. [**patchTask**](TasksApi.md#patchTask) | **PATCH** /crm/api/v1/tasks/{taskId} | Partially update a task. [**patchTaskInternalNote**](TasksApi.md#patchTaskInternalNote) | **PATCH** /crm/api/v1/tasks/{taskId}/notes/{noteId} | Add an internal note to a task. -[**softDeleteTaskInternalNote**](TasksApi.md#softDeleteTaskInternalNote) | **POST** /crm/api/v1/tasks/{taskId}/notes/{noteId}/softDelete | Soft delete an internal note for a task. [**transferTaskToCompleted**](TasksApi.md#transferTaskToCompleted) | **POST** /crm/api/v1/tasks/{taskId}/transferToCompleted | Transfer a task to completed/done. +## archiveTaskInternalNote + +> object archiveTaskInternalNote($taskId, $noteId, $acceptLanguage) + +Archive an internal note for a task. + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new Equisoft\SDK\EquisoftConnect\Api\TasksApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$taskId = 'taskId_example'; // string | Task unique identifier. +$noteId = 56; // int | Note unique identifier. +$acceptLanguage = 'acceptLanguage_example'; // string | Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 + +try { + $result = $apiInstance->archiveTaskInternalNote($taskId, $noteId, $acceptLanguage); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling TasksApi->archiveTaskInternalNote: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **taskId** | **string**| Task unique identifier. | + **noteId** | **int**| Note unique identifier. | + **acceptLanguage** | **string**| Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 | [optional] + +### Return type + +**object** + +### Authorization + +[OAuth2](../../README.md#OAuth2) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + + ## createTask > \Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskResponse createTask($tasksCreateTaskPayload, $acceptLanguage) @@ -488,7 +551,7 @@ $apiInstance = new Equisoft\SDK\EquisoftConnect\Api\TasksApi( $config ); $taskId = 'taskId_example'; // string | Task unique identifier. -$noteId = 'noteId_example'; // string | Note unique identifier. +$noteId = 56; // int | Note unique identifier. $internalNotesPatchNotePayload = new \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload(); // \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload | $acceptLanguage = 'acceptLanguage_example'; // string | Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 @@ -507,7 +570,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **taskId** | **string**| Task unique identifier. | - **noteId** | **string**| Note unique identifier. | + **noteId** | **int**| Note unique identifier. | **internalNotesPatchNotePayload** | [**\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload**](../Model/InternalNotesPatchNotePayload.md)| | **acceptLanguage** | **string**| Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 | [optional] @@ -529,69 +592,6 @@ Name | Type | Description | Notes [[Back to README]](../../README.md) -## softDeleteTaskInternalNote - -> object softDeleteTaskInternalNote($taskId, $noteId, $acceptLanguage) - -Soft delete an internal note for a task. - -### Example - -```php -setAccessToken('YOUR_ACCESS_TOKEN'); - - -$apiInstance = new Equisoft\SDK\EquisoftConnect\Api\TasksApi( - // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. - // This is optional, `GuzzleHttp\Client` will be used as default. - new GuzzleHttp\Client(), - $config -); -$taskId = 'taskId_example'; // string | Task unique identifier. -$noteId = 'noteId_example'; // string | Note unique identifier. -$acceptLanguage = 'acceptLanguage_example'; // string | Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 - -try { - $result = $apiInstance->softDeleteTaskInternalNote($taskId, $noteId, $acceptLanguage); - print_r($result); -} catch (Exception $e) { - echo 'Exception when calling TasksApi->softDeleteTaskInternalNote: ', $e->getMessage(), PHP_EOL; -} -?> -``` - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **taskId** | **string**| Task unique identifier. | - **noteId** | **string**| Note unique identifier. | - **acceptLanguage** | **string**| Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 | [optional] - -### Return type - -**object** - -### Authorization - -[OAuth2](../../README.md#OAuth2) - -### HTTP request headers - -- **Content-Type**: Not defined -- **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../../README.md#documentation-for-api-endpoints) -[[Back to Model list]](../../README.md#documentation-for-models) -[[Back to README]](../../README.md) - - ## transferTaskToCompleted > \Equisoft\SDK\EquisoftConnect\Model\TasksTransferToCompletedResponse transferTaskToCompleted($taskId) diff --git a/docs/Model/GatewaysCredentials.md b/docs/Model/GatewaysCredentials.md index 72b5e69c..0e5ab301 100644 --- a/docs/Model/GatewaysCredentials.md +++ b/docs/Model/GatewaysCredentials.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **username** | **string** | | **password** | **string** | | +**isADealerCode** | **bool** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/GatewaysCredentialsWithSsn.md b/docs/Model/GatewaysCredentialsWithSsn.md index 4a00bab5..42cd9c12 100644 --- a/docs/Model/GatewaysCredentialsWithSsn.md +++ b/docs/Model/GatewaysCredentialsWithSsn.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **username** | **string** | | **password** | **string** | | +**isADealerCode** | **bool** | | [optional] **ssnList** | **string[]** | The list will contain formatted SSNs, i.e. \"123 456 789\" | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InternalNotesCreateNoteResponse.md b/docs/Model/InternalNotesCreateNoteResponse.md index ebf7e774..6a6dd80f 100644 --- a/docs/Model/InternalNotesCreateNoteResponse.md +++ b/docs/Model/InternalNotesCreateNoteResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | Unique numerical identifier of the created note. | +**id** | **int** | Unique numerical identifier of the created note. | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/InternalNotesNote.md b/docs/Model/InternalNotesNote.md index 8eac8135..94d54200 100644 --- a/docs/Model/InternalNotesNote.md +++ b/docs/Model/InternalNotesNote.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **int** | Unique numerical identifier. | [optional] +**id** | **int** | Unique numerical identifier. | **author** | [**\Equisoft\SDK\EquisoftConnect\Model\InternalNotesAuthor**](InternalNotesAuthor.md) | | **firstRevisionCreatedAt** | [**\DateTime**](\DateTime.md) | | **accessRights** | [**\Equisoft\SDK\EquisoftConnect\Model\AccessRights**](AccessRights.md) | | diff --git a/docs/Model/InternalNotesPatchNoteResponse.md b/docs/Model/InternalNotesPatchNoteResponse.md index 1e00b91b..3367d9fc 100644 --- a/docs/Model/InternalNotesPatchNoteResponse.md +++ b/docs/Model/InternalNotesPatchNoteResponse.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **string** | Unique numerical identifier of the note. | +**id** | **int** | Unique numerical identifier of the note. | [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LegacyContactContactPayloadItem.md b/docs/Model/LegacyContactContactPayloadItem.md index 9efc4e95..38bb254a 100644 --- a/docs/Model/LegacyContactContactPayloadItem.md +++ b/docs/Model/LegacyContactContactPayloadItem.md @@ -59,6 +59,8 @@ Name | Type | Description | Notes **orgIdNo** | **string** | | [optional] **orgFedNo** | **string** | | [optional] **orgProvNo** | **string** | | [optional] +**orgStateId** | **string** | | [optional] +**orgEin** | **string** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/docs/Model/LegacyContactContactPayloadItemAllOf.md b/docs/Model/LegacyContactContactPayloadItemAllOf.md index b1bc30d5..972746b5 100644 --- a/docs/Model/LegacyContactContactPayloadItemAllOf.md +++ b/docs/Model/LegacyContactContactPayloadItemAllOf.md @@ -47,6 +47,8 @@ Name | Type | Description | Notes **orgIdNo** | **string** | | [optional] **orgFedNo** | **string** | | [optional] **orgProvNo** | **string** | | [optional] +**orgStateId** | **string** | | [optional] +**orgEin** | **string** | | [optional] [[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md) diff --git a/lib/Api/EventsApi.php b/lib/Api/EventsApi.php index 63cd0c03..445b2e60 100644 --- a/lib/Api/EventsApi.php +++ b/lib/Api/EventsApi.php @@ -116,38 +116,40 @@ public function getConfig() } /** - * Operation createEvent + * Operation archiveEventInternalNote * - * Create an event. + * Archive an internal note for and event. * - * @param \Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventPayload $eventsCreateEventPayload eventsCreateEventPayload (required) + * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param int $noteId Note unique identifier. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return object|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function createEvent($eventsCreateEventPayload, $acceptLanguage = null) + public function archiveEventInternalNote($eventId, $noteId, $acceptLanguage = null) { - list($response) = $this->createEventWithHttpInfo($eventsCreateEventPayload, $acceptLanguage); + list($response) = $this->archiveEventInternalNoteWithHttpInfo($eventId, $noteId, $acceptLanguage); return $response; } /** - * Operation createEventWithHttpInfo + * Operation archiveEventInternalNoteWithHttpInfo * - * Create an event. + * Archive an internal note for and event. * - * @param \Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventPayload $eventsCreateEventPayload (required) + * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param int $noteId Note unique identifier. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of object|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function createEventWithHttpInfo($eventsCreateEventPayload, $acceptLanguage = null) + public function archiveEventInternalNoteWithHttpInfo($eventId, $noteId, $acceptLanguage = null) { - $request = $this->createEventRequest($eventsCreateEventPayload, $acceptLanguage); + $request = $this->archiveEventInternalNoteRequest($eventId, $noteId, $acceptLanguage); try { $options = $this->createHttpClientOption(); @@ -180,18 +182,18 @@ public function createEventWithHttpInfo($eventsCreateEventPayload, $acceptLangua $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventResponse' === '\SplFileObject') { + if ('object' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventResponse', []), + ObjectSerializer::deserialize($content, 'object', []), $response->getStatusCode(), $response->getHeaders() ]; - case 400: + case 401: if ('\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -203,7 +205,7 @@ public function createEventWithHttpInfo($eventsCreateEventPayload, $acceptLangua $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 404: if ('\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -229,7 +231,7 @@ public function createEventWithHttpInfo($eventsCreateEventPayload, $acceptLangua ]; } - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventResponse'; + $returnType = 'object'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -248,12 +250,12 @@ public function createEventWithHttpInfo($eventsCreateEventPayload, $acceptLangua case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventResponse', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 400: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse', @@ -261,7 +263,7 @@ public function createEventWithHttpInfo($eventsCreateEventPayload, $acceptLangua ); $e->setResponseObject($data); break; - case 401: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse', @@ -283,19 +285,20 @@ public function createEventWithHttpInfo($eventsCreateEventPayload, $acceptLangua } /** - * Operation createEventAsync + * Operation archiveEventInternalNoteAsync * - * Create an event. + * Archive an internal note for and event. * - * @param \Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventPayload $eventsCreateEventPayload (required) + * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param int $noteId Note unique identifier. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createEventAsync($eventsCreateEventPayload, $acceptLanguage = null) + public function archiveEventInternalNoteAsync($eventId, $noteId, $acceptLanguage = null) { - return $this->createEventAsyncWithHttpInfo($eventsCreateEventPayload, $acceptLanguage) + return $this->archiveEventInternalNoteAsyncWithHttpInfo($eventId, $noteId, $acceptLanguage) ->then( function ($response) { return $response[0]; @@ -304,20 +307,21 @@ function ($response) { } /** - * Operation createEventAsyncWithHttpInfo + * Operation archiveEventInternalNoteAsyncWithHttpInfo * - * Create an event. + * Archive an internal note for and event. * - * @param \Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventPayload $eventsCreateEventPayload (required) + * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param int $noteId Note unique identifier. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createEventAsyncWithHttpInfo($eventsCreateEventPayload, $acceptLanguage = null) + public function archiveEventInternalNoteAsyncWithHttpInfo($eventId, $noteId, $acceptLanguage = null) { - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventResponse'; - $request = $this->createEventRequest($eventsCreateEventPayload, $acceptLanguage); + $returnType = 'object'; + $request = $this->archiveEventInternalNoteRequest($eventId, $noteId, $acceptLanguage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -354,24 +358,31 @@ function ($exception) { } /** - * Create request for operation 'createEvent' + * Create request for operation 'archiveEventInternalNote' * - * @param \Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventPayload $eventsCreateEventPayload (required) + * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param int $noteId Note unique identifier. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createEventRequest($eventsCreateEventPayload, $acceptLanguage = null) + protected function archiveEventInternalNoteRequest($eventId, $noteId, $acceptLanguage = null) { - // verify the required parameter 'eventsCreateEventPayload' is set - if ($eventsCreateEventPayload === null || (is_array($eventsCreateEventPayload) && count($eventsCreateEventPayload) === 0)) { + // verify the required parameter 'eventId' is set + if ($eventId === null || (is_array($eventId) && count($eventId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $eventsCreateEventPayload when calling createEvent' + 'Missing the required parameter $eventId when calling archiveEventInternalNote' + ); + } + // verify the required parameter 'noteId' is set + if ($noteId === null || (is_array($noteId) && count($noteId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $noteId when calling archiveEventInternalNote' ); } - $resourcePath = '/crm/api/v1/events'; + $resourcePath = '/crm/api/v1/events/{eventId}/notes/{noteId}/archive'; $formParams = []; $queryParams = []; $headerParams = []; @@ -384,12 +395,25 @@ protected function createEventRequest($eventsCreateEventPayload, $acceptLanguage $headerParams['Accept-Language'] = ObjectSerializer::toHeaderValue($acceptLanguage); } + // path params + if ($eventId !== null) { + $resourcePath = str_replace( + '{' . 'eventId' . '}', + ObjectSerializer::toPathValue($eventId), + $resourcePath + ); + } + // path params + if ($noteId !== null) { + $resourcePath = str_replace( + '{' . 'noteId' . '}', + ObjectSerializer::toPathValue($noteId), + $resourcePath + ); + } // body params $_tempBody = null; - if (isset($eventsCreateEventPayload)) { - $_tempBody = $eventsCreateEventPayload; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -398,7 +422,7 @@ protected function createEventRequest($eventsCreateEventPayload, $acceptLanguage } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -414,10 +438,13 @@ protected function createEventRequest($eventsCreateEventPayload, $acceptLanguage if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -457,40 +484,38 @@ protected function createEventRequest($eventsCreateEventPayload, $acceptLanguage } /** - * Operation createEventInternalNote + * Operation createEvent * - * Add an internal note to and event. + * Create an event. * - * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload internalNotesCreateNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventPayload $eventsCreateEventPayload eventsCreateEventPayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return \Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function createEventInternalNote($eventId, $internalNotesCreateNotePayload, $acceptLanguage = null) + public function createEvent($eventsCreateEventPayload, $acceptLanguage = null) { - list($response) = $this->createEventInternalNoteWithHttpInfo($eventId, $internalNotesCreateNotePayload, $acceptLanguage); + list($response) = $this->createEventWithHttpInfo($eventsCreateEventPayload, $acceptLanguage); return $response; } /** - * Operation createEventInternalNoteWithHttpInfo + * Operation createEventWithHttpInfo * - * Add an internal note to and event. + * Create an event. * - * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventPayload $eventsCreateEventPayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function createEventInternalNoteWithHttpInfo($eventId, $internalNotesCreateNotePayload, $acceptLanguage = null) + public function createEventWithHttpInfo($eventsCreateEventPayload, $acceptLanguage = null) { - $request = $this->createEventInternalNoteRequest($eventId, $internalNotesCreateNotePayload, $acceptLanguage); + $request = $this->createEventRequest($eventsCreateEventPayload, $acceptLanguage); try { $options = $this->createHttpClientOption(); @@ -523,18 +548,18 @@ public function createEventInternalNoteWithHttpInfo($eventId, $internalNotesCrea $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse' === '\SplFileObject') { + if ('\Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse', []), + ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 400: if ('\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -546,7 +571,7 @@ public function createEventInternalNoteWithHttpInfo($eventId, $internalNotesCrea $response->getStatusCode(), $response->getHeaders() ]; - case 404: + case 401: if ('\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -572,7 +597,7 @@ public function createEventInternalNoteWithHttpInfo($eventId, $internalNotesCrea ]; } - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse'; + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -591,12 +616,12 @@ public function createEventInternalNoteWithHttpInfo($eventId, $internalNotesCrea case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse', + '\Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse', @@ -604,7 +629,7 @@ public function createEventInternalNoteWithHttpInfo($eventId, $internalNotesCrea ); $e->setResponseObject($data); break; - case 404: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse', @@ -626,20 +651,19 @@ public function createEventInternalNoteWithHttpInfo($eventId, $internalNotesCrea } /** - * Operation createEventInternalNoteAsync + * Operation createEventAsync * - * Add an internal note to and event. + * Create an event. * - * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventPayload $eventsCreateEventPayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createEventInternalNoteAsync($eventId, $internalNotesCreateNotePayload, $acceptLanguage = null) + public function createEventAsync($eventsCreateEventPayload, $acceptLanguage = null) { - return $this->createEventInternalNoteAsyncWithHttpInfo($eventId, $internalNotesCreateNotePayload, $acceptLanguage) + return $this->createEventAsyncWithHttpInfo($eventsCreateEventPayload, $acceptLanguage) ->then( function ($response) { return $response[0]; @@ -648,21 +672,20 @@ function ($response) { } /** - * Operation createEventInternalNoteAsyncWithHttpInfo + * Operation createEventAsyncWithHttpInfo * - * Add an internal note to and event. + * Create an event. * - * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventPayload $eventsCreateEventPayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createEventInternalNoteAsyncWithHttpInfo($eventId, $internalNotesCreateNotePayload, $acceptLanguage = null) + public function createEventAsyncWithHttpInfo($eventsCreateEventPayload, $acceptLanguage = null) { - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse'; - $request = $this->createEventInternalNoteRequest($eventId, $internalNotesCreateNotePayload, $acceptLanguage); + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventResponse'; + $request = $this->createEventRequest($eventsCreateEventPayload, $acceptLanguage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -699,31 +722,24 @@ function ($exception) { } /** - * Create request for operation 'createEventInternalNote' + * Create request for operation 'createEvent' * - * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\EventsCreateEventPayload $eventsCreateEventPayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createEventInternalNoteRequest($eventId, $internalNotesCreateNotePayload, $acceptLanguage = null) + protected function createEventRequest($eventsCreateEventPayload, $acceptLanguage = null) { - // verify the required parameter 'eventId' is set - if ($eventId === null || (is_array($eventId) && count($eventId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $eventId when calling createEventInternalNote' - ); - } - // verify the required parameter 'internalNotesCreateNotePayload' is set - if ($internalNotesCreateNotePayload === null || (is_array($internalNotesCreateNotePayload) && count($internalNotesCreateNotePayload) === 0)) { + // verify the required parameter 'eventsCreateEventPayload' is set + if ($eventsCreateEventPayload === null || (is_array($eventsCreateEventPayload) && count($eventsCreateEventPayload) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $internalNotesCreateNotePayload when calling createEventInternalNote' + 'Missing the required parameter $eventsCreateEventPayload when calling createEvent' ); } - $resourcePath = '/crm/api/v1/events/{eventId}/notes'; + $resourcePath = '/crm/api/v1/events'; $formParams = []; $queryParams = []; $headerParams = []; @@ -736,19 +752,11 @@ protected function createEventInternalNoteRequest($eventId, $internalNotesCreate $headerParams['Accept-Language'] = ObjectSerializer::toHeaderValue($acceptLanguage); } - // path params - if ($eventId !== null) { - $resourcePath = str_replace( - '{' . 'eventId' . '}', - ObjectSerializer::toPathValue($eventId), - $resourcePath - ); - } // body params $_tempBody = null; - if (isset($internalNotesCreateNotePayload)) { - $_tempBody = $internalNotesCreateNotePayload; + if (isset($eventsCreateEventPayload)) { + $_tempBody = $eventsCreateEventPayload; } if ($multipart) { @@ -774,10 +782,13 @@ protected function createEventInternalNoteRequest($eventId, $internalNotesCreate if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -817,36 +828,40 @@ protected function createEventInternalNoteRequest($eventId, $internalNotesCreate } /** - * Operation deleteEvent + * Operation createEventInternalNote * - * Delete an event. + * Add an internal note to and event. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload internalNotesCreateNotePayload (required) + * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function deleteEvent($eventId) + public function createEventInternalNote($eventId, $internalNotesCreateNotePayload, $acceptLanguage = null) { - list($response) = $this->deleteEventWithHttpInfo($eventId); + list($response) = $this->createEventInternalNoteWithHttpInfo($eventId, $internalNotesCreateNotePayload, $acceptLanguage); return $response; } /** - * Operation deleteEventWithHttpInfo + * Operation createEventInternalNoteWithHttpInfo * - * Delete an event. + * Add an internal note to and event. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload (required) + * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteEventWithHttpInfo($eventId) + public function createEventInternalNoteWithHttpInfo($eventId, $internalNotesCreateNotePayload, $acceptLanguage = null) { - $request = $this->deleteEventRequest($eventId); + $request = $this->createEventInternalNoteRequest($eventId, $internalNotesCreateNotePayload, $acceptLanguage); try { $options = $this->createHttpClientOption(); @@ -879,14 +894,14 @@ public function deleteEventWithHttpInfo($eventId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('object' === '\SplFileObject') { + if ('\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, 'object', []), + ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -928,7 +943,7 @@ public function deleteEventWithHttpInfo($eventId) ]; } - $returnType = 'object'; + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -947,7 +962,7 @@ public function deleteEventWithHttpInfo($eventId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'object', + '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -982,18 +997,20 @@ public function deleteEventWithHttpInfo($eventId) } /** - * Operation deleteEventAsync + * Operation createEventInternalNoteAsync * - * Delete an event. + * Add an internal note to and event. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload (required) + * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteEventAsync($eventId) + public function createEventInternalNoteAsync($eventId, $internalNotesCreateNotePayload, $acceptLanguage = null) { - return $this->deleteEventAsyncWithHttpInfo($eventId) + return $this->createEventInternalNoteAsyncWithHttpInfo($eventId, $internalNotesCreateNotePayload, $acceptLanguage) ->then( function ($response) { return $response[0]; @@ -1002,19 +1019,21 @@ function ($response) { } /** - * Operation deleteEventAsyncWithHttpInfo + * Operation createEventInternalNoteAsyncWithHttpInfo * - * Delete an event. + * Add an internal note to and event. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload (required) + * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteEventAsyncWithHttpInfo($eventId) + public function createEventInternalNoteAsyncWithHttpInfo($eventId, $internalNotesCreateNotePayload, $acceptLanguage = null) { - $returnType = 'object'; - $request = $this->deleteEventRequest($eventId); + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse'; + $request = $this->createEventInternalNoteRequest($eventId, $internalNotesCreateNotePayload, $acceptLanguage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1051,23 +1070,31 @@ function ($exception) { } /** - * Create request for operation 'deleteEvent' + * Create request for operation 'createEventInternalNote' * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload (required) + * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteEventRequest($eventId) + protected function createEventInternalNoteRequest($eventId, $internalNotesCreateNotePayload, $acceptLanguage = null) { // verify the required parameter 'eventId' is set if ($eventId === null || (is_array($eventId) && count($eventId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $eventId when calling deleteEvent' + 'Missing the required parameter $eventId when calling createEventInternalNote' + ); + } + // verify the required parameter 'internalNotesCreateNotePayload' is set + if ($internalNotesCreateNotePayload === null || (is_array($internalNotesCreateNotePayload) && count($internalNotesCreateNotePayload) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $internalNotesCreateNotePayload when calling createEventInternalNote' ); } - $resourcePath = '/crm/api/v1/events/{eventId}'; + $resourcePath = '/crm/api/v1/events/{eventId}/notes'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1075,7 +1102,11 @@ protected function deleteEventRequest($eventId) $multipart = false; - + // header params + if ($acceptLanguage !== null) { + $headerParams['Accept-Language'] = ObjectSerializer::toHeaderValue($acceptLanguage); + } + // path params if ($eventId !== null) { $resourcePath = str_replace( @@ -1087,6 +1118,9 @@ protected function deleteEventRequest($eventId) // body params $_tempBody = null; + if (isset($internalNotesCreateNotePayload)) { + $_tempBody = $internalNotesCreateNotePayload; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1095,7 +1129,7 @@ protected function deleteEventRequest($eventId) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -1111,10 +1145,13 @@ protected function deleteEventRequest($eventId) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1146,7 +1183,7 @@ protected function deleteEventRequest($eventId) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'DELETE', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1154,38 +1191,36 @@ protected function deleteEventRequest($eventId) } /** - * Operation getCalendar + * Operation deleteEvent * - * Get informations about a calendar or a default calendar. + * Delete an event. * - * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (required) - * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) + * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Equisoft\SDK\EquisoftConnect\Model\CalendarsCalendar|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return object|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function getCalendar($calendarId, $acceptLanguage = null) + public function deleteEvent($eventId) { - list($response) = $this->getCalendarWithHttpInfo($calendarId, $acceptLanguage); + list($response) = $this->deleteEventWithHttpInfo($eventId); return $response; } /** - * Operation getCalendarWithHttpInfo + * Operation deleteEventWithHttpInfo * - * Get informations about a calendar or a default calendar. + * Delete an event. * - * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (required) - * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) + * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Equisoft\SDK\EquisoftConnect\Model\CalendarsCalendar|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of object|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getCalendarWithHttpInfo($calendarId, $acceptLanguage = null) + public function deleteEventWithHttpInfo($eventId) { - $request = $this->getCalendarRequest($calendarId, $acceptLanguage); + $request = $this->deleteEventRequest($eventId); try { $options = $this->createHttpClientOption(); @@ -1218,14 +1253,14 @@ public function getCalendarWithHttpInfo($calendarId, $acceptLanguage = null) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Equisoft\SDK\EquisoftConnect\Model\CalendarsCalendar' === '\SplFileObject') { + if ('object' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\CalendarsCalendar', []), + ObjectSerializer::deserialize($content, 'object', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1267,7 +1302,7 @@ public function getCalendarWithHttpInfo($calendarId, $acceptLanguage = null) ]; } - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\CalendarsCalendar'; + $returnType = 'object'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1286,7 +1321,7 @@ public function getCalendarWithHttpInfo($calendarId, $acceptLanguage = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Equisoft\SDK\EquisoftConnect\Model\CalendarsCalendar', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1321,19 +1356,18 @@ public function getCalendarWithHttpInfo($calendarId, $acceptLanguage = null) } /** - * Operation getCalendarAsync + * Operation deleteEventAsync * - * Get informations about a calendar or a default calendar. + * Delete an event. * - * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (required) - * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) + * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCalendarAsync($calendarId, $acceptLanguage = null) + public function deleteEventAsync($eventId) { - return $this->getCalendarAsyncWithHttpInfo($calendarId, $acceptLanguage) + return $this->deleteEventAsyncWithHttpInfo($eventId) ->then( function ($response) { return $response[0]; @@ -1342,20 +1376,19 @@ function ($response) { } /** - * Operation getCalendarAsyncWithHttpInfo + * Operation deleteEventAsyncWithHttpInfo * - * Get informations about a calendar or a default calendar. + * Delete an event. * - * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (required) - * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) + * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getCalendarAsyncWithHttpInfo($calendarId, $acceptLanguage = null) + public function deleteEventAsyncWithHttpInfo($eventId) { - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\CalendarsCalendar'; - $request = $this->getCalendarRequest($calendarId, $acceptLanguage); + $returnType = 'object'; + $request = $this->deleteEventRequest($eventId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1392,24 +1425,23 @@ function ($exception) { } /** - * Create request for operation 'getCalendar' + * Create request for operation 'deleteEvent' * - * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (required) - * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) + * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getCalendarRequest($calendarId, $acceptLanguage = null) + protected function deleteEventRequest($eventId) { - // verify the required parameter 'calendarId' is set - if ($calendarId === null || (is_array($calendarId) && count($calendarId) === 0)) { + // verify the required parameter 'eventId' is set + if ($eventId === null || (is_array($eventId) && count($eventId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $calendarId when calling getCalendar' + 'Missing the required parameter $eventId when calling deleteEvent' ); } - $resourcePath = '/crm/api/v1/calendars/{calendarId}'; + $resourcePath = '/crm/api/v1/events/{eventId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1417,16 +1449,12 @@ protected function getCalendarRequest($calendarId, $acceptLanguage = null) $multipart = false; - // header params - if ($acceptLanguage !== null) { - $headerParams['Accept-Language'] = ObjectSerializer::toHeaderValue($acceptLanguage); - } // path params - if ($calendarId !== null) { + if ($eventId !== null) { $resourcePath = str_replace( - '{' . 'calendarId' . '}', - ObjectSerializer::toPathValue($calendarId), + '{' . 'eventId' . '}', + ObjectSerializer::toPathValue($eventId), $resourcePath ); } @@ -1457,10 +1485,13 @@ protected function getCalendarRequest($calendarId, $acceptLanguage = null) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1492,7 +1523,7 @@ protected function getCalendarRequest($calendarId, $acceptLanguage = null) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1500,38 +1531,38 @@ protected function getCalendarRequest($calendarId, $acceptLanguage = null) } /** - * Operation getEvent + * Operation getCalendar * - * Return the detail of an event. + * Get informations about a calendar or a default calendar. * - * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Equisoft\SDK\EquisoftConnect\Model\EventsEvent|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return \Equisoft\SDK\EquisoftConnect\Model\CalendarsCalendar|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function getEvent($eventId, $acceptLanguage = null) + public function getCalendar($calendarId, $acceptLanguage = null) { - list($response) = $this->getEventWithHttpInfo($eventId, $acceptLanguage); + list($response) = $this->getCalendarWithHttpInfo($calendarId, $acceptLanguage); return $response; } /** - * Operation getEventWithHttpInfo + * Operation getCalendarWithHttpInfo * - * Return the detail of an event. + * Get informations about a calendar or a default calendar. * - * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Equisoft\SDK\EquisoftConnect\Model\EventsEvent|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Equisoft\SDK\EquisoftConnect\Model\CalendarsCalendar|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getEventWithHttpInfo($eventId, $acceptLanguage = null) + public function getCalendarWithHttpInfo($calendarId, $acceptLanguage = null) { - $request = $this->getEventRequest($eventId, $acceptLanguage); + $request = $this->getCalendarRequest($calendarId, $acceptLanguage); try { $options = $this->createHttpClientOption(); @@ -1564,14 +1595,14 @@ public function getEventWithHttpInfo($eventId, $acceptLanguage = null) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Equisoft\SDK\EquisoftConnect\Model\EventsEvent' === '\SplFileObject') { + if ('\Equisoft\SDK\EquisoftConnect\Model\CalendarsCalendar' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\EventsEvent', []), + ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\CalendarsCalendar', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1613,7 +1644,7 @@ public function getEventWithHttpInfo($eventId, $acceptLanguage = null) ]; } - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsEvent'; + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\CalendarsCalendar'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1632,7 +1663,7 @@ public function getEventWithHttpInfo($eventId, $acceptLanguage = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Equisoft\SDK\EquisoftConnect\Model\EventsEvent', + '\Equisoft\SDK\EquisoftConnect\Model\CalendarsCalendar', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1667,19 +1698,19 @@ public function getEventWithHttpInfo($eventId, $acceptLanguage = null) } /** - * Operation getEventAsync + * Operation getCalendarAsync * - * Return the detail of an event. + * Get informations about a calendar or a default calendar. * - * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEventAsync($eventId, $acceptLanguage = null) + public function getCalendarAsync($calendarId, $acceptLanguage = null) { - return $this->getEventAsyncWithHttpInfo($eventId, $acceptLanguage) + return $this->getCalendarAsyncWithHttpInfo($calendarId, $acceptLanguage) ->then( function ($response) { return $response[0]; @@ -1688,20 +1719,20 @@ function ($response) { } /** - * Operation getEventAsyncWithHttpInfo + * Operation getCalendarAsyncWithHttpInfo * - * Return the detail of an event. + * Get informations about a calendar or a default calendar. * - * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEventAsyncWithHttpInfo($eventId, $acceptLanguage = null) + public function getCalendarAsyncWithHttpInfo($calendarId, $acceptLanguage = null) { - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsEvent'; - $request = $this->getEventRequest($eventId, $acceptLanguage); + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\CalendarsCalendar'; + $request = $this->getCalendarRequest($calendarId, $acceptLanguage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1738,24 +1769,24 @@ function ($exception) { } /** - * Create request for operation 'getEvent' + * Create request for operation 'getCalendar' * - * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getEventRequest($eventId, $acceptLanguage = null) + protected function getCalendarRequest($calendarId, $acceptLanguage = null) { - // verify the required parameter 'eventId' is set - if ($eventId === null || (is_array($eventId) && count($eventId) === 0)) { + // verify the required parameter 'calendarId' is set + if ($calendarId === null || (is_array($calendarId) && count($calendarId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $eventId when calling getEvent' + 'Missing the required parameter $calendarId when calling getCalendar' ); } - $resourcePath = '/crm/api/v1/events/{eventId}'; + $resourcePath = '/crm/api/v1/calendars/{calendarId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1769,10 +1800,10 @@ protected function getEventRequest($eventId, $acceptLanguage = null) } // path params - if ($eventId !== null) { + if ($calendarId !== null) { $resourcePath = str_replace( - '{' . 'eventId' . '}', - ObjectSerializer::toPathValue($eventId), + '{' . 'calendarId' . '}', + ObjectSerializer::toPathValue($calendarId), $resourcePath ); } @@ -1803,10 +1834,13 @@ protected function getEventRequest($eventId, $acceptLanguage = null) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1846,46 +1880,38 @@ protected function getEventRequest($eventId, $acceptLanguage = null) } /** - * Operation getEventInstances + * Operation getEvent * - * Get a recurring event instances. + * Return the detail of an event. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param string $pageToken Token to specify which page to fetch. (optional) - * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Equisoft\SDK\EquisoftConnect\Model\EventsGetEventInstancesResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return \Equisoft\SDK\EquisoftConnect\Model\EventsEvent|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function getEventInstances($eventId, $minTime = null, $maxTime = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) + public function getEvent($eventId, $acceptLanguage = null) { - list($response) = $this->getEventInstancesWithHttpInfo($eventId, $minTime, $maxTime, $pageToken, $maxResults, $acceptLanguage); + list($response) = $this->getEventWithHttpInfo($eventId, $acceptLanguage); return $response; } /** - * Operation getEventInstancesWithHttpInfo + * Operation getEventWithHttpInfo * - * Get a recurring event instances. + * Return the detail of an event. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param string $pageToken Token to specify which page to fetch. (optional) - * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Equisoft\SDK\EquisoftConnect\Model\EventsGetEventInstancesResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Equisoft\SDK\EquisoftConnect\Model\EventsEvent|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getEventInstancesWithHttpInfo($eventId, $minTime = null, $maxTime = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) + public function getEventWithHttpInfo($eventId, $acceptLanguage = null) { - $request = $this->getEventInstancesRequest($eventId, $minTime, $maxTime, $pageToken, $maxResults, $acceptLanguage); + $request = $this->getEventRequest($eventId, $acceptLanguage); try { $options = $this->createHttpClientOption(); @@ -1918,14 +1944,14 @@ public function getEventInstancesWithHttpInfo($eventId, $minTime = null, $maxTim $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Equisoft\SDK\EquisoftConnect\Model\EventsGetEventInstancesResponse' === '\SplFileObject') { + if ('\Equisoft\SDK\EquisoftConnect\Model\EventsEvent' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\EventsGetEventInstancesResponse', []), + ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\EventsEvent', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1967,7 +1993,7 @@ public function getEventInstancesWithHttpInfo($eventId, $minTime = null, $maxTim ]; } - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsGetEventInstancesResponse'; + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsEvent'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1986,7 +2012,7 @@ public function getEventInstancesWithHttpInfo($eventId, $minTime = null, $maxTim case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Equisoft\SDK\EquisoftConnect\Model\EventsGetEventInstancesResponse', + '\Equisoft\SDK\EquisoftConnect\Model\EventsEvent', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2021,23 +2047,19 @@ public function getEventInstancesWithHttpInfo($eventId, $minTime = null, $maxTim } /** - * Operation getEventInstancesAsync + * Operation getEventAsync * - * Get a recurring event instances. + * Return the detail of an event. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param string $pageToken Token to specify which page to fetch. (optional) - * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEventInstancesAsync($eventId, $minTime = null, $maxTime = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) + public function getEventAsync($eventId, $acceptLanguage = null) { - return $this->getEventInstancesAsyncWithHttpInfo($eventId, $minTime, $maxTime, $pageToken, $maxResults, $acceptLanguage) + return $this->getEventAsyncWithHttpInfo($eventId, $acceptLanguage) ->then( function ($response) { return $response[0]; @@ -2046,24 +2068,20 @@ function ($response) { } /** - * Operation getEventInstancesAsyncWithHttpInfo + * Operation getEventAsyncWithHttpInfo * - * Get a recurring event instances. + * Return the detail of an event. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param string $pageToken Token to specify which page to fetch. (optional) - * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEventInstancesAsyncWithHttpInfo($eventId, $minTime = null, $maxTime = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) + public function getEventAsyncWithHttpInfo($eventId, $acceptLanguage = null) { - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsGetEventInstancesResponse'; - $request = $this->getEventInstancesRequest($eventId, $minTime, $maxTime, $pageToken, $maxResults, $acceptLanguage); + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsEvent'; + $request = $this->getEventRequest($eventId, $acceptLanguage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2100,78 +2118,30 @@ function ($exception) { } /** - * Create request for operation 'getEventInstances' + * Create request for operation 'getEvent' * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param string $pageToken Token to specify which page to fetch. (optional) - * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getEventInstancesRequest($eventId, $minTime = null, $maxTime = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) + protected function getEventRequest($eventId, $acceptLanguage = null) { // verify the required parameter 'eventId' is set if ($eventId === null || (is_array($eventId) && count($eventId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $eventId when calling getEventInstances' + 'Missing the required parameter $eventId when calling getEvent' ); } - $resourcePath = '/crm/api/v1/events/{eventId}/instances'; + $resourcePath = '/crm/api/v1/events/{eventId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($minTime !== null) { - if('form' === 'form' && is_array($minTime)) { - foreach($minTime as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['minTime'] = $minTime; - } - } - // query params - if ($maxTime !== null) { - if('form' === 'form' && is_array($maxTime)) { - foreach($maxTime as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['maxTime'] = $maxTime; - } - } - // query params - if ($pageToken !== null) { - if('form' === 'form' && is_array($pageToken)) { - foreach($pageToken as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['pageToken'] = $pageToken; - } - } - // query params - if ($maxResults !== null) { - if('form' === 'form' && is_array($maxResults)) { - foreach($maxResults as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['maxResults'] = $maxResults; - } - } // header params if ($acceptLanguage !== null) { @@ -2213,10 +2183,13 @@ protected function getEventInstancesRequest($eventId, $minTime = null, $maxTime if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2256,40 +2229,46 @@ protected function getEventInstancesRequest($eventId, $minTime = null, $maxTime } /** - * Operation getEventInternalNoteList + * Operation getEventInstances * - * Get the internal notes list for an event. + * Get a recurring event instances. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) + * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param string $pageToken Token to specify which page to fetch. (optional) + * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return \Equisoft\SDK\EquisoftConnect\Model\EventsGetEventInstancesResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function getEventInternalNoteList($eventId, $history = null, $acceptLanguage = null) + public function getEventInstances($eventId, $minTime = null, $maxTime = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) { - list($response) = $this->getEventInternalNoteListWithHttpInfo($eventId, $history, $acceptLanguage); + list($response) = $this->getEventInstancesWithHttpInfo($eventId, $minTime, $maxTime, $pageToken, $maxResults, $acceptLanguage); return $response; } /** - * Operation getEventInternalNoteListWithHttpInfo + * Operation getEventInstancesWithHttpInfo * - * Get the internal notes list for an event. + * Get a recurring event instances. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) + * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param string $pageToken Token to specify which page to fetch. (optional) + * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Equisoft\SDK\EquisoftConnect\Model\EventsGetEventInstancesResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getEventInternalNoteListWithHttpInfo($eventId, $history = null, $acceptLanguage = null) + public function getEventInstancesWithHttpInfo($eventId, $minTime = null, $maxTime = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) { - $request = $this->getEventInternalNoteListRequest($eventId, $history, $acceptLanguage); + $request = $this->getEventInstancesRequest($eventId, $minTime, $maxTime, $pageToken, $maxResults, $acceptLanguage); try { $options = $this->createHttpClientOption(); @@ -2322,14 +2301,14 @@ public function getEventInternalNoteListWithHttpInfo($eventId, $history = null, $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList' === '\SplFileObject') { + if ('\Equisoft\SDK\EquisoftConnect\Model\EventsGetEventInstancesResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList', []), + ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\EventsGetEventInstancesResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2371,7 +2350,7 @@ public function getEventInternalNoteListWithHttpInfo($eventId, $history = null, ]; } - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList'; + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsGetEventInstancesResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -2390,7 +2369,7 @@ public function getEventInternalNoteListWithHttpInfo($eventId, $history = null, case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList', + '\Equisoft\SDK\EquisoftConnect\Model\EventsGetEventInstancesResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2425,20 +2404,23 @@ public function getEventInternalNoteListWithHttpInfo($eventId, $history = null, } /** - * Operation getEventInternalNoteListAsync + * Operation getEventInstancesAsync * - * Get the internal notes list for an event. + * Get a recurring event instances. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) + * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param string $pageToken Token to specify which page to fetch. (optional) + * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEventInternalNoteListAsync($eventId, $history = null, $acceptLanguage = null) + public function getEventInstancesAsync($eventId, $minTime = null, $maxTime = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) { - return $this->getEventInternalNoteListAsyncWithHttpInfo($eventId, $history, $acceptLanguage) + return $this->getEventInstancesAsyncWithHttpInfo($eventId, $minTime, $maxTime, $pageToken, $maxResults, $acceptLanguage) ->then( function ($response) { return $response[0]; @@ -2447,21 +2429,24 @@ function ($response) { } /** - * Operation getEventInternalNoteListAsyncWithHttpInfo + * Operation getEventInstancesAsyncWithHttpInfo * - * Get the internal notes list for an event. + * Get a recurring event instances. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) + * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param string $pageToken Token to specify which page to fetch. (optional) + * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getEventInternalNoteListAsyncWithHttpInfo($eventId, $history = null, $acceptLanguage = null) + public function getEventInstancesAsyncWithHttpInfo($eventId, $minTime = null, $maxTime = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) { - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList'; - $request = $this->getEventInternalNoteListRequest($eventId, $history, $acceptLanguage); + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsGetEventInstancesResponse'; + $request = $this->getEventInstancesRequest($eventId, $minTime, $maxTime, $pageToken, $maxResults, $acceptLanguage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2498,25 +2483,28 @@ function ($exception) { } /** - * Create request for operation 'getEventInternalNoteList' + * Create request for operation 'getEventInstances' * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) + * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param string $pageToken Token to specify which page to fetch. (optional) + * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getEventInternalNoteListRequest($eventId, $history = null, $acceptLanguage = null) + protected function getEventInstancesRequest($eventId, $minTime = null, $maxTime = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) { // verify the required parameter 'eventId' is set if ($eventId === null || (is_array($eventId) && count($eventId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $eventId when calling getEventInternalNoteList' + 'Missing the required parameter $eventId when calling getEventInstances' ); } - $resourcePath = '/crm/api/v1/events/{eventId}/notes'; + $resourcePath = '/crm/api/v1/events/{eventId}/instances'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2524,14 +2512,47 @@ protected function getEventInternalNoteListRequest($eventId, $history = null, $a $multipart = false; // query params - if ($history !== null) { - if('form' === 'form' && is_array($history)) { - foreach($history as $key => $value) { + if ($minTime !== null) { + if('form' === 'form' && is_array($minTime)) { + foreach($minTime as $key => $value) { $queryParams[$key] = $value; } } else { - $queryParams['history'] = $history; + $queryParams['minTime'] = $minTime; + } + } + // query params + if ($maxTime !== null) { + if('form' === 'form' && is_array($maxTime)) { + foreach($maxTime as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['maxTime'] = $maxTime; + } + } + // query params + if ($pageToken !== null) { + if('form' === 'form' && is_array($pageToken)) { + foreach($pageToken as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['pageToken'] = $pageToken; + } + } + // query params + if ($maxResults !== null) { + if('form' === 'form' && is_array($maxResults)) { + foreach($maxResults as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['maxResults'] = $maxResults; } } @@ -2575,10 +2596,13 @@ protected function getEventInternalNoteListRequest($eventId, $history = null, $a if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2618,36 +2642,40 @@ protected function getEventInternalNoteListRequest($eventId, $history = null, $a } /** - * Operation listCalendars + * Operation getEventInternalNoteList * - * Get the list of available calendars. + * Get the internal notes list for an event. * + * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Equisoft\SDK\EquisoftConnect\Model\CalendarsListCalendarResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return \Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function listCalendars($acceptLanguage = null) + public function getEventInternalNoteList($eventId, $history = null, $acceptLanguage = null) { - list($response) = $this->listCalendarsWithHttpInfo($acceptLanguage); + list($response) = $this->getEventInternalNoteListWithHttpInfo($eventId, $history, $acceptLanguage); return $response; } /** - * Operation listCalendarsWithHttpInfo + * Operation getEventInternalNoteListWithHttpInfo * - * Get the list of available calendars. + * Get the internal notes list for an event. * + * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Equisoft\SDK\EquisoftConnect\Model\CalendarsListCalendarResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listCalendarsWithHttpInfo($acceptLanguage = null) + public function getEventInternalNoteListWithHttpInfo($eventId, $history = null, $acceptLanguage = null) { - $request = $this->listCalendarsRequest($acceptLanguage); + $request = $this->getEventInternalNoteListRequest($eventId, $history, $acceptLanguage); try { $options = $this->createHttpClientOption(); @@ -2680,18 +2708,18 @@ public function listCalendarsWithHttpInfo($acceptLanguage = null) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Equisoft\SDK\EquisoftConnect\Model\CalendarsListCalendarResponse' === '\SplFileObject') { + if ('\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\CalendarsListCalendarResponse', []), + ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList', []), $response->getStatusCode(), $response->getHeaders() ]; - case 400: + case 401: if ('\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -2703,7 +2731,7 @@ public function listCalendarsWithHttpInfo($acceptLanguage = null) $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 404: if ('\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -2729,7 +2757,7 @@ public function listCalendarsWithHttpInfo($acceptLanguage = null) ]; } - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\CalendarsListCalendarResponse'; + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -2748,12 +2776,12 @@ public function listCalendarsWithHttpInfo($acceptLanguage = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Equisoft\SDK\EquisoftConnect\Model\CalendarsListCalendarResponse', + '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 400: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse', @@ -2761,7 +2789,7 @@ public function listCalendarsWithHttpInfo($acceptLanguage = null) ); $e->setResponseObject($data); break; - case 401: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse', @@ -2783,18 +2811,20 @@ public function listCalendarsWithHttpInfo($acceptLanguage = null) } /** - * Operation listCalendarsAsync + * Operation getEventInternalNoteListAsync * - * Get the list of available calendars. + * Get the internal notes list for an event. * + * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listCalendarsAsync($acceptLanguage = null) + public function getEventInternalNoteListAsync($eventId, $history = null, $acceptLanguage = null) { - return $this->listCalendarsAsyncWithHttpInfo($acceptLanguage) + return $this->getEventInternalNoteListAsyncWithHttpInfo($eventId, $history, $acceptLanguage) ->then( function ($response) { return $response[0]; @@ -2803,19 +2833,21 @@ function ($response) { } /** - * Operation listCalendarsAsyncWithHttpInfo + * Operation getEventInternalNoteListAsyncWithHttpInfo * - * Get the list of available calendars. + * Get the internal notes list for an event. * + * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listCalendarsAsyncWithHttpInfo($acceptLanguage = null) + public function getEventInternalNoteListAsyncWithHttpInfo($eventId, $history = null, $acceptLanguage = null) { - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\CalendarsListCalendarResponse'; - $request = $this->listCalendarsRequest($acceptLanguage); + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList'; + $request = $this->getEventInternalNoteListRequest($eventId, $history, $acceptLanguage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2852,35 +2884,62 @@ function ($exception) { } /** - * Create request for operation 'listCalendars' + * Create request for operation 'getEventInternalNoteList' * + * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listCalendarsRequest($acceptLanguage = null) + protected function getEventInternalNoteListRequest($eventId, $history = null, $acceptLanguage = null) { + // verify the required parameter 'eventId' is set + if ($eventId === null || (is_array($eventId) && count($eventId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $eventId when calling getEventInternalNoteList' + ); + } - $resourcePath = '/crm/api/v1/calendars'; + $resourcePath = '/crm/api/v1/events/{eventId}/notes'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + if ($history !== null) { + if('form' === 'form' && is_array($history)) { + foreach($history as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['history'] = $history; + } + } // header params if ($acceptLanguage !== null) { $headerParams['Accept-Language'] = ObjectSerializer::toHeaderValue($acceptLanguage); } - - // body params - $_tempBody = null; - - if ($multipart) { - $headers = $this->headerSelector->selectHeadersForMultipart( + // path params + if ($eventId !== null) { + $resourcePath = str_replace( + '{' . 'eventId' . '}', + ObjectSerializer::toPathValue($eventId), + $resourcePath + ); + } + + // body params + $_tempBody = null; + + if ($multipart) { + $headers = $this->headerSelector->selectHeadersForMultipart( ['application/json'] ); } else { @@ -2902,10 +2961,13 @@ protected function listCalendarsRequest($acceptLanguage = null) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2945,56 +3007,36 @@ protected function listCalendarsRequest($acceptLanguage = null) } /** - * Operation listEvents + * Operation listCalendars * - * List or search events. + * Get the list of available calendars. * - * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (optional) - * @param string $ownerId Owner ID filter param. (optional) - * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) - * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param bool $singleEvents Expand recurring events into occurrences. When singleEvents is true, master recurrences are not returned in list. (optional) - * @param bool $isCompleted If true, include only completed events. If false, include only TODO event. If not set or null, include both. (optional) - * @param \Equisoft\SDK\EquisoftConnect\Model\EventsOrderByType $orderBy Specify the order of the results. `startTime` may result in inconsistant sort when used without the `singleEvents` option. (optional) - * @param string $pageToken Token to specify which page to fetch. (optional) - * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Equisoft\SDK\EquisoftConnect\Model\EventsListEventResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return \Equisoft\SDK\EquisoftConnect\Model\CalendarsListCalendarResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function listEvents($calendarId = null, $ownerId = null, $contactIds = null, $minTime = null, $maxTime = null, $singleEvents = null, $isCompleted = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) + public function listCalendars($acceptLanguage = null) { - list($response) = $this->listEventsWithHttpInfo($calendarId, $ownerId, $contactIds, $minTime, $maxTime, $singleEvents, $isCompleted, $orderBy, $pageToken, $maxResults, $acceptLanguage); + list($response) = $this->listCalendarsWithHttpInfo($acceptLanguage); return $response; } /** - * Operation listEventsWithHttpInfo + * Operation listCalendarsWithHttpInfo * - * List or search events. + * Get the list of available calendars. * - * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (optional) - * @param string $ownerId Owner ID filter param. (optional) - * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) - * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param bool $singleEvents Expand recurring events into occurrences. When singleEvents is true, master recurrences are not returned in list. (optional) - * @param bool $isCompleted If true, include only completed events. If false, include only TODO event. If not set or null, include both. (optional) - * @param \Equisoft\SDK\EquisoftConnect\Model\EventsOrderByType $orderBy Specify the order of the results. `startTime` may result in inconsistant sort when used without the `singleEvents` option. (optional) - * @param string $pageToken Token to specify which page to fetch. (optional) - * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Equisoft\SDK\EquisoftConnect\Model\EventsListEventResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Equisoft\SDK\EquisoftConnect\Model\CalendarsListCalendarResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listEventsWithHttpInfo($calendarId = null, $ownerId = null, $contactIds = null, $minTime = null, $maxTime = null, $singleEvents = null, $isCompleted = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) + public function listCalendarsWithHttpInfo($acceptLanguage = null) { - $request = $this->listEventsRequest($calendarId, $ownerId, $contactIds, $minTime, $maxTime, $singleEvents, $isCompleted, $orderBy, $pageToken, $maxResults, $acceptLanguage); + $request = $this->listCalendarsRequest($acceptLanguage); try { $options = $this->createHttpClientOption(); @@ -3027,14 +3069,14 @@ public function listEventsWithHttpInfo($calendarId = null, $ownerId = null, $con $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Equisoft\SDK\EquisoftConnect\Model\EventsListEventResponse' === '\SplFileObject') { + if ('\Equisoft\SDK\EquisoftConnect\Model\CalendarsListCalendarResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\EventsListEventResponse', []), + ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\CalendarsListCalendarResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -3076,7 +3118,7 @@ public function listEventsWithHttpInfo($calendarId = null, $ownerId = null, $con ]; } - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsListEventResponse'; + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\CalendarsListCalendarResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -3095,7 +3137,7 @@ public function listEventsWithHttpInfo($calendarId = null, $ownerId = null, $con case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Equisoft\SDK\EquisoftConnect\Model\EventsListEventResponse', + '\Equisoft\SDK\EquisoftConnect\Model\CalendarsListCalendarResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3130,28 +3172,18 @@ public function listEventsWithHttpInfo($calendarId = null, $ownerId = null, $con } /** - * Operation listEventsAsync + * Operation listCalendarsAsync * - * List or search events. + * Get the list of available calendars. * - * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (optional) - * @param string $ownerId Owner ID filter param. (optional) - * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) - * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param bool $singleEvents Expand recurring events into occurrences. When singleEvents is true, master recurrences are not returned in list. (optional) - * @param bool $isCompleted If true, include only completed events. If false, include only TODO event. If not set or null, include both. (optional) - * @param \Equisoft\SDK\EquisoftConnect\Model\EventsOrderByType $orderBy Specify the order of the results. `startTime` may result in inconsistant sort when used without the `singleEvents` option. (optional) - * @param string $pageToken Token to specify which page to fetch. (optional) - * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listEventsAsync($calendarId = null, $ownerId = null, $contactIds = null, $minTime = null, $maxTime = null, $singleEvents = null, $isCompleted = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) + public function listCalendarsAsync($acceptLanguage = null) { - return $this->listEventsAsyncWithHttpInfo($calendarId, $ownerId, $contactIds, $minTime, $maxTime, $singleEvents, $isCompleted, $orderBy, $pageToken, $maxResults, $acceptLanguage) + return $this->listCalendarsAsyncWithHttpInfo($acceptLanguage) ->then( function ($response) { return $response[0]; @@ -3160,29 +3192,19 @@ function ($response) { } /** - * Operation listEventsAsyncWithHttpInfo + * Operation listCalendarsAsyncWithHttpInfo * - * List or search events. + * Get the list of available calendars. * - * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (optional) - * @param string $ownerId Owner ID filter param. (optional) - * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) - * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param bool $singleEvents Expand recurring events into occurrences. When singleEvents is true, master recurrences are not returned in list. (optional) - * @param bool $isCompleted If true, include only completed events. If false, include only TODO event. If not set or null, include both. (optional) - * @param \Equisoft\SDK\EquisoftConnect\Model\EventsOrderByType $orderBy Specify the order of the results. `startTime` may result in inconsistant sort when used without the `singleEvents` option. (optional) - * @param string $pageToken Token to specify which page to fetch. (optional) - * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listEventsAsyncWithHttpInfo($calendarId = null, $ownerId = null, $contactIds = null, $minTime = null, $maxTime = null, $singleEvents = null, $isCompleted = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) + public function listCalendarsAsyncWithHttpInfo($acceptLanguage = null) { - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsListEventResponse'; - $request = $this->listEventsRequest($calendarId, $ownerId, $contactIds, $minTime, $maxTime, $singleEvents, $isCompleted, $orderBy, $pageToken, $maxResults, $acceptLanguage); + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\CalendarsListCalendarResponse'; + $request = $this->listCalendarsRequest($acceptLanguage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3219,143 +3241,23 @@ function ($exception) { } /** - * Create request for operation 'listEvents' + * Create request for operation 'listCalendars' * - * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (optional) - * @param string $ownerId Owner ID filter param. (optional) - * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) - * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) - * @param bool $singleEvents Expand recurring events into occurrences. When singleEvents is true, master recurrences are not returned in list. (optional) - * @param bool $isCompleted If true, include only completed events. If false, include only TODO event. If not set or null, include both. (optional) - * @param \Equisoft\SDK\EquisoftConnect\Model\EventsOrderByType $orderBy Specify the order of the results. `startTime` may result in inconsistant sort when used without the `singleEvents` option. (optional) - * @param string $pageToken Token to specify which page to fetch. (optional) - * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listEventsRequest($calendarId = null, $ownerId = null, $contactIds = null, $minTime = null, $maxTime = null, $singleEvents = null, $isCompleted = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) + protected function listCalendarsRequest($acceptLanguage = null) { - $resourcePath = '/crm/api/v1/events'; + $resourcePath = '/crm/api/v1/calendars'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($calendarId !== null) { - if('form' === 'form' && is_array($calendarId)) { - foreach($calendarId as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['calendarId'] = $calendarId; - } - } - // query params - if ($ownerId !== null) { - if('form' === 'form' && is_array($ownerId)) { - foreach($ownerId as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['ownerId'] = $ownerId; - } - } - // query params - if ($contactIds !== null) { - if('form' === 'form' && is_array($contactIds)) { - foreach($contactIds as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['contactIds'] = $contactIds; - } - } - // query params - if ($minTime !== null) { - if('form' === 'form' && is_array($minTime)) { - foreach($minTime as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['minTime'] = $minTime; - } - } - // query params - if ($maxTime !== null) { - if('form' === 'form' && is_array($maxTime)) { - foreach($maxTime as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['maxTime'] = $maxTime; - } - } - // query params - if ($singleEvents !== null) { - if('form' === 'form' && is_array($singleEvents)) { - foreach($singleEvents as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['singleEvents'] = $singleEvents; - } - } - // query params - if ($isCompleted !== null) { - if('form' === 'form' && is_array($isCompleted)) { - foreach($isCompleted as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isCompleted'] = $isCompleted; - } - } - // query params - if ($orderBy !== null) { - if('form' === 'form' && is_array($orderBy)) { - foreach($orderBy as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['orderBy'] = $orderBy; - } - } - // query params - if ($pageToken !== null) { - if('form' === 'form' && is_array($pageToken)) { - foreach($pageToken as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['pageToken'] = $pageToken; - } - } - // query params - if ($maxResults !== null) { - if('form' === 'form' && is_array($maxResults)) { - foreach($maxResults as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['maxResults'] = $maxResults; - } - } // header params if ($acceptLanguage !== null) { @@ -3389,10 +3291,13 @@ protected function listEventsRequest($calendarId = null, $ownerId = null, $conta if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -3432,40 +3337,56 @@ protected function listEventsRequest($calendarId = null, $ownerId = null, $conta } /** - * Operation patchEvent + * Operation listEvents * - * Partially update an event. + * List or search events. * - * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventPayload $eventsPatchEventPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) + * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (optional) + * @param string $ownerId Owner ID filter param. (optional) + * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) + * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param bool $singleEvents Expand recurring events into occurrences. When singleEvents is true, master recurrences are not returned in list. (optional) + * @param bool $isCompleted If true, include only completed events. If false, include only TODO event. If not set or null, include both. (optional) + * @param \Equisoft\SDK\EquisoftConnect\Model\EventsOrderByType $orderBy Specify the order of the results. `startTime` may result in inconsistant sort when used without the `singleEvents` option. (optional) + * @param string $pageToken Token to specify which page to fetch. (optional) + * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return \Equisoft\SDK\EquisoftConnect\Model\EventsListEventResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function patchEvent($eventId, $eventsPatchEventPayload, $acceptLanguage = null) + public function listEvents($calendarId = null, $ownerId = null, $contactIds = null, $minTime = null, $maxTime = null, $singleEvents = null, $isCompleted = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) { - list($response) = $this->patchEventWithHttpInfo($eventId, $eventsPatchEventPayload, $acceptLanguage); + list($response) = $this->listEventsWithHttpInfo($calendarId, $ownerId, $contactIds, $minTime, $maxTime, $singleEvents, $isCompleted, $orderBy, $pageToken, $maxResults, $acceptLanguage); return $response; } /** - * Operation patchEventWithHttpInfo + * Operation listEventsWithHttpInfo * - * Partially update an event. + * List or search events. * - * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventPayload $eventsPatchEventPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) + * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (optional) + * @param string $ownerId Owner ID filter param. (optional) + * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) + * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param bool $singleEvents Expand recurring events into occurrences. When singleEvents is true, master recurrences are not returned in list. (optional) + * @param bool $isCompleted If true, include only completed events. If false, include only TODO event. If not set or null, include both. (optional) + * @param \Equisoft\SDK\EquisoftConnect\Model\EventsOrderByType $orderBy Specify the order of the results. `startTime` may result in inconsistant sort when used without the `singleEvents` option. (optional) + * @param string $pageToken Token to specify which page to fetch. (optional) + * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Equisoft\SDK\EquisoftConnect\Model\EventsListEventResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function patchEventWithHttpInfo($eventId, $eventsPatchEventPayload, $acceptLanguage = null) + public function listEventsWithHttpInfo($calendarId = null, $ownerId = null, $contactIds = null, $minTime = null, $maxTime = null, $singleEvents = null, $isCompleted = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) { - $request = $this->patchEventRequest($eventId, $eventsPatchEventPayload, $acceptLanguage); + $request = $this->listEventsRequest($calendarId, $ownerId, $contactIds, $minTime, $maxTime, $singleEvents, $isCompleted, $orderBy, $pageToken, $maxResults, $acceptLanguage); try { $options = $this->createHttpClientOption(); @@ -3498,14 +3419,14 @@ public function patchEventWithHttpInfo($eventId, $eventsPatchEventPayload, $acce $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventResponse' === '\SplFileObject') { + if ('\Equisoft\SDK\EquisoftConnect\Model\EventsListEventResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventResponse', []), + ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\EventsListEventResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -3547,7 +3468,7 @@ public function patchEventWithHttpInfo($eventId, $eventsPatchEventPayload, $acce ]; } - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventResponse'; + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsListEventResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -3566,7 +3487,7 @@ public function patchEventWithHttpInfo($eventId, $eventsPatchEventPayload, $acce case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventResponse', + '\Equisoft\SDK\EquisoftConnect\Model\EventsListEventResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3601,20 +3522,28 @@ public function patchEventWithHttpInfo($eventId, $eventsPatchEventPayload, $acce } /** - * Operation patchEventAsync + * Operation listEventsAsync * - * Partially update an event. + * List or search events. * - * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventPayload $eventsPatchEventPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) + * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (optional) + * @param string $ownerId Owner ID filter param. (optional) + * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) + * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param bool $singleEvents Expand recurring events into occurrences. When singleEvents is true, master recurrences are not returned in list. (optional) + * @param bool $isCompleted If true, include only completed events. If false, include only TODO event. If not set or null, include both. (optional) + * @param \Equisoft\SDK\EquisoftConnect\Model\EventsOrderByType $orderBy Specify the order of the results. `startTime` may result in inconsistant sort when used without the `singleEvents` option. (optional) + * @param string $pageToken Token to specify which page to fetch. (optional) + * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function patchEventAsync($eventId, $eventsPatchEventPayload, $acceptLanguage = null) + public function listEventsAsync($calendarId = null, $ownerId = null, $contactIds = null, $minTime = null, $maxTime = null, $singleEvents = null, $isCompleted = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) { - return $this->patchEventAsyncWithHttpInfo($eventId, $eventsPatchEventPayload, $acceptLanguage) + return $this->listEventsAsyncWithHttpInfo($calendarId, $ownerId, $contactIds, $minTime, $maxTime, $singleEvents, $isCompleted, $orderBy, $pageToken, $maxResults, $acceptLanguage) ->then( function ($response) { return $response[0]; @@ -3623,21 +3552,29 @@ function ($response) { } /** - * Operation patchEventAsyncWithHttpInfo + * Operation listEventsAsyncWithHttpInfo * - * Partially update an event. + * List or search events. * - * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventPayload $eventsPatchEventPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) + * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (optional) + * @param string $ownerId Owner ID filter param. (optional) + * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) + * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param bool $singleEvents Expand recurring events into occurrences. When singleEvents is true, master recurrences are not returned in list. (optional) + * @param bool $isCompleted If true, include only completed events. If false, include only TODO event. If not set or null, include both. (optional) + * @param \Equisoft\SDK\EquisoftConnect\Model\EventsOrderByType $orderBy Specify the order of the results. `startTime` may result in inconsistant sort when used without the `singleEvents` option. (optional) + * @param string $pageToken Token to specify which page to fetch. (optional) + * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function patchEventAsyncWithHttpInfo($eventId, $eventsPatchEventPayload, $acceptLanguage = null) + public function listEventsAsyncWithHttpInfo($calendarId = null, $ownerId = null, $contactIds = null, $minTime = null, $maxTime = null, $singleEvents = null, $isCompleted = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) { - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventResponse'; - $request = $this->patchEventRequest($eventId, $eventsPatchEventPayload, $acceptLanguage); + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsListEventResponse'; + $request = $this->listEventsRequest($calendarId, $ownerId, $contactIds, $minTime, $maxTime, $singleEvents, $isCompleted, $orderBy, $pageToken, $maxResults, $acceptLanguage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3670,61 +3607,156 @@ function ($exception) { $response->getBody() ); } - ); - } - - /** - * Create request for operation 'patchEvent' - * - * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventPayload $eventsPatchEventPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) - * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function patchEventRequest($eventId, $eventsPatchEventPayload, $acceptLanguage = null) - { - // verify the required parameter 'eventId' is set - if ($eventId === null || (is_array($eventId) && count($eventId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $eventId when calling patchEvent' - ); + ); + } + + /** + * Create request for operation 'listEvents' + * + * @param string $calendarId Calendar ID filter param. An id returned by listCalendars. The string `primary` for the current connected user primary (TODO) calendar. The string `completed` for the current connected user completed (DONE) calendar. (optional) + * @param string $ownerId Owner ID filter param. (optional) + * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) + * @param \DateTime $minTime Minimum (inclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param \DateTime $maxTime Maximum (exclusive) date and time of the event start time. As defined by date-time - RFC3339 (optional) + * @param bool $singleEvents Expand recurring events into occurrences. When singleEvents is true, master recurrences are not returned in list. (optional) + * @param bool $isCompleted If true, include only completed events. If false, include only TODO event. If not set or null, include both. (optional) + * @param \Equisoft\SDK\EquisoftConnect\Model\EventsOrderByType $orderBy Specify the order of the results. `startTime` may result in inconsistant sort when used without the `singleEvents` option. (optional) + * @param string $pageToken Token to specify which page to fetch. (optional) + * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) + * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listEventsRequest($calendarId = null, $ownerId = null, $contactIds = null, $minTime = null, $maxTime = null, $singleEvents = null, $isCompleted = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) + { + + $resourcePath = '/crm/api/v1/events'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($calendarId !== null) { + if('form' === 'form' && is_array($calendarId)) { + foreach($calendarId as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['calendarId'] = $calendarId; + } + } + // query params + if ($ownerId !== null) { + if('form' === 'form' && is_array($ownerId)) { + foreach($ownerId as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['ownerId'] = $ownerId; + } + } + // query params + if ($contactIds !== null) { + if('form' === 'form' && is_array($contactIds)) { + foreach($contactIds as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['contactIds'] = $contactIds; + } + } + // query params + if ($minTime !== null) { + if('form' === 'form' && is_array($minTime)) { + foreach($minTime as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['minTime'] = $minTime; + } + } + // query params + if ($maxTime !== null) { + if('form' === 'form' && is_array($maxTime)) { + foreach($maxTime as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['maxTime'] = $maxTime; + } + } + // query params + if ($singleEvents !== null) { + if('form' === 'form' && is_array($singleEvents)) { + foreach($singleEvents as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['singleEvents'] = $singleEvents; + } } - // verify the required parameter 'eventsPatchEventPayload' is set - if ($eventsPatchEventPayload === null || (is_array($eventsPatchEventPayload) && count($eventsPatchEventPayload) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $eventsPatchEventPayload when calling patchEvent' - ); + // query params + if ($isCompleted !== null) { + if('form' === 'form' && is_array($isCompleted)) { + foreach($isCompleted as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['isCompleted'] = $isCompleted; + } + } + // query params + if ($orderBy !== null) { + if('form' === 'form' && is_array($orderBy)) { + foreach($orderBy as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['orderBy'] = $orderBy; + } + } + // query params + if ($pageToken !== null) { + if('form' === 'form' && is_array($pageToken)) { + foreach($pageToken as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['pageToken'] = $pageToken; + } + } + // query params + if ($maxResults !== null) { + if('form' === 'form' && is_array($maxResults)) { + foreach($maxResults as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['maxResults'] = $maxResults; + } } - - $resourcePath = '/crm/api/v1/events/{eventId}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - // header params if ($acceptLanguage !== null) { $headerParams['Accept-Language'] = ObjectSerializer::toHeaderValue($acceptLanguage); } - // path params - if ($eventId !== null) { - $resourcePath = str_replace( - '{' . 'eventId' . '}', - ObjectSerializer::toPathValue($eventId), - $resourcePath - ); - } // body params $_tempBody = null; - if (isset($eventsPatchEventPayload)) { - $_tempBody = $eventsPatchEventPayload; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -3733,7 +3765,7 @@ protected function patchEventRequest($eventId, $eventsPatchEventPayload, $accept } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -3749,10 +3781,13 @@ protected function patchEventRequest($eventId, $eventsPatchEventPayload, $accept if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -3784,7 +3819,7 @@ protected function patchEventRequest($eventId, $eventsPatchEventPayload, $accept $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'PATCH', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -3792,42 +3827,40 @@ protected function patchEventRequest($eventId, $eventsPatchEventPayload, $accept } /** - * Operation patchEventInternalNote + * Operation patchEvent * - * Add an internal note to and event. + * Partially update an event. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param string $noteId Note unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload internalNotesPatchNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventPayload $eventsPatchEventPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return \Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function patchEventInternalNote($eventId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) + public function patchEvent($eventId, $eventsPatchEventPayload, $acceptLanguage = null) { - list($response) = $this->patchEventInternalNoteWithHttpInfo($eventId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage); + list($response) = $this->patchEventWithHttpInfo($eventId, $eventsPatchEventPayload, $acceptLanguage); return $response; } /** - * Operation patchEventInternalNoteWithHttpInfo + * Operation patchEventWithHttpInfo * - * Add an internal note to and event. + * Partially update an event. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param string $noteId Note unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventPayload $eventsPatchEventPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function patchEventInternalNoteWithHttpInfo($eventId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) + public function patchEventWithHttpInfo($eventId, $eventsPatchEventPayload, $acceptLanguage = null) { - $request = $this->patchEventInternalNoteRequest($eventId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage); + $request = $this->patchEventRequest($eventId, $eventsPatchEventPayload, $acceptLanguage); try { $options = $this->createHttpClientOption(); @@ -3860,18 +3893,18 @@ public function patchEventInternalNoteWithHttpInfo($eventId, $noteId, $internalN $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse' === '\SplFileObject') { + if ('\Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse', []), + ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 400: if ('\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -3883,7 +3916,7 @@ public function patchEventInternalNoteWithHttpInfo($eventId, $noteId, $internalN $response->getStatusCode(), $response->getHeaders() ]; - case 404: + case 401: if ('\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -3909,7 +3942,7 @@ public function patchEventInternalNoteWithHttpInfo($eventId, $noteId, $internalN ]; } - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse'; + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -3928,12 +3961,12 @@ public function patchEventInternalNoteWithHttpInfo($eventId, $noteId, $internalN case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse', + '\Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse', @@ -3941,7 +3974,7 @@ public function patchEventInternalNoteWithHttpInfo($eventId, $noteId, $internalN ); $e->setResponseObject($data); break; - case 404: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse', @@ -3963,21 +3996,20 @@ public function patchEventInternalNoteWithHttpInfo($eventId, $noteId, $internalN } /** - * Operation patchEventInternalNoteAsync + * Operation patchEventAsync * - * Add an internal note to and event. + * Partially update an event. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param string $noteId Note unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventPayload $eventsPatchEventPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function patchEventInternalNoteAsync($eventId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) + public function patchEventAsync($eventId, $eventsPatchEventPayload, $acceptLanguage = null) { - return $this->patchEventInternalNoteAsyncWithHttpInfo($eventId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage) + return $this->patchEventAsyncWithHttpInfo($eventId, $eventsPatchEventPayload, $acceptLanguage) ->then( function ($response) { return $response[0]; @@ -3986,22 +4018,21 @@ function ($response) { } /** - * Operation patchEventInternalNoteAsyncWithHttpInfo + * Operation patchEventAsyncWithHttpInfo * - * Add an internal note to and event. + * Partially update an event. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param string $noteId Note unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventPayload $eventsPatchEventPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function patchEventInternalNoteAsyncWithHttpInfo($eventId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) + public function patchEventAsyncWithHttpInfo($eventId, $eventsPatchEventPayload, $acceptLanguage = null) { - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse'; - $request = $this->patchEventInternalNoteRequest($eventId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage); + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventResponse'; + $request = $this->patchEventRequest($eventId, $eventsPatchEventPayload, $acceptLanguage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4038,38 +4069,31 @@ function ($exception) { } /** - * Create request for operation 'patchEventInternalNote' + * Create request for operation 'patchEvent' * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param string $noteId Note unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\EventsPatchEventPayload $eventsPatchEventPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function patchEventInternalNoteRequest($eventId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) + protected function patchEventRequest($eventId, $eventsPatchEventPayload, $acceptLanguage = null) { // verify the required parameter 'eventId' is set if ($eventId === null || (is_array($eventId) && count($eventId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $eventId when calling patchEventInternalNote' - ); - } - // verify the required parameter 'noteId' is set - if ($noteId === null || (is_array($noteId) && count($noteId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $noteId when calling patchEventInternalNote' + 'Missing the required parameter $eventId when calling patchEvent' ); } - // verify the required parameter 'internalNotesPatchNotePayload' is set - if ($internalNotesPatchNotePayload === null || (is_array($internalNotesPatchNotePayload) && count($internalNotesPatchNotePayload) === 0)) { + // verify the required parameter 'eventsPatchEventPayload' is set + if ($eventsPatchEventPayload === null || (is_array($eventsPatchEventPayload) && count($eventsPatchEventPayload) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $internalNotesPatchNotePayload when calling patchEventInternalNote' + 'Missing the required parameter $eventsPatchEventPayload when calling patchEvent' ); } - $resourcePath = '/crm/api/v1/events/{eventId}/notes/{noteId}'; + $resourcePath = '/crm/api/v1/events/{eventId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4090,19 +4114,11 @@ protected function patchEventInternalNoteRequest($eventId, $noteId, $internalNot $resourcePath ); } - // path params - if ($noteId !== null) { - $resourcePath = str_replace( - '{' . 'noteId' . '}', - ObjectSerializer::toPathValue($noteId), - $resourcePath - ); - } // body params $_tempBody = null; - if (isset($internalNotesPatchNotePayload)) { - $_tempBody = $internalNotesPatchNotePayload; + if (isset($eventsPatchEventPayload)) { + $_tempBody = $eventsPatchEventPayload; } if ($multipart) { @@ -4128,10 +4144,13 @@ protected function patchEventInternalNoteRequest($eventId, $noteId, $internalNot if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -4171,40 +4190,42 @@ protected function patchEventInternalNoteRequest($eventId, $noteId, $internalNot } /** - * Operation softDeleteEventInternalNote + * Operation patchEventInternalNote * - * Soft delete an internal note for and event. + * Add an internal note to and event. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param string $noteId Note unique identifier. (required) + * @param int $noteId Note unique identifier. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload internalNotesPatchNotePayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function softDeleteEventInternalNote($eventId, $noteId, $acceptLanguage = null) + public function patchEventInternalNote($eventId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) { - list($response) = $this->softDeleteEventInternalNoteWithHttpInfo($eventId, $noteId, $acceptLanguage); + list($response) = $this->patchEventInternalNoteWithHttpInfo($eventId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage); return $response; } /** - * Operation softDeleteEventInternalNoteWithHttpInfo + * Operation patchEventInternalNoteWithHttpInfo * - * Soft delete an internal note for and event. + * Add an internal note to and event. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param string $noteId Note unique identifier. (required) + * @param int $noteId Note unique identifier. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function softDeleteEventInternalNoteWithHttpInfo($eventId, $noteId, $acceptLanguage = null) + public function patchEventInternalNoteWithHttpInfo($eventId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) { - $request = $this->softDeleteEventInternalNoteRequest($eventId, $noteId, $acceptLanguage); + $request = $this->patchEventInternalNoteRequest($eventId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage); try { $options = $this->createHttpClientOption(); @@ -4237,14 +4258,14 @@ public function softDeleteEventInternalNoteWithHttpInfo($eventId, $noteId, $acce $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('object' === '\SplFileObject') { + if ('\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, 'object', []), + ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -4286,7 +4307,7 @@ public function softDeleteEventInternalNoteWithHttpInfo($eventId, $noteId, $acce ]; } - $returnType = 'object'; + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -4305,7 +4326,7 @@ public function softDeleteEventInternalNoteWithHttpInfo($eventId, $noteId, $acce case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'object', + '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -4340,20 +4361,21 @@ public function softDeleteEventInternalNoteWithHttpInfo($eventId, $noteId, $acce } /** - * Operation softDeleteEventInternalNoteAsync + * Operation patchEventInternalNoteAsync * - * Soft delete an internal note for and event. + * Add an internal note to and event. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param string $noteId Note unique identifier. (required) + * @param int $noteId Note unique identifier. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function softDeleteEventInternalNoteAsync($eventId, $noteId, $acceptLanguage = null) + public function patchEventInternalNoteAsync($eventId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) { - return $this->softDeleteEventInternalNoteAsyncWithHttpInfo($eventId, $noteId, $acceptLanguage) + return $this->patchEventInternalNoteAsyncWithHttpInfo($eventId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage) ->then( function ($response) { return $response[0]; @@ -4362,21 +4384,22 @@ function ($response) { } /** - * Operation softDeleteEventInternalNoteAsyncWithHttpInfo + * Operation patchEventInternalNoteAsyncWithHttpInfo * - * Soft delete an internal note for and event. + * Add an internal note to and event. * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param string $noteId Note unique identifier. (required) + * @param int $noteId Note unique identifier. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function softDeleteEventInternalNoteAsyncWithHttpInfo($eventId, $noteId, $acceptLanguage = null) + public function patchEventInternalNoteAsyncWithHttpInfo($eventId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) { - $returnType = 'object'; - $request = $this->softDeleteEventInternalNoteRequest($eventId, $noteId, $acceptLanguage); + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse'; + $request = $this->patchEventInternalNoteRequest($eventId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -4413,31 +4436,38 @@ function ($exception) { } /** - * Create request for operation 'softDeleteEventInternalNote' + * Create request for operation 'patchEventInternalNote' * * @param string $eventId Event unique identifier. For recurrence occurrence/exception, eventId is suffixed with the original start date of the occurrence. For example 999_20180101. (required) - * @param string $noteId Note unique identifier. (required) + * @param int $noteId Note unique identifier. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function softDeleteEventInternalNoteRequest($eventId, $noteId, $acceptLanguage = null) + protected function patchEventInternalNoteRequest($eventId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) { // verify the required parameter 'eventId' is set if ($eventId === null || (is_array($eventId) && count($eventId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $eventId when calling softDeleteEventInternalNote' + 'Missing the required parameter $eventId when calling patchEventInternalNote' ); } // verify the required parameter 'noteId' is set if ($noteId === null || (is_array($noteId) && count($noteId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $noteId when calling softDeleteEventInternalNote' + 'Missing the required parameter $noteId when calling patchEventInternalNote' + ); + } + // verify the required parameter 'internalNotesPatchNotePayload' is set + if ($internalNotesPatchNotePayload === null || (is_array($internalNotesPatchNotePayload) && count($internalNotesPatchNotePayload) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $internalNotesPatchNotePayload when calling patchEventInternalNote' ); } - $resourcePath = '/crm/api/v1/events/{eventId}/notes/{noteId}/softDelete'; + $resourcePath = '/crm/api/v1/events/{eventId}/notes/{noteId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -4469,6 +4499,9 @@ protected function softDeleteEventInternalNoteRequest($eventId, $noteId, $accept // body params $_tempBody = null; + if (isset($internalNotesPatchNotePayload)) { + $_tempBody = $internalNotesPatchNotePayload; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -4477,7 +4510,7 @@ protected function softDeleteEventInternalNoteRequest($eventId, $noteId, $accept } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -4493,10 +4526,13 @@ protected function softDeleteEventInternalNoteRequest($eventId, $noteId, $accept if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -4528,7 +4564,7 @@ protected function softDeleteEventInternalNoteRequest($eventId, $noteId, $accept $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -4830,10 +4866,13 @@ protected function transferEventToCompletedRequest($eventId) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); diff --git a/lib/Api/GatewaysApi.php b/lib/Api/GatewaysApi.php index 2c223c98..79703ab6 100644 --- a/lib/Api/GatewaysApi.php +++ b/lib/Api/GatewaysApi.php @@ -421,10 +421,13 @@ protected function createEquisoftAnalyzeAccessRequest($gatewaysAccessesCreateEqu if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -754,10 +757,13 @@ protected function deleteEquisoftAnalyzeAccessRequest($accessId) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1104,10 +1110,13 @@ protected function listEquisoftAnalyzeAccessesRequest($userUuid = null) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1433,10 +1442,13 @@ protected function listGenericCredentialsRequest($gatewayName, $includeSsn = nul if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1800,10 +1812,13 @@ protected function patchEquisoftAnalyzeAccessRequest($accessId, $gatewaysAccesse if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); diff --git a/lib/Api/LegacyDocumentApi.php b/lib/Api/LegacyDocumentApi.php index ea20d63b..84524207 100644 --- a/lib/Api/LegacyDocumentApi.php +++ b/lib/Api/LegacyDocumentApi.php @@ -425,10 +425,13 @@ protected function addDocumentRequest($legacyDocumentDocumentPayloadRequest) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -785,10 +788,13 @@ protected function deleteDocumentRequest($id) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1145,10 +1151,13 @@ protected function deleteDocumentFileRequest($id) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1505,10 +1514,13 @@ protected function downloadDocumentFileRequest($id) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1865,10 +1877,13 @@ protected function getDocumentRequest($id) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2163,10 +2178,13 @@ protected function getDocumentListRequest() if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2515,10 +2533,13 @@ protected function updateDocumentRequest($legacyDocumentDocumentPayloadRequest) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2889,10 +2910,13 @@ protected function uploadDocumentFileRequest($id, $legacyDocumentUploadDocumentF if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); diff --git a/lib/Api/LegacyProvisioningApi.php b/lib/Api/LegacyProvisioningApi.php index 9d8984bb..e3e28302 100644 --- a/lib/Api/LegacyProvisioningApi.php +++ b/lib/Api/LegacyProvisioningApi.php @@ -433,10 +433,13 @@ protected function getOrganizationRequest($orgId) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -731,10 +734,13 @@ protected function getOrganizationListRequest() if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); diff --git a/lib/Api/MovementApi.php b/lib/Api/MovementApi.php index dbb26ea6..411f2c42 100644 --- a/lib/Api/MovementApi.php +++ b/lib/Api/MovementApi.php @@ -421,10 +421,13 @@ protected function addMovementRequest($movementMovementPayload) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -754,10 +757,13 @@ protected function cancelMovementRequest($movementId) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1087,10 +1093,13 @@ protected function deleteMovementRequest($movementId) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1420,10 +1429,13 @@ protected function getMovementStatusRequest($movementId) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1734,10 +1746,13 @@ protected function listMovementsRequest() if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); diff --git a/lib/Api/TasksApi.php b/lib/Api/TasksApi.php index 8cbb7ea5..bf3e7179 100644 --- a/lib/Api/TasksApi.php +++ b/lib/Api/TasksApi.php @@ -116,38 +116,40 @@ public function getConfig() } /** - * Operation createTask + * Operation archiveTaskInternalNote * - * Create a task. + * Archive an internal note for a task. * - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskPayload $tasksCreateTaskPayload tasksCreateTaskPayload (required) + * @param string $taskId Task unique identifier. (required) + * @param int $noteId Note unique identifier. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return object|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function createTask($tasksCreateTaskPayload, $acceptLanguage = null) + public function archiveTaskInternalNote($taskId, $noteId, $acceptLanguage = null) { - list($response) = $this->createTaskWithHttpInfo($tasksCreateTaskPayload, $acceptLanguage); + list($response) = $this->archiveTaskInternalNoteWithHttpInfo($taskId, $noteId, $acceptLanguage); return $response; } /** - * Operation createTaskWithHttpInfo + * Operation archiveTaskInternalNoteWithHttpInfo * - * Create a task. + * Archive an internal note for a task. * - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskPayload $tasksCreateTaskPayload (required) + * @param string $taskId Task unique identifier. (required) + * @param int $noteId Note unique identifier. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of object|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function createTaskWithHttpInfo($tasksCreateTaskPayload, $acceptLanguage = null) + public function archiveTaskInternalNoteWithHttpInfo($taskId, $noteId, $acceptLanguage = null) { - $request = $this->createTaskRequest($tasksCreateTaskPayload, $acceptLanguage); + $request = $this->archiveTaskInternalNoteRequest($taskId, $noteId, $acceptLanguage); try { $options = $this->createHttpClientOption(); @@ -180,18 +182,18 @@ public function createTaskWithHttpInfo($tasksCreateTaskPayload, $acceptLanguage $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskResponse' === '\SplFileObject') { + if ('object' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskResponse', []), + ObjectSerializer::deserialize($content, 'object', []), $response->getStatusCode(), $response->getHeaders() ]; - case 400: + case 401: if ('\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -203,7 +205,7 @@ public function createTaskWithHttpInfo($tasksCreateTaskPayload, $acceptLanguage $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 404: if ('\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -229,7 +231,7 @@ public function createTaskWithHttpInfo($tasksCreateTaskPayload, $acceptLanguage ]; } - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskResponse'; + $returnType = 'object'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -248,12 +250,12 @@ public function createTaskWithHttpInfo($tasksCreateTaskPayload, $acceptLanguage case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskResponse', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 400: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse', @@ -261,7 +263,7 @@ public function createTaskWithHttpInfo($tasksCreateTaskPayload, $acceptLanguage ); $e->setResponseObject($data); break; - case 401: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse', @@ -283,19 +285,20 @@ public function createTaskWithHttpInfo($tasksCreateTaskPayload, $acceptLanguage } /** - * Operation createTaskAsync + * Operation archiveTaskInternalNoteAsync * - * Create a task. + * Archive an internal note for a task. * - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskPayload $tasksCreateTaskPayload (required) + * @param string $taskId Task unique identifier. (required) + * @param int $noteId Note unique identifier. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createTaskAsync($tasksCreateTaskPayload, $acceptLanguage = null) + public function archiveTaskInternalNoteAsync($taskId, $noteId, $acceptLanguage = null) { - return $this->createTaskAsyncWithHttpInfo($tasksCreateTaskPayload, $acceptLanguage) + return $this->archiveTaskInternalNoteAsyncWithHttpInfo($taskId, $noteId, $acceptLanguage) ->then( function ($response) { return $response[0]; @@ -304,20 +307,21 @@ function ($response) { } /** - * Operation createTaskAsyncWithHttpInfo + * Operation archiveTaskInternalNoteAsyncWithHttpInfo * - * Create a task. + * Archive an internal note for a task. * - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskPayload $tasksCreateTaskPayload (required) + * @param string $taskId Task unique identifier. (required) + * @param int $noteId Note unique identifier. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createTaskAsyncWithHttpInfo($tasksCreateTaskPayload, $acceptLanguage = null) + public function archiveTaskInternalNoteAsyncWithHttpInfo($taskId, $noteId, $acceptLanguage = null) { - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskResponse'; - $request = $this->createTaskRequest($tasksCreateTaskPayload, $acceptLanguage); + $returnType = 'object'; + $request = $this->archiveTaskInternalNoteRequest($taskId, $noteId, $acceptLanguage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -354,24 +358,31 @@ function ($exception) { } /** - * Create request for operation 'createTask' + * Create request for operation 'archiveTaskInternalNote' * - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskPayload $tasksCreateTaskPayload (required) + * @param string $taskId Task unique identifier. (required) + * @param int $noteId Note unique identifier. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createTaskRequest($tasksCreateTaskPayload, $acceptLanguage = null) + protected function archiveTaskInternalNoteRequest($taskId, $noteId, $acceptLanguage = null) { - // verify the required parameter 'tasksCreateTaskPayload' is set - if ($tasksCreateTaskPayload === null || (is_array($tasksCreateTaskPayload) && count($tasksCreateTaskPayload) === 0)) { + // verify the required parameter 'taskId' is set + if ($taskId === null || (is_array($taskId) && count($taskId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $tasksCreateTaskPayload when calling createTask' + 'Missing the required parameter $taskId when calling archiveTaskInternalNote' + ); + } + // verify the required parameter 'noteId' is set + if ($noteId === null || (is_array($noteId) && count($noteId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $noteId when calling archiveTaskInternalNote' ); } - $resourcePath = '/crm/api/v1/tasks'; + $resourcePath = '/crm/api/v1/tasks/{taskId}/notes/{noteId}/archive'; $formParams = []; $queryParams = []; $headerParams = []; @@ -384,12 +395,25 @@ protected function createTaskRequest($tasksCreateTaskPayload, $acceptLanguage = $headerParams['Accept-Language'] = ObjectSerializer::toHeaderValue($acceptLanguage); } + // path params + if ($taskId !== null) { + $resourcePath = str_replace( + '{' . 'taskId' . '}', + ObjectSerializer::toPathValue($taskId), + $resourcePath + ); + } + // path params + if ($noteId !== null) { + $resourcePath = str_replace( + '{' . 'noteId' . '}', + ObjectSerializer::toPathValue($noteId), + $resourcePath + ); + } // body params $_tempBody = null; - if (isset($tasksCreateTaskPayload)) { - $_tempBody = $tasksCreateTaskPayload; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -398,7 +422,7 @@ protected function createTaskRequest($tasksCreateTaskPayload, $acceptLanguage = } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -414,10 +438,13 @@ protected function createTaskRequest($tasksCreateTaskPayload, $acceptLanguage = if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -457,40 +484,38 @@ protected function createTaskRequest($tasksCreateTaskPayload, $acceptLanguage = } /** - * Operation createTaskInternalNote + * Operation createTask * - * Add an internal note to a task. + * Create a task. * - * @param string $taskId Task unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload internalNotesCreateNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskPayload $tasksCreateTaskPayload tasksCreateTaskPayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return \Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function createTaskInternalNote($taskId, $internalNotesCreateNotePayload, $acceptLanguage = null) + public function createTask($tasksCreateTaskPayload, $acceptLanguage = null) { - list($response) = $this->createTaskInternalNoteWithHttpInfo($taskId, $internalNotesCreateNotePayload, $acceptLanguage); + list($response) = $this->createTaskWithHttpInfo($tasksCreateTaskPayload, $acceptLanguage); return $response; } /** - * Operation createTaskInternalNoteWithHttpInfo + * Operation createTaskWithHttpInfo * - * Add an internal note to a task. + * Create a task. * - * @param string $taskId Task unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskPayload $tasksCreateTaskPayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function createTaskInternalNoteWithHttpInfo($taskId, $internalNotesCreateNotePayload, $acceptLanguage = null) + public function createTaskWithHttpInfo($tasksCreateTaskPayload, $acceptLanguage = null) { - $request = $this->createTaskInternalNoteRequest($taskId, $internalNotesCreateNotePayload, $acceptLanguage); + $request = $this->createTaskRequest($tasksCreateTaskPayload, $acceptLanguage); try { $options = $this->createHttpClientOption(); @@ -523,18 +548,18 @@ public function createTaskInternalNoteWithHttpInfo($taskId, $internalNotesCreate $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse' === '\SplFileObject') { + if ('\Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse', []), + ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 400: if ('\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -546,7 +571,7 @@ public function createTaskInternalNoteWithHttpInfo($taskId, $internalNotesCreate $response->getStatusCode(), $response->getHeaders() ]; - case 404: + case 401: if ('\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -572,7 +597,7 @@ public function createTaskInternalNoteWithHttpInfo($taskId, $internalNotesCreate ]; } - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse'; + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -591,12 +616,12 @@ public function createTaskInternalNoteWithHttpInfo($taskId, $internalNotesCreate case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse', + '\Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse', @@ -604,7 +629,7 @@ public function createTaskInternalNoteWithHttpInfo($taskId, $internalNotesCreate ); $e->setResponseObject($data); break; - case 404: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse', @@ -626,20 +651,19 @@ public function createTaskInternalNoteWithHttpInfo($taskId, $internalNotesCreate } /** - * Operation createTaskInternalNoteAsync + * Operation createTaskAsync * - * Add an internal note to a task. + * Create a task. * - * @param string $taskId Task unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskPayload $tasksCreateTaskPayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createTaskInternalNoteAsync($taskId, $internalNotesCreateNotePayload, $acceptLanguage = null) + public function createTaskAsync($tasksCreateTaskPayload, $acceptLanguage = null) { - return $this->createTaskInternalNoteAsyncWithHttpInfo($taskId, $internalNotesCreateNotePayload, $acceptLanguage) + return $this->createTaskAsyncWithHttpInfo($tasksCreateTaskPayload, $acceptLanguage) ->then( function ($response) { return $response[0]; @@ -648,21 +672,20 @@ function ($response) { } /** - * Operation createTaskInternalNoteAsyncWithHttpInfo + * Operation createTaskAsyncWithHttpInfo * - * Add an internal note to a task. + * Create a task. * - * @param string $taskId Task unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskPayload $tasksCreateTaskPayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createTaskInternalNoteAsyncWithHttpInfo($taskId, $internalNotesCreateNotePayload, $acceptLanguage = null) + public function createTaskAsyncWithHttpInfo($tasksCreateTaskPayload, $acceptLanguage = null) { - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse'; - $request = $this->createTaskInternalNoteRequest($taskId, $internalNotesCreateNotePayload, $acceptLanguage); + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskResponse'; + $request = $this->createTaskRequest($tasksCreateTaskPayload, $acceptLanguage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -699,31 +722,24 @@ function ($exception) { } /** - * Create request for operation 'createTaskInternalNote' + * Create request for operation 'createTask' * - * @param string $taskId Task unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksCreateTaskPayload $tasksCreateTaskPayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function createTaskInternalNoteRequest($taskId, $internalNotesCreateNotePayload, $acceptLanguage = null) + protected function createTaskRequest($tasksCreateTaskPayload, $acceptLanguage = null) { - // verify the required parameter 'taskId' is set - if ($taskId === null || (is_array($taskId) && count($taskId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $taskId when calling createTaskInternalNote' - ); - } - // verify the required parameter 'internalNotesCreateNotePayload' is set - if ($internalNotesCreateNotePayload === null || (is_array($internalNotesCreateNotePayload) && count($internalNotesCreateNotePayload) === 0)) { + // verify the required parameter 'tasksCreateTaskPayload' is set + if ($tasksCreateTaskPayload === null || (is_array($tasksCreateTaskPayload) && count($tasksCreateTaskPayload) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $internalNotesCreateNotePayload when calling createTaskInternalNote' + 'Missing the required parameter $tasksCreateTaskPayload when calling createTask' ); } - $resourcePath = '/crm/api/v1/tasks/{taskId}/notes'; + $resourcePath = '/crm/api/v1/tasks'; $formParams = []; $queryParams = []; $headerParams = []; @@ -736,19 +752,11 @@ protected function createTaskInternalNoteRequest($taskId, $internalNotesCreateNo $headerParams['Accept-Language'] = ObjectSerializer::toHeaderValue($acceptLanguage); } - // path params - if ($taskId !== null) { - $resourcePath = str_replace( - '{' . 'taskId' . '}', - ObjectSerializer::toPathValue($taskId), - $resourcePath - ); - } // body params $_tempBody = null; - if (isset($internalNotesCreateNotePayload)) { - $_tempBody = $internalNotesCreateNotePayload; + if (isset($tasksCreateTaskPayload)) { + $_tempBody = $tasksCreateTaskPayload; } if ($multipart) { @@ -774,10 +782,13 @@ protected function createTaskInternalNoteRequest($taskId, $internalNotesCreateNo if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -817,36 +828,40 @@ protected function createTaskInternalNoteRequest($taskId, $internalNotesCreateNo } /** - * Operation deleteTask + * Operation createTaskInternalNote * - * Delete a task. + * Add an internal note to a task. * - * @param string $taskId taskId (required) + * @param string $taskId Task unique identifier. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload internalNotesCreateNotePayload (required) + * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function deleteTask($taskId) + public function createTaskInternalNote($taskId, $internalNotesCreateNotePayload, $acceptLanguage = null) { - list($response) = $this->deleteTaskWithHttpInfo($taskId); + list($response) = $this->createTaskInternalNoteWithHttpInfo($taskId, $internalNotesCreateNotePayload, $acceptLanguage); return $response; } /** - * Operation deleteTaskWithHttpInfo + * Operation createTaskInternalNoteWithHttpInfo * - * Delete a task. + * Add an internal note to a task. * - * @param string $taskId (required) + * @param string $taskId Task unique identifier. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload (required) + * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function deleteTaskWithHttpInfo($taskId) + public function createTaskInternalNoteWithHttpInfo($taskId, $internalNotesCreateNotePayload, $acceptLanguage = null) { - $request = $this->deleteTaskRequest($taskId); + $request = $this->createTaskInternalNoteRequest($taskId, $internalNotesCreateNotePayload, $acceptLanguage); try { $options = $this->createHttpClientOption(); @@ -879,14 +894,14 @@ public function deleteTaskWithHttpInfo($taskId) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('object' === '\SplFileObject') { + if ('\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, 'object', []), + ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -928,7 +943,7 @@ public function deleteTaskWithHttpInfo($taskId) ]; } - $returnType = 'object'; + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -947,7 +962,7 @@ public function deleteTaskWithHttpInfo($taskId) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'object', + '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -982,18 +997,20 @@ public function deleteTaskWithHttpInfo($taskId) } /** - * Operation deleteTaskAsync + * Operation createTaskInternalNoteAsync * - * Delete a task. + * Add an internal note to a task. * - * @param string $taskId (required) + * @param string $taskId Task unique identifier. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload (required) + * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteTaskAsync($taskId) + public function createTaskInternalNoteAsync($taskId, $internalNotesCreateNotePayload, $acceptLanguage = null) { - return $this->deleteTaskAsyncWithHttpInfo($taskId) + return $this->createTaskInternalNoteAsyncWithHttpInfo($taskId, $internalNotesCreateNotePayload, $acceptLanguage) ->then( function ($response) { return $response[0]; @@ -1002,19 +1019,21 @@ function ($response) { } /** - * Operation deleteTaskAsyncWithHttpInfo + * Operation createTaskInternalNoteAsyncWithHttpInfo * - * Delete a task. + * Add an internal note to a task. * - * @param string $taskId (required) + * @param string $taskId Task unique identifier. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload (required) + * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function deleteTaskAsyncWithHttpInfo($taskId) + public function createTaskInternalNoteAsyncWithHttpInfo($taskId, $internalNotesCreateNotePayload, $acceptLanguage = null) { - $returnType = 'object'; - $request = $this->deleteTaskRequest($taskId); + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNoteResponse'; + $request = $this->createTaskInternalNoteRequest($taskId, $internalNotesCreateNotePayload, $acceptLanguage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1051,23 +1070,31 @@ function ($exception) { } /** - * Create request for operation 'deleteTask' + * Create request for operation 'createTaskInternalNote' * - * @param string $taskId (required) + * @param string $taskId Task unique identifier. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesCreateNotePayload $internalNotesCreateNotePayload (required) + * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function deleteTaskRequest($taskId) + protected function createTaskInternalNoteRequest($taskId, $internalNotesCreateNotePayload, $acceptLanguage = null) { // verify the required parameter 'taskId' is set if ($taskId === null || (is_array($taskId) && count($taskId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $taskId when calling deleteTask' + 'Missing the required parameter $taskId when calling createTaskInternalNote' + ); + } + // verify the required parameter 'internalNotesCreateNotePayload' is set + if ($internalNotesCreateNotePayload === null || (is_array($internalNotesCreateNotePayload) && count($internalNotesCreateNotePayload) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $internalNotesCreateNotePayload when calling createTaskInternalNote' ); } - $resourcePath = '/crm/api/v1/tasks/{taskId}'; + $resourcePath = '/crm/api/v1/tasks/{taskId}/notes'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1075,6 +1102,10 @@ protected function deleteTaskRequest($taskId) $multipart = false; + // header params + if ($acceptLanguage !== null) { + $headerParams['Accept-Language'] = ObjectSerializer::toHeaderValue($acceptLanguage); + } // path params if ($taskId !== null) { @@ -1087,6 +1118,9 @@ protected function deleteTaskRequest($taskId) // body params $_tempBody = null; + if (isset($internalNotesCreateNotePayload)) { + $_tempBody = $internalNotesCreateNotePayload; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -1095,7 +1129,7 @@ protected function deleteTaskRequest($taskId) } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -1111,10 +1145,13 @@ protected function deleteTaskRequest($taskId) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1146,7 +1183,7 @@ protected function deleteTaskRequest($taskId) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'DELETE', + 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1154,38 +1191,36 @@ protected function deleteTaskRequest($taskId) } /** - * Operation getTask + * Operation deleteTask * - * Return the detail of a task. + * Delete a task. * * @param string $taskId taskId (required) - * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Equisoft\SDK\EquisoftConnect\Model\TasksTask|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return object|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function getTask($taskId, $acceptLanguage = null) + public function deleteTask($taskId) { - list($response) = $this->getTaskWithHttpInfo($taskId, $acceptLanguage); + list($response) = $this->deleteTaskWithHttpInfo($taskId); return $response; } /** - * Operation getTaskWithHttpInfo + * Operation deleteTaskWithHttpInfo * - * Return the detail of a task. + * Delete a task. * * @param string $taskId (required) - * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Equisoft\SDK\EquisoftConnect\Model\TasksTask|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of object|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getTaskWithHttpInfo($taskId, $acceptLanguage = null) + public function deleteTaskWithHttpInfo($taskId) { - $request = $this->getTaskRequest($taskId, $acceptLanguage); + $request = $this->deleteTaskRequest($taskId); try { $options = $this->createHttpClientOption(); @@ -1218,14 +1253,14 @@ public function getTaskWithHttpInfo($taskId, $acceptLanguage = null) $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Equisoft\SDK\EquisoftConnect\Model\TasksTask' === '\SplFileObject') { + if ('object' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\TasksTask', []), + ObjectSerializer::deserialize($content, 'object', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1267,7 +1302,7 @@ public function getTaskWithHttpInfo($taskId, $acceptLanguage = null) ]; } - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\TasksTask'; + $returnType = 'object'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1286,7 +1321,7 @@ public function getTaskWithHttpInfo($taskId, $acceptLanguage = null) case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Equisoft\SDK\EquisoftConnect\Model\TasksTask', + 'object', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1321,19 +1356,18 @@ public function getTaskWithHttpInfo($taskId, $acceptLanguage = null) } /** - * Operation getTaskAsync + * Operation deleteTaskAsync * - * Return the detail of a task. + * Delete a task. * * @param string $taskId (required) - * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTaskAsync($taskId, $acceptLanguage = null) + public function deleteTaskAsync($taskId) { - return $this->getTaskAsyncWithHttpInfo($taskId, $acceptLanguage) + return $this->deleteTaskAsyncWithHttpInfo($taskId) ->then( function ($response) { return $response[0]; @@ -1342,20 +1376,19 @@ function ($response) { } /** - * Operation getTaskAsyncWithHttpInfo + * Operation deleteTaskAsyncWithHttpInfo * - * Return the detail of a task. + * Delete a task. * * @param string $taskId (required) - * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTaskAsyncWithHttpInfo($taskId, $acceptLanguage = null) + public function deleteTaskAsyncWithHttpInfo($taskId) { - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\TasksTask'; - $request = $this->getTaskRequest($taskId, $acceptLanguage); + $returnType = 'object'; + $request = $this->deleteTaskRequest($taskId); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1392,20 +1425,19 @@ function ($exception) { } /** - * Create request for operation 'getTask' + * Create request for operation 'deleteTask' * * @param string $taskId (required) - * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getTaskRequest($taskId, $acceptLanguage = null) + protected function deleteTaskRequest($taskId) { // verify the required parameter 'taskId' is set if ($taskId === null || (is_array($taskId) && count($taskId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $taskId when calling getTask' + 'Missing the required parameter $taskId when calling deleteTask' ); } @@ -1417,10 +1449,6 @@ protected function getTaskRequest($taskId, $acceptLanguage = null) $multipart = false; - // header params - if ($acceptLanguage !== null) { - $headerParams['Accept-Language'] = ObjectSerializer::toHeaderValue($acceptLanguage); - } // path params if ($taskId !== null) { @@ -1457,10 +1485,13 @@ protected function getTaskRequest($taskId, $acceptLanguage = null) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1492,7 +1523,7 @@ protected function getTaskRequest($taskId, $acceptLanguage = null) $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'GET', + 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1500,40 +1531,38 @@ protected function getTaskRequest($taskId, $acceptLanguage = null) } /** - * Operation getTaskInternalNoteList + * Operation getTask * - * Get the internal notes list for a task. + * Return the detail of a task. * * @param string $taskId taskId (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return \Equisoft\SDK\EquisoftConnect\Model\TasksTask|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function getTaskInternalNoteList($taskId, $history = null, $acceptLanguage = null) + public function getTask($taskId, $acceptLanguage = null) { - list($response) = $this->getTaskInternalNoteListWithHttpInfo($taskId, $history, $acceptLanguage); + list($response) = $this->getTaskWithHttpInfo($taskId, $acceptLanguage); return $response; } /** - * Operation getTaskInternalNoteListWithHttpInfo + * Operation getTaskWithHttpInfo * - * Get the internal notes list for a task. + * Return the detail of a task. * * @param string $taskId (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Equisoft\SDK\EquisoftConnect\Model\TasksTask|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function getTaskInternalNoteListWithHttpInfo($taskId, $history = null, $acceptLanguage = null) + public function getTaskWithHttpInfo($taskId, $acceptLanguage = null) { - $request = $this->getTaskInternalNoteListRequest($taskId, $history, $acceptLanguage); + $request = $this->getTaskRequest($taskId, $acceptLanguage); try { $options = $this->createHttpClientOption(); @@ -1566,14 +1595,14 @@ public function getTaskInternalNoteListWithHttpInfo($taskId, $history = null, $a $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList' === '\SplFileObject') { + if ('\Equisoft\SDK\EquisoftConnect\Model\TasksTask' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList', []), + ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\TasksTask', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -1615,7 +1644,7 @@ public function getTaskInternalNoteListWithHttpInfo($taskId, $history = null, $a ]; } - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList'; + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\TasksTask'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -1634,7 +1663,7 @@ public function getTaskInternalNoteListWithHttpInfo($taskId, $history = null, $a case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList', + '\Equisoft\SDK\EquisoftConnect\Model\TasksTask', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -1669,20 +1698,19 @@ public function getTaskInternalNoteListWithHttpInfo($taskId, $history = null, $a } /** - * Operation getTaskInternalNoteListAsync + * Operation getTaskAsync * - * Get the internal notes list for a task. + * Return the detail of a task. * * @param string $taskId (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTaskInternalNoteListAsync($taskId, $history = null, $acceptLanguage = null) + public function getTaskAsync($taskId, $acceptLanguage = null) { - return $this->getTaskInternalNoteListAsyncWithHttpInfo($taskId, $history, $acceptLanguage) + return $this->getTaskAsyncWithHttpInfo($taskId, $acceptLanguage) ->then( function ($response) { return $response[0]; @@ -1691,21 +1719,20 @@ function ($response) { } /** - * Operation getTaskInternalNoteListAsyncWithHttpInfo + * Operation getTaskAsyncWithHttpInfo * - * Get the internal notes list for a task. + * Return the detail of a task. * * @param string $taskId (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getTaskInternalNoteListAsyncWithHttpInfo($taskId, $history = null, $acceptLanguage = null) + public function getTaskAsyncWithHttpInfo($taskId, $acceptLanguage = null) { - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList'; - $request = $this->getTaskInternalNoteListRequest($taskId, $history, $acceptLanguage); + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\TasksTask'; + $request = $this->getTaskRequest($taskId, $acceptLanguage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1742,42 +1769,30 @@ function ($exception) { } /** - * Create request for operation 'getTaskInternalNoteList' + * Create request for operation 'getTask' * * @param string $taskId (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function getTaskInternalNoteListRequest($taskId, $history = null, $acceptLanguage = null) + protected function getTaskRequest($taskId, $acceptLanguage = null) { // verify the required parameter 'taskId' is set if ($taskId === null || (is_array($taskId) && count($taskId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $taskId when calling getTaskInternalNoteList' + 'Missing the required parameter $taskId when calling getTask' ); } - $resourcePath = '/crm/api/v1/tasks/{taskId}/notes'; + $resourcePath = '/crm/api/v1/tasks/{taskId}'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - if ($history !== null) { - if('form' === 'form' && is_array($history)) { - foreach($history as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['history'] = $history; - } - } // header params if ($acceptLanguage !== null) { @@ -1819,10 +1834,13 @@ protected function getTaskInternalNoteListRequest($taskId, $history = null, $acc if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -1862,54 +1880,40 @@ protected function getTaskInternalNoteListRequest($taskId, $history = null, $acc } /** - * Operation listTasks + * Operation getTaskInternalNoteList * - * List or search tasks. + * Get the internal notes list for a task. * - * @param string $ownerId Owner ID filter param. (optional) - * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) - * @param \DateTime $minDueDate Minimum (inclusive) due date of the task. (optional) - * @param \DateTime $maxDueDate Maximum (exclusive) due date of the task. (optional) - * @param bool $isCompleted If true, include only completed tasks. If false, include only TODO tasks. If not set or null, include both. (optional) - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksDueDateFilter $dueDateFilter Include or exclude tasks with or without due date. (optional) - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksOrderByType $orderBy Specify the order of the results. (optional) - * @param string $pageToken Token to specify which page to fetch. (optional) - * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) + * @param string $taskId taskId (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Equisoft\SDK\EquisoftConnect\Model\TasksListTaskResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return \Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function listTasks($ownerId = null, $contactIds = null, $minDueDate = null, $maxDueDate = null, $isCompleted = null, $dueDateFilter = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) + public function getTaskInternalNoteList($taskId, $history = null, $acceptLanguage = null) { - list($response) = $this->listTasksWithHttpInfo($ownerId, $contactIds, $minDueDate, $maxDueDate, $isCompleted, $dueDateFilter, $orderBy, $pageToken, $maxResults, $acceptLanguage); + list($response) = $this->getTaskInternalNoteListWithHttpInfo($taskId, $history, $acceptLanguage); return $response; } /** - * Operation listTasksWithHttpInfo + * Operation getTaskInternalNoteListWithHttpInfo * - * List or search tasks. + * Get the internal notes list for a task. * - * @param string $ownerId Owner ID filter param. (optional) - * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) - * @param \DateTime $minDueDate Minimum (inclusive) due date of the task. (optional) - * @param \DateTime $maxDueDate Maximum (exclusive) due date of the task. (optional) - * @param bool $isCompleted If true, include only completed tasks. If false, include only TODO tasks. If not set or null, include both. (optional) - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksDueDateFilter $dueDateFilter Include or exclude tasks with or without due date. (optional) - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksOrderByType $orderBy Specify the order of the results. (optional) - * @param string $pageToken Token to specify which page to fetch. (optional) - * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) + * @param string $taskId (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Equisoft\SDK\EquisoftConnect\Model\TasksListTaskResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function listTasksWithHttpInfo($ownerId = null, $contactIds = null, $minDueDate = null, $maxDueDate = null, $isCompleted = null, $dueDateFilter = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) + public function getTaskInternalNoteListWithHttpInfo($taskId, $history = null, $acceptLanguage = null) { - $request = $this->listTasksRequest($ownerId, $contactIds, $minDueDate, $maxDueDate, $isCompleted, $dueDateFilter, $orderBy, $pageToken, $maxResults, $acceptLanguage); + $request = $this->getTaskInternalNoteListRequest($taskId, $history, $acceptLanguage); try { $options = $this->createHttpClientOption(); @@ -1942,18 +1946,18 @@ public function listTasksWithHttpInfo($ownerId = null, $contactIds = null, $minD $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Equisoft\SDK\EquisoftConnect\Model\TasksListTaskResponse' === '\SplFileObject') { + if ('\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\TasksListTaskResponse', []), + ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList', []), $response->getStatusCode(), $response->getHeaders() ]; - case 400: + case 401: if ('\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -1965,7 +1969,7 @@ public function listTasksWithHttpInfo($ownerId = null, $contactIds = null, $minD $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 404: if ('\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -1991,7 +1995,7 @@ public function listTasksWithHttpInfo($ownerId = null, $contactIds = null, $minD ]; } - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\TasksListTaskResponse'; + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -2010,12 +2014,12 @@ public function listTasksWithHttpInfo($ownerId = null, $contactIds = null, $minD case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Equisoft\SDK\EquisoftConnect\Model\TasksListTaskResponse', + '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 400: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse', @@ -2023,7 +2027,7 @@ public function listTasksWithHttpInfo($ownerId = null, $contactIds = null, $minD ); $e->setResponseObject($data); break; - case 401: + case 404: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse', @@ -2045,27 +2049,20 @@ public function listTasksWithHttpInfo($ownerId = null, $contactIds = null, $minD } /** - * Operation listTasksAsync + * Operation getTaskInternalNoteListAsync * - * List or search tasks. + * Get the internal notes list for a task. * - * @param string $ownerId Owner ID filter param. (optional) - * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) - * @param \DateTime $minDueDate Minimum (inclusive) due date of the task. (optional) - * @param \DateTime $maxDueDate Maximum (exclusive) due date of the task. (optional) - * @param bool $isCompleted If true, include only completed tasks. If false, include only TODO tasks. If not set or null, include both. (optional) - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksDueDateFilter $dueDateFilter Include or exclude tasks with or without due date. (optional) - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksOrderByType $orderBy Specify the order of the results. (optional) - * @param string $pageToken Token to specify which page to fetch. (optional) - * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) + * @param string $taskId (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listTasksAsync($ownerId = null, $contactIds = null, $minDueDate = null, $maxDueDate = null, $isCompleted = null, $dueDateFilter = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) + public function getTaskInternalNoteListAsync($taskId, $history = null, $acceptLanguage = null) { - return $this->listTasksAsyncWithHttpInfo($ownerId, $contactIds, $minDueDate, $maxDueDate, $isCompleted, $dueDateFilter, $orderBy, $pageToken, $maxResults, $acceptLanguage) + return $this->getTaskInternalNoteListAsyncWithHttpInfo($taskId, $history, $acceptLanguage) ->then( function ($response) { return $response[0]; @@ -2074,29 +2071,22 @@ function ($response) { } /** - * Operation listTasksAsyncWithHttpInfo + * Operation getTaskInternalNoteListAsyncWithHttpInfo * - * List or search tasks. + * Get the internal notes list for a task. * - * @param string $ownerId Owner ID filter param. (optional) - * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) - * @param \DateTime $minDueDate Minimum (inclusive) due date of the task. (optional) - * @param \DateTime $maxDueDate Maximum (exclusive) due date of the task. (optional) - * @param bool $isCompleted If true, include only completed tasks. If false, include only TODO tasks. If not set or null, include both. (optional) - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksDueDateFilter $dueDateFilter Include or exclude tasks with or without due date. (optional) - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksOrderByType $orderBy Specify the order of the results. (optional) - * @param string $pageToken Token to specify which page to fetch. (optional) - * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) + * @param string $taskId (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function listTasksAsyncWithHttpInfo($ownerId = null, $contactIds = null, $minDueDate = null, $maxDueDate = null, $isCompleted = null, $dueDateFilter = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) + public function getTaskInternalNoteListAsyncWithHttpInfo($taskId, $history = null, $acceptLanguage = null) { - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\TasksListTaskResponse'; - $request = $this->listTasksRequest($ownerId, $contactIds, $minDueDate, $maxDueDate, $isCompleted, $dueDateFilter, $orderBy, $pageToken, $maxResults, $acceptLanguage); - + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesNoteList'; + $request = $this->getTaskInternalNoteListRequest($taskId, $history, $acceptLanguage); + return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( @@ -2132,26 +2122,25 @@ function ($exception) { } /** - * Create request for operation 'listTasks' + * Create request for operation 'getTaskInternalNoteList' * - * @param string $ownerId Owner ID filter param. (optional) - * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) - * @param \DateTime $minDueDate Minimum (inclusive) due date of the task. (optional) - * @param \DateTime $maxDueDate Maximum (exclusive) due date of the task. (optional) - * @param bool $isCompleted If true, include only completed tasks. If false, include only TODO tasks. If not set or null, include both. (optional) - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksDueDateFilter $dueDateFilter Include or exclude tasks with or without due date. (optional) - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksOrderByType $orderBy Specify the order of the results. (optional) - * @param string $pageToken Token to specify which page to fetch. (optional) - * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) + * @param string $taskId (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesHistoryType $history Query all revisions or not. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function listTasksRequest($ownerId = null, $contactIds = null, $minDueDate = null, $maxDueDate = null, $isCompleted = null, $dueDateFilter = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) + protected function getTaskInternalNoteListRequest($taskId, $history = null, $acceptLanguage = null) { + // verify the required parameter 'taskId' is set + if ($taskId === null || (is_array($taskId) && count($taskId) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $taskId when calling getTaskInternalNoteList' + ); + } - $resourcePath = '/crm/api/v1/tasks'; + $resourcePath = '/crm/api/v1/tasks/{taskId}/notes'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2159,102 +2148,14 @@ protected function listTasksRequest($ownerId = null, $contactIds = null, $minDue $multipart = false; // query params - if ($ownerId !== null) { - if('form' === 'form' && is_array($ownerId)) { - foreach($ownerId as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['ownerId'] = $ownerId; - } - } - // query params - if ($contactIds !== null) { - if('form' === 'form' && is_array($contactIds)) { - foreach($contactIds as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['contactIds'] = $contactIds; - } - } - // query params - if ($minDueDate !== null) { - if('form' === 'form' && is_array($minDueDate)) { - foreach($minDueDate as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['minDueDate'] = $minDueDate; - } - } - // query params - if ($maxDueDate !== null) { - if('form' === 'form' && is_array($maxDueDate)) { - foreach($maxDueDate as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['maxDueDate'] = $maxDueDate; - } - } - // query params - if ($isCompleted !== null) { - if('form' === 'form' && is_array($isCompleted)) { - foreach($isCompleted as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['isCompleted'] = $isCompleted; - } - } - // query params - if ($dueDateFilter !== null) { - if('form' === 'form' && is_array($dueDateFilter)) { - foreach($dueDateFilter as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['dueDateFilter'] = $dueDateFilter; - } - } - // query params - if ($orderBy !== null) { - if('form' === 'form' && is_array($orderBy)) { - foreach($orderBy as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['orderBy'] = $orderBy; - } - } - // query params - if ($pageToken !== null) { - if('form' === 'form' && is_array($pageToken)) { - foreach($pageToken as $key => $value) { - $queryParams[$key] = $value; - } - } - else { - $queryParams['pageToken'] = $pageToken; - } - } - // query params - if ($maxResults !== null) { - if('form' === 'form' && is_array($maxResults)) { - foreach($maxResults as $key => $value) { + if ($history !== null) { + if('form' === 'form' && is_array($history)) { + foreach($history as $key => $value) { $queryParams[$key] = $value; } } else { - $queryParams['maxResults'] = $maxResults; + $queryParams['history'] = $history; } } @@ -2263,6 +2164,14 @@ protected function listTasksRequest($ownerId = null, $contactIds = null, $minDue $headerParams['Accept-Language'] = ObjectSerializer::toHeaderValue($acceptLanguage); } + // path params + if ($taskId !== null) { + $resourcePath = str_replace( + '{' . 'taskId' . '}', + ObjectSerializer::toPathValue($taskId), + $resourcePath + ); + } // body params $_tempBody = null; @@ -2290,10 +2199,13 @@ protected function listTasksRequest($ownerId = null, $contactIds = null, $minDue if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2333,40 +2245,54 @@ protected function listTasksRequest($ownerId = null, $contactIds = null, $minDue } /** - * Operation patchTask + * Operation listTasks * - * Partially update a task. + * List or search tasks. * - * @param string $taskId Task unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskPayload $tasksPatchTaskPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) + * @param string $ownerId Owner ID filter param. (optional) + * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) + * @param \DateTime $minDueDate Minimum (inclusive) due date of the task. (optional) + * @param \DateTime $maxDueDate Maximum (exclusive) due date of the task. (optional) + * @param bool $isCompleted If true, include only completed tasks. If false, include only TODO tasks. If not set or null, include both. (optional) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksDueDateFilter $dueDateFilter Include or exclude tasks with or without due date. (optional) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksOrderByType $orderBy Specify the order of the results. (optional) + * @param string $pageToken Token to specify which page to fetch. (optional) + * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return \Equisoft\SDK\EquisoftConnect\Model\TasksListTaskResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function patchTask($taskId, $tasksPatchTaskPayload, $acceptLanguage = null) + public function listTasks($ownerId = null, $contactIds = null, $minDueDate = null, $maxDueDate = null, $isCompleted = null, $dueDateFilter = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) { - list($response) = $this->patchTaskWithHttpInfo($taskId, $tasksPatchTaskPayload, $acceptLanguage); + list($response) = $this->listTasksWithHttpInfo($ownerId, $contactIds, $minDueDate, $maxDueDate, $isCompleted, $dueDateFilter, $orderBy, $pageToken, $maxResults, $acceptLanguage); return $response; } /** - * Operation patchTaskWithHttpInfo + * Operation listTasksWithHttpInfo * - * Partially update a task. + * List or search tasks. * - * @param string $taskId Task unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskPayload $tasksPatchTaskPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) + * @param string $ownerId Owner ID filter param. (optional) + * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) + * @param \DateTime $minDueDate Minimum (inclusive) due date of the task. (optional) + * @param \DateTime $maxDueDate Maximum (exclusive) due date of the task. (optional) + * @param bool $isCompleted If true, include only completed tasks. If false, include only TODO tasks. If not set or null, include both. (optional) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksDueDateFilter $dueDateFilter Include or exclude tasks with or without due date. (optional) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksOrderByType $orderBy Specify the order of the results. (optional) + * @param string $pageToken Token to specify which page to fetch. (optional) + * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Equisoft\SDK\EquisoftConnect\Model\TasksListTaskResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function patchTaskWithHttpInfo($taskId, $tasksPatchTaskPayload, $acceptLanguage = null) + public function listTasksWithHttpInfo($ownerId = null, $contactIds = null, $minDueDate = null, $maxDueDate = null, $isCompleted = null, $dueDateFilter = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) { - $request = $this->patchTaskRequest($taskId, $tasksPatchTaskPayload, $acceptLanguage); + $request = $this->listTasksRequest($ownerId, $contactIds, $minDueDate, $maxDueDate, $isCompleted, $dueDateFilter, $orderBy, $pageToken, $maxResults, $acceptLanguage); try { $options = $this->createHttpClientOption(); @@ -2399,14 +2325,14 @@ public function patchTaskWithHttpInfo($taskId, $tasksPatchTaskPayload, $acceptLa $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskResponse' === '\SplFileObject') { + if ('\Equisoft\SDK\EquisoftConnect\Model\TasksListTaskResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskResponse', []), + ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\TasksListTaskResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -2448,7 +2374,7 @@ public function patchTaskWithHttpInfo($taskId, $tasksPatchTaskPayload, $acceptLa ]; } - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskResponse'; + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\TasksListTaskResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -2467,7 +2393,7 @@ public function patchTaskWithHttpInfo($taskId, $tasksPatchTaskPayload, $acceptLa case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskResponse', + '\Equisoft\SDK\EquisoftConnect\Model\TasksListTaskResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -2502,20 +2428,27 @@ public function patchTaskWithHttpInfo($taskId, $tasksPatchTaskPayload, $acceptLa } /** - * Operation patchTaskAsync + * Operation listTasksAsync * - * Partially update a task. + * List or search tasks. * - * @param string $taskId Task unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskPayload $tasksPatchTaskPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) + * @param string $ownerId Owner ID filter param. (optional) + * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) + * @param \DateTime $minDueDate Minimum (inclusive) due date of the task. (optional) + * @param \DateTime $maxDueDate Maximum (exclusive) due date of the task. (optional) + * @param bool $isCompleted If true, include only completed tasks. If false, include only TODO tasks. If not set or null, include both. (optional) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksDueDateFilter $dueDateFilter Include or exclude tasks with or without due date. (optional) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksOrderByType $orderBy Specify the order of the results. (optional) + * @param string $pageToken Token to specify which page to fetch. (optional) + * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function patchTaskAsync($taskId, $tasksPatchTaskPayload, $acceptLanguage = null) + public function listTasksAsync($ownerId = null, $contactIds = null, $minDueDate = null, $maxDueDate = null, $isCompleted = null, $dueDateFilter = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) { - return $this->patchTaskAsyncWithHttpInfo($taskId, $tasksPatchTaskPayload, $acceptLanguage) + return $this->listTasksAsyncWithHttpInfo($ownerId, $contactIds, $minDueDate, $maxDueDate, $isCompleted, $dueDateFilter, $orderBy, $pageToken, $maxResults, $acceptLanguage) ->then( function ($response) { return $response[0]; @@ -2524,21 +2457,28 @@ function ($response) { } /** - * Operation patchTaskAsyncWithHttpInfo + * Operation listTasksAsyncWithHttpInfo * - * Partially update a task. + * List or search tasks. * - * @param string $taskId Task unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskPayload $tasksPatchTaskPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) + * @param string $ownerId Owner ID filter param. (optional) + * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) + * @param \DateTime $minDueDate Minimum (inclusive) due date of the task. (optional) + * @param \DateTime $maxDueDate Maximum (exclusive) due date of the task. (optional) + * @param bool $isCompleted If true, include only completed tasks. If false, include only TODO tasks. If not set or null, include both. (optional) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksDueDateFilter $dueDateFilter Include or exclude tasks with or without due date. (optional) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksOrderByType $orderBy Specify the order of the results. (optional) + * @param string $pageToken Token to specify which page to fetch. (optional) + * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function patchTaskAsyncWithHttpInfo($taskId, $tasksPatchTaskPayload, $acceptLanguage = null) + public function listTasksAsyncWithHttpInfo($ownerId = null, $contactIds = null, $minDueDate = null, $maxDueDate = null, $isCompleted = null, $dueDateFilter = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) { - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskResponse'; - $request = $this->patchTaskRequest($taskId, $tasksPatchTaskPayload, $acceptLanguage); + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\TasksListTaskResponse'; + $request = $this->listTasksRequest($ownerId, $contactIds, $minDueDate, $maxDueDate, $isCompleted, $dueDateFilter, $orderBy, $pageToken, $maxResults, $acceptLanguage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2571,61 +2511,144 @@ function ($exception) { $response->getBody() ); } - ); - } - - /** - * Create request for operation 'patchTask' - * - * @param string $taskId Task unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskPayload $tasksPatchTaskPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) - * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - protected function patchTaskRequest($taskId, $tasksPatchTaskPayload, $acceptLanguage = null) - { - // verify the required parameter 'taskId' is set - if ($taskId === null || (is_array($taskId) && count($taskId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $taskId when calling patchTask' - ); + ); + } + + /** + * Create request for operation 'listTasks' + * + * @param string $ownerId Owner ID filter param. (optional) + * @param int[] $contactIds Contact ID filter param. Many ids can be passed to this argument separated by coma. Ex: '?contactId=1,2,3'. Any of the given contacts will be returned in the result. (optional) + * @param \DateTime $minDueDate Minimum (inclusive) due date of the task. (optional) + * @param \DateTime $maxDueDate Maximum (exclusive) due date of the task. (optional) + * @param bool $isCompleted If true, include only completed tasks. If false, include only TODO tasks. If not set or null, include both. (optional) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksDueDateFilter $dueDateFilter Include or exclude tasks with or without due date. (optional) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksOrderByType $orderBy Specify the order of the results. (optional) + * @param string $pageToken Token to specify which page to fetch. (optional) + * @param string $maxResults Maximum number of records for one result page. If the query return more records, nextPageToken will be specified in the result to get the records of the next page. Defaults to 250 records. Can never be more than 2500 records. (optional) + * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + protected function listTasksRequest($ownerId = null, $contactIds = null, $minDueDate = null, $maxDueDate = null, $isCompleted = null, $dueDateFilter = null, $orderBy = null, $pageToken = null, $maxResults = null, $acceptLanguage = null) + { + + $resourcePath = '/crm/api/v1/tasks'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + if ($ownerId !== null) { + if('form' === 'form' && is_array($ownerId)) { + foreach($ownerId as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['ownerId'] = $ownerId; + } + } + // query params + if ($contactIds !== null) { + if('form' === 'form' && is_array($contactIds)) { + foreach($contactIds as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['contactIds'] = $contactIds; + } + } + // query params + if ($minDueDate !== null) { + if('form' === 'form' && is_array($minDueDate)) { + foreach($minDueDate as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['minDueDate'] = $minDueDate; + } + } + // query params + if ($maxDueDate !== null) { + if('form' === 'form' && is_array($maxDueDate)) { + foreach($maxDueDate as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['maxDueDate'] = $maxDueDate; + } + } + // query params + if ($isCompleted !== null) { + if('form' === 'form' && is_array($isCompleted)) { + foreach($isCompleted as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['isCompleted'] = $isCompleted; + } } - // verify the required parameter 'tasksPatchTaskPayload' is set - if ($tasksPatchTaskPayload === null || (is_array($tasksPatchTaskPayload) && count($tasksPatchTaskPayload) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $tasksPatchTaskPayload when calling patchTask' - ); + // query params + if ($dueDateFilter !== null) { + if('form' === 'form' && is_array($dueDateFilter)) { + foreach($dueDateFilter as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['dueDateFilter'] = $dueDateFilter; + } + } + // query params + if ($orderBy !== null) { + if('form' === 'form' && is_array($orderBy)) { + foreach($orderBy as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['orderBy'] = $orderBy; + } + } + // query params + if ($pageToken !== null) { + if('form' === 'form' && is_array($pageToken)) { + foreach($pageToken as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['pageToken'] = $pageToken; + } + } + // query params + if ($maxResults !== null) { + if('form' === 'form' && is_array($maxResults)) { + foreach($maxResults as $key => $value) { + $queryParams[$key] = $value; + } + } + else { + $queryParams['maxResults'] = $maxResults; + } } - - $resourcePath = '/crm/api/v1/tasks/{taskId}'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - // header params if ($acceptLanguage !== null) { $headerParams['Accept-Language'] = ObjectSerializer::toHeaderValue($acceptLanguage); } - // path params - if ($taskId !== null) { - $resourcePath = str_replace( - '{' . 'taskId' . '}', - ObjectSerializer::toPathValue($taskId), - $resourcePath - ); - } // body params $_tempBody = null; - if (isset($tasksPatchTaskPayload)) { - $_tempBody = $tasksPatchTaskPayload; - } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -2634,7 +2657,7 @@ protected function patchTaskRequest($taskId, $tasksPatchTaskPayload, $acceptLang } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - ['application/json'] + [] ); } @@ -2650,10 +2673,13 @@ protected function patchTaskRequest($taskId, $tasksPatchTaskPayload, $acceptLang if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -2685,7 +2711,7 @@ protected function patchTaskRequest($taskId, $tasksPatchTaskPayload, $acceptLang $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'PATCH', + 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -2693,42 +2719,40 @@ protected function patchTaskRequest($taskId, $tasksPatchTaskPayload, $acceptLang } /** - * Operation patchTaskInternalNote + * Operation patchTask * - * Add an internal note to a task. + * Partially update a task. * * @param string $taskId Task unique identifier. (required) - * @param string $noteId Note unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload internalNotesPatchNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskPayload $tasksPatchTaskPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return \Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function patchTaskInternalNote($taskId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) + public function patchTask($taskId, $tasksPatchTaskPayload, $acceptLanguage = null) { - list($response) = $this->patchTaskInternalNoteWithHttpInfo($taskId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage); + list($response) = $this->patchTaskWithHttpInfo($taskId, $tasksPatchTaskPayload, $acceptLanguage); return $response; } /** - * Operation patchTaskInternalNoteWithHttpInfo + * Operation patchTaskWithHttpInfo * - * Add an internal note to a task. + * Partially update a task. * * @param string $taskId Task unique identifier. (required) - * @param string $noteId Note unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskPayload $tasksPatchTaskPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function patchTaskInternalNoteWithHttpInfo($taskId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) + public function patchTaskWithHttpInfo($taskId, $tasksPatchTaskPayload, $acceptLanguage = null) { - $request = $this->patchTaskInternalNoteRequest($taskId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage); + $request = $this->patchTaskRequest($taskId, $tasksPatchTaskPayload, $acceptLanguage); try { $options = $this->createHttpClientOption(); @@ -2761,18 +2785,18 @@ public function patchTaskInternalNoteWithHttpInfo($taskId, $noteId, $internalNot $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse' === '\SplFileObject') { + if ('\Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse', []), + ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskResponse', []), $response->getStatusCode(), $response->getHeaders() ]; - case 401: + case 400: if ('\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -2784,7 +2808,7 @@ public function patchTaskInternalNoteWithHttpInfo($taskId, $noteId, $internalNot $response->getStatusCode(), $response->getHeaders() ]; - case 404: + case 401: if ('\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { @@ -2810,7 +2834,7 @@ public function patchTaskInternalNoteWithHttpInfo($taskId, $noteId, $internalNot ]; } - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse'; + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -2829,12 +2853,12 @@ public function patchTaskInternalNoteWithHttpInfo($taskId, $noteId, $internalNot case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse', + '\Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); break; - case 401: + case 400: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse', @@ -2842,7 +2866,7 @@ public function patchTaskInternalNoteWithHttpInfo($taskId, $noteId, $internalNot ); $e->setResponseObject($data); break; - case 404: + case 401: $data = ObjectSerializer::deserialize( $e->getResponseBody(), '\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse', @@ -2864,21 +2888,20 @@ public function patchTaskInternalNoteWithHttpInfo($taskId, $noteId, $internalNot } /** - * Operation patchTaskInternalNoteAsync + * Operation patchTaskAsync * - * Add an internal note to a task. + * Partially update a task. * * @param string $taskId Task unique identifier. (required) - * @param string $noteId Note unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskPayload $tasksPatchTaskPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function patchTaskInternalNoteAsync($taskId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) + public function patchTaskAsync($taskId, $tasksPatchTaskPayload, $acceptLanguage = null) { - return $this->patchTaskInternalNoteAsyncWithHttpInfo($taskId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage) + return $this->patchTaskAsyncWithHttpInfo($taskId, $tasksPatchTaskPayload, $acceptLanguage) ->then( function ($response) { return $response[0]; @@ -2887,22 +2910,21 @@ function ($response) { } /** - * Operation patchTaskInternalNoteAsyncWithHttpInfo + * Operation patchTaskAsyncWithHttpInfo * - * Add an internal note to a task. + * Partially update a task. * * @param string $taskId Task unique identifier. (required) - * @param string $noteId Note unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskPayload $tasksPatchTaskPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function patchTaskInternalNoteAsyncWithHttpInfo($taskId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) + public function patchTaskAsyncWithHttpInfo($taskId, $tasksPatchTaskPayload, $acceptLanguage = null) { - $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse'; - $request = $this->patchTaskInternalNoteRequest($taskId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage); + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskResponse'; + $request = $this->patchTaskRequest($taskId, $tasksPatchTaskPayload, $acceptLanguage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2939,38 +2961,31 @@ function ($exception) { } /** - * Create request for operation 'patchTaskInternalNote' + * Create request for operation 'patchTask' * * @param string $taskId Task unique identifier. (required) - * @param string $noteId Note unique identifier. (required) - * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\TasksPatchTaskPayload $tasksPatchTaskPayload Event fields to update. The body of the patch request includes only the resource fields you want to modify. To delete a field, set it to null. Collections are always overridden if defined. (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function patchTaskInternalNoteRequest($taskId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) + protected function patchTaskRequest($taskId, $tasksPatchTaskPayload, $acceptLanguage = null) { // verify the required parameter 'taskId' is set if ($taskId === null || (is_array($taskId) && count($taskId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $taskId when calling patchTaskInternalNote' - ); - } - // verify the required parameter 'noteId' is set - if ($noteId === null || (is_array($noteId) && count($noteId) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $noteId when calling patchTaskInternalNote' + 'Missing the required parameter $taskId when calling patchTask' ); } - // verify the required parameter 'internalNotesPatchNotePayload' is set - if ($internalNotesPatchNotePayload === null || (is_array($internalNotesPatchNotePayload) && count($internalNotesPatchNotePayload) === 0)) { + // verify the required parameter 'tasksPatchTaskPayload' is set + if ($tasksPatchTaskPayload === null || (is_array($tasksPatchTaskPayload) && count($tasksPatchTaskPayload) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $internalNotesPatchNotePayload when calling patchTaskInternalNote' + 'Missing the required parameter $tasksPatchTaskPayload when calling patchTask' ); } - $resourcePath = '/crm/api/v1/tasks/{taskId}/notes/{noteId}'; + $resourcePath = '/crm/api/v1/tasks/{taskId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -2991,19 +3006,11 @@ protected function patchTaskInternalNoteRequest($taskId, $noteId, $internalNotes $resourcePath ); } - // path params - if ($noteId !== null) { - $resourcePath = str_replace( - '{' . 'noteId' . '}', - ObjectSerializer::toPathValue($noteId), - $resourcePath - ); - } // body params $_tempBody = null; - if (isset($internalNotesPatchNotePayload)) { - $_tempBody = $internalNotesPatchNotePayload; + if (isset($tasksPatchTaskPayload)) { + $_tempBody = $tasksPatchTaskPayload; } if ($multipart) { @@ -3029,10 +3036,13 @@ protected function patchTaskInternalNoteRequest($taskId, $noteId, $internalNotes if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -3072,40 +3082,42 @@ protected function patchTaskInternalNoteRequest($taskId, $noteId, $internalNotes } /** - * Operation softDeleteTaskInternalNote + * Operation patchTaskInternalNote * - * Soft delete an internal note for a task. + * Add an internal note to a task. * * @param string $taskId Task unique identifier. (required) - * @param string $noteId Note unique identifier. (required) + * @param int $noteId Note unique identifier. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload internalNotesPatchNotePayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return object|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse + * @return \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse */ - public function softDeleteTaskInternalNote($taskId, $noteId, $acceptLanguage = null) + public function patchTaskInternalNote($taskId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) { - list($response) = $this->softDeleteTaskInternalNoteWithHttpInfo($taskId, $noteId, $acceptLanguage); + list($response) = $this->patchTaskInternalNoteWithHttpInfo($taskId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage); return $response; } /** - * Operation softDeleteTaskInternalNoteWithHttpInfo + * Operation patchTaskInternalNoteWithHttpInfo * - * Soft delete an internal note for a task. + * Add an internal note to a task. * * @param string $taskId Task unique identifier. (required) - * @param string $noteId Note unique identifier. (required) + * @param int $noteId Note unique identifier. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \Equisoft\SDK\EquisoftConnect\ApiException on non-2xx response * @throws \InvalidArgumentException - * @return array of object|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) + * @return array of \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse|\Equisoft\SDK\EquisoftConnect\Model\ErrorResponse, HTTP status code, HTTP response headers (array of strings) */ - public function softDeleteTaskInternalNoteWithHttpInfo($taskId, $noteId, $acceptLanguage = null) + public function patchTaskInternalNoteWithHttpInfo($taskId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) { - $request = $this->softDeleteTaskInternalNoteRequest($taskId, $noteId, $acceptLanguage); + $request = $this->patchTaskInternalNoteRequest($taskId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage); try { $options = $this->createHttpClientOption(); @@ -3138,14 +3150,14 @@ public function softDeleteTaskInternalNoteWithHttpInfo($taskId, $noteId, $accept $responseBody = $response->getBody(); switch($statusCode) { case 200: - if ('object' === '\SplFileObject') { + if ('\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse' === '\SplFileObject') { $content = $responseBody; //stream goes to serializer } else { $content = (string) $responseBody; } return [ - ObjectSerializer::deserialize($content, 'object', []), + ObjectSerializer::deserialize($content, '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse', []), $response->getStatusCode(), $response->getHeaders() ]; @@ -3187,7 +3199,7 @@ public function softDeleteTaskInternalNoteWithHttpInfo($taskId, $noteId, $accept ]; } - $returnType = 'object'; + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse'; $responseBody = $response->getBody(); if ($returnType === '\SplFileObject') { $content = $responseBody; //stream goes to serializer @@ -3206,7 +3218,7 @@ public function softDeleteTaskInternalNoteWithHttpInfo($taskId, $noteId, $accept case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - 'object', + '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); @@ -3241,20 +3253,21 @@ public function softDeleteTaskInternalNoteWithHttpInfo($taskId, $noteId, $accept } /** - * Operation softDeleteTaskInternalNoteAsync + * Operation patchTaskInternalNoteAsync * - * Soft delete an internal note for a task. + * Add an internal note to a task. * * @param string $taskId Task unique identifier. (required) - * @param string $noteId Note unique identifier. (required) + * @param int $noteId Note unique identifier. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function softDeleteTaskInternalNoteAsync($taskId, $noteId, $acceptLanguage = null) + public function patchTaskInternalNoteAsync($taskId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) { - return $this->softDeleteTaskInternalNoteAsyncWithHttpInfo($taskId, $noteId, $acceptLanguage) + return $this->patchTaskInternalNoteAsyncWithHttpInfo($taskId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage) ->then( function ($response) { return $response[0]; @@ -3263,21 +3276,22 @@ function ($response) { } /** - * Operation softDeleteTaskInternalNoteAsyncWithHttpInfo + * Operation patchTaskInternalNoteAsyncWithHttpInfo * - * Soft delete an internal note for a task. + * Add an internal note to a task. * * @param string $taskId Task unique identifier. (required) - * @param string $noteId Note unique identifier. (required) + * @param int $noteId Note unique identifier. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function softDeleteTaskInternalNoteAsyncWithHttpInfo($taskId, $noteId, $acceptLanguage = null) + public function patchTaskInternalNoteAsyncWithHttpInfo($taskId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) { - $returnType = 'object'; - $request = $this->softDeleteTaskInternalNoteRequest($taskId, $noteId, $acceptLanguage); + $returnType = '\Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNoteResponse'; + $request = $this->patchTaskInternalNoteRequest($taskId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -3314,31 +3328,38 @@ function ($exception) { } /** - * Create request for operation 'softDeleteTaskInternalNote' + * Create request for operation 'patchTaskInternalNote' * * @param string $taskId Task unique identifier. (required) - * @param string $noteId Note unique identifier. (required) + * @param int $noteId Note unique identifier. (required) + * @param \Equisoft\SDK\EquisoftConnect\Model\InternalNotesPatchNotePayload $internalNotesPatchNotePayload (required) * @param string $acceptLanguage Specify preferred language for returned data. Format is https://tools.ietf.org/html/rfc3282 (optional) * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - protected function softDeleteTaskInternalNoteRequest($taskId, $noteId, $acceptLanguage = null) + protected function patchTaskInternalNoteRequest($taskId, $noteId, $internalNotesPatchNotePayload, $acceptLanguage = null) { // verify the required parameter 'taskId' is set if ($taskId === null || (is_array($taskId) && count($taskId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $taskId when calling softDeleteTaskInternalNote' + 'Missing the required parameter $taskId when calling patchTaskInternalNote' ); } // verify the required parameter 'noteId' is set if ($noteId === null || (is_array($noteId) && count($noteId) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $noteId when calling softDeleteTaskInternalNote' + 'Missing the required parameter $noteId when calling patchTaskInternalNote' + ); + } + // verify the required parameter 'internalNotesPatchNotePayload' is set + if ($internalNotesPatchNotePayload === null || (is_array($internalNotesPatchNotePayload) && count($internalNotesPatchNotePayload) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $internalNotesPatchNotePayload when calling patchTaskInternalNote' ); } - $resourcePath = '/crm/api/v1/tasks/{taskId}/notes/{noteId}/softDelete'; + $resourcePath = '/crm/api/v1/tasks/{taskId}/notes/{noteId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -3370,6 +3391,9 @@ protected function softDeleteTaskInternalNoteRequest($taskId, $noteId, $acceptLa // body params $_tempBody = null; + if (isset($internalNotesPatchNotePayload)) { + $_tempBody = $internalNotesPatchNotePayload; + } if ($multipart) { $headers = $this->headerSelector->selectHeadersForMultipart( @@ -3378,7 +3402,7 @@ protected function softDeleteTaskInternalNoteRequest($taskId, $noteId, $acceptLa } else { $headers = $this->headerSelector->selectHeaders( ['application/json'], - [] + ['application/json'] ); } @@ -3394,10 +3418,13 @@ protected function softDeleteTaskInternalNoteRequest($taskId, $noteId, $acceptLa if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); @@ -3429,7 +3456,7 @@ protected function softDeleteTaskInternalNoteRequest($taskId, $noteId, $acceptLa $query = \GuzzleHttp\Psr7\build_query($queryParams); return new Request( - 'POST', + 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -3731,10 +3758,13 @@ protected function transferTaskToCompletedRequest($taskId) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); diff --git a/lib/Api/UsersApi.php b/lib/Api/UsersApi.php index 36a8ff3d..5bb3086b 100644 --- a/lib/Api/UsersApi.php +++ b/lib/Api/UsersApi.php @@ -380,10 +380,13 @@ protected function getCurrentUserRequest($acceptLanguage = null) if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { - $multipartContents[] = [ - 'name' => $formParamName, - 'contents' => $formParamValue - ]; + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } } // for HTTP post (form) $httpBody = new MultipartStream($multipartContents); diff --git a/lib/Model/GatewaysCredentials.php b/lib/Model/GatewaysCredentials.php index 449073a2..69912340 100644 --- a/lib/Model/GatewaysCredentials.php +++ b/lib/Model/GatewaysCredentials.php @@ -58,7 +58,8 @@ class GatewaysCredentials implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'username' => 'string', - 'password' => 'string' + 'password' => 'string', + 'isADealerCode' => 'bool' ]; /** @@ -68,7 +69,8 @@ class GatewaysCredentials implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'username' => null, - 'password' => null + 'password' => null, + 'isADealerCode' => null ]; /** @@ -99,7 +101,8 @@ public static function openAPIFormats() */ protected static $attributeMap = [ 'username' => 'username', - 'password' => 'password' + 'password' => 'password', + 'isADealerCode' => 'isADealerCode' ]; /** @@ -109,7 +112,8 @@ public static function openAPIFormats() */ protected static $setters = [ 'username' => 'setUsername', - 'password' => 'setPassword' + 'password' => 'setPassword', + 'isADealerCode' => 'setIsADealerCode' ]; /** @@ -119,7 +123,8 @@ public static function openAPIFormats() */ protected static $getters = [ 'username' => 'getUsername', - 'password' => 'getPassword' + 'password' => 'getPassword', + 'isADealerCode' => 'getIsADealerCode' ]; /** @@ -184,6 +189,7 @@ public function __construct(array $data = null) { $this->container['username'] = isset($data['username']) ? $data['username'] : null; $this->container['password'] = isset($data['password']) ? $data['password'] : null; + $this->container['isADealerCode'] = isset($data['isADealerCode']) ? $data['isADealerCode'] : null; } /** @@ -263,6 +269,30 @@ public function setPassword($password) return $this; } + + /** + * Gets isADealerCode + * + * @return bool|null + */ + public function getIsADealerCode() + { + return $this->container['isADealerCode']; + } + + /** + * Sets isADealerCode + * + * @param bool|null $isADealerCode isADealerCode + * + * @return $this + */ + public function setIsADealerCode($isADealerCode) + { + $this->container['isADealerCode'] = $isADealerCode; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/GatewaysCredentialsWithSsn.php b/lib/Model/GatewaysCredentialsWithSsn.php index d74ab8bb..40dd1954 100644 --- a/lib/Model/GatewaysCredentialsWithSsn.php +++ b/lib/Model/GatewaysCredentialsWithSsn.php @@ -59,6 +59,7 @@ class GatewaysCredentialsWithSsn implements ModelInterface, ArrayAccess protected static $openAPITypes = [ 'username' => 'string', 'password' => 'string', + 'isADealerCode' => 'bool', 'ssnList' => 'string[]' ]; @@ -70,6 +71,7 @@ class GatewaysCredentialsWithSsn implements ModelInterface, ArrayAccess protected static $openAPIFormats = [ 'username' => null, 'password' => null, + 'isADealerCode' => null, 'ssnList' => null ]; @@ -102,6 +104,7 @@ public static function openAPIFormats() protected static $attributeMap = [ 'username' => 'username', 'password' => 'password', + 'isADealerCode' => 'isADealerCode', 'ssnList' => 'ssnList' ]; @@ -113,6 +116,7 @@ public static function openAPIFormats() protected static $setters = [ 'username' => 'setUsername', 'password' => 'setPassword', + 'isADealerCode' => 'setIsADealerCode', 'ssnList' => 'setSsnList' ]; @@ -124,6 +128,7 @@ public static function openAPIFormats() protected static $getters = [ 'username' => 'getUsername', 'password' => 'getPassword', + 'isADealerCode' => 'getIsADealerCode', 'ssnList' => 'getSsnList' ]; @@ -189,6 +194,7 @@ public function __construct(array $data = null) { $this->container['username'] = isset($data['username']) ? $data['username'] : null; $this->container['password'] = isset($data['password']) ? $data['password'] : null; + $this->container['isADealerCode'] = isset($data['isADealerCode']) ? $data['isADealerCode'] : null; $this->container['ssnList'] = isset($data['ssnList']) ? $data['ssnList'] : null; } @@ -270,6 +276,30 @@ public function setPassword($password) return $this; } + /** + * Gets isADealerCode + * + * @return bool|null + */ + public function getIsADealerCode() + { + return $this->container['isADealerCode']; + } + + /** + * Sets isADealerCode + * + * @param bool|null $isADealerCode isADealerCode + * + * @return $this + */ + public function setIsADealerCode($isADealerCode) + { + $this->container['isADealerCode'] = $isADealerCode; + + return $this; + } + /** * Gets ssnList * diff --git a/lib/Model/InternalNotesCreateNoteResponse.php b/lib/Model/InternalNotesCreateNoteResponse.php index 234259ad..7704b2fe 100644 --- a/lib/Model/InternalNotesCreateNoteResponse.php +++ b/lib/Model/InternalNotesCreateNoteResponse.php @@ -57,7 +57,7 @@ class InternalNotesCreateNoteResponse implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'id' => 'string' + 'id' => 'int' ]; /** @@ -210,7 +210,7 @@ public function valid() /** * Gets id * - * @return string + * @return int */ public function getId() { @@ -220,7 +220,7 @@ public function getId() /** * Sets id * - * @param string $id Unique numerical identifier of the created note. + * @param int $id Unique numerical identifier of the created note. * * @return $this */ diff --git a/lib/Model/InternalNotesNote.php b/lib/Model/InternalNotesNote.php index 7250635f..73b66968 100644 --- a/lib/Model/InternalNotesNote.php +++ b/lib/Model/InternalNotesNote.php @@ -219,6 +219,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } if ($this->container['author'] === null) { $invalidProperties[] = "'author' can't be null"; } @@ -249,7 +252,7 @@ public function valid() /** * Gets id * - * @return int|null + * @return int */ public function getId() { @@ -259,7 +262,7 @@ public function getId() /** * Sets id * - * @param int|null $id Unique numerical identifier. + * @param int $id Unique numerical identifier. * * @return $this */ diff --git a/lib/Model/InternalNotesNoteRevisionType.php b/lib/Model/InternalNotesNoteRevisionType.php index 9421949d..c4417702 100644 --- a/lib/Model/InternalNotesNoteRevisionType.php +++ b/lib/Model/InternalNotesNoteRevisionType.php @@ -45,7 +45,7 @@ class InternalNotesNoteRevisionType */ const CREATE = 'CREATE'; const MODIFY = 'MODIFY'; - const DELETE = 'DELETE'; + const ARCHIVE = 'ARCHIVE'; /** * Gets allowable values of the enum @@ -56,7 +56,7 @@ public static function getAllowableEnumValues() return [ self::CREATE, self::MODIFY, - self::DELETE, + self::ARCHIVE, ]; } } diff --git a/lib/Model/InternalNotesPatchNoteResponse.php b/lib/Model/InternalNotesPatchNoteResponse.php index f51d5562..ec48f844 100644 --- a/lib/Model/InternalNotesPatchNoteResponse.php +++ b/lib/Model/InternalNotesPatchNoteResponse.php @@ -57,7 +57,7 @@ class InternalNotesPatchNoteResponse implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'id' => 'string' + 'id' => 'int' ]; /** @@ -210,7 +210,7 @@ public function valid() /** * Gets id * - * @return string + * @return int */ public function getId() { @@ -220,7 +220,7 @@ public function getId() /** * Sets id * - * @param string $id Unique numerical identifier of the note. + * @param int $id Unique numerical identifier of the note. * * @return $this */ diff --git a/lib/Model/LegacyContactContactPayloadItem.php b/lib/Model/LegacyContactContactPayloadItem.php index f1bac639..2b9f4cc2 100644 --- a/lib/Model/LegacyContactContactPayloadItem.php +++ b/lib/Model/LegacyContactContactPayloadItem.php @@ -111,7 +111,9 @@ class LegacyContactContactPayloadItem implements ModelInterface, ArrayAccess 'dateEndFinancialYear' => 'string', 'orgIdNo' => 'string', 'orgFedNo' => 'string', - 'orgProvNo' => 'string' + 'orgProvNo' => 'string', + 'orgStateId' => 'string', + 'orgEin' => 'string' ]; /** @@ -174,7 +176,9 @@ class LegacyContactContactPayloadItem implements ModelInterface, ArrayAccess 'dateEndFinancialYear' => null, 'orgIdNo' => null, 'orgFedNo' => null, - 'orgProvNo' => null + 'orgProvNo' => null, + 'orgStateId' => null, + 'orgEin' => null ]; /** @@ -258,7 +262,9 @@ public static function openAPIFormats() 'dateEndFinancialYear' => 'dateEndFinancialYear', 'orgIdNo' => 'orgIdNo', 'orgFedNo' => 'orgFedNo', - 'orgProvNo' => 'orgProvNo' + 'orgProvNo' => 'orgProvNo', + 'orgStateId' => 'orgStateId', + 'orgEin' => 'orgEin' ]; /** @@ -321,7 +327,9 @@ public static function openAPIFormats() 'dateEndFinancialYear' => 'setDateEndFinancialYear', 'orgIdNo' => 'setOrgIdNo', 'orgFedNo' => 'setOrgFedNo', - 'orgProvNo' => 'setOrgProvNo' + 'orgProvNo' => 'setOrgProvNo', + 'orgStateId' => 'setOrgStateId', + 'orgEin' => 'setOrgEin' ]; /** @@ -384,7 +392,9 @@ public static function openAPIFormats() 'dateEndFinancialYear' => 'getDateEndFinancialYear', 'orgIdNo' => 'getOrgIdNo', 'orgFedNo' => 'getOrgFedNo', - 'orgProvNo' => 'getOrgProvNo' + 'orgProvNo' => 'getOrgProvNo', + 'orgStateId' => 'getOrgStateId', + 'orgEin' => 'getOrgEin' ]; /** @@ -502,6 +512,8 @@ public function __construct(array $data = null) $this->container['orgIdNo'] = isset($data['orgIdNo']) ? $data['orgIdNo'] : null; $this->container['orgFedNo'] = isset($data['orgFedNo']) ? $data['orgFedNo'] : null; $this->container['orgProvNo'] = isset($data['orgProvNo']) ? $data['orgProvNo'] : null; + $this->container['orgStateId'] = isset($data['orgStateId']) ? $data['orgStateId'] : null; + $this->container['orgEin'] = isset($data['orgEin']) ? $data['orgEin'] : null; } /** @@ -1847,6 +1859,54 @@ public function setOrgProvNo($orgProvNo) return $this; } + + /** + * Gets orgStateId + * + * @return string|null + */ + public function getOrgStateId() + { + return $this->container['orgStateId']; + } + + /** + * Sets orgStateId + * + * @param string|null $orgStateId orgStateId + * + * @return $this + */ + public function setOrgStateId($orgStateId) + { + $this->container['orgStateId'] = $orgStateId; + + return $this; + } + + /** + * Gets orgEin + * + * @return string|null + */ + public function getOrgEin() + { + return $this->container['orgEin']; + } + + /** + * Sets orgEin + * + * @param string|null $orgEin orgEin + * + * @return $this + */ + public function setOrgEin($orgEin) + { + $this->container['orgEin'] = $orgEin; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/lib/Model/LegacyContactContactPayloadItemAllOf.php b/lib/Model/LegacyContactContactPayloadItemAllOf.php index 413fbdd9..5066f79d 100644 --- a/lib/Model/LegacyContactContactPayloadItemAllOf.php +++ b/lib/Model/LegacyContactContactPayloadItemAllOf.php @@ -99,7 +99,9 @@ class LegacyContactContactPayloadItemAllOf implements ModelInterface, ArrayAcces 'dateEndFinancialYear' => 'string', 'orgIdNo' => 'string', 'orgFedNo' => 'string', - 'orgProvNo' => 'string' + 'orgProvNo' => 'string', + 'orgStateId' => 'string', + 'orgEin' => 'string' ]; /** @@ -150,7 +152,9 @@ class LegacyContactContactPayloadItemAllOf implements ModelInterface, ArrayAcces 'dateEndFinancialYear' => null, 'orgIdNo' => null, 'orgFedNo' => null, - 'orgProvNo' => null + 'orgProvNo' => null, + 'orgStateId' => null, + 'orgEin' => null ]; /** @@ -222,7 +226,9 @@ public static function openAPIFormats() 'dateEndFinancialYear' => 'dateEndFinancialYear', 'orgIdNo' => 'orgIdNo', 'orgFedNo' => 'orgFedNo', - 'orgProvNo' => 'orgProvNo' + 'orgProvNo' => 'orgProvNo', + 'orgStateId' => 'orgStateId', + 'orgEin' => 'orgEin' ]; /** @@ -273,7 +279,9 @@ public static function openAPIFormats() 'dateEndFinancialYear' => 'setDateEndFinancialYear', 'orgIdNo' => 'setOrgIdNo', 'orgFedNo' => 'setOrgFedNo', - 'orgProvNo' => 'setOrgProvNo' + 'orgProvNo' => 'setOrgProvNo', + 'orgStateId' => 'setOrgStateId', + 'orgEin' => 'setOrgEin' ]; /** @@ -324,7 +332,9 @@ public static function openAPIFormats() 'dateEndFinancialYear' => 'getDateEndFinancialYear', 'orgIdNo' => 'getOrgIdNo', 'orgFedNo' => 'getOrgFedNo', - 'orgProvNo' => 'getOrgProvNo' + 'orgProvNo' => 'getOrgProvNo', + 'orgStateId' => 'getOrgStateId', + 'orgEin' => 'getOrgEin' ]; /** @@ -430,6 +440,8 @@ public function __construct(array $data = null) $this->container['orgIdNo'] = isset($data['orgIdNo']) ? $data['orgIdNo'] : null; $this->container['orgFedNo'] = isset($data['orgFedNo']) ? $data['orgFedNo'] : null; $this->container['orgProvNo'] = isset($data['orgProvNo']) ? $data['orgProvNo'] : null; + $this->container['orgStateId'] = isset($data['orgStateId']) ? $data['orgStateId'] : null; + $this->container['orgEin'] = isset($data['orgEin']) ? $data['orgEin'] : null; } /** @@ -1487,6 +1499,54 @@ public function setOrgProvNo($orgProvNo) return $this; } + + /** + * Gets orgStateId + * + * @return string|null + */ + public function getOrgStateId() + { + return $this->container['orgStateId']; + } + + /** + * Sets orgStateId + * + * @param string|null $orgStateId orgStateId + * + * @return $this + */ + public function setOrgStateId($orgStateId) + { + $this->container['orgStateId'] = $orgStateId; + + return $this; + } + + /** + * Gets orgEin + * + * @return string|null + */ + public function getOrgEin() + { + return $this->container['orgEin']; + } + + /** + * Sets orgEin + * + * @param string|null $orgEin orgEin + * + * @return $this + */ + public function setOrgEin($orgEin) + { + $this->container['orgEin'] = $orgEin; + + return $this; + } /** * Returns true if offset exists. False otherwise. * diff --git a/test/Api/EventsApiTest.php b/test/Api/EventsApiTest.php index acc7e120..d355e997 100644 --- a/test/Api/EventsApiTest.php +++ b/test/Api/EventsApiTest.php @@ -72,6 +72,16 @@ public static function tearDownAfterClass(): void { } + /** + * Test case for archiveEventInternalNote + * + * Archive an internal note for and event.. + * + */ + public function testArchiveEventInternalNote() + { + } + /** * Test case for createEvent * @@ -182,16 +192,6 @@ public function testPatchEventInternalNote() { } - /** - * Test case for softDeleteEventInternalNote - * - * Soft delete an internal note for and event.. - * - */ - public function testSoftDeleteEventInternalNote() - { - } - /** * Test case for transferEventToCompleted * diff --git a/test/Api/TasksApiTest.php b/test/Api/TasksApiTest.php index ce49d7d3..d2790c14 100644 --- a/test/Api/TasksApiTest.php +++ b/test/Api/TasksApiTest.php @@ -72,6 +72,16 @@ public static function tearDownAfterClass(): void { } + /** + * Test case for archiveTaskInternalNote + * + * Archive an internal note for a task.. + * + */ + public function testArchiveTaskInternalNote() + { + } + /** * Test case for createTask * @@ -152,16 +162,6 @@ public function testPatchTaskInternalNote() { } - /** - * Test case for softDeleteTaskInternalNote - * - * Soft delete an internal note for a task.. - * - */ - public function testSoftDeleteTaskInternalNote() - { - } - /** * Test case for transferTaskToCompleted * diff --git a/test/Model/GatewaysCredentialsTest.php b/test/Model/GatewaysCredentialsTest.php index 5b2d0fd7..1b028d30 100644 --- a/test/Model/GatewaysCredentialsTest.php +++ b/test/Model/GatewaysCredentialsTest.php @@ -91,4 +91,11 @@ public function testPropertyUsername() public function testPropertyPassword() { } + + /** + * Test attribute "isADealerCode" + */ + public function testPropertyIsADealerCode() + { + } } diff --git a/test/Model/GatewaysCredentialsWithSsnTest.php b/test/Model/GatewaysCredentialsWithSsnTest.php index 08cf5601..37a7c83f 100644 --- a/test/Model/GatewaysCredentialsWithSsnTest.php +++ b/test/Model/GatewaysCredentialsWithSsnTest.php @@ -92,6 +92,13 @@ public function testPropertyPassword() { } + /** + * Test attribute "isADealerCode" + */ + public function testPropertyIsADealerCode() + { + } + /** * Test attribute "ssnList" */ diff --git a/test/Model/LegacyContactContactPayloadItemAllOfTest.php b/test/Model/LegacyContactContactPayloadItemAllOfTest.php index 62758dae..0237bf3e 100644 --- a/test/Model/LegacyContactContactPayloadItemAllOfTest.php +++ b/test/Model/LegacyContactContactPayloadItemAllOfTest.php @@ -378,4 +378,18 @@ public function testPropertyOrgFedNo() public function testPropertyOrgProvNo() { } + + /** + * Test attribute "orgStateId" + */ + public function testPropertyOrgStateId() + { + } + + /** + * Test attribute "orgEin" + */ + public function testPropertyOrgEin() + { + } } diff --git a/test/Model/LegacyContactContactPayloadItemTest.php b/test/Model/LegacyContactContactPayloadItemTest.php index 25e27ffd..9c9b23f9 100644 --- a/test/Model/LegacyContactContactPayloadItemTest.php +++ b/test/Model/LegacyContactContactPayloadItemTest.php @@ -462,4 +462,18 @@ public function testPropertyOrgFedNo() public function testPropertyOrgProvNo() { } + + /** + * Test attribute "orgStateId" + */ + public function testPropertyOrgStateId() + { + } + + /** + * Test attribute "orgEin" + */ + public function testPropertyOrgEin() + { + } }