diff --git a/codegen/Crm/Imports/Api/CoreApi.php b/codegen/Crm/Imports/Api/CoreApi.php index 867e177bb..0f962f0c5 100644 --- a/codegen/Crm/Imports/Api/CoreApi.php +++ b/codegen/Crm/Imports/Api/CoreApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -92,13 +92,13 @@ class CoreApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); $this->headerSelector = $selector ?: new HeaderSelector(); $this->hostIndex = $hostIndex; } @@ -187,18 +187,6 @@ public function cancelWithHttpInfo($import_id, string $contentType = self::conte $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 200: @@ -257,6 +245,19 @@ public function cancelWithHttpInfo($import_id, string $contentType = self::conte ]; } + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + $returnType = '\HubSpot\Client\Crm\Imports\Model\ActionResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -482,8 +483,8 @@ public function cancelRequest($import_id, string $contentType = self::contentTyp * * Start a new import * - * @param \SplFileObject $files A list of files containing the data to import (optional) - * @param string $import_request JSON formatted metadata about the import. This includes a name for the import and the column mappings for each file. See the overview tab for more on the required format. (optional) + * @param \SplFileObject|null $files files (optional) + * @param string|null $import_request import_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Imports\ApiException on non-2xx response or if the response body is not in the expected format @@ -501,8 +502,8 @@ public function create($files = null, $import_request = null, string $contentTyp * * Start a new import * - * @param \SplFileObject $files A list of files containing the data to import (optional) - * @param string $import_request JSON formatted metadata about the import. This includes a name for the import and the column mappings for each file. See the overview tab for more on the required format. (optional) + * @param \SplFileObject|null $files (optional) + * @param string|null $import_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Imports\ApiException on non-2xx response or if the response body is not in the expected format @@ -535,18 +536,6 @@ public function createWithHttpInfo($files = null, $import_request = null, string $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 200: @@ -605,6 +594,19 @@ public function createWithHttpInfo($files = null, $import_request = null, string ]; } + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + $returnType = '\HubSpot\Client\Crm\Imports\Model\PublicImportResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -661,8 +663,8 @@ public function createWithHttpInfo($files = null, $import_request = null, string * * Start a new import * - * @param \SplFileObject $files A list of files containing the data to import (optional) - * @param string $import_request JSON formatted metadata about the import. This includes a name for the import and the column mappings for each file. See the overview tab for more on the required format. (optional) + * @param \SplFileObject|null $files (optional) + * @param string|null $import_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -683,8 +685,8 @@ function ($response) { * * Start a new import * - * @param \SplFileObject $files A list of files containing the data to import (optional) - * @param string $import_request JSON formatted metadata about the import. This includes a name for the import and the column mappings for each file. See the overview tab for more on the required format. (optional) + * @param \SplFileObject|null $files (optional) + * @param string|null $import_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -734,8 +736,8 @@ function ($exception) { /** * Create request for operation 'create' * - * @param \SplFileObject $files A list of files containing the data to import (optional) - * @param string $import_request JSON formatted metadata about the import. This includes a name for the import and the column mappings for each file. See the overview tab for more on the required format. (optional) + * @param \SplFileObject|null $files (optional) + * @param string|null $import_request (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -774,6 +776,7 @@ public function createRequest($files = null, $import_request = null, string $con $formParams['importRequest'] = ObjectSerializer::toFormValue($import_request); } + $multipart = true; $headers = $this->headerSelector->selectHeaders( ['application/json', '*/*', ], $contentType, @@ -887,18 +890,6 @@ public function getByIdWithHttpInfo($import_id, string $contentType = self::cont $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 200: @@ -957,6 +948,19 @@ public function getByIdWithHttpInfo($import_id, string $contentType = self::cont ]; } + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + $returnType = '\HubSpot\Client\Crm\Imports\Model\PublicImportResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1182,9 +1186,9 @@ public function getByIdRequest($import_id, string $contentType = self::contentTy * * Get active imports * - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before before (optional) - * @param int $limit The maximum number of results to display per page. (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param string|null $before before (optional) + * @param int|null $limit The maximum number of results to display per page. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Imports\ApiException on non-2xx response or if the response body is not in the expected format @@ -1202,9 +1206,9 @@ public function getPage($after = null, $before = null, $limit = null, string $co * * Get active imports * - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before (optional) - * @param int $limit The maximum number of results to display per page. (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param string|null $before (optional) + * @param int|null $limit The maximum number of results to display per page. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Imports\ApiException on non-2xx response or if the response body is not in the expected format @@ -1237,18 +1241,6 @@ public function getPageWithHttpInfo($after = null, $before = null, $limit = null $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 200: @@ -1307,6 +1299,19 @@ public function getPageWithHttpInfo($after = null, $before = null, $limit = null ]; } + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + $returnType = '\HubSpot\Client\Crm\Imports\Model\CollectionResponsePublicImportResponse'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -1363,9 +1368,9 @@ public function getPageWithHttpInfo($after = null, $before = null, $limit = null * * Get active imports * - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before (optional) - * @param int $limit The maximum number of results to display per page. (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param string|null $before (optional) + * @param int|null $limit The maximum number of results to display per page. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1386,9 +1391,9 @@ function ($response) { * * Get active imports * - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before (optional) - * @param int $limit The maximum number of results to display per page. (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param string|null $before (optional) + * @param int|null $limit The maximum number of results to display per page. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1438,9 +1443,9 @@ function ($exception) { /** * Create request for operation 'getPage' * - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param string $before (optional) - * @param int $limit The maximum number of results to display per page. (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param string|null $before (optional) + * @param int|null $limit The maximum number of results to display per page. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPage'] to see the possible values for this operation * * @throws \InvalidArgumentException diff --git a/codegen/Crm/Imports/Api/PublicImportsApi.php b/codegen/Crm/Imports/Api/PublicImportsApi.php index 90fa61864..5db08c44c 100644 --- a/codegen/Crm/Imports/Api/PublicImportsApi.php +++ b/codegen/Crm/Imports/Api/PublicImportsApi.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -83,13 +83,13 @@ class PublicImportsApi * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec */ public function __construct( - ClientInterface $client = null, - Configuration $config = null, - HeaderSelector $selector = null, - $hostIndex = 0 + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 ) { $this->client = $client ?: new Client(); - $this->config = $config ?: new Configuration(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); $this->headerSelector = $selector ?: new HeaderSelector(); $this->hostIndex = $hostIndex; } @@ -126,17 +126,19 @@ public function getConfig() * Operation getErrors * * @param int $import_id import_id (required) - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to display per page. (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to display per page. (optional) + * @param bool|null $include_error_message Set to True to receive a message explaining the error. (optional) + * @param bool|null $include_row_data Set to True to receive the data values for the errored row. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getErrors'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Imports\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \HubSpot\Client\Crm\Imports\Model\CollectionResponsePublicImportErrorForwardPaging|\HubSpot\Client\Crm\Imports\Model\Error */ - public function getErrors($import_id, $after = null, $limit = null, string $contentType = self::contentTypes['getErrors'][0]) + public function getErrors($import_id, $after = null, $limit = null, $include_error_message = null, $include_row_data = null, string $contentType = self::contentTypes['getErrors'][0]) { - list($response) = $this->getErrorsWithHttpInfo($import_id, $after, $limit, $contentType); + list($response) = $this->getErrorsWithHttpInfo($import_id, $after, $limit, $include_error_message, $include_row_data, $contentType); return $response; } @@ -144,17 +146,19 @@ public function getErrors($import_id, $after = null, $limit = null, string $cont * Operation getErrorsWithHttpInfo * * @param int $import_id (required) - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to display per page. (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to display per page. (optional) + * @param bool|null $include_error_message Set to True to receive a message explaining the error. (optional) + * @param bool|null $include_row_data Set to True to receive the data values for the errored row. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getErrors'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Imports\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \HubSpot\Client\Crm\Imports\Model\CollectionResponsePublicImportErrorForwardPaging|\HubSpot\Client\Crm\Imports\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function getErrorsWithHttpInfo($import_id, $after = null, $limit = null, string $contentType = self::contentTypes['getErrors'][0]) + public function getErrorsWithHttpInfo($import_id, $after = null, $limit = null, $include_error_message = null, $include_row_data = null, string $contentType = self::contentTypes['getErrors'][0]) { - $request = $this->getErrorsRequest($import_id, $after, $limit, $contentType); + $request = $this->getErrorsRequest($import_id, $after, $limit, $include_error_message, $include_row_data, $contentType); try { $options = $this->createHttpClientOption(); @@ -178,18 +182,6 @@ public function getErrorsWithHttpInfo($import_id, $after = null, $limit = null, $statusCode = $response->getStatusCode(); - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } switch($statusCode) { case 200: @@ -248,6 +240,19 @@ public function getErrorsWithHttpInfo($import_id, $after = null, $limit = null, ]; } + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + $returnType = '\HubSpot\Client\Crm\Imports\Model\CollectionResponsePublicImportErrorForwardPaging'; if ($returnType === '\SplFileObject') { $content = $response->getBody(); //stream goes to serializer @@ -303,16 +308,18 @@ public function getErrorsWithHttpInfo($import_id, $after = null, $limit = null, * Operation getErrorsAsync * * @param int $import_id (required) - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to display per page. (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to display per page. (optional) + * @param bool|null $include_error_message Set to True to receive a message explaining the error. (optional) + * @param bool|null $include_row_data Set to True to receive the data values for the errored row. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getErrors'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getErrorsAsync($import_id, $after = null, $limit = null, string $contentType = self::contentTypes['getErrors'][0]) + public function getErrorsAsync($import_id, $after = null, $limit = null, $include_error_message = null, $include_row_data = null, string $contentType = self::contentTypes['getErrors'][0]) { - return $this->getErrorsAsyncWithHttpInfo($import_id, $after, $limit, $contentType) + return $this->getErrorsAsyncWithHttpInfo($import_id, $after, $limit, $include_error_message, $include_row_data, $contentType) ->then( function ($response) { return $response[0]; @@ -324,17 +331,19 @@ function ($response) { * Operation getErrorsAsyncWithHttpInfo * * @param int $import_id (required) - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to display per page. (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to display per page. (optional) + * @param bool|null $include_error_message Set to True to receive a message explaining the error. (optional) + * @param bool|null $include_row_data Set to True to receive the data values for the errored row. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getErrors'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getErrorsAsyncWithHttpInfo($import_id, $after = null, $limit = null, string $contentType = self::contentTypes['getErrors'][0]) + public function getErrorsAsyncWithHttpInfo($import_id, $after = null, $limit = null, $include_error_message = null, $include_row_data = null, string $contentType = self::contentTypes['getErrors'][0]) { $returnType = '\HubSpot\Client\Crm\Imports\Model\CollectionResponsePublicImportErrorForwardPaging'; - $request = $this->getErrorsRequest($import_id, $after, $limit, $contentType); + $request = $this->getErrorsRequest($import_id, $after, $limit, $include_error_message, $include_row_data, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -376,14 +385,16 @@ function ($exception) { * Create request for operation 'getErrors' * * @param int $import_id (required) - * @param string $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) - * @param int $limit The maximum number of results to display per page. (optional) + * @param string|null $after The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results. (optional) + * @param int|null $limit The maximum number of results to display per page. (optional) + * @param bool|null $include_error_message Set to True to receive a message explaining the error. (optional) + * @param bool|null $include_row_data Set to True to receive the data values for the errored row. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getErrors'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getErrorsRequest($import_id, $after = null, $limit = null, string $contentType = self::contentTypes['getErrors'][0]) + public function getErrorsRequest($import_id, $after = null, $limit = null, $include_error_message = null, $include_row_data = null, string $contentType = self::contentTypes['getErrors'][0]) { // verify the required parameter 'import_id' is set @@ -396,6 +407,8 @@ public function getErrorsRequest($import_id, $after = null, $limit = null, strin + + $resourcePath = '/crm/v3/imports/{importId}/errors'; $formParams = []; $queryParams = []; @@ -421,6 +434,24 @@ public function getErrorsRequest($import_id, $after = null, $limit = null, strin true, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_error_message, + 'includeErrorMessage', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $include_row_data, + 'includeRowData', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params diff --git a/codegen/Crm/Imports/ApiException.php b/codegen/Crm/Imports/ApiException.php index d40b1c249..ba4acf593 100644 --- a/codegen/Crm/Imports/ApiException.php +++ b/codegen/Crm/Imports/ApiException.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -49,7 +49,7 @@ class ApiException extends Exception /** * The HTTP header of the server response. * - * @var string[]|null + * @var string[][]|null */ protected $responseHeaders; @@ -65,7 +65,7 @@ class ApiException extends Exception * * @param string $message Error message * @param int $code HTTP status code - * @param string[]|null $responseHeaders HTTP response header + * @param string[][]|null $responseHeaders HTTP response header * @param \stdClass|string|null $responseBody HTTP decoded body of the server response either as \stdClass or string */ public function __construct($message = "", $code = 0, $responseHeaders = [], $responseBody = null) @@ -78,7 +78,7 @@ public function __construct($message = "", $code = 0, $responseHeaders = [], $re /** * Gets the HTTP response header * - * @return string[]|null HTTP response header + * @return string[][]|null HTTP response header */ public function getResponseHeaders() { diff --git a/codegen/Crm/Imports/Configuration.php b/codegen/Crm/Imports/Configuration.php index c30b5667d..33f32919a 100644 --- a/codegen/Crm/Imports/Configuration.php +++ b/codegen/Crm/Imports/Configuration.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -486,7 +486,7 @@ public function getHostSettings() * @param array|null $variables hash of variable and the corresponding value (optional) * @return string URL based on host settings */ - public static function getHostString(array $hostSettings, $hostIndex, array $variables = null) + public static function getHostString(array $hostSettings, $hostIndex, ?array $variables = null) { if (null === $variables) { $variables = []; diff --git a/codegen/Crm/Imports/HeaderSelector.php b/codegen/Crm/Imports/HeaderSelector.php index d4fe6b708..b2b2fe30f 100644 --- a/codegen/Crm/Imports/HeaderSelector.php +++ b/codegen/Crm/Imports/HeaderSelector.php @@ -16,7 +16,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -85,7 +85,7 @@ private function selectAcceptHeader(array $accept): ?string } # If none of the available Accept headers is of type "json", then just use all them - $headersWithJson = preg_grep('~(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$~', $accept); + $headersWithJson = $this->selectJsonMimeList($accept); if (count($headersWithJson) === 0) { return implode(',', $accept); } @@ -95,6 +95,34 @@ private function selectAcceptHeader(array $accept): ?string return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson); } + /** + * Detects whether a string contains a valid JSON mime type + * + * @param string $searchString + * @return bool + */ + public function isJsonMime(string $searchString): bool + { + return preg_match('~^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)~', $searchString) === 1; + } + + /** + * Select all items from a list containing a JSON mime type + * + * @param array $mimeList + * @return array + */ + private function selectJsonMimeList(array $mimeList): array { + $jsonMimeList = []; + foreach ($mimeList as $mime) { + if($this->isJsonMime($mime)) { + $jsonMimeList[] = $mime; + } + } + return $jsonMimeList; + } + + /** * Create an Accept header string from the given "Accept" headers array, recalculating all weights * diff --git a/codegen/Crm/Imports/Model/ActionResponse.php b/codegen/Crm/Imports/Model/ActionResponse.php index 520b4ceaf..3eb9c7885 100644 --- a/codegen/Crm/Imports/Model/ActionResponse.php +++ b/codegen/Crm/Imports/Model/ActionResponse.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -282,10 +282,10 @@ public function getStatusAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('completed_at', $data ?? [], null); $this->setIfExists('requested_at', $data ?? [], null); diff --git a/codegen/Crm/Imports/Model/CollectionResponsePublicImportErrorForwardPaging.php b/codegen/Crm/Imports/Model/CollectionResponsePublicImportErrorForwardPaging.php index b714b683b..51293c0c8 100644 --- a/codegen/Crm/Imports/Model/CollectionResponsePublicImportErrorForwardPaging.php +++ b/codegen/Crm/Imports/Model/CollectionResponsePublicImportErrorForwardPaging.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('paging', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); diff --git a/codegen/Crm/Imports/Model/CollectionResponsePublicImportResponse.php b/codegen/Crm/Imports/Model/CollectionResponsePublicImportResponse.php index a07fa9ded..1d9c4ac75 100644 --- a/codegen/Crm/Imports/Model/CollectionResponsePublicImportResponse.php +++ b/codegen/Crm/Imports/Model/CollectionResponsePublicImportResponse.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('paging', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); diff --git a/codegen/Crm/Imports/Model/Error.php b/codegen/Crm/Imports/Model/Error.php index 94a12d12e..fcab0c830 100644 --- a/codegen/Crm/Imports/Model/Error.php +++ b/codegen/Crm/Imports/Model/Error.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -275,10 +275,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('sub_category', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); diff --git a/codegen/Crm/Imports/Model/ErrorDetail.php b/codegen/Crm/Imports/Model/ErrorDetail.php index d381b4d16..3a9828094 100644 --- a/codegen/Crm/Imports/Model/ErrorDetail.php +++ b/codegen/Crm/Imports/Model/ErrorDetail.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -263,10 +263,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('sub_category', $data ?? [], null); $this->setIfExists('code', $data ?? [], null); diff --git a/codegen/Crm/Imports/Model/ForwardPaging.php b/codegen/Crm/Imports/Model/ForwardPaging.php index 464ed4a2e..4d979d649 100644 --- a/codegen/Crm/Imports/Model/ForwardPaging.php +++ b/codegen/Crm/Imports/Model/ForwardPaging.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -239,10 +239,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('next', $data ?? [], null); } diff --git a/codegen/Crm/Imports/Model/ImportRowCore.php b/codegen/Crm/Imports/Model/ImportRowCore.php index e46b4e3f8..10d586606 100644 --- a/codegen/Crm/Imports/Model/ImportRowCore.php +++ b/codegen/Crm/Imports/Model/ImportRowCore.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -58,6 +58,7 @@ class ImportRowCore implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'row_data' => 'string[]', + 'contains_encrypted_properties' => 'bool', 'line_number' => 'int', 'page_name' => 'string', 'file_id' => 'int' @@ -72,6 +73,7 @@ class ImportRowCore implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'row_data' => null, + 'contains_encrypted_properties' => null, 'line_number' => 'int32', 'page_name' => null, 'file_id' => 'int32' @@ -84,6 +86,7 @@ class ImportRowCore implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'row_data' => false, + 'contains_encrypted_properties' => false, 'line_number' => false, 'page_name' => false, 'file_id' => false @@ -176,6 +179,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'row_data' => 'rowData', + 'contains_encrypted_properties' => 'containsEncryptedProperties', 'line_number' => 'lineNumber', 'page_name' => 'pageName', 'file_id' => 'fileId' @@ -188,6 +192,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'row_data' => 'setRowData', + 'contains_encrypted_properties' => 'setContainsEncryptedProperties', 'line_number' => 'setLineNumber', 'page_name' => 'setPageName', 'file_id' => 'setFileId' @@ -200,6 +205,7 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'row_data' => 'getRowData', + 'contains_encrypted_properties' => 'getContainsEncryptedProperties', 'line_number' => 'getLineNumber', 'page_name' => 'getPageName', 'file_id' => 'getFileId' @@ -257,12 +263,13 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('row_data', $data ?? [], null); + $this->setIfExists('contains_encrypted_properties', $data ?? [], null); $this->setIfExists('line_number', $data ?? [], null); $this->setIfExists('page_name', $data ?? [], null); $this->setIfExists('file_id', $data ?? [], null); @@ -298,6 +305,9 @@ public function listInvalidProperties() if ($this->container['row_data'] === null) { $invalidProperties[] = "'row_data' can't be null"; } + if ($this->container['contains_encrypted_properties'] === null) { + $invalidProperties[] = "'contains_encrypted_properties' can't be null"; + } if ($this->container['line_number'] === null) { $invalidProperties[] = "'line_number' can't be null"; } @@ -346,6 +356,33 @@ public function setRowData($row_data) return $this; } + /** + * Gets contains_encrypted_properties + * + * @return bool + */ + public function getContainsEncryptedProperties() + { + return $this->container['contains_encrypted_properties']; + } + + /** + * Sets contains_encrypted_properties + * + * @param bool $contains_encrypted_properties contains_encrypted_properties + * + * @return self + */ + public function setContainsEncryptedProperties($contains_encrypted_properties) + { + if (is_null($contains_encrypted_properties)) { + throw new \InvalidArgumentException('non-nullable contains_encrypted_properties cannot be null'); + } + $this->container['contains_encrypted_properties'] = $contains_encrypted_properties; + + return $this; + } + /** * Gets line_number * diff --git a/codegen/Crm/Imports/Model/ImportTemplate.php b/codegen/Crm/Imports/Model/ImportTemplate.php index 61b846048..de457ade4 100644 --- a/codegen/Crm/Imports/Model/ImportTemplate.php +++ b/codegen/Crm/Imports/Model/ImportTemplate.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -262,10 +262,10 @@ public function getTemplateTypeAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('template_type', $data ?? [], null); $this->setIfExists('template_id', $data ?? [], null); diff --git a/codegen/Crm/Imports/Model/ModelInterface.php b/codegen/Crm/Imports/Model/ModelInterface.php index a0cfbb959..699d171bc 100644 --- a/codegen/Crm/Imports/Model/ModelInterface.php +++ b/codegen/Crm/Imports/Model/ModelInterface.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** diff --git a/codegen/Crm/Imports/Model/NextPage.php b/codegen/Crm/Imports/Model/NextPage.php index fa1c980b7..3330fbb74 100644 --- a/codegen/Crm/Imports/Model/NextPage.php +++ b/codegen/Crm/Imports/Model/NextPage.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('link', $data ?? [], null); $this->setIfExists('after', $data ?? [], null); diff --git a/codegen/Crm/Imports/Model/Paging.php b/codegen/Crm/Imports/Model/Paging.php index 45b9f51ae..69356d320 100644 --- a/codegen/Crm/Imports/Model/Paging.php +++ b/codegen/Crm/Imports/Model/Paging.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('next', $data ?? [], null); $this->setIfExists('prev', $data ?? [], null); diff --git a/codegen/Crm/Imports/Model/PreviousPage.php b/codegen/Crm/Imports/Model/PreviousPage.php index 16385e6a8..54686b879 100644 --- a/codegen/Crm/Imports/Model/PreviousPage.php +++ b/codegen/Crm/Imports/Model/PreviousPage.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -245,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('before', $data ?? [], null); $this->setIfExists('link', $data ?? [], null); diff --git a/codegen/Crm/Imports/Model/PropertyValue.php b/codegen/Crm/Imports/Model/PropertyValue.php new file mode 100644 index 000000000..a09b43074 --- /dev/null +++ b/codegen/Crm/Imports/Model/PropertyValue.php @@ -0,0 +1,1289 @@ + + */ +class PropertyValue implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PropertyValue'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'source_id' => 'string', + 'selected_by_user' => 'bool', + 'source_label' => 'string', + 'source' => 'string', + 'updated_by_user_id' => 'int', + 'persistence_timestamp' => 'int', + 'source_metadata' => 'string', + 'data_sensitivity' => 'string', + 'source_vid' => 'int[]', + 'unit' => 'string', + 'request_id' => 'string', + 'is_encrypted' => 'bool', + 'name' => 'string', + 'use_timestamp_as_persistence_timestamp' => 'bool', + 'value' => 'string', + 'selected_by_user_timestamp' => 'int', + 'timestamp' => 'int', + 'is_large_value' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'source_id' => null, + 'selected_by_user' => null, + 'source_label' => null, + 'source' => null, + 'updated_by_user_id' => 'int32', + 'persistence_timestamp' => 'int64', + 'source_metadata' => null, + 'data_sensitivity' => null, + 'source_vid' => 'int64', + 'unit' => null, + 'request_id' => null, + 'is_encrypted' => null, + 'name' => null, + 'use_timestamp_as_persistence_timestamp' => null, + 'value' => null, + 'selected_by_user_timestamp' => 'int64', + 'timestamp' => 'int64', + 'is_large_value' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'source_id' => false, + 'selected_by_user' => false, + 'source_label' => false, + 'source' => false, + 'updated_by_user_id' => false, + 'persistence_timestamp' => false, + 'source_metadata' => false, + 'data_sensitivity' => false, + 'source_vid' => false, + 'unit' => false, + 'request_id' => false, + 'is_encrypted' => false, + 'name' => false, + 'use_timestamp_as_persistence_timestamp' => false, + 'value' => false, + 'selected_by_user_timestamp' => false, + 'timestamp' => false, + 'is_large_value' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'source_id' => 'sourceId', + 'selected_by_user' => 'selectedByUser', + 'source_label' => 'sourceLabel', + 'source' => 'source', + 'updated_by_user_id' => 'updatedByUserId', + 'persistence_timestamp' => 'persistenceTimestamp', + 'source_metadata' => 'sourceMetadata', + 'data_sensitivity' => 'dataSensitivity', + 'source_vid' => 'sourceVid', + 'unit' => 'unit', + 'request_id' => 'requestId', + 'is_encrypted' => 'isEncrypted', + 'name' => 'name', + 'use_timestamp_as_persistence_timestamp' => 'useTimestampAsPersistenceTimestamp', + 'value' => 'value', + 'selected_by_user_timestamp' => 'selectedByUserTimestamp', + 'timestamp' => 'timestamp', + 'is_large_value' => 'isLargeValue' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'source_id' => 'setSourceId', + 'selected_by_user' => 'setSelectedByUser', + 'source_label' => 'setSourceLabel', + 'source' => 'setSource', + 'updated_by_user_id' => 'setUpdatedByUserId', + 'persistence_timestamp' => 'setPersistenceTimestamp', + 'source_metadata' => 'setSourceMetadata', + 'data_sensitivity' => 'setDataSensitivity', + 'source_vid' => 'setSourceVid', + 'unit' => 'setUnit', + 'request_id' => 'setRequestId', + 'is_encrypted' => 'setIsEncrypted', + 'name' => 'setName', + 'use_timestamp_as_persistence_timestamp' => 'setUseTimestampAsPersistenceTimestamp', + 'value' => 'setValue', + 'selected_by_user_timestamp' => 'setSelectedByUserTimestamp', + 'timestamp' => 'setTimestamp', + 'is_large_value' => 'setIsLargeValue' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'source_id' => 'getSourceId', + 'selected_by_user' => 'getSelectedByUser', + 'source_label' => 'getSourceLabel', + 'source' => 'getSource', + 'updated_by_user_id' => 'getUpdatedByUserId', + 'persistence_timestamp' => 'getPersistenceTimestamp', + 'source_metadata' => 'getSourceMetadata', + 'data_sensitivity' => 'getDataSensitivity', + 'source_vid' => 'getSourceVid', + 'unit' => 'getUnit', + 'request_id' => 'getRequestId', + 'is_encrypted' => 'getIsEncrypted', + 'name' => 'getName', + 'use_timestamp_as_persistence_timestamp' => 'getUseTimestampAsPersistenceTimestamp', + 'value' => 'getValue', + 'selected_by_user_timestamp' => 'getSelectedByUserTimestamp', + 'timestamp' => 'getTimestamp', + 'is_large_value' => 'getIsLargeValue' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + public const SOURCE_UNKNOWN = 'UNKNOWN'; + public const SOURCE_IMPORT = 'IMPORT'; + public const SOURCE_API = 'API'; + public const SOURCE_FORM = 'FORM'; + public const SOURCE_ANALYTICS = 'ANALYTICS'; + public const SOURCE_MIGRATION = 'MIGRATION'; + public const SOURCE_SALESFORCE = 'SALESFORCE'; + public const SOURCE_INTEGRATION = 'INTEGRATION'; + public const SOURCE_CONTACTS_WEB = 'CONTACTS_WEB'; + public const SOURCE_WAL_INCREMENTAL = 'WAL_INCREMENTAL'; + public const SOURCE_TASK = 'TASK'; + public const SOURCE_EMAIL = 'EMAIL'; + public const SOURCE_WORKFLOWS = 'WORKFLOWS'; + public const SOURCE_CALCULATED = 'CALCULATED'; + public const SOURCE_SOCIAL = 'SOCIAL'; + public const SOURCE_BATCH_UPDATE = 'BATCH_UPDATE'; + public const SOURCE_SIGNALS = 'SIGNALS'; + public const SOURCE_BIDEN = 'BIDEN'; + public const SOURCE__DEFAULT = 'DEFAULT'; + public const SOURCE_COMPANIES = 'COMPANIES'; + public const SOURCE_DEALS = 'DEALS'; + public const SOURCE_ASSISTS = 'ASSISTS'; + public const SOURCE_PRESENTATIONS = 'PRESENTATIONS'; + public const SOURCE_TALLY = 'TALLY'; + public const SOURCE_SIDEKICK = 'SIDEKICK'; + public const SOURCE_CRM_UI = 'CRM_UI'; + public const SOURCE_MERGE_CONTACTS = 'MERGE_CONTACTS'; + public const SOURCE_PORTAL_USER_ASSOCIATOR = 'PORTAL_USER_ASSOCIATOR'; + public const SOURCE_INTEGRATIONS_PLATFORM = 'INTEGRATIONS_PLATFORM'; + public const SOURCE_BCC_TO_CRM = 'BCC_TO_CRM'; + public const SOURCE_FORWARD_TO_CRM = 'FORWARD_TO_CRM'; + public const SOURCE_ENGAGEMENTS = 'ENGAGEMENTS'; + public const SOURCE_SALES = 'SALES'; + public const SOURCE_HEISENBERG = 'HEISENBERG'; + public const SOURCE_LEADIN = 'LEADIN'; + public const SOURCE_GMAIL_INTEGRATION = 'GMAIL_INTEGRATION'; + public const SOURCE_ACADEMY = 'ACADEMY'; + public const SOURCE_SALES_MESSAGES = 'SALES_MESSAGES'; + public const SOURCE_AVATARS_SERVICE = 'AVATARS_SERVICE'; + public const SOURCE_MERGE_COMPANIES = 'MERGE_COMPANIES'; + public const SOURCE_SEQUENCES = 'SEQUENCES'; + public const SOURCE_COMPANY_FAMILIES = 'COMPANY_FAMILIES'; + public const SOURCE_MOBILE_IOS = 'MOBILE_IOS'; + public const SOURCE_MOBILE_ANDROID = 'MOBILE_ANDROID'; + public const SOURCE_CONTACTS = 'CONTACTS'; + public const SOURCE_ASSOCIATIONS = 'ASSOCIATIONS'; + public const SOURCE_EXTENSION = 'EXTENSION'; + public const SOURCE_SUCCESS = 'SUCCESS'; + public const SOURCE_BOT = 'BOT'; + public const SOURCE_INTEGRATIONS_SYNC = 'INTEGRATIONS_SYNC'; + public const SOURCE_AUTOMATION_PLATFORM = 'AUTOMATION_PLATFORM'; + public const SOURCE_CONVERSATIONS = 'CONVERSATIONS'; + public const SOURCE_EMAIL_INTEGRATION = 'EMAIL_INTEGRATION'; + public const SOURCE_CONTENT_MEMBERSHIP = 'CONTENT_MEMBERSHIP'; + public const SOURCE_QUOTES = 'QUOTES'; + public const SOURCE_BET_ASSIGNMENT = 'BET_ASSIGNMENT'; + public const SOURCE_QUOTAS = 'QUOTAS'; + public const SOURCE_BET_CRM_CONNECTOR = 'BET_CRM_CONNECTOR'; + public const SOURCE_MEETINGS = 'MEETINGS'; + public const SOURCE_MERGE_OBJECTS = 'MERGE_OBJECTS'; + public const SOURCE_RECYCLING_BIN = 'RECYCLING_BIN'; + public const SOURCE_ADS = 'ADS'; + public const SOURCE_AI_GROUP = 'AI_GROUP'; + public const SOURCE_COMMUNICATOR = 'COMMUNICATOR'; + public const SOURCE_SETTINGS = 'SETTINGS'; + public const SOURCE_PROPERTY_SETTINGS = 'PROPERTY_SETTINGS'; + public const SOURCE_PIPELINE_SETTINGS = 'PIPELINE_SETTINGS'; + public const SOURCE_COMPANY_INSIGHTS = 'COMPANY_INSIGHTS'; + public const SOURCE_BEHAVIORAL_EVENTS = 'BEHAVIORAL_EVENTS'; + public const SOURCE_PAYMENTS = 'PAYMENTS'; + public const SOURCE_GOALS = 'GOALS'; + public const SOURCE_PORTAL_OBJECT_SYNC = 'PORTAL_OBJECT_SYNC'; + public const SOURCE_APPROVALS = 'APPROVALS'; + public const SOURCE_FILE_MANAGER = 'FILE_MANAGER'; + public const SOURCE_MARKETPLACE = 'MARKETPLACE'; + public const SOURCE_INTERNAL_PROCESSING = 'INTERNAL_PROCESSING'; + public const SOURCE_FORECASTING = 'FORECASTING'; + public const SOURCE_SLACK_INTEGRATION = 'SLACK_INTEGRATION'; + public const SOURCE_CRM_UI_BULK_ACTION = 'CRM_UI_BULK_ACTION'; + public const SOURCE_WORKFLOW_CONTACT_DELETE_ACTION = 'WORKFLOW_CONTACT_DELETE_ACTION'; + public const SOURCE_ACCEPTANCE_TEST = 'ACCEPTANCE_TEST'; + public const SOURCE_PLAYBOOKS = 'PLAYBOOKS'; + public const SOURCE_CHATSPOT = 'CHATSPOT'; + public const SOURCE_FLYWHEEL_PRODUCT_DATA_SYNC = 'FLYWHEEL_PRODUCT_DATA_SYNC'; + public const SOURCE_HELP_DESK = 'HELP_DESK'; + public const SOURCE_BILLING = 'BILLING'; + public const SOURCE_DATA_ENRICHMENT = 'DATA_ENRICHMENT'; + public const SOURCE_AUTOMATION_JOURNEY = 'AUTOMATION_JOURNEY'; + public const SOURCE_MICROAPPS = 'MICROAPPS'; + public const SOURCE_INTENT = 'INTENT'; + public const SOURCE_PROSPECTING_AGENT = 'PROSPECTING_AGENT'; + public const DATA_SENSITIVITY_NONE = 'none'; + public const DATA_SENSITIVITY_STANDARD = 'standard'; + public const DATA_SENSITIVITY_HIGH = 'high'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getSourceAllowableValues() + { + return [ + self::SOURCE_UNKNOWN, + self::SOURCE_IMPORT, + self::SOURCE_API, + self::SOURCE_FORM, + self::SOURCE_ANALYTICS, + self::SOURCE_MIGRATION, + self::SOURCE_SALESFORCE, + self::SOURCE_INTEGRATION, + self::SOURCE_CONTACTS_WEB, + self::SOURCE_WAL_INCREMENTAL, + self::SOURCE_TASK, + self::SOURCE_EMAIL, + self::SOURCE_WORKFLOWS, + self::SOURCE_CALCULATED, + self::SOURCE_SOCIAL, + self::SOURCE_BATCH_UPDATE, + self::SOURCE_SIGNALS, + self::SOURCE_BIDEN, + self::SOURCE__DEFAULT, + self::SOURCE_COMPANIES, + self::SOURCE_DEALS, + self::SOURCE_ASSISTS, + self::SOURCE_PRESENTATIONS, + self::SOURCE_TALLY, + self::SOURCE_SIDEKICK, + self::SOURCE_CRM_UI, + self::SOURCE_MERGE_CONTACTS, + self::SOURCE_PORTAL_USER_ASSOCIATOR, + self::SOURCE_INTEGRATIONS_PLATFORM, + self::SOURCE_BCC_TO_CRM, + self::SOURCE_FORWARD_TO_CRM, + self::SOURCE_ENGAGEMENTS, + self::SOURCE_SALES, + self::SOURCE_HEISENBERG, + self::SOURCE_LEADIN, + self::SOURCE_GMAIL_INTEGRATION, + self::SOURCE_ACADEMY, + self::SOURCE_SALES_MESSAGES, + self::SOURCE_AVATARS_SERVICE, + self::SOURCE_MERGE_COMPANIES, + self::SOURCE_SEQUENCES, + self::SOURCE_COMPANY_FAMILIES, + self::SOURCE_MOBILE_IOS, + self::SOURCE_MOBILE_ANDROID, + self::SOURCE_CONTACTS, + self::SOURCE_ASSOCIATIONS, + self::SOURCE_EXTENSION, + self::SOURCE_SUCCESS, + self::SOURCE_BOT, + self::SOURCE_INTEGRATIONS_SYNC, + self::SOURCE_AUTOMATION_PLATFORM, + self::SOURCE_CONVERSATIONS, + self::SOURCE_EMAIL_INTEGRATION, + self::SOURCE_CONTENT_MEMBERSHIP, + self::SOURCE_QUOTES, + self::SOURCE_BET_ASSIGNMENT, + self::SOURCE_QUOTAS, + self::SOURCE_BET_CRM_CONNECTOR, + self::SOURCE_MEETINGS, + self::SOURCE_MERGE_OBJECTS, + self::SOURCE_RECYCLING_BIN, + self::SOURCE_ADS, + self::SOURCE_AI_GROUP, + self::SOURCE_COMMUNICATOR, + self::SOURCE_SETTINGS, + self::SOURCE_PROPERTY_SETTINGS, + self::SOURCE_PIPELINE_SETTINGS, + self::SOURCE_COMPANY_INSIGHTS, + self::SOURCE_BEHAVIORAL_EVENTS, + self::SOURCE_PAYMENTS, + self::SOURCE_GOALS, + self::SOURCE_PORTAL_OBJECT_SYNC, + self::SOURCE_APPROVALS, + self::SOURCE_FILE_MANAGER, + self::SOURCE_MARKETPLACE, + self::SOURCE_INTERNAL_PROCESSING, + self::SOURCE_FORECASTING, + self::SOURCE_SLACK_INTEGRATION, + self::SOURCE_CRM_UI_BULK_ACTION, + self::SOURCE_WORKFLOW_CONTACT_DELETE_ACTION, + self::SOURCE_ACCEPTANCE_TEST, + self::SOURCE_PLAYBOOKS, + self::SOURCE_CHATSPOT, + self::SOURCE_FLYWHEEL_PRODUCT_DATA_SYNC, + self::SOURCE_HELP_DESK, + self::SOURCE_BILLING, + self::SOURCE_DATA_ENRICHMENT, + self::SOURCE_AUTOMATION_JOURNEY, + self::SOURCE_MICROAPPS, + self::SOURCE_INTENT, + self::SOURCE_PROSPECTING_AGENT, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getDataSensitivityAllowableValues() + { + return [ + self::DATA_SENSITIVITY_NONE, + self::DATA_SENSITIVITY_STANDARD, + self::DATA_SENSITIVITY_HIGH, + ]; + } + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('source_id', $data ?? [], null); + $this->setIfExists('selected_by_user', $data ?? [], null); + $this->setIfExists('source_label', $data ?? [], null); + $this->setIfExists('source', $data ?? [], null); + $this->setIfExists('updated_by_user_id', $data ?? [], null); + $this->setIfExists('persistence_timestamp', $data ?? [], null); + $this->setIfExists('source_metadata', $data ?? [], null); + $this->setIfExists('data_sensitivity', $data ?? [], null); + $this->setIfExists('source_vid', $data ?? [], null); + $this->setIfExists('unit', $data ?? [], null); + $this->setIfExists('request_id', $data ?? [], null); + $this->setIfExists('is_encrypted', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('use_timestamp_as_persistence_timestamp', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('selected_by_user_timestamp', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('is_large_value', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + if ($this->container['source_id'] === null) { + $invalidProperties[] = "'source_id' can't be null"; + } + if ($this->container['selected_by_user'] === null) { + $invalidProperties[] = "'selected_by_user' can't be null"; + } + if ($this->container['source_label'] === null) { + $invalidProperties[] = "'source_label' can't be null"; + } + if ($this->container['source'] === null) { + $invalidProperties[] = "'source' can't be null"; + } + $allowedValues = $this->getSourceAllowableValues(); + if (!is_null($this->container['source']) && !in_array($this->container['source'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'source', must be one of '%s'", + $this->container['source'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['updated_by_user_id'] === null) { + $invalidProperties[] = "'updated_by_user_id' can't be null"; + } + if ($this->container['persistence_timestamp'] === null) { + $invalidProperties[] = "'persistence_timestamp' can't be null"; + } + if ($this->container['source_metadata'] === null) { + $invalidProperties[] = "'source_metadata' can't be null"; + } + if ($this->container['data_sensitivity'] === null) { + $invalidProperties[] = "'data_sensitivity' can't be null"; + } + $allowedValues = $this->getDataSensitivityAllowableValues(); + if (!is_null($this->container['data_sensitivity']) && !in_array($this->container['data_sensitivity'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'data_sensitivity', must be one of '%s'", + $this->container['data_sensitivity'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['source_vid'] === null) { + $invalidProperties[] = "'source_vid' can't be null"; + } + if ($this->container['unit'] === null) { + $invalidProperties[] = "'unit' can't be null"; + } + if ($this->container['request_id'] === null) { + $invalidProperties[] = "'request_id' can't be null"; + } + if ($this->container['is_encrypted'] === null) { + $invalidProperties[] = "'is_encrypted' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['use_timestamp_as_persistence_timestamp'] === null) { + $invalidProperties[] = "'use_timestamp_as_persistence_timestamp' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ($this->container['selected_by_user_timestamp'] === null) { + $invalidProperties[] = "'selected_by_user_timestamp' can't be null"; + } + if ($this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } + if ($this->container['is_large_value'] === null) { + $invalidProperties[] = "'is_large_value' can't be null"; + } + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets source_id + * + * @return string + */ + public function getSourceId() + { + return $this->container['source_id']; + } + + /** + * Sets source_id + * + * @param string $source_id source_id + * + * @return self + */ + public function setSourceId($source_id) + { + if (is_null($source_id)) { + throw new \InvalidArgumentException('non-nullable source_id cannot be null'); + } + $this->container['source_id'] = $source_id; + + return $this; + } + + /** + * Gets selected_by_user + * + * @return bool + */ + public function getSelectedByUser() + { + return $this->container['selected_by_user']; + } + + /** + * Sets selected_by_user + * + * @param bool $selected_by_user selected_by_user + * + * @return self + */ + public function setSelectedByUser($selected_by_user) + { + if (is_null($selected_by_user)) { + throw new \InvalidArgumentException('non-nullable selected_by_user cannot be null'); + } + $this->container['selected_by_user'] = $selected_by_user; + + return $this; + } + + /** + * Gets source_label + * + * @return string + */ + public function getSourceLabel() + { + return $this->container['source_label']; + } + + /** + * Sets source_label + * + * @param string $source_label source_label + * + * @return self + */ + public function setSourceLabel($source_label) + { + if (is_null($source_label)) { + throw new \InvalidArgumentException('non-nullable source_label cannot be null'); + } + $this->container['source_label'] = $source_label; + + return $this; + } + + /** + * Gets source + * + * @return string + */ + public function getSource() + { + return $this->container['source']; + } + + /** + * Sets source + * + * @param string $source source + * + * @return self + */ + public function setSource($source) + { + if (is_null($source)) { + throw new \InvalidArgumentException('non-nullable source cannot be null'); + } + $allowedValues = $this->getSourceAllowableValues(); + if (!in_array($source, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'source', must be one of '%s'", + $source, + implode("', '", $allowedValues) + ) + ); + } + $this->container['source'] = $source; + + return $this; + } + + /** + * Gets updated_by_user_id + * + * @return int + */ + public function getUpdatedByUserId() + { + return $this->container['updated_by_user_id']; + } + + /** + * Sets updated_by_user_id + * + * @param int $updated_by_user_id updated_by_user_id + * + * @return self + */ + public function setUpdatedByUserId($updated_by_user_id) + { + if (is_null($updated_by_user_id)) { + throw new \InvalidArgumentException('non-nullable updated_by_user_id cannot be null'); + } + $this->container['updated_by_user_id'] = $updated_by_user_id; + + return $this; + } + + /** + * Gets persistence_timestamp + * + * @return int + */ + public function getPersistenceTimestamp() + { + return $this->container['persistence_timestamp']; + } + + /** + * Sets persistence_timestamp + * + * @param int $persistence_timestamp persistence_timestamp + * + * @return self + */ + public function setPersistenceTimestamp($persistence_timestamp) + { + if (is_null($persistence_timestamp)) { + throw new \InvalidArgumentException('non-nullable persistence_timestamp cannot be null'); + } + $this->container['persistence_timestamp'] = $persistence_timestamp; + + return $this; + } + + /** + * Gets source_metadata + * + * @return string + */ + public function getSourceMetadata() + { + return $this->container['source_metadata']; + } + + /** + * Sets source_metadata + * + * @param string $source_metadata source_metadata + * + * @return self + */ + public function setSourceMetadata($source_metadata) + { + if (is_null($source_metadata)) { + throw new \InvalidArgumentException('non-nullable source_metadata cannot be null'); + } + $this->container['source_metadata'] = $source_metadata; + + return $this; + } + + /** + * Gets data_sensitivity + * + * @return string + */ + public function getDataSensitivity() + { + return $this->container['data_sensitivity']; + } + + /** + * Sets data_sensitivity + * + * @param string $data_sensitivity data_sensitivity + * + * @return self + */ + public function setDataSensitivity($data_sensitivity) + { + if (is_null($data_sensitivity)) { + throw new \InvalidArgumentException('non-nullable data_sensitivity cannot be null'); + } + $allowedValues = $this->getDataSensitivityAllowableValues(); + if (!in_array($data_sensitivity, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'data_sensitivity', must be one of '%s'", + $data_sensitivity, + implode("', '", $allowedValues) + ) + ); + } + $this->container['data_sensitivity'] = $data_sensitivity; + + return $this; + } + + /** + * Gets source_vid + * + * @return int[] + */ + public function getSourceVid() + { + return $this->container['source_vid']; + } + + /** + * Sets source_vid + * + * @param int[] $source_vid source_vid + * + * @return self + */ + public function setSourceVid($source_vid) + { + if (is_null($source_vid)) { + throw new \InvalidArgumentException('non-nullable source_vid cannot be null'); + } + $this->container['source_vid'] = $source_vid; + + return $this; + } + + /** + * Gets unit + * + * @return string + */ + public function getUnit() + { + return $this->container['unit']; + } + + /** + * Sets unit + * + * @param string $unit unit + * + * @return self + */ + public function setUnit($unit) + { + if (is_null($unit)) { + throw new \InvalidArgumentException('non-nullable unit cannot be null'); + } + $this->container['unit'] = $unit; + + return $this; + } + + /** + * Gets request_id + * + * @return string + */ + public function getRequestId() + { + return $this->container['request_id']; + } + + /** + * Sets request_id + * + * @param string $request_id request_id + * + * @return self + */ + public function setRequestId($request_id) + { + if (is_null($request_id)) { + throw new \InvalidArgumentException('non-nullable request_id cannot be null'); + } + $this->container['request_id'] = $request_id; + + return $this; + } + + /** + * Gets is_encrypted + * + * @return bool + */ + public function getIsEncrypted() + { + return $this->container['is_encrypted']; + } + + /** + * Sets is_encrypted + * + * @param bool $is_encrypted is_encrypted + * + * @return self + */ + public function setIsEncrypted($is_encrypted) + { + if (is_null($is_encrypted)) { + throw new \InvalidArgumentException('non-nullable is_encrypted cannot be null'); + } + $this->container['is_encrypted'] = $is_encrypted; + + return $this; + } + + /** + * Gets name + * + * @return string + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets use_timestamp_as_persistence_timestamp + * + * @return bool + */ + public function getUseTimestampAsPersistenceTimestamp() + { + return $this->container['use_timestamp_as_persistence_timestamp']; + } + + /** + * Sets use_timestamp_as_persistence_timestamp + * + * @param bool $use_timestamp_as_persistence_timestamp use_timestamp_as_persistence_timestamp + * + * @return self + */ + public function setUseTimestampAsPersistenceTimestamp($use_timestamp_as_persistence_timestamp) + { + if (is_null($use_timestamp_as_persistence_timestamp)) { + throw new \InvalidArgumentException('non-nullable use_timestamp_as_persistence_timestamp cannot be null'); + } + $this->container['use_timestamp_as_persistence_timestamp'] = $use_timestamp_as_persistence_timestamp; + + return $this; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value value + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets selected_by_user_timestamp + * + * @return int + */ + public function getSelectedByUserTimestamp() + { + return $this->container['selected_by_user_timestamp']; + } + + /** + * Sets selected_by_user_timestamp + * + * @param int $selected_by_user_timestamp selected_by_user_timestamp + * + * @return self + */ + public function setSelectedByUserTimestamp($selected_by_user_timestamp) + { + if (is_null($selected_by_user_timestamp)) { + throw new \InvalidArgumentException('non-nullable selected_by_user_timestamp cannot be null'); + } + $this->container['selected_by_user_timestamp'] = $selected_by_user_timestamp; + + return $this; + } + + /** + * Gets timestamp + * + * @return int + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param int $timestamp timestamp + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets is_large_value + * + * @return bool + */ + public function getIsLargeValue() + { + return $this->container['is_large_value']; + } + + /** + * Sets is_large_value + * + * @param bool $is_large_value is_large_value + * + * @return self + */ + public function setIsLargeValue($is_large_value) + { + if (is_null($is_large_value)) { + throw new \InvalidArgumentException('non-nullable is_large_value cannot be null'); + } + $this->container['is_large_value'] = $is_large_value; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/codegen/Crm/Imports/Model/PublicImportError.php b/codegen/Crm/Imports/Model/PublicImportError.php index a5eb8869c..204bda9e8 100644 --- a/codegen/Crm/Imports/Model/PublicImportError.php +++ b/codegen/Crm/Imports/Model/PublicImportError.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -61,7 +61,10 @@ class PublicImportError implements ModelInterface, ArrayAccess, \JsonSerializabl 'extra_context' => 'string', 'object_type_id' => 'string', 'error_type' => 'string', + 'invalid_property_value' => '\HubSpot\Client\Crm\Imports\Model\PropertyValue', + 'error_message' => 'string', 'known_column_number' => 'int', + 'invalid_value_to_display' => 'string', 'id' => 'string', 'source_data' => '\HubSpot\Client\Crm\Imports\Model\ImportRowCore', 'object_type' => 'string', @@ -80,7 +83,10 @@ class PublicImportError implements ModelInterface, ArrayAccess, \JsonSerializabl 'extra_context' => null, 'object_type_id' => null, 'error_type' => null, + 'invalid_property_value' => null, + 'error_message' => null, 'known_column_number' => 'int32', + 'invalid_value_to_display' => null, 'id' => null, 'source_data' => null, 'object_type' => null, @@ -97,7 +103,10 @@ class PublicImportError implements ModelInterface, ArrayAccess, \JsonSerializabl 'extra_context' => false, 'object_type_id' => false, 'error_type' => false, + 'invalid_property_value' => false, + 'error_message' => false, 'known_column_number' => false, + 'invalid_value_to_display' => false, 'id' => false, 'source_data' => false, 'object_type' => false, @@ -194,7 +203,10 @@ public function isNullableSetToNull(string $property): bool 'extra_context' => 'extraContext', 'object_type_id' => 'objectTypeId', 'error_type' => 'errorType', + 'invalid_property_value' => 'invalidPropertyValue', + 'error_message' => 'errorMessage', 'known_column_number' => 'knownColumnNumber', + 'invalid_value_to_display' => 'invalidValueToDisplay', 'id' => 'id', 'source_data' => 'sourceData', 'object_type' => 'objectType', @@ -211,7 +223,10 @@ public function isNullableSetToNull(string $property): bool 'extra_context' => 'setExtraContext', 'object_type_id' => 'setObjectTypeId', 'error_type' => 'setErrorType', + 'invalid_property_value' => 'setInvalidPropertyValue', + 'error_message' => 'setErrorMessage', 'known_column_number' => 'setKnownColumnNumber', + 'invalid_value_to_display' => 'setInvalidValueToDisplay', 'id' => 'setId', 'source_data' => 'setSourceData', 'object_type' => 'setObjectType', @@ -228,7 +243,10 @@ public function isNullableSetToNull(string $property): bool 'extra_context' => 'getExtraContext', 'object_type_id' => 'getObjectTypeId', 'error_type' => 'getErrorType', + 'invalid_property_value' => 'getInvalidPropertyValue', + 'error_message' => 'getErrorMessage', 'known_column_number' => 'getKnownColumnNumber', + 'invalid_value_to_display' => 'getInvalidValueToDisplay', 'id' => 'getId', 'source_data' => 'getSourceData', 'object_type' => 'getObjectType', @@ -296,6 +314,7 @@ public function getModelName() public const ERROR_TYPE_AMBIGUOUS_ENUMERATION_OPTION = 'AMBIGUOUS_ENUMERATION_OPTION'; public const ERROR_TYPE_FAILED_VALIDATION = 'FAILED_VALIDATION'; public const ERROR_TYPE_FAILED_TO_CREATE_ASSOCIATION = 'FAILED_TO_CREATE_ASSOCIATION'; + public const ERROR_TYPE_ASSOCIATION_LIMIT_EXCEEDED = 'ASSOCIATION_LIMIT_EXCEEDED'; public const ERROR_TYPE_FILE_NOT_FOUND = 'FILE_NOT_FOUND'; public const ERROR_TYPE_INVALID_COLUMN_CONFIGURATION = 'INVALID_COLUMN_CONFIGURATION'; public const ERROR_TYPE_INVALID_FILE_TYPE = 'INVALID_FILE_TYPE'; @@ -309,6 +328,7 @@ public function getModelName() public const ERROR_TYPE_PORTAL_WIDE_CUSTOM_OBJECT_LIMIT_EXCEEDED = 'PORTAL_WIDE_CUSTOM_OBJECT_LIMIT_EXCEEDED'; public const ERROR_TYPE_INVALID_ALTERNATE_ID = 'INVALID_ALTERNATE_ID'; public const ERROR_TYPE_INVALID_EMAIL = 'INVALID_EMAIL'; + public const ERROR_TYPE_SECONDARY_EMAIL_WRITE_FAILURE = 'SECONDARY_EMAIL_WRITE_FAILURE'; public const ERROR_TYPE_INVALID_DOMAIN = 'INVALID_DOMAIN'; public const ERROR_TYPE_DUPLICATE_ROW_CONTENT = 'DUPLICATE_ROW_CONTENT'; public const ERROR_TYPE_INVALID_NUMBER_SIZE = 'INVALID_NUMBER_SIZE'; @@ -319,7 +339,6 @@ public function getModelName() public const ERROR_TYPE_DUPLICATE_ALTERNATE_ID = 'DUPLICATE_ALTERNATE_ID'; public const ERROR_TYPE_DUPLICATE_OBJECT_ID = 'DUPLICATE_OBJECT_ID'; public const ERROR_TYPE_DUPLICATE_UNIQUE_PROPERTY_VALUE = 'DUPLICATE_UNIQUE_PROPERTY_VALUE'; - public const ERROR_TYPE_BLANK_VALUE_PROVIDED = 'BLANK_VALUE_PROVIDED'; public const ERROR_TYPE_UNKNOWN_ASSOCIATION_RECORD_ID = 'UNKNOWN_ASSOCIATION_RECORD_ID'; public const ERROR_TYPE_INVALID_RECORD_ID = 'INVALID_RECORD_ID'; public const ERROR_TYPE_DUPLICATE_RECORD_ID = 'DUPLICATE_RECORD_ID'; @@ -328,10 +347,16 @@ public function getModelName() public const ERROR_TYPE_UPDATE_ONLY_IMPORT = 'UPDATE_ONLY_IMPORT'; public const ERROR_TYPE_COLUMN_TOO_LARGE = 'COLUMN_TOO_LARGE'; public const ERROR_TYPE_ROW_DATA_TOO_LARGE = 'ROW_DATA_TOO_LARGE'; + public const ERROR_TYPE_MISSING_EVENT_TIMESTAMP = 'MISSING_EVENT_TIMESTAMP'; public const ERROR_TYPE_INVALID_EVENT_TIMESTAMP = 'INVALID_EVENT_TIMESTAMP'; public const ERROR_TYPE_INVALID_EVENT = 'INVALID_EVENT'; public const ERROR_TYPE_DUPLICATE_EVENT = 'DUPLICATE_EVENT'; public const ERROR_TYPE_MISSING_EVENT_DEFINITION = 'MISSING_EVENT_DEFINITION'; + public const ERROR_TYPE_INVALID_ASSOCIATION_KEY = 'INVALID_ASSOCIATION_KEY'; + public const ERROR_TYPE_ASSOCIATION_RECORD_NOT_FOUND = 'ASSOCIATION_RECORD_NOT_FOUND'; + public const ERROR_TYPE_MISSING_OBJECT_DEFINITION = 'MISSING_OBJECT_DEFINITION'; + public const ERROR_TYPE_ASSOCIATION_LABEL_NOT_FOUND = 'ASSOCIATION_LABEL_NOT_FOUND'; + public const ERROR_TYPE_MANY_ERRORS_IN_ROW = 'MANY_ERRORS_IN_ROW'; public const OBJECT_TYPE_CONTACT = 'CONTACT'; public const OBJECT_TYPE_COMPANY = 'COMPANY'; public const OBJECT_TYPE_DEAL = 'DEAL'; @@ -477,6 +502,21 @@ public function getModelName() public const OBJECT_TYPE_ALL_PAGES = 'ALL_PAGES'; public const OBJECT_TYPE_AI_FORECAST = 'AI_FORECAST'; public const OBJECT_TYPE_CRM_PIPELINES_DUMMY_TYPE = 'CRM_PIPELINES_DUMMY_TYPE'; + public const OBJECT_TYPE_KNOWLEDGE_ARTICLE = 'KNOWLEDGE_ARTICLE'; + public const OBJECT_TYPE_PROPERTY_INFO = 'PROPERTY_INFO'; + public const OBJECT_TYPE_DATA_PRIVACY_CONSENT = 'DATA_PRIVACY_CONSENT'; + public const OBJECT_TYPE_GOAL_TEMPLATE = 'GOAL_TEMPLATE'; + public const OBJECT_TYPE_SCORE_CONFIGURATION = 'SCORE_CONFIGURATION'; + public const OBJECT_TYPE_AUDIENCE = 'AUDIENCE'; + public const OBJECT_TYPE_PARTNER_CLIENT_REVENUE = 'PARTNER_CLIENT_REVENUE'; + public const OBJECT_TYPE_AUTOMATION_JOURNEY = 'AUTOMATION_JOURNEY'; + public const OBJECT_TYPE_COMBO_EVENT_CONFIGURATION = 'COMBO_EVENT_CONFIGURATION'; + public const OBJECT_TYPE_CRM_OBJECTS_DUMMY_TYPE = 'CRM_OBJECTS_DUMMY_TYPE'; + public const OBJECT_TYPE_CASE_STUDY = 'CASE_STUDY'; + public const OBJECT_TYPE_SERVICE = 'SERVICE'; + public const OBJECT_TYPE_PODCAST_EPISODE = 'PODCAST_EPISODE'; + public const OBJECT_TYPE_PARTNER_SERVICE = 'PARTNER_SERVICE'; + public const OBJECT_TYPE_PROSPECTING_AGENT_CONTACT_ASSIGNMENT = 'PROSPECTING_AGENT_CONTACT_ASSIGNMENT'; public const OBJECT_TYPE_UNKNOWN = 'UNKNOWN'; /** @@ -507,6 +547,7 @@ public function getErrorTypeAllowableValues() self::ERROR_TYPE_AMBIGUOUS_ENUMERATION_OPTION, self::ERROR_TYPE_FAILED_VALIDATION, self::ERROR_TYPE_FAILED_TO_CREATE_ASSOCIATION, + self::ERROR_TYPE_ASSOCIATION_LIMIT_EXCEEDED, self::ERROR_TYPE_FILE_NOT_FOUND, self::ERROR_TYPE_INVALID_COLUMN_CONFIGURATION, self::ERROR_TYPE_INVALID_FILE_TYPE, @@ -520,6 +561,7 @@ public function getErrorTypeAllowableValues() self::ERROR_TYPE_PORTAL_WIDE_CUSTOM_OBJECT_LIMIT_EXCEEDED, self::ERROR_TYPE_INVALID_ALTERNATE_ID, self::ERROR_TYPE_INVALID_EMAIL, + self::ERROR_TYPE_SECONDARY_EMAIL_WRITE_FAILURE, self::ERROR_TYPE_INVALID_DOMAIN, self::ERROR_TYPE_DUPLICATE_ROW_CONTENT, self::ERROR_TYPE_INVALID_NUMBER_SIZE, @@ -530,7 +572,6 @@ public function getErrorTypeAllowableValues() self::ERROR_TYPE_DUPLICATE_ALTERNATE_ID, self::ERROR_TYPE_DUPLICATE_OBJECT_ID, self::ERROR_TYPE_DUPLICATE_UNIQUE_PROPERTY_VALUE, - self::ERROR_TYPE_BLANK_VALUE_PROVIDED, self::ERROR_TYPE_UNKNOWN_ASSOCIATION_RECORD_ID, self::ERROR_TYPE_INVALID_RECORD_ID, self::ERROR_TYPE_DUPLICATE_RECORD_ID, @@ -539,10 +580,16 @@ public function getErrorTypeAllowableValues() self::ERROR_TYPE_UPDATE_ONLY_IMPORT, self::ERROR_TYPE_COLUMN_TOO_LARGE, self::ERROR_TYPE_ROW_DATA_TOO_LARGE, + self::ERROR_TYPE_MISSING_EVENT_TIMESTAMP, self::ERROR_TYPE_INVALID_EVENT_TIMESTAMP, self::ERROR_TYPE_INVALID_EVENT, self::ERROR_TYPE_DUPLICATE_EVENT, self::ERROR_TYPE_MISSING_EVENT_DEFINITION, + self::ERROR_TYPE_INVALID_ASSOCIATION_KEY, + self::ERROR_TYPE_ASSOCIATION_RECORD_NOT_FOUND, + self::ERROR_TYPE_MISSING_OBJECT_DEFINITION, + self::ERROR_TYPE_ASSOCIATION_LABEL_NOT_FOUND, + self::ERROR_TYPE_MANY_ERRORS_IN_ROW, ]; } @@ -699,6 +746,21 @@ public function getObjectTypeAllowableValues() self::OBJECT_TYPE_ALL_PAGES, self::OBJECT_TYPE_AI_FORECAST, self::OBJECT_TYPE_CRM_PIPELINES_DUMMY_TYPE, + self::OBJECT_TYPE_KNOWLEDGE_ARTICLE, + self::OBJECT_TYPE_PROPERTY_INFO, + self::OBJECT_TYPE_DATA_PRIVACY_CONSENT, + self::OBJECT_TYPE_GOAL_TEMPLATE, + self::OBJECT_TYPE_SCORE_CONFIGURATION, + self::OBJECT_TYPE_AUDIENCE, + self::OBJECT_TYPE_PARTNER_CLIENT_REVENUE, + self::OBJECT_TYPE_AUTOMATION_JOURNEY, + self::OBJECT_TYPE_COMBO_EVENT_CONFIGURATION, + self::OBJECT_TYPE_CRM_OBJECTS_DUMMY_TYPE, + self::OBJECT_TYPE_CASE_STUDY, + self::OBJECT_TYPE_SERVICE, + self::OBJECT_TYPE_PODCAST_EPISODE, + self::OBJECT_TYPE_PARTNER_SERVICE, + self::OBJECT_TYPE_PROSPECTING_AGENT_CONTACT_ASSIGNMENT, self::OBJECT_TYPE_UNKNOWN, ]; } @@ -713,16 +775,19 @@ public function getObjectTypeAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('extra_context', $data ?? [], null); $this->setIfExists('object_type_id', $data ?? [], null); $this->setIfExists('error_type', $data ?? [], null); + $this->setIfExists('invalid_property_value', $data ?? [], null); + $this->setIfExists('error_message', $data ?? [], null); $this->setIfExists('known_column_number', $data ?? [], null); + $this->setIfExists('invalid_value_to_display', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('source_data', $data ?? [], null); $this->setIfExists('object_type', $data ?? [], null); @@ -919,6 +984,60 @@ public function setErrorType($error_type) return $this; } + /** + * Gets invalid_property_value + * + * @return \HubSpot\Client\Crm\Imports\Model\PropertyValue|null + */ + public function getInvalidPropertyValue() + { + return $this->container['invalid_property_value']; + } + + /** + * Sets invalid_property_value + * + * @param \HubSpot\Client\Crm\Imports\Model\PropertyValue|null $invalid_property_value invalid_property_value + * + * @return self + */ + public function setInvalidPropertyValue($invalid_property_value) + { + if (is_null($invalid_property_value)) { + throw new \InvalidArgumentException('non-nullable invalid_property_value cannot be null'); + } + $this->container['invalid_property_value'] = $invalid_property_value; + + return $this; + } + + /** + * Gets error_message + * + * @return string|null + */ + public function getErrorMessage() + { + return $this->container['error_message']; + } + + /** + * Sets error_message + * + * @param string|null $error_message error_message + * + * @return self + */ + public function setErrorMessage($error_message) + { + if (is_null($error_message)) { + throw new \InvalidArgumentException('non-nullable error_message cannot be null'); + } + $this->container['error_message'] = $error_message; + + return $this; + } + /** * Gets known_column_number * @@ -946,6 +1065,33 @@ public function setKnownColumnNumber($known_column_number) return $this; } + /** + * Gets invalid_value_to_display + * + * @return string|null + */ + public function getInvalidValueToDisplay() + { + return $this->container['invalid_value_to_display']; + } + + /** + * Sets invalid_value_to_display + * + * @param string|null $invalid_value_to_display invalid_value_to_display + * + * @return self + */ + public function setInvalidValueToDisplay($invalid_value_to_display) + { + if (is_null($invalid_value_to_display)) { + throw new \InvalidArgumentException('non-nullable invalid_value_to_display cannot be null'); + } + $this->container['invalid_value_to_display'] = $invalid_value_to_display; + + return $this; + } + /** * Gets id * diff --git a/codegen/Crm/Imports/Model/PublicImportMetadata.php b/codegen/Crm/Imports/Model/PublicImportMetadata.php index 0b7fd1a20..fcf59413d 100644 --- a/codegen/Crm/Imports/Model/PublicImportMetadata.php +++ b/codegen/Crm/Imports/Model/PublicImportMetadata.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -35,7 +35,6 @@ * PublicImportMetadata Class Doc Comment * * @category Class - * @description An object detailing a summary of the import record outputs * @package HubSpot\Client\Crm\Imports * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -252,10 +251,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('counters', $data ?? [], null); $this->setIfExists('file_ids', $data ?? [], null); diff --git a/codegen/Crm/Imports/Model/PublicImportResponse.php b/codegen/Crm/Imports/Model/PublicImportResponse.php index 88f04f75f..50b6bfec2 100644 --- a/codegen/Crm/Imports/Model/PublicImportResponse.php +++ b/codegen/Crm/Imports/Model/PublicImportResponse.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -35,7 +35,6 @@ * PublicImportResponse Class Doc Comment * * @category Class - * @description A current summary of the import, whether complete or not. * @package HubSpot\Client\Crm\Imports * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -67,6 +66,7 @@ class PublicImportResponse implements ModelInterface, ArrayAccess, \JsonSerializ 'state' => 'string', 'id' => 'string', 'opt_out_import' => 'bool', + 'mapped_object_type_ids' => 'string[]', 'updated_at' => '\DateTime' ]; @@ -87,6 +87,7 @@ class PublicImportResponse implements ModelInterface, ArrayAccess, \JsonSerializ 'state' => null, 'id' => null, 'opt_out_import' => null, + 'mapped_object_type_ids' => null, 'updated_at' => 'date-time' ]; @@ -105,6 +106,7 @@ class PublicImportResponse implements ModelInterface, ArrayAccess, \JsonSerializ 'state' => false, 'id' => false, 'opt_out_import' => false, + 'mapped_object_type_ids' => false, 'updated_at' => false ]; @@ -203,6 +205,7 @@ public function isNullableSetToNull(string $property): bool 'state' => 'state', 'id' => 'id', 'opt_out_import' => 'optOutImport', + 'mapped_object_type_ids' => 'mappedObjectTypeIds', 'updated_at' => 'updatedAt' ]; @@ -221,6 +224,7 @@ public function isNullableSetToNull(string $property): bool 'state' => 'setState', 'id' => 'setId', 'opt_out_import' => 'setOptOutImport', + 'mapped_object_type_ids' => 'setMappedObjectTypeIds', 'updated_at' => 'setUpdatedAt' ]; @@ -239,6 +243,7 @@ public function isNullableSetToNull(string $property): bool 'state' => 'getState', 'id' => 'getId', 'opt_out_import' => 'getOptOutImport', + 'mapped_object_type_ids' => 'getMappedObjectTypeIds', 'updated_at' => 'getUpdatedAt' ]; @@ -342,10 +347,10 @@ public function getStateAllowableValues() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('import_template', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); @@ -356,6 +361,7 @@ public function __construct(array $data = null) $this->setIfExists('state', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('opt_out_import', $data ?? [], null); + $this->setIfExists('mapped_object_type_ids', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); } @@ -419,6 +425,9 @@ public function listInvalidProperties() if ($this->container['opt_out_import'] === null) { $invalidProperties[] = "'opt_out_import' can't be null"; } + if ($this->container['mapped_object_type_ids'] === null) { + $invalidProperties[] = "'mapped_object_type_ids' can't be null"; + } if ($this->container['updated_at'] === null) { $invalidProperties[] = "'updated_at' can't be null"; } @@ -700,6 +709,33 @@ public function setOptOutImport($opt_out_import) return $this; } + /** + * Gets mapped_object_type_ids + * + * @return string[] + */ + public function getMappedObjectTypeIds() + { + return $this->container['mapped_object_type_ids']; + } + + /** + * Sets mapped_object_type_ids + * + * @param string[] $mapped_object_type_ids mapped_object_type_ids + * + * @return self + */ + public function setMappedObjectTypeIds($mapped_object_type_ids) + { + if (is_null($mapped_object_type_ids)) { + throw new \InvalidArgumentException('non-nullable mapped_object_type_ids cannot be null'); + } + $this->container['mapped_object_type_ids'] = $mapped_object_type_ids; + + return $this; + } + /** * Gets updated_at * diff --git a/codegen/Crm/Imports/Model/PublicObjectListRecord.php b/codegen/Crm/Imports/Model/PublicObjectListRecord.php index b59402468..7d3069d92 100644 --- a/codegen/Crm/Imports/Model/PublicObjectListRecord.php +++ b/codegen/Crm/Imports/Model/PublicObjectListRecord.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -35,7 +35,6 @@ * PublicObjectListRecord Class Doc Comment * * @category Class - * @description A summary detailing which list contains the imported objects. * @package HubSpot\Client\Crm\Imports * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -246,10 +245,10 @@ public function getModelName() /** * Constructor * - * @param mixed[] $data Associated array of property values + * @param mixed[]|null $data Associated array of property values * initializing the model */ - public function __construct(array $data = null) + public function __construct(?array $data = null) { $this->setIfExists('list_id', $data ?? [], null); $this->setIfExists('object_type', $data ?? [], null); diff --git a/codegen/Crm/Imports/ObjectSerializer.php b/codegen/Crm/Imports/ObjectSerializer.php index 83b8ec77f..2b3390d4f 100644 --- a/codegen/Crm/Imports/ObjectSerializer.php +++ b/codegen/Crm/Imports/ObjectSerializer.php @@ -17,7 +17,7 @@ * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * OpenAPI Generator version: 7.3.0 + * Generator version: 7.12.0 */ /** @@ -58,8 +58,8 @@ public static function setDateTimeFormat($format) * Serialize data * * @param mixed $data the data to serialize - * @param string $type the OpenAPIToolsType of the data - * @param string $format the format of the OpenAPITools type of the data + * @param string|null $type the OpenAPIToolsType of the data + * @param string|null $format the format of the OpenAPITools type of the data * * @return scalar|object|array|null serialized form of $data */ @@ -194,6 +194,10 @@ private static function isEmptyValue($value, string $openApiType): bool case 'boolean': return !in_array($value, [false, 0], true); + # For string values, '' is considered empty. + case 'string': + return $value === ''; + # For all the other types, any value at this point can be considered empty. default: return true; @@ -265,6 +269,11 @@ public static function toQueryValue( $value = $flattenArray($value, $paramName); + // https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values + if ($openApiType === 'array' && $style === 'deepObject' && $explode) { + return $value; + } + if ($openApiType === 'object' && ($style === 'deepObject' || $explode)) { return $value; } @@ -338,7 +347,7 @@ public static function toFormValue($value) * If it's a datetime object, format it in ISO8601 * If it's a boolean, convert it to "true" or "false". * - * @param string|bool|\DateTime $value the value of the parameter + * @param float|int|bool|\DateTime $value the value of the parameter * * @return string the header string */ @@ -395,8 +404,7 @@ public static function serializeCollection(array $collection, $style, $allowColl * * @param mixed $data object or primitive to be deserialized * @param string $class class name is passed as a string - * @param string[] $httpHeaders HTTP headers - * @param string $discriminator discriminator if polymorphism is used + * @param string[]|null $httpHeaders HTTP headers * * @return object|array|null a single or an array of $class instances */ @@ -473,7 +481,7 @@ public static function deserialize($data, $class, $httpHeaders = null) // determine file name if ( is_array($httpHeaders) - && array_key_exists('Content-Disposition', $httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) ) { $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); @@ -546,22 +554,64 @@ public static function deserialize($data, $class, $httpHeaders = null) } /** - * Native `http_build_query` wrapper. - * @see https://www.php.net/manual/en/function.http-build-query - * - * @param array|object $data May be an array or object containing properties. - * @param string $numeric_prefix If numeric indices are used in the base array and this parameter is provided, it will be prepended to the numeric index for elements in the base array only. - * @param string|null $arg_separator arg_separator.output is used to separate arguments but may be overridden by specifying this parameter. - * @param int $encoding_type Encoding type. By default, PHP_QUERY_RFC1738. - * - * @return string - */ - public static function buildQuery( - $data, - string $numeric_prefix = '', - ?string $arg_separator = null, - int $encoding_type = \PHP_QUERY_RFC3986 - ): string { - return \GuzzleHttp\Psr7\Query::build($data, $encoding_type); + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * The function is copied from https://github.com/guzzle/psr7/blob/a243f80a1ca7fe8ceed4deee17f12c1930efe662/src/Query.php#L59-L112 + * with a modification which is described in https://github.com/guzzle/psr7/pull/603 + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + */ + public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): string + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function (string $str): string { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $castBool = Configuration::BOOLEAN_FORMAT_INT == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString() + ? function ($v) { return (int) $v; } + : function ($v) { return $v ? 'true' : 'false'; }; + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder((string) $k); + if (!is_array($v)) { + $qs .= $k; + $v = is_bool($v) ? $castBool($v) : $v; + if ($v !== null) { + $qs .= '='.$encoder((string) $v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + $vv = is_bool($vv) ? $castBool($vv) : $vv; + if ($vv !== null) { + $qs .= '='.$encoder((string) $vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; } }