diff --git a/codegen/Crm/Exports/Api/PublicExportsApi.php b/codegen/Crm/Exports/Api/PublicExportsApi.php index 9a5e751d..dc3239f2 100644 --- a/codegen/Crm/Exports/Api/PublicExportsApi.php +++ b/codegen/Crm/Exports/Api/PublicExportsApi.php @@ -1,7 +1,7 @@ [ + 'application/json', + ], 'getStatus' => [ 'application/json', ], @@ -125,12 +131,298 @@ public function getConfig() return $this->config; } + /** + * Operation getById + * + * Retrieve details of a specific export by its unique ID. + * + * @param int $export_id The unique ID of the export to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation + * + * @throws \HubSpot\Client\Crm\Exports\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \HubSpot\Client\Crm\Exports\Model\PublicExportResponse|\HubSpot\Client\Crm\Exports\Model\Error + */ + public function getById($export_id, string $contentType = self::contentTypes['getById'][0]) + { + list($response) = $this->getByIdWithHttpInfo($export_id, $contentType); + return $response; + } + + /** + * Operation getByIdWithHttpInfo + * + * Retrieve details of a specific export by its unique ID. + * + * @param int $export_id The unique ID of the export to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation + * + * @throws \HubSpot\Client\Crm\Exports\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \HubSpot\Client\Crm\Exports\Model\PublicExportResponse|\HubSpot\Client\Crm\Exports\Model\Error, HTTP status code, HTTP response headers (array of strings) + */ + public function getByIdWithHttpInfo($export_id, string $contentType = self::contentTypes['getById'][0]) + { + $request = $this->getByIdRequest($export_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Exports\Model\PublicExportResponse', + $request, + $response, + ); + default: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Exports\Model\Error', + $request, + $response, + ); + } + + + + 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() + ); + } + + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Exports\Model\PublicExportResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\HubSpot\Client\Crm\Exports\Model\PublicExportResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\HubSpot\Client\Crm\Exports\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getByIdAsync + * + * Retrieve details of a specific export by its unique ID. + * + * @param int $export_id The unique ID of the export to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getByIdAsync($export_id, string $contentType = self::contentTypes['getById'][0]) + { + return $this->getByIdAsyncWithHttpInfo($export_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getByIdAsyncWithHttpInfo + * + * Retrieve details of a specific export by its unique ID. + * + * @param int $export_id The unique ID of the export to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getByIdAsyncWithHttpInfo($export_id, string $contentType = self::contentTypes['getById'][0]) + { + $returnType = '\HubSpot\Client\Crm\Exports\Model\PublicExportResponse'; + $request = $this->getByIdRequest($export_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'getById' + * + * @param int $export_id The unique ID of the export to retrieve. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getById'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getByIdRequest($export_id, string $contentType = self::contentTypes['getById'][0]) + { + + // verify the required parameter 'export_id' is set + if ($export_id === null || (is_array($export_id) && count($export_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $export_id when calling getById' + ); + } + + + $resourcePath = '/crm/v3/exports/export/{exportId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($export_id !== null) { + $resourcePath = str_replace( + '{' . 'exportId' . '}', + ObjectSerializer::toPathValue($export_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['application/json', '*/*', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires OAuth (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation getStatus * * Get the status of the export including the URL to download the file * - * @param int $task_id task_id (required) + * @param int $task_id The unique ID of the export. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStatus'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Exports\ApiException on non-2xx response or if the response body is not in the expected format @@ -148,7 +440,7 @@ public function getStatus($task_id, string $contentType = self::contentTypes['ge * * Get the status of the export including the URL to download the file * - * @param int $task_id (required) + * @param int $task_id The unique ID of the export. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStatus'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Exports\ApiException on non-2xx response or if the response body is not in the expected format @@ -184,61 +476,21 @@ public function getStatusWithHttpInfo($task_id, string $contentType = self::cont switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Exports\Model\ActionResponseWithSingleResultURI' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Exports\Model\ActionResponseWithSingleResultURI' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Exports\Model\ActionResponseWithSingleResultURI', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Exports\Model\ActionResponseWithSingleResultURI', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Exports\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Exports\Model\Error' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Exports\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Exports\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -252,34 +504,11 @@ public function getStatusWithHttpInfo($task_id, string $contentType = self::cont ); } - $returnType = '\HubSpot\Client\Crm\Exports\Model\ActionResponseWithSingleResultURI'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Exports\Model\ActionResponseWithSingleResultURI', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -289,7 +518,7 @@ public function getStatusWithHttpInfo($task_id, string $contentType = self::cont $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -297,8 +526,10 @@ public function getStatusWithHttpInfo($task_id, string $contentType = self::cont $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -308,7 +539,7 @@ public function getStatusWithHttpInfo($task_id, string $contentType = self::cont * * Get the status of the export including the URL to download the file * - * @param int $task_id (required) + * @param int $task_id The unique ID of the export. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -329,7 +560,7 @@ function ($response) { * * Get the status of the export including the URL to download the file * - * @param int $task_id (required) + * @param int $task_id The unique ID of the export. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -379,7 +610,7 @@ function ($exception) { /** * Create request for operation 'getStatus' * - * @param int $task_id (required) + * @param int $task_id The unique ID of the export. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getStatus'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -531,61 +762,21 @@ public function startWithHttpInfo($public_export_request, string $contentType = switch($statusCode) { case 202: - if ('\HubSpot\Client\Crm\Exports\Model\TaskLocator' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Exports\Model\TaskLocator' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Exports\Model\TaskLocator', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Exports\Model\TaskLocator', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Exports\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Exports\Model\Error' !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, '\HubSpot\Client\Crm\Exports\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Exports\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -599,34 +790,11 @@ public function startWithHttpInfo($public_export_request, string $contentType = ); } - $returnType = '\HubSpot\Client\Crm\Exports\Model\TaskLocator'; - if ($returnType === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ($returnType !== 'string') { - try { - $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); - } catch (\JsonException $exception) { - throw new ApiException( - sprintf( - 'Error JSON decoding server response (%s)', - $request->getUri() - ), - $statusCode, - $response->getHeaders(), - $content - ); - } - } - } - - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; - + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Exports\Model\TaskLocator', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 202: @@ -636,7 +804,7 @@ public function startWithHttpInfo($public_export_request, string $contentType = $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -644,8 +812,10 @@ public function startWithHttpInfo($public_export_request, string $contentType = $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -834,6 +1004,57 @@ protected function createHttpClientOption() } } + if ($this->config->getCertFile()) { + $options[RequestOptions::CERT] = $this->config->getCertFile(); + } + + if ($this->config->getKeyFile()) { + $options[RequestOptions::SSL_KEY] = $this->config->getKeyFile(); + } + return $options; } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } } diff --git a/codegen/Crm/Exports/ApiException.php b/codegen/Crm/Exports/ApiException.php index 77c559aa..bdd4b748 100644 --- a/codegen/Crm/Exports/ApiException.php +++ b/codegen/Crm/Exports/ApiException.php @@ -1,7 +1,7 @@ tempFolderPath; } + /** + * Sets the certificate file path, for mTLS + * + * @return $this + */ + public function setCertFile($certFile) + { + $this->certFile = $certFile; + return $this; + } + + /** + * Gets the certificate file path, for mTLS + * + * @return string Certificate file path + */ + public function getCertFile() + { + return $this->certFile; + } + + /** + * Sets the certificate key path, for mTLS + * + * @return $this + */ + public function setKeyFile($keyFile) + { + $this->keyFile = $keyFile; + return $this; + } + + /** + * Gets the certificate key path, for mTLS + * + * @return string Certificate key path + */ + public function getKeyFile() + { + return $this->keyFile; + } + + /** * Gets the default configuration instance * diff --git a/codegen/Crm/Exports/FormDataProcessor.php b/codegen/Crm/Exports/FormDataProcessor.php new file mode 100644 index 00000000..620beb54 --- /dev/null +++ b/codegen/Crm/Exports/FormDataProcessor.php @@ -0,0 +1,246 @@ + $values the value of the form parameter + * + * @return array [key => value] of formdata + */ + public function prepare(array $values): array + { + $this->has_file = false; + $result = []; + + foreach ($values as $k => $v) { + if ($v === null) { + continue; + } + + $result[$k] = $this->makeFormSafe($v); + } + + return $result; + } + + /** + * Flattens a multi-level array of data and generates a single-level array + * compatible with formdata - a single-level array where the keys use bracket + * notation to signify nested data. + * + * credit: https://github.com/FranBar1966/FlatPHP + */ + public static function flatten(array $source, string $start = ''): array + { + $opt = [ + 'prefix' => '[', + 'suffix' => ']', + 'suffix-end' => true, + 'prefix-list' => '[', + 'suffix-list' => ']', + 'suffix-list-end' => true, + ]; + + if ($start === '') { + $currentPrefix = ''; + $currentSuffix = ''; + $currentSuffixEnd = false; + } elseif (array_is_list($source)) { + $currentPrefix = $opt['prefix-list']; + $currentSuffix = $opt['suffix-list']; + $currentSuffixEnd = $opt['suffix-list-end']; + } else { + $currentPrefix = $opt['prefix']; + $currentSuffix = $opt['suffix']; + $currentSuffixEnd = $opt['suffix-end']; + } + + $currentName = $start; + $result = []; + + foreach ($source as $key => $val) { + $currentName .= $currentPrefix.$key; + + if (is_array($val) && !empty($val)) { + $currentName .= $currentSuffix; + $result += self::flatten($val, $currentName); + } else { + if ($currentSuffixEnd) { + $currentName .= $currentSuffix; + } + + if (is_resource($val)) { + $result[$currentName] = $val; + } else { + $result[$currentName] = ObjectSerializer::toString($val); + } + } + + $currentName = $start; + } + + return $result; + } + + /** + * formdata must be limited to scalars or arrays of scalar values, + * or a resource for a file upload. Here we iterate through all available + * data and identify how to handle each scenario + */ + protected function makeFormSafe($value) + { + if ($value instanceof SplFileObject) { + return $this->processFiles([$value])[0]; + } + + if (is_resource($value)) { + $this->has_file = true; + + return $value; + } + + if ($value instanceof ModelInterface) { + return $this->processModel($value); + } + + if (is_array($value) || (is_object($value) && !$value instanceof \DateTimeInterface)) { + $data = []; + + foreach ($value as $k => $v) { + $data[$k] = $this->makeFormSafe($v); + } + + return $data; + } + + return ObjectSerializer::toString($value); + } + + /** + * We are able to handle nested ModelInterface. We do not simply call + * json_decode(json_encode()) because any given model may have binary data + * or other data that cannot be serialized to a JSON string + */ + protected function processModel(ModelInterface $model): array + { + $result = []; + + foreach ($model::openAPITypes() as $name => $type) { + $value = $model->offsetGet($name); + + if ($value === null) { + continue; + } + + if (strpos($type, '\SplFileObject') !== false) { + $file = is_array($value) ? $value : [$value]; + $result[$name] = $this->processFiles($file); + + continue; + } + + if ($value instanceof ModelInterface) { + $result[$name] = $this->processModel($value); + + continue; + } + + if (is_array($value) || is_object($value)) { + $result[$name] = $this->makeFormSafe($value); + + continue; + } + + $result[$name] = ObjectSerializer::toString($value); + } + + return $result; + } + + /** + * Handle file data + */ + protected function processFiles(array $files): array + { + $this->has_file = true; + + $result = []; + + foreach ($files as $i => $file) { + if (is_array($file)) { + $result[$i] = $this->processFiles($file); + + continue; + } + + if ($file instanceof StreamInterface) { + $result[$i] = $file; + + continue; + } + + if ($file instanceof SplFileObject) { + $result[$i] = $this->tryFopen($file); + } + } + + return $result; + } + + private function tryFopen(SplFileObject $file) + { + return Utils::tryFopen($file->getRealPath(), 'rb'); + } +} diff --git a/codegen/Crm/Exports/HeaderSelector.php b/codegen/Crm/Exports/HeaderSelector.php index 0756e130..f0b6212a 100644 --- a/codegen/Crm/Exports/HeaderSelector.php +++ b/codegen/Crm/Exports/HeaderSelector.php @@ -1,7 +1,7 @@ 'string', 'completed_at' => '\DateTime', + 'errors' => '\HubSpot\Client\Crm\Exports\Model\StandardError[]', + 'links' => 'array', 'num_errors' => 'int', 'requested_at' => '\DateTime', + 'result' => 'string', 'started_at' => '\DateTime', - 'links' => 'array', - 'errors' => '\HubSpot\Client\Crm\Exports\Model\StandardError[]', 'status' => 'string' ]; @@ -75,13 +75,13 @@ class ActionResponseWithSingleResultURI implements ModelInterface, ArrayAccess, * @psalm-var array */ protected static $openAPIFormats = [ - 'result' => null, 'completed_at' => 'date-time', + 'errors' => null, + 'links' => null, 'num_errors' => 'int32', 'requested_at' => 'date-time', + 'result' => null, 'started_at' => 'date-time', - 'links' => null, - 'errors' => null, 'status' => null ]; @@ -91,13 +91,13 @@ class ActionResponseWithSingleResultURI implements ModelInterface, ArrayAccess, * @var boolean[] */ protected static array $openAPINullables = [ - 'result' => false, 'completed_at' => false, + 'errors' => false, + 'links' => false, 'num_errors' => false, 'requested_at' => false, + 'result' => false, 'started_at' => false, - 'links' => false, - 'errors' => false, 'status' => false ]; @@ -187,13 +187,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'result' => 'result', 'completed_at' => 'completedAt', + 'errors' => 'errors', + 'links' => 'links', 'num_errors' => 'numErrors', 'requested_at' => 'requestedAt', + 'result' => 'result', 'started_at' => 'startedAt', - 'links' => 'links', - 'errors' => 'errors', 'status' => 'status' ]; @@ -203,13 +203,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'result' => 'setResult', 'completed_at' => 'setCompletedAt', + 'errors' => 'setErrors', + 'links' => 'setLinks', 'num_errors' => 'setNumErrors', 'requested_at' => 'setRequestedAt', + 'result' => 'setResult', 'started_at' => 'setStartedAt', - 'links' => 'setLinks', - 'errors' => 'setErrors', 'status' => 'setStatus' ]; @@ -219,13 +219,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'result' => 'getResult', 'completed_at' => 'getCompletedAt', + 'errors' => 'getErrors', + 'links' => 'getLinks', 'num_errors' => 'getNumErrors', 'requested_at' => 'getRequestedAt', + 'result' => 'getResult', 'started_at' => 'getStartedAt', - 'links' => 'getLinks', - 'errors' => 'getErrors', 'status' => 'getStatus' ]; @@ -270,10 +270,10 @@ public function getModelName() return self::$openAPIModelName; } - public const STATUS_PENDING = 'PENDING'; - public const STATUS_PROCESSING = 'PROCESSING'; public const STATUS_CANCELED = 'CANCELED'; public const STATUS_COMPLETE = 'COMPLETE'; + public const STATUS_PENDING = 'PENDING'; + public const STATUS_PROCESSING = 'PROCESSING'; /** * Gets allowable values of the enum @@ -283,10 +283,10 @@ public function getModelName() public function getStatusAllowableValues() { return [ - self::STATUS_PENDING, - self::STATUS_PROCESSING, self::STATUS_CANCELED, self::STATUS_COMPLETE, + self::STATUS_PENDING, + self::STATUS_PROCESSING, ]; } @@ -305,13 +305,13 @@ public function getStatusAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('result', $data ?? [], null); $this->setIfExists('completed_at', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('links', $data ?? [], null); $this->setIfExists('num_errors', $data ?? [], null); $this->setIfExists('requested_at', $data ?? [], null); + $this->setIfExists('result', $data ?? [], null); $this->setIfExists('started_at', $data ?? [], null); - $this->setIfExists('links', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); } @@ -376,55 +376,82 @@ public function valid() /** - * Gets result + * Gets completed_at * - * @return string|null + * @return \DateTime */ - public function getResult() + public function getCompletedAt() { - return $this->container['result']; + return $this->container['completed_at']; } /** - * Sets result + * Sets completed_at * - * @param string|null $result result + * @param \DateTime $completed_at The timestamp when the export was completed, in ISO 8601 format. * * @return self */ - public function setResult($result) + public function setCompletedAt($completed_at) { - if (is_null($result)) { - throw new \InvalidArgumentException('non-nullable result cannot be null'); + if (is_null($completed_at)) { + throw new \InvalidArgumentException('non-nullable completed_at cannot be null'); } - $this->container['result'] = $result; + $this->container['completed_at'] = $completed_at; return $this; } /** - * Gets completed_at + * Gets errors * - * @return \DateTime + * @return \HubSpot\Client\Crm\Exports\Model\StandardError[]|null */ - public function getCompletedAt() + public function getErrors() { - return $this->container['completed_at']; + return $this->container['errors']; } /** - * Sets completed_at + * Sets errors * - * @param \DateTime $completed_at completed_at + * @param \HubSpot\Client\Crm\Exports\Model\StandardError[]|null $errors errors * * @return self */ - public function setCompletedAt($completed_at) + public function setErrors($errors) { - if (is_null($completed_at)) { - throw new \InvalidArgumentException('non-nullable completed_at cannot be null'); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['completed_at'] = $completed_at; + $this->container['errors'] = $errors; + + return $this; + } + + /** + * Gets links + * + * @return array|null + */ + public function getLinks() + { + return $this->container['links']; + } + + /** + * Sets links + * + * @param array|null $links A collection of related links associated with the export. + * + * @return self + */ + public function setLinks($links) + { + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); + } + $this->container['links'] = $links; return $this; } @@ -442,7 +469,7 @@ public function getNumErrors() /** * Sets num_errors * - * @param int|null $num_errors num_errors + * @param int|null $num_errors The number of errors encountered during the export process. * * @return self */ @@ -469,7 +496,7 @@ public function getRequestedAt() /** * Sets requested_at * - * @param \DateTime|null $requested_at requested_at + * @param \DateTime|null $requested_at The timestamp when the export request was made, in ISO 8601 format. * * @return self */ @@ -484,82 +511,55 @@ public function setRequestedAt($requested_at) } /** - * Gets started_at - * - * @return \DateTime - */ - public function getStartedAt() - { - return $this->container['started_at']; - } - - /** - * Sets started_at - * - * @param \DateTime $started_at started_at - * - * @return self - */ - public function setStartedAt($started_at) - { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); - } - $this->container['started_at'] = $started_at; - - return $this; - } - - /** - * Gets links + * Gets result * - * @return array|null + * @return string|null */ - public function getLinks() + public function getResult() { - return $this->container['links']; + return $this->container['result']; } /** - * Sets links + * Sets result * - * @param array|null $links links + * @param string|null $result The URL of the resulting file if the export status is COMPLETE. * * @return self */ - public function setLinks($links) + public function setResult($result) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($result)) { + throw new \InvalidArgumentException('non-nullable result cannot be null'); } - $this->container['links'] = $links; + $this->container['result'] = $result; return $this; } /** - * Gets errors + * Gets started_at * - * @return \HubSpot\Client\Crm\Exports\Model\StandardError[]|null + * @return \DateTime */ - public function getErrors() + public function getStartedAt() { - return $this->container['errors']; + return $this->container['started_at']; } /** - * Sets errors + * Sets started_at * - * @param \HubSpot\Client\Crm\Exports\Model\StandardError[]|null $errors errors + * @param \DateTime $started_at The timestamp when the export process started, in ISO 8601 format. * * @return self */ - public function setErrors($errors) + public function setStartedAt($started_at) { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); + if (is_null($started_at)) { + throw new \InvalidArgumentException('non-nullable started_at cannot be null'); } - $this->container['errors'] = $errors; + $this->container['started_at'] = $started_at; return $this; } @@ -577,7 +577,7 @@ public function getStatus() /** * Sets status * - * @param string $status status + * @param string $status The current status of the export, which can be PENDING, PROCESSING, COMPLETE or CANCELED. * * @return self */ @@ -603,11 +603,11 @@ public function setStatus($status) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -615,12 +615,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -645,11 +645,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Exports/Model/Error.php b/codegen/Crm/Exports/Model/Error.php index 21149fe2..bc139bc0 100644 --- a/codegen/Crm/Exports/Model/Error.php +++ b/codegen/Crm/Exports/Model/Error.php @@ -2,7 +2,7 @@ /** * Error * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Exports @@ -13,11 +13,11 @@ /** * CRM Exports * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,13 +57,13 @@ class Error implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'string', + 'category' => 'string', 'context' => 'array', 'correlation_id' => 'string', + 'errors' => '\HubSpot\Client\Crm\Exports\Model\ErrorDetail[]', 'links' => 'array', 'message' => 'string', - 'category' => 'string', - 'errors' => '\HubSpot\Client\Crm\Exports\Model\ErrorDetail[]' + 'sub_category' => 'string' ]; /** @@ -74,13 +74,13 @@ class Error implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'sub_category' => null, + 'category' => null, 'context' => null, 'correlation_id' => 'uuid', + 'errors' => null, 'links' => null, 'message' => null, - 'category' => null, - 'errors' => null + 'sub_category' => null ]; /** @@ -89,13 +89,13 @@ class Error implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'sub_category' => false, + 'category' => false, 'context' => false, 'correlation_id' => false, + 'errors' => false, 'links' => false, 'message' => false, - 'category' => false, - 'errors' => false + 'sub_category' => false ]; /** @@ -184,13 +184,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'sub_category' => 'subCategory', + 'category' => 'category', 'context' => 'context', 'correlation_id' => 'correlationId', + 'errors' => 'errors', 'links' => 'links', 'message' => 'message', - 'category' => 'category', - 'errors' => 'errors' + 'sub_category' => 'subCategory' ]; /** @@ -199,13 +199,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'sub_category' => 'setSubCategory', + 'category' => 'setCategory', 'context' => 'setContext', 'correlation_id' => 'setCorrelationId', + 'errors' => 'setErrors', 'links' => 'setLinks', 'message' => 'setMessage', - 'category' => 'setCategory', - 'errors' => 'setErrors' + 'sub_category' => 'setSubCategory' ]; /** @@ -214,13 +214,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'sub_category' => 'getSubCategory', + 'category' => 'getCategory', 'context' => 'getContext', 'correlation_id' => 'getCorrelationId', + 'errors' => 'getErrors', 'links' => 'getLinks', 'message' => 'getMessage', - 'category' => 'getCategory', - 'errors' => 'getErrors' + 'sub_category' => 'getSubCategory' ]; /** @@ -280,13 +280,13 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('sub_category', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); $this->setIfExists('correlation_id', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('links', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); - $this->setIfExists('category', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('sub_category', $data ?? [], null); } /** @@ -316,15 +316,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['category'] === null) { + $invalidProperties[] = "'category' can't be null"; + } if ($this->container['correlation_id'] === null) { $invalidProperties[] = "'correlation_id' can't be null"; } if ($this->container['message'] === null) { $invalidProperties[] = "'message' can't be null"; } - if ($this->container['category'] === null) { - $invalidProperties[] = "'category' can't be null"; - } return $invalidProperties; } @@ -341,28 +341,28 @@ public function valid() /** - * Gets sub_category + * Gets category * - * @return string|null + * @return string */ - public function getSubCategory() + public function getCategory() { - return $this->container['sub_category']; + return $this->container['category']; } /** - * Sets sub_category + * Sets category * - * @param string|null $sub_category A specific category that contains more specific detail about the error + * @param string $category The error category * * @return self */ - public function setSubCategory($sub_category) + public function setCategory($category) { - if (is_null($sub_category)) { - throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); } - $this->container['sub_category'] = $sub_category; + $this->container['category'] = $category; return $this; } @@ -421,6 +421,33 @@ public function setCorrelationId($correlation_id) return $this; } + /** + * Gets errors + * + * @return \HubSpot\Client\Crm\Exports\Model\ErrorDetail[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Crm\Exports\Model\ErrorDetail[]|null $errors further information about the error + * + * @return self + */ + public function setErrors($errors) + { + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); + } + $this->container['errors'] = $errors; + + return $this; + } + /** * Gets links * @@ -476,66 +503,39 @@ public function setMessage($message) } /** - * Gets category - * - * @return string - */ - public function getCategory() - { - return $this->container['category']; - } - - /** - * Sets category - * - * @param string $category The error category - * - * @return self - */ - public function setCategory($category) - { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); - } - $this->container['category'] = $category; - - return $this; - } - - /** - * Gets errors + * Gets sub_category * - * @return \HubSpot\Client\Crm\Exports\Model\ErrorDetail[]|null + * @return string|null */ - public function getErrors() + public function getSubCategory() { - return $this->container['errors']; + return $this->container['sub_category']; } /** - * Sets errors + * Sets sub_category * - * @param \HubSpot\Client\Crm\Exports\Model\ErrorDetail[]|null $errors further information about the error + * @param string|null $sub_category A specific category that contains more specific detail about the error * * @return self */ - public function setErrors($errors) + public function setSubCategory($sub_category) { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['errors'] = $errors; + $this->container['sub_category'] = $sub_category; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -543,12 +543,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -573,11 +573,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Exports/Model/ErrorDetail.php b/codegen/Crm/Exports/Model/ErrorDetail.php index 40f0311d..57c49857 100644 --- a/codegen/Crm/Exports/Model/ErrorDetail.php +++ b/codegen/Crm/Exports/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Exports @@ -13,11 +13,11 @@ /** * CRM Exports * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,11 +57,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'string', 'code' => 'string', - 'in' => 'string', 'context' => 'array', - 'message' => 'string' + 'in' => 'string', + 'message' => 'string', + 'sub_category' => 'string' ]; /** @@ -72,11 +72,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'sub_category' => null, 'code' => null, - 'in' => null, 'context' => null, - 'message' => null + 'in' => null, + 'message' => null, + 'sub_category' => null ]; /** @@ -85,11 +85,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'sub_category' => false, 'code' => false, - 'in' => false, 'context' => false, - 'message' => false + 'in' => false, + 'message' => false, + 'sub_category' => false ]; /** @@ -178,11 +178,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'sub_category' => 'subCategory', 'code' => 'code', - 'in' => 'in', 'context' => 'context', - 'message' => 'message' + 'in' => 'in', + 'message' => 'message', + 'sub_category' => 'subCategory' ]; /** @@ -191,11 +191,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'sub_category' => 'setSubCategory', 'code' => 'setCode', - 'in' => 'setIn', 'context' => 'setContext', - 'message' => 'setMessage' + 'in' => 'setIn', + 'message' => 'setMessage', + 'sub_category' => 'setSubCategory' ]; /** @@ -204,11 +204,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'sub_category' => 'getSubCategory', 'code' => 'getCode', - 'in' => 'getIn', 'context' => 'getContext', - 'message' => 'getMessage' + 'in' => 'getIn', + 'message' => 'getMessage', + 'sub_category' => 'getSubCategory' ]; /** @@ -268,11 +268,11 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('sub_category', $data ?? [], null); $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('in', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); + $this->setIfExists('in', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('sub_category', $data ?? [], null); } /** @@ -321,55 +321,55 @@ public function valid() /** - * Gets sub_category + * Gets code * * @return string|null */ - public function getSubCategory() + public function getCode() { - return $this->container['sub_category']; + return $this->container['code']; } /** - * Sets sub_category + * Sets code * - * @param string|null $sub_category A specific category that contains more specific detail about the error + * @param string|null $code The status code associated with the error detail * * @return self */ - public function setSubCategory($sub_category) + public function setCode($code) { - if (is_null($sub_category)) { - throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); } - $this->container['sub_category'] = $sub_category; + $this->container['code'] = $code; return $this; } /** - * Gets code + * Gets context * - * @return string|null + * @return array|null */ - public function getCode() + public function getContext() { - return $this->container['code']; + return $this->container['context']; } /** - * Sets code + * Sets context * - * @param string|null $code The status code associated with the error detail + * @param array|null $context Context about the error condition * * @return self */ - public function setCode($code) + public function setContext($context) { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); + if (is_null($context)) { + throw new \InvalidArgumentException('non-nullable context cannot be null'); } - $this->container['code'] = $code; + $this->container['context'] = $context; return $this; } @@ -402,66 +402,66 @@ public function setIn($in) } /** - * Gets context + * Gets message * - * @return array|null + * @return string */ - public function getContext() + public function getMessage() { - return $this->container['context']; + return $this->container['message']; } /** - * Sets context + * Sets message * - * @param array|null $context Context about the error condition + * @param string $message A human readable message describing the error along with remediation steps where appropriate * * @return self */ - public function setContext($context) + public function setMessage($message) { - if (is_null($context)) { - throw new \InvalidArgumentException('non-nullable context cannot be null'); + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - $this->container['context'] = $context; + $this->container['message'] = $message; return $this; } /** - * Gets message + * Gets sub_category * - * @return string + * @return string|null */ - public function getMessage() + public function getSubCategory() { - return $this->container['message']; + return $this->container['sub_category']; } /** - * Sets message + * Sets sub_category * - * @param string $message A human readable message describing the error along with remediation steps where appropriate + * @param string|null $sub_category A specific category that contains more specific detail about the error * * @return self */ - public function setMessage($message) + public function setSubCategory($sub_category) { - if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['message'] = $message; + $this->container['sub_category'] = $sub_category; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -469,12 +469,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -499,11 +499,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Exports/Model/Filter.php b/codegen/Crm/Exports/Model/Filter.php index 6d3c0694..9c5aef48 100644 --- a/codegen/Crm/Exports/Model/Filter.php +++ b/codegen/Crm/Exports/Model/Filter.php @@ -2,7 +2,7 @@ /** * Filter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Exports @@ -13,11 +13,11 @@ /** * CRM Exports * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -35,6 +35,7 @@ * Filter Class Doc Comment * * @category Class + * @description Defines a single condition for searching CRM objects, specifying the property to filter on, the operator to use (such as equals, greater than, or contains), and the value(s) to compare against. * @package HubSpot\Client\Crm\Exports * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -58,10 +59,10 @@ class Filter implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPITypes = [ 'high_value' => 'string', + 'operator' => 'string', 'property_name' => 'string', - 'values' => 'string[]', 'value' => 'string', - 'operator' => 'string' + 'values' => 'string[]' ]; /** @@ -73,10 +74,10 @@ class Filter implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static $openAPIFormats = [ 'high_value' => null, + 'operator' => null, 'property_name' => null, - 'values' => null, 'value' => null, - 'operator' => null + 'values' => null ]; /** @@ -86,10 +87,10 @@ class Filter implements ModelInterface, ArrayAccess, \JsonSerializable */ protected static array $openAPINullables = [ 'high_value' => false, + 'operator' => false, 'property_name' => false, - 'values' => false, 'value' => false, - 'operator' => false + 'values' => false ]; /** @@ -179,10 +180,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'high_value' => 'highValue', + 'operator' => 'operator', 'property_name' => 'propertyName', - 'values' => 'values', 'value' => 'value', - 'operator' => 'operator' + 'values' => 'values' ]; /** @@ -192,10 +193,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'high_value' => 'setHighValue', + 'operator' => 'setOperator', 'property_name' => 'setPropertyName', - 'values' => 'setValues', 'value' => 'setValue', - 'operator' => 'setOperator' + 'values' => 'setValues' ]; /** @@ -205,10 +206,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'high_value' => 'getHighValue', + 'operator' => 'getOperator', 'property_name' => 'getPropertyName', - 'values' => 'getValues', 'value' => 'getValue', - 'operator' => 'getOperator' + 'values' => 'getValues' ]; /** @@ -252,17 +253,19 @@ public function getModelName() return self::$openAPIModelName; } + public const OPERATOR_BETWEEN = 'BETWEEN'; + public const OPERATOR_CONTAINS_TOKEN = 'CONTAINS_TOKEN'; public const OPERATOR_EQ = 'EQ'; - public const OPERATOR_NEQ = 'NEQ'; - public const OPERATOR_LT = 'LT'; - public const OPERATOR_LTE = 'LTE'; public const OPERATOR_GT = 'GT'; public const OPERATOR_GTE = 'GTE'; - public const OPERATOR_BETWEEN = 'BETWEEN'; - public const OPERATOR_IN = 'IN'; - public const OPERATOR_NOT_IN = 'NOT_IN'; public const OPERATOR_HAS_PROPERTY = 'HAS_PROPERTY'; + public const OPERATOR_IN = 'IN'; + public const OPERATOR_LT = 'LT'; + public const OPERATOR_LTE = 'LTE'; + public const OPERATOR_NEQ = 'NEQ'; + public const OPERATOR_NOT_CONTAINS_TOKEN = 'NOT_CONTAINS_TOKEN'; public const OPERATOR_NOT_HAS_PROPERTY = 'NOT_HAS_PROPERTY'; + public const OPERATOR_NOT_IN = 'NOT_IN'; /** * Gets allowable values of the enum @@ -272,17 +275,19 @@ public function getModelName() public function getOperatorAllowableValues() { return [ + self::OPERATOR_BETWEEN, + self::OPERATOR_CONTAINS_TOKEN, self::OPERATOR_EQ, - self::OPERATOR_NEQ, - self::OPERATOR_LT, - self::OPERATOR_LTE, self::OPERATOR_GT, self::OPERATOR_GTE, - self::OPERATOR_BETWEEN, - self::OPERATOR_IN, - self::OPERATOR_NOT_IN, self::OPERATOR_HAS_PROPERTY, + self::OPERATOR_IN, + self::OPERATOR_LT, + self::OPERATOR_LTE, + self::OPERATOR_NEQ, + self::OPERATOR_NOT_CONTAINS_TOKEN, self::OPERATOR_NOT_HAS_PROPERTY, + self::OPERATOR_NOT_IN, ]; } @@ -302,10 +307,10 @@ public function getOperatorAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('high_value', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); $this->setIfExists('property_name', $data ?? [], null); - $this->setIfExists('values', $data ?? [], null); $this->setIfExists('value', $data ?? [], null); - $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); } /** @@ -335,9 +340,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['property_name'] === null) { - $invalidProperties[] = "'property_name' can't be null"; - } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } @@ -350,6 +352,9 @@ public function listInvalidProperties() ); } + if ($this->container['property_name'] === null) { + $invalidProperties[] = "'property_name' can't be null"; + } return $invalidProperties; } @@ -378,7 +383,7 @@ public function getHighValue() /** * Sets high_value * - * @param string|null $high_value high_value + * @param string|null $high_value The upper boundary value when using ranged-based filters. * * @return self */ @@ -393,55 +398,65 @@ public function setHighValue($high_value) } /** - * Gets property_name + * Gets operator * * @return string */ - public function getPropertyName() + public function getOperator() { - return $this->container['property_name']; + return $this->container['operator']; } /** - * Sets property_name + * Sets operator * - * @param string $property_name property_name + * @param string $operator The comparison operator used in the filter, such as \"EQ\" or \"GT\". * * @return self */ - public function setPropertyName($property_name) + public function setOperator($operator) { - if (is_null($property_name)) { - throw new \InvalidArgumentException('non-nullable property_name cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['property_name'] = $property_name; + $allowedValues = $this->getOperatorAllowableValues(); + if (!in_array($operator, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'operator', must be one of '%s'", + $operator, + implode("', '", $allowedValues) + ) + ); + } + $this->container['operator'] = $operator; return $this; } /** - * Gets values + * Gets property_name * - * @return string[]|null + * @return string */ - public function getValues() + public function getPropertyName() { - return $this->container['values']; + return $this->container['property_name']; } /** - * Sets values + * Sets property_name * - * @param string[]|null $values values + * @param string $property_name The name of the property to apply the filter to. * * @return self */ - public function setValues($values) + public function setPropertyName($property_name) { - if (is_null($values)) { - throw new \InvalidArgumentException('non-nullable values cannot be null'); + if (is_null($property_name)) { + throw new \InvalidArgumentException('non-nullable property_name cannot be null'); } - $this->container['values'] = $values; + $this->container['property_name'] = $property_name; return $this; } @@ -459,7 +474,7 @@ public function getValue() /** * Sets value * - * @param string|null $value value + * @param string|null $value The value to match against the property. * * @return self */ @@ -474,49 +489,39 @@ public function setValue($value) } /** - * Gets operator + * Gets values * - * @return string + * @return string[]|null */ - public function getOperator() + public function getValues() { - return $this->container['operator']; + return $this->container['values']; } /** - * Sets operator + * Sets values * - * @param string $operator operator + * @param string[]|null $values The values to match against the property. * * @return self */ - public function setOperator($operator) + public function setValues($values) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); - } - $allowedValues = $this->getOperatorAllowableValues(); - if (!in_array($operator, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'operator', must be one of '%s'", - $operator, - implode("', '", $allowedValues) - ) - ); + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); } - $this->container['operator'] = $operator; + $this->container['values'] = $values; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -524,12 +529,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -554,11 +559,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Exports/Model/FilterGroup.php b/codegen/Crm/Exports/Model/FilterGroup.php new file mode 100644 index 00000000..080b8bc9 --- /dev/null +++ b/codegen/Crm/Exports/Model/FilterGroup.php @@ -0,0 +1,412 @@ + + */ +class FilterGroup implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FilterGroup'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'filters' => '\HubSpot\Client\Crm\Exports\Model\Filter[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'filters' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'filters' => 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 = [ + 'filters' => 'filters' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'filters' => 'setFilters' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'filters' => 'getFilters' + ]; + + /** + * 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; + } + + + /** + * 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('filters', $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['filters'] === null) { + $invalidProperties[] = "'filters' 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 filters + * + * @return \HubSpot\Client\Crm\Exports\Model\Filter[] + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param \HubSpot\Client\Crm\Exports\Model\Filter[] $filters filters + * + * @return self + */ + public function setFilters($filters) + { + if (is_null($filters)) { + throw new \InvalidArgumentException('non-nullable filters cannot be null'); + } + $this->container['filters'] = $filters; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $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|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $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/Exports/Model/ModelInterface.php b/codegen/Crm/Exports/Model/ModelInterface.php index 322049a3..48b91b6c 100644 --- a/codegen/Crm/Exports/Model/ModelInterface.php +++ b/codegen/Crm/Exports/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Exports\Model @@ -13,11 +13,11 @@ /** * CRM Exports * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** diff --git a/codegen/Crm/Exports/Model/PublicCrmSearchRequest.php b/codegen/Crm/Exports/Model/PublicCrmSearchRequest.php index d9e1d489..04210da4 100644 --- a/codegen/Crm/Exports/Model/PublicCrmSearchRequest.php +++ b/codegen/Crm/Exports/Model/PublicCrmSearchRequest.php @@ -2,7 +2,7 @@ /** * PublicCrmSearchRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Exports @@ -13,11 +13,11 @@ /** * CRM Exports * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,8 +57,9 @@ class PublicCrmSearchRequest implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $openAPITypes = [ - 'query' => 'string', + 'filter_groups' => '\HubSpot\Client\Crm\Exports\Model\FilterGroup[]', 'filters' => '\HubSpot\Client\Crm\Exports\Model\Filter[]', + 'query' => 'string', 'sorts' => 'string[]' ]; @@ -70,8 +71,9 @@ class PublicCrmSearchRequest implements ModelInterface, ArrayAccess, \JsonSerial * @psalm-var array */ protected static $openAPIFormats = [ - 'query' => null, + 'filter_groups' => null, 'filters' => null, + 'query' => null, 'sorts' => null ]; @@ -81,8 +83,9 @@ class PublicCrmSearchRequest implements ModelInterface, ArrayAccess, \JsonSerial * @var boolean[] */ protected static array $openAPINullables = [ - 'query' => false, + 'filter_groups' => false, 'filters' => false, + 'query' => false, 'sorts' => false ]; @@ -172,8 +175,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'query' => 'query', + 'filter_groups' => 'filterGroups', 'filters' => 'filters', + 'query' => 'query', 'sorts' => 'sorts' ]; @@ -183,8 +187,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'query' => 'setQuery', + 'filter_groups' => 'setFilterGroups', 'filters' => 'setFilters', + 'query' => 'setQuery', 'sorts' => 'setSorts' ]; @@ -194,8 +199,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'query' => 'getQuery', + 'filter_groups' => 'getFilterGroups', 'filters' => 'getFilters', + 'query' => 'getQuery', 'sorts' => 'getSorts' ]; @@ -256,8 +262,9 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('query', $data ?? [], null); + $this->setIfExists('filter_groups', $data ?? [], null); $this->setIfExists('filters', $data ?? [], null); + $this->setIfExists('query', $data ?? [], null); $this->setIfExists('sorts', $data ?? [], null); } @@ -288,8 +295,8 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['query'] === null) { - $invalidProperties[] = "'query' can't be null"; + if ($this->container['filter_groups'] === null) { + $invalidProperties[] = "'filter_groups' can't be null"; } if ($this->container['filters'] === null) { $invalidProperties[] = "'filters' can't be null"; @@ -313,28 +320,28 @@ public function valid() /** - * Gets query + * Gets filter_groups * - * @return string + * @return \HubSpot\Client\Crm\Exports\Model\FilterGroup[] */ - public function getQuery() + public function getFilterGroups() { - return $this->container['query']; + return $this->container['filter_groups']; } /** - * Sets query + * Sets filter_groups * - * @param string $query query + * @param \HubSpot\Client\Crm\Exports\Model\FilterGroup[] $filter_groups filter_groups * * @return self */ - public function setQuery($query) + public function setFilterGroups($filter_groups) { - if (is_null($query)) { - throw new \InvalidArgumentException('non-nullable query cannot be null'); + if (is_null($filter_groups)) { + throw new \InvalidArgumentException('non-nullable filter_groups cannot be null'); } - $this->container['query'] = $query; + $this->container['filter_groups'] = $filter_groups; return $this; } @@ -366,6 +373,33 @@ public function setFilters($filters) return $this; } + /** + * Gets query + * + * @return string|null + */ + public function getQuery() + { + return $this->container['query']; + } + + /** + * Sets query + * + * @param string|null $query The search query string, to filter CRM records. + * + * @return self + */ + public function setQuery($query) + { + if (is_null($query)) { + throw new \InvalidArgumentException('non-nullable query cannot be null'); + } + $this->container['query'] = $query; + + return $this; + } + /** * Gets sorts * @@ -379,7 +413,7 @@ public function getSorts() /** * Sets sorts * - * @param string[] $sorts sorts + * @param string[] $sorts Defines the order in which the CRM records should be returned. * * @return self */ @@ -395,11 +429,11 @@ public function setSorts($sorts) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -407,12 +441,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -437,11 +471,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Exports/Model/PublicExportListRequest.php b/codegen/Crm/Exports/Model/PublicExportListRequest.php index b320adaa..422f4467 100644 --- a/codegen/Crm/Exports/Model/PublicExportListRequest.php +++ b/codegen/Crm/Exports/Model/PublicExportListRequest.php @@ -2,7 +2,7 @@ /** * PublicExportListRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Exports @@ -13,11 +13,11 @@ /** * CRM Exports * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -61,7 +61,9 @@ class PublicExportListRequest implements ModelInterface, ArrayAccess, \JsonSeria 'format' => 'string', 'export_name' => 'string', 'object_properties' => 'string[]', - 'associated_object_type' => 'string', + 'associated_object_type' => 'string[]', + 'include_labeled_associations' => 'bool', + 'include_primary_display_property_for_associated_objects' => 'bool', 'object_type' => 'string', 'language' => 'string', 'export_internal_values_options' => 'string[]', @@ -83,6 +85,8 @@ class PublicExportListRequest implements ModelInterface, ArrayAccess, \JsonSeria 'export_name' => null, 'object_properties' => null, 'associated_object_type' => null, + 'include_labeled_associations' => null, + 'include_primary_display_property_for_associated_objects' => null, 'object_type' => null, 'language' => null, 'export_internal_values_options' => null, @@ -102,6 +106,8 @@ class PublicExportListRequest implements ModelInterface, ArrayAccess, \JsonSeria 'export_name' => false, 'object_properties' => false, 'associated_object_type' => false, + 'include_labeled_associations' => false, + 'include_primary_display_property_for_associated_objects' => false, 'object_type' => false, 'language' => false, 'export_internal_values_options' => false, @@ -201,6 +207,8 @@ public function isNullableSetToNull(string $property): bool 'export_name' => 'exportName', 'object_properties' => 'objectProperties', 'associated_object_type' => 'associatedObjectType', + 'include_labeled_associations' => 'includeLabeledAssociations', + 'include_primary_display_property_for_associated_objects' => 'includePrimaryDisplayPropertyForAssociatedObjects', 'object_type' => 'objectType', 'language' => 'language', 'export_internal_values_options' => 'exportInternalValuesOptions', @@ -220,6 +228,8 @@ public function isNullableSetToNull(string $property): bool 'export_name' => 'setExportName', 'object_properties' => 'setObjectProperties', 'associated_object_type' => 'setAssociatedObjectType', + 'include_labeled_associations' => 'setIncludeLabeledAssociations', + 'include_primary_display_property_for_associated_objects' => 'setIncludePrimaryDisplayPropertyForAssociatedObjects', 'object_type' => 'setObjectType', 'language' => 'setLanguage', 'export_internal_values_options' => 'setExportInternalValuesOptions', @@ -239,6 +249,8 @@ public function isNullableSetToNull(string $property): bool 'export_name' => 'getExportName', 'object_properties' => 'getObjectProperties', 'associated_object_type' => 'getAssociatedObjectType', + 'include_labeled_associations' => 'getIncludeLabeledAssociations', + 'include_primary_display_property_for_associated_objects' => 'getIncludePrimaryDisplayPropertyForAssociatedObjects', 'object_type' => 'getObjectType', 'language' => 'getLanguage', 'export_internal_values_options' => 'getExportInternalValuesOptions', @@ -393,6 +405,8 @@ public function __construct(?array $data = null) $this->setIfExists('export_name', $data ?? [], null); $this->setIfExists('object_properties', $data ?? [], null); $this->setIfExists('associated_object_type', $data ?? [], null); + $this->setIfExists('include_labeled_associations', $data ?? [], null); + $this->setIfExists('include_primary_display_property_for_associated_objects', $data ?? [], null); $this->setIfExists('object_type', $data ?? [], null); $this->setIfExists('language', $data ?? [], null); $this->setIfExists('export_internal_values_options', $data ?? [], null); @@ -458,6 +472,15 @@ public function listInvalidProperties() if ($this->container['object_properties'] === null) { $invalidProperties[] = "'object_properties' can't be null"; } + if ($this->container['associated_object_type'] === null) { + $invalidProperties[] = "'associated_object_type' can't be null"; + } + if ($this->container['include_labeled_associations'] === null) { + $invalidProperties[] = "'include_labeled_associations' can't be null"; + } + if ($this->container['include_primary_display_property_for_associated_objects'] === null) { + $invalidProperties[] = "'include_primary_display_property_for_associated_objects' can't be null"; + } if ($this->container['object_type'] === null) { $invalidProperties[] = "'object_type' can't be null"; } @@ -628,7 +651,7 @@ public function setObjectProperties($object_properties) /** * Gets associated_object_type * - * @return string|null + * @return string[] */ public function getAssociatedObjectType() { @@ -638,7 +661,7 @@ public function getAssociatedObjectType() /** * Sets associated_object_type * - * @param string|null $associated_object_type associated_object_type + * @param string[] $associated_object_type associated_object_type * * @return self */ @@ -652,6 +675,60 @@ public function setAssociatedObjectType($associated_object_type) return $this; } + /** + * Gets include_labeled_associations + * + * @return bool + */ + public function getIncludeLabeledAssociations() + { + return $this->container['include_labeled_associations']; + } + + /** + * Sets include_labeled_associations + * + * @param bool $include_labeled_associations include_labeled_associations + * + * @return self + */ + public function setIncludeLabeledAssociations($include_labeled_associations) + { + if (is_null($include_labeled_associations)) { + throw new \InvalidArgumentException('non-nullable include_labeled_associations cannot be null'); + } + $this->container['include_labeled_associations'] = $include_labeled_associations; + + return $this; + } + + /** + * Gets include_primary_display_property_for_associated_objects + * + * @return bool + */ + public function getIncludePrimaryDisplayPropertyForAssociatedObjects() + { + return $this->container['include_primary_display_property_for_associated_objects']; + } + + /** + * Sets include_primary_display_property_for_associated_objects + * + * @param bool $include_primary_display_property_for_associated_objects include_primary_display_property_for_associated_objects + * + * @return self + */ + public function setIncludePrimaryDisplayPropertyForAssociatedObjects($include_primary_display_property_for_associated_objects) + { + if (is_null($include_primary_display_property_for_associated_objects)) { + throw new \InvalidArgumentException('non-nullable include_primary_display_property_for_associated_objects cannot be null'); + } + $this->container['include_primary_display_property_for_associated_objects'] = $include_primary_display_property_for_associated_objects; + + return $this; + } + /** * Gets object_type * @@ -835,11 +912,11 @@ public function setListId($list_id) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -847,12 +924,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -877,11 +954,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Exports/Model/PublicExportRequest.php b/codegen/Crm/Exports/Model/PublicExportRequest.php index a6dfe324..1c1cf5f6 100644 --- a/codegen/Crm/Exports/Model/PublicExportRequest.php +++ b/codegen/Crm/Exports/Model/PublicExportRequest.php @@ -2,7 +2,7 @@ /** * PublicExportRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Exports @@ -13,11 +13,11 @@ /** * CRM Exports * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -61,7 +61,9 @@ class PublicExportRequest implements ModelInterface, ArrayAccess, \JsonSerializa 'format' => 'string', 'export_name' => 'string', 'object_properties' => 'string[]', - 'associated_object_type' => 'string', + 'associated_object_type' => 'string[]', + 'include_labeled_associations' => 'bool', + 'include_primary_display_property_for_associated_objects' => 'bool', 'object_type' => 'string', 'language' => 'string', 'export_internal_values_options' => 'string[]', @@ -83,6 +85,8 @@ class PublicExportRequest implements ModelInterface, ArrayAccess, \JsonSerializa 'export_name' => null, 'object_properties' => null, 'associated_object_type' => null, + 'include_labeled_associations' => null, + 'include_primary_display_property_for_associated_objects' => null, 'object_type' => null, 'language' => null, 'export_internal_values_options' => null, @@ -102,6 +106,8 @@ class PublicExportRequest implements ModelInterface, ArrayAccess, \JsonSerializa 'export_name' => false, 'object_properties' => false, 'associated_object_type' => false, + 'include_labeled_associations' => false, + 'include_primary_display_property_for_associated_objects' => false, 'object_type' => false, 'language' => false, 'export_internal_values_options' => false, @@ -201,6 +207,8 @@ public function isNullableSetToNull(string $property): bool 'export_name' => 'exportName', 'object_properties' => 'objectProperties', 'associated_object_type' => 'associatedObjectType', + 'include_labeled_associations' => 'includeLabeledAssociations', + 'include_primary_display_property_for_associated_objects' => 'includePrimaryDisplayPropertyForAssociatedObjects', 'object_type' => 'objectType', 'language' => 'language', 'export_internal_values_options' => 'exportInternalValuesOptions', @@ -220,6 +228,8 @@ public function isNullableSetToNull(string $property): bool 'export_name' => 'setExportName', 'object_properties' => 'setObjectProperties', 'associated_object_type' => 'setAssociatedObjectType', + 'include_labeled_associations' => 'setIncludeLabeledAssociations', + 'include_primary_display_property_for_associated_objects' => 'setIncludePrimaryDisplayPropertyForAssociatedObjects', 'object_type' => 'setObjectType', 'language' => 'setLanguage', 'export_internal_values_options' => 'setExportInternalValuesOptions', @@ -239,6 +249,8 @@ public function isNullableSetToNull(string $property): bool 'export_name' => 'getExportName', 'object_properties' => 'getObjectProperties', 'associated_object_type' => 'getAssociatedObjectType', + 'include_labeled_associations' => 'getIncludeLabeledAssociations', + 'include_primary_display_property_for_associated_objects' => 'getIncludePrimaryDisplayPropertyForAssociatedObjects', 'object_type' => 'getObjectType', 'language' => 'getLanguage', 'export_internal_values_options' => 'getExportInternalValuesOptions', @@ -393,6 +405,8 @@ public function __construct(?array $data = null) $this->setIfExists('export_name', $data ?? [], null); $this->setIfExists('object_properties', $data ?? [], null); $this->setIfExists('associated_object_type', $data ?? [], null); + $this->setIfExists('include_labeled_associations', $data ?? [], null); + $this->setIfExists('include_primary_display_property_for_associated_objects', $data ?? [], null); $this->setIfExists('object_type', $data ?? [], null); $this->setIfExists('language', $data ?? [], null); $this->setIfExists('export_internal_values_options', $data ?? [], null); @@ -458,6 +472,15 @@ public function listInvalidProperties() if ($this->container['object_properties'] === null) { $invalidProperties[] = "'object_properties' can't be null"; } + if ($this->container['associated_object_type'] === null) { + $invalidProperties[] = "'associated_object_type' can't be null"; + } + if ($this->container['include_labeled_associations'] === null) { + $invalidProperties[] = "'include_labeled_associations' can't be null"; + } + if ($this->container['include_primary_display_property_for_associated_objects'] === null) { + $invalidProperties[] = "'include_primary_display_property_for_associated_objects' can't be null"; + } if ($this->container['object_type'] === null) { $invalidProperties[] = "'object_type' can't be null"; } @@ -628,7 +651,7 @@ public function setObjectProperties($object_properties) /** * Gets associated_object_type * - * @return string|null + * @return string[] */ public function getAssociatedObjectType() { @@ -638,7 +661,7 @@ public function getAssociatedObjectType() /** * Sets associated_object_type * - * @param string|null $associated_object_type associated_object_type + * @param string[] $associated_object_type associated_object_type * * @return self */ @@ -652,6 +675,60 @@ public function setAssociatedObjectType($associated_object_type) return $this; } + /** + * Gets include_labeled_associations + * + * @return bool + */ + public function getIncludeLabeledAssociations() + { + return $this->container['include_labeled_associations']; + } + + /** + * Sets include_labeled_associations + * + * @param bool $include_labeled_associations include_labeled_associations + * + * @return self + */ + public function setIncludeLabeledAssociations($include_labeled_associations) + { + if (is_null($include_labeled_associations)) { + throw new \InvalidArgumentException('non-nullable include_labeled_associations cannot be null'); + } + $this->container['include_labeled_associations'] = $include_labeled_associations; + + return $this; + } + + /** + * Gets include_primary_display_property_for_associated_objects + * + * @return bool + */ + public function getIncludePrimaryDisplayPropertyForAssociatedObjects() + { + return $this->container['include_primary_display_property_for_associated_objects']; + } + + /** + * Sets include_primary_display_property_for_associated_objects + * + * @param bool $include_primary_display_property_for_associated_objects include_primary_display_property_for_associated_objects + * + * @return self + */ + public function setIncludePrimaryDisplayPropertyForAssociatedObjects($include_primary_display_property_for_associated_objects) + { + if (is_null($include_primary_display_property_for_associated_objects)) { + throw new \InvalidArgumentException('non-nullable include_primary_display_property_for_associated_objects cannot be null'); + } + $this->container['include_primary_display_property_for_associated_objects'] = $include_primary_display_property_for_associated_objects; + + return $this; + } + /** * Gets object_type * @@ -835,11 +912,11 @@ public function setPublicCrmSearchRequest($public_crm_search_request) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -847,12 +924,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -877,11 +954,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Exports/Model/PublicExportResponse.php b/codegen/Crm/Exports/Model/PublicExportResponse.php new file mode 100644 index 00000000..15eda84a --- /dev/null +++ b/codegen/Crm/Exports/Model/PublicExportResponse.php @@ -0,0 +1,784 @@ + + */ +class PublicExportResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicExportResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'created_at' => '\DateTime', + 'export_name' => 'string', + 'export_state' => 'string', + 'export_type' => 'string', + 'id' => 'string', + 'object_properties' => 'string[]', + 'object_type' => 'string', + 'record_count' => 'int', + 'updated_at' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'created_at' => 'date-time', + 'export_name' => null, + 'export_state' => null, + 'export_type' => null, + 'id' => null, + 'object_properties' => null, + 'object_type' => null, + 'record_count' => 'int32', + 'updated_at' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'created_at' => false, + 'export_name' => false, + 'export_state' => false, + 'export_type' => false, + 'id' => false, + 'object_properties' => false, + 'object_type' => false, + 'record_count' => false, + 'updated_at' => 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 = [ + 'created_at' => 'createdAt', + 'export_name' => 'exportName', + 'export_state' => 'exportState', + 'export_type' => 'exportType', + 'id' => 'id', + 'object_properties' => 'objectProperties', + 'object_type' => 'objectType', + 'record_count' => 'recordCount', + 'updated_at' => 'updatedAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'created_at' => 'setCreatedAt', + 'export_name' => 'setExportName', + 'export_state' => 'setExportState', + 'export_type' => 'setExportType', + 'id' => 'setId', + 'object_properties' => 'setObjectProperties', + 'object_type' => 'setObjectType', + 'record_count' => 'setRecordCount', + 'updated_at' => 'setUpdatedAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'created_at' => 'getCreatedAt', + 'export_name' => 'getExportName', + 'export_state' => 'getExportState', + 'export_type' => 'getExportType', + 'id' => 'getId', + 'object_properties' => 'getObjectProperties', + 'object_type' => 'getObjectType', + 'record_count' => 'getRecordCount', + 'updated_at' => 'getUpdatedAt' + ]; + + /** + * 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 EXPORT_STATE_CANCELED = 'CANCELED'; + public const EXPORT_STATE_CONFLICT = 'CONFLICT'; + public const EXPORT_STATE_DEFERRED = 'DEFERRED'; + public const EXPORT_STATE_DELETED = 'DELETED'; + public const EXPORT_STATE_DONE = 'DONE'; + public const EXPORT_STATE_ENQUEUED = 'ENQUEUED'; + public const EXPORT_STATE_FAILED = 'FAILED'; + public const EXPORT_STATE_PENDING_APPROVAL = 'PENDING_APPROVAL'; + public const EXPORT_STATE_PROCESSING = 'PROCESSING'; + public const EXPORT_TYPE__LIST = 'LIST'; + public const EXPORT_TYPE_VIEW = 'VIEW'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExportStateAllowableValues() + { + return [ + self::EXPORT_STATE_CANCELED, + self::EXPORT_STATE_CONFLICT, + self::EXPORT_STATE_DEFERRED, + self::EXPORT_STATE_DELETED, + self::EXPORT_STATE_DONE, + self::EXPORT_STATE_ENQUEUED, + self::EXPORT_STATE_FAILED, + self::EXPORT_STATE_PENDING_APPROVAL, + self::EXPORT_STATE_PROCESSING, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getExportTypeAllowableValues() + { + return [ + self::EXPORT_TYPE__LIST, + self::EXPORT_TYPE_VIEW, + ]; + } + + /** + * 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('created_at', $data ?? [], null); + $this->setIfExists('export_name', $data ?? [], null); + $this->setIfExists('export_state', $data ?? [], null); + $this->setIfExists('export_type', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('object_properties', $data ?? [], null); + $this->setIfExists('object_type', $data ?? [], null); + $this->setIfExists('record_count', $data ?? [], null); + $this->setIfExists('updated_at', $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['created_at'] === null) { + $invalidProperties[] = "'created_at' can't be null"; + } + if ($this->container['export_state'] === null) { + $invalidProperties[] = "'export_state' can't be null"; + } + $allowedValues = $this->getExportStateAllowableValues(); + if (!is_null($this->container['export_state']) && !in_array($this->container['export_state'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'export_state', must be one of '%s'", + $this->container['export_state'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['export_type'] === null) { + $invalidProperties[] = "'export_type' can't be null"; + } + $allowedValues = $this->getExportTypeAllowableValues(); + if (!is_null($this->container['export_type']) && !in_array($this->container['export_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'export_type', must be one of '%s'", + $this->container['export_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['object_properties'] === null) { + $invalidProperties[] = "'object_properties' can't be null"; + } + if ($this->container['object_type'] === null) { + $invalidProperties[] = "'object_type' can't be null"; + } + if ($this->container['updated_at'] === null) { + $invalidProperties[] = "'updated_at' 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 created_at + * + * @return \DateTime + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime $created_at The timestamp when the export was created, in ISO 8601 format. + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets export_name + * + * @return string|null + */ + public function getExportName() + { + return $this->container['export_name']; + } + + /** + * Sets export_name + * + * @param string|null $export_name The name assigned to the export. + * + * @return self + */ + public function setExportName($export_name) + { + if (is_null($export_name)) { + throw new \InvalidArgumentException('non-nullable export_name cannot be null'); + } + $this->container['export_name'] = $export_name; + + return $this; + } + + /** + * Gets export_state + * + * @return string + */ + public function getExportState() + { + return $this->container['export_state']; + } + + /** + * Sets export_state + * + * @param string $export_state The current state of the export process. + * + * @return self + */ + public function setExportState($export_state) + { + if (is_null($export_state)) { + throw new \InvalidArgumentException('non-nullable export_state cannot be null'); + } + $allowedValues = $this->getExportStateAllowableValues(); + if (!in_array($export_state, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'export_state', must be one of '%s'", + $export_state, + implode("', '", $allowedValues) + ) + ); + } + $this->container['export_state'] = $export_state; + + return $this; + } + + /** + * Gets export_type + * + * @return string + */ + public function getExportType() + { + return $this->container['export_type']; + } + + /** + * Sets export_type + * + * @param string $export_type The type of export, which can be either VIEW or LIST. + * + * @return self + */ + public function setExportType($export_type) + { + if (is_null($export_type)) { + throw new \InvalidArgumentException('non-nullable export_type cannot be null'); + } + $allowedValues = $this->getExportTypeAllowableValues(); + if (!in_array($export_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'export_type', must be one of '%s'", + $export_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['export_type'] = $export_type; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The unique ID of the export. + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets object_properties + * + * @return string[] + */ + public function getObjectProperties() + { + return $this->container['object_properties']; + } + + /** + * Sets object_properties + * + * @param string[] $object_properties The list of properties exported for the associated object. + * + * @return self + */ + public function setObjectProperties($object_properties) + { + if (is_null($object_properties)) { + throw new \InvalidArgumentException('non-nullable object_properties cannot be null'); + } + $this->container['object_properties'] = $object_properties; + + return $this; + } + + /** + * Gets object_type + * + * @return string + */ + public function getObjectType() + { + return $this->container['object_type']; + } + + /** + * Sets object_type + * + * @param string $object_type The associated CRM object being exported. + * + * @return self + */ + public function setObjectType($object_type) + { + if (is_null($object_type)) { + throw new \InvalidArgumentException('non-nullable object_type cannot be null'); + } + $this->container['object_type'] = $object_type; + + return $this; + } + + /** + * Gets record_count + * + * @return int|null + */ + public function getRecordCount() + { + return $this->container['record_count']; + } + + /** + * Sets record_count + * + * @param int|null $record_count The total number of records included in the export. + * + * @return self + */ + public function setRecordCount($record_count) + { + if (is_null($record_count)) { + throw new \InvalidArgumentException('non-nullable record_count cannot be null'); + } + $this->container['record_count'] = $record_count; + + return $this; + } + + /** + * Gets updated_at + * + * @return \DateTime + */ + public function getUpdatedAt() + { + return $this->container['updated_at']; + } + + /** + * Sets updated_at + * + * @param \DateTime $updated_at The timestamp when the export was last updated, in ISO 8601 format. + * + * @return self + */ + public function setUpdatedAt($updated_at) + { + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + } + $this->container['updated_at'] = $updated_at; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer|string $offset Offset + * + * @return boolean + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $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|string $offset Offset + * + * @return void + */ + public function offsetUnset(mixed $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/Exports/Model/PublicExportViewRequest.php b/codegen/Crm/Exports/Model/PublicExportViewRequest.php index fbd19cd5..9ccb2bca 100644 --- a/codegen/Crm/Exports/Model/PublicExportViewRequest.php +++ b/codegen/Crm/Exports/Model/PublicExportViewRequest.php @@ -2,7 +2,7 @@ /** * PublicExportViewRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Exports @@ -13,11 +13,11 @@ /** * CRM Exports * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -61,7 +61,9 @@ class PublicExportViewRequest implements ModelInterface, ArrayAccess, \JsonSeria 'format' => 'string', 'export_name' => 'string', 'object_properties' => 'string[]', - 'associated_object_type' => 'string', + 'associated_object_type' => 'string[]', + 'include_labeled_associations' => 'bool', + 'include_primary_display_property_for_associated_objects' => 'bool', 'object_type' => 'string', 'language' => 'string', 'export_internal_values_options' => 'string[]', @@ -83,6 +85,8 @@ class PublicExportViewRequest implements ModelInterface, ArrayAccess, \JsonSeria 'export_name' => null, 'object_properties' => null, 'associated_object_type' => null, + 'include_labeled_associations' => null, + 'include_primary_display_property_for_associated_objects' => null, 'object_type' => null, 'language' => null, 'export_internal_values_options' => null, @@ -102,6 +106,8 @@ class PublicExportViewRequest implements ModelInterface, ArrayAccess, \JsonSeria 'export_name' => false, 'object_properties' => false, 'associated_object_type' => false, + 'include_labeled_associations' => false, + 'include_primary_display_property_for_associated_objects' => false, 'object_type' => false, 'language' => false, 'export_internal_values_options' => false, @@ -201,6 +207,8 @@ public function isNullableSetToNull(string $property): bool 'export_name' => 'exportName', 'object_properties' => 'objectProperties', 'associated_object_type' => 'associatedObjectType', + 'include_labeled_associations' => 'includeLabeledAssociations', + 'include_primary_display_property_for_associated_objects' => 'includePrimaryDisplayPropertyForAssociatedObjects', 'object_type' => 'objectType', 'language' => 'language', 'export_internal_values_options' => 'exportInternalValuesOptions', @@ -220,6 +228,8 @@ public function isNullableSetToNull(string $property): bool 'export_name' => 'setExportName', 'object_properties' => 'setObjectProperties', 'associated_object_type' => 'setAssociatedObjectType', + 'include_labeled_associations' => 'setIncludeLabeledAssociations', + 'include_primary_display_property_for_associated_objects' => 'setIncludePrimaryDisplayPropertyForAssociatedObjects', 'object_type' => 'setObjectType', 'language' => 'setLanguage', 'export_internal_values_options' => 'setExportInternalValuesOptions', @@ -239,6 +249,8 @@ public function isNullableSetToNull(string $property): bool 'export_name' => 'getExportName', 'object_properties' => 'getObjectProperties', 'associated_object_type' => 'getAssociatedObjectType', + 'include_labeled_associations' => 'getIncludeLabeledAssociations', + 'include_primary_display_property_for_associated_objects' => 'getIncludePrimaryDisplayPropertyForAssociatedObjects', 'object_type' => 'getObjectType', 'language' => 'getLanguage', 'export_internal_values_options' => 'getExportInternalValuesOptions', @@ -393,6 +405,8 @@ public function __construct(?array $data = null) $this->setIfExists('export_name', $data ?? [], null); $this->setIfExists('object_properties', $data ?? [], null); $this->setIfExists('associated_object_type', $data ?? [], null); + $this->setIfExists('include_labeled_associations', $data ?? [], null); + $this->setIfExists('include_primary_display_property_for_associated_objects', $data ?? [], null); $this->setIfExists('object_type', $data ?? [], null); $this->setIfExists('language', $data ?? [], null); $this->setIfExists('export_internal_values_options', $data ?? [], null); @@ -458,6 +472,15 @@ public function listInvalidProperties() if ($this->container['object_properties'] === null) { $invalidProperties[] = "'object_properties' can't be null"; } + if ($this->container['associated_object_type'] === null) { + $invalidProperties[] = "'associated_object_type' can't be null"; + } + if ($this->container['include_labeled_associations'] === null) { + $invalidProperties[] = "'include_labeled_associations' can't be null"; + } + if ($this->container['include_primary_display_property_for_associated_objects'] === null) { + $invalidProperties[] = "'include_primary_display_property_for_associated_objects' can't be null"; + } if ($this->container['object_type'] === null) { $invalidProperties[] = "'object_type' can't be null"; } @@ -628,7 +651,7 @@ public function setObjectProperties($object_properties) /** * Gets associated_object_type * - * @return string|null + * @return string[] */ public function getAssociatedObjectType() { @@ -638,7 +661,7 @@ public function getAssociatedObjectType() /** * Sets associated_object_type * - * @param string|null $associated_object_type associated_object_type + * @param string[] $associated_object_type associated_object_type * * @return self */ @@ -652,6 +675,60 @@ public function setAssociatedObjectType($associated_object_type) return $this; } + /** + * Gets include_labeled_associations + * + * @return bool + */ + public function getIncludeLabeledAssociations() + { + return $this->container['include_labeled_associations']; + } + + /** + * Sets include_labeled_associations + * + * @param bool $include_labeled_associations include_labeled_associations + * + * @return self + */ + public function setIncludeLabeledAssociations($include_labeled_associations) + { + if (is_null($include_labeled_associations)) { + throw new \InvalidArgumentException('non-nullable include_labeled_associations cannot be null'); + } + $this->container['include_labeled_associations'] = $include_labeled_associations; + + return $this; + } + + /** + * Gets include_primary_display_property_for_associated_objects + * + * @return bool + */ + public function getIncludePrimaryDisplayPropertyForAssociatedObjects() + { + return $this->container['include_primary_display_property_for_associated_objects']; + } + + /** + * Sets include_primary_display_property_for_associated_objects + * + * @param bool $include_primary_display_property_for_associated_objects include_primary_display_property_for_associated_objects + * + * @return self + */ + public function setIncludePrimaryDisplayPropertyForAssociatedObjects($include_primary_display_property_for_associated_objects) + { + if (is_null($include_primary_display_property_for_associated_objects)) { + throw new \InvalidArgumentException('non-nullable include_primary_display_property_for_associated_objects cannot be null'); + } + $this->container['include_primary_display_property_for_associated_objects'] = $include_primary_display_property_for_associated_objects; + + return $this; + } + /** * Gets object_type * @@ -835,11 +912,11 @@ public function setListId($list_id) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -847,12 +924,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -877,11 +954,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Exports/Model/StandardError.php b/codegen/Crm/Exports/Model/StandardError.php index 6300ce12..fe7164fc 100644 --- a/codegen/Crm/Exports/Model/StandardError.php +++ b/codegen/Crm/Exports/Model/StandardError.php @@ -2,7 +2,7 @@ /** * StandardError * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Exports @@ -13,11 +13,11 @@ /** * CRM Exports * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -35,6 +35,7 @@ * StandardError Class Doc Comment * * @category Class + * @description Ye olde error * @package HubSpot\Client\Crm\Exports * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,14 +58,14 @@ class StandardError implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'object', + 'category' => 'string', 'context' => 'array', - 'links' => 'array', + 'errors' => '\HubSpot\Client\Crm\Exports\Model\ErrorDetail[]', 'id' => 'string', - 'category' => 'string', + 'links' => 'array', 'message' => 'string', - 'errors' => '\HubSpot\Client\Crm\Exports\Model\ErrorDetail[]', - 'status' => 'string' + 'status' => 'string', + 'sub_category' => 'object' ]; /** @@ -75,14 +76,14 @@ class StandardError implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'sub_category' => null, + 'category' => null, 'context' => null, - 'links' => null, + 'errors' => null, 'id' => null, - 'category' => null, + 'links' => null, 'message' => null, - 'errors' => null, - 'status' => null + 'status' => null, + 'sub_category' => null ]; /** @@ -91,14 +92,14 @@ class StandardError implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'sub_category' => false, + 'category' => false, 'context' => false, - 'links' => false, + 'errors' => false, 'id' => false, - 'category' => false, + 'links' => false, 'message' => false, - 'errors' => false, - 'status' => false + 'status' => false, + 'sub_category' => false ]; /** @@ -187,14 +188,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'sub_category' => 'subCategory', + 'category' => 'category', 'context' => 'context', - 'links' => 'links', + 'errors' => 'errors', 'id' => 'id', - 'category' => 'category', + 'links' => 'links', 'message' => 'message', - 'errors' => 'errors', - 'status' => 'status' + 'status' => 'status', + 'sub_category' => 'subCategory' ]; /** @@ -203,14 +204,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'sub_category' => 'setSubCategory', + 'category' => 'setCategory', 'context' => 'setContext', - 'links' => 'setLinks', + 'errors' => 'setErrors', 'id' => 'setId', - 'category' => 'setCategory', + 'links' => 'setLinks', 'message' => 'setMessage', - 'errors' => 'setErrors', - 'status' => 'setStatus' + 'status' => 'setStatus', + 'sub_category' => 'setSubCategory' ]; /** @@ -219,14 +220,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'sub_category' => 'getSubCategory', + 'category' => 'getCategory', 'context' => 'getContext', - 'links' => 'getLinks', + 'errors' => 'getErrors', 'id' => 'getId', - 'category' => 'getCategory', + 'links' => 'getLinks', 'message' => 'getMessage', - 'errors' => 'getErrors', - 'status' => 'getStatus' + 'status' => 'getStatus', + 'sub_category' => 'getSubCategory' ]; /** @@ -286,14 +287,14 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('sub_category', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); - $this->setIfExists('links', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); - $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('links', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('sub_category', $data ?? [], null); } /** @@ -323,21 +324,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['category'] === null) { + $invalidProperties[] = "'category' can't be null"; + } if ($this->container['context'] === null) { $invalidProperties[] = "'context' can't be null"; } + if ($this->container['errors'] === null) { + $invalidProperties[] = "'errors' can't be null"; + } if ($this->container['links'] === null) { $invalidProperties[] = "'links' can't be null"; } - if ($this->container['category'] === null) { - $invalidProperties[] = "'category' can't be null"; - } if ($this->container['message'] === null) { $invalidProperties[] = "'message' can't be null"; } - if ($this->container['errors'] === null) { - $invalidProperties[] = "'errors' can't be null"; - } if ($this->container['status'] === null) { $invalidProperties[] = "'status' can't be null"; } @@ -357,28 +358,28 @@ public function valid() /** - * Gets sub_category + * Gets category * - * @return object|null + * @return string */ - public function getSubCategory() + public function getCategory() { - return $this->container['sub_category']; + return $this->container['category']; } /** - * Sets sub_category + * Sets category * - * @param object|null $sub_category sub_category + * @param string $category The main category of the error. * * @return self */ - public function setSubCategory($sub_category) + public function setCategory($category) { - if (is_null($sub_category)) { - throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); + if (is_null($category)) { + throw new \InvalidArgumentException('non-nullable category cannot be null'); } - $this->container['sub_category'] = $sub_category; + $this->container['category'] = $category; return $this; } @@ -396,7 +397,7 @@ public function getContext() /** * Sets context * - * @param array $context context + * @param array $context Additional context-specific information related to the error. * * @return self */ @@ -411,28 +412,28 @@ public function setContext($context) } /** - * Gets links + * Gets errors * - * @return array + * @return \HubSpot\Client\Crm\Exports\Model\ErrorDetail[] */ - public function getLinks() + public function getErrors() { - return $this->container['links']; + return $this->container['errors']; } /** - * Sets links + * Sets errors * - * @param array $links links + * @param \HubSpot\Client\Crm\Exports\Model\ErrorDetail[] $errors The detailed error objects. * * @return self */ - public function setLinks($links) + public function setErrors($errors) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['links'] = $links; + $this->container['errors'] = $errors; return $this; } @@ -450,7 +451,7 @@ public function getId() /** * Sets id * - * @param string|null $id id + * @param string|null $id A unique ID for the error instance. * * @return self */ @@ -465,28 +466,28 @@ public function setId($id) } /** - * Gets category + * Gets links * - * @return string + * @return array */ - public function getCategory() + public function getLinks() { - return $this->container['category']; + return $this->container['links']; } /** - * Sets category + * Sets links * - * @param string $category category + * @param array $links URLs linking to documentation or resources associated with the error. * * @return self */ - public function setCategory($category) + public function setLinks($links) { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['category'] = $category; + $this->container['links'] = $links; return $this; } @@ -504,7 +505,7 @@ public function getMessage() /** * Sets message * - * @param string $message message + * @param string $message A human-readable string describing the error and possible remediation steps. * * @return self */ @@ -519,66 +520,66 @@ public function setMessage($message) } /** - * Gets errors + * Gets status * - * @return \HubSpot\Client\Crm\Exports\Model\ErrorDetail[] + * @return string */ - public function getErrors() + public function getStatus() { - return $this->container['errors']; + return $this->container['status']; } /** - * Sets errors + * Sets status * - * @param \HubSpot\Client\Crm\Exports\Model\ErrorDetail[] $errors errors + * @param string $status The HTTP status code associated with the error. * * @return self */ - public function setErrors($errors) + public function setStatus($status) { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); } - $this->container['errors'] = $errors; + $this->container['status'] = $status; return $this; } /** - * Gets status + * Gets sub_category * - * @return string + * @return object|null */ - public function getStatus() + public function getSubCategory() { - return $this->container['status']; + return $this->container['sub_category']; } /** - * Sets status + * Sets sub_category * - * @param string $status status + * @param object|null $sub_category A more specific error category within each main category. * * @return self */ - public function setStatus($status) + public function setSubCategory($sub_category) { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['status'] = $status; + $this->container['sub_category'] = $sub_category; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -586,12 +587,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -616,11 +617,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Exports/Model/TaskLocator.php b/codegen/Crm/Exports/Model/TaskLocator.php index 2f1bdf6a..f767a109 100644 --- a/codegen/Crm/Exports/Model/TaskLocator.php +++ b/codegen/Crm/Exports/Model/TaskLocator.php @@ -2,7 +2,7 @@ /** * TaskLocator * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Exports @@ -13,11 +13,11 @@ /** * CRM Exports * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,8 +57,8 @@ class TaskLocator implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'links' => 'array', - 'id' => 'string' + 'id' => 'string', + 'links' => 'array' ]; /** @@ -69,8 +69,8 @@ class TaskLocator implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'links' => null, - 'id' => null + 'id' => null, + 'links' => null ]; /** @@ -79,8 +79,8 @@ class TaskLocator implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'links' => false, - 'id' => false + 'id' => false, + 'links' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'links' => 'links', - 'id' => 'id' + 'id' => 'id', + 'links' => 'links' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'links' => 'setLinks', - 'id' => 'setId' + 'id' => 'setId', + 'links' => 'setLinks' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'links' => 'getLinks', - 'id' => 'getId' + 'id' => 'getId', + 'links' => 'getLinks' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('links', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('links', $data ?? [], null); } /** @@ -300,66 +300,66 @@ public function valid() /** - * Gets links + * Gets id * - * @return array|null + * @return string */ - public function getLinks() + public function getId() { - return $this->container['links']; + return $this->container['id']; } /** - * Sets links + * Sets id * - * @param array|null $links links + * @param string $id The unique ID of the export. * * @return self */ - public function setLinks($links) + public function setId($id) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['links'] = $links; + $this->container['id'] = $id; return $this; } /** - * Gets id + * Gets links * - * @return string + * @return array|null */ - public function getId() + public function getLinks() { - return $this->container['id']; + return $this->container['links']; } /** - * Sets id + * Sets links * - * @param string $id id + * @param array|null $links An object containing relevant links related to the export process. * * @return self */ - public function setId($id) + public function setLinks($links) { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['id'] = $id; + $this->container['links'] = $links; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -367,12 +367,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -397,11 +397,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Crm/Exports/ObjectSerializer.php b/codegen/Crm/Exports/ObjectSerializer.php index 415f1f42..ca4f4856 100644 --- a/codegen/Crm/Exports/ObjectSerializer.php +++ b/codegen/Crm/Exports/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Exports @@ -13,11 +13,11 @@ /** * CRM Exports * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -323,24 +323,6 @@ public static function toHeaderValue($value) return self::toString($value); } - /** - * Take value and turn it into a string suitable for inclusion in - * the http body (form parameter). If it's a string, pass through unchanged - * If it's a datetime object, format it in ISO8601 - * - * @param string|\SplFileObject $value the value of the form parameter - * - * @return string the form string - */ - public static function toFormValue($value) - { - if ($value instanceof \SplFileObject) { - return $value->getRealPath(); - } else { - return self::toString($value); - } - } - /** * Take value and turn it into a string suitable for inclusion in * the parameter. If it's a string, pass through unchanged @@ -612,6 +594,6 @@ public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): } } - return $qs ? (string) substr($qs, 0, -1) : ''; + return $qs ? substr($qs, 0, -1) : ''; } }