diff --git a/codegen/Crm/Lists/Api/MappingApi.php b/codegen/Crm/Lists/Api/IDMappingApi.php similarity index 75% rename from codegen/Crm/Lists/Api/MappingApi.php rename to codegen/Crm/Lists/Api/IDMappingApi.php index 17190f36c..bf6fcbd59 100644 --- a/codegen/Crm/Lists/Api/MappingApi.php +++ b/codegen/Crm/Lists/Api/IDMappingApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\Model\PublicMigrationMapping' !== '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\Lists\Model\PublicMigrationMapping', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\PublicMigrationMapping', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Lists\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\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\Lists\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -252,34 +215,11 @@ public function translateLegacyListIdToListIdWithHttpInfo($legacy_list_id = null ); } - $returnType = '\HubSpot\Client\Crm\Lists\Model\PublicMigrationMapping'; - 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\Lists\Model\PublicMigrationMapping', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -289,7 +229,7 @@ public function translateLegacyListIdToListIdWithHttpInfo($legacy_list_id = null $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -297,8 +237,10 @@ public function translateLegacyListIdToListIdWithHttpInfo($legacy_list_id = null $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -526,61 +468,21 @@ public function translateLegacyListIdToListIdBatchWithHttpInfo($request_body, st switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Lists\Model\PublicBatchMigrationMapping' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\Model\PublicBatchMigrationMapping' !== '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\Lists\Model\PublicBatchMigrationMapping', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\PublicBatchMigrationMapping', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Lists\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\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\Lists\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -594,34 +496,11 @@ public function translateLegacyListIdToListIdBatchWithHttpInfo($request_body, st ); } - $returnType = '\HubSpot\Client\Crm\Lists\Model\PublicBatchMigrationMapping'; - 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\Lists\Model\PublicBatchMigrationMapping', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -631,7 +510,7 @@ public function translateLegacyListIdToListIdBatchWithHttpInfo($request_body, st $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -639,8 +518,10 @@ public function translateLegacyListIdToListIdBatchWithHttpInfo($request_body, st $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -829,6 +710,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/Lists/Api/JoinOrderApi.php b/codegen/Crm/Lists/Api/JoinOrderApi.php new file mode 100644 index 000000000..4f66d9691 --- /dev/null +++ b/codegen/Crm/Lists/Api/JoinOrderApi.php @@ -0,0 +1,528 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation getPageOrderedByAddedToListDate + * + * Fetch List Memberships Ordered by Added to List Date + * + * @param string $list_id The **ILS ID** of the list. (required) + * @param string|null $after The paging offset token for the page that comes `after` the previously requested records. If provided, then the records in the response will be the records following the offset, sorted in *ascending* order. Takes precedence over the `before` offset. (optional) + * @param string|null $before The paging offset token for the page that comes `before` the previously requested records. If provided, then the records in the response will be the records preceding the offset, sorted in *descending* order. (optional) + * @param int|null $limit The number of records to return in the response. The maximum `limit` is 250. (optional, default to 100) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPageOrderedByAddedToListDate'] to see the possible values for this operation + * + * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \HubSpot\Client\Crm\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId|\HubSpot\Client\Crm\Lists\Model\Error + */ + public function getPageOrderedByAddedToListDate($list_id, $after = null, $before = null, $limit = 100, string $contentType = self::contentTypes['getPageOrderedByAddedToListDate'][0]) + { + list($response) = $this->getPageOrderedByAddedToListDateWithHttpInfo($list_id, $after, $before, $limit, $contentType); + return $response; + } + + /** + * Operation getPageOrderedByAddedToListDateWithHttpInfo + * + * Fetch List Memberships Ordered by Added to List Date + * + * @param string $list_id The **ILS ID** of the list. (required) + * @param string|null $after The paging offset token for the page that comes `after` the previously requested records. If provided, then the records in the response will be the records following the offset, sorted in *ascending* order. Takes precedence over the `before` offset. (optional) + * @param string|null $before The paging offset token for the page that comes `before` the previously requested records. If provided, then the records in the response will be the records preceding the offset, sorted in *descending* order. (optional) + * @param int|null $limit The number of records to return in the response. The maximum `limit` is 250. (optional, default to 100) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPageOrderedByAddedToListDate'] to see the possible values for this operation + * + * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \HubSpot\Client\Crm\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId|\HubSpot\Client\Crm\Lists\Model\Error, HTTP status code, HTTP response headers (array of strings) + */ + public function getPageOrderedByAddedToListDateWithHttpInfo($list_id, $after = null, $before = null, $limit = 100, string $contentType = self::contentTypes['getPageOrderedByAddedToListDate'][0]) + { + $request = $this->getPageOrderedByAddedToListDateRequest($list_id, $after, $before, $limit, $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\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId', + $request, + $response, + ); + default: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\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\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\HubSpot\Client\Crm\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\HubSpot\Client\Crm\Lists\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getPageOrderedByAddedToListDateAsync + * + * Fetch List Memberships Ordered by Added to List Date + * + * @param string $list_id The **ILS ID** of the list. (required) + * @param string|null $after The paging offset token for the page that comes `after` the previously requested records. If provided, then the records in the response will be the records following the offset, sorted in *ascending* order. Takes precedence over the `before` offset. (optional) + * @param string|null $before The paging offset token for the page that comes `before` the previously requested records. If provided, then the records in the response will be the records preceding the offset, sorted in *descending* order. (optional) + * @param int|null $limit The number of records to return in the response. The maximum `limit` is 250. (optional, default to 100) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPageOrderedByAddedToListDate'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPageOrderedByAddedToListDateAsync($list_id, $after = null, $before = null, $limit = 100, string $contentType = self::contentTypes['getPageOrderedByAddedToListDate'][0]) + { + return $this->getPageOrderedByAddedToListDateAsyncWithHttpInfo($list_id, $after, $before, $limit, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getPageOrderedByAddedToListDateAsyncWithHttpInfo + * + * Fetch List Memberships Ordered by Added to List Date + * + * @param string $list_id The **ILS ID** of the list. (required) + * @param string|null $after The paging offset token for the page that comes `after` the previously requested records. If provided, then the records in the response will be the records following the offset, sorted in *ascending* order. Takes precedence over the `before` offset. (optional) + * @param string|null $before The paging offset token for the page that comes `before` the previously requested records. If provided, then the records in the response will be the records preceding the offset, sorted in *descending* order. (optional) + * @param int|null $limit The number of records to return in the response. The maximum `limit` is 250. (optional, default to 100) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPageOrderedByAddedToListDate'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getPageOrderedByAddedToListDateAsyncWithHttpInfo($list_id, $after = null, $before = null, $limit = 100, string $contentType = self::contentTypes['getPageOrderedByAddedToListDate'][0]) + { + $returnType = '\HubSpot\Client\Crm\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId'; + $request = $this->getPageOrderedByAddedToListDateRequest($list_id, $after, $before, $limit, $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 'getPageOrderedByAddedToListDate' + * + * @param string $list_id The **ILS ID** of the list. (required) + * @param string|null $after The paging offset token for the page that comes `after` the previously requested records. If provided, then the records in the response will be the records following the offset, sorted in *ascending* order. Takes precedence over the `before` offset. (optional) + * @param string|null $before The paging offset token for the page that comes `before` the previously requested records. If provided, then the records in the response will be the records preceding the offset, sorted in *descending* order. (optional) + * @param int|null $limit The number of records to return in the response. The maximum `limit` is 250. (optional, default to 100) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPageOrderedByAddedToListDate'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getPageOrderedByAddedToListDateRequest($list_id, $after = null, $before = null, $limit = 100, string $contentType = self::contentTypes['getPageOrderedByAddedToListDate'][0]) + { + + // verify the required parameter 'list_id' is set + if ($list_id === null || (is_array($list_id) && count($list_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $list_id when calling getPageOrderedByAddedToListDate' + ); + } + + + + + + $resourcePath = '/crm/v3/lists/{listId}/memberships/join-order'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $after, + 'after', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $before, + 'before', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $limit, + 'limit', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + // path params + if ($list_id !== null) { + $resourcePath = str_replace( + '{' . 'listId' . '}', + ObjectSerializer::toPathValue($list_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 + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + 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/Lists/Api/FoldersApi.php b/codegen/Crm/Lists/Api/ListManagementApi.php similarity index 51% rename from codegen/Crm/Lists/Api/FoldersApi.php rename to codegen/Crm/Lists/Api/ListManagementApi.php index e325959d0..6c2e1a4d8 100644 --- a/codegen/Crm/Lists/Api/FoldersApi.php +++ b/codegen/Crm/Lists/Api/ListManagementApi.php @@ -1,7 +1,7 @@ [ + 'cancelConversion' => [ 'application/json', ], - 'getAll' => [ + 'createFolder' => [ 'application/json', ], - 'move' => [ + 'getConversionDetails' => [ 'application/json', ], - 'moveList' => [ + 'getFolder' => [ 'application/json', ], - 'remove' => [ + 'moveFolder' => [ 'application/json', ], - 'rename' => [ + 'moveListToFolder' => [ + 'application/json', + ], + 'removeFolder' => [ + 'application/json', + ], + 'renameFolder' => [ + 'application/json', + ], + 'scheduleOrUpdateConversion' => [ 'application/json', ], ]; @@ -138,38 +150,37 @@ public function getConfig() } /** - * Operation create + * Operation cancelConversion * - * Creates a folder + * Cancel the conversion of a list * - * @param \HubSpot\Client\Crm\Lists\Model\ListFolderCreateRequest $list_folder_create_request list_folder_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation + * @param string $list_id The ID of the list that you want to cancel the conversion for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelConversion'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Lists\Model\ListFolderCreateResponse|\HubSpot\Client\Crm\Lists\Model\Error + * @return void */ - public function create($list_folder_create_request, string $contentType = self::contentTypes['create'][0]) + public function cancelConversion($list_id, string $contentType = self::contentTypes['cancelConversion'][0]) { - list($response) = $this->createWithHttpInfo($list_folder_create_request, $contentType); - return $response; + $this->cancelConversionWithHttpInfo($list_id, $contentType); } /** - * Operation createWithHttpInfo + * Operation cancelConversionWithHttpInfo * - * Creates a folder + * Cancel the conversion of a list * - * @param \HubSpot\Client\Crm\Lists\Model\ListFolderCreateRequest $list_folder_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation + * @param string $list_id The ID of the list that you want to cancel the conversion for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelConversion'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Lists\Model\ListFolderCreateResponse|\HubSpot\Client\Crm\Lists\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function createWithHttpInfo($list_folder_create_request, string $contentType = self::contentTypes['create'][0]) + public function cancelConversionWithHttpInfo($list_id, string $contentType = self::contentTypes['cancelConversion'][0]) { - $request = $this->createRequest($list_folder_create_request, $contentType); + $request = $this->cancelConversionRequest($list_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -194,114 +205,9 @@ public function createWithHttpInfo($list_folder_create_request, string $contentT $statusCode = $response->getStatusCode(); - switch($statusCode) { - case 200: - if ('\HubSpot\Client\Crm\Lists\Model\ListFolderCreateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\Model\ListFolderCreateResponse' !== '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\Lists\Model\ListFolderCreateResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - default: - if ('\HubSpot\Client\Crm\Lists\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\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\Lists\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - $returnType = '\HubSpot\Client\Crm\Lists\Model\ListFolderCreateResponse'; - 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 [null, $statusCode, $response->getHeaders()]; } catch (ApiException $e) { switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Lists\Model\ListFolderCreateResponse', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -309,26 +215,28 @@ public function createWithHttpInfo($list_folder_create_request, string $contentT $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation createAsync + * Operation cancelConversionAsync * - * Creates a folder + * Cancel the conversion of a list * - * @param \HubSpot\Client\Crm\Lists\Model\ListFolderCreateRequest $list_folder_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation + * @param string $list_id The ID of the list that you want to cancel the conversion for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelConversion'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createAsync($list_folder_create_request, string $contentType = self::contentTypes['create'][0]) + public function cancelConversionAsync($list_id, string $contentType = self::contentTypes['cancelConversion'][0]) { - return $this->createAsyncWithHttpInfo($list_folder_create_request, $contentType) + return $this->cancelConversionAsyncWithHttpInfo($list_id, $contentType) ->then( function ($response) { return $response[0]; @@ -337,39 +245,26 @@ function ($response) { } /** - * Operation createAsyncWithHttpInfo + * Operation cancelConversionAsyncWithHttpInfo * - * Creates a folder + * Cancel the conversion of a list * - * @param \HubSpot\Client\Crm\Lists\Model\ListFolderCreateRequest $list_folder_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation + * @param string $list_id The ID of the list that you want to cancel the conversion for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelConversion'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function createAsyncWithHttpInfo($list_folder_create_request, string $contentType = self::contentTypes['create'][0]) + public function cancelConversionAsyncWithHttpInfo($list_id, string $contentType = self::contentTypes['cancelConversion'][0]) { - $returnType = '\HubSpot\Client\Crm\Lists\Model\ListFolderCreateResponse'; - $request = $this->createRequest($list_folder_create_request, $contentType); + $returnType = ''; + $request = $this->cancelConversionRequest($list_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() - ]; + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -389,26 +284,26 @@ function ($exception) { } /** - * Create request for operation 'create' + * Create request for operation 'cancelConversion' * - * @param \HubSpot\Client\Crm\Lists\Model\ListFolderCreateRequest $list_folder_create_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['create'] to see the possible values for this operation + * @param string $list_id The ID of the list that you want to cancel the conversion for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cancelConversion'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function createRequest($list_folder_create_request, string $contentType = self::contentTypes['create'][0]) + public function cancelConversionRequest($list_id, string $contentType = self::contentTypes['cancelConversion'][0]) { - // verify the required parameter 'list_folder_create_request' is set - if ($list_folder_create_request === null || (is_array($list_folder_create_request) && count($list_folder_create_request) === 0)) { + // verify the required parameter 'list_id' is set + if ($list_id === null || (is_array($list_id) && count($list_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $list_folder_create_request when calling create' + 'Missing the required parameter $list_id when calling cancelConversion' ); } - $resourcePath = '/crm/v3/lists/folders'; + $resourcePath = '/crm/v3/lists/{listId}/schedule-conversion'; $formParams = []; $queryParams = []; $headerParams = []; @@ -417,23 +312,24 @@ public function createRequest($list_folder_create_request, string $contentType = + // path params + if ($list_id !== null) { + $resourcePath = str_replace( + '{' . 'listId' . '}', + ObjectSerializer::toPathValue($list_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( - ['application/json', '*/*', ], + ['*/*', ], $contentType, $multipart ); // for model (json/xml) - if (isset($list_folder_create_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($list_folder_create_request)); - } else { - $httpBody = $list_folder_create_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -476,7 +372,7 @@ public function createRequest($list_folder_create_request, string $contentType = $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'POST', + 'DELETE', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -484,38 +380,38 @@ public function createRequest($list_folder_create_request, string $contentType = } /** - * Operation getAll + * Operation createFolder * - * Retrieves a folder. + * Creates a folder * - * @param string|null $folder_id The Id of the folder to retrieve. (optional, default to '0') - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAll'] to see the possible values for this operation + * @param \HubSpot\Client\Crm\Lists\Model\ListFolderCreateRequest $list_folder_create_request list_folder_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFolder'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse|\HubSpot\Client\Crm\Lists\Model\Error + * @return \HubSpot\Client\Crm\Lists\Model\ListFolderCreateResponse|\HubSpot\Client\Crm\Lists\Model\Error */ - public function getAll($folder_id = '0', string $contentType = self::contentTypes['getAll'][0]) + public function createFolder($list_folder_create_request, string $contentType = self::contentTypes['createFolder'][0]) { - list($response) = $this->getAllWithHttpInfo($folder_id, $contentType); + list($response) = $this->createFolderWithHttpInfo($list_folder_create_request, $contentType); return $response; } /** - * Operation getAllWithHttpInfo + * Operation createFolderWithHttpInfo * - * Retrieves a folder. + * Creates a folder * - * @param string|null $folder_id The Id of the folder to retrieve. (optional, default to '0') - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAll'] to see the possible values for this operation + * @param \HubSpot\Client\Crm\Lists\Model\ListFolderCreateRequest $list_folder_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFolder'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse|\HubSpot\Client\Crm\Lists\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Lists\Model\ListFolderCreateResponse|\HubSpot\Client\Crm\Lists\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function getAllWithHttpInfo($folder_id = '0', string $contentType = self::contentTypes['getAll'][0]) + public function createFolderWithHttpInfo($list_folder_create_request, string $contentType = self::contentTypes['createFolder'][0]) { - $request = $this->getAllRequest($folder_id, $contentType); + $request = $this->createFolderRequest($list_folder_create_request, $contentType); try { $options = $this->createHttpClientOption(); @@ -542,61 +438,21 @@ public function getAllWithHttpInfo($folder_id = '0', string $contentType = self: switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse' !== '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\Lists\Model\ListFolderFetchResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\ListFolderCreateResponse', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Lists\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\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\Lists\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -610,44 +466,21 @@ public function getAllWithHttpInfo($folder_id = '0', string $contentType = self: ); } - $returnType = '\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse'; - 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\Lists\Model\ListFolderCreateResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse', + '\HubSpot\Client\Crm\Lists\Model\ListFolderCreateResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -655,26 +488,28 @@ public function getAllWithHttpInfo($folder_id = '0', string $contentType = self: $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation getAllAsync + * Operation createFolderAsync * - * Retrieves a folder. + * Creates a folder * - * @param string|null $folder_id The Id of the folder to retrieve. (optional, default to '0') - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAll'] to see the possible values for this operation + * @param \HubSpot\Client\Crm\Lists\Model\ListFolderCreateRequest $list_folder_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAllAsync($folder_id = '0', string $contentType = self::contentTypes['getAll'][0]) + public function createFolderAsync($list_folder_create_request, string $contentType = self::contentTypes['createFolder'][0]) { - return $this->getAllAsyncWithHttpInfo($folder_id, $contentType) + return $this->createFolderAsyncWithHttpInfo($list_folder_create_request, $contentType) ->then( function ($response) { return $response[0]; @@ -683,20 +518,20 @@ function ($response) { } /** - * Operation getAllAsyncWithHttpInfo + * Operation createFolderAsyncWithHttpInfo * - * Retrieves a folder. + * Creates a folder * - * @param string|null $folder_id The Id of the folder to retrieve. (optional, default to '0') - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAll'] to see the possible values for this operation + * @param \HubSpot\Client\Crm\Lists\Model\ListFolderCreateRequest $list_folder_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAllAsyncWithHttpInfo($folder_id = '0', string $contentType = self::contentTypes['getAll'][0]) + public function createFolderAsyncWithHttpInfo($list_folder_create_request, string $contentType = self::contentTypes['createFolder'][0]) { - $returnType = '\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse'; - $request = $this->getAllRequest($folder_id, $contentType); + $returnType = '\HubSpot\Client\Crm\Lists\Model\ListFolderCreateResponse'; + $request = $this->createFolderRequest($list_folder_create_request, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -735,17 +570,23 @@ function ($exception) { } /** - * Create request for operation 'getAll' + * Create request for operation 'createFolder' * - * @param string|null $folder_id The Id of the folder to retrieve. (optional, default to '0') - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAll'] to see the possible values for this operation + * @param \HubSpot\Client\Crm\Lists\Model\ListFolderCreateRequest $list_folder_create_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['createFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getAllRequest($folder_id = '0', string $contentType = self::contentTypes['getAll'][0]) + public function createFolderRequest($list_folder_create_request, string $contentType = self::contentTypes['createFolder'][0]) { + // verify the required parameter 'list_folder_create_request' is set + if ($list_folder_create_request === null || (is_array($list_folder_create_request) && count($list_folder_create_request) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $list_folder_create_request when calling createFolder' + ); + } $resourcePath = '/crm/v3/lists/folders'; @@ -755,15 +596,6 @@ public function getAllRequest($folder_id = '0', string $contentType = self::cont $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $folder_id, - 'folderId', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); @@ -775,7 +607,14 @@ public function getAllRequest($folder_id = '0', string $contentType = self::cont ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($list_folder_create_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($list_folder_create_request)); + } else { + $httpBody = $list_folder_create_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -818,7 +657,7 @@ public function getAllRequest($folder_id = '0', string $contentType = self::cont $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'GET', + 'POST', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -826,40 +665,38 @@ public function getAllRequest($folder_id = '0', string $contentType = self::cont } /** - * Operation move + * Operation getConversionDetails * - * Moves a folder + * Retrieve the conversion details for a list * - * @param string $folder_id (required) - * @param string $new_parent_folder_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['move'] to see the possible values for this operation + * @param string $list_id The ID of the list to schedule the conversion for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConversionDetails'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse|\HubSpot\Client\Crm\Lists\Model\Error + * @return \HubSpot\Client\Crm\Lists\Model\PublicListConversionResponse|\HubSpot\Client\Crm\Lists\Model\Error */ - public function move($folder_id, $new_parent_folder_id, string $contentType = self::contentTypes['move'][0]) + public function getConversionDetails($list_id, string $contentType = self::contentTypes['getConversionDetails'][0]) { - list($response) = $this->moveWithHttpInfo($folder_id, $new_parent_folder_id, $contentType); + list($response) = $this->getConversionDetailsWithHttpInfo($list_id, $contentType); return $response; } /** - * Operation moveWithHttpInfo + * Operation getConversionDetailsWithHttpInfo * - * Moves a folder + * Retrieve the conversion details for a list * - * @param string $folder_id (required) - * @param string $new_parent_folder_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['move'] to see the possible values for this operation + * @param string $list_id The ID of the list to schedule the conversion for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConversionDetails'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse|\HubSpot\Client\Crm\Lists\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Lists\Model\PublicListConversionResponse|\HubSpot\Client\Crm\Lists\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function moveWithHttpInfo($folder_id, $new_parent_folder_id, string $contentType = self::contentTypes['move'][0]) + public function getConversionDetailsWithHttpInfo($list_id, string $contentType = self::contentTypes['getConversionDetails'][0]) { - $request = $this->moveRequest($folder_id, $new_parent_folder_id, $contentType); + $request = $this->getConversionDetailsRequest($list_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -886,61 +723,21 @@ public function moveWithHttpInfo($folder_id, $new_parent_folder_id, string $cont switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse' !== '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\Lists\Model\ListFolderFetchResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\PublicListConversionResponse', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Lists\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\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\Lists\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -954,44 +751,21 @@ public function moveWithHttpInfo($folder_id, $new_parent_folder_id, string $cont ); } - $returnType = '\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse'; - 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\Lists\Model\PublicListConversionResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse', + '\HubSpot\Client\Crm\Lists\Model\PublicListConversionResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -999,27 +773,28 @@ public function moveWithHttpInfo($folder_id, $new_parent_folder_id, string $cont $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation moveAsync + * Operation getConversionDetailsAsync * - * Moves a folder + * Retrieve the conversion details for a list * - * @param string $folder_id (required) - * @param string $new_parent_folder_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['move'] to see the possible values for this operation + * @param string $list_id The ID of the list to schedule the conversion for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConversionDetails'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function moveAsync($folder_id, $new_parent_folder_id, string $contentType = self::contentTypes['move'][0]) + public function getConversionDetailsAsync($list_id, string $contentType = self::contentTypes['getConversionDetails'][0]) { - return $this->moveAsyncWithHttpInfo($folder_id, $new_parent_folder_id, $contentType) + return $this->getConversionDetailsAsyncWithHttpInfo($list_id, $contentType) ->then( function ($response) { return $response[0]; @@ -1028,21 +803,20 @@ function ($response) { } /** - * Operation moveAsyncWithHttpInfo + * Operation getConversionDetailsAsyncWithHttpInfo * - * Moves a folder + * Retrieve the conversion details for a list * - * @param string $folder_id (required) - * @param string $new_parent_folder_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['move'] to see the possible values for this operation + * @param string $list_id The ID of the list to schedule the conversion for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConversionDetails'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function moveAsyncWithHttpInfo($folder_id, $new_parent_folder_id, string $contentType = self::contentTypes['move'][0]) + public function getConversionDetailsAsyncWithHttpInfo($list_id, string $contentType = self::contentTypes['getConversionDetails'][0]) { - $returnType = '\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse'; - $request = $this->moveRequest($folder_id, $new_parent_folder_id, $contentType); + $returnType = '\HubSpot\Client\Crm\Lists\Model\PublicListConversionResponse'; + $request = $this->getConversionDetailsRequest($list_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1057,11 +831,828 @@ function ($response) use ($returnType) { } } - return [ - ObjectSerializer::deserialize($content, $returnType, []), - $response->getStatusCode(), - $response->getHeaders() - ]; + 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 'getConversionDetails' + * + * @param string $list_id The ID of the list to schedule the conversion for. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getConversionDetails'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getConversionDetailsRequest($list_id, string $contentType = self::contentTypes['getConversionDetails'][0]) + { + + // verify the required parameter 'list_id' is set + if ($list_id === null || (is_array($list_id) && count($list_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $list_id when calling getConversionDetails' + ); + } + + + $resourcePath = '/crm/v3/lists/{listId}/schedule-conversion'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($list_id !== null) { + $resourcePath = str_replace( + '{' . 'listId' . '}', + ObjectSerializer::toPathValue($list_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 getFolder + * + * Retrieves a folder. + * + * @param string|null $folder_id The Id of the folder to retrieve. (optional, default to '0') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolder'] to see the possible values for this operation + * + * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse|\HubSpot\Client\Crm\Lists\Model\Error + */ + public function getFolder($folder_id = '0', string $contentType = self::contentTypes['getFolder'][0]) + { + list($response) = $this->getFolderWithHttpInfo($folder_id, $contentType); + return $response; + } + + /** + * Operation getFolderWithHttpInfo + * + * Retrieves a folder. + * + * @param string|null $folder_id The Id of the folder to retrieve. (optional, default to '0') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolder'] to see the possible values for this operation + * + * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse|\HubSpot\Client\Crm\Lists\Model\Error, HTTP status code, HTTP response headers (array of strings) + */ + public function getFolderWithHttpInfo($folder_id = '0', string $contentType = self::contentTypes['getFolder'][0]) + { + $request = $this->getFolderRequest($folder_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\Lists\Model\ListFolderFetchResponse', + $request, + $response, + ); + default: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\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\Lists\Model\ListFolderFetchResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\HubSpot\Client\Crm\Lists\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation getFolderAsync + * + * Retrieves a folder. + * + * @param string|null $folder_id The Id of the folder to retrieve. (optional, default to '0') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolder'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFolderAsync($folder_id = '0', string $contentType = self::contentTypes['getFolder'][0]) + { + return $this->getFolderAsyncWithHttpInfo($folder_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation getFolderAsyncWithHttpInfo + * + * Retrieves a folder. + * + * @param string|null $folder_id The Id of the folder to retrieve. (optional, default to '0') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolder'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function getFolderAsyncWithHttpInfo($folder_id = '0', string $contentType = self::contentTypes['getFolder'][0]) + { + $returnType = '\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse'; + $request = $this->getFolderRequest($folder_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 'getFolder' + * + * @param string|null $folder_id The Id of the folder to retrieve. (optional, default to '0') + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getFolder'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function getFolderRequest($folder_id = '0', string $contentType = self::contentTypes['getFolder'][0]) + { + + + + $resourcePath = '/crm/v3/lists/folders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $folder_id, + 'folderId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $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 moveFolder + * + * Moves a folder + * + * @param string $folder_id The ID of the folder to move (required) + * @param string $new_parent_folder_id The ID for the target parent folder. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveFolder'] to see the possible values for this operation + * + * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse|\HubSpot\Client\Crm\Lists\Model\Error + */ + public function moveFolder($folder_id, $new_parent_folder_id, string $contentType = self::contentTypes['moveFolder'][0]) + { + list($response) = $this->moveFolderWithHttpInfo($folder_id, $new_parent_folder_id, $contentType); + return $response; + } + + /** + * Operation moveFolderWithHttpInfo + * + * Moves a folder + * + * @param string $folder_id The ID of the folder to move (required) + * @param string $new_parent_folder_id The ID for the target parent folder. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveFolder'] to see the possible values for this operation + * + * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse|\HubSpot\Client\Crm\Lists\Model\Error, HTTP status code, HTTP response headers (array of strings) + */ + public function moveFolderWithHttpInfo($folder_id, $new_parent_folder_id, string $contentType = self::contentTypes['moveFolder'][0]) + { + $request = $this->moveFolderRequest($folder_id, $new_parent_folder_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\Lists\Model\ListFolderFetchResponse', + $request, + $response, + ); + default: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\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\Lists\Model\ListFolderFetchResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\HubSpot\Client\Crm\Lists\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation moveFolderAsync + * + * Moves a folder + * + * @param string $folder_id The ID of the folder to move (required) + * @param string $new_parent_folder_id The ID for the target parent folder. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveFolder'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function moveFolderAsync($folder_id, $new_parent_folder_id, string $contentType = self::contentTypes['moveFolder'][0]) + { + return $this->moveFolderAsyncWithHttpInfo($folder_id, $new_parent_folder_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation moveFolderAsyncWithHttpInfo + * + * Moves a folder + * + * @param string $folder_id The ID of the folder to move (required) + * @param string $new_parent_folder_id The ID for the target parent folder. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveFolder'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function moveFolderAsyncWithHttpInfo($folder_id, $new_parent_folder_id, string $contentType = self::contentTypes['moveFolder'][0]) + { + $returnType = '\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse'; + $request = $this->moveFolderRequest($folder_id, $new_parent_folder_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 'moveFolder' + * + * @param string $folder_id The ID of the folder to move (required) + * @param string $new_parent_folder_id The ID for the target parent folder. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveFolder'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function moveFolderRequest($folder_id, $new_parent_folder_id, string $contentType = self::contentTypes['moveFolder'][0]) + { + + // verify the required parameter 'folder_id' is set + if ($folder_id === null || (is_array($folder_id) && count($folder_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $folder_id when calling moveFolder' + ); + } + + // verify the required parameter 'new_parent_folder_id' is set + if ($new_parent_folder_id === null || (is_array($new_parent_folder_id) && count($new_parent_folder_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $new_parent_folder_id when calling moveFolder' + ); + } + + + $resourcePath = '/crm/v3/lists/folders/{folderId}/move/{newParentFolderId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($folder_id !== null) { + $resourcePath = str_replace( + '{' . 'folderId' . '}', + ObjectSerializer::toPathValue($folder_id), + $resourcePath + ); + } + // path params + if ($new_parent_folder_id !== null) { + $resourcePath = str_replace( + '{' . 'newParentFolderId' . '}', + ObjectSerializer::toPathValue($new_parent_folder_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( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation moveListToFolder + * + * Moves a list to a given folder + * + * @param \HubSpot\Client\Crm\Lists\Model\ListMoveRequest $list_move_request list_move_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveListToFolder'] to see the possible values for this operation + * + * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function moveListToFolder($list_move_request, string $contentType = self::contentTypes['moveListToFolder'][0]) + { + $this->moveListToFolderWithHttpInfo($list_move_request, $contentType); + } + + /** + * Operation moveListToFolderWithHttpInfo + * + * Moves a list to a given folder + * + * @param \HubSpot\Client\Crm\Lists\Model\ListMoveRequest $list_move_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveListToFolder'] to see the possible values for this operation + * + * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function moveListToFolderWithHttpInfo($list_move_request, string $contentType = self::contentTypes['moveListToFolder'][0]) + { + $request = $this->moveListToFolderRequest($list_move_request, $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(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\HubSpot\Client\Crm\Lists\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation moveListToFolderAsync + * + * Moves a list to a given folder + * + * @param \HubSpot\Client\Crm\Lists\Model\ListMoveRequest $list_move_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveListToFolder'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function moveListToFolderAsync($list_move_request, string $contentType = self::contentTypes['moveListToFolder'][0]) + { + return $this->moveListToFolderAsyncWithHttpInfo($list_move_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation moveListToFolderAsyncWithHttpInfo + * + * Moves a list to a given folder + * + * @param \HubSpot\Client\Crm\Lists\Model\ListMoveRequest $list_move_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveListToFolder'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function moveListToFolderAsyncWithHttpInfo($list_move_request, string $contentType = self::contentTypes['moveListToFolder'][0]) + { + $returnType = ''; + $request = $this->moveListToFolderRequest($list_move_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; }, function ($exception) { $response = $exception->getResponse(); @@ -1081,34 +1672,26 @@ function ($exception) { } /** - * Create request for operation 'move' + * Create request for operation 'moveListToFolder' * - * @param string $folder_id (required) - * @param string $new_parent_folder_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['move'] to see the possible values for this operation + * @param \HubSpot\Client\Crm\Lists\Model\ListMoveRequest $list_move_request (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveListToFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function moveRequest($folder_id, $new_parent_folder_id, string $contentType = self::contentTypes['move'][0]) + public function moveListToFolderRequest($list_move_request, string $contentType = self::contentTypes['moveListToFolder'][0]) { - // verify the required parameter 'folder_id' is set - if ($folder_id === null || (is_array($folder_id) && count($folder_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $folder_id when calling move' - ); - } - - // verify the required parameter 'new_parent_folder_id' is set - if ($new_parent_folder_id === null || (is_array($new_parent_folder_id) && count($new_parent_folder_id) === 0)) { + // verify the required parameter 'list_move_request' is set + if ($list_move_request === null || (is_array($list_move_request) && count($list_move_request) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $new_parent_folder_id when calling move' + 'Missing the required parameter $list_move_request when calling moveListToFolder' ); } - $resourcePath = '/crm/v3/lists/folders/{folderId}/move/{newParentFolderId}'; + $resourcePath = '/crm/v3/lists/folders/move-list'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1117,32 +1700,23 @@ public function moveRequest($folder_id, $new_parent_folder_id, string $contentTy - // path params - if ($folder_id !== null) { - $resourcePath = str_replace( - '{' . 'folderId' . '}', - ObjectSerializer::toPathValue($folder_id), - $resourcePath - ); - } - // path params - if ($new_parent_folder_id !== null) { - $resourcePath = str_replace( - '{' . 'newParentFolderId' . '}', - ObjectSerializer::toPathValue($new_parent_folder_id), - $resourcePath - ); - } $headers = $this->headerSelector->selectHeaders( - ['application/json', '*/*', ], + ['*/*', ], $contentType, $multipart ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($list_move_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($list_move_request)); + } else { + $httpBody = $list_move_request; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -1193,37 +1767,37 @@ public function moveRequest($folder_id, $new_parent_folder_id, string $contentTy } /** - * Operation moveList + * Operation removeFolder * - * Moves a list to a given folder + * Deletes a folder * - * @param \HubSpot\Client\Crm\Lists\Model\ListMoveRequest $list_move_request list_move_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveList'] to see the possible values for this operation + * @param string $folder_id The ID of the folder to delete (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeFolder'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return void */ - public function moveList($list_move_request, string $contentType = self::contentTypes['moveList'][0]) + public function removeFolder($folder_id, string $contentType = self::contentTypes['removeFolder'][0]) { - $this->moveListWithHttpInfo($list_move_request, $contentType); + $this->removeFolderWithHttpInfo($folder_id, $contentType); } /** - * Operation moveListWithHttpInfo + * Operation removeFolderWithHttpInfo * - * Moves a list to a given folder + * Deletes a folder * - * @param \HubSpot\Client\Crm\Lists\Model\ListMoveRequest $list_move_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveList'] to see the possible values for this operation + * @param string $folder_id The ID of the folder to delete (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeFolder'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of null, HTTP status code, HTTP response headers (array of strings) */ - public function moveListWithHttpInfo($list_move_request, string $contentType = self::contentTypes['moveList'][0]) + public function removeFolderWithHttpInfo($folder_id, string $contentType = self::contentTypes['removeFolder'][0]) { - $request = $this->moveListRequest($list_move_request, $contentType); + $request = $this->removeFolderRequest($folder_id, $contentType); try { $options = $this->createHttpClientOption(); @@ -1249,7 +1823,6 @@ public function moveListWithHttpInfo($list_move_request, string $contentType = s return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -1259,26 +1832,28 @@ public function moveListWithHttpInfo($list_move_request, string $contentType = s $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation moveListAsync + * Operation removeFolderAsync * - * Moves a list to a given folder + * Deletes a folder * - * @param \HubSpot\Client\Crm\Lists\Model\ListMoveRequest $list_move_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveList'] to see the possible values for this operation + * @param string $folder_id The ID of the folder to delete (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function moveListAsync($list_move_request, string $contentType = self::contentTypes['moveList'][0]) + public function removeFolderAsync($folder_id, string $contentType = self::contentTypes['removeFolder'][0]) { - return $this->moveListAsyncWithHttpInfo($list_move_request, $contentType) + return $this->removeFolderAsyncWithHttpInfo($folder_id, $contentType) ->then( function ($response) { return $response[0]; @@ -1287,20 +1862,20 @@ function ($response) { } /** - * Operation moveListAsyncWithHttpInfo + * Operation removeFolderAsyncWithHttpInfo * - * Moves a list to a given folder + * Deletes a folder * - * @param \HubSpot\Client\Crm\Lists\Model\ListMoveRequest $list_move_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveList'] to see the possible values for this operation + * @param string $folder_id The ID of the folder to delete (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function moveListAsyncWithHttpInfo($list_move_request, string $contentType = self::contentTypes['moveList'][0]) + public function removeFolderAsyncWithHttpInfo($folder_id, string $contentType = self::contentTypes['removeFolder'][0]) { $returnType = ''; - $request = $this->moveListRequest($list_move_request, $contentType); + $request = $this->removeFolderRequest($folder_id, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1326,26 +1901,26 @@ function ($exception) { } /** - * Create request for operation 'moveList' + * Create request for operation 'removeFolder' * - * @param \HubSpot\Client\Crm\Lists\Model\ListMoveRequest $list_move_request (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['moveList'] to see the possible values for this operation + * @param string $folder_id The ID of the folder to delete (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function moveListRequest($list_move_request, string $contentType = self::contentTypes['moveList'][0]) + public function removeFolderRequest($folder_id, string $contentType = self::contentTypes['removeFolder'][0]) { - // verify the required parameter 'list_move_request' is set - if ($list_move_request === null || (is_array($list_move_request) && count($list_move_request) === 0)) { + // verify the required parameter 'folder_id' is set + if ($folder_id === null || (is_array($folder_id) && count($folder_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $list_move_request when calling moveList' + 'Missing the required parameter $folder_id when calling removeFolder' ); } - $resourcePath = '/crm/v3/lists/folders/move-list'; + $resourcePath = '/crm/v3/lists/folders/{folderId}'; $formParams = []; $queryParams = []; $headerParams = []; @@ -1354,6 +1929,14 @@ public function moveListRequest($list_move_request, string $contentType = self:: + // path params + if ($folder_id !== null) { + $resourcePath = str_replace( + '{' . 'folderId' . '}', + ObjectSerializer::toPathValue($folder_id), + $resourcePath + ); + } $headers = $this->headerSelector->selectHeaders( @@ -1363,14 +1946,7 @@ public function moveListRequest($list_move_request, string $contentType = self:: ); // for model (json/xml) - if (isset($list_move_request)) { - if (stripos($headers['Content-Type'], 'application/json') !== false) { - # if Content-Type contains "application/json", json_encode the body - $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($list_move_request)); - } else { - $httpBody = $list_move_request; - } - } elseif (count($formParams) > 0) { + if (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -1413,7 +1989,7 @@ public function moveListRequest($list_move_request, string $contentType = self:: $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'PUT', + 'DELETE', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1421,37 +1997,40 @@ public function moveListRequest($list_move_request, string $contentType = self:: } /** - * Operation remove + * Operation renameFolder * - * Deletes a folder + * Rename a folder * - * @param string $folder_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['remove'] to see the possible values for this operation + * @param string $folder_id The ID of the folder to rename (required) + * @param string|null $new_folder_name The new name of the folder. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['renameFolder'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return void + * @return \HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse|\HubSpot\Client\Crm\Lists\Model\Error */ - public function remove($folder_id, string $contentType = self::contentTypes['remove'][0]) + public function renameFolder($folder_id, $new_folder_name = null, string $contentType = self::contentTypes['renameFolder'][0]) { - $this->removeWithHttpInfo($folder_id, $contentType); + list($response) = $this->renameFolderWithHttpInfo($folder_id, $new_folder_name, $contentType); + return $response; } /** - * Operation removeWithHttpInfo + * Operation renameFolderWithHttpInfo * - * Deletes a folder + * Rename a folder * - * @param string $folder_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['remove'] to see the possible values for this operation + * @param string $folder_id The ID of the folder to rename (required) + * @param string|null $new_folder_name The new name of the folder. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['renameFolder'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of null, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse|\HubSpot\Client\Crm\Lists\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function removeWithHttpInfo($folder_id, string $contentType = self::contentTypes['remove'][0]) + public function renameFolderWithHttpInfo($folder_id, $new_folder_name = null, string $contentType = self::contentTypes['renameFolder'][0]) { - $request = $this->removeRequest($folder_id, $contentType); + $request = $this->renameFolderRequest($folder_id, $new_folder_name, $contentType); try { $options = $this->createHttpClientOption(); @@ -1476,10 +2055,51 @@ public function removeWithHttpInfo($folder_id, string $contentType = self::conte $statusCode = $response->getStatusCode(); - return [null, $statusCode, $response->getHeaders()]; + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse', + $request, + $response, + ); + default: + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\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\Lists\Model\ListFolderFetchResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1487,26 +2107,29 @@ public function removeWithHttpInfo($folder_id, string $contentType = self::conte $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation removeAsync + * Operation renameFolderAsync * - * Deletes a folder + * Rename a folder * - * @param string $folder_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['remove'] to see the possible values for this operation + * @param string $folder_id The ID of the folder to rename (required) + * @param string|null $new_folder_name The new name of the folder. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['renameFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function removeAsync($folder_id, string $contentType = self::contentTypes['remove'][0]) + public function renameFolderAsync($folder_id, $new_folder_name = null, string $contentType = self::contentTypes['renameFolder'][0]) { - return $this->removeAsyncWithHttpInfo($folder_id, $contentType) + return $this->renameFolderAsyncWithHttpInfo($folder_id, $new_folder_name, $contentType) ->then( function ($response) { return $response[0]; @@ -1515,26 +2138,40 @@ function ($response) { } /** - * Operation removeAsyncWithHttpInfo + * Operation renameFolderAsyncWithHttpInfo * - * Deletes a folder + * Rename a folder * - * @param string $folder_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['remove'] to see the possible values for this operation + * @param string $folder_id The ID of the folder to rename (required) + * @param string|null $new_folder_name The new name of the folder. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['renameFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function removeAsyncWithHttpInfo($folder_id, string $contentType = self::contentTypes['remove'][0]) + public function renameFolderAsyncWithHttpInfo($folder_id, $new_folder_name = null, string $contentType = self::contentTypes['renameFolder'][0]) { - $returnType = ''; - $request = $this->removeRequest($folder_id, $contentType); + $returnType = '\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse'; + $request = $this->renameFolderRequest($folder_id, $new_folder_name, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) ->then( function ($response) use ($returnType) { - return [null, $response->getStatusCode(), $response->getHeaders()]; + 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(); @@ -1554,32 +2191,43 @@ function ($exception) { } /** - * Create request for operation 'remove' + * Create request for operation 'renameFolder' * - * @param string $folder_id (required) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['remove'] to see the possible values for this operation + * @param string $folder_id The ID of the folder to rename (required) + * @param string|null $new_folder_name The new name of the folder. (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['renameFolder'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function removeRequest($folder_id, string $contentType = self::contentTypes['remove'][0]) + public function renameFolderRequest($folder_id, $new_folder_name = null, string $contentType = self::contentTypes['renameFolder'][0]) { // verify the required parameter 'folder_id' is set if ($folder_id === null || (is_array($folder_id) && count($folder_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $folder_id when calling remove' + 'Missing the required parameter $folder_id when calling renameFolder' ); } - $resourcePath = '/crm/v3/lists/folders/{folderId}'; + + $resourcePath = '/crm/v3/lists/folders/{folderId}/rename'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $new_folder_name, + 'newFolderName', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); // path params @@ -1593,7 +2241,7 @@ public function removeRequest($folder_id, string $contentType = self::contentTyp $headers = $this->headerSelector->selectHeaders( - ['*/*', ], + ['application/json', '*/*', ], $contentType, $multipart ); @@ -1642,7 +2290,7 @@ public function removeRequest($folder_id, string $contentType = self::contentTyp $operationHost = $this->config->getHost(); $query = ObjectSerializer::buildQuery($queryParams); return new Request( - 'DELETE', + 'PUT', $operationHost . $resourcePath . ($query ? "?{$query}" : ''), $headers, $httpBody @@ -1650,40 +2298,40 @@ public function removeRequest($folder_id, string $contentType = self::contentTyp } /** - * Operation rename + * Operation scheduleOrUpdateConversion * - * Rename a folder + * Schedule or update the conversion of a list to static * - * @param string $folder_id (required) - * @param string|null $new_folder_name (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rename'] to see the possible values for this operation + * @param string $list_id The ID of the list to schedule the conversion for. (required) + * @param \HubSpot\Client\Crm\Lists\Model\PublicListConversionTime $public_list_conversion_time public_list_conversion_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleOrUpdateConversion'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse|\HubSpot\Client\Crm\Lists\Model\Error + * @return \HubSpot\Client\Crm\Lists\Model\PublicListConversionResponse|\HubSpot\Client\Crm\Lists\Model\Error */ - public function rename($folder_id, $new_folder_name = null, string $contentType = self::contentTypes['rename'][0]) + public function scheduleOrUpdateConversion($list_id, $public_list_conversion_time, string $contentType = self::contentTypes['scheduleOrUpdateConversion'][0]) { - list($response) = $this->renameWithHttpInfo($folder_id, $new_folder_name, $contentType); + list($response) = $this->scheduleOrUpdateConversionWithHttpInfo($list_id, $public_list_conversion_time, $contentType); return $response; } /** - * Operation renameWithHttpInfo + * Operation scheduleOrUpdateConversionWithHttpInfo * - * Rename a folder + * Schedule or update the conversion of a list to static * - * @param string $folder_id (required) - * @param string|null $new_folder_name (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rename'] to see the possible values for this operation + * @param string $list_id The ID of the list to schedule the conversion for. (required) + * @param \HubSpot\Client\Crm\Lists\Model\PublicListConversionTime $public_list_conversion_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleOrUpdateConversion'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse|\HubSpot\Client\Crm\Lists\Model\Error, HTTP status code, HTTP response headers (array of strings) + * @return array of \HubSpot\Client\Crm\Lists\Model\PublicListConversionResponse|\HubSpot\Client\Crm\Lists\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function renameWithHttpInfo($folder_id, $new_folder_name = null, string $contentType = self::contentTypes['rename'][0]) + public function scheduleOrUpdateConversionWithHttpInfo($list_id, $public_list_conversion_time, string $contentType = self::contentTypes['scheduleOrUpdateConversion'][0]) { - $request = $this->renameRequest($folder_id, $new_folder_name, $contentType); + $request = $this->scheduleOrUpdateConversionRequest($list_id, $public_list_conversion_time, $contentType); try { $options = $this->createHttpClientOption(); @@ -1710,61 +2358,21 @@ public function renameWithHttpInfo($folder_id, $new_folder_name = null, string $ switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse' !== '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\Lists\Model\ListFolderFetchResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\PublicListConversionResponse', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Lists\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\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\Lists\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1778,44 +2386,21 @@ public function renameWithHttpInfo($folder_id, $new_folder_name = null, string $ ); } - $returnType = '\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse'; - 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\Lists\Model\PublicListConversionResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: $data = ObjectSerializer::deserialize( $e->getResponseBody(), - '\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse', + '\HubSpot\Client\Crm\Lists\Model\PublicListConversionResponse', $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1823,27 +2408,29 @@ public function renameWithHttpInfo($folder_id, $new_folder_name = null, string $ $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } /** - * Operation renameAsync + * Operation scheduleOrUpdateConversionAsync * - * Rename a folder + * Schedule or update the conversion of a list to static * - * @param string $folder_id (required) - * @param string|null $new_folder_name (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rename'] to see the possible values for this operation + * @param string $list_id The ID of the list to schedule the conversion for. (required) + * @param \HubSpot\Client\Crm\Lists\Model\PublicListConversionTime $public_list_conversion_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleOrUpdateConversion'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function renameAsync($folder_id, $new_folder_name = null, string $contentType = self::contentTypes['rename'][0]) + public function scheduleOrUpdateConversionAsync($list_id, $public_list_conversion_time, string $contentType = self::contentTypes['scheduleOrUpdateConversion'][0]) { - return $this->renameAsyncWithHttpInfo($folder_id, $new_folder_name, $contentType) + return $this->scheduleOrUpdateConversionAsyncWithHttpInfo($list_id, $public_list_conversion_time, $contentType) ->then( function ($response) { return $response[0]; @@ -1852,21 +2439,21 @@ function ($response) { } /** - * Operation renameAsyncWithHttpInfo + * Operation scheduleOrUpdateConversionAsyncWithHttpInfo * - * Rename a folder + * Schedule or update the conversion of a list to static * - * @param string $folder_id (required) - * @param string|null $new_folder_name (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rename'] to see the possible values for this operation + * @param string $list_id The ID of the list to schedule the conversion for. (required) + * @param \HubSpot\Client\Crm\Lists\Model\PublicListConversionTime $public_list_conversion_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleOrUpdateConversion'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function renameAsyncWithHttpInfo($folder_id, $new_folder_name = null, string $contentType = self::contentTypes['rename'][0]) + public function scheduleOrUpdateConversionAsyncWithHttpInfo($list_id, $public_list_conversion_time, string $contentType = self::contentTypes['scheduleOrUpdateConversion'][0]) { - $returnType = '\HubSpot\Client\Crm\Lists\Model\ListFolderFetchResponse'; - $request = $this->renameRequest($folder_id, $new_folder_name, $contentType); + $returnType = '\HubSpot\Client\Crm\Lists\Model\PublicListConversionResponse'; + $request = $this->scheduleOrUpdateConversionRequest($list_id, $public_list_conversion_time, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -1905,50 +2492,47 @@ function ($exception) { } /** - * Create request for operation 'rename' + * Create request for operation 'scheduleOrUpdateConversion' * - * @param string $folder_id (required) - * @param string|null $new_folder_name (optional) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['rename'] to see the possible values for this operation + * @param string $list_id The ID of the list to schedule the conversion for. (required) + * @param \HubSpot\Client\Crm\Lists\Model\PublicListConversionTime $public_list_conversion_time (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['scheduleOrUpdateConversion'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function renameRequest($folder_id, $new_folder_name = null, string $contentType = self::contentTypes['rename'][0]) + public function scheduleOrUpdateConversionRequest($list_id, $public_list_conversion_time, string $contentType = self::contentTypes['scheduleOrUpdateConversion'][0]) { - // verify the required parameter 'folder_id' is set - if ($folder_id === null || (is_array($folder_id) && count($folder_id) === 0)) { + // verify the required parameter 'list_id' is set + if ($list_id === null || (is_array($list_id) && count($list_id) === 0)) { throw new \InvalidArgumentException( - 'Missing the required parameter $folder_id when calling rename' + 'Missing the required parameter $list_id when calling scheduleOrUpdateConversion' ); } + // verify the required parameter 'public_list_conversion_time' is set + if ($public_list_conversion_time === null || (is_array($public_list_conversion_time) && count($public_list_conversion_time) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $public_list_conversion_time when calling scheduleOrUpdateConversion' + ); + } - $resourcePath = '/crm/v3/lists/folders/{folderId}/rename'; + $resourcePath = '/crm/v3/lists/{listId}/schedule-conversion'; $formParams = []; $queryParams = []; $headerParams = []; $httpBody = ''; $multipart = false; - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $new_folder_name, - 'newFolderName', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); // path params - if ($folder_id !== null) { + if ($list_id !== null) { $resourcePath = str_replace( - '{' . 'folderId' . '}', - ObjectSerializer::toPathValue($folder_id), + '{' . 'listId' . '}', + ObjectSerializer::toPathValue($list_id), $resourcePath ); } @@ -1961,7 +2545,14 @@ public function renameRequest($folder_id, $new_folder_name = null, string $conte ); // for model (json/xml) - if (count($formParams) > 0) { + if (isset($public_list_conversion_time)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($public_list_conversion_time)); + } else { + $httpBody = $public_list_conversion_time; + } + } elseif (count($formParams) > 0) { if ($multipart) { $multipartContents = []; foreach ($formParams as $formParamName => $formParamValue) { @@ -2027,6 +2618,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/Lists/Api/ListsApi.php b/codegen/Crm/Lists/Api/ListsApi.php index 9af84d456..0e5bc1c0a 100644 --- a/codegen/Crm/Lists/Api/ListsApi.php +++ b/codegen/Crm/Lists/Api/ListsApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\Model\ListCreateResponse' !== '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\Lists\Model\ListCreateResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\ListCreateResponse', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Lists\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\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\Lists\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -273,34 +236,11 @@ public function createWithHttpInfo($list_create_request, string $contentType = s ); } - $returnType = '\HubSpot\Client\Crm\Lists\Model\ListCreateResponse'; - 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\Lists\Model\ListCreateResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -310,7 +250,7 @@ public function createWithHttpInfo($list_create_request, string $contentType = s $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -318,8 +258,10 @@ public function createWithHttpInfo($list_create_request, string $contentType = s $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -497,7 +439,7 @@ public function createRequest($list_create_request, string $contentType = self:: * * Search Lists * - * @param \HubSpot\Client\Crm\Lists\Model\ListSearchRequest $list_search_request list_search_request (required) + * @param \HubSpot\Client\Crm\Lists\Model\ListSearchRequest $list_search_request The IDs of the records to add and/or remove from the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['doSearch'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format @@ -515,7 +457,7 @@ public function doSearch($list_search_request, string $contentType = self::conte * * Search Lists * - * @param \HubSpot\Client\Crm\Lists\Model\ListSearchRequest $list_search_request (required) + * @param \HubSpot\Client\Crm\Lists\Model\ListSearchRequest $list_search_request The IDs of the records to add and/or remove from the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['doSearch'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format @@ -551,61 +493,21 @@ public function doSearchWithHttpInfo($list_search_request, string $contentType = switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Lists\Model\ListSearchResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\Model\ListSearchResponse' !== '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\Lists\Model\ListSearchResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\ListSearchResponse', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Lists\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\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\Lists\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -619,34 +521,11 @@ public function doSearchWithHttpInfo($list_search_request, string $contentType = ); } - $returnType = '\HubSpot\Client\Crm\Lists\Model\ListSearchResponse'; - 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\Lists\Model\ListSearchResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -656,7 +535,7 @@ public function doSearchWithHttpInfo($list_search_request, string $contentType = $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -664,8 +543,10 @@ public function doSearchWithHttpInfo($list_search_request, string $contentType = $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -675,7 +556,7 @@ public function doSearchWithHttpInfo($list_search_request, string $contentType = * * Search Lists * - * @param \HubSpot\Client\Crm\Lists\Model\ListSearchRequest $list_search_request (required) + * @param \HubSpot\Client\Crm\Lists\Model\ListSearchRequest $list_search_request The IDs of the records to add and/or remove from the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['doSearch'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -696,7 +577,7 @@ function ($response) { * * Search Lists * - * @param \HubSpot\Client\Crm\Lists\Model\ListSearchRequest $list_search_request (required) + * @param \HubSpot\Client\Crm\Lists\Model\ListSearchRequest $list_search_request The IDs of the records to add and/or remove from the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['doSearch'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -746,7 +627,7 @@ function ($exception) { /** * Create request for operation 'doSearch' * - * @param \HubSpot\Client\Crm\Lists\Model\ListSearchRequest $list_search_request (required) + * @param \HubSpot\Client\Crm\Lists\Model\ListSearchRequest $list_search_request The IDs of the records to add and/or remove from the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['doSearch'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -899,61 +780,21 @@ public function getAllWithHttpInfo($list_ids = null, $include_filters = false, s switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Lists\Model\ListsByIdResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\Model\ListsByIdResponse' !== '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\Lists\Model\ListsByIdResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\ListsByIdResponse', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Lists\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\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\Lists\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -967,34 +808,11 @@ public function getAllWithHttpInfo($list_ids = null, $include_filters = false, s ); } - $returnType = '\HubSpot\Client\Crm\Lists\Model\ListsByIdResponse'; - 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\Lists\Model\ListsByIdResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1004,7 +822,7 @@ public function getAllWithHttpInfo($list_ids = null, $include_filters = false, s $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1012,8 +830,10 @@ public function getAllWithHttpInfo($list_ids = null, $include_filters = false, s $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1256,61 +1076,21 @@ public function getByIdWithHttpInfo($list_id, $include_filters = false, string $ switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Lists\Model\ListFetchResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\Model\ListFetchResponse' !== '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\Lists\Model\ListFetchResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\ListFetchResponse', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Lists\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\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\Lists\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1324,34 +1104,11 @@ public function getByIdWithHttpInfo($list_id, $include_filters = false, string $ ); } - $returnType = '\HubSpot\Client\Crm\Lists\Model\ListFetchResponse'; - 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\Lists\Model\ListFetchResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1361,7 +1118,7 @@ public function getByIdWithHttpInfo($list_id, $include_filters = false, string $ $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1369,8 +1126,10 @@ public function getByIdWithHttpInfo($list_id, $include_filters = false, string $ $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1620,61 +1379,21 @@ public function getByNameWithHttpInfo($list_name, $object_type_id, $include_filt switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Lists\Model\ListFetchResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\Model\ListFetchResponse' !== '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\Lists\Model\ListFetchResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\ListFetchResponse', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Lists\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\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\Lists\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1688,34 +1407,11 @@ public function getByNameWithHttpInfo($list_name, $object_type_id, $include_filt ); } - $returnType = '\HubSpot\Client\Crm\Lists\Model\ListFetchResponse'; - 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\Lists\Model\ListFetchResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1725,7 +1421,7 @@ public function getByNameWithHttpInfo($list_name, $object_type_id, $include_filt $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1733,8 +1429,10 @@ public function getByNameWithHttpInfo($list_name, $object_type_id, $include_filt $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1996,7 +1694,6 @@ public function removeWithHttpInfo($list_id, string $contentType = self::content return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -2006,8 +1703,10 @@ public function removeWithHttpInfo($list_id, string $contentType = self::content $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2225,7 +1924,6 @@ public function restoreWithHttpInfo($list_id, string $contentType = self::conten return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -2235,8 +1933,10 @@ public function restoreWithHttpInfo($list_id, string $contentType = self::conten $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2460,61 +2160,21 @@ public function updateListFiltersWithHttpInfo($list_id, $list_filter_update_requ switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Lists\Model\ListUpdateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\Model\ListUpdateResponse' !== '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\Lists\Model\ListUpdateResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\ListUpdateResponse', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Lists\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\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\Lists\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2528,34 +2188,11 @@ public function updateListFiltersWithHttpInfo($list_id, $list_filter_update_requ ); } - $returnType = '\HubSpot\Client\Crm\Lists\Model\ListUpdateResponse'; - 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\Lists\Model\ListUpdateResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2565,7 +2202,7 @@ public function updateListFiltersWithHttpInfo($list_id, $list_filter_update_requ $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2573,8 +2210,10 @@ public function updateListFiltersWithHttpInfo($list_id, $list_filter_update_requ $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2841,61 +2480,21 @@ public function updateNameWithHttpInfo($list_id, $list_name = null, $include_fil switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Lists\Model\ListUpdateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\Model\ListUpdateResponse' !== '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\Lists\Model\ListUpdateResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\ListUpdateResponse', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Lists\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\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\Lists\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2909,34 +2508,11 @@ public function updateNameWithHttpInfo($list_id, $list_name = null, $include_fil ); } - $returnType = '\HubSpot\Client\Crm\Lists\Model\ListUpdateResponse'; - 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\Lists\Model\ListUpdateResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2946,7 +2522,7 @@ public function updateNameWithHttpInfo($list_id, $list_name = null, $include_fil $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2954,8 +2530,10 @@ public function updateNameWithHttpInfo($list_id, $list_name = null, $include_fil $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -3171,6 +2749,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/Lists/Api/MembershipsApi.php b/codegen/Crm/Lists/Api/MembershipsApi.php index 71587dfa9..cac0cb206 100644 --- a/codegen/Crm/Lists/Api/MembershipsApi.php +++ b/codegen/Crm/Lists/Api/MembershipsApi.php @@ -1,7 +1,7 @@ [ 'application/json', ], - 'getPageOrderedByAddedToListDate' => [ - 'application/json', - ], 'remove' => [ 'application/json', ], @@ -149,7 +149,7 @@ public function getConfig() * Add Records to a List * * @param string $list_id The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. (required) - * @param string[] $request_body request_body (required) + * @param string[] $request_body The IDs of the records to add to the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['add'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format @@ -168,7 +168,7 @@ public function add($list_id, $request_body, string $contentType = self::content * Add Records to a List * * @param string $list_id The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. (required) - * @param string[] $request_body (required) + * @param string[] $request_body The IDs of the records to add to the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['add'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format @@ -204,61 +204,21 @@ public function addWithHttpInfo($list_id, $request_body, string $contentType = s switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Lists\Model\MembershipsUpdateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\Model\MembershipsUpdateResponse' !== '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\Lists\Model\MembershipsUpdateResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\MembershipsUpdateResponse', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Lists\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\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\Lists\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -272,34 +232,11 @@ public function addWithHttpInfo($list_id, $request_body, string $contentType = s ); } - $returnType = '\HubSpot\Client\Crm\Lists\Model\MembershipsUpdateResponse'; - 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\Lists\Model\MembershipsUpdateResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -309,7 +246,7 @@ public function addWithHttpInfo($list_id, $request_body, string $contentType = s $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -317,8 +254,10 @@ public function addWithHttpInfo($list_id, $request_body, string $contentType = s $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -329,7 +268,7 @@ public function addWithHttpInfo($list_id, $request_body, string $contentType = s * Add Records to a List * * @param string $list_id The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. (required) - * @param string[] $request_body (required) + * @param string[] $request_body The IDs of the records to add to the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['add'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -351,7 +290,7 @@ function ($response) { * Add Records to a List * * @param string $list_id The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. (required) - * @param string[] $request_body (required) + * @param string[] $request_body The IDs of the records to add to the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['add'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -402,7 +341,7 @@ function ($exception) { * Create request for operation 'add' * * @param string $list_id The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. (required) - * @param string[] $request_body (required) + * @param string[] $request_body The IDs of the records to add to the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['add'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -568,7 +507,6 @@ public function addAllFromListWithHttpInfo($list_id, $source_list_id, string $co return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -578,8 +516,10 @@ public function addAllFromListWithHttpInfo($list_id, $source_list_id, string $co $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -764,7 +704,7 @@ public function addAllFromListRequest($list_id, $source_list_id, string $content * Add and/or Remove Records from a List * * @param string $list_id The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. (required) - * @param \HubSpot\Client\Crm\Lists\Model\MembershipChangeRequest $membership_change_request membership_change_request (required) + * @param \HubSpot\Client\Crm\Lists\Model\MembershipChangeRequest $membership_change_request The IDs of the records to add and/or remove from the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addAndRemove'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format @@ -783,7 +723,7 @@ public function addAndRemove($list_id, $membership_change_request, string $conte * Add and/or Remove Records from a List * * @param string $list_id The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. (required) - * @param \HubSpot\Client\Crm\Lists\Model\MembershipChangeRequest $membership_change_request (required) + * @param \HubSpot\Client\Crm\Lists\Model\MembershipChangeRequest $membership_change_request The IDs of the records to add and/or remove from the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addAndRemove'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format @@ -819,61 +759,21 @@ public function addAndRemoveWithHttpInfo($list_id, $membership_change_request, s switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Lists\Model\MembershipsUpdateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\Model\MembershipsUpdateResponse' !== '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\Lists\Model\MembershipsUpdateResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\MembershipsUpdateResponse', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Lists\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\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\Lists\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -887,34 +787,11 @@ public function addAndRemoveWithHttpInfo($list_id, $membership_change_request, s ); } - $returnType = '\HubSpot\Client\Crm\Lists\Model\MembershipsUpdateResponse'; - 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\Lists\Model\MembershipsUpdateResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -924,7 +801,7 @@ public function addAndRemoveWithHttpInfo($list_id, $membership_change_request, s $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -932,8 +809,10 @@ public function addAndRemoveWithHttpInfo($list_id, $membership_change_request, s $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -944,7 +823,7 @@ public function addAndRemoveWithHttpInfo($list_id, $membership_change_request, s * Add and/or Remove Records from a List * * @param string $list_id The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. (required) - * @param \HubSpot\Client\Crm\Lists\Model\MembershipChangeRequest $membership_change_request (required) + * @param \HubSpot\Client\Crm\Lists\Model\MembershipChangeRequest $membership_change_request The IDs of the records to add and/or remove from the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addAndRemove'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -966,7 +845,7 @@ function ($response) { * Add and/or Remove Records from a List * * @param string $list_id The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. (required) - * @param \HubSpot\Client\Crm\Lists\Model\MembershipChangeRequest $membership_change_request (required) + * @param \HubSpot\Client\Crm\Lists\Model\MembershipChangeRequest $membership_change_request The IDs of the records to add and/or remove from the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addAndRemove'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1017,7 +896,7 @@ function ($exception) { * Create request for operation 'addAndRemove' * * @param string $list_id The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. (required) - * @param \HubSpot\Client\Crm\Lists\Model\MembershipChangeRequest $membership_change_request (required) + * @param \HubSpot\Client\Crm\Lists\Model\MembershipChangeRequest $membership_change_request The IDs of the records to add and/or remove from the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['addAndRemove'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1185,61 +1064,21 @@ public function getListsWithHttpInfo($object_type_id, $record_id, string $conten switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Lists\Model\ApiCollectionResponseRecordListMembershipNoPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\Model\ApiCollectionResponseRecordListMembershipNoPaging' !== '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\Lists\Model\ApiCollectionResponseRecordListMembershipNoPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\ApiCollectionResponseRecordListMembershipNoPaging', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Lists\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\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\Lists\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1253,34 +1092,11 @@ public function getListsWithHttpInfo($object_type_id, $record_id, string $conten ); } - $returnType = '\HubSpot\Client\Crm\Lists\Model\ApiCollectionResponseRecordListMembershipNoPaging'; - 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\Lists\Model\ApiCollectionResponseRecordListMembershipNoPaging', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1290,7 +1106,7 @@ public function getListsWithHttpInfo($object_type_id, $record_id, string $conten $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1298,8 +1114,10 @@ public function getListsWithHttpInfo($object_type_id, $record_id, string $conten $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1556,61 +1374,21 @@ public function getPageWithHttpInfo($list_id, $after = null, $before = null, $li switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId' !== '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\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Lists\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\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\Lists\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1624,34 +1402,11 @@ public function getPageWithHttpInfo($list_id, $after = null, $before = null, $li ); } - $returnType = '\HubSpot\Client\Crm\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId'; - 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\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1661,7 +1416,7 @@ public function getPageWithHttpInfo($list_id, $after = null, $before = null, $li $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1669,8 +1424,10 @@ public function getPageWithHttpInfo($list_id, $after = null, $before = null, $li $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1883,405 +1640,13 @@ public function getPageRequest($list_id, $after = null, $before = null, $limit = ); } - /** - * Operation getPageOrderedByAddedToListDate - * - * Fetch List Memberships Ordered by Added to List Date - * - * @param string $list_id The **ILS ID** of the list. (required) - * @param string|null $after The paging offset token for the page that comes `after` the previously requested records. If provided, then the records in the response will be the records following the offset, sorted in *ascending* order. Takes precedence over the `before` offset. (optional) - * @param string|null $before The paging offset token for the page that comes `before` the previously requested records. If provided, then the records in the response will be the records preceding the offset, sorted in *descending* order. (optional) - * @param int|null $limit The number of records to return in the response. The maximum `limit` is 250. (optional, default to 100) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPageOrderedByAddedToListDate'] to see the possible values for this operation - * - * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return \HubSpot\Client\Crm\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId|\HubSpot\Client\Crm\Lists\Model\Error - */ - public function getPageOrderedByAddedToListDate($list_id, $after = null, $before = null, $limit = 100, string $contentType = self::contentTypes['getPageOrderedByAddedToListDate'][0]) - { - list($response) = $this->getPageOrderedByAddedToListDateWithHttpInfo($list_id, $after, $before, $limit, $contentType); - return $response; - } - - /** - * Operation getPageOrderedByAddedToListDateWithHttpInfo - * - * Fetch List Memberships Ordered by Added to List Date - * - * @param string $list_id The **ILS ID** of the list. (required) - * @param string|null $after The paging offset token for the page that comes `after` the previously requested records. If provided, then the records in the response will be the records following the offset, sorted in *ascending* order. Takes precedence over the `before` offset. (optional) - * @param string|null $before The paging offset token for the page that comes `before` the previously requested records. If provided, then the records in the response will be the records preceding the offset, sorted in *descending* order. (optional) - * @param int|null $limit The number of records to return in the response. The maximum `limit` is 250. (optional, default to 100) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPageOrderedByAddedToListDate'] to see the possible values for this operation - * - * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format - * @throws \InvalidArgumentException - * @return array of \HubSpot\Client\Crm\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId|\HubSpot\Client\Crm\Lists\Model\Error, HTTP status code, HTTP response headers (array of strings) - */ - public function getPageOrderedByAddedToListDateWithHttpInfo($list_id, $after = null, $before = null, $limit = 100, string $contentType = self::contentTypes['getPageOrderedByAddedToListDate'][0]) - { - $request = $this->getPageOrderedByAddedToListDateRequest($list_id, $after, $before, $limit, $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: - if ('\HubSpot\Client\Crm\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId' !== '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\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - default: - if ('\HubSpot\Client\Crm\Lists\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\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\Lists\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; - } - - if ($statusCode < 200 || $statusCode > 299) { - throw new ApiException( - sprintf( - '[%d] Error connecting to the API (%s)', - $statusCode, - (string) $request->getUri() - ), - $statusCode, - $response->getHeaders(), - (string) $response->getBody() - ); - } - - $returnType = '\HubSpot\Client\Crm\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId'; - 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() - ]; - - } catch (ApiException $e) { - switch ($e->getCode()) { - case 200: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - default: - $data = ObjectSerializer::deserialize( - $e->getResponseBody(), - '\HubSpot\Client\Crm\Lists\Model\Error', - $e->getResponseHeaders() - ); - $e->setResponseObject($data); - break; - } - throw $e; - } - } - - /** - * Operation getPageOrderedByAddedToListDateAsync - * - * Fetch List Memberships Ordered by Added to List Date - * - * @param string $list_id The **ILS ID** of the list. (required) - * @param string|null $after The paging offset token for the page that comes `after` the previously requested records. If provided, then the records in the response will be the records following the offset, sorted in *ascending* order. Takes precedence over the `before` offset. (optional) - * @param string|null $before The paging offset token for the page that comes `before` the previously requested records. If provided, then the records in the response will be the records preceding the offset, sorted in *descending* order. (optional) - * @param int|null $limit The number of records to return in the response. The maximum `limit` is 250. (optional, default to 100) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPageOrderedByAddedToListDate'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getPageOrderedByAddedToListDateAsync($list_id, $after = null, $before = null, $limit = 100, string $contentType = self::contentTypes['getPageOrderedByAddedToListDate'][0]) - { - return $this->getPageOrderedByAddedToListDateAsyncWithHttpInfo($list_id, $after, $before, $limit, $contentType) - ->then( - function ($response) { - return $response[0]; - } - ); - } - - /** - * Operation getPageOrderedByAddedToListDateAsyncWithHttpInfo - * - * Fetch List Memberships Ordered by Added to List Date - * - * @param string $list_id The **ILS ID** of the list. (required) - * @param string|null $after The paging offset token for the page that comes `after` the previously requested records. If provided, then the records in the response will be the records following the offset, sorted in *ascending* order. Takes precedence over the `before` offset. (optional) - * @param string|null $before The paging offset token for the page that comes `before` the previously requested records. If provided, then the records in the response will be the records preceding the offset, sorted in *descending* order. (optional) - * @param int|null $limit The number of records to return in the response. The maximum `limit` is 250. (optional, default to 100) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPageOrderedByAddedToListDate'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Promise\PromiseInterface - */ - public function getPageOrderedByAddedToListDateAsyncWithHttpInfo($list_id, $after = null, $before = null, $limit = 100, string $contentType = self::contentTypes['getPageOrderedByAddedToListDate'][0]) - { - $returnType = '\HubSpot\Client\Crm\Lists\Model\ApiCollectionResponseJoinTimeAndRecordId'; - $request = $this->getPageOrderedByAddedToListDateRequest($list_id, $after, $before, $limit, $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 'getPageOrderedByAddedToListDate' - * - * @param string $list_id The **ILS ID** of the list. (required) - * @param string|null $after The paging offset token for the page that comes `after` the previously requested records. If provided, then the records in the response will be the records following the offset, sorted in *ascending* order. Takes precedence over the `before` offset. (optional) - * @param string|null $before The paging offset token for the page that comes `before` the previously requested records. If provided, then the records in the response will be the records preceding the offset, sorted in *descending* order. (optional) - * @param int|null $limit The number of records to return in the response. The maximum `limit` is 250. (optional, default to 100) - * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getPageOrderedByAddedToListDate'] to see the possible values for this operation - * - * @throws \InvalidArgumentException - * @return \GuzzleHttp\Psr7\Request - */ - public function getPageOrderedByAddedToListDateRequest($list_id, $after = null, $before = null, $limit = 100, string $contentType = self::contentTypes['getPageOrderedByAddedToListDate'][0]) - { - - // verify the required parameter 'list_id' is set - if ($list_id === null || (is_array($list_id) && count($list_id) === 0)) { - throw new \InvalidArgumentException( - 'Missing the required parameter $list_id when calling getPageOrderedByAddedToListDate' - ); - } - - - - - - $resourcePath = '/crm/v3/lists/{listId}/memberships/join-order'; - $formParams = []; - $queryParams = []; - $headerParams = []; - $httpBody = ''; - $multipart = false; - - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $after, - 'after', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $before, - 'before', // param base name - 'string', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - // query params - $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $limit, - 'limit', // param base name - 'integer', // openApiType - 'form', // style - true, // explode - false // required - ) ?? []); - - - // path params - if ($list_id !== null) { - $resourcePath = str_replace( - '{' . 'listId' . '}', - ObjectSerializer::toPathValue($list_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 remove * * Remove Records from a List * * @param string $list_id The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. (required) - * @param string[] $request_body request_body (required) + * @param string[] $request_body The IDs of the records to remove from the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['remove'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format @@ -2300,7 +1665,7 @@ public function remove($list_id, $request_body, string $contentType = self::cont * Remove Records from a List * * @param string $list_id The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. (required) - * @param string[] $request_body (required) + * @param string[] $request_body The IDs of the records to remove from the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['remove'] to see the possible values for this operation * * @throws \HubSpot\Client\Crm\Lists\ApiException on non-2xx response or if the response body is not in the expected format @@ -2336,61 +1701,21 @@ public function removeWithHttpInfo($list_id, $request_body, string $contentType switch($statusCode) { case 200: - if ('\HubSpot\Client\Crm\Lists\Model\MembershipsUpdateResponse' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\Model\MembershipsUpdateResponse' !== '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\Lists\Model\MembershipsUpdateResponse', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\MembershipsUpdateResponse', + $request, + $response, + ); default: - if ('\HubSpot\Client\Crm\Lists\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Crm\Lists\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\Lists\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Crm\Lists\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2404,34 +1729,11 @@ public function removeWithHttpInfo($list_id, $request_body, string $contentType ); } - $returnType = '\HubSpot\Client\Crm\Lists\Model\MembershipsUpdateResponse'; - 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\Lists\Model\MembershipsUpdateResponse', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2441,7 +1743,7 @@ public function removeWithHttpInfo($list_id, $request_body, string $contentType $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2449,8 +1751,10 @@ public function removeWithHttpInfo($list_id, $request_body, string $contentType $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2461,7 +1765,7 @@ public function removeWithHttpInfo($list_id, $request_body, string $contentType * Remove Records from a List * * @param string $list_id The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. (required) - * @param string[] $request_body (required) + * @param string[] $request_body The IDs of the records to remove from the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['remove'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2483,7 +1787,7 @@ function ($response) { * Remove Records from a List * * @param string $list_id The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. (required) - * @param string[] $request_body (required) + * @param string[] $request_body The IDs of the records to remove from the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['remove'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2534,7 +1838,7 @@ function ($exception) { * Create request for operation 'remove' * * @param string $list_id The **ILS ID** of the `MANUAL` or `SNAPSHOT` list. (required) - * @param string[] $request_body (required) + * @param string[] $request_body The IDs of the records to remove from the list. (required) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['remove'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2698,7 +2002,6 @@ public function removeAllWithHttpInfo($list_id, string $contentType = self::cont return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -2708,8 +2011,10 @@ public function removeAllWithHttpInfo($list_id, string $contentType = self::cont $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2886,6 +2191,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/Lists/ApiException.php b/codegen/Crm/Lists/ApiException.php index 0dce58194..742d4ef9e 100644 --- a/codegen/Crm/Lists/ApiException.php +++ b/codegen/Crm/Lists/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/Lists/FormDataProcessor.php b/codegen/Crm/Lists/FormDataProcessor.php new file mode 100644 index 000000000..94c72746b --- /dev/null +++ b/codegen/Crm/Lists/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/Lists/HeaderSelector.php b/codegen/Crm/Lists/HeaderSelector.php index e8efc2ae8..cad6f03d3 100644 --- a/codegen/Crm/Lists/HeaderSelector.php +++ b/codegen/Crm/Lists/HeaderSelector.php @@ -1,7 +1,7 @@ 'int', 'paging' => '\HubSpot\Client\Crm\Lists\Model\Paging', - 'results' => '\HubSpot\Client\Crm\Lists\Model\JoinTimeAndRecordId[]' + 'results' => '\HubSpot\Client\Crm\Lists\Model\JoinTimeAndRecordId[]', + 'total' => 'int' ]; /** @@ -70,9 +70,9 @@ class ApiCollectionResponseJoinTimeAndRecordId implements ModelInterface, ArrayA * @psalm-var array */ protected static $openAPIFormats = [ - 'total' => 'int64', 'paging' => null, - 'results' => null + 'results' => null, + 'total' => 'int64' ]; /** @@ -81,9 +81,9 @@ class ApiCollectionResponseJoinTimeAndRecordId implements ModelInterface, ArrayA * @var boolean[] */ protected static array $openAPINullables = [ - 'total' => false, 'paging' => false, - 'results' => false + 'results' => false, + 'total' => false ]; /** @@ -172,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'total' => 'total', 'paging' => 'paging', - 'results' => 'results' + 'results' => 'results', + 'total' => 'total' ]; /** @@ -183,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'total' => 'setTotal', 'paging' => 'setPaging', - 'results' => 'setResults' + 'results' => 'setResults', + 'total' => 'setTotal' ]; /** @@ -194,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'total' => 'getTotal', 'paging' => 'getPaging', - 'results' => 'getResults' + 'results' => 'getResults', + 'total' => 'getTotal' ]; /** @@ -256,9 +256,9 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('total', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); } /** @@ -306,33 +306,6 @@ public function valid() } - /** - * Gets total - * - * @return int|null - */ - public function getTotal() - { - return $this->container['total']; - } - - /** - * Sets total - * - * @param int|null $total total - * - * @return self - */ - public function setTotal($total) - { - if (is_null($total)) { - throw new \InvalidArgumentException('non-nullable total cannot be null'); - } - $this->container['total'] = $total; - - return $this; - } - /** * Gets paging * @@ -386,14 +359,41 @@ public function setResults($results) return $this; } + + /** + * Gets total + * + * @return int|null + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int|null $total The total number of records that match the query. + * + * @return self + */ + public function setTotal($total) + { + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); + } + $this->container['total'] = $total; + + 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]); } @@ -401,12 +401,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; } @@ -431,11 +431,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/Lists/Model/ApiCollectionResponseRecordListMembershipNoPaging.php b/codegen/Crm/Lists/Model/ApiCollectionResponseRecordListMembershipNoPaging.php index d90345880..124657c75 100644 --- a/codegen/Crm/Lists/Model/ApiCollectionResponseRecordListMembershipNoPaging.php +++ b/codegen/Crm/Lists/Model/ApiCollectionResponseRecordListMembershipNoPaging.php @@ -2,7 +2,7 @@ /** * ApiCollectionResponseRecordListMembershipNoPaging * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,8 +57,8 @@ class ApiCollectionResponseRecordListMembershipNoPaging implements ModelInterfac * @var string[] */ protected static $openAPITypes = [ - 'total' => 'int', - 'results' => '\HubSpot\Client\Crm\Lists\Model\RecordListMembership[]' + 'results' => '\HubSpot\Client\Crm\Lists\Model\RecordListMembership[]', + 'total' => 'int' ]; /** @@ -69,8 +69,8 @@ class ApiCollectionResponseRecordListMembershipNoPaging implements ModelInterfac * @psalm-var array */ protected static $openAPIFormats = [ - 'total' => 'int64', - 'results' => null + 'results' => null, + 'total' => 'int64' ]; /** @@ -79,8 +79,8 @@ class ApiCollectionResponseRecordListMembershipNoPaging implements ModelInterfac * @var boolean[] */ protected static array $openAPINullables = [ - 'total' => false, - 'results' => false + 'results' => false, + 'total' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'total' => 'total', - 'results' => 'results' + 'results' => 'results', + 'total' => 'total' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'total' => 'setTotal', - 'results' => 'setResults' + 'results' => 'setResults', + 'total' => 'setTotal' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'total' => 'getTotal', - 'results' => 'getResults' + 'results' => 'getResults', + 'total' => 'getTotal' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('total', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); } /** @@ -300,66 +300,66 @@ public function valid() /** - * Gets total + * Gets results * - * @return int|null + * @return \HubSpot\Client\Crm\Lists\Model\RecordListMembership[] */ - public function getTotal() + public function getResults() { - return $this->container['total']; + return $this->container['results']; } /** - * Sets total + * Sets results * - * @param int|null $total total + * @param \HubSpot\Client\Crm\Lists\Model\RecordListMembership[] $results results * * @return self */ - public function setTotal($total) + public function setResults($results) { - if (is_null($total)) { - throw new \InvalidArgumentException('non-nullable total cannot be null'); + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); } - $this->container['total'] = $total; + $this->container['results'] = $results; return $this; } /** - * Gets results + * Gets total * - * @return \HubSpot\Client\Crm\Lists\Model\RecordListMembership[] + * @return int|null */ - public function getResults() + public function getTotal() { - return $this->container['results']; + return $this->container['total']; } /** - * Sets results + * Sets total * - * @param \HubSpot\Client\Crm\Lists\Model\RecordListMembership[] $results results + * @param int|null $total The total number of list memberships for the specified record. * * @return self */ - public function setResults($results) + public function setTotal($total) { - if (is_null($results)) { - throw new \InvalidArgumentException('non-nullable results cannot be null'); + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); } - $this->container['results'] = $results; + $this->container['total'] = $total; 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/Lists/Model/Error.php b/codegen/Crm/Lists/Model/Error.php index 0fda51f1c..9d9797252 100644 --- a/codegen/Crm/Lists/Model/Error.php +++ b/codegen/Crm/Lists/Model/Error.php @@ -2,7 +2,7 @@ /** * Error * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.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\Lists\Model\ErrorDetail[]', 'links' => 'array', 'message' => 'string', - 'category' => 'string', - 'errors' => '\HubSpot\Client\Crm\Lists\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\Lists\Model\ErrorDetail[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Crm\Lists\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\Lists\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\Lists\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/Lists/Model/ErrorDetail.php b/codegen/Crm/Lists/Model/ErrorDetail.php index f77be6f10..12e35fd48 100644 --- a/codegen/Crm/Lists/Model/ErrorDetail.php +++ b/codegen/Crm/Lists/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.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/Lists/Model/JoinTimeAndRecordId.php b/codegen/Crm/Lists/Model/JoinTimeAndRecordId.php index a67393277..31d916c61 100644 --- a/codegen/Crm/Lists/Model/JoinTimeAndRecordId.php +++ b/codegen/Crm/Lists/Model/JoinTimeAndRecordId.php @@ -2,7 +2,7 @@ /** * JoinTimeAndRecordId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,8 +57,8 @@ class JoinTimeAndRecordId implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'record_id' => 'string', - 'membership_timestamp' => '\DateTime' + 'membership_timestamp' => '\DateTime', + 'record_id' => 'string' ]; /** @@ -69,8 +69,8 @@ class JoinTimeAndRecordId implements ModelInterface, ArrayAccess, \JsonSerializa * @psalm-var array */ protected static $openAPIFormats = [ - 'record_id' => null, - 'membership_timestamp' => 'date-time' + 'membership_timestamp' => 'date-time', + 'record_id' => null ]; /** @@ -79,8 +79,8 @@ class JoinTimeAndRecordId implements ModelInterface, ArrayAccess, \JsonSerializa * @var boolean[] */ protected static array $openAPINullables = [ - 'record_id' => false, - 'membership_timestamp' => false + 'membership_timestamp' => false, + 'record_id' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'record_id' => 'recordId', - 'membership_timestamp' => 'membershipTimestamp' + 'membership_timestamp' => 'membershipTimestamp', + 'record_id' => 'recordId' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'record_id' => 'setRecordId', - 'membership_timestamp' => 'setMembershipTimestamp' + 'membership_timestamp' => 'setMembershipTimestamp', + 'record_id' => 'setRecordId' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'record_id' => 'getRecordId', - 'membership_timestamp' => 'getMembershipTimestamp' + 'membership_timestamp' => 'getMembershipTimestamp', + 'record_id' => 'getRecordId' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('record_id', $data ?? [], null); $this->setIfExists('membership_timestamp', $data ?? [], null); + $this->setIfExists('record_id', $data ?? [], null); } /** @@ -281,12 +281,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['record_id'] === null) { - $invalidProperties[] = "'record_id' can't be null"; - } if ($this->container['membership_timestamp'] === null) { $invalidProperties[] = "'membership_timestamp' can't be null"; } + if ($this->container['record_id'] === null) { + $invalidProperties[] = "'record_id' can't be null"; + } return $invalidProperties; } @@ -303,66 +303,66 @@ public function valid() /** - * Gets record_id + * Gets membership_timestamp * - * @return string + * @return \DateTime */ - public function getRecordId() + public function getMembershipTimestamp() { - return $this->container['record_id']; + return $this->container['membership_timestamp']; } /** - * Sets record_id + * Sets membership_timestamp * - * @param string $record_id record_id + * @param \DateTime $membership_timestamp The date and time when the record was added to the list. * * @return self */ - public function setRecordId($record_id) + public function setMembershipTimestamp($membership_timestamp) { - if (is_null($record_id)) { - throw new \InvalidArgumentException('non-nullable record_id cannot be null'); + if (is_null($membership_timestamp)) { + throw new \InvalidArgumentException('non-nullable membership_timestamp cannot be null'); } - $this->container['record_id'] = $record_id; + $this->container['membership_timestamp'] = $membership_timestamp; return $this; } /** - * Gets membership_timestamp + * Gets record_id * - * @return \DateTime + * @return string */ - public function getMembershipTimestamp() + public function getRecordId() { - return $this->container['membership_timestamp']; + return $this->container['record_id']; } /** - * Sets membership_timestamp + * Sets record_id * - * @param \DateTime $membership_timestamp membership_timestamp + * @param string $record_id The unique identifier of the record. * * @return self */ - public function setMembershipTimestamp($membership_timestamp) + public function setRecordId($record_id) { - if (is_null($membership_timestamp)) { - throw new \InvalidArgumentException('non-nullable membership_timestamp cannot be null'); + if (is_null($record_id)) { + throw new \InvalidArgumentException('non-nullable record_id cannot be null'); } - $this->container['membership_timestamp'] = $membership_timestamp; + $this->container['record_id'] = $record_id; 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]); } @@ -370,12 +370,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; } @@ -400,11 +400,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/Lists/Model/ListCreateRequest.php b/codegen/Crm/Lists/Model/ListCreateRequest.php index 5a4d76fc0..b12c970e3 100644 --- a/codegen/Crm/Lists/Model/ListCreateRequest.php +++ b/codegen/Crm/Lists/Model/ListCreateRequest.php @@ -2,7 +2,7 @@ /** * ListCreateRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * ListCreateRequest Class Doc Comment * * @category Class + * @description The request object used when creating a new object list. * @package HubSpot\Client\Crm\Lists * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,12 +58,14 @@ class ListCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializabl * @var string[] */ protected static $openAPITypes = [ - 'object_type_id' => 'string', - 'processing_type' => 'string', 'custom_properties' => 'array', + 'filter_branch' => '\HubSpot\Client\Crm\Lists\Model\ListCreateRequestFilterBranch', 'list_folder_id' => 'int', + 'list_permissions' => '\HubSpot\Client\Crm\Lists\Model\PublicListPermissions', + 'membership_settings' => '\HubSpot\Client\Crm\Lists\Model\PublicMembershipSettings', 'name' => 'string', - 'filter_branch' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner' + 'object_type_id' => 'string', + 'processing_type' => 'string' ]; /** @@ -73,12 +76,14 @@ class ListCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializabl * @psalm-var array */ protected static $openAPIFormats = [ - 'object_type_id' => null, - 'processing_type' => null, 'custom_properties' => null, + 'filter_branch' => null, 'list_folder_id' => 'int32', + 'list_permissions' => null, + 'membership_settings' => null, 'name' => null, - 'filter_branch' => null + 'object_type_id' => null, + 'processing_type' => null ]; /** @@ -87,12 +92,14 @@ class ListCreateRequest implements ModelInterface, ArrayAccess, \JsonSerializabl * @var boolean[] */ protected static array $openAPINullables = [ - 'object_type_id' => false, - 'processing_type' => false, 'custom_properties' => false, + 'filter_branch' => false, 'list_folder_id' => false, + 'list_permissions' => false, + 'membership_settings' => false, 'name' => false, - 'filter_branch' => false + 'object_type_id' => false, + 'processing_type' => false ]; /** @@ -181,12 +188,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'object_type_id' => 'objectTypeId', - 'processing_type' => 'processingType', 'custom_properties' => 'customProperties', + 'filter_branch' => 'filterBranch', 'list_folder_id' => 'listFolderId', + 'list_permissions' => 'listPermissions', + 'membership_settings' => 'membershipSettings', 'name' => 'name', - 'filter_branch' => 'filterBranch' + 'object_type_id' => 'objectTypeId', + 'processing_type' => 'processingType' ]; /** @@ -195,12 +204,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'object_type_id' => 'setObjectTypeId', - 'processing_type' => 'setProcessingType', 'custom_properties' => 'setCustomProperties', + 'filter_branch' => 'setFilterBranch', 'list_folder_id' => 'setListFolderId', + 'list_permissions' => 'setListPermissions', + 'membership_settings' => 'setMembershipSettings', 'name' => 'setName', - 'filter_branch' => 'setFilterBranch' + 'object_type_id' => 'setObjectTypeId', + 'processing_type' => 'setProcessingType' ]; /** @@ -209,12 +220,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'object_type_id' => 'getObjectTypeId', - 'processing_type' => 'getProcessingType', 'custom_properties' => 'getCustomProperties', + 'filter_branch' => 'getFilterBranch', 'list_folder_id' => 'getListFolderId', + 'list_permissions' => 'getListPermissions', + 'membership_settings' => 'getMembershipSettings', 'name' => 'getName', - 'filter_branch' => 'getFilterBranch' + 'object_type_id' => 'getObjectTypeId', + 'processing_type' => 'getProcessingType' ]; /** @@ -274,12 +287,14 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('object_type_id', $data ?? [], null); - $this->setIfExists('processing_type', $data ?? [], null); $this->setIfExists('custom_properties', $data ?? [], null); + $this->setIfExists('filter_branch', $data ?? [], null); $this->setIfExists('list_folder_id', $data ?? [], null); + $this->setIfExists('list_permissions', $data ?? [], null); + $this->setIfExists('membership_settings', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('filter_branch', $data ?? [], null); + $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('processing_type', $data ?? [], null); } /** @@ -309,15 +324,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } if ($this->container['object_type_id'] === null) { $invalidProperties[] = "'object_type_id' can't be null"; } if ($this->container['processing_type'] === null) { $invalidProperties[] = "'processing_type' can't be null"; } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } return $invalidProperties; } @@ -334,109 +349,136 @@ public function valid() /** - * Gets object_type_id + * Gets custom_properties * - * @return string + * @return array|null */ - public function getObjectTypeId() + public function getCustomProperties() { - return $this->container['object_type_id']; + return $this->container['custom_properties']; } /** - * Sets object_type_id + * Sets custom_properties * - * @param string $object_type_id The object type ID of the type of objects that the list will store. + * @param array|null $custom_properties The list of custom properties to tie to the list. Custom property name is the key, the value is the value. * * @return self */ - public function setObjectTypeId($object_type_id) + public function setCustomProperties($custom_properties) { - if (is_null($object_type_id)) { - throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + if (is_null($custom_properties)) { + throw new \InvalidArgumentException('non-nullable custom_properties cannot be null'); } - $this->container['object_type_id'] = $object_type_id; + $this->container['custom_properties'] = $custom_properties; return $this; } /** - * Gets processing_type + * Gets filter_branch * - * @return string + * @return \HubSpot\Client\Crm\Lists\Model\ListCreateRequestFilterBranch|null */ - public function getProcessingType() + public function getFilterBranch() { - return $this->container['processing_type']; + return $this->container['filter_branch']; } /** - * Sets processing_type + * Sets filter_branch * - * @param string $processing_type The processing type of the list. One of: `SNAPSHOT`, `MANUAL`, or `DYNAMIC`. + * @param \HubSpot\Client\Crm\Lists\Model\ListCreateRequestFilterBranch|null $filter_branch filter_branch * * @return self */ - public function setProcessingType($processing_type) + public function setFilterBranch($filter_branch) { - if (is_null($processing_type)) { - throw new \InvalidArgumentException('non-nullable processing_type cannot be null'); + if (is_null($filter_branch)) { + throw new \InvalidArgumentException('non-nullable filter_branch cannot be null'); } - $this->container['processing_type'] = $processing_type; + $this->container['filter_branch'] = $filter_branch; return $this; } /** - * Gets custom_properties + * Gets list_folder_id * - * @return array|null + * @return int|null */ - public function getCustomProperties() + public function getListFolderId() { - return $this->container['custom_properties']; + return $this->container['list_folder_id']; } /** - * Sets custom_properties + * Sets list_folder_id * - * @param array|null $custom_properties The list of custom properties to tie to the list. Custom property name is the key, the value is the value. + * @param int|null $list_folder_id The ID of the folder that the list should be created in. If left blank, then the list will be created in the root of the list folder structure. * * @return self */ - public function setCustomProperties($custom_properties) + public function setListFolderId($list_folder_id) { - if (is_null($custom_properties)) { - throw new \InvalidArgumentException('non-nullable custom_properties cannot be null'); + if (is_null($list_folder_id)) { + throw new \InvalidArgumentException('non-nullable list_folder_id cannot be null'); } - $this->container['custom_properties'] = $custom_properties; + $this->container['list_folder_id'] = $list_folder_id; return $this; } /** - * Gets list_folder_id + * Gets list_permissions * - * @return int|null + * @return \HubSpot\Client\Crm\Lists\Model\PublicListPermissions|null */ - public function getListFolderId() + public function getListPermissions() { - return $this->container['list_folder_id']; + return $this->container['list_permissions']; } /** - * Sets list_folder_id + * Sets list_permissions * - * @param int|null $list_folder_id The ID of the folder that the list should be created in. If left blank, then the list will be created in the root of the list folder structure. + * @param \HubSpot\Client\Crm\Lists\Model\PublicListPermissions|null $list_permissions list_permissions * * @return self */ - public function setListFolderId($list_folder_id) + public function setListPermissions($list_permissions) { - if (is_null($list_folder_id)) { - throw new \InvalidArgumentException('non-nullable list_folder_id cannot be null'); + if (is_null($list_permissions)) { + throw new \InvalidArgumentException('non-nullable list_permissions cannot be null'); } - $this->container['list_folder_id'] = $list_folder_id; + $this->container['list_permissions'] = $list_permissions; + + return $this; + } + + /** + * Gets membership_settings + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicMembershipSettings|null + */ + public function getMembershipSettings() + { + return $this->container['membership_settings']; + } + + /** + * Sets membership_settings + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicMembershipSettings|null $membership_settings membership_settings + * + * @return self + */ + public function setMembershipSettings($membership_settings) + { + if (is_null($membership_settings)) { + throw new \InvalidArgumentException('non-nullable membership_settings cannot be null'); + } + $this->container['membership_settings'] = $membership_settings; return $this; } @@ -469,39 +511,66 @@ public function setName($name) } /** - * Gets filter_branch + * Gets object_type_id * - * @return \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner|null + * @return string */ - public function getFilterBranch() + public function getObjectTypeId() { - return $this->container['filter_branch']; + return $this->container['object_type_id']; } /** - * Sets filter_branch + * Sets object_type_id * - * @param \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner|null $filter_branch filter_branch + * @param string $object_type_id The object type ID of the type of objects that the list will store. * * @return self */ - public function setFilterBranch($filter_branch) + public function setObjectTypeId($object_type_id) { - if (is_null($filter_branch)) { - throw new \InvalidArgumentException('non-nullable filter_branch cannot be null'); + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); } - $this->container['filter_branch'] = $filter_branch; + $this->container['object_type_id'] = $object_type_id; + + return $this; + } + + /** + * Gets processing_type + * + * @return string + */ + public function getProcessingType() + { + return $this->container['processing_type']; + } + + /** + * Sets processing_type + * + * @param string $processing_type The processing type of the list. One of: `SNAPSHOT`, `MANUAL`, or `DYNAMIC`. + * + * @return self + */ + public function setProcessingType($processing_type) + { + if (is_null($processing_type)) { + throw new \InvalidArgumentException('non-nullable processing_type cannot be null'); + } + $this->container['processing_type'] = $processing_type; 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]); } @@ -509,12 +578,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; } @@ -539,11 +608,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/Lists/Model/ListCreateRequestFilterBranch.php b/codegen/Crm/Lists/Model/ListCreateRequestFilterBranch.php new file mode 100644 index 000000000..304975e49 --- /dev/null +++ b/codegen/Crm/Lists/Model/ListCreateRequestFilterBranch.php @@ -0,0 +1,815 @@ + + */ +class ListCreateRequestFilterBranch implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'filter_branch_type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListCreateRequest_filterBranch'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'filter_branch_operator' => 'string', + 'filter_branch_type' => 'string', + 'filter_branches' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[]', + 'filters' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[]', + 'coalescing_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', + 'event_type_id' => 'string', + 'operator' => 'string', + 'object_type_id' => 'string', + 'property_with_object_id' => 'string', + 'association_category' => 'string', + 'association_type_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'filter_branch_operator' => null, + 'filter_branch_type' => null, + 'filter_branches' => null, + 'filters' => null, + 'coalescing_refine_by' => null, + 'event_type_id' => null, + 'operator' => null, + 'object_type_id' => null, + 'property_with_object_id' => null, + 'association_category' => null, + 'association_type_id' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'filter_branch_operator' => false, + 'filter_branch_type' => false, + 'filter_branches' => false, + 'filters' => false, + 'coalescing_refine_by' => false, + 'event_type_id' => false, + 'operator' => false, + 'object_type_id' => false, + 'property_with_object_id' => false, + 'association_category' => false, + 'association_type_id' => 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 = [ + 'filter_branch_operator' => 'filterBranchOperator', + 'filter_branch_type' => 'filterBranchType', + 'filter_branches' => 'filterBranches', + 'filters' => 'filters', + 'coalescing_refine_by' => 'coalescingRefineBy', + 'event_type_id' => 'eventTypeId', + 'operator' => 'operator', + 'object_type_id' => 'objectTypeId', + 'property_with_object_id' => 'propertyWithObjectId', + 'association_category' => 'associationCategory', + 'association_type_id' => 'associationTypeId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'filter_branch_operator' => 'setFilterBranchOperator', + 'filter_branch_type' => 'setFilterBranchType', + 'filter_branches' => 'setFilterBranches', + 'filters' => 'setFilters', + 'coalescing_refine_by' => 'setCoalescingRefineBy', + 'event_type_id' => 'setEventTypeId', + 'operator' => 'setOperator', + 'object_type_id' => 'setObjectTypeId', + 'property_with_object_id' => 'setPropertyWithObjectId', + 'association_category' => 'setAssociationCategory', + 'association_type_id' => 'setAssociationTypeId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'filter_branch_operator' => 'getFilterBranchOperator', + 'filter_branch_type' => 'getFilterBranchType', + 'filter_branches' => 'getFilterBranches', + 'filters' => 'getFilters', + 'coalescing_refine_by' => 'getCoalescingRefineBy', + 'event_type_id' => 'getEventTypeId', + 'operator' => 'getOperator', + 'object_type_id' => 'getObjectTypeId', + 'property_with_object_id' => 'getPropertyWithObjectId', + 'association_category' => 'getAssociationCategory', + 'association_type_id' => 'getAssociationTypeId' + ]; + + /** + * 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 FILTER_BRANCH_TYPE_ASSOCIATION = 'ASSOCIATION'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFilterBranchTypeAllowableValues() + { + return [ + self::FILTER_BRANCH_TYPE_ASSOCIATION, + ]; + } + + /** + * 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('filter_branch_operator', $data ?? [], null); + $this->setIfExists('filter_branch_type', $data ?? [], 'ASSOCIATION'); + $this->setIfExists('filter_branches', $data ?? [], null); + $this->setIfExists('filters', $data ?? [], null); + $this->setIfExists('coalescing_refine_by', $data ?? [], null); + $this->setIfExists('event_type_id', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('property_with_object_id', $data ?? [], null); + $this->setIfExists('association_category', $data ?? [], null); + $this->setIfExists('association_type_id', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['filter_branch_type'] = static::$openAPIModelName; + } + + /** + * 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['filter_branch_operator'] === null) { + $invalidProperties[] = "'filter_branch_operator' can't be null"; + } + if ($this->container['filter_branch_type'] === null) { + $invalidProperties[] = "'filter_branch_type' can't be null"; + } + $allowedValues = $this->getFilterBranchTypeAllowableValues(); + if (!is_null($this->container['filter_branch_type']) && !in_array($this->container['filter_branch_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'filter_branch_type', must be one of '%s'", + $this->container['filter_branch_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['filter_branches'] === null) { + $invalidProperties[] = "'filter_branches' can't be null"; + } + if ($this->container['filters'] === null) { + $invalidProperties[] = "'filters' can't be null"; + } + if ($this->container['event_type_id'] === null) { + $invalidProperties[] = "'event_type_id' can't be null"; + } + if ($this->container['operator'] === null) { + $invalidProperties[] = "'operator' can't be null"; + } + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } + if ($this->container['property_with_object_id'] === null) { + $invalidProperties[] = "'property_with_object_id' can't be null"; + } + if ($this->container['association_category'] === null) { + $invalidProperties[] = "'association_category' can't be null"; + } + if ($this->container['association_type_id'] === null) { + $invalidProperties[] = "'association_type_id' 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 filter_branch_operator + * + * @return string + */ + public function getFilterBranchOperator() + { + return $this->container['filter_branch_operator']; + } + + /** + * Sets filter_branch_operator + * + * @param string $filter_branch_operator Filter branch operator (AND) + * + * @return self + */ + public function setFilterBranchOperator($filter_branch_operator) + { + if (is_null($filter_branch_operator)) { + throw new \InvalidArgumentException('non-nullable filter_branch_operator cannot be null'); + } + $this->container['filter_branch_operator'] = $filter_branch_operator; + + return $this; + } + + /** + * Gets filter_branch_type + * + * @return string + */ + public function getFilterBranchType() + { + return $this->container['filter_branch_type']; + } + + /** + * Sets filter_branch_type + * + * @param string $filter_branch_type Type of the filter branch (ASSOCIATION) + * + * @return self + */ + public function setFilterBranchType($filter_branch_type) + { + if (is_null($filter_branch_type)) { + throw new \InvalidArgumentException('non-nullable filter_branch_type cannot be null'); + } + $allowedValues = $this->getFilterBranchTypeAllowableValues(); + if (!in_array($filter_branch_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'filter_branch_type', must be one of '%s'", + $filter_branch_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['filter_branch_type'] = $filter_branch_type; + + return $this; + } + + /** + * Gets filter_branches + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[] + */ + public function getFilterBranches() + { + return $this->container['filter_branches']; + } + + /** + * Sets filter_branches + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[] $filter_branches filter_branches + * + * @return self + */ + public function setFilterBranches($filter_branches) + { + if (is_null($filter_branches)) { + throw new \InvalidArgumentException('non-nullable filter_branches cannot be null'); + } + $this->container['filter_branches'] = $filter_branches; + + return $this; + } + + /** + * Gets filters + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[] + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[] $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; + } + + /** + * Gets coalescing_refine_by + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null + */ + public function getCoalescingRefineBy() + { + return $this->container['coalescing_refine_by']; + } + + /** + * Sets coalescing_refine_by + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null $coalescing_refine_by coalescing_refine_by + * + * @return self + */ + public function setCoalescingRefineBy($coalescing_refine_by) + { + if (is_null($coalescing_refine_by)) { + throw new \InvalidArgumentException('non-nullable coalescing_refine_by cannot be null'); + } + $this->container['coalescing_refine_by'] = $coalescing_refine_by; + + return $this; + } + + /** + * Gets event_type_id + * + * @return string + */ + public function getEventTypeId() + { + return $this->container['event_type_id']; + } + + /** + * Sets event_type_id + * + * @param string $event_type_id The identifier for the type of event associated with the filter branch. + * + * @return self + */ + public function setEventTypeId($event_type_id) + { + if (is_null($event_type_id)) { + throw new \InvalidArgumentException('non-nullable event_type_id cannot be null'); + } + $this->container['event_type_id'] = $event_type_id; + + return $this; + } + + /** + * Gets operator + * + * @return string + */ + public function getOperator() + { + return $this->container['operator']; + } + + /** + * Sets operator + * + * @param string $operator Defines the operation to be applied within the filter branch (IN_LIST, NOT_IN_LIST). + * + * @return self + */ + public function setOperator($operator) + { + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); + } + $this->container['operator'] = $operator; + + return $this; + } + + /** + * Gets object_type_id + * + * @return string + */ + public function getObjectTypeId() + { + return $this->container['object_type_id']; + } + + /** + * Sets object_type_id + * + * @param string $object_type_id The ID representing the type of object associated with the filter branch. + * + * @return self + */ + public function setObjectTypeId($object_type_id) + { + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + } + $this->container['object_type_id'] = $object_type_id; + + return $this; + } + + /** + * Gets property_with_object_id + * + * @return string + */ + public function getPropertyWithObjectId() + { + return $this->container['property_with_object_id']; + } + + /** + * Sets property_with_object_id + * + * @param string $property_with_object_id The property that is associated with the object ID in the filter branch. + * + * @return self + */ + public function setPropertyWithObjectId($property_with_object_id) + { + if (is_null($property_with_object_id)) { + throw new \InvalidArgumentException('non-nullable property_with_object_id cannot be null'); + } + $this->container['property_with_object_id'] = $property_with_object_id; + + return $this; + } + + /** + * Gets association_category + * + * @return string + */ + public function getAssociationCategory() + { + return $this->container['association_category']; + } + + /** + * Sets association_category + * + * @param string $association_category Specifies the category of the association for the filter branch (HUBSPOT_DEFINED, USER_DEFINED, INTEGRATOR_DEFINED, WORK). + * + * @return self + */ + public function setAssociationCategory($association_category) + { + if (is_null($association_category)) { + throw new \InvalidArgumentException('non-nullable association_category cannot be null'); + } + $this->container['association_category'] = $association_category; + + return $this; + } + + /** + * Gets association_type_id + * + * @return int + */ + public function getAssociationTypeId() + { + return $this->container['association_type_id']; + } + + /** + * Sets association_type_id + * + * @param int $association_type_id Type id of the association + * + * @return self + */ + public function setAssociationTypeId($association_type_id) + { + if (is_null($association_type_id)) { + throw new \InvalidArgumentException('non-nullable association_type_id cannot be null'); + } + $this->container['association_type_id'] = $association_type_id; + + 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/Lists/Model/ListCreateResponse.php b/codegen/Crm/Lists/Model/ListCreateResponse.php index 60960eb9d..8e1fa9721 100644 --- a/codegen/Crm/Lists/Model/ListCreateResponse.php +++ b/codegen/Crm/Lists/Model/ListCreateResponse.php @@ -2,7 +2,7 @@ /** * ListCreateResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * ListCreateResponse Class Doc Comment * * @category Class + * @description The response for a list create request. * @package HubSpot\Client\Crm\Lists * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -321,11 +322,11 @@ public function setList($list) /** * 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]); } @@ -333,12 +334,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; } @@ -363,11 +364,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/Lists/Model/ListFetchResponse.php b/codegen/Crm/Lists/Model/ListFetchResponse.php index 57257c3eb..6d24abb42 100644 --- a/codegen/Crm/Lists/Model/ListFetchResponse.php +++ b/codegen/Crm/Lists/Model/ListFetchResponse.php @@ -2,7 +2,7 @@ /** * ListFetchResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * ListFetchResponse Class Doc Comment * * @category Class + * @description The response for a list fetch request. * @package HubSpot\Client\Crm\Lists * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -321,11 +322,11 @@ public function setList($list) /** * 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]); } @@ -333,12 +334,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; } @@ -363,11 +364,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/Lists/Model/ListFilterUpdateRequest.php b/codegen/Crm/Lists/Model/ListFilterUpdateRequest.php index 47b7f3e07..1c1939726 100644 --- a/codegen/Crm/Lists/Model/ListFilterUpdateRequest.php +++ b/codegen/Crm/Lists/Model/ListFilterUpdateRequest.php @@ -2,7 +2,7 @@ /** * ListFilterUpdateRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * ListFilterUpdateRequest Class Doc Comment * * @category Class + * @description The definition of the list filter branch update request. * @package HubSpot\Client\Crm\Lists * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,7 +58,7 @@ class ListFilterUpdateRequest implements ModelInterface, ArrayAccess, \JsonSeria * @var string[] */ protected static $openAPITypes = [ - 'filter_branch' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner' + 'filter_branch' => '\HubSpot\Client\Crm\Lists\Model\ListFilterUpdateRequestFilterBranch' ]; /** @@ -295,7 +296,7 @@ public function valid() /** * Gets filter_branch * - * @return \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner + * @return \HubSpot\Client\Crm\Lists\Model\ListFilterUpdateRequestFilterBranch */ public function getFilterBranch() { @@ -305,7 +306,7 @@ public function getFilterBranch() /** * Sets filter_branch * - * @param \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner $filter_branch filter_branch + * @param \HubSpot\Client\Crm\Lists\Model\ListFilterUpdateRequestFilterBranch $filter_branch filter_branch * * @return self */ @@ -321,11 +322,11 @@ public function setFilterBranch($filter_branch) /** * 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]); } @@ -333,12 +334,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; } @@ -363,11 +364,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/Lists/Model/ListFilterUpdateRequestFilterBranch.php b/codegen/Crm/Lists/Model/ListFilterUpdateRequestFilterBranch.php new file mode 100644 index 000000000..6827b2adf --- /dev/null +++ b/codegen/Crm/Lists/Model/ListFilterUpdateRequestFilterBranch.php @@ -0,0 +1,815 @@ + + */ +class ListFilterUpdateRequestFilterBranch implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'filter_branch_type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ListFilterUpdateRequest_filterBranch'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'filter_branch_operator' => 'string', + 'filter_branch_type' => 'string', + 'filter_branches' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[]', + 'filters' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[]', + 'coalescing_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', + 'event_type_id' => 'string', + 'operator' => 'string', + 'object_type_id' => 'string', + 'property_with_object_id' => 'string', + 'association_category' => 'string', + 'association_type_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'filter_branch_operator' => null, + 'filter_branch_type' => null, + 'filter_branches' => null, + 'filters' => null, + 'coalescing_refine_by' => null, + 'event_type_id' => null, + 'operator' => null, + 'object_type_id' => null, + 'property_with_object_id' => null, + 'association_category' => null, + 'association_type_id' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'filter_branch_operator' => false, + 'filter_branch_type' => false, + 'filter_branches' => false, + 'filters' => false, + 'coalescing_refine_by' => false, + 'event_type_id' => false, + 'operator' => false, + 'object_type_id' => false, + 'property_with_object_id' => false, + 'association_category' => false, + 'association_type_id' => 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 = [ + 'filter_branch_operator' => 'filterBranchOperator', + 'filter_branch_type' => 'filterBranchType', + 'filter_branches' => 'filterBranches', + 'filters' => 'filters', + 'coalescing_refine_by' => 'coalescingRefineBy', + 'event_type_id' => 'eventTypeId', + 'operator' => 'operator', + 'object_type_id' => 'objectTypeId', + 'property_with_object_id' => 'propertyWithObjectId', + 'association_category' => 'associationCategory', + 'association_type_id' => 'associationTypeId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'filter_branch_operator' => 'setFilterBranchOperator', + 'filter_branch_type' => 'setFilterBranchType', + 'filter_branches' => 'setFilterBranches', + 'filters' => 'setFilters', + 'coalescing_refine_by' => 'setCoalescingRefineBy', + 'event_type_id' => 'setEventTypeId', + 'operator' => 'setOperator', + 'object_type_id' => 'setObjectTypeId', + 'property_with_object_id' => 'setPropertyWithObjectId', + 'association_category' => 'setAssociationCategory', + 'association_type_id' => 'setAssociationTypeId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'filter_branch_operator' => 'getFilterBranchOperator', + 'filter_branch_type' => 'getFilterBranchType', + 'filter_branches' => 'getFilterBranches', + 'filters' => 'getFilters', + 'coalescing_refine_by' => 'getCoalescingRefineBy', + 'event_type_id' => 'getEventTypeId', + 'operator' => 'getOperator', + 'object_type_id' => 'getObjectTypeId', + 'property_with_object_id' => 'getPropertyWithObjectId', + 'association_category' => 'getAssociationCategory', + 'association_type_id' => 'getAssociationTypeId' + ]; + + /** + * 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 FILTER_BRANCH_TYPE_ASSOCIATION = 'ASSOCIATION'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFilterBranchTypeAllowableValues() + { + return [ + self::FILTER_BRANCH_TYPE_ASSOCIATION, + ]; + } + + /** + * 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('filter_branch_operator', $data ?? [], null); + $this->setIfExists('filter_branch_type', $data ?? [], 'ASSOCIATION'); + $this->setIfExists('filter_branches', $data ?? [], null); + $this->setIfExists('filters', $data ?? [], null); + $this->setIfExists('coalescing_refine_by', $data ?? [], null); + $this->setIfExists('event_type_id', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('property_with_object_id', $data ?? [], null); + $this->setIfExists('association_category', $data ?? [], null); + $this->setIfExists('association_type_id', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['filter_branch_type'] = static::$openAPIModelName; + } + + /** + * 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['filter_branch_operator'] === null) { + $invalidProperties[] = "'filter_branch_operator' can't be null"; + } + if ($this->container['filter_branch_type'] === null) { + $invalidProperties[] = "'filter_branch_type' can't be null"; + } + $allowedValues = $this->getFilterBranchTypeAllowableValues(); + if (!is_null($this->container['filter_branch_type']) && !in_array($this->container['filter_branch_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'filter_branch_type', must be one of '%s'", + $this->container['filter_branch_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['filter_branches'] === null) { + $invalidProperties[] = "'filter_branches' can't be null"; + } + if ($this->container['filters'] === null) { + $invalidProperties[] = "'filters' can't be null"; + } + if ($this->container['event_type_id'] === null) { + $invalidProperties[] = "'event_type_id' can't be null"; + } + if ($this->container['operator'] === null) { + $invalidProperties[] = "'operator' can't be null"; + } + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } + if ($this->container['property_with_object_id'] === null) { + $invalidProperties[] = "'property_with_object_id' can't be null"; + } + if ($this->container['association_category'] === null) { + $invalidProperties[] = "'association_category' can't be null"; + } + if ($this->container['association_type_id'] === null) { + $invalidProperties[] = "'association_type_id' 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 filter_branch_operator + * + * @return string + */ + public function getFilterBranchOperator() + { + return $this->container['filter_branch_operator']; + } + + /** + * Sets filter_branch_operator + * + * @param string $filter_branch_operator Filter branch operator (AND) + * + * @return self + */ + public function setFilterBranchOperator($filter_branch_operator) + { + if (is_null($filter_branch_operator)) { + throw new \InvalidArgumentException('non-nullable filter_branch_operator cannot be null'); + } + $this->container['filter_branch_operator'] = $filter_branch_operator; + + return $this; + } + + /** + * Gets filter_branch_type + * + * @return string + */ + public function getFilterBranchType() + { + return $this->container['filter_branch_type']; + } + + /** + * Sets filter_branch_type + * + * @param string $filter_branch_type Type of the filter branch (ASSOCIATION) + * + * @return self + */ + public function setFilterBranchType($filter_branch_type) + { + if (is_null($filter_branch_type)) { + throw new \InvalidArgumentException('non-nullable filter_branch_type cannot be null'); + } + $allowedValues = $this->getFilterBranchTypeAllowableValues(); + if (!in_array($filter_branch_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'filter_branch_type', must be one of '%s'", + $filter_branch_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['filter_branch_type'] = $filter_branch_type; + + return $this; + } + + /** + * Gets filter_branches + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[] + */ + public function getFilterBranches() + { + return $this->container['filter_branches']; + } + + /** + * Sets filter_branches + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[] $filter_branches filter_branches + * + * @return self + */ + public function setFilterBranches($filter_branches) + { + if (is_null($filter_branches)) { + throw new \InvalidArgumentException('non-nullable filter_branches cannot be null'); + } + $this->container['filter_branches'] = $filter_branches; + + return $this; + } + + /** + * Gets filters + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[] + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[] $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; + } + + /** + * Gets coalescing_refine_by + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null + */ + public function getCoalescingRefineBy() + { + return $this->container['coalescing_refine_by']; + } + + /** + * Sets coalescing_refine_by + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null $coalescing_refine_by coalescing_refine_by + * + * @return self + */ + public function setCoalescingRefineBy($coalescing_refine_by) + { + if (is_null($coalescing_refine_by)) { + throw new \InvalidArgumentException('non-nullable coalescing_refine_by cannot be null'); + } + $this->container['coalescing_refine_by'] = $coalescing_refine_by; + + return $this; + } + + /** + * Gets event_type_id + * + * @return string + */ + public function getEventTypeId() + { + return $this->container['event_type_id']; + } + + /** + * Sets event_type_id + * + * @param string $event_type_id The identifier for the type of event associated with the filter branch. + * + * @return self + */ + public function setEventTypeId($event_type_id) + { + if (is_null($event_type_id)) { + throw new \InvalidArgumentException('non-nullable event_type_id cannot be null'); + } + $this->container['event_type_id'] = $event_type_id; + + return $this; + } + + /** + * Gets operator + * + * @return string + */ + public function getOperator() + { + return $this->container['operator']; + } + + /** + * Sets operator + * + * @param string $operator Defines the operation to be applied within the filter branch (IN_LIST, NOT_IN_LIST). + * + * @return self + */ + public function setOperator($operator) + { + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); + } + $this->container['operator'] = $operator; + + return $this; + } + + /** + * Gets object_type_id + * + * @return string + */ + public function getObjectTypeId() + { + return $this->container['object_type_id']; + } + + /** + * Sets object_type_id + * + * @param string $object_type_id The ID representing the type of object associated with the filter branch. + * + * @return self + */ + public function setObjectTypeId($object_type_id) + { + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + } + $this->container['object_type_id'] = $object_type_id; + + return $this; + } + + /** + * Gets property_with_object_id + * + * @return string + */ + public function getPropertyWithObjectId() + { + return $this->container['property_with_object_id']; + } + + /** + * Sets property_with_object_id + * + * @param string $property_with_object_id The property that is associated with the object ID in the filter branch. + * + * @return self + */ + public function setPropertyWithObjectId($property_with_object_id) + { + if (is_null($property_with_object_id)) { + throw new \InvalidArgumentException('non-nullable property_with_object_id cannot be null'); + } + $this->container['property_with_object_id'] = $property_with_object_id; + + return $this; + } + + /** + * Gets association_category + * + * @return string + */ + public function getAssociationCategory() + { + return $this->container['association_category']; + } + + /** + * Sets association_category + * + * @param string $association_category Specifies the category of the association for the filter branch (HUBSPOT_DEFINED, USER_DEFINED, INTEGRATOR_DEFINED, WORK). + * + * @return self + */ + public function setAssociationCategory($association_category) + { + if (is_null($association_category)) { + throw new \InvalidArgumentException('non-nullable association_category cannot be null'); + } + $this->container['association_category'] = $association_category; + + return $this; + } + + /** + * Gets association_type_id + * + * @return int + */ + public function getAssociationTypeId() + { + return $this->container['association_type_id']; + } + + /** + * Sets association_type_id + * + * @param int $association_type_id Type id of the association + * + * @return self + */ + public function setAssociationTypeId($association_type_id) + { + if (is_null($association_type_id)) { + throw new \InvalidArgumentException('non-nullable association_type_id cannot be null'); + } + $this->container['association_type_id'] = $association_type_id; + + 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/Lists/Model/ListFolderCreateRequest.php b/codegen/Crm/Lists/Model/ListFolderCreateRequest.php index fda62e204..2af4070b9 100644 --- a/codegen/Crm/Lists/Model/ListFolderCreateRequest.php +++ b/codegen/Crm/Lists/Model/ListFolderCreateRequest.php @@ -2,7 +2,7 @@ /** * ListFolderCreateRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,8 +57,8 @@ class ListFolderCreateRequest implements ModelInterface, ArrayAccess, \JsonSeria * @var string[] */ protected static $openAPITypes = [ - 'parent_folder_id' => 'string', - 'name' => 'string' + 'name' => 'string', + 'parent_folder_id' => 'string' ]; /** @@ -69,8 +69,8 @@ class ListFolderCreateRequest implements ModelInterface, ArrayAccess, \JsonSeria * @psalm-var array */ protected static $openAPIFormats = [ - 'parent_folder_id' => null, - 'name' => null + 'name' => null, + 'parent_folder_id' => null ]; /** @@ -79,8 +79,8 @@ class ListFolderCreateRequest implements ModelInterface, ArrayAccess, \JsonSeria * @var boolean[] */ protected static array $openAPINullables = [ - 'parent_folder_id' => false, - 'name' => false + 'name' => false, + 'parent_folder_id' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'parent_folder_id' => 'parentFolderId', - 'name' => 'name' + 'name' => 'name', + 'parent_folder_id' => 'parentFolderId' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'parent_folder_id' => 'setParentFolderId', - 'name' => 'setName' + 'name' => 'setName', + 'parent_folder_id' => 'setParentFolderId' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'parent_folder_id' => 'getParentFolderId', - 'name' => 'getName' + 'name' => 'getName', + 'parent_folder_id' => 'getParentFolderId' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('parent_folder_id', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('parent_folder_id', $data ?? [], null); } /** @@ -300,66 +300,66 @@ public function valid() /** - * Gets parent_folder_id + * Gets name * - * @return string|null + * @return string */ - public function getParentFolderId() + public function getName() { - return $this->container['parent_folder_id']; + return $this->container['name']; } /** - * Sets parent_folder_id + * Sets name * - * @param string|null $parent_folder_id The folder this should be created in, if not specified will be created in the root folder 0. + * @param string $name The name of the folder to be created. * * @return self */ - public function setParentFolderId($parent_folder_id) + public function setName($name) { - if (is_null($parent_folder_id)) { - throw new \InvalidArgumentException('non-nullable parent_folder_id cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['parent_folder_id'] = $parent_folder_id; + $this->container['name'] = $name; return $this; } /** - * Gets name + * Gets parent_folder_id * - * @return string + * @return string|null */ - public function getName() + public function getParentFolderId() { - return $this->container['name']; + return $this->container['parent_folder_id']; } /** - * Sets name + * Sets parent_folder_id * - * @param string $name The name of the folder to be created. + * @param string|null $parent_folder_id The folder this should be created in, if not specified will be created in the root folder 0. * * @return self */ - public function setName($name) + public function setParentFolderId($parent_folder_id) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($parent_folder_id)) { + throw new \InvalidArgumentException('non-nullable parent_folder_id cannot be null'); } - $this->container['name'] = $name; + $this->container['parent_folder_id'] = $parent_folder_id; 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/Lists/Model/ListFolderCreateResponse.php b/codegen/Crm/Lists/Model/ListFolderCreateResponse.php index a5290f0a9..0c7f92522 100644 --- a/codegen/Crm/Lists/Model/ListFolderCreateResponse.php +++ b/codegen/Crm/Lists/Model/ListFolderCreateResponse.php @@ -2,7 +2,7 @@ /** * ListFolderCreateResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -321,11 +321,11 @@ public function setFolder($folder) /** * 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]); } @@ -333,12 +333,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; } @@ -363,11 +363,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/Lists/Model/ListFolderFetchResponse.php b/codegen/Crm/Lists/Model/ListFolderFetchResponse.php index f16cdaa5f..c0f1f4c5e 100644 --- a/codegen/Crm/Lists/Model/ListFolderFetchResponse.php +++ b/codegen/Crm/Lists/Model/ListFolderFetchResponse.php @@ -2,7 +2,7 @@ /** * ListFolderFetchResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -321,11 +321,11 @@ public function setFolder($folder) /** * 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]); } @@ -333,12 +333,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; } @@ -363,11 +363,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/Lists/Model/ListMoveRequest.php b/codegen/Crm/Lists/Model/ListMoveRequest.php index 9142ffb3d..7d853cc77 100644 --- a/codegen/Crm/Lists/Model/ListMoveRequest.php +++ b/codegen/Crm/Lists/Model/ListMoveRequest.php @@ -2,7 +2,7 @@ /** * ListMoveRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -358,11 +358,11 @@ public function setNewFolderId($new_folder_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]); } @@ -370,12 +370,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; } @@ -400,11 +400,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/Lists/Model/ListSearchRequest.php b/codegen/Crm/Lists/Model/ListSearchRequest.php index 364f1a2ac..729738d87 100644 --- a/codegen/Crm/Lists/Model/ListSearchRequest.php +++ b/codegen/Crm/Lists/Model/ListSearchRequest.php @@ -2,7 +2,7 @@ /** * ListSearchRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * ListSearchRequest Class Doc Comment * * @category Class + * @description The request object used for searching through lists. * @package HubSpot\Client\Crm\Lists * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,12 +58,12 @@ class ListSearchRequest implements ModelInterface, ArrayAccess, \JsonSerializabl * @var string[] */ protected static $openAPITypes = [ + 'additional_properties' => 'string[]', + 'count' => 'int', 'list_ids' => 'string[]', 'offset' => 'int', - 'query' => 'string', - 'count' => 'int', 'processing_types' => 'string[]', - 'additional_properties' => 'string[]', + 'query' => 'string', 'sort' => 'string' ]; @@ -74,12 +75,12 @@ class ListSearchRequest implements ModelInterface, ArrayAccess, \JsonSerializabl * @psalm-var array */ protected static $openAPIFormats = [ + 'additional_properties' => null, + 'count' => 'int32', 'list_ids' => null, 'offset' => 'int32', - 'query' => null, - 'count' => 'int32', 'processing_types' => null, - 'additional_properties' => null, + 'query' => null, 'sort' => null ]; @@ -89,12 +90,12 @@ class ListSearchRequest implements ModelInterface, ArrayAccess, \JsonSerializabl * @var boolean[] */ protected static array $openAPINullables = [ + 'additional_properties' => false, + 'count' => false, 'list_ids' => false, 'offset' => false, - 'query' => false, - 'count' => false, 'processing_types' => false, - 'additional_properties' => false, + 'query' => false, 'sort' => false ]; @@ -184,12 +185,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'additional_properties' => 'additionalProperties', + 'count' => 'count', 'list_ids' => 'listIds', 'offset' => 'offset', - 'query' => 'query', - 'count' => 'count', 'processing_types' => 'processingTypes', - 'additional_properties' => 'additionalProperties', + 'query' => 'query', 'sort' => 'sort' ]; @@ -199,12 +200,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'additional_properties' => 'setAdditionalProperties', + 'count' => 'setCount', 'list_ids' => 'setListIds', 'offset' => 'setOffset', - 'query' => 'setQuery', - 'count' => 'setCount', 'processing_types' => 'setProcessingTypes', - 'additional_properties' => 'setAdditionalProperties', + 'query' => 'setQuery', 'sort' => 'setSort' ]; @@ -214,12 +215,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'additional_properties' => 'getAdditionalProperties', + 'count' => 'getCount', 'list_ids' => 'getListIds', 'offset' => 'getOffset', - 'query' => 'getQuery', - 'count' => 'getCount', 'processing_types' => 'getProcessingTypes', - 'additional_properties' => 'getAdditionalProperties', + 'query' => 'getQuery', 'sort' => 'getSort' ]; @@ -280,12 +281,12 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('additional_properties', $data ?? [], null); + $this->setIfExists('count', $data ?? [], null); $this->setIfExists('list_ids', $data ?? [], null); $this->setIfExists('offset', $data ?? [], null); - $this->setIfExists('query', $data ?? [], null); - $this->setIfExists('count', $data ?? [], null); $this->setIfExists('processing_types', $data ?? [], null); - $this->setIfExists('additional_properties', $data ?? [], null); + $this->setIfExists('query', $data ?? [], null); $this->setIfExists('sort', $data ?? [], null); } @@ -316,6 +317,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['additional_properties'] === null) { + $invalidProperties[] = "'additional_properties' can't be null"; + } + if ($this->container['offset'] === null) { + $invalidProperties[] = "'offset' can't be null"; + } return $invalidProperties; } @@ -332,109 +339,109 @@ public function valid() /** - * Gets list_ids + * Gets additional_properties * - * @return string[]|null + * @return string[] */ - public function getListIds() + public function getAdditionalProperties() { - return $this->container['list_ids']; + return $this->container['additional_properties']; } /** - * Sets list_ids + * Sets additional_properties * - * @param string[]|null $list_ids The `listIds` that will be used to filter results by `listId`. If values are provided, then the response will only include results that have a `listId` in this array. If no value is provided, or if an empty list is provided, then the results will not be filtered by `listId`. + * @param string[] $additional_properties The property names of any additional list properties to include in the response. Properties that do not exist or that are empty for a particular list are not included in the response. By default, all requests will fetch the following properties for each list: `hs_list_size`, `hs_last_record_added_at`, `hs_last_record_removed_at`, `hs_folder_name`, and `hs_list_reference_count`. * * @return self */ - public function setListIds($list_ids) + public function setAdditionalProperties($additional_properties) { - if (is_null($list_ids)) { - throw new \InvalidArgumentException('non-nullable list_ids cannot be null'); + if (is_null($additional_properties)) { + throw new \InvalidArgumentException('non-nullable additional_properties cannot be null'); } - $this->container['list_ids'] = $list_ids; + $this->container['additional_properties'] = $additional_properties; return $this; } /** - * Gets offset + * Gets count * * @return int|null */ - public function getOffset() + public function getCount() { - return $this->container['offset']; + return $this->container['count']; } /** - * Sets offset + * Sets count * - * @param int|null $offset Value used to paginate through lists. The `offset` provided in the response can be used in the next request to fetch the next page of results. Defaults to `0` if no offset is provided. + * @param int|null $count The number of lists to include in the response. Defaults to `20` if no value is provided. The max `count` is `500`. * * @return self */ - public function setOffset($offset) + public function setCount($count) { - if (is_null($offset)) { - throw new \InvalidArgumentException('non-nullable offset cannot be null'); + if (is_null($count)) { + throw new \InvalidArgumentException('non-nullable count cannot be null'); } - $this->container['offset'] = $offset; + $this->container['count'] = $count; return $this; } /** - * Gets query + * Gets list_ids * - * @return string|null + * @return string[]|null */ - public function getQuery() + public function getListIds() { - return $this->container['query']; + return $this->container['list_ids']; } /** - * Sets query + * Sets list_ids * - * @param string|null $query The `query` that will be used to search for lists by list name. If no `query` is provided, then the results will include all lists. + * @param string[]|null $list_ids The `listIds` that will be used to filter results by `listId`. If values are provided, then the response will only include results that have a `listId` in this array. If no value is provided, or if an empty list is provided, then the results will not be filtered by `listId`. * * @return self */ - public function setQuery($query) + public function setListIds($list_ids) { - if (is_null($query)) { - throw new \InvalidArgumentException('non-nullable query cannot be null'); + if (is_null($list_ids)) { + throw new \InvalidArgumentException('non-nullable list_ids cannot be null'); } - $this->container['query'] = $query; + $this->container['list_ids'] = $list_ids; return $this; } /** - * Gets count + * Gets offset * - * @return int|null + * @return int */ - public function getCount() + public function getOffset() { - return $this->container['count']; + return $this->container['offset']; } /** - * Sets count + * Sets offset * - * @param int|null $count The number of lists to include in the response. Defaults to `20` if no value is provided. The max `count` is `500`. + * @param int $offset Value used to paginate through lists. The `offset` provided in the response can be used in the next request to fetch the next page of results. Defaults to `0` if no offset is provided. * * @return self */ - public function setCount($count) + public function setOffset($offset) { - if (is_null($count)) { - throw new \InvalidArgumentException('non-nullable count cannot be null'); + if (is_null($offset)) { + throw new \InvalidArgumentException('non-nullable offset cannot be null'); } - $this->container['count'] = $count; + $this->container['offset'] = $offset; return $this; } @@ -467,28 +474,28 @@ public function setProcessingTypes($processing_types) } /** - * Gets additional_properties + * Gets query * - * @return string[]|null + * @return string|null */ - public function getAdditionalProperties() + public function getQuery() { - return $this->container['additional_properties']; + return $this->container['query']; } /** - * Sets additional_properties + * Sets query * - * @param string[]|null $additional_properties The property names of any additional list properties to include in the response. Properties that do not exist or that are empty for a particular list are not included in the response. By default, all requests will fetch the following properties for each list: `hs_list_size`, `hs_last_record_added_at`, `hs_last_record_removed_at`, `hs_folder_name`, and `hs_list_reference_count`. + * @param string|null $query The `query` that will be used to search for lists by list name. If no `query` is provided, then the results will include all lists. * * @return self */ - public function setAdditionalProperties($additional_properties) + public function setQuery($query) { - if (is_null($additional_properties)) { - throw new \InvalidArgumentException('non-nullable additional_properties cannot be null'); + if (is_null($query)) { + throw new \InvalidArgumentException('non-nullable query cannot be null'); } - $this->container['additional_properties'] = $additional_properties; + $this->container['query'] = $query; return $this; } @@ -506,7 +513,7 @@ public function getSort() /** * Sets sort * - * @param string|null $sort sort + * @param string|null $sort Sort field and order * * @return self */ @@ -522,11 +529,11 @@ public function setSort($sort) /** * 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]); } @@ -534,12 +541,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; } @@ -564,11 +571,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/Lists/Model/ListSearchResponse.php b/codegen/Crm/Lists/Model/ListSearchResponse.php index 4b6f71947..9b4ee341b 100644 --- a/codegen/Crm/Lists/Model/ListSearchResponse.php +++ b/codegen/Crm/Lists/Model/ListSearchResponse.php @@ -2,7 +2,7 @@ /** * ListSearchResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * ListSearchResponse Class Doc Comment * * @category Class + * @description The response object with the list search hits and additional information regarding pagination. * @package HubSpot\Client\Crm\Lists * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,10 +58,10 @@ class ListSearchResponse implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ - 'total' => 'int', - 'offset' => 'int', + 'has_more' => 'bool', 'lists' => '\HubSpot\Client\Crm\Lists\Model\PublicObjectListSearchResult[]', - 'has_more' => 'bool' + 'offset' => 'int', + 'total' => 'int' ]; /** @@ -71,10 +72,10 @@ class ListSearchResponse implements ModelInterface, ArrayAccess, \JsonSerializab * @psalm-var array */ protected static $openAPIFormats = [ - 'total' => 'int32', - 'offset' => 'int32', + 'has_more' => null, 'lists' => null, - 'has_more' => null + 'offset' => 'int32', + 'total' => 'int32' ]; /** @@ -83,10 +84,10 @@ class ListSearchResponse implements ModelInterface, ArrayAccess, \JsonSerializab * @var boolean[] */ protected static array $openAPINullables = [ - 'total' => false, - 'offset' => false, + 'has_more' => false, 'lists' => false, - 'has_more' => false + 'offset' => false, + 'total' => false ]; /** @@ -175,10 +176,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'total' => 'total', - 'offset' => 'offset', + 'has_more' => 'hasMore', 'lists' => 'lists', - 'has_more' => 'hasMore' + 'offset' => 'offset', + 'total' => 'total' ]; /** @@ -187,10 +188,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'total' => 'setTotal', - 'offset' => 'setOffset', + 'has_more' => 'setHasMore', 'lists' => 'setLists', - 'has_more' => 'setHasMore' + 'offset' => 'setOffset', + 'total' => 'setTotal' ]; /** @@ -199,10 +200,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'total' => 'getTotal', - 'offset' => 'getOffset', + 'has_more' => 'getHasMore', 'lists' => 'getLists', - 'has_more' => 'getHasMore' + 'offset' => 'getOffset', + 'total' => 'getTotal' ]; /** @@ -262,10 +263,10 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('total', $data ?? [], null); - $this->setIfExists('offset', $data ?? [], null); - $this->setIfExists('lists', $data ?? [], null); $this->setIfExists('has_more', $data ?? [], null); + $this->setIfExists('lists', $data ?? [], null); + $this->setIfExists('offset', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); } /** @@ -295,17 +296,17 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['total'] === null) { - $invalidProperties[] = "'total' can't be null"; - } - if ($this->container['offset'] === null) { - $invalidProperties[] = "'offset' can't be null"; + if ($this->container['has_more'] === null) { + $invalidProperties[] = "'has_more' can't be null"; } if ($this->container['lists'] === null) { $invalidProperties[] = "'lists' can't be null"; } - if ($this->container['has_more'] === null) { - $invalidProperties[] = "'has_more' can't be null"; + if ($this->container['offset'] === null) { + $invalidProperties[] = "'offset' can't be null"; + } + if ($this->container['total'] === null) { + $invalidProperties[] = "'total' can't be null"; } return $invalidProperties; } @@ -323,120 +324,120 @@ public function valid() /** - * Gets total + * Gets has_more * - * @return int + * @return bool */ - public function getTotal() + public function getHasMore() { - return $this->container['total']; + return $this->container['has_more']; } /** - * Sets total + * Sets has_more * - * @param int $total The total number of lists that match the search criteria. + * @param bool $has_more Whether or not there are more results to page through. * * @return self */ - public function setTotal($total) + public function setHasMore($has_more) { - if (is_null($total)) { - throw new \InvalidArgumentException('non-nullable total cannot be null'); + if (is_null($has_more)) { + throw new \InvalidArgumentException('non-nullable has_more cannot be null'); } - $this->container['total'] = $total; + $this->container['has_more'] = $has_more; return $this; } /** - * Gets offset + * Gets lists * - * @return int + * @return \HubSpot\Client\Crm\Lists\Model\PublicObjectListSearchResult[] */ - public function getOffset() + public function getLists() { - return $this->container['offset']; + return $this->container['lists']; } /** - * Sets offset + * Sets lists * - * @param int $offset Value to be passed in a future request to paginate through list search results. + * @param \HubSpot\Client\Crm\Lists\Model\PublicObjectListSearchResult[] $lists The lists that matched the search criteria. * * @return self */ - public function setOffset($offset) + public function setLists($lists) { - if (is_null($offset)) { - throw new \InvalidArgumentException('non-nullable offset cannot be null'); + if (is_null($lists)) { + throw new \InvalidArgumentException('non-nullable lists cannot be null'); } - $this->container['offset'] = $offset; + $this->container['lists'] = $lists; return $this; } /** - * Gets lists + * Gets offset * - * @return \HubSpot\Client\Crm\Lists\Model\PublicObjectListSearchResult[] + * @return int */ - public function getLists() + public function getOffset() { - return $this->container['lists']; + return $this->container['offset']; } /** - * Sets lists + * Sets offset * - * @param \HubSpot\Client\Crm\Lists\Model\PublicObjectListSearchResult[] $lists The lists that matched the search criteria. + * @param int $offset Value to be passed in a future request to paginate through list search results. * * @return self */ - public function setLists($lists) + public function setOffset($offset) { - if (is_null($lists)) { - throw new \InvalidArgumentException('non-nullable lists cannot be null'); + if (is_null($offset)) { + throw new \InvalidArgumentException('non-nullable offset cannot be null'); } - $this->container['lists'] = $lists; + $this->container['offset'] = $offset; return $this; } /** - * Gets has_more + * Gets total * - * @return bool + * @return int */ - public function getHasMore() + public function getTotal() { - return $this->container['has_more']; + return $this->container['total']; } /** - * Sets has_more + * Sets total * - * @param bool $has_more Whether or not there are more results to page through. + * @param int $total The total number of lists that match the search criteria. * * @return self */ - public function setHasMore($has_more) + public function setTotal($total) { - if (is_null($has_more)) { - throw new \InvalidArgumentException('non-nullable has_more cannot be null'); + if (is_null($total)) { + throw new \InvalidArgumentException('non-nullable total cannot be null'); } - $this->container['has_more'] = $has_more; + $this->container['total'] = $total; 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]); } @@ -444,12 +445,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; } @@ -474,11 +475,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/Lists/Model/ListUpdateResponse.php b/codegen/Crm/Lists/Model/ListUpdateResponse.php index 459887306..6d07dcdc0 100644 --- a/codegen/Crm/Lists/Model/ListUpdateResponse.php +++ b/codegen/Crm/Lists/Model/ListUpdateResponse.php @@ -2,7 +2,7 @@ /** * ListUpdateResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * ListUpdateResponse Class Doc Comment * * @category Class + * @description The updated definition of the list in response to a list update request. * @package HubSpot\Client\Crm\Lists * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -318,11 +319,11 @@ public function setUpdatedList($updated_list) /** * 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]); } @@ -330,12 +331,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; } @@ -360,11 +361,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/Lists/Model/ListsByIdResponse.php b/codegen/Crm/Lists/Model/ListsByIdResponse.php index 1ab862470..cf5190e71 100644 --- a/codegen/Crm/Lists/Model/ListsByIdResponse.php +++ b/codegen/Crm/Lists/Model/ListsByIdResponse.php @@ -2,7 +2,7 @@ /** * ListsByIdResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * ListsByIdResponse Class Doc Comment * * @category Class + * @description The response object containing the lists found for a multi-list fetch. * @package HubSpot\Client\Crm\Lists * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -321,11 +322,11 @@ public function setLists($lists) /** * 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]); } @@ -333,12 +334,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; } @@ -363,11 +364,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/Lists/Model/MembershipChangeRequest.php b/codegen/Crm/Lists/Model/MembershipChangeRequest.php index 0c96a9363..752ef8434 100644 --- a/codegen/Crm/Lists/Model/MembershipChangeRequest.php +++ b/codegen/Crm/Lists/Model/MembershipChangeRequest.php @@ -2,7 +2,7 @@ /** * MembershipChangeRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * MembershipChangeRequest Class Doc Comment * * @category Class + * @description The IDs of the records to add and/or remove from a list. * @package HubSpot\Client\Crm\Lists * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,8 +58,8 @@ class MembershipChangeRequest implements ModelInterface, ArrayAccess, \JsonSeria * @var string[] */ protected static $openAPITypes = [ - 'record_ids_to_remove' => 'string[]', - 'record_ids_to_add' => 'string[]' + 'record_ids_to_add' => 'string[]', + 'record_ids_to_remove' => 'string[]' ]; /** @@ -69,8 +70,8 @@ class MembershipChangeRequest implements ModelInterface, ArrayAccess, \JsonSeria * @psalm-var array */ protected static $openAPIFormats = [ - 'record_ids_to_remove' => null, - 'record_ids_to_add' => null + 'record_ids_to_add' => null, + 'record_ids_to_remove' => null ]; /** @@ -79,8 +80,8 @@ class MembershipChangeRequest implements ModelInterface, ArrayAccess, \JsonSeria * @var boolean[] */ protected static array $openAPINullables = [ - 'record_ids_to_remove' => false, - 'record_ids_to_add' => false + 'record_ids_to_add' => false, + 'record_ids_to_remove' => false ]; /** @@ -169,8 +170,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'record_ids_to_remove' => 'recordIdsToRemove', - 'record_ids_to_add' => 'recordIdsToAdd' + 'record_ids_to_add' => 'recordIdsToAdd', + 'record_ids_to_remove' => 'recordIdsToRemove' ]; /** @@ -179,8 +180,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'record_ids_to_remove' => 'setRecordIdsToRemove', - 'record_ids_to_add' => 'setRecordIdsToAdd' + 'record_ids_to_add' => 'setRecordIdsToAdd', + 'record_ids_to_remove' => 'setRecordIdsToRemove' ]; /** @@ -189,8 +190,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'record_ids_to_remove' => 'getRecordIdsToRemove', - 'record_ids_to_add' => 'getRecordIdsToAdd' + 'record_ids_to_add' => 'getRecordIdsToAdd', + 'record_ids_to_remove' => 'getRecordIdsToRemove' ]; /** @@ -250,8 +251,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('record_ids_to_remove', $data ?? [], null); $this->setIfExists('record_ids_to_add', $data ?? [], null); + $this->setIfExists('record_ids_to_remove', $data ?? [], null); } /** @@ -281,12 +282,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['record_ids_to_remove'] === null) { - $invalidProperties[] = "'record_ids_to_remove' can't be null"; - } if ($this->container['record_ids_to_add'] === null) { $invalidProperties[] = "'record_ids_to_add' can't be null"; } + if ($this->container['record_ids_to_remove'] === null) { + $invalidProperties[] = "'record_ids_to_remove' can't be null"; + } return $invalidProperties; } @@ -303,66 +304,66 @@ public function valid() /** - * Gets record_ids_to_remove + * Gets record_ids_to_add * * @return string[] */ - public function getRecordIdsToRemove() + public function getRecordIdsToAdd() { - return $this->container['record_ids_to_remove']; + return $this->container['record_ids_to_add']; } /** - * Sets record_ids_to_remove + * Sets record_ids_to_add * - * @param string[] $record_ids_to_remove + * @param string[] $record_ids_to_add record_ids_to_add * * @return self */ - public function setRecordIdsToRemove($record_ids_to_remove) + public function setRecordIdsToAdd($record_ids_to_add) { - if (is_null($record_ids_to_remove)) { - throw new \InvalidArgumentException('non-nullable record_ids_to_remove cannot be null'); + if (is_null($record_ids_to_add)) { + throw new \InvalidArgumentException('non-nullable record_ids_to_add cannot be null'); } - $this->container['record_ids_to_remove'] = $record_ids_to_remove; + $this->container['record_ids_to_add'] = $record_ids_to_add; return $this; } /** - * Gets record_ids_to_add + * Gets record_ids_to_remove * * @return string[] */ - public function getRecordIdsToAdd() + public function getRecordIdsToRemove() { - return $this->container['record_ids_to_add']; + return $this->container['record_ids_to_remove']; } /** - * Sets record_ids_to_add + * Sets record_ids_to_remove * - * @param string[] $record_ids_to_add + * @param string[] $record_ids_to_remove record_ids_to_remove * * @return self */ - public function setRecordIdsToAdd($record_ids_to_add) + public function setRecordIdsToRemove($record_ids_to_remove) { - if (is_null($record_ids_to_add)) { - throw new \InvalidArgumentException('non-nullable record_ids_to_add cannot be null'); + if (is_null($record_ids_to_remove)) { + throw new \InvalidArgumentException('non-nullable record_ids_to_remove cannot be null'); } - $this->container['record_ids_to_add'] = $record_ids_to_add; + $this->container['record_ids_to_remove'] = $record_ids_to_remove; 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]); } @@ -370,12 +371,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; } @@ -400,11 +401,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/Lists/Model/MembershipsUpdateResponse.php b/codegen/Crm/Lists/Model/MembershipsUpdateResponse.php index 484199ad5..7bff0c6e1 100644 --- a/codegen/Crm/Lists/Model/MembershipsUpdateResponse.php +++ b/codegen/Crm/Lists/Model/MembershipsUpdateResponse.php @@ -2,7 +2,7 @@ /** * MembershipsUpdateResponse * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * MembershipsUpdateResponse Class Doc Comment * * @category Class + * @description The IDs of the records that were `added`, `removed`, and/or found to be `missing` as a result of the membership update request. * @package HubSpot\Client\Crm\Lists * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,9 +58,9 @@ class MembershipsUpdateResponse implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ + 'record_ids_missing' => 'string[]', 'record_ids_removed' => 'string[]', - 'records_ids_added' => 'string[]', - 'record_ids_missing' => 'string[]' + 'records_ids_added' => 'string[]' ]; /** @@ -70,9 +71,9 @@ class MembershipsUpdateResponse implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ + 'record_ids_missing' => null, 'record_ids_removed' => null, - 'records_ids_added' => null, - 'record_ids_missing' => null + 'records_ids_added' => null ]; /** @@ -81,9 +82,9 @@ class MembershipsUpdateResponse implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static array $openAPINullables = [ + 'record_ids_missing' => false, 'record_ids_removed' => false, - 'records_ids_added' => false, - 'record_ids_missing' => false + 'records_ids_added' => false ]; /** @@ -172,9 +173,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'record_ids_missing' => 'recordIdsMissing', 'record_ids_removed' => 'recordIdsRemoved', - 'records_ids_added' => 'recordsIdsAdded', - 'record_ids_missing' => 'recordIdsMissing' + 'records_ids_added' => 'recordsIdsAdded' ]; /** @@ -183,9 +184,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'record_ids_missing' => 'setRecordIdsMissing', 'record_ids_removed' => 'setRecordIdsRemoved', - 'records_ids_added' => 'setRecordsIdsAdded', - 'record_ids_missing' => 'setRecordIdsMissing' + 'records_ids_added' => 'setRecordsIdsAdded' ]; /** @@ -194,9 +195,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'record_ids_missing' => 'getRecordIdsMissing', 'record_ids_removed' => 'getRecordIdsRemoved', - 'records_ids_added' => 'getRecordsIdsAdded', - 'record_ids_missing' => 'getRecordIdsMissing' + 'records_ids_added' => 'getRecordsIdsAdded' ]; /** @@ -256,9 +257,9 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('record_ids_missing', $data ?? [], null); $this->setIfExists('record_ids_removed', $data ?? [], null); $this->setIfExists('records_ids_added', $data ?? [], null); - $this->setIfExists('record_ids_missing', $data ?? [], null); } /** @@ -288,15 +289,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['record_ids_missing'] === null) { + $invalidProperties[] = "'record_ids_missing' can't be null"; + } if ($this->container['record_ids_removed'] === null) { $invalidProperties[] = "'record_ids_removed' can't be null"; } if ($this->container['records_ids_added'] === null) { $invalidProperties[] = "'records_ids_added' can't be null"; } - if ($this->container['record_ids_missing'] === null) { - $invalidProperties[] = "'record_ids_missing' can't be null"; - } return $invalidProperties; } @@ -313,93 +314,93 @@ public function valid() /** - * Gets record_ids_removed + * Gets record_ids_missing * * @return string[] */ - public function getRecordIdsRemoved() + public function getRecordIdsMissing() { - return $this->container['record_ids_removed']; + return $this->container['record_ids_missing']; } /** - * Sets record_ids_removed + * Sets record_ids_missing * - * @param string[] $record_ids_removed The IDs of the records that were `removed` from the list. + * @param string[] $record_ids_missing The IDs of the records that were `missing` (e.g. did not exist in the portal) and so were not `added` or `removed`. * * @return self */ - public function setRecordIdsRemoved($record_ids_removed) + public function setRecordIdsMissing($record_ids_missing) { - if (is_null($record_ids_removed)) { - throw new \InvalidArgumentException('non-nullable record_ids_removed cannot be null'); + if (is_null($record_ids_missing)) { + throw new \InvalidArgumentException('non-nullable record_ids_missing cannot be null'); } - $this->container['record_ids_removed'] = $record_ids_removed; + $this->container['record_ids_missing'] = $record_ids_missing; return $this; } /** - * Gets records_ids_added + * Gets record_ids_removed * * @return string[] */ - public function getRecordsIdsAdded() + public function getRecordIdsRemoved() { - return $this->container['records_ids_added']; + return $this->container['record_ids_removed']; } /** - * Sets records_ids_added + * Sets record_ids_removed * - * @param string[] $records_ids_added records_ids_added + * @param string[] $record_ids_removed The IDs of the records that were `removed` from the list. * * @return self */ - public function setRecordsIdsAdded($records_ids_added) + public function setRecordIdsRemoved($record_ids_removed) { - if (is_null($records_ids_added)) { - throw new \InvalidArgumentException('non-nullable records_ids_added cannot be null'); + if (is_null($record_ids_removed)) { + throw new \InvalidArgumentException('non-nullable record_ids_removed cannot be null'); } - $this->container['records_ids_added'] = $records_ids_added; + $this->container['record_ids_removed'] = $record_ids_removed; return $this; } /** - * Gets record_ids_missing + * Gets records_ids_added * * @return string[] */ - public function getRecordIdsMissing() + public function getRecordsIdsAdded() { - return $this->container['record_ids_missing']; + return $this->container['records_ids_added']; } /** - * Sets record_ids_missing + * Sets records_ids_added * - * @param string[] $record_ids_missing The IDs of the records that were `missing` (e.g. did not exist in the portal) and so were not `added` or `removed`. + * @param string[] $records_ids_added records_ids_added * * @return self */ - public function setRecordIdsMissing($record_ids_missing) + public function setRecordsIdsAdded($records_ids_added) { - if (is_null($record_ids_missing)) { - throw new \InvalidArgumentException('non-nullable record_ids_missing cannot be null'); + if (is_null($records_ids_added)) { + throw new \InvalidArgumentException('non-nullable records_ids_added cannot be null'); } - $this->container['record_ids_missing'] = $record_ids_missing; + $this->container['records_ids_added'] = $records_ids_added; 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]); } @@ -407,12 +408,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 +438,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/Lists/Model/ModelInterface.php b/codegen/Crm/Lists/Model/ModelInterface.php index 7b97b91a1..0d57ddf03 100644 --- a/codegen/Crm/Lists/Model/ModelInterface.php +++ b/codegen/Crm/Lists/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists\Model @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** diff --git a/codegen/Crm/Lists/Model/NextPage.php b/codegen/Crm/Lists/Model/NextPage.php index 0fb89f2bb..aafd358f3 100644 --- a/codegen/Crm/Lists/Model/NextPage.php +++ b/codegen/Crm/Lists/Model/NextPage.php @@ -2,7 +2,7 @@ /** * NextPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * NextPage Class Doc Comment * * @category Class + * @description The cursor for the next page of records. * @package HubSpot\Client\Crm\Lists * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,8 +58,8 @@ class NextPage implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'link' => 'string', - 'after' => 'string' + 'after' => 'string', + 'link' => 'string' ]; /** @@ -69,8 +70,8 @@ class NextPage implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'link' => null, - 'after' => null + 'after' => null, + 'link' => null ]; /** @@ -79,8 +80,8 @@ class NextPage implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'link' => false, - 'after' => false + 'after' => false, + 'link' => false ]; /** @@ -169,8 +170,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'link' => 'link', - 'after' => 'after' + 'after' => 'after', + 'link' => 'link' ]; /** @@ -179,8 +180,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'link' => 'setLink', - 'after' => 'setAfter' + 'after' => 'setAfter', + 'link' => 'setLink' ]; /** @@ -189,8 +190,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'link' => 'getLink', - 'after' => 'getAfter' + 'after' => 'getAfter', + 'link' => 'getLink' ]; /** @@ -250,8 +251,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('link', $data ?? [], null); $this->setIfExists('after', $data ?? [], null); + $this->setIfExists('link', $data ?? [], null); } /** @@ -300,66 +301,66 @@ public function valid() /** - * Gets link + * Gets after * - * @return string|null + * @return string */ - public function getLink() + public function getAfter() { - return $this->container['link']; + return $this->container['after']; } /** - * Sets link + * Sets after * - * @param string|null $link A direct link to the request for the next page of records. + * @param string $after The offset for the next page of records. * * @return self */ - public function setLink($link) + public function setAfter($after) { - if (is_null($link)) { - throw new \InvalidArgumentException('non-nullable link cannot be null'); + if (is_null($after)) { + throw new \InvalidArgumentException('non-nullable after cannot be null'); } - $this->container['link'] = $link; + $this->container['after'] = $after; return $this; } /** - * Gets after + * Gets link * - * @return string + * @return string|null */ - public function getAfter() + public function getLink() { - return $this->container['after']; + return $this->container['link']; } /** - * Sets after + * Sets link * - * @param string $after The offset for the next page of records. + * @param string|null $link A direct link to the request for the next page of records. * * @return self */ - public function setAfter($after) + public function setLink($link) { - if (is_null($after)) { - throw new \InvalidArgumentException('non-nullable after cannot be null'); + if (is_null($link)) { + throw new \InvalidArgumentException('non-nullable link cannot be null'); } - $this->container['after'] = $after; + $this->container['link'] = $link; 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 +368,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 +398,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/Lists/Model/Paging.php b/codegen/Crm/Lists/Model/Paging.php index 4098cb017..625e2cdab 100644 --- a/codegen/Crm/Lists/Model/Paging.php +++ b/codegen/Crm/Lists/Model/Paging.php @@ -2,7 +2,7 @@ /** * Paging * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * Paging Class Doc Comment * * @category Class + * @description The cursor to be used for paging through records. * @package HubSpot\Client\Crm\Lists * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -352,11 +353,11 @@ public function setPrev($prev) /** * 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]); } @@ -364,12 +365,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; } @@ -394,11 +395,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/Lists/Model/PreviousPage.php b/codegen/Crm/Lists/Model/PreviousPage.php index ec6ee1839..75987a7b0 100644 --- a/codegen/Crm/Lists/Model/PreviousPage.php +++ b/codegen/Crm/Lists/Model/PreviousPage.php @@ -2,7 +2,7 @@ /** * PreviousPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * PreviousPage Class Doc Comment * * @category Class + * @description The cursor for the previous page of records. * @package HubSpot\Client\Crm\Lists * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -355,11 +356,11 @@ public function setLink($link) /** * 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 +368,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 +398,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/Lists/Model/PublicAbsoluteComparativeTimestampRefineBy.php b/codegen/Crm/Lists/Model/PublicAbsoluteComparativeTimestampRefineBy.php index e4dda9c2d..22b3c97cd 100644 --- a/codegen/Crm/Lists/Model/PublicAbsoluteComparativeTimestampRefineBy.php +++ b/codegen/Crm/Lists/Model/PublicAbsoluteComparativeTimestampRefineBy.php @@ -2,7 +2,7 @@ /** * PublicAbsoluteComparativeTimestampRefineBy * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -58,8 +58,8 @@ class PublicAbsoluteComparativeTimestampRefineBy implements ModelInterface, Arra */ protected static $openAPITypes = [ 'comparison' => 'string', - 'type' => 'string', - 'timestamp' => 'int' + 'timestamp' => 'int', + 'type' => 'string' ]; /** @@ -71,8 +71,8 @@ class PublicAbsoluteComparativeTimestampRefineBy implements ModelInterface, Arra */ protected static $openAPIFormats = [ 'comparison' => null, - 'type' => null, - 'timestamp' => 'int64' + 'timestamp' => 'int64', + 'type' => null ]; /** @@ -82,8 +82,8 @@ class PublicAbsoluteComparativeTimestampRefineBy implements ModelInterface, Arra */ protected static array $openAPINullables = [ 'comparison' => false, - 'type' => false, - 'timestamp' => false + 'timestamp' => false, + 'type' => false ]; /** @@ -173,8 +173,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'comparison' => 'comparison', - 'type' => 'type', - 'timestamp' => 'timestamp' + 'timestamp' => 'timestamp', + 'type' => 'type' ]; /** @@ -184,8 +184,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'comparison' => 'setComparison', - 'type' => 'setType', - 'timestamp' => 'setTimestamp' + 'timestamp' => 'setTimestamp', + 'type' => 'setType' ]; /** @@ -195,8 +195,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'comparison' => 'getComparison', - 'type' => 'getType', - 'timestamp' => 'getTimestamp' + 'timestamp' => 'getTimestamp', + 'type' => 'getType' ]; /** @@ -270,8 +270,8 @@ public function getTypeAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('comparison', $data ?? [], null); - $this->setIfExists('type', $data ?? [], 'ABSOLUTE_COMPARATIVE'); $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'ABSOLUTE_COMPARATIVE'); } /** @@ -304,6 +304,9 @@ public function listInvalidProperties() if ($this->container['comparison'] === null) { $invalidProperties[] = "'comparison' can't be null"; } + if ($this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } @@ -316,9 +319,6 @@ public function listInvalidProperties() ); } - if ($this->container['timestamp'] === null) { - $invalidProperties[] = "'timestamp' can't be null"; - } return $invalidProperties; } @@ -347,7 +347,7 @@ public function getComparison() /** * Sets comparison * - * @param string $comparison comparison + * @param string $comparison Timestamp comparison options (BEFORE, AFTER) * * @return self */ @@ -361,6 +361,33 @@ public function setComparison($comparison) return $this; } + /** + * Gets timestamp + * + * @return int + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param int $timestamp Timestamp to be used in refine by criteria + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + /** * Gets type * @@ -374,7 +401,7 @@ public function getType() /** * Sets type * - * @param string $type type + * @param string $type type of refine by criteria (ABSOLUTE_COMPARATIVE) * * @return self */ @@ -397,41 +424,14 @@ public function setType($type) return $this; } - - /** - * Gets timestamp - * - * @return int - */ - public function getTimestamp() - { - return $this->container['timestamp']; - } - - /** - * Sets timestamp - * - * @param int $timestamp timestamp - * - * @return self - */ - public function setTimestamp($timestamp) - { - if (is_null($timestamp)) { - throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); - } - $this->container['timestamp'] = $timestamp; - - return $this; - } /** * 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]); } @@ -439,12 +439,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; } @@ -469,11 +469,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/Lists/Model/PublicAbsoluteRangedTimestampRefineBy.php b/codegen/Crm/Lists/Model/PublicAbsoluteRangedTimestampRefineBy.php index 9ad0db076..53d4c51d7 100644 --- a/codegen/Crm/Lists/Model/PublicAbsoluteRangedTimestampRefineBy.php +++ b/codegen/Crm/Lists/Model/PublicAbsoluteRangedTimestampRefineBy.php @@ -2,7 +2,7 @@ /** * PublicAbsoluteRangedTimestampRefineBy * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,10 +57,10 @@ class PublicAbsoluteRangedTimestampRefineBy implements ModelInterface, ArrayAcce * @var string[] */ protected static $openAPITypes = [ - 'range_type' => 'string', - 'upper_timestamp' => 'int', 'lower_timestamp' => 'int', - 'type' => 'string' + 'range_type' => 'string', + 'type' => 'string', + 'upper_timestamp' => 'int' ]; /** @@ -71,10 +71,10 @@ class PublicAbsoluteRangedTimestampRefineBy implements ModelInterface, ArrayAcce * @psalm-var array */ protected static $openAPIFormats = [ - 'range_type' => null, - 'upper_timestamp' => 'int64', 'lower_timestamp' => 'int64', - 'type' => null + 'range_type' => null, + 'type' => null, + 'upper_timestamp' => 'int64' ]; /** @@ -83,10 +83,10 @@ class PublicAbsoluteRangedTimestampRefineBy implements ModelInterface, ArrayAcce * @var boolean[] */ protected static array $openAPINullables = [ - 'range_type' => false, - 'upper_timestamp' => false, 'lower_timestamp' => false, - 'type' => false + 'range_type' => false, + 'type' => false, + 'upper_timestamp' => false ]; /** @@ -175,10 +175,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'range_type' => 'rangeType', - 'upper_timestamp' => 'upperTimestamp', 'lower_timestamp' => 'lowerTimestamp', - 'type' => 'type' + 'range_type' => 'rangeType', + 'type' => 'type', + 'upper_timestamp' => 'upperTimestamp' ]; /** @@ -187,10 +187,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'range_type' => 'setRangeType', - 'upper_timestamp' => 'setUpperTimestamp', 'lower_timestamp' => 'setLowerTimestamp', - 'type' => 'setType' + 'range_type' => 'setRangeType', + 'type' => 'setType', + 'upper_timestamp' => 'setUpperTimestamp' ]; /** @@ -199,10 +199,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'range_type' => 'getRangeType', - 'upper_timestamp' => 'getUpperTimestamp', 'lower_timestamp' => 'getLowerTimestamp', - 'type' => 'getType' + 'range_type' => 'getRangeType', + 'type' => 'getType', + 'upper_timestamp' => 'getUpperTimestamp' ]; /** @@ -275,10 +275,10 @@ public function getTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('range_type', $data ?? [], null); - $this->setIfExists('upper_timestamp', $data ?? [], null); $this->setIfExists('lower_timestamp', $data ?? [], null); + $this->setIfExists('range_type', $data ?? [], null); $this->setIfExists('type', $data ?? [], 'ABSOLUTE_RANGED'); + $this->setIfExists('upper_timestamp', $data ?? [], null); } /** @@ -308,15 +308,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['range_type'] === null) { - $invalidProperties[] = "'range_type' can't be null"; - } - if ($this->container['upper_timestamp'] === null) { - $invalidProperties[] = "'upper_timestamp' can't be null"; - } if ($this->container['lower_timestamp'] === null) { $invalidProperties[] = "'lower_timestamp' can't be null"; } + if ($this->container['range_type'] === null) { + $invalidProperties[] = "'range_type' can't be null"; + } if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } @@ -329,6 +326,9 @@ public function listInvalidProperties() ); } + if ($this->container['upper_timestamp'] === null) { + $invalidProperties[] = "'upper_timestamp' can't be null"; + } return $invalidProperties; } @@ -345,82 +345,55 @@ public function valid() /** - * Gets range_type - * - * @return string - */ - public function getRangeType() - { - return $this->container['range_type']; - } - - /** - * Sets range_type - * - * @param string $range_type range_type - * - * @return self - */ - public function setRangeType($range_type) - { - if (is_null($range_type)) { - throw new \InvalidArgumentException('non-nullable range_type cannot be null'); - } - $this->container['range_type'] = $range_type; - - return $this; - } - - /** - * Gets upper_timestamp + * Gets lower_timestamp * * @return int */ - public function getUpperTimestamp() + public function getLowerTimestamp() { - return $this->container['upper_timestamp']; + return $this->container['lower_timestamp']; } /** - * Sets upper_timestamp + * Sets lower_timestamp * - * @param int $upper_timestamp upper_timestamp + * @param int $lower_timestamp Lower range timestamp of refinement criteria * * @return self */ - public function setUpperTimestamp($upper_timestamp) + public function setLowerTimestamp($lower_timestamp) { - if (is_null($upper_timestamp)) { - throw new \InvalidArgumentException('non-nullable upper_timestamp cannot be null'); + if (is_null($lower_timestamp)) { + throw new \InvalidArgumentException('non-nullable lower_timestamp cannot be null'); } - $this->container['upper_timestamp'] = $upper_timestamp; + $this->container['lower_timestamp'] = $lower_timestamp; return $this; } /** - * Gets lower_timestamp + * Gets range_type * - * @return int + * @return string */ - public function getLowerTimestamp() + public function getRangeType() { - return $this->container['lower_timestamp']; + return $this->container['range_type']; } /** - * Sets lower_timestamp + * Sets range_type * - * @param int $lower_timestamp lower_timestamp + * @param string $range_type Type of range of refinement critaria (BETWEEN, NOT_BETWEEN) * * @return self */ - public function setLowerTimestamp($lower_timestamp) + public function setRangeType($range_type) { - if (is_null($lower_timestamp)) { - throw new \InvalidArgumentException('non-nullable lower_timestamp cannot be null'); + if (is_null($range_type)) { + throw new \InvalidArgumentException('non-nullable range_type cannot be null'); } - $this->container['lower_timestamp'] = $lower_timestamp; + $this->container['range_type'] = $range_type; return $this; } @@ -438,7 +411,7 @@ public function getType() /** * Sets type * - * @param string $type type + * @param string $type type of refine by criteria (ABSOLUTE_RANGED) * * @return self */ @@ -461,14 +434,41 @@ public function setType($type) return $this; } + + /** + * Gets upper_timestamp + * + * @return int + */ + public function getUpperTimestamp() + { + return $this->container['upper_timestamp']; + } + + /** + * Sets upper_timestamp + * + * @param int $upper_timestamp Upper range timestamp of refinement criteria + * + * @return self + */ + public function setUpperTimestamp($upper_timestamp) + { + if (is_null($upper_timestamp)) { + throw new \InvalidArgumentException('non-nullable upper_timestamp cannot be null'); + } + $this->container['upper_timestamp'] = $upper_timestamp; + + 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]); } @@ -476,12 +476,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; } @@ -506,11 +506,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/Lists/Model/PublicAdsSearchFilter.php b/codegen/Crm/Lists/Model/PublicAdsSearchFilter.php index d59e7cc61..ee5c59d74 100644 --- a/codegen/Crm/Lists/Model/PublicAdsSearchFilter.php +++ b/codegen/Crm/Lists/Model/PublicAdsSearchFilter.php @@ -2,7 +2,7 @@ /** * PublicAdsSearchFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,12 +57,12 @@ class PublicAdsSearchFilter implements ModelInterface, ArrayAccess, \JsonSeriali * @var string[] */ protected static $openAPITypes = [ - 'search_terms' => 'string[]', - 'entity_type' => 'string', 'ad_network' => 'string', - 'search_term_type' => 'string', + 'entity_type' => 'string', 'filter_type' => 'string', - 'operator' => 'string' + 'operator' => 'string', + 'search_term_type' => 'string', + 'search_terms' => 'string[]' ]; /** @@ -73,12 +73,12 @@ class PublicAdsSearchFilter implements ModelInterface, ArrayAccess, \JsonSeriali * @psalm-var array */ protected static $openAPIFormats = [ - 'search_terms' => null, - 'entity_type' => null, 'ad_network' => null, - 'search_term_type' => null, + 'entity_type' => null, 'filter_type' => null, - 'operator' => null + 'operator' => null, + 'search_term_type' => null, + 'search_terms' => null ]; /** @@ -87,12 +87,12 @@ class PublicAdsSearchFilter implements ModelInterface, ArrayAccess, \JsonSeriali * @var boolean[] */ protected static array $openAPINullables = [ - 'search_terms' => false, - 'entity_type' => false, 'ad_network' => false, - 'search_term_type' => false, + 'entity_type' => false, 'filter_type' => false, - 'operator' => false + 'operator' => false, + 'search_term_type' => false, + 'search_terms' => false ]; /** @@ -181,12 +181,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'search_terms' => 'searchTerms', - 'entity_type' => 'entityType', 'ad_network' => 'adNetwork', - 'search_term_type' => 'searchTermType', + 'entity_type' => 'entityType', 'filter_type' => 'filterType', - 'operator' => 'operator' + 'operator' => 'operator', + 'search_term_type' => 'searchTermType', + 'search_terms' => 'searchTerms' ]; /** @@ -195,12 +195,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'search_terms' => 'setSearchTerms', - 'entity_type' => 'setEntityType', 'ad_network' => 'setAdNetwork', - 'search_term_type' => 'setSearchTermType', + 'entity_type' => 'setEntityType', 'filter_type' => 'setFilterType', - 'operator' => 'setOperator' + 'operator' => 'setOperator', + 'search_term_type' => 'setSearchTermType', + 'search_terms' => 'setSearchTerms' ]; /** @@ -209,12 +209,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'search_terms' => 'getSearchTerms', - 'entity_type' => 'getEntityType', 'ad_network' => 'getAdNetwork', - 'search_term_type' => 'getSearchTermType', + 'entity_type' => 'getEntityType', 'filter_type' => 'getFilterType', - 'operator' => 'getOperator' + 'operator' => 'getOperator', + 'search_term_type' => 'getSearchTermType', + 'search_terms' => 'getSearchTerms' ]; /** @@ -287,12 +287,12 @@ public function getFilterTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('search_terms', $data ?? [], null); - $this->setIfExists('entity_type', $data ?? [], null); $this->setIfExists('ad_network', $data ?? [], null); - $this->setIfExists('search_term_type', $data ?? [], null); + $this->setIfExists('entity_type', $data ?? [], null); $this->setIfExists('filter_type', $data ?? [], 'ADS_SEARCH'); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('search_term_type', $data ?? [], null); + $this->setIfExists('search_terms', $data ?? [], null); } /** @@ -322,17 +322,11 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['search_terms'] === null) { - $invalidProperties[] = "'search_terms' can't be null"; - } - if ($this->container['entity_type'] === null) { - $invalidProperties[] = "'entity_type' can't be null"; - } if ($this->container['ad_network'] === null) { $invalidProperties[] = "'ad_network' can't be null"; } - if ($this->container['search_term_type'] === null) { - $invalidProperties[] = "'search_term_type' can't be null"; + if ($this->container['entity_type'] === null) { + $invalidProperties[] = "'entity_type' can't be null"; } if ($this->container['filter_type'] === null) { $invalidProperties[] = "'filter_type' can't be null"; @@ -349,6 +343,12 @@ public function listInvalidProperties() if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } + if ($this->container['search_term_type'] === null) { + $invalidProperties[] = "'search_term_type' can't be null"; + } + if ($this->container['search_terms'] === null) { + $invalidProperties[] = "'search_terms' can't be null"; + } return $invalidProperties; } @@ -365,28 +365,28 @@ public function valid() /** - * Gets search_terms + * Gets ad_network * - * @return string[] + * @return string */ - public function getSearchTerms() + public function getAdNetwork() { - return $this->container['search_terms']; + return $this->container['ad_network']; } /** - * Sets search_terms + * Sets ad_network * - * @param string[] $search_terms search_terms + * @param string $ad_network Ad network (ADWORDS, FACEBOOK, LINKEDIN, ALL) * * @return self */ - public function setSearchTerms($search_terms) + public function setAdNetwork($ad_network) { - if (is_null($search_terms)) { - throw new \InvalidArgumentException('non-nullable search_terms cannot be null'); + if (is_null($ad_network)) { + throw new \InvalidArgumentException('non-nullable ad_network cannot be null'); } - $this->container['search_terms'] = $search_terms; + $this->container['ad_network'] = $ad_network; return $this; } @@ -404,7 +404,7 @@ public function getEntityType() /** * Sets entity_type * - * @param string $entity_type entity_type + * @param string $entity_type Type of ad entity (KEYWORD, ADGROUP, AD, CAMPAIGN) * * @return self */ @@ -419,130 +419,130 @@ public function setEntityType($entity_type) } /** - * Gets ad_network + * Gets filter_type * * @return string */ - public function getAdNetwork() + public function getFilterType() { - return $this->container['ad_network']; + return $this->container['filter_type']; } /** - * Sets ad_network + * Sets filter_type * - * @param string $ad_network ad_network + * @param string $filter_type Type of the filter (ADS_SEARCH) * * @return self */ - public function setAdNetwork($ad_network) + public function setFilterType($filter_type) { - if (is_null($ad_network)) { - throw new \InvalidArgumentException('non-nullable ad_network cannot be null'); + if (is_null($filter_type)) { + throw new \InvalidArgumentException('non-nullable filter_type cannot be null'); } - $this->container['ad_network'] = $ad_network; + $allowedValues = $this->getFilterTypeAllowableValues(); + if (!in_array($filter_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'filter_type', must be one of '%s'", + $filter_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['filter_type'] = $filter_type; return $this; } /** - * Gets search_term_type + * Gets operator * * @return string */ - public function getSearchTermType() + public function getOperator() { - return $this->container['search_term_type']; + return $this->container['operator']; } /** - * Sets search_term_type + * Sets operator * - * @param string $search_term_type search_term_type + * @param string $operator Operator to be applied (CONTAINS, IS_EQUAL_TO, ENDS_WITH, STARTS_WITH, IS_KNOWN) * * @return self */ - public function setSearchTermType($search_term_type) + public function setOperator($operator) { - if (is_null($search_term_type)) { - throw new \InvalidArgumentException('non-nullable search_term_type cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['search_term_type'] = $search_term_type; + $this->container['operator'] = $operator; return $this; } /** - * Gets filter_type + * Gets search_term_type * * @return string */ - public function getFilterType() + public function getSearchTermType() { - return $this->container['filter_type']; + return $this->container['search_term_type']; } /** - * Sets filter_type + * Sets search_term_type * - * @param string $filter_type filter_type + * @param string $search_term_type Search term to match an ad * * @return self */ - public function setFilterType($filter_type) + public function setSearchTermType($search_term_type) { - if (is_null($filter_type)) { - throw new \InvalidArgumentException('non-nullable filter_type cannot be null'); - } - $allowedValues = $this->getFilterTypeAllowableValues(); - if (!in_array($filter_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'filter_type', must be one of '%s'", - $filter_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($search_term_type)) { + throw new \InvalidArgumentException('non-nullable search_term_type cannot be null'); } - $this->container['filter_type'] = $filter_type; + $this->container['search_term_type'] = $search_term_type; return $this; } /** - * Gets operator + * Gets search_terms * - * @return string + * @return string[] */ - public function getOperator() + public function getSearchTerms() { - return $this->container['operator']; + return $this->container['search_terms']; } /** - * Sets operator + * Sets search_terms * - * @param string $operator operator + * @param string[] $search_terms search_terms * * @return self */ - public function setOperator($operator) + public function setSearchTerms($search_terms) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); + if (is_null($search_terms)) { + throw new \InvalidArgumentException('non-nullable search_terms cannot be null'); } - $this->container['operator'] = $operator; + $this->container['search_terms'] = $search_terms; 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]); } @@ -550,12 +550,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; } @@ -580,11 +580,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/Lists/Model/PublicAdsTimeFilter.php b/codegen/Crm/Lists/Model/PublicAdsTimeFilter.php index 1a38af3a9..a329b1c7a 100644 --- a/codegen/Crm/Lists/Model/PublicAdsTimeFilter.php +++ b/codegen/Crm/Lists/Model/PublicAdsTimeFilter.php @@ -2,7 +2,7 @@ /** * PublicAdsTimeFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,8 +57,8 @@ class PublicAdsTimeFilter implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'pruning_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', - 'filter_type' => 'string' + 'filter_type' => 'string', + 'pruning_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicAdsTimeFilterPruningRefineBy' ]; /** @@ -69,8 +69,8 @@ class PublicAdsTimeFilter implements ModelInterface, ArrayAccess, \JsonSerializa * @psalm-var array */ protected static $openAPIFormats = [ - 'pruning_refine_by' => null, - 'filter_type' => null + 'filter_type' => null, + 'pruning_refine_by' => null ]; /** @@ -79,8 +79,8 @@ class PublicAdsTimeFilter implements ModelInterface, ArrayAccess, \JsonSerializa * @var boolean[] */ protected static array $openAPINullables = [ - 'pruning_refine_by' => false, - 'filter_type' => false + 'filter_type' => false, + 'pruning_refine_by' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'pruning_refine_by' => 'pruningRefineBy', - 'filter_type' => 'filterType' + 'filter_type' => 'filterType', + 'pruning_refine_by' => 'pruningRefineBy' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'pruning_refine_by' => 'setPruningRefineBy', - 'filter_type' => 'setFilterType' + 'filter_type' => 'setFilterType', + 'pruning_refine_by' => 'setPruningRefineBy' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'pruning_refine_by' => 'getPruningRefineBy', - 'filter_type' => 'getFilterType' + 'filter_type' => 'getFilterType', + 'pruning_refine_by' => 'getPruningRefineBy' ]; /** @@ -263,8 +263,8 @@ public function getFilterTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('pruning_refine_by', $data ?? [], null); $this->setIfExists('filter_type', $data ?? [], 'ADS_TIME'); + $this->setIfExists('pruning_refine_by', $data ?? [], null); } /** @@ -294,9 +294,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['pruning_refine_by'] === null) { - $invalidProperties[] = "'pruning_refine_by' can't be null"; - } if ($this->container['filter_type'] === null) { $invalidProperties[] = "'filter_type' can't be null"; } @@ -309,6 +306,9 @@ public function listInvalidProperties() ); } + if ($this->container['pruning_refine_by'] === null) { + $invalidProperties[] = "'pruning_refine_by' can't be null"; + } return $invalidProperties; } @@ -324,33 +324,6 @@ public function valid() } - /** - * Gets pruning_refine_by - * - * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy - */ - public function getPruningRefineBy() - { - return $this->container['pruning_refine_by']; - } - - /** - * Sets pruning_refine_by - * - * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy $pruning_refine_by pruning_refine_by - * - * @return self - */ - public function setPruningRefineBy($pruning_refine_by) - { - if (is_null($pruning_refine_by)) { - throw new \InvalidArgumentException('non-nullable pruning_refine_by cannot be null'); - } - $this->container['pruning_refine_by'] = $pruning_refine_by; - - return $this; - } - /** * Gets filter_type * @@ -364,7 +337,7 @@ public function getFilterType() /** * Sets filter_type * - * @param string $filter_type filter_type + * @param string $filter_type Filter type (ADS_TIME) * * @return self */ @@ -387,14 +360,41 @@ public function setFilterType($filter_type) return $this; } + + /** + * Gets pruning_refine_by + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicAdsTimeFilterPruningRefineBy + */ + public function getPruningRefineBy() + { + return $this->container['pruning_refine_by']; + } + + /** + * Sets pruning_refine_by + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicAdsTimeFilterPruningRefineBy $pruning_refine_by pruning_refine_by + * + * @return self + */ + public function setPruningRefineBy($pruning_refine_by) + { + if (is_null($pruning_refine_by)) { + throw new \InvalidArgumentException('non-nullable pruning_refine_by cannot be null'); + } + $this->container['pruning_refine_by'] = $pruning_refine_by; + + 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]); } @@ -402,12 +402,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; } @@ -432,11 +432,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/Lists/Model/PublicAdsTimeFilterPruningRefineBy.php b/codegen/Crm/Lists/Model/PublicAdsTimeFilterPruningRefineBy.php new file mode 100644 index 000000000..db72ac62d --- /dev/null +++ b/codegen/Crm/Lists/Model/PublicAdsTimeFilterPruningRefineBy.php @@ -0,0 +1,1175 @@ + + */ +class PublicAdsTimeFilterPruningRefineBy implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicAdsTimeFilter_pruningRefineBy'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'max_occurrences' => 'int', + 'min_occurrences' => 'int', + 'type' => 'string', + 'set_type' => 'string', + 'comparison' => 'string', + 'time_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', + 'lower_bound_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', + 'range_type' => 'string', + 'upper_bound_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', + 'timestamp' => 'int', + 'lower_timestamp' => 'int', + 'upper_timestamp' => 'int', + 'endpoint_behavior' => 'string', + 'include_objects_with_no_value_set' => 'bool', + 'operation_type' => 'string', + 'operator' => 'string', + 'property_parser' => 'string', + 'time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint', + 'lower_bound_endpoint_behavior' => 'string', + 'lower_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'string', + 'upper_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'max_occurrences' => 'int32', + 'min_occurrences' => 'int32', + 'type' => null, + 'set_type' => null, + 'comparison' => null, + 'time_offset' => null, + 'lower_bound_offset' => null, + 'range_type' => null, + 'upper_bound_offset' => null, + 'timestamp' => 'int64', + 'lower_timestamp' => 'int64', + 'upper_timestamp' => 'int64', + 'endpoint_behavior' => null, + 'include_objects_with_no_value_set' => null, + 'operation_type' => null, + 'operator' => null, + 'property_parser' => null, + 'time_point' => null, + 'lower_bound_endpoint_behavior' => null, + 'lower_bound_time_point' => null, + 'upper_bound_endpoint_behavior' => null, + 'upper_bound_time_point' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'max_occurrences' => false, + 'min_occurrences' => false, + 'type' => false, + 'set_type' => false, + 'comparison' => false, + 'time_offset' => false, + 'lower_bound_offset' => false, + 'range_type' => false, + 'upper_bound_offset' => false, + 'timestamp' => false, + 'lower_timestamp' => false, + 'upper_timestamp' => false, + 'endpoint_behavior' => false, + 'include_objects_with_no_value_set' => false, + 'operation_type' => false, + 'operator' => false, + 'property_parser' => false, + 'time_point' => false, + 'lower_bound_endpoint_behavior' => false, + 'lower_bound_time_point' => false, + 'upper_bound_endpoint_behavior' => false, + 'upper_bound_time_point' => 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 = [ + 'max_occurrences' => 'maxOccurrences', + 'min_occurrences' => 'minOccurrences', + 'type' => 'type', + 'set_type' => 'setType', + 'comparison' => 'comparison', + 'time_offset' => 'timeOffset', + 'lower_bound_offset' => 'lowerBoundOffset', + 'range_type' => 'rangeType', + 'upper_bound_offset' => 'upperBoundOffset', + 'timestamp' => 'timestamp', + 'lower_timestamp' => 'lowerTimestamp', + 'upper_timestamp' => 'upperTimestamp', + 'endpoint_behavior' => 'endpointBehavior', + 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', + 'operation_type' => 'operationType', + 'operator' => 'operator', + 'property_parser' => 'propertyParser', + 'time_point' => 'timePoint', + 'lower_bound_endpoint_behavior' => 'lowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'lowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'upperBoundEndpointBehavior', + 'upper_bound_time_point' => 'upperBoundTimePoint' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'max_occurrences' => 'setMaxOccurrences', + 'min_occurrences' => 'setMinOccurrences', + 'type' => 'setType', + 'set_type' => 'setSetType', + 'comparison' => 'setComparison', + 'time_offset' => 'setTimeOffset', + 'lower_bound_offset' => 'setLowerBoundOffset', + 'range_type' => 'setRangeType', + 'upper_bound_offset' => 'setUpperBoundOffset', + 'timestamp' => 'setTimestamp', + 'lower_timestamp' => 'setLowerTimestamp', + 'upper_timestamp' => 'setUpperTimestamp', + 'endpoint_behavior' => 'setEndpointBehavior', + 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', + 'operation_type' => 'setOperationType', + 'operator' => 'setOperator', + 'property_parser' => 'setPropertyParser', + 'time_point' => 'setTimePoint', + 'lower_bound_endpoint_behavior' => 'setLowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'setLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'setUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'setUpperBoundTimePoint' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'max_occurrences' => 'getMaxOccurrences', + 'min_occurrences' => 'getMinOccurrences', + 'type' => 'getType', + 'set_type' => 'getSetType', + 'comparison' => 'getComparison', + 'time_offset' => 'getTimeOffset', + 'lower_bound_offset' => 'getLowerBoundOffset', + 'range_type' => 'getRangeType', + 'upper_bound_offset' => 'getUpperBoundOffset', + 'timestamp' => 'getTimestamp', + 'lower_timestamp' => 'getLowerTimestamp', + 'upper_timestamp' => 'getUpperTimestamp', + 'endpoint_behavior' => 'getEndpointBehavior', + 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', + 'operation_type' => 'getOperationType', + 'operator' => 'getOperator', + 'property_parser' => 'getPropertyParser', + 'time_point' => 'getTimePoint', + 'lower_bound_endpoint_behavior' => 'getLowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'getLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'getUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'getUpperBoundTimePoint' + ]; + + /** + * 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('max_occurrences', $data ?? [], null); + $this->setIfExists('min_occurrences', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('set_type', $data ?? [], null); + $this->setIfExists('comparison', $data ?? [], null); + $this->setIfExists('time_offset', $data ?? [], null); + $this->setIfExists('lower_bound_offset', $data ?? [], null); + $this->setIfExists('range_type', $data ?? [], null); + $this->setIfExists('upper_bound_offset', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('lower_timestamp', $data ?? [], null); + $this->setIfExists('upper_timestamp', $data ?? [], null); + $this->setIfExists('endpoint_behavior', $data ?? [], null); + $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); + $this->setIfExists('operation_type', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('property_parser', $data ?? [], null); + $this->setIfExists('time_point', $data ?? [], null); + $this->setIfExists('lower_bound_endpoint_behavior', $data ?? [], null); + $this->setIfExists('lower_bound_time_point', $data ?? [], null); + $this->setIfExists('upper_bound_endpoint_behavior', $data ?? [], null); + $this->setIfExists('upper_bound_time_point', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * 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['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['set_type'] === null) { + $invalidProperties[] = "'set_type' can't be null"; + } + if ($this->container['comparison'] === null) { + $invalidProperties[] = "'comparison' can't be null"; + } + if ($this->container['time_offset'] === null) { + $invalidProperties[] = "'time_offset' can't be null"; + } + if ($this->container['lower_bound_offset'] === null) { + $invalidProperties[] = "'lower_bound_offset' can't be null"; + } + if ($this->container['range_type'] === null) { + $invalidProperties[] = "'range_type' can't be null"; + } + if ($this->container['upper_bound_offset'] === null) { + $invalidProperties[] = "'upper_bound_offset' can't be null"; + } + if ($this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } + if ($this->container['lower_timestamp'] === null) { + $invalidProperties[] = "'lower_timestamp' can't be null"; + } + if ($this->container['upper_timestamp'] === null) { + $invalidProperties[] = "'upper_timestamp' can't be null"; + } + if ($this->container['include_objects_with_no_value_set'] === null) { + $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; + } + if ($this->container['operation_type'] === null) { + $invalidProperties[] = "'operation_type' can't be null"; + } + if ($this->container['operator'] === null) { + $invalidProperties[] = "'operator' can't be null"; + } + if ($this->container['time_point'] === null) { + $invalidProperties[] = "'time_point' can't be null"; + } + if ($this->container['lower_bound_time_point'] === null) { + $invalidProperties[] = "'lower_bound_time_point' can't be null"; + } + if ($this->container['upper_bound_time_point'] === null) { + $invalidProperties[] = "'upper_bound_time_point' 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 max_occurrences + * + * @return int|null + */ + public function getMaxOccurrences() + { + return $this->container['max_occurrences']; + } + + /** + * Sets max_occurrences + * + * @param int|null $max_occurrences The maximum number of occurrences allowed. + * + * @return self + */ + public function setMaxOccurrences($max_occurrences) + { + if (is_null($max_occurrences)) { + throw new \InvalidArgumentException('non-nullable max_occurrences cannot be null'); + } + $this->container['max_occurrences'] = $max_occurrences; + + return $this; + } + + /** + * Gets min_occurrences + * + * @return int|null + */ + public function getMinOccurrences() + { + return $this->container['min_occurrences']; + } + + /** + * Sets min_occurrences + * + * @param int|null $min_occurrences The minimum number of occurrences required. + * + * @return self + */ + public function setMinOccurrences($min_occurrences) + { + if (is_null($min_occurrences)) { + throw new \InvalidArgumentException('non-nullable min_occurrences cannot be null'); + } + $this->container['min_occurrences'] = $min_occurrences; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Defines the type of operation being performed. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets set_type + * + * @return string + */ + public function getSetType() + { + return $this->container['set_type']; + } + + /** + * Sets set_type + * + * @param string $set_type Indicates the specific set type used in the refinement (ALL, ALL_INCLUDE_EMPTY, ANY, NONE, NONE_EXCLUDE_EMPTY, ANY_INCLUDE_EMPTY). + * + * @return self + */ + public function setSetType($set_type) + { + if (is_null($set_type)) { + throw new \InvalidArgumentException('non-nullable set_type cannot be null'); + } + $this->container['set_type'] = $set_type; + + return $this; + } + + /** + * Gets comparison + * + * @return string + */ + public function getComparison() + { + return $this->container['comparison']; + } + + /** + * Sets comparison + * + * @param string $comparison Timestamp comparison options (BEFORE, AFTER) + * + * @return self + */ + public function setComparison($comparison) + { + if (is_null($comparison)) { + throw new \InvalidArgumentException('non-nullable comparison cannot be null'); + } + $this->container['comparison'] = $comparison; + + return $this; + } + + /** + * Gets time_offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset + */ + public function getTimeOffset() + { + return $this->container['time_offset']; + } + + /** + * Sets time_offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $time_offset time_offset + * + * @return self + */ + public function setTimeOffset($time_offset) + { + if (is_null($time_offset)) { + throw new \InvalidArgumentException('non-nullable time_offset cannot be null'); + } + $this->container['time_offset'] = $time_offset; + + return $this; + } + + /** + * Gets lower_bound_offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset + */ + public function getLowerBoundOffset() + { + return $this->container['lower_bound_offset']; + } + + /** + * Sets lower_bound_offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $lower_bound_offset lower_bound_offset + * + * @return self + */ + public function setLowerBoundOffset($lower_bound_offset) + { + if (is_null($lower_bound_offset)) { + throw new \InvalidArgumentException('non-nullable lower_bound_offset cannot be null'); + } + $this->container['lower_bound_offset'] = $lower_bound_offset; + + return $this; + } + + /** + * Gets range_type + * + * @return string + */ + public function getRangeType() + { + return $this->container['range_type']; + } + + /** + * Sets range_type + * + * @param string $range_type Type of range of refinement critaria (BETWEEN, NOT_BETWEEN) + * + * @return self + */ + public function setRangeType($range_type) + { + if (is_null($range_type)) { + throw new \InvalidArgumentException('non-nullable range_type cannot be null'); + } + $this->container['range_type'] = $range_type; + + return $this; + } + + /** + * Gets upper_bound_offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset + */ + public function getUpperBoundOffset() + { + return $this->container['upper_bound_offset']; + } + + /** + * Sets upper_bound_offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $upper_bound_offset upper_bound_offset + * + * @return self + */ + public function setUpperBoundOffset($upper_bound_offset) + { + if (is_null($upper_bound_offset)) { + throw new \InvalidArgumentException('non-nullable upper_bound_offset cannot be null'); + } + $this->container['upper_bound_offset'] = $upper_bound_offset; + + return $this; + } + + /** + * Gets timestamp + * + * @return int + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param int $timestamp Timestamp to be used in refine by criteria + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets lower_timestamp + * + * @return int + */ + public function getLowerTimestamp() + { + return $this->container['lower_timestamp']; + } + + /** + * Sets lower_timestamp + * + * @param int $lower_timestamp Lower range timestamp of refinement criteria + * + * @return self + */ + public function setLowerTimestamp($lower_timestamp) + { + if (is_null($lower_timestamp)) { + throw new \InvalidArgumentException('non-nullable lower_timestamp cannot be null'); + } + $this->container['lower_timestamp'] = $lower_timestamp; + + return $this; + } + + /** + * Gets upper_timestamp + * + * @return int + */ + public function getUpperTimestamp() + { + return $this->container['upper_timestamp']; + } + + /** + * Sets upper_timestamp + * + * @param int $upper_timestamp Upper range timestamp of refinement criteria + * + * @return self + */ + public function setUpperTimestamp($upper_timestamp) + { + if (is_null($upper_timestamp)) { + throw new \InvalidArgumentException('non-nullable upper_timestamp cannot be null'); + } + $this->container['upper_timestamp'] = $upper_timestamp; + + return $this; + } + + /** + * Gets endpoint_behavior + * + * @return string|null + */ + public function getEndpointBehavior() + { + return $this->container['endpoint_behavior']; + } + + /** + * Sets endpoint_behavior + * + * @param string|null $endpoint_behavior Describes the behavior at the endpoint of the time point operation. + * + * @return self + */ + public function setEndpointBehavior($endpoint_behavior) + { + if (is_null($endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable endpoint_behavior cannot be null'); + } + $this->container['endpoint_behavior'] = $endpoint_behavior; + + return $this; + } + + /** + * Gets include_objects_with_no_value_set + * + * @return bool + */ + public function getIncludeObjectsWithNoValueSet() + { + return $this->container['include_objects_with_no_value_set']; + } + + /** + * Sets include_objects_with_no_value_set + * + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. + * + * @return self + */ + public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_set) + { + if (is_null($include_objects_with_no_value_set)) { + throw new \InvalidArgumentException('non-nullable include_objects_with_no_value_set cannot be null'); + } + $this->container['include_objects_with_no_value_set'] = $include_objects_with_no_value_set; + + return $this; + } + + /** + * Gets operation_type + * + * @return string + */ + public function getOperationType() + { + return $this->container['operation_type']; + } + + /** + * Sets operation_type + * + * @param string $operation_type Specifies the type of operation (TIME_RANGED). + * + * @return self + */ + public function setOperationType($operation_type) + { + if (is_null($operation_type)) { + throw new \InvalidArgumentException('non-nullable operation_type cannot be null'); + } + $this->container['operation_type'] = $operation_type; + + return $this; + } + + /** + * Gets operator + * + * @return string + */ + public function getOperator() + { + return $this->container['operator']; + } + + /** + * Sets operator + * + * @param string $operator Defines the operation to be applied within the time range (IS_BETWEEN, IS_NOT_BETWEEN). + * + * @return self + */ + public function setOperator($operator) + { + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); + } + $this->container['operator'] = $operator; + + return $this; + } + + /** + * Gets property_parser + * + * @return string|null + */ + public function getPropertyParser() + { + return $this->container['property_parser']; + } + + /** + * Sets property_parser + * + * @param string|null $property_parser Specifies the parser used for the property in the operation. + * + * @return self + */ + public function setPropertyParser($property_parser) + { + if (is_null($property_parser)) { + throw new \InvalidArgumentException('non-nullable property_parser cannot be null'); + } + $this->container['property_parser'] = $property_parser; + + return $this; + } + + /** + * Gets time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint + */ + public function getTimePoint() + { + return $this->container['time_point']; + } + + /** + * Sets time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint $time_point time_point + * + * @return self + */ + public function setTimePoint($time_point) + { + if (is_null($time_point)) { + throw new \InvalidArgumentException('non-nullable time_point cannot be null'); + } + $this->container['time_point'] = $time_point; + + return $this; + } + + /** + * Gets lower_bound_endpoint_behavior + * + * @return string|null + */ + public function getLowerBoundEndpointBehavior() + { + return $this->container['lower_bound_endpoint_behavior']; + } + + /** + * Sets lower_bound_endpoint_behavior + * + * @param string|null $lower_bound_endpoint_behavior Describes the behavior at the lower bound endpoint of the time range. + * + * @return self + */ + public function setLowerBoundEndpointBehavior($lower_bound_endpoint_behavior) + { + if (is_null($lower_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable lower_bound_endpoint_behavior cannot be null'); + } + $this->container['lower_bound_endpoint_behavior'] = $lower_bound_endpoint_behavior; + + return $this; + } + + /** + * Gets lower_bound_time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint + */ + public function getLowerBoundTimePoint() + { + return $this->container['lower_bound_time_point']; + } + + /** + * Sets lower_bound_time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint $lower_bound_time_point lower_bound_time_point + * + * @return self + */ + public function setLowerBoundTimePoint($lower_bound_time_point) + { + if (is_null($lower_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable lower_bound_time_point cannot be null'); + } + $this->container['lower_bound_time_point'] = $lower_bound_time_point; + + return $this; + } + + /** + * Gets upper_bound_endpoint_behavior + * + * @return string|null + */ + public function getUpperBoundEndpointBehavior() + { + return $this->container['upper_bound_endpoint_behavior']; + } + + /** + * Sets upper_bound_endpoint_behavior + * + * @param string|null $upper_bound_endpoint_behavior Describes the behavior at the upper bound endpoint of the time range. + * + * @return self + */ + public function setUpperBoundEndpointBehavior($upper_bound_endpoint_behavior) + { + if (is_null($upper_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable upper_bound_endpoint_behavior cannot be null'); + } + $this->container['upper_bound_endpoint_behavior'] = $upper_bound_endpoint_behavior; + + return $this; + } + + /** + * Gets upper_bound_time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint + */ + public function getUpperBoundTimePoint() + { + return $this->container['upper_bound_time_point']; + } + + /** + * Sets upper_bound_time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint $upper_bound_time_point upper_bound_time_point + * + * @return self + */ + public function setUpperBoundTimePoint($upper_bound_time_point) + { + if (is_null($upper_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable upper_bound_time_point cannot be null'); + } + $this->container['upper_bound_time_point'] = $upper_bound_time_point; + + 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/Lists/Model/PublicAllHistoryRefineBy.php b/codegen/Crm/Lists/Model/PublicAllHistoryRefineBy.php index 0a07ad75f..b66eec99c 100644 --- a/codegen/Crm/Lists/Model/PublicAllHistoryRefineBy.php +++ b/codegen/Crm/Lists/Model/PublicAllHistoryRefineBy.php @@ -2,7 +2,7 @@ /** * PublicAllHistoryRefineBy * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -327,7 +327,7 @@ public function getType() /** * Sets type * - * @param string $type type + * @param string $type Type of refine by (ALL_HISTORY) * * @return self */ @@ -353,11 +353,11 @@ public function setType($type) /** * 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]); } @@ -365,12 +365,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; } @@ -395,11 +395,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/Lists/Model/PublicAllPropertyTypesOperation.php b/codegen/Crm/Lists/Model/PublicAllPropertyTypesOperation.php index 52c4312a1..9903f2e4a 100644 --- a/codegen/Crm/Lists/Model/PublicAllPropertyTypesOperation.php +++ b/codegen/Crm/Lists/Model/PublicAllPropertyTypesOperation.php @@ -2,7 +2,7 @@ /** * PublicAllPropertyTypesOperation * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -347,7 +347,7 @@ public function getIncludeObjectsWithNoValueSet() /** * Sets include_objects_with_no_value_set * - * @param bool $include_objects_with_no_value_set include_objects_with_no_value_set + * @param bool $include_objects_with_no_value_set Indication of whether objects with no value should be included * * @return self */ @@ -374,7 +374,7 @@ public function getOperationType() /** * Sets operation_type * - * @param string $operation_type operation_type + * @param string $operation_type Type of operation (ALL_PROPERTY) * * @return self */ @@ -411,7 +411,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Operator to be applied (IS_KNOWN, IS_UNKNOWN) * * @return self */ @@ -427,11 +427,11 @@ public function setOperator($operator) /** * 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]); } @@ -439,12 +439,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; } @@ -469,11 +469,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/Lists/Model/PublicAndFilterBranch.php b/codegen/Crm/Lists/Model/PublicAndFilterBranch.php index 60d9370d9..e9aef3fc8 100644 --- a/codegen/Crm/Lists/Model/PublicAndFilterBranch.php +++ b/codegen/Crm/Lists/Model/PublicAndFilterBranch.php @@ -2,7 +2,7 @@ /** * PublicAndFilterBranch * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,9 +57,9 @@ class PublicAndFilterBranch implements ModelInterface, ArrayAccess, \JsonSeriali * @var string[] */ protected static $openAPITypes = [ + 'filter_branch_operator' => 'string', 'filter_branch_type' => 'string', 'filter_branches' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[]', - 'filter_branch_operator' => 'string', 'filters' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[]' ]; @@ -71,9 +71,9 @@ class PublicAndFilterBranch implements ModelInterface, ArrayAccess, \JsonSeriali * @psalm-var array */ protected static $openAPIFormats = [ + 'filter_branch_operator' => null, 'filter_branch_type' => null, 'filter_branches' => null, - 'filter_branch_operator' => null, 'filters' => null ]; @@ -83,9 +83,9 @@ class PublicAndFilterBranch implements ModelInterface, ArrayAccess, \JsonSeriali * @var boolean[] */ protected static array $openAPINullables = [ + 'filter_branch_operator' => false, 'filter_branch_type' => false, 'filter_branches' => false, - 'filter_branch_operator' => false, 'filters' => false ]; @@ -175,9 +175,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'filter_branch_operator' => 'filterBranchOperator', 'filter_branch_type' => 'filterBranchType', 'filter_branches' => 'filterBranches', - 'filter_branch_operator' => 'filterBranchOperator', 'filters' => 'filters' ]; @@ -187,9 +187,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'filter_branch_operator' => 'setFilterBranchOperator', 'filter_branch_type' => 'setFilterBranchType', 'filter_branches' => 'setFilterBranches', - 'filter_branch_operator' => 'setFilterBranchOperator', 'filters' => 'setFilters' ]; @@ -199,9 +199,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'filter_branch_operator' => 'getFilterBranchOperator', 'filter_branch_type' => 'getFilterBranchType', 'filter_branches' => 'getFilterBranches', - 'filter_branch_operator' => 'getFilterBranchOperator', 'filters' => 'getFilters' ]; @@ -275,9 +275,9 @@ public function getFilterBranchTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('filter_branch_operator', $data ?? [], null); $this->setIfExists('filter_branch_type', $data ?? [], 'AND'); $this->setIfExists('filter_branches', $data ?? [], null); - $this->setIfExists('filter_branch_operator', $data ?? [], null); $this->setIfExists('filters', $data ?? [], null); } @@ -308,6 +308,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['filter_branch_operator'] === null) { + $invalidProperties[] = "'filter_branch_operator' can't be null"; + } if ($this->container['filter_branch_type'] === null) { $invalidProperties[] = "'filter_branch_type' can't be null"; } @@ -323,9 +326,6 @@ public function listInvalidProperties() if ($this->container['filter_branches'] === null) { $invalidProperties[] = "'filter_branches' can't be null"; } - if ($this->container['filter_branch_operator'] === null) { - $invalidProperties[] = "'filter_branch_operator' can't be null"; - } if ($this->container['filters'] === null) { $invalidProperties[] = "'filters' can't be null"; } @@ -344,6 +344,33 @@ public function valid() } + /** + * Gets filter_branch_operator + * + * @return string + */ + public function getFilterBranchOperator() + { + return $this->container['filter_branch_operator']; + } + + /** + * Sets filter_branch_operator + * + * @param string $filter_branch_operator Filter branch operator (AND) + * + * @return self + */ + public function setFilterBranchOperator($filter_branch_operator) + { + if (is_null($filter_branch_operator)) { + throw new \InvalidArgumentException('non-nullable filter_branch_operator cannot be null'); + } + $this->container['filter_branch_operator'] = $filter_branch_operator; + + return $this; + } + /** * Gets filter_branch_type * @@ -357,7 +384,7 @@ public function getFilterBranchType() /** * Sets filter_branch_type * - * @param string $filter_branch_type filter_branch_type + * @param string $filter_branch_type Type of filter branch (AND) * * @return self */ @@ -408,33 +435,6 @@ public function setFilterBranches($filter_branches) return $this; } - /** - * Gets filter_branch_operator - * - * @return string - */ - public function getFilterBranchOperator() - { - return $this->container['filter_branch_operator']; - } - - /** - * Sets filter_branch_operator - * - * @param string $filter_branch_operator filter_branch_operator - * - * @return self - */ - public function setFilterBranchOperator($filter_branch_operator) - { - if (is_null($filter_branch_operator)) { - throw new \InvalidArgumentException('non-nullable filter_branch_operator cannot be null'); - } - $this->container['filter_branch_operator'] = $filter_branch_operator; - - return $this; - } - /** * Gets filters * @@ -464,11 +464,11 @@ public function setFilters($filters) /** * 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]); } @@ -476,12 +476,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; } @@ -506,11 +506,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/Lists/Model/PublicAssociationFilterBranch.php b/codegen/Crm/Lists/Model/PublicAssociationFilterBranch.php index e0af40d13..0faf8ab2f 100644 --- a/codegen/Crm/Lists/Model/PublicAssociationFilterBranch.php +++ b/codegen/Crm/Lists/Model/PublicAssociationFilterBranch.php @@ -2,7 +2,7 @@ /** * PublicAssociationFilterBranch * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,13 +57,13 @@ class PublicAssociationFilterBranch implements ModelInterface, ArrayAccess, \Jso * @var string[] */ protected static $openAPITypes = [ + 'association_category' => 'string', + 'association_type_id' => 'int', + 'filter_branch_operator' => 'string', 'filter_branch_type' => 'string', 'filter_branches' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[]', - 'object_type_id' => 'string', - 'filter_branch_operator' => 'string', - 'association_type_id' => 'int', - 'association_category' => 'string', 'filters' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[]', + 'object_type_id' => 'string', 'operator' => 'string' ]; @@ -75,13 +75,13 @@ class PublicAssociationFilterBranch implements ModelInterface, ArrayAccess, \Jso * @psalm-var array */ protected static $openAPIFormats = [ + 'association_category' => null, + 'association_type_id' => 'int32', + 'filter_branch_operator' => null, 'filter_branch_type' => null, 'filter_branches' => null, - 'object_type_id' => null, - 'filter_branch_operator' => null, - 'association_type_id' => 'int32', - 'association_category' => null, 'filters' => null, + 'object_type_id' => null, 'operator' => null ]; @@ -91,13 +91,13 @@ class PublicAssociationFilterBranch implements ModelInterface, ArrayAccess, \Jso * @var boolean[] */ protected static array $openAPINullables = [ + 'association_category' => false, + 'association_type_id' => false, + 'filter_branch_operator' => false, 'filter_branch_type' => false, 'filter_branches' => false, - 'object_type_id' => false, - 'filter_branch_operator' => false, - 'association_type_id' => false, - 'association_category' => false, 'filters' => false, + 'object_type_id' => false, 'operator' => false ]; @@ -187,13 +187,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'association_category' => 'associationCategory', + 'association_type_id' => 'associationTypeId', + 'filter_branch_operator' => 'filterBranchOperator', 'filter_branch_type' => 'filterBranchType', 'filter_branches' => 'filterBranches', - 'object_type_id' => 'objectTypeId', - 'filter_branch_operator' => 'filterBranchOperator', - 'association_type_id' => 'associationTypeId', - 'association_category' => 'associationCategory', 'filters' => 'filters', + 'object_type_id' => 'objectTypeId', 'operator' => 'operator' ]; @@ -203,13 +203,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'association_category' => 'setAssociationCategory', + 'association_type_id' => 'setAssociationTypeId', + 'filter_branch_operator' => 'setFilterBranchOperator', 'filter_branch_type' => 'setFilterBranchType', 'filter_branches' => 'setFilterBranches', - 'object_type_id' => 'setObjectTypeId', - 'filter_branch_operator' => 'setFilterBranchOperator', - 'association_type_id' => 'setAssociationTypeId', - 'association_category' => 'setAssociationCategory', 'filters' => 'setFilters', + 'object_type_id' => 'setObjectTypeId', 'operator' => 'setOperator' ]; @@ -219,13 +219,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'association_category' => 'getAssociationCategory', + 'association_type_id' => 'getAssociationTypeId', + 'filter_branch_operator' => 'getFilterBranchOperator', 'filter_branch_type' => 'getFilterBranchType', 'filter_branches' => 'getFilterBranches', - 'object_type_id' => 'getObjectTypeId', - 'filter_branch_operator' => 'getFilterBranchOperator', - 'association_type_id' => 'getAssociationTypeId', - 'association_category' => 'getAssociationCategory', 'filters' => 'getFilters', + 'object_type_id' => 'getObjectTypeId', 'operator' => 'getOperator' ]; @@ -299,13 +299,13 @@ public function getFilterBranchTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('association_category', $data ?? [], null); + $this->setIfExists('association_type_id', $data ?? [], null); + $this->setIfExists('filter_branch_operator', $data ?? [], null); $this->setIfExists('filter_branch_type', $data ?? [], 'ASSOCIATION'); $this->setIfExists('filter_branches', $data ?? [], null); - $this->setIfExists('object_type_id', $data ?? [], null); - $this->setIfExists('filter_branch_operator', $data ?? [], null); - $this->setIfExists('association_type_id', $data ?? [], null); - $this->setIfExists('association_category', $data ?? [], null); $this->setIfExists('filters', $data ?? [], null); + $this->setIfExists('object_type_id', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); } @@ -336,6 +336,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['association_category'] === null) { + $invalidProperties[] = "'association_category' can't be null"; + } + if ($this->container['association_type_id'] === null) { + $invalidProperties[] = "'association_type_id' can't be null"; + } + if ($this->container['filter_branch_operator'] === null) { + $invalidProperties[] = "'filter_branch_operator' can't be null"; + } if ($this->container['filter_branch_type'] === null) { $invalidProperties[] = "'filter_branch_type' can't be null"; } @@ -351,21 +360,12 @@ public function listInvalidProperties() if ($this->container['filter_branches'] === null) { $invalidProperties[] = "'filter_branches' can't be null"; } - if ($this->container['object_type_id'] === null) { - $invalidProperties[] = "'object_type_id' can't be null"; - } - if ($this->container['filter_branch_operator'] === null) { - $invalidProperties[] = "'filter_branch_operator' can't be null"; - } - if ($this->container['association_type_id'] === null) { - $invalidProperties[] = "'association_type_id' can't be null"; - } - if ($this->container['association_category'] === null) { - $invalidProperties[] = "'association_category' can't be null"; - } if ($this->container['filters'] === null) { $invalidProperties[] = "'filters' can't be null"; } + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } @@ -385,92 +385,55 @@ public function valid() /** - * Gets filter_branch_type + * Gets association_category * * @return string */ - public function getFilterBranchType() - { - return $this->container['filter_branch_type']; - } - - /** - * Sets filter_branch_type - * - * @param string $filter_branch_type filter_branch_type - * - * @return self - */ - public function setFilterBranchType($filter_branch_type) - { - if (is_null($filter_branch_type)) { - throw new \InvalidArgumentException('non-nullable filter_branch_type cannot be null'); - } - $allowedValues = $this->getFilterBranchTypeAllowableValues(); - if (!in_array($filter_branch_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'filter_branch_type', must be one of '%s'", - $filter_branch_type, - implode("', '", $allowedValues) - ) - ); - } - $this->container['filter_branch_type'] = $filter_branch_type; - - return $this; - } - - /** - * Gets filter_branches - * - * @return \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[] - */ - public function getFilterBranches() + public function getAssociationCategory() { - return $this->container['filter_branches']; + return $this->container['association_category']; } /** - * Sets filter_branches + * Sets association_category * - * @param \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[] $filter_branches filter_branches + * @param string $association_category Specifies the category of the association for the filter branch (HUBSPOT_DEFINED, USER_DEFINED, INTEGRATOR_DEFINED, WORK). * * @return self */ - public function setFilterBranches($filter_branches) + public function setAssociationCategory($association_category) { - if (is_null($filter_branches)) { - throw new \InvalidArgumentException('non-nullable filter_branches cannot be null'); + if (is_null($association_category)) { + throw new \InvalidArgumentException('non-nullable association_category cannot be null'); } - $this->container['filter_branches'] = $filter_branches; + $this->container['association_category'] = $association_category; return $this; } /** - * Gets object_type_id + * Gets association_type_id * - * @return string + * @return int */ - public function getObjectTypeId() + public function getAssociationTypeId() { - return $this->container['object_type_id']; + return $this->container['association_type_id']; } /** - * Sets object_type_id + * Sets association_type_id * - * @param string $object_type_id object_type_id + * @param int $association_type_id Type id of the association * * @return self */ - public function setObjectTypeId($object_type_id) + public function setAssociationTypeId($association_type_id) { - if (is_null($object_type_id)) { - throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + if (is_null($association_type_id)) { + throw new \InvalidArgumentException('non-nullable association_type_id cannot be null'); } - $this->container['object_type_id'] = $object_type_id; + $this->container['association_type_id'] = $association_type_id; return $this; } @@ -488,7 +451,7 @@ public function getFilterBranchOperator() /** * Sets filter_branch_operator * - * @param string $filter_branch_operator filter_branch_operator + * @param string $filter_branch_operator Filter branch operator (AND) * * @return self */ @@ -503,55 +466,65 @@ public function setFilterBranchOperator($filter_branch_operator) } /** - * Gets association_type_id + * Gets filter_branch_type * - * @return int + * @return string */ - public function getAssociationTypeId() + public function getFilterBranchType() { - return $this->container['association_type_id']; + return $this->container['filter_branch_type']; } /** - * Sets association_type_id + * Sets filter_branch_type * - * @param int $association_type_id association_type_id + * @param string $filter_branch_type Type of the filter branch (ASSOCIATION) * * @return self */ - public function setAssociationTypeId($association_type_id) + public function setFilterBranchType($filter_branch_type) { - if (is_null($association_type_id)) { - throw new \InvalidArgumentException('non-nullable association_type_id cannot be null'); + if (is_null($filter_branch_type)) { + throw new \InvalidArgumentException('non-nullable filter_branch_type cannot be null'); } - $this->container['association_type_id'] = $association_type_id; + $allowedValues = $this->getFilterBranchTypeAllowableValues(); + if (!in_array($filter_branch_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'filter_branch_type', must be one of '%s'", + $filter_branch_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['filter_branch_type'] = $filter_branch_type; return $this; } /** - * Gets association_category + * Gets filter_branches * - * @return string + * @return \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[] */ - public function getAssociationCategory() + public function getFilterBranches() { - return $this->container['association_category']; + return $this->container['filter_branches']; } /** - * Sets association_category + * Sets filter_branches * - * @param string $association_category association_category + * @param \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[] $filter_branches filter_branches * * @return self */ - public function setAssociationCategory($association_category) + public function setFilterBranches($filter_branches) { - if (is_null($association_category)) { - throw new \InvalidArgumentException('non-nullable association_category cannot be null'); + if (is_null($filter_branches)) { + throw new \InvalidArgumentException('non-nullable filter_branches cannot be null'); } - $this->container['association_category'] = $association_category; + $this->container['filter_branches'] = $filter_branches; return $this; } @@ -583,6 +556,33 @@ public function setFilters($filters) return $this; } + /** + * Gets object_type_id + * + * @return string + */ + public function getObjectTypeId() + { + return $this->container['object_type_id']; + } + + /** + * Sets object_type_id + * + * @param string $object_type_id The ID representing the type of object associated with the filter branch. + * + * @return self + */ + public function setObjectTypeId($object_type_id) + { + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + } + $this->container['object_type_id'] = $object_type_id; + + return $this; + } + /** * Gets operator * @@ -596,7 +596,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Defines the operation to be applied within the filter branch (IN_LIST, NOT_IN_LIST). * * @return self */ @@ -612,11 +612,11 @@ public function setOperator($operator) /** * 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]); } @@ -624,12 +624,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; } @@ -654,11 +654,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/Lists/Model/PublicAssociationInListFilter.php b/codegen/Crm/Lists/Model/PublicAssociationInListFilter.php index 7d6d45f1a..d5c51e66b 100644 --- a/codegen/Crm/Lists/Model/PublicAssociationInListFilter.php +++ b/codegen/Crm/Lists/Model/PublicAssociationInListFilter.php @@ -2,7 +2,7 @@ /** * PublicAssociationInListFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,14 +57,14 @@ class PublicAssociationInListFilter implements ModelInterface, ArrayAccess, \Jso * @var string[] */ protected static $openAPITypes = [ - 'list_id' => 'string', - 'coalescing_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', - 'to_object_type' => 'string', - 'association_type_id' => 'int', 'association_category' => 'string', + 'association_type_id' => 'int', + 'coalescing_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicNumAssociationsFilterCoalescingRefineBy', 'filter_type' => 'string', - 'to_object_type_id' => 'string', - 'operator' => 'string' + 'list_id' => 'string', + 'operator' => 'string', + 'to_object_type' => 'string', + 'to_object_type_id' => 'string' ]; /** @@ -75,14 +75,14 @@ class PublicAssociationInListFilter implements ModelInterface, ArrayAccess, \Jso * @psalm-var array */ protected static $openAPIFormats = [ - 'list_id' => null, - 'coalescing_refine_by' => null, - 'to_object_type' => null, - 'association_type_id' => 'int32', 'association_category' => null, + 'association_type_id' => 'int32', + 'coalescing_refine_by' => null, 'filter_type' => null, - 'to_object_type_id' => null, - 'operator' => null + 'list_id' => null, + 'operator' => null, + 'to_object_type' => null, + 'to_object_type_id' => null ]; /** @@ -91,14 +91,14 @@ class PublicAssociationInListFilter implements ModelInterface, ArrayAccess, \Jso * @var boolean[] */ protected static array $openAPINullables = [ - 'list_id' => false, - 'coalescing_refine_by' => false, - 'to_object_type' => false, - 'association_type_id' => false, 'association_category' => false, + 'association_type_id' => false, + 'coalescing_refine_by' => false, 'filter_type' => false, - 'to_object_type_id' => false, - 'operator' => false + 'list_id' => false, + 'operator' => false, + 'to_object_type' => false, + 'to_object_type_id' => false ]; /** @@ -187,14 +187,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'list_id' => 'listId', - 'coalescing_refine_by' => 'coalescingRefineBy', - 'to_object_type' => 'toObjectType', - 'association_type_id' => 'associationTypeId', 'association_category' => 'associationCategory', + 'association_type_id' => 'associationTypeId', + 'coalescing_refine_by' => 'coalescingRefineBy', 'filter_type' => 'filterType', - 'to_object_type_id' => 'toObjectTypeId', - 'operator' => 'operator' + 'list_id' => 'listId', + 'operator' => 'operator', + 'to_object_type' => 'toObjectType', + 'to_object_type_id' => 'toObjectTypeId' ]; /** @@ -203,14 +203,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'list_id' => 'setListId', - 'coalescing_refine_by' => 'setCoalescingRefineBy', - 'to_object_type' => 'setToObjectType', - 'association_type_id' => 'setAssociationTypeId', 'association_category' => 'setAssociationCategory', + 'association_type_id' => 'setAssociationTypeId', + 'coalescing_refine_by' => 'setCoalescingRefineBy', 'filter_type' => 'setFilterType', - 'to_object_type_id' => 'setToObjectTypeId', - 'operator' => 'setOperator' + 'list_id' => 'setListId', + 'operator' => 'setOperator', + 'to_object_type' => 'setToObjectType', + 'to_object_type_id' => 'setToObjectTypeId' ]; /** @@ -219,14 +219,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'list_id' => 'getListId', - 'coalescing_refine_by' => 'getCoalescingRefineBy', - 'to_object_type' => 'getToObjectType', - 'association_type_id' => 'getAssociationTypeId', 'association_category' => 'getAssociationCategory', + 'association_type_id' => 'getAssociationTypeId', + 'coalescing_refine_by' => 'getCoalescingRefineBy', 'filter_type' => 'getFilterType', - 'to_object_type_id' => 'getToObjectTypeId', - 'operator' => 'getOperator' + 'list_id' => 'getListId', + 'operator' => 'getOperator', + 'to_object_type' => 'getToObjectType', + 'to_object_type_id' => 'getToObjectTypeId' ]; /** @@ -299,14 +299,14 @@ public function getFilterTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('list_id', $data ?? [], null); - $this->setIfExists('coalescing_refine_by', $data ?? [], null); - $this->setIfExists('to_object_type', $data ?? [], null); - $this->setIfExists('association_type_id', $data ?? [], null); $this->setIfExists('association_category', $data ?? [], null); + $this->setIfExists('association_type_id', $data ?? [], null); + $this->setIfExists('coalescing_refine_by', $data ?? [], null); $this->setIfExists('filter_type', $data ?? [], 'ASSOCIATION'); - $this->setIfExists('to_object_type_id', $data ?? [], null); + $this->setIfExists('list_id', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('to_object_type', $data ?? [], null); + $this->setIfExists('to_object_type_id', $data ?? [], null); } /** @@ -336,17 +336,14 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['list_id'] === null) { - $invalidProperties[] = "'list_id' can't be null"; - } - if ($this->container['coalescing_refine_by'] === null) { - $invalidProperties[] = "'coalescing_refine_by' can't be null"; + if ($this->container['association_category'] === null) { + $invalidProperties[] = "'association_category' can't be null"; } if ($this->container['association_type_id'] === null) { $invalidProperties[] = "'association_type_id' can't be null"; } - if ($this->container['association_category'] === null) { - $invalidProperties[] = "'association_category' can't be null"; + if ($this->container['coalescing_refine_by'] === null) { + $invalidProperties[] = "'coalescing_refine_by' can't be null"; } if ($this->container['filter_type'] === null) { $invalidProperties[] = "'filter_type' can't be null"; @@ -360,6 +357,9 @@ public function listInvalidProperties() ); } + if ($this->container['list_id'] === null) { + $invalidProperties[] = "'list_id' can't be null"; + } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } @@ -379,82 +379,28 @@ public function valid() /** - * Gets list_id + * Gets association_category * * @return string */ - public function getListId() - { - return $this->container['list_id']; - } - - /** - * Sets list_id - * - * @param string $list_id list_id - * - * @return self - */ - public function setListId($list_id) - { - if (is_null($list_id)) { - throw new \InvalidArgumentException('non-nullable list_id cannot be null'); - } - $this->container['list_id'] = $list_id; - - return $this; - } - - /** - * Gets coalescing_refine_by - * - * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy - */ - public function getCoalescingRefineBy() - { - return $this->container['coalescing_refine_by']; - } - - /** - * Sets coalescing_refine_by - * - * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy $coalescing_refine_by coalescing_refine_by - * - * @return self - */ - public function setCoalescingRefineBy($coalescing_refine_by) - { - if (is_null($coalescing_refine_by)) { - throw new \InvalidArgumentException('non-nullable coalescing_refine_by cannot be null'); - } - $this->container['coalescing_refine_by'] = $coalescing_refine_by; - - return $this; - } - - /** - * Gets to_object_type - * - * @return string|null - */ - public function getToObjectType() + public function getAssociationCategory() { - return $this->container['to_object_type']; + return $this->container['association_category']; } /** - * Sets to_object_type + * Sets association_category * - * @param string|null $to_object_type to_object_type + * @param string $association_category Defines the category of the association, such as (HUBSPOT_DEFINED, USER_DEFINED, INTEGRATOR_DEFINED, WORK). * * @return self */ - public function setToObjectType($to_object_type) + public function setAssociationCategory($association_category) { - if (is_null($to_object_type)) { - throw new \InvalidArgumentException('non-nullable to_object_type cannot be null'); + if (is_null($association_category)) { + throw new \InvalidArgumentException('non-nullable association_category cannot be null'); } - $this->container['to_object_type'] = $to_object_type; + $this->container['association_category'] = $association_category; return $this; } @@ -472,7 +418,7 @@ public function getAssociationTypeId() /** * Sets association_type_id * - * @param int $association_type_id association_type_id + * @param int $association_type_id The ID representing the type of association being filtered. * * @return self */ @@ -487,28 +433,28 @@ public function setAssociationTypeId($association_type_id) } /** - * Gets association_category + * Gets coalescing_refine_by * - * @return string + * @return \HubSpot\Client\Crm\Lists\Model\PublicNumAssociationsFilterCoalescingRefineBy */ - public function getAssociationCategory() + public function getCoalescingRefineBy() { - return $this->container['association_category']; + return $this->container['coalescing_refine_by']; } /** - * Sets association_category + * Sets coalescing_refine_by * - * @param string $association_category association_category + * @param \HubSpot\Client\Crm\Lists\Model\PublicNumAssociationsFilterCoalescingRefineBy $coalescing_refine_by coalescing_refine_by * * @return self */ - public function setAssociationCategory($association_category) + public function setCoalescingRefineBy($coalescing_refine_by) { - if (is_null($association_category)) { - throw new \InvalidArgumentException('non-nullable association_category cannot be null'); + if (is_null($coalescing_refine_by)) { + throw new \InvalidArgumentException('non-nullable coalescing_refine_by cannot be null'); } - $this->container['association_category'] = $association_category; + $this->container['coalescing_refine_by'] = $coalescing_refine_by; return $this; } @@ -526,7 +472,7 @@ public function getFilterType() /** * Sets filter_type * - * @param string $filter_type filter_type + * @param string $filter_type Indicates the type of filter being applied, which is 'ASSOCIATION' by default. * * @return self */ @@ -551,28 +497,28 @@ public function setFilterType($filter_type) } /** - * Gets to_object_type_id + * Gets list_id * - * @return string|null + * @return string */ - public function getToObjectTypeId() + public function getListId() { - return $this->container['to_object_type_id']; + return $this->container['list_id']; } /** - * Sets to_object_type_id + * Sets list_id * - * @param string|null $to_object_type_id to_object_type_id + * @param string $list_id The ID of the list used in the association filter. * * @return self */ - public function setToObjectTypeId($to_object_type_id) + public function setListId($list_id) { - if (is_null($to_object_type_id)) { - throw new \InvalidArgumentException('non-nullable to_object_type_id cannot be null'); + if (is_null($list_id)) { + throw new \InvalidArgumentException('non-nullable list_id cannot be null'); } - $this->container['to_object_type_id'] = $to_object_type_id; + $this->container['list_id'] = $list_id; return $this; } @@ -590,7 +536,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Specifies the operation to be performed by the filter, such as 'IN_LIST' or 'NOT_IN_LIST'. * * @return self */ @@ -603,14 +549,68 @@ public function setOperator($operator) return $this; } + + /** + * Gets to_object_type + * + * @return string|null + */ + public function getToObjectType() + { + return $this->container['to_object_type']; + } + + /** + * Sets to_object_type + * + * @param string|null $to_object_type The type of object that the association filter is targeting. + * + * @return self + */ + public function setToObjectType($to_object_type) + { + if (is_null($to_object_type)) { + throw new \InvalidArgumentException('non-nullable to_object_type cannot be null'); + } + $this->container['to_object_type'] = $to_object_type; + + return $this; + } + + /** + * Gets to_object_type_id + * + * @return string|null + */ + public function getToObjectTypeId() + { + return $this->container['to_object_type_id']; + } + + /** + * Sets to_object_type_id + * + * @param string|null $to_object_type_id The ID representing the type of object that the association filter is targeting. + * + * @return self + */ + public function setToObjectTypeId($to_object_type_id) + { + if (is_null($to_object_type_id)) { + throw new \InvalidArgumentException('non-nullable to_object_type_id cannot be null'); + } + $this->container['to_object_type_id'] = $to_object_type_id; + + 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]); } @@ -618,12 +618,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; } @@ -648,11 +648,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/Lists/Model/PublicBatchMigrationMapping.php b/codegen/Crm/Lists/Model/PublicBatchMigrationMapping.php index 034af7033..e4497fe21 100644 --- a/codegen/Crm/Lists/Model/PublicBatchMigrationMapping.php +++ b/codegen/Crm/Lists/Model/PublicBatchMigrationMapping.php @@ -2,7 +2,7 @@ /** * PublicBatchMigrationMapping * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -358,11 +358,11 @@ public function setMissingLegacyListIds($missing_legacy_list_ids) /** * 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]); } @@ -370,12 +370,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; } @@ -400,11 +400,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/Lists/Model/PublicBoolPropertyOperation.php b/codegen/Crm/Lists/Model/PublicBoolPropertyOperation.php index 678f61e2e..6f14c95b6 100644 --- a/codegen/Crm/Lists/Model/PublicBoolPropertyOperation.php +++ b/codegen/Crm/Lists/Model/PublicBoolPropertyOperation.php @@ -2,7 +2,7 @@ /** * PublicBoolPropertyOperation * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -59,8 +59,8 @@ class PublicBoolPropertyOperation implements ModelInterface, ArrayAccess, \JsonS protected static $openAPITypes = [ 'include_objects_with_no_value_set' => 'bool', 'operation_type' => 'string', - 'value' => 'bool', - 'operator' => 'string' + 'operator' => 'string', + 'value' => 'bool' ]; /** @@ -73,8 +73,8 @@ class PublicBoolPropertyOperation implements ModelInterface, ArrayAccess, \JsonS protected static $openAPIFormats = [ 'include_objects_with_no_value_set' => null, 'operation_type' => null, - 'value' => null, - 'operator' => null + 'operator' => null, + 'value' => null ]; /** @@ -85,8 +85,8 @@ class PublicBoolPropertyOperation implements ModelInterface, ArrayAccess, \JsonS protected static array $openAPINullables = [ 'include_objects_with_no_value_set' => false, 'operation_type' => false, - 'value' => false, - 'operator' => false + 'operator' => false, + 'value' => false ]; /** @@ -177,8 +177,8 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', 'operation_type' => 'operationType', - 'value' => 'value', - 'operator' => 'operator' + 'operator' => 'operator', + 'value' => 'value' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', 'operation_type' => 'setOperationType', - 'value' => 'setValue', - 'operator' => 'setOperator' + 'operator' => 'setOperator', + 'value' => 'setValue' ]; /** @@ -201,8 +201,8 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', 'operation_type' => 'getOperationType', - 'value' => 'getValue', - 'operator' => 'getOperator' + 'operator' => 'getOperator', + 'value' => 'getValue' ]; /** @@ -277,8 +277,8 @@ public function __construct(?array $data = null) { $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); $this->setIfExists('operation_type', $data ?? [], 'BOOL'); - $this->setIfExists('value', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); } /** @@ -323,12 +323,12 @@ public function listInvalidProperties() ); } - if ($this->container['value'] === null) { - $invalidProperties[] = "'value' can't be null"; - } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } return $invalidProperties; } @@ -357,7 +357,7 @@ public function getIncludeObjectsWithNoValueSet() /** * Sets include_objects_with_no_value_set * - * @param bool $include_objects_with_no_value_set include_objects_with_no_value_set + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. * * @return self */ @@ -384,7 +384,7 @@ public function getOperationType() /** * Sets operation_type * - * @param string $operation_type operation_type + * @param string $operation_type Specifies the type of operation (BOOL). * * @return self */ @@ -409,66 +409,66 @@ public function setOperationType($operation_type) } /** - * Gets value + * Gets operator * - * @return bool + * @return string */ - public function getValue() + public function getOperator() { - return $this->container['value']; + return $this->container['operator']; } /** - * Sets value + * Sets operator * - * @param bool $value value + * @param string $operator Defines the operation to be applied in the boolean property operation (IS_EQUAL_TO, IS_NOT_EQUAL_TO, HAS_EVER_BEEN_EQUAL_TO, HAS_NEVER_BEEN_EQUAL_TO). * * @return self */ - public function setValue($value) + public function setOperator($operator) { - if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['value'] = $value; + $this->container['operator'] = $operator; return $this; } /** - * Gets operator + * Gets value * - * @return string + * @return bool */ - public function getOperator() + public function getValue() { - return $this->container['operator']; + return $this->container['value']; } /** - * Sets operator + * Sets value * - * @param string $operator operator + * @param bool $value The boolean value to be used in the operation. * * @return self */ - public function setOperator($operator) + public function setValue($value) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); } - $this->container['operator'] = $operator; + $this->container['value'] = $value; 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]); } @@ -476,12 +476,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; } @@ -506,11 +506,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/Lists/Model/PublicCalendarDatePropertyOperation.php b/codegen/Crm/Lists/Model/PublicCalendarDatePropertyOperation.php index 16052be7e..e84268b7b 100644 --- a/codegen/Crm/Lists/Model/PublicCalendarDatePropertyOperation.php +++ b/codegen/Crm/Lists/Model/PublicCalendarDatePropertyOperation.php @@ -2,7 +2,7 @@ /** * PublicCalendarDatePropertyOperation * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,13 +57,13 @@ class PublicCalendarDatePropertyOperation implements ModelInterface, ArrayAccess * @var string[] */ protected static $openAPITypes = [ - 'use_fiscal_year' => 'bool', 'fiscal_year_start' => 'string', 'include_objects_with_no_value_set' => 'bool', 'operation_type' => 'string', - 'time_unit_count' => 'int', 'operator' => 'string', - 'time_unit' => 'string' + 'time_unit' => 'string', + 'time_unit_count' => 'int', + 'use_fiscal_year' => 'bool' ]; /** @@ -74,13 +74,13 @@ class PublicCalendarDatePropertyOperation implements ModelInterface, ArrayAccess * @psalm-var array */ protected static $openAPIFormats = [ - 'use_fiscal_year' => null, 'fiscal_year_start' => null, 'include_objects_with_no_value_set' => null, 'operation_type' => null, - 'time_unit_count' => 'int32', 'operator' => null, - 'time_unit' => null + 'time_unit' => null, + 'time_unit_count' => 'int32', + 'use_fiscal_year' => null ]; /** @@ -89,13 +89,13 @@ class PublicCalendarDatePropertyOperation implements ModelInterface, ArrayAccess * @var boolean[] */ protected static array $openAPINullables = [ - 'use_fiscal_year' => false, 'fiscal_year_start' => false, 'include_objects_with_no_value_set' => false, 'operation_type' => false, - 'time_unit_count' => false, 'operator' => false, - 'time_unit' => false + 'time_unit' => false, + 'time_unit_count' => false, + 'use_fiscal_year' => false ]; /** @@ -184,13 +184,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'use_fiscal_year' => 'useFiscalYear', 'fiscal_year_start' => 'fiscalYearStart', 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', 'operation_type' => 'operationType', - 'time_unit_count' => 'timeUnitCount', 'operator' => 'operator', - 'time_unit' => 'timeUnit' + 'time_unit' => 'timeUnit', + 'time_unit_count' => 'timeUnitCount', + 'use_fiscal_year' => 'useFiscalYear' ]; /** @@ -199,13 +199,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'use_fiscal_year' => 'setUseFiscalYear', 'fiscal_year_start' => 'setFiscalYearStart', 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', 'operation_type' => 'setOperationType', - 'time_unit_count' => 'setTimeUnitCount', 'operator' => 'setOperator', - 'time_unit' => 'setTimeUnit' + 'time_unit' => 'setTimeUnit', + 'time_unit_count' => 'setTimeUnitCount', + 'use_fiscal_year' => 'setUseFiscalYear' ]; /** @@ -214,13 +214,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'use_fiscal_year' => 'getUseFiscalYear', 'fiscal_year_start' => 'getFiscalYearStart', 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', 'operation_type' => 'getOperationType', - 'time_unit_count' => 'getTimeUnitCount', 'operator' => 'getOperator', - 'time_unit' => 'getTimeUnit' + 'time_unit' => 'getTimeUnit', + 'time_unit_count' => 'getTimeUnitCount', + 'use_fiscal_year' => 'getUseFiscalYear' ]; /** @@ -264,18 +264,18 @@ public function getModelName() return self::$openAPIModelName; } - public const FISCAL_YEAR_START_JANUARY = 'JANUARY'; + public const FISCAL_YEAR_START_APRIL = 'APRIL'; + public const FISCAL_YEAR_START_AUGUST = 'AUGUST'; + public const FISCAL_YEAR_START_DECEMBER = 'DECEMBER'; public const FISCAL_YEAR_START_FEBRUARY = 'FEBRUARY'; + public const FISCAL_YEAR_START_JANUARY = 'JANUARY'; + public const FISCAL_YEAR_START_JULY = 'JULY'; + public const FISCAL_YEAR_START_JUNE = 'JUNE'; public const FISCAL_YEAR_START_MARCH = 'MARCH'; - public const FISCAL_YEAR_START_APRIL = 'APRIL'; public const FISCAL_YEAR_START_MAY = 'MAY'; - public const FISCAL_YEAR_START_JUNE = 'JUNE'; - public const FISCAL_YEAR_START_JULY = 'JULY'; - public const FISCAL_YEAR_START_AUGUST = 'AUGUST'; - public const FISCAL_YEAR_START_SEPTEMBER = 'SEPTEMBER'; - public const FISCAL_YEAR_START_OCTOBER = 'OCTOBER'; public const FISCAL_YEAR_START_NOVEMBER = 'NOVEMBER'; - public const FISCAL_YEAR_START_DECEMBER = 'DECEMBER'; + public const FISCAL_YEAR_START_OCTOBER = 'OCTOBER'; + public const FISCAL_YEAR_START_SEPTEMBER = 'SEPTEMBER'; public const OPERATION_TYPE_CALENDAR_DATE = 'CALENDAR_DATE'; /** @@ -286,18 +286,18 @@ public function getModelName() public function getFiscalYearStartAllowableValues() { return [ - self::FISCAL_YEAR_START_JANUARY, + self::FISCAL_YEAR_START_APRIL, + self::FISCAL_YEAR_START_AUGUST, + self::FISCAL_YEAR_START_DECEMBER, self::FISCAL_YEAR_START_FEBRUARY, + self::FISCAL_YEAR_START_JANUARY, + self::FISCAL_YEAR_START_JULY, + self::FISCAL_YEAR_START_JUNE, self::FISCAL_YEAR_START_MARCH, - self::FISCAL_YEAR_START_APRIL, self::FISCAL_YEAR_START_MAY, - self::FISCAL_YEAR_START_JUNE, - self::FISCAL_YEAR_START_JULY, - self::FISCAL_YEAR_START_AUGUST, - self::FISCAL_YEAR_START_SEPTEMBER, - self::FISCAL_YEAR_START_OCTOBER, self::FISCAL_YEAR_START_NOVEMBER, - self::FISCAL_YEAR_START_DECEMBER, + self::FISCAL_YEAR_START_OCTOBER, + self::FISCAL_YEAR_START_SEPTEMBER, ]; } @@ -328,13 +328,13 @@ public function getOperationTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('use_fiscal_year', $data ?? [], null); $this->setIfExists('fiscal_year_start', $data ?? [], null); $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); $this->setIfExists('operation_type', $data ?? [], 'CALENDAR_DATE'); - $this->setIfExists('time_unit_count', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); $this->setIfExists('time_unit', $data ?? [], null); + $this->setIfExists('time_unit_count', $data ?? [], null); + $this->setIfExists('use_fiscal_year', $data ?? [], null); } /** @@ -409,33 +409,6 @@ public function valid() } - /** - * Gets use_fiscal_year - * - * @return bool|null - */ - public function getUseFiscalYear() - { - return $this->container['use_fiscal_year']; - } - - /** - * Sets use_fiscal_year - * - * @param bool|null $use_fiscal_year use_fiscal_year - * - * @return self - */ - public function setUseFiscalYear($use_fiscal_year) - { - if (is_null($use_fiscal_year)) { - throw new \InvalidArgumentException('non-nullable use_fiscal_year cannot be null'); - } - $this->container['use_fiscal_year'] = $use_fiscal_year; - - return $this; - } - /** * Gets fiscal_year_start * @@ -449,7 +422,7 @@ public function getFiscalYearStart() /** * Sets fiscal_year_start * - * @param string|null $fiscal_year_start fiscal_year_start + * @param string|null $fiscal_year_start The month in which the fiscal year starts. * * @return self */ @@ -486,7 +459,7 @@ public function getIncludeObjectsWithNoValueSet() /** * Sets include_objects_with_no_value_set * - * @param bool $include_objects_with_no_value_set include_objects_with_no_value_set + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included. * * @return self */ @@ -513,7 +486,7 @@ public function getOperationType() /** * Sets operation_type * - * @param string $operation_type operation_type + * @param string $operation_type The type of operation, which is (CALENDAR_DATE). * * @return self */ @@ -537,33 +510,6 @@ public function setOperationType($operation_type) return $this; } - /** - * Gets time_unit_count - * - * @return int|null - */ - public function getTimeUnitCount() - { - return $this->container['time_unit_count']; - } - - /** - * Sets time_unit_count - * - * @param int|null $time_unit_count time_unit_count - * - * @return self - */ - public function setTimeUnitCount($time_unit_count) - { - if (is_null($time_unit_count)) { - throw new \InvalidArgumentException('non-nullable time_unit_count cannot be null'); - } - $this->container['time_unit_count'] = $time_unit_count; - - return $this; - } - /** * Gets operator * @@ -577,7 +523,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Defines the operation to be applied to the calendar date property (IN_THIS_TIME_UNIT, IN_THIS_TIME_UNIT_SO_FAR, IN_NEXT_TIME_UNIT, IN_LAST_TIME_UNIT). * * @return self */ @@ -604,7 +550,7 @@ public function getTimeUnit() /** * Sets time_unit * - * @param string $time_unit time_unit + * @param string $time_unit The unit of time to be used in the operation (DAY, WEEK, MONTH, QUARTER, YEAR). * * @return self */ @@ -617,14 +563,68 @@ public function setTimeUnit($time_unit) return $this; } + + /** + * Gets time_unit_count + * + * @return int|null + */ + public function getTimeUnitCount() + { + return $this->container['time_unit_count']; + } + + /** + * Sets time_unit_count + * + * @param int|null $time_unit_count The count of time units to be applied in the operation (1). + * + * @return self + */ + public function setTimeUnitCount($time_unit_count) + { + if (is_null($time_unit_count)) { + throw new \InvalidArgumentException('non-nullable time_unit_count cannot be null'); + } + $this->container['time_unit_count'] = $time_unit_count; + + return $this; + } + + /** + * Gets use_fiscal_year + * + * @return bool|null + */ + public function getUseFiscalYear() + { + return $this->container['use_fiscal_year']; + } + + /** + * Sets use_fiscal_year + * + * @param bool|null $use_fiscal_year Specifies whether the fiscal year should be used in the operation. + * + * @return self + */ + public function setUseFiscalYear($use_fiscal_year) + { + if (is_null($use_fiscal_year)) { + throw new \InvalidArgumentException('non-nullable use_fiscal_year cannot be null'); + } + $this->container['use_fiscal_year'] = $use_fiscal_year; + + 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]); } @@ -632,12 +632,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; } @@ -662,11 +662,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/Lists/Model/PublicCampaignInfluencedFilter.php b/codegen/Crm/Lists/Model/PublicCampaignInfluencedFilter.php index f7ef6e2de..a501e93a7 100644 --- a/codegen/Crm/Lists/Model/PublicCampaignInfluencedFilter.php +++ b/codegen/Crm/Lists/Model/PublicCampaignInfluencedFilter.php @@ -2,7 +2,7 @@ /** * PublicCampaignInfluencedFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -337,7 +337,7 @@ public function getCampaignId() /** * Sets campaign_id * - * @param string $campaign_id campaign_id + * @param string $campaign_id The ID of the campaign that influences the filter. * * @return self */ @@ -364,7 +364,7 @@ public function getFilterType() /** * Sets filter_type * - * @param string $filter_type filter_type + * @param string $filter_type Indicates the type of filter (CAMPAIGN_INFLUENCED). * * @return self */ @@ -390,11 +390,11 @@ public function setFilterType($filter_type) /** * 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]); } @@ -402,12 +402,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; } @@ -432,11 +432,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/Lists/Model/PublicCommunicationSubscriptionFilter.php b/codegen/Crm/Lists/Model/PublicCommunicationSubscriptionFilter.php index 1cec5290f..c3442fdf0 100644 --- a/codegen/Crm/Lists/Model/PublicCommunicationSubscriptionFilter.php +++ b/codegen/Crm/Lists/Model/PublicCommunicationSubscriptionFilter.php @@ -2,7 +2,7 @@ /** * PublicCommunicationSubscriptionFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,12 +57,12 @@ class PublicCommunicationSubscriptionFilter implements ModelInterface, ArrayAcce * @var string[] */ protected static $openAPITypes = [ - 'subscription_type' => 'string', - 'subscription_ids' => 'string[]', - 'channel' => 'string', 'accepted_opt_states' => 'string[]', + 'business_unit_id' => 'string', + 'channel' => 'string', 'filter_type' => 'string', - 'business_unit_id' => 'string' + 'subscription_ids' => 'string[]', + 'subscription_type' => 'string' ]; /** @@ -73,12 +73,12 @@ class PublicCommunicationSubscriptionFilter implements ModelInterface, ArrayAcce * @psalm-var array */ protected static $openAPIFormats = [ - 'subscription_type' => null, - 'subscription_ids' => null, - 'channel' => null, 'accepted_opt_states' => null, + 'business_unit_id' => null, + 'channel' => null, 'filter_type' => null, - 'business_unit_id' => null + 'subscription_ids' => null, + 'subscription_type' => null ]; /** @@ -87,12 +87,12 @@ class PublicCommunicationSubscriptionFilter implements ModelInterface, ArrayAcce * @var boolean[] */ protected static array $openAPINullables = [ - 'subscription_type' => false, - 'subscription_ids' => false, - 'channel' => false, 'accepted_opt_states' => false, + 'business_unit_id' => false, + 'channel' => false, 'filter_type' => false, - 'business_unit_id' => false + 'subscription_ids' => false, + 'subscription_type' => false ]; /** @@ -181,12 +181,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'subscription_type' => 'subscriptionType', - 'subscription_ids' => 'subscriptionIds', - 'channel' => 'channel', 'accepted_opt_states' => 'acceptedOptStates', + 'business_unit_id' => 'businessUnitId', + 'channel' => 'channel', 'filter_type' => 'filterType', - 'business_unit_id' => 'businessUnitId' + 'subscription_ids' => 'subscriptionIds', + 'subscription_type' => 'subscriptionType' ]; /** @@ -195,12 +195,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'subscription_type' => 'setSubscriptionType', - 'subscription_ids' => 'setSubscriptionIds', - 'channel' => 'setChannel', 'accepted_opt_states' => 'setAcceptedOptStates', + 'business_unit_id' => 'setBusinessUnitId', + 'channel' => 'setChannel', 'filter_type' => 'setFilterType', - 'business_unit_id' => 'setBusinessUnitId' + 'subscription_ids' => 'setSubscriptionIds', + 'subscription_type' => 'setSubscriptionType' ]; /** @@ -209,12 +209,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'subscription_type' => 'getSubscriptionType', - 'subscription_ids' => 'getSubscriptionIds', - 'channel' => 'getChannel', 'accepted_opt_states' => 'getAcceptedOptStates', + 'business_unit_id' => 'getBusinessUnitId', + 'channel' => 'getChannel', 'filter_type' => 'getFilterType', - 'business_unit_id' => 'getBusinessUnitId' + 'subscription_ids' => 'getSubscriptionIds', + 'subscription_type' => 'getSubscriptionType' ]; /** @@ -287,12 +287,12 @@ public function getFilterTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('subscription_type', $data ?? [], null); - $this->setIfExists('subscription_ids', $data ?? [], null); - $this->setIfExists('channel', $data ?? [], null); $this->setIfExists('accepted_opt_states', $data ?? [], null); - $this->setIfExists('filter_type', $data ?? [], 'COMMUNICATION_SUBSCRIPTION'); $this->setIfExists('business_unit_id', $data ?? [], null); + $this->setIfExists('channel', $data ?? [], null); + $this->setIfExists('filter_type', $data ?? [], 'COMMUNICATION_SUBSCRIPTION'); + $this->setIfExists('subscription_ids', $data ?? [], null); + $this->setIfExists('subscription_type', $data ?? [], null); } /** @@ -322,18 +322,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['subscription_type'] === null) { - $invalidProperties[] = "'subscription_type' can't be null"; - } - if ($this->container['subscription_ids'] === null) { - $invalidProperties[] = "'subscription_ids' can't be null"; + if ($this->container['accepted_opt_states'] === null) { + $invalidProperties[] = "'accepted_opt_states' can't be null"; } if ($this->container['channel'] === null) { $invalidProperties[] = "'channel' can't be null"; } - if ($this->container['accepted_opt_states'] === null) { - $invalidProperties[] = "'accepted_opt_states' can't be null"; - } if ($this->container['filter_type'] === null) { $invalidProperties[] = "'filter_type' can't be null"; } @@ -346,6 +340,12 @@ public function listInvalidProperties() ); } + if ($this->container['subscription_ids'] === null) { + $invalidProperties[] = "'subscription_ids' can't be null"; + } + if ($this->container['subscription_type'] === null) { + $invalidProperties[] = "'subscription_type' can't be null"; + } return $invalidProperties; } @@ -362,55 +362,55 @@ public function valid() /** - * Gets subscription_type + * Gets accepted_opt_states * - * @return string + * @return string[] */ - public function getSubscriptionType() + public function getAcceptedOptStates() { - return $this->container['subscription_type']; + return $this->container['accepted_opt_states']; } /** - * Sets subscription_type + * Sets accepted_opt_states * - * @param string $subscription_type subscription_type + * @param string[] $accepted_opt_states accepted_opt_states * * @return self */ - public function setSubscriptionType($subscription_type) + public function setAcceptedOptStates($accepted_opt_states) { - if (is_null($subscription_type)) { - throw new \InvalidArgumentException('non-nullable subscription_type cannot be null'); + if (is_null($accepted_opt_states)) { + throw new \InvalidArgumentException('non-nullable accepted_opt_states cannot be null'); } - $this->container['subscription_type'] = $subscription_type; + $this->container['accepted_opt_states'] = $accepted_opt_states; return $this; } /** - * Gets subscription_ids + * Gets business_unit_id * - * @return string[] + * @return string|null */ - public function getSubscriptionIds() + public function getBusinessUnitId() { - return $this->container['subscription_ids']; + return $this->container['business_unit_id']; } /** - * Sets subscription_ids + * Sets business_unit_id * - * @param string[] $subscription_ids subscription_ids + * @param string|null $business_unit_id The ID of the business unit associated with the subscription filter. * * @return self */ - public function setSubscriptionIds($subscription_ids) + public function setBusinessUnitId($business_unit_id) { - if (is_null($subscription_ids)) { - throw new \InvalidArgumentException('non-nullable subscription_ids cannot be null'); + if (is_null($business_unit_id)) { + throw new \InvalidArgumentException('non-nullable business_unit_id cannot be null'); } - $this->container['subscription_ids'] = $subscription_ids; + $this->container['business_unit_id'] = $business_unit_id; return $this; } @@ -428,7 +428,7 @@ public function getChannel() /** * Sets channel * - * @param string $channel channel + * @param string $channel Specifies the communication channel associated with the subscription filter (EMAIL, WHATSAPP, SMS). * * @return self */ @@ -442,33 +442,6 @@ public function setChannel($channel) return $this; } - /** - * Gets accepted_opt_states - * - * @return string[] - */ - public function getAcceptedOptStates() - { - return $this->container['accepted_opt_states']; - } - - /** - * Sets accepted_opt_states - * - * @param string[] $accepted_opt_states accepted_opt_states - * - * @return self - */ - public function setAcceptedOptStates($accepted_opt_states) - { - if (is_null($accepted_opt_states)) { - throw new \InvalidArgumentException('non-nullable accepted_opt_states cannot be null'); - } - $this->container['accepted_opt_states'] = $accepted_opt_states; - - return $this; - } - /** * Gets filter_type * @@ -482,7 +455,7 @@ public function getFilterType() /** * Sets filter_type * - * @param string $filter_type filter_type + * @param string $filter_type Indicates the type of filter, which is (COMMUNICATION_SUBSCRIPTION) * * @return self */ @@ -507,39 +480,66 @@ public function setFilterType($filter_type) } /** - * Gets business_unit_id + * Gets subscription_ids * - * @return string|null + * @return string[] */ - public function getBusinessUnitId() + public function getSubscriptionIds() { - return $this->container['business_unit_id']; + return $this->container['subscription_ids']; } /** - * Sets business_unit_id + * Sets subscription_ids * - * @param string|null $business_unit_id business_unit_id + * @param string[] $subscription_ids subscription_ids * * @return self */ - public function setBusinessUnitId($business_unit_id) + public function setSubscriptionIds($subscription_ids) { - if (is_null($business_unit_id)) { - throw new \InvalidArgumentException('non-nullable business_unit_id cannot be null'); + if (is_null($subscription_ids)) { + throw new \InvalidArgumentException('non-nullable subscription_ids cannot be null'); } - $this->container['business_unit_id'] = $business_unit_id; + $this->container['subscription_ids'] = $subscription_ids; + + return $this; + } + + /** + * Gets subscription_type + * + * @return string + */ + public function getSubscriptionType() + { + return $this->container['subscription_type']; + } + + /** + * Sets subscription_type + * + * @param string $subscription_type Defines the type of subscription related to the filter (PORTAL_WIDE, BUSINESS_UNIT_WIDE, INDIVIDUAL_SUBSCRIPTION) + * + * @return self + */ + public function setSubscriptionType($subscription_type) + { + if (is_null($subscription_type)) { + throw new \InvalidArgumentException('non-nullable subscription_type cannot be null'); + } + $this->container['subscription_type'] = $subscription_type; 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]); } @@ -547,12 +547,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; } @@ -577,11 +577,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/Lists/Model/PublicComparativeDatePropertyOperation.php b/codegen/Crm/Lists/Model/PublicComparativeDatePropertyOperation.php index 2e073dab8..05771ec24 100644 --- a/codegen/Crm/Lists/Model/PublicComparativeDatePropertyOperation.php +++ b/codegen/Crm/Lists/Model/PublicComparativeDatePropertyOperation.php @@ -2,7 +2,7 @@ /** * PublicComparativeDatePropertyOperation * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,10 +57,10 @@ class PublicComparativeDatePropertyOperation implements ModelInterface, ArrayAcc * @var string[] */ protected static $openAPITypes = [ - 'include_objects_with_no_value_set' => 'bool', + 'comparison_property_name' => 'string', 'default_comparison_value' => 'string', + 'include_objects_with_no_value_set' => 'bool', 'operation_type' => 'string', - 'comparison_property_name' => 'string', 'operator' => 'string' ]; @@ -72,10 +72,10 @@ class PublicComparativeDatePropertyOperation implements ModelInterface, ArrayAcc * @psalm-var array */ protected static $openAPIFormats = [ - 'include_objects_with_no_value_set' => null, + 'comparison_property_name' => null, 'default_comparison_value' => null, + 'include_objects_with_no_value_set' => null, 'operation_type' => null, - 'comparison_property_name' => null, 'operator' => null ]; @@ -85,10 +85,10 @@ class PublicComparativeDatePropertyOperation implements ModelInterface, ArrayAcc * @var boolean[] */ protected static array $openAPINullables = [ - 'include_objects_with_no_value_set' => false, + 'comparison_property_name' => false, 'default_comparison_value' => false, + 'include_objects_with_no_value_set' => false, 'operation_type' => false, - 'comparison_property_name' => false, 'operator' => false ]; @@ -178,10 +178,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', + 'comparison_property_name' => 'comparisonPropertyName', 'default_comparison_value' => 'defaultComparisonValue', + 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', 'operation_type' => 'operationType', - 'comparison_property_name' => 'comparisonPropertyName', 'operator' => 'operator' ]; @@ -191,10 +191,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', + 'comparison_property_name' => 'setComparisonPropertyName', 'default_comparison_value' => 'setDefaultComparisonValue', + 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', 'operation_type' => 'setOperationType', - 'comparison_property_name' => 'setComparisonPropertyName', 'operator' => 'setOperator' ]; @@ -204,10 +204,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', + 'comparison_property_name' => 'getComparisonPropertyName', 'default_comparison_value' => 'getDefaultComparisonValue', + 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', 'operation_type' => 'getOperationType', - 'comparison_property_name' => 'getComparisonPropertyName', 'operator' => 'getOperator' ]; @@ -281,10 +281,10 @@ public function getOperationTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); + $this->setIfExists('comparison_property_name', $data ?? [], null); $this->setIfExists('default_comparison_value', $data ?? [], null); + $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); $this->setIfExists('operation_type', $data ?? [], 'COMPARATIVE_DATE'); - $this->setIfExists('comparison_property_name', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); } @@ -315,6 +315,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['comparison_property_name'] === null) { + $invalidProperties[] = "'comparison_property_name' can't be null"; + } if ($this->container['include_objects_with_no_value_set'] === null) { $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; } @@ -330,9 +333,6 @@ public function listInvalidProperties() ); } - if ($this->container['comparison_property_name'] === null) { - $invalidProperties[] = "'comparison_property_name' can't be null"; - } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } @@ -352,28 +352,28 @@ public function valid() /** - * Gets include_objects_with_no_value_set + * Gets comparison_property_name * - * @return bool + * @return string */ - public function getIncludeObjectsWithNoValueSet() + public function getComparisonPropertyName() { - return $this->container['include_objects_with_no_value_set']; + return $this->container['comparison_property_name']; } /** - * Sets include_objects_with_no_value_set + * Sets comparison_property_name * - * @param bool $include_objects_with_no_value_set include_objects_with_no_value_set + * @param string $comparison_property_name The name of the property to compare against in the operation. * * @return self */ - public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_set) + public function setComparisonPropertyName($comparison_property_name) { - if (is_null($include_objects_with_no_value_set)) { - throw new \InvalidArgumentException('non-nullable include_objects_with_no_value_set cannot be null'); + if (is_null($comparison_property_name)) { + throw new \InvalidArgumentException('non-nullable comparison_property_name cannot be null'); } - $this->container['include_objects_with_no_value_set'] = $include_objects_with_no_value_set; + $this->container['comparison_property_name'] = $comparison_property_name; return $this; } @@ -391,7 +391,7 @@ public function getDefaultComparisonValue() /** * Sets default_comparison_value * - * @param string|null $default_comparison_value default_comparison_value + * @param string|null $default_comparison_value The default value used for comparison if the actual comparison property value is not set. * * @return self */ @@ -405,6 +405,33 @@ public function setDefaultComparisonValue($default_comparison_value) return $this; } + /** + * Gets include_objects_with_no_value_set + * + * @return bool + */ + public function getIncludeObjectsWithNoValueSet() + { + return $this->container['include_objects_with_no_value_set']; + } + + /** + * Sets include_objects_with_no_value_set + * + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. + * + * @return self + */ + public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_set) + { + if (is_null($include_objects_with_no_value_set)) { + throw new \InvalidArgumentException('non-nullable include_objects_with_no_value_set cannot be null'); + } + $this->container['include_objects_with_no_value_set'] = $include_objects_with_no_value_set; + + return $this; + } + /** * Gets operation_type * @@ -418,7 +445,7 @@ public function getOperationType() /** * Sets operation_type * - * @param string $operation_type operation_type + * @param string $operation_type The type of operation (COMPARATIVE_DATE). * * @return self */ @@ -442,33 +469,6 @@ public function setOperationType($operation_type) return $this; } - /** - * Gets comparison_property_name - * - * @return string - */ - public function getComparisonPropertyName() - { - return $this->container['comparison_property_name']; - } - - /** - * Sets comparison_property_name - * - * @param string $comparison_property_name comparison_property_name - * - * @return self - */ - public function setComparisonPropertyName($comparison_property_name) - { - if (is_null($comparison_property_name)) { - throw new \InvalidArgumentException('non-nullable comparison_property_name cannot be null'); - } - $this->container['comparison_property_name'] = $comparison_property_name; - - return $this; - } - /** * Gets operator * @@ -482,7 +482,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Defines the operation to be applied in the comparative date property operation (IS_BEFORE, IS_AFTER). * * @return self */ @@ -498,11 +498,11 @@ public function setOperator($operator) /** * 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]); } @@ -510,12 +510,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; } @@ -540,11 +540,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/Lists/Model/PublicComparativePropertyUpdatedOperation.php b/codegen/Crm/Lists/Model/PublicComparativePropertyUpdatedOperation.php index 8dc95d997..dec398868 100644 --- a/codegen/Crm/Lists/Model/PublicComparativePropertyUpdatedOperation.php +++ b/codegen/Crm/Lists/Model/PublicComparativePropertyUpdatedOperation.php @@ -2,7 +2,7 @@ /** * PublicComparativePropertyUpdatedOperation * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,10 +57,10 @@ class PublicComparativePropertyUpdatedOperation implements ModelInterface, Array * @var string[] */ protected static $openAPITypes = [ - 'include_objects_with_no_value_set' => 'bool', + 'comparison_property_name' => 'string', 'default_comparison_value' => 'string', + 'include_objects_with_no_value_set' => 'bool', 'operation_type' => 'string', - 'comparison_property_name' => 'string', 'operator' => 'string' ]; @@ -72,10 +72,10 @@ class PublicComparativePropertyUpdatedOperation implements ModelInterface, Array * @psalm-var array */ protected static $openAPIFormats = [ - 'include_objects_with_no_value_set' => null, + 'comparison_property_name' => null, 'default_comparison_value' => null, + 'include_objects_with_no_value_set' => null, 'operation_type' => null, - 'comparison_property_name' => null, 'operator' => null ]; @@ -85,10 +85,10 @@ class PublicComparativePropertyUpdatedOperation implements ModelInterface, Array * @var boolean[] */ protected static array $openAPINullables = [ - 'include_objects_with_no_value_set' => false, + 'comparison_property_name' => false, 'default_comparison_value' => false, + 'include_objects_with_no_value_set' => false, 'operation_type' => false, - 'comparison_property_name' => false, 'operator' => false ]; @@ -178,10 +178,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', + 'comparison_property_name' => 'comparisonPropertyName', 'default_comparison_value' => 'defaultComparisonValue', + 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', 'operation_type' => 'operationType', - 'comparison_property_name' => 'comparisonPropertyName', 'operator' => 'operator' ]; @@ -191,10 +191,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', + 'comparison_property_name' => 'setComparisonPropertyName', 'default_comparison_value' => 'setDefaultComparisonValue', + 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', 'operation_type' => 'setOperationType', - 'comparison_property_name' => 'setComparisonPropertyName', 'operator' => 'setOperator' ]; @@ -204,10 +204,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', + 'comparison_property_name' => 'getComparisonPropertyName', 'default_comparison_value' => 'getDefaultComparisonValue', + 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', 'operation_type' => 'getOperationType', - 'comparison_property_name' => 'getComparisonPropertyName', 'operator' => 'getOperator' ]; @@ -281,10 +281,10 @@ public function getOperationTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); + $this->setIfExists('comparison_property_name', $data ?? [], null); $this->setIfExists('default_comparison_value', $data ?? [], null); + $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); $this->setIfExists('operation_type', $data ?? [], 'COMPARATIVE_PROPERTY_UPDATED'); - $this->setIfExists('comparison_property_name', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); } @@ -315,6 +315,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['comparison_property_name'] === null) { + $invalidProperties[] = "'comparison_property_name' can't be null"; + } if ($this->container['include_objects_with_no_value_set'] === null) { $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; } @@ -330,9 +333,6 @@ public function listInvalidProperties() ); } - if ($this->container['comparison_property_name'] === null) { - $invalidProperties[] = "'comparison_property_name' can't be null"; - } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } @@ -352,28 +352,28 @@ public function valid() /** - * Gets include_objects_with_no_value_set + * Gets comparison_property_name * - * @return bool + * @return string */ - public function getIncludeObjectsWithNoValueSet() + public function getComparisonPropertyName() { - return $this->container['include_objects_with_no_value_set']; + return $this->container['comparison_property_name']; } /** - * Sets include_objects_with_no_value_set + * Sets comparison_property_name * - * @param bool $include_objects_with_no_value_set include_objects_with_no_value_set + * @param string $comparison_property_name The name of the property to compare against in the operation. * * @return self */ - public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_set) + public function setComparisonPropertyName($comparison_property_name) { - if (is_null($include_objects_with_no_value_set)) { - throw new \InvalidArgumentException('non-nullable include_objects_with_no_value_set cannot be null'); + if (is_null($comparison_property_name)) { + throw new \InvalidArgumentException('non-nullable comparison_property_name cannot be null'); } - $this->container['include_objects_with_no_value_set'] = $include_objects_with_no_value_set; + $this->container['comparison_property_name'] = $comparison_property_name; return $this; } @@ -391,7 +391,7 @@ public function getDefaultComparisonValue() /** * Sets default_comparison_value * - * @param string|null $default_comparison_value default_comparison_value + * @param string|null $default_comparison_value The default value used for comparison if the actual comparison property value is not set. * * @return self */ @@ -405,6 +405,33 @@ public function setDefaultComparisonValue($default_comparison_value) return $this; } + /** + * Gets include_objects_with_no_value_set + * + * @return bool + */ + public function getIncludeObjectsWithNoValueSet() + { + return $this->container['include_objects_with_no_value_set']; + } + + /** + * Sets include_objects_with_no_value_set + * + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. + * + * @return self + */ + public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_set) + { + if (is_null($include_objects_with_no_value_set)) { + throw new \InvalidArgumentException('non-nullable include_objects_with_no_value_set cannot be null'); + } + $this->container['include_objects_with_no_value_set'] = $include_objects_with_no_value_set; + + return $this; + } + /** * Gets operation_type * @@ -418,7 +445,7 @@ public function getOperationType() /** * Sets operation_type * - * @param string $operation_type operation_type + * @param string $operation_type Specifies the type of operation (COMPARATIVE_PROPERTY_UPDATED). * * @return self */ @@ -442,33 +469,6 @@ public function setOperationType($operation_type) return $this; } - /** - * Gets comparison_property_name - * - * @return string - */ - public function getComparisonPropertyName() - { - return $this->container['comparison_property_name']; - } - - /** - * Sets comparison_property_name - * - * @param string $comparison_property_name comparison_property_name - * - * @return self - */ - public function setComparisonPropertyName($comparison_property_name) - { - if (is_null($comparison_property_name)) { - throw new \InvalidArgumentException('non-nullable comparison_property_name cannot be null'); - } - $this->container['comparison_property_name'] = $comparison_property_name; - - return $this; - } - /** * Gets operator * @@ -482,7 +482,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Defines the operation to be applied, such as comparison operators (IS_BEFORE, IS_AFTER). * * @return self */ @@ -498,11 +498,11 @@ public function setOperator($operator) /** * 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]); } @@ -510,12 +510,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; } @@ -540,11 +540,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/Lists/Model/PublicConstantFilter.php b/codegen/Crm/Lists/Model/PublicConstantFilter.php index 43678315c..d8cb76fb0 100644 --- a/codegen/Crm/Lists/Model/PublicConstantFilter.php +++ b/codegen/Crm/Lists/Model/PublicConstantFilter.php @@ -2,7 +2,7 @@ /** * PublicConstantFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,9 +57,9 @@ class PublicConstantFilter implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ + 'filter_type' => 'string', 'should_accept' => 'bool', - 'source' => 'string', - 'filter_type' => 'string' + 'source' => 'string' ]; /** @@ -70,9 +70,9 @@ class PublicConstantFilter implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ + 'filter_type' => null, 'should_accept' => null, - 'source' => null, - 'filter_type' => null + 'source' => null ]; /** @@ -81,9 +81,9 @@ class PublicConstantFilter implements ModelInterface, ArrayAccess, \JsonSerializ * @var boolean[] */ protected static array $openAPINullables = [ + 'filter_type' => false, 'should_accept' => false, - 'source' => false, - 'filter_type' => false + 'source' => false ]; /** @@ -172,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'filter_type' => 'filterType', 'should_accept' => 'shouldAccept', - 'source' => 'source', - 'filter_type' => 'filterType' + 'source' => 'source' ]; /** @@ -183,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'filter_type' => 'setFilterType', 'should_accept' => 'setShouldAccept', - 'source' => 'setSource', - 'filter_type' => 'setFilterType' + 'source' => 'setSource' ]; /** @@ -194,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'filter_type' => 'getFilterType', 'should_accept' => 'getShouldAccept', - 'source' => 'getSource', - 'filter_type' => 'getFilterType' + 'source' => 'getSource' ]; /** @@ -269,9 +269,9 @@ public function getFilterTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('filter_type', $data ?? [], 'CONSTANT'); $this->setIfExists('should_accept', $data ?? [], null); $this->setIfExists('source', $data ?? [], null); - $this->setIfExists('filter_type', $data ?? [], 'CONSTANT'); } /** @@ -301,9 +301,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['should_accept'] === null) { - $invalidProperties[] = "'should_accept' can't be null"; - } if ($this->container['filter_type'] === null) { $invalidProperties[] = "'filter_type' can't be null"; } @@ -316,6 +313,9 @@ public function listInvalidProperties() ); } + if ($this->container['should_accept'] === null) { + $invalidProperties[] = "'should_accept' can't be null"; + } return $invalidProperties; } @@ -331,6 +331,43 @@ public function valid() } + /** + * Gets filter_type + * + * @return string + */ + public function getFilterType() + { + return $this->container['filter_type']; + } + + /** + * Sets filter_type + * + * @param string $filter_type Specifies the type of filter, which is (CONSTANT). + * + * @return self + */ + public function setFilterType($filter_type) + { + if (is_null($filter_type)) { + throw new \InvalidArgumentException('non-nullable filter_type cannot be null'); + } + $allowedValues = $this->getFilterTypeAllowableValues(); + if (!in_array($filter_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'filter_type', must be one of '%s'", + $filter_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['filter_type'] = $filter_type; + + return $this; + } + /** * Gets should_accept * @@ -344,7 +381,7 @@ public function getShouldAccept() /** * Sets should_accept * - * @param bool $should_accept should_accept + * @param bool $should_accept Indicates whether the filter should accept the condition. * * @return self */ @@ -371,7 +408,7 @@ public function getSource() /** * Sets source * - * @param string|null $source source + * @param string|null $source Defines the source of the constant filter. * * @return self */ @@ -384,51 +421,14 @@ public function setSource($source) return $this; } - - /** - * Gets filter_type - * - * @return string - */ - public function getFilterType() - { - return $this->container['filter_type']; - } - - /** - * Sets filter_type - * - * @param string $filter_type filter_type - * - * @return self - */ - public function setFilterType($filter_type) - { - if (is_null($filter_type)) { - throw new \InvalidArgumentException('non-nullable filter_type cannot be null'); - } - $allowedValues = $this->getFilterTypeAllowableValues(); - if (!in_array($filter_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'filter_type', must be one of '%s'", - $filter_type, - implode("', '", $allowedValues) - ) - ); - } - $this->container['filter_type'] = $filter_type; - - 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]); } @@ -436,12 +436,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; } @@ -466,11 +466,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/Lists/Model/PublicCtaAnalyticsFilter.php b/codegen/Crm/Lists/Model/PublicCtaAnalyticsFilter.php index a98611ff7..e68a9a0a9 100644 --- a/codegen/Crm/Lists/Model/PublicCtaAnalyticsFilter.php +++ b/codegen/Crm/Lists/Model/PublicCtaAnalyticsFilter.php @@ -2,7 +2,7 @@ /** * PublicCtaAnalyticsFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -58,10 +58,10 @@ class PublicCtaAnalyticsFilter implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPITypes = [ 'coalescing_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', - 'pruning_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', - 'filter_type' => 'string', 'cta_name' => 'string', - 'operator' => 'string' + 'filter_type' => 'string', + 'operator' => 'string', + 'pruning_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy' ]; /** @@ -73,10 +73,10 @@ class PublicCtaAnalyticsFilter implements ModelInterface, ArrayAccess, \JsonSeri */ protected static $openAPIFormats = [ 'coalescing_refine_by' => null, - 'pruning_refine_by' => null, - 'filter_type' => null, 'cta_name' => null, - 'operator' => null + 'filter_type' => null, + 'operator' => null, + 'pruning_refine_by' => null ]; /** @@ -86,10 +86,10 @@ class PublicCtaAnalyticsFilter implements ModelInterface, ArrayAccess, \JsonSeri */ protected static array $openAPINullables = [ 'coalescing_refine_by' => false, - 'pruning_refine_by' => false, - 'filter_type' => false, 'cta_name' => false, - 'operator' => false + 'filter_type' => false, + 'operator' => false, + 'pruning_refine_by' => false ]; /** @@ -179,10 +179,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'coalescing_refine_by' => 'coalescingRefineBy', - 'pruning_refine_by' => 'pruningRefineBy', - 'filter_type' => 'filterType', 'cta_name' => 'ctaName', - 'operator' => 'operator' + 'filter_type' => 'filterType', + 'operator' => 'operator', + 'pruning_refine_by' => 'pruningRefineBy' ]; /** @@ -192,10 +192,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'coalescing_refine_by' => 'setCoalescingRefineBy', - 'pruning_refine_by' => 'setPruningRefineBy', - 'filter_type' => 'setFilterType', 'cta_name' => 'setCtaName', - 'operator' => 'setOperator' + 'filter_type' => 'setFilterType', + 'operator' => 'setOperator', + 'pruning_refine_by' => 'setPruningRefineBy' ]; /** @@ -205,10 +205,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'coalescing_refine_by' => 'getCoalescingRefineBy', - 'pruning_refine_by' => 'getPruningRefineBy', - 'filter_type' => 'getFilterType', 'cta_name' => 'getCtaName', - 'operator' => 'getOperator' + 'filter_type' => 'getFilterType', + 'operator' => 'getOperator', + 'pruning_refine_by' => 'getPruningRefineBy' ]; /** @@ -282,10 +282,10 @@ public function getFilterTypeAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('coalescing_refine_by', $data ?? [], null); - $this->setIfExists('pruning_refine_by', $data ?? [], null); - $this->setIfExists('filter_type', $data ?? [], 'CTA'); $this->setIfExists('cta_name', $data ?? [], null); + $this->setIfExists('filter_type', $data ?? [], 'CTA'); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('pruning_refine_by', $data ?? [], null); } /** @@ -315,6 +315,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['cta_name'] === null) { + $invalidProperties[] = "'cta_name' can't be null"; + } if ($this->container['filter_type'] === null) { $invalidProperties[] = "'filter_type' can't be null"; } @@ -327,9 +330,6 @@ public function listInvalidProperties() ); } - if ($this->container['cta_name'] === null) { - $invalidProperties[] = "'cta_name' can't be null"; - } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } @@ -376,28 +376,28 @@ public function setCoalescingRefineBy($coalescing_refine_by) } /** - * Gets pruning_refine_by + * Gets cta_name * - * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null + * @return string */ - public function getPruningRefineBy() + public function getCtaName() { - return $this->container['pruning_refine_by']; + return $this->container['cta_name']; } /** - * Sets pruning_refine_by + * Sets cta_name * - * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null $pruning_refine_by pruning_refine_by + * @param string $cta_name The name of the Call-to-Action (CTA) to be used in the filter. * * @return self */ - public function setPruningRefineBy($pruning_refine_by) + public function setCtaName($cta_name) { - if (is_null($pruning_refine_by)) { - throw new \InvalidArgumentException('non-nullable pruning_refine_by cannot be null'); + if (is_null($cta_name)) { + throw new \InvalidArgumentException('non-nullable cta_name cannot be null'); } - $this->container['pruning_refine_by'] = $pruning_refine_by; + $this->container['cta_name'] = $cta_name; return $this; } @@ -415,7 +415,7 @@ public function getFilterType() /** * Sets filter_type * - * @param string $filter_type filter_type + * @param string $filter_type Indicates the type of filter being applied, which is (CTA). * * @return self */ @@ -440,66 +440,66 @@ public function setFilterType($filter_type) } /** - * Gets cta_name + * Gets operator * * @return string */ - public function getCtaName() + public function getOperator() { - return $this->container['cta_name']; + return $this->container['operator']; } /** - * Sets cta_name + * Sets operator * - * @param string $cta_name cta_name + * @param string $operator Defines the operation to be applied within the filter (HAS_CLICKED_CTA, HAS_NOT_CLICKED_CTA, HAS_OPENED_CTA, HAS_NOT_OPENED_CTA, HAS_CLICKED_CTA_PLACEMENT, HAS_NOT_CLICKED_CTA_PLACEMENT, HAS_OPENED_CTA_PLACEMENT, HAS_NOT_OPENED_CTA_PLACEMENT). * * @return self */ - public function setCtaName($cta_name) + public function setOperator($operator) { - if (is_null($cta_name)) { - throw new \InvalidArgumentException('non-nullable cta_name cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['cta_name'] = $cta_name; + $this->container['operator'] = $operator; return $this; } /** - * Gets operator + * Gets pruning_refine_by * - * @return string + * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy|null */ - public function getOperator() + public function getPruningRefineBy() { - return $this->container['operator']; + return $this->container['pruning_refine_by']; } /** - * Sets operator + * Sets pruning_refine_by * - * @param string $operator operator + * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy|null $pruning_refine_by pruning_refine_by * * @return self */ - public function setOperator($operator) + public function setPruningRefineBy($pruning_refine_by) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); + if (is_null($pruning_refine_by)) { + throw new \InvalidArgumentException('non-nullable pruning_refine_by cannot be null'); } - $this->container['operator'] = $operator; + $this->container['pruning_refine_by'] = $pruning_refine_by; 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]); } @@ -507,12 +507,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; } @@ -537,11 +537,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/Lists/Model/PublicDatePoint.php b/codegen/Crm/Lists/Model/PublicDatePoint.php index d052e4b63..355528503 100644 --- a/codegen/Crm/Lists/Model/PublicDatePoint.php +++ b/codegen/Crm/Lists/Model/PublicDatePoint.php @@ -2,7 +2,7 @@ /** * PublicDatePoint * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,16 +57,16 @@ class PublicDatePoint implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'month' => 'int', + 'day' => 'int', 'hour' => 'int', - 'year' => 'int', - 'timezone_source' => 'string', 'millisecond' => 'int', - 'time_type' => 'string', - 'zone_id' => 'string', - 'day' => 'int', 'minute' => 'int', - 'second' => 'int' + 'month' => 'int', + 'second' => 'int', + 'time_type' => 'string', + 'timezone_source' => 'string', + 'year' => 'int', + 'zone_id' => 'string' ]; /** @@ -77,16 +77,16 @@ class PublicDatePoint implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'month' => 'int32', + 'day' => 'int32', 'hour' => 'int32', - 'year' => 'int32', - 'timezone_source' => null, 'millisecond' => 'int32', - 'time_type' => null, - 'zone_id' => null, - 'day' => 'int32', 'minute' => 'int32', - 'second' => 'int32' + 'month' => 'int32', + 'second' => 'int32', + 'time_type' => null, + 'timezone_source' => null, + 'year' => 'int32', + 'zone_id' => null ]; /** @@ -95,16 +95,16 @@ class PublicDatePoint implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'month' => false, + 'day' => false, 'hour' => false, - 'year' => false, - 'timezone_source' => false, 'millisecond' => false, - 'time_type' => false, - 'zone_id' => false, - 'day' => false, 'minute' => false, - 'second' => false + 'month' => false, + 'second' => false, + 'time_type' => false, + 'timezone_source' => false, + 'year' => false, + 'zone_id' => false ]; /** @@ -193,16 +193,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'month' => 'month', + 'day' => 'day', 'hour' => 'hour', - 'year' => 'year', - 'timezone_source' => 'timezoneSource', 'millisecond' => 'millisecond', - 'time_type' => 'timeType', - 'zone_id' => 'zoneId', - 'day' => 'day', 'minute' => 'minute', - 'second' => 'second' + 'month' => 'month', + 'second' => 'second', + 'time_type' => 'timeType', + 'timezone_source' => 'timezoneSource', + 'year' => 'year', + 'zone_id' => 'zoneId' ]; /** @@ -211,16 +211,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'month' => 'setMonth', + 'day' => 'setDay', 'hour' => 'setHour', - 'year' => 'setYear', - 'timezone_source' => 'setTimezoneSource', 'millisecond' => 'setMillisecond', - 'time_type' => 'setTimeType', - 'zone_id' => 'setZoneId', - 'day' => 'setDay', 'minute' => 'setMinute', - 'second' => 'setSecond' + 'month' => 'setMonth', + 'second' => 'setSecond', + 'time_type' => 'setTimeType', + 'timezone_source' => 'setTimezoneSource', + 'year' => 'setYear', + 'zone_id' => 'setZoneId' ]; /** @@ -229,16 +229,16 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'month' => 'getMonth', + 'day' => 'getDay', 'hour' => 'getHour', - 'year' => 'getYear', - 'timezone_source' => 'getTimezoneSource', 'millisecond' => 'getMillisecond', - 'time_type' => 'getTimeType', - 'zone_id' => 'getZoneId', - 'day' => 'getDay', 'minute' => 'getMinute', - 'second' => 'getSecond' + 'month' => 'getMonth', + 'second' => 'getSecond', + 'time_type' => 'getTimeType', + 'timezone_source' => 'getTimezoneSource', + 'year' => 'getYear', + 'zone_id' => 'getZoneId' ]; /** @@ -311,16 +311,16 @@ public function getTimeTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('month', $data ?? [], null); + $this->setIfExists('day', $data ?? [], null); $this->setIfExists('hour', $data ?? [], null); - $this->setIfExists('year', $data ?? [], null); - $this->setIfExists('timezone_source', $data ?? [], null); $this->setIfExists('millisecond', $data ?? [], null); - $this->setIfExists('time_type', $data ?? [], 'DATE'); - $this->setIfExists('zone_id', $data ?? [], null); - $this->setIfExists('day', $data ?? [], null); $this->setIfExists('minute', $data ?? [], null); + $this->setIfExists('month', $data ?? [], null); $this->setIfExists('second', $data ?? [], null); + $this->setIfExists('time_type', $data ?? [], 'DATE'); + $this->setIfExists('timezone_source', $data ?? [], null); + $this->setIfExists('year', $data ?? [], null); + $this->setIfExists('zone_id', $data ?? [], null); } /** @@ -350,12 +350,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } if ($this->container['month'] === null) { $invalidProperties[] = "'month' can't be null"; } - if ($this->container['year'] === null) { - $invalidProperties[] = "'year' can't be null"; - } if ($this->container['time_type'] === null) { $invalidProperties[] = "'time_type' can't be null"; } @@ -368,12 +368,12 @@ public function listInvalidProperties() ); } + if ($this->container['year'] === null) { + $invalidProperties[] = "'year' can't be null"; + } if ($this->container['zone_id'] === null) { $invalidProperties[] = "'zone_id' can't be null"; } - if ($this->container['day'] === null) { - $invalidProperties[] = "'day' can't be null"; - } return $invalidProperties; } @@ -390,28 +390,28 @@ public function valid() /** - * Gets month + * Gets day * * @return int */ - public function getMonth() + public function getDay() { - return $this->container['month']; + return $this->container['day']; } /** - * Sets month + * Sets day * - * @param int $month month + * @param int $day The day component of the date. * * @return self */ - public function setMonth($month) + public function setDay($day) { - if (is_null($month)) { - throw new \InvalidArgumentException('non-nullable month cannot be null'); + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); } - $this->container['month'] = $month; + $this->container['day'] = $day; return $this; } @@ -429,7 +429,7 @@ public function getHour() /** * Sets hour * - * @param int|null $hour hour + * @param int|null $hour The hour component of the time. * * @return self */ @@ -444,82 +444,109 @@ public function setHour($hour) } /** - * Gets year + * Gets millisecond * - * @return int + * @return int|null */ - public function getYear() + public function getMillisecond() { - return $this->container['year']; + return $this->container['millisecond']; } /** - * Sets year + * Sets millisecond * - * @param int $year year + * @param int|null $millisecond The millisecond component of the time. * * @return self */ - public function setYear($year) + public function setMillisecond($millisecond) { - if (is_null($year)) { - throw new \InvalidArgumentException('non-nullable year cannot be null'); + if (is_null($millisecond)) { + throw new \InvalidArgumentException('non-nullable millisecond cannot be null'); } - $this->container['year'] = $year; + $this->container['millisecond'] = $millisecond; return $this; } /** - * Gets timezone_source + * Gets minute * - * @return string|null + * @return int|null */ - public function getTimezoneSource() + public function getMinute() { - return $this->container['timezone_source']; + return $this->container['minute']; } /** - * Sets timezone_source + * Sets minute * - * @param string|null $timezone_source timezone_source + * @param int|null $minute The minute component of the time. * * @return self */ - public function setTimezoneSource($timezone_source) + public function setMinute($minute) { - if (is_null($timezone_source)) { - throw new \InvalidArgumentException('non-nullable timezone_source cannot be null'); + if (is_null($minute)) { + throw new \InvalidArgumentException('non-nullable minute cannot be null'); } - $this->container['timezone_source'] = $timezone_source; + $this->container['minute'] = $minute; return $this; } /** - * Gets millisecond + * Gets month + * + * @return int + */ + public function getMonth() + { + return $this->container['month']; + } + + /** + * Sets month + * + * @param int $month The month component of the date. + * + * @return self + */ + public function setMonth($month) + { + if (is_null($month)) { + throw new \InvalidArgumentException('non-nullable month cannot be null'); + } + $this->container['month'] = $month; + + return $this; + } + + /** + * Gets second * * @return int|null */ - public function getMillisecond() + public function getSecond() { - return $this->container['millisecond']; + return $this->container['second']; } /** - * Sets millisecond + * Sets second * - * @param int|null $millisecond millisecond + * @param int|null $second The second component of the time. * * @return self */ - public function setMillisecond($millisecond) + public function setSecond($second) { - if (is_null($millisecond)) { - throw new \InvalidArgumentException('non-nullable millisecond cannot be null'); + if (is_null($second)) { + throw new \InvalidArgumentException('non-nullable second cannot be null'); } - $this->container['millisecond'] = $millisecond; + $this->container['second'] = $second; return $this; } @@ -537,7 +564,7 @@ public function getTimeType() /** * Sets time_type * - * @param string $time_type time_type + * @param string $time_type Specifies the type of time (DATE). * * @return self */ @@ -562,120 +589,93 @@ public function setTimeType($time_type) } /** - * Gets zone_id + * Gets timezone_source * - * @return string + * @return string|null */ - public function getZoneId() + public function getTimezoneSource() { - return $this->container['zone_id']; + return $this->container['timezone_source']; } /** - * Sets zone_id + * Sets timezone_source * - * @param string $zone_id zone_id + * @param string|null $timezone_source The source of the time zone information. * * @return self */ - public function setZoneId($zone_id) + public function setTimezoneSource($timezone_source) { - if (is_null($zone_id)) { - throw new \InvalidArgumentException('non-nullable zone_id cannot be null'); + if (is_null($timezone_source)) { + throw new \InvalidArgumentException('non-nullable timezone_source cannot be null'); } - $this->container['zone_id'] = $zone_id; + $this->container['timezone_source'] = $timezone_source; return $this; } /** - * Gets day + * Gets year * * @return int */ - public function getDay() - { - return $this->container['day']; - } - - /** - * Sets day - * - * @param int $day day - * - * @return self - */ - public function setDay($day) - { - if (is_null($day)) { - throw new \InvalidArgumentException('non-nullable day cannot be null'); - } - $this->container['day'] = $day; - - return $this; - } - - /** - * Gets minute - * - * @return int|null - */ - public function getMinute() + public function getYear() { - return $this->container['minute']; + return $this->container['year']; } /** - * Sets minute + * Sets year * - * @param int|null $minute minute + * @param int $year The year component of the date. * * @return self */ - public function setMinute($minute) + public function setYear($year) { - if (is_null($minute)) { - throw new \InvalidArgumentException('non-nullable minute cannot be null'); + if (is_null($year)) { + throw new \InvalidArgumentException('non-nullable year cannot be null'); } - $this->container['minute'] = $minute; + $this->container['year'] = $year; return $this; } /** - * Gets second + * Gets zone_id * - * @return int|null + * @return string */ - public function getSecond() + public function getZoneId() { - return $this->container['second']; + return $this->container['zone_id']; } /** - * Sets second + * Sets zone_id * - * @param int|null $second second + * @param string $zone_id The identifier for the time zone. * * @return self */ - public function setSecond($second) + public function setZoneId($zone_id) { - if (is_null($second)) { - throw new \InvalidArgumentException('non-nullable second cannot be null'); + if (is_null($zone_id)) { + throw new \InvalidArgumentException('non-nullable zone_id cannot be null'); } - $this->container['second'] = $second; + $this->container['zone_id'] = $zone_id; 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]); } @@ -683,12 +683,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; } @@ -713,11 +713,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/Lists/Model/PublicDatePropertyOperation.php b/codegen/Crm/Lists/Model/PublicDatePropertyOperation.php index 0e6b06e06..db53bb9cd 100644 --- a/codegen/Crm/Lists/Model/PublicDatePropertyOperation.php +++ b/codegen/Crm/Lists/Model/PublicDatePropertyOperation.php @@ -2,7 +2,7 @@ /** * PublicDatePropertyOperation * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,12 +57,12 @@ class PublicDatePropertyOperation implements ModelInterface, ArrayAccess, \JsonS * @var string[] */ protected static $openAPITypes = [ + 'day' => 'int', 'include_objects_with_no_value_set' => 'bool', 'month' => 'string', - 'year' => 'int', 'operation_type' => 'string', - 'day' => 'int', - 'operator' => 'string' + 'operator' => 'string', + 'year' => 'int' ]; /** @@ -73,12 +73,12 @@ class PublicDatePropertyOperation implements ModelInterface, ArrayAccess, \JsonS * @psalm-var array */ protected static $openAPIFormats = [ + 'day' => 'int32', 'include_objects_with_no_value_set' => null, 'month' => null, - 'year' => 'int32', 'operation_type' => null, - 'day' => 'int32', - 'operator' => null + 'operator' => null, + 'year' => 'int32' ]; /** @@ -87,12 +87,12 @@ class PublicDatePropertyOperation implements ModelInterface, ArrayAccess, \JsonS * @var boolean[] */ protected static array $openAPINullables = [ + 'day' => false, 'include_objects_with_no_value_set' => false, 'month' => false, - 'year' => false, 'operation_type' => false, - 'day' => false, - 'operator' => false + 'operator' => false, + 'year' => false ]; /** @@ -181,12 +181,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'day' => 'day', 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', 'month' => 'month', - 'year' => 'year', 'operation_type' => 'operationType', - 'day' => 'day', - 'operator' => 'operator' + 'operator' => 'operator', + 'year' => 'year' ]; /** @@ -195,12 +195,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'day' => 'setDay', 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', 'month' => 'setMonth', - 'year' => 'setYear', 'operation_type' => 'setOperationType', - 'day' => 'setDay', - 'operator' => 'setOperator' + 'operator' => 'setOperator', + 'year' => 'setYear' ]; /** @@ -209,12 +209,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'day' => 'getDay', 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', 'month' => 'getMonth', - 'year' => 'getYear', 'operation_type' => 'getOperationType', - 'day' => 'getDay', - 'operator' => 'getOperator' + 'operator' => 'getOperator', + 'year' => 'getYear' ]; /** @@ -287,12 +287,12 @@ public function getOperationTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('day', $data ?? [], null); $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); $this->setIfExists('month', $data ?? [], null); - $this->setIfExists('year', $data ?? [], null); $this->setIfExists('operation_type', $data ?? [], 'DATE'); - $this->setIfExists('day', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('year', $data ?? [], null); } /** @@ -322,15 +322,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } if ($this->container['include_objects_with_no_value_set'] === null) { $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; } if ($this->container['month'] === null) { $invalidProperties[] = "'month' can't be null"; } - if ($this->container['year'] === null) { - $invalidProperties[] = "'year' can't be null"; - } if ($this->container['operation_type'] === null) { $invalidProperties[] = "'operation_type' can't be null"; } @@ -343,12 +343,12 @@ public function listInvalidProperties() ); } - if ($this->container['day'] === null) { - $invalidProperties[] = "'day' can't be null"; - } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } + if ($this->container['year'] === null) { + $invalidProperties[] = "'year' can't be null"; + } return $invalidProperties; } @@ -364,6 +364,33 @@ public function valid() } + /** + * Gets day + * + * @return int + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param int $day The day of the month for the date operation. + * + * @return self + */ + public function setDay($day) + { + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + /** * Gets include_objects_with_no_value_set * @@ -377,7 +404,7 @@ public function getIncludeObjectsWithNoValueSet() /** * Sets include_objects_with_no_value_set * - * @param bool $include_objects_with_no_value_set include_objects_with_no_value_set + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included. * * @return self */ @@ -404,7 +431,7 @@ public function getMonth() /** * Sets month * - * @param string $month month + * @param string $month The month for the date operation. * * @return self */ @@ -418,33 +445,6 @@ public function setMonth($month) return $this; } - /** - * Gets year - * - * @return int - */ - public function getYear() - { - return $this->container['year']; - } - - /** - * Sets year - * - * @param int $year year - * - * @return self - */ - public function setYear($year) - { - if (is_null($year)) { - throw new \InvalidArgumentException('non-nullable year cannot be null'); - } - $this->container['year'] = $year; - - return $this; - } - /** * Gets operation_type * @@ -458,7 +458,7 @@ public function getOperationType() /** * Sets operation_type * - * @param string $operation_type operation_type + * @param string $operation_type Specifies the type of operation (DATE). * * @return self */ @@ -483,66 +483,66 @@ public function setOperationType($operation_type) } /** - * Gets day + * Gets operator * - * @return int + * @return string */ - public function getDay() + public function getOperator() { - return $this->container['day']; + return $this->container['operator']; } /** - * Sets day + * Sets operator * - * @param int $day day + * @param string $operator Defines the operation to be applied in the date property operation (IS_LESS_THAN_X_DAYS_AGO, IS_MORE_THAN_X_DAYS_AGO, IS_LESS_THAN_X_DAYS_FROM_NOW, IS_MORE_THAN_X_DAYS_FROM_NOW). * * @return self */ - public function setDay($day) + public function setOperator($operator) { - if (is_null($day)) { - throw new \InvalidArgumentException('non-nullable day cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['day'] = $day; + $this->container['operator'] = $operator; return $this; } /** - * Gets operator + * Gets year * - * @return string + * @return int */ - public function getOperator() + public function getYear() { - return $this->container['operator']; + return $this->container['year']; } /** - * Sets operator + * Sets year * - * @param string $operator operator + * @param int $year The year for the date operation. * * @return self */ - public function setOperator($operator) + public function setYear($year) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); + if (is_null($year)) { + throw new \InvalidArgumentException('non-nullable year cannot be null'); } - $this->container['operator'] = $operator; + $this->container['year'] = $year; 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]); } @@ -550,12 +550,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; } @@ -580,11 +580,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/Lists/Model/PublicDateTimePropertyOperation.php b/codegen/Crm/Lists/Model/PublicDateTimePropertyOperation.php index 9be8dc453..305f801f5 100644 --- a/codegen/Crm/Lists/Model/PublicDateTimePropertyOperation.php +++ b/codegen/Crm/Lists/Model/PublicDateTimePropertyOperation.php @@ -2,7 +2,7 @@ /** * PublicDateTimePropertyOperation * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -58,9 +58,9 @@ class PublicDateTimePropertyOperation implements ModelInterface, ArrayAccess, \J */ protected static $openAPITypes = [ 'include_objects_with_no_value_set' => 'bool', - 'requires_time_zone_conversion' => 'bool', 'operation_type' => 'string', 'operator' => 'string', + 'requires_time_zone_conversion' => 'bool', 'timestamp' => 'int' ]; @@ -73,9 +73,9 @@ class PublicDateTimePropertyOperation implements ModelInterface, ArrayAccess, \J */ protected static $openAPIFormats = [ 'include_objects_with_no_value_set' => null, - 'requires_time_zone_conversion' => null, 'operation_type' => null, 'operator' => null, + 'requires_time_zone_conversion' => null, 'timestamp' => 'int32' ]; @@ -86,9 +86,9 @@ class PublicDateTimePropertyOperation implements ModelInterface, ArrayAccess, \J */ protected static array $openAPINullables = [ 'include_objects_with_no_value_set' => false, - 'requires_time_zone_conversion' => false, 'operation_type' => false, 'operator' => false, + 'requires_time_zone_conversion' => false, 'timestamp' => false ]; @@ -179,9 +179,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', - 'requires_time_zone_conversion' => 'requiresTimeZoneConversion', 'operation_type' => 'operationType', 'operator' => 'operator', + 'requires_time_zone_conversion' => 'requiresTimeZoneConversion', 'timestamp' => 'timestamp' ]; @@ -192,9 +192,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', - 'requires_time_zone_conversion' => 'setRequiresTimeZoneConversion', 'operation_type' => 'setOperationType', 'operator' => 'setOperator', + 'requires_time_zone_conversion' => 'setRequiresTimeZoneConversion', 'timestamp' => 'setTimestamp' ]; @@ -205,9 +205,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', - 'requires_time_zone_conversion' => 'getRequiresTimeZoneConversion', 'operation_type' => 'getOperationType', 'operator' => 'getOperator', + 'requires_time_zone_conversion' => 'getRequiresTimeZoneConversion', 'timestamp' => 'getTimestamp' ]; @@ -282,9 +282,9 @@ public function getOperationTypeAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); - $this->setIfExists('requires_time_zone_conversion', $data ?? [], null); $this->setIfExists('operation_type', $data ?? [], 'DATETIME'); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('requires_time_zone_conversion', $data ?? [], null); $this->setIfExists('timestamp', $data ?? [], null); } @@ -318,9 +318,6 @@ public function listInvalidProperties() if ($this->container['include_objects_with_no_value_set'] === null) { $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; } - if ($this->container['requires_time_zone_conversion'] === null) { - $invalidProperties[] = "'requires_time_zone_conversion' can't be null"; - } if ($this->container['operation_type'] === null) { $invalidProperties[] = "'operation_type' can't be null"; } @@ -336,6 +333,9 @@ public function listInvalidProperties() if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } + if ($this->container['requires_time_zone_conversion'] === null) { + $invalidProperties[] = "'requires_time_zone_conversion' can't be null"; + } if ($this->container['timestamp'] === null) { $invalidProperties[] = "'timestamp' can't be null"; } @@ -367,7 +367,7 @@ public function getIncludeObjectsWithNoValueSet() /** * Sets include_objects_with_no_value_set * - * @param bool $include_objects_with_no_value_set include_objects_with_no_value_set + * @param bool $include_objects_with_no_value_set Specifies whether objects without a set value should be included in the operation. * * @return self */ @@ -381,33 +381,6 @@ public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_s return $this; } - /** - * Gets requires_time_zone_conversion - * - * @return bool - */ - public function getRequiresTimeZoneConversion() - { - return $this->container['requires_time_zone_conversion']; - } - - /** - * Sets requires_time_zone_conversion - * - * @param bool $requires_time_zone_conversion requires_time_zone_conversion - * - * @return self - */ - public function setRequiresTimeZoneConversion($requires_time_zone_conversion) - { - if (is_null($requires_time_zone_conversion)) { - throw new \InvalidArgumentException('non-nullable requires_time_zone_conversion cannot be null'); - } - $this->container['requires_time_zone_conversion'] = $requires_time_zone_conversion; - - return $this; - } - /** * Gets operation_type * @@ -421,7 +394,7 @@ public function getOperationType() /** * Sets operation_type * - * @param string $operation_type operation_type + * @param string $operation_type The type of operation (DATETIME). * * @return self */ @@ -458,7 +431,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Defines the operation to be applied, such as comparison operators (IS_BEFORE, IS_AFTER). * * @return self */ @@ -472,6 +445,33 @@ public function setOperator($operator) return $this; } + /** + * Gets requires_time_zone_conversion + * + * @return bool + */ + public function getRequiresTimeZoneConversion() + { + return $this->container['requires_time_zone_conversion']; + } + + /** + * Sets requires_time_zone_conversion + * + * @param bool $requires_time_zone_conversion Indicates whether the timestamp requires conversion to a different time zone. + * + * @return self + */ + public function setRequiresTimeZoneConversion($requires_time_zone_conversion) + { + if (is_null($requires_time_zone_conversion)) { + throw new \InvalidArgumentException('non-nullable requires_time_zone_conversion cannot be null'); + } + $this->container['requires_time_zone_conversion'] = $requires_time_zone_conversion; + + return $this; + } + /** * Gets timestamp * @@ -485,7 +485,7 @@ public function getTimestamp() /** * Sets timestamp * - * @param int $timestamp timestamp + * @param int $timestamp The specific point in time used in the operation. * * @return self */ @@ -501,11 +501,11 @@ public function setTimestamp($timestamp) /** * 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]); } @@ -513,12 +513,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; } @@ -543,11 +543,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/Lists/Model/PublicEmailEventFilter.php b/codegen/Crm/Lists/Model/PublicEmailEventFilter.php index 98b06e522..d6676fe1b 100644 --- a/codegen/Crm/Lists/Model/PublicEmailEventFilter.php +++ b/codegen/Crm/Lists/Model/PublicEmailEventFilter.php @@ -2,7 +2,7 @@ /** * PublicEmailEventFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,13 +57,13 @@ class PublicEmailEventFilter implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $openAPITypes = [ - 'click_url' => 'string', - 'level' => 'string', - 'pruning_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', 'app_id' => 'string', + 'click_url' => 'string', 'email_id' => 'string', 'filter_type' => 'string', - 'operator' => 'string' + 'level' => 'string', + 'operator' => 'string', + 'pruning_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy' ]; /** @@ -74,13 +74,13 @@ class PublicEmailEventFilter implements ModelInterface, ArrayAccess, \JsonSerial * @psalm-var array */ protected static $openAPIFormats = [ - 'click_url' => null, - 'level' => null, - 'pruning_refine_by' => null, 'app_id' => null, + 'click_url' => null, 'email_id' => null, 'filter_type' => null, - 'operator' => null + 'level' => null, + 'operator' => null, + 'pruning_refine_by' => null ]; /** @@ -89,13 +89,13 @@ class PublicEmailEventFilter implements ModelInterface, ArrayAccess, \JsonSerial * @var boolean[] */ protected static array $openAPINullables = [ - 'click_url' => false, - 'level' => false, - 'pruning_refine_by' => false, 'app_id' => false, + 'click_url' => false, 'email_id' => false, 'filter_type' => false, - 'operator' => false + 'level' => false, + 'operator' => false, + 'pruning_refine_by' => false ]; /** @@ -184,13 +184,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'click_url' => 'clickUrl', - 'level' => 'level', - 'pruning_refine_by' => 'pruningRefineBy', 'app_id' => 'appId', + 'click_url' => 'clickUrl', 'email_id' => 'emailId', 'filter_type' => 'filterType', - 'operator' => 'operator' + 'level' => 'level', + 'operator' => 'operator', + 'pruning_refine_by' => 'pruningRefineBy' ]; /** @@ -199,13 +199,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'click_url' => 'setClickUrl', - 'level' => 'setLevel', - 'pruning_refine_by' => 'setPruningRefineBy', 'app_id' => 'setAppId', + 'click_url' => 'setClickUrl', 'email_id' => 'setEmailId', 'filter_type' => 'setFilterType', - 'operator' => 'setOperator' + 'level' => 'setLevel', + 'operator' => 'setOperator', + 'pruning_refine_by' => 'setPruningRefineBy' ]; /** @@ -214,13 +214,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'click_url' => 'getClickUrl', - 'level' => 'getLevel', - 'pruning_refine_by' => 'getPruningRefineBy', 'app_id' => 'getAppId', + 'click_url' => 'getClickUrl', 'email_id' => 'getEmailId', 'filter_type' => 'getFilterType', - 'operator' => 'getOperator' + 'level' => 'getLevel', + 'operator' => 'getOperator', + 'pruning_refine_by' => 'getPruningRefineBy' ]; /** @@ -265,19 +265,19 @@ public function getModelName() } public const FILTER_TYPE_EMAIL_EVENT = 'EMAIL_EVENT'; + public const OPERATOR_BOUNCED = 'BOUNCED'; public const OPERATOR_LINK_CLICKED = 'LINK_CLICKED'; public const OPERATOR_MARKED_SPAM = 'MARKED_SPAM'; public const OPERATOR_OPENED = 'OPENED'; public const OPERATOR_OPENED_BUT_LINK_NOT_CLICKED = 'OPENED_BUT_LINK_NOT_CLICKED'; public const OPERATOR_OPENED_BUT_NOT_REPLIED = 'OPENED_BUT_NOT_REPLIED'; - public const OPERATOR_REPLIED = 'REPLIED'; - public const OPERATOR_UNSUBSCRIBED = 'UNSUBSCRIBED'; - public const OPERATOR_BOUNCED = 'BOUNCED'; public const OPERATOR_RECEIVED = 'RECEIVED'; public const OPERATOR_RECEIVED_BUT_NOT_OPENED = 'RECEIVED_BUT_NOT_OPENED'; + public const OPERATOR_REPLIED = 'REPLIED'; public const OPERATOR_SENT = 'SENT'; public const OPERATOR_SENT_BUT_LINK_NOT_CLICKED = 'SENT_BUT_LINK_NOT_CLICKED'; public const OPERATOR_SENT_BUT_NOT_RECEIVED = 'SENT_BUT_NOT_RECEIVED'; + public const OPERATOR_UNSUBSCRIBED = 'UNSUBSCRIBED'; /** * Gets allowable values of the enum @@ -299,19 +299,19 @@ public function getFilterTypeAllowableValues() public function getOperatorAllowableValues() { return [ + self::OPERATOR_BOUNCED, self::OPERATOR_LINK_CLICKED, self::OPERATOR_MARKED_SPAM, self::OPERATOR_OPENED, self::OPERATOR_OPENED_BUT_LINK_NOT_CLICKED, self::OPERATOR_OPENED_BUT_NOT_REPLIED, - self::OPERATOR_REPLIED, - self::OPERATOR_UNSUBSCRIBED, - self::OPERATOR_BOUNCED, self::OPERATOR_RECEIVED, self::OPERATOR_RECEIVED_BUT_NOT_OPENED, + self::OPERATOR_REPLIED, self::OPERATOR_SENT, self::OPERATOR_SENT_BUT_LINK_NOT_CLICKED, self::OPERATOR_SENT_BUT_NOT_RECEIVED, + self::OPERATOR_UNSUBSCRIBED, ]; } @@ -330,13 +330,13 @@ public function getOperatorAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('click_url', $data ?? [], null); - $this->setIfExists('level', $data ?? [], null); - $this->setIfExists('pruning_refine_by', $data ?? [], null); $this->setIfExists('app_id', $data ?? [], null); + $this->setIfExists('click_url', $data ?? [], null); $this->setIfExists('email_id', $data ?? [], null); $this->setIfExists('filter_type', $data ?? [], 'EMAIL_EVENT'); + $this->setIfExists('level', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('pruning_refine_by', $data ?? [], null); } /** @@ -366,9 +366,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['level'] === null) { - $invalidProperties[] = "'level' can't be null"; - } if ($this->container['app_id'] === null) { $invalidProperties[] = "'app_id' can't be null"; } @@ -387,6 +384,9 @@ public function listInvalidProperties() ); } + if ($this->container['level'] === null) { + $invalidProperties[] = "'level' can't be null"; + } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } @@ -415,109 +415,55 @@ public function valid() /** - * Gets click_url - * - * @return string|null - */ - public function getClickUrl() - { - return $this->container['click_url']; - } - - /** - * Sets click_url - * - * @param string|null $click_url click_url - * - * @return self - */ - public function setClickUrl($click_url) - { - if (is_null($click_url)) { - throw new \InvalidArgumentException('non-nullable click_url cannot be null'); - } - $this->container['click_url'] = $click_url; - - return $this; - } - - /** - * Gets level + * Gets app_id * * @return string */ - public function getLevel() - { - return $this->container['level']; - } - - /** - * Sets level - * - * @param string $level level - * - * @return self - */ - public function setLevel($level) - { - if (is_null($level)) { - throw new \InvalidArgumentException('non-nullable level cannot be null'); - } - $this->container['level'] = $level; - - return $this; - } - - /** - * Gets pruning_refine_by - * - * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null - */ - public function getPruningRefineBy() + public function getAppId() { - return $this->container['pruning_refine_by']; + return $this->container['app_id']; } /** - * Sets pruning_refine_by + * Sets app_id * - * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null $pruning_refine_by pruning_refine_by + * @param string $app_id The ID of the application associated with the email event filter. * * @return self */ - public function setPruningRefineBy($pruning_refine_by) + public function setAppId($app_id) { - if (is_null($pruning_refine_by)) { - throw new \InvalidArgumentException('non-nullable pruning_refine_by cannot be null'); + if (is_null($app_id)) { + throw new \InvalidArgumentException('non-nullable app_id cannot be null'); } - $this->container['pruning_refine_by'] = $pruning_refine_by; + $this->container['app_id'] = $app_id; return $this; } /** - * Gets app_id + * Gets click_url * - * @return string + * @return string|null */ - public function getAppId() + public function getClickUrl() { - return $this->container['app_id']; + return $this->container['click_url']; } /** - * Sets app_id + * Sets click_url * - * @param string $app_id app_id + * @param string|null $click_url The URL that was clicked in the email event. * * @return self */ - public function setAppId($app_id) + public function setClickUrl($click_url) { - if (is_null($app_id)) { - throw new \InvalidArgumentException('non-nullable app_id cannot be null'); + if (is_null($click_url)) { + throw new \InvalidArgumentException('non-nullable click_url cannot be null'); } - $this->container['app_id'] = $app_id; + $this->container['click_url'] = $click_url; return $this; } @@ -535,7 +481,7 @@ public function getEmailId() /** * Sets email_id * - * @param string $email_id email_id + * @param string $email_id The ID of the email associated with the event filter. * * @return self */ @@ -562,7 +508,7 @@ public function getFilterType() /** * Sets filter_type * - * @param string $filter_type filter_type + * @param string $filter_type Indicates the type of filter (EMAIL_EVENT). * * @return self */ @@ -586,6 +532,33 @@ public function setFilterType($filter_type) return $this; } + /** + * Gets level + * + * @return string + */ + public function getLevel() + { + return $this->container['level']; + } + + /** + * Sets level + * + * @param string $level Specifies the level of the email event, such as EMAIL_API_CAMPAIGN_GROUP. + * + * @return self + */ + public function setLevel($level) + { + if (is_null($level)) { + throw new \InvalidArgumentException('non-nullable level cannot be null'); + } + $this->container['level'] = $level; + + return $this; + } + /** * Gets operator * @@ -599,7 +572,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Defines the operation to be applied within the filter (BOUNCED, LINK_CLICKED, MARKED_SPAM, OPENED, OPENED_BUT_LINK_NOT_CLICKED, OPENED_BUT_NOT_REPLIED, RECEIVED, RECEIVED_BUT_NOT_OPENED, REPLIED, SENT, SENT_BUT_LINK_NOT_CLICKED, SENT_BUT_NOT_RECEIVED, UNSUBSCRIBED). * * @return self */ @@ -622,14 +595,41 @@ public function setOperator($operator) return $this; } + + /** + * Gets pruning_refine_by + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy|null + */ + public function getPruningRefineBy() + { + return $this->container['pruning_refine_by']; + } + + /** + * Sets pruning_refine_by + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy|null $pruning_refine_by pruning_refine_by + * + * @return self + */ + public function setPruningRefineBy($pruning_refine_by) + { + if (is_null($pruning_refine_by)) { + throw new \InvalidArgumentException('non-nullable pruning_refine_by cannot be null'); + } + $this->container['pruning_refine_by'] = $pruning_refine_by; + + 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]); } @@ -637,12 +637,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; } @@ -667,11 +667,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/Lists/Model/PublicEmailSubscriptionFilter.php b/codegen/Crm/Lists/Model/PublicEmailSubscriptionFilter.php index 7e6ffdad2..fdf842cb7 100644 --- a/codegen/Crm/Lists/Model/PublicEmailSubscriptionFilter.php +++ b/codegen/Crm/Lists/Model/PublicEmailSubscriptionFilter.php @@ -2,7 +2,7 @@ /** * PublicEmailSubscriptionFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,10 +57,10 @@ class PublicEmailSubscriptionFilter implements ModelInterface, ArrayAccess, \Jso * @var string[] */ protected static $openAPITypes = [ - 'subscription_type' => 'string', - 'subscription_ids' => 'string[]', + 'accepted_statuses' => 'string[]', 'filter_type' => 'string', - 'accepted_statuses' => 'string[]' + 'subscription_ids' => 'string[]', + 'subscription_type' => 'string' ]; /** @@ -71,10 +71,10 @@ class PublicEmailSubscriptionFilter implements ModelInterface, ArrayAccess, \Jso * @psalm-var array */ protected static $openAPIFormats = [ - 'subscription_type' => null, - 'subscription_ids' => null, + 'accepted_statuses' => null, 'filter_type' => null, - 'accepted_statuses' => null + 'subscription_ids' => null, + 'subscription_type' => null ]; /** @@ -83,10 +83,10 @@ class PublicEmailSubscriptionFilter implements ModelInterface, ArrayAccess, \Jso * @var boolean[] */ protected static array $openAPINullables = [ - 'subscription_type' => false, - 'subscription_ids' => false, + 'accepted_statuses' => false, 'filter_type' => false, - 'accepted_statuses' => false + 'subscription_ids' => false, + 'subscription_type' => false ]; /** @@ -175,10 +175,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'subscription_type' => 'subscriptionType', - 'subscription_ids' => 'subscriptionIds', + 'accepted_statuses' => 'acceptedStatuses', 'filter_type' => 'filterType', - 'accepted_statuses' => 'acceptedStatuses' + 'subscription_ids' => 'subscriptionIds', + 'subscription_type' => 'subscriptionType' ]; /** @@ -187,10 +187,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'subscription_type' => 'setSubscriptionType', - 'subscription_ids' => 'setSubscriptionIds', + 'accepted_statuses' => 'setAcceptedStatuses', 'filter_type' => 'setFilterType', - 'accepted_statuses' => 'setAcceptedStatuses' + 'subscription_ids' => 'setSubscriptionIds', + 'subscription_type' => 'setSubscriptionType' ]; /** @@ -199,10 +199,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'subscription_type' => 'getSubscriptionType', - 'subscription_ids' => 'getSubscriptionIds', + 'accepted_statuses' => 'getAcceptedStatuses', 'filter_type' => 'getFilterType', - 'accepted_statuses' => 'getAcceptedStatuses' + 'subscription_ids' => 'getSubscriptionIds', + 'subscription_type' => 'getSubscriptionType' ]; /** @@ -275,10 +275,10 @@ public function getFilterTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('subscription_type', $data ?? [], null); - $this->setIfExists('subscription_ids', $data ?? [], null); - $this->setIfExists('filter_type', $data ?? [], 'EMAIL_SUBSCRIPTION'); $this->setIfExists('accepted_statuses', $data ?? [], null); + $this->setIfExists('filter_type', $data ?? [], 'EMAIL_SUBSCRIPTION'); + $this->setIfExists('subscription_ids', $data ?? [], null); + $this->setIfExists('subscription_type', $data ?? [], null); } /** @@ -308,8 +308,8 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['subscription_ids'] === null) { - $invalidProperties[] = "'subscription_ids' can't be null"; + if ($this->container['accepted_statuses'] === null) { + $invalidProperties[] = "'accepted_statuses' can't be null"; } if ($this->container['filter_type'] === null) { $invalidProperties[] = "'filter_type' can't be null"; @@ -323,8 +323,8 @@ public function listInvalidProperties() ); } - if ($this->container['accepted_statuses'] === null) { - $invalidProperties[] = "'accepted_statuses' can't be null"; + if ($this->container['subscription_ids'] === null) { + $invalidProperties[] = "'subscription_ids' can't be null"; } return $invalidProperties; } @@ -342,55 +342,28 @@ public function valid() /** - * Gets subscription_type - * - * @return string|null - */ - public function getSubscriptionType() - { - return $this->container['subscription_type']; - } - - /** - * Sets subscription_type - * - * @param string|null $subscription_type subscription_type - * - * @return self - */ - public function setSubscriptionType($subscription_type) - { - if (is_null($subscription_type)) { - throw new \InvalidArgumentException('non-nullable subscription_type cannot be null'); - } - $this->container['subscription_type'] = $subscription_type; - - return $this; - } - - /** - * Gets subscription_ids + * Gets accepted_statuses * * @return string[] */ - public function getSubscriptionIds() + public function getAcceptedStatuses() { - return $this->container['subscription_ids']; + return $this->container['accepted_statuses']; } /** - * Sets subscription_ids + * Sets accepted_statuses * - * @param string[] $subscription_ids subscription_ids + * @param string[] $accepted_statuses accepted_statuses * * @return self */ - public function setSubscriptionIds($subscription_ids) + public function setAcceptedStatuses($accepted_statuses) { - if (is_null($subscription_ids)) { - throw new \InvalidArgumentException('non-nullable subscription_ids cannot be null'); + if (is_null($accepted_statuses)) { + throw new \InvalidArgumentException('non-nullable accepted_statuses cannot be null'); } - $this->container['subscription_ids'] = $subscription_ids; + $this->container['accepted_statuses'] = $accepted_statuses; return $this; } @@ -408,7 +381,7 @@ public function getFilterType() /** * Sets filter_type * - * @param string $filter_type filter_type + * @param string $filter_type Indicates the type of filter (EMAIL_SUBSCRIPTION). * * @return self */ @@ -433,39 +406,66 @@ public function setFilterType($filter_type) } /** - * Gets accepted_statuses + * Gets subscription_ids * * @return string[] */ - public function getAcceptedStatuses() + public function getSubscriptionIds() { - return $this->container['accepted_statuses']; + return $this->container['subscription_ids']; } /** - * Sets accepted_statuses + * Sets subscription_ids * - * @param string[] $accepted_statuses accepted_statuses + * @param string[] $subscription_ids subscription_ids * * @return self */ - public function setAcceptedStatuses($accepted_statuses) + public function setSubscriptionIds($subscription_ids) { - if (is_null($accepted_statuses)) { - throw new \InvalidArgumentException('non-nullable accepted_statuses cannot be null'); + if (is_null($subscription_ids)) { + throw new \InvalidArgumentException('non-nullable subscription_ids cannot be null'); } - $this->container['accepted_statuses'] = $accepted_statuses; + $this->container['subscription_ids'] = $subscription_ids; + + return $this; + } + + /** + * Gets subscription_type + * + * @return string|null + */ + public function getSubscriptionType() + { + return $this->container['subscription_type']; + } + + /** + * Sets subscription_type + * + * @param string|null $subscription_type The type of subscription related to the filter (PORTAL, BRAND, SUBSCRIPTION, HARDBOUNCE, SPAMREPORT). + * + * @return self + */ + public function setSubscriptionType($subscription_type) + { + if (is_null($subscription_type)) { + throw new \InvalidArgumentException('non-nullable subscription_type cannot be null'); + } + $this->container['subscription_type'] = $subscription_type; 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]); } @@ -473,12 +473,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; } @@ -503,11 +503,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/Lists/Model/PublicEnumerationPropertyOperation.php b/codegen/Crm/Lists/Model/PublicEnumerationPropertyOperation.php index 5953d15ef..406f46605 100644 --- a/codegen/Crm/Lists/Model/PublicEnumerationPropertyOperation.php +++ b/codegen/Crm/Lists/Model/PublicEnumerationPropertyOperation.php @@ -2,7 +2,7 @@ /** * PublicEnumerationPropertyOperation * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -58,9 +58,9 @@ class PublicEnumerationPropertyOperation implements ModelInterface, ArrayAccess, */ protected static $openAPITypes = [ 'include_objects_with_no_value_set' => 'bool', - 'values' => 'string[]', 'operation_type' => 'string', - 'operator' => 'string' + 'operator' => 'string', + 'values' => 'string[]' ]; /** @@ -72,9 +72,9 @@ class PublicEnumerationPropertyOperation implements ModelInterface, ArrayAccess, */ protected static $openAPIFormats = [ 'include_objects_with_no_value_set' => null, - 'values' => null, 'operation_type' => null, - 'operator' => null + 'operator' => null, + 'values' => null ]; /** @@ -84,9 +84,9 @@ class PublicEnumerationPropertyOperation implements ModelInterface, ArrayAccess, */ protected static array $openAPINullables = [ 'include_objects_with_no_value_set' => false, - 'values' => false, 'operation_type' => false, - 'operator' => false + 'operator' => false, + 'values' => false ]; /** @@ -176,9 +176,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', - 'values' => 'values', 'operation_type' => 'operationType', - 'operator' => 'operator' + 'operator' => 'operator', + 'values' => 'values' ]; /** @@ -188,9 +188,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', - 'values' => 'setValues', 'operation_type' => 'setOperationType', - 'operator' => 'setOperator' + 'operator' => 'setOperator', + 'values' => 'setValues' ]; /** @@ -200,9 +200,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', - 'values' => 'getValues', 'operation_type' => 'getOperationType', - 'operator' => 'getOperator' + 'operator' => 'getOperator', + 'values' => 'getValues' ]; /** @@ -276,9 +276,9 @@ public function getOperationTypeAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); - $this->setIfExists('values', $data ?? [], null); $this->setIfExists('operation_type', $data ?? [], 'ENUMERATION'); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); } /** @@ -311,9 +311,6 @@ public function listInvalidProperties() if ($this->container['include_objects_with_no_value_set'] === null) { $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; } - if ($this->container['values'] === null) { - $invalidProperties[] = "'values' can't be null"; - } if ($this->container['operation_type'] === null) { $invalidProperties[] = "'operation_type' can't be null"; } @@ -329,6 +326,9 @@ public function listInvalidProperties() if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } + if ($this->container['values'] === null) { + $invalidProperties[] = "'values' can't be null"; + } return $invalidProperties; } @@ -357,7 +357,7 @@ public function getIncludeObjectsWithNoValueSet() /** * Sets include_objects_with_no_value_set * - * @param bool $include_objects_with_no_value_set include_objects_with_no_value_set + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. * * @return self */ @@ -371,33 +371,6 @@ public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_s return $this; } - /** - * Gets values - * - * @return string[] - */ - public function getValues() - { - return $this->container['values']; - } - - /** - * Sets values - * - * @param string[] $values values - * - * @return self - */ - public function setValues($values) - { - if (is_null($values)) { - throw new \InvalidArgumentException('non-nullable values cannot be null'); - } - $this->container['values'] = $values; - - return $this; - } - /** * Gets operation_type * @@ -411,7 +384,7 @@ public function getOperationType() /** * Sets operation_type * - * @param string $operation_type operation_type + * @param string $operation_type Specifies the type of operation (ENUMERATION). * * @return self */ @@ -448,7 +421,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Defines the operation to be applied in the enumeration property operation (IS_ANY_OF, IS_NONE_OF, IS_EXACTLY, IS_NOT_EXACTLY, CONTAINS_ALL, DOES_NOT_CONTAIN_ALL, HAS_EVER_BEEN_ANY_OF, HAS_NEVER_BEEN_ANY_OF, HAS_EVER_BEEN_EXACTLY, HAS_NEVER_BEEN_EXACTLY, HAS_EVER_CONTAINED_ALL, HAS_NEVER_CONTAINED_ALL). * * @return self */ @@ -461,14 +434,41 @@ public function setOperator($operator) return $this; } + + /** + * Gets values + * + * @return string[] + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param string[] $values values + * + * @return self + */ + public function setValues($values) + { + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); + } + $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]); } @@ -476,12 +476,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; } @@ -506,11 +506,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/Lists/Model/PublicEventAnalyticsFilter.php b/codegen/Crm/Lists/Model/PublicEventAnalyticsFilter.php index e2af48840..8dbef46e7 100644 --- a/codegen/Crm/Lists/Model/PublicEventAnalyticsFilter.php +++ b/codegen/Crm/Lists/Model/PublicEventAnalyticsFilter.php @@ -2,7 +2,7 @@ /** * PublicEventAnalyticsFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,11 +57,11 @@ class PublicEventAnalyticsFilter implements ModelInterface, ArrayAccess, \JsonSe * @var string[] */ protected static $openAPITypes = [ + 'coalescing_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicEventAnalyticsFilterCoalescingRefineBy', 'event_id' => 'string', - 'coalescing_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', - 'pruning_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', 'filter_type' => 'string', - 'operator' => 'string' + 'operator' => 'string', + 'pruning_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicEventAnalyticsFilterPruningRefineBy' ]; /** @@ -72,11 +72,11 @@ class PublicEventAnalyticsFilter implements ModelInterface, ArrayAccess, \JsonSe * @psalm-var array */ protected static $openAPIFormats = [ - 'event_id' => null, 'coalescing_refine_by' => null, - 'pruning_refine_by' => null, + 'event_id' => null, 'filter_type' => null, - 'operator' => null + 'operator' => null, + 'pruning_refine_by' => null ]; /** @@ -85,11 +85,11 @@ class PublicEventAnalyticsFilter implements ModelInterface, ArrayAccess, \JsonSe * @var boolean[] */ protected static array $openAPINullables = [ - 'event_id' => false, 'coalescing_refine_by' => false, - 'pruning_refine_by' => false, + 'event_id' => false, 'filter_type' => false, - 'operator' => false + 'operator' => false, + 'pruning_refine_by' => false ]; /** @@ -178,11 +178,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'event_id' => 'eventId', 'coalescing_refine_by' => 'coalescingRefineBy', - 'pruning_refine_by' => 'pruningRefineBy', + 'event_id' => 'eventId', 'filter_type' => 'filterType', - 'operator' => 'operator' + 'operator' => 'operator', + 'pruning_refine_by' => 'pruningRefineBy' ]; /** @@ -191,11 +191,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'event_id' => 'setEventId', 'coalescing_refine_by' => 'setCoalescingRefineBy', - 'pruning_refine_by' => 'setPruningRefineBy', + 'event_id' => 'setEventId', 'filter_type' => 'setFilterType', - 'operator' => 'setOperator' + 'operator' => 'setOperator', + 'pruning_refine_by' => 'setPruningRefineBy' ]; /** @@ -204,11 +204,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'event_id' => 'getEventId', 'coalescing_refine_by' => 'getCoalescingRefineBy', - 'pruning_refine_by' => 'getPruningRefineBy', + 'event_id' => 'getEventId', 'filter_type' => 'getFilterType', - 'operator' => 'getOperator' + 'operator' => 'getOperator', + 'pruning_refine_by' => 'getPruningRefineBy' ]; /** @@ -281,11 +281,11 @@ public function getFilterTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('event_id', $data ?? [], null); $this->setIfExists('coalescing_refine_by', $data ?? [], null); - $this->setIfExists('pruning_refine_by', $data ?? [], null); + $this->setIfExists('event_id', $data ?? [], null); $this->setIfExists('filter_type', $data ?? [], 'EVENT'); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('pruning_refine_by', $data ?? [], null); } /** @@ -348,37 +348,10 @@ public function valid() } - /** - * Gets event_id - * - * @return string - */ - public function getEventId() - { - return $this->container['event_id']; - } - - /** - * Sets event_id - * - * @param string $event_id event_id - * - * @return self - */ - public function setEventId($event_id) - { - if (is_null($event_id)) { - throw new \InvalidArgumentException('non-nullable event_id cannot be null'); - } - $this->container['event_id'] = $event_id; - - return $this; - } - /** * Gets coalescing_refine_by * - * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null + * @return \HubSpot\Client\Crm\Lists\Model\PublicEventAnalyticsFilterCoalescingRefineBy|null */ public function getCoalescingRefineBy() { @@ -388,7 +361,7 @@ public function getCoalescingRefineBy() /** * Sets coalescing_refine_by * - * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null $coalescing_refine_by coalescing_refine_by + * @param \HubSpot\Client\Crm\Lists\Model\PublicEventAnalyticsFilterCoalescingRefineBy|null $coalescing_refine_by coalescing_refine_by * * @return self */ @@ -403,28 +376,28 @@ public function setCoalescingRefineBy($coalescing_refine_by) } /** - * Gets pruning_refine_by + * Gets event_id * - * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null + * @return string */ - public function getPruningRefineBy() + public function getEventId() { - return $this->container['pruning_refine_by']; + return $this->container['event_id']; } /** - * Sets pruning_refine_by + * Sets event_id * - * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null $pruning_refine_by pruning_refine_by + * @param string $event_id The ID of the event to be used in the filter. * * @return self */ - public function setPruningRefineBy($pruning_refine_by) + public function setEventId($event_id) { - if (is_null($pruning_refine_by)) { - throw new \InvalidArgumentException('non-nullable pruning_refine_by cannot be null'); + if (is_null($event_id)) { + throw new \InvalidArgumentException('non-nullable event_id cannot be null'); } - $this->container['pruning_refine_by'] = $pruning_refine_by; + $this->container['event_id'] = $event_id; return $this; } @@ -442,7 +415,7 @@ public function getFilterType() /** * Sets filter_type * - * @param string $filter_type filter_type + * @param string $filter_type Indicates the type of filter being applied (EVENT). * * @return self */ @@ -479,7 +452,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Defines the operation to be applied within the event filter (HAS_EVENT, NOT_HAS_EVENT). * * @return self */ @@ -492,14 +465,41 @@ public function setOperator($operator) return $this; } + + /** + * Gets pruning_refine_by + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicEventAnalyticsFilterPruningRefineBy|null + */ + public function getPruningRefineBy() + { + return $this->container['pruning_refine_by']; + } + + /** + * Sets pruning_refine_by + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicEventAnalyticsFilterPruningRefineBy|null $pruning_refine_by pruning_refine_by + * + * @return self + */ + public function setPruningRefineBy($pruning_refine_by) + { + if (is_null($pruning_refine_by)) { + throw new \InvalidArgumentException('non-nullable pruning_refine_by cannot be null'); + } + $this->container['pruning_refine_by'] = $pruning_refine_by; + + 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]); } @@ -507,12 +507,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; } @@ -537,11 +537,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/Lists/Model/PublicEventAnalyticsFilterCoalescingRefineBy.php b/codegen/Crm/Lists/Model/PublicEventAnalyticsFilterCoalescingRefineBy.php new file mode 100644 index 000000000..12f5bf1db --- /dev/null +++ b/codegen/Crm/Lists/Model/PublicEventAnalyticsFilterCoalescingRefineBy.php @@ -0,0 +1,1175 @@ + + */ +class PublicEventAnalyticsFilterCoalescingRefineBy implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicEventAnalyticsFilter_coalescingRefineBy'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'max_occurrences' => 'int', + 'min_occurrences' => 'int', + 'type' => 'string', + 'set_type' => 'string', + 'comparison' => 'string', + 'time_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', + 'lower_bound_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', + 'range_type' => 'string', + 'upper_bound_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', + 'timestamp' => 'int', + 'lower_timestamp' => 'int', + 'upper_timestamp' => 'int', + 'endpoint_behavior' => 'string', + 'include_objects_with_no_value_set' => 'bool', + 'operation_type' => 'string', + 'operator' => 'string', + 'property_parser' => 'string', + 'time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint', + 'lower_bound_endpoint_behavior' => 'string', + 'lower_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'string', + 'upper_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'max_occurrences' => 'int32', + 'min_occurrences' => 'int32', + 'type' => null, + 'set_type' => null, + 'comparison' => null, + 'time_offset' => null, + 'lower_bound_offset' => null, + 'range_type' => null, + 'upper_bound_offset' => null, + 'timestamp' => 'int64', + 'lower_timestamp' => 'int64', + 'upper_timestamp' => 'int64', + 'endpoint_behavior' => null, + 'include_objects_with_no_value_set' => null, + 'operation_type' => null, + 'operator' => null, + 'property_parser' => null, + 'time_point' => null, + 'lower_bound_endpoint_behavior' => null, + 'lower_bound_time_point' => null, + 'upper_bound_endpoint_behavior' => null, + 'upper_bound_time_point' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'max_occurrences' => false, + 'min_occurrences' => false, + 'type' => false, + 'set_type' => false, + 'comparison' => false, + 'time_offset' => false, + 'lower_bound_offset' => false, + 'range_type' => false, + 'upper_bound_offset' => false, + 'timestamp' => false, + 'lower_timestamp' => false, + 'upper_timestamp' => false, + 'endpoint_behavior' => false, + 'include_objects_with_no_value_set' => false, + 'operation_type' => false, + 'operator' => false, + 'property_parser' => false, + 'time_point' => false, + 'lower_bound_endpoint_behavior' => false, + 'lower_bound_time_point' => false, + 'upper_bound_endpoint_behavior' => false, + 'upper_bound_time_point' => 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 = [ + 'max_occurrences' => 'maxOccurrences', + 'min_occurrences' => 'minOccurrences', + 'type' => 'type', + 'set_type' => 'setType', + 'comparison' => 'comparison', + 'time_offset' => 'timeOffset', + 'lower_bound_offset' => 'lowerBoundOffset', + 'range_type' => 'rangeType', + 'upper_bound_offset' => 'upperBoundOffset', + 'timestamp' => 'timestamp', + 'lower_timestamp' => 'lowerTimestamp', + 'upper_timestamp' => 'upperTimestamp', + 'endpoint_behavior' => 'endpointBehavior', + 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', + 'operation_type' => 'operationType', + 'operator' => 'operator', + 'property_parser' => 'propertyParser', + 'time_point' => 'timePoint', + 'lower_bound_endpoint_behavior' => 'lowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'lowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'upperBoundEndpointBehavior', + 'upper_bound_time_point' => 'upperBoundTimePoint' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'max_occurrences' => 'setMaxOccurrences', + 'min_occurrences' => 'setMinOccurrences', + 'type' => 'setType', + 'set_type' => 'setSetType', + 'comparison' => 'setComparison', + 'time_offset' => 'setTimeOffset', + 'lower_bound_offset' => 'setLowerBoundOffset', + 'range_type' => 'setRangeType', + 'upper_bound_offset' => 'setUpperBoundOffset', + 'timestamp' => 'setTimestamp', + 'lower_timestamp' => 'setLowerTimestamp', + 'upper_timestamp' => 'setUpperTimestamp', + 'endpoint_behavior' => 'setEndpointBehavior', + 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', + 'operation_type' => 'setOperationType', + 'operator' => 'setOperator', + 'property_parser' => 'setPropertyParser', + 'time_point' => 'setTimePoint', + 'lower_bound_endpoint_behavior' => 'setLowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'setLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'setUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'setUpperBoundTimePoint' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'max_occurrences' => 'getMaxOccurrences', + 'min_occurrences' => 'getMinOccurrences', + 'type' => 'getType', + 'set_type' => 'getSetType', + 'comparison' => 'getComparison', + 'time_offset' => 'getTimeOffset', + 'lower_bound_offset' => 'getLowerBoundOffset', + 'range_type' => 'getRangeType', + 'upper_bound_offset' => 'getUpperBoundOffset', + 'timestamp' => 'getTimestamp', + 'lower_timestamp' => 'getLowerTimestamp', + 'upper_timestamp' => 'getUpperTimestamp', + 'endpoint_behavior' => 'getEndpointBehavior', + 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', + 'operation_type' => 'getOperationType', + 'operator' => 'getOperator', + 'property_parser' => 'getPropertyParser', + 'time_point' => 'getTimePoint', + 'lower_bound_endpoint_behavior' => 'getLowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'getLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'getUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'getUpperBoundTimePoint' + ]; + + /** + * 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('max_occurrences', $data ?? [], null); + $this->setIfExists('min_occurrences', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('set_type', $data ?? [], null); + $this->setIfExists('comparison', $data ?? [], null); + $this->setIfExists('time_offset', $data ?? [], null); + $this->setIfExists('lower_bound_offset', $data ?? [], null); + $this->setIfExists('range_type', $data ?? [], null); + $this->setIfExists('upper_bound_offset', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('lower_timestamp', $data ?? [], null); + $this->setIfExists('upper_timestamp', $data ?? [], null); + $this->setIfExists('endpoint_behavior', $data ?? [], null); + $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); + $this->setIfExists('operation_type', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('property_parser', $data ?? [], null); + $this->setIfExists('time_point', $data ?? [], null); + $this->setIfExists('lower_bound_endpoint_behavior', $data ?? [], null); + $this->setIfExists('lower_bound_time_point', $data ?? [], null); + $this->setIfExists('upper_bound_endpoint_behavior', $data ?? [], null); + $this->setIfExists('upper_bound_time_point', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * 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['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['set_type'] === null) { + $invalidProperties[] = "'set_type' can't be null"; + } + if ($this->container['comparison'] === null) { + $invalidProperties[] = "'comparison' can't be null"; + } + if ($this->container['time_offset'] === null) { + $invalidProperties[] = "'time_offset' can't be null"; + } + if ($this->container['lower_bound_offset'] === null) { + $invalidProperties[] = "'lower_bound_offset' can't be null"; + } + if ($this->container['range_type'] === null) { + $invalidProperties[] = "'range_type' can't be null"; + } + if ($this->container['upper_bound_offset'] === null) { + $invalidProperties[] = "'upper_bound_offset' can't be null"; + } + if ($this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } + if ($this->container['lower_timestamp'] === null) { + $invalidProperties[] = "'lower_timestamp' can't be null"; + } + if ($this->container['upper_timestamp'] === null) { + $invalidProperties[] = "'upper_timestamp' can't be null"; + } + if ($this->container['include_objects_with_no_value_set'] === null) { + $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; + } + if ($this->container['operation_type'] === null) { + $invalidProperties[] = "'operation_type' can't be null"; + } + if ($this->container['operator'] === null) { + $invalidProperties[] = "'operator' can't be null"; + } + if ($this->container['time_point'] === null) { + $invalidProperties[] = "'time_point' can't be null"; + } + if ($this->container['lower_bound_time_point'] === null) { + $invalidProperties[] = "'lower_bound_time_point' can't be null"; + } + if ($this->container['upper_bound_time_point'] === null) { + $invalidProperties[] = "'upper_bound_time_point' 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 max_occurrences + * + * @return int|null + */ + public function getMaxOccurrences() + { + return $this->container['max_occurrences']; + } + + /** + * Sets max_occurrences + * + * @param int|null $max_occurrences The maximum number of occurrences allowed. + * + * @return self + */ + public function setMaxOccurrences($max_occurrences) + { + if (is_null($max_occurrences)) { + throw new \InvalidArgumentException('non-nullable max_occurrences cannot be null'); + } + $this->container['max_occurrences'] = $max_occurrences; + + return $this; + } + + /** + * Gets min_occurrences + * + * @return int|null + */ + public function getMinOccurrences() + { + return $this->container['min_occurrences']; + } + + /** + * Sets min_occurrences + * + * @param int|null $min_occurrences The minimum number of occurrences required. + * + * @return self + */ + public function setMinOccurrences($min_occurrences) + { + if (is_null($min_occurrences)) { + throw new \InvalidArgumentException('non-nullable min_occurrences cannot be null'); + } + $this->container['min_occurrences'] = $min_occurrences; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Defines the type of operation being performed. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets set_type + * + * @return string + */ + public function getSetType() + { + return $this->container['set_type']; + } + + /** + * Sets set_type + * + * @param string $set_type Indicates the specific set type used in the refinement (ALL, ALL_INCLUDE_EMPTY, ANY, NONE, NONE_EXCLUDE_EMPTY, ANY_INCLUDE_EMPTY). + * + * @return self + */ + public function setSetType($set_type) + { + if (is_null($set_type)) { + throw new \InvalidArgumentException('non-nullable set_type cannot be null'); + } + $this->container['set_type'] = $set_type; + + return $this; + } + + /** + * Gets comparison + * + * @return string + */ + public function getComparison() + { + return $this->container['comparison']; + } + + /** + * Sets comparison + * + * @param string $comparison Timestamp comparison options (BEFORE, AFTER) + * + * @return self + */ + public function setComparison($comparison) + { + if (is_null($comparison)) { + throw new \InvalidArgumentException('non-nullable comparison cannot be null'); + } + $this->container['comparison'] = $comparison; + + return $this; + } + + /** + * Gets time_offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset + */ + public function getTimeOffset() + { + return $this->container['time_offset']; + } + + /** + * Sets time_offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $time_offset time_offset + * + * @return self + */ + public function setTimeOffset($time_offset) + { + if (is_null($time_offset)) { + throw new \InvalidArgumentException('non-nullable time_offset cannot be null'); + } + $this->container['time_offset'] = $time_offset; + + return $this; + } + + /** + * Gets lower_bound_offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset + */ + public function getLowerBoundOffset() + { + return $this->container['lower_bound_offset']; + } + + /** + * Sets lower_bound_offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $lower_bound_offset lower_bound_offset + * + * @return self + */ + public function setLowerBoundOffset($lower_bound_offset) + { + if (is_null($lower_bound_offset)) { + throw new \InvalidArgumentException('non-nullable lower_bound_offset cannot be null'); + } + $this->container['lower_bound_offset'] = $lower_bound_offset; + + return $this; + } + + /** + * Gets range_type + * + * @return string + */ + public function getRangeType() + { + return $this->container['range_type']; + } + + /** + * Sets range_type + * + * @param string $range_type Type of range of refinement critaria (BETWEEN, NOT_BETWEEN) + * + * @return self + */ + public function setRangeType($range_type) + { + if (is_null($range_type)) { + throw new \InvalidArgumentException('non-nullable range_type cannot be null'); + } + $this->container['range_type'] = $range_type; + + return $this; + } + + /** + * Gets upper_bound_offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset + */ + public function getUpperBoundOffset() + { + return $this->container['upper_bound_offset']; + } + + /** + * Sets upper_bound_offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $upper_bound_offset upper_bound_offset + * + * @return self + */ + public function setUpperBoundOffset($upper_bound_offset) + { + if (is_null($upper_bound_offset)) { + throw new \InvalidArgumentException('non-nullable upper_bound_offset cannot be null'); + } + $this->container['upper_bound_offset'] = $upper_bound_offset; + + return $this; + } + + /** + * Gets timestamp + * + * @return int + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param int $timestamp Timestamp to be used in refine by criteria + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets lower_timestamp + * + * @return int + */ + public function getLowerTimestamp() + { + return $this->container['lower_timestamp']; + } + + /** + * Sets lower_timestamp + * + * @param int $lower_timestamp Lower range timestamp of refinement criteria + * + * @return self + */ + public function setLowerTimestamp($lower_timestamp) + { + if (is_null($lower_timestamp)) { + throw new \InvalidArgumentException('non-nullable lower_timestamp cannot be null'); + } + $this->container['lower_timestamp'] = $lower_timestamp; + + return $this; + } + + /** + * Gets upper_timestamp + * + * @return int + */ + public function getUpperTimestamp() + { + return $this->container['upper_timestamp']; + } + + /** + * Sets upper_timestamp + * + * @param int $upper_timestamp Upper range timestamp of refinement criteria + * + * @return self + */ + public function setUpperTimestamp($upper_timestamp) + { + if (is_null($upper_timestamp)) { + throw new \InvalidArgumentException('non-nullable upper_timestamp cannot be null'); + } + $this->container['upper_timestamp'] = $upper_timestamp; + + return $this; + } + + /** + * Gets endpoint_behavior + * + * @return string|null + */ + public function getEndpointBehavior() + { + return $this->container['endpoint_behavior']; + } + + /** + * Sets endpoint_behavior + * + * @param string|null $endpoint_behavior Describes the behavior at the endpoint of the time point operation. + * + * @return self + */ + public function setEndpointBehavior($endpoint_behavior) + { + if (is_null($endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable endpoint_behavior cannot be null'); + } + $this->container['endpoint_behavior'] = $endpoint_behavior; + + return $this; + } + + /** + * Gets include_objects_with_no_value_set + * + * @return bool + */ + public function getIncludeObjectsWithNoValueSet() + { + return $this->container['include_objects_with_no_value_set']; + } + + /** + * Sets include_objects_with_no_value_set + * + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. + * + * @return self + */ + public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_set) + { + if (is_null($include_objects_with_no_value_set)) { + throw new \InvalidArgumentException('non-nullable include_objects_with_no_value_set cannot be null'); + } + $this->container['include_objects_with_no_value_set'] = $include_objects_with_no_value_set; + + return $this; + } + + /** + * Gets operation_type + * + * @return string + */ + public function getOperationType() + { + return $this->container['operation_type']; + } + + /** + * Sets operation_type + * + * @param string $operation_type Specifies the type of operation (TIME_RANGED). + * + * @return self + */ + public function setOperationType($operation_type) + { + if (is_null($operation_type)) { + throw new \InvalidArgumentException('non-nullable operation_type cannot be null'); + } + $this->container['operation_type'] = $operation_type; + + return $this; + } + + /** + * Gets operator + * + * @return string + */ + public function getOperator() + { + return $this->container['operator']; + } + + /** + * Sets operator + * + * @param string $operator Defines the operation to be applied within the time range (IS_BETWEEN, IS_NOT_BETWEEN). + * + * @return self + */ + public function setOperator($operator) + { + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); + } + $this->container['operator'] = $operator; + + return $this; + } + + /** + * Gets property_parser + * + * @return string|null + */ + public function getPropertyParser() + { + return $this->container['property_parser']; + } + + /** + * Sets property_parser + * + * @param string|null $property_parser Specifies the parser used for the property in the operation. + * + * @return self + */ + public function setPropertyParser($property_parser) + { + if (is_null($property_parser)) { + throw new \InvalidArgumentException('non-nullable property_parser cannot be null'); + } + $this->container['property_parser'] = $property_parser; + + return $this; + } + + /** + * Gets time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint + */ + public function getTimePoint() + { + return $this->container['time_point']; + } + + /** + * Sets time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint $time_point time_point + * + * @return self + */ + public function setTimePoint($time_point) + { + if (is_null($time_point)) { + throw new \InvalidArgumentException('non-nullable time_point cannot be null'); + } + $this->container['time_point'] = $time_point; + + return $this; + } + + /** + * Gets lower_bound_endpoint_behavior + * + * @return string|null + */ + public function getLowerBoundEndpointBehavior() + { + return $this->container['lower_bound_endpoint_behavior']; + } + + /** + * Sets lower_bound_endpoint_behavior + * + * @param string|null $lower_bound_endpoint_behavior Describes the behavior at the lower bound endpoint of the time range. + * + * @return self + */ + public function setLowerBoundEndpointBehavior($lower_bound_endpoint_behavior) + { + if (is_null($lower_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable lower_bound_endpoint_behavior cannot be null'); + } + $this->container['lower_bound_endpoint_behavior'] = $lower_bound_endpoint_behavior; + + return $this; + } + + /** + * Gets lower_bound_time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint + */ + public function getLowerBoundTimePoint() + { + return $this->container['lower_bound_time_point']; + } + + /** + * Sets lower_bound_time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint $lower_bound_time_point lower_bound_time_point + * + * @return self + */ + public function setLowerBoundTimePoint($lower_bound_time_point) + { + if (is_null($lower_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable lower_bound_time_point cannot be null'); + } + $this->container['lower_bound_time_point'] = $lower_bound_time_point; + + return $this; + } + + /** + * Gets upper_bound_endpoint_behavior + * + * @return string|null + */ + public function getUpperBoundEndpointBehavior() + { + return $this->container['upper_bound_endpoint_behavior']; + } + + /** + * Sets upper_bound_endpoint_behavior + * + * @param string|null $upper_bound_endpoint_behavior Describes the behavior at the upper bound endpoint of the time range. + * + * @return self + */ + public function setUpperBoundEndpointBehavior($upper_bound_endpoint_behavior) + { + if (is_null($upper_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable upper_bound_endpoint_behavior cannot be null'); + } + $this->container['upper_bound_endpoint_behavior'] = $upper_bound_endpoint_behavior; + + return $this; + } + + /** + * Gets upper_bound_time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint + */ + public function getUpperBoundTimePoint() + { + return $this->container['upper_bound_time_point']; + } + + /** + * Sets upper_bound_time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint $upper_bound_time_point upper_bound_time_point + * + * @return self + */ + public function setUpperBoundTimePoint($upper_bound_time_point) + { + if (is_null($upper_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable upper_bound_time_point cannot be null'); + } + $this->container['upper_bound_time_point'] = $upper_bound_time_point; + + 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/Lists/Model/PublicEventAnalyticsFilterPruningRefineBy.php b/codegen/Crm/Lists/Model/PublicEventAnalyticsFilterPruningRefineBy.php new file mode 100644 index 000000000..71d82f41f --- /dev/null +++ b/codegen/Crm/Lists/Model/PublicEventAnalyticsFilterPruningRefineBy.php @@ -0,0 +1,1175 @@ + + */ +class PublicEventAnalyticsFilterPruningRefineBy implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicEventAnalyticsFilter_pruningRefineBy'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'max_occurrences' => 'int', + 'min_occurrences' => 'int', + 'type' => 'string', + 'set_type' => 'string', + 'comparison' => 'string', + 'time_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', + 'lower_bound_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', + 'range_type' => 'string', + 'upper_bound_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', + 'timestamp' => 'int', + 'lower_timestamp' => 'int', + 'upper_timestamp' => 'int', + 'endpoint_behavior' => 'string', + 'include_objects_with_no_value_set' => 'bool', + 'operation_type' => 'string', + 'operator' => 'string', + 'property_parser' => 'string', + 'time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint', + 'lower_bound_endpoint_behavior' => 'string', + 'lower_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'string', + 'upper_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'max_occurrences' => 'int32', + 'min_occurrences' => 'int32', + 'type' => null, + 'set_type' => null, + 'comparison' => null, + 'time_offset' => null, + 'lower_bound_offset' => null, + 'range_type' => null, + 'upper_bound_offset' => null, + 'timestamp' => 'int64', + 'lower_timestamp' => 'int64', + 'upper_timestamp' => 'int64', + 'endpoint_behavior' => null, + 'include_objects_with_no_value_set' => null, + 'operation_type' => null, + 'operator' => null, + 'property_parser' => null, + 'time_point' => null, + 'lower_bound_endpoint_behavior' => null, + 'lower_bound_time_point' => null, + 'upper_bound_endpoint_behavior' => null, + 'upper_bound_time_point' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'max_occurrences' => false, + 'min_occurrences' => false, + 'type' => false, + 'set_type' => false, + 'comparison' => false, + 'time_offset' => false, + 'lower_bound_offset' => false, + 'range_type' => false, + 'upper_bound_offset' => false, + 'timestamp' => false, + 'lower_timestamp' => false, + 'upper_timestamp' => false, + 'endpoint_behavior' => false, + 'include_objects_with_no_value_set' => false, + 'operation_type' => false, + 'operator' => false, + 'property_parser' => false, + 'time_point' => false, + 'lower_bound_endpoint_behavior' => false, + 'lower_bound_time_point' => false, + 'upper_bound_endpoint_behavior' => false, + 'upper_bound_time_point' => 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 = [ + 'max_occurrences' => 'maxOccurrences', + 'min_occurrences' => 'minOccurrences', + 'type' => 'type', + 'set_type' => 'setType', + 'comparison' => 'comparison', + 'time_offset' => 'timeOffset', + 'lower_bound_offset' => 'lowerBoundOffset', + 'range_type' => 'rangeType', + 'upper_bound_offset' => 'upperBoundOffset', + 'timestamp' => 'timestamp', + 'lower_timestamp' => 'lowerTimestamp', + 'upper_timestamp' => 'upperTimestamp', + 'endpoint_behavior' => 'endpointBehavior', + 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', + 'operation_type' => 'operationType', + 'operator' => 'operator', + 'property_parser' => 'propertyParser', + 'time_point' => 'timePoint', + 'lower_bound_endpoint_behavior' => 'lowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'lowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'upperBoundEndpointBehavior', + 'upper_bound_time_point' => 'upperBoundTimePoint' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'max_occurrences' => 'setMaxOccurrences', + 'min_occurrences' => 'setMinOccurrences', + 'type' => 'setType', + 'set_type' => 'setSetType', + 'comparison' => 'setComparison', + 'time_offset' => 'setTimeOffset', + 'lower_bound_offset' => 'setLowerBoundOffset', + 'range_type' => 'setRangeType', + 'upper_bound_offset' => 'setUpperBoundOffset', + 'timestamp' => 'setTimestamp', + 'lower_timestamp' => 'setLowerTimestamp', + 'upper_timestamp' => 'setUpperTimestamp', + 'endpoint_behavior' => 'setEndpointBehavior', + 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', + 'operation_type' => 'setOperationType', + 'operator' => 'setOperator', + 'property_parser' => 'setPropertyParser', + 'time_point' => 'setTimePoint', + 'lower_bound_endpoint_behavior' => 'setLowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'setLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'setUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'setUpperBoundTimePoint' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'max_occurrences' => 'getMaxOccurrences', + 'min_occurrences' => 'getMinOccurrences', + 'type' => 'getType', + 'set_type' => 'getSetType', + 'comparison' => 'getComparison', + 'time_offset' => 'getTimeOffset', + 'lower_bound_offset' => 'getLowerBoundOffset', + 'range_type' => 'getRangeType', + 'upper_bound_offset' => 'getUpperBoundOffset', + 'timestamp' => 'getTimestamp', + 'lower_timestamp' => 'getLowerTimestamp', + 'upper_timestamp' => 'getUpperTimestamp', + 'endpoint_behavior' => 'getEndpointBehavior', + 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', + 'operation_type' => 'getOperationType', + 'operator' => 'getOperator', + 'property_parser' => 'getPropertyParser', + 'time_point' => 'getTimePoint', + 'lower_bound_endpoint_behavior' => 'getLowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'getLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'getUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'getUpperBoundTimePoint' + ]; + + /** + * 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('max_occurrences', $data ?? [], null); + $this->setIfExists('min_occurrences', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('set_type', $data ?? [], null); + $this->setIfExists('comparison', $data ?? [], null); + $this->setIfExists('time_offset', $data ?? [], null); + $this->setIfExists('lower_bound_offset', $data ?? [], null); + $this->setIfExists('range_type', $data ?? [], null); + $this->setIfExists('upper_bound_offset', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('lower_timestamp', $data ?? [], null); + $this->setIfExists('upper_timestamp', $data ?? [], null); + $this->setIfExists('endpoint_behavior', $data ?? [], null); + $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); + $this->setIfExists('operation_type', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('property_parser', $data ?? [], null); + $this->setIfExists('time_point', $data ?? [], null); + $this->setIfExists('lower_bound_endpoint_behavior', $data ?? [], null); + $this->setIfExists('lower_bound_time_point', $data ?? [], null); + $this->setIfExists('upper_bound_endpoint_behavior', $data ?? [], null); + $this->setIfExists('upper_bound_time_point', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * 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['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['set_type'] === null) { + $invalidProperties[] = "'set_type' can't be null"; + } + if ($this->container['comparison'] === null) { + $invalidProperties[] = "'comparison' can't be null"; + } + if ($this->container['time_offset'] === null) { + $invalidProperties[] = "'time_offset' can't be null"; + } + if ($this->container['lower_bound_offset'] === null) { + $invalidProperties[] = "'lower_bound_offset' can't be null"; + } + if ($this->container['range_type'] === null) { + $invalidProperties[] = "'range_type' can't be null"; + } + if ($this->container['upper_bound_offset'] === null) { + $invalidProperties[] = "'upper_bound_offset' can't be null"; + } + if ($this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } + if ($this->container['lower_timestamp'] === null) { + $invalidProperties[] = "'lower_timestamp' can't be null"; + } + if ($this->container['upper_timestamp'] === null) { + $invalidProperties[] = "'upper_timestamp' can't be null"; + } + if ($this->container['include_objects_with_no_value_set'] === null) { + $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; + } + if ($this->container['operation_type'] === null) { + $invalidProperties[] = "'operation_type' can't be null"; + } + if ($this->container['operator'] === null) { + $invalidProperties[] = "'operator' can't be null"; + } + if ($this->container['time_point'] === null) { + $invalidProperties[] = "'time_point' can't be null"; + } + if ($this->container['lower_bound_time_point'] === null) { + $invalidProperties[] = "'lower_bound_time_point' can't be null"; + } + if ($this->container['upper_bound_time_point'] === null) { + $invalidProperties[] = "'upper_bound_time_point' 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 max_occurrences + * + * @return int|null + */ + public function getMaxOccurrences() + { + return $this->container['max_occurrences']; + } + + /** + * Sets max_occurrences + * + * @param int|null $max_occurrences The maximum number of occurrences allowed. + * + * @return self + */ + public function setMaxOccurrences($max_occurrences) + { + if (is_null($max_occurrences)) { + throw new \InvalidArgumentException('non-nullable max_occurrences cannot be null'); + } + $this->container['max_occurrences'] = $max_occurrences; + + return $this; + } + + /** + * Gets min_occurrences + * + * @return int|null + */ + public function getMinOccurrences() + { + return $this->container['min_occurrences']; + } + + /** + * Sets min_occurrences + * + * @param int|null $min_occurrences The minimum number of occurrences required. + * + * @return self + */ + public function setMinOccurrences($min_occurrences) + { + if (is_null($min_occurrences)) { + throw new \InvalidArgumentException('non-nullable min_occurrences cannot be null'); + } + $this->container['min_occurrences'] = $min_occurrences; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Defines the type of operation being performed. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets set_type + * + * @return string + */ + public function getSetType() + { + return $this->container['set_type']; + } + + /** + * Sets set_type + * + * @param string $set_type Indicates the specific set type used in the refinement (ALL, ALL_INCLUDE_EMPTY, ANY, NONE, NONE_EXCLUDE_EMPTY, ANY_INCLUDE_EMPTY). + * + * @return self + */ + public function setSetType($set_type) + { + if (is_null($set_type)) { + throw new \InvalidArgumentException('non-nullable set_type cannot be null'); + } + $this->container['set_type'] = $set_type; + + return $this; + } + + /** + * Gets comparison + * + * @return string + */ + public function getComparison() + { + return $this->container['comparison']; + } + + /** + * Sets comparison + * + * @param string $comparison Timestamp comparison options (BEFORE, AFTER) + * + * @return self + */ + public function setComparison($comparison) + { + if (is_null($comparison)) { + throw new \InvalidArgumentException('non-nullable comparison cannot be null'); + } + $this->container['comparison'] = $comparison; + + return $this; + } + + /** + * Gets time_offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset + */ + public function getTimeOffset() + { + return $this->container['time_offset']; + } + + /** + * Sets time_offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $time_offset time_offset + * + * @return self + */ + public function setTimeOffset($time_offset) + { + if (is_null($time_offset)) { + throw new \InvalidArgumentException('non-nullable time_offset cannot be null'); + } + $this->container['time_offset'] = $time_offset; + + return $this; + } + + /** + * Gets lower_bound_offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset + */ + public function getLowerBoundOffset() + { + return $this->container['lower_bound_offset']; + } + + /** + * Sets lower_bound_offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $lower_bound_offset lower_bound_offset + * + * @return self + */ + public function setLowerBoundOffset($lower_bound_offset) + { + if (is_null($lower_bound_offset)) { + throw new \InvalidArgumentException('non-nullable lower_bound_offset cannot be null'); + } + $this->container['lower_bound_offset'] = $lower_bound_offset; + + return $this; + } + + /** + * Gets range_type + * + * @return string + */ + public function getRangeType() + { + return $this->container['range_type']; + } + + /** + * Sets range_type + * + * @param string $range_type Type of range of refinement critaria (BETWEEN, NOT_BETWEEN) + * + * @return self + */ + public function setRangeType($range_type) + { + if (is_null($range_type)) { + throw new \InvalidArgumentException('non-nullable range_type cannot be null'); + } + $this->container['range_type'] = $range_type; + + return $this; + } + + /** + * Gets upper_bound_offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset + */ + public function getUpperBoundOffset() + { + return $this->container['upper_bound_offset']; + } + + /** + * Sets upper_bound_offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $upper_bound_offset upper_bound_offset + * + * @return self + */ + public function setUpperBoundOffset($upper_bound_offset) + { + if (is_null($upper_bound_offset)) { + throw new \InvalidArgumentException('non-nullable upper_bound_offset cannot be null'); + } + $this->container['upper_bound_offset'] = $upper_bound_offset; + + return $this; + } + + /** + * Gets timestamp + * + * @return int + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param int $timestamp Timestamp to be used in refine by criteria + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets lower_timestamp + * + * @return int + */ + public function getLowerTimestamp() + { + return $this->container['lower_timestamp']; + } + + /** + * Sets lower_timestamp + * + * @param int $lower_timestamp Lower range timestamp of refinement criteria + * + * @return self + */ + public function setLowerTimestamp($lower_timestamp) + { + if (is_null($lower_timestamp)) { + throw new \InvalidArgumentException('non-nullable lower_timestamp cannot be null'); + } + $this->container['lower_timestamp'] = $lower_timestamp; + + return $this; + } + + /** + * Gets upper_timestamp + * + * @return int + */ + public function getUpperTimestamp() + { + return $this->container['upper_timestamp']; + } + + /** + * Sets upper_timestamp + * + * @param int $upper_timestamp Upper range timestamp of refinement criteria + * + * @return self + */ + public function setUpperTimestamp($upper_timestamp) + { + if (is_null($upper_timestamp)) { + throw new \InvalidArgumentException('non-nullable upper_timestamp cannot be null'); + } + $this->container['upper_timestamp'] = $upper_timestamp; + + return $this; + } + + /** + * Gets endpoint_behavior + * + * @return string|null + */ + public function getEndpointBehavior() + { + return $this->container['endpoint_behavior']; + } + + /** + * Sets endpoint_behavior + * + * @param string|null $endpoint_behavior Describes the behavior at the endpoint of the time point operation. + * + * @return self + */ + public function setEndpointBehavior($endpoint_behavior) + { + if (is_null($endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable endpoint_behavior cannot be null'); + } + $this->container['endpoint_behavior'] = $endpoint_behavior; + + return $this; + } + + /** + * Gets include_objects_with_no_value_set + * + * @return bool + */ + public function getIncludeObjectsWithNoValueSet() + { + return $this->container['include_objects_with_no_value_set']; + } + + /** + * Sets include_objects_with_no_value_set + * + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. + * + * @return self + */ + public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_set) + { + if (is_null($include_objects_with_no_value_set)) { + throw new \InvalidArgumentException('non-nullable include_objects_with_no_value_set cannot be null'); + } + $this->container['include_objects_with_no_value_set'] = $include_objects_with_no_value_set; + + return $this; + } + + /** + * Gets operation_type + * + * @return string + */ + public function getOperationType() + { + return $this->container['operation_type']; + } + + /** + * Sets operation_type + * + * @param string $operation_type Specifies the type of operation (TIME_RANGED). + * + * @return self + */ + public function setOperationType($operation_type) + { + if (is_null($operation_type)) { + throw new \InvalidArgumentException('non-nullable operation_type cannot be null'); + } + $this->container['operation_type'] = $operation_type; + + return $this; + } + + /** + * Gets operator + * + * @return string + */ + public function getOperator() + { + return $this->container['operator']; + } + + /** + * Sets operator + * + * @param string $operator Defines the operation to be applied within the time range (IS_BETWEEN, IS_NOT_BETWEEN). + * + * @return self + */ + public function setOperator($operator) + { + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); + } + $this->container['operator'] = $operator; + + return $this; + } + + /** + * Gets property_parser + * + * @return string|null + */ + public function getPropertyParser() + { + return $this->container['property_parser']; + } + + /** + * Sets property_parser + * + * @param string|null $property_parser Specifies the parser used for the property in the operation. + * + * @return self + */ + public function setPropertyParser($property_parser) + { + if (is_null($property_parser)) { + throw new \InvalidArgumentException('non-nullable property_parser cannot be null'); + } + $this->container['property_parser'] = $property_parser; + + return $this; + } + + /** + * Gets time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint + */ + public function getTimePoint() + { + return $this->container['time_point']; + } + + /** + * Sets time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint $time_point time_point + * + * @return self + */ + public function setTimePoint($time_point) + { + if (is_null($time_point)) { + throw new \InvalidArgumentException('non-nullable time_point cannot be null'); + } + $this->container['time_point'] = $time_point; + + return $this; + } + + /** + * Gets lower_bound_endpoint_behavior + * + * @return string|null + */ + public function getLowerBoundEndpointBehavior() + { + return $this->container['lower_bound_endpoint_behavior']; + } + + /** + * Sets lower_bound_endpoint_behavior + * + * @param string|null $lower_bound_endpoint_behavior Describes the behavior at the lower bound endpoint of the time range. + * + * @return self + */ + public function setLowerBoundEndpointBehavior($lower_bound_endpoint_behavior) + { + if (is_null($lower_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable lower_bound_endpoint_behavior cannot be null'); + } + $this->container['lower_bound_endpoint_behavior'] = $lower_bound_endpoint_behavior; + + return $this; + } + + /** + * Gets lower_bound_time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint + */ + public function getLowerBoundTimePoint() + { + return $this->container['lower_bound_time_point']; + } + + /** + * Sets lower_bound_time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint $lower_bound_time_point lower_bound_time_point + * + * @return self + */ + public function setLowerBoundTimePoint($lower_bound_time_point) + { + if (is_null($lower_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable lower_bound_time_point cannot be null'); + } + $this->container['lower_bound_time_point'] = $lower_bound_time_point; + + return $this; + } + + /** + * Gets upper_bound_endpoint_behavior + * + * @return string|null + */ + public function getUpperBoundEndpointBehavior() + { + return $this->container['upper_bound_endpoint_behavior']; + } + + /** + * Sets upper_bound_endpoint_behavior + * + * @param string|null $upper_bound_endpoint_behavior Describes the behavior at the upper bound endpoint of the time range. + * + * @return self + */ + public function setUpperBoundEndpointBehavior($upper_bound_endpoint_behavior) + { + if (is_null($upper_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable upper_bound_endpoint_behavior cannot be null'); + } + $this->container['upper_bound_endpoint_behavior'] = $upper_bound_endpoint_behavior; + + return $this; + } + + /** + * Gets upper_bound_time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint + */ + public function getUpperBoundTimePoint() + { + return $this->container['upper_bound_time_point']; + } + + /** + * Sets upper_bound_time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint $upper_bound_time_point upper_bound_time_point + * + * @return self + */ + public function setUpperBoundTimePoint($upper_bound_time_point) + { + if (is_null($upper_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable upper_bound_time_point cannot be null'); + } + $this->container['upper_bound_time_point'] = $upper_bound_time_point; + + 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/Lists/Model/PublicEventFilterMetadata.php b/codegen/Crm/Lists/Model/PublicEventFilterMetadata.php index 871495bcd..8068fcc4a 100644 --- a/codegen/Crm/Lists/Model/PublicEventFilterMetadata.php +++ b/codegen/Crm/Lists/Model/PublicEventFilterMetadata.php @@ -2,7 +2,7 @@ /** * PublicEventFilterMetadata * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,8 +57,8 @@ class PublicEventFilterMetadata implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ - 'property' => 'string', - 'operation' => '\HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison' + 'operation' => '\HubSpot\Client\Crm\Lists\Model\PublicEventFilterMetadataOperation', + 'property' => 'string' ]; /** @@ -69,8 +69,8 @@ class PublicEventFilterMetadata implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ - 'property' => null, - 'operation' => null + 'operation' => null, + 'property' => null ]; /** @@ -79,8 +79,8 @@ class PublicEventFilterMetadata implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static array $openAPINullables = [ - 'property' => false, - 'operation' => false + 'operation' => false, + 'property' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'property' => 'property', - 'operation' => 'operation' + 'operation' => 'operation', + 'property' => 'property' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'property' => 'setProperty', - 'operation' => 'setOperation' + 'operation' => 'setOperation', + 'property' => 'setProperty' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'property' => 'getProperty', - 'operation' => 'getOperation' + 'operation' => 'getOperation', + 'property' => 'getProperty' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('property', $data ?? [], null); $this->setIfExists('operation', $data ?? [], null); + $this->setIfExists('property', $data ?? [], null); } /** @@ -281,12 +281,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['property'] === null) { - $invalidProperties[] = "'property' can't be null"; - } if ($this->container['operation'] === null) { $invalidProperties[] = "'operation' can't be null"; } + if ($this->container['property'] === null) { + $invalidProperties[] = "'property' can't be null"; + } return $invalidProperties; } @@ -303,66 +303,66 @@ public function valid() /** - * Gets property + * Gets operation * - * @return string + * @return \HubSpot\Client\Crm\Lists\Model\PublicEventFilterMetadataOperation */ - public function getProperty() + public function getOperation() { - return $this->container['property']; + return $this->container['operation']; } /** - * Sets property + * Sets operation * - * @param string $property property + * @param \HubSpot\Client\Crm\Lists\Model\PublicEventFilterMetadataOperation $operation operation * * @return self */ - public function setProperty($property) + public function setOperation($operation) { - if (is_null($property)) { - throw new \InvalidArgumentException('non-nullable property cannot be null'); + if (is_null($operation)) { + throw new \InvalidArgumentException('non-nullable operation cannot be null'); } - $this->container['property'] = $property; + $this->container['operation'] = $operation; return $this; } /** - * Gets operation + * Gets property * - * @return \HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison + * @return string */ - public function getOperation() + public function getProperty() { - return $this->container['operation']; + return $this->container['property']; } /** - * Sets operation + * Sets property * - * @param \HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison $operation operation + * @param string $property Specifies the property on which the operation is to be applied. * * @return self */ - public function setOperation($operation) + public function setProperty($property) { - if (is_null($operation)) { - throw new \InvalidArgumentException('non-nullable operation cannot be null'); + if (is_null($property)) { + throw new \InvalidArgumentException('non-nullable property cannot be null'); } - $this->container['operation'] = $operation; + $this->container['property'] = $property; 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]); } @@ -370,12 +370,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; } @@ -400,11 +400,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/Lists/Model/PublicEventFilterMetadataOperation.php b/codegen/Crm/Lists/Model/PublicEventFilterMetadataOperation.php new file mode 100644 index 000000000..42d0c9f81 --- /dev/null +++ b/codegen/Crm/Lists/Model/PublicEventFilterMetadataOperation.php @@ -0,0 +1,1408 @@ + + */ +class PublicEventFilterMetadataOperation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'operation_type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicEventFilterMetadata_operation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'include_objects_with_no_value_set' => 'bool', + 'operation_type' => 'string', + 'operator' => 'string', + 'value' => 'string', + 'requires_time_zone_conversion' => 'bool', + 'timestamp' => 'int', + 'lower_bound' => 'int', + 'upper_bound' => 'int', + 'comparison_property_name' => 'string', + 'default_comparison_value' => 'string', + 'number_of_days' => 'int', + 'values' => 'string[]', + 'day' => 'int', + 'month' => 'string', + 'year' => 'int', + 'fiscal_year_start' => 'string', + 'time_unit' => 'string', + 'time_unit_count' => 'int', + 'use_fiscal_year' => 'bool', + 'endpoint_behavior' => 'string', + 'property_parser' => 'string', + 'time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint', + 'type' => 'string', + 'lower_bound_endpoint_behavior' => 'string', + 'lower_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'string', + 'upper_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'include_objects_with_no_value_set' => null, + 'operation_type' => null, + 'operator' => null, + 'value' => null, + 'requires_time_zone_conversion' => null, + 'timestamp' => 'int32', + 'lower_bound' => 'int32', + 'upper_bound' => 'int32', + 'comparison_property_name' => null, + 'default_comparison_value' => null, + 'number_of_days' => 'int32', + 'values' => null, + 'day' => 'int32', + 'month' => null, + 'year' => 'int32', + 'fiscal_year_start' => null, + 'time_unit' => null, + 'time_unit_count' => 'int32', + 'use_fiscal_year' => null, + 'endpoint_behavior' => null, + 'property_parser' => null, + 'time_point' => null, + 'type' => null, + 'lower_bound_endpoint_behavior' => null, + 'lower_bound_time_point' => null, + 'upper_bound_endpoint_behavior' => null, + 'upper_bound_time_point' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'include_objects_with_no_value_set' => false, + 'operation_type' => false, + 'operator' => false, + 'value' => false, + 'requires_time_zone_conversion' => false, + 'timestamp' => false, + 'lower_bound' => false, + 'upper_bound' => false, + 'comparison_property_name' => false, + 'default_comparison_value' => false, + 'number_of_days' => false, + 'values' => false, + 'day' => false, + 'month' => false, + 'year' => false, + 'fiscal_year_start' => false, + 'time_unit' => false, + 'time_unit_count' => false, + 'use_fiscal_year' => false, + 'endpoint_behavior' => false, + 'property_parser' => false, + 'time_point' => false, + 'type' => false, + 'lower_bound_endpoint_behavior' => false, + 'lower_bound_time_point' => false, + 'upper_bound_endpoint_behavior' => false, + 'upper_bound_time_point' => 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 = [ + 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', + 'operation_type' => 'operationType', + 'operator' => 'operator', + 'value' => 'value', + 'requires_time_zone_conversion' => 'requiresTimeZoneConversion', + 'timestamp' => 'timestamp', + 'lower_bound' => 'lowerBound', + 'upper_bound' => 'upperBound', + 'comparison_property_name' => 'comparisonPropertyName', + 'default_comparison_value' => 'defaultComparisonValue', + 'number_of_days' => 'numberOfDays', + 'values' => 'values', + 'day' => 'day', + 'month' => 'month', + 'year' => 'year', + 'fiscal_year_start' => 'fiscalYearStart', + 'time_unit' => 'timeUnit', + 'time_unit_count' => 'timeUnitCount', + 'use_fiscal_year' => 'useFiscalYear', + 'endpoint_behavior' => 'endpointBehavior', + 'property_parser' => 'propertyParser', + 'time_point' => 'timePoint', + 'type' => 'type', + 'lower_bound_endpoint_behavior' => 'lowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'lowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'upperBoundEndpointBehavior', + 'upper_bound_time_point' => 'upperBoundTimePoint' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', + 'operation_type' => 'setOperationType', + 'operator' => 'setOperator', + 'value' => 'setValue', + 'requires_time_zone_conversion' => 'setRequiresTimeZoneConversion', + 'timestamp' => 'setTimestamp', + 'lower_bound' => 'setLowerBound', + 'upper_bound' => 'setUpperBound', + 'comparison_property_name' => 'setComparisonPropertyName', + 'default_comparison_value' => 'setDefaultComparisonValue', + 'number_of_days' => 'setNumberOfDays', + 'values' => 'setValues', + 'day' => 'setDay', + 'month' => 'setMonth', + 'year' => 'setYear', + 'fiscal_year_start' => 'setFiscalYearStart', + 'time_unit' => 'setTimeUnit', + 'time_unit_count' => 'setTimeUnitCount', + 'use_fiscal_year' => 'setUseFiscalYear', + 'endpoint_behavior' => 'setEndpointBehavior', + 'property_parser' => 'setPropertyParser', + 'time_point' => 'setTimePoint', + 'type' => 'setType', + 'lower_bound_endpoint_behavior' => 'setLowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'setLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'setUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'setUpperBoundTimePoint' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', + 'operation_type' => 'getOperationType', + 'operator' => 'getOperator', + 'value' => 'getValue', + 'requires_time_zone_conversion' => 'getRequiresTimeZoneConversion', + 'timestamp' => 'getTimestamp', + 'lower_bound' => 'getLowerBound', + 'upper_bound' => 'getUpperBound', + 'comparison_property_name' => 'getComparisonPropertyName', + 'default_comparison_value' => 'getDefaultComparisonValue', + 'number_of_days' => 'getNumberOfDays', + 'values' => 'getValues', + 'day' => 'getDay', + 'month' => 'getMonth', + 'year' => 'getYear', + 'fiscal_year_start' => 'getFiscalYearStart', + 'time_unit' => 'getTimeUnit', + 'time_unit_count' => 'getTimeUnitCount', + 'use_fiscal_year' => 'getUseFiscalYear', + 'endpoint_behavior' => 'getEndpointBehavior', + 'property_parser' => 'getPropertyParser', + 'time_point' => 'getTimePoint', + 'type' => 'getType', + 'lower_bound_endpoint_behavior' => 'getLowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'getLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'getUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'getUpperBoundTimePoint' + ]; + + /** + * 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 FISCAL_YEAR_START_APRIL = 'APRIL'; + public const FISCAL_YEAR_START_AUGUST = 'AUGUST'; + public const FISCAL_YEAR_START_DECEMBER = 'DECEMBER'; + public const FISCAL_YEAR_START_FEBRUARY = 'FEBRUARY'; + public const FISCAL_YEAR_START_JANUARY = 'JANUARY'; + public const FISCAL_YEAR_START_JULY = 'JULY'; + public const FISCAL_YEAR_START_JUNE = 'JUNE'; + public const FISCAL_YEAR_START_MARCH = 'MARCH'; + public const FISCAL_YEAR_START_MAY = 'MAY'; + public const FISCAL_YEAR_START_NOVEMBER = 'NOVEMBER'; + public const FISCAL_YEAR_START_OCTOBER = 'OCTOBER'; + public const FISCAL_YEAR_START_SEPTEMBER = 'SEPTEMBER'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFiscalYearStartAllowableValues() + { + return [ + self::FISCAL_YEAR_START_APRIL, + self::FISCAL_YEAR_START_AUGUST, + self::FISCAL_YEAR_START_DECEMBER, + self::FISCAL_YEAR_START_FEBRUARY, + self::FISCAL_YEAR_START_JANUARY, + self::FISCAL_YEAR_START_JULY, + self::FISCAL_YEAR_START_JUNE, + self::FISCAL_YEAR_START_MARCH, + self::FISCAL_YEAR_START_MAY, + self::FISCAL_YEAR_START_NOVEMBER, + self::FISCAL_YEAR_START_OCTOBER, + self::FISCAL_YEAR_START_SEPTEMBER, + ]; + } + + /** + * 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('include_objects_with_no_value_set', $data ?? [], null); + $this->setIfExists('operation_type', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('requires_time_zone_conversion', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('lower_bound', $data ?? [], null); + $this->setIfExists('upper_bound', $data ?? [], null); + $this->setIfExists('comparison_property_name', $data ?? [], null); + $this->setIfExists('default_comparison_value', $data ?? [], null); + $this->setIfExists('number_of_days', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); + $this->setIfExists('day', $data ?? [], null); + $this->setIfExists('month', $data ?? [], null); + $this->setIfExists('year', $data ?? [], null); + $this->setIfExists('fiscal_year_start', $data ?? [], null); + $this->setIfExists('time_unit', $data ?? [], null); + $this->setIfExists('time_unit_count', $data ?? [], null); + $this->setIfExists('use_fiscal_year', $data ?? [], null); + $this->setIfExists('endpoint_behavior', $data ?? [], null); + $this->setIfExists('property_parser', $data ?? [], null); + $this->setIfExists('time_point', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('lower_bound_endpoint_behavior', $data ?? [], null); + $this->setIfExists('lower_bound_time_point', $data ?? [], null); + $this->setIfExists('upper_bound_endpoint_behavior', $data ?? [], null); + $this->setIfExists('upper_bound_time_point', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['operation_type'] = static::$openAPIModelName; + } + + /** + * 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['include_objects_with_no_value_set'] === null) { + $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; + } + if ($this->container['operation_type'] === null) { + $invalidProperties[] = "'operation_type' can't be null"; + } + if ($this->container['operator'] === null) { + $invalidProperties[] = "'operator' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ($this->container['requires_time_zone_conversion'] === null) { + $invalidProperties[] = "'requires_time_zone_conversion' can't be null"; + } + if ($this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } + if ($this->container['lower_bound'] === null) { + $invalidProperties[] = "'lower_bound' can't be null"; + } + if ($this->container['upper_bound'] === null) { + $invalidProperties[] = "'upper_bound' can't be null"; + } + if ($this->container['comparison_property_name'] === null) { + $invalidProperties[] = "'comparison_property_name' can't be null"; + } + if ($this->container['number_of_days'] === null) { + $invalidProperties[] = "'number_of_days' can't be null"; + } + if ($this->container['values'] === null) { + $invalidProperties[] = "'values' can't be null"; + } + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } + if ($this->container['month'] === null) { + $invalidProperties[] = "'month' can't be null"; + } + if ($this->container['year'] === null) { + $invalidProperties[] = "'year' can't be null"; + } + $allowedValues = $this->getFiscalYearStartAllowableValues(); + if (!is_null($this->container['fiscal_year_start']) && !in_array($this->container['fiscal_year_start'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'fiscal_year_start', must be one of '%s'", + $this->container['fiscal_year_start'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['time_unit'] === null) { + $invalidProperties[] = "'time_unit' can't be null"; + } + if ($this->container['time_point'] === null) { + $invalidProperties[] = "'time_point' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['lower_bound_time_point'] === null) { + $invalidProperties[] = "'lower_bound_time_point' can't be null"; + } + if ($this->container['upper_bound_time_point'] === null) { + $invalidProperties[] = "'upper_bound_time_point' 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 include_objects_with_no_value_set + * + * @return bool + */ + public function getIncludeObjectsWithNoValueSet() + { + return $this->container['include_objects_with_no_value_set']; + } + + /** + * Sets include_objects_with_no_value_set + * + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. + * + * @return self + */ + public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_set) + { + if (is_null($include_objects_with_no_value_set)) { + throw new \InvalidArgumentException('non-nullable include_objects_with_no_value_set cannot be null'); + } + $this->container['include_objects_with_no_value_set'] = $include_objects_with_no_value_set; + + return $this; + } + + /** + * Gets operation_type + * + * @return string + */ + public function getOperationType() + { + return $this->container['operation_type']; + } + + /** + * Sets operation_type + * + * @param string $operation_type Specifies the type of operation (TIME_RANGED). + * + * @return self + */ + public function setOperationType($operation_type) + { + if (is_null($operation_type)) { + throw new \InvalidArgumentException('non-nullable operation_type cannot be null'); + } + $this->container['operation_type'] = $operation_type; + + return $this; + } + + /** + * Gets operator + * + * @return string + */ + public function getOperator() + { + return $this->container['operator']; + } + + /** + * Sets operator + * + * @param string $operator Defines the operation to be applied within the time range (IS_BETWEEN, IS_NOT_BETWEEN). + * + * @return self + */ + public function setOperator($operator) + { + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); + } + $this->container['operator'] = $operator; + + return $this; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value The string value to be used in the operation. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets requires_time_zone_conversion + * + * @return bool + */ + public function getRequiresTimeZoneConversion() + { + return $this->container['requires_time_zone_conversion']; + } + + /** + * Sets requires_time_zone_conversion + * + * @param bool $requires_time_zone_conversion Specifies whether the operation requires conversion to a different time zone. + * + * @return self + */ + public function setRequiresTimeZoneConversion($requires_time_zone_conversion) + { + if (is_null($requires_time_zone_conversion)) { + throw new \InvalidArgumentException('non-nullable requires_time_zone_conversion cannot be null'); + } + $this->container['requires_time_zone_conversion'] = $requires_time_zone_conversion; + + return $this; + } + + /** + * Gets timestamp + * + * @return int + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param int $timestamp The specific point in time used in the operation. + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets lower_bound + * + * @return int + */ + public function getLowerBound() + { + return $this->container['lower_bound']; + } + + /** + * Sets lower_bound + * + * @param int $lower_bound The lower limit of the number range for the operation. + * + * @return self + */ + public function setLowerBound($lower_bound) + { + if (is_null($lower_bound)) { + throw new \InvalidArgumentException('non-nullable lower_bound cannot be null'); + } + $this->container['lower_bound'] = $lower_bound; + + return $this; + } + + /** + * Gets upper_bound + * + * @return int + */ + public function getUpperBound() + { + return $this->container['upper_bound']; + } + + /** + * Sets upper_bound + * + * @param int $upper_bound The upper limit of the number range for the operation. + * + * @return self + */ + public function setUpperBound($upper_bound) + { + if (is_null($upper_bound)) { + throw new \InvalidArgumentException('non-nullable upper_bound cannot be null'); + } + $this->container['upper_bound'] = $upper_bound; + + return $this; + } + + /** + * Gets comparison_property_name + * + * @return string + */ + public function getComparisonPropertyName() + { + return $this->container['comparison_property_name']; + } + + /** + * Sets comparison_property_name + * + * @param string $comparison_property_name The name of the property to compare against in the operation. + * + * @return self + */ + public function setComparisonPropertyName($comparison_property_name) + { + if (is_null($comparison_property_name)) { + throw new \InvalidArgumentException('non-nullable comparison_property_name cannot be null'); + } + $this->container['comparison_property_name'] = $comparison_property_name; + + return $this; + } + + /** + * Gets default_comparison_value + * + * @return string|null + */ + public function getDefaultComparisonValue() + { + return $this->container['default_comparison_value']; + } + + /** + * Sets default_comparison_value + * + * @param string|null $default_comparison_value The default value used for comparison if the actual comparison property value is not set. + * + * @return self + */ + public function setDefaultComparisonValue($default_comparison_value) + { + if (is_null($default_comparison_value)) { + throw new \InvalidArgumentException('non-nullable default_comparison_value cannot be null'); + } + $this->container['default_comparison_value'] = $default_comparison_value; + + return $this; + } + + /** + * Gets number_of_days + * + * @return int + */ + public function getNumberOfDays() + { + return $this->container['number_of_days']; + } + + /** + * Sets number_of_days + * + * @param int $number_of_days The number of days to be considered in the rolling property updated operation. + * + * @return self + */ + public function setNumberOfDays($number_of_days) + { + if (is_null($number_of_days)) { + throw new \InvalidArgumentException('non-nullable number_of_days cannot be null'); + } + $this->container['number_of_days'] = $number_of_days; + + return $this; + } + + /** + * Gets values + * + * @return string[] + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param string[] $values values + * + * @return self + */ + public function setValues($values) + { + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); + } + $this->container['values'] = $values; + + return $this; + } + + /** + * Gets day + * + * @return int + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param int $day The day of the month for the date operation. + * + * @return self + */ + public function setDay($day) + { + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets month + * + * @return string + */ + public function getMonth() + { + return $this->container['month']; + } + + /** + * Sets month + * + * @param string $month The month for the date operation. + * + * @return self + */ + public function setMonth($month) + { + if (is_null($month)) { + throw new \InvalidArgumentException('non-nullable month cannot be null'); + } + $this->container['month'] = $month; + + return $this; + } + + /** + * Gets year + * + * @return int + */ + public function getYear() + { + return $this->container['year']; + } + + /** + * Sets year + * + * @param int $year The year for the date operation. + * + * @return self + */ + public function setYear($year) + { + if (is_null($year)) { + throw new \InvalidArgumentException('non-nullable year cannot be null'); + } + $this->container['year'] = $year; + + return $this; + } + + /** + * Gets fiscal_year_start + * + * @return string|null + */ + public function getFiscalYearStart() + { + return $this->container['fiscal_year_start']; + } + + /** + * Sets fiscal_year_start + * + * @param string|null $fiscal_year_start The month in which the fiscal year starts. + * + * @return self + */ + public function setFiscalYearStart($fiscal_year_start) + { + if (is_null($fiscal_year_start)) { + throw new \InvalidArgumentException('non-nullable fiscal_year_start cannot be null'); + } + $allowedValues = $this->getFiscalYearStartAllowableValues(); + if (!in_array($fiscal_year_start, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'fiscal_year_start', must be one of '%s'", + $fiscal_year_start, + implode("', '", $allowedValues) + ) + ); + } + $this->container['fiscal_year_start'] = $fiscal_year_start; + + return $this; + } + + /** + * Gets time_unit + * + * @return string + */ + public function getTimeUnit() + { + return $this->container['time_unit']; + } + + /** + * Sets time_unit + * + * @param string $time_unit The unit of time to be used in the operation (DAY, WEEK, MONTH, QUARTER, YEAR). + * + * @return self + */ + public function setTimeUnit($time_unit) + { + if (is_null($time_unit)) { + throw new \InvalidArgumentException('non-nullable time_unit cannot be null'); + } + $this->container['time_unit'] = $time_unit; + + return $this; + } + + /** + * Gets time_unit_count + * + * @return int|null + */ + public function getTimeUnitCount() + { + return $this->container['time_unit_count']; + } + + /** + * Sets time_unit_count + * + * @param int|null $time_unit_count The count of time units to be applied in the operation (1). + * + * @return self + */ + public function setTimeUnitCount($time_unit_count) + { + if (is_null($time_unit_count)) { + throw new \InvalidArgumentException('non-nullable time_unit_count cannot be null'); + } + $this->container['time_unit_count'] = $time_unit_count; + + return $this; + } + + /** + * Gets use_fiscal_year + * + * @return bool|null + */ + public function getUseFiscalYear() + { + return $this->container['use_fiscal_year']; + } + + /** + * Sets use_fiscal_year + * + * @param bool|null $use_fiscal_year Specifies whether the fiscal year should be used in the operation. + * + * @return self + */ + public function setUseFiscalYear($use_fiscal_year) + { + if (is_null($use_fiscal_year)) { + throw new \InvalidArgumentException('non-nullable use_fiscal_year cannot be null'); + } + $this->container['use_fiscal_year'] = $use_fiscal_year; + + return $this; + } + + /** + * Gets endpoint_behavior + * + * @return string|null + */ + public function getEndpointBehavior() + { + return $this->container['endpoint_behavior']; + } + + /** + * Sets endpoint_behavior + * + * @param string|null $endpoint_behavior Describes the behavior at the endpoint of the time point operation. + * + * @return self + */ + public function setEndpointBehavior($endpoint_behavior) + { + if (is_null($endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable endpoint_behavior cannot be null'); + } + $this->container['endpoint_behavior'] = $endpoint_behavior; + + return $this; + } + + /** + * Gets property_parser + * + * @return string|null + */ + public function getPropertyParser() + { + return $this->container['property_parser']; + } + + /** + * Sets property_parser + * + * @param string|null $property_parser Specifies the parser used for the property in the operation. + * + * @return self + */ + public function setPropertyParser($property_parser) + { + if (is_null($property_parser)) { + throw new \InvalidArgumentException('non-nullable property_parser cannot be null'); + } + $this->container['property_parser'] = $property_parser; + + return $this; + } + + /** + * Gets time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint + */ + public function getTimePoint() + { + return $this->container['time_point']; + } + + /** + * Sets time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint $time_point time_point + * + * @return self + */ + public function setTimePoint($time_point) + { + if (is_null($time_point)) { + throw new \InvalidArgumentException('non-nullable time_point cannot be null'); + } + $this->container['time_point'] = $time_point; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Defines the type of operation being performed. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets lower_bound_endpoint_behavior + * + * @return string|null + */ + public function getLowerBoundEndpointBehavior() + { + return $this->container['lower_bound_endpoint_behavior']; + } + + /** + * Sets lower_bound_endpoint_behavior + * + * @param string|null $lower_bound_endpoint_behavior Describes the behavior at the lower bound endpoint of the time range. + * + * @return self + */ + public function setLowerBoundEndpointBehavior($lower_bound_endpoint_behavior) + { + if (is_null($lower_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable lower_bound_endpoint_behavior cannot be null'); + } + $this->container['lower_bound_endpoint_behavior'] = $lower_bound_endpoint_behavior; + + return $this; + } + + /** + * Gets lower_bound_time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint + */ + public function getLowerBoundTimePoint() + { + return $this->container['lower_bound_time_point']; + } + + /** + * Sets lower_bound_time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint $lower_bound_time_point lower_bound_time_point + * + * @return self + */ + public function setLowerBoundTimePoint($lower_bound_time_point) + { + if (is_null($lower_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable lower_bound_time_point cannot be null'); + } + $this->container['lower_bound_time_point'] = $lower_bound_time_point; + + return $this; + } + + /** + * Gets upper_bound_endpoint_behavior + * + * @return string|null + */ + public function getUpperBoundEndpointBehavior() + { + return $this->container['upper_bound_endpoint_behavior']; + } + + /** + * Sets upper_bound_endpoint_behavior + * + * @param string|null $upper_bound_endpoint_behavior Describes the behavior at the upper bound endpoint of the time range. + * + * @return self + */ + public function setUpperBoundEndpointBehavior($upper_bound_endpoint_behavior) + { + if (is_null($upper_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable upper_bound_endpoint_behavior cannot be null'); + } + $this->container['upper_bound_endpoint_behavior'] = $upper_bound_endpoint_behavior; + + return $this; + } + + /** + * Gets upper_bound_time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint + */ + public function getUpperBoundTimePoint() + { + return $this->container['upper_bound_time_point']; + } + + /** + * Sets upper_bound_time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint $upper_bound_time_point upper_bound_time_point + * + * @return self + */ + public function setUpperBoundTimePoint($upper_bound_time_point) + { + if (is_null($upper_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable upper_bound_time_point cannot be null'); + } + $this->container['upper_bound_time_point'] = $upper_bound_time_point; + + 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/Lists/Model/PublicFiscalQuarterReference.php b/codegen/Crm/Lists/Model/PublicFiscalQuarterReference.php index 0cc0b9f2e..7846a9e49 100644 --- a/codegen/Crm/Lists/Model/PublicFiscalQuarterReference.php +++ b/codegen/Crm/Lists/Model/PublicFiscalQuarterReference.php @@ -2,7 +2,7 @@ /** * PublicFiscalQuarterReference * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,12 +57,12 @@ class PublicFiscalQuarterReference implements ModelInterface, ArrayAccess, \Json * @var string[] */ protected static $openAPITypes = [ + 'day' => 'int', 'hour' => 'int', - 'month' => 'int', 'millisecond' => 'int', - 'reference_type' => 'string', - 'day' => 'int', 'minute' => 'int', + 'month' => 'int', + 'reference_type' => 'string', 'second' => 'int' ]; @@ -74,12 +74,12 @@ class PublicFiscalQuarterReference implements ModelInterface, ArrayAccess, \Json * @psalm-var array */ protected static $openAPIFormats = [ + 'day' => 'int32', 'hour' => 'int32', - 'month' => 'int32', 'millisecond' => 'int32', - 'reference_type' => null, - 'day' => 'int32', 'minute' => 'int32', + 'month' => 'int32', + 'reference_type' => null, 'second' => 'int32' ]; @@ -89,12 +89,12 @@ class PublicFiscalQuarterReference implements ModelInterface, ArrayAccess, \Json * @var boolean[] */ protected static array $openAPINullables = [ + 'day' => false, 'hour' => false, - 'month' => false, 'millisecond' => false, - 'reference_type' => false, - 'day' => false, 'minute' => false, + 'month' => false, + 'reference_type' => false, 'second' => false ]; @@ -184,12 +184,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'day' => 'day', 'hour' => 'hour', - 'month' => 'month', 'millisecond' => 'millisecond', - 'reference_type' => 'referenceType', - 'day' => 'day', 'minute' => 'minute', + 'month' => 'month', + 'reference_type' => 'referenceType', 'second' => 'second' ]; @@ -199,12 +199,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'day' => 'setDay', 'hour' => 'setHour', - 'month' => 'setMonth', 'millisecond' => 'setMillisecond', - 'reference_type' => 'setReferenceType', - 'day' => 'setDay', 'minute' => 'setMinute', + 'month' => 'setMonth', + 'reference_type' => 'setReferenceType', 'second' => 'setSecond' ]; @@ -214,12 +214,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'day' => 'getDay', 'hour' => 'getHour', - 'month' => 'getMonth', 'millisecond' => 'getMillisecond', - 'reference_type' => 'getReferenceType', - 'day' => 'getDay', 'minute' => 'getMinute', + 'month' => 'getMonth', + 'reference_type' => 'getReferenceType', 'second' => 'getSecond' ]; @@ -293,12 +293,12 @@ public function getReferenceTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('day', $data ?? [], null); $this->setIfExists('hour', $data ?? [], null); - $this->setIfExists('month', $data ?? [], null); $this->setIfExists('millisecond', $data ?? [], null); - $this->setIfExists('reference_type', $data ?? [], 'FISCAL_QUARTER'); - $this->setIfExists('day', $data ?? [], null); $this->setIfExists('minute', $data ?? [], null); + $this->setIfExists('month', $data ?? [], null); + $this->setIfExists('reference_type', $data ?? [], 'FISCAL_QUARTER'); $this->setIfExists('second', $data ?? [], null); } @@ -329,6 +329,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } if ($this->container['month'] === null) { $invalidProperties[] = "'month' can't be null"; } @@ -344,9 +347,6 @@ public function listInvalidProperties() ); } - if ($this->container['day'] === null) { - $invalidProperties[] = "'day' can't be null"; - } return $invalidProperties; } @@ -363,55 +363,55 @@ public function valid() /** - * Gets hour + * Gets day * - * @return int|null + * @return int */ - public function getHour() + public function getDay() { - return $this->container['hour']; + return $this->container['day']; } /** - * Sets hour + * Sets day * - * @param int|null $hour hour + * @param int $day The day component of the fiscal quarter reference. * * @return self */ - public function setHour($hour) + public function setDay($day) { - if (is_null($hour)) { - throw new \InvalidArgumentException('non-nullable hour cannot be null'); + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); } - $this->container['hour'] = $hour; + $this->container['day'] = $day; return $this; } /** - * Gets month + * Gets hour * - * @return int + * @return int|null */ - public function getMonth() + public function getHour() { - return $this->container['month']; + return $this->container['hour']; } /** - * Sets month + * Sets hour * - * @param int $month month + * @param int|null $hour The hour component of the fiscal quarter reference. * * @return self */ - public function setMonth($month) + public function setHour($hour) { - if (is_null($month)) { - throw new \InvalidArgumentException('non-nullable month cannot be null'); + if (is_null($hour)) { + throw new \InvalidArgumentException('non-nullable hour cannot be null'); } - $this->container['month'] = $month; + $this->container['hour'] = $hour; return $this; } @@ -429,7 +429,7 @@ public function getMillisecond() /** * Sets millisecond * - * @param int|null $millisecond millisecond + * @param int|null $millisecond The millisecond component of the fiscal quarter reference. * * @return self */ @@ -444,92 +444,92 @@ public function setMillisecond($millisecond) } /** - * Gets reference_type + * Gets minute * - * @return string + * @return int|null */ - public function getReferenceType() + public function getMinute() { - return $this->container['reference_type']; + return $this->container['minute']; } /** - * Sets reference_type + * Sets minute * - * @param string $reference_type reference_type + * @param int|null $minute The minute component of the fiscal quarter reference. * * @return self */ - public function setReferenceType($reference_type) + public function setMinute($minute) { - if (is_null($reference_type)) { - throw new \InvalidArgumentException('non-nullable reference_type cannot be null'); - } - $allowedValues = $this->getReferenceTypeAllowableValues(); - if (!in_array($reference_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'reference_type', must be one of '%s'", - $reference_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($minute)) { + throw new \InvalidArgumentException('non-nullable minute cannot be null'); } - $this->container['reference_type'] = $reference_type; + $this->container['minute'] = $minute; return $this; } /** - * Gets day + * Gets month * * @return int */ - public function getDay() + public function getMonth() { - return $this->container['day']; + return $this->container['month']; } /** - * Sets day + * Sets month * - * @param int $day day + * @param int $month The month component of the fiscal quarter reference. * * @return self */ - public function setDay($day) + public function setMonth($month) { - if (is_null($day)) { - throw new \InvalidArgumentException('non-nullable day cannot be null'); + if (is_null($month)) { + throw new \InvalidArgumentException('non-nullable month cannot be null'); } - $this->container['day'] = $day; + $this->container['month'] = $month; return $this; } /** - * Gets minute + * Gets reference_type * - * @return int|null + * @return string */ - public function getMinute() + public function getReferenceType() { - return $this->container['minute']; + return $this->container['reference_type']; } /** - * Sets minute + * Sets reference_type * - * @param int|null $minute minute + * @param string $reference_type Indicates the type of reference (FISCAL_QUARTER). * * @return self */ - public function setMinute($minute) + public function setReferenceType($reference_type) { - if (is_null($minute)) { - throw new \InvalidArgumentException('non-nullable minute cannot be null'); + if (is_null($reference_type)) { + throw new \InvalidArgumentException('non-nullable reference_type cannot be null'); } - $this->container['minute'] = $minute; + $allowedValues = $this->getReferenceTypeAllowableValues(); + if (!in_array($reference_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'reference_type', must be one of '%s'", + $reference_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['reference_type'] = $reference_type; return $this; } @@ -547,7 +547,7 @@ public function getSecond() /** * Sets second * - * @param int|null $second second + * @param int|null $second The second component of the fiscal quarter reference. * * @return self */ @@ -563,11 +563,11 @@ public function setSecond($second) /** * 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]); } @@ -575,12 +575,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; } @@ -605,11 +605,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/Lists/Model/PublicFiscalYearReference.php b/codegen/Crm/Lists/Model/PublicFiscalYearReference.php index d35a9ea79..892f2ad12 100644 --- a/codegen/Crm/Lists/Model/PublicFiscalYearReference.php +++ b/codegen/Crm/Lists/Model/PublicFiscalYearReference.php @@ -2,7 +2,7 @@ /** * PublicFiscalYearReference * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,12 +57,12 @@ class PublicFiscalYearReference implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ + 'day' => 'int', 'hour' => 'int', - 'month' => 'int', 'millisecond' => 'int', - 'reference_type' => 'string', - 'day' => 'int', 'minute' => 'int', + 'month' => 'int', + 'reference_type' => 'string', 'second' => 'int' ]; @@ -74,12 +74,12 @@ class PublicFiscalYearReference implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ + 'day' => 'int32', 'hour' => 'int32', - 'month' => 'int32', 'millisecond' => 'int32', - 'reference_type' => null, - 'day' => 'int32', 'minute' => 'int32', + 'month' => 'int32', + 'reference_type' => null, 'second' => 'int32' ]; @@ -89,12 +89,12 @@ class PublicFiscalYearReference implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static array $openAPINullables = [ + 'day' => false, 'hour' => false, - 'month' => false, 'millisecond' => false, - 'reference_type' => false, - 'day' => false, 'minute' => false, + 'month' => false, + 'reference_type' => false, 'second' => false ]; @@ -184,12 +184,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'day' => 'day', 'hour' => 'hour', - 'month' => 'month', 'millisecond' => 'millisecond', - 'reference_type' => 'referenceType', - 'day' => 'day', 'minute' => 'minute', + 'month' => 'month', + 'reference_type' => 'referenceType', 'second' => 'second' ]; @@ -199,12 +199,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'day' => 'setDay', 'hour' => 'setHour', - 'month' => 'setMonth', 'millisecond' => 'setMillisecond', - 'reference_type' => 'setReferenceType', - 'day' => 'setDay', 'minute' => 'setMinute', + 'month' => 'setMonth', + 'reference_type' => 'setReferenceType', 'second' => 'setSecond' ]; @@ -214,12 +214,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'day' => 'getDay', 'hour' => 'getHour', - 'month' => 'getMonth', 'millisecond' => 'getMillisecond', - 'reference_type' => 'getReferenceType', - 'day' => 'getDay', 'minute' => 'getMinute', + 'month' => 'getMonth', + 'reference_type' => 'getReferenceType', 'second' => 'getSecond' ]; @@ -293,12 +293,12 @@ public function getReferenceTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('day', $data ?? [], null); $this->setIfExists('hour', $data ?? [], null); - $this->setIfExists('month', $data ?? [], null); $this->setIfExists('millisecond', $data ?? [], null); - $this->setIfExists('reference_type', $data ?? [], 'FISCAL_YEAR'); - $this->setIfExists('day', $data ?? [], null); $this->setIfExists('minute', $data ?? [], null); + $this->setIfExists('month', $data ?? [], null); + $this->setIfExists('reference_type', $data ?? [], 'FISCAL_YEAR'); $this->setIfExists('second', $data ?? [], null); } @@ -329,6 +329,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } if ($this->container['month'] === null) { $invalidProperties[] = "'month' can't be null"; } @@ -344,9 +347,6 @@ public function listInvalidProperties() ); } - if ($this->container['day'] === null) { - $invalidProperties[] = "'day' can't be null"; - } return $invalidProperties; } @@ -363,55 +363,55 @@ public function valid() /** - * Gets hour + * Gets day * - * @return int|null + * @return int */ - public function getHour() + public function getDay() { - return $this->container['hour']; + return $this->container['day']; } /** - * Sets hour + * Sets day * - * @param int|null $hour hour + * @param int $day The day component of the fiscal year reference. * * @return self */ - public function setHour($hour) + public function setDay($day) { - if (is_null($hour)) { - throw new \InvalidArgumentException('non-nullable hour cannot be null'); + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); } - $this->container['hour'] = $hour; + $this->container['day'] = $day; return $this; } /** - * Gets month + * Gets hour * - * @return int + * @return int|null */ - public function getMonth() + public function getHour() { - return $this->container['month']; + return $this->container['hour']; } /** - * Sets month + * Sets hour * - * @param int $month month + * @param int|null $hour The hour component of the fiscal year reference. * * @return self */ - public function setMonth($month) + public function setHour($hour) { - if (is_null($month)) { - throw new \InvalidArgumentException('non-nullable month cannot be null'); + if (is_null($hour)) { + throw new \InvalidArgumentException('non-nullable hour cannot be null'); } - $this->container['month'] = $month; + $this->container['hour'] = $hour; return $this; } @@ -429,7 +429,7 @@ public function getMillisecond() /** * Sets millisecond * - * @param int|null $millisecond millisecond + * @param int|null $millisecond The millisecond component of the fiscal year reference. * * @return self */ @@ -444,92 +444,92 @@ public function setMillisecond($millisecond) } /** - * Gets reference_type + * Gets minute * - * @return string + * @return int|null */ - public function getReferenceType() + public function getMinute() { - return $this->container['reference_type']; + return $this->container['minute']; } /** - * Sets reference_type + * Sets minute * - * @param string $reference_type reference_type + * @param int|null $minute The minute component of the fiscal year reference. * * @return self */ - public function setReferenceType($reference_type) + public function setMinute($minute) { - if (is_null($reference_type)) { - throw new \InvalidArgumentException('non-nullable reference_type cannot be null'); - } - $allowedValues = $this->getReferenceTypeAllowableValues(); - if (!in_array($reference_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'reference_type', must be one of '%s'", - $reference_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($minute)) { + throw new \InvalidArgumentException('non-nullable minute cannot be null'); } - $this->container['reference_type'] = $reference_type; + $this->container['minute'] = $minute; return $this; } /** - * Gets day + * Gets month * * @return int */ - public function getDay() + public function getMonth() { - return $this->container['day']; + return $this->container['month']; } /** - * Sets day + * Sets month * - * @param int $day day + * @param int $month The month component of the fiscal year reference. * * @return self */ - public function setDay($day) + public function setMonth($month) { - if (is_null($day)) { - throw new \InvalidArgumentException('non-nullable day cannot be null'); + if (is_null($month)) { + throw new \InvalidArgumentException('non-nullable month cannot be null'); } - $this->container['day'] = $day; + $this->container['month'] = $month; return $this; } /** - * Gets minute + * Gets reference_type * - * @return int|null + * @return string */ - public function getMinute() + public function getReferenceType() { - return $this->container['minute']; + return $this->container['reference_type']; } /** - * Sets minute + * Sets reference_type * - * @param int|null $minute minute + * @param string $reference_type Indicates the type of reference (FISCAL_YEAR). * * @return self */ - public function setMinute($minute) + public function setReferenceType($reference_type) { - if (is_null($minute)) { - throw new \InvalidArgumentException('non-nullable minute cannot be null'); + if (is_null($reference_type)) { + throw new \InvalidArgumentException('non-nullable reference_type cannot be null'); } - $this->container['minute'] = $minute; + $allowedValues = $this->getReferenceTypeAllowableValues(); + if (!in_array($reference_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'reference_type', must be one of '%s'", + $reference_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['reference_type'] = $reference_type; return $this; } @@ -547,7 +547,7 @@ public function getSecond() /** * Sets second * - * @param int|null $second second + * @param int|null $second The second component of the fiscal year reference. * * @return self */ @@ -563,11 +563,11 @@ public function setSecond($second) /** * 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]); } @@ -575,12 +575,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; } @@ -605,11 +605,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/Lists/Model/PublicFormSubmissionFilter.php b/codegen/Crm/Lists/Model/PublicFormSubmissionFilter.php index 2741e17fd..08930ee16 100644 --- a/codegen/Crm/Lists/Model/PublicFormSubmissionFilter.php +++ b/codegen/Crm/Lists/Model/PublicFormSubmissionFilter.php @@ -2,7 +2,7 @@ /** * PublicFormSubmissionFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,11 +57,11 @@ class PublicFormSubmissionFilter implements ModelInterface, ArrayAccess, \JsonSe * @var string[] */ protected static $openAPITypes = [ - 'form_id' => 'string', 'coalescing_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', - 'pruning_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', 'filter_type' => 'string', - 'operator' => 'string' + 'form_id' => 'string', + 'operator' => 'string', + 'pruning_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy' ]; /** @@ -72,11 +72,11 @@ class PublicFormSubmissionFilter implements ModelInterface, ArrayAccess, \JsonSe * @psalm-var array */ protected static $openAPIFormats = [ - 'form_id' => null, 'coalescing_refine_by' => null, - 'pruning_refine_by' => null, 'filter_type' => null, - 'operator' => null + 'form_id' => null, + 'operator' => null, + 'pruning_refine_by' => null ]; /** @@ -85,11 +85,11 @@ class PublicFormSubmissionFilter implements ModelInterface, ArrayAccess, \JsonSe * @var boolean[] */ protected static array $openAPINullables = [ - 'form_id' => false, 'coalescing_refine_by' => false, - 'pruning_refine_by' => false, 'filter_type' => false, - 'operator' => false + 'form_id' => false, + 'operator' => false, + 'pruning_refine_by' => false ]; /** @@ -178,11 +178,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'form_id' => 'formId', 'coalescing_refine_by' => 'coalescingRefineBy', - 'pruning_refine_by' => 'pruningRefineBy', 'filter_type' => 'filterType', - 'operator' => 'operator' + 'form_id' => 'formId', + 'operator' => 'operator', + 'pruning_refine_by' => 'pruningRefineBy' ]; /** @@ -191,11 +191,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'form_id' => 'setFormId', 'coalescing_refine_by' => 'setCoalescingRefineBy', - 'pruning_refine_by' => 'setPruningRefineBy', 'filter_type' => 'setFilterType', - 'operator' => 'setOperator' + 'form_id' => 'setFormId', + 'operator' => 'setOperator', + 'pruning_refine_by' => 'setPruningRefineBy' ]; /** @@ -204,11 +204,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'form_id' => 'getFormId', 'coalescing_refine_by' => 'getCoalescingRefineBy', - 'pruning_refine_by' => 'getPruningRefineBy', 'filter_type' => 'getFilterType', - 'operator' => 'getOperator' + 'form_id' => 'getFormId', + 'operator' => 'getOperator', + 'pruning_refine_by' => 'getPruningRefineBy' ]; /** @@ -296,11 +296,11 @@ public function getOperatorAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('form_id', $data ?? [], null); $this->setIfExists('coalescing_refine_by', $data ?? [], null); - $this->setIfExists('pruning_refine_by', $data ?? [], null); $this->setIfExists('filter_type', $data ?? [], 'FORM_SUBMISSION'); + $this->setIfExists('form_id', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('pruning_refine_by', $data ?? [], null); } /** @@ -369,33 +369,6 @@ public function valid() } - /** - * Gets form_id - * - * @return string|null - */ - public function getFormId() - { - return $this->container['form_id']; - } - - /** - * Sets form_id - * - * @param string|null $form_id form_id - * - * @return self - */ - public function setFormId($form_id) - { - if (is_null($form_id)) { - throw new \InvalidArgumentException('non-nullable form_id cannot be null'); - } - $this->container['form_id'] = $form_id; - - return $this; - } - /** * Gets coalescing_refine_by * @@ -423,33 +396,6 @@ public function setCoalescingRefineBy($coalescing_refine_by) return $this; } - /** - * Gets pruning_refine_by - * - * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null - */ - public function getPruningRefineBy() - { - return $this->container['pruning_refine_by']; - } - - /** - * Sets pruning_refine_by - * - * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null $pruning_refine_by pruning_refine_by - * - * @return self - */ - public function setPruningRefineBy($pruning_refine_by) - { - if (is_null($pruning_refine_by)) { - throw new \InvalidArgumentException('non-nullable pruning_refine_by cannot be null'); - } - $this->container['pruning_refine_by'] = $pruning_refine_by; - - return $this; - } - /** * Gets filter_type * @@ -463,7 +409,7 @@ public function getFilterType() /** * Sets filter_type * - * @param string $filter_type filter_type + * @param string $filter_type Indicates the type of filter (FORM_SUBMISSION). * * @return self */ @@ -487,6 +433,33 @@ public function setFilterType($filter_type) return $this; } + /** + * Gets form_id + * + * @return string|null + */ + public function getFormId() + { + return $this->container['form_id']; + } + + /** + * Sets form_id + * + * @param string|null $form_id The ID of the form used in the filter. + * + * @return self + */ + public function setFormId($form_id) + { + if (is_null($form_id)) { + throw new \InvalidArgumentException('non-nullable form_id cannot be null'); + } + $this->container['form_id'] = $form_id; + + return $this; + } + /** * Gets operator * @@ -500,7 +473,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Specifies the operation to be performed (FILLED_OUT, NOT_FILLED_OUT). * * @return self */ @@ -523,14 +496,41 @@ public function setOperator($operator) return $this; } + + /** + * Gets pruning_refine_by + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy|null + */ + public function getPruningRefineBy() + { + return $this->container['pruning_refine_by']; + } + + /** + * Sets pruning_refine_by + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy|null $pruning_refine_by pruning_refine_by + * + * @return self + */ + public function setPruningRefineBy($pruning_refine_by) + { + if (is_null($pruning_refine_by)) { + throw new \InvalidArgumentException('non-nullable pruning_refine_by cannot be null'); + } + $this->container['pruning_refine_by'] = $pruning_refine_by; + + 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]); } @@ -538,12 +538,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; } @@ -568,11 +568,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/Lists/Model/PublicFormSubmissionFilterCoalescingRefineBy.php b/codegen/Crm/Lists/Model/PublicFormSubmissionFilterCoalescingRefineBy.php index 48bed7add..e75bafed2 100644 --- a/codegen/Crm/Lists/Model/PublicFormSubmissionFilterCoalescingRefineBy.php +++ b/codegen/Crm/Lists/Model/PublicFormSubmissionFilterCoalescingRefineBy.php @@ -2,7 +2,7 @@ /** * PublicFormSubmissionFilterCoalescingRefineBy * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * PublicFormSubmissionFilterCoalescingRefineBy Class Doc Comment * * @category Class + * @description Specifies the criteria for refining the filter by coalescing. * @package HubSpot\Client\Crm\Lists * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -42,7 +43,7 @@ */ class PublicFormSubmissionFilterCoalescingRefineBy implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = null; + public const DISCRIMINATOR = 'type'; /** * The original name of the model. @@ -58,27 +59,27 @@ class PublicFormSubmissionFilterCoalescingRefineBy implements ModelInterface, Ar */ protected static $openAPITypes = [ 'max_occurrences' => 'int', - 'type' => 'string', 'min_occurrences' => 'int', + 'type' => 'string', 'set_type' => 'string', 'comparison' => 'string', 'time_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', - 'upper_bound_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', - 'range_type' => 'string', 'lower_bound_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', + 'range_type' => 'string', + 'upper_bound_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', 'timestamp' => 'int', - 'upper_timestamp' => 'int', 'lower_timestamp' => 'int', + 'upper_timestamp' => 'int', 'endpoint_behavior' => 'string', 'include_objects_with_no_value_set' => 'bool', - 'property_parser' => 'string', 'operation_type' => 'string', - 'time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint', 'operator' => 'string', - 'upper_bound_endpoint_behavior' => 'string', - 'upper_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint', + 'property_parser' => 'string', + 'time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint', 'lower_bound_endpoint_behavior' => 'string', - 'lower_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint' + 'lower_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'string', + 'upper_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint' ]; /** @@ -90,27 +91,27 @@ class PublicFormSubmissionFilterCoalescingRefineBy implements ModelInterface, Ar */ protected static $openAPIFormats = [ 'max_occurrences' => 'int32', - 'type' => null, 'min_occurrences' => 'int32', + 'type' => null, 'set_type' => null, 'comparison' => null, 'time_offset' => null, - 'upper_bound_offset' => null, - 'range_type' => null, 'lower_bound_offset' => null, + 'range_type' => null, + 'upper_bound_offset' => null, 'timestamp' => 'int64', - 'upper_timestamp' => 'int64', 'lower_timestamp' => 'int64', + 'upper_timestamp' => 'int64', 'endpoint_behavior' => null, 'include_objects_with_no_value_set' => null, - 'property_parser' => null, 'operation_type' => null, - 'time_point' => null, 'operator' => null, - 'upper_bound_endpoint_behavior' => null, - 'upper_bound_time_point' => null, + 'property_parser' => null, + 'time_point' => null, 'lower_bound_endpoint_behavior' => null, - 'lower_bound_time_point' => null + 'lower_bound_time_point' => null, + 'upper_bound_endpoint_behavior' => null, + 'upper_bound_time_point' => null ]; /** @@ -120,27 +121,27 @@ class PublicFormSubmissionFilterCoalescingRefineBy implements ModelInterface, Ar */ protected static array $openAPINullables = [ 'max_occurrences' => false, - 'type' => false, 'min_occurrences' => false, + 'type' => false, 'set_type' => false, 'comparison' => false, 'time_offset' => false, - 'upper_bound_offset' => false, - 'range_type' => false, 'lower_bound_offset' => false, + 'range_type' => false, + 'upper_bound_offset' => false, 'timestamp' => false, - 'upper_timestamp' => false, 'lower_timestamp' => false, + 'upper_timestamp' => false, 'endpoint_behavior' => false, 'include_objects_with_no_value_set' => false, - 'property_parser' => false, 'operation_type' => false, - 'time_point' => false, 'operator' => false, - 'upper_bound_endpoint_behavior' => false, - 'upper_bound_time_point' => false, + 'property_parser' => false, + 'time_point' => false, 'lower_bound_endpoint_behavior' => false, - 'lower_bound_time_point' => false + 'lower_bound_time_point' => false, + 'upper_bound_endpoint_behavior' => false, + 'upper_bound_time_point' => false ]; /** @@ -230,27 +231,27 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'max_occurrences' => 'maxOccurrences', - 'type' => 'type', 'min_occurrences' => 'minOccurrences', + 'type' => 'type', 'set_type' => 'setType', 'comparison' => 'comparison', 'time_offset' => 'timeOffset', - 'upper_bound_offset' => 'upperBoundOffset', - 'range_type' => 'rangeType', 'lower_bound_offset' => 'lowerBoundOffset', + 'range_type' => 'rangeType', + 'upper_bound_offset' => 'upperBoundOffset', 'timestamp' => 'timestamp', - 'upper_timestamp' => 'upperTimestamp', 'lower_timestamp' => 'lowerTimestamp', + 'upper_timestamp' => 'upperTimestamp', 'endpoint_behavior' => 'endpointBehavior', 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', - 'property_parser' => 'propertyParser', 'operation_type' => 'operationType', - 'time_point' => 'timePoint', 'operator' => 'operator', - 'upper_bound_endpoint_behavior' => 'upperBoundEndpointBehavior', - 'upper_bound_time_point' => 'upperBoundTimePoint', + 'property_parser' => 'propertyParser', + 'time_point' => 'timePoint', 'lower_bound_endpoint_behavior' => 'lowerBoundEndpointBehavior', - 'lower_bound_time_point' => 'lowerBoundTimePoint' + 'lower_bound_time_point' => 'lowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'upperBoundEndpointBehavior', + 'upper_bound_time_point' => 'upperBoundTimePoint' ]; /** @@ -260,27 +261,27 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'max_occurrences' => 'setMaxOccurrences', - 'type' => 'setType', 'min_occurrences' => 'setMinOccurrences', + 'type' => 'setType', 'set_type' => 'setSetType', 'comparison' => 'setComparison', 'time_offset' => 'setTimeOffset', - 'upper_bound_offset' => 'setUpperBoundOffset', - 'range_type' => 'setRangeType', 'lower_bound_offset' => 'setLowerBoundOffset', + 'range_type' => 'setRangeType', + 'upper_bound_offset' => 'setUpperBoundOffset', 'timestamp' => 'setTimestamp', - 'upper_timestamp' => 'setUpperTimestamp', 'lower_timestamp' => 'setLowerTimestamp', + 'upper_timestamp' => 'setUpperTimestamp', 'endpoint_behavior' => 'setEndpointBehavior', 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', - 'property_parser' => 'setPropertyParser', 'operation_type' => 'setOperationType', - 'time_point' => 'setTimePoint', 'operator' => 'setOperator', - 'upper_bound_endpoint_behavior' => 'setUpperBoundEndpointBehavior', - 'upper_bound_time_point' => 'setUpperBoundTimePoint', + 'property_parser' => 'setPropertyParser', + 'time_point' => 'setTimePoint', 'lower_bound_endpoint_behavior' => 'setLowerBoundEndpointBehavior', - 'lower_bound_time_point' => 'setLowerBoundTimePoint' + 'lower_bound_time_point' => 'setLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'setUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'setUpperBoundTimePoint' ]; /** @@ -290,27 +291,27 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'max_occurrences' => 'getMaxOccurrences', - 'type' => 'getType', 'min_occurrences' => 'getMinOccurrences', + 'type' => 'getType', 'set_type' => 'getSetType', 'comparison' => 'getComparison', 'time_offset' => 'getTimeOffset', - 'upper_bound_offset' => 'getUpperBoundOffset', - 'range_type' => 'getRangeType', 'lower_bound_offset' => 'getLowerBoundOffset', + 'range_type' => 'getRangeType', + 'upper_bound_offset' => 'getUpperBoundOffset', 'timestamp' => 'getTimestamp', - 'upper_timestamp' => 'getUpperTimestamp', 'lower_timestamp' => 'getLowerTimestamp', + 'upper_timestamp' => 'getUpperTimestamp', 'endpoint_behavior' => 'getEndpointBehavior', 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', - 'property_parser' => 'getPropertyParser', 'operation_type' => 'getOperationType', - 'time_point' => 'getTimePoint', 'operator' => 'getOperator', - 'upper_bound_endpoint_behavior' => 'getUpperBoundEndpointBehavior', - 'upper_bound_time_point' => 'getUpperBoundTimePoint', + 'property_parser' => 'getPropertyParser', + 'time_point' => 'getTimePoint', 'lower_bound_endpoint_behavior' => 'getLowerBoundEndpointBehavior', - 'lower_bound_time_point' => 'getLowerBoundTimePoint' + 'lower_bound_time_point' => 'getLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'getUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'getUpperBoundTimePoint' ]; /** @@ -371,27 +372,30 @@ public function getModelName() public function __construct(?array $data = null) { $this->setIfExists('max_occurrences', $data ?? [], null); - $this->setIfExists('type', $data ?? [], null); $this->setIfExists('min_occurrences', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); $this->setIfExists('set_type', $data ?? [], null); $this->setIfExists('comparison', $data ?? [], null); $this->setIfExists('time_offset', $data ?? [], null); - $this->setIfExists('upper_bound_offset', $data ?? [], null); - $this->setIfExists('range_type', $data ?? [], null); $this->setIfExists('lower_bound_offset', $data ?? [], null); + $this->setIfExists('range_type', $data ?? [], null); + $this->setIfExists('upper_bound_offset', $data ?? [], null); $this->setIfExists('timestamp', $data ?? [], null); - $this->setIfExists('upper_timestamp', $data ?? [], null); $this->setIfExists('lower_timestamp', $data ?? [], null); + $this->setIfExists('upper_timestamp', $data ?? [], null); $this->setIfExists('endpoint_behavior', $data ?? [], null); $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); - $this->setIfExists('property_parser', $data ?? [], null); $this->setIfExists('operation_type', $data ?? [], null); - $this->setIfExists('time_point', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); - $this->setIfExists('upper_bound_endpoint_behavior', $data ?? [], null); - $this->setIfExists('upper_bound_time_point', $data ?? [], null); + $this->setIfExists('property_parser', $data ?? [], null); + $this->setIfExists('time_point', $data ?? [], null); $this->setIfExists('lower_bound_endpoint_behavior', $data ?? [], null); $this->setIfExists('lower_bound_time_point', $data ?? [], null); + $this->setIfExists('upper_bound_endpoint_behavior', $data ?? [], null); + $this->setIfExists('upper_bound_time_point', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; } /** @@ -433,42 +437,42 @@ public function listInvalidProperties() if ($this->container['time_offset'] === null) { $invalidProperties[] = "'time_offset' can't be null"; } - if ($this->container['upper_bound_offset'] === null) { - $invalidProperties[] = "'upper_bound_offset' can't be null"; + if ($this->container['lower_bound_offset'] === null) { + $invalidProperties[] = "'lower_bound_offset' can't be null"; } if ($this->container['range_type'] === null) { $invalidProperties[] = "'range_type' can't be null"; } - if ($this->container['lower_bound_offset'] === null) { - $invalidProperties[] = "'lower_bound_offset' can't be null"; + if ($this->container['upper_bound_offset'] === null) { + $invalidProperties[] = "'upper_bound_offset' can't be null"; } if ($this->container['timestamp'] === null) { $invalidProperties[] = "'timestamp' can't be null"; } - if ($this->container['upper_timestamp'] === null) { - $invalidProperties[] = "'upper_timestamp' can't be null"; - } if ($this->container['lower_timestamp'] === null) { $invalidProperties[] = "'lower_timestamp' can't be null"; } + if ($this->container['upper_timestamp'] === null) { + $invalidProperties[] = "'upper_timestamp' can't be null"; + } if ($this->container['include_objects_with_no_value_set'] === null) { $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; } if ($this->container['operation_type'] === null) { $invalidProperties[] = "'operation_type' can't be null"; } - if ($this->container['time_point'] === null) { - $invalidProperties[] = "'time_point' can't be null"; - } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } - if ($this->container['upper_bound_time_point'] === null) { - $invalidProperties[] = "'upper_bound_time_point' can't be null"; + if ($this->container['time_point'] === null) { + $invalidProperties[] = "'time_point' can't be null"; } if ($this->container['lower_bound_time_point'] === null) { $invalidProperties[] = "'lower_bound_time_point' can't be null"; } + if ($this->container['upper_bound_time_point'] === null) { + $invalidProperties[] = "'upper_bound_time_point' can't be null"; + } return $invalidProperties; } @@ -497,7 +501,7 @@ public function getMaxOccurrences() /** * Sets max_occurrences * - * @param int|null $max_occurrences max_occurrences + * @param int|null $max_occurrences The maximum number of occurrences allowed. * * @return self */ @@ -512,55 +516,55 @@ public function setMaxOccurrences($max_occurrences) } /** - * Gets type + * Gets min_occurrences * - * @return string + * @return int|null */ - public function getType() + public function getMinOccurrences() { - return $this->container['type']; + return $this->container['min_occurrences']; } /** - * Sets type + * Sets min_occurrences * - * @param string $type type + * @param int|null $min_occurrences The minimum number of occurrences required. * * @return self */ - public function setType($type) + public function setMinOccurrences($min_occurrences) { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + if (is_null($min_occurrences)) { + throw new \InvalidArgumentException('non-nullable min_occurrences cannot be null'); } - $this->container['type'] = $type; + $this->container['min_occurrences'] = $min_occurrences; return $this; } /** - * Gets min_occurrences + * Gets type * - * @return int|null + * @return string */ - public function getMinOccurrences() + public function getType() { - return $this->container['min_occurrences']; + return $this->container['type']; } /** - * Sets min_occurrences + * Sets type * - * @param int|null $min_occurrences min_occurrences + * @param string $type Defines the type of operation being performed. * * @return self */ - public function setMinOccurrences($min_occurrences) + public function setType($type) { - if (is_null($min_occurrences)) { - throw new \InvalidArgumentException('non-nullable min_occurrences cannot be null'); + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); } - $this->container['min_occurrences'] = $min_occurrences; + $this->container['type'] = $type; return $this; } @@ -578,7 +582,7 @@ public function getSetType() /** * Sets set_type * - * @param string $set_type set_type + * @param string $set_type Indicates the specific set type used in the refinement (ALL, ALL_INCLUDE_EMPTY, ANY, NONE, NONE_EXCLUDE_EMPTY, ANY_INCLUDE_EMPTY). * * @return self */ @@ -605,7 +609,7 @@ public function getComparison() /** * Sets comparison * - * @param string $comparison comparison + * @param string $comparison Timestamp comparison options (BEFORE, AFTER) * * @return self */ @@ -647,28 +651,28 @@ public function setTimeOffset($time_offset) } /** - * Gets upper_bound_offset + * Gets lower_bound_offset * * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset */ - public function getUpperBoundOffset() + public function getLowerBoundOffset() { - return $this->container['upper_bound_offset']; + return $this->container['lower_bound_offset']; } /** - * Sets upper_bound_offset + * Sets lower_bound_offset * - * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $upper_bound_offset upper_bound_offset + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $lower_bound_offset lower_bound_offset * * @return self */ - public function setUpperBoundOffset($upper_bound_offset) + public function setLowerBoundOffset($lower_bound_offset) { - if (is_null($upper_bound_offset)) { - throw new \InvalidArgumentException('non-nullable upper_bound_offset cannot be null'); + if (is_null($lower_bound_offset)) { + throw new \InvalidArgumentException('non-nullable lower_bound_offset cannot be null'); } - $this->container['upper_bound_offset'] = $upper_bound_offset; + $this->container['lower_bound_offset'] = $lower_bound_offset; return $this; } @@ -686,7 +690,7 @@ public function getRangeType() /** * Sets range_type * - * @param string $range_type range_type + * @param string $range_type Type of range of refinement critaria (BETWEEN, NOT_BETWEEN) * * @return self */ @@ -701,28 +705,28 @@ public function setRangeType($range_type) } /** - * Gets lower_bound_offset + * Gets upper_bound_offset * * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset */ - public function getLowerBoundOffset() + public function getUpperBoundOffset() { - return $this->container['lower_bound_offset']; + return $this->container['upper_bound_offset']; } /** - * Sets lower_bound_offset + * Sets upper_bound_offset * - * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $lower_bound_offset lower_bound_offset + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $upper_bound_offset upper_bound_offset * * @return self */ - public function setLowerBoundOffset($lower_bound_offset) + public function setUpperBoundOffset($upper_bound_offset) { - if (is_null($lower_bound_offset)) { - throw new \InvalidArgumentException('non-nullable lower_bound_offset cannot be null'); + if (is_null($upper_bound_offset)) { + throw new \InvalidArgumentException('non-nullable upper_bound_offset cannot be null'); } - $this->container['lower_bound_offset'] = $lower_bound_offset; + $this->container['upper_bound_offset'] = $upper_bound_offset; return $this; } @@ -740,7 +744,7 @@ public function getTimestamp() /** * Sets timestamp * - * @param int $timestamp timestamp + * @param int $timestamp Timestamp to be used in refine by criteria * * @return self */ @@ -755,55 +759,55 @@ public function setTimestamp($timestamp) } /** - * Gets upper_timestamp + * Gets lower_timestamp * * @return int */ - public function getUpperTimestamp() + public function getLowerTimestamp() { - return $this->container['upper_timestamp']; + return $this->container['lower_timestamp']; } /** - * Sets upper_timestamp + * Sets lower_timestamp * - * @param int $upper_timestamp upper_timestamp + * @param int $lower_timestamp Lower range timestamp of refinement criteria * * @return self */ - public function setUpperTimestamp($upper_timestamp) + public function setLowerTimestamp($lower_timestamp) { - if (is_null($upper_timestamp)) { - throw new \InvalidArgumentException('non-nullable upper_timestamp cannot be null'); + if (is_null($lower_timestamp)) { + throw new \InvalidArgumentException('non-nullable lower_timestamp cannot be null'); } - $this->container['upper_timestamp'] = $upper_timestamp; + $this->container['lower_timestamp'] = $lower_timestamp; return $this; } /** - * Gets lower_timestamp + * Gets upper_timestamp * * @return int */ - public function getLowerTimestamp() + public function getUpperTimestamp() { - return $this->container['lower_timestamp']; + return $this->container['upper_timestamp']; } /** - * Sets lower_timestamp + * Sets upper_timestamp * - * @param int $lower_timestamp lower_timestamp + * @param int $upper_timestamp Upper range timestamp of refinement criteria * * @return self */ - public function setLowerTimestamp($lower_timestamp) + public function setUpperTimestamp($upper_timestamp) { - if (is_null($lower_timestamp)) { - throw new \InvalidArgumentException('non-nullable lower_timestamp cannot be null'); + if (is_null($upper_timestamp)) { + throw new \InvalidArgumentException('non-nullable upper_timestamp cannot be null'); } - $this->container['lower_timestamp'] = $lower_timestamp; + $this->container['upper_timestamp'] = $upper_timestamp; return $this; } @@ -821,7 +825,7 @@ public function getEndpointBehavior() /** * Sets endpoint_behavior * - * @param string|null $endpoint_behavior endpoint_behavior + * @param string|null $endpoint_behavior Describes the behavior at the endpoint of the time point operation. * * @return self */ @@ -848,7 +852,7 @@ public function getIncludeObjectsWithNoValueSet() /** * Sets include_objects_with_no_value_set * - * @param bool $include_objects_with_no_value_set include_objects_with_no_value_set + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. * * @return self */ @@ -862,33 +866,6 @@ public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_s return $this; } - /** - * Gets property_parser - * - * @return string|null - */ - public function getPropertyParser() - { - return $this->container['property_parser']; - } - - /** - * Sets property_parser - * - * @param string|null $property_parser property_parser - * - * @return self - */ - public function setPropertyParser($property_parser) - { - if (is_null($property_parser)) { - throw new \InvalidArgumentException('non-nullable property_parser cannot be null'); - } - $this->container['property_parser'] = $property_parser; - - return $this; - } - /** * Gets operation_type * @@ -902,7 +879,7 @@ public function getOperationType() /** * Sets operation_type * - * @param string $operation_type operation_type + * @param string $operation_type Specifies the type of operation (TIME_RANGED). * * @return self */ @@ -916,33 +893,6 @@ public function setOperationType($operation_type) return $this; } - /** - * Gets time_point - * - * @return \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint - */ - public function getTimePoint() - { - return $this->container['time_point']; - } - - /** - * Sets time_point - * - * @param \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint $time_point time_point - * - * @return self - */ - public function setTimePoint($time_point) - { - if (is_null($time_point)) { - throw new \InvalidArgumentException('non-nullable time_point cannot be null'); - } - $this->container['time_point'] = $time_point; - - return $this; - } - /** * Gets operator * @@ -956,7 +906,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Defines the operation to be applied within the time range (IS_BETWEEN, IS_NOT_BETWEEN). * * @return self */ @@ -971,55 +921,55 @@ public function setOperator($operator) } /** - * Gets upper_bound_endpoint_behavior + * Gets property_parser * * @return string|null */ - public function getUpperBoundEndpointBehavior() + public function getPropertyParser() { - return $this->container['upper_bound_endpoint_behavior']; + return $this->container['property_parser']; } /** - * Sets upper_bound_endpoint_behavior + * Sets property_parser * - * @param string|null $upper_bound_endpoint_behavior upper_bound_endpoint_behavior + * @param string|null $property_parser Specifies the parser used for the property in the operation. * * @return self */ - public function setUpperBoundEndpointBehavior($upper_bound_endpoint_behavior) + public function setPropertyParser($property_parser) { - if (is_null($upper_bound_endpoint_behavior)) { - throw new \InvalidArgumentException('non-nullable upper_bound_endpoint_behavior cannot be null'); + if (is_null($property_parser)) { + throw new \InvalidArgumentException('non-nullable property_parser cannot be null'); } - $this->container['upper_bound_endpoint_behavior'] = $upper_bound_endpoint_behavior; + $this->container['property_parser'] = $property_parser; return $this; } /** - * Gets upper_bound_time_point + * Gets time_point * * @return \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint */ - public function getUpperBoundTimePoint() + public function getTimePoint() { - return $this->container['upper_bound_time_point']; + return $this->container['time_point']; } /** - * Sets upper_bound_time_point + * Sets time_point * - * @param \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint $upper_bound_time_point upper_bound_time_point + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint $time_point time_point * * @return self */ - public function setUpperBoundTimePoint($upper_bound_time_point) + public function setTimePoint($time_point) { - if (is_null($upper_bound_time_point)) { - throw new \InvalidArgumentException('non-nullable upper_bound_time_point cannot be null'); + if (is_null($time_point)) { + throw new \InvalidArgumentException('non-nullable time_point cannot be null'); } - $this->container['upper_bound_time_point'] = $upper_bound_time_point; + $this->container['time_point'] = $time_point; return $this; } @@ -1037,7 +987,7 @@ public function getLowerBoundEndpointBehavior() /** * Sets lower_bound_endpoint_behavior * - * @param string|null $lower_bound_endpoint_behavior lower_bound_endpoint_behavior + * @param string|null $lower_bound_endpoint_behavior Describes the behavior at the lower bound endpoint of the time range. * * @return self */ @@ -1054,7 +1004,7 @@ public function setLowerBoundEndpointBehavior($lower_bound_endpoint_behavior) /** * Gets lower_bound_time_point * - * @return \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint */ public function getLowerBoundTimePoint() { @@ -1064,7 +1014,7 @@ public function getLowerBoundTimePoint() /** * Sets lower_bound_time_point * - * @param \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint $lower_bound_time_point lower_bound_time_point + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint $lower_bound_time_point lower_bound_time_point * * @return self */ @@ -1077,14 +1027,68 @@ public function setLowerBoundTimePoint($lower_bound_time_point) return $this; } + + /** + * Gets upper_bound_endpoint_behavior + * + * @return string|null + */ + public function getUpperBoundEndpointBehavior() + { + return $this->container['upper_bound_endpoint_behavior']; + } + + /** + * Sets upper_bound_endpoint_behavior + * + * @param string|null $upper_bound_endpoint_behavior Describes the behavior at the upper bound endpoint of the time range. + * + * @return self + */ + public function setUpperBoundEndpointBehavior($upper_bound_endpoint_behavior) + { + if (is_null($upper_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable upper_bound_endpoint_behavior cannot be null'); + } + $this->container['upper_bound_endpoint_behavior'] = $upper_bound_endpoint_behavior; + + return $this; + } + + /** + * Gets upper_bound_time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint + */ + public function getUpperBoundTimePoint() + { + return $this->container['upper_bound_time_point']; + } + + /** + * Sets upper_bound_time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint $upper_bound_time_point upper_bound_time_point + * + * @return self + */ + public function setUpperBoundTimePoint($upper_bound_time_point) + { + if (is_null($upper_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable upper_bound_time_point cannot be null'); + } + $this->container['upper_bound_time_point'] = $upper_bound_time_point; + + 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]); } @@ -1092,12 +1096,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; } @@ -1122,11 +1126,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/Lists/Model/PublicFormSubmissionFilterPruningRefineBy.php b/codegen/Crm/Lists/Model/PublicFormSubmissionFilterPruningRefineBy.php new file mode 100644 index 000000000..05be03340 --- /dev/null +++ b/codegen/Crm/Lists/Model/PublicFormSubmissionFilterPruningRefineBy.php @@ -0,0 +1,1175 @@ + + */ +class PublicFormSubmissionFilterPruningRefineBy implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicFormSubmissionFilter_pruningRefineBy'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'max_occurrences' => 'int', + 'min_occurrences' => 'int', + 'type' => 'string', + 'set_type' => 'string', + 'comparison' => 'string', + 'time_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', + 'lower_bound_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', + 'range_type' => 'string', + 'upper_bound_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', + 'timestamp' => 'int', + 'lower_timestamp' => 'int', + 'upper_timestamp' => 'int', + 'endpoint_behavior' => 'string', + 'include_objects_with_no_value_set' => 'bool', + 'operation_type' => 'string', + 'operator' => 'string', + 'property_parser' => 'string', + 'time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint', + 'lower_bound_endpoint_behavior' => 'string', + 'lower_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'string', + 'upper_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'max_occurrences' => 'int32', + 'min_occurrences' => 'int32', + 'type' => null, + 'set_type' => null, + 'comparison' => null, + 'time_offset' => null, + 'lower_bound_offset' => null, + 'range_type' => null, + 'upper_bound_offset' => null, + 'timestamp' => 'int64', + 'lower_timestamp' => 'int64', + 'upper_timestamp' => 'int64', + 'endpoint_behavior' => null, + 'include_objects_with_no_value_set' => null, + 'operation_type' => null, + 'operator' => null, + 'property_parser' => null, + 'time_point' => null, + 'lower_bound_endpoint_behavior' => null, + 'lower_bound_time_point' => null, + 'upper_bound_endpoint_behavior' => null, + 'upper_bound_time_point' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'max_occurrences' => false, + 'min_occurrences' => false, + 'type' => false, + 'set_type' => false, + 'comparison' => false, + 'time_offset' => false, + 'lower_bound_offset' => false, + 'range_type' => false, + 'upper_bound_offset' => false, + 'timestamp' => false, + 'lower_timestamp' => false, + 'upper_timestamp' => false, + 'endpoint_behavior' => false, + 'include_objects_with_no_value_set' => false, + 'operation_type' => false, + 'operator' => false, + 'property_parser' => false, + 'time_point' => false, + 'lower_bound_endpoint_behavior' => false, + 'lower_bound_time_point' => false, + 'upper_bound_endpoint_behavior' => false, + 'upper_bound_time_point' => 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 = [ + 'max_occurrences' => 'maxOccurrences', + 'min_occurrences' => 'minOccurrences', + 'type' => 'type', + 'set_type' => 'setType', + 'comparison' => 'comparison', + 'time_offset' => 'timeOffset', + 'lower_bound_offset' => 'lowerBoundOffset', + 'range_type' => 'rangeType', + 'upper_bound_offset' => 'upperBoundOffset', + 'timestamp' => 'timestamp', + 'lower_timestamp' => 'lowerTimestamp', + 'upper_timestamp' => 'upperTimestamp', + 'endpoint_behavior' => 'endpointBehavior', + 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', + 'operation_type' => 'operationType', + 'operator' => 'operator', + 'property_parser' => 'propertyParser', + 'time_point' => 'timePoint', + 'lower_bound_endpoint_behavior' => 'lowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'lowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'upperBoundEndpointBehavior', + 'upper_bound_time_point' => 'upperBoundTimePoint' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'max_occurrences' => 'setMaxOccurrences', + 'min_occurrences' => 'setMinOccurrences', + 'type' => 'setType', + 'set_type' => 'setSetType', + 'comparison' => 'setComparison', + 'time_offset' => 'setTimeOffset', + 'lower_bound_offset' => 'setLowerBoundOffset', + 'range_type' => 'setRangeType', + 'upper_bound_offset' => 'setUpperBoundOffset', + 'timestamp' => 'setTimestamp', + 'lower_timestamp' => 'setLowerTimestamp', + 'upper_timestamp' => 'setUpperTimestamp', + 'endpoint_behavior' => 'setEndpointBehavior', + 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', + 'operation_type' => 'setOperationType', + 'operator' => 'setOperator', + 'property_parser' => 'setPropertyParser', + 'time_point' => 'setTimePoint', + 'lower_bound_endpoint_behavior' => 'setLowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'setLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'setUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'setUpperBoundTimePoint' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'max_occurrences' => 'getMaxOccurrences', + 'min_occurrences' => 'getMinOccurrences', + 'type' => 'getType', + 'set_type' => 'getSetType', + 'comparison' => 'getComparison', + 'time_offset' => 'getTimeOffset', + 'lower_bound_offset' => 'getLowerBoundOffset', + 'range_type' => 'getRangeType', + 'upper_bound_offset' => 'getUpperBoundOffset', + 'timestamp' => 'getTimestamp', + 'lower_timestamp' => 'getLowerTimestamp', + 'upper_timestamp' => 'getUpperTimestamp', + 'endpoint_behavior' => 'getEndpointBehavior', + 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', + 'operation_type' => 'getOperationType', + 'operator' => 'getOperator', + 'property_parser' => 'getPropertyParser', + 'time_point' => 'getTimePoint', + 'lower_bound_endpoint_behavior' => 'getLowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'getLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'getUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'getUpperBoundTimePoint' + ]; + + /** + * 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('max_occurrences', $data ?? [], null); + $this->setIfExists('min_occurrences', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('set_type', $data ?? [], null); + $this->setIfExists('comparison', $data ?? [], null); + $this->setIfExists('time_offset', $data ?? [], null); + $this->setIfExists('lower_bound_offset', $data ?? [], null); + $this->setIfExists('range_type', $data ?? [], null); + $this->setIfExists('upper_bound_offset', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('lower_timestamp', $data ?? [], null); + $this->setIfExists('upper_timestamp', $data ?? [], null); + $this->setIfExists('endpoint_behavior', $data ?? [], null); + $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); + $this->setIfExists('operation_type', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('property_parser', $data ?? [], null); + $this->setIfExists('time_point', $data ?? [], null); + $this->setIfExists('lower_bound_endpoint_behavior', $data ?? [], null); + $this->setIfExists('lower_bound_time_point', $data ?? [], null); + $this->setIfExists('upper_bound_endpoint_behavior', $data ?? [], null); + $this->setIfExists('upper_bound_time_point', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * 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['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['set_type'] === null) { + $invalidProperties[] = "'set_type' can't be null"; + } + if ($this->container['comparison'] === null) { + $invalidProperties[] = "'comparison' can't be null"; + } + if ($this->container['time_offset'] === null) { + $invalidProperties[] = "'time_offset' can't be null"; + } + if ($this->container['lower_bound_offset'] === null) { + $invalidProperties[] = "'lower_bound_offset' can't be null"; + } + if ($this->container['range_type'] === null) { + $invalidProperties[] = "'range_type' can't be null"; + } + if ($this->container['upper_bound_offset'] === null) { + $invalidProperties[] = "'upper_bound_offset' can't be null"; + } + if ($this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } + if ($this->container['lower_timestamp'] === null) { + $invalidProperties[] = "'lower_timestamp' can't be null"; + } + if ($this->container['upper_timestamp'] === null) { + $invalidProperties[] = "'upper_timestamp' can't be null"; + } + if ($this->container['include_objects_with_no_value_set'] === null) { + $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; + } + if ($this->container['operation_type'] === null) { + $invalidProperties[] = "'operation_type' can't be null"; + } + if ($this->container['operator'] === null) { + $invalidProperties[] = "'operator' can't be null"; + } + if ($this->container['time_point'] === null) { + $invalidProperties[] = "'time_point' can't be null"; + } + if ($this->container['lower_bound_time_point'] === null) { + $invalidProperties[] = "'lower_bound_time_point' can't be null"; + } + if ($this->container['upper_bound_time_point'] === null) { + $invalidProperties[] = "'upper_bound_time_point' 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 max_occurrences + * + * @return int|null + */ + public function getMaxOccurrences() + { + return $this->container['max_occurrences']; + } + + /** + * Sets max_occurrences + * + * @param int|null $max_occurrences The maximum number of occurrences allowed. + * + * @return self + */ + public function setMaxOccurrences($max_occurrences) + { + if (is_null($max_occurrences)) { + throw new \InvalidArgumentException('non-nullable max_occurrences cannot be null'); + } + $this->container['max_occurrences'] = $max_occurrences; + + return $this; + } + + /** + * Gets min_occurrences + * + * @return int|null + */ + public function getMinOccurrences() + { + return $this->container['min_occurrences']; + } + + /** + * Sets min_occurrences + * + * @param int|null $min_occurrences The minimum number of occurrences required. + * + * @return self + */ + public function setMinOccurrences($min_occurrences) + { + if (is_null($min_occurrences)) { + throw new \InvalidArgumentException('non-nullable min_occurrences cannot be null'); + } + $this->container['min_occurrences'] = $min_occurrences; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Defines the type of operation being performed. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets set_type + * + * @return string + */ + public function getSetType() + { + return $this->container['set_type']; + } + + /** + * Sets set_type + * + * @param string $set_type Indicates the specific set type used in the refinement (ALL, ALL_INCLUDE_EMPTY, ANY, NONE, NONE_EXCLUDE_EMPTY, ANY_INCLUDE_EMPTY). + * + * @return self + */ + public function setSetType($set_type) + { + if (is_null($set_type)) { + throw new \InvalidArgumentException('non-nullable set_type cannot be null'); + } + $this->container['set_type'] = $set_type; + + return $this; + } + + /** + * Gets comparison + * + * @return string + */ + public function getComparison() + { + return $this->container['comparison']; + } + + /** + * Sets comparison + * + * @param string $comparison Timestamp comparison options (BEFORE, AFTER) + * + * @return self + */ + public function setComparison($comparison) + { + if (is_null($comparison)) { + throw new \InvalidArgumentException('non-nullable comparison cannot be null'); + } + $this->container['comparison'] = $comparison; + + return $this; + } + + /** + * Gets time_offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset + */ + public function getTimeOffset() + { + return $this->container['time_offset']; + } + + /** + * Sets time_offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $time_offset time_offset + * + * @return self + */ + public function setTimeOffset($time_offset) + { + if (is_null($time_offset)) { + throw new \InvalidArgumentException('non-nullable time_offset cannot be null'); + } + $this->container['time_offset'] = $time_offset; + + return $this; + } + + /** + * Gets lower_bound_offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset + */ + public function getLowerBoundOffset() + { + return $this->container['lower_bound_offset']; + } + + /** + * Sets lower_bound_offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $lower_bound_offset lower_bound_offset + * + * @return self + */ + public function setLowerBoundOffset($lower_bound_offset) + { + if (is_null($lower_bound_offset)) { + throw new \InvalidArgumentException('non-nullable lower_bound_offset cannot be null'); + } + $this->container['lower_bound_offset'] = $lower_bound_offset; + + return $this; + } + + /** + * Gets range_type + * + * @return string + */ + public function getRangeType() + { + return $this->container['range_type']; + } + + /** + * Sets range_type + * + * @param string $range_type Type of range of refinement critaria (BETWEEN, NOT_BETWEEN) + * + * @return self + */ + public function setRangeType($range_type) + { + if (is_null($range_type)) { + throw new \InvalidArgumentException('non-nullable range_type cannot be null'); + } + $this->container['range_type'] = $range_type; + + return $this; + } + + /** + * Gets upper_bound_offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset + */ + public function getUpperBoundOffset() + { + return $this->container['upper_bound_offset']; + } + + /** + * Sets upper_bound_offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $upper_bound_offset upper_bound_offset + * + * @return self + */ + public function setUpperBoundOffset($upper_bound_offset) + { + if (is_null($upper_bound_offset)) { + throw new \InvalidArgumentException('non-nullable upper_bound_offset cannot be null'); + } + $this->container['upper_bound_offset'] = $upper_bound_offset; + + return $this; + } + + /** + * Gets timestamp + * + * @return int + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param int $timestamp Timestamp to be used in refine by criteria + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets lower_timestamp + * + * @return int + */ + public function getLowerTimestamp() + { + return $this->container['lower_timestamp']; + } + + /** + * Sets lower_timestamp + * + * @param int $lower_timestamp Lower range timestamp of refinement criteria + * + * @return self + */ + public function setLowerTimestamp($lower_timestamp) + { + if (is_null($lower_timestamp)) { + throw new \InvalidArgumentException('non-nullable lower_timestamp cannot be null'); + } + $this->container['lower_timestamp'] = $lower_timestamp; + + return $this; + } + + /** + * Gets upper_timestamp + * + * @return int + */ + public function getUpperTimestamp() + { + return $this->container['upper_timestamp']; + } + + /** + * Sets upper_timestamp + * + * @param int $upper_timestamp Upper range timestamp of refinement criteria + * + * @return self + */ + public function setUpperTimestamp($upper_timestamp) + { + if (is_null($upper_timestamp)) { + throw new \InvalidArgumentException('non-nullable upper_timestamp cannot be null'); + } + $this->container['upper_timestamp'] = $upper_timestamp; + + return $this; + } + + /** + * Gets endpoint_behavior + * + * @return string|null + */ + public function getEndpointBehavior() + { + return $this->container['endpoint_behavior']; + } + + /** + * Sets endpoint_behavior + * + * @param string|null $endpoint_behavior Describes the behavior at the endpoint of the time point operation. + * + * @return self + */ + public function setEndpointBehavior($endpoint_behavior) + { + if (is_null($endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable endpoint_behavior cannot be null'); + } + $this->container['endpoint_behavior'] = $endpoint_behavior; + + return $this; + } + + /** + * Gets include_objects_with_no_value_set + * + * @return bool + */ + public function getIncludeObjectsWithNoValueSet() + { + return $this->container['include_objects_with_no_value_set']; + } + + /** + * Sets include_objects_with_no_value_set + * + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. + * + * @return self + */ + public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_set) + { + if (is_null($include_objects_with_no_value_set)) { + throw new \InvalidArgumentException('non-nullable include_objects_with_no_value_set cannot be null'); + } + $this->container['include_objects_with_no_value_set'] = $include_objects_with_no_value_set; + + return $this; + } + + /** + * Gets operation_type + * + * @return string + */ + public function getOperationType() + { + return $this->container['operation_type']; + } + + /** + * Sets operation_type + * + * @param string $operation_type Specifies the type of operation (TIME_RANGED). + * + * @return self + */ + public function setOperationType($operation_type) + { + if (is_null($operation_type)) { + throw new \InvalidArgumentException('non-nullable operation_type cannot be null'); + } + $this->container['operation_type'] = $operation_type; + + return $this; + } + + /** + * Gets operator + * + * @return string + */ + public function getOperator() + { + return $this->container['operator']; + } + + /** + * Sets operator + * + * @param string $operator Defines the operation to be applied within the time range (IS_BETWEEN, IS_NOT_BETWEEN). + * + * @return self + */ + public function setOperator($operator) + { + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); + } + $this->container['operator'] = $operator; + + return $this; + } + + /** + * Gets property_parser + * + * @return string|null + */ + public function getPropertyParser() + { + return $this->container['property_parser']; + } + + /** + * Sets property_parser + * + * @param string|null $property_parser Specifies the parser used for the property in the operation. + * + * @return self + */ + public function setPropertyParser($property_parser) + { + if (is_null($property_parser)) { + throw new \InvalidArgumentException('non-nullable property_parser cannot be null'); + } + $this->container['property_parser'] = $property_parser; + + return $this; + } + + /** + * Gets time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint + */ + public function getTimePoint() + { + return $this->container['time_point']; + } + + /** + * Sets time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint $time_point time_point + * + * @return self + */ + public function setTimePoint($time_point) + { + if (is_null($time_point)) { + throw new \InvalidArgumentException('non-nullable time_point cannot be null'); + } + $this->container['time_point'] = $time_point; + + return $this; + } + + /** + * Gets lower_bound_endpoint_behavior + * + * @return string|null + */ + public function getLowerBoundEndpointBehavior() + { + return $this->container['lower_bound_endpoint_behavior']; + } + + /** + * Sets lower_bound_endpoint_behavior + * + * @param string|null $lower_bound_endpoint_behavior Describes the behavior at the lower bound endpoint of the time range. + * + * @return self + */ + public function setLowerBoundEndpointBehavior($lower_bound_endpoint_behavior) + { + if (is_null($lower_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable lower_bound_endpoint_behavior cannot be null'); + } + $this->container['lower_bound_endpoint_behavior'] = $lower_bound_endpoint_behavior; + + return $this; + } + + /** + * Gets lower_bound_time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint + */ + public function getLowerBoundTimePoint() + { + return $this->container['lower_bound_time_point']; + } + + /** + * Sets lower_bound_time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint $lower_bound_time_point lower_bound_time_point + * + * @return self + */ + public function setLowerBoundTimePoint($lower_bound_time_point) + { + if (is_null($lower_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable lower_bound_time_point cannot be null'); + } + $this->container['lower_bound_time_point'] = $lower_bound_time_point; + + return $this; + } + + /** + * Gets upper_bound_endpoint_behavior + * + * @return string|null + */ + public function getUpperBoundEndpointBehavior() + { + return $this->container['upper_bound_endpoint_behavior']; + } + + /** + * Sets upper_bound_endpoint_behavior + * + * @param string|null $upper_bound_endpoint_behavior Describes the behavior at the upper bound endpoint of the time range. + * + * @return self + */ + public function setUpperBoundEndpointBehavior($upper_bound_endpoint_behavior) + { + if (is_null($upper_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable upper_bound_endpoint_behavior cannot be null'); + } + $this->container['upper_bound_endpoint_behavior'] = $upper_bound_endpoint_behavior; + + return $this; + } + + /** + * Gets upper_bound_time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint + */ + public function getUpperBoundTimePoint() + { + return $this->container['upper_bound_time_point']; + } + + /** + * Sets upper_bound_time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint $upper_bound_time_point upper_bound_time_point + * + * @return self + */ + public function setUpperBoundTimePoint($upper_bound_time_point) + { + if (is_null($upper_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable upper_bound_time_point cannot be null'); + } + $this->container['upper_bound_time_point'] = $upper_bound_time_point; + + 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/Lists/Model/PublicFormSubmissionOnPageFilter.php b/codegen/Crm/Lists/Model/PublicFormSubmissionOnPageFilter.php index d5808701d..9f5dc2861 100644 --- a/codegen/Crm/Lists/Model/PublicFormSubmissionOnPageFilter.php +++ b/codegen/Crm/Lists/Model/PublicFormSubmissionOnPageFilter.php @@ -2,7 +2,7 @@ /** * PublicFormSubmissionOnPageFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,12 +57,12 @@ class PublicFormSubmissionOnPageFilter implements ModelInterface, ArrayAccess, \ * @var string[] */ protected static $openAPITypes = [ - 'form_id' => 'string', - 'coalescing_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', - 'pruning_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', + 'coalescing_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionOnPageFilterCoalescingRefineBy', 'filter_type' => 'string', + 'form_id' => 'string', + 'operator' => 'string', 'page_id' => 'string', - 'operator' => 'string' + 'pruning_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy' ]; /** @@ -73,12 +73,12 @@ class PublicFormSubmissionOnPageFilter implements ModelInterface, ArrayAccess, \ * @psalm-var array */ protected static $openAPIFormats = [ - 'form_id' => null, 'coalescing_refine_by' => null, - 'pruning_refine_by' => null, 'filter_type' => null, + 'form_id' => null, + 'operator' => null, 'page_id' => null, - 'operator' => null + 'pruning_refine_by' => null ]; /** @@ -87,12 +87,12 @@ class PublicFormSubmissionOnPageFilter implements ModelInterface, ArrayAccess, \ * @var boolean[] */ protected static array $openAPINullables = [ - 'form_id' => false, 'coalescing_refine_by' => false, - 'pruning_refine_by' => false, 'filter_type' => false, + 'form_id' => false, + 'operator' => false, 'page_id' => false, - 'operator' => false + 'pruning_refine_by' => false ]; /** @@ -181,12 +181,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'form_id' => 'formId', 'coalescing_refine_by' => 'coalescingRefineBy', - 'pruning_refine_by' => 'pruningRefineBy', 'filter_type' => 'filterType', + 'form_id' => 'formId', + 'operator' => 'operator', 'page_id' => 'pageId', - 'operator' => 'operator' + 'pruning_refine_by' => 'pruningRefineBy' ]; /** @@ -195,12 +195,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'form_id' => 'setFormId', 'coalescing_refine_by' => 'setCoalescingRefineBy', - 'pruning_refine_by' => 'setPruningRefineBy', 'filter_type' => 'setFilterType', + 'form_id' => 'setFormId', + 'operator' => 'setOperator', 'page_id' => 'setPageId', - 'operator' => 'setOperator' + 'pruning_refine_by' => 'setPruningRefineBy' ]; /** @@ -209,12 +209,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'form_id' => 'getFormId', 'coalescing_refine_by' => 'getCoalescingRefineBy', - 'pruning_refine_by' => 'getPruningRefineBy', 'filter_type' => 'getFilterType', + 'form_id' => 'getFormId', + 'operator' => 'getOperator', 'page_id' => 'getPageId', - 'operator' => 'getOperator' + 'pruning_refine_by' => 'getPruningRefineBy' ]; /** @@ -302,12 +302,12 @@ public function getOperatorAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('form_id', $data ?? [], null); $this->setIfExists('coalescing_refine_by', $data ?? [], null); - $this->setIfExists('pruning_refine_by', $data ?? [], null); $this->setIfExists('filter_type', $data ?? [], 'FORM_SUBMISSION_ON_PAGE'); - $this->setIfExists('page_id', $data ?? [], null); + $this->setIfExists('form_id', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('page_id', $data ?? [], null); + $this->setIfExists('pruning_refine_by', $data ?? [], null); } /** @@ -349,9 +349,6 @@ public function listInvalidProperties() ); } - if ($this->container['page_id'] === null) { - $invalidProperties[] = "'page_id' can't be null"; - } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } @@ -364,6 +361,9 @@ public function listInvalidProperties() ); } + if ($this->container['page_id'] === null) { + $invalidProperties[] = "'page_id' can't be null"; + } return $invalidProperties; } @@ -380,119 +380,129 @@ public function valid() /** - * Gets form_id + * Gets coalescing_refine_by * - * @return string|null + * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionOnPageFilterCoalescingRefineBy|null */ - public function getFormId() + public function getCoalescingRefineBy() { - return $this->container['form_id']; + return $this->container['coalescing_refine_by']; } /** - * Sets form_id + * Sets coalescing_refine_by * - * @param string|null $form_id form_id + * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionOnPageFilterCoalescingRefineBy|null $coalescing_refine_by coalescing_refine_by * * @return self */ - public function setFormId($form_id) + public function setCoalescingRefineBy($coalescing_refine_by) { - if (is_null($form_id)) { - throw new \InvalidArgumentException('non-nullable form_id cannot be null'); + if (is_null($coalescing_refine_by)) { + throw new \InvalidArgumentException('non-nullable coalescing_refine_by cannot be null'); } - $this->container['form_id'] = $form_id; + $this->container['coalescing_refine_by'] = $coalescing_refine_by; return $this; } /** - * Gets coalescing_refine_by + * Gets filter_type * - * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null + * @return string */ - public function getCoalescingRefineBy() + public function getFilterType() { - return $this->container['coalescing_refine_by']; + return $this->container['filter_type']; } /** - * Sets coalescing_refine_by + * Sets filter_type * - * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null $coalescing_refine_by coalescing_refine_by + * @param string $filter_type Indicates the type of filter (FORM_SUBMISSION_ON_PAGE). * * @return self */ - public function setCoalescingRefineBy($coalescing_refine_by) + public function setFilterType($filter_type) { - if (is_null($coalescing_refine_by)) { - throw new \InvalidArgumentException('non-nullable coalescing_refine_by cannot be null'); + if (is_null($filter_type)) { + throw new \InvalidArgumentException('non-nullable filter_type cannot be null'); } - $this->container['coalescing_refine_by'] = $coalescing_refine_by; + $allowedValues = $this->getFilterTypeAllowableValues(); + if (!in_array($filter_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'filter_type', must be one of '%s'", + $filter_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['filter_type'] = $filter_type; return $this; } /** - * Gets pruning_refine_by + * Gets form_id * - * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null + * @return string|null */ - public function getPruningRefineBy() + public function getFormId() { - return $this->container['pruning_refine_by']; + return $this->container['form_id']; } /** - * Sets pruning_refine_by + * Sets form_id * - * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null $pruning_refine_by pruning_refine_by + * @param string|null $form_id The ID of the form associated with the submission filter. * * @return self */ - public function setPruningRefineBy($pruning_refine_by) + public function setFormId($form_id) { - if (is_null($pruning_refine_by)) { - throw new \InvalidArgumentException('non-nullable pruning_refine_by cannot be null'); + if (is_null($form_id)) { + throw new \InvalidArgumentException('non-nullable form_id cannot be null'); } - $this->container['pruning_refine_by'] = $pruning_refine_by; + $this->container['form_id'] = $form_id; return $this; } /** - * Gets filter_type + * Gets operator * * @return string */ - public function getFilterType() + public function getOperator() { - return $this->container['filter_type']; + return $this->container['operator']; } /** - * Sets filter_type + * Sets operator * - * @param string $filter_type filter_type + * @param string $operator Specifies the operation to be applied (FILLED_OUT, NOT_FILLED_OUT). * * @return self */ - public function setFilterType($filter_type) + public function setOperator($operator) { - if (is_null($filter_type)) { - throw new \InvalidArgumentException('non-nullable filter_type cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $allowedValues = $this->getFilterTypeAllowableValues(); - if (!in_array($filter_type, $allowedValues, true)) { + $allowedValues = $this->getOperatorAllowableValues(); + if (!in_array($operator, $allowedValues, true)) { throw new \InvalidArgumentException( sprintf( - "Invalid value '%s' for 'filter_type', must be one of '%s'", - $filter_type, + "Invalid value '%s' for 'operator', must be one of '%s'", + $operator, implode("', '", $allowedValues) ) ); } - $this->container['filter_type'] = $filter_type; + $this->container['operator'] = $operator; return $this; } @@ -510,7 +520,7 @@ public function getPageId() /** * Sets page_id * - * @param string $page_id page_id + * @param string $page_id The ID of the page where the form submission occurred. * * @return self */ @@ -525,49 +535,39 @@ public function setPageId($page_id) } /** - * Gets operator + * Gets pruning_refine_by * - * @return string + * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy|null */ - public function getOperator() + public function getPruningRefineBy() { - return $this->container['operator']; + return $this->container['pruning_refine_by']; } /** - * Sets operator + * Sets pruning_refine_by * - * @param string $operator operator + * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy|null $pruning_refine_by pruning_refine_by * * @return self */ - public function setOperator($operator) + public function setPruningRefineBy($pruning_refine_by) { - 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($pruning_refine_by)) { + throw new \InvalidArgumentException('non-nullable pruning_refine_by cannot be null'); } - $this->container['operator'] = $operator; + $this->container['pruning_refine_by'] = $pruning_refine_by; 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]); } @@ -575,12 +575,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; } @@ -605,11 +605,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/Lists/Model/PublicFormSubmissionOnPageFilterCoalescingRefineBy.php b/codegen/Crm/Lists/Model/PublicFormSubmissionOnPageFilterCoalescingRefineBy.php new file mode 100644 index 000000000..7de2427b6 --- /dev/null +++ b/codegen/Crm/Lists/Model/PublicFormSubmissionOnPageFilterCoalescingRefineBy.php @@ -0,0 +1,1175 @@ + + */ +class PublicFormSubmissionOnPageFilterCoalescingRefineBy implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicFormSubmissionOnPageFilter_coalescingRefineBy'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'max_occurrences' => 'int', + 'min_occurrences' => 'int', + 'type' => 'string', + 'set_type' => 'string', + 'comparison' => 'string', + 'time_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', + 'lower_bound_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', + 'range_type' => 'string', + 'upper_bound_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', + 'timestamp' => 'int', + 'lower_timestamp' => 'int', + 'upper_timestamp' => 'int', + 'endpoint_behavior' => 'string', + 'include_objects_with_no_value_set' => 'bool', + 'operation_type' => 'string', + 'operator' => 'string', + 'property_parser' => 'string', + 'time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint', + 'lower_bound_endpoint_behavior' => 'string', + 'lower_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'string', + 'upper_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'max_occurrences' => 'int32', + 'min_occurrences' => 'int32', + 'type' => null, + 'set_type' => null, + 'comparison' => null, + 'time_offset' => null, + 'lower_bound_offset' => null, + 'range_type' => null, + 'upper_bound_offset' => null, + 'timestamp' => 'int64', + 'lower_timestamp' => 'int64', + 'upper_timestamp' => 'int64', + 'endpoint_behavior' => null, + 'include_objects_with_no_value_set' => null, + 'operation_type' => null, + 'operator' => null, + 'property_parser' => null, + 'time_point' => null, + 'lower_bound_endpoint_behavior' => null, + 'lower_bound_time_point' => null, + 'upper_bound_endpoint_behavior' => null, + 'upper_bound_time_point' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'max_occurrences' => false, + 'min_occurrences' => false, + 'type' => false, + 'set_type' => false, + 'comparison' => false, + 'time_offset' => false, + 'lower_bound_offset' => false, + 'range_type' => false, + 'upper_bound_offset' => false, + 'timestamp' => false, + 'lower_timestamp' => false, + 'upper_timestamp' => false, + 'endpoint_behavior' => false, + 'include_objects_with_no_value_set' => false, + 'operation_type' => false, + 'operator' => false, + 'property_parser' => false, + 'time_point' => false, + 'lower_bound_endpoint_behavior' => false, + 'lower_bound_time_point' => false, + 'upper_bound_endpoint_behavior' => false, + 'upper_bound_time_point' => 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 = [ + 'max_occurrences' => 'maxOccurrences', + 'min_occurrences' => 'minOccurrences', + 'type' => 'type', + 'set_type' => 'setType', + 'comparison' => 'comparison', + 'time_offset' => 'timeOffset', + 'lower_bound_offset' => 'lowerBoundOffset', + 'range_type' => 'rangeType', + 'upper_bound_offset' => 'upperBoundOffset', + 'timestamp' => 'timestamp', + 'lower_timestamp' => 'lowerTimestamp', + 'upper_timestamp' => 'upperTimestamp', + 'endpoint_behavior' => 'endpointBehavior', + 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', + 'operation_type' => 'operationType', + 'operator' => 'operator', + 'property_parser' => 'propertyParser', + 'time_point' => 'timePoint', + 'lower_bound_endpoint_behavior' => 'lowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'lowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'upperBoundEndpointBehavior', + 'upper_bound_time_point' => 'upperBoundTimePoint' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'max_occurrences' => 'setMaxOccurrences', + 'min_occurrences' => 'setMinOccurrences', + 'type' => 'setType', + 'set_type' => 'setSetType', + 'comparison' => 'setComparison', + 'time_offset' => 'setTimeOffset', + 'lower_bound_offset' => 'setLowerBoundOffset', + 'range_type' => 'setRangeType', + 'upper_bound_offset' => 'setUpperBoundOffset', + 'timestamp' => 'setTimestamp', + 'lower_timestamp' => 'setLowerTimestamp', + 'upper_timestamp' => 'setUpperTimestamp', + 'endpoint_behavior' => 'setEndpointBehavior', + 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', + 'operation_type' => 'setOperationType', + 'operator' => 'setOperator', + 'property_parser' => 'setPropertyParser', + 'time_point' => 'setTimePoint', + 'lower_bound_endpoint_behavior' => 'setLowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'setLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'setUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'setUpperBoundTimePoint' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'max_occurrences' => 'getMaxOccurrences', + 'min_occurrences' => 'getMinOccurrences', + 'type' => 'getType', + 'set_type' => 'getSetType', + 'comparison' => 'getComparison', + 'time_offset' => 'getTimeOffset', + 'lower_bound_offset' => 'getLowerBoundOffset', + 'range_type' => 'getRangeType', + 'upper_bound_offset' => 'getUpperBoundOffset', + 'timestamp' => 'getTimestamp', + 'lower_timestamp' => 'getLowerTimestamp', + 'upper_timestamp' => 'getUpperTimestamp', + 'endpoint_behavior' => 'getEndpointBehavior', + 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', + 'operation_type' => 'getOperationType', + 'operator' => 'getOperator', + 'property_parser' => 'getPropertyParser', + 'time_point' => 'getTimePoint', + 'lower_bound_endpoint_behavior' => 'getLowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'getLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'getUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'getUpperBoundTimePoint' + ]; + + /** + * 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('max_occurrences', $data ?? [], null); + $this->setIfExists('min_occurrences', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('set_type', $data ?? [], null); + $this->setIfExists('comparison', $data ?? [], null); + $this->setIfExists('time_offset', $data ?? [], null); + $this->setIfExists('lower_bound_offset', $data ?? [], null); + $this->setIfExists('range_type', $data ?? [], null); + $this->setIfExists('upper_bound_offset', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('lower_timestamp', $data ?? [], null); + $this->setIfExists('upper_timestamp', $data ?? [], null); + $this->setIfExists('endpoint_behavior', $data ?? [], null); + $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); + $this->setIfExists('operation_type', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('property_parser', $data ?? [], null); + $this->setIfExists('time_point', $data ?? [], null); + $this->setIfExists('lower_bound_endpoint_behavior', $data ?? [], null); + $this->setIfExists('lower_bound_time_point', $data ?? [], null); + $this->setIfExists('upper_bound_endpoint_behavior', $data ?? [], null); + $this->setIfExists('upper_bound_time_point', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * 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['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['set_type'] === null) { + $invalidProperties[] = "'set_type' can't be null"; + } + if ($this->container['comparison'] === null) { + $invalidProperties[] = "'comparison' can't be null"; + } + if ($this->container['time_offset'] === null) { + $invalidProperties[] = "'time_offset' can't be null"; + } + if ($this->container['lower_bound_offset'] === null) { + $invalidProperties[] = "'lower_bound_offset' can't be null"; + } + if ($this->container['range_type'] === null) { + $invalidProperties[] = "'range_type' can't be null"; + } + if ($this->container['upper_bound_offset'] === null) { + $invalidProperties[] = "'upper_bound_offset' can't be null"; + } + if ($this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } + if ($this->container['lower_timestamp'] === null) { + $invalidProperties[] = "'lower_timestamp' can't be null"; + } + if ($this->container['upper_timestamp'] === null) { + $invalidProperties[] = "'upper_timestamp' can't be null"; + } + if ($this->container['include_objects_with_no_value_set'] === null) { + $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; + } + if ($this->container['operation_type'] === null) { + $invalidProperties[] = "'operation_type' can't be null"; + } + if ($this->container['operator'] === null) { + $invalidProperties[] = "'operator' can't be null"; + } + if ($this->container['time_point'] === null) { + $invalidProperties[] = "'time_point' can't be null"; + } + if ($this->container['lower_bound_time_point'] === null) { + $invalidProperties[] = "'lower_bound_time_point' can't be null"; + } + if ($this->container['upper_bound_time_point'] === null) { + $invalidProperties[] = "'upper_bound_time_point' 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 max_occurrences + * + * @return int|null + */ + public function getMaxOccurrences() + { + return $this->container['max_occurrences']; + } + + /** + * Sets max_occurrences + * + * @param int|null $max_occurrences The maximum number of occurrences allowed. + * + * @return self + */ + public function setMaxOccurrences($max_occurrences) + { + if (is_null($max_occurrences)) { + throw new \InvalidArgumentException('non-nullable max_occurrences cannot be null'); + } + $this->container['max_occurrences'] = $max_occurrences; + + return $this; + } + + /** + * Gets min_occurrences + * + * @return int|null + */ + public function getMinOccurrences() + { + return $this->container['min_occurrences']; + } + + /** + * Sets min_occurrences + * + * @param int|null $min_occurrences The minimum number of occurrences required. + * + * @return self + */ + public function setMinOccurrences($min_occurrences) + { + if (is_null($min_occurrences)) { + throw new \InvalidArgumentException('non-nullable min_occurrences cannot be null'); + } + $this->container['min_occurrences'] = $min_occurrences; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Defines the type of operation being performed. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets set_type + * + * @return string + */ + public function getSetType() + { + return $this->container['set_type']; + } + + /** + * Sets set_type + * + * @param string $set_type Indicates the specific set type used in the refinement (ALL, ALL_INCLUDE_EMPTY, ANY, NONE, NONE_EXCLUDE_EMPTY, ANY_INCLUDE_EMPTY). + * + * @return self + */ + public function setSetType($set_type) + { + if (is_null($set_type)) { + throw new \InvalidArgumentException('non-nullable set_type cannot be null'); + } + $this->container['set_type'] = $set_type; + + return $this; + } + + /** + * Gets comparison + * + * @return string + */ + public function getComparison() + { + return $this->container['comparison']; + } + + /** + * Sets comparison + * + * @param string $comparison Timestamp comparison options (BEFORE, AFTER) + * + * @return self + */ + public function setComparison($comparison) + { + if (is_null($comparison)) { + throw new \InvalidArgumentException('non-nullable comparison cannot be null'); + } + $this->container['comparison'] = $comparison; + + return $this; + } + + /** + * Gets time_offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset + */ + public function getTimeOffset() + { + return $this->container['time_offset']; + } + + /** + * Sets time_offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $time_offset time_offset + * + * @return self + */ + public function setTimeOffset($time_offset) + { + if (is_null($time_offset)) { + throw new \InvalidArgumentException('non-nullable time_offset cannot be null'); + } + $this->container['time_offset'] = $time_offset; + + return $this; + } + + /** + * Gets lower_bound_offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset + */ + public function getLowerBoundOffset() + { + return $this->container['lower_bound_offset']; + } + + /** + * Sets lower_bound_offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $lower_bound_offset lower_bound_offset + * + * @return self + */ + public function setLowerBoundOffset($lower_bound_offset) + { + if (is_null($lower_bound_offset)) { + throw new \InvalidArgumentException('non-nullable lower_bound_offset cannot be null'); + } + $this->container['lower_bound_offset'] = $lower_bound_offset; + + return $this; + } + + /** + * Gets range_type + * + * @return string + */ + public function getRangeType() + { + return $this->container['range_type']; + } + + /** + * Sets range_type + * + * @param string $range_type Type of range of refinement critaria (BETWEEN, NOT_BETWEEN) + * + * @return self + */ + public function setRangeType($range_type) + { + if (is_null($range_type)) { + throw new \InvalidArgumentException('non-nullable range_type cannot be null'); + } + $this->container['range_type'] = $range_type; + + return $this; + } + + /** + * Gets upper_bound_offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset + */ + public function getUpperBoundOffset() + { + return $this->container['upper_bound_offset']; + } + + /** + * Sets upper_bound_offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $upper_bound_offset upper_bound_offset + * + * @return self + */ + public function setUpperBoundOffset($upper_bound_offset) + { + if (is_null($upper_bound_offset)) { + throw new \InvalidArgumentException('non-nullable upper_bound_offset cannot be null'); + } + $this->container['upper_bound_offset'] = $upper_bound_offset; + + return $this; + } + + /** + * Gets timestamp + * + * @return int + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param int $timestamp Timestamp to be used in refine by criteria + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets lower_timestamp + * + * @return int + */ + public function getLowerTimestamp() + { + return $this->container['lower_timestamp']; + } + + /** + * Sets lower_timestamp + * + * @param int $lower_timestamp Lower range timestamp of refinement criteria + * + * @return self + */ + public function setLowerTimestamp($lower_timestamp) + { + if (is_null($lower_timestamp)) { + throw new \InvalidArgumentException('non-nullable lower_timestamp cannot be null'); + } + $this->container['lower_timestamp'] = $lower_timestamp; + + return $this; + } + + /** + * Gets upper_timestamp + * + * @return int + */ + public function getUpperTimestamp() + { + return $this->container['upper_timestamp']; + } + + /** + * Sets upper_timestamp + * + * @param int $upper_timestamp Upper range timestamp of refinement criteria + * + * @return self + */ + public function setUpperTimestamp($upper_timestamp) + { + if (is_null($upper_timestamp)) { + throw new \InvalidArgumentException('non-nullable upper_timestamp cannot be null'); + } + $this->container['upper_timestamp'] = $upper_timestamp; + + return $this; + } + + /** + * Gets endpoint_behavior + * + * @return string|null + */ + public function getEndpointBehavior() + { + return $this->container['endpoint_behavior']; + } + + /** + * Sets endpoint_behavior + * + * @param string|null $endpoint_behavior Describes the behavior at the endpoint of the time point operation. + * + * @return self + */ + public function setEndpointBehavior($endpoint_behavior) + { + if (is_null($endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable endpoint_behavior cannot be null'); + } + $this->container['endpoint_behavior'] = $endpoint_behavior; + + return $this; + } + + /** + * Gets include_objects_with_no_value_set + * + * @return bool + */ + public function getIncludeObjectsWithNoValueSet() + { + return $this->container['include_objects_with_no_value_set']; + } + + /** + * Sets include_objects_with_no_value_set + * + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. + * + * @return self + */ + public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_set) + { + if (is_null($include_objects_with_no_value_set)) { + throw new \InvalidArgumentException('non-nullable include_objects_with_no_value_set cannot be null'); + } + $this->container['include_objects_with_no_value_set'] = $include_objects_with_no_value_set; + + return $this; + } + + /** + * Gets operation_type + * + * @return string + */ + public function getOperationType() + { + return $this->container['operation_type']; + } + + /** + * Sets operation_type + * + * @param string $operation_type Specifies the type of operation (TIME_RANGED). + * + * @return self + */ + public function setOperationType($operation_type) + { + if (is_null($operation_type)) { + throw new \InvalidArgumentException('non-nullable operation_type cannot be null'); + } + $this->container['operation_type'] = $operation_type; + + return $this; + } + + /** + * Gets operator + * + * @return string + */ + public function getOperator() + { + return $this->container['operator']; + } + + /** + * Sets operator + * + * @param string $operator Defines the operation to be applied within the time range (IS_BETWEEN, IS_NOT_BETWEEN). + * + * @return self + */ + public function setOperator($operator) + { + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); + } + $this->container['operator'] = $operator; + + return $this; + } + + /** + * Gets property_parser + * + * @return string|null + */ + public function getPropertyParser() + { + return $this->container['property_parser']; + } + + /** + * Sets property_parser + * + * @param string|null $property_parser Specifies the parser used for the property in the operation. + * + * @return self + */ + public function setPropertyParser($property_parser) + { + if (is_null($property_parser)) { + throw new \InvalidArgumentException('non-nullable property_parser cannot be null'); + } + $this->container['property_parser'] = $property_parser; + + return $this; + } + + /** + * Gets time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint + */ + public function getTimePoint() + { + return $this->container['time_point']; + } + + /** + * Sets time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint $time_point time_point + * + * @return self + */ + public function setTimePoint($time_point) + { + if (is_null($time_point)) { + throw new \InvalidArgumentException('non-nullable time_point cannot be null'); + } + $this->container['time_point'] = $time_point; + + return $this; + } + + /** + * Gets lower_bound_endpoint_behavior + * + * @return string|null + */ + public function getLowerBoundEndpointBehavior() + { + return $this->container['lower_bound_endpoint_behavior']; + } + + /** + * Sets lower_bound_endpoint_behavior + * + * @param string|null $lower_bound_endpoint_behavior Describes the behavior at the lower bound endpoint of the time range. + * + * @return self + */ + public function setLowerBoundEndpointBehavior($lower_bound_endpoint_behavior) + { + if (is_null($lower_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable lower_bound_endpoint_behavior cannot be null'); + } + $this->container['lower_bound_endpoint_behavior'] = $lower_bound_endpoint_behavior; + + return $this; + } + + /** + * Gets lower_bound_time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint + */ + public function getLowerBoundTimePoint() + { + return $this->container['lower_bound_time_point']; + } + + /** + * Sets lower_bound_time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint $lower_bound_time_point lower_bound_time_point + * + * @return self + */ + public function setLowerBoundTimePoint($lower_bound_time_point) + { + if (is_null($lower_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable lower_bound_time_point cannot be null'); + } + $this->container['lower_bound_time_point'] = $lower_bound_time_point; + + return $this; + } + + /** + * Gets upper_bound_endpoint_behavior + * + * @return string|null + */ + public function getUpperBoundEndpointBehavior() + { + return $this->container['upper_bound_endpoint_behavior']; + } + + /** + * Sets upper_bound_endpoint_behavior + * + * @param string|null $upper_bound_endpoint_behavior Describes the behavior at the upper bound endpoint of the time range. + * + * @return self + */ + public function setUpperBoundEndpointBehavior($upper_bound_endpoint_behavior) + { + if (is_null($upper_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable upper_bound_endpoint_behavior cannot be null'); + } + $this->container['upper_bound_endpoint_behavior'] = $upper_bound_endpoint_behavior; + + return $this; + } + + /** + * Gets upper_bound_time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint + */ + public function getUpperBoundTimePoint() + { + return $this->container['upper_bound_time_point']; + } + + /** + * Sets upper_bound_time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint $upper_bound_time_point upper_bound_time_point + * + * @return self + */ + public function setUpperBoundTimePoint($upper_bound_time_point) + { + if (is_null($upper_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable upper_bound_time_point cannot be null'); + } + $this->container['upper_bound_time_point'] = $upper_bound_time_point; + + 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/Lists/Model/PublicInListFilter.php b/codegen/Crm/Lists/Model/PublicInListFilter.php index 6d93a437c..677032cab 100644 --- a/codegen/Crm/Lists/Model/PublicInListFilter.php +++ b/codegen/Crm/Lists/Model/PublicInListFilter.php @@ -2,7 +2,7 @@ /** * PublicInListFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,9 +57,9 @@ class PublicInListFilter implements ModelInterface, ArrayAccess, \JsonSerializab * @var string[] */ protected static $openAPITypes = [ + 'filter_type' => 'string', 'list_id' => 'string', 'metadata' => '\HubSpot\Client\Crm\Lists\Model\PublicInListFilterMetadata', - 'filter_type' => 'string', 'operator' => 'string' ]; @@ -71,9 +71,9 @@ class PublicInListFilter implements ModelInterface, ArrayAccess, \JsonSerializab * @psalm-var array */ protected static $openAPIFormats = [ + 'filter_type' => null, 'list_id' => null, 'metadata' => null, - 'filter_type' => null, 'operator' => null ]; @@ -83,9 +83,9 @@ class PublicInListFilter implements ModelInterface, ArrayAccess, \JsonSerializab * @var boolean[] */ protected static array $openAPINullables = [ + 'filter_type' => false, 'list_id' => false, 'metadata' => false, - 'filter_type' => false, 'operator' => false ]; @@ -175,9 +175,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'filter_type' => 'filterType', 'list_id' => 'listId', 'metadata' => 'metadata', - 'filter_type' => 'filterType', 'operator' => 'operator' ]; @@ -187,9 +187,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'filter_type' => 'setFilterType', 'list_id' => 'setListId', 'metadata' => 'setMetadata', - 'filter_type' => 'setFilterType', 'operator' => 'setOperator' ]; @@ -199,9 +199,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'filter_type' => 'getFilterType', 'list_id' => 'getListId', 'metadata' => 'getMetadata', - 'filter_type' => 'getFilterType', 'operator' => 'getOperator' ]; @@ -275,9 +275,9 @@ public function getFilterTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('filter_type', $data ?? [], 'IN_LIST'); $this->setIfExists('list_id', $data ?? [], null); $this->setIfExists('metadata', $data ?? [], null); - $this->setIfExists('filter_type', $data ?? [], 'IN_LIST'); $this->setIfExists('operator', $data ?? [], null); } @@ -308,9 +308,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['list_id'] === null) { - $invalidProperties[] = "'list_id' can't be null"; - } if ($this->container['filter_type'] === null) { $invalidProperties[] = "'filter_type' can't be null"; } @@ -323,6 +320,9 @@ public function listInvalidProperties() ); } + if ($this->container['list_id'] === null) { + $invalidProperties[] = "'list_id' can't be null"; + } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } @@ -341,6 +341,43 @@ public function valid() } + /** + * Gets filter_type + * + * @return string + */ + public function getFilterType() + { + return $this->container['filter_type']; + } + + /** + * Sets filter_type + * + * @param string $filter_type Indicates the type of filter being applied (IN_LIST). + * + * @return self + */ + public function setFilterType($filter_type) + { + if (is_null($filter_type)) { + throw new \InvalidArgumentException('non-nullable filter_type cannot be null'); + } + $allowedValues = $this->getFilterTypeAllowableValues(); + if (!in_array($filter_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'filter_type', must be one of '%s'", + $filter_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['filter_type'] = $filter_type; + + return $this; + } + /** * Gets list_id * @@ -354,7 +391,7 @@ public function getListId() /** * Sets list_id * - * @param string $list_id list_id + * @param string $list_id The ID of the list used in the association filter. * * @return self */ @@ -395,43 +432,6 @@ public function setMetadata($metadata) return $this; } - /** - * Gets filter_type - * - * @return string - */ - public function getFilterType() - { - return $this->container['filter_type']; - } - - /** - * Sets filter_type - * - * @param string $filter_type filter_type - * - * @return self - */ - public function setFilterType($filter_type) - { - if (is_null($filter_type)) { - throw new \InvalidArgumentException('non-nullable filter_type cannot be null'); - } - $allowedValues = $this->getFilterTypeAllowableValues(); - if (!in_array($filter_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'filter_type', must be one of '%s'", - $filter_type, - implode("', '", $allowedValues) - ) - ); - } - $this->container['filter_type'] = $filter_type; - - return $this; - } - /** * Gets operator * @@ -445,7 +445,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Specifies the operation to be performed by the filter (IN_LIST, NOT_IN_LIST). * * @return self */ @@ -461,11 +461,11 @@ public function setOperator($operator) /** * 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]); } @@ -473,12 +473,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; } @@ -503,11 +503,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/Lists/Model/PublicInListFilterMetadata.php b/codegen/Crm/Lists/Model/PublicInListFilterMetadata.php index 71ecc6276..589fa4dfb 100644 --- a/codegen/Crm/Lists/Model/PublicInListFilterMetadata.php +++ b/codegen/Crm/Lists/Model/PublicInListFilterMetadata.php @@ -2,7 +2,7 @@ /** * PublicInListFilterMetadata * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -315,7 +315,7 @@ public function getId() /** * Sets id * - * @param string $id id + * @param string $id The identifier for the filter metadata. * * @return self */ @@ -342,7 +342,7 @@ public function getInListType() /** * Sets in_list_type * - * @param string $in_list_type in_list_type + * @param string $in_list_type Specifies the type of list for the filter (WORKFLOWS_ENROLLMENT, WORKFLOWS_ACTIVE, WORKFLOWS_GOAL, WORKFLOWS_COMPLETED, IMPORT, DATASET, DATASETS). * * @return self */ @@ -358,11 +358,11 @@ public function setInListType($in_list_type) /** * 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]); } @@ -370,12 +370,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; } @@ -400,11 +400,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/Lists/Model/PublicIndexOffset.php b/codegen/Crm/Lists/Model/PublicIndexOffset.php index 3133005aa..de42db1a0 100644 --- a/codegen/Crm/Lists/Model/PublicIndexOffset.php +++ b/codegen/Crm/Lists/Model/PublicIndexOffset.php @@ -2,7 +2,7 @@ /** * PublicIndexOffset * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,14 +57,14 @@ class PublicIndexOffset implements ModelInterface, ArrayAccess, \JsonSerializabl * @var string[] */ protected static $openAPITypes = [ - 'milliseconds' => 'int', + 'days' => 'int', 'hours' => 'int', - 'seconds' => 'int', - 'months' => 'int', - 'weeks' => 'int', + 'milliseconds' => 'int', 'minutes' => 'int', + 'months' => 'int', 'quarters' => 'int', - 'days' => 'int', + 'seconds' => 'int', + 'weeks' => 'int', 'years' => 'int' ]; @@ -76,14 +76,14 @@ class PublicIndexOffset implements ModelInterface, ArrayAccess, \JsonSerializabl * @psalm-var array */ protected static $openAPIFormats = [ - 'milliseconds' => 'int32', + 'days' => 'int32', 'hours' => 'int32', - 'seconds' => 'int32', - 'months' => 'int32', - 'weeks' => 'int32', + 'milliseconds' => 'int32', 'minutes' => 'int32', + 'months' => 'int32', 'quarters' => 'int32', - 'days' => 'int32', + 'seconds' => 'int32', + 'weeks' => 'int32', 'years' => 'int32' ]; @@ -93,14 +93,14 @@ class PublicIndexOffset implements ModelInterface, ArrayAccess, \JsonSerializabl * @var boolean[] */ protected static array $openAPINullables = [ - 'milliseconds' => false, + 'days' => false, 'hours' => false, - 'seconds' => false, - 'months' => false, - 'weeks' => false, + 'milliseconds' => false, 'minutes' => false, + 'months' => false, 'quarters' => false, - 'days' => false, + 'seconds' => false, + 'weeks' => false, 'years' => false ]; @@ -190,14 +190,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'milliseconds' => 'milliseconds', + 'days' => 'days', 'hours' => 'hours', - 'seconds' => 'seconds', - 'months' => 'months', - 'weeks' => 'weeks', + 'milliseconds' => 'milliseconds', 'minutes' => 'minutes', + 'months' => 'months', 'quarters' => 'quarters', - 'days' => 'days', + 'seconds' => 'seconds', + 'weeks' => 'weeks', 'years' => 'years' ]; @@ -207,14 +207,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'milliseconds' => 'setMilliseconds', + 'days' => 'setDays', 'hours' => 'setHours', - 'seconds' => 'setSeconds', - 'months' => 'setMonths', - 'weeks' => 'setWeeks', + 'milliseconds' => 'setMilliseconds', 'minutes' => 'setMinutes', + 'months' => 'setMonths', 'quarters' => 'setQuarters', - 'days' => 'setDays', + 'seconds' => 'setSeconds', + 'weeks' => 'setWeeks', 'years' => 'setYears' ]; @@ -224,14 +224,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'milliseconds' => 'getMilliseconds', + 'days' => 'getDays', 'hours' => 'getHours', - 'seconds' => 'getSeconds', - 'months' => 'getMonths', - 'weeks' => 'getWeeks', + 'milliseconds' => 'getMilliseconds', 'minutes' => 'getMinutes', + 'months' => 'getMonths', 'quarters' => 'getQuarters', - 'days' => 'getDays', + 'seconds' => 'getSeconds', + 'weeks' => 'getWeeks', 'years' => 'getYears' ]; @@ -292,14 +292,14 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('milliseconds', $data ?? [], null); + $this->setIfExists('days', $data ?? [], null); $this->setIfExists('hours', $data ?? [], null); - $this->setIfExists('seconds', $data ?? [], null); - $this->setIfExists('months', $data ?? [], null); - $this->setIfExists('weeks', $data ?? [], null); + $this->setIfExists('milliseconds', $data ?? [], null); $this->setIfExists('minutes', $data ?? [], null); + $this->setIfExists('months', $data ?? [], null); $this->setIfExists('quarters', $data ?? [], null); - $this->setIfExists('days', $data ?? [], null); + $this->setIfExists('seconds', $data ?? [], null); + $this->setIfExists('weeks', $data ?? [], null); $this->setIfExists('years', $data ?? [], null); } @@ -346,28 +346,28 @@ public function valid() /** - * Gets milliseconds + * Gets days * * @return int|null */ - public function getMilliseconds() + public function getDays() { - return $this->container['milliseconds']; + return $this->container['days']; } /** - * Sets milliseconds + * Sets days * - * @param int|null $milliseconds milliseconds + * @param int|null $days The number of days to offset. * * @return self */ - public function setMilliseconds($milliseconds) + public function setDays($days) { - if (is_null($milliseconds)) { - throw new \InvalidArgumentException('non-nullable milliseconds cannot be null'); + if (is_null($days)) { + throw new \InvalidArgumentException('non-nullable days cannot be null'); } - $this->container['milliseconds'] = $milliseconds; + $this->container['days'] = $days; return $this; } @@ -385,7 +385,7 @@ public function getHours() /** * Sets hours * - * @param int|null $hours hours + * @param int|null $hours The number of hours to offset. * * @return self */ @@ -400,163 +400,163 @@ public function setHours($hours) } /** - * Gets seconds + * Gets milliseconds * * @return int|null */ - public function getSeconds() + public function getMilliseconds() { - return $this->container['seconds']; + return $this->container['milliseconds']; } /** - * Sets seconds + * Sets milliseconds * - * @param int|null $seconds seconds + * @param int|null $milliseconds The number of milliseconds to offset. * * @return self */ - public function setSeconds($seconds) + public function setMilliseconds($milliseconds) { - if (is_null($seconds)) { - throw new \InvalidArgumentException('non-nullable seconds cannot be null'); + if (is_null($milliseconds)) { + throw new \InvalidArgumentException('non-nullable milliseconds cannot be null'); } - $this->container['seconds'] = $seconds; + $this->container['milliseconds'] = $milliseconds; return $this; } /** - * Gets months + * Gets minutes * * @return int|null */ - public function getMonths() + public function getMinutes() { - return $this->container['months']; + return $this->container['minutes']; } /** - * Sets months + * Sets minutes * - * @param int|null $months months + * @param int|null $minutes The number of minutes to offset. * * @return self */ - public function setMonths($months) + public function setMinutes($minutes) { - if (is_null($months)) { - throw new \InvalidArgumentException('non-nullable months cannot be null'); + if (is_null($minutes)) { + throw new \InvalidArgumentException('non-nullable minutes cannot be null'); } - $this->container['months'] = $months; + $this->container['minutes'] = $minutes; return $this; } /** - * Gets weeks + * Gets months * * @return int|null */ - public function getWeeks() + public function getMonths() { - return $this->container['weeks']; + return $this->container['months']; } /** - * Sets weeks + * Sets months * - * @param int|null $weeks weeks + * @param int|null $months The number of months to offset. * * @return self */ - public function setWeeks($weeks) + public function setMonths($months) { - if (is_null($weeks)) { - throw new \InvalidArgumentException('non-nullable weeks cannot be null'); + if (is_null($months)) { + throw new \InvalidArgumentException('non-nullable months cannot be null'); } - $this->container['weeks'] = $weeks; + $this->container['months'] = $months; return $this; } /** - * Gets minutes + * Gets quarters * * @return int|null */ - public function getMinutes() + public function getQuarters() { - return $this->container['minutes']; + return $this->container['quarters']; } /** - * Sets minutes + * Sets quarters * - * @param int|null $minutes minutes + * @param int|null $quarters The number of quarters to offset. * * @return self */ - public function setMinutes($minutes) + public function setQuarters($quarters) { - if (is_null($minutes)) { - throw new \InvalidArgumentException('non-nullable minutes cannot be null'); + if (is_null($quarters)) { + throw new \InvalidArgumentException('non-nullable quarters cannot be null'); } - $this->container['minutes'] = $minutes; + $this->container['quarters'] = $quarters; return $this; } /** - * Gets quarters + * Gets seconds * * @return int|null */ - public function getQuarters() + public function getSeconds() { - return $this->container['quarters']; + return $this->container['seconds']; } /** - * Sets quarters + * Sets seconds * - * @param int|null $quarters quarters + * @param int|null $seconds The number of seconds to offset. * * @return self */ - public function setQuarters($quarters) + public function setSeconds($seconds) { - if (is_null($quarters)) { - throw new \InvalidArgumentException('non-nullable quarters cannot be null'); + if (is_null($seconds)) { + throw new \InvalidArgumentException('non-nullable seconds cannot be null'); } - $this->container['quarters'] = $quarters; + $this->container['seconds'] = $seconds; return $this; } /** - * Gets days + * Gets weeks * * @return int|null */ - public function getDays() + public function getWeeks() { - return $this->container['days']; + return $this->container['weeks']; } /** - * Sets days + * Sets weeks * - * @param int|null $days days + * @param int|null $weeks The number of weeks to offset. * * @return self */ - public function setDays($days) + public function setWeeks($weeks) { - if (is_null($days)) { - throw new \InvalidArgumentException('non-nullable days cannot be null'); + if (is_null($weeks)) { + throw new \InvalidArgumentException('non-nullable weeks cannot be null'); } - $this->container['days'] = $days; + $this->container['weeks'] = $weeks; return $this; } @@ -574,7 +574,7 @@ public function getYears() /** * Sets years * - * @param int|null $years years + * @param int|null $years The number of years to offset. * * @return self */ @@ -590,11 +590,11 @@ public function setYears($years) /** * 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]); } @@ -602,12 +602,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; } @@ -632,11 +632,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/Lists/Model/PublicIndexedTimePoint.php b/codegen/Crm/Lists/Model/PublicIndexedTimePoint.php index 5f85f49ad..617091b87 100644 --- a/codegen/Crm/Lists/Model/PublicIndexedTimePoint.php +++ b/codegen/Crm/Lists/Model/PublicIndexedTimePoint.php @@ -2,7 +2,7 @@ /** * PublicIndexedTimePoint * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,10 +57,10 @@ class PublicIndexedTimePoint implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $openAPITypes = [ - 'offset' => '\HubSpot\Client\Crm\Lists\Model\PublicIndexOffset', - 'timezone_source' => 'string', 'index_reference' => '\HubSpot\Client\Crm\Lists\Model\PublicIndexedTimePointIndexReference', + 'offset' => '\HubSpot\Client\Crm\Lists\Model\PublicIndexOffset', 'time_type' => 'string', + 'timezone_source' => 'string', 'zone_id' => 'string' ]; @@ -72,10 +72,10 @@ class PublicIndexedTimePoint implements ModelInterface, ArrayAccess, \JsonSerial * @psalm-var array */ protected static $openAPIFormats = [ - 'offset' => null, - 'timezone_source' => null, 'index_reference' => null, + 'offset' => null, 'time_type' => null, + 'timezone_source' => null, 'zone_id' => null ]; @@ -85,10 +85,10 @@ class PublicIndexedTimePoint implements ModelInterface, ArrayAccess, \JsonSerial * @var boolean[] */ protected static array $openAPINullables = [ - 'offset' => false, - 'timezone_source' => false, 'index_reference' => false, + 'offset' => false, 'time_type' => false, + 'timezone_source' => false, 'zone_id' => false ]; @@ -178,10 +178,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'offset' => 'offset', - 'timezone_source' => 'timezoneSource', 'index_reference' => 'indexReference', + 'offset' => 'offset', 'time_type' => 'timeType', + 'timezone_source' => 'timezoneSource', 'zone_id' => 'zoneId' ]; @@ -191,10 +191,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'offset' => 'setOffset', - 'timezone_source' => 'setTimezoneSource', 'index_reference' => 'setIndexReference', + 'offset' => 'setOffset', 'time_type' => 'setTimeType', + 'timezone_source' => 'setTimezoneSource', 'zone_id' => 'setZoneId' ]; @@ -204,10 +204,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'offset' => 'getOffset', - 'timezone_source' => 'getTimezoneSource', 'index_reference' => 'getIndexReference', + 'offset' => 'getOffset', 'time_type' => 'getTimeType', + 'timezone_source' => 'getTimezoneSource', 'zone_id' => 'getZoneId' ]; @@ -281,10 +281,10 @@ public function getTimeTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('offset', $data ?? [], null); - $this->setIfExists('timezone_source', $data ?? [], null); $this->setIfExists('index_reference', $data ?? [], null); + $this->setIfExists('offset', $data ?? [], null); $this->setIfExists('time_type', $data ?? [], 'INDEXED'); + $this->setIfExists('timezone_source', $data ?? [], null); $this->setIfExists('zone_id', $data ?? [], null); } @@ -349,82 +349,55 @@ public function valid() /** - * Gets offset - * - * @return \HubSpot\Client\Crm\Lists\Model\PublicIndexOffset|null - */ - public function getOffset() - { - return $this->container['offset']; - } - - /** - * Sets offset - * - * @param \HubSpot\Client\Crm\Lists\Model\PublicIndexOffset|null $offset offset - * - * @return self - */ - public function setOffset($offset) - { - if (is_null($offset)) { - throw new \InvalidArgumentException('non-nullable offset cannot be null'); - } - $this->container['offset'] = $offset; - - return $this; - } - - /** - * Gets timezone_source + * Gets index_reference * - * @return string|null + * @return \HubSpot\Client\Crm\Lists\Model\PublicIndexedTimePointIndexReference */ - public function getTimezoneSource() + public function getIndexReference() { - return $this->container['timezone_source']; + return $this->container['index_reference']; } /** - * Sets timezone_source + * Sets index_reference * - * @param string|null $timezone_source timezone_source + * @param \HubSpot\Client\Crm\Lists\Model\PublicIndexedTimePointIndexReference $index_reference index_reference * * @return self */ - public function setTimezoneSource($timezone_source) + public function setIndexReference($index_reference) { - if (is_null($timezone_source)) { - throw new \InvalidArgumentException('non-nullable timezone_source cannot be null'); + if (is_null($index_reference)) { + throw new \InvalidArgumentException('non-nullable index_reference cannot be null'); } - $this->container['timezone_source'] = $timezone_source; + $this->container['index_reference'] = $index_reference; return $this; } /** - * Gets index_reference + * Gets offset * - * @return \HubSpot\Client\Crm\Lists\Model\PublicIndexedTimePointIndexReference + * @return \HubSpot\Client\Crm\Lists\Model\PublicIndexOffset|null */ - public function getIndexReference() + public function getOffset() { - return $this->container['index_reference']; + return $this->container['offset']; } /** - * Sets index_reference + * Sets offset * - * @param \HubSpot\Client\Crm\Lists\Model\PublicIndexedTimePointIndexReference $index_reference index_reference + * @param \HubSpot\Client\Crm\Lists\Model\PublicIndexOffset|null $offset offset * * @return self */ - public function setIndexReference($index_reference) + public function setOffset($offset) { - if (is_null($index_reference)) { - throw new \InvalidArgumentException('non-nullable index_reference cannot be null'); + if (is_null($offset)) { + throw new \InvalidArgumentException('non-nullable offset cannot be null'); } - $this->container['index_reference'] = $index_reference; + $this->container['offset'] = $offset; return $this; } @@ -442,7 +415,7 @@ public function getTimeType() /** * Sets time_type * - * @param string $time_type time_type + * @param string $time_type Defines the type of time (INDEXED). * * @return self */ @@ -466,6 +439,33 @@ public function setTimeType($time_type) return $this; } + /** + * Gets timezone_source + * + * @return string|null + */ + public function getTimezoneSource() + { + return $this->container['timezone_source']; + } + + /** + * Sets timezone_source + * + * @param string|null $timezone_source Specifies the source of the time zone information for the indexed time point (CUSTOM, USER, PORTAL). + * + * @return self + */ + public function setTimezoneSource($timezone_source) + { + if (is_null($timezone_source)) { + throw new \InvalidArgumentException('non-nullable timezone_source cannot be null'); + } + $this->container['timezone_source'] = $timezone_source; + + return $this; + } + /** * Gets zone_id * @@ -479,7 +479,7 @@ public function getZoneId() /** * Sets zone_id * - * @param string $zone_id zone_id + * @param string $zone_id Indicates the identifier for the time zone associated with the indexed time point. * * @return self */ @@ -495,11 +495,11 @@ public function setZoneId($zone_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]); } @@ -507,12 +507,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; } @@ -537,11 +537,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/Lists/Model/PublicIndexedTimePointIndexReference.php b/codegen/Crm/Lists/Model/PublicIndexedTimePointIndexReference.php index d65d82865..af380eb2e 100644 --- a/codegen/Crm/Lists/Model/PublicIndexedTimePointIndexReference.php +++ b/codegen/Crm/Lists/Model/PublicIndexedTimePointIndexReference.php @@ -2,7 +2,7 @@ /** * PublicIndexedTimePointIndexReference * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * PublicIndexedTimePointIndexReference Class Doc Comment * * @category Class + * @description Specifies the reference point in time for the indexed time point. * @package HubSpot\Client\Crm\Lists * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -42,7 +43,7 @@ */ class PublicIndexedTimePointIndexReference implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = null; + public const DISCRIMINATOR = 'reference_type'; /** * The original name of the model. @@ -59,12 +60,12 @@ class PublicIndexedTimePointIndexReference implements ModelInterface, ArrayAcces protected static $openAPITypes = [ 'hour' => 'int', 'millisecond' => 'int', - 'reference_type' => 'string', 'minute' => 'int', + 'reference_type' => 'string', 'second' => 'int', 'day_of_week' => 'string', - 'month' => 'int', - 'day' => 'int' + 'day' => 'int', + 'month' => 'int' ]; /** @@ -77,12 +78,12 @@ class PublicIndexedTimePointIndexReference implements ModelInterface, ArrayAcces protected static $openAPIFormats = [ 'hour' => 'int32', 'millisecond' => 'int32', - 'reference_type' => null, 'minute' => 'int32', + 'reference_type' => null, 'second' => 'int32', 'day_of_week' => null, - 'month' => 'int32', - 'day' => 'int32' + 'day' => 'int32', + 'month' => 'int32' ]; /** @@ -93,12 +94,12 @@ class PublicIndexedTimePointIndexReference implements ModelInterface, ArrayAcces protected static array $openAPINullables = [ 'hour' => false, 'millisecond' => false, - 'reference_type' => false, 'minute' => false, + 'reference_type' => false, 'second' => false, 'day_of_week' => false, - 'month' => false, - 'day' => false + 'day' => false, + 'month' => false ]; /** @@ -189,12 +190,12 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'hour' => 'hour', 'millisecond' => 'millisecond', - 'reference_type' => 'referenceType', 'minute' => 'minute', + 'reference_type' => 'referenceType', 'second' => 'second', 'day_of_week' => 'dayOfWeek', - 'month' => 'month', - 'day' => 'day' + 'day' => 'day', + 'month' => 'month' ]; /** @@ -205,12 +206,12 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'hour' => 'setHour', 'millisecond' => 'setMillisecond', - 'reference_type' => 'setReferenceType', 'minute' => 'setMinute', + 'reference_type' => 'setReferenceType', 'second' => 'setSecond', 'day_of_week' => 'setDayOfWeek', - 'month' => 'setMonth', - 'day' => 'setDay' + 'day' => 'setDay', + 'month' => 'setMonth' ]; /** @@ -221,12 +222,12 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'hour' => 'getHour', 'millisecond' => 'getMillisecond', - 'reference_type' => 'getReferenceType', 'minute' => 'getMinute', + 'reference_type' => 'getReferenceType', 'second' => 'getSecond', 'day_of_week' => 'getDayOfWeek', - 'month' => 'getMonth', - 'day' => 'getDay' + 'day' => 'getDay', + 'month' => 'getMonth' ]; /** @@ -271,13 +272,13 @@ public function getModelName() } public const REFERENCE_TYPE_MONTH = 'MONTH'; - public const DAY_OF_WEEK_MONDAY = 'MONDAY'; - public const DAY_OF_WEEK_TUESDAY = 'TUESDAY'; - public const DAY_OF_WEEK_WEDNESDAY = 'WEDNESDAY'; - public const DAY_OF_WEEK_THURSDAY = 'THURSDAY'; public const DAY_OF_WEEK_FRIDAY = 'FRIDAY'; + public const DAY_OF_WEEK_MONDAY = 'MONDAY'; public const DAY_OF_WEEK_SATURDAY = 'SATURDAY'; public const DAY_OF_WEEK_SUNDAY = 'SUNDAY'; + public const DAY_OF_WEEK_THURSDAY = 'THURSDAY'; + public const DAY_OF_WEEK_TUESDAY = 'TUESDAY'; + public const DAY_OF_WEEK_WEDNESDAY = 'WEDNESDAY'; /** * Gets allowable values of the enum @@ -299,13 +300,13 @@ public function getReferenceTypeAllowableValues() public function getDayOfWeekAllowableValues() { return [ - self::DAY_OF_WEEK_MONDAY, - self::DAY_OF_WEEK_TUESDAY, - self::DAY_OF_WEEK_WEDNESDAY, - self::DAY_OF_WEEK_THURSDAY, self::DAY_OF_WEEK_FRIDAY, + self::DAY_OF_WEEK_MONDAY, self::DAY_OF_WEEK_SATURDAY, self::DAY_OF_WEEK_SUNDAY, + self::DAY_OF_WEEK_THURSDAY, + self::DAY_OF_WEEK_TUESDAY, + self::DAY_OF_WEEK_WEDNESDAY, ]; } @@ -326,12 +327,15 @@ public function __construct(?array $data = null) { $this->setIfExists('hour', $data ?? [], null); $this->setIfExists('millisecond', $data ?? [], null); - $this->setIfExists('reference_type', $data ?? [], 'MONTH'); $this->setIfExists('minute', $data ?? [], null); + $this->setIfExists('reference_type', $data ?? [], 'MONTH'); $this->setIfExists('second', $data ?? [], null); $this->setIfExists('day_of_week', $data ?? [], null); - $this->setIfExists('month', $data ?? [], null); $this->setIfExists('day', $data ?? [], null); + $this->setIfExists('month', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['reference_type'] = static::$openAPIModelName; } /** @@ -385,12 +389,12 @@ public function listInvalidProperties() ); } - if ($this->container['month'] === null) { - $invalidProperties[] = "'month' can't be null"; - } if ($this->container['day'] === null) { $invalidProperties[] = "'day' can't be null"; } + if ($this->container['month'] === null) { + $invalidProperties[] = "'month' can't be null"; + } return $invalidProperties; } @@ -419,7 +423,7 @@ public function getHour() /** * Sets hour * - * @param int|null $hour hour + * @param int|null $hour The hour component of the month reference. * * @return self */ @@ -446,7 +450,7 @@ public function getMillisecond() /** * Sets millisecond * - * @param int|null $millisecond millisecond + * @param int|null $millisecond The millisecond component of the month reference. * * @return self */ @@ -460,6 +464,33 @@ public function setMillisecond($millisecond) return $this; } + /** + * Gets minute + * + * @return int|null + */ + public function getMinute() + { + return $this->container['minute']; + } + + /** + * Sets minute + * + * @param int|null $minute The minute component of the month reference. + * + * @return self + */ + public function setMinute($minute) + { + if (is_null($minute)) { + throw new \InvalidArgumentException('non-nullable minute cannot be null'); + } + $this->container['minute'] = $minute; + + return $this; + } + /** * Gets reference_type * @@ -473,7 +504,7 @@ public function getReferenceType() /** * Sets reference_type * - * @param string $reference_type reference_type + * @param string $reference_type Indicates the type of reference, (MONTH). * * @return self */ @@ -497,33 +528,6 @@ public function setReferenceType($reference_type) return $this; } - /** - * Gets minute - * - * @return int|null - */ - public function getMinute() - { - return $this->container['minute']; - } - - /** - * Sets minute - * - * @param int|null $minute minute - * - * @return self - */ - public function setMinute($minute) - { - if (is_null($minute)) { - throw new \InvalidArgumentException('non-nullable minute cannot be null'); - } - $this->container['minute'] = $minute; - - return $this; - } - /** * Gets second * @@ -537,7 +541,7 @@ public function getSecond() /** * Sets second * - * @param int|null $second second + * @param int|null $second The second component of the month reference. * * @return self */ @@ -564,7 +568,7 @@ public function getDayOfWeek() /** * Sets day_of_week * - * @param string $day_of_week day_of_week + * @param string $day_of_week The day of the week (SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY). * * @return self */ @@ -589,66 +593,66 @@ public function setDayOfWeek($day_of_week) } /** - * Gets month + * Gets day * * @return int */ - public function getMonth() + public function getDay() { - return $this->container['month']; + return $this->container['day']; } /** - * Sets month + * Sets day * - * @param int $month month + * @param int $day The day component of the month reference. * * @return self */ - public function setMonth($month) + public function setDay($day) { - if (is_null($month)) { - throw new \InvalidArgumentException('non-nullable month cannot be null'); + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); } - $this->container['month'] = $month; + $this->container['day'] = $day; return $this; } /** - * Gets day + * Gets month * * @return int */ - public function getDay() + public function getMonth() { - return $this->container['day']; + return $this->container['month']; } /** - * Sets day + * Sets month * - * @param int $day day + * @param int $month The month component of the quarter reference. * * @return self */ - public function setDay($day) + public function setMonth($month) { - if (is_null($day)) { - throw new \InvalidArgumentException('non-nullable day cannot be null'); + if (is_null($month)) { + throw new \InvalidArgumentException('non-nullable month cannot be null'); } - $this->container['day'] = $day; + $this->container['month'] = $month; 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]); } @@ -656,12 +660,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; } @@ -686,11 +690,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/Lists/Model/PublicIntegrationEventFilter.php b/codegen/Crm/Lists/Model/PublicIntegrationEventFilter.php index 79664ed98..b7f6c2149 100644 --- a/codegen/Crm/Lists/Model/PublicIntegrationEventFilter.php +++ b/codegen/Crm/Lists/Model/PublicIntegrationEventFilter.php @@ -2,7 +2,7 @@ /** * PublicIntegrationEventFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -347,7 +347,7 @@ public function getEventTypeId() /** * Sets event_type_id * - * @param int $event_type_id event_type_id + * @param int $event_type_id The ID representing the type of event for the integration event filter. * * @return self */ @@ -401,7 +401,7 @@ public function getFilterType() /** * Sets filter_type * - * @param string $filter_type filter_type + * @param string $filter_type Indicates the type of filter (INTEGRATION_EVENT). * * @return self */ @@ -427,11 +427,11 @@ public function setFilterType($filter_type) /** * 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]); } @@ -439,12 +439,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; } @@ -469,11 +469,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/Lists/Model/PublicListConversionDate.php b/codegen/Crm/Lists/Model/PublicListConversionDate.php new file mode 100644 index 000000000..2f250fc80 --- /dev/null +++ b/codegen/Crm/Lists/Model/PublicListConversionDate.php @@ -0,0 +1,555 @@ + + */ +class PublicListConversionDate implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicListConversionDate'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conversion_type' => 'string', + 'day' => 'int', + 'month' => 'int', + 'year' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conversion_type' => null, + 'day' => 'int32', + 'month' => 'int32', + 'year' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'conversion_type' => false, + 'day' => false, + 'month' => false, + 'year' => 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 = [ + 'conversion_type' => 'conversionType', + 'day' => 'day', + 'month' => 'month', + 'year' => 'year' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conversion_type' => 'setConversionType', + 'day' => 'setDay', + 'month' => 'setMonth', + 'year' => 'setYear' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conversion_type' => 'getConversionType', + 'day' => 'getDay', + 'month' => 'getMonth', + 'year' => 'getYear' + ]; + + /** + * 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 CONVERSION_TYPE_CONVERSION_DATE = 'CONVERSION_DATE'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getConversionTypeAllowableValues() + { + return [ + self::CONVERSION_TYPE_CONVERSION_DATE, + ]; + } + + /** + * 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('conversion_type', $data ?? [], 'CONVERSION_DATE'); + $this->setIfExists('day', $data ?? [], null); + $this->setIfExists('month', $data ?? [], null); + $this->setIfExists('year', $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['conversion_type'] === null) { + $invalidProperties[] = "'conversion_type' can't be null"; + } + $allowedValues = $this->getConversionTypeAllowableValues(); + if (!is_null($this->container['conversion_type']) && !in_array($this->container['conversion_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'conversion_type', must be one of '%s'", + $this->container['conversion_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } + if ($this->container['month'] === null) { + $invalidProperties[] = "'month' can't be null"; + } + if ($this->container['year'] === null) { + $invalidProperties[] = "'year' 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 conversion_type + * + * @return string + */ + public function getConversionType() + { + return $this->container['conversion_type']; + } + + /** + * Sets conversion_type + * + * @param string $conversion_type Specifies the type of conversion (CONVERSION_DATE). + * + * @return self + */ + public function setConversionType($conversion_type) + { + if (is_null($conversion_type)) { + throw new \InvalidArgumentException('non-nullable conversion_type cannot be null'); + } + $allowedValues = $this->getConversionTypeAllowableValues(); + if (!in_array($conversion_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'conversion_type', must be one of '%s'", + $conversion_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['conversion_type'] = $conversion_type; + + return $this; + } + + /** + * Gets day + * + * @return int + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param int $day The day component of the conversion date. + * + * @return self + */ + public function setDay($day) + { + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets month + * + * @return int + */ + public function getMonth() + { + return $this->container['month']; + } + + /** + * Sets month + * + * @param int $month The month component of the conversion date. + * + * @return self + */ + public function setMonth($month) + { + if (is_null($month)) { + throw new \InvalidArgumentException('non-nullable month cannot be null'); + } + $this->container['month'] = $month; + + return $this; + } + + /** + * Gets year + * + * @return int + */ + public function getYear() + { + return $this->container['year']; + } + + /** + * Sets year + * + * @param int $year The year component of the conversion date. + * + * @return self + */ + public function setYear($year) + { + if (is_null($year)) { + throw new \InvalidArgumentException('non-nullable year cannot be null'); + } + $this->container['year'] = $year; + + 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/Lists/Model/PublicListConversionInactivity.php b/codegen/Crm/Lists/Model/PublicListConversionInactivity.php new file mode 100644 index 000000000..1d7f9129a --- /dev/null +++ b/codegen/Crm/Lists/Model/PublicListConversionInactivity.php @@ -0,0 +1,554 @@ + + */ +class PublicListConversionInactivity implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicListConversionInactivity'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conversion_type' => 'string', + 'offset' => 'int', + 'time_unit' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conversion_type' => null, + 'offset' => 'int32', + 'time_unit' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'conversion_type' => false, + 'offset' => false, + 'time_unit' => 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 = [ + 'conversion_type' => 'conversionType', + 'offset' => 'offset', + 'time_unit' => 'timeUnit' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conversion_type' => 'setConversionType', + 'offset' => 'setOffset', + 'time_unit' => 'setTimeUnit' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conversion_type' => 'getConversionType', + 'offset' => 'getOffset', + 'time_unit' => 'getTimeUnit' + ]; + + /** + * 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 CONVERSION_TYPE_INACTIVITY = 'INACTIVITY'; + public const TIME_UNIT_DAY = 'DAY'; + public const TIME_UNIT_MONTH = 'MONTH'; + public const TIME_UNIT_WEEK = 'WEEK'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getConversionTypeAllowableValues() + { + return [ + self::CONVERSION_TYPE_INACTIVITY, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTimeUnitAllowableValues() + { + return [ + self::TIME_UNIT_DAY, + self::TIME_UNIT_MONTH, + self::TIME_UNIT_WEEK, + ]; + } + + /** + * 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('conversion_type', $data ?? [], 'INACTIVITY'); + $this->setIfExists('offset', $data ?? [], null); + $this->setIfExists('time_unit', $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['conversion_type'] === null) { + $invalidProperties[] = "'conversion_type' can't be null"; + } + $allowedValues = $this->getConversionTypeAllowableValues(); + if (!is_null($this->container['conversion_type']) && !in_array($this->container['conversion_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'conversion_type', must be one of '%s'", + $this->container['conversion_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['offset'] === null) { + $invalidProperties[] = "'offset' can't be null"; + } + if ($this->container['time_unit'] === null) { + $invalidProperties[] = "'time_unit' can't be null"; + } + $allowedValues = $this->getTimeUnitAllowableValues(); + if (!is_null($this->container['time_unit']) && !in_array($this->container['time_unit'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'time_unit', must be one of '%s'", + $this->container['time_unit'], + implode("', '", $allowedValues) + ); + } + + 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 conversion_type + * + * @return string + */ + public function getConversionType() + { + return $this->container['conversion_type']; + } + + /** + * Sets conversion_type + * + * @param string $conversion_type Specifies the type of conversion (INACTIVITY). + * + * @return self + */ + public function setConversionType($conversion_type) + { + if (is_null($conversion_type)) { + throw new \InvalidArgumentException('non-nullable conversion_type cannot be null'); + } + $allowedValues = $this->getConversionTypeAllowableValues(); + if (!in_array($conversion_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'conversion_type', must be one of '%s'", + $conversion_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['conversion_type'] = $conversion_type; + + return $this; + } + + /** + * Gets offset + * + * @return int + */ + public function getOffset() + { + return $this->container['offset']; + } + + /** + * Sets offset + * + * @param int $offset The number of time units for the inactivity period. + * + * @return self + */ + public function setOffset($offset) + { + if (is_null($offset)) { + throw new \InvalidArgumentException('non-nullable offset cannot be null'); + } + $this->container['offset'] = $offset; + + return $this; + } + + /** + * Gets time_unit + * + * @return string + */ + public function getTimeUnit() + { + return $this->container['time_unit']; + } + + /** + * Sets time_unit + * + * @param string $time_unit The unit of time for the inactivity period, such as (DAY, MONTH, WEEK). + * + * @return self + */ + public function setTimeUnit($time_unit) + { + if (is_null($time_unit)) { + throw new \InvalidArgumentException('non-nullable time_unit cannot be null'); + } + $allowedValues = $this->getTimeUnitAllowableValues(); + if (!in_array($time_unit, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'time_unit', must be one of '%s'", + $time_unit, + implode("', '", $allowedValues) + ) + ); + } + $this->container['time_unit'] = $time_unit; + + 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/Lists/Model/PublicListConversionResponse.php b/codegen/Crm/Lists/Model/PublicListConversionResponse.php new file mode 100644 index 000000000..c19807b60 --- /dev/null +++ b/codegen/Crm/Lists/Model/PublicListConversionResponse.php @@ -0,0 +1,480 @@ + + */ +class PublicListConversionResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicListConversionResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'converted_at' => '\DateTime', + 'list_id' => 'string', + 'requested_conversion_time' => '\HubSpot\Client\Crm\Lists\Model\PublicListConversionResponseRequestedConversionTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'converted_at' => 'date-time', + 'list_id' => null, + 'requested_conversion_time' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'converted_at' => false, + 'list_id' => false, + 'requested_conversion_time' => 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 = [ + 'converted_at' => 'convertedAt', + 'list_id' => 'listId', + 'requested_conversion_time' => 'requestedConversionTime' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'converted_at' => 'setConvertedAt', + 'list_id' => 'setListId', + 'requested_conversion_time' => 'setRequestedConversionTime' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'converted_at' => 'getConvertedAt', + 'list_id' => 'getListId', + 'requested_conversion_time' => 'getRequestedConversionTime' + ]; + + /** + * 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('converted_at', $data ?? [], null); + $this->setIfExists('list_id', $data ?? [], null); + $this->setIfExists('requested_conversion_time', $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['list_id'] === null) { + $invalidProperties[] = "'list_id' 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 converted_at + * + * @return \DateTime|null + */ + public function getConvertedAt() + { + return $this->container['converted_at']; + } + + /** + * Sets converted_at + * + * @param \DateTime|null $converted_at The date and time when the list was converted. + * + * @return self + */ + public function setConvertedAt($converted_at) + { + if (is_null($converted_at)) { + throw new \InvalidArgumentException('non-nullable converted_at cannot be null'); + } + $this->container['converted_at'] = $converted_at; + + return $this; + } + + /** + * Gets list_id + * + * @return string + */ + public function getListId() + { + return $this->container['list_id']; + } + + /** + * Sets list_id + * + * @param string $list_id The unique identifier of the list for which the conversion details are provided. + * + * @return self + */ + public function setListId($list_id) + { + if (is_null($list_id)) { + throw new \InvalidArgumentException('non-nullable list_id cannot be null'); + } + $this->container['list_id'] = $list_id; + + return $this; + } + + /** + * Gets requested_conversion_time + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicListConversionResponseRequestedConversionTime|null + */ + public function getRequestedConversionTime() + { + return $this->container['requested_conversion_time']; + } + + /** + * Sets requested_conversion_time + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicListConversionResponseRequestedConversionTime|null $requested_conversion_time requested_conversion_time + * + * @return self + */ + public function setRequestedConversionTime($requested_conversion_time) + { + if (is_null($requested_conversion_time)) { + throw new \InvalidArgumentException('non-nullable requested_conversion_time cannot be null'); + } + $this->container['requested_conversion_time'] = $requested_conversion_time; + + 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/Lists/Model/PublicListConversionResponseRequestedConversionTime.php b/codegen/Crm/Lists/Model/PublicListConversionResponseRequestedConversionTime.php new file mode 100644 index 000000000..688d4f719 --- /dev/null +++ b/codegen/Crm/Lists/Model/PublicListConversionResponseRequestedConversionTime.php @@ -0,0 +1,669 @@ + + */ +class PublicListConversionResponseRequestedConversionTime implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'conversion_type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicListConversionResponse_requestedConversionTime'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conversion_type' => 'string', + 'day' => 'int', + 'month' => 'int', + 'year' => 'int', + 'offset' => 'int', + 'time_unit' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conversion_type' => null, + 'day' => 'int32', + 'month' => 'int32', + 'year' => 'int32', + 'offset' => 'int32', + 'time_unit' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'conversion_type' => false, + 'day' => false, + 'month' => false, + 'year' => false, + 'offset' => false, + 'time_unit' => 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 = [ + 'conversion_type' => 'conversionType', + 'day' => 'day', + 'month' => 'month', + 'year' => 'year', + 'offset' => 'offset', + 'time_unit' => 'timeUnit' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conversion_type' => 'setConversionType', + 'day' => 'setDay', + 'month' => 'setMonth', + 'year' => 'setYear', + 'offset' => 'setOffset', + 'time_unit' => 'setTimeUnit' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conversion_type' => 'getConversionType', + 'day' => 'getDay', + 'month' => 'getMonth', + 'year' => 'getYear', + 'offset' => 'getOffset', + 'time_unit' => 'getTimeUnit' + ]; + + /** + * 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 CONVERSION_TYPE_INACTIVITY = 'INACTIVITY'; + public const TIME_UNIT_DAY = 'DAY'; + public const TIME_UNIT_MONTH = 'MONTH'; + public const TIME_UNIT_WEEK = 'WEEK'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getConversionTypeAllowableValues() + { + return [ + self::CONVERSION_TYPE_INACTIVITY, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTimeUnitAllowableValues() + { + return [ + self::TIME_UNIT_DAY, + self::TIME_UNIT_MONTH, + self::TIME_UNIT_WEEK, + ]; + } + + /** + * 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('conversion_type', $data ?? [], 'INACTIVITY'); + $this->setIfExists('day', $data ?? [], null); + $this->setIfExists('month', $data ?? [], null); + $this->setIfExists('year', $data ?? [], null); + $this->setIfExists('offset', $data ?? [], null); + $this->setIfExists('time_unit', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['conversion_type'] = static::$openAPIModelName; + } + + /** + * 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['conversion_type'] === null) { + $invalidProperties[] = "'conversion_type' can't be null"; + } + $allowedValues = $this->getConversionTypeAllowableValues(); + if (!is_null($this->container['conversion_type']) && !in_array($this->container['conversion_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'conversion_type', must be one of '%s'", + $this->container['conversion_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } + if ($this->container['month'] === null) { + $invalidProperties[] = "'month' can't be null"; + } + if ($this->container['year'] === null) { + $invalidProperties[] = "'year' can't be null"; + } + if ($this->container['offset'] === null) { + $invalidProperties[] = "'offset' can't be null"; + } + if ($this->container['time_unit'] === null) { + $invalidProperties[] = "'time_unit' can't be null"; + } + $allowedValues = $this->getTimeUnitAllowableValues(); + if (!is_null($this->container['time_unit']) && !in_array($this->container['time_unit'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'time_unit', must be one of '%s'", + $this->container['time_unit'], + implode("', '", $allowedValues) + ); + } + + 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 conversion_type + * + * @return string + */ + public function getConversionType() + { + return $this->container['conversion_type']; + } + + /** + * Sets conversion_type + * + * @param string $conversion_type Specifies the type of conversion (INACTIVITY). + * + * @return self + */ + public function setConversionType($conversion_type) + { + if (is_null($conversion_type)) { + throw new \InvalidArgumentException('non-nullable conversion_type cannot be null'); + } + $allowedValues = $this->getConversionTypeAllowableValues(); + if (!in_array($conversion_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'conversion_type', must be one of '%s'", + $conversion_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['conversion_type'] = $conversion_type; + + return $this; + } + + /** + * Gets day + * + * @return int + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param int $day The day component of the conversion date. + * + * @return self + */ + public function setDay($day) + { + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets month + * + * @return int + */ + public function getMonth() + { + return $this->container['month']; + } + + /** + * Sets month + * + * @param int $month The month component of the conversion date. + * + * @return self + */ + public function setMonth($month) + { + if (is_null($month)) { + throw new \InvalidArgumentException('non-nullable month cannot be null'); + } + $this->container['month'] = $month; + + return $this; + } + + /** + * Gets year + * + * @return int + */ + public function getYear() + { + return $this->container['year']; + } + + /** + * Sets year + * + * @param int $year The year component of the conversion date. + * + * @return self + */ + public function setYear($year) + { + if (is_null($year)) { + throw new \InvalidArgumentException('non-nullable year cannot be null'); + } + $this->container['year'] = $year; + + return $this; + } + + /** + * Gets offset + * + * @return int + */ + public function getOffset() + { + return $this->container['offset']; + } + + /** + * Sets offset + * + * @param int $offset The number of time units for the inactivity period. + * + * @return self + */ + public function setOffset($offset) + { + if (is_null($offset)) { + throw new \InvalidArgumentException('non-nullable offset cannot be null'); + } + $this->container['offset'] = $offset; + + return $this; + } + + /** + * Gets time_unit + * + * @return string + */ + public function getTimeUnit() + { + return $this->container['time_unit']; + } + + /** + * Sets time_unit + * + * @param string $time_unit The unit of time for the inactivity period, such as (DAY, MONTH, WEEK). + * + * @return self + */ + public function setTimeUnit($time_unit) + { + if (is_null($time_unit)) { + throw new \InvalidArgumentException('non-nullable time_unit cannot be null'); + } + $allowedValues = $this->getTimeUnitAllowableValues(); + if (!in_array($time_unit, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'time_unit', must be one of '%s'", + $time_unit, + implode("', '", $allowedValues) + ) + ); + } + $this->container['time_unit'] = $time_unit; + + 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/Lists/Model/PublicListConversionTime.php b/codegen/Crm/Lists/Model/PublicListConversionTime.php new file mode 100644 index 000000000..7113cac43 --- /dev/null +++ b/codegen/Crm/Lists/Model/PublicListConversionTime.php @@ -0,0 +1,668 @@ + + */ +class PublicListConversionTime implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'conversion_type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicListConversionTime'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'conversion_type' => 'string', + 'day' => 'int', + 'month' => 'int', + 'year' => 'int', + 'offset' => 'int', + 'time_unit' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'conversion_type' => null, + 'day' => 'int32', + 'month' => 'int32', + 'year' => 'int32', + 'offset' => 'int32', + 'time_unit' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'conversion_type' => false, + 'day' => false, + 'month' => false, + 'year' => false, + 'offset' => false, + 'time_unit' => 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 = [ + 'conversion_type' => 'conversionType', + 'day' => 'day', + 'month' => 'month', + 'year' => 'year', + 'offset' => 'offset', + 'time_unit' => 'timeUnit' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'conversion_type' => 'setConversionType', + 'day' => 'setDay', + 'month' => 'setMonth', + 'year' => 'setYear', + 'offset' => 'setOffset', + 'time_unit' => 'setTimeUnit' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'conversion_type' => 'getConversionType', + 'day' => 'getDay', + 'month' => 'getMonth', + 'year' => 'getYear', + 'offset' => 'getOffset', + 'time_unit' => 'getTimeUnit' + ]; + + /** + * 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 CONVERSION_TYPE_INACTIVITY = 'INACTIVITY'; + public const TIME_UNIT_DAY = 'DAY'; + public const TIME_UNIT_MONTH = 'MONTH'; + public const TIME_UNIT_WEEK = 'WEEK'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getConversionTypeAllowableValues() + { + return [ + self::CONVERSION_TYPE_INACTIVITY, + ]; + } + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTimeUnitAllowableValues() + { + return [ + self::TIME_UNIT_DAY, + self::TIME_UNIT_MONTH, + self::TIME_UNIT_WEEK, + ]; + } + + /** + * 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('conversion_type', $data ?? [], 'INACTIVITY'); + $this->setIfExists('day', $data ?? [], null); + $this->setIfExists('month', $data ?? [], null); + $this->setIfExists('year', $data ?? [], null); + $this->setIfExists('offset', $data ?? [], null); + $this->setIfExists('time_unit', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['conversion_type'] = static::$openAPIModelName; + } + + /** + * 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['conversion_type'] === null) { + $invalidProperties[] = "'conversion_type' can't be null"; + } + $allowedValues = $this->getConversionTypeAllowableValues(); + if (!is_null($this->container['conversion_type']) && !in_array($this->container['conversion_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'conversion_type', must be one of '%s'", + $this->container['conversion_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } + if ($this->container['month'] === null) { + $invalidProperties[] = "'month' can't be null"; + } + if ($this->container['year'] === null) { + $invalidProperties[] = "'year' can't be null"; + } + if ($this->container['offset'] === null) { + $invalidProperties[] = "'offset' can't be null"; + } + if ($this->container['time_unit'] === null) { + $invalidProperties[] = "'time_unit' can't be null"; + } + $allowedValues = $this->getTimeUnitAllowableValues(); + if (!is_null($this->container['time_unit']) && !in_array($this->container['time_unit'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'time_unit', must be one of '%s'", + $this->container['time_unit'], + implode("', '", $allowedValues) + ); + } + + 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 conversion_type + * + * @return string + */ + public function getConversionType() + { + return $this->container['conversion_type']; + } + + /** + * Sets conversion_type + * + * @param string $conversion_type Specifies the type of conversion (INACTIVITY). + * + * @return self + */ + public function setConversionType($conversion_type) + { + if (is_null($conversion_type)) { + throw new \InvalidArgumentException('non-nullable conversion_type cannot be null'); + } + $allowedValues = $this->getConversionTypeAllowableValues(); + if (!in_array($conversion_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'conversion_type', must be one of '%s'", + $conversion_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['conversion_type'] = $conversion_type; + + return $this; + } + + /** + * Gets day + * + * @return int + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param int $day The day component of the conversion date. + * + * @return self + */ + public function setDay($day) + { + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets month + * + * @return int + */ + public function getMonth() + { + return $this->container['month']; + } + + /** + * Sets month + * + * @param int $month The month component of the conversion date. + * + * @return self + */ + public function setMonth($month) + { + if (is_null($month)) { + throw new \InvalidArgumentException('non-nullable month cannot be null'); + } + $this->container['month'] = $month; + + return $this; + } + + /** + * Gets year + * + * @return int + */ + public function getYear() + { + return $this->container['year']; + } + + /** + * Sets year + * + * @param int $year The year component of the conversion date. + * + * @return self + */ + public function setYear($year) + { + if (is_null($year)) { + throw new \InvalidArgumentException('non-nullable year cannot be null'); + } + $this->container['year'] = $year; + + return $this; + } + + /** + * Gets offset + * + * @return int + */ + public function getOffset() + { + return $this->container['offset']; + } + + /** + * Sets offset + * + * @param int $offset The number of time units for the inactivity period. + * + * @return self + */ + public function setOffset($offset) + { + if (is_null($offset)) { + throw new \InvalidArgumentException('non-nullable offset cannot be null'); + } + $this->container['offset'] = $offset; + + return $this; + } + + /** + * Gets time_unit + * + * @return string + */ + public function getTimeUnit() + { + return $this->container['time_unit']; + } + + /** + * Sets time_unit + * + * @param string $time_unit The unit of time for the inactivity period, such as (DAY, MONTH, WEEK). + * + * @return self + */ + public function setTimeUnit($time_unit) + { + if (is_null($time_unit)) { + throw new \InvalidArgumentException('non-nullable time_unit cannot be null'); + } + $allowedValues = $this->getTimeUnitAllowableValues(); + if (!in_array($time_unit, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'time_unit', must be one of '%s'", + $time_unit, + implode("', '", $allowedValues) + ) + ); + } + $this->container['time_unit'] = $time_unit; + + 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/Lists/Model/PublicListFolder.php b/codegen/Crm/Lists/Model/PublicListFolder.php index b50edc36e..c3b19a082 100644 --- a/codegen/Crm/Lists/Model/PublicListFolder.php +++ b/codegen/Crm/Lists/Model/PublicListFolder.php @@ -2,7 +2,7 @@ /** * PublicListFolder * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,15 +57,15 @@ class PublicListFolder implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'created_at' => '\DateTime', - 'parent_folder_id' => 'int', + 'child_lists' => 'int[]', 'child_nodes' => '\HubSpot\Client\Crm\Lists\Model\PublicListFolder[]', + 'created_at' => '\DateTime', + 'id' => 'string', 'name' => 'string', - 'id' => 'int', - 'child_lists' => 'int[]', + 'parent_folder_id' => 'string', + 'updated_at' => '\DateTime', 'updated_contents_at' => '\DateTime', - 'user_id' => 'int', - 'updated_at' => '\DateTime' + 'user_id' => 'int' ]; /** @@ -76,15 +76,15 @@ class PublicListFolder implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'created_at' => 'date-time', - 'parent_folder_id' => 'int32', + 'child_lists' => 'int32', 'child_nodes' => null, + 'created_at' => 'date-time', + 'id' => null, 'name' => null, - 'id' => 'int32', - 'child_lists' => 'int32', + 'parent_folder_id' => null, + 'updated_at' => 'date-time', 'updated_contents_at' => 'date-time', - 'user_id' => 'int32', - 'updated_at' => 'date-time' + 'user_id' => 'int32' ]; /** @@ -93,15 +93,15 @@ class PublicListFolder implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'created_at' => false, - 'parent_folder_id' => false, + 'child_lists' => false, 'child_nodes' => false, - 'name' => false, + 'created_at' => false, 'id' => false, - 'child_lists' => false, + 'name' => false, + 'parent_folder_id' => false, + 'updated_at' => false, 'updated_contents_at' => false, - 'user_id' => false, - 'updated_at' => false + 'user_id' => false ]; /** @@ -190,15 +190,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'created_at' => 'createdAt', - 'parent_folder_id' => 'parentFolderId', + 'child_lists' => 'childLists', 'child_nodes' => 'childNodes', - 'name' => 'name', + 'created_at' => 'createdAt', 'id' => 'id', - 'child_lists' => 'childLists', + 'name' => 'name', + 'parent_folder_id' => 'parentFolderId', + 'updated_at' => 'updatedAt', 'updated_contents_at' => 'updatedContentsAt', - 'user_id' => 'userId', - 'updated_at' => 'updatedAt' + 'user_id' => 'userId' ]; /** @@ -207,15 +207,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'created_at' => 'setCreatedAt', - 'parent_folder_id' => 'setParentFolderId', + 'child_lists' => 'setChildLists', 'child_nodes' => 'setChildNodes', - 'name' => 'setName', + 'created_at' => 'setCreatedAt', 'id' => 'setId', - 'child_lists' => 'setChildLists', + 'name' => 'setName', + 'parent_folder_id' => 'setParentFolderId', + 'updated_at' => 'setUpdatedAt', 'updated_contents_at' => 'setUpdatedContentsAt', - 'user_id' => 'setUserId', - 'updated_at' => 'setUpdatedAt' + 'user_id' => 'setUserId' ]; /** @@ -224,15 +224,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'created_at' => 'getCreatedAt', - 'parent_folder_id' => 'getParentFolderId', + 'child_lists' => 'getChildLists', 'child_nodes' => 'getChildNodes', - 'name' => 'getName', + 'created_at' => 'getCreatedAt', 'id' => 'getId', - 'child_lists' => 'getChildLists', + 'name' => 'getName', + 'parent_folder_id' => 'getParentFolderId', + 'updated_at' => 'getUpdatedAt', 'updated_contents_at' => 'getUpdatedContentsAt', - 'user_id' => 'getUserId', - 'updated_at' => 'getUpdatedAt' + 'user_id' => 'getUserId' ]; /** @@ -292,15 +292,15 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('created_at', $data ?? [], null); - $this->setIfExists('parent_folder_id', $data ?? [], null); + $this->setIfExists('child_lists', $data ?? [], null); $this->setIfExists('child_nodes', $data ?? [], null); - $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); - $this->setIfExists('child_lists', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('parent_folder_id', $data ?? [], null); + $this->setIfExists('updated_at', $data ?? [], null); $this->setIfExists('updated_contents_at', $data ?? [], null); $this->setIfExists('user_id', $data ?? [], null); - $this->setIfExists('updated_at', $data ?? [], null); } /** @@ -330,8 +330,8 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['parent_folder_id'] === null) { - $invalidProperties[] = "'parent_folder_id' can't be null"; + if ($this->container['child_lists'] === null) { + $invalidProperties[] = "'child_lists' can't be null"; } if ($this->container['child_nodes'] === null) { $invalidProperties[] = "'child_nodes' can't be null"; @@ -339,8 +339,8 @@ public function listInvalidProperties() if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ($this->container['child_lists'] === null) { - $invalidProperties[] = "'child_lists' can't be null"; + if ($this->container['parent_folder_id'] === null) { + $invalidProperties[] = "'parent_folder_id' can't be null"; } return $invalidProperties; } @@ -358,82 +358,109 @@ public function valid() /** - * Gets created_at + * Gets child_lists * - * @return \DateTime|null + * @return int[] */ - public function getCreatedAt() + public function getChildLists() { - return $this->container['created_at']; + return $this->container['child_lists']; } /** - * Sets created_at + * Sets child_lists * - * @param \DateTime|null $created_at The time the folder was created at. + * @param int[] $child_lists An array of list Id's contained in this folder. * * @return self */ - public function setCreatedAt($created_at) + public function setChildLists($child_lists) { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + if (is_null($child_lists)) { + throw new \InvalidArgumentException('non-nullable child_lists cannot be null'); } - $this->container['created_at'] = $created_at; + $this->container['child_lists'] = $child_lists; return $this; } /** - * Gets parent_folder_id + * Gets child_nodes * - * @return int + * @return \HubSpot\Client\Crm\Lists\Model\PublicListFolder[] */ - public function getParentFolderId() + public function getChildNodes() { - return $this->container['parent_folder_id']; + return $this->container['child_nodes']; } /** - * Sets parent_folder_id + * Sets child_nodes * - * @param int $parent_folder_id The Id of the folder this folder is in, the root folder is represented as 0. + * @param \HubSpot\Client\Crm\Lists\Model\PublicListFolder[] $child_nodes child_nodes * * @return self */ - public function setParentFolderId($parent_folder_id) + public function setChildNodes($child_nodes) { - if (is_null($parent_folder_id)) { - throw new \InvalidArgumentException('non-nullable parent_folder_id cannot be null'); + if (is_null($child_nodes)) { + throw new \InvalidArgumentException('non-nullable child_nodes cannot be null'); } - $this->container['parent_folder_id'] = $parent_folder_id; + $this->container['child_nodes'] = $child_nodes; return $this; } /** - * Gets child_nodes + * Gets created_at * - * @return \HubSpot\Client\Crm\Lists\Model\PublicListFolder[] + * @return \DateTime|null */ - public function getChildNodes() + public function getCreatedAt() { - return $this->container['child_nodes']; + return $this->container['created_at']; } /** - * Sets child_nodes + * Sets created_at * - * @param \HubSpot\Client\Crm\Lists\Model\PublicListFolder[] $child_nodes child_nodes + * @param \DateTime|null $created_at The time the folder was created at. * * @return self */ - public function setChildNodes($child_nodes) + public function setCreatedAt($created_at) { - if (is_null($child_nodes)) { - throw new \InvalidArgumentException('non-nullable child_nodes cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['child_nodes'] = $child_nodes; + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets id + * + * @return string + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string $id The Id of the folder. + * + * @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; } @@ -466,55 +493,55 @@ public function setName($name) } /** - * Gets id + * Gets parent_folder_id * - * @return int + * @return string */ - public function getId() + public function getParentFolderId() { - return $this->container['id']; + return $this->container['parent_folder_id']; } /** - * Sets id + * Sets parent_folder_id * - * @param int $id The Id of the folder. + * @param string $parent_folder_id The Id of the folder this folder is in, the root folder is represented as 0. * * @return self */ - public function setId($id) + public function setParentFolderId($parent_folder_id) { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + if (is_null($parent_folder_id)) { + throw new \InvalidArgumentException('non-nullable parent_folder_id cannot be null'); } - $this->container['id'] = $id; + $this->container['parent_folder_id'] = $parent_folder_id; return $this; } /** - * Gets child_lists + * Gets updated_at * - * @return int[] + * @return \DateTime|null */ - public function getChildLists() + public function getUpdatedAt() { - return $this->container['child_lists']; + return $this->container['updated_at']; } /** - * Sets child_lists + * Sets updated_at * - * @param int[] $child_lists An array of list Id's contained in this folder. + * @param \DateTime|null $updated_at The time the folder was last updated at. * * @return self */ - public function setChildLists($child_lists) + public function setUpdatedAt($updated_at) { - if (is_null($child_lists)) { - throw new \InvalidArgumentException('non-nullable child_lists cannot be null'); + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); } - $this->container['child_lists'] = $child_lists; + $this->container['updated_at'] = $updated_at; return $this; } @@ -572,41 +599,14 @@ public function setUserId($user_id) return $this; } - - /** - * Gets updated_at - * - * @return \DateTime|null - */ - public function getUpdatedAt() - { - return $this->container['updated_at']; - } - - /** - * Sets updated_at - * - * @param \DateTime|null $updated_at The time the folder was last updated at. - * - * @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 $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]); } @@ -614,12 +614,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; } @@ -644,11 +644,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/Lists/Model/PublicListPermissions.php b/codegen/Crm/Lists/Model/PublicListPermissions.php new file mode 100644 index 000000000..e1b921676 --- /dev/null +++ b/codegen/Crm/Lists/Model/PublicListPermissions.php @@ -0,0 +1,449 @@ + + */ +class PublicListPermissions implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicListPermissions'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'teams_with_edit_access' => 'int[]', + 'users_with_edit_access' => 'int[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'teams_with_edit_access' => 'int32', + 'users_with_edit_access' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'teams_with_edit_access' => false, + 'users_with_edit_access' => 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 = [ + 'teams_with_edit_access' => 'teamsWithEditAccess', + 'users_with_edit_access' => 'usersWithEditAccess' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'teams_with_edit_access' => 'setTeamsWithEditAccess', + 'users_with_edit_access' => 'setUsersWithEditAccess' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'teams_with_edit_access' => 'getTeamsWithEditAccess', + 'users_with_edit_access' => 'getUsersWithEditAccess' + ]; + + /** + * 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('teams_with_edit_access', $data ?? [], null); + $this->setIfExists('users_with_edit_access', $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['teams_with_edit_access'] === null) { + $invalidProperties[] = "'teams_with_edit_access' can't be null"; + } + if ($this->container['users_with_edit_access'] === null) { + $invalidProperties[] = "'users_with_edit_access' 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 teams_with_edit_access + * + * @return int[] + */ + public function getTeamsWithEditAccess() + { + return $this->container['teams_with_edit_access']; + } + + /** + * Sets teams_with_edit_access + * + * @param int[] $teams_with_edit_access teams_with_edit_access + * + * @return self + */ + public function setTeamsWithEditAccess($teams_with_edit_access) + { + if (is_null($teams_with_edit_access)) { + throw new \InvalidArgumentException('non-nullable teams_with_edit_access cannot be null'); + } + $this->container['teams_with_edit_access'] = $teams_with_edit_access; + + return $this; + } + + /** + * Gets users_with_edit_access + * + * @return int[] + */ + public function getUsersWithEditAccess() + { + return $this->container['users_with_edit_access']; + } + + /** + * Sets users_with_edit_access + * + * @param int[] $users_with_edit_access users_with_edit_access + * + * @return self + */ + public function setUsersWithEditAccess($users_with_edit_access) + { + if (is_null($users_with_edit_access)) { + throw new \InvalidArgumentException('non-nullable users_with_edit_access cannot be null'); + } + $this->container['users_with_edit_access'] = $users_with_edit_access; + + 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/Lists/Model/PublicMembershipSettings.php b/codegen/Crm/Lists/Model/PublicMembershipSettings.php new file mode 100644 index 000000000..893cbaa07 --- /dev/null +++ b/codegen/Crm/Lists/Model/PublicMembershipSettings.php @@ -0,0 +1,443 @@ + + */ +class PublicMembershipSettings implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicMembershipSettings'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'include_unassigned' => 'bool', + 'membership_team_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'include_unassigned' => null, + 'membership_team_id' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'include_unassigned' => false, + 'membership_team_id' => 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 = [ + 'include_unassigned' => 'includeUnassigned', + 'membership_team_id' => 'membershipTeamId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'include_unassigned' => 'setIncludeUnassigned', + 'membership_team_id' => 'setMembershipTeamId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'include_unassigned' => 'getIncludeUnassigned', + 'membership_team_id' => 'getMembershipTeamId' + ]; + + /** + * 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('include_unassigned', $data ?? [], null); + $this->setIfExists('membership_team_id', $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 = []; + + 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 include_unassigned + * + * @return bool|null + */ + public function getIncludeUnassigned() + { + return $this->container['include_unassigned']; + } + + /** + * Sets include_unassigned + * + * @param bool|null $include_unassigned Indicates whether unassigned memberships should be included. + * + * @return self + */ + public function setIncludeUnassigned($include_unassigned) + { + if (is_null($include_unassigned)) { + throw new \InvalidArgumentException('non-nullable include_unassigned cannot be null'); + } + $this->container['include_unassigned'] = $include_unassigned; + + return $this; + } + + /** + * Gets membership_team_id + * + * @return int|null + */ + public function getMembershipTeamId() + { + return $this->container['membership_team_id']; + } + + /** + * Sets membership_team_id + * + * @param int|null $membership_team_id The ID of the team associated with the membership. + * + * @return self + */ + public function setMembershipTeamId($membership_team_id) + { + if (is_null($membership_team_id)) { + throw new \InvalidArgumentException('non-nullable membership_team_id cannot be null'); + } + $this->container['membership_team_id'] = $membership_team_id; + + 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/Lists/Model/PublicMigrationMapping.php b/codegen/Crm/Lists/Model/PublicMigrationMapping.php index 3fd3b4933..19a95bc9e 100644 --- a/codegen/Crm/Lists/Model/PublicMigrationMapping.php +++ b/codegen/Crm/Lists/Model/PublicMigrationMapping.php @@ -2,7 +2,7 @@ /** * PublicMigrationMapping * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,8 +57,8 @@ class PublicMigrationMapping implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $openAPITypes = [ - 'list_id' => 'string', - 'legacy_list_id' => 'string' + 'legacy_list_id' => 'string', + 'list_id' => 'string' ]; /** @@ -69,8 +69,8 @@ class PublicMigrationMapping implements ModelInterface, ArrayAccess, \JsonSerial * @psalm-var array */ protected static $openAPIFormats = [ - 'list_id' => null, - 'legacy_list_id' => null + 'legacy_list_id' => null, + 'list_id' => null ]; /** @@ -79,8 +79,8 @@ class PublicMigrationMapping implements ModelInterface, ArrayAccess, \JsonSerial * @var boolean[] */ protected static array $openAPINullables = [ - 'list_id' => false, - 'legacy_list_id' => false + 'legacy_list_id' => false, + 'list_id' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'list_id' => 'listId', - 'legacy_list_id' => 'legacyListId' + 'legacy_list_id' => 'legacyListId', + 'list_id' => 'listId' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'list_id' => 'setListId', - 'legacy_list_id' => 'setLegacyListId' + 'legacy_list_id' => 'setLegacyListId', + 'list_id' => 'setListId' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'list_id' => 'getListId', - 'legacy_list_id' => 'getLegacyListId' + 'legacy_list_id' => 'getLegacyListId', + 'list_id' => 'getListId' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('list_id', $data ?? [], null); $this->setIfExists('legacy_list_id', $data ?? [], null); + $this->setIfExists('list_id', $data ?? [], null); } /** @@ -281,12 +281,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['list_id'] === null) { - $invalidProperties[] = "'list_id' can't be null"; - } if ($this->container['legacy_list_id'] === null) { $invalidProperties[] = "'legacy_list_id' can't be null"; } + if ($this->container['list_id'] === null) { + $invalidProperties[] = "'list_id' can't be null"; + } return $invalidProperties; } @@ -303,66 +303,66 @@ public function valid() /** - * Gets list_id + * Gets legacy_list_id * * @return string */ - public function getListId() + public function getLegacyListId() { - return $this->container['list_id']; + return $this->container['legacy_list_id']; } /** - * Sets list_id + * Sets legacy_list_id * - * @param string $list_id The V3 list id for the list + * @param string $legacy_list_id The legacy list id for the list * * @return self */ - public function setListId($list_id) + public function setLegacyListId($legacy_list_id) { - if (is_null($list_id)) { - throw new \InvalidArgumentException('non-nullable list_id cannot be null'); + if (is_null($legacy_list_id)) { + throw new \InvalidArgumentException('non-nullable legacy_list_id cannot be null'); } - $this->container['list_id'] = $list_id; + $this->container['legacy_list_id'] = $legacy_list_id; return $this; } /** - * Gets legacy_list_id + * Gets list_id * * @return string */ - public function getLegacyListId() + public function getListId() { - return $this->container['legacy_list_id']; + return $this->container['list_id']; } /** - * Sets legacy_list_id + * Sets list_id * - * @param string $legacy_list_id The legacy list id for the list + * @param string $list_id The V3 list id for the list * * @return self */ - public function setLegacyListId($legacy_list_id) + public function setListId($list_id) { - if (is_null($legacy_list_id)) { - throw new \InvalidArgumentException('non-nullable legacy_list_id cannot be null'); + if (is_null($list_id)) { + throw new \InvalidArgumentException('non-nullable list_id cannot be null'); } - $this->container['legacy_list_id'] = $legacy_list_id; + $this->container['list_id'] = $list_id; 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]); } @@ -370,12 +370,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; } @@ -400,11 +400,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/Lists/Model/PublicMonthReference.php b/codegen/Crm/Lists/Model/PublicMonthReference.php index 107fdfe70..e9fa140cf 100644 --- a/codegen/Crm/Lists/Model/PublicMonthReference.php +++ b/codegen/Crm/Lists/Model/PublicMonthReference.php @@ -2,7 +2,7 @@ /** * PublicMonthReference * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,11 +57,11 @@ class PublicMonthReference implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ + 'day' => 'int', 'hour' => 'int', 'millisecond' => 'int', - 'reference_type' => 'string', - 'day' => 'int', 'minute' => 'int', + 'reference_type' => 'string', 'second' => 'int' ]; @@ -73,11 +73,11 @@ class PublicMonthReference implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ + 'day' => 'int32', 'hour' => 'int32', 'millisecond' => 'int32', - 'reference_type' => null, - 'day' => 'int32', 'minute' => 'int32', + 'reference_type' => null, 'second' => 'int32' ]; @@ -87,11 +87,11 @@ class PublicMonthReference implements ModelInterface, ArrayAccess, \JsonSerializ * @var boolean[] */ protected static array $openAPINullables = [ + 'day' => false, 'hour' => false, 'millisecond' => false, - 'reference_type' => false, - 'day' => false, 'minute' => false, + 'reference_type' => false, 'second' => false ]; @@ -181,11 +181,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'day' => 'day', 'hour' => 'hour', 'millisecond' => 'millisecond', - 'reference_type' => 'referenceType', - 'day' => 'day', 'minute' => 'minute', + 'reference_type' => 'referenceType', 'second' => 'second' ]; @@ -195,11 +195,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'day' => 'setDay', 'hour' => 'setHour', 'millisecond' => 'setMillisecond', - 'reference_type' => 'setReferenceType', - 'day' => 'setDay', 'minute' => 'setMinute', + 'reference_type' => 'setReferenceType', 'second' => 'setSecond' ]; @@ -209,11 +209,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'day' => 'getDay', 'hour' => 'getHour', 'millisecond' => 'getMillisecond', - 'reference_type' => 'getReferenceType', - 'day' => 'getDay', 'minute' => 'getMinute', + 'reference_type' => 'getReferenceType', 'second' => 'getSecond' ]; @@ -287,11 +287,11 @@ public function getReferenceTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('day', $data ?? [], null); $this->setIfExists('hour', $data ?? [], null); $this->setIfExists('millisecond', $data ?? [], null); - $this->setIfExists('reference_type', $data ?? [], 'MONTH'); - $this->setIfExists('day', $data ?? [], null); $this->setIfExists('minute', $data ?? [], null); + $this->setIfExists('reference_type', $data ?? [], 'MONTH'); $this->setIfExists('second', $data ?? [], null); } @@ -322,6 +322,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } if ($this->container['reference_type'] === null) { $invalidProperties[] = "'reference_type' can't be null"; } @@ -334,9 +337,6 @@ public function listInvalidProperties() ); } - if ($this->container['day'] === null) { - $invalidProperties[] = "'day' can't be null"; - } return $invalidProperties; } @@ -352,6 +352,33 @@ public function valid() } + /** + * Gets day + * + * @return int + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param int $day The day component of the month reference. + * + * @return self + */ + public function setDay($day) + { + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + /** * Gets hour * @@ -365,7 +392,7 @@ public function getHour() /** * Sets hour * - * @param int|null $hour hour + * @param int|null $hour The hour component of the month reference. * * @return self */ @@ -392,7 +419,7 @@ public function getMillisecond() /** * Sets millisecond * - * @param int|null $millisecond millisecond + * @param int|null $millisecond The millisecond component of the month reference. * * @return self */ @@ -406,6 +433,33 @@ public function setMillisecond($millisecond) return $this; } + /** + * Gets minute + * + * @return int|null + */ + public function getMinute() + { + return $this->container['minute']; + } + + /** + * Sets minute + * + * @param int|null $minute The minute component of the month reference. + * + * @return self + */ + public function setMinute($minute) + { + if (is_null($minute)) { + throw new \InvalidArgumentException('non-nullable minute cannot be null'); + } + $this->container['minute'] = $minute; + + return $this; + } + /** * Gets reference_type * @@ -419,7 +473,7 @@ public function getReferenceType() /** * Sets reference_type * - * @param string $reference_type reference_type + * @param string $reference_type Indicates the type of reference, (MONTH). * * @return self */ @@ -443,60 +497,6 @@ public function setReferenceType($reference_type) return $this; } - /** - * Gets day - * - * @return int - */ - public function getDay() - { - return $this->container['day']; - } - - /** - * Sets day - * - * @param int $day day - * - * @return self - */ - public function setDay($day) - { - if (is_null($day)) { - throw new \InvalidArgumentException('non-nullable day cannot be null'); - } - $this->container['day'] = $day; - - return $this; - } - - /** - * Gets minute - * - * @return int|null - */ - public function getMinute() - { - return $this->container['minute']; - } - - /** - * Sets minute - * - * @param int|null $minute minute - * - * @return self - */ - public function setMinute($minute) - { - if (is_null($minute)) { - throw new \InvalidArgumentException('non-nullable minute cannot be null'); - } - $this->container['minute'] = $minute; - - return $this; - } - /** * Gets second * @@ -510,7 +510,7 @@ public function getSecond() /** * Sets second * - * @param int|null $second second + * @param int|null $second The second component of the month reference. * * @return self */ @@ -526,11 +526,11 @@ public function setSecond($second) /** * 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]); } @@ -538,12 +538,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; } @@ -568,11 +568,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/Lists/Model/PublicMultiStringPropertyOperation.php b/codegen/Crm/Lists/Model/PublicMultiStringPropertyOperation.php index 658908a5f..7999654d9 100644 --- a/codegen/Crm/Lists/Model/PublicMultiStringPropertyOperation.php +++ b/codegen/Crm/Lists/Model/PublicMultiStringPropertyOperation.php @@ -2,7 +2,7 @@ /** * PublicMultiStringPropertyOperation * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -58,9 +58,9 @@ class PublicMultiStringPropertyOperation implements ModelInterface, ArrayAccess, */ protected static $openAPITypes = [ 'include_objects_with_no_value_set' => 'bool', - 'values' => 'string[]', 'operation_type' => 'string', - 'operator' => 'string' + 'operator' => 'string', + 'values' => 'string[]' ]; /** @@ -72,9 +72,9 @@ class PublicMultiStringPropertyOperation implements ModelInterface, ArrayAccess, */ protected static $openAPIFormats = [ 'include_objects_with_no_value_set' => null, - 'values' => null, 'operation_type' => null, - 'operator' => null + 'operator' => null, + 'values' => null ]; /** @@ -84,9 +84,9 @@ class PublicMultiStringPropertyOperation implements ModelInterface, ArrayAccess, */ protected static array $openAPINullables = [ 'include_objects_with_no_value_set' => false, - 'values' => false, 'operation_type' => false, - 'operator' => false + 'operator' => false, + 'values' => false ]; /** @@ -176,9 +176,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', - 'values' => 'values', 'operation_type' => 'operationType', - 'operator' => 'operator' + 'operator' => 'operator', + 'values' => 'values' ]; /** @@ -188,9 +188,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', - 'values' => 'setValues', 'operation_type' => 'setOperationType', - 'operator' => 'setOperator' + 'operator' => 'setOperator', + 'values' => 'setValues' ]; /** @@ -200,9 +200,9 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', - 'values' => 'getValues', 'operation_type' => 'getOperationType', - 'operator' => 'getOperator' + 'operator' => 'getOperator', + 'values' => 'getValues' ]; /** @@ -276,9 +276,9 @@ public function getOperationTypeAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); - $this->setIfExists('values', $data ?? [], null); $this->setIfExists('operation_type', $data ?? [], 'MULTISTRING'); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); } /** @@ -311,9 +311,6 @@ public function listInvalidProperties() if ($this->container['include_objects_with_no_value_set'] === null) { $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; } - if ($this->container['values'] === null) { - $invalidProperties[] = "'values' can't be null"; - } if ($this->container['operation_type'] === null) { $invalidProperties[] = "'operation_type' can't be null"; } @@ -329,6 +326,9 @@ public function listInvalidProperties() if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } + if ($this->container['values'] === null) { + $invalidProperties[] = "'values' can't be null"; + } return $invalidProperties; } @@ -357,7 +357,7 @@ public function getIncludeObjectsWithNoValueSet() /** * Sets include_objects_with_no_value_set * - * @param bool $include_objects_with_no_value_set include_objects_with_no_value_set + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. * * @return self */ @@ -371,33 +371,6 @@ public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_s return $this; } - /** - * Gets values - * - * @return string[] - */ - public function getValues() - { - return $this->container['values']; - } - - /** - * Sets values - * - * @param string[] $values values - * - * @return self - */ - public function setValues($values) - { - if (is_null($values)) { - throw new \InvalidArgumentException('non-nullable values cannot be null'); - } - $this->container['values'] = $values; - - return $this; - } - /** * Gets operation_type * @@ -411,7 +384,7 @@ public function getOperationType() /** * Sets operation_type * - * @param string $operation_type operation_type + * @param string $operation_type Specifies the type of operation (MULTISTRING). * * @return self */ @@ -448,7 +421,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Defines the operation to be applied in the multi-string property operation (IS_EQUAL_TO, IS_NOT_EQUAL_TO, CONTAINS, CONTAINS_EXACTLY, DOES_NOT_CONTAIN, DOES_NOT_CONTAIN_EXACTLY, STARTS_WITH, ENDS_WITH). * * @return self */ @@ -461,14 +434,41 @@ public function setOperator($operator) return $this; } + + /** + * Gets values + * + * @return string[] + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param string[] $values values + * + * @return self + */ + public function setValues($values) + { + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); + } + $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]); } @@ -476,12 +476,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; } @@ -506,11 +506,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/Lists/Model/PublicNotAllFilterBranch.php b/codegen/Crm/Lists/Model/PublicNotAllFilterBranch.php index dd5d262c9..a9e831122 100644 --- a/codegen/Crm/Lists/Model/PublicNotAllFilterBranch.php +++ b/codegen/Crm/Lists/Model/PublicNotAllFilterBranch.php @@ -2,7 +2,7 @@ /** * PublicNotAllFilterBranch * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,9 +57,9 @@ class PublicNotAllFilterBranch implements ModelInterface, ArrayAccess, \JsonSeri * @var string[] */ protected static $openAPITypes = [ + 'filter_branch_operator' => 'string', 'filter_branch_type' => 'string', 'filter_branches' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[]', - 'filter_branch_operator' => 'string', 'filters' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[]' ]; @@ -71,9 +71,9 @@ class PublicNotAllFilterBranch implements ModelInterface, ArrayAccess, \JsonSeri * @psalm-var array */ protected static $openAPIFormats = [ + 'filter_branch_operator' => null, 'filter_branch_type' => null, 'filter_branches' => null, - 'filter_branch_operator' => null, 'filters' => null ]; @@ -83,9 +83,9 @@ class PublicNotAllFilterBranch implements ModelInterface, ArrayAccess, \JsonSeri * @var boolean[] */ protected static array $openAPINullables = [ + 'filter_branch_operator' => false, 'filter_branch_type' => false, 'filter_branches' => false, - 'filter_branch_operator' => false, 'filters' => false ]; @@ -175,9 +175,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'filter_branch_operator' => 'filterBranchOperator', 'filter_branch_type' => 'filterBranchType', 'filter_branches' => 'filterBranches', - 'filter_branch_operator' => 'filterBranchOperator', 'filters' => 'filters' ]; @@ -187,9 +187,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'filter_branch_operator' => 'setFilterBranchOperator', 'filter_branch_type' => 'setFilterBranchType', 'filter_branches' => 'setFilterBranches', - 'filter_branch_operator' => 'setFilterBranchOperator', 'filters' => 'setFilters' ]; @@ -199,9 +199,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'filter_branch_operator' => 'getFilterBranchOperator', 'filter_branch_type' => 'getFilterBranchType', 'filter_branches' => 'getFilterBranches', - 'filter_branch_operator' => 'getFilterBranchOperator', 'filters' => 'getFilters' ]; @@ -275,9 +275,9 @@ public function getFilterBranchTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('filter_branch_operator', $data ?? [], null); $this->setIfExists('filter_branch_type', $data ?? [], 'NOT_ALL'); $this->setIfExists('filter_branches', $data ?? [], null); - $this->setIfExists('filter_branch_operator', $data ?? [], null); $this->setIfExists('filters', $data ?? [], null); } @@ -308,6 +308,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['filter_branch_operator'] === null) { + $invalidProperties[] = "'filter_branch_operator' can't be null"; + } if ($this->container['filter_branch_type'] === null) { $invalidProperties[] = "'filter_branch_type' can't be null"; } @@ -323,9 +326,6 @@ public function listInvalidProperties() if ($this->container['filter_branches'] === null) { $invalidProperties[] = "'filter_branches' can't be null"; } - if ($this->container['filter_branch_operator'] === null) { - $invalidProperties[] = "'filter_branch_operator' can't be null"; - } if ($this->container['filters'] === null) { $invalidProperties[] = "'filters' can't be null"; } @@ -344,6 +344,33 @@ public function valid() } + /** + * Gets filter_branch_operator + * + * @return string + */ + public function getFilterBranchOperator() + { + return $this->container['filter_branch_operator']; + } + + /** + * Sets filter_branch_operator + * + * @param string $filter_branch_operator The operator used to combine filters within the branch (NOT_ALL). + * + * @return self + */ + public function setFilterBranchOperator($filter_branch_operator) + { + if (is_null($filter_branch_operator)) { + throw new \InvalidArgumentException('non-nullable filter_branch_operator cannot be null'); + } + $this->container['filter_branch_operator'] = $filter_branch_operator; + + return $this; + } + /** * Gets filter_branch_type * @@ -357,7 +384,7 @@ public function getFilterBranchType() /** * Sets filter_branch_type * - * @param string $filter_branch_type filter_branch_type + * @param string $filter_branch_type The type of the filter branch (NOT_ALL). * * @return self */ @@ -408,33 +435,6 @@ public function setFilterBranches($filter_branches) return $this; } - /** - * Gets filter_branch_operator - * - * @return string - */ - public function getFilterBranchOperator() - { - return $this->container['filter_branch_operator']; - } - - /** - * Sets filter_branch_operator - * - * @param string $filter_branch_operator filter_branch_operator - * - * @return self - */ - public function setFilterBranchOperator($filter_branch_operator) - { - if (is_null($filter_branch_operator)) { - throw new \InvalidArgumentException('non-nullable filter_branch_operator cannot be null'); - } - $this->container['filter_branch_operator'] = $filter_branch_operator; - - return $this; - } - /** * Gets filters * @@ -464,11 +464,11 @@ public function setFilters($filters) /** * 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]); } @@ -476,12 +476,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; } @@ -506,11 +506,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/Lists/Model/PublicNotAnyFilterBranch.php b/codegen/Crm/Lists/Model/PublicNotAnyFilterBranch.php index 0886271ae..5da5ac096 100644 --- a/codegen/Crm/Lists/Model/PublicNotAnyFilterBranch.php +++ b/codegen/Crm/Lists/Model/PublicNotAnyFilterBranch.php @@ -2,7 +2,7 @@ /** * PublicNotAnyFilterBranch * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,9 +57,9 @@ class PublicNotAnyFilterBranch implements ModelInterface, ArrayAccess, \JsonSeri * @var string[] */ protected static $openAPITypes = [ + 'filter_branch_operator' => 'string', 'filter_branch_type' => 'string', 'filter_branches' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[]', - 'filter_branch_operator' => 'string', 'filters' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[]' ]; @@ -71,9 +71,9 @@ class PublicNotAnyFilterBranch implements ModelInterface, ArrayAccess, \JsonSeri * @psalm-var array */ protected static $openAPIFormats = [ + 'filter_branch_operator' => null, 'filter_branch_type' => null, 'filter_branches' => null, - 'filter_branch_operator' => null, 'filters' => null ]; @@ -83,9 +83,9 @@ class PublicNotAnyFilterBranch implements ModelInterface, ArrayAccess, \JsonSeri * @var boolean[] */ protected static array $openAPINullables = [ + 'filter_branch_operator' => false, 'filter_branch_type' => false, 'filter_branches' => false, - 'filter_branch_operator' => false, 'filters' => false ]; @@ -175,9 +175,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'filter_branch_operator' => 'filterBranchOperator', 'filter_branch_type' => 'filterBranchType', 'filter_branches' => 'filterBranches', - 'filter_branch_operator' => 'filterBranchOperator', 'filters' => 'filters' ]; @@ -187,9 +187,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'filter_branch_operator' => 'setFilterBranchOperator', 'filter_branch_type' => 'setFilterBranchType', 'filter_branches' => 'setFilterBranches', - 'filter_branch_operator' => 'setFilterBranchOperator', 'filters' => 'setFilters' ]; @@ -199,9 +199,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'filter_branch_operator' => 'getFilterBranchOperator', 'filter_branch_type' => 'getFilterBranchType', 'filter_branches' => 'getFilterBranches', - 'filter_branch_operator' => 'getFilterBranchOperator', 'filters' => 'getFilters' ]; @@ -275,9 +275,9 @@ public function getFilterBranchTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('filter_branch_operator', $data ?? [], null); $this->setIfExists('filter_branch_type', $data ?? [], 'NOT_ANY'); $this->setIfExists('filter_branches', $data ?? [], null); - $this->setIfExists('filter_branch_operator', $data ?? [], null); $this->setIfExists('filters', $data ?? [], null); } @@ -308,6 +308,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['filter_branch_operator'] === null) { + $invalidProperties[] = "'filter_branch_operator' can't be null"; + } if ($this->container['filter_branch_type'] === null) { $invalidProperties[] = "'filter_branch_type' can't be null"; } @@ -323,9 +326,6 @@ public function listInvalidProperties() if ($this->container['filter_branches'] === null) { $invalidProperties[] = "'filter_branches' can't be null"; } - if ($this->container['filter_branch_operator'] === null) { - $invalidProperties[] = "'filter_branch_operator' can't be null"; - } if ($this->container['filters'] === null) { $invalidProperties[] = "'filters' can't be null"; } @@ -344,6 +344,33 @@ public function valid() } + /** + * Gets filter_branch_operator + * + * @return string + */ + public function getFilterBranchOperator() + { + return $this->container['filter_branch_operator']; + } + + /** + * Sets filter_branch_operator + * + * @param string $filter_branch_operator Specifies the logical operator used to combine filters within the branch (NOT_ANY). + * + * @return self + */ + public function setFilterBranchOperator($filter_branch_operator) + { + if (is_null($filter_branch_operator)) { + throw new \InvalidArgumentException('non-nullable filter_branch_operator cannot be null'); + } + $this->container['filter_branch_operator'] = $filter_branch_operator; + + return $this; + } + /** * Gets filter_branch_type * @@ -357,7 +384,7 @@ public function getFilterBranchType() /** * Sets filter_branch_type * - * @param string $filter_branch_type filter_branch_type + * @param string $filter_branch_type Indicates the type of filter branch (NOT_ANY). * * @return self */ @@ -408,33 +435,6 @@ public function setFilterBranches($filter_branches) return $this; } - /** - * Gets filter_branch_operator - * - * @return string - */ - public function getFilterBranchOperator() - { - return $this->container['filter_branch_operator']; - } - - /** - * Sets filter_branch_operator - * - * @param string $filter_branch_operator filter_branch_operator - * - * @return self - */ - public function setFilterBranchOperator($filter_branch_operator) - { - if (is_null($filter_branch_operator)) { - throw new \InvalidArgumentException('non-nullable filter_branch_operator cannot be null'); - } - $this->container['filter_branch_operator'] = $filter_branch_operator; - - return $this; - } - /** * Gets filters * @@ -464,11 +464,11 @@ public function setFilters($filters) /** * 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]); } @@ -476,12 +476,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; } @@ -506,11 +506,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/Lists/Model/PublicNowReference.php b/codegen/Crm/Lists/Model/PublicNowReference.php index 4f59992c3..a6174a423 100644 --- a/codegen/Crm/Lists/Model/PublicNowReference.php +++ b/codegen/Crm/Lists/Model/PublicNowReference.php @@ -2,7 +2,7 @@ /** * PublicNowReference * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -59,8 +59,8 @@ class PublicNowReference implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPITypes = [ 'hour' => 'int', 'millisecond' => 'int', - 'reference_type' => 'string', 'minute' => 'int', + 'reference_type' => 'string', 'second' => 'int' ]; @@ -74,8 +74,8 @@ class PublicNowReference implements ModelInterface, ArrayAccess, \JsonSerializab protected static $openAPIFormats = [ 'hour' => 'int32', 'millisecond' => 'int32', - 'reference_type' => null, 'minute' => 'int32', + 'reference_type' => null, 'second' => 'int32' ]; @@ -87,8 +87,8 @@ class PublicNowReference implements ModelInterface, ArrayAccess, \JsonSerializab protected static array $openAPINullables = [ 'hour' => false, 'millisecond' => false, - 'reference_type' => false, 'minute' => false, + 'reference_type' => false, 'second' => false ]; @@ -180,8 +180,8 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'hour' => 'hour', 'millisecond' => 'millisecond', - 'reference_type' => 'referenceType', 'minute' => 'minute', + 'reference_type' => 'referenceType', 'second' => 'second' ]; @@ -193,8 +193,8 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'hour' => 'setHour', 'millisecond' => 'setMillisecond', - 'reference_type' => 'setReferenceType', 'minute' => 'setMinute', + 'reference_type' => 'setReferenceType', 'second' => 'setSecond' ]; @@ -206,8 +206,8 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'hour' => 'getHour', 'millisecond' => 'getMillisecond', - 'reference_type' => 'getReferenceType', 'minute' => 'getMinute', + 'reference_type' => 'getReferenceType', 'second' => 'getSecond' ]; @@ -283,8 +283,8 @@ public function __construct(?array $data = null) { $this->setIfExists('hour', $data ?? [], null); $this->setIfExists('millisecond', $data ?? [], null); - $this->setIfExists('reference_type', $data ?? [], 'NOW'); $this->setIfExists('minute', $data ?? [], null); + $this->setIfExists('reference_type', $data ?? [], 'NOW'); $this->setIfExists('second', $data ?? [], null); } @@ -355,7 +355,7 @@ public function getHour() /** * Sets hour * - * @param int|null $hour hour + * @param int|null $hour The hour component of the current time reference. * * @return self */ @@ -382,7 +382,7 @@ public function getMillisecond() /** * Sets millisecond * - * @param int|null $millisecond millisecond + * @param int|null $millisecond The millisecond component of the current time reference. * * @return self */ @@ -396,6 +396,33 @@ public function setMillisecond($millisecond) return $this; } + /** + * Gets minute + * + * @return int|null + */ + public function getMinute() + { + return $this->container['minute']; + } + + /** + * Sets minute + * + * @param int|null $minute The minute component of the current time reference. + * + * @return self + */ + public function setMinute($minute) + { + if (is_null($minute)) { + throw new \InvalidArgumentException('non-nullable minute cannot be null'); + } + $this->container['minute'] = $minute; + + return $this; + } + /** * Gets reference_type * @@ -409,7 +436,7 @@ public function getReferenceType() /** * Sets reference_type * - * @param string $reference_type reference_type + * @param string $reference_type Indicates the type of reference (NOW). * * @return self */ @@ -433,33 +460,6 @@ public function setReferenceType($reference_type) return $this; } - /** - * Gets minute - * - * @return int|null - */ - public function getMinute() - { - return $this->container['minute']; - } - - /** - * Sets minute - * - * @param int|null $minute minute - * - * @return self - */ - public function setMinute($minute) - { - if (is_null($minute)) { - throw new \InvalidArgumentException('non-nullable minute cannot be null'); - } - $this->container['minute'] = $minute; - - return $this; - } - /** * Gets second * @@ -473,7 +473,7 @@ public function getSecond() /** * Sets second * - * @param int|null $second second + * @param int|null $second The second component of the current time reference. * * @return self */ @@ -489,11 +489,11 @@ public function setSecond($second) /** * 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]); } @@ -501,12 +501,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; } @@ -531,11 +531,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/Lists/Model/PublicNumAssociationsFilter.php b/codegen/Crm/Lists/Model/PublicNumAssociationsFilter.php index 2f7e7d3bb..677b29d24 100644 --- a/codegen/Crm/Lists/Model/PublicNumAssociationsFilter.php +++ b/codegen/Crm/Lists/Model/PublicNumAssociationsFilter.php @@ -2,7 +2,7 @@ /** * PublicNumAssociationsFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,9 +57,9 @@ class PublicNumAssociationsFilter implements ModelInterface, ArrayAccess, \JsonS * @var string[] */ protected static $openAPITypes = [ - 'coalescing_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', - 'association_type_id' => 'int', 'association_category' => 'string', + 'association_type_id' => 'int', + 'coalescing_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicNumAssociationsFilterCoalescingRefineBy', 'filter_type' => 'string' ]; @@ -71,9 +71,9 @@ class PublicNumAssociationsFilter implements ModelInterface, ArrayAccess, \JsonS * @psalm-var array */ protected static $openAPIFormats = [ - 'coalescing_refine_by' => null, - 'association_type_id' => 'int32', 'association_category' => null, + 'association_type_id' => 'int32', + 'coalescing_refine_by' => null, 'filter_type' => null ]; @@ -83,9 +83,9 @@ class PublicNumAssociationsFilter implements ModelInterface, ArrayAccess, \JsonS * @var boolean[] */ protected static array $openAPINullables = [ - 'coalescing_refine_by' => false, - 'association_type_id' => false, 'association_category' => false, + 'association_type_id' => false, + 'coalescing_refine_by' => false, 'filter_type' => false ]; @@ -175,9 +175,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'coalescing_refine_by' => 'coalescingRefineBy', - 'association_type_id' => 'associationTypeId', 'association_category' => 'associationCategory', + 'association_type_id' => 'associationTypeId', + 'coalescing_refine_by' => 'coalescingRefineBy', 'filter_type' => 'filterType' ]; @@ -187,9 +187,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'coalescing_refine_by' => 'setCoalescingRefineBy', - 'association_type_id' => 'setAssociationTypeId', 'association_category' => 'setAssociationCategory', + 'association_type_id' => 'setAssociationTypeId', + 'coalescing_refine_by' => 'setCoalescingRefineBy', 'filter_type' => 'setFilterType' ]; @@ -199,9 +199,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'coalescing_refine_by' => 'getCoalescingRefineBy', - 'association_type_id' => 'getAssociationTypeId', 'association_category' => 'getAssociationCategory', + 'association_type_id' => 'getAssociationTypeId', + 'coalescing_refine_by' => 'getCoalescingRefineBy', 'filter_type' => 'getFilterType' ]; @@ -275,9 +275,9 @@ public function getFilterTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('coalescing_refine_by', $data ?? [], null); - $this->setIfExists('association_type_id', $data ?? [], null); $this->setIfExists('association_category', $data ?? [], null); + $this->setIfExists('association_type_id', $data ?? [], null); + $this->setIfExists('coalescing_refine_by', $data ?? [], null); $this->setIfExists('filter_type', $data ?? [], 'NUM_ASSOCIATIONS'); } @@ -308,14 +308,14 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['coalescing_refine_by'] === null) { - $invalidProperties[] = "'coalescing_refine_by' can't be null"; + if ($this->container['association_category'] === null) { + $invalidProperties[] = "'association_category' can't be null"; } if ($this->container['association_type_id'] === null) { $invalidProperties[] = "'association_type_id' can't be null"; } - if ($this->container['association_category'] === null) { - $invalidProperties[] = "'association_category' can't be null"; + if ($this->container['coalescing_refine_by'] === null) { + $invalidProperties[] = "'coalescing_refine_by' can't be null"; } if ($this->container['filter_type'] === null) { $invalidProperties[] = "'filter_type' can't be null"; @@ -345,28 +345,28 @@ public function valid() /** - * Gets coalescing_refine_by + * Gets association_category * - * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy + * @return string */ - public function getCoalescingRefineBy() + public function getAssociationCategory() { - return $this->container['coalescing_refine_by']; + return $this->container['association_category']; } /** - * Sets coalescing_refine_by + * Sets association_category * - * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy $coalescing_refine_by coalescing_refine_by + * @param string $association_category Defines the category of the association (HUBSPOT_DEFINED, USER_DEFINED, INTEGRATOR_DEFINED, WORK). * * @return self */ - public function setCoalescingRefineBy($coalescing_refine_by) + public function setAssociationCategory($association_category) { - if (is_null($coalescing_refine_by)) { - throw new \InvalidArgumentException('non-nullable coalescing_refine_by cannot be null'); + if (is_null($association_category)) { + throw new \InvalidArgumentException('non-nullable association_category cannot be null'); } - $this->container['coalescing_refine_by'] = $coalescing_refine_by; + $this->container['association_category'] = $association_category; return $this; } @@ -384,7 +384,7 @@ public function getAssociationTypeId() /** * Sets association_type_id * - * @param int $association_type_id association_type_id + * @param int $association_type_id The ID representing the type of association being filtered. * * @return self */ @@ -399,28 +399,28 @@ public function setAssociationTypeId($association_type_id) } /** - * Gets association_category + * Gets coalescing_refine_by * - * @return string + * @return \HubSpot\Client\Crm\Lists\Model\PublicNumAssociationsFilterCoalescingRefineBy */ - public function getAssociationCategory() + public function getCoalescingRefineBy() { - return $this->container['association_category']; + return $this->container['coalescing_refine_by']; } /** - * Sets association_category + * Sets coalescing_refine_by * - * @param string $association_category association_category + * @param \HubSpot\Client\Crm\Lists\Model\PublicNumAssociationsFilterCoalescingRefineBy $coalescing_refine_by coalescing_refine_by * * @return self */ - public function setAssociationCategory($association_category) + public function setCoalescingRefineBy($coalescing_refine_by) { - if (is_null($association_category)) { - throw new \InvalidArgumentException('non-nullable association_category cannot be null'); + if (is_null($coalescing_refine_by)) { + throw new \InvalidArgumentException('non-nullable coalescing_refine_by cannot be null'); } - $this->container['association_category'] = $association_category; + $this->container['coalescing_refine_by'] = $coalescing_refine_by; return $this; } @@ -438,7 +438,7 @@ public function getFilterType() /** * Sets filter_type * - * @param string $filter_type filter_type + * @param string $filter_type Indicates the type of filter being applied (NUM_ASSOCIATIONS). * * @return self */ @@ -464,11 +464,11 @@ public function setFilterType($filter_type) /** * 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]); } @@ -476,12 +476,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; } @@ -506,11 +506,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/Lists/Model/PublicNumAssociationsFilterCoalescingRefineBy.php b/codegen/Crm/Lists/Model/PublicNumAssociationsFilterCoalescingRefineBy.php new file mode 100644 index 000000000..2cd30cf21 --- /dev/null +++ b/codegen/Crm/Lists/Model/PublicNumAssociationsFilterCoalescingRefineBy.php @@ -0,0 +1,1175 @@ + + */ +class PublicNumAssociationsFilterCoalescingRefineBy implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicNumAssociationsFilter_coalescingRefineBy'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'max_occurrences' => 'int', + 'min_occurrences' => 'int', + 'type' => 'string', + 'set_type' => 'string', + 'comparison' => 'string', + 'time_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', + 'lower_bound_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', + 'range_type' => 'string', + 'upper_bound_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', + 'timestamp' => 'int', + 'lower_timestamp' => 'int', + 'upper_timestamp' => 'int', + 'endpoint_behavior' => 'string', + 'include_objects_with_no_value_set' => 'bool', + 'operation_type' => 'string', + 'operator' => 'string', + 'property_parser' => 'string', + 'time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint', + 'lower_bound_endpoint_behavior' => 'string', + 'lower_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'string', + 'upper_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'max_occurrences' => 'int32', + 'min_occurrences' => 'int32', + 'type' => null, + 'set_type' => null, + 'comparison' => null, + 'time_offset' => null, + 'lower_bound_offset' => null, + 'range_type' => null, + 'upper_bound_offset' => null, + 'timestamp' => 'int64', + 'lower_timestamp' => 'int64', + 'upper_timestamp' => 'int64', + 'endpoint_behavior' => null, + 'include_objects_with_no_value_set' => null, + 'operation_type' => null, + 'operator' => null, + 'property_parser' => null, + 'time_point' => null, + 'lower_bound_endpoint_behavior' => null, + 'lower_bound_time_point' => null, + 'upper_bound_endpoint_behavior' => null, + 'upper_bound_time_point' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'max_occurrences' => false, + 'min_occurrences' => false, + 'type' => false, + 'set_type' => false, + 'comparison' => false, + 'time_offset' => false, + 'lower_bound_offset' => false, + 'range_type' => false, + 'upper_bound_offset' => false, + 'timestamp' => false, + 'lower_timestamp' => false, + 'upper_timestamp' => false, + 'endpoint_behavior' => false, + 'include_objects_with_no_value_set' => false, + 'operation_type' => false, + 'operator' => false, + 'property_parser' => false, + 'time_point' => false, + 'lower_bound_endpoint_behavior' => false, + 'lower_bound_time_point' => false, + 'upper_bound_endpoint_behavior' => false, + 'upper_bound_time_point' => 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 = [ + 'max_occurrences' => 'maxOccurrences', + 'min_occurrences' => 'minOccurrences', + 'type' => 'type', + 'set_type' => 'setType', + 'comparison' => 'comparison', + 'time_offset' => 'timeOffset', + 'lower_bound_offset' => 'lowerBoundOffset', + 'range_type' => 'rangeType', + 'upper_bound_offset' => 'upperBoundOffset', + 'timestamp' => 'timestamp', + 'lower_timestamp' => 'lowerTimestamp', + 'upper_timestamp' => 'upperTimestamp', + 'endpoint_behavior' => 'endpointBehavior', + 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', + 'operation_type' => 'operationType', + 'operator' => 'operator', + 'property_parser' => 'propertyParser', + 'time_point' => 'timePoint', + 'lower_bound_endpoint_behavior' => 'lowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'lowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'upperBoundEndpointBehavior', + 'upper_bound_time_point' => 'upperBoundTimePoint' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'max_occurrences' => 'setMaxOccurrences', + 'min_occurrences' => 'setMinOccurrences', + 'type' => 'setType', + 'set_type' => 'setSetType', + 'comparison' => 'setComparison', + 'time_offset' => 'setTimeOffset', + 'lower_bound_offset' => 'setLowerBoundOffset', + 'range_type' => 'setRangeType', + 'upper_bound_offset' => 'setUpperBoundOffset', + 'timestamp' => 'setTimestamp', + 'lower_timestamp' => 'setLowerTimestamp', + 'upper_timestamp' => 'setUpperTimestamp', + 'endpoint_behavior' => 'setEndpointBehavior', + 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', + 'operation_type' => 'setOperationType', + 'operator' => 'setOperator', + 'property_parser' => 'setPropertyParser', + 'time_point' => 'setTimePoint', + 'lower_bound_endpoint_behavior' => 'setLowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'setLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'setUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'setUpperBoundTimePoint' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'max_occurrences' => 'getMaxOccurrences', + 'min_occurrences' => 'getMinOccurrences', + 'type' => 'getType', + 'set_type' => 'getSetType', + 'comparison' => 'getComparison', + 'time_offset' => 'getTimeOffset', + 'lower_bound_offset' => 'getLowerBoundOffset', + 'range_type' => 'getRangeType', + 'upper_bound_offset' => 'getUpperBoundOffset', + 'timestamp' => 'getTimestamp', + 'lower_timestamp' => 'getLowerTimestamp', + 'upper_timestamp' => 'getUpperTimestamp', + 'endpoint_behavior' => 'getEndpointBehavior', + 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', + 'operation_type' => 'getOperationType', + 'operator' => 'getOperator', + 'property_parser' => 'getPropertyParser', + 'time_point' => 'getTimePoint', + 'lower_bound_endpoint_behavior' => 'getLowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'getLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'getUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'getUpperBoundTimePoint' + ]; + + /** + * 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('max_occurrences', $data ?? [], null); + $this->setIfExists('min_occurrences', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('set_type', $data ?? [], null); + $this->setIfExists('comparison', $data ?? [], null); + $this->setIfExists('time_offset', $data ?? [], null); + $this->setIfExists('lower_bound_offset', $data ?? [], null); + $this->setIfExists('range_type', $data ?? [], null); + $this->setIfExists('upper_bound_offset', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('lower_timestamp', $data ?? [], null); + $this->setIfExists('upper_timestamp', $data ?? [], null); + $this->setIfExists('endpoint_behavior', $data ?? [], null); + $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); + $this->setIfExists('operation_type', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('property_parser', $data ?? [], null); + $this->setIfExists('time_point', $data ?? [], null); + $this->setIfExists('lower_bound_endpoint_behavior', $data ?? [], null); + $this->setIfExists('lower_bound_time_point', $data ?? [], null); + $this->setIfExists('upper_bound_endpoint_behavior', $data ?? [], null); + $this->setIfExists('upper_bound_time_point', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; + } + + /** + * 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['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['set_type'] === null) { + $invalidProperties[] = "'set_type' can't be null"; + } + if ($this->container['comparison'] === null) { + $invalidProperties[] = "'comparison' can't be null"; + } + if ($this->container['time_offset'] === null) { + $invalidProperties[] = "'time_offset' can't be null"; + } + if ($this->container['lower_bound_offset'] === null) { + $invalidProperties[] = "'lower_bound_offset' can't be null"; + } + if ($this->container['range_type'] === null) { + $invalidProperties[] = "'range_type' can't be null"; + } + if ($this->container['upper_bound_offset'] === null) { + $invalidProperties[] = "'upper_bound_offset' can't be null"; + } + if ($this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } + if ($this->container['lower_timestamp'] === null) { + $invalidProperties[] = "'lower_timestamp' can't be null"; + } + if ($this->container['upper_timestamp'] === null) { + $invalidProperties[] = "'upper_timestamp' can't be null"; + } + if ($this->container['include_objects_with_no_value_set'] === null) { + $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; + } + if ($this->container['operation_type'] === null) { + $invalidProperties[] = "'operation_type' can't be null"; + } + if ($this->container['operator'] === null) { + $invalidProperties[] = "'operator' can't be null"; + } + if ($this->container['time_point'] === null) { + $invalidProperties[] = "'time_point' can't be null"; + } + if ($this->container['lower_bound_time_point'] === null) { + $invalidProperties[] = "'lower_bound_time_point' can't be null"; + } + if ($this->container['upper_bound_time_point'] === null) { + $invalidProperties[] = "'upper_bound_time_point' 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 max_occurrences + * + * @return int|null + */ + public function getMaxOccurrences() + { + return $this->container['max_occurrences']; + } + + /** + * Sets max_occurrences + * + * @param int|null $max_occurrences The maximum number of occurrences allowed. + * + * @return self + */ + public function setMaxOccurrences($max_occurrences) + { + if (is_null($max_occurrences)) { + throw new \InvalidArgumentException('non-nullable max_occurrences cannot be null'); + } + $this->container['max_occurrences'] = $max_occurrences; + + return $this; + } + + /** + * Gets min_occurrences + * + * @return int|null + */ + public function getMinOccurrences() + { + return $this->container['min_occurrences']; + } + + /** + * Sets min_occurrences + * + * @param int|null $min_occurrences The minimum number of occurrences required. + * + * @return self + */ + public function setMinOccurrences($min_occurrences) + { + if (is_null($min_occurrences)) { + throw new \InvalidArgumentException('non-nullable min_occurrences cannot be null'); + } + $this->container['min_occurrences'] = $min_occurrences; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Defines the type of operation being performed. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets set_type + * + * @return string + */ + public function getSetType() + { + return $this->container['set_type']; + } + + /** + * Sets set_type + * + * @param string $set_type Indicates the specific set type used in the refinement (ALL, ALL_INCLUDE_EMPTY, ANY, NONE, NONE_EXCLUDE_EMPTY, ANY_INCLUDE_EMPTY). + * + * @return self + */ + public function setSetType($set_type) + { + if (is_null($set_type)) { + throw new \InvalidArgumentException('non-nullable set_type cannot be null'); + } + $this->container['set_type'] = $set_type; + + return $this; + } + + /** + * Gets comparison + * + * @return string + */ + public function getComparison() + { + return $this->container['comparison']; + } + + /** + * Sets comparison + * + * @param string $comparison Timestamp comparison options (BEFORE, AFTER) + * + * @return self + */ + public function setComparison($comparison) + { + if (is_null($comparison)) { + throw new \InvalidArgumentException('non-nullable comparison cannot be null'); + } + $this->container['comparison'] = $comparison; + + return $this; + } + + /** + * Gets time_offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset + */ + public function getTimeOffset() + { + return $this->container['time_offset']; + } + + /** + * Sets time_offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $time_offset time_offset + * + * @return self + */ + public function setTimeOffset($time_offset) + { + if (is_null($time_offset)) { + throw new \InvalidArgumentException('non-nullable time_offset cannot be null'); + } + $this->container['time_offset'] = $time_offset; + + return $this; + } + + /** + * Gets lower_bound_offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset + */ + public function getLowerBoundOffset() + { + return $this->container['lower_bound_offset']; + } + + /** + * Sets lower_bound_offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $lower_bound_offset lower_bound_offset + * + * @return self + */ + public function setLowerBoundOffset($lower_bound_offset) + { + if (is_null($lower_bound_offset)) { + throw new \InvalidArgumentException('non-nullable lower_bound_offset cannot be null'); + } + $this->container['lower_bound_offset'] = $lower_bound_offset; + + return $this; + } + + /** + * Gets range_type + * + * @return string + */ + public function getRangeType() + { + return $this->container['range_type']; + } + + /** + * Sets range_type + * + * @param string $range_type Type of range of refinement critaria (BETWEEN, NOT_BETWEEN) + * + * @return self + */ + public function setRangeType($range_type) + { + if (is_null($range_type)) { + throw new \InvalidArgumentException('non-nullable range_type cannot be null'); + } + $this->container['range_type'] = $range_type; + + return $this; + } + + /** + * Gets upper_bound_offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset + */ + public function getUpperBoundOffset() + { + return $this->container['upper_bound_offset']; + } + + /** + * Sets upper_bound_offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $upper_bound_offset upper_bound_offset + * + * @return self + */ + public function setUpperBoundOffset($upper_bound_offset) + { + if (is_null($upper_bound_offset)) { + throw new \InvalidArgumentException('non-nullable upper_bound_offset cannot be null'); + } + $this->container['upper_bound_offset'] = $upper_bound_offset; + + return $this; + } + + /** + * Gets timestamp + * + * @return int + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param int $timestamp Timestamp to be used in refine by criteria + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets lower_timestamp + * + * @return int + */ + public function getLowerTimestamp() + { + return $this->container['lower_timestamp']; + } + + /** + * Sets lower_timestamp + * + * @param int $lower_timestamp Lower range timestamp of refinement criteria + * + * @return self + */ + public function setLowerTimestamp($lower_timestamp) + { + if (is_null($lower_timestamp)) { + throw new \InvalidArgumentException('non-nullable lower_timestamp cannot be null'); + } + $this->container['lower_timestamp'] = $lower_timestamp; + + return $this; + } + + /** + * Gets upper_timestamp + * + * @return int + */ + public function getUpperTimestamp() + { + return $this->container['upper_timestamp']; + } + + /** + * Sets upper_timestamp + * + * @param int $upper_timestamp Upper range timestamp of refinement criteria + * + * @return self + */ + public function setUpperTimestamp($upper_timestamp) + { + if (is_null($upper_timestamp)) { + throw new \InvalidArgumentException('non-nullable upper_timestamp cannot be null'); + } + $this->container['upper_timestamp'] = $upper_timestamp; + + return $this; + } + + /** + * Gets endpoint_behavior + * + * @return string|null + */ + public function getEndpointBehavior() + { + return $this->container['endpoint_behavior']; + } + + /** + * Sets endpoint_behavior + * + * @param string|null $endpoint_behavior Describes the behavior at the endpoint of the time point operation. + * + * @return self + */ + public function setEndpointBehavior($endpoint_behavior) + { + if (is_null($endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable endpoint_behavior cannot be null'); + } + $this->container['endpoint_behavior'] = $endpoint_behavior; + + return $this; + } + + /** + * Gets include_objects_with_no_value_set + * + * @return bool + */ + public function getIncludeObjectsWithNoValueSet() + { + return $this->container['include_objects_with_no_value_set']; + } + + /** + * Sets include_objects_with_no_value_set + * + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. + * + * @return self + */ + public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_set) + { + if (is_null($include_objects_with_no_value_set)) { + throw new \InvalidArgumentException('non-nullable include_objects_with_no_value_set cannot be null'); + } + $this->container['include_objects_with_no_value_set'] = $include_objects_with_no_value_set; + + return $this; + } + + /** + * Gets operation_type + * + * @return string + */ + public function getOperationType() + { + return $this->container['operation_type']; + } + + /** + * Sets operation_type + * + * @param string $operation_type Specifies the type of operation (TIME_RANGED). + * + * @return self + */ + public function setOperationType($operation_type) + { + if (is_null($operation_type)) { + throw new \InvalidArgumentException('non-nullable operation_type cannot be null'); + } + $this->container['operation_type'] = $operation_type; + + return $this; + } + + /** + * Gets operator + * + * @return string + */ + public function getOperator() + { + return $this->container['operator']; + } + + /** + * Sets operator + * + * @param string $operator Defines the operation to be applied within the time range (IS_BETWEEN, IS_NOT_BETWEEN). + * + * @return self + */ + public function setOperator($operator) + { + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); + } + $this->container['operator'] = $operator; + + return $this; + } + + /** + * Gets property_parser + * + * @return string|null + */ + public function getPropertyParser() + { + return $this->container['property_parser']; + } + + /** + * Sets property_parser + * + * @param string|null $property_parser Specifies the parser used for the property in the operation. + * + * @return self + */ + public function setPropertyParser($property_parser) + { + if (is_null($property_parser)) { + throw new \InvalidArgumentException('non-nullable property_parser cannot be null'); + } + $this->container['property_parser'] = $property_parser; + + return $this; + } + + /** + * Gets time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint + */ + public function getTimePoint() + { + return $this->container['time_point']; + } + + /** + * Sets time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint $time_point time_point + * + * @return self + */ + public function setTimePoint($time_point) + { + if (is_null($time_point)) { + throw new \InvalidArgumentException('non-nullable time_point cannot be null'); + } + $this->container['time_point'] = $time_point; + + return $this; + } + + /** + * Gets lower_bound_endpoint_behavior + * + * @return string|null + */ + public function getLowerBoundEndpointBehavior() + { + return $this->container['lower_bound_endpoint_behavior']; + } + + /** + * Sets lower_bound_endpoint_behavior + * + * @param string|null $lower_bound_endpoint_behavior Describes the behavior at the lower bound endpoint of the time range. + * + * @return self + */ + public function setLowerBoundEndpointBehavior($lower_bound_endpoint_behavior) + { + if (is_null($lower_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable lower_bound_endpoint_behavior cannot be null'); + } + $this->container['lower_bound_endpoint_behavior'] = $lower_bound_endpoint_behavior; + + return $this; + } + + /** + * Gets lower_bound_time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint + */ + public function getLowerBoundTimePoint() + { + return $this->container['lower_bound_time_point']; + } + + /** + * Sets lower_bound_time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint $lower_bound_time_point lower_bound_time_point + * + * @return self + */ + public function setLowerBoundTimePoint($lower_bound_time_point) + { + if (is_null($lower_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable lower_bound_time_point cannot be null'); + } + $this->container['lower_bound_time_point'] = $lower_bound_time_point; + + return $this; + } + + /** + * Gets upper_bound_endpoint_behavior + * + * @return string|null + */ + public function getUpperBoundEndpointBehavior() + { + return $this->container['upper_bound_endpoint_behavior']; + } + + /** + * Sets upper_bound_endpoint_behavior + * + * @param string|null $upper_bound_endpoint_behavior Describes the behavior at the upper bound endpoint of the time range. + * + * @return self + */ + public function setUpperBoundEndpointBehavior($upper_bound_endpoint_behavior) + { + if (is_null($upper_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable upper_bound_endpoint_behavior cannot be null'); + } + $this->container['upper_bound_endpoint_behavior'] = $upper_bound_endpoint_behavior; + + return $this; + } + + /** + * Gets upper_bound_time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint + */ + public function getUpperBoundTimePoint() + { + return $this->container['upper_bound_time_point']; + } + + /** + * Sets upper_bound_time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint $upper_bound_time_point upper_bound_time_point + * + * @return self + */ + public function setUpperBoundTimePoint($upper_bound_time_point) + { + if (is_null($upper_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable upper_bound_time_point cannot be null'); + } + $this->container['upper_bound_time_point'] = $upper_bound_time_point; + + 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/Lists/Model/PublicNumOccurrencesRefineBy.php b/codegen/Crm/Lists/Model/PublicNumOccurrencesRefineBy.php index 1928f1c82..54715d46f 100644 --- a/codegen/Crm/Lists/Model/PublicNumOccurrencesRefineBy.php +++ b/codegen/Crm/Lists/Model/PublicNumOccurrencesRefineBy.php @@ -2,7 +2,7 @@ /** * PublicNumOccurrencesRefineBy * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -58,8 +58,8 @@ class PublicNumOccurrencesRefineBy implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'max_occurrences' => 'int', - 'type' => 'string', - 'min_occurrences' => 'int' + 'min_occurrences' => 'int', + 'type' => 'string' ]; /** @@ -71,8 +71,8 @@ class PublicNumOccurrencesRefineBy implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'max_occurrences' => 'int32', - 'type' => null, - 'min_occurrences' => 'int32' + 'min_occurrences' => 'int32', + 'type' => null ]; /** @@ -82,8 +82,8 @@ class PublicNumOccurrencesRefineBy implements ModelInterface, ArrayAccess, \Json */ protected static array $openAPINullables = [ 'max_occurrences' => false, - 'type' => false, - 'min_occurrences' => false + 'min_occurrences' => false, + 'type' => false ]; /** @@ -173,8 +173,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'max_occurrences' => 'maxOccurrences', - 'type' => 'type', - 'min_occurrences' => 'minOccurrences' + 'min_occurrences' => 'minOccurrences', + 'type' => 'type' ]; /** @@ -184,8 +184,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'max_occurrences' => 'setMaxOccurrences', - 'type' => 'setType', - 'min_occurrences' => 'setMinOccurrences' + 'min_occurrences' => 'setMinOccurrences', + 'type' => 'setType' ]; /** @@ -195,8 +195,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'max_occurrences' => 'getMaxOccurrences', - 'type' => 'getType', - 'min_occurrences' => 'getMinOccurrences' + 'min_occurrences' => 'getMinOccurrences', + 'type' => 'getType' ]; /** @@ -270,8 +270,8 @@ public function getTypeAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('max_occurrences', $data ?? [], null); - $this->setIfExists('type', $data ?? [], 'NUM_OCCURRENCES'); $this->setIfExists('min_occurrences', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'NUM_OCCURRENCES'); } /** @@ -341,7 +341,7 @@ public function getMaxOccurrences() /** * Sets max_occurrences * - * @param int|null $max_occurrences max_occurrences + * @param int|null $max_occurrences The maximum number of occurrences allowed. * * @return self */ @@ -355,6 +355,33 @@ public function setMaxOccurrences($max_occurrences) return $this; } + /** + * Gets min_occurrences + * + * @return int|null + */ + public function getMinOccurrences() + { + return $this->container['min_occurrences']; + } + + /** + * Sets min_occurrences + * + * @param int|null $min_occurrences The minimum number of occurrences required. + * + * @return self + */ + public function setMinOccurrences($min_occurrences) + { + if (is_null($min_occurrences)) { + throw new \InvalidArgumentException('non-nullable min_occurrences cannot be null'); + } + $this->container['min_occurrences'] = $min_occurrences; + + return $this; + } + /** * Gets type * @@ -368,7 +395,7 @@ public function getType() /** * Sets type * - * @param string $type type + * @param string $type The type of refinement (NUM_OCCURRENCES). * * @return self */ @@ -391,41 +418,14 @@ public function setType($type) return $this; } - - /** - * Gets min_occurrences - * - * @return int|null - */ - public function getMinOccurrences() - { - return $this->container['min_occurrences']; - } - - /** - * Sets min_occurrences - * - * @param int|null $min_occurrences min_occurrences - * - * @return self - */ - public function setMinOccurrences($min_occurrences) - { - if (is_null($min_occurrences)) { - throw new \InvalidArgumentException('non-nullable min_occurrences cannot be null'); - } - $this->container['min_occurrences'] = $min_occurrences; - - 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]); } @@ -433,12 +433,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; } @@ -463,11 +463,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/Lists/Model/PublicNumberPropertyOperation.php b/codegen/Crm/Lists/Model/PublicNumberPropertyOperation.php index 0bae95f45..1532b7d1e 100644 --- a/codegen/Crm/Lists/Model/PublicNumberPropertyOperation.php +++ b/codegen/Crm/Lists/Model/PublicNumberPropertyOperation.php @@ -2,7 +2,7 @@ /** * PublicNumberPropertyOperation * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -59,8 +59,8 @@ class PublicNumberPropertyOperation implements ModelInterface, ArrayAccess, \Jso protected static $openAPITypes = [ 'include_objects_with_no_value_set' => 'bool', 'operation_type' => 'string', - 'value' => 'float', - 'operator' => 'string' + 'operator' => 'string', + 'value' => 'float' ]; /** @@ -73,8 +73,8 @@ class PublicNumberPropertyOperation implements ModelInterface, ArrayAccess, \Jso protected static $openAPIFormats = [ 'include_objects_with_no_value_set' => null, 'operation_type' => null, - 'value' => null, - 'operator' => null + 'operator' => null, + 'value' => null ]; /** @@ -85,8 +85,8 @@ class PublicNumberPropertyOperation implements ModelInterface, ArrayAccess, \Jso protected static array $openAPINullables = [ 'include_objects_with_no_value_set' => false, 'operation_type' => false, - 'value' => false, - 'operator' => false + 'operator' => false, + 'value' => false ]; /** @@ -177,8 +177,8 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', 'operation_type' => 'operationType', - 'value' => 'value', - 'operator' => 'operator' + 'operator' => 'operator', + 'value' => 'value' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', 'operation_type' => 'setOperationType', - 'value' => 'setValue', - 'operator' => 'setOperator' + 'operator' => 'setOperator', + 'value' => 'setValue' ]; /** @@ -201,8 +201,8 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', 'operation_type' => 'getOperationType', - 'value' => 'getValue', - 'operator' => 'getOperator' + 'operator' => 'getOperator', + 'value' => 'getValue' ]; /** @@ -277,8 +277,8 @@ public function __construct(?array $data = null) { $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); $this->setIfExists('operation_type', $data ?? [], 'NUMBER'); - $this->setIfExists('value', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); } /** @@ -323,12 +323,12 @@ public function listInvalidProperties() ); } - if ($this->container['value'] === null) { - $invalidProperties[] = "'value' can't be null"; - } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } return $invalidProperties; } @@ -357,7 +357,7 @@ public function getIncludeObjectsWithNoValueSet() /** * Sets include_objects_with_no_value_set * - * @param bool $include_objects_with_no_value_set include_objects_with_no_value_set + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. * * @return self */ @@ -384,7 +384,7 @@ public function getOperationType() /** * Sets operation_type * - * @param string $operation_type operation_type + * @param string $operation_type Specifies the type of operation (NUMBER). * * @return self */ @@ -409,66 +409,66 @@ public function setOperationType($operation_type) } /** - * Gets value + * Gets operator * - * @return float + * @return string */ - public function getValue() + public function getOperator() { - return $this->container['value']; + return $this->container['operator']; } /** - * Sets value + * Sets operator * - * @param float $value value + * @param string $operator Defines the operation to be applied in the number property operation (IS_EQUAL_TO, IS_NOT_EQUAL_TO, IS_GREATER_THAN, IS_GREATER_THAN_OR_EQUAL_TO, IS_LESS_THAN, IS_LESS_THAN_OR_EQUAL_TO, HAS_EVER_BEEN_EQUAL_TO, HAS_NEVER_BEEN_EQUAL_TO). * * @return self */ - public function setValue($value) + public function setOperator($operator) { - if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['value'] = $value; + $this->container['operator'] = $operator; return $this; } /** - * Gets operator + * Gets value * - * @return string + * @return float */ - public function getOperator() + public function getValue() { - return $this->container['operator']; + return $this->container['value']; } /** - * Sets operator + * Sets value * - * @param string $operator operator + * @param float $value The numeric value to be used in the operation. * * @return self */ - public function setOperator($operator) + public function setValue($value) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); } - $this->container['operator'] = $operator; + $this->container['value'] = $value; 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]); } @@ -476,12 +476,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; } @@ -506,11 +506,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/Lists/Model/PublicObjectList.php b/codegen/Crm/Lists/Model/PublicObjectList.php index 0a568163c..23cae2cf2 100644 --- a/codegen/Crm/Lists/Model/PublicObjectList.php +++ b/codegen/Crm/Lists/Model/PublicObjectList.php @@ -2,7 +2,7 @@ /** * PublicObjectList * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * PublicObjectList Class Doc Comment * * @category Class + * @description An object list definition. * @package HubSpot\Client\Crm\Lists * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,20 +58,22 @@ class PublicObjectList implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'processing_type' => 'string', - 'object_type_id' => 'string', - 'updated_by_id' => 'string', - 'filters_updated_at' => '\DateTime', - 'list_id' => 'string', 'created_at' => '\DateTime', - 'processing_status' => 'string', + 'created_by_id' => 'string', 'deleted_at' => '\DateTime', + 'filter_branch' => '\HubSpot\Client\Crm\Lists\Model\PublicObjectListFilterBranch', + 'filters_updated_at' => '\DateTime', + 'list_id' => 'string', + 'list_permissions' => '\HubSpot\Client\Crm\Lists\Model\PublicListPermissions', 'list_version' => 'int', - 'size' => 'int', + 'membership_settings' => '\HubSpot\Client\Crm\Lists\Model\PublicMembershipSettings', 'name' => 'string', - 'created_by_id' => 'string', - 'filter_branch' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner', - 'updated_at' => '\DateTime' + 'object_type_id' => 'string', + 'processing_status' => 'string', + 'processing_type' => 'string', + 'size' => 'int', + 'updated_at' => '\DateTime', + 'updated_by_id' => 'string' ]; /** @@ -81,20 +84,22 @@ class PublicObjectList implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'processing_type' => null, - 'object_type_id' => null, - 'updated_by_id' => null, - 'filters_updated_at' => 'date-time', - 'list_id' => null, 'created_at' => 'date-time', - 'processing_status' => null, + 'created_by_id' => null, 'deleted_at' => 'date-time', + 'filter_branch' => null, + 'filters_updated_at' => 'date-time', + 'list_id' => null, + 'list_permissions' => null, 'list_version' => 'int32', - 'size' => 'int64', + 'membership_settings' => null, 'name' => null, - 'created_by_id' => null, - 'filter_branch' => null, - 'updated_at' => 'date-time' + 'object_type_id' => null, + 'processing_status' => null, + 'processing_type' => null, + 'size' => 'int64', + 'updated_at' => 'date-time', + 'updated_by_id' => null ]; /** @@ -103,20 +108,22 @@ class PublicObjectList implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'processing_type' => false, - 'object_type_id' => false, - 'updated_by_id' => false, - 'filters_updated_at' => false, - 'list_id' => false, 'created_at' => false, - 'processing_status' => false, + 'created_by_id' => false, 'deleted_at' => false, + 'filter_branch' => false, + 'filters_updated_at' => false, + 'list_id' => false, + 'list_permissions' => false, 'list_version' => false, - 'size' => false, + 'membership_settings' => false, 'name' => false, - 'created_by_id' => false, - 'filter_branch' => false, - 'updated_at' => false + 'object_type_id' => false, + 'processing_status' => false, + 'processing_type' => false, + 'size' => false, + 'updated_at' => false, + 'updated_by_id' => false ]; /** @@ -205,20 +212,22 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'processing_type' => 'processingType', - 'object_type_id' => 'objectTypeId', - 'updated_by_id' => 'updatedById', - 'filters_updated_at' => 'filtersUpdatedAt', - 'list_id' => 'listId', 'created_at' => 'createdAt', - 'processing_status' => 'processingStatus', + 'created_by_id' => 'createdById', 'deleted_at' => 'deletedAt', + 'filter_branch' => 'filterBranch', + 'filters_updated_at' => 'filtersUpdatedAt', + 'list_id' => 'listId', + 'list_permissions' => 'listPermissions', 'list_version' => 'listVersion', - 'size' => 'size', + 'membership_settings' => 'membershipSettings', 'name' => 'name', - 'created_by_id' => 'createdById', - 'filter_branch' => 'filterBranch', - 'updated_at' => 'updatedAt' + 'object_type_id' => 'objectTypeId', + 'processing_status' => 'processingStatus', + 'processing_type' => 'processingType', + 'size' => 'size', + 'updated_at' => 'updatedAt', + 'updated_by_id' => 'updatedById' ]; /** @@ -227,20 +236,22 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'processing_type' => 'setProcessingType', - 'object_type_id' => 'setObjectTypeId', - 'updated_by_id' => 'setUpdatedById', - 'filters_updated_at' => 'setFiltersUpdatedAt', - 'list_id' => 'setListId', 'created_at' => 'setCreatedAt', - 'processing_status' => 'setProcessingStatus', + 'created_by_id' => 'setCreatedById', 'deleted_at' => 'setDeletedAt', + 'filter_branch' => 'setFilterBranch', + 'filters_updated_at' => 'setFiltersUpdatedAt', + 'list_id' => 'setListId', + 'list_permissions' => 'setListPermissions', 'list_version' => 'setListVersion', - 'size' => 'setSize', + 'membership_settings' => 'setMembershipSettings', 'name' => 'setName', - 'created_by_id' => 'setCreatedById', - 'filter_branch' => 'setFilterBranch', - 'updated_at' => 'setUpdatedAt' + 'object_type_id' => 'setObjectTypeId', + 'processing_status' => 'setProcessingStatus', + 'processing_type' => 'setProcessingType', + 'size' => 'setSize', + 'updated_at' => 'setUpdatedAt', + 'updated_by_id' => 'setUpdatedById' ]; /** @@ -249,20 +260,22 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'processing_type' => 'getProcessingType', - 'object_type_id' => 'getObjectTypeId', - 'updated_by_id' => 'getUpdatedById', - 'filters_updated_at' => 'getFiltersUpdatedAt', - 'list_id' => 'getListId', 'created_at' => 'getCreatedAt', - 'processing_status' => 'getProcessingStatus', + 'created_by_id' => 'getCreatedById', 'deleted_at' => 'getDeletedAt', + 'filter_branch' => 'getFilterBranch', + 'filters_updated_at' => 'getFiltersUpdatedAt', + 'list_id' => 'getListId', + 'list_permissions' => 'getListPermissions', 'list_version' => 'getListVersion', - 'size' => 'getSize', + 'membership_settings' => 'getMembershipSettings', 'name' => 'getName', - 'created_by_id' => 'getCreatedById', - 'filter_branch' => 'getFilterBranch', - 'updated_at' => 'getUpdatedAt' + 'object_type_id' => 'getObjectTypeId', + 'processing_status' => 'getProcessingStatus', + 'processing_type' => 'getProcessingType', + 'size' => 'getSize', + 'updated_at' => 'getUpdatedAt', + 'updated_by_id' => 'getUpdatedById' ]; /** @@ -322,20 +335,22 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('processing_type', $data ?? [], null); - $this->setIfExists('object_type_id', $data ?? [], null); - $this->setIfExists('updated_by_id', $data ?? [], null); - $this->setIfExists('filters_updated_at', $data ?? [], null); - $this->setIfExists('list_id', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); - $this->setIfExists('processing_status', $data ?? [], null); + $this->setIfExists('created_by_id', $data ?? [], null); $this->setIfExists('deleted_at', $data ?? [], null); + $this->setIfExists('filter_branch', $data ?? [], null); + $this->setIfExists('filters_updated_at', $data ?? [], null); + $this->setIfExists('list_id', $data ?? [], null); + $this->setIfExists('list_permissions', $data ?? [], null); $this->setIfExists('list_version', $data ?? [], null); - $this->setIfExists('size', $data ?? [], null); + $this->setIfExists('membership_settings', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('created_by_id', $data ?? [], null); - $this->setIfExists('filter_branch', $data ?? [], null); + $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('processing_status', $data ?? [], null); + $this->setIfExists('processing_type', $data ?? [], null); + $this->setIfExists('size', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('updated_by_id', $data ?? [], null); } /** @@ -365,24 +380,24 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['processing_type'] === null) { - $invalidProperties[] = "'processing_type' can't be null"; - } - if ($this->container['object_type_id'] === null) { - $invalidProperties[] = "'object_type_id' can't be null"; - } if ($this->container['list_id'] === null) { $invalidProperties[] = "'list_id' can't be null"; } - if ($this->container['processing_status'] === null) { - $invalidProperties[] = "'processing_status' can't be null"; - } if ($this->container['list_version'] === null) { $invalidProperties[] = "'list_version' can't be null"; } if ($this->container['name'] === null) { $invalidProperties[] = "'name' can't be null"; } + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } + if ($this->container['processing_status'] === null) { + $invalidProperties[] = "'processing_status' can't be null"; + } + if ($this->container['processing_type'] === null) { + $invalidProperties[] = "'processing_type' can't be null"; + } return $invalidProperties; } @@ -399,82 +414,109 @@ public function valid() /** - * Gets processing_type + * Gets created_at * - * @return string + * @return \DateTime|null */ - public function getProcessingType() + public function getCreatedAt() { - return $this->container['processing_type']; + return $this->container['created_at']; } /** - * Sets processing_type + * Sets created_at * - * @param string $processing_type The processing type of the list. + * @param \DateTime|null $created_at The time when the list was created. * * @return self */ - public function setProcessingType($processing_type) + public function setCreatedAt($created_at) { - if (is_null($processing_type)) { - throw new \InvalidArgumentException('non-nullable processing_type cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['processing_type'] = $processing_type; + $this->container['created_at'] = $created_at; return $this; } /** - * Gets object_type_id + * Gets created_by_id * - * @return string + * @return string|null */ - public function getObjectTypeId() + public function getCreatedById() { - return $this->container['object_type_id']; + return $this->container['created_by_id']; } /** - * Sets object_type_id + * Sets created_by_id * - * @param string $object_type_id The object type of the list. + * @param string|null $created_by_id The ID of the user that created the list. * * @return self */ - public function setObjectTypeId($object_type_id) + public function setCreatedById($created_by_id) { - if (is_null($object_type_id)) { - throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + if (is_null($created_by_id)) { + throw new \InvalidArgumentException('non-nullable created_by_id cannot be null'); } - $this->container['object_type_id'] = $object_type_id; + $this->container['created_by_id'] = $created_by_id; return $this; } /** - * Gets updated_by_id + * Gets deleted_at * - * @return string|null + * @return \DateTime|null */ - public function getUpdatedById() + public function getDeletedAt() { - return $this->container['updated_by_id']; + return $this->container['deleted_at']; } /** - * Sets updated_by_id + * Sets deleted_at * - * @param string|null $updated_by_id The ID of the user that last updated the list. + * @param \DateTime|null $deleted_at The time when the list was deleted. * * @return self */ - public function setUpdatedById($updated_by_id) + public function setDeletedAt($deleted_at) { - if (is_null($updated_by_id)) { - throw new \InvalidArgumentException('non-nullable updated_by_id cannot be null'); + if (is_null($deleted_at)) { + throw new \InvalidArgumentException('non-nullable deleted_at cannot be null'); } - $this->container['updated_by_id'] = $updated_by_id; + $this->container['deleted_at'] = $deleted_at; + + return $this; + } + + /** + * Gets filter_branch + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicObjectListFilterBranch|null + */ + public function getFilterBranch() + { + return $this->container['filter_branch']; + } + + /** + * Sets filter_branch + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicObjectListFilterBranch|null $filter_branch filter_branch + * + * @return self + */ + public function setFilterBranch($filter_branch) + { + if (is_null($filter_branch)) { + throw new \InvalidArgumentException('non-nullable filter_branch cannot be null'); + } + $this->container['filter_branch'] = $filter_branch; return $this; } @@ -534,217 +576,217 @@ public function setListId($list_id) } /** - * Gets created_at + * Gets list_permissions * - * @return \DateTime|null + * @return \HubSpot\Client\Crm\Lists\Model\PublicListPermissions|null */ - public function getCreatedAt() + public function getListPermissions() { - return $this->container['created_at']; + return $this->container['list_permissions']; } /** - * Sets created_at + * Sets list_permissions * - * @param \DateTime|null $created_at The time when the list was created. + * @param \HubSpot\Client\Crm\Lists\Model\PublicListPermissions|null $list_permissions list_permissions * * @return self */ - public function setCreatedAt($created_at) + public function setListPermissions($list_permissions) { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + if (is_null($list_permissions)) { + throw new \InvalidArgumentException('non-nullable list_permissions cannot be null'); } - $this->container['created_at'] = $created_at; + $this->container['list_permissions'] = $list_permissions; return $this; } /** - * Gets processing_status + * Gets list_version * - * @return string + * @return int */ - public function getProcessingStatus() + public function getListVersion() { - return $this->container['processing_status']; + return $this->container['list_version']; } /** - * Sets processing_status + * Sets list_version * - * @param string $processing_status The processing status of the list. + * @param int $list_version The version of the list. * * @return self */ - public function setProcessingStatus($processing_status) + public function setListVersion($list_version) { - if (is_null($processing_status)) { - throw new \InvalidArgumentException('non-nullable processing_status cannot be null'); + if (is_null($list_version)) { + throw new \InvalidArgumentException('non-nullable list_version cannot be null'); } - $this->container['processing_status'] = $processing_status; + $this->container['list_version'] = $list_version; return $this; } /** - * Gets deleted_at + * Gets membership_settings * - * @return \DateTime|null + * @return \HubSpot\Client\Crm\Lists\Model\PublicMembershipSettings|null */ - public function getDeletedAt() + public function getMembershipSettings() { - return $this->container['deleted_at']; + return $this->container['membership_settings']; } /** - * Sets deleted_at + * Sets membership_settings * - * @param \DateTime|null $deleted_at The time when the list was deleted. + * @param \HubSpot\Client\Crm\Lists\Model\PublicMembershipSettings|null $membership_settings membership_settings * * @return self */ - public function setDeletedAt($deleted_at) + public function setMembershipSettings($membership_settings) { - if (is_null($deleted_at)) { - throw new \InvalidArgumentException('non-nullable deleted_at cannot be null'); + if (is_null($membership_settings)) { + throw new \InvalidArgumentException('non-nullable membership_settings cannot be null'); } - $this->container['deleted_at'] = $deleted_at; + $this->container['membership_settings'] = $membership_settings; return $this; } /** - * Gets list_version + * Gets name * - * @return int + * @return string */ - public function getListVersion() + public function getName() { - return $this->container['list_version']; + return $this->container['name']; } /** - * Sets list_version + * Sets name * - * @param int $list_version The version of the list. + * @param string $name The name of the list. * * @return self */ - public function setListVersion($list_version) + public function setName($name) { - if (is_null($list_version)) { - throw new \InvalidArgumentException('non-nullable list_version cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['list_version'] = $list_version; + $this->container['name'] = $name; return $this; } /** - * Gets size + * Gets object_type_id * - * @return int|null + * @return string */ - public function getSize() + public function getObjectTypeId() { - return $this->container['size']; + return $this->container['object_type_id']; } /** - * Sets size + * Sets object_type_id * - * @param int|null $size size + * @param string $object_type_id The object type of the list. * * @return self */ - public function setSize($size) + public function setObjectTypeId($object_type_id) { - if (is_null($size)) { - throw new \InvalidArgumentException('non-nullable size cannot be null'); + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); } - $this->container['size'] = $size; + $this->container['object_type_id'] = $object_type_id; return $this; } /** - * Gets name + * Gets processing_status * * @return string */ - public function getName() + public function getProcessingStatus() { - return $this->container['name']; + return $this->container['processing_status']; } /** - * Sets name + * Sets processing_status * - * @param string $name The name of the list. + * @param string $processing_status The processing status of the list. * * @return self */ - public function setName($name) + public function setProcessingStatus($processing_status) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($processing_status)) { + throw new \InvalidArgumentException('non-nullable processing_status cannot be null'); } - $this->container['name'] = $name; + $this->container['processing_status'] = $processing_status; return $this; } /** - * Gets created_by_id + * Gets processing_type * - * @return string|null + * @return string */ - public function getCreatedById() + public function getProcessingType() { - return $this->container['created_by_id']; + return $this->container['processing_type']; } /** - * Sets created_by_id + * Sets processing_type * - * @param string|null $created_by_id The ID of the user that created the list. + * @param string $processing_type The processing type of the list. * * @return self */ - public function setCreatedById($created_by_id) + public function setProcessingType($processing_type) { - if (is_null($created_by_id)) { - throw new \InvalidArgumentException('non-nullable created_by_id cannot be null'); + if (is_null($processing_type)) { + throw new \InvalidArgumentException('non-nullable processing_type cannot be null'); } - $this->container['created_by_id'] = $created_by_id; + $this->container['processing_type'] = $processing_type; return $this; } /** - * Gets filter_branch + * Gets size * - * @return \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner|null + * @return int|null */ - public function getFilterBranch() + public function getSize() { - return $this->container['filter_branch']; + return $this->container['size']; } /** - * Sets filter_branch + * Sets size * - * @param \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner|null $filter_branch filter_branch + * @param int|null $size Size of the list * * @return self */ - public function setFilterBranch($filter_branch) + public function setSize($size) { - if (is_null($filter_branch)) { - throw new \InvalidArgumentException('non-nullable filter_branch cannot be null'); + if (is_null($size)) { + throw new \InvalidArgumentException('non-nullable size cannot be null'); } - $this->container['filter_branch'] = $filter_branch; + $this->container['size'] = $size; return $this; } @@ -775,14 +817,41 @@ public function setUpdatedAt($updated_at) return $this; } + + /** + * Gets updated_by_id + * + * @return string|null + */ + public function getUpdatedById() + { + return $this->container['updated_by_id']; + } + + /** + * Sets updated_by_id + * + * @param string|null $updated_by_id The ID of the user that last updated the list. + * + * @return self + */ + public function setUpdatedById($updated_by_id) + { + if (is_null($updated_by_id)) { + throw new \InvalidArgumentException('non-nullable updated_by_id cannot be null'); + } + $this->container['updated_by_id'] = $updated_by_id; + + 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]); } @@ -790,12 +859,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; } @@ -820,11 +889,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/Lists/Model/PublicObjectListFilterBranch.php b/codegen/Crm/Lists/Model/PublicObjectListFilterBranch.php new file mode 100644 index 000000000..4ebbabac9 --- /dev/null +++ b/codegen/Crm/Lists/Model/PublicObjectListFilterBranch.php @@ -0,0 +1,815 @@ + + */ +class PublicObjectListFilterBranch implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'filter_branch_type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicObjectList_filterBranch'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'filter_branch_operator' => 'string', + 'filter_branch_type' => 'string', + 'filter_branches' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[]', + 'filters' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[]', + 'coalescing_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', + 'event_type_id' => 'string', + 'operator' => 'string', + 'object_type_id' => 'string', + 'property_with_object_id' => 'string', + 'association_category' => 'string', + 'association_type_id' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'filter_branch_operator' => null, + 'filter_branch_type' => null, + 'filter_branches' => null, + 'filters' => null, + 'coalescing_refine_by' => null, + 'event_type_id' => null, + 'operator' => null, + 'object_type_id' => null, + 'property_with_object_id' => null, + 'association_category' => null, + 'association_type_id' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'filter_branch_operator' => false, + 'filter_branch_type' => false, + 'filter_branches' => false, + 'filters' => false, + 'coalescing_refine_by' => false, + 'event_type_id' => false, + 'operator' => false, + 'object_type_id' => false, + 'property_with_object_id' => false, + 'association_category' => false, + 'association_type_id' => 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 = [ + 'filter_branch_operator' => 'filterBranchOperator', + 'filter_branch_type' => 'filterBranchType', + 'filter_branches' => 'filterBranches', + 'filters' => 'filters', + 'coalescing_refine_by' => 'coalescingRefineBy', + 'event_type_id' => 'eventTypeId', + 'operator' => 'operator', + 'object_type_id' => 'objectTypeId', + 'property_with_object_id' => 'propertyWithObjectId', + 'association_category' => 'associationCategory', + 'association_type_id' => 'associationTypeId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'filter_branch_operator' => 'setFilterBranchOperator', + 'filter_branch_type' => 'setFilterBranchType', + 'filter_branches' => 'setFilterBranches', + 'filters' => 'setFilters', + 'coalescing_refine_by' => 'setCoalescingRefineBy', + 'event_type_id' => 'setEventTypeId', + 'operator' => 'setOperator', + 'object_type_id' => 'setObjectTypeId', + 'property_with_object_id' => 'setPropertyWithObjectId', + 'association_category' => 'setAssociationCategory', + 'association_type_id' => 'setAssociationTypeId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'filter_branch_operator' => 'getFilterBranchOperator', + 'filter_branch_type' => 'getFilterBranchType', + 'filter_branches' => 'getFilterBranches', + 'filters' => 'getFilters', + 'coalescing_refine_by' => 'getCoalescingRefineBy', + 'event_type_id' => 'getEventTypeId', + 'operator' => 'getOperator', + 'object_type_id' => 'getObjectTypeId', + 'property_with_object_id' => 'getPropertyWithObjectId', + 'association_category' => 'getAssociationCategory', + 'association_type_id' => 'getAssociationTypeId' + ]; + + /** + * 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 FILTER_BRANCH_TYPE_ASSOCIATION = 'ASSOCIATION'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFilterBranchTypeAllowableValues() + { + return [ + self::FILTER_BRANCH_TYPE_ASSOCIATION, + ]; + } + + /** + * 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('filter_branch_operator', $data ?? [], null); + $this->setIfExists('filter_branch_type', $data ?? [], 'ASSOCIATION'); + $this->setIfExists('filter_branches', $data ?? [], null); + $this->setIfExists('filters', $data ?? [], null); + $this->setIfExists('coalescing_refine_by', $data ?? [], null); + $this->setIfExists('event_type_id', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('property_with_object_id', $data ?? [], null); + $this->setIfExists('association_category', $data ?? [], null); + $this->setIfExists('association_type_id', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['filter_branch_type'] = static::$openAPIModelName; + } + + /** + * 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['filter_branch_operator'] === null) { + $invalidProperties[] = "'filter_branch_operator' can't be null"; + } + if ($this->container['filter_branch_type'] === null) { + $invalidProperties[] = "'filter_branch_type' can't be null"; + } + $allowedValues = $this->getFilterBranchTypeAllowableValues(); + if (!is_null($this->container['filter_branch_type']) && !in_array($this->container['filter_branch_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'filter_branch_type', must be one of '%s'", + $this->container['filter_branch_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['filter_branches'] === null) { + $invalidProperties[] = "'filter_branches' can't be null"; + } + if ($this->container['filters'] === null) { + $invalidProperties[] = "'filters' can't be null"; + } + if ($this->container['event_type_id'] === null) { + $invalidProperties[] = "'event_type_id' can't be null"; + } + if ($this->container['operator'] === null) { + $invalidProperties[] = "'operator' can't be null"; + } + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } + if ($this->container['property_with_object_id'] === null) { + $invalidProperties[] = "'property_with_object_id' can't be null"; + } + if ($this->container['association_category'] === null) { + $invalidProperties[] = "'association_category' can't be null"; + } + if ($this->container['association_type_id'] === null) { + $invalidProperties[] = "'association_type_id' 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 filter_branch_operator + * + * @return string + */ + public function getFilterBranchOperator() + { + return $this->container['filter_branch_operator']; + } + + /** + * Sets filter_branch_operator + * + * @param string $filter_branch_operator Filter branch operator (AND) + * + * @return self + */ + public function setFilterBranchOperator($filter_branch_operator) + { + if (is_null($filter_branch_operator)) { + throw new \InvalidArgumentException('non-nullable filter_branch_operator cannot be null'); + } + $this->container['filter_branch_operator'] = $filter_branch_operator; + + return $this; + } + + /** + * Gets filter_branch_type + * + * @return string + */ + public function getFilterBranchType() + { + return $this->container['filter_branch_type']; + } + + /** + * Sets filter_branch_type + * + * @param string $filter_branch_type Type of the filter branch (ASSOCIATION) + * + * @return self + */ + public function setFilterBranchType($filter_branch_type) + { + if (is_null($filter_branch_type)) { + throw new \InvalidArgumentException('non-nullable filter_branch_type cannot be null'); + } + $allowedValues = $this->getFilterBranchTypeAllowableValues(); + if (!in_array($filter_branch_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'filter_branch_type', must be one of '%s'", + $filter_branch_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['filter_branch_type'] = $filter_branch_type; + + return $this; + } + + /** + * Gets filter_branches + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[] + */ + public function getFilterBranches() + { + return $this->container['filter_branches']; + } + + /** + * Sets filter_branches + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[] $filter_branches filter_branches + * + * @return self + */ + public function setFilterBranches($filter_branches) + { + if (is_null($filter_branches)) { + throw new \InvalidArgumentException('non-nullable filter_branches cannot be null'); + } + $this->container['filter_branches'] = $filter_branches; + + return $this; + } + + /** + * Gets filters + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[] + */ + public function getFilters() + { + return $this->container['filters']; + } + + /** + * Sets filters + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[] $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; + } + + /** + * Gets coalescing_refine_by + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null + */ + public function getCoalescingRefineBy() + { + return $this->container['coalescing_refine_by']; + } + + /** + * Sets coalescing_refine_by + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null $coalescing_refine_by coalescing_refine_by + * + * @return self + */ + public function setCoalescingRefineBy($coalescing_refine_by) + { + if (is_null($coalescing_refine_by)) { + throw new \InvalidArgumentException('non-nullable coalescing_refine_by cannot be null'); + } + $this->container['coalescing_refine_by'] = $coalescing_refine_by; + + return $this; + } + + /** + * Gets event_type_id + * + * @return string + */ + public function getEventTypeId() + { + return $this->container['event_type_id']; + } + + /** + * Sets event_type_id + * + * @param string $event_type_id The identifier for the type of event associated with the filter branch. + * + * @return self + */ + public function setEventTypeId($event_type_id) + { + if (is_null($event_type_id)) { + throw new \InvalidArgumentException('non-nullable event_type_id cannot be null'); + } + $this->container['event_type_id'] = $event_type_id; + + return $this; + } + + /** + * Gets operator + * + * @return string + */ + public function getOperator() + { + return $this->container['operator']; + } + + /** + * Sets operator + * + * @param string $operator Defines the operation to be applied within the filter branch (IN_LIST, NOT_IN_LIST). + * + * @return self + */ + public function setOperator($operator) + { + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); + } + $this->container['operator'] = $operator; + + return $this; + } + + /** + * Gets object_type_id + * + * @return string + */ + public function getObjectTypeId() + { + return $this->container['object_type_id']; + } + + /** + * Sets object_type_id + * + * @param string $object_type_id The ID representing the type of object associated with the filter branch. + * + * @return self + */ + public function setObjectTypeId($object_type_id) + { + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + } + $this->container['object_type_id'] = $object_type_id; + + return $this; + } + + /** + * Gets property_with_object_id + * + * @return string + */ + public function getPropertyWithObjectId() + { + return $this->container['property_with_object_id']; + } + + /** + * Sets property_with_object_id + * + * @param string $property_with_object_id The property that is associated with the object ID in the filter branch. + * + * @return self + */ + public function setPropertyWithObjectId($property_with_object_id) + { + if (is_null($property_with_object_id)) { + throw new \InvalidArgumentException('non-nullable property_with_object_id cannot be null'); + } + $this->container['property_with_object_id'] = $property_with_object_id; + + return $this; + } + + /** + * Gets association_category + * + * @return string + */ + public function getAssociationCategory() + { + return $this->container['association_category']; + } + + /** + * Sets association_category + * + * @param string $association_category Specifies the category of the association for the filter branch (HUBSPOT_DEFINED, USER_DEFINED, INTEGRATOR_DEFINED, WORK). + * + * @return self + */ + public function setAssociationCategory($association_category) + { + if (is_null($association_category)) { + throw new \InvalidArgumentException('non-nullable association_category cannot be null'); + } + $this->container['association_category'] = $association_category; + + return $this; + } + + /** + * Gets association_type_id + * + * @return int + */ + public function getAssociationTypeId() + { + return $this->container['association_type_id']; + } + + /** + * Sets association_type_id + * + * @param int $association_type_id Type id of the association + * + * @return self + */ + public function setAssociationTypeId($association_type_id) + { + if (is_null($association_type_id)) { + throw new \InvalidArgumentException('non-nullable association_type_id cannot be null'); + } + $this->container['association_type_id'] = $association_type_id; + + 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/Lists/Model/PublicObjectListSearchResult.php b/codegen/Crm/Lists/Model/PublicObjectListSearchResult.php index b871b7d31..cd7066d73 100644 --- a/codegen/Crm/Lists/Model/PublicObjectListSearchResult.php +++ b/codegen/Crm/Lists/Model/PublicObjectListSearchResult.php @@ -2,7 +2,7 @@ /** * PublicObjectListSearchResult * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,19 +57,19 @@ class PublicObjectListSearchResult implements ModelInterface, ArrayAccess, \Json * @var string[] */ protected static $openAPITypes = [ - 'processing_type' => 'string', - 'object_type_id' => 'string', - 'updated_by_id' => 'string', - 'filters_updated_at' => '\DateTime', - 'list_id' => 'string', + 'additional_properties' => 'array', 'created_at' => '\DateTime', - 'processing_status' => 'string', + 'created_by_id' => 'string', 'deleted_at' => '\DateTime', + 'filters_updated_at' => '\DateTime', + 'list_id' => 'string', 'list_version' => 'int', 'name' => 'string', - 'additional_properties' => 'array', - 'created_by_id' => 'string', - 'updated_at' => '\DateTime' + 'object_type_id' => 'string', + 'processing_status' => 'string', + 'processing_type' => 'string', + 'updated_at' => '\DateTime', + 'updated_by_id' => 'string' ]; /** @@ -80,19 +80,19 @@ class PublicObjectListSearchResult implements ModelInterface, ArrayAccess, \Json * @psalm-var array */ protected static $openAPIFormats = [ - 'processing_type' => null, - 'object_type_id' => null, - 'updated_by_id' => null, - 'filters_updated_at' => 'date-time', - 'list_id' => null, + 'additional_properties' => null, 'created_at' => 'date-time', - 'processing_status' => null, + 'created_by_id' => null, 'deleted_at' => 'date-time', + 'filters_updated_at' => 'date-time', + 'list_id' => null, 'list_version' => 'int32', 'name' => null, - 'additional_properties' => null, - 'created_by_id' => null, - 'updated_at' => 'date-time' + 'object_type_id' => null, + 'processing_status' => null, + 'processing_type' => null, + 'updated_at' => 'date-time', + 'updated_by_id' => null ]; /** @@ -101,19 +101,19 @@ class PublicObjectListSearchResult implements ModelInterface, ArrayAccess, \Json * @var boolean[] */ protected static array $openAPINullables = [ - 'processing_type' => false, - 'object_type_id' => false, - 'updated_by_id' => false, - 'filters_updated_at' => false, - 'list_id' => false, + 'additional_properties' => false, 'created_at' => false, - 'processing_status' => false, + 'created_by_id' => false, 'deleted_at' => false, + 'filters_updated_at' => false, + 'list_id' => false, 'list_version' => false, 'name' => false, - 'additional_properties' => false, - 'created_by_id' => false, - 'updated_at' => false + 'object_type_id' => false, + 'processing_status' => false, + 'processing_type' => false, + 'updated_at' => false, + 'updated_by_id' => false ]; /** @@ -202,19 +202,19 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'processing_type' => 'processingType', - 'object_type_id' => 'objectTypeId', - 'updated_by_id' => 'updatedById', - 'filters_updated_at' => 'filtersUpdatedAt', - 'list_id' => 'listId', + 'additional_properties' => 'additionalProperties', 'created_at' => 'createdAt', - 'processing_status' => 'processingStatus', + 'created_by_id' => 'createdById', 'deleted_at' => 'deletedAt', + 'filters_updated_at' => 'filtersUpdatedAt', + 'list_id' => 'listId', 'list_version' => 'listVersion', 'name' => 'name', - 'additional_properties' => 'additionalProperties', - 'created_by_id' => 'createdById', - 'updated_at' => 'updatedAt' + 'object_type_id' => 'objectTypeId', + 'processing_status' => 'processingStatus', + 'processing_type' => 'processingType', + 'updated_at' => 'updatedAt', + 'updated_by_id' => 'updatedById' ]; /** @@ -223,19 +223,19 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'processing_type' => 'setProcessingType', - 'object_type_id' => 'setObjectTypeId', - 'updated_by_id' => 'setUpdatedById', - 'filters_updated_at' => 'setFiltersUpdatedAt', - 'list_id' => 'setListId', + 'additional_properties' => 'setAdditionalProperties', 'created_at' => 'setCreatedAt', - 'processing_status' => 'setProcessingStatus', + 'created_by_id' => 'setCreatedById', 'deleted_at' => 'setDeletedAt', + 'filters_updated_at' => 'setFiltersUpdatedAt', + 'list_id' => 'setListId', 'list_version' => 'setListVersion', 'name' => 'setName', - 'additional_properties' => 'setAdditionalProperties', - 'created_by_id' => 'setCreatedById', - 'updated_at' => 'setUpdatedAt' + 'object_type_id' => 'setObjectTypeId', + 'processing_status' => 'setProcessingStatus', + 'processing_type' => 'setProcessingType', + 'updated_at' => 'setUpdatedAt', + 'updated_by_id' => 'setUpdatedById' ]; /** @@ -244,19 +244,19 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'processing_type' => 'getProcessingType', - 'object_type_id' => 'getObjectTypeId', - 'updated_by_id' => 'getUpdatedById', - 'filters_updated_at' => 'getFiltersUpdatedAt', - 'list_id' => 'getListId', + 'additional_properties' => 'getAdditionalProperties', 'created_at' => 'getCreatedAt', - 'processing_status' => 'getProcessingStatus', + 'created_by_id' => 'getCreatedById', 'deleted_at' => 'getDeletedAt', + 'filters_updated_at' => 'getFiltersUpdatedAt', + 'list_id' => 'getListId', 'list_version' => 'getListVersion', 'name' => 'getName', - 'additional_properties' => 'getAdditionalProperties', - 'created_by_id' => 'getCreatedById', - 'updated_at' => 'getUpdatedAt' + 'object_type_id' => 'getObjectTypeId', + 'processing_status' => 'getProcessingStatus', + 'processing_type' => 'getProcessingType', + 'updated_at' => 'getUpdatedAt', + 'updated_by_id' => 'getUpdatedById' ]; /** @@ -316,19 +316,19 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('processing_type', $data ?? [], null); - $this->setIfExists('object_type_id', $data ?? [], null); - $this->setIfExists('updated_by_id', $data ?? [], null); - $this->setIfExists('filters_updated_at', $data ?? [], null); - $this->setIfExists('list_id', $data ?? [], null); + $this->setIfExists('additional_properties', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); - $this->setIfExists('processing_status', $data ?? [], null); + $this->setIfExists('created_by_id', $data ?? [], null); $this->setIfExists('deleted_at', $data ?? [], null); + $this->setIfExists('filters_updated_at', $data ?? [], null); + $this->setIfExists('list_id', $data ?? [], null); $this->setIfExists('list_version', $data ?? [], null); $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('additional_properties', $data ?? [], null); - $this->setIfExists('created_by_id', $data ?? [], null); + $this->setIfExists('object_type_id', $data ?? [], null); + $this->setIfExists('processing_status', $data ?? [], null); + $this->setIfExists('processing_type', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('updated_by_id', $data ?? [], null); } /** @@ -358,26 +358,26 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['processing_type'] === null) { - $invalidProperties[] = "'processing_type' can't be null"; - } - if ($this->container['object_type_id'] === null) { - $invalidProperties[] = "'object_type_id' can't be null"; + if ($this->container['additional_properties'] === null) { + $invalidProperties[] = "'additional_properties' can't be null"; } if ($this->container['list_id'] === null) { $invalidProperties[] = "'list_id' can't be null"; } - if ($this->container['processing_status'] === null) { - $invalidProperties[] = "'processing_status' can't be null"; - } if ($this->container['list_version'] === null) { $invalidProperties[] = "'list_version' can't be null"; } if ($this->container['name'] === null) { $invalidProperties[] = "'name' can't be null"; } - if ($this->container['additional_properties'] === null) { - $invalidProperties[] = "'additional_properties' can't be null"; + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; + } + if ($this->container['processing_status'] === null) { + $invalidProperties[] = "'processing_status' can't be null"; + } + if ($this->container['processing_type'] === null) { + $invalidProperties[] = "'processing_type' can't be null"; } return $invalidProperties; } @@ -395,82 +395,109 @@ public function valid() /** - * Gets processing_type + * Gets additional_properties * - * @return string + * @return array */ - public function getProcessingType() + public function getAdditionalProperties() { - return $this->container['processing_type']; + return $this->container['additional_properties']; } /** - * Sets processing_type + * Sets additional_properties * - * @param string $processing_type The processing type of the list. + * @param array $additional_properties The name and value of any additional properties that exist for this list and that were included in the search request. * * @return self */ - public function setProcessingType($processing_type) + public function setAdditionalProperties($additional_properties) { - if (is_null($processing_type)) { - throw new \InvalidArgumentException('non-nullable processing_type cannot be null'); + if (is_null($additional_properties)) { + throw new \InvalidArgumentException('non-nullable additional_properties cannot be null'); } - $this->container['processing_type'] = $processing_type; + $this->container['additional_properties'] = $additional_properties; return $this; } /** - * Gets object_type_id + * Gets created_at * - * @return string + * @return \DateTime|null */ - public function getObjectTypeId() + public function getCreatedAt() { - return $this->container['object_type_id']; + return $this->container['created_at']; } /** - * Sets object_type_id + * Sets created_at * - * @param string $object_type_id The object type of the list. + * @param \DateTime|null $created_at The time when the list was created. * * @return self */ - public function setObjectTypeId($object_type_id) + public function setCreatedAt($created_at) { - if (is_null($object_type_id)) { - throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['object_type_id'] = $object_type_id; + $this->container['created_at'] = $created_at; return $this; } /** - * Gets updated_by_id + * Gets created_by_id * * @return string|null */ - public function getUpdatedById() + public function getCreatedById() { - return $this->container['updated_by_id']; + return $this->container['created_by_id']; } /** - * Sets updated_by_id + * Sets created_by_id * - * @param string|null $updated_by_id The ID of the user that last updated the list. + * @param string|null $created_by_id The ID of the user that created the list. * * @return self */ - public function setUpdatedById($updated_by_id) + public function setCreatedById($created_by_id) { - if (is_null($updated_by_id)) { - throw new \InvalidArgumentException('non-nullable updated_by_id cannot be null'); + if (is_null($created_by_id)) { + throw new \InvalidArgumentException('non-nullable created_by_id cannot be null'); } - $this->container['updated_by_id'] = $updated_by_id; + $this->container['created_by_id'] = $created_by_id; + + return $this; + } + + /** + * Gets deleted_at + * + * @return \DateTime|null + */ + public function getDeletedAt() + { + return $this->container['deleted_at']; + } + + /** + * Sets deleted_at + * + * @param \DateTime|null $deleted_at The time when the list was deleted. + * + * @return self + */ + public function setDeletedAt($deleted_at) + { + if (is_null($deleted_at)) { + throw new \InvalidArgumentException('non-nullable deleted_at cannot be null'); + } + $this->container['deleted_at'] = $deleted_at; return $this; } @@ -530,228 +557,201 @@ public function setListId($list_id) } /** - * Gets created_at + * Gets list_version * - * @return \DateTime|null + * @return int */ - public function getCreatedAt() + public function getListVersion() { - return $this->container['created_at']; + return $this->container['list_version']; } /** - * Sets created_at + * Sets list_version * - * @param \DateTime|null $created_at The time when the list was created. + * @param int $list_version The version of the list. * * @return self */ - public function setCreatedAt($created_at) + public function setListVersion($list_version) { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + if (is_null($list_version)) { + throw new \InvalidArgumentException('non-nullable list_version cannot be null'); } - $this->container['created_at'] = $created_at; + $this->container['list_version'] = $list_version; return $this; } /** - * Gets processing_status + * Gets name * * @return string */ - public function getProcessingStatus() + public function getName() { - return $this->container['processing_status']; + return $this->container['name']; } /** - * Sets processing_status + * Sets name * - * @param string $processing_status The processing status of the list. + * @param string $name The name of the list. * * @return self */ - public function setProcessingStatus($processing_status) + public function setName($name) { - if (is_null($processing_status)) { - throw new \InvalidArgumentException('non-nullable processing_status cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['processing_status'] = $processing_status; + $this->container['name'] = $name; return $this; } /** - * Gets deleted_at + * Gets object_type_id * - * @return \DateTime|null + * @return string */ - public function getDeletedAt() + public function getObjectTypeId() { - return $this->container['deleted_at']; + return $this->container['object_type_id']; } /** - * Sets deleted_at + * Sets object_type_id * - * @param \DateTime|null $deleted_at The time when the list was deleted. + * @param string $object_type_id The object type of the list. * * @return self */ - public function setDeletedAt($deleted_at) + public function setObjectTypeId($object_type_id) { - if (is_null($deleted_at)) { - throw new \InvalidArgumentException('non-nullable deleted_at cannot be null'); + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); } - $this->container['deleted_at'] = $deleted_at; + $this->container['object_type_id'] = $object_type_id; return $this; } /** - * Gets list_version + * Gets processing_status * - * @return int + * @return string */ - public function getListVersion() + public function getProcessingStatus() { - return $this->container['list_version']; + return $this->container['processing_status']; } /** - * Sets list_version + * Sets processing_status * - * @param int $list_version The version of the list. + * @param string $processing_status The processing status of the list. * * @return self */ - public function setListVersion($list_version) + public function setProcessingStatus($processing_status) { - if (is_null($list_version)) { - throw new \InvalidArgumentException('non-nullable list_version cannot be null'); + if (is_null($processing_status)) { + throw new \InvalidArgumentException('non-nullable processing_status cannot be null'); } - $this->container['list_version'] = $list_version; + $this->container['processing_status'] = $processing_status; return $this; } /** - * Gets name + * Gets processing_type * * @return string */ - public function getName() + public function getProcessingType() { - return $this->container['name']; + return $this->container['processing_type']; } /** - * Sets name + * Sets processing_type * - * @param string $name The name of the list. + * @param string $processing_type The processing type of the list. * * @return self */ - public function setName($name) + public function setProcessingType($processing_type) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($processing_type)) { + throw new \InvalidArgumentException('non-nullable processing_type cannot be null'); } - $this->container['name'] = $name; + $this->container['processing_type'] = $processing_type; return $this; } /** - * Gets additional_properties + * Gets updated_at * - * @return array + * @return \DateTime|null */ - public function getAdditionalProperties() + public function getUpdatedAt() { - return $this->container['additional_properties']; + return $this->container['updated_at']; } /** - * Sets additional_properties + * Sets updated_at * - * @param array $additional_properties The name and value of any additional properties that exist for this list and that were included in the search request. + * @param \DateTime|null $updated_at The time the list was last updated. * * @return self */ - public function setAdditionalProperties($additional_properties) + public function setUpdatedAt($updated_at) { - if (is_null($additional_properties)) { - throw new \InvalidArgumentException('non-nullable additional_properties cannot be null'); + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); } - $this->container['additional_properties'] = $additional_properties; + $this->container['updated_at'] = $updated_at; return $this; } /** - * Gets created_by_id + * Gets updated_by_id * * @return string|null */ - public function getCreatedById() - { - return $this->container['created_by_id']; - } - - /** - * Sets created_by_id - * - * @param string|null $created_by_id The ID of the user that created the list. - * - * @return self - */ - public function setCreatedById($created_by_id) - { - if (is_null($created_by_id)) { - throw new \InvalidArgumentException('non-nullable created_by_id cannot be null'); - } - $this->container['created_by_id'] = $created_by_id; - - return $this; - } - - /** - * Gets updated_at - * - * @return \DateTime|null - */ - public function getUpdatedAt() + public function getUpdatedById() { - return $this->container['updated_at']; + return $this->container['updated_by_id']; } /** - * Sets updated_at + * Sets updated_by_id * - * @param \DateTime|null $updated_at The time the list was last updated. + * @param string|null $updated_by_id The ID of the user that last updated the list. * * @return self */ - public function setUpdatedAt($updated_at) + public function setUpdatedById($updated_by_id) { - if (is_null($updated_at)) { - throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + if (is_null($updated_by_id)) { + throw new \InvalidArgumentException('non-nullable updated_by_id cannot be null'); } - $this->container['updated_at'] = $updated_at; + $this->container['updated_by_id'] = $updated_by_id; 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]); } @@ -759,12 +759,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; } @@ -789,11 +789,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/Lists/Model/PublicOrFilterBranch.php b/codegen/Crm/Lists/Model/PublicOrFilterBranch.php index ba2c3237f..e80183d40 100644 --- a/codegen/Crm/Lists/Model/PublicOrFilterBranch.php +++ b/codegen/Crm/Lists/Model/PublicOrFilterBranch.php @@ -2,7 +2,7 @@ /** * PublicOrFilterBranch * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,9 +57,9 @@ class PublicOrFilterBranch implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ + 'filter_branch_operator' => 'string', 'filter_branch_type' => 'string', 'filter_branches' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[]', - 'filter_branch_operator' => 'string', 'filters' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[]' ]; @@ -71,9 +71,9 @@ class PublicOrFilterBranch implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ + 'filter_branch_operator' => null, 'filter_branch_type' => null, 'filter_branches' => null, - 'filter_branch_operator' => null, 'filters' => null ]; @@ -83,9 +83,9 @@ class PublicOrFilterBranch implements ModelInterface, ArrayAccess, \JsonSerializ * @var boolean[] */ protected static array $openAPINullables = [ + 'filter_branch_operator' => false, 'filter_branch_type' => false, 'filter_branches' => false, - 'filter_branch_operator' => false, 'filters' => false ]; @@ -175,9 +175,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'filter_branch_operator' => 'filterBranchOperator', 'filter_branch_type' => 'filterBranchType', 'filter_branches' => 'filterBranches', - 'filter_branch_operator' => 'filterBranchOperator', 'filters' => 'filters' ]; @@ -187,9 +187,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'filter_branch_operator' => 'setFilterBranchOperator', 'filter_branch_type' => 'setFilterBranchType', 'filter_branches' => 'setFilterBranches', - 'filter_branch_operator' => 'setFilterBranchOperator', 'filters' => 'setFilters' ]; @@ -199,9 +199,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'filter_branch_operator' => 'getFilterBranchOperator', 'filter_branch_type' => 'getFilterBranchType', 'filter_branches' => 'getFilterBranches', - 'filter_branch_operator' => 'getFilterBranchOperator', 'filters' => 'getFilters' ]; @@ -275,9 +275,9 @@ public function getFilterBranchTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('filter_branch_operator', $data ?? [], null); $this->setIfExists('filter_branch_type', $data ?? [], 'OR'); $this->setIfExists('filter_branches', $data ?? [], null); - $this->setIfExists('filter_branch_operator', $data ?? [], null); $this->setIfExists('filters', $data ?? [], null); } @@ -308,6 +308,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['filter_branch_operator'] === null) { + $invalidProperties[] = "'filter_branch_operator' can't be null"; + } if ($this->container['filter_branch_type'] === null) { $invalidProperties[] = "'filter_branch_type' can't be null"; } @@ -323,9 +326,6 @@ public function listInvalidProperties() if ($this->container['filter_branches'] === null) { $invalidProperties[] = "'filter_branches' can't be null"; } - if ($this->container['filter_branch_operator'] === null) { - $invalidProperties[] = "'filter_branch_operator' can't be null"; - } if ($this->container['filters'] === null) { $invalidProperties[] = "'filters' can't be null"; } @@ -344,6 +344,33 @@ public function valid() } + /** + * Gets filter_branch_operator + * + * @return string + */ + public function getFilterBranchOperator() + { + return $this->container['filter_branch_operator']; + } + + /** + * Sets filter_branch_operator + * + * @param string $filter_branch_operator The logical operator used to combine the filters within the branch (OR). + * + * @return self + */ + public function setFilterBranchOperator($filter_branch_operator) + { + if (is_null($filter_branch_operator)) { + throw new \InvalidArgumentException('non-nullable filter_branch_operator cannot be null'); + } + $this->container['filter_branch_operator'] = $filter_branch_operator; + + return $this; + } + /** * Gets filter_branch_type * @@ -357,7 +384,7 @@ public function getFilterBranchType() /** * Sets filter_branch_type * - * @param string $filter_branch_type filter_branch_type + * @param string $filter_branch_type The type of the filter branch (OR). * * @return self */ @@ -408,33 +435,6 @@ public function setFilterBranches($filter_branches) return $this; } - /** - * Gets filter_branch_operator - * - * @return string - */ - public function getFilterBranchOperator() - { - return $this->container['filter_branch_operator']; - } - - /** - * Sets filter_branch_operator - * - * @param string $filter_branch_operator filter_branch_operator - * - * @return self - */ - public function setFilterBranchOperator($filter_branch_operator) - { - if (is_null($filter_branch_operator)) { - throw new \InvalidArgumentException('non-nullable filter_branch_operator cannot be null'); - } - $this->container['filter_branch_operator'] = $filter_branch_operator; - - return $this; - } - /** * Gets filters * @@ -464,11 +464,11 @@ public function setFilters($filters) /** * 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]); } @@ -476,12 +476,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; } @@ -506,11 +506,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/Lists/Model/PublicPageViewAnalyticsFilter.php b/codegen/Crm/Lists/Model/PublicPageViewAnalyticsFilter.php index 06a80b4b2..7ab9bf017 100644 --- a/codegen/Crm/Lists/Model/PublicPageViewAnalyticsFilter.php +++ b/codegen/Crm/Lists/Model/PublicPageViewAnalyticsFilter.php @@ -2,7 +2,7 @@ /** * PublicPageViewAnalyticsFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -59,10 +59,10 @@ class PublicPageViewAnalyticsFilter implements ModelInterface, ArrayAccess, \Jso protected static $openAPITypes = [ 'coalescing_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', 'enable_tracking' => 'bool', - 'pruning_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', - 'page_url' => 'string', 'filter_type' => 'string', - 'operator' => 'string' + 'operator' => 'string', + 'page_url' => 'string', + 'pruning_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy' ]; /** @@ -75,10 +75,10 @@ class PublicPageViewAnalyticsFilter implements ModelInterface, ArrayAccess, \Jso protected static $openAPIFormats = [ 'coalescing_refine_by' => null, 'enable_tracking' => null, - 'pruning_refine_by' => null, - 'page_url' => null, 'filter_type' => null, - 'operator' => null + 'operator' => null, + 'page_url' => null, + 'pruning_refine_by' => null ]; /** @@ -89,10 +89,10 @@ class PublicPageViewAnalyticsFilter implements ModelInterface, ArrayAccess, \Jso protected static array $openAPINullables = [ 'coalescing_refine_by' => false, 'enable_tracking' => false, - 'pruning_refine_by' => false, - 'page_url' => false, 'filter_type' => false, - 'operator' => false + 'operator' => false, + 'page_url' => false, + 'pruning_refine_by' => false ]; /** @@ -183,10 +183,10 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'coalescing_refine_by' => 'coalescingRefineBy', 'enable_tracking' => 'enableTracking', - 'pruning_refine_by' => 'pruningRefineBy', - 'page_url' => 'pageUrl', 'filter_type' => 'filterType', - 'operator' => 'operator' + 'operator' => 'operator', + 'page_url' => 'pageUrl', + 'pruning_refine_by' => 'pruningRefineBy' ]; /** @@ -197,10 +197,10 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'coalescing_refine_by' => 'setCoalescingRefineBy', 'enable_tracking' => 'setEnableTracking', - 'pruning_refine_by' => 'setPruningRefineBy', - 'page_url' => 'setPageUrl', 'filter_type' => 'setFilterType', - 'operator' => 'setOperator' + 'operator' => 'setOperator', + 'page_url' => 'setPageUrl', + 'pruning_refine_by' => 'setPruningRefineBy' ]; /** @@ -211,10 +211,10 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'coalescing_refine_by' => 'getCoalescingRefineBy', 'enable_tracking' => 'getEnableTracking', - 'pruning_refine_by' => 'getPruningRefineBy', - 'page_url' => 'getPageUrl', 'filter_type' => 'getFilterType', - 'operator' => 'getOperator' + 'operator' => 'getOperator', + 'page_url' => 'getPageUrl', + 'pruning_refine_by' => 'getPruningRefineBy' ]; /** @@ -289,10 +289,10 @@ public function __construct(?array $data = null) { $this->setIfExists('coalescing_refine_by', $data ?? [], null); $this->setIfExists('enable_tracking', $data ?? [], null); - $this->setIfExists('pruning_refine_by', $data ?? [], null); - $this->setIfExists('page_url', $data ?? [], null); $this->setIfExists('filter_type', $data ?? [], 'PAGE_VIEW'); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('page_url', $data ?? [], null); + $this->setIfExists('pruning_refine_by', $data ?? [], null); } /** @@ -322,9 +322,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['page_url'] === null) { - $invalidProperties[] = "'page_url' can't be null"; - } if ($this->container['filter_type'] === null) { $invalidProperties[] = "'filter_type' can't be null"; } @@ -340,6 +337,9 @@ public function listInvalidProperties() if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } + if ($this->container['page_url'] === null) { + $invalidProperties[] = "'page_url' can't be null"; + } return $invalidProperties; } @@ -395,7 +395,7 @@ public function getEnableTracking() /** * Sets enable_tracking * - * @param bool|null $enable_tracking enable_tracking + * @param bool|null $enable_tracking Indicates whether tracking is enabled for the page view. * * @return self */ @@ -410,130 +410,130 @@ public function setEnableTracking($enable_tracking) } /** - * Gets pruning_refine_by + * Gets filter_type * - * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null + * @return string */ - public function getPruningRefineBy() + public function getFilterType() { - return $this->container['pruning_refine_by']; + return $this->container['filter_type']; } /** - * Sets pruning_refine_by + * Sets filter_type * - * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null $pruning_refine_by pruning_refine_by + * @param string $filter_type Indicates the type of filter being applied (PAGE_VIEW). * * @return self */ - public function setPruningRefineBy($pruning_refine_by) + public function setFilterType($filter_type) { - if (is_null($pruning_refine_by)) { - throw new \InvalidArgumentException('non-nullable pruning_refine_by cannot be null'); + if (is_null($filter_type)) { + throw new \InvalidArgumentException('non-nullable filter_type cannot be null'); } - $this->container['pruning_refine_by'] = $pruning_refine_by; + $allowedValues = $this->getFilterTypeAllowableValues(); + if (!in_array($filter_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'filter_type', must be one of '%s'", + $filter_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['filter_type'] = $filter_type; return $this; } /** - * Gets page_url + * Gets operator * * @return string */ - public function getPageUrl() + public function getOperator() { - return $this->container['page_url']; + return $this->container['operator']; } /** - * Sets page_url + * Sets operator * - * @param string $page_url page_url + * @param string $operator Defines the operation to be applied within the filter (HAS_PAGEVIEW_EQ, HAS_PAGEVIEW_CONTAINS, HAS_PAGEVIEW_MATCHES_REGEX, NOT_HAS_PAGEVIEW_EQ, NOT_HAS_PAGEVIEW_CONTAINS). * * @return self */ - public function setPageUrl($page_url) + public function setOperator($operator) { - if (is_null($page_url)) { - throw new \InvalidArgumentException('non-nullable page_url cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['page_url'] = $page_url; + $this->container['operator'] = $operator; return $this; } /** - * Gets filter_type + * Gets page_url * * @return string */ - public function getFilterType() + public function getPageUrl() { - return $this->container['filter_type']; + return $this->container['page_url']; } /** - * Sets filter_type + * Sets page_url * - * @param string $filter_type filter_type + * @param string $page_url The URL of the page to be used in the filter. * * @return self */ - public function setFilterType($filter_type) + public function setPageUrl($page_url) { - if (is_null($filter_type)) { - throw new \InvalidArgumentException('non-nullable filter_type cannot be null'); - } - $allowedValues = $this->getFilterTypeAllowableValues(); - if (!in_array($filter_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'filter_type', must be one of '%s'", - $filter_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($page_url)) { + throw new \InvalidArgumentException('non-nullable page_url cannot be null'); } - $this->container['filter_type'] = $filter_type; + $this->container['page_url'] = $page_url; return $this; } /** - * Gets operator + * Gets pruning_refine_by * - * @return string + * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy|null */ - public function getOperator() + public function getPruningRefineBy() { - return $this->container['operator']; + return $this->container['pruning_refine_by']; } /** - * Sets operator + * Sets pruning_refine_by * - * @param string $operator operator + * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy|null $pruning_refine_by pruning_refine_by * * @return self */ - public function setOperator($operator) + public function setPruningRefineBy($pruning_refine_by) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); + if (is_null($pruning_refine_by)) { + throw new \InvalidArgumentException('non-nullable pruning_refine_by cannot be null'); } - $this->container['operator'] = $operator; + $this->container['pruning_refine_by'] = $pruning_refine_by; 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]); } @@ -541,12 +541,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; } @@ -571,11 +571,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/Lists/Model/PublicPrivacyAnalyticsFilter.php b/codegen/Crm/Lists/Model/PublicPrivacyAnalyticsFilter.php index 3c2969b10..37c24037e 100644 --- a/codegen/Crm/Lists/Model/PublicPrivacyAnalyticsFilter.php +++ b/codegen/Crm/Lists/Model/PublicPrivacyAnalyticsFilter.php @@ -2,7 +2,7 @@ /** * PublicPrivacyAnalyticsFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,9 +57,9 @@ class PublicPrivacyAnalyticsFilter implements ModelInterface, ArrayAccess, \Json * @var string[] */ protected static $openAPITypes = [ - 'privacy_name' => 'string', 'filter_type' => 'string', - 'operator' => 'string' + 'operator' => 'string', + 'privacy_name' => 'string' ]; /** @@ -70,9 +70,9 @@ class PublicPrivacyAnalyticsFilter implements ModelInterface, ArrayAccess, \Json * @psalm-var array */ protected static $openAPIFormats = [ - 'privacy_name' => null, 'filter_type' => null, - 'operator' => null + 'operator' => null, + 'privacy_name' => null ]; /** @@ -81,9 +81,9 @@ class PublicPrivacyAnalyticsFilter implements ModelInterface, ArrayAccess, \Json * @var boolean[] */ protected static array $openAPINullables = [ - 'privacy_name' => false, 'filter_type' => false, - 'operator' => false + 'operator' => false, + 'privacy_name' => false ]; /** @@ -172,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'privacy_name' => 'privacyName', 'filter_type' => 'filterType', - 'operator' => 'operator' + 'operator' => 'operator', + 'privacy_name' => 'privacyName' ]; /** @@ -183,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'privacy_name' => 'setPrivacyName', 'filter_type' => 'setFilterType', - 'operator' => 'setOperator' + 'operator' => 'setOperator', + 'privacy_name' => 'setPrivacyName' ]; /** @@ -194,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'privacy_name' => 'getPrivacyName', 'filter_type' => 'getFilterType', - 'operator' => 'getOperator' + 'operator' => 'getOperator', + 'privacy_name' => 'getPrivacyName' ]; /** @@ -269,9 +269,9 @@ public function getFilterTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('privacy_name', $data ?? [], null); $this->setIfExists('filter_type', $data ?? [], 'PRIVACY'); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('privacy_name', $data ?? [], null); } /** @@ -301,9 +301,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['privacy_name'] === null) { - $invalidProperties[] = "'privacy_name' can't be null"; - } if ($this->container['filter_type'] === null) { $invalidProperties[] = "'filter_type' can't be null"; } @@ -319,6 +316,9 @@ public function listInvalidProperties() if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } + if ($this->container['privacy_name'] === null) { + $invalidProperties[] = "'privacy_name' can't be null"; + } return $invalidProperties; } @@ -334,33 +334,6 @@ public function valid() } - /** - * Gets privacy_name - * - * @return string - */ - public function getPrivacyName() - { - return $this->container['privacy_name']; - } - - /** - * Sets privacy_name - * - * @param string $privacy_name privacy_name - * - * @return self - */ - public function setPrivacyName($privacy_name) - { - if (is_null($privacy_name)) { - throw new \InvalidArgumentException('non-nullable privacy_name cannot be null'); - } - $this->container['privacy_name'] = $privacy_name; - - return $this; - } - /** * Gets filter_type * @@ -374,7 +347,7 @@ public function getFilterType() /** * Sets filter_type * - * @param string $filter_type filter_type + * @param string $filter_type Specifies the type of filter (PRIVACY). * * @return self */ @@ -411,7 +384,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Defines the operation to be applied within the filter (PRIVACY_CONSENT_GRANTED, PRIVACY_CONSENT_NOT_GRANTED). * * @return self */ @@ -424,14 +397,41 @@ public function setOperator($operator) return $this; } + + /** + * Gets privacy_name + * + * @return string + */ + public function getPrivacyName() + { + return $this->container['privacy_name']; + } + + /** + * Sets privacy_name + * + * @param string $privacy_name The name of the privacy setting used in the filter. + * + * @return self + */ + public function setPrivacyName($privacy_name) + { + if (is_null($privacy_name)) { + throw new \InvalidArgumentException('non-nullable privacy_name cannot be null'); + } + $this->container['privacy_name'] = $privacy_name; + + 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]); } @@ -439,12 +439,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; } @@ -469,11 +469,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/Lists/Model/PublicPropertyAssociationFilterBranch.php b/codegen/Crm/Lists/Model/PublicPropertyAssociationFilterBranch.php index 9bc160d9f..3c9e6d4f6 100644 --- a/codegen/Crm/Lists/Model/PublicPropertyAssociationFilterBranch.php +++ b/codegen/Crm/Lists/Model/PublicPropertyAssociationFilterBranch.php @@ -2,7 +2,7 @@ /** * PublicPropertyAssociationFilterBranch * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,13 +57,13 @@ class PublicPropertyAssociationFilterBranch implements ModelInterface, ArrayAcce * @var string[] */ protected static $openAPITypes = [ + 'filter_branch_operator' => 'string', 'filter_branch_type' => 'string', 'filter_branches' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[]', - 'object_type_id' => 'string', - 'filter_branch_operator' => 'string', 'filters' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[]', - 'property_with_object_id' => 'string', - 'operator' => 'string' + 'object_type_id' => 'string', + 'operator' => 'string', + 'property_with_object_id' => 'string' ]; /** @@ -74,13 +74,13 @@ class PublicPropertyAssociationFilterBranch implements ModelInterface, ArrayAcce * @psalm-var array */ protected static $openAPIFormats = [ + 'filter_branch_operator' => null, 'filter_branch_type' => null, 'filter_branches' => null, - 'object_type_id' => null, - 'filter_branch_operator' => null, 'filters' => null, - 'property_with_object_id' => null, - 'operator' => null + 'object_type_id' => null, + 'operator' => null, + 'property_with_object_id' => null ]; /** @@ -89,13 +89,13 @@ class PublicPropertyAssociationFilterBranch implements ModelInterface, ArrayAcce * @var boolean[] */ protected static array $openAPINullables = [ + 'filter_branch_operator' => false, 'filter_branch_type' => false, 'filter_branches' => false, - 'object_type_id' => false, - 'filter_branch_operator' => false, 'filters' => false, - 'property_with_object_id' => false, - 'operator' => false + 'object_type_id' => false, + 'operator' => false, + 'property_with_object_id' => false ]; /** @@ -184,13 +184,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'filter_branch_operator' => 'filterBranchOperator', 'filter_branch_type' => 'filterBranchType', 'filter_branches' => 'filterBranches', - 'object_type_id' => 'objectTypeId', - 'filter_branch_operator' => 'filterBranchOperator', 'filters' => 'filters', - 'property_with_object_id' => 'propertyWithObjectId', - 'operator' => 'operator' + 'object_type_id' => 'objectTypeId', + 'operator' => 'operator', + 'property_with_object_id' => 'propertyWithObjectId' ]; /** @@ -199,13 +199,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'filter_branch_operator' => 'setFilterBranchOperator', 'filter_branch_type' => 'setFilterBranchType', 'filter_branches' => 'setFilterBranches', - 'object_type_id' => 'setObjectTypeId', - 'filter_branch_operator' => 'setFilterBranchOperator', 'filters' => 'setFilters', - 'property_with_object_id' => 'setPropertyWithObjectId', - 'operator' => 'setOperator' + 'object_type_id' => 'setObjectTypeId', + 'operator' => 'setOperator', + 'property_with_object_id' => 'setPropertyWithObjectId' ]; /** @@ -214,13 +214,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'filter_branch_operator' => 'getFilterBranchOperator', 'filter_branch_type' => 'getFilterBranchType', 'filter_branches' => 'getFilterBranches', - 'object_type_id' => 'getObjectTypeId', - 'filter_branch_operator' => 'getFilterBranchOperator', 'filters' => 'getFilters', - 'property_with_object_id' => 'getPropertyWithObjectId', - 'operator' => 'getOperator' + 'object_type_id' => 'getObjectTypeId', + 'operator' => 'getOperator', + 'property_with_object_id' => 'getPropertyWithObjectId' ]; /** @@ -293,13 +293,13 @@ public function getFilterBranchTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('filter_branch_operator', $data ?? [], null); $this->setIfExists('filter_branch_type', $data ?? [], 'PROPERTY_ASSOCIATION'); $this->setIfExists('filter_branches', $data ?? [], null); - $this->setIfExists('object_type_id', $data ?? [], null); - $this->setIfExists('filter_branch_operator', $data ?? [], null); $this->setIfExists('filters', $data ?? [], null); - $this->setIfExists('property_with_object_id', $data ?? [], null); + $this->setIfExists('object_type_id', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('property_with_object_id', $data ?? [], null); } /** @@ -329,6 +329,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['filter_branch_operator'] === null) { + $invalidProperties[] = "'filter_branch_operator' can't be null"; + } if ($this->container['filter_branch_type'] === null) { $invalidProperties[] = "'filter_branch_type' can't be null"; } @@ -344,21 +347,18 @@ public function listInvalidProperties() if ($this->container['filter_branches'] === null) { $invalidProperties[] = "'filter_branches' can't be null"; } - if ($this->container['object_type_id'] === null) { - $invalidProperties[] = "'object_type_id' can't be null"; - } - if ($this->container['filter_branch_operator'] === null) { - $invalidProperties[] = "'filter_branch_operator' can't be null"; - } if ($this->container['filters'] === null) { $invalidProperties[] = "'filters' can't be null"; } - if ($this->container['property_with_object_id'] === null) { - $invalidProperties[] = "'property_with_object_id' can't be null"; + if ($this->container['object_type_id'] === null) { + $invalidProperties[] = "'object_type_id' can't be null"; } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } + if ($this->container['property_with_object_id'] === null) { + $invalidProperties[] = "'property_with_object_id' can't be null"; + } return $invalidProperties; } @@ -374,6 +374,33 @@ public function valid() } + /** + * Gets filter_branch_operator + * + * @return string + */ + public function getFilterBranchOperator() + { + return $this->container['filter_branch_operator']; + } + + /** + * Sets filter_branch_operator + * + * @param string $filter_branch_operator The logical operator used to combine filters within the branch. + * + * @return self + */ + public function setFilterBranchOperator($filter_branch_operator) + { + if (is_null($filter_branch_operator)) { + throw new \InvalidArgumentException('non-nullable filter_branch_operator cannot be null'); + } + $this->container['filter_branch_operator'] = $filter_branch_operator; + + return $this; + } + /** * Gets filter_branch_type * @@ -387,7 +414,7 @@ public function getFilterBranchType() /** * Sets filter_branch_type * - * @param string $filter_branch_type filter_branch_type + * @param string $filter_branch_type The type of the filter branch (PROPERTY_ASSOCIATION). * * @return self */ @@ -439,82 +466,82 @@ public function setFilterBranches($filter_branches) } /** - * Gets object_type_id + * Gets filters * - * @return string + * @return \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[] */ - public function getObjectTypeId() + public function getFilters() { - return $this->container['object_type_id']; + return $this->container['filters']; } /** - * Sets object_type_id + * Sets filters * - * @param string $object_type_id object_type_id + * @param \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[] $filters filters * * @return self */ - public function setObjectTypeId($object_type_id) + public function setFilters($filters) { - if (is_null($object_type_id)) { - throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); + if (is_null($filters)) { + throw new \InvalidArgumentException('non-nullable filters cannot be null'); } - $this->container['object_type_id'] = $object_type_id; + $this->container['filters'] = $filters; return $this; } /** - * Gets filter_branch_operator + * Gets object_type_id * * @return string */ - public function getFilterBranchOperator() + public function getObjectTypeId() { - return $this->container['filter_branch_operator']; + return $this->container['object_type_id']; } /** - * Sets filter_branch_operator + * Sets object_type_id * - * @param string $filter_branch_operator filter_branch_operator + * @param string $object_type_id The ID representing the type of object associated with the filter branch. * * @return self */ - public function setFilterBranchOperator($filter_branch_operator) + public function setObjectTypeId($object_type_id) { - if (is_null($filter_branch_operator)) { - throw new \InvalidArgumentException('non-nullable filter_branch_operator cannot be null'); + if (is_null($object_type_id)) { + throw new \InvalidArgumentException('non-nullable object_type_id cannot be null'); } - $this->container['filter_branch_operator'] = $filter_branch_operator; + $this->container['object_type_id'] = $object_type_id; return $this; } /** - * Gets filters + * Gets operator * - * @return \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[] + * @return string */ - public function getFilters() + public function getOperator() { - return $this->container['filters']; + return $this->container['operator']; } /** - * Sets filters + * Sets operator * - * @param \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[] $filters filters + * @param string $operator Defines the operation to be applied within the filter branch (IN_LIST, NOT_IN_LIST). * * @return self */ - public function setFilters($filters) + public function setOperator($operator) { - if (is_null($filters)) { - throw new \InvalidArgumentException('non-nullable filters cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['filters'] = $filters; + $this->container['operator'] = $operator; return $this; } @@ -532,7 +559,7 @@ public function getPropertyWithObjectId() /** * Sets property_with_object_id * - * @param string $property_with_object_id property_with_object_id + * @param string $property_with_object_id The property that is associated with the object ID in the filter branch. * * @return self */ @@ -545,41 +572,14 @@ public function setPropertyWithObjectId($property_with_object_id) return $this; } - - /** - * Gets operator - * - * @return string - */ - public function getOperator() - { - return $this->container['operator']; - } - - /** - * Sets operator - * - * @param string $operator operator - * - * @return self - */ - public function setOperator($operator) - { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); - } - $this->container['operator'] = $operator; - - 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]); } @@ -587,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; } @@ -617,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/Lists/Model/PublicPropertyAssociationFilterBranchFilterBranchesInner.php b/codegen/Crm/Lists/Model/PublicPropertyAssociationFilterBranchFilterBranchesInner.php index 1d003be17..4c120e938 100644 --- a/codegen/Crm/Lists/Model/PublicPropertyAssociationFilterBranchFilterBranchesInner.php +++ b/codegen/Crm/Lists/Model/PublicPropertyAssociationFilterBranchFilterBranchesInner.php @@ -2,7 +2,7 @@ /** * PublicPropertyAssociationFilterBranchFilterBranchesInner * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -42,7 +42,7 @@ */ class PublicPropertyAssociationFilterBranchFilterBranchesInner implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = null; + public const DISCRIMINATOR = 'filter_branch_type'; /** * The original name of the model. @@ -57,17 +57,17 @@ class PublicPropertyAssociationFilterBranchFilterBranchesInner implements ModelI * @var string[] */ protected static $openAPITypes = [ + 'filter_branch_operator' => 'string', 'filter_branch_type' => 'string', 'filter_branches' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[]', - 'filter_branch_operator' => 'string', 'filters' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[]', - 'event_type_id' => 'string', 'coalescing_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', + 'event_type_id' => 'string', 'operator' => 'string', 'object_type_id' => 'string', 'property_with_object_id' => 'string', - 'association_type_id' => 'int', - 'association_category' => 'string' + 'association_category' => 'string', + 'association_type_id' => 'int' ]; /** @@ -78,17 +78,17 @@ class PublicPropertyAssociationFilterBranchFilterBranchesInner implements ModelI * @psalm-var array */ protected static $openAPIFormats = [ + 'filter_branch_operator' => null, 'filter_branch_type' => null, 'filter_branches' => null, - 'filter_branch_operator' => null, 'filters' => null, - 'event_type_id' => null, 'coalescing_refine_by' => null, + 'event_type_id' => null, 'operator' => null, 'object_type_id' => null, 'property_with_object_id' => null, - 'association_type_id' => 'int32', - 'association_category' => null + 'association_category' => null, + 'association_type_id' => 'int32' ]; /** @@ -97,17 +97,17 @@ class PublicPropertyAssociationFilterBranchFilterBranchesInner implements ModelI * @var boolean[] */ protected static array $openAPINullables = [ + 'filter_branch_operator' => false, 'filter_branch_type' => false, 'filter_branches' => false, - 'filter_branch_operator' => false, 'filters' => false, - 'event_type_id' => false, 'coalescing_refine_by' => false, + 'event_type_id' => false, 'operator' => false, 'object_type_id' => false, 'property_with_object_id' => false, - 'association_type_id' => false, - 'association_category' => false + 'association_category' => false, + 'association_type_id' => false ]; /** @@ -196,17 +196,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'filter_branch_operator' => 'filterBranchOperator', 'filter_branch_type' => 'filterBranchType', 'filter_branches' => 'filterBranches', - 'filter_branch_operator' => 'filterBranchOperator', 'filters' => 'filters', - 'event_type_id' => 'eventTypeId', 'coalescing_refine_by' => 'coalescingRefineBy', + 'event_type_id' => 'eventTypeId', 'operator' => 'operator', 'object_type_id' => 'objectTypeId', 'property_with_object_id' => 'propertyWithObjectId', - 'association_type_id' => 'associationTypeId', - 'association_category' => 'associationCategory' + 'association_category' => 'associationCategory', + 'association_type_id' => 'associationTypeId' ]; /** @@ -215,17 +215,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'filter_branch_operator' => 'setFilterBranchOperator', 'filter_branch_type' => 'setFilterBranchType', 'filter_branches' => 'setFilterBranches', - 'filter_branch_operator' => 'setFilterBranchOperator', 'filters' => 'setFilters', - 'event_type_id' => 'setEventTypeId', 'coalescing_refine_by' => 'setCoalescingRefineBy', + 'event_type_id' => 'setEventTypeId', 'operator' => 'setOperator', 'object_type_id' => 'setObjectTypeId', 'property_with_object_id' => 'setPropertyWithObjectId', - 'association_type_id' => 'setAssociationTypeId', - 'association_category' => 'setAssociationCategory' + 'association_category' => 'setAssociationCategory', + 'association_type_id' => 'setAssociationTypeId' ]; /** @@ -234,17 +234,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'filter_branch_operator' => 'getFilterBranchOperator', 'filter_branch_type' => 'getFilterBranchType', 'filter_branches' => 'getFilterBranches', - 'filter_branch_operator' => 'getFilterBranchOperator', 'filters' => 'getFilters', - 'event_type_id' => 'getEventTypeId', 'coalescing_refine_by' => 'getCoalescingRefineBy', + 'event_type_id' => 'getEventTypeId', 'operator' => 'getOperator', 'object_type_id' => 'getObjectTypeId', 'property_with_object_id' => 'getPropertyWithObjectId', - 'association_type_id' => 'getAssociationTypeId', - 'association_category' => 'getAssociationCategory' + 'association_category' => 'getAssociationCategory', + 'association_type_id' => 'getAssociationTypeId' ]; /** @@ -317,17 +317,20 @@ public function getFilterBranchTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('filter_branch_operator', $data ?? [], null); $this->setIfExists('filter_branch_type', $data ?? [], 'ASSOCIATION'); $this->setIfExists('filter_branches', $data ?? [], null); - $this->setIfExists('filter_branch_operator', $data ?? [], null); $this->setIfExists('filters', $data ?? [], null); - $this->setIfExists('event_type_id', $data ?? [], null); $this->setIfExists('coalescing_refine_by', $data ?? [], null); + $this->setIfExists('event_type_id', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); $this->setIfExists('object_type_id', $data ?? [], null); $this->setIfExists('property_with_object_id', $data ?? [], null); - $this->setIfExists('association_type_id', $data ?? [], null); $this->setIfExists('association_category', $data ?? [], null); + $this->setIfExists('association_type_id', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['filter_branch_type'] = static::$openAPIModelName; } /** @@ -357,6 +360,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['filter_branch_operator'] === null) { + $invalidProperties[] = "'filter_branch_operator' can't be null"; + } if ($this->container['filter_branch_type'] === null) { $invalidProperties[] = "'filter_branch_type' can't be null"; } @@ -372,9 +378,6 @@ public function listInvalidProperties() if ($this->container['filter_branches'] === null) { $invalidProperties[] = "'filter_branches' can't be null"; } - if ($this->container['filter_branch_operator'] === null) { - $invalidProperties[] = "'filter_branch_operator' can't be null"; - } if ($this->container['filters'] === null) { $invalidProperties[] = "'filters' can't be null"; } @@ -390,12 +393,12 @@ public function listInvalidProperties() if ($this->container['property_with_object_id'] === null) { $invalidProperties[] = "'property_with_object_id' can't be null"; } - if ($this->container['association_type_id'] === null) { - $invalidProperties[] = "'association_type_id' can't be null"; - } if ($this->container['association_category'] === null) { $invalidProperties[] = "'association_category' can't be null"; } + if ($this->container['association_type_id'] === null) { + $invalidProperties[] = "'association_type_id' can't be null"; + } return $invalidProperties; } @@ -411,6 +414,33 @@ public function valid() } + /** + * Gets filter_branch_operator + * + * @return string + */ + public function getFilterBranchOperator() + { + return $this->container['filter_branch_operator']; + } + + /** + * Sets filter_branch_operator + * + * @param string $filter_branch_operator Filter branch operator (AND) + * + * @return self + */ + public function setFilterBranchOperator($filter_branch_operator) + { + if (is_null($filter_branch_operator)) { + throw new \InvalidArgumentException('non-nullable filter_branch_operator cannot be null'); + } + $this->container['filter_branch_operator'] = $filter_branch_operator; + + return $this; + } + /** * Gets filter_branch_type * @@ -424,7 +454,7 @@ public function getFilterBranchType() /** * Sets filter_branch_type * - * @param string $filter_branch_type filter_branch_type + * @param string $filter_branch_type Type of the filter branch (ASSOCIATION) * * @return self */ @@ -475,33 +505,6 @@ public function setFilterBranches($filter_branches) return $this; } - /** - * Gets filter_branch_operator - * - * @return string - */ - public function getFilterBranchOperator() - { - return $this->container['filter_branch_operator']; - } - - /** - * Sets filter_branch_operator - * - * @param string $filter_branch_operator filter_branch_operator - * - * @return self - */ - public function setFilterBranchOperator($filter_branch_operator) - { - if (is_null($filter_branch_operator)) { - throw new \InvalidArgumentException('non-nullable filter_branch_operator cannot be null'); - } - $this->container['filter_branch_operator'] = $filter_branch_operator; - - return $this; - } - /** * Gets filters * @@ -530,55 +533,55 @@ public function setFilters($filters) } /** - * Gets event_type_id + * Gets coalescing_refine_by * - * @return string + * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null */ - public function getEventTypeId() + public function getCoalescingRefineBy() { - return $this->container['event_type_id']; + return $this->container['coalescing_refine_by']; } /** - * Sets event_type_id + * Sets coalescing_refine_by * - * @param string $event_type_id event_type_id + * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null $coalescing_refine_by coalescing_refine_by * * @return self */ - public function setEventTypeId($event_type_id) + public function setCoalescingRefineBy($coalescing_refine_by) { - if (is_null($event_type_id)) { - throw new \InvalidArgumentException('non-nullable event_type_id cannot be null'); + if (is_null($coalescing_refine_by)) { + throw new \InvalidArgumentException('non-nullable coalescing_refine_by cannot be null'); } - $this->container['event_type_id'] = $event_type_id; + $this->container['coalescing_refine_by'] = $coalescing_refine_by; return $this; } /** - * Gets coalescing_refine_by + * Gets event_type_id * - * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null + * @return string */ - public function getCoalescingRefineBy() + public function getEventTypeId() { - return $this->container['coalescing_refine_by']; + return $this->container['event_type_id']; } /** - * Sets coalescing_refine_by + * Sets event_type_id * - * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null $coalescing_refine_by coalescing_refine_by + * @param string $event_type_id The identifier for the type of event associated with the filter branch. * * @return self */ - public function setCoalescingRefineBy($coalescing_refine_by) + public function setEventTypeId($event_type_id) { - if (is_null($coalescing_refine_by)) { - throw new \InvalidArgumentException('non-nullable coalescing_refine_by cannot be null'); + if (is_null($event_type_id)) { + throw new \InvalidArgumentException('non-nullable event_type_id cannot be null'); } - $this->container['coalescing_refine_by'] = $coalescing_refine_by; + $this->container['event_type_id'] = $event_type_id; return $this; } @@ -596,7 +599,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Defines the operation to be applied within the filter branch (IN_LIST, NOT_IN_LIST). * * @return self */ @@ -623,7 +626,7 @@ public function getObjectTypeId() /** * Sets object_type_id * - * @param string $object_type_id object_type_id + * @param string $object_type_id The ID representing the type of object associated with the filter branch. * * @return self */ @@ -650,7 +653,7 @@ public function getPropertyWithObjectId() /** * Sets property_with_object_id * - * @param string $property_with_object_id property_with_object_id + * @param string $property_with_object_id The property that is associated with the object ID in the filter branch. * * @return self */ @@ -665,66 +668,66 @@ public function setPropertyWithObjectId($property_with_object_id) } /** - * Gets association_type_id + * Gets association_category * - * @return int + * @return string */ - public function getAssociationTypeId() + public function getAssociationCategory() { - return $this->container['association_type_id']; + return $this->container['association_category']; } /** - * Sets association_type_id + * Sets association_category * - * @param int $association_type_id association_type_id + * @param string $association_category Specifies the category of the association for the filter branch (HUBSPOT_DEFINED, USER_DEFINED, INTEGRATOR_DEFINED, WORK). * * @return self */ - public function setAssociationTypeId($association_type_id) + public function setAssociationCategory($association_category) { - if (is_null($association_type_id)) { - throw new \InvalidArgumentException('non-nullable association_type_id cannot be null'); + if (is_null($association_category)) { + throw new \InvalidArgumentException('non-nullable association_category cannot be null'); } - $this->container['association_type_id'] = $association_type_id; + $this->container['association_category'] = $association_category; return $this; } /** - * Gets association_category + * Gets association_type_id * - * @return string + * @return int */ - public function getAssociationCategory() + public function getAssociationTypeId() { - return $this->container['association_category']; + return $this->container['association_type_id']; } /** - * Sets association_category + * Sets association_type_id * - * @param string $association_category association_category + * @param int $association_type_id Type id of the association * * @return self */ - public function setAssociationCategory($association_category) + public function setAssociationTypeId($association_type_id) { - if (is_null($association_category)) { - throw new \InvalidArgumentException('non-nullable association_category cannot be null'); + if (is_null($association_type_id)) { + throw new \InvalidArgumentException('non-nullable association_type_id cannot be null'); } - $this->container['association_category'] = $association_category; + $this->container['association_type_id'] = $association_type_id; 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]); } @@ -732,12 +735,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; } @@ -762,11 +765,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/Lists/Model/PublicPropertyAssociationFilterBranchFiltersInner.php b/codegen/Crm/Lists/Model/PublicPropertyAssociationFilterBranchFiltersInner.php index d6000efed..e93fecc88 100644 --- a/codegen/Crm/Lists/Model/PublicPropertyAssociationFilterBranchFiltersInner.php +++ b/codegen/Crm/Lists/Model/PublicPropertyAssociationFilterBranchFiltersInner.php @@ -2,7 +2,7 @@ /** * PublicPropertyAssociationFilterBranchFiltersInner * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -42,7 +42,7 @@ */ class PublicPropertyAssociationFilterBranchFiltersInner implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = null; + public const DISCRIMINATOR = 'filter_type'; /** * The original name of the model. @@ -57,47 +57,47 @@ class PublicPropertyAssociationFilterBranchFiltersInner implements ModelInterfac * @var string[] */ protected static $openAPITypes = [ - 'property' => 'string', 'filter_type' => 'string', - 'operation' => '\HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison', - 'list_id' => 'string', + 'operation' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyFilterOperation', + 'property' => 'string', + 'association_category' => 'string', + 'association_type_id' => 'int', 'coalescing_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', + 'list_id' => 'string', + 'operator' => 'string', 'to_object_type' => 'string', - 'association_type_id' => 'int', - 'association_category' => 'string', 'to_object_type_id' => 'string', - 'operator' => 'string', 'enable_tracking' => 'bool', - 'pruning_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', 'page_url' => 'string', + 'pruning_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy', 'cta_name' => 'string', 'event_id' => 'string', 'form_id' => 'string', 'page_id' => 'string', 'event_type_id' => 'string', 'filter_lines' => '\HubSpot\Client\Crm\Lists\Model\PublicEventFilterMetadata[]', - 'subscription_type' => 'string', - 'subscription_ids' => 'string[]', 'accepted_statuses' => 'string[]', - 'channel' => 'string', + 'subscription_ids' => 'string[]', + 'subscription_type' => 'string', 'accepted_opt_states' => 'string[]', 'business_unit_id' => 'string', + 'channel' => 'string', 'campaign_id' => 'string', 'survey_id' => 'string', - 'value_comparison' => '\HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison', - 'survey_question' => 'string', - 'survey_answer_row_id' => 'string', 'survey_answer_col_id' => 'string', + 'survey_answer_row_id' => 'string', + 'survey_question' => 'string', + 'value_comparison' => '\HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison', 'webinar_id' => 'string', - 'click_url' => 'string', - 'level' => 'string', 'app_id' => 'string', + 'click_url' => 'string', 'email_id' => 'string', + 'level' => 'string', 'privacy_name' => 'string', - 'search_terms' => 'string[]', - 'entity_type' => 'string', 'ad_network' => 'string', + 'entity_type' => 'string', 'search_term_type' => 'string', + 'search_terms' => 'string[]', 'metadata' => '\HubSpot\Client\Crm\Lists\Model\PublicInListFilterMetadata', 'property_with_object_id' => 'string', 'should_accept' => 'bool', @@ -112,47 +112,47 @@ class PublicPropertyAssociationFilterBranchFiltersInner implements ModelInterfac * @psalm-var array */ protected static $openAPIFormats = [ - 'property' => null, 'filter_type' => null, 'operation' => null, - 'list_id' => null, + 'property' => null, + 'association_category' => null, + 'association_type_id' => 'int32', 'coalescing_refine_by' => null, + 'list_id' => null, + 'operator' => null, 'to_object_type' => null, - 'association_type_id' => 'int32', - 'association_category' => null, 'to_object_type_id' => null, - 'operator' => null, 'enable_tracking' => null, - 'pruning_refine_by' => null, 'page_url' => null, + 'pruning_refine_by' => null, 'cta_name' => null, 'event_id' => null, 'form_id' => null, 'page_id' => null, 'event_type_id' => null, 'filter_lines' => null, - 'subscription_type' => null, - 'subscription_ids' => null, 'accepted_statuses' => null, - 'channel' => null, + 'subscription_ids' => null, + 'subscription_type' => null, 'accepted_opt_states' => null, 'business_unit_id' => null, + 'channel' => null, 'campaign_id' => null, 'survey_id' => null, - 'value_comparison' => null, - 'survey_question' => null, - 'survey_answer_row_id' => null, 'survey_answer_col_id' => null, + 'survey_answer_row_id' => null, + 'survey_question' => null, + 'value_comparison' => null, 'webinar_id' => null, - 'click_url' => null, - 'level' => null, 'app_id' => null, + 'click_url' => null, 'email_id' => null, + 'level' => null, 'privacy_name' => null, - 'search_terms' => null, - 'entity_type' => null, 'ad_network' => null, + 'entity_type' => null, 'search_term_type' => null, + 'search_terms' => null, 'metadata' => null, 'property_with_object_id' => null, 'should_accept' => null, @@ -165,47 +165,47 @@ class PublicPropertyAssociationFilterBranchFiltersInner implements ModelInterfac * @var boolean[] */ protected static array $openAPINullables = [ - 'property' => false, 'filter_type' => false, 'operation' => false, - 'list_id' => false, + 'property' => false, + 'association_category' => false, + 'association_type_id' => false, 'coalescing_refine_by' => false, + 'list_id' => false, + 'operator' => false, 'to_object_type' => false, - 'association_type_id' => false, - 'association_category' => false, 'to_object_type_id' => false, - 'operator' => false, 'enable_tracking' => false, - 'pruning_refine_by' => false, 'page_url' => false, + 'pruning_refine_by' => false, 'cta_name' => false, 'event_id' => false, 'form_id' => false, 'page_id' => false, 'event_type_id' => false, 'filter_lines' => false, - 'subscription_type' => false, - 'subscription_ids' => false, 'accepted_statuses' => false, - 'channel' => false, + 'subscription_ids' => false, + 'subscription_type' => false, 'accepted_opt_states' => false, 'business_unit_id' => false, + 'channel' => false, 'campaign_id' => false, 'survey_id' => false, - 'value_comparison' => false, - 'survey_question' => false, - 'survey_answer_row_id' => false, 'survey_answer_col_id' => false, + 'survey_answer_row_id' => false, + 'survey_question' => false, + 'value_comparison' => false, 'webinar_id' => false, - 'click_url' => false, - 'level' => false, 'app_id' => false, + 'click_url' => false, 'email_id' => false, + 'level' => false, 'privacy_name' => false, - 'search_terms' => false, - 'entity_type' => false, 'ad_network' => false, + 'entity_type' => false, 'search_term_type' => false, + 'search_terms' => false, 'metadata' => false, 'property_with_object_id' => false, 'should_accept' => false, @@ -298,47 +298,47 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'property' => 'property', 'filter_type' => 'filterType', 'operation' => 'operation', - 'list_id' => 'listId', + 'property' => 'property', + 'association_category' => 'associationCategory', + 'association_type_id' => 'associationTypeId', 'coalescing_refine_by' => 'coalescingRefineBy', + 'list_id' => 'listId', + 'operator' => 'operator', 'to_object_type' => 'toObjectType', - 'association_type_id' => 'associationTypeId', - 'association_category' => 'associationCategory', 'to_object_type_id' => 'toObjectTypeId', - 'operator' => 'operator', 'enable_tracking' => 'enableTracking', - 'pruning_refine_by' => 'pruningRefineBy', 'page_url' => 'pageUrl', + 'pruning_refine_by' => 'pruningRefineBy', 'cta_name' => 'ctaName', 'event_id' => 'eventId', 'form_id' => 'formId', 'page_id' => 'pageId', 'event_type_id' => 'eventTypeId', 'filter_lines' => 'filterLines', - 'subscription_type' => 'subscriptionType', - 'subscription_ids' => 'subscriptionIds', 'accepted_statuses' => 'acceptedStatuses', - 'channel' => 'channel', + 'subscription_ids' => 'subscriptionIds', + 'subscription_type' => 'subscriptionType', 'accepted_opt_states' => 'acceptedOptStates', 'business_unit_id' => 'businessUnitId', + 'channel' => 'channel', 'campaign_id' => 'campaignId', 'survey_id' => 'surveyId', - 'value_comparison' => 'valueComparison', - 'survey_question' => 'surveyQuestion', - 'survey_answer_row_id' => 'surveyAnswerRowId', 'survey_answer_col_id' => 'surveyAnswerColId', + 'survey_answer_row_id' => 'surveyAnswerRowId', + 'survey_question' => 'surveyQuestion', + 'value_comparison' => 'valueComparison', 'webinar_id' => 'webinarId', - 'click_url' => 'clickUrl', - 'level' => 'level', 'app_id' => 'appId', + 'click_url' => 'clickUrl', 'email_id' => 'emailId', + 'level' => 'level', 'privacy_name' => 'privacyName', - 'search_terms' => 'searchTerms', - 'entity_type' => 'entityType', 'ad_network' => 'adNetwork', + 'entity_type' => 'entityType', 'search_term_type' => 'searchTermType', + 'search_terms' => 'searchTerms', 'metadata' => 'metadata', 'property_with_object_id' => 'propertyWithObjectId', 'should_accept' => 'shouldAccept', @@ -351,47 +351,47 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'property' => 'setProperty', 'filter_type' => 'setFilterType', 'operation' => 'setOperation', - 'list_id' => 'setListId', + 'property' => 'setProperty', + 'association_category' => 'setAssociationCategory', + 'association_type_id' => 'setAssociationTypeId', 'coalescing_refine_by' => 'setCoalescingRefineBy', + 'list_id' => 'setListId', + 'operator' => 'setOperator', 'to_object_type' => 'setToObjectType', - 'association_type_id' => 'setAssociationTypeId', - 'association_category' => 'setAssociationCategory', 'to_object_type_id' => 'setToObjectTypeId', - 'operator' => 'setOperator', 'enable_tracking' => 'setEnableTracking', - 'pruning_refine_by' => 'setPruningRefineBy', 'page_url' => 'setPageUrl', + 'pruning_refine_by' => 'setPruningRefineBy', 'cta_name' => 'setCtaName', 'event_id' => 'setEventId', 'form_id' => 'setFormId', 'page_id' => 'setPageId', 'event_type_id' => 'setEventTypeId', 'filter_lines' => 'setFilterLines', - 'subscription_type' => 'setSubscriptionType', - 'subscription_ids' => 'setSubscriptionIds', 'accepted_statuses' => 'setAcceptedStatuses', - 'channel' => 'setChannel', + 'subscription_ids' => 'setSubscriptionIds', + 'subscription_type' => 'setSubscriptionType', 'accepted_opt_states' => 'setAcceptedOptStates', 'business_unit_id' => 'setBusinessUnitId', + 'channel' => 'setChannel', 'campaign_id' => 'setCampaignId', 'survey_id' => 'setSurveyId', - 'value_comparison' => 'setValueComparison', - 'survey_question' => 'setSurveyQuestion', - 'survey_answer_row_id' => 'setSurveyAnswerRowId', 'survey_answer_col_id' => 'setSurveyAnswerColId', + 'survey_answer_row_id' => 'setSurveyAnswerRowId', + 'survey_question' => 'setSurveyQuestion', + 'value_comparison' => 'setValueComparison', 'webinar_id' => 'setWebinarId', - 'click_url' => 'setClickUrl', - 'level' => 'setLevel', 'app_id' => 'setAppId', + 'click_url' => 'setClickUrl', 'email_id' => 'setEmailId', + 'level' => 'setLevel', 'privacy_name' => 'setPrivacyName', - 'search_terms' => 'setSearchTerms', - 'entity_type' => 'setEntityType', 'ad_network' => 'setAdNetwork', + 'entity_type' => 'setEntityType', 'search_term_type' => 'setSearchTermType', + 'search_terms' => 'setSearchTerms', 'metadata' => 'setMetadata', 'property_with_object_id' => 'setPropertyWithObjectId', 'should_accept' => 'setShouldAccept', @@ -404,47 +404,47 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'property' => 'getProperty', 'filter_type' => 'getFilterType', 'operation' => 'getOperation', - 'list_id' => 'getListId', + 'property' => 'getProperty', + 'association_category' => 'getAssociationCategory', + 'association_type_id' => 'getAssociationTypeId', 'coalescing_refine_by' => 'getCoalescingRefineBy', + 'list_id' => 'getListId', + 'operator' => 'getOperator', 'to_object_type' => 'getToObjectType', - 'association_type_id' => 'getAssociationTypeId', - 'association_category' => 'getAssociationCategory', 'to_object_type_id' => 'getToObjectTypeId', - 'operator' => 'getOperator', 'enable_tracking' => 'getEnableTracking', - 'pruning_refine_by' => 'getPruningRefineBy', 'page_url' => 'getPageUrl', + 'pruning_refine_by' => 'getPruningRefineBy', 'cta_name' => 'getCtaName', 'event_id' => 'getEventId', 'form_id' => 'getFormId', 'page_id' => 'getPageId', 'event_type_id' => 'getEventTypeId', 'filter_lines' => 'getFilterLines', - 'subscription_type' => 'getSubscriptionType', - 'subscription_ids' => 'getSubscriptionIds', 'accepted_statuses' => 'getAcceptedStatuses', - 'channel' => 'getChannel', + 'subscription_ids' => 'getSubscriptionIds', + 'subscription_type' => 'getSubscriptionType', 'accepted_opt_states' => 'getAcceptedOptStates', 'business_unit_id' => 'getBusinessUnitId', + 'channel' => 'getChannel', 'campaign_id' => 'getCampaignId', 'survey_id' => 'getSurveyId', - 'value_comparison' => 'getValueComparison', - 'survey_question' => 'getSurveyQuestion', - 'survey_answer_row_id' => 'getSurveyAnswerRowId', 'survey_answer_col_id' => 'getSurveyAnswerColId', + 'survey_answer_row_id' => 'getSurveyAnswerRowId', + 'survey_question' => 'getSurveyQuestion', + 'value_comparison' => 'getValueComparison', 'webinar_id' => 'getWebinarId', - 'click_url' => 'getClickUrl', - 'level' => 'getLevel', 'app_id' => 'getAppId', + 'click_url' => 'getClickUrl', 'email_id' => 'getEmailId', + 'level' => 'getLevel', 'privacy_name' => 'getPrivacyName', - 'search_terms' => 'getSearchTerms', - 'entity_type' => 'getEntityType', 'ad_network' => 'getAdNetwork', + 'entity_type' => 'getEntityType', 'search_term_type' => 'getSearchTermType', + 'search_terms' => 'getSearchTerms', 'metadata' => 'getMetadata', 'property_with_object_id' => 'getPropertyWithObjectId', 'should_accept' => 'getShouldAccept', @@ -521,51 +521,54 @@ public function getFilterTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('property', $data ?? [], null); $this->setIfExists('filter_type', $data ?? [], 'CONSTANT'); $this->setIfExists('operation', $data ?? [], null); - $this->setIfExists('list_id', $data ?? [], null); + $this->setIfExists('property', $data ?? [], null); + $this->setIfExists('association_category', $data ?? [], null); + $this->setIfExists('association_type_id', $data ?? [], null); $this->setIfExists('coalescing_refine_by', $data ?? [], null); + $this->setIfExists('list_id', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); $this->setIfExists('to_object_type', $data ?? [], null); - $this->setIfExists('association_type_id', $data ?? [], null); - $this->setIfExists('association_category', $data ?? [], null); $this->setIfExists('to_object_type_id', $data ?? [], null); - $this->setIfExists('operator', $data ?? [], null); $this->setIfExists('enable_tracking', $data ?? [], null); - $this->setIfExists('pruning_refine_by', $data ?? [], null); $this->setIfExists('page_url', $data ?? [], null); + $this->setIfExists('pruning_refine_by', $data ?? [], null); $this->setIfExists('cta_name', $data ?? [], null); $this->setIfExists('event_id', $data ?? [], null); $this->setIfExists('form_id', $data ?? [], null); $this->setIfExists('page_id', $data ?? [], null); $this->setIfExists('event_type_id', $data ?? [], null); $this->setIfExists('filter_lines', $data ?? [], null); - $this->setIfExists('subscription_type', $data ?? [], null); - $this->setIfExists('subscription_ids', $data ?? [], null); $this->setIfExists('accepted_statuses', $data ?? [], null); - $this->setIfExists('channel', $data ?? [], null); + $this->setIfExists('subscription_ids', $data ?? [], null); + $this->setIfExists('subscription_type', $data ?? [], null); $this->setIfExists('accepted_opt_states', $data ?? [], null); $this->setIfExists('business_unit_id', $data ?? [], null); + $this->setIfExists('channel', $data ?? [], null); $this->setIfExists('campaign_id', $data ?? [], null); $this->setIfExists('survey_id', $data ?? [], null); - $this->setIfExists('value_comparison', $data ?? [], null); - $this->setIfExists('survey_question', $data ?? [], null); - $this->setIfExists('survey_answer_row_id', $data ?? [], null); $this->setIfExists('survey_answer_col_id', $data ?? [], null); + $this->setIfExists('survey_answer_row_id', $data ?? [], null); + $this->setIfExists('survey_question', $data ?? [], null); + $this->setIfExists('value_comparison', $data ?? [], null); $this->setIfExists('webinar_id', $data ?? [], null); - $this->setIfExists('click_url', $data ?? [], null); - $this->setIfExists('level', $data ?? [], null); $this->setIfExists('app_id', $data ?? [], null); + $this->setIfExists('click_url', $data ?? [], null); $this->setIfExists('email_id', $data ?? [], null); + $this->setIfExists('level', $data ?? [], null); $this->setIfExists('privacy_name', $data ?? [], null); - $this->setIfExists('search_terms', $data ?? [], null); - $this->setIfExists('entity_type', $data ?? [], null); $this->setIfExists('ad_network', $data ?? [], null); + $this->setIfExists('entity_type', $data ?? [], null); $this->setIfExists('search_term_type', $data ?? [], null); + $this->setIfExists('search_terms', $data ?? [], null); $this->setIfExists('metadata', $data ?? [], null); $this->setIfExists('property_with_object_id', $data ?? [], null); $this->setIfExists('should_accept', $data ?? [], null); $this->setIfExists('source', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['filter_type'] = static::$openAPIModelName; } /** @@ -595,9 +598,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['property'] === null) { - $invalidProperties[] = "'property' can't be null"; - } if ($this->container['filter_type'] === null) { $invalidProperties[] = "'filter_type' can't be null"; } @@ -613,27 +613,30 @@ public function listInvalidProperties() if ($this->container['operation'] === null) { $invalidProperties[] = "'operation' can't be null"; } - if ($this->container['list_id'] === null) { - $invalidProperties[] = "'list_id' can't be null"; + if ($this->container['property'] === null) { + $invalidProperties[] = "'property' can't be null"; } - if ($this->container['coalescing_refine_by'] === null) { - $invalidProperties[] = "'coalescing_refine_by' can't be null"; + if ($this->container['association_category'] === null) { + $invalidProperties[] = "'association_category' can't be null"; } if ($this->container['association_type_id'] === null) { $invalidProperties[] = "'association_type_id' can't be null"; } - if ($this->container['association_category'] === null) { - $invalidProperties[] = "'association_category' can't be null"; + if ($this->container['coalescing_refine_by'] === null) { + $invalidProperties[] = "'coalescing_refine_by' can't be null"; + } + if ($this->container['list_id'] === null) { + $invalidProperties[] = "'list_id' can't be null"; } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } - if ($this->container['pruning_refine_by'] === null) { - $invalidProperties[] = "'pruning_refine_by' can't be null"; - } if ($this->container['page_url'] === null) { $invalidProperties[] = "'page_url' can't be null"; } + if ($this->container['pruning_refine_by'] === null) { + $invalidProperties[] = "'pruning_refine_by' can't be null"; + } if ($this->container['cta_name'] === null) { $invalidProperties[] = "'cta_name' can't be null"; } @@ -649,35 +652,32 @@ public function listInvalidProperties() if ($this->container['filter_lines'] === null) { $invalidProperties[] = "'filter_lines' can't be null"; } - if ($this->container['subscription_type'] === null) { - $invalidProperties[] = "'subscription_type' can't be null"; + if ($this->container['accepted_statuses'] === null) { + $invalidProperties[] = "'accepted_statuses' can't be null"; } if ($this->container['subscription_ids'] === null) { $invalidProperties[] = "'subscription_ids' can't be null"; } - if ($this->container['accepted_statuses'] === null) { - $invalidProperties[] = "'accepted_statuses' can't be null"; - } - if ($this->container['channel'] === null) { - $invalidProperties[] = "'channel' can't be null"; + if ($this->container['subscription_type'] === null) { + $invalidProperties[] = "'subscription_type' can't be null"; } if ($this->container['accepted_opt_states'] === null) { $invalidProperties[] = "'accepted_opt_states' can't be null"; } + if ($this->container['channel'] === null) { + $invalidProperties[] = "'channel' can't be null"; + } if ($this->container['campaign_id'] === null) { $invalidProperties[] = "'campaign_id' can't be null"; } if ($this->container['survey_id'] === null) { $invalidProperties[] = "'survey_id' can't be null"; } - if ($this->container['value_comparison'] === null) { - $invalidProperties[] = "'value_comparison' can't be null"; - } if ($this->container['survey_question'] === null) { $invalidProperties[] = "'survey_question' can't be null"; } - if ($this->container['level'] === null) { - $invalidProperties[] = "'level' can't be null"; + if ($this->container['value_comparison'] === null) { + $invalidProperties[] = "'value_comparison' can't be null"; } if ($this->container['app_id'] === null) { $invalidProperties[] = "'app_id' can't be null"; @@ -685,21 +685,24 @@ public function listInvalidProperties() if ($this->container['email_id'] === null) { $invalidProperties[] = "'email_id' can't be null"; } + if ($this->container['level'] === null) { + $invalidProperties[] = "'level' can't be null"; + } if ($this->container['privacy_name'] === null) { $invalidProperties[] = "'privacy_name' can't be null"; } - if ($this->container['search_terms'] === null) { - $invalidProperties[] = "'search_terms' can't be null"; + if ($this->container['ad_network'] === null) { + $invalidProperties[] = "'ad_network' can't be null"; } if ($this->container['entity_type'] === null) { $invalidProperties[] = "'entity_type' can't be null"; } - if ($this->container['ad_network'] === null) { - $invalidProperties[] = "'ad_network' can't be null"; - } if ($this->container['search_term_type'] === null) { $invalidProperties[] = "'search_term_type' can't be null"; } + if ($this->container['search_terms'] === null) { + $invalidProperties[] = "'search_terms' can't be null"; + } if ($this->container['property_with_object_id'] === null) { $invalidProperties[] = "'property_with_object_id' can't be null"; } @@ -721,33 +724,6 @@ public function valid() } - /** - * Gets property - * - * @return string - */ - public function getProperty() - { - return $this->container['property']; - } - - /** - * Sets property - * - * @param string $property property - * - * @return self - */ - public function setProperty($property) - { - if (is_null($property)) { - throw new \InvalidArgumentException('non-nullable property cannot be null'); - } - $this->container['property'] = $property; - - return $this; - } - /** * Gets filter_type * @@ -761,7 +737,7 @@ public function getFilterType() /** * Sets filter_type * - * @param string $filter_type filter_type + * @param string $filter_type Specifies the type of filter, which is (CONSTANT). * * @return self */ @@ -788,7 +764,7 @@ public function setFilterType($filter_type) /** * Gets operation * - * @return \HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison + * @return \HubSpot\Client\Crm\Lists\Model\PublicPropertyFilterOperation */ public function getOperation() { @@ -798,7 +774,7 @@ public function getOperation() /** * Sets operation * - * @param \HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison $operation operation + * @param \HubSpot\Client\Crm\Lists\Model\PublicPropertyFilterOperation $operation operation * * @return self */ @@ -813,190 +789,217 @@ public function setOperation($operation) } /** - * Gets list_id + * Gets property * * @return string */ - public function getListId() + public function getProperty() { - return $this->container['list_id']; + return $this->container['property']; } /** - * Sets list_id + * Sets property * - * @param string $list_id list_id + * @param string $property Specifies the name of the property that the filter is applied to. * * @return self */ - public function setListId($list_id) + public function setProperty($property) { - if (is_null($list_id)) { - throw new \InvalidArgumentException('non-nullable list_id cannot be null'); + if (is_null($property)) { + throw new \InvalidArgumentException('non-nullable property cannot be null'); } - $this->container['list_id'] = $list_id; + $this->container['property'] = $property; return $this; } /** - * Gets coalescing_refine_by + * Gets association_category * - * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy + * @return string */ - public function getCoalescingRefineBy() + public function getAssociationCategory() { - return $this->container['coalescing_refine_by']; + return $this->container['association_category']; } /** - * Sets coalescing_refine_by + * Sets association_category * - * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy $coalescing_refine_by coalescing_refine_by + * @param string $association_category Defines the category of the association (HUBSPOT_DEFINED, USER_DEFINED, INTEGRATOR_DEFINED, WORK). * * @return self */ - public function setCoalescingRefineBy($coalescing_refine_by) + public function setAssociationCategory($association_category) { - if (is_null($coalescing_refine_by)) { - throw new \InvalidArgumentException('non-nullable coalescing_refine_by cannot be null'); + if (is_null($association_category)) { + throw new \InvalidArgumentException('non-nullable association_category cannot be null'); } - $this->container['coalescing_refine_by'] = $coalescing_refine_by; + $this->container['association_category'] = $association_category; return $this; } /** - * Gets to_object_type + * Gets association_type_id * - * @return string|null + * @return int */ - public function getToObjectType() + public function getAssociationTypeId() { - return $this->container['to_object_type']; + return $this->container['association_type_id']; } /** - * Sets to_object_type + * Sets association_type_id * - * @param string|null $to_object_type to_object_type + * @param int $association_type_id The ID representing the type of association being filtered. * * @return self */ - public function setToObjectType($to_object_type) + public function setAssociationTypeId($association_type_id) { - if (is_null($to_object_type)) { - throw new \InvalidArgumentException('non-nullable to_object_type cannot be null'); + if (is_null($association_type_id)) { + throw new \InvalidArgumentException('non-nullable association_type_id cannot be null'); } - $this->container['to_object_type'] = $to_object_type; + $this->container['association_type_id'] = $association_type_id; return $this; } /** - * Gets association_type_id + * Gets coalescing_refine_by * - * @return int + * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy */ - public function getAssociationTypeId() + public function getCoalescingRefineBy() { - return $this->container['association_type_id']; + return $this->container['coalescing_refine_by']; } /** - * Sets association_type_id + * Sets coalescing_refine_by * - * @param int $association_type_id association_type_id + * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy $coalescing_refine_by coalescing_refine_by * * @return self */ - public function setAssociationTypeId($association_type_id) + public function setCoalescingRefineBy($coalescing_refine_by) { - if (is_null($association_type_id)) { - throw new \InvalidArgumentException('non-nullable association_type_id cannot be null'); + if (is_null($coalescing_refine_by)) { + throw new \InvalidArgumentException('non-nullable coalescing_refine_by cannot be null'); } - $this->container['association_type_id'] = $association_type_id; + $this->container['coalescing_refine_by'] = $coalescing_refine_by; return $this; } /** - * Gets association_category + * Gets list_id * * @return string */ - public function getAssociationCategory() + public function getListId() { - return $this->container['association_category']; + return $this->container['list_id']; } /** - * Sets association_category + * Sets list_id * - * @param string $association_category association_category + * @param string $list_id The ID of the list used in the property association filter. * * @return self */ - public function setAssociationCategory($association_category) + public function setListId($list_id) { - if (is_null($association_category)) { - throw new \InvalidArgumentException('non-nullable association_category cannot be null'); + if (is_null($list_id)) { + throw new \InvalidArgumentException('non-nullable list_id cannot be null'); } - $this->container['association_category'] = $association_category; + $this->container['list_id'] = $list_id; return $this; } /** - * Gets to_object_type_id + * Gets operator + * + * @return string + */ + public function getOperator() + { + return $this->container['operator']; + } + + /** + * Sets operator + * + * @param string $operator Defines the operation to be applied by the filter (IN_LIST, NOT_IN_LIST). + * + * @return self + */ + public function setOperator($operator) + { + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); + } + $this->container['operator'] = $operator; + + return $this; + } + + /** + * Gets to_object_type * * @return string|null */ - public function getToObjectTypeId() + public function getToObjectType() { - return $this->container['to_object_type_id']; + return $this->container['to_object_type']; } /** - * Sets to_object_type_id + * Sets to_object_type * - * @param string|null $to_object_type_id to_object_type_id + * @param string|null $to_object_type The type of object that the association filter is targeting. * * @return self */ - public function setToObjectTypeId($to_object_type_id) + public function setToObjectType($to_object_type) { - if (is_null($to_object_type_id)) { - throw new \InvalidArgumentException('non-nullable to_object_type_id cannot be null'); + if (is_null($to_object_type)) { + throw new \InvalidArgumentException('non-nullable to_object_type cannot be null'); } - $this->container['to_object_type_id'] = $to_object_type_id; + $this->container['to_object_type'] = $to_object_type; return $this; } /** - * Gets operator + * Gets to_object_type_id * - * @return string + * @return string|null */ - public function getOperator() + public function getToObjectTypeId() { - return $this->container['operator']; + return $this->container['to_object_type_id']; } /** - * Sets operator + * Sets to_object_type_id * - * @param string $operator operator + * @param string|null $to_object_type_id The ID representing the type of object that the property association filter is targeting. * * @return self */ - public function setOperator($operator) + public function setToObjectTypeId($to_object_type_id) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); + if (is_null($to_object_type_id)) { + throw new \InvalidArgumentException('non-nullable to_object_type_id cannot be null'); } - $this->container['operator'] = $operator; + $this->container['to_object_type_id'] = $to_object_type_id; return $this; } @@ -1014,7 +1017,7 @@ public function getEnableTracking() /** * Sets enable_tracking * - * @param bool|null $enable_tracking enable_tracking + * @param bool|null $enable_tracking Indicates whether tracking is enabled for the page view. * * @return self */ @@ -1029,55 +1032,55 @@ public function setEnableTracking($enable_tracking) } /** - * Gets pruning_refine_by + * Gets page_url * - * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy + * @return string */ - public function getPruningRefineBy() + public function getPageUrl() { - return $this->container['pruning_refine_by']; + return $this->container['page_url']; } /** - * Sets pruning_refine_by + * Sets page_url * - * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy $pruning_refine_by pruning_refine_by + * @param string $page_url The URL of the page to be used in the filter. * * @return self */ - public function setPruningRefineBy($pruning_refine_by) + public function setPageUrl($page_url) { - if (is_null($pruning_refine_by)) { - throw new \InvalidArgumentException('non-nullable pruning_refine_by cannot be null'); + if (is_null($page_url)) { + throw new \InvalidArgumentException('non-nullable page_url cannot be null'); } - $this->container['pruning_refine_by'] = $pruning_refine_by; + $this->container['page_url'] = $page_url; return $this; } /** - * Gets page_url + * Gets pruning_refine_by * - * @return string + * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy */ - public function getPageUrl() + public function getPruningRefineBy() { - return $this->container['page_url']; + return $this->container['pruning_refine_by']; } /** - * Sets page_url + * Sets pruning_refine_by * - * @param string $page_url page_url + * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy $pruning_refine_by pruning_refine_by * * @return self */ - public function setPageUrl($page_url) + public function setPruningRefineBy($pruning_refine_by) { - if (is_null($page_url)) { - throw new \InvalidArgumentException('non-nullable page_url cannot be null'); + if (is_null($pruning_refine_by)) { + throw new \InvalidArgumentException('non-nullable pruning_refine_by cannot be null'); } - $this->container['page_url'] = $page_url; + $this->container['pruning_refine_by'] = $pruning_refine_by; return $this; } @@ -1095,7 +1098,7 @@ public function getCtaName() /** * Sets cta_name * - * @param string $cta_name cta_name + * @param string $cta_name The name of the Call-to-Action (CTA) to be used in the filter. * * @return self */ @@ -1122,7 +1125,7 @@ public function getEventId() /** * Sets event_id * - * @param string $event_id event_id + * @param string $event_id The ID of the event to be used in the filter. * * @return self */ @@ -1149,7 +1152,7 @@ public function getFormId() /** * Sets form_id * - * @param string|null $form_id form_id + * @param string|null $form_id The ID of the form associated with the submission filter. * * @return self */ @@ -1176,7 +1179,7 @@ public function getPageId() /** * Sets page_id * - * @param string $page_id page_id + * @param string $page_id The ID of the page where the form submission occurred. * * @return self */ @@ -1203,7 +1206,7 @@ public function getEventTypeId() /** * Sets event_type_id * - * @param string $event_type_id event_type_id + * @param string $event_type_id The identifier for the type of event in the unified events filter. * * @return self */ @@ -1245,28 +1248,28 @@ public function setFilterLines($filter_lines) } /** - * Gets subscription_type + * Gets accepted_statuses * - * @return string + * @return string[] */ - public function getSubscriptionType() + public function getAcceptedStatuses() { - return $this->container['subscription_type']; + return $this->container['accepted_statuses']; } /** - * Sets subscription_type + * Sets accepted_statuses * - * @param string $subscription_type subscription_type + * @param string[] $accepted_statuses accepted_statuses * * @return self */ - public function setSubscriptionType($subscription_type) + public function setAcceptedStatuses($accepted_statuses) { - if (is_null($subscription_type)) { - throw new \InvalidArgumentException('non-nullable subscription_type cannot be null'); + if (is_null($accepted_statuses)) { + throw new \InvalidArgumentException('non-nullable accepted_statuses cannot be null'); } - $this->container['subscription_type'] = $subscription_type; + $this->container['accepted_statuses'] = $accepted_statuses; return $this; } @@ -1299,55 +1302,28 @@ public function setSubscriptionIds($subscription_ids) } /** - * Gets accepted_statuses - * - * @return string[] - */ - public function getAcceptedStatuses() - { - return $this->container['accepted_statuses']; - } - - /** - * Sets accepted_statuses - * - * @param string[] $accepted_statuses accepted_statuses - * - * @return self - */ - public function setAcceptedStatuses($accepted_statuses) - { - if (is_null($accepted_statuses)) { - throw new \InvalidArgumentException('non-nullable accepted_statuses cannot be null'); - } - $this->container['accepted_statuses'] = $accepted_statuses; - - return $this; - } - - /** - * Gets channel + * Gets subscription_type * * @return string */ - public function getChannel() + public function getSubscriptionType() { - return $this->container['channel']; + return $this->container['subscription_type']; } /** - * Sets channel + * Sets subscription_type * - * @param string $channel channel + * @param string $subscription_type Defines the type of subscription related to the filter (PORTAL_WIDE, BUSINESS_UNIT_WIDE, INDIVIDUAL_SUBSCRIPTION) * * @return self */ - public function setChannel($channel) + public function setSubscriptionType($subscription_type) { - if (is_null($channel)) { - throw new \InvalidArgumentException('non-nullable channel cannot be null'); + if (is_null($subscription_type)) { + throw new \InvalidArgumentException('non-nullable subscription_type cannot be null'); } - $this->container['channel'] = $channel; + $this->container['subscription_type'] = $subscription_type; return $this; } @@ -1392,7 +1368,7 @@ public function getBusinessUnitId() /** * Sets business_unit_id * - * @param string|null $business_unit_id business_unit_id + * @param string|null $business_unit_id The ID of the business unit associated with the subscription filter. * * @return self */ @@ -1406,6 +1382,33 @@ public function setBusinessUnitId($business_unit_id) return $this; } + /** + * Gets channel + * + * @return string + */ + public function getChannel() + { + return $this->container['channel']; + } + + /** + * Sets channel + * + * @param string $channel Specifies the communication channel associated with the subscription filter (EMAIL, WHATSAPP, SMS). + * + * @return self + */ + public function setChannel($channel) + { + if (is_null($channel)) { + throw new \InvalidArgumentException('non-nullable channel cannot be null'); + } + $this->container['channel'] = $channel; + + return $this; + } + /** * Gets campaign_id * @@ -1419,7 +1422,7 @@ public function getCampaignId() /** * Sets campaign_id * - * @param string $campaign_id campaign_id + * @param string $campaign_id The ID of the campaign that influences the filter. * * @return self */ @@ -1446,7 +1449,7 @@ public function getSurveyId() /** * Sets survey_id * - * @param string $survey_id survey_id + * @param string $survey_id The ID of the survey used in the filter. * * @return self */ @@ -1461,109 +1464,109 @@ public function setSurveyId($survey_id) } /** - * Gets value_comparison + * Gets survey_answer_col_id * - * @return \HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison + * @return string|null */ - public function getValueComparison() + public function getSurveyAnswerColId() { - return $this->container['value_comparison']; + return $this->container['survey_answer_col_id']; } /** - * Sets value_comparison + * Sets survey_answer_col_id * - * @param \HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison $value_comparison value_comparison + * @param string|null $survey_answer_col_id The column ID of the survey answer used in the filter. * * @return self */ - public function setValueComparison($value_comparison) + public function setSurveyAnswerColId($survey_answer_col_id) { - if (is_null($value_comparison)) { - throw new \InvalidArgumentException('non-nullable value_comparison cannot be null'); + if (is_null($survey_answer_col_id)) { + throw new \InvalidArgumentException('non-nullable survey_answer_col_id cannot be null'); } - $this->container['value_comparison'] = $value_comparison; + $this->container['survey_answer_col_id'] = $survey_answer_col_id; return $this; } /** - * Gets survey_question + * Gets survey_answer_row_id * - * @return string + * @return string|null */ - public function getSurveyQuestion() + public function getSurveyAnswerRowId() { - return $this->container['survey_question']; + return $this->container['survey_answer_row_id']; } /** - * Sets survey_question + * Sets survey_answer_row_id * - * @param string $survey_question survey_question + * @param string|null $survey_answer_row_id The row ID of the survey answer used in the filter. * * @return self */ - public function setSurveyQuestion($survey_question) + public function setSurveyAnswerRowId($survey_answer_row_id) { - if (is_null($survey_question)) { - throw new \InvalidArgumentException('non-nullable survey_question cannot be null'); + if (is_null($survey_answer_row_id)) { + throw new \InvalidArgumentException('non-nullable survey_answer_row_id cannot be null'); } - $this->container['survey_question'] = $survey_question; + $this->container['survey_answer_row_id'] = $survey_answer_row_id; return $this; } /** - * Gets survey_answer_row_id + * Gets survey_question * - * @return string|null + * @return string */ - public function getSurveyAnswerRowId() + public function getSurveyQuestion() { - return $this->container['survey_answer_row_id']; + return $this->container['survey_question']; } /** - * Sets survey_answer_row_id + * Sets survey_question * - * @param string|null $survey_answer_row_id survey_answer_row_id + * @param string $survey_question The question from the survey used in the filter. * * @return self */ - public function setSurveyAnswerRowId($survey_answer_row_id) + public function setSurveyQuestion($survey_question) { - if (is_null($survey_answer_row_id)) { - throw new \InvalidArgumentException('non-nullable survey_answer_row_id cannot be null'); + if (is_null($survey_question)) { + throw new \InvalidArgumentException('non-nullable survey_question cannot be null'); } - $this->container['survey_answer_row_id'] = $survey_answer_row_id; + $this->container['survey_question'] = $survey_question; return $this; } /** - * Gets survey_answer_col_id + * Gets value_comparison * - * @return string|null + * @return \HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison */ - public function getSurveyAnswerColId() + public function getValueComparison() { - return $this->container['survey_answer_col_id']; + return $this->container['value_comparison']; } /** - * Sets survey_answer_col_id + * Sets value_comparison * - * @param string|null $survey_answer_col_id survey_answer_col_id + * @param \HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison $value_comparison value_comparison * * @return self */ - public function setSurveyAnswerColId($survey_answer_col_id) + public function setValueComparison($value_comparison) { - if (is_null($survey_answer_col_id)) { - throw new \InvalidArgumentException('non-nullable survey_answer_col_id cannot be null'); + if (is_null($value_comparison)) { + throw new \InvalidArgumentException('non-nullable value_comparison cannot be null'); } - $this->container['survey_answer_col_id'] = $survey_answer_col_id; + $this->container['value_comparison'] = $value_comparison; return $this; } @@ -1581,7 +1584,7 @@ public function getWebinarId() /** * Sets webinar_id * - * @param string|null $webinar_id webinar_id + * @param string|null $webinar_id The ID of the webinar associated with the filter. * * @return self */ @@ -1596,109 +1599,109 @@ public function setWebinarId($webinar_id) } /** - * Gets click_url + * Gets app_id * - * @return string|null + * @return string */ - public function getClickUrl() + public function getAppId() { - return $this->container['click_url']; + return $this->container['app_id']; } /** - * Sets click_url + * Sets app_id * - * @param string|null $click_url click_url + * @param string $app_id The ID of the application associated with the email event filter. * * @return self */ - public function setClickUrl($click_url) + public function setAppId($app_id) { - if (is_null($click_url)) { - throw new \InvalidArgumentException('non-nullable click_url cannot be null'); + if (is_null($app_id)) { + throw new \InvalidArgumentException('non-nullable app_id cannot be null'); } - $this->container['click_url'] = $click_url; + $this->container['app_id'] = $app_id; return $this; } /** - * Gets level + * Gets click_url * - * @return string + * @return string|null */ - public function getLevel() + public function getClickUrl() { - return $this->container['level']; + return $this->container['click_url']; } /** - * Sets level + * Sets click_url * - * @param string $level level + * @param string|null $click_url The URL that was clicked in the email event. * * @return self */ - public function setLevel($level) + public function setClickUrl($click_url) { - if (is_null($level)) { - throw new \InvalidArgumentException('non-nullable level cannot be null'); + if (is_null($click_url)) { + throw new \InvalidArgumentException('non-nullable click_url cannot be null'); } - $this->container['level'] = $level; + $this->container['click_url'] = $click_url; return $this; } /** - * Gets app_id + * Gets email_id * * @return string */ - public function getAppId() + public function getEmailId() { - return $this->container['app_id']; + return $this->container['email_id']; } /** - * Sets app_id + * Sets email_id * - * @param string $app_id app_id + * @param string $email_id The ID of the email associated with the event filter. * * @return self */ - public function setAppId($app_id) + public function setEmailId($email_id) { - if (is_null($app_id)) { - throw new \InvalidArgumentException('non-nullable app_id cannot be null'); + if (is_null($email_id)) { + throw new \InvalidArgumentException('non-nullable email_id cannot be null'); } - $this->container['app_id'] = $app_id; + $this->container['email_id'] = $email_id; return $this; } /** - * Gets email_id + * Gets level * * @return string */ - public function getEmailId() + public function getLevel() { - return $this->container['email_id']; + return $this->container['level']; } /** - * Sets email_id + * Sets level * - * @param string $email_id email_id + * @param string $level Specifies the level of the email event, such as EMAIL_API_CAMPAIGN_GROUP. * * @return self */ - public function setEmailId($email_id) + public function setLevel($level) { - if (is_null($email_id)) { - throw new \InvalidArgumentException('non-nullable email_id cannot be null'); + if (is_null($level)) { + throw new \InvalidArgumentException('non-nullable level cannot be null'); } - $this->container['email_id'] = $email_id; + $this->container['level'] = $level; return $this; } @@ -1716,7 +1719,7 @@ public function getPrivacyName() /** * Sets privacy_name * - * @param string $privacy_name privacy_name + * @param string $privacy_name The name of the privacy setting used in the filter. * * @return self */ @@ -1731,28 +1734,28 @@ public function setPrivacyName($privacy_name) } /** - * Gets search_terms + * Gets ad_network * - * @return string[] + * @return string */ - public function getSearchTerms() + public function getAdNetwork() { - return $this->container['search_terms']; + return $this->container['ad_network']; } /** - * Sets search_terms + * Sets ad_network * - * @param string[] $search_terms search_terms + * @param string $ad_network Ad network (ADWORDS, FACEBOOK, LINKEDIN, ALL) * * @return self */ - public function setSearchTerms($search_terms) + public function setAdNetwork($ad_network) { - if (is_null($search_terms)) { - throw new \InvalidArgumentException('non-nullable search_terms cannot be null'); + if (is_null($ad_network)) { + throw new \InvalidArgumentException('non-nullable ad_network cannot be null'); } - $this->container['search_terms'] = $search_terms; + $this->container['ad_network'] = $ad_network; return $this; } @@ -1770,7 +1773,7 @@ public function getEntityType() /** * Sets entity_type * - * @param string $entity_type entity_type + * @param string $entity_type Type of ad entity (KEYWORD, ADGROUP, AD, CAMPAIGN) * * @return self */ @@ -1785,55 +1788,55 @@ public function setEntityType($entity_type) } /** - * Gets ad_network + * Gets search_term_type * * @return string */ - public function getAdNetwork() + public function getSearchTermType() { - return $this->container['ad_network']; + return $this->container['search_term_type']; } /** - * Sets ad_network + * Sets search_term_type * - * @param string $ad_network ad_network + * @param string $search_term_type Search term to match an ad * * @return self */ - public function setAdNetwork($ad_network) + public function setSearchTermType($search_term_type) { - if (is_null($ad_network)) { - throw new \InvalidArgumentException('non-nullable ad_network cannot be null'); + if (is_null($search_term_type)) { + throw new \InvalidArgumentException('non-nullable search_term_type cannot be null'); } - $this->container['ad_network'] = $ad_network; + $this->container['search_term_type'] = $search_term_type; return $this; } /** - * Gets search_term_type + * Gets search_terms * - * @return string + * @return string[] */ - public function getSearchTermType() + public function getSearchTerms() { - return $this->container['search_term_type']; + return $this->container['search_terms']; } /** - * Sets search_term_type + * Sets search_terms * - * @param string $search_term_type search_term_type + * @param string[] $search_terms search_terms * * @return self */ - public function setSearchTermType($search_term_type) + public function setSearchTerms($search_terms) { - if (is_null($search_term_type)) { - throw new \InvalidArgumentException('non-nullable search_term_type cannot be null'); + if (is_null($search_terms)) { + throw new \InvalidArgumentException('non-nullable search_terms cannot be null'); } - $this->container['search_term_type'] = $search_term_type; + $this->container['search_terms'] = $search_terms; return $this; } @@ -1878,7 +1881,7 @@ public function getPropertyWithObjectId() /** * Sets property_with_object_id * - * @param string $property_with_object_id property_with_object_id + * @param string $property_with_object_id The property associated with the object ID in the filter. * * @return self */ @@ -1905,7 +1908,7 @@ public function getShouldAccept() /** * Sets should_accept * - * @param bool $should_accept should_accept + * @param bool $should_accept Indicates whether the filter should accept the condition. * * @return self */ @@ -1932,7 +1935,7 @@ public function getSource() /** * Sets source * - * @param string|null $source source + * @param string|null $source Defines the source of the constant filter. * * @return self */ @@ -1948,11 +1951,11 @@ public function setSource($source) /** * 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]); } @@ -1960,12 +1963,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; } @@ -1990,11 +1993,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/Lists/Model/PublicPropertyAssociationInListFilter.php b/codegen/Crm/Lists/Model/PublicPropertyAssociationInListFilter.php index 3a90e73dd..f0ce3a008 100644 --- a/codegen/Crm/Lists/Model/PublicPropertyAssociationInListFilter.php +++ b/codegen/Crm/Lists/Model/PublicPropertyAssociationInListFilter.php @@ -2,7 +2,7 @@ /** * PublicPropertyAssociationInListFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,12 +57,12 @@ class PublicPropertyAssociationInListFilter implements ModelInterface, ArrayAcce * @var string[] */ protected static $openAPITypes = [ - 'list_id' => 'string', 'coalescing_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', - 'property_with_object_id' => 'string', 'filter_type' => 'string', - 'to_object_type_id' => 'string', - 'operator' => 'string' + 'list_id' => 'string', + 'operator' => 'string', + 'property_with_object_id' => 'string', + 'to_object_type_id' => 'string' ]; /** @@ -73,12 +73,12 @@ class PublicPropertyAssociationInListFilter implements ModelInterface, ArrayAcce * @psalm-var array */ protected static $openAPIFormats = [ - 'list_id' => null, 'coalescing_refine_by' => null, - 'property_with_object_id' => null, 'filter_type' => null, - 'to_object_type_id' => null, - 'operator' => null + 'list_id' => null, + 'operator' => null, + 'property_with_object_id' => null, + 'to_object_type_id' => null ]; /** @@ -87,12 +87,12 @@ class PublicPropertyAssociationInListFilter implements ModelInterface, ArrayAcce * @var boolean[] */ protected static array $openAPINullables = [ - 'list_id' => false, 'coalescing_refine_by' => false, - 'property_with_object_id' => false, 'filter_type' => false, - 'to_object_type_id' => false, - 'operator' => false + 'list_id' => false, + 'operator' => false, + 'property_with_object_id' => false, + 'to_object_type_id' => false ]; /** @@ -181,12 +181,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'list_id' => 'listId', 'coalescing_refine_by' => 'coalescingRefineBy', - 'property_with_object_id' => 'propertyWithObjectId', 'filter_type' => 'filterType', - 'to_object_type_id' => 'toObjectTypeId', - 'operator' => 'operator' + 'list_id' => 'listId', + 'operator' => 'operator', + 'property_with_object_id' => 'propertyWithObjectId', + 'to_object_type_id' => 'toObjectTypeId' ]; /** @@ -195,12 +195,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'list_id' => 'setListId', 'coalescing_refine_by' => 'setCoalescingRefineBy', - 'property_with_object_id' => 'setPropertyWithObjectId', 'filter_type' => 'setFilterType', - 'to_object_type_id' => 'setToObjectTypeId', - 'operator' => 'setOperator' + 'list_id' => 'setListId', + 'operator' => 'setOperator', + 'property_with_object_id' => 'setPropertyWithObjectId', + 'to_object_type_id' => 'setToObjectTypeId' ]; /** @@ -209,12 +209,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'list_id' => 'getListId', 'coalescing_refine_by' => 'getCoalescingRefineBy', - 'property_with_object_id' => 'getPropertyWithObjectId', 'filter_type' => 'getFilterType', - 'to_object_type_id' => 'getToObjectTypeId', - 'operator' => 'getOperator' + 'list_id' => 'getListId', + 'operator' => 'getOperator', + 'property_with_object_id' => 'getPropertyWithObjectId', + 'to_object_type_id' => 'getToObjectTypeId' ]; /** @@ -287,12 +287,12 @@ public function getFilterTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('list_id', $data ?? [], null); $this->setIfExists('coalescing_refine_by', $data ?? [], null); - $this->setIfExists('property_with_object_id', $data ?? [], null); $this->setIfExists('filter_type', $data ?? [], 'PROPERTY_ASSOCIATION'); - $this->setIfExists('to_object_type_id', $data ?? [], null); + $this->setIfExists('list_id', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('property_with_object_id', $data ?? [], null); + $this->setIfExists('to_object_type_id', $data ?? [], null); } /** @@ -322,15 +322,9 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['list_id'] === null) { - $invalidProperties[] = "'list_id' can't be null"; - } if ($this->container['coalescing_refine_by'] === null) { $invalidProperties[] = "'coalescing_refine_by' can't be null"; } - if ($this->container['property_with_object_id'] === null) { - $invalidProperties[] = "'property_with_object_id' can't be null"; - } if ($this->container['filter_type'] === null) { $invalidProperties[] = "'filter_type' can't be null"; } @@ -343,9 +337,15 @@ public function listInvalidProperties() ); } + if ($this->container['list_id'] === null) { + $invalidProperties[] = "'list_id' can't be null"; + } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } + if ($this->container['property_with_object_id'] === null) { + $invalidProperties[] = "'property_with_object_id' can't be null"; + } return $invalidProperties; } @@ -361,33 +361,6 @@ public function valid() } - /** - * Gets list_id - * - * @return string - */ - public function getListId() - { - return $this->container['list_id']; - } - - /** - * Sets list_id - * - * @param string $list_id list_id - * - * @return self - */ - public function setListId($list_id) - { - if (is_null($list_id)) { - throw new \InvalidArgumentException('non-nullable list_id cannot be null'); - } - $this->container['list_id'] = $list_id; - - return $this; - } - /** * Gets coalescing_refine_by * @@ -415,33 +388,6 @@ public function setCoalescingRefineBy($coalescing_refine_by) return $this; } - /** - * Gets property_with_object_id - * - * @return string - */ - public function getPropertyWithObjectId() - { - return $this->container['property_with_object_id']; - } - - /** - * Sets property_with_object_id - * - * @param string $property_with_object_id property_with_object_id - * - * @return self - */ - public function setPropertyWithObjectId($property_with_object_id) - { - if (is_null($property_with_object_id)) { - throw new \InvalidArgumentException('non-nullable property_with_object_id cannot be null'); - } - $this->container['property_with_object_id'] = $property_with_object_id; - - return $this; - } - /** * Gets filter_type * @@ -455,7 +401,7 @@ public function getFilterType() /** * Sets filter_type * - * @param string $filter_type filter_type + * @param string $filter_type Indicates the type of filter being applied (PROPERTY_ASSOCIATION). * * @return self */ @@ -480,28 +426,28 @@ public function setFilterType($filter_type) } /** - * Gets to_object_type_id + * Gets list_id * - * @return string|null + * @return string */ - public function getToObjectTypeId() + public function getListId() { - return $this->container['to_object_type_id']; + return $this->container['list_id']; } /** - * Sets to_object_type_id + * Sets list_id * - * @param string|null $to_object_type_id to_object_type_id + * @param string $list_id The ID of the list used in the property association filter. * * @return self */ - public function setToObjectTypeId($to_object_type_id) + public function setListId($list_id) { - if (is_null($to_object_type_id)) { - throw new \InvalidArgumentException('non-nullable to_object_type_id cannot be null'); + if (is_null($list_id)) { + throw new \InvalidArgumentException('non-nullable list_id cannot be null'); } - $this->container['to_object_type_id'] = $to_object_type_id; + $this->container['list_id'] = $list_id; return $this; } @@ -519,7 +465,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Defines the operation to be applied by the filter (IN_LIST, NOT_IN_LIST). * * @return self */ @@ -532,14 +478,68 @@ public function setOperator($operator) return $this; } + + /** + * Gets property_with_object_id + * + * @return string + */ + public function getPropertyWithObjectId() + { + return $this->container['property_with_object_id']; + } + + /** + * Sets property_with_object_id + * + * @param string $property_with_object_id The property associated with the object ID in the filter. + * + * @return self + */ + public function setPropertyWithObjectId($property_with_object_id) + { + if (is_null($property_with_object_id)) { + throw new \InvalidArgumentException('non-nullable property_with_object_id cannot be null'); + } + $this->container['property_with_object_id'] = $property_with_object_id; + + return $this; + } + + /** + * Gets to_object_type_id + * + * @return string|null + */ + public function getToObjectTypeId() + { + return $this->container['to_object_type_id']; + } + + /** + * Sets to_object_type_id + * + * @param string|null $to_object_type_id The ID representing the type of object that the property association filter is targeting. + * + * @return self + */ + public function setToObjectTypeId($to_object_type_id) + { + if (is_null($to_object_type_id)) { + throw new \InvalidArgumentException('non-nullable to_object_type_id cannot be null'); + } + $this->container['to_object_type_id'] = $to_object_type_id; + + 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]); } @@ -547,12 +547,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; } @@ -577,11 +577,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/Lists/Model/PublicPropertyFilter.php b/codegen/Crm/Lists/Model/PublicPropertyFilter.php index b6b8c981a..7f5f1c8c3 100644 --- a/codegen/Crm/Lists/Model/PublicPropertyFilter.php +++ b/codegen/Crm/Lists/Model/PublicPropertyFilter.php @@ -2,7 +2,7 @@ /** * PublicPropertyFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,9 +57,9 @@ class PublicPropertyFilter implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ - 'property' => 'string', 'filter_type' => 'string', - 'operation' => '\HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison' + 'operation' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyFilterOperation', + 'property' => 'string' ]; /** @@ -70,9 +70,9 @@ class PublicPropertyFilter implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ - 'property' => null, 'filter_type' => null, - 'operation' => null + 'operation' => null, + 'property' => null ]; /** @@ -81,9 +81,9 @@ class PublicPropertyFilter implements ModelInterface, ArrayAccess, \JsonSerializ * @var boolean[] */ protected static array $openAPINullables = [ - 'property' => false, 'filter_type' => false, - 'operation' => false + 'operation' => false, + 'property' => false ]; /** @@ -172,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'property' => 'property', 'filter_type' => 'filterType', - 'operation' => 'operation' + 'operation' => 'operation', + 'property' => 'property' ]; /** @@ -183,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'property' => 'setProperty', 'filter_type' => 'setFilterType', - 'operation' => 'setOperation' + 'operation' => 'setOperation', + 'property' => 'setProperty' ]; /** @@ -194,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'property' => 'getProperty', 'filter_type' => 'getFilterType', - 'operation' => 'getOperation' + 'operation' => 'getOperation', + 'property' => 'getProperty' ]; /** @@ -269,9 +269,9 @@ public function getFilterTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('property', $data ?? [], null); $this->setIfExists('filter_type', $data ?? [], 'PROPERTY'); $this->setIfExists('operation', $data ?? [], null); + $this->setIfExists('property', $data ?? [], null); } /** @@ -301,9 +301,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['property'] === null) { - $invalidProperties[] = "'property' can't be null"; - } if ($this->container['filter_type'] === null) { $invalidProperties[] = "'filter_type' can't be null"; } @@ -319,6 +316,9 @@ public function listInvalidProperties() if ($this->container['operation'] === null) { $invalidProperties[] = "'operation' can't be null"; } + if ($this->container['property'] === null) { + $invalidProperties[] = "'property' can't be null"; + } return $invalidProperties; } @@ -334,33 +334,6 @@ public function valid() } - /** - * Gets property - * - * @return string - */ - public function getProperty() - { - return $this->container['property']; - } - - /** - * Sets property - * - * @param string $property property - * - * @return self - */ - public function setProperty($property) - { - if (is_null($property)) { - throw new \InvalidArgumentException('non-nullable property cannot be null'); - } - $this->container['property'] = $property; - - return $this; - } - /** * Gets filter_type * @@ -374,7 +347,7 @@ public function getFilterType() /** * Sets filter_type * - * @param string $filter_type filter_type + * @param string $filter_type Indicates that the filter (PROPERTY). * * @return self */ @@ -401,7 +374,7 @@ public function setFilterType($filter_type) /** * Gets operation * - * @return \HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison + * @return \HubSpot\Client\Crm\Lists\Model\PublicPropertyFilterOperation */ public function getOperation() { @@ -411,7 +384,7 @@ public function getOperation() /** * Sets operation * - * @param \HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison $operation operation + * @param \HubSpot\Client\Crm\Lists\Model\PublicPropertyFilterOperation $operation operation * * @return self */ @@ -424,14 +397,41 @@ public function setOperation($operation) return $this; } + + /** + * Gets property + * + * @return string + */ + public function getProperty() + { + return $this->container['property']; + } + + /** + * Sets property + * + * @param string $property Specifies the name of the property that the filter is applied to. + * + * @return self + */ + public function setProperty($property) + { + if (is_null($property)) { + throw new \InvalidArgumentException('non-nullable property cannot be null'); + } + $this->container['property'] = $property; + + 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]); } @@ -439,12 +439,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; } @@ -469,11 +469,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/Lists/Model/PublicPropertyFilterOperation.php b/codegen/Crm/Lists/Model/PublicPropertyFilterOperation.php new file mode 100644 index 000000000..9ddc67f61 --- /dev/null +++ b/codegen/Crm/Lists/Model/PublicPropertyFilterOperation.php @@ -0,0 +1,1408 @@ + + */ +class PublicPropertyFilterOperation implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'operation_type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicPropertyFilter_operation'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'include_objects_with_no_value_set' => 'bool', + 'operation_type' => 'string', + 'operator' => 'string', + 'value' => 'string', + 'requires_time_zone_conversion' => 'bool', + 'timestamp' => 'int', + 'lower_bound' => 'int', + 'upper_bound' => 'int', + 'comparison_property_name' => 'string', + 'default_comparison_value' => 'string', + 'number_of_days' => 'int', + 'values' => 'string[]', + 'day' => 'int', + 'month' => 'string', + 'year' => 'int', + 'fiscal_year_start' => 'string', + 'time_unit' => 'string', + 'time_unit_count' => 'int', + 'use_fiscal_year' => 'bool', + 'endpoint_behavior' => 'string', + 'property_parser' => 'string', + 'time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint', + 'type' => 'string', + 'lower_bound_endpoint_behavior' => 'string', + 'lower_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'string', + 'upper_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'include_objects_with_no_value_set' => null, + 'operation_type' => null, + 'operator' => null, + 'value' => null, + 'requires_time_zone_conversion' => null, + 'timestamp' => 'int32', + 'lower_bound' => 'int32', + 'upper_bound' => 'int32', + 'comparison_property_name' => null, + 'default_comparison_value' => null, + 'number_of_days' => 'int32', + 'values' => null, + 'day' => 'int32', + 'month' => null, + 'year' => 'int32', + 'fiscal_year_start' => null, + 'time_unit' => null, + 'time_unit_count' => 'int32', + 'use_fiscal_year' => null, + 'endpoint_behavior' => null, + 'property_parser' => null, + 'time_point' => null, + 'type' => null, + 'lower_bound_endpoint_behavior' => null, + 'lower_bound_time_point' => null, + 'upper_bound_endpoint_behavior' => null, + 'upper_bound_time_point' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'include_objects_with_no_value_set' => false, + 'operation_type' => false, + 'operator' => false, + 'value' => false, + 'requires_time_zone_conversion' => false, + 'timestamp' => false, + 'lower_bound' => false, + 'upper_bound' => false, + 'comparison_property_name' => false, + 'default_comparison_value' => false, + 'number_of_days' => false, + 'values' => false, + 'day' => false, + 'month' => false, + 'year' => false, + 'fiscal_year_start' => false, + 'time_unit' => false, + 'time_unit_count' => false, + 'use_fiscal_year' => false, + 'endpoint_behavior' => false, + 'property_parser' => false, + 'time_point' => false, + 'type' => false, + 'lower_bound_endpoint_behavior' => false, + 'lower_bound_time_point' => false, + 'upper_bound_endpoint_behavior' => false, + 'upper_bound_time_point' => 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 = [ + 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', + 'operation_type' => 'operationType', + 'operator' => 'operator', + 'value' => 'value', + 'requires_time_zone_conversion' => 'requiresTimeZoneConversion', + 'timestamp' => 'timestamp', + 'lower_bound' => 'lowerBound', + 'upper_bound' => 'upperBound', + 'comparison_property_name' => 'comparisonPropertyName', + 'default_comparison_value' => 'defaultComparisonValue', + 'number_of_days' => 'numberOfDays', + 'values' => 'values', + 'day' => 'day', + 'month' => 'month', + 'year' => 'year', + 'fiscal_year_start' => 'fiscalYearStart', + 'time_unit' => 'timeUnit', + 'time_unit_count' => 'timeUnitCount', + 'use_fiscal_year' => 'useFiscalYear', + 'endpoint_behavior' => 'endpointBehavior', + 'property_parser' => 'propertyParser', + 'time_point' => 'timePoint', + 'type' => 'type', + 'lower_bound_endpoint_behavior' => 'lowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'lowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'upperBoundEndpointBehavior', + 'upper_bound_time_point' => 'upperBoundTimePoint' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', + 'operation_type' => 'setOperationType', + 'operator' => 'setOperator', + 'value' => 'setValue', + 'requires_time_zone_conversion' => 'setRequiresTimeZoneConversion', + 'timestamp' => 'setTimestamp', + 'lower_bound' => 'setLowerBound', + 'upper_bound' => 'setUpperBound', + 'comparison_property_name' => 'setComparisonPropertyName', + 'default_comparison_value' => 'setDefaultComparisonValue', + 'number_of_days' => 'setNumberOfDays', + 'values' => 'setValues', + 'day' => 'setDay', + 'month' => 'setMonth', + 'year' => 'setYear', + 'fiscal_year_start' => 'setFiscalYearStart', + 'time_unit' => 'setTimeUnit', + 'time_unit_count' => 'setTimeUnitCount', + 'use_fiscal_year' => 'setUseFiscalYear', + 'endpoint_behavior' => 'setEndpointBehavior', + 'property_parser' => 'setPropertyParser', + 'time_point' => 'setTimePoint', + 'type' => 'setType', + 'lower_bound_endpoint_behavior' => 'setLowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'setLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'setUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'setUpperBoundTimePoint' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', + 'operation_type' => 'getOperationType', + 'operator' => 'getOperator', + 'value' => 'getValue', + 'requires_time_zone_conversion' => 'getRequiresTimeZoneConversion', + 'timestamp' => 'getTimestamp', + 'lower_bound' => 'getLowerBound', + 'upper_bound' => 'getUpperBound', + 'comparison_property_name' => 'getComparisonPropertyName', + 'default_comparison_value' => 'getDefaultComparisonValue', + 'number_of_days' => 'getNumberOfDays', + 'values' => 'getValues', + 'day' => 'getDay', + 'month' => 'getMonth', + 'year' => 'getYear', + 'fiscal_year_start' => 'getFiscalYearStart', + 'time_unit' => 'getTimeUnit', + 'time_unit_count' => 'getTimeUnitCount', + 'use_fiscal_year' => 'getUseFiscalYear', + 'endpoint_behavior' => 'getEndpointBehavior', + 'property_parser' => 'getPropertyParser', + 'time_point' => 'getTimePoint', + 'type' => 'getType', + 'lower_bound_endpoint_behavior' => 'getLowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'getLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'getUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'getUpperBoundTimePoint' + ]; + + /** + * 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 FISCAL_YEAR_START_APRIL = 'APRIL'; + public const FISCAL_YEAR_START_AUGUST = 'AUGUST'; + public const FISCAL_YEAR_START_DECEMBER = 'DECEMBER'; + public const FISCAL_YEAR_START_FEBRUARY = 'FEBRUARY'; + public const FISCAL_YEAR_START_JANUARY = 'JANUARY'; + public const FISCAL_YEAR_START_JULY = 'JULY'; + public const FISCAL_YEAR_START_JUNE = 'JUNE'; + public const FISCAL_YEAR_START_MARCH = 'MARCH'; + public const FISCAL_YEAR_START_MAY = 'MAY'; + public const FISCAL_YEAR_START_NOVEMBER = 'NOVEMBER'; + public const FISCAL_YEAR_START_OCTOBER = 'OCTOBER'; + public const FISCAL_YEAR_START_SEPTEMBER = 'SEPTEMBER'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getFiscalYearStartAllowableValues() + { + return [ + self::FISCAL_YEAR_START_APRIL, + self::FISCAL_YEAR_START_AUGUST, + self::FISCAL_YEAR_START_DECEMBER, + self::FISCAL_YEAR_START_FEBRUARY, + self::FISCAL_YEAR_START_JANUARY, + self::FISCAL_YEAR_START_JULY, + self::FISCAL_YEAR_START_JUNE, + self::FISCAL_YEAR_START_MARCH, + self::FISCAL_YEAR_START_MAY, + self::FISCAL_YEAR_START_NOVEMBER, + self::FISCAL_YEAR_START_OCTOBER, + self::FISCAL_YEAR_START_SEPTEMBER, + ]; + } + + /** + * 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('include_objects_with_no_value_set', $data ?? [], null); + $this->setIfExists('operation_type', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('requires_time_zone_conversion', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('lower_bound', $data ?? [], null); + $this->setIfExists('upper_bound', $data ?? [], null); + $this->setIfExists('comparison_property_name', $data ?? [], null); + $this->setIfExists('default_comparison_value', $data ?? [], null); + $this->setIfExists('number_of_days', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); + $this->setIfExists('day', $data ?? [], null); + $this->setIfExists('month', $data ?? [], null); + $this->setIfExists('year', $data ?? [], null); + $this->setIfExists('fiscal_year_start', $data ?? [], null); + $this->setIfExists('time_unit', $data ?? [], null); + $this->setIfExists('time_unit_count', $data ?? [], null); + $this->setIfExists('use_fiscal_year', $data ?? [], null); + $this->setIfExists('endpoint_behavior', $data ?? [], null); + $this->setIfExists('property_parser', $data ?? [], null); + $this->setIfExists('time_point', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('lower_bound_endpoint_behavior', $data ?? [], null); + $this->setIfExists('lower_bound_time_point', $data ?? [], null); + $this->setIfExists('upper_bound_endpoint_behavior', $data ?? [], null); + $this->setIfExists('upper_bound_time_point', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['operation_type'] = static::$openAPIModelName; + } + + /** + * 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['include_objects_with_no_value_set'] === null) { + $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; + } + if ($this->container['operation_type'] === null) { + $invalidProperties[] = "'operation_type' can't be null"; + } + if ($this->container['operator'] === null) { + $invalidProperties[] = "'operator' can't be null"; + } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } + if ($this->container['requires_time_zone_conversion'] === null) { + $invalidProperties[] = "'requires_time_zone_conversion' can't be null"; + } + if ($this->container['timestamp'] === null) { + $invalidProperties[] = "'timestamp' can't be null"; + } + if ($this->container['lower_bound'] === null) { + $invalidProperties[] = "'lower_bound' can't be null"; + } + if ($this->container['upper_bound'] === null) { + $invalidProperties[] = "'upper_bound' can't be null"; + } + if ($this->container['comparison_property_name'] === null) { + $invalidProperties[] = "'comparison_property_name' can't be null"; + } + if ($this->container['number_of_days'] === null) { + $invalidProperties[] = "'number_of_days' can't be null"; + } + if ($this->container['values'] === null) { + $invalidProperties[] = "'values' can't be null"; + } + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } + if ($this->container['month'] === null) { + $invalidProperties[] = "'month' can't be null"; + } + if ($this->container['year'] === null) { + $invalidProperties[] = "'year' can't be null"; + } + $allowedValues = $this->getFiscalYearStartAllowableValues(); + if (!is_null($this->container['fiscal_year_start']) && !in_array($this->container['fiscal_year_start'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'fiscal_year_start', must be one of '%s'", + $this->container['fiscal_year_start'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['time_unit'] === null) { + $invalidProperties[] = "'time_unit' can't be null"; + } + if ($this->container['time_point'] === null) { + $invalidProperties[] = "'time_point' can't be null"; + } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } + if ($this->container['lower_bound_time_point'] === null) { + $invalidProperties[] = "'lower_bound_time_point' can't be null"; + } + if ($this->container['upper_bound_time_point'] === null) { + $invalidProperties[] = "'upper_bound_time_point' 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 include_objects_with_no_value_set + * + * @return bool + */ + public function getIncludeObjectsWithNoValueSet() + { + return $this->container['include_objects_with_no_value_set']; + } + + /** + * Sets include_objects_with_no_value_set + * + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. + * + * @return self + */ + public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_set) + { + if (is_null($include_objects_with_no_value_set)) { + throw new \InvalidArgumentException('non-nullable include_objects_with_no_value_set cannot be null'); + } + $this->container['include_objects_with_no_value_set'] = $include_objects_with_no_value_set; + + return $this; + } + + /** + * Gets operation_type + * + * @return string + */ + public function getOperationType() + { + return $this->container['operation_type']; + } + + /** + * Sets operation_type + * + * @param string $operation_type Specifies the type of operation (TIME_RANGED). + * + * @return self + */ + public function setOperationType($operation_type) + { + if (is_null($operation_type)) { + throw new \InvalidArgumentException('non-nullable operation_type cannot be null'); + } + $this->container['operation_type'] = $operation_type; + + return $this; + } + + /** + * Gets operator + * + * @return string + */ + public function getOperator() + { + return $this->container['operator']; + } + + /** + * Sets operator + * + * @param string $operator Defines the operation to be applied within the time range (IS_BETWEEN, IS_NOT_BETWEEN). + * + * @return self + */ + public function setOperator($operator) + { + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); + } + $this->container['operator'] = $operator; + + return $this; + } + + /** + * Gets value + * + * @return string + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string $value The string value to be used in the operation. + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets requires_time_zone_conversion + * + * @return bool + */ + public function getRequiresTimeZoneConversion() + { + return $this->container['requires_time_zone_conversion']; + } + + /** + * Sets requires_time_zone_conversion + * + * @param bool $requires_time_zone_conversion Specifies whether the operation requires conversion to a different time zone. + * + * @return self + */ + public function setRequiresTimeZoneConversion($requires_time_zone_conversion) + { + if (is_null($requires_time_zone_conversion)) { + throw new \InvalidArgumentException('non-nullable requires_time_zone_conversion cannot be null'); + } + $this->container['requires_time_zone_conversion'] = $requires_time_zone_conversion; + + return $this; + } + + /** + * Gets timestamp + * + * @return int + */ + public function getTimestamp() + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp + * + * @param int $timestamp The specific point in time used in the operation. + * + * @return self + */ + public function setTimestamp($timestamp) + { + if (is_null($timestamp)) { + throw new \InvalidArgumentException('non-nullable timestamp cannot be null'); + } + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets lower_bound + * + * @return int + */ + public function getLowerBound() + { + return $this->container['lower_bound']; + } + + /** + * Sets lower_bound + * + * @param int $lower_bound The lower limit of the number range for the operation. + * + * @return self + */ + public function setLowerBound($lower_bound) + { + if (is_null($lower_bound)) { + throw new \InvalidArgumentException('non-nullable lower_bound cannot be null'); + } + $this->container['lower_bound'] = $lower_bound; + + return $this; + } + + /** + * Gets upper_bound + * + * @return int + */ + public function getUpperBound() + { + return $this->container['upper_bound']; + } + + /** + * Sets upper_bound + * + * @param int $upper_bound The upper limit of the number range for the operation. + * + * @return self + */ + public function setUpperBound($upper_bound) + { + if (is_null($upper_bound)) { + throw new \InvalidArgumentException('non-nullable upper_bound cannot be null'); + } + $this->container['upper_bound'] = $upper_bound; + + return $this; + } + + /** + * Gets comparison_property_name + * + * @return string + */ + public function getComparisonPropertyName() + { + return $this->container['comparison_property_name']; + } + + /** + * Sets comparison_property_name + * + * @param string $comparison_property_name The name of the property to compare against in the operation. + * + * @return self + */ + public function setComparisonPropertyName($comparison_property_name) + { + if (is_null($comparison_property_name)) { + throw new \InvalidArgumentException('non-nullable comparison_property_name cannot be null'); + } + $this->container['comparison_property_name'] = $comparison_property_name; + + return $this; + } + + /** + * Gets default_comparison_value + * + * @return string|null + */ + public function getDefaultComparisonValue() + { + return $this->container['default_comparison_value']; + } + + /** + * Sets default_comparison_value + * + * @param string|null $default_comparison_value The default value used for comparison if the actual comparison property value is not set. + * + * @return self + */ + public function setDefaultComparisonValue($default_comparison_value) + { + if (is_null($default_comparison_value)) { + throw new \InvalidArgumentException('non-nullable default_comparison_value cannot be null'); + } + $this->container['default_comparison_value'] = $default_comparison_value; + + return $this; + } + + /** + * Gets number_of_days + * + * @return int + */ + public function getNumberOfDays() + { + return $this->container['number_of_days']; + } + + /** + * Sets number_of_days + * + * @param int $number_of_days The number of days to be considered in the rolling property updated operation. + * + * @return self + */ + public function setNumberOfDays($number_of_days) + { + if (is_null($number_of_days)) { + throw new \InvalidArgumentException('non-nullable number_of_days cannot be null'); + } + $this->container['number_of_days'] = $number_of_days; + + return $this; + } + + /** + * Gets values + * + * @return string[] + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param string[] $values values + * + * @return self + */ + public function setValues($values) + { + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); + } + $this->container['values'] = $values; + + return $this; + } + + /** + * Gets day + * + * @return int + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param int $day The day of the month for the date operation. + * + * @return self + */ + public function setDay($day) + { + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets month + * + * @return string + */ + public function getMonth() + { + return $this->container['month']; + } + + /** + * Sets month + * + * @param string $month The month for the date operation. + * + * @return self + */ + public function setMonth($month) + { + if (is_null($month)) { + throw new \InvalidArgumentException('non-nullable month cannot be null'); + } + $this->container['month'] = $month; + + return $this; + } + + /** + * Gets year + * + * @return int + */ + public function getYear() + { + return $this->container['year']; + } + + /** + * Sets year + * + * @param int $year The year for the date operation. + * + * @return self + */ + public function setYear($year) + { + if (is_null($year)) { + throw new \InvalidArgumentException('non-nullable year cannot be null'); + } + $this->container['year'] = $year; + + return $this; + } + + /** + * Gets fiscal_year_start + * + * @return string|null + */ + public function getFiscalYearStart() + { + return $this->container['fiscal_year_start']; + } + + /** + * Sets fiscal_year_start + * + * @param string|null $fiscal_year_start The month in which the fiscal year starts. + * + * @return self + */ + public function setFiscalYearStart($fiscal_year_start) + { + if (is_null($fiscal_year_start)) { + throw new \InvalidArgumentException('non-nullable fiscal_year_start cannot be null'); + } + $allowedValues = $this->getFiscalYearStartAllowableValues(); + if (!in_array($fiscal_year_start, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'fiscal_year_start', must be one of '%s'", + $fiscal_year_start, + implode("', '", $allowedValues) + ) + ); + } + $this->container['fiscal_year_start'] = $fiscal_year_start; + + return $this; + } + + /** + * Gets time_unit + * + * @return string + */ + public function getTimeUnit() + { + return $this->container['time_unit']; + } + + /** + * Sets time_unit + * + * @param string $time_unit The unit of time to be used in the operation (DAY, WEEK, MONTH, QUARTER, YEAR). + * + * @return self + */ + public function setTimeUnit($time_unit) + { + if (is_null($time_unit)) { + throw new \InvalidArgumentException('non-nullable time_unit cannot be null'); + } + $this->container['time_unit'] = $time_unit; + + return $this; + } + + /** + * Gets time_unit_count + * + * @return int|null + */ + public function getTimeUnitCount() + { + return $this->container['time_unit_count']; + } + + /** + * Sets time_unit_count + * + * @param int|null $time_unit_count The count of time units to be applied in the operation (1). + * + * @return self + */ + public function setTimeUnitCount($time_unit_count) + { + if (is_null($time_unit_count)) { + throw new \InvalidArgumentException('non-nullable time_unit_count cannot be null'); + } + $this->container['time_unit_count'] = $time_unit_count; + + return $this; + } + + /** + * Gets use_fiscal_year + * + * @return bool|null + */ + public function getUseFiscalYear() + { + return $this->container['use_fiscal_year']; + } + + /** + * Sets use_fiscal_year + * + * @param bool|null $use_fiscal_year Specifies whether the fiscal year should be used in the operation. + * + * @return self + */ + public function setUseFiscalYear($use_fiscal_year) + { + if (is_null($use_fiscal_year)) { + throw new \InvalidArgumentException('non-nullable use_fiscal_year cannot be null'); + } + $this->container['use_fiscal_year'] = $use_fiscal_year; + + return $this; + } + + /** + * Gets endpoint_behavior + * + * @return string|null + */ + public function getEndpointBehavior() + { + return $this->container['endpoint_behavior']; + } + + /** + * Sets endpoint_behavior + * + * @param string|null $endpoint_behavior Describes the behavior at the endpoint of the time point operation. + * + * @return self + */ + public function setEndpointBehavior($endpoint_behavior) + { + if (is_null($endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable endpoint_behavior cannot be null'); + } + $this->container['endpoint_behavior'] = $endpoint_behavior; + + return $this; + } + + /** + * Gets property_parser + * + * @return string|null + */ + public function getPropertyParser() + { + return $this->container['property_parser']; + } + + /** + * Sets property_parser + * + * @param string|null $property_parser Specifies the parser used for the property in the operation. + * + * @return self + */ + public function setPropertyParser($property_parser) + { + if (is_null($property_parser)) { + throw new \InvalidArgumentException('non-nullable property_parser cannot be null'); + } + $this->container['property_parser'] = $property_parser; + + return $this; + } + + /** + * Gets time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint + */ + public function getTimePoint() + { + return $this->container['time_point']; + } + + /** + * Sets time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint $time_point time_point + * + * @return self + */ + public function setTimePoint($time_point) + { + if (is_null($time_point)) { + throw new \InvalidArgumentException('non-nullable time_point cannot be null'); + } + $this->container['time_point'] = $time_point; + + return $this; + } + + /** + * Gets type + * + * @return string + */ + public function getType() + { + return $this->container['type']; + } + + /** + * Sets type + * + * @param string $type Defines the type of operation being performed. + * + * @return self + */ + public function setType($type) + { + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); + } + $this->container['type'] = $type; + + return $this; + } + + /** + * Gets lower_bound_endpoint_behavior + * + * @return string|null + */ + public function getLowerBoundEndpointBehavior() + { + return $this->container['lower_bound_endpoint_behavior']; + } + + /** + * Sets lower_bound_endpoint_behavior + * + * @param string|null $lower_bound_endpoint_behavior Describes the behavior at the lower bound endpoint of the time range. + * + * @return self + */ + public function setLowerBoundEndpointBehavior($lower_bound_endpoint_behavior) + { + if (is_null($lower_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable lower_bound_endpoint_behavior cannot be null'); + } + $this->container['lower_bound_endpoint_behavior'] = $lower_bound_endpoint_behavior; + + return $this; + } + + /** + * Gets lower_bound_time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint + */ + public function getLowerBoundTimePoint() + { + return $this->container['lower_bound_time_point']; + } + + /** + * Sets lower_bound_time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint $lower_bound_time_point lower_bound_time_point + * + * @return self + */ + public function setLowerBoundTimePoint($lower_bound_time_point) + { + if (is_null($lower_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable lower_bound_time_point cannot be null'); + } + $this->container['lower_bound_time_point'] = $lower_bound_time_point; + + return $this; + } + + /** + * Gets upper_bound_endpoint_behavior + * + * @return string|null + */ + public function getUpperBoundEndpointBehavior() + { + return $this->container['upper_bound_endpoint_behavior']; + } + + /** + * Sets upper_bound_endpoint_behavior + * + * @param string|null $upper_bound_endpoint_behavior Describes the behavior at the upper bound endpoint of the time range. + * + * @return self + */ + public function setUpperBoundEndpointBehavior($upper_bound_endpoint_behavior) + { + if (is_null($upper_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable upper_bound_endpoint_behavior cannot be null'); + } + $this->container['upper_bound_endpoint_behavior'] = $upper_bound_endpoint_behavior; + + return $this; + } + + /** + * Gets upper_bound_time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint + */ + public function getUpperBoundTimePoint() + { + return $this->container['upper_bound_time_point']; + } + + /** + * Sets upper_bound_time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint $upper_bound_time_point upper_bound_time_point + * + * @return self + */ + public function setUpperBoundTimePoint($upper_bound_time_point) + { + if (is_null($upper_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable upper_bound_time_point cannot be null'); + } + $this->container['upper_bound_time_point'] = $upper_bound_time_point; + + 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/Lists/Model/PublicPropertyReferencedTime.php b/codegen/Crm/Lists/Model/PublicPropertyReferencedTime.php index a975d9b02..b982e9125 100644 --- a/codegen/Crm/Lists/Model/PublicPropertyReferencedTime.php +++ b/codegen/Crm/Lists/Model/PublicPropertyReferencedTime.php @@ -2,7 +2,7 @@ /** * PublicPropertyReferencedTime * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,11 +57,11 @@ class PublicPropertyReferencedTime implements ModelInterface, ArrayAccess, \Json * @var string[] */ protected static $openAPITypes = [ - 'timezone_source' => 'string', 'property' => 'string', + 'reference_type' => 'string', 'time_type' => 'string', - 'zone_id' => 'string', - 'reference_type' => 'string' + 'timezone_source' => 'string', + 'zone_id' => 'string' ]; /** @@ -72,11 +72,11 @@ class PublicPropertyReferencedTime implements ModelInterface, ArrayAccess, \Json * @psalm-var array */ protected static $openAPIFormats = [ - 'timezone_source' => null, 'property' => null, + 'reference_type' => null, 'time_type' => null, - 'zone_id' => null, - 'reference_type' => null + 'timezone_source' => null, + 'zone_id' => null ]; /** @@ -85,11 +85,11 @@ class PublicPropertyReferencedTime implements ModelInterface, ArrayAccess, \Json * @var boolean[] */ protected static array $openAPINullables = [ - 'timezone_source' => false, 'property' => false, + 'reference_type' => false, 'time_type' => false, - 'zone_id' => false, - 'reference_type' => false + 'timezone_source' => false, + 'zone_id' => false ]; /** @@ -178,11 +178,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'timezone_source' => 'timezoneSource', 'property' => 'property', + 'reference_type' => 'referenceType', 'time_type' => 'timeType', - 'zone_id' => 'zoneId', - 'reference_type' => 'referenceType' + 'timezone_source' => 'timezoneSource', + 'zone_id' => 'zoneId' ]; /** @@ -191,11 +191,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'timezone_source' => 'setTimezoneSource', 'property' => 'setProperty', + 'reference_type' => 'setReferenceType', 'time_type' => 'setTimeType', - 'zone_id' => 'setZoneId', - 'reference_type' => 'setReferenceType' + 'timezone_source' => 'setTimezoneSource', + 'zone_id' => 'setZoneId' ]; /** @@ -204,11 +204,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'timezone_source' => 'getTimezoneSource', 'property' => 'getProperty', + 'reference_type' => 'getReferenceType', 'time_type' => 'getTimeType', - 'zone_id' => 'getZoneId', - 'reference_type' => 'getReferenceType' + 'timezone_source' => 'getTimezoneSource', + 'zone_id' => 'getZoneId' ]; /** @@ -281,11 +281,11 @@ public function getTimeTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('timezone_source', $data ?? [], null); $this->setIfExists('property', $data ?? [], null); + $this->setIfExists('reference_type', $data ?? [], null); $this->setIfExists('time_type', $data ?? [], 'PROPERTY_REFERENCED'); + $this->setIfExists('timezone_source', $data ?? [], null); $this->setIfExists('zone_id', $data ?? [], null); - $this->setIfExists('reference_type', $data ?? [], null); } /** @@ -318,6 +318,9 @@ public function listInvalidProperties() if ($this->container['property'] === null) { $invalidProperties[] = "'property' can't be null"; } + if ($this->container['reference_type'] === null) { + $invalidProperties[] = "'reference_type' can't be null"; + } if ($this->container['time_type'] === null) { $invalidProperties[] = "'time_type' can't be null"; } @@ -333,9 +336,6 @@ public function listInvalidProperties() if ($this->container['zone_id'] === null) { $invalidProperties[] = "'zone_id' can't be null"; } - if ($this->container['reference_type'] === null) { - $invalidProperties[] = "'reference_type' can't be null"; - } return $invalidProperties; } @@ -352,55 +352,55 @@ public function valid() /** - * Gets timezone_source + * Gets property * - * @return string|null + * @return string */ - public function getTimezoneSource() + public function getProperty() { - return $this->container['timezone_source']; + return $this->container['property']; } /** - * Sets timezone_source + * Sets property * - * @param string|null $timezone_source timezone_source + * @param string $property Specifies the name of the property that the time reference is applied to. * * @return self */ - public function setTimezoneSource($timezone_source) + public function setProperty($property) { - if (is_null($timezone_source)) { - throw new \InvalidArgumentException('non-nullable timezone_source cannot be null'); + if (is_null($property)) { + throw new \InvalidArgumentException('non-nullable property cannot be null'); } - $this->container['timezone_source'] = $timezone_source; + $this->container['property'] = $property; return $this; } /** - * Gets property + * Gets reference_type * * @return string */ - public function getProperty() + public function getReferenceType() { - return $this->container['property']; + return $this->container['reference_type']; } /** - * Sets property + * Sets reference_type * - * @param string $property property + * @param string $reference_type Specifies the type of reference for the property (VALUE, UPDATED_AT, ANNIVERSARY, VALUE_WITH_ZONE_SAME_LOCAL_CONVERSION, ANNIVERSARY_WITH_ZONE_SAME_LOCAL_CONVERSION). * * @return self */ - public function setProperty($property) + public function setReferenceType($reference_type) { - if (is_null($property)) { - throw new \InvalidArgumentException('non-nullable property cannot be null'); + if (is_null($reference_type)) { + throw new \InvalidArgumentException('non-nullable reference_type cannot be null'); } - $this->container['property'] = $property; + $this->container['reference_type'] = $reference_type; return $this; } @@ -418,7 +418,7 @@ public function getTimeType() /** * Sets time_type * - * @param string $time_type time_type + * @param string $time_type Defines the type of time (PROPERTY_REFERENCED). * * @return self */ @@ -443,66 +443,66 @@ public function setTimeType($time_type) } /** - * Gets zone_id + * Gets timezone_source * - * @return string + * @return string|null */ - public function getZoneId() + public function getTimezoneSource() { - return $this->container['zone_id']; + return $this->container['timezone_source']; } /** - * Sets zone_id + * Sets timezone_source * - * @param string $zone_id zone_id + * @param string|null $timezone_source Specifies the source of the time zone information for the property (CUSTOM, USER, PORTAL). * * @return self */ - public function setZoneId($zone_id) + public function setTimezoneSource($timezone_source) { - if (is_null($zone_id)) { - throw new \InvalidArgumentException('non-nullable zone_id cannot be null'); + if (is_null($timezone_source)) { + throw new \InvalidArgumentException('non-nullable timezone_source cannot be null'); } - $this->container['zone_id'] = $zone_id; + $this->container['timezone_source'] = $timezone_source; return $this; } /** - * Gets reference_type + * Gets zone_id * * @return string */ - public function getReferenceType() + public function getZoneId() { - return $this->container['reference_type']; + return $this->container['zone_id']; } /** - * Sets reference_type + * Sets zone_id * - * @param string $reference_type reference_type + * @param string $zone_id Indicates the identifier for the time zone associated with the property. * * @return self */ - public function setReferenceType($reference_type) + public function setZoneId($zone_id) { - if (is_null($reference_type)) { - throw new \InvalidArgumentException('non-nullable reference_type cannot be null'); + if (is_null($zone_id)) { + throw new \InvalidArgumentException('non-nullable zone_id cannot be null'); } - $this->container['reference_type'] = $reference_type; + $this->container['zone_id'] = $zone_id; 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]); } @@ -510,12 +510,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; } @@ -540,11 +540,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/Lists/Model/PublicQuarterReference.php b/codegen/Crm/Lists/Model/PublicQuarterReference.php index af9cdd169..f3ad312db 100644 --- a/codegen/Crm/Lists/Model/PublicQuarterReference.php +++ b/codegen/Crm/Lists/Model/PublicQuarterReference.php @@ -2,7 +2,7 @@ /** * PublicQuarterReference * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,12 +57,12 @@ class PublicQuarterReference implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $openAPITypes = [ + 'day' => 'int', 'hour' => 'int', - 'month' => 'int', 'millisecond' => 'int', - 'reference_type' => 'string', - 'day' => 'int', 'minute' => 'int', + 'month' => 'int', + 'reference_type' => 'string', 'second' => 'int' ]; @@ -74,12 +74,12 @@ class PublicQuarterReference implements ModelInterface, ArrayAccess, \JsonSerial * @psalm-var array */ protected static $openAPIFormats = [ + 'day' => 'int32', 'hour' => 'int32', - 'month' => 'int32', 'millisecond' => 'int32', - 'reference_type' => null, - 'day' => 'int32', 'minute' => 'int32', + 'month' => 'int32', + 'reference_type' => null, 'second' => 'int32' ]; @@ -89,12 +89,12 @@ class PublicQuarterReference implements ModelInterface, ArrayAccess, \JsonSerial * @var boolean[] */ protected static array $openAPINullables = [ + 'day' => false, 'hour' => false, - 'month' => false, 'millisecond' => false, - 'reference_type' => false, - 'day' => false, 'minute' => false, + 'month' => false, + 'reference_type' => false, 'second' => false ]; @@ -184,12 +184,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'day' => 'day', 'hour' => 'hour', - 'month' => 'month', 'millisecond' => 'millisecond', - 'reference_type' => 'referenceType', - 'day' => 'day', 'minute' => 'minute', + 'month' => 'month', + 'reference_type' => 'referenceType', 'second' => 'second' ]; @@ -199,12 +199,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'day' => 'setDay', 'hour' => 'setHour', - 'month' => 'setMonth', 'millisecond' => 'setMillisecond', - 'reference_type' => 'setReferenceType', - 'day' => 'setDay', 'minute' => 'setMinute', + 'month' => 'setMonth', + 'reference_type' => 'setReferenceType', 'second' => 'setSecond' ]; @@ -214,12 +214,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'day' => 'getDay', 'hour' => 'getHour', - 'month' => 'getMonth', 'millisecond' => 'getMillisecond', - 'reference_type' => 'getReferenceType', - 'day' => 'getDay', 'minute' => 'getMinute', + 'month' => 'getMonth', + 'reference_type' => 'getReferenceType', 'second' => 'getSecond' ]; @@ -293,12 +293,12 @@ public function getReferenceTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('day', $data ?? [], null); $this->setIfExists('hour', $data ?? [], null); - $this->setIfExists('month', $data ?? [], null); $this->setIfExists('millisecond', $data ?? [], null); - $this->setIfExists('reference_type', $data ?? [], 'QUARTER'); - $this->setIfExists('day', $data ?? [], null); $this->setIfExists('minute', $data ?? [], null); + $this->setIfExists('month', $data ?? [], null); + $this->setIfExists('reference_type', $data ?? [], 'QUARTER'); $this->setIfExists('second', $data ?? [], null); } @@ -329,6 +329,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } if ($this->container['month'] === null) { $invalidProperties[] = "'month' can't be null"; } @@ -344,9 +347,6 @@ public function listInvalidProperties() ); } - if ($this->container['day'] === null) { - $invalidProperties[] = "'day' can't be null"; - } return $invalidProperties; } @@ -363,55 +363,55 @@ public function valid() /** - * Gets hour + * Gets day * - * @return int|null + * @return int */ - public function getHour() + public function getDay() { - return $this->container['hour']; + return $this->container['day']; } /** - * Sets hour + * Sets day * - * @param int|null $hour hour + * @param int $day The day component of the quarter reference. * * @return self */ - public function setHour($hour) + public function setDay($day) { - if (is_null($hour)) { - throw new \InvalidArgumentException('non-nullable hour cannot be null'); + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); } - $this->container['hour'] = $hour; + $this->container['day'] = $day; return $this; } /** - * Gets month + * Gets hour * - * @return int + * @return int|null */ - public function getMonth() + public function getHour() { - return $this->container['month']; + return $this->container['hour']; } /** - * Sets month + * Sets hour * - * @param int $month month + * @param int|null $hour The hour component of the quarter reference. * * @return self */ - public function setMonth($month) + public function setHour($hour) { - if (is_null($month)) { - throw new \InvalidArgumentException('non-nullable month cannot be null'); + if (is_null($hour)) { + throw new \InvalidArgumentException('non-nullable hour cannot be null'); } - $this->container['month'] = $month; + $this->container['hour'] = $hour; return $this; } @@ -429,7 +429,7 @@ public function getMillisecond() /** * Sets millisecond * - * @param int|null $millisecond millisecond + * @param int|null $millisecond The millisecond component of the quarter reference. * * @return self */ @@ -444,92 +444,92 @@ public function setMillisecond($millisecond) } /** - * Gets reference_type + * Gets minute * - * @return string + * @return int|null */ - public function getReferenceType() + public function getMinute() { - return $this->container['reference_type']; + return $this->container['minute']; } /** - * Sets reference_type + * Sets minute * - * @param string $reference_type reference_type + * @param int|null $minute The minute component of the quarter reference. * * @return self */ - public function setReferenceType($reference_type) + public function setMinute($minute) { - if (is_null($reference_type)) { - throw new \InvalidArgumentException('non-nullable reference_type cannot be null'); - } - $allowedValues = $this->getReferenceTypeAllowableValues(); - if (!in_array($reference_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'reference_type', must be one of '%s'", - $reference_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($minute)) { + throw new \InvalidArgumentException('non-nullable minute cannot be null'); } - $this->container['reference_type'] = $reference_type; + $this->container['minute'] = $minute; return $this; } /** - * Gets day + * Gets month * * @return int */ - public function getDay() + public function getMonth() { - return $this->container['day']; + return $this->container['month']; } /** - * Sets day + * Sets month * - * @param int $day day + * @param int $month The month component of the quarter reference. * * @return self */ - public function setDay($day) + public function setMonth($month) { - if (is_null($day)) { - throw new \InvalidArgumentException('non-nullable day cannot be null'); + if (is_null($month)) { + throw new \InvalidArgumentException('non-nullable month cannot be null'); } - $this->container['day'] = $day; + $this->container['month'] = $month; return $this; } /** - * Gets minute + * Gets reference_type * - * @return int|null + * @return string */ - public function getMinute() + public function getReferenceType() { - return $this->container['minute']; + return $this->container['reference_type']; } /** - * Sets minute + * Sets reference_type * - * @param int|null $minute minute + * @param string $reference_type Indicates the type of reference (QUARTER). * * @return self */ - public function setMinute($minute) + public function setReferenceType($reference_type) { - if (is_null($minute)) { - throw new \InvalidArgumentException('non-nullable minute cannot be null'); + if (is_null($reference_type)) { + throw new \InvalidArgumentException('non-nullable reference_type cannot be null'); } - $this->container['minute'] = $minute; + $allowedValues = $this->getReferenceTypeAllowableValues(); + if (!in_array($reference_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'reference_type', must be one of '%s'", + $reference_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['reference_type'] = $reference_type; return $this; } @@ -547,7 +547,7 @@ public function getSecond() /** * Sets second * - * @param int|null $second second + * @param int|null $second The second component of the quarter reference. * * @return self */ @@ -563,11 +563,11 @@ public function setSecond($second) /** * 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]); } @@ -575,12 +575,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; } @@ -605,11 +605,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/Lists/Model/PublicRangedDatePropertyOperation.php b/codegen/Crm/Lists/Model/PublicRangedDatePropertyOperation.php index ce49e0241..0435b0ecc 100644 --- a/codegen/Crm/Lists/Model/PublicRangedDatePropertyOperation.php +++ b/codegen/Crm/Lists/Model/PublicRangedDatePropertyOperation.php @@ -2,7 +2,7 @@ /** * PublicRangedDatePropertyOperation * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -58,11 +58,11 @@ class PublicRangedDatePropertyOperation implements ModelInterface, ArrayAccess, */ protected static $openAPITypes = [ 'include_objects_with_no_value_set' => 'bool', - 'upper_bound' => 'int', - 'requires_time_zone_conversion' => 'bool', - 'operation_type' => 'string', 'lower_bound' => 'int', - 'operator' => 'string' + 'operation_type' => 'string', + 'operator' => 'string', + 'requires_time_zone_conversion' => 'bool', + 'upper_bound' => 'int' ]; /** @@ -74,11 +74,11 @@ class PublicRangedDatePropertyOperation implements ModelInterface, ArrayAccess, */ protected static $openAPIFormats = [ 'include_objects_with_no_value_set' => null, - 'upper_bound' => 'int32', - 'requires_time_zone_conversion' => null, - 'operation_type' => null, 'lower_bound' => 'int32', - 'operator' => null + 'operation_type' => null, + 'operator' => null, + 'requires_time_zone_conversion' => null, + 'upper_bound' => 'int32' ]; /** @@ -88,11 +88,11 @@ class PublicRangedDatePropertyOperation implements ModelInterface, ArrayAccess, */ protected static array $openAPINullables = [ 'include_objects_with_no_value_set' => false, - 'upper_bound' => false, - 'requires_time_zone_conversion' => false, - 'operation_type' => false, 'lower_bound' => false, - 'operator' => false + 'operation_type' => false, + 'operator' => false, + 'requires_time_zone_conversion' => false, + 'upper_bound' => false ]; /** @@ -182,11 +182,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', - 'upper_bound' => 'upperBound', - 'requires_time_zone_conversion' => 'requiresTimeZoneConversion', - 'operation_type' => 'operationType', 'lower_bound' => 'lowerBound', - 'operator' => 'operator' + 'operation_type' => 'operationType', + 'operator' => 'operator', + 'requires_time_zone_conversion' => 'requiresTimeZoneConversion', + 'upper_bound' => 'upperBound' ]; /** @@ -196,11 +196,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', - 'upper_bound' => 'setUpperBound', - 'requires_time_zone_conversion' => 'setRequiresTimeZoneConversion', - 'operation_type' => 'setOperationType', 'lower_bound' => 'setLowerBound', - 'operator' => 'setOperator' + 'operation_type' => 'setOperationType', + 'operator' => 'setOperator', + 'requires_time_zone_conversion' => 'setRequiresTimeZoneConversion', + 'upper_bound' => 'setUpperBound' ]; /** @@ -210,11 +210,11 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', - 'upper_bound' => 'getUpperBound', - 'requires_time_zone_conversion' => 'getRequiresTimeZoneConversion', - 'operation_type' => 'getOperationType', 'lower_bound' => 'getLowerBound', - 'operator' => 'getOperator' + 'operation_type' => 'getOperationType', + 'operator' => 'getOperator', + 'requires_time_zone_conversion' => 'getRequiresTimeZoneConversion', + 'upper_bound' => 'getUpperBound' ]; /** @@ -288,11 +288,11 @@ public function getOperationTypeAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); - $this->setIfExists('upper_bound', $data ?? [], null); - $this->setIfExists('requires_time_zone_conversion', $data ?? [], null); - $this->setIfExists('operation_type', $data ?? [], 'RANGED_DATE'); $this->setIfExists('lower_bound', $data ?? [], null); + $this->setIfExists('operation_type', $data ?? [], 'RANGED_DATE'); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('requires_time_zone_conversion', $data ?? [], null); + $this->setIfExists('upper_bound', $data ?? [], null); } /** @@ -325,11 +325,8 @@ public function listInvalidProperties() if ($this->container['include_objects_with_no_value_set'] === null) { $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; } - if ($this->container['upper_bound'] === null) { - $invalidProperties[] = "'upper_bound' can't be null"; - } - if ($this->container['requires_time_zone_conversion'] === null) { - $invalidProperties[] = "'requires_time_zone_conversion' can't be null"; + if ($this->container['lower_bound'] === null) { + $invalidProperties[] = "'lower_bound' can't be null"; } if ($this->container['operation_type'] === null) { $invalidProperties[] = "'operation_type' can't be null"; @@ -343,12 +340,15 @@ public function listInvalidProperties() ); } - if ($this->container['lower_bound'] === null) { - $invalidProperties[] = "'lower_bound' can't be null"; - } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } + if ($this->container['requires_time_zone_conversion'] === null) { + $invalidProperties[] = "'requires_time_zone_conversion' can't be null"; + } + if ($this->container['upper_bound'] === null) { + $invalidProperties[] = "'upper_bound' can't be null"; + } return $invalidProperties; } @@ -377,7 +377,7 @@ public function getIncludeObjectsWithNoValueSet() /** * Sets include_objects_with_no_value_set * - * @param bool $include_objects_with_no_value_set include_objects_with_no_value_set + * @param bool $include_objects_with_no_value_set Specifies whether objects without a set value should be included in the operation. * * @return self */ @@ -392,55 +392,28 @@ public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_s } /** - * Gets upper_bound + * Gets lower_bound * * @return int */ - public function getUpperBound() - { - return $this->container['upper_bound']; - } - - /** - * Sets upper_bound - * - * @param int $upper_bound upper_bound - * - * @return self - */ - public function setUpperBound($upper_bound) - { - if (is_null($upper_bound)) { - throw new \InvalidArgumentException('non-nullable upper_bound cannot be null'); - } - $this->container['upper_bound'] = $upper_bound; - - return $this; - } - - /** - * Gets requires_time_zone_conversion - * - * @return bool - */ - public function getRequiresTimeZoneConversion() + public function getLowerBound() { - return $this->container['requires_time_zone_conversion']; + return $this->container['lower_bound']; } /** - * Sets requires_time_zone_conversion + * Sets lower_bound * - * @param bool $requires_time_zone_conversion requires_time_zone_conversion + * @param int $lower_bound The lower limit of the date range for the operation. * * @return self */ - public function setRequiresTimeZoneConversion($requires_time_zone_conversion) + public function setLowerBound($lower_bound) { - if (is_null($requires_time_zone_conversion)) { - throw new \InvalidArgumentException('non-nullable requires_time_zone_conversion cannot be null'); + if (is_null($lower_bound)) { + throw new \InvalidArgumentException('non-nullable lower_bound cannot be null'); } - $this->container['requires_time_zone_conversion'] = $requires_time_zone_conversion; + $this->container['lower_bound'] = $lower_bound; return $this; } @@ -458,7 +431,7 @@ public function getOperationType() /** * Sets operation_type * - * @param string $operation_type operation_type + * @param string $operation_type Specifies the type of operation (RANGED_DATE). * * @return self */ @@ -483,66 +456,93 @@ public function setOperationType($operation_type) } /** - * Gets lower_bound + * Gets operator * - * @return int + * @return string */ - public function getLowerBound() + public function getOperator() { - return $this->container['lower_bound']; + return $this->container['operator']; } /** - * Sets lower_bound + * Sets operator * - * @param int $lower_bound lower_bound + * @param string $operator Defines the operation to be applied in the ranged date property operation (IS_BETWEEN, IS_NOT_BETWEEN). * * @return self */ - public function setLowerBound($lower_bound) + public function setOperator($operator) { - if (is_null($lower_bound)) { - throw new \InvalidArgumentException('non-nullable lower_bound cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['lower_bound'] = $lower_bound; + $this->container['operator'] = $operator; return $this; } /** - * Gets operator + * Gets requires_time_zone_conversion * - * @return string + * @return bool */ - public function getOperator() + public function getRequiresTimeZoneConversion() { - return $this->container['operator']; + return $this->container['requires_time_zone_conversion']; } /** - * Sets operator + * Sets requires_time_zone_conversion * - * @param string $operator operator + * @param bool $requires_time_zone_conversion Indicates whether the operation requires conversion to a different time zone. * * @return self */ - public function setOperator($operator) + public function setRequiresTimeZoneConversion($requires_time_zone_conversion) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); + if (is_null($requires_time_zone_conversion)) { + throw new \InvalidArgumentException('non-nullable requires_time_zone_conversion cannot be null'); } - $this->container['operator'] = $operator; + $this->container['requires_time_zone_conversion'] = $requires_time_zone_conversion; + + return $this; + } + + /** + * Gets upper_bound + * + * @return int + */ + public function getUpperBound() + { + return $this->container['upper_bound']; + } + + /** + * Sets upper_bound + * + * @param int $upper_bound The upper limit of the date range for the operation. + * + * @return self + */ + public function setUpperBound($upper_bound) + { + if (is_null($upper_bound)) { + throw new \InvalidArgumentException('non-nullable upper_bound cannot be null'); + } + $this->container['upper_bound'] = $upper_bound; 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]); } @@ -550,12 +550,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; } @@ -580,11 +580,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/Lists/Model/PublicRangedNumberPropertyOperation.php b/codegen/Crm/Lists/Model/PublicRangedNumberPropertyOperation.php index f307321b4..54499a818 100644 --- a/codegen/Crm/Lists/Model/PublicRangedNumberPropertyOperation.php +++ b/codegen/Crm/Lists/Model/PublicRangedNumberPropertyOperation.php @@ -2,7 +2,7 @@ /** * PublicRangedNumberPropertyOperation * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -58,10 +58,10 @@ class PublicRangedNumberPropertyOperation implements ModelInterface, ArrayAccess */ protected static $openAPITypes = [ 'include_objects_with_no_value_set' => 'bool', - 'upper_bound' => 'int', - 'operation_type' => 'string', 'lower_bound' => 'int', - 'operator' => 'string' + 'operation_type' => 'string', + 'operator' => 'string', + 'upper_bound' => 'int' ]; /** @@ -73,10 +73,10 @@ class PublicRangedNumberPropertyOperation implements ModelInterface, ArrayAccess */ protected static $openAPIFormats = [ 'include_objects_with_no_value_set' => null, - 'upper_bound' => 'int32', - 'operation_type' => null, 'lower_bound' => 'int32', - 'operator' => null + 'operation_type' => null, + 'operator' => null, + 'upper_bound' => 'int32' ]; /** @@ -86,10 +86,10 @@ class PublicRangedNumberPropertyOperation implements ModelInterface, ArrayAccess */ protected static array $openAPINullables = [ 'include_objects_with_no_value_set' => false, - 'upper_bound' => false, - 'operation_type' => false, 'lower_bound' => false, - 'operator' => false + 'operation_type' => false, + 'operator' => false, + 'upper_bound' => false ]; /** @@ -179,10 +179,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', - 'upper_bound' => 'upperBound', - 'operation_type' => 'operationType', 'lower_bound' => 'lowerBound', - 'operator' => 'operator' + 'operation_type' => 'operationType', + 'operator' => 'operator', + 'upper_bound' => 'upperBound' ]; /** @@ -192,10 +192,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', - 'upper_bound' => 'setUpperBound', - 'operation_type' => 'setOperationType', 'lower_bound' => 'setLowerBound', - 'operator' => 'setOperator' + 'operation_type' => 'setOperationType', + 'operator' => 'setOperator', + 'upper_bound' => 'setUpperBound' ]; /** @@ -205,10 +205,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', - 'upper_bound' => 'getUpperBound', - 'operation_type' => 'getOperationType', 'lower_bound' => 'getLowerBound', - 'operator' => 'getOperator' + 'operation_type' => 'getOperationType', + 'operator' => 'getOperator', + 'upper_bound' => 'getUpperBound' ]; /** @@ -282,10 +282,10 @@ public function getOperationTypeAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); - $this->setIfExists('upper_bound', $data ?? [], null); - $this->setIfExists('operation_type', $data ?? [], 'NUMBER_RANGED'); $this->setIfExists('lower_bound', $data ?? [], null); + $this->setIfExists('operation_type', $data ?? [], 'NUMBER_RANGED'); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('upper_bound', $data ?? [], null); } /** @@ -318,8 +318,8 @@ public function listInvalidProperties() if ($this->container['include_objects_with_no_value_set'] === null) { $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; } - if ($this->container['upper_bound'] === null) { - $invalidProperties[] = "'upper_bound' can't be null"; + if ($this->container['lower_bound'] === null) { + $invalidProperties[] = "'lower_bound' can't be null"; } if ($this->container['operation_type'] === null) { $invalidProperties[] = "'operation_type' can't be null"; @@ -333,12 +333,12 @@ public function listInvalidProperties() ); } - if ($this->container['lower_bound'] === null) { - $invalidProperties[] = "'lower_bound' can't be null"; - } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } + if ($this->container['upper_bound'] === null) { + $invalidProperties[] = "'upper_bound' can't be null"; + } return $invalidProperties; } @@ -367,7 +367,7 @@ public function getIncludeObjectsWithNoValueSet() /** * Sets include_objects_with_no_value_set * - * @param bool $include_objects_with_no_value_set include_objects_with_no_value_set + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. * * @return self */ @@ -382,28 +382,28 @@ public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_s } /** - * Gets upper_bound + * Gets lower_bound * * @return int */ - public function getUpperBound() + public function getLowerBound() { - return $this->container['upper_bound']; + return $this->container['lower_bound']; } /** - * Sets upper_bound + * Sets lower_bound * - * @param int $upper_bound upper_bound + * @param int $lower_bound The lower limit of the number range for the operation. * * @return self */ - public function setUpperBound($upper_bound) + public function setLowerBound($lower_bound) { - if (is_null($upper_bound)) { - throw new \InvalidArgumentException('non-nullable upper_bound cannot be null'); + if (is_null($lower_bound)) { + throw new \InvalidArgumentException('non-nullable lower_bound cannot be null'); } - $this->container['upper_bound'] = $upper_bound; + $this->container['lower_bound'] = $lower_bound; return $this; } @@ -421,7 +421,7 @@ public function getOperationType() /** * Sets operation_type * - * @param string $operation_type operation_type + * @param string $operation_type Specifies the type of operation (NUMBER_RANGED). * * @return self */ @@ -446,66 +446,66 @@ public function setOperationType($operation_type) } /** - * Gets lower_bound + * Gets operator * - * @return int + * @return string */ - public function getLowerBound() + public function getOperator() { - return $this->container['lower_bound']; + return $this->container['operator']; } /** - * Sets lower_bound + * Sets operator * - * @param int $lower_bound lower_bound + * @param string $operator Defines the operation to be applied in the ranged number property operation (IS_BETWEEN, IS_NOT_BETWEEN). * * @return self */ - public function setLowerBound($lower_bound) + public function setOperator($operator) { - if (is_null($lower_bound)) { - throw new \InvalidArgumentException('non-nullable lower_bound cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['lower_bound'] = $lower_bound; + $this->container['operator'] = $operator; return $this; } /** - * Gets operator + * Gets upper_bound * - * @return string + * @return int */ - public function getOperator() + public function getUpperBound() { - return $this->container['operator']; + return $this->container['upper_bound']; } /** - * Sets operator + * Sets upper_bound * - * @param string $operator operator + * @param int $upper_bound The upper limit of the number range for the operation. * * @return self */ - public function setOperator($operator) + public function setUpperBound($upper_bound) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); + if (is_null($upper_bound)) { + throw new \InvalidArgumentException('non-nullable upper_bound cannot be null'); } - $this->container['operator'] = $operator; + $this->container['upper_bound'] = $upper_bound; 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]); } @@ -513,12 +513,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; } @@ -543,11 +543,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/Lists/Model/PublicRangedTimeOperation.php b/codegen/Crm/Lists/Model/PublicRangedTimeOperation.php index f5acda23c..8c3168ee5 100644 --- a/codegen/Crm/Lists/Model/PublicRangedTimeOperation.php +++ b/codegen/Crm/Lists/Model/PublicRangedTimeOperation.php @@ -2,7 +2,7 @@ /** * PublicRangedTimeOperation * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,15 +57,15 @@ class PublicRangedTimeOperation implements ModelInterface, ArrayAccess, \JsonSer * @var string[] */ protected static $openAPITypes = [ - 'upper_bound_endpoint_behavior' => 'string', 'include_objects_with_no_value_set' => 'bool', - 'upper_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint', - 'property_parser' => 'string', - 'operation_type' => 'string', - 'type' => 'string', 'lower_bound_endpoint_behavior' => 'string', + 'lower_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint', + 'operation_type' => 'string', 'operator' => 'string', - 'lower_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint' + 'property_parser' => 'string', + 'type' => 'string', + 'upper_bound_endpoint_behavior' => 'string', + 'upper_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint' ]; /** @@ -76,15 +76,15 @@ class PublicRangedTimeOperation implements ModelInterface, ArrayAccess, \JsonSer * @psalm-var array */ protected static $openAPIFormats = [ - 'upper_bound_endpoint_behavior' => null, 'include_objects_with_no_value_set' => null, - 'upper_bound_time_point' => null, - 'property_parser' => null, - 'operation_type' => null, - 'type' => null, 'lower_bound_endpoint_behavior' => null, + 'lower_bound_time_point' => null, + 'operation_type' => null, 'operator' => null, - 'lower_bound_time_point' => null + 'property_parser' => null, + 'type' => null, + 'upper_bound_endpoint_behavior' => null, + 'upper_bound_time_point' => null ]; /** @@ -93,15 +93,15 @@ class PublicRangedTimeOperation implements ModelInterface, ArrayAccess, \JsonSer * @var boolean[] */ protected static array $openAPINullables = [ - 'upper_bound_endpoint_behavior' => false, 'include_objects_with_no_value_set' => false, - 'upper_bound_time_point' => false, - 'property_parser' => false, - 'operation_type' => false, - 'type' => false, 'lower_bound_endpoint_behavior' => false, + 'lower_bound_time_point' => false, + 'operation_type' => false, 'operator' => false, - 'lower_bound_time_point' => false + 'property_parser' => false, + 'type' => false, + 'upper_bound_endpoint_behavior' => false, + 'upper_bound_time_point' => false ]; /** @@ -190,15 +190,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'upper_bound_endpoint_behavior' => 'upperBoundEndpointBehavior', 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', - 'upper_bound_time_point' => 'upperBoundTimePoint', - 'property_parser' => 'propertyParser', - 'operation_type' => 'operationType', - 'type' => 'type', 'lower_bound_endpoint_behavior' => 'lowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'lowerBoundTimePoint', + 'operation_type' => 'operationType', 'operator' => 'operator', - 'lower_bound_time_point' => 'lowerBoundTimePoint' + 'property_parser' => 'propertyParser', + 'type' => 'type', + 'upper_bound_endpoint_behavior' => 'upperBoundEndpointBehavior', + 'upper_bound_time_point' => 'upperBoundTimePoint' ]; /** @@ -207,15 +207,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'upper_bound_endpoint_behavior' => 'setUpperBoundEndpointBehavior', 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', - 'upper_bound_time_point' => 'setUpperBoundTimePoint', - 'property_parser' => 'setPropertyParser', - 'operation_type' => 'setOperationType', - 'type' => 'setType', 'lower_bound_endpoint_behavior' => 'setLowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'setLowerBoundTimePoint', + 'operation_type' => 'setOperationType', 'operator' => 'setOperator', - 'lower_bound_time_point' => 'setLowerBoundTimePoint' + 'property_parser' => 'setPropertyParser', + 'type' => 'setType', + 'upper_bound_endpoint_behavior' => 'setUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'setUpperBoundTimePoint' ]; /** @@ -224,15 +224,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'upper_bound_endpoint_behavior' => 'getUpperBoundEndpointBehavior', 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', - 'upper_bound_time_point' => 'getUpperBoundTimePoint', - 'property_parser' => 'getPropertyParser', - 'operation_type' => 'getOperationType', - 'type' => 'getType', 'lower_bound_endpoint_behavior' => 'getLowerBoundEndpointBehavior', + 'lower_bound_time_point' => 'getLowerBoundTimePoint', + 'operation_type' => 'getOperationType', 'operator' => 'getOperator', - 'lower_bound_time_point' => 'getLowerBoundTimePoint' + 'property_parser' => 'getPropertyParser', + 'type' => 'getType', + 'upper_bound_endpoint_behavior' => 'getUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'getUpperBoundTimePoint' ]; /** @@ -305,15 +305,15 @@ public function getTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('upper_bound_endpoint_behavior', $data ?? [], null); $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); - $this->setIfExists('upper_bound_time_point', $data ?? [], null); - $this->setIfExists('property_parser', $data ?? [], null); - $this->setIfExists('operation_type', $data ?? [], null); - $this->setIfExists('type', $data ?? [], 'TIME_RANGED'); $this->setIfExists('lower_bound_endpoint_behavior', $data ?? [], null); - $this->setIfExists('operator', $data ?? [], null); $this->setIfExists('lower_bound_time_point', $data ?? [], null); + $this->setIfExists('operation_type', $data ?? [], null); + $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('property_parser', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'TIME_RANGED'); + $this->setIfExists('upper_bound_endpoint_behavior', $data ?? [], null); + $this->setIfExists('upper_bound_time_point', $data ?? [], null); } /** @@ -346,12 +346,15 @@ public function listInvalidProperties() if ($this->container['include_objects_with_no_value_set'] === null) { $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; } - if ($this->container['upper_bound_time_point'] === null) { - $invalidProperties[] = "'upper_bound_time_point' can't be null"; + if ($this->container['lower_bound_time_point'] === null) { + $invalidProperties[] = "'lower_bound_time_point' can't be null"; } if ($this->container['operation_type'] === null) { $invalidProperties[] = "'operation_type' can't be null"; } + if ($this->container['operator'] === null) { + $invalidProperties[] = "'operator' can't be null"; + } if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } @@ -364,11 +367,8 @@ public function listInvalidProperties() ); } - if ($this->container['operator'] === null) { - $invalidProperties[] = "'operator' can't be null"; - } - if ($this->container['lower_bound_time_point'] === null) { - $invalidProperties[] = "'lower_bound_time_point' can't be null"; + if ($this->container['upper_bound_time_point'] === null) { + $invalidProperties[] = "'upper_bound_time_point' can't be null"; } return $invalidProperties; } @@ -385,33 +385,6 @@ public function valid() } - /** - * Gets upper_bound_endpoint_behavior - * - * @return string|null - */ - public function getUpperBoundEndpointBehavior() - { - return $this->container['upper_bound_endpoint_behavior']; - } - - /** - * Sets upper_bound_endpoint_behavior - * - * @param string|null $upper_bound_endpoint_behavior upper_bound_endpoint_behavior - * - * @return self - */ - public function setUpperBoundEndpointBehavior($upper_bound_endpoint_behavior) - { - if (is_null($upper_bound_endpoint_behavior)) { - throw new \InvalidArgumentException('non-nullable upper_bound_endpoint_behavior cannot be null'); - } - $this->container['upper_bound_endpoint_behavior'] = $upper_bound_endpoint_behavior; - - return $this; - } - /** * Gets include_objects_with_no_value_set * @@ -425,7 +398,7 @@ public function getIncludeObjectsWithNoValueSet() /** * Sets include_objects_with_no_value_set * - * @param bool $include_objects_with_no_value_set include_objects_with_no_value_set + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. * * @return self */ @@ -440,55 +413,55 @@ public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_s } /** - * Gets upper_bound_time_point + * Gets lower_bound_endpoint_behavior * - * @return \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint + * @return string|null */ - public function getUpperBoundTimePoint() + public function getLowerBoundEndpointBehavior() { - return $this->container['upper_bound_time_point']; + return $this->container['lower_bound_endpoint_behavior']; } /** - * Sets upper_bound_time_point + * Sets lower_bound_endpoint_behavior * - * @param \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint $upper_bound_time_point upper_bound_time_point + * @param string|null $lower_bound_endpoint_behavior Describes the behavior at the lower bound endpoint of the time range. * * @return self */ - public function setUpperBoundTimePoint($upper_bound_time_point) + public function setLowerBoundEndpointBehavior($lower_bound_endpoint_behavior) { - if (is_null($upper_bound_time_point)) { - throw new \InvalidArgumentException('non-nullable upper_bound_time_point cannot be null'); + if (is_null($lower_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable lower_bound_endpoint_behavior cannot be null'); } - $this->container['upper_bound_time_point'] = $upper_bound_time_point; + $this->container['lower_bound_endpoint_behavior'] = $lower_bound_endpoint_behavior; return $this; } /** - * Gets property_parser + * Gets lower_bound_time_point * - * @return string|null + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint */ - public function getPropertyParser() + public function getLowerBoundTimePoint() { - return $this->container['property_parser']; + return $this->container['lower_bound_time_point']; } /** - * Sets property_parser + * Sets lower_bound_time_point * - * @param string|null $property_parser property_parser + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint $lower_bound_time_point lower_bound_time_point * * @return self */ - public function setPropertyParser($property_parser) + public function setLowerBoundTimePoint($lower_bound_time_point) { - if (is_null($property_parser)) { - throw new \InvalidArgumentException('non-nullable property_parser cannot be null'); + if (is_null($lower_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable lower_bound_time_point cannot be null'); } - $this->container['property_parser'] = $property_parser; + $this->container['lower_bound_time_point'] = $lower_bound_time_point; return $this; } @@ -506,7 +479,7 @@ public function getOperationType() /** * Sets operation_type * - * @param string $operation_type operation_type + * @param string $operation_type Specifies the type of operation (TIME_RANGED). * * @return self */ @@ -521,130 +494,157 @@ public function setOperationType($operation_type) } /** - * Gets type + * Gets operator * * @return string */ - public function getType() + public function getOperator() { - return $this->container['type']; + return $this->container['operator']; } /** - * Sets type + * Sets operator * - * @param string $type type + * @param string $operator Defines the operation to be applied within the time range (IS_BETWEEN, IS_NOT_BETWEEN). * * @return self */ - public function setType($type) + public function setOperator($operator) { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['type'] = $type; + $this->container['operator'] = $operator; return $this; } /** - * Gets lower_bound_endpoint_behavior + * Gets property_parser * * @return string|null */ - public function getLowerBoundEndpointBehavior() + public function getPropertyParser() { - return $this->container['lower_bound_endpoint_behavior']; + return $this->container['property_parser']; } /** - * Sets lower_bound_endpoint_behavior + * Sets property_parser * - * @param string|null $lower_bound_endpoint_behavior lower_bound_endpoint_behavior + * @param string|null $property_parser Specifies the parser used for the property in the operation. * * @return self */ - public function setLowerBoundEndpointBehavior($lower_bound_endpoint_behavior) + public function setPropertyParser($property_parser) { - if (is_null($lower_bound_endpoint_behavior)) { - throw new \InvalidArgumentException('non-nullable lower_bound_endpoint_behavior cannot be null'); + if (is_null($property_parser)) { + throw new \InvalidArgumentException('non-nullable property_parser cannot be null'); } - $this->container['lower_bound_endpoint_behavior'] = $lower_bound_endpoint_behavior; + $this->container['property_parser'] = $property_parser; return $this; } /** - * Gets operator + * Gets type * * @return string */ - public function getOperator() + public function getType() { - return $this->container['operator']; + return $this->container['type']; } /** - * Sets operator + * Sets type * - * @param string $operator operator + * @param string $type Specifies the type of operation (TIME_RANGED). * * @return self */ - public function setOperator($operator) + public function setType($type) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); } - $this->container['operator'] = $operator; + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; return $this; } /** - * Gets lower_bound_time_point + * Gets upper_bound_endpoint_behavior * - * @return \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint + * @return string|null */ - public function getLowerBoundTimePoint() + public function getUpperBoundEndpointBehavior() { - return $this->container['lower_bound_time_point']; + return $this->container['upper_bound_endpoint_behavior']; } /** - * Sets lower_bound_time_point + * Sets upper_bound_endpoint_behavior * - * @param \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint $lower_bound_time_point lower_bound_time_point + * @param string|null $upper_bound_endpoint_behavior Describes the behavior at the upper bound endpoint of the time range. * * @return self */ - public function setLowerBoundTimePoint($lower_bound_time_point) + public function setUpperBoundEndpointBehavior($upper_bound_endpoint_behavior) { - if (is_null($lower_bound_time_point)) { - throw new \InvalidArgumentException('non-nullable lower_bound_time_point cannot be null'); + if (is_null($upper_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable upper_bound_endpoint_behavior cannot be null'); } - $this->container['lower_bound_time_point'] = $lower_bound_time_point; + $this->container['upper_bound_endpoint_behavior'] = $upper_bound_endpoint_behavior; + + return $this; + } + + /** + * Gets upper_bound_time_point + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint + */ + public function getUpperBoundTimePoint() + { + return $this->container['upper_bound_time_point']; + } + + /** + * Sets upper_bound_time_point + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint $upper_bound_time_point upper_bound_time_point + * + * @return self + */ + public function setUpperBoundTimePoint($upper_bound_time_point) + { + if (is_null($upper_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable upper_bound_time_point cannot be null'); + } + $this->container['upper_bound_time_point'] = $upper_bound_time_point; 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]); } @@ -652,12 +652,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; } @@ -682,11 +682,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/Lists/Model/PublicRangedTimeOperationLowerBoundTimePoint.php b/codegen/Crm/Lists/Model/PublicRangedTimeOperationLowerBoundTimePoint.php new file mode 100644 index 000000000..6bd9095e3 --- /dev/null +++ b/codegen/Crm/Lists/Model/PublicRangedTimeOperationLowerBoundTimePoint.php @@ -0,0 +1,911 @@ + + */ +class PublicRangedTimeOperationLowerBoundTimePoint implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'time_type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicRangedTimeOperation_lowerBoundTimePoint'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'day' => 'int', + 'hour' => 'int', + 'millisecond' => 'int', + 'minute' => 'int', + 'month' => 'int', + 'second' => 'int', + 'time_type' => 'string', + 'timezone_source' => 'string', + 'year' => 'int', + 'zone_id' => 'string', + 'index_reference' => '\HubSpot\Client\Crm\Lists\Model\PublicIndexedTimePointIndexReference', + 'offset' => '\HubSpot\Client\Crm\Lists\Model\PublicIndexOffset', + 'property' => 'string', + 'reference_type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'day' => 'int32', + 'hour' => 'int32', + 'millisecond' => 'int32', + 'minute' => 'int32', + 'month' => 'int32', + 'second' => 'int32', + 'time_type' => null, + 'timezone_source' => null, + 'year' => 'int32', + 'zone_id' => null, + 'index_reference' => null, + 'offset' => null, + 'property' => null, + 'reference_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'day' => false, + 'hour' => false, + 'millisecond' => false, + 'minute' => false, + 'month' => false, + 'second' => false, + 'time_type' => false, + 'timezone_source' => false, + 'year' => false, + 'zone_id' => false, + 'index_reference' => false, + 'offset' => false, + 'property' => false, + 'reference_type' => 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 = [ + 'day' => 'day', + 'hour' => 'hour', + 'millisecond' => 'millisecond', + 'minute' => 'minute', + 'month' => 'month', + 'second' => 'second', + 'time_type' => 'timeType', + 'timezone_source' => 'timezoneSource', + 'year' => 'year', + 'zone_id' => 'zoneId', + 'index_reference' => 'indexReference', + 'offset' => 'offset', + 'property' => 'property', + 'reference_type' => 'referenceType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'day' => 'setDay', + 'hour' => 'setHour', + 'millisecond' => 'setMillisecond', + 'minute' => 'setMinute', + 'month' => 'setMonth', + 'second' => 'setSecond', + 'time_type' => 'setTimeType', + 'timezone_source' => 'setTimezoneSource', + 'year' => 'setYear', + 'zone_id' => 'setZoneId', + 'index_reference' => 'setIndexReference', + 'offset' => 'setOffset', + 'property' => 'setProperty', + 'reference_type' => 'setReferenceType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'day' => 'getDay', + 'hour' => 'getHour', + 'millisecond' => 'getMillisecond', + 'minute' => 'getMinute', + 'month' => 'getMonth', + 'second' => 'getSecond', + 'time_type' => 'getTimeType', + 'timezone_source' => 'getTimezoneSource', + 'year' => 'getYear', + 'zone_id' => 'getZoneId', + 'index_reference' => 'getIndexReference', + 'offset' => 'getOffset', + 'property' => 'getProperty', + 'reference_type' => 'getReferenceType' + ]; + + /** + * 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 TIME_TYPE_PROPERTY_REFERENCED = 'PROPERTY_REFERENCED'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTimeTypeAllowableValues() + { + return [ + self::TIME_TYPE_PROPERTY_REFERENCED, + ]; + } + + /** + * 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('day', $data ?? [], null); + $this->setIfExists('hour', $data ?? [], null); + $this->setIfExists('millisecond', $data ?? [], null); + $this->setIfExists('minute', $data ?? [], null); + $this->setIfExists('month', $data ?? [], null); + $this->setIfExists('second', $data ?? [], null); + $this->setIfExists('time_type', $data ?? [], 'PROPERTY_REFERENCED'); + $this->setIfExists('timezone_source', $data ?? [], null); + $this->setIfExists('year', $data ?? [], null); + $this->setIfExists('zone_id', $data ?? [], null); + $this->setIfExists('index_reference', $data ?? [], null); + $this->setIfExists('offset', $data ?? [], null); + $this->setIfExists('property', $data ?? [], null); + $this->setIfExists('reference_type', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['time_type'] = static::$openAPIModelName; + } + + /** + * 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['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } + if ($this->container['month'] === null) { + $invalidProperties[] = "'month' can't be null"; + } + if ($this->container['time_type'] === null) { + $invalidProperties[] = "'time_type' can't be null"; + } + $allowedValues = $this->getTimeTypeAllowableValues(); + if (!is_null($this->container['time_type']) && !in_array($this->container['time_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'time_type', must be one of '%s'", + $this->container['time_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['year'] === null) { + $invalidProperties[] = "'year' can't be null"; + } + if ($this->container['zone_id'] === null) { + $invalidProperties[] = "'zone_id' can't be null"; + } + if ($this->container['index_reference'] === null) { + $invalidProperties[] = "'index_reference' can't be null"; + } + if ($this->container['property'] === null) { + $invalidProperties[] = "'property' can't be null"; + } + if ($this->container['reference_type'] === null) { + $invalidProperties[] = "'reference_type' 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 day + * + * @return int + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param int $day The day component of the date. + * + * @return self + */ + public function setDay($day) + { + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets hour + * + * @return int|null + */ + public function getHour() + { + return $this->container['hour']; + } + + /** + * Sets hour + * + * @param int|null $hour The hour component of the time. + * + * @return self + */ + public function setHour($hour) + { + if (is_null($hour)) { + throw new \InvalidArgumentException('non-nullable hour cannot be null'); + } + $this->container['hour'] = $hour; + + return $this; + } + + /** + * Gets millisecond + * + * @return int|null + */ + public function getMillisecond() + { + return $this->container['millisecond']; + } + + /** + * Sets millisecond + * + * @param int|null $millisecond The millisecond component of the time. + * + * @return self + */ + public function setMillisecond($millisecond) + { + if (is_null($millisecond)) { + throw new \InvalidArgumentException('non-nullable millisecond cannot be null'); + } + $this->container['millisecond'] = $millisecond; + + return $this; + } + + /** + * Gets minute + * + * @return int|null + */ + public function getMinute() + { + return $this->container['minute']; + } + + /** + * Sets minute + * + * @param int|null $minute The minute component of the time. + * + * @return self + */ + public function setMinute($minute) + { + if (is_null($minute)) { + throw new \InvalidArgumentException('non-nullable minute cannot be null'); + } + $this->container['minute'] = $minute; + + return $this; + } + + /** + * Gets month + * + * @return int + */ + public function getMonth() + { + return $this->container['month']; + } + + /** + * Sets month + * + * @param int $month The month component of the date. + * + * @return self + */ + public function setMonth($month) + { + if (is_null($month)) { + throw new \InvalidArgumentException('non-nullable month cannot be null'); + } + $this->container['month'] = $month; + + return $this; + } + + /** + * Gets second + * + * @return int|null + */ + public function getSecond() + { + return $this->container['second']; + } + + /** + * Sets second + * + * @param int|null $second The second component of the time. + * + * @return self + */ + public function setSecond($second) + { + if (is_null($second)) { + throw new \InvalidArgumentException('non-nullable second cannot be null'); + } + $this->container['second'] = $second; + + return $this; + } + + /** + * Gets time_type + * + * @return string + */ + public function getTimeType() + { + return $this->container['time_type']; + } + + /** + * Sets time_type + * + * @param string $time_type Defines the type of time (PROPERTY_REFERENCED). + * + * @return self + */ + public function setTimeType($time_type) + { + if (is_null($time_type)) { + throw new \InvalidArgumentException('non-nullable time_type cannot be null'); + } + $allowedValues = $this->getTimeTypeAllowableValues(); + if (!in_array($time_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'time_type', must be one of '%s'", + $time_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['time_type'] = $time_type; + + return $this; + } + + /** + * Gets timezone_source + * + * @return string|null + */ + public function getTimezoneSource() + { + return $this->container['timezone_source']; + } + + /** + * Sets timezone_source + * + * @param string|null $timezone_source Specifies the source of the time zone information for the property (CUSTOM, USER, PORTAL). + * + * @return self + */ + public function setTimezoneSource($timezone_source) + { + if (is_null($timezone_source)) { + throw new \InvalidArgumentException('non-nullable timezone_source cannot be null'); + } + $this->container['timezone_source'] = $timezone_source; + + return $this; + } + + /** + * Gets year + * + * @return int + */ + public function getYear() + { + return $this->container['year']; + } + + /** + * Sets year + * + * @param int $year The year component of the date. + * + * @return self + */ + public function setYear($year) + { + if (is_null($year)) { + throw new \InvalidArgumentException('non-nullable year cannot be null'); + } + $this->container['year'] = $year; + + return $this; + } + + /** + * Gets zone_id + * + * @return string + */ + public function getZoneId() + { + return $this->container['zone_id']; + } + + /** + * Sets zone_id + * + * @param string $zone_id Indicates the identifier for the time zone associated with the property. + * + * @return self + */ + public function setZoneId($zone_id) + { + if (is_null($zone_id)) { + throw new \InvalidArgumentException('non-nullable zone_id cannot be null'); + } + $this->container['zone_id'] = $zone_id; + + return $this; + } + + /** + * Gets index_reference + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicIndexedTimePointIndexReference + */ + public function getIndexReference() + { + return $this->container['index_reference']; + } + + /** + * Sets index_reference + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicIndexedTimePointIndexReference $index_reference index_reference + * + * @return self + */ + public function setIndexReference($index_reference) + { + if (is_null($index_reference)) { + throw new \InvalidArgumentException('non-nullable index_reference cannot be null'); + } + $this->container['index_reference'] = $index_reference; + + return $this; + } + + /** + * Gets offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicIndexOffset|null + */ + public function getOffset() + { + return $this->container['offset']; + } + + /** + * Sets offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicIndexOffset|null $offset offset + * + * @return self + */ + public function setOffset($offset) + { + if (is_null($offset)) { + throw new \InvalidArgumentException('non-nullable offset cannot be null'); + } + $this->container['offset'] = $offset; + + return $this; + } + + /** + * Gets property + * + * @return string + */ + public function getProperty() + { + return $this->container['property']; + } + + /** + * Sets property + * + * @param string $property Specifies the name of the property that the time reference is applied to. + * + * @return self + */ + public function setProperty($property) + { + if (is_null($property)) { + throw new \InvalidArgumentException('non-nullable property cannot be null'); + } + $this->container['property'] = $property; + + return $this; + } + + /** + * Gets reference_type + * + * @return string + */ + public function getReferenceType() + { + return $this->container['reference_type']; + } + + /** + * Sets reference_type + * + * @param string $reference_type Specifies the type of reference for the property (VALUE, UPDATED_AT, ANNIVERSARY, VALUE_WITH_ZONE_SAME_LOCAL_CONVERSION, ANNIVERSARY_WITH_ZONE_SAME_LOCAL_CONVERSION). + * + * @return self + */ + public function setReferenceType($reference_type) + { + if (is_null($reference_type)) { + throw new \InvalidArgumentException('non-nullable reference_type cannot be null'); + } + $this->container['reference_type'] = $reference_type; + + 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/Lists/Model/PublicRangedTimeOperationUpperBoundTimePoint.php b/codegen/Crm/Lists/Model/PublicRangedTimeOperationUpperBoundTimePoint.php new file mode 100644 index 000000000..22bc84d57 --- /dev/null +++ b/codegen/Crm/Lists/Model/PublicRangedTimeOperationUpperBoundTimePoint.php @@ -0,0 +1,911 @@ + + */ +class PublicRangedTimeOperationUpperBoundTimePoint implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = 'time_type'; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PublicRangedTimeOperation_upperBoundTimePoint'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'day' => 'int', + 'hour' => 'int', + 'millisecond' => 'int', + 'minute' => 'int', + 'month' => 'int', + 'second' => 'int', + 'time_type' => 'string', + 'timezone_source' => 'string', + 'year' => 'int', + 'zone_id' => 'string', + 'index_reference' => '\HubSpot\Client\Crm\Lists\Model\PublicIndexedTimePointIndexReference', + 'offset' => '\HubSpot\Client\Crm\Lists\Model\PublicIndexOffset', + 'property' => 'string', + 'reference_type' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'day' => 'int32', + 'hour' => 'int32', + 'millisecond' => 'int32', + 'minute' => 'int32', + 'month' => 'int32', + 'second' => 'int32', + 'time_type' => null, + 'timezone_source' => null, + 'year' => 'int32', + 'zone_id' => null, + 'index_reference' => null, + 'offset' => null, + 'property' => null, + 'reference_type' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'day' => false, + 'hour' => false, + 'millisecond' => false, + 'minute' => false, + 'month' => false, + 'second' => false, + 'time_type' => false, + 'timezone_source' => false, + 'year' => false, + 'zone_id' => false, + 'index_reference' => false, + 'offset' => false, + 'property' => false, + 'reference_type' => 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 = [ + 'day' => 'day', + 'hour' => 'hour', + 'millisecond' => 'millisecond', + 'minute' => 'minute', + 'month' => 'month', + 'second' => 'second', + 'time_type' => 'timeType', + 'timezone_source' => 'timezoneSource', + 'year' => 'year', + 'zone_id' => 'zoneId', + 'index_reference' => 'indexReference', + 'offset' => 'offset', + 'property' => 'property', + 'reference_type' => 'referenceType' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'day' => 'setDay', + 'hour' => 'setHour', + 'millisecond' => 'setMillisecond', + 'minute' => 'setMinute', + 'month' => 'setMonth', + 'second' => 'setSecond', + 'time_type' => 'setTimeType', + 'timezone_source' => 'setTimezoneSource', + 'year' => 'setYear', + 'zone_id' => 'setZoneId', + 'index_reference' => 'setIndexReference', + 'offset' => 'setOffset', + 'property' => 'setProperty', + 'reference_type' => 'setReferenceType' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'day' => 'getDay', + 'hour' => 'getHour', + 'millisecond' => 'getMillisecond', + 'minute' => 'getMinute', + 'month' => 'getMonth', + 'second' => 'getSecond', + 'time_type' => 'getTimeType', + 'timezone_source' => 'getTimezoneSource', + 'year' => 'getYear', + 'zone_id' => 'getZoneId', + 'index_reference' => 'getIndexReference', + 'offset' => 'getOffset', + 'property' => 'getProperty', + 'reference_type' => 'getReferenceType' + ]; + + /** + * 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 TIME_TYPE_PROPERTY_REFERENCED = 'PROPERTY_REFERENCED'; + + /** + * Gets allowable values of the enum + * + * @return string[] + */ + public function getTimeTypeAllowableValues() + { + return [ + self::TIME_TYPE_PROPERTY_REFERENCED, + ]; + } + + /** + * 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('day', $data ?? [], null); + $this->setIfExists('hour', $data ?? [], null); + $this->setIfExists('millisecond', $data ?? [], null); + $this->setIfExists('minute', $data ?? [], null); + $this->setIfExists('month', $data ?? [], null); + $this->setIfExists('second', $data ?? [], null); + $this->setIfExists('time_type', $data ?? [], 'PROPERTY_REFERENCED'); + $this->setIfExists('timezone_source', $data ?? [], null); + $this->setIfExists('year', $data ?? [], null); + $this->setIfExists('zone_id', $data ?? [], null); + $this->setIfExists('index_reference', $data ?? [], null); + $this->setIfExists('offset', $data ?? [], null); + $this->setIfExists('property', $data ?? [], null); + $this->setIfExists('reference_type', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['time_type'] = static::$openAPIModelName; + } + + /** + * 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['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } + if ($this->container['month'] === null) { + $invalidProperties[] = "'month' can't be null"; + } + if ($this->container['time_type'] === null) { + $invalidProperties[] = "'time_type' can't be null"; + } + $allowedValues = $this->getTimeTypeAllowableValues(); + if (!is_null($this->container['time_type']) && !in_array($this->container['time_type'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value '%s' for 'time_type', must be one of '%s'", + $this->container['time_type'], + implode("', '", $allowedValues) + ); + } + + if ($this->container['year'] === null) { + $invalidProperties[] = "'year' can't be null"; + } + if ($this->container['zone_id'] === null) { + $invalidProperties[] = "'zone_id' can't be null"; + } + if ($this->container['index_reference'] === null) { + $invalidProperties[] = "'index_reference' can't be null"; + } + if ($this->container['property'] === null) { + $invalidProperties[] = "'property' can't be null"; + } + if ($this->container['reference_type'] === null) { + $invalidProperties[] = "'reference_type' 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 day + * + * @return int + */ + public function getDay() + { + return $this->container['day']; + } + + /** + * Sets day + * + * @param int $day The day component of the date. + * + * @return self + */ + public function setDay($day) + { + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); + } + $this->container['day'] = $day; + + return $this; + } + + /** + * Gets hour + * + * @return int|null + */ + public function getHour() + { + return $this->container['hour']; + } + + /** + * Sets hour + * + * @param int|null $hour The hour component of the time. + * + * @return self + */ + public function setHour($hour) + { + if (is_null($hour)) { + throw new \InvalidArgumentException('non-nullable hour cannot be null'); + } + $this->container['hour'] = $hour; + + return $this; + } + + /** + * Gets millisecond + * + * @return int|null + */ + public function getMillisecond() + { + return $this->container['millisecond']; + } + + /** + * Sets millisecond + * + * @param int|null $millisecond The millisecond component of the time. + * + * @return self + */ + public function setMillisecond($millisecond) + { + if (is_null($millisecond)) { + throw new \InvalidArgumentException('non-nullable millisecond cannot be null'); + } + $this->container['millisecond'] = $millisecond; + + return $this; + } + + /** + * Gets minute + * + * @return int|null + */ + public function getMinute() + { + return $this->container['minute']; + } + + /** + * Sets minute + * + * @param int|null $minute The minute component of the time. + * + * @return self + */ + public function setMinute($minute) + { + if (is_null($minute)) { + throw new \InvalidArgumentException('non-nullable minute cannot be null'); + } + $this->container['minute'] = $minute; + + return $this; + } + + /** + * Gets month + * + * @return int + */ + public function getMonth() + { + return $this->container['month']; + } + + /** + * Sets month + * + * @param int $month The month component of the date. + * + * @return self + */ + public function setMonth($month) + { + if (is_null($month)) { + throw new \InvalidArgumentException('non-nullable month cannot be null'); + } + $this->container['month'] = $month; + + return $this; + } + + /** + * Gets second + * + * @return int|null + */ + public function getSecond() + { + return $this->container['second']; + } + + /** + * Sets second + * + * @param int|null $second The second component of the time. + * + * @return self + */ + public function setSecond($second) + { + if (is_null($second)) { + throw new \InvalidArgumentException('non-nullable second cannot be null'); + } + $this->container['second'] = $second; + + return $this; + } + + /** + * Gets time_type + * + * @return string + */ + public function getTimeType() + { + return $this->container['time_type']; + } + + /** + * Sets time_type + * + * @param string $time_type Defines the type of time (PROPERTY_REFERENCED). + * + * @return self + */ + public function setTimeType($time_type) + { + if (is_null($time_type)) { + throw new \InvalidArgumentException('non-nullable time_type cannot be null'); + } + $allowedValues = $this->getTimeTypeAllowableValues(); + if (!in_array($time_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'time_type', must be one of '%s'", + $time_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['time_type'] = $time_type; + + return $this; + } + + /** + * Gets timezone_source + * + * @return string|null + */ + public function getTimezoneSource() + { + return $this->container['timezone_source']; + } + + /** + * Sets timezone_source + * + * @param string|null $timezone_source Specifies the source of the time zone information for the property (CUSTOM, USER, PORTAL). + * + * @return self + */ + public function setTimezoneSource($timezone_source) + { + if (is_null($timezone_source)) { + throw new \InvalidArgumentException('non-nullable timezone_source cannot be null'); + } + $this->container['timezone_source'] = $timezone_source; + + return $this; + } + + /** + * Gets year + * + * @return int + */ + public function getYear() + { + return $this->container['year']; + } + + /** + * Sets year + * + * @param int $year The year component of the date. + * + * @return self + */ + public function setYear($year) + { + if (is_null($year)) { + throw new \InvalidArgumentException('non-nullable year cannot be null'); + } + $this->container['year'] = $year; + + return $this; + } + + /** + * Gets zone_id + * + * @return string + */ + public function getZoneId() + { + return $this->container['zone_id']; + } + + /** + * Sets zone_id + * + * @param string $zone_id Indicates the identifier for the time zone associated with the property. + * + * @return self + */ + public function setZoneId($zone_id) + { + if (is_null($zone_id)) { + throw new \InvalidArgumentException('non-nullable zone_id cannot be null'); + } + $this->container['zone_id'] = $zone_id; + + return $this; + } + + /** + * Gets index_reference + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicIndexedTimePointIndexReference + */ + public function getIndexReference() + { + return $this->container['index_reference']; + } + + /** + * Sets index_reference + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicIndexedTimePointIndexReference $index_reference index_reference + * + * @return self + */ + public function setIndexReference($index_reference) + { + if (is_null($index_reference)) { + throw new \InvalidArgumentException('non-nullable index_reference cannot be null'); + } + $this->container['index_reference'] = $index_reference; + + return $this; + } + + /** + * Gets offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicIndexOffset|null + */ + public function getOffset() + { + return $this->container['offset']; + } + + /** + * Sets offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicIndexOffset|null $offset offset + * + * @return self + */ + public function setOffset($offset) + { + if (is_null($offset)) { + throw new \InvalidArgumentException('non-nullable offset cannot be null'); + } + $this->container['offset'] = $offset; + + return $this; + } + + /** + * Gets property + * + * @return string + */ + public function getProperty() + { + return $this->container['property']; + } + + /** + * Sets property + * + * @param string $property Specifies the name of the property that the time reference is applied to. + * + * @return self + */ + public function setProperty($property) + { + if (is_null($property)) { + throw new \InvalidArgumentException('non-nullable property cannot be null'); + } + $this->container['property'] = $property; + + return $this; + } + + /** + * Gets reference_type + * + * @return string + */ + public function getReferenceType() + { + return $this->container['reference_type']; + } + + /** + * Sets reference_type + * + * @param string $reference_type Specifies the type of reference for the property (VALUE, UPDATED_AT, ANNIVERSARY, VALUE_WITH_ZONE_SAME_LOCAL_CONVERSION, ANNIVERSARY_WITH_ZONE_SAME_LOCAL_CONVERSION). + * + * @return self + */ + public function setReferenceType($reference_type) + { + if (is_null($reference_type)) { + throw new \InvalidArgumentException('non-nullable reference_type cannot be null'); + } + $this->container['reference_type'] = $reference_type; + + 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/Lists/Model/PublicRelativeComparativeTimestampRefineBy.php b/codegen/Crm/Lists/Model/PublicRelativeComparativeTimestampRefineBy.php index 9e1fee3ff..10954223e 100644 --- a/codegen/Crm/Lists/Model/PublicRelativeComparativeTimestampRefineBy.php +++ b/codegen/Crm/Lists/Model/PublicRelativeComparativeTimestampRefineBy.php @@ -2,7 +2,7 @@ /** * PublicRelativeComparativeTimestampRefineBy * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -347,7 +347,7 @@ public function getComparison() /** * Sets comparison * - * @param string $comparison comparison + * @param string $comparison Defines the comparison operation to be used in the refinement (BEFORE, AFTER). * * @return self */ @@ -401,7 +401,7 @@ public function getType() /** * Sets type * - * @param string $type type + * @param string $type Specifies the type of refinement, (RELATIVE_COMPARATIVE). * * @return self */ @@ -427,11 +427,11 @@ public function setType($type) /** * 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]); } @@ -439,12 +439,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; } @@ -469,11 +469,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/Lists/Model/PublicRelativeRangedTimestampRefineBy.php b/codegen/Crm/Lists/Model/PublicRelativeRangedTimestampRefineBy.php index 6fc928321..d154a48f6 100644 --- a/codegen/Crm/Lists/Model/PublicRelativeRangedTimestampRefineBy.php +++ b/codegen/Crm/Lists/Model/PublicRelativeRangedTimestampRefineBy.php @@ -2,7 +2,7 @@ /** * PublicRelativeRangedTimestampRefineBy * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,10 +57,10 @@ class PublicRelativeRangedTimestampRefineBy implements ModelInterface, ArrayAcce * @var string[] */ protected static $openAPITypes = [ - 'upper_bound_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', - 'range_type' => 'string', 'lower_bound_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset', - 'type' => 'string' + 'range_type' => 'string', + 'type' => 'string', + 'upper_bound_offset' => '\HubSpot\Client\Crm\Lists\Model\PublicTimeOffset' ]; /** @@ -71,10 +71,10 @@ class PublicRelativeRangedTimestampRefineBy implements ModelInterface, ArrayAcce * @psalm-var array */ protected static $openAPIFormats = [ - 'upper_bound_offset' => null, - 'range_type' => null, 'lower_bound_offset' => null, - 'type' => null + 'range_type' => null, + 'type' => null, + 'upper_bound_offset' => null ]; /** @@ -83,10 +83,10 @@ class PublicRelativeRangedTimestampRefineBy implements ModelInterface, ArrayAcce * @var boolean[] */ protected static array $openAPINullables = [ - 'upper_bound_offset' => false, - 'range_type' => false, 'lower_bound_offset' => false, - 'type' => false + 'range_type' => false, + 'type' => false, + 'upper_bound_offset' => false ]; /** @@ -175,10 +175,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'upper_bound_offset' => 'upperBoundOffset', - 'range_type' => 'rangeType', 'lower_bound_offset' => 'lowerBoundOffset', - 'type' => 'type' + 'range_type' => 'rangeType', + 'type' => 'type', + 'upper_bound_offset' => 'upperBoundOffset' ]; /** @@ -187,10 +187,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'upper_bound_offset' => 'setUpperBoundOffset', - 'range_type' => 'setRangeType', 'lower_bound_offset' => 'setLowerBoundOffset', - 'type' => 'setType' + 'range_type' => 'setRangeType', + 'type' => 'setType', + 'upper_bound_offset' => 'setUpperBoundOffset' ]; /** @@ -199,10 +199,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'upper_bound_offset' => 'getUpperBoundOffset', - 'range_type' => 'getRangeType', 'lower_bound_offset' => 'getLowerBoundOffset', - 'type' => 'getType' + 'range_type' => 'getRangeType', + 'type' => 'getType', + 'upper_bound_offset' => 'getUpperBoundOffset' ]; /** @@ -275,10 +275,10 @@ public function getTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('upper_bound_offset', $data ?? [], null); - $this->setIfExists('range_type', $data ?? [], null); $this->setIfExists('lower_bound_offset', $data ?? [], null); + $this->setIfExists('range_type', $data ?? [], null); $this->setIfExists('type', $data ?? [], 'RELATIVE_RANGED'); + $this->setIfExists('upper_bound_offset', $data ?? [], null); } /** @@ -308,15 +308,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['upper_bound_offset'] === null) { - $invalidProperties[] = "'upper_bound_offset' can't be null"; + if ($this->container['lower_bound_offset'] === null) { + $invalidProperties[] = "'lower_bound_offset' can't be null"; } if ($this->container['range_type'] === null) { $invalidProperties[] = "'range_type' can't be null"; } - if ($this->container['lower_bound_offset'] === null) { - $invalidProperties[] = "'lower_bound_offset' can't be null"; - } if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } @@ -329,6 +326,9 @@ public function listInvalidProperties() ); } + if ($this->container['upper_bound_offset'] === null) { + $invalidProperties[] = "'upper_bound_offset' can't be null"; + } return $invalidProperties; } @@ -345,28 +345,28 @@ public function valid() /** - * Gets upper_bound_offset + * Gets lower_bound_offset * * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset */ - public function getUpperBoundOffset() + public function getLowerBoundOffset() { - return $this->container['upper_bound_offset']; + return $this->container['lower_bound_offset']; } /** - * Sets upper_bound_offset + * Sets lower_bound_offset * - * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $upper_bound_offset upper_bound_offset + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $lower_bound_offset lower_bound_offset * * @return self */ - public function setUpperBoundOffset($upper_bound_offset) + public function setLowerBoundOffset($lower_bound_offset) { - if (is_null($upper_bound_offset)) { - throw new \InvalidArgumentException('non-nullable upper_bound_offset cannot be null'); + if (is_null($lower_bound_offset)) { + throw new \InvalidArgumentException('non-nullable lower_bound_offset cannot be null'); } - $this->container['upper_bound_offset'] = $upper_bound_offset; + $this->container['lower_bound_offset'] = $lower_bound_offset; return $this; } @@ -384,7 +384,7 @@ public function getRangeType() /** * Sets range_type * - * @param string $range_type range_type + * @param string $range_type Specifies the type of range for the refinement criteria (BETWEEN, NOT_BETWEEN). * * @return self */ @@ -398,33 +398,6 @@ public function setRangeType($range_type) return $this; } - /** - * Gets lower_bound_offset - * - * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset - */ - public function getLowerBoundOffset() - { - return $this->container['lower_bound_offset']; - } - - /** - * Sets lower_bound_offset - * - * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $lower_bound_offset lower_bound_offset - * - * @return self - */ - public function setLowerBoundOffset($lower_bound_offset) - { - if (is_null($lower_bound_offset)) { - throw new \InvalidArgumentException('non-nullable lower_bound_offset cannot be null'); - } - $this->container['lower_bound_offset'] = $lower_bound_offset; - - return $this; - } - /** * Gets type * @@ -438,7 +411,7 @@ public function getType() /** * Sets type * - * @param string $type type + * @param string $type Indicates the type of refinement (RELATIVE_RANGED). * * @return self */ @@ -461,14 +434,41 @@ public function setType($type) return $this; } + + /** + * Gets upper_bound_offset + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset + */ + public function getUpperBoundOffset() + { + return $this->container['upper_bound_offset']; + } + + /** + * Sets upper_bound_offset + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicTimeOffset $upper_bound_offset upper_bound_offset + * + * @return self + */ + public function setUpperBoundOffset($upper_bound_offset) + { + if (is_null($upper_bound_offset)) { + throw new \InvalidArgumentException('non-nullable upper_bound_offset cannot be null'); + } + $this->container['upper_bound_offset'] = $upper_bound_offset; + + 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]); } @@ -476,12 +476,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; } @@ -506,11 +506,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/Lists/Model/PublicRestrictedFilterBranch.php b/codegen/Crm/Lists/Model/PublicRestrictedFilterBranch.php index 222cb1f2b..2b999a2c5 100644 --- a/codegen/Crm/Lists/Model/PublicRestrictedFilterBranch.php +++ b/codegen/Crm/Lists/Model/PublicRestrictedFilterBranch.php @@ -2,7 +2,7 @@ /** * PublicRestrictedFilterBranch * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,9 +57,9 @@ class PublicRestrictedFilterBranch implements ModelInterface, ArrayAccess, \Json * @var string[] */ protected static $openAPITypes = [ + 'filter_branch_operator' => 'string', 'filter_branch_type' => 'string', 'filter_branches' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[]', - 'filter_branch_operator' => 'string', 'filters' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[]' ]; @@ -71,9 +71,9 @@ class PublicRestrictedFilterBranch implements ModelInterface, ArrayAccess, \Json * @psalm-var array */ protected static $openAPIFormats = [ + 'filter_branch_operator' => null, 'filter_branch_type' => null, 'filter_branches' => null, - 'filter_branch_operator' => null, 'filters' => null ]; @@ -83,9 +83,9 @@ class PublicRestrictedFilterBranch implements ModelInterface, ArrayAccess, \Json * @var boolean[] */ protected static array $openAPINullables = [ + 'filter_branch_operator' => false, 'filter_branch_type' => false, 'filter_branches' => false, - 'filter_branch_operator' => false, 'filters' => false ]; @@ -175,9 +175,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'filter_branch_operator' => 'filterBranchOperator', 'filter_branch_type' => 'filterBranchType', 'filter_branches' => 'filterBranches', - 'filter_branch_operator' => 'filterBranchOperator', 'filters' => 'filters' ]; @@ -187,9 +187,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'filter_branch_operator' => 'setFilterBranchOperator', 'filter_branch_type' => 'setFilterBranchType', 'filter_branches' => 'setFilterBranches', - 'filter_branch_operator' => 'setFilterBranchOperator', 'filters' => 'setFilters' ]; @@ -199,9 +199,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'filter_branch_operator' => 'getFilterBranchOperator', 'filter_branch_type' => 'getFilterBranchType', 'filter_branches' => 'getFilterBranches', - 'filter_branch_operator' => 'getFilterBranchOperator', 'filters' => 'getFilters' ]; @@ -275,9 +275,9 @@ public function getFilterBranchTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('filter_branch_operator', $data ?? [], null); $this->setIfExists('filter_branch_type', $data ?? [], 'RESTRICTED'); $this->setIfExists('filter_branches', $data ?? [], null); - $this->setIfExists('filter_branch_operator', $data ?? [], null); $this->setIfExists('filters', $data ?? [], null); } @@ -308,6 +308,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['filter_branch_operator'] === null) { + $invalidProperties[] = "'filter_branch_operator' can't be null"; + } if ($this->container['filter_branch_type'] === null) { $invalidProperties[] = "'filter_branch_type' can't be null"; } @@ -323,9 +326,6 @@ public function listInvalidProperties() if ($this->container['filter_branches'] === null) { $invalidProperties[] = "'filter_branches' can't be null"; } - if ($this->container['filter_branch_operator'] === null) { - $invalidProperties[] = "'filter_branch_operator' can't be null"; - } if ($this->container['filters'] === null) { $invalidProperties[] = "'filters' can't be null"; } @@ -344,6 +344,33 @@ public function valid() } + /** + * Gets filter_branch_operator + * + * @return string + */ + public function getFilterBranchOperator() + { + return $this->container['filter_branch_operator']; + } + + /** + * Sets filter_branch_operator + * + * @param string $filter_branch_operator The logical operator used to combine filters within the restricted filter branch. + * + * @return self + */ + public function setFilterBranchOperator($filter_branch_operator) + { + if (is_null($filter_branch_operator)) { + throw new \InvalidArgumentException('non-nullable filter_branch_operator cannot be null'); + } + $this->container['filter_branch_operator'] = $filter_branch_operator; + + return $this; + } + /** * Gets filter_branch_type * @@ -357,7 +384,7 @@ public function getFilterBranchType() /** * Sets filter_branch_type * - * @param string $filter_branch_type filter_branch_type + * @param string $filter_branch_type Specifies the type of the filter branch (RESTRICTED). * * @return self */ @@ -408,33 +435,6 @@ public function setFilterBranches($filter_branches) return $this; } - /** - * Gets filter_branch_operator - * - * @return string - */ - public function getFilterBranchOperator() - { - return $this->container['filter_branch_operator']; - } - - /** - * Sets filter_branch_operator - * - * @param string $filter_branch_operator filter_branch_operator - * - * @return self - */ - public function setFilterBranchOperator($filter_branch_operator) - { - if (is_null($filter_branch_operator)) { - throw new \InvalidArgumentException('non-nullable filter_branch_operator cannot be null'); - } - $this->container['filter_branch_operator'] = $filter_branch_operator; - - return $this; - } - /** * Gets filters * @@ -464,11 +464,11 @@ public function setFilters($filters) /** * 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]); } @@ -476,12 +476,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; } @@ -506,11 +506,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/Lists/Model/PublicRollingDateRangePropertyOperation.php b/codegen/Crm/Lists/Model/PublicRollingDateRangePropertyOperation.php index 1dabd3f3c..68e9f9707 100644 --- a/codegen/Crm/Lists/Model/PublicRollingDateRangePropertyOperation.php +++ b/codegen/Crm/Lists/Model/PublicRollingDateRangePropertyOperation.php @@ -2,7 +2,7 @@ /** * PublicRollingDateRangePropertyOperation * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -58,10 +58,10 @@ class PublicRollingDateRangePropertyOperation implements ModelInterface, ArrayAc */ protected static $openAPITypes = [ 'include_objects_with_no_value_set' => 'bool', - 'requires_time_zone_conversion' => 'bool', - 'operation_type' => 'string', 'number_of_days' => 'int', - 'operator' => 'string' + 'operation_type' => 'string', + 'operator' => 'string', + 'requires_time_zone_conversion' => 'bool' ]; /** @@ -73,10 +73,10 @@ class PublicRollingDateRangePropertyOperation implements ModelInterface, ArrayAc */ protected static $openAPIFormats = [ 'include_objects_with_no_value_set' => null, - 'requires_time_zone_conversion' => null, - 'operation_type' => null, 'number_of_days' => 'int32', - 'operator' => null + 'operation_type' => null, + 'operator' => null, + 'requires_time_zone_conversion' => null ]; /** @@ -86,10 +86,10 @@ class PublicRollingDateRangePropertyOperation implements ModelInterface, ArrayAc */ protected static array $openAPINullables = [ 'include_objects_with_no_value_set' => false, - 'requires_time_zone_conversion' => false, - 'operation_type' => false, 'number_of_days' => false, - 'operator' => false + 'operation_type' => false, + 'operator' => false, + 'requires_time_zone_conversion' => false ]; /** @@ -179,10 +179,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', - 'requires_time_zone_conversion' => 'requiresTimeZoneConversion', - 'operation_type' => 'operationType', 'number_of_days' => 'numberOfDays', - 'operator' => 'operator' + 'operation_type' => 'operationType', + 'operator' => 'operator', + 'requires_time_zone_conversion' => 'requiresTimeZoneConversion' ]; /** @@ -192,10 +192,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', - 'requires_time_zone_conversion' => 'setRequiresTimeZoneConversion', - 'operation_type' => 'setOperationType', 'number_of_days' => 'setNumberOfDays', - 'operator' => 'setOperator' + 'operation_type' => 'setOperationType', + 'operator' => 'setOperator', + 'requires_time_zone_conversion' => 'setRequiresTimeZoneConversion' ]; /** @@ -205,10 +205,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', - 'requires_time_zone_conversion' => 'getRequiresTimeZoneConversion', - 'operation_type' => 'getOperationType', 'number_of_days' => 'getNumberOfDays', - 'operator' => 'getOperator' + 'operation_type' => 'getOperationType', + 'operator' => 'getOperator', + 'requires_time_zone_conversion' => 'getRequiresTimeZoneConversion' ]; /** @@ -282,10 +282,10 @@ public function getOperationTypeAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); - $this->setIfExists('requires_time_zone_conversion', $data ?? [], null); - $this->setIfExists('operation_type', $data ?? [], 'ROLLING_DATE_RANGE'); $this->setIfExists('number_of_days', $data ?? [], null); + $this->setIfExists('operation_type', $data ?? [], 'ROLLING_DATE_RANGE'); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('requires_time_zone_conversion', $data ?? [], null); } /** @@ -318,8 +318,8 @@ public function listInvalidProperties() if ($this->container['include_objects_with_no_value_set'] === null) { $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; } - if ($this->container['requires_time_zone_conversion'] === null) { - $invalidProperties[] = "'requires_time_zone_conversion' can't be null"; + if ($this->container['number_of_days'] === null) { + $invalidProperties[] = "'number_of_days' can't be null"; } if ($this->container['operation_type'] === null) { $invalidProperties[] = "'operation_type' can't be null"; @@ -333,12 +333,12 @@ public function listInvalidProperties() ); } - if ($this->container['number_of_days'] === null) { - $invalidProperties[] = "'number_of_days' can't be null"; - } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } + if ($this->container['requires_time_zone_conversion'] === null) { + $invalidProperties[] = "'requires_time_zone_conversion' can't be null"; + } return $invalidProperties; } @@ -367,7 +367,7 @@ public function getIncludeObjectsWithNoValueSet() /** * Sets include_objects_with_no_value_set * - * @param bool $include_objects_with_no_value_set include_objects_with_no_value_set + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. * * @return self */ @@ -382,28 +382,28 @@ public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_s } /** - * Gets requires_time_zone_conversion + * Gets number_of_days * - * @return bool + * @return int */ - public function getRequiresTimeZoneConversion() + public function getNumberOfDays() { - return $this->container['requires_time_zone_conversion']; + return $this->container['number_of_days']; } /** - * Sets requires_time_zone_conversion + * Sets number_of_days * - * @param bool $requires_time_zone_conversion requires_time_zone_conversion + * @param int $number_of_days The number of days to be considered in the rolling date range operation. * * @return self */ - public function setRequiresTimeZoneConversion($requires_time_zone_conversion) + public function setNumberOfDays($number_of_days) { - if (is_null($requires_time_zone_conversion)) { - throw new \InvalidArgumentException('non-nullable requires_time_zone_conversion cannot be null'); + if (is_null($number_of_days)) { + throw new \InvalidArgumentException('non-nullable number_of_days cannot be null'); } - $this->container['requires_time_zone_conversion'] = $requires_time_zone_conversion; + $this->container['number_of_days'] = $number_of_days; return $this; } @@ -421,7 +421,7 @@ public function getOperationType() /** * Sets operation_type * - * @param string $operation_type operation_type + * @param string $operation_type Specifies the type of operation (ROLLING_DATE_RANGE). * * @return self */ @@ -446,66 +446,66 @@ public function setOperationType($operation_type) } /** - * Gets number_of_days + * Gets operator * - * @return int + * @return string */ - public function getNumberOfDays() + public function getOperator() { - return $this->container['number_of_days']; + return $this->container['operator']; } /** - * Sets number_of_days + * Sets operator * - * @param int $number_of_days number_of_days + * @param string $operator Defines the operation to be applied within the rolling date range property operation (IS_LESS_THAN_X_DAYS_AGO, IS_MORE_THAN_X_DAYS_AGO, IS_LESS_THAN_X_DAYS_FROM_NOW, IS_MORE_THAN_X_DAYS_FROM_NOW). * * @return self */ - public function setNumberOfDays($number_of_days) + public function setOperator($operator) { - if (is_null($number_of_days)) { - throw new \InvalidArgumentException('non-nullable number_of_days cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['number_of_days'] = $number_of_days; + $this->container['operator'] = $operator; return $this; } /** - * Gets operator + * Gets requires_time_zone_conversion * - * @return string + * @return bool */ - public function getOperator() + public function getRequiresTimeZoneConversion() { - return $this->container['operator']; + return $this->container['requires_time_zone_conversion']; } /** - * Sets operator + * Sets requires_time_zone_conversion * - * @param string $operator operator + * @param bool $requires_time_zone_conversion Specifies whether the operation requires conversion to a different time zone. * * @return self */ - public function setOperator($operator) + public function setRequiresTimeZoneConversion($requires_time_zone_conversion) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); + if (is_null($requires_time_zone_conversion)) { + throw new \InvalidArgumentException('non-nullable requires_time_zone_conversion cannot be null'); } - $this->container['operator'] = $operator; + $this->container['requires_time_zone_conversion'] = $requires_time_zone_conversion; 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]); } @@ -513,12 +513,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; } @@ -543,11 +543,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/Lists/Model/PublicRollingPropertyUpdatedOperation.php b/codegen/Crm/Lists/Model/PublicRollingPropertyUpdatedOperation.php index b700241a2..46cb7eda4 100644 --- a/codegen/Crm/Lists/Model/PublicRollingPropertyUpdatedOperation.php +++ b/codegen/Crm/Lists/Model/PublicRollingPropertyUpdatedOperation.php @@ -2,7 +2,7 @@ /** * PublicRollingPropertyUpdatedOperation * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -58,8 +58,8 @@ class PublicRollingPropertyUpdatedOperation implements ModelInterface, ArrayAcce */ protected static $openAPITypes = [ 'include_objects_with_no_value_set' => 'bool', - 'operation_type' => 'string', 'number_of_days' => 'int', + 'operation_type' => 'string', 'operator' => 'string' ]; @@ -72,8 +72,8 @@ class PublicRollingPropertyUpdatedOperation implements ModelInterface, ArrayAcce */ protected static $openAPIFormats = [ 'include_objects_with_no_value_set' => null, - 'operation_type' => null, 'number_of_days' => 'int32', + 'operation_type' => null, 'operator' => null ]; @@ -84,8 +84,8 @@ class PublicRollingPropertyUpdatedOperation implements ModelInterface, ArrayAcce */ protected static array $openAPINullables = [ 'include_objects_with_no_value_set' => false, - 'operation_type' => false, 'number_of_days' => false, + 'operation_type' => false, 'operator' => false ]; @@ -176,8 +176,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', - 'operation_type' => 'operationType', 'number_of_days' => 'numberOfDays', + 'operation_type' => 'operationType', 'operator' => 'operator' ]; @@ -188,8 +188,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', - 'operation_type' => 'setOperationType', 'number_of_days' => 'setNumberOfDays', + 'operation_type' => 'setOperationType', 'operator' => 'setOperator' ]; @@ -200,8 +200,8 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', - 'operation_type' => 'getOperationType', 'number_of_days' => 'getNumberOfDays', + 'operation_type' => 'getOperationType', 'operator' => 'getOperator' ]; @@ -276,8 +276,8 @@ public function getOperationTypeAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); - $this->setIfExists('operation_type', $data ?? [], 'ROLLING_PROPERTY_UPDATED'); $this->setIfExists('number_of_days', $data ?? [], null); + $this->setIfExists('operation_type', $data ?? [], 'ROLLING_PROPERTY_UPDATED'); $this->setIfExists('operator', $data ?? [], null); } @@ -311,6 +311,9 @@ public function listInvalidProperties() if ($this->container['include_objects_with_no_value_set'] === null) { $invalidProperties[] = "'include_objects_with_no_value_set' can't be null"; } + if ($this->container['number_of_days'] === null) { + $invalidProperties[] = "'number_of_days' can't be null"; + } if ($this->container['operation_type'] === null) { $invalidProperties[] = "'operation_type' can't be null"; } @@ -323,9 +326,6 @@ public function listInvalidProperties() ); } - if ($this->container['number_of_days'] === null) { - $invalidProperties[] = "'number_of_days' can't be null"; - } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } @@ -357,7 +357,7 @@ public function getIncludeObjectsWithNoValueSet() /** * Sets include_objects_with_no_value_set * - * @param bool $include_objects_with_no_value_set include_objects_with_no_value_set + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. * * @return self */ @@ -371,6 +371,33 @@ public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_s return $this; } + /** + * Gets number_of_days + * + * @return int + */ + public function getNumberOfDays() + { + return $this->container['number_of_days']; + } + + /** + * Sets number_of_days + * + * @param int $number_of_days The number of days to be considered in the rolling property updated operation. + * + * @return self + */ + public function setNumberOfDays($number_of_days) + { + if (is_null($number_of_days)) { + throw new \InvalidArgumentException('non-nullable number_of_days cannot be null'); + } + $this->container['number_of_days'] = $number_of_days; + + return $this; + } + /** * Gets operation_type * @@ -384,7 +411,7 @@ public function getOperationType() /** * Sets operation_type * - * @param string $operation_type operation_type + * @param string $operation_type Specifies the type of operation (ROLLING_PROPERTY_UPDATED). * * @return self */ @@ -408,33 +435,6 @@ public function setOperationType($operation_type) return $this; } - /** - * Gets number_of_days - * - * @return int - */ - public function getNumberOfDays() - { - return $this->container['number_of_days']; - } - - /** - * Sets number_of_days - * - * @param int $number_of_days number_of_days - * - * @return self - */ - public function setNumberOfDays($number_of_days) - { - if (is_null($number_of_days)) { - throw new \InvalidArgumentException('non-nullable number_of_days cannot be null'); - } - $this->container['number_of_days'] = $number_of_days; - - return $this; - } - /** * Gets operator * @@ -448,7 +448,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Defines the operation to be applied within the rolling property updated operation (UPDATED_IN_LAST_X_DAYS, NOT_UPDATED_IN_LAST_X_DAYS). * * @return self */ @@ -464,11 +464,11 @@ public function setOperator($operator) /** * 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]); } @@ -476,12 +476,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; } @@ -506,11 +506,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/Lists/Model/PublicSetOccurrencesRefineBy.php b/codegen/Crm/Lists/Model/PublicSetOccurrencesRefineBy.php index 569561b87..2d334deef 100644 --- a/codegen/Crm/Lists/Model/PublicSetOccurrencesRefineBy.php +++ b/codegen/Crm/Lists/Model/PublicSetOccurrencesRefineBy.php @@ -2,7 +2,7 @@ /** * PublicSetOccurrencesRefineBy * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,8 +57,8 @@ class PublicSetOccurrencesRefineBy implements ModelInterface, ArrayAccess, \Json * @var string[] */ protected static $openAPITypes = [ - 'type' => 'string', - 'set_type' => 'string' + 'set_type' => 'string', + 'type' => 'string' ]; /** @@ -69,8 +69,8 @@ class PublicSetOccurrencesRefineBy implements ModelInterface, ArrayAccess, \Json * @psalm-var array */ protected static $openAPIFormats = [ - 'type' => null, - 'set_type' => null + 'set_type' => null, + 'type' => null ]; /** @@ -79,8 +79,8 @@ class PublicSetOccurrencesRefineBy implements ModelInterface, ArrayAccess, \Json * @var boolean[] */ protected static array $openAPINullables = [ - 'type' => false, - 'set_type' => false + 'set_type' => false, + 'type' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'type' => 'type', - 'set_type' => 'setType' + 'set_type' => 'setType', + 'type' => 'type' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'type' => 'setType', - 'set_type' => 'setSetType' + 'set_type' => 'setSetType', + 'type' => 'setType' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'type' => 'getType', - 'set_type' => 'getSetType' + 'set_type' => 'getSetType', + 'type' => 'getType' ]; /** @@ -263,8 +263,8 @@ public function getTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('type', $data ?? [], 'SET_OCCURRENCES'); $this->setIfExists('set_type', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'SET_OCCURRENCES'); } /** @@ -294,6 +294,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['set_type'] === null) { + $invalidProperties[] = "'set_type' can't be null"; + } if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } @@ -306,9 +309,6 @@ public function listInvalidProperties() ); } - if ($this->container['set_type'] === null) { - $invalidProperties[] = "'set_type' can't be null"; - } return $invalidProperties; } @@ -325,76 +325,76 @@ public function valid() /** - * Gets type + * Gets set_type * * @return string */ - public function getType() + public function getSetType() { - return $this->container['type']; + return $this->container['set_type']; } /** - * Sets type + * Sets set_type * - * @param string $type type + * @param string $set_type Indicates the specific set type used in the refinement (ALL, ALL_INCLUDE_EMPTY, ANY, NONE, NONE_EXCLUDE_EMPTY, ANY_INCLUDE_EMPTY). * * @return self */ - public function setType($type) + public function setSetType($set_type) { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); - } - $allowedValues = $this->getTypeAllowableValues(); - if (!in_array($type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'type', must be one of '%s'", - $type, - implode("', '", $allowedValues) - ) - ); + if (is_null($set_type)) { + throw new \InvalidArgumentException('non-nullable set_type cannot be null'); } - $this->container['type'] = $type; + $this->container['set_type'] = $set_type; return $this; } /** - * Gets set_type + * Gets type * * @return string */ - public function getSetType() + public function getType() { - return $this->container['set_type']; + return $this->container['type']; } /** - * Sets set_type + * Sets type * - * @param string $set_type set_type + * @param string $type Specifies the type of refinement (SET_OCCURRENCES). * * @return self */ - public function setSetType($set_type) + public function setType($type) { - if (is_null($set_type)) { - throw new \InvalidArgumentException('non-nullable set_type cannot be null'); + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); } - $this->container['set_type'] = $set_type; + $allowedValues = $this->getTypeAllowableValues(); + if (!in_array($type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'type', must be one of '%s'", + $type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['type'] = $type; 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]); } @@ -402,12 +402,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; } @@ -432,11 +432,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/Lists/Model/PublicStringPropertyOperation.php b/codegen/Crm/Lists/Model/PublicStringPropertyOperation.php index 816b8a589..27108c96c 100644 --- a/codegen/Crm/Lists/Model/PublicStringPropertyOperation.php +++ b/codegen/Crm/Lists/Model/PublicStringPropertyOperation.php @@ -2,7 +2,7 @@ /** * PublicStringPropertyOperation * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -59,8 +59,8 @@ class PublicStringPropertyOperation implements ModelInterface, ArrayAccess, \Jso protected static $openAPITypes = [ 'include_objects_with_no_value_set' => 'bool', 'operation_type' => 'string', - 'value' => 'string', - 'operator' => 'string' + 'operator' => 'string', + 'value' => 'string' ]; /** @@ -73,8 +73,8 @@ class PublicStringPropertyOperation implements ModelInterface, ArrayAccess, \Jso protected static $openAPIFormats = [ 'include_objects_with_no_value_set' => null, 'operation_type' => null, - 'value' => null, - 'operator' => null + 'operator' => null, + 'value' => null ]; /** @@ -85,8 +85,8 @@ class PublicStringPropertyOperation implements ModelInterface, ArrayAccess, \Jso protected static array $openAPINullables = [ 'include_objects_with_no_value_set' => false, 'operation_type' => false, - 'value' => false, - 'operator' => false + 'operator' => false, + 'value' => false ]; /** @@ -177,8 +177,8 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', 'operation_type' => 'operationType', - 'value' => 'value', - 'operator' => 'operator' + 'operator' => 'operator', + 'value' => 'value' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', 'operation_type' => 'setOperationType', - 'value' => 'setValue', - 'operator' => 'setOperator' + 'operator' => 'setOperator', + 'value' => 'setValue' ]; /** @@ -201,8 +201,8 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', 'operation_type' => 'getOperationType', - 'value' => 'getValue', - 'operator' => 'getOperator' + 'operator' => 'getOperator', + 'value' => 'getValue' ]; /** @@ -277,8 +277,8 @@ public function __construct(?array $data = null) { $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); $this->setIfExists('operation_type', $data ?? [], 'STRING'); - $this->setIfExists('value', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); } /** @@ -323,12 +323,12 @@ public function listInvalidProperties() ); } - if ($this->container['value'] === null) { - $invalidProperties[] = "'value' can't be null"; - } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } return $invalidProperties; } @@ -357,7 +357,7 @@ public function getIncludeObjectsWithNoValueSet() /** * Sets include_objects_with_no_value_set * - * @param bool $include_objects_with_no_value_set include_objects_with_no_value_set + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. * * @return self */ @@ -384,7 +384,7 @@ public function getOperationType() /** * Sets operation_type * - * @param string $operation_type operation_type + * @param string $operation_type Specifies the type of operation (STRING). * * @return self */ @@ -409,66 +409,66 @@ public function setOperationType($operation_type) } /** - * Gets value + * Gets operator * * @return string */ - public function getValue() + public function getOperator() { - return $this->container['value']; + return $this->container['operator']; } /** - * Sets value + * Sets operator * - * @param string $value value + * @param string $operator Defines the operation to be applied in the string property operation ()IS_EQUAL_TO, IS_NOT_EQUAL_TO, CONTAINS, DOES_NOT_CONTAIN, STARTS_WITH, ENDS_WITH, HAS_EVER_BEEN_EQUAL_TO, HAS_NEVER_BEEN_EQUAL_TO, HAS_EVER_CONTAINED, HAS_NEVER_CONTAINED). * * @return self */ - public function setValue($value) + public function setOperator($operator) { - if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['value'] = $value; + $this->container['operator'] = $operator; return $this; } /** - * Gets operator + * Gets value * * @return string */ - public function getOperator() + public function getValue() { - return $this->container['operator']; + return $this->container['value']; } /** - * Sets operator + * Sets value * - * @param string $operator operator + * @param string $value The string value to be used in the operation. * * @return self */ - public function setOperator($operator) + public function setValue($value) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); } - $this->container['operator'] = $operator; + $this->container['value'] = $value; 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]); } @@ -476,12 +476,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; } @@ -506,11 +506,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/Lists/Model/PublicSurveyMonkeyFilter.php b/codegen/Crm/Lists/Model/PublicSurveyMonkeyFilter.php index 5f876943e..da9782193 100644 --- a/codegen/Crm/Lists/Model/PublicSurveyMonkeyFilter.php +++ b/codegen/Crm/Lists/Model/PublicSurveyMonkeyFilter.php @@ -2,7 +2,7 @@ /** * PublicSurveyMonkeyFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,9 +57,9 @@ class PublicSurveyMonkeyFilter implements ModelInterface, ArrayAccess, \JsonSeri * @var string[] */ protected static $openAPITypes = [ - 'survey_id' => 'string', 'filter_type' => 'string', - 'operator' => 'string' + 'operator' => 'string', + 'survey_id' => 'string' ]; /** @@ -70,9 +70,9 @@ class PublicSurveyMonkeyFilter implements ModelInterface, ArrayAccess, \JsonSeri * @psalm-var array */ protected static $openAPIFormats = [ - 'survey_id' => null, 'filter_type' => null, - 'operator' => null + 'operator' => null, + 'survey_id' => null ]; /** @@ -81,9 +81,9 @@ class PublicSurveyMonkeyFilter implements ModelInterface, ArrayAccess, \JsonSeri * @var boolean[] */ protected static array $openAPINullables = [ - 'survey_id' => false, 'filter_type' => false, - 'operator' => false + 'operator' => false, + 'survey_id' => false ]; /** @@ -172,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'survey_id' => 'surveyId', 'filter_type' => 'filterType', - 'operator' => 'operator' + 'operator' => 'operator', + 'survey_id' => 'surveyId' ]; /** @@ -183,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'survey_id' => 'setSurveyId', 'filter_type' => 'setFilterType', - 'operator' => 'setOperator' + 'operator' => 'setOperator', + 'survey_id' => 'setSurveyId' ]; /** @@ -194,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'survey_id' => 'getSurveyId', 'filter_type' => 'getFilterType', - 'operator' => 'getOperator' + 'operator' => 'getOperator', + 'survey_id' => 'getSurveyId' ]; /** @@ -269,9 +269,9 @@ public function getFilterTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('survey_id', $data ?? [], null); $this->setIfExists('filter_type', $data ?? [], 'SURVEY_MONKEY'); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('survey_id', $data ?? [], null); } /** @@ -301,9 +301,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['survey_id'] === null) { - $invalidProperties[] = "'survey_id' can't be null"; - } if ($this->container['filter_type'] === null) { $invalidProperties[] = "'filter_type' can't be null"; } @@ -319,6 +316,9 @@ public function listInvalidProperties() if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } + if ($this->container['survey_id'] === null) { + $invalidProperties[] = "'survey_id' can't be null"; + } return $invalidProperties; } @@ -334,33 +334,6 @@ public function valid() } - /** - * Gets survey_id - * - * @return string - */ - public function getSurveyId() - { - return $this->container['survey_id']; - } - - /** - * Sets survey_id - * - * @param string $survey_id survey_id - * - * @return self - */ - public function setSurveyId($survey_id) - { - if (is_null($survey_id)) { - throw new \InvalidArgumentException('non-nullable survey_id cannot be null'); - } - $this->container['survey_id'] = $survey_id; - - return $this; - } - /** * Gets filter_type * @@ -374,7 +347,7 @@ public function getFilterType() /** * Sets filter_type * - * @param string $filter_type filter_type + * @param string $filter_type Indicates the type of filter being applied (SURVEY_MONKEY). * * @return self */ @@ -411,7 +384,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Specifies the operation to be performed by the filter (HAS_RESPONDED_TO_SURVEY, HAS_NOT_RESPONDED_TO_SURVEY). * * @return self */ @@ -424,14 +397,41 @@ public function setOperator($operator) return $this; } + + /** + * Gets survey_id + * + * @return string + */ + public function getSurveyId() + { + return $this->container['survey_id']; + } + + /** + * Sets survey_id + * + * @param string $survey_id The ID of the survey associated with the filter. + * + * @return self + */ + public function setSurveyId($survey_id) + { + if (is_null($survey_id)) { + throw new \InvalidArgumentException('non-nullable survey_id cannot be null'); + } + $this->container['survey_id'] = $survey_id; + + 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]); } @@ -439,12 +439,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; } @@ -469,11 +469,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/Lists/Model/PublicSurveyMonkeyValueFilter.php b/codegen/Crm/Lists/Model/PublicSurveyMonkeyValueFilter.php index cf6a08ed4..791aa3932 100644 --- a/codegen/Crm/Lists/Model/PublicSurveyMonkeyValueFilter.php +++ b/codegen/Crm/Lists/Model/PublicSurveyMonkeyValueFilter.php @@ -2,7 +2,7 @@ /** * PublicSurveyMonkeyValueFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,13 +57,13 @@ class PublicSurveyMonkeyValueFilter implements ModelInterface, ArrayAccess, \Jso * @var string[] */ protected static $openAPITypes = [ - 'value_comparison' => '\HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison', - 'survey_id' => 'string', - 'survey_question' => 'string', 'filter_type' => 'string', - 'survey_answer_row_id' => 'string', + 'operator' => 'string', 'survey_answer_col_id' => 'string', - 'operator' => 'string' + 'survey_answer_row_id' => 'string', + 'survey_id' => 'string', + 'survey_question' => 'string', + 'value_comparison' => '\HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison' ]; /** @@ -74,13 +74,13 @@ class PublicSurveyMonkeyValueFilter implements ModelInterface, ArrayAccess, \Jso * @psalm-var array */ protected static $openAPIFormats = [ - 'value_comparison' => null, - 'survey_id' => null, - 'survey_question' => null, 'filter_type' => null, - 'survey_answer_row_id' => null, + 'operator' => null, 'survey_answer_col_id' => null, - 'operator' => null + 'survey_answer_row_id' => null, + 'survey_id' => null, + 'survey_question' => null, + 'value_comparison' => null ]; /** @@ -89,13 +89,13 @@ class PublicSurveyMonkeyValueFilter implements ModelInterface, ArrayAccess, \Jso * @var boolean[] */ protected static array $openAPINullables = [ - 'value_comparison' => false, - 'survey_id' => false, - 'survey_question' => false, 'filter_type' => false, - 'survey_answer_row_id' => false, + 'operator' => false, 'survey_answer_col_id' => false, - 'operator' => false + 'survey_answer_row_id' => false, + 'survey_id' => false, + 'survey_question' => false, + 'value_comparison' => false ]; /** @@ -184,13 +184,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'value_comparison' => 'valueComparison', - 'survey_id' => 'surveyId', - 'survey_question' => 'surveyQuestion', 'filter_type' => 'filterType', - 'survey_answer_row_id' => 'surveyAnswerRowId', + 'operator' => 'operator', 'survey_answer_col_id' => 'surveyAnswerColId', - 'operator' => 'operator' + 'survey_answer_row_id' => 'surveyAnswerRowId', + 'survey_id' => 'surveyId', + 'survey_question' => 'surveyQuestion', + 'value_comparison' => 'valueComparison' ]; /** @@ -199,13 +199,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'value_comparison' => 'setValueComparison', - 'survey_id' => 'setSurveyId', - 'survey_question' => 'setSurveyQuestion', 'filter_type' => 'setFilterType', - 'survey_answer_row_id' => 'setSurveyAnswerRowId', + 'operator' => 'setOperator', 'survey_answer_col_id' => 'setSurveyAnswerColId', - 'operator' => 'setOperator' + 'survey_answer_row_id' => 'setSurveyAnswerRowId', + 'survey_id' => 'setSurveyId', + 'survey_question' => 'setSurveyQuestion', + 'value_comparison' => 'setValueComparison' ]; /** @@ -214,13 +214,13 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'value_comparison' => 'getValueComparison', - 'survey_id' => 'getSurveyId', - 'survey_question' => 'getSurveyQuestion', 'filter_type' => 'getFilterType', - 'survey_answer_row_id' => 'getSurveyAnswerRowId', + 'operator' => 'getOperator', 'survey_answer_col_id' => 'getSurveyAnswerColId', - 'operator' => 'getOperator' + 'survey_answer_row_id' => 'getSurveyAnswerRowId', + 'survey_id' => 'getSurveyId', + 'survey_question' => 'getSurveyQuestion', + 'value_comparison' => 'getValueComparison' ]; /** @@ -293,13 +293,13 @@ public function getFilterTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('value_comparison', $data ?? [], null); - $this->setIfExists('survey_id', $data ?? [], null); - $this->setIfExists('survey_question', $data ?? [], null); $this->setIfExists('filter_type', $data ?? [], 'SURVEY_MONKEY_VALUE'); - $this->setIfExists('survey_answer_row_id', $data ?? [], null); - $this->setIfExists('survey_answer_col_id', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('survey_answer_col_id', $data ?? [], null); + $this->setIfExists('survey_answer_row_id', $data ?? [], null); + $this->setIfExists('survey_id', $data ?? [], null); + $this->setIfExists('survey_question', $data ?? [], null); + $this->setIfExists('value_comparison', $data ?? [], null); } /** @@ -329,15 +329,6 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['value_comparison'] === null) { - $invalidProperties[] = "'value_comparison' can't be null"; - } - if ($this->container['survey_id'] === null) { - $invalidProperties[] = "'survey_id' can't be null"; - } - if ($this->container['survey_question'] === null) { - $invalidProperties[] = "'survey_question' can't be null"; - } if ($this->container['filter_type'] === null) { $invalidProperties[] = "'filter_type' can't be null"; } @@ -353,6 +344,15 @@ public function listInvalidProperties() if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } + if ($this->container['survey_id'] === null) { + $invalidProperties[] = "'survey_id' can't be null"; + } + if ($this->container['survey_question'] === null) { + $invalidProperties[] = "'survey_question' can't be null"; + } + if ($this->container['value_comparison'] === null) { + $invalidProperties[] = "'value_comparison' can't be null"; + } return $invalidProperties; } @@ -369,211 +369,211 @@ public function valid() /** - * Gets value_comparison + * Gets filter_type * - * @return \HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison + * @return string */ - public function getValueComparison() + public function getFilterType() { - return $this->container['value_comparison']; + return $this->container['filter_type']; } /** - * Sets value_comparison + * Sets filter_type * - * @param \HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison $value_comparison value_comparison + * @param string $filter_type Defines the type of filter (SURVEY_MONKEY_VALUE). * * @return self */ - public function setValueComparison($value_comparison) + public function setFilterType($filter_type) { - if (is_null($value_comparison)) { - throw new \InvalidArgumentException('non-nullable value_comparison cannot be null'); + if (is_null($filter_type)) { + throw new \InvalidArgumentException('non-nullable filter_type cannot be null'); } - $this->container['value_comparison'] = $value_comparison; + $allowedValues = $this->getFilterTypeAllowableValues(); + if (!in_array($filter_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'filter_type', must be one of '%s'", + $filter_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['filter_type'] = $filter_type; return $this; } /** - * Gets survey_id + * Gets operator * * @return string */ - public function getSurveyId() + public function getOperator() { - return $this->container['survey_id']; + return $this->container['operator']; } /** - * Sets survey_id + * Sets operator * - * @param string $survey_id survey_id + * @param string $operator Defines the operation to be applied within the filter (HAS_ANSWERED_SURVEY_QUESTION_WITH_VALUE). * * @return self */ - public function setSurveyId($survey_id) + public function setOperator($operator) { - if (is_null($survey_id)) { - throw new \InvalidArgumentException('non-nullable survey_id cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['survey_id'] = $survey_id; + $this->container['operator'] = $operator; return $this; } /** - * Gets survey_question + * Gets survey_answer_col_id * - * @return string + * @return string|null */ - public function getSurveyQuestion() + public function getSurveyAnswerColId() { - return $this->container['survey_question']; + return $this->container['survey_answer_col_id']; } /** - * Sets survey_question + * Sets survey_answer_col_id * - * @param string $survey_question survey_question + * @param string|null $survey_answer_col_id The column ID of the survey answer used in the filter. * * @return self */ - public function setSurveyQuestion($survey_question) + public function setSurveyAnswerColId($survey_answer_col_id) { - if (is_null($survey_question)) { - throw new \InvalidArgumentException('non-nullable survey_question cannot be null'); + if (is_null($survey_answer_col_id)) { + throw new \InvalidArgumentException('non-nullable survey_answer_col_id cannot be null'); } - $this->container['survey_question'] = $survey_question; + $this->container['survey_answer_col_id'] = $survey_answer_col_id; return $this; } /** - * Gets filter_type + * Gets survey_answer_row_id * - * @return string + * @return string|null */ - public function getFilterType() + public function getSurveyAnswerRowId() { - return $this->container['filter_type']; + return $this->container['survey_answer_row_id']; } /** - * Sets filter_type + * Sets survey_answer_row_id * - * @param string $filter_type filter_type + * @param string|null $survey_answer_row_id The row ID of the survey answer used in the filter. * * @return self */ - public function setFilterType($filter_type) + public function setSurveyAnswerRowId($survey_answer_row_id) { - if (is_null($filter_type)) { - throw new \InvalidArgumentException('non-nullable filter_type cannot be null'); - } - $allowedValues = $this->getFilterTypeAllowableValues(); - if (!in_array($filter_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'filter_type', must be one of '%s'", - $filter_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($survey_answer_row_id)) { + throw new \InvalidArgumentException('non-nullable survey_answer_row_id cannot be null'); } - $this->container['filter_type'] = $filter_type; + $this->container['survey_answer_row_id'] = $survey_answer_row_id; return $this; } /** - * Gets survey_answer_row_id + * Gets survey_id * - * @return string|null + * @return string */ - public function getSurveyAnswerRowId() + public function getSurveyId() { - return $this->container['survey_answer_row_id']; + return $this->container['survey_id']; } /** - * Sets survey_answer_row_id + * Sets survey_id * - * @param string|null $survey_answer_row_id survey_answer_row_id + * @param string $survey_id The ID of the survey used in the filter. * * @return self */ - public function setSurveyAnswerRowId($survey_answer_row_id) + public function setSurveyId($survey_id) { - if (is_null($survey_answer_row_id)) { - throw new \InvalidArgumentException('non-nullable survey_answer_row_id cannot be null'); + if (is_null($survey_id)) { + throw new \InvalidArgumentException('non-nullable survey_id cannot be null'); } - $this->container['survey_answer_row_id'] = $survey_answer_row_id; + $this->container['survey_id'] = $survey_id; return $this; } /** - * Gets survey_answer_col_id + * Gets survey_question * - * @return string|null + * @return string */ - public function getSurveyAnswerColId() + public function getSurveyQuestion() { - return $this->container['survey_answer_col_id']; + return $this->container['survey_question']; } /** - * Sets survey_answer_col_id + * Sets survey_question * - * @param string|null $survey_answer_col_id survey_answer_col_id + * @param string $survey_question The question from the survey used in the filter. * * @return self */ - public function setSurveyAnswerColId($survey_answer_col_id) + public function setSurveyQuestion($survey_question) { - if (is_null($survey_answer_col_id)) { - throw new \InvalidArgumentException('non-nullable survey_answer_col_id cannot be null'); + if (is_null($survey_question)) { + throw new \InvalidArgumentException('non-nullable survey_question cannot be null'); } - $this->container['survey_answer_col_id'] = $survey_answer_col_id; + $this->container['survey_question'] = $survey_question; return $this; } /** - * Gets operator + * Gets value_comparison * - * @return string + * @return \HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison */ - public function getOperator() + public function getValueComparison() { - return $this->container['operator']; + return $this->container['value_comparison']; } /** - * Sets operator + * Sets value_comparison * - * @param string $operator operator + * @param \HubSpot\Client\Crm\Lists\Model\PublicSurveyMonkeyValueFilterValueComparison $value_comparison value_comparison * * @return self */ - public function setOperator($operator) + public function setValueComparison($value_comparison) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); + if (is_null($value_comparison)) { + throw new \InvalidArgumentException('non-nullable value_comparison cannot be null'); } - $this->container['operator'] = $operator; + $this->container['value_comparison'] = $value_comparison; 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]); } @@ -581,12 +581,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; } @@ -611,11 +611,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/Lists/Model/PublicSurveyMonkeyValueFilterValueComparison.php b/codegen/Crm/Lists/Model/PublicSurveyMonkeyValueFilterValueComparison.php index 8341d68e4..ba34da33a 100644 --- a/codegen/Crm/Lists/Model/PublicSurveyMonkeyValueFilterValueComparison.php +++ b/codegen/Crm/Lists/Model/PublicSurveyMonkeyValueFilterValueComparison.php @@ -2,7 +2,7 @@ /** * PublicSurveyMonkeyValueFilterValueComparison * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * PublicSurveyMonkeyValueFilterValueComparison Class Doc Comment * * @category Class + * @description Specifies the operation used to compare the survey answer value. * @package HubSpot\Client\Crm\Lists * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -42,7 +43,7 @@ */ class PublicSurveyMonkeyValueFilterValueComparison implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = null; + public const DISCRIMINATOR = 'operation_type'; /** * The original name of the model. @@ -59,31 +60,31 @@ class PublicSurveyMonkeyValueFilterValueComparison implements ModelInterface, Ar protected static $openAPITypes = [ 'include_objects_with_no_value_set' => 'bool', 'operation_type' => 'string', - 'value' => 'string', 'operator' => 'string', + 'value' => 'string', 'requires_time_zone_conversion' => 'bool', 'timestamp' => 'int', - 'upper_bound' => 'int', 'lower_bound' => 'int', - 'default_comparison_value' => 'string', + 'upper_bound' => 'int', 'comparison_property_name' => 'string', + 'default_comparison_value' => 'string', 'number_of_days' => 'int', 'values' => 'string[]', + 'day' => 'int', 'month' => 'string', 'year' => 'int', - 'day' => 'int', - 'use_fiscal_year' => 'bool', 'fiscal_year_start' => 'string', - 'time_unit_count' => 'int', 'time_unit' => 'string', + 'time_unit_count' => 'int', + 'use_fiscal_year' => 'bool', 'endpoint_behavior' => 'string', 'property_parser' => 'string', 'time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint', 'type' => 'string', - 'upper_bound_endpoint_behavior' => 'string', - 'upper_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint', 'lower_bound_endpoint_behavior' => 'string', - 'lower_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint' + 'lower_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'string', + 'upper_bound_time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint' ]; /** @@ -96,31 +97,31 @@ class PublicSurveyMonkeyValueFilterValueComparison implements ModelInterface, Ar protected static $openAPIFormats = [ 'include_objects_with_no_value_set' => null, 'operation_type' => null, - 'value' => null, 'operator' => null, + 'value' => null, 'requires_time_zone_conversion' => null, 'timestamp' => 'int32', - 'upper_bound' => 'int32', 'lower_bound' => 'int32', - 'default_comparison_value' => null, + 'upper_bound' => 'int32', 'comparison_property_name' => null, + 'default_comparison_value' => null, 'number_of_days' => 'int32', 'values' => null, + 'day' => 'int32', 'month' => null, 'year' => 'int32', - 'day' => 'int32', - 'use_fiscal_year' => null, 'fiscal_year_start' => null, - 'time_unit_count' => 'int32', 'time_unit' => null, + 'time_unit_count' => 'int32', + 'use_fiscal_year' => null, 'endpoint_behavior' => null, 'property_parser' => null, 'time_point' => null, 'type' => null, - 'upper_bound_endpoint_behavior' => null, - 'upper_bound_time_point' => null, 'lower_bound_endpoint_behavior' => null, - 'lower_bound_time_point' => null + 'lower_bound_time_point' => null, + 'upper_bound_endpoint_behavior' => null, + 'upper_bound_time_point' => null ]; /** @@ -131,31 +132,31 @@ class PublicSurveyMonkeyValueFilterValueComparison implements ModelInterface, Ar protected static array $openAPINullables = [ 'include_objects_with_no_value_set' => false, 'operation_type' => false, - 'value' => false, 'operator' => false, + 'value' => false, 'requires_time_zone_conversion' => false, 'timestamp' => false, - 'upper_bound' => false, 'lower_bound' => false, - 'default_comparison_value' => false, + 'upper_bound' => false, 'comparison_property_name' => false, + 'default_comparison_value' => false, 'number_of_days' => false, 'values' => false, + 'day' => false, 'month' => false, 'year' => false, - 'day' => false, - 'use_fiscal_year' => false, 'fiscal_year_start' => false, - 'time_unit_count' => false, 'time_unit' => false, + 'time_unit_count' => false, + 'use_fiscal_year' => false, 'endpoint_behavior' => false, 'property_parser' => false, 'time_point' => false, 'type' => false, - 'upper_bound_endpoint_behavior' => false, - 'upper_bound_time_point' => false, 'lower_bound_endpoint_behavior' => false, - 'lower_bound_time_point' => false + 'lower_bound_time_point' => false, + 'upper_bound_endpoint_behavior' => false, + 'upper_bound_time_point' => false ]; /** @@ -246,31 +247,31 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', 'operation_type' => 'operationType', - 'value' => 'value', 'operator' => 'operator', + 'value' => 'value', 'requires_time_zone_conversion' => 'requiresTimeZoneConversion', 'timestamp' => 'timestamp', - 'upper_bound' => 'upperBound', 'lower_bound' => 'lowerBound', - 'default_comparison_value' => 'defaultComparisonValue', + 'upper_bound' => 'upperBound', 'comparison_property_name' => 'comparisonPropertyName', + 'default_comparison_value' => 'defaultComparisonValue', 'number_of_days' => 'numberOfDays', 'values' => 'values', + 'day' => 'day', 'month' => 'month', 'year' => 'year', - 'day' => 'day', - 'use_fiscal_year' => 'useFiscalYear', 'fiscal_year_start' => 'fiscalYearStart', - 'time_unit_count' => 'timeUnitCount', 'time_unit' => 'timeUnit', + 'time_unit_count' => 'timeUnitCount', + 'use_fiscal_year' => 'useFiscalYear', 'endpoint_behavior' => 'endpointBehavior', 'property_parser' => 'propertyParser', 'time_point' => 'timePoint', 'type' => 'type', - 'upper_bound_endpoint_behavior' => 'upperBoundEndpointBehavior', - 'upper_bound_time_point' => 'upperBoundTimePoint', 'lower_bound_endpoint_behavior' => 'lowerBoundEndpointBehavior', - 'lower_bound_time_point' => 'lowerBoundTimePoint' + 'lower_bound_time_point' => 'lowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'upperBoundEndpointBehavior', + 'upper_bound_time_point' => 'upperBoundTimePoint' ]; /** @@ -281,31 +282,31 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', 'operation_type' => 'setOperationType', - 'value' => 'setValue', 'operator' => 'setOperator', + 'value' => 'setValue', 'requires_time_zone_conversion' => 'setRequiresTimeZoneConversion', 'timestamp' => 'setTimestamp', - 'upper_bound' => 'setUpperBound', 'lower_bound' => 'setLowerBound', - 'default_comparison_value' => 'setDefaultComparisonValue', + 'upper_bound' => 'setUpperBound', 'comparison_property_name' => 'setComparisonPropertyName', + 'default_comparison_value' => 'setDefaultComparisonValue', 'number_of_days' => 'setNumberOfDays', 'values' => 'setValues', + 'day' => 'setDay', 'month' => 'setMonth', 'year' => 'setYear', - 'day' => 'setDay', - 'use_fiscal_year' => 'setUseFiscalYear', 'fiscal_year_start' => 'setFiscalYearStart', - 'time_unit_count' => 'setTimeUnitCount', 'time_unit' => 'setTimeUnit', + 'time_unit_count' => 'setTimeUnitCount', + 'use_fiscal_year' => 'setUseFiscalYear', 'endpoint_behavior' => 'setEndpointBehavior', 'property_parser' => 'setPropertyParser', 'time_point' => 'setTimePoint', 'type' => 'setType', - 'upper_bound_endpoint_behavior' => 'setUpperBoundEndpointBehavior', - 'upper_bound_time_point' => 'setUpperBoundTimePoint', 'lower_bound_endpoint_behavior' => 'setLowerBoundEndpointBehavior', - 'lower_bound_time_point' => 'setLowerBoundTimePoint' + 'lower_bound_time_point' => 'setLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'setUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'setUpperBoundTimePoint' ]; /** @@ -316,31 +317,31 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', 'operation_type' => 'getOperationType', - 'value' => 'getValue', 'operator' => 'getOperator', + 'value' => 'getValue', 'requires_time_zone_conversion' => 'getRequiresTimeZoneConversion', 'timestamp' => 'getTimestamp', - 'upper_bound' => 'getUpperBound', 'lower_bound' => 'getLowerBound', - 'default_comparison_value' => 'getDefaultComparisonValue', + 'upper_bound' => 'getUpperBound', 'comparison_property_name' => 'getComparisonPropertyName', + 'default_comparison_value' => 'getDefaultComparisonValue', 'number_of_days' => 'getNumberOfDays', 'values' => 'getValues', + 'day' => 'getDay', 'month' => 'getMonth', 'year' => 'getYear', - 'day' => 'getDay', - 'use_fiscal_year' => 'getUseFiscalYear', 'fiscal_year_start' => 'getFiscalYearStart', - 'time_unit_count' => 'getTimeUnitCount', 'time_unit' => 'getTimeUnit', + 'time_unit_count' => 'getTimeUnitCount', + 'use_fiscal_year' => 'getUseFiscalYear', 'endpoint_behavior' => 'getEndpointBehavior', 'property_parser' => 'getPropertyParser', 'time_point' => 'getTimePoint', 'type' => 'getType', - 'upper_bound_endpoint_behavior' => 'getUpperBoundEndpointBehavior', - 'upper_bound_time_point' => 'getUpperBoundTimePoint', 'lower_bound_endpoint_behavior' => 'getLowerBoundEndpointBehavior', - 'lower_bound_time_point' => 'getLowerBoundTimePoint' + 'lower_bound_time_point' => 'getLowerBoundTimePoint', + 'upper_bound_endpoint_behavior' => 'getUpperBoundEndpointBehavior', + 'upper_bound_time_point' => 'getUpperBoundTimePoint' ]; /** @@ -384,18 +385,18 @@ public function getModelName() return self::$openAPIModelName; } - public const FISCAL_YEAR_START_JANUARY = 'JANUARY'; + public const FISCAL_YEAR_START_APRIL = 'APRIL'; + public const FISCAL_YEAR_START_AUGUST = 'AUGUST'; + public const FISCAL_YEAR_START_DECEMBER = 'DECEMBER'; public const FISCAL_YEAR_START_FEBRUARY = 'FEBRUARY'; + public const FISCAL_YEAR_START_JANUARY = 'JANUARY'; + public const FISCAL_YEAR_START_JULY = 'JULY'; + public const FISCAL_YEAR_START_JUNE = 'JUNE'; public const FISCAL_YEAR_START_MARCH = 'MARCH'; - public const FISCAL_YEAR_START_APRIL = 'APRIL'; public const FISCAL_YEAR_START_MAY = 'MAY'; - public const FISCAL_YEAR_START_JUNE = 'JUNE'; - public const FISCAL_YEAR_START_JULY = 'JULY'; - public const FISCAL_YEAR_START_AUGUST = 'AUGUST'; - public const FISCAL_YEAR_START_SEPTEMBER = 'SEPTEMBER'; - public const FISCAL_YEAR_START_OCTOBER = 'OCTOBER'; public const FISCAL_YEAR_START_NOVEMBER = 'NOVEMBER'; - public const FISCAL_YEAR_START_DECEMBER = 'DECEMBER'; + public const FISCAL_YEAR_START_OCTOBER = 'OCTOBER'; + public const FISCAL_YEAR_START_SEPTEMBER = 'SEPTEMBER'; /** * Gets allowable values of the enum @@ -405,18 +406,18 @@ public function getModelName() public function getFiscalYearStartAllowableValues() { return [ - self::FISCAL_YEAR_START_JANUARY, + self::FISCAL_YEAR_START_APRIL, + self::FISCAL_YEAR_START_AUGUST, + self::FISCAL_YEAR_START_DECEMBER, self::FISCAL_YEAR_START_FEBRUARY, + self::FISCAL_YEAR_START_JANUARY, + self::FISCAL_YEAR_START_JULY, + self::FISCAL_YEAR_START_JUNE, self::FISCAL_YEAR_START_MARCH, - self::FISCAL_YEAR_START_APRIL, self::FISCAL_YEAR_START_MAY, - self::FISCAL_YEAR_START_JUNE, - self::FISCAL_YEAR_START_JULY, - self::FISCAL_YEAR_START_AUGUST, - self::FISCAL_YEAR_START_SEPTEMBER, - self::FISCAL_YEAR_START_OCTOBER, self::FISCAL_YEAR_START_NOVEMBER, - self::FISCAL_YEAR_START_DECEMBER, + self::FISCAL_YEAR_START_OCTOBER, + self::FISCAL_YEAR_START_SEPTEMBER, ]; } @@ -437,31 +438,34 @@ public function __construct(?array $data = null) { $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); $this->setIfExists('operation_type', $data ?? [], null); - $this->setIfExists('value', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); $this->setIfExists('requires_time_zone_conversion', $data ?? [], null); $this->setIfExists('timestamp', $data ?? [], null); - $this->setIfExists('upper_bound', $data ?? [], null); $this->setIfExists('lower_bound', $data ?? [], null); - $this->setIfExists('default_comparison_value', $data ?? [], null); + $this->setIfExists('upper_bound', $data ?? [], null); $this->setIfExists('comparison_property_name', $data ?? [], null); + $this->setIfExists('default_comparison_value', $data ?? [], null); $this->setIfExists('number_of_days', $data ?? [], null); $this->setIfExists('values', $data ?? [], null); + $this->setIfExists('day', $data ?? [], null); $this->setIfExists('month', $data ?? [], null); $this->setIfExists('year', $data ?? [], null); - $this->setIfExists('day', $data ?? [], null); - $this->setIfExists('use_fiscal_year', $data ?? [], null); $this->setIfExists('fiscal_year_start', $data ?? [], null); - $this->setIfExists('time_unit_count', $data ?? [], null); $this->setIfExists('time_unit', $data ?? [], null); + $this->setIfExists('time_unit_count', $data ?? [], null); + $this->setIfExists('use_fiscal_year', $data ?? [], null); $this->setIfExists('endpoint_behavior', $data ?? [], null); $this->setIfExists('property_parser', $data ?? [], null); $this->setIfExists('time_point', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); - $this->setIfExists('upper_bound_endpoint_behavior', $data ?? [], null); - $this->setIfExists('upper_bound_time_point', $data ?? [], null); $this->setIfExists('lower_bound_endpoint_behavior', $data ?? [], null); $this->setIfExists('lower_bound_time_point', $data ?? [], null); + $this->setIfExists('upper_bound_endpoint_behavior', $data ?? [], null); + $this->setIfExists('upper_bound_time_point', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['operation_type'] = static::$openAPIModelName; } /** @@ -497,24 +501,24 @@ public function listInvalidProperties() if ($this->container['operation_type'] === null) { $invalidProperties[] = "'operation_type' can't be null"; } - if ($this->container['value'] === null) { - $invalidProperties[] = "'value' can't be null"; - } if ($this->container['operator'] === null) { $invalidProperties[] = "'operator' can't be null"; } + if ($this->container['value'] === null) { + $invalidProperties[] = "'value' can't be null"; + } if ($this->container['requires_time_zone_conversion'] === null) { $invalidProperties[] = "'requires_time_zone_conversion' can't be null"; } if ($this->container['timestamp'] === null) { $invalidProperties[] = "'timestamp' can't be null"; } - if ($this->container['upper_bound'] === null) { - $invalidProperties[] = "'upper_bound' can't be null"; - } if ($this->container['lower_bound'] === null) { $invalidProperties[] = "'lower_bound' can't be null"; } + if ($this->container['upper_bound'] === null) { + $invalidProperties[] = "'upper_bound' can't be null"; + } if ($this->container['comparison_property_name'] === null) { $invalidProperties[] = "'comparison_property_name' can't be null"; } @@ -524,15 +528,15 @@ public function listInvalidProperties() if ($this->container['values'] === null) { $invalidProperties[] = "'values' can't be null"; } + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } if ($this->container['month'] === null) { $invalidProperties[] = "'month' can't be null"; } if ($this->container['year'] === null) { $invalidProperties[] = "'year' can't be null"; } - if ($this->container['day'] === null) { - $invalidProperties[] = "'day' can't be null"; - } $allowedValues = $this->getFiscalYearStartAllowableValues(); if (!is_null($this->container['fiscal_year_start']) && !in_array($this->container['fiscal_year_start'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -551,12 +555,12 @@ public function listInvalidProperties() if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - if ($this->container['upper_bound_time_point'] === null) { - $invalidProperties[] = "'upper_bound_time_point' can't be null"; - } if ($this->container['lower_bound_time_point'] === null) { $invalidProperties[] = "'lower_bound_time_point' can't be null"; } + if ($this->container['upper_bound_time_point'] === null) { + $invalidProperties[] = "'upper_bound_time_point' can't be null"; + } return $invalidProperties; } @@ -585,7 +589,7 @@ public function getIncludeObjectsWithNoValueSet() /** * Sets include_objects_with_no_value_set * - * @param bool $include_objects_with_no_value_set include_objects_with_no_value_set + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. * * @return self */ @@ -612,7 +616,7 @@ public function getOperationType() /** * Sets operation_type * - * @param string $operation_type operation_type + * @param string $operation_type Specifies the type of operation (TIME_RANGED). * * @return self */ @@ -627,55 +631,55 @@ public function setOperationType($operation_type) } /** - * Gets value + * Gets operator * * @return string */ - public function getValue() + public function getOperator() { - return $this->container['value']; + return $this->container['operator']; } /** - * Sets value + * Sets operator * - * @param string $value value + * @param string $operator Defines the operation to be applied within the time range (IS_BETWEEN, IS_NOT_BETWEEN). * * @return self */ - public function setValue($value) + public function setOperator($operator) { - if (is_null($value)) { - throw new \InvalidArgumentException('non-nullable value cannot be null'); + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); } - $this->container['value'] = $value; + $this->container['operator'] = $operator; return $this; } /** - * Gets operator + * Gets value * * @return string */ - public function getOperator() + public function getValue() { - return $this->container['operator']; + return $this->container['value']; } /** - * Sets operator + * Sets value * - * @param string $operator operator + * @param string $value The string value to be used in the operation. * * @return self */ - public function setOperator($operator) + public function setValue($value) { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); + if (is_null($value)) { + throw new \InvalidArgumentException('non-nullable value cannot be null'); } - $this->container['operator'] = $operator; + $this->container['value'] = $value; return $this; } @@ -693,7 +697,7 @@ public function getRequiresTimeZoneConversion() /** * Sets requires_time_zone_conversion * - * @param bool $requires_time_zone_conversion requires_time_zone_conversion + * @param bool $requires_time_zone_conversion Specifies whether the operation requires conversion to a different time zone. * * @return self */ @@ -720,7 +724,7 @@ public function getTimestamp() /** * Sets timestamp * - * @param int $timestamp timestamp + * @param int $timestamp The specific point in time used in the operation. * * @return self */ @@ -735,109 +739,109 @@ public function setTimestamp($timestamp) } /** - * Gets upper_bound + * Gets lower_bound * * @return int */ - public function getUpperBound() + public function getLowerBound() { - return $this->container['upper_bound']; + return $this->container['lower_bound']; } /** - * Sets upper_bound + * Sets lower_bound * - * @param int $upper_bound upper_bound + * @param int $lower_bound The lower limit of the number range for the operation. * * @return self */ - public function setUpperBound($upper_bound) + public function setLowerBound($lower_bound) { - if (is_null($upper_bound)) { - throw new \InvalidArgumentException('non-nullable upper_bound cannot be null'); + if (is_null($lower_bound)) { + throw new \InvalidArgumentException('non-nullable lower_bound cannot be null'); } - $this->container['upper_bound'] = $upper_bound; + $this->container['lower_bound'] = $lower_bound; return $this; } /** - * Gets lower_bound + * Gets upper_bound * * @return int */ - public function getLowerBound() + public function getUpperBound() { - return $this->container['lower_bound']; + return $this->container['upper_bound']; } /** - * Sets lower_bound + * Sets upper_bound * - * @param int $lower_bound lower_bound + * @param int $upper_bound The upper limit of the number range for the operation. * * @return self */ - public function setLowerBound($lower_bound) + public function setUpperBound($upper_bound) { - if (is_null($lower_bound)) { - throw new \InvalidArgumentException('non-nullable lower_bound cannot be null'); + if (is_null($upper_bound)) { + throw new \InvalidArgumentException('non-nullable upper_bound cannot be null'); } - $this->container['lower_bound'] = $lower_bound; + $this->container['upper_bound'] = $upper_bound; return $this; } /** - * Gets default_comparison_value + * Gets comparison_property_name * - * @return string|null + * @return string */ - public function getDefaultComparisonValue() + public function getComparisonPropertyName() { - return $this->container['default_comparison_value']; + return $this->container['comparison_property_name']; } /** - * Sets default_comparison_value + * Sets comparison_property_name * - * @param string|null $default_comparison_value default_comparison_value + * @param string $comparison_property_name The name of the property to compare against in the operation. * * @return self */ - public function setDefaultComparisonValue($default_comparison_value) + public function setComparisonPropertyName($comparison_property_name) { - if (is_null($default_comparison_value)) { - throw new \InvalidArgumentException('non-nullable default_comparison_value cannot be null'); + if (is_null($comparison_property_name)) { + throw new \InvalidArgumentException('non-nullable comparison_property_name cannot be null'); } - $this->container['default_comparison_value'] = $default_comparison_value; + $this->container['comparison_property_name'] = $comparison_property_name; return $this; } /** - * Gets comparison_property_name + * Gets default_comparison_value * - * @return string + * @return string|null */ - public function getComparisonPropertyName() + public function getDefaultComparisonValue() { - return $this->container['comparison_property_name']; + return $this->container['default_comparison_value']; } /** - * Sets comparison_property_name + * Sets default_comparison_value * - * @param string $comparison_property_name comparison_property_name + * @param string|null $default_comparison_value The default value used for comparison if the actual comparison property value is not set. * * @return self */ - public function setComparisonPropertyName($comparison_property_name) + public function setDefaultComparisonValue($default_comparison_value) { - if (is_null($comparison_property_name)) { - throw new \InvalidArgumentException('non-nullable comparison_property_name cannot be null'); + if (is_null($default_comparison_value)) { + throw new \InvalidArgumentException('non-nullable default_comparison_value cannot be null'); } - $this->container['comparison_property_name'] = $comparison_property_name; + $this->container['default_comparison_value'] = $default_comparison_value; return $this; } @@ -855,7 +859,7 @@ public function getNumberOfDays() /** * Sets number_of_days * - * @param int $number_of_days number_of_days + * @param int $number_of_days The number of days to be considered in the rolling property updated operation. * * @return self */ @@ -897,109 +901,82 @@ public function setValues($values) } /** - * Gets month - * - * @return string - */ - public function getMonth() - { - return $this->container['month']; - } - - /** - * Sets month - * - * @param string $month month - * - * @return self - */ - public function setMonth($month) - { - if (is_null($month)) { - throw new \InvalidArgumentException('non-nullable month cannot be null'); - } - $this->container['month'] = $month; - - return $this; - } - - /** - * Gets year + * Gets day * * @return int */ - public function getYear() + public function getDay() { - return $this->container['year']; + return $this->container['day']; } /** - * Sets year + * Sets day * - * @param int $year year + * @param int $day The day of the month for the date operation. * * @return self */ - public function setYear($year) + public function setDay($day) { - if (is_null($year)) { - throw new \InvalidArgumentException('non-nullable year cannot be null'); + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); } - $this->container['year'] = $year; + $this->container['day'] = $day; return $this; } /** - * Gets day + * Gets month * - * @return int + * @return string */ - public function getDay() + public function getMonth() { - return $this->container['day']; + return $this->container['month']; } /** - * Sets day + * Sets month * - * @param int $day day + * @param string $month The month for the date operation. * * @return self */ - public function setDay($day) + public function setMonth($month) { - if (is_null($day)) { - throw new \InvalidArgumentException('non-nullable day cannot be null'); + if (is_null($month)) { + throw new \InvalidArgumentException('non-nullable month cannot be null'); } - $this->container['day'] = $day; + $this->container['month'] = $month; return $this; } /** - * Gets use_fiscal_year + * Gets year * - * @return bool|null + * @return int */ - public function getUseFiscalYear() + public function getYear() { - return $this->container['use_fiscal_year']; + return $this->container['year']; } /** - * Sets use_fiscal_year + * Sets year * - * @param bool|null $use_fiscal_year use_fiscal_year + * @param int $year The year for the date operation. * * @return self */ - public function setUseFiscalYear($use_fiscal_year) + public function setYear($year) { - if (is_null($use_fiscal_year)) { - throw new \InvalidArgumentException('non-nullable use_fiscal_year cannot be null'); + if (is_null($year)) { + throw new \InvalidArgumentException('non-nullable year cannot be null'); } - $this->container['use_fiscal_year'] = $use_fiscal_year; + $this->container['year'] = $year; return $this; } @@ -1017,7 +994,7 @@ public function getFiscalYearStart() /** * Sets fiscal_year_start * - * @param string|null $fiscal_year_start fiscal_year_start + * @param string|null $fiscal_year_start The month in which the fiscal year starts. * * @return self */ @@ -1041,6 +1018,33 @@ public function setFiscalYearStart($fiscal_year_start) return $this; } + /** + * Gets time_unit + * + * @return string + */ + public function getTimeUnit() + { + return $this->container['time_unit']; + } + + /** + * Sets time_unit + * + * @param string $time_unit The unit of time to be used in the operation (DAY, WEEK, MONTH, QUARTER, YEAR). + * + * @return self + */ + public function setTimeUnit($time_unit) + { + if (is_null($time_unit)) { + throw new \InvalidArgumentException('non-nullable time_unit cannot be null'); + } + $this->container['time_unit'] = $time_unit; + + return $this; + } + /** * Gets time_unit_count * @@ -1054,7 +1058,7 @@ public function getTimeUnitCount() /** * Sets time_unit_count * - * @param int|null $time_unit_count time_unit_count + * @param int|null $time_unit_count The count of time units to be applied in the operation (1). * * @return self */ @@ -1069,28 +1073,28 @@ public function setTimeUnitCount($time_unit_count) } /** - * Gets time_unit + * Gets use_fiscal_year * - * @return string + * @return bool|null */ - public function getTimeUnit() + public function getUseFiscalYear() { - return $this->container['time_unit']; + return $this->container['use_fiscal_year']; } /** - * Sets time_unit + * Sets use_fiscal_year * - * @param string $time_unit time_unit + * @param bool|null $use_fiscal_year Specifies whether the fiscal year should be used in the operation. * * @return self */ - public function setTimeUnit($time_unit) + public function setUseFiscalYear($use_fiscal_year) { - if (is_null($time_unit)) { - throw new \InvalidArgumentException('non-nullable time_unit cannot be null'); + if (is_null($use_fiscal_year)) { + throw new \InvalidArgumentException('non-nullable use_fiscal_year cannot be null'); } - $this->container['time_unit'] = $time_unit; + $this->container['use_fiscal_year'] = $use_fiscal_year; return $this; } @@ -1108,7 +1112,7 @@ public function getEndpointBehavior() /** * Sets endpoint_behavior * - * @param string|null $endpoint_behavior endpoint_behavior + * @param string|null $endpoint_behavior Describes the behavior at the endpoint of the time point operation. * * @return self */ @@ -1135,7 +1139,7 @@ public function getPropertyParser() /** * Sets property_parser * - * @param string|null $property_parser property_parser + * @param string|null $property_parser Specifies the parser used for the property in the operation. * * @return self */ @@ -1189,7 +1193,7 @@ public function getType() /** * Sets type * - * @param string $type type + * @param string $type Defines the type of operation being performed. * * @return self */ @@ -1204,120 +1208,120 @@ public function setType($type) } /** - * Gets upper_bound_endpoint_behavior + * Gets lower_bound_endpoint_behavior * * @return string|null */ - public function getUpperBoundEndpointBehavior() + public function getLowerBoundEndpointBehavior() { - return $this->container['upper_bound_endpoint_behavior']; + return $this->container['lower_bound_endpoint_behavior']; } /** - * Sets upper_bound_endpoint_behavior + * Sets lower_bound_endpoint_behavior * - * @param string|null $upper_bound_endpoint_behavior upper_bound_endpoint_behavior + * @param string|null $lower_bound_endpoint_behavior Describes the behavior at the lower bound endpoint of the time range. * * @return self */ - public function setUpperBoundEndpointBehavior($upper_bound_endpoint_behavior) + public function setLowerBoundEndpointBehavior($lower_bound_endpoint_behavior) { - if (is_null($upper_bound_endpoint_behavior)) { - throw new \InvalidArgumentException('non-nullable upper_bound_endpoint_behavior cannot be null'); + if (is_null($lower_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable lower_bound_endpoint_behavior cannot be null'); } - $this->container['upper_bound_endpoint_behavior'] = $upper_bound_endpoint_behavior; + $this->container['lower_bound_endpoint_behavior'] = $lower_bound_endpoint_behavior; return $this; } /** - * Gets upper_bound_time_point + * Gets lower_bound_time_point * - * @return \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint */ - public function getUpperBoundTimePoint() + public function getLowerBoundTimePoint() { - return $this->container['upper_bound_time_point']; + return $this->container['lower_bound_time_point']; } /** - * Sets upper_bound_time_point + * Sets lower_bound_time_point * - * @param \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint $upper_bound_time_point upper_bound_time_point + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationLowerBoundTimePoint $lower_bound_time_point lower_bound_time_point * * @return self */ - public function setUpperBoundTimePoint($upper_bound_time_point) + public function setLowerBoundTimePoint($lower_bound_time_point) { - if (is_null($upper_bound_time_point)) { - throw new \InvalidArgumentException('non-nullable upper_bound_time_point cannot be null'); + if (is_null($lower_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable lower_bound_time_point cannot be null'); } - $this->container['upper_bound_time_point'] = $upper_bound_time_point; + $this->container['lower_bound_time_point'] = $lower_bound_time_point; return $this; } /** - * Gets lower_bound_endpoint_behavior + * Gets upper_bound_endpoint_behavior * * @return string|null */ - public function getLowerBoundEndpointBehavior() + public function getUpperBoundEndpointBehavior() { - return $this->container['lower_bound_endpoint_behavior']; + return $this->container['upper_bound_endpoint_behavior']; } /** - * Sets lower_bound_endpoint_behavior + * Sets upper_bound_endpoint_behavior * - * @param string|null $lower_bound_endpoint_behavior lower_bound_endpoint_behavior + * @param string|null $upper_bound_endpoint_behavior Describes the behavior at the upper bound endpoint of the time range. * * @return self */ - public function setLowerBoundEndpointBehavior($lower_bound_endpoint_behavior) + public function setUpperBoundEndpointBehavior($upper_bound_endpoint_behavior) { - if (is_null($lower_bound_endpoint_behavior)) { - throw new \InvalidArgumentException('non-nullable lower_bound_endpoint_behavior cannot be null'); + if (is_null($upper_bound_endpoint_behavior)) { + throw new \InvalidArgumentException('non-nullable upper_bound_endpoint_behavior cannot be null'); } - $this->container['lower_bound_endpoint_behavior'] = $lower_bound_endpoint_behavior; + $this->container['upper_bound_endpoint_behavior'] = $upper_bound_endpoint_behavior; return $this; } /** - * Gets lower_bound_time_point + * Gets upper_bound_time_point * - * @return \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint + * @return \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint */ - public function getLowerBoundTimePoint() + public function getUpperBoundTimePoint() { - return $this->container['lower_bound_time_point']; + return $this->container['upper_bound_time_point']; } /** - * Sets lower_bound_time_point + * Sets upper_bound_time_point * - * @param \HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint $lower_bound_time_point lower_bound_time_point + * @param \HubSpot\Client\Crm\Lists\Model\PublicRangedTimeOperationUpperBoundTimePoint $upper_bound_time_point upper_bound_time_point * * @return self */ - public function setLowerBoundTimePoint($lower_bound_time_point) + public function setUpperBoundTimePoint($upper_bound_time_point) { - if (is_null($lower_bound_time_point)) { - throw new \InvalidArgumentException('non-nullable lower_bound_time_point cannot be null'); + if (is_null($upper_bound_time_point)) { + throw new \InvalidArgumentException('non-nullable upper_bound_time_point cannot be null'); } - $this->container['lower_bound_time_point'] = $lower_bound_time_point; + $this->container['upper_bound_time_point'] = $upper_bound_time_point; 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]); } @@ -1325,12 +1329,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; } @@ -1355,11 +1359,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/Lists/Model/PublicTimeOffset.php b/codegen/Crm/Lists/Model/PublicTimeOffset.php index 656d1c143..ccc446889 100644 --- a/codegen/Crm/Lists/Model/PublicTimeOffset.php +++ b/codegen/Crm/Lists/Model/PublicTimeOffset.php @@ -2,7 +2,7 @@ /** * PublicTimeOffset * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -325,7 +325,7 @@ public function getAmount() /** * Sets amount * - * @param int $amount amount + * @param int $amount The numerical value representing the quantity of the time offset. * * @return self */ @@ -352,7 +352,7 @@ public function getOffsetDirection() /** * Sets offset_direction * - * @param string $offset_direction offset_direction + * @param string $offset_direction Indicates the direction of the time offset, such as forward or backward. * * @return self */ @@ -379,7 +379,7 @@ public function getTimeUnit() /** * Sets time_unit * - * @param string $time_unit time_unit + * @param string $time_unit Specifies the unit of time for the offset, such as days, hours, or minutes. * * @return self */ @@ -395,11 +395,11 @@ public function setTimeUnit($time_unit) /** * 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 +407,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 +437,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/Lists/Model/PublicTimePointOperation.php b/codegen/Crm/Lists/Model/PublicTimePointOperation.php index a21b877a2..d63bc8f13 100644 --- a/codegen/Crm/Lists/Model/PublicTimePointOperation.php +++ b/codegen/Crm/Lists/Model/PublicTimePointOperation.php @@ -2,7 +2,7 @@ /** * PublicTimePointOperation * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -59,11 +59,11 @@ class PublicTimePointOperation implements ModelInterface, ArrayAccess, \JsonSeri protected static $openAPITypes = [ 'endpoint_behavior' => 'string', 'include_objects_with_no_value_set' => 'bool', - 'property_parser' => 'string', 'operation_type' => 'string', + 'operator' => 'string', + 'property_parser' => 'string', 'time_point' => '\HubSpot\Client\Crm\Lists\Model\PublicTimePointOperationTimePoint', - 'type' => 'string', - 'operator' => 'string' + 'type' => 'string' ]; /** @@ -76,11 +76,11 @@ class PublicTimePointOperation implements ModelInterface, ArrayAccess, \JsonSeri protected static $openAPIFormats = [ 'endpoint_behavior' => null, 'include_objects_with_no_value_set' => null, - 'property_parser' => null, 'operation_type' => null, + 'operator' => null, + 'property_parser' => null, 'time_point' => null, - 'type' => null, - 'operator' => null + 'type' => null ]; /** @@ -91,11 +91,11 @@ class PublicTimePointOperation implements ModelInterface, ArrayAccess, \JsonSeri protected static array $openAPINullables = [ 'endpoint_behavior' => false, 'include_objects_with_no_value_set' => false, - 'property_parser' => false, 'operation_type' => false, + 'operator' => false, + 'property_parser' => false, 'time_point' => false, - 'type' => false, - 'operator' => false + 'type' => false ]; /** @@ -186,11 +186,11 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'endpoint_behavior' => 'endpointBehavior', 'include_objects_with_no_value_set' => 'includeObjectsWithNoValueSet', - 'property_parser' => 'propertyParser', 'operation_type' => 'operationType', + 'operator' => 'operator', + 'property_parser' => 'propertyParser', 'time_point' => 'timePoint', - 'type' => 'type', - 'operator' => 'operator' + 'type' => 'type' ]; /** @@ -201,11 +201,11 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'endpoint_behavior' => 'setEndpointBehavior', 'include_objects_with_no_value_set' => 'setIncludeObjectsWithNoValueSet', - 'property_parser' => 'setPropertyParser', 'operation_type' => 'setOperationType', + 'operator' => 'setOperator', + 'property_parser' => 'setPropertyParser', 'time_point' => 'setTimePoint', - 'type' => 'setType', - 'operator' => 'setOperator' + 'type' => 'setType' ]; /** @@ -216,11 +216,11 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'endpoint_behavior' => 'getEndpointBehavior', 'include_objects_with_no_value_set' => 'getIncludeObjectsWithNoValueSet', - 'property_parser' => 'getPropertyParser', 'operation_type' => 'getOperationType', + 'operator' => 'getOperator', + 'property_parser' => 'getPropertyParser', 'time_point' => 'getTimePoint', - 'type' => 'getType', - 'operator' => 'getOperator' + 'type' => 'getType' ]; /** @@ -295,11 +295,11 @@ public function __construct(?array $data = null) { $this->setIfExists('endpoint_behavior', $data ?? [], null); $this->setIfExists('include_objects_with_no_value_set', $data ?? [], null); - $this->setIfExists('property_parser', $data ?? [], null); $this->setIfExists('operation_type', $data ?? [], 'TIME_POINT'); + $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('property_parser', $data ?? [], null); $this->setIfExists('time_point', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); - $this->setIfExists('operator', $data ?? [], null); } /** @@ -344,15 +344,15 @@ public function listInvalidProperties() ); } + if ($this->container['operator'] === null) { + $invalidProperties[] = "'operator' can't be null"; + } if ($this->container['time_point'] === null) { $invalidProperties[] = "'time_point' can't be null"; } if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } - if ($this->container['operator'] === null) { - $invalidProperties[] = "'operator' can't be null"; - } return $invalidProperties; } @@ -381,7 +381,7 @@ public function getEndpointBehavior() /** * Sets endpoint_behavior * - * @param string|null $endpoint_behavior endpoint_behavior + * @param string|null $endpoint_behavior Describes the behavior at the endpoint of the time point operation. * * @return self */ @@ -408,7 +408,7 @@ public function getIncludeObjectsWithNoValueSet() /** * Sets include_objects_with_no_value_set * - * @param bool $include_objects_with_no_value_set include_objects_with_no_value_set + * @param bool $include_objects_with_no_value_set Indicates whether objects with no value set for the property should be included in the operation. * * @return self */ @@ -422,33 +422,6 @@ public function setIncludeObjectsWithNoValueSet($include_objects_with_no_value_s return $this; } - /** - * Gets property_parser - * - * @return string|null - */ - public function getPropertyParser() - { - return $this->container['property_parser']; - } - - /** - * Sets property_parser - * - * @param string|null $property_parser property_parser - * - * @return self - */ - public function setPropertyParser($property_parser) - { - if (is_null($property_parser)) { - throw new \InvalidArgumentException('non-nullable property_parser cannot be null'); - } - $this->container['property_parser'] = $property_parser; - - return $this; - } - /** * Gets operation_type * @@ -462,7 +435,7 @@ public function getOperationType() /** * Sets operation_type * - * @param string $operation_type operation_type + * @param string $operation_type Specifies the type of operation (TIME_POINT). * * @return self */ @@ -486,6 +459,60 @@ public function setOperationType($operation_type) return $this; } + /** + * Gets operator + * + * @return string + */ + public function getOperator() + { + return $this->container['operator']; + } + + /** + * Sets operator + * + * @param string $operator Specifies the operation to be applied within the time point operation (IS_BEFORE, IS_AFTER). + * + * @return self + */ + public function setOperator($operator) + { + if (is_null($operator)) { + throw new \InvalidArgumentException('non-nullable operator cannot be null'); + } + $this->container['operator'] = $operator; + + return $this; + } + + /** + * Gets property_parser + * + * @return string|null + */ + public function getPropertyParser() + { + return $this->container['property_parser']; + } + + /** + * Sets property_parser + * + * @param string|null $property_parser Specifies the parser used for interpreting the property in the operation. + * + * @return self + */ + public function setPropertyParser($property_parser) + { + if (is_null($property_parser)) { + throw new \InvalidArgumentException('non-nullable property_parser cannot be null'); + } + $this->container['property_parser'] = $property_parser; + + return $this; + } + /** * Gets time_point * @@ -526,7 +553,7 @@ public function getType() /** * Sets type * - * @param string $type type + * @param string $type Defines the type of operation being performed. * * @return self */ @@ -539,41 +566,14 @@ public function setType($type) return $this; } - - /** - * Gets operator - * - * @return string - */ - public function getOperator() - { - return $this->container['operator']; - } - - /** - * Sets operator - * - * @param string $operator operator - * - * @return self - */ - public function setOperator($operator) - { - if (is_null($operator)) { - throw new \InvalidArgumentException('non-nullable operator cannot be null'); - } - $this->container['operator'] = $operator; - - 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]); } @@ -581,12 +581,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; } @@ -611,11 +611,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/Lists/Model/PublicTimePointOperationTimePoint.php b/codegen/Crm/Lists/Model/PublicTimePointOperationTimePoint.php index be89c62af..8d8f323b6 100644 --- a/codegen/Crm/Lists/Model/PublicTimePointOperationTimePoint.php +++ b/codegen/Crm/Lists/Model/PublicTimePointOperationTimePoint.php @@ -2,7 +2,7 @@ /** * PublicTimePointOperationTimePoint * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * PublicTimePointOperationTimePoint Class Doc Comment * * @category Class + * @description Defines the specific point in time for the operation, which can be a date, indexed time, or property-referenced time. * @package HubSpot\Client\Crm\Lists * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -42,7 +43,7 @@ */ class PublicTimePointOperationTimePoint implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = null; + public const DISCRIMINATOR = 'time_type'; /** * The original name of the model. @@ -57,18 +58,18 @@ class PublicTimePointOperationTimePoint implements ModelInterface, ArrayAccess, * @var string[] */ protected static $openAPITypes = [ - 'month' => 'int', + 'day' => 'int', 'hour' => 'int', - 'year' => 'int', - 'timezone_source' => 'string', 'millisecond' => 'int', - 'time_type' => 'string', - 'zone_id' => 'string', - 'day' => 'int', 'minute' => 'int', + 'month' => 'int', 'second' => 'int', - 'offset' => '\HubSpot\Client\Crm\Lists\Model\PublicIndexOffset', + 'time_type' => 'string', + 'timezone_source' => 'string', + 'year' => 'int', + 'zone_id' => 'string', 'index_reference' => '\HubSpot\Client\Crm\Lists\Model\PublicIndexedTimePointIndexReference', + 'offset' => '\HubSpot\Client\Crm\Lists\Model\PublicIndexOffset', 'property' => 'string', 'reference_type' => 'string' ]; @@ -81,18 +82,18 @@ class PublicTimePointOperationTimePoint implements ModelInterface, ArrayAccess, * @psalm-var array */ protected static $openAPIFormats = [ - 'month' => 'int32', + 'day' => 'int32', 'hour' => 'int32', - 'year' => 'int32', - 'timezone_source' => null, 'millisecond' => 'int32', - 'time_type' => null, - 'zone_id' => null, - 'day' => 'int32', 'minute' => 'int32', + 'month' => 'int32', 'second' => 'int32', - 'offset' => null, + 'time_type' => null, + 'timezone_source' => null, + 'year' => 'int32', + 'zone_id' => null, 'index_reference' => null, + 'offset' => null, 'property' => null, 'reference_type' => null ]; @@ -103,18 +104,18 @@ class PublicTimePointOperationTimePoint implements ModelInterface, ArrayAccess, * @var boolean[] */ protected static array $openAPINullables = [ - 'month' => false, + 'day' => false, 'hour' => false, - 'year' => false, - 'timezone_source' => false, 'millisecond' => false, - 'time_type' => false, - 'zone_id' => false, - 'day' => false, 'minute' => false, + 'month' => false, 'second' => false, - 'offset' => false, + 'time_type' => false, + 'timezone_source' => false, + 'year' => false, + 'zone_id' => false, 'index_reference' => false, + 'offset' => false, 'property' => false, 'reference_type' => false ]; @@ -205,18 +206,18 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'month' => 'month', + 'day' => 'day', 'hour' => 'hour', - 'year' => 'year', - 'timezone_source' => 'timezoneSource', 'millisecond' => 'millisecond', - 'time_type' => 'timeType', - 'zone_id' => 'zoneId', - 'day' => 'day', 'minute' => 'minute', + 'month' => 'month', 'second' => 'second', - 'offset' => 'offset', + 'time_type' => 'timeType', + 'timezone_source' => 'timezoneSource', + 'year' => 'year', + 'zone_id' => 'zoneId', 'index_reference' => 'indexReference', + 'offset' => 'offset', 'property' => 'property', 'reference_type' => 'referenceType' ]; @@ -227,18 +228,18 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'month' => 'setMonth', + 'day' => 'setDay', 'hour' => 'setHour', - 'year' => 'setYear', - 'timezone_source' => 'setTimezoneSource', 'millisecond' => 'setMillisecond', - 'time_type' => 'setTimeType', - 'zone_id' => 'setZoneId', - 'day' => 'setDay', 'minute' => 'setMinute', + 'month' => 'setMonth', 'second' => 'setSecond', - 'offset' => 'setOffset', + 'time_type' => 'setTimeType', + 'timezone_source' => 'setTimezoneSource', + 'year' => 'setYear', + 'zone_id' => 'setZoneId', 'index_reference' => 'setIndexReference', + 'offset' => 'setOffset', 'property' => 'setProperty', 'reference_type' => 'setReferenceType' ]; @@ -249,18 +250,18 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'month' => 'getMonth', + 'day' => 'getDay', 'hour' => 'getHour', - 'year' => 'getYear', - 'timezone_source' => 'getTimezoneSource', 'millisecond' => 'getMillisecond', - 'time_type' => 'getTimeType', - 'zone_id' => 'getZoneId', - 'day' => 'getDay', 'minute' => 'getMinute', + 'month' => 'getMonth', 'second' => 'getSecond', - 'offset' => 'getOffset', + 'time_type' => 'getTimeType', + 'timezone_source' => 'getTimezoneSource', + 'year' => 'getYear', + 'zone_id' => 'getZoneId', 'index_reference' => 'getIndexReference', + 'offset' => 'getOffset', 'property' => 'getProperty', 'reference_type' => 'getReferenceType' ]; @@ -335,20 +336,23 @@ public function getTimeTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('month', $data ?? [], null); + $this->setIfExists('day', $data ?? [], null); $this->setIfExists('hour', $data ?? [], null); - $this->setIfExists('year', $data ?? [], null); - $this->setIfExists('timezone_source', $data ?? [], null); $this->setIfExists('millisecond', $data ?? [], null); - $this->setIfExists('time_type', $data ?? [], 'PROPERTY_REFERENCED'); - $this->setIfExists('zone_id', $data ?? [], null); - $this->setIfExists('day', $data ?? [], null); $this->setIfExists('minute', $data ?? [], null); + $this->setIfExists('month', $data ?? [], null); $this->setIfExists('second', $data ?? [], null); - $this->setIfExists('offset', $data ?? [], null); + $this->setIfExists('time_type', $data ?? [], 'PROPERTY_REFERENCED'); + $this->setIfExists('timezone_source', $data ?? [], null); + $this->setIfExists('year', $data ?? [], null); + $this->setIfExists('zone_id', $data ?? [], null); $this->setIfExists('index_reference', $data ?? [], null); + $this->setIfExists('offset', $data ?? [], null); $this->setIfExists('property', $data ?? [], null); $this->setIfExists('reference_type', $data ?? [], null); + + // Initialize discriminator property with the model name. + $this->container['time_type'] = static::$openAPIModelName; } /** @@ -378,12 +382,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } if ($this->container['month'] === null) { $invalidProperties[] = "'month' can't be null"; } - if ($this->container['year'] === null) { - $invalidProperties[] = "'year' can't be null"; - } if ($this->container['time_type'] === null) { $invalidProperties[] = "'time_type' can't be null"; } @@ -396,12 +400,12 @@ public function listInvalidProperties() ); } + if ($this->container['year'] === null) { + $invalidProperties[] = "'year' can't be null"; + } if ($this->container['zone_id'] === null) { $invalidProperties[] = "'zone_id' can't be null"; } - if ($this->container['day'] === null) { - $invalidProperties[] = "'day' can't be null"; - } if ($this->container['index_reference'] === null) { $invalidProperties[] = "'index_reference' can't be null"; } @@ -427,28 +431,28 @@ public function valid() /** - * Gets month + * Gets day * * @return int */ - public function getMonth() + public function getDay() { - return $this->container['month']; + return $this->container['day']; } /** - * Sets month + * Sets day * - * @param int $month month + * @param int $day The day component of the date. * * @return self */ - public function setMonth($month) + public function setDay($day) { - if (is_null($month)) { - throw new \InvalidArgumentException('non-nullable month cannot be null'); + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); } - $this->container['month'] = $month; + $this->container['day'] = $day; return $this; } @@ -466,7 +470,7 @@ public function getHour() /** * Sets hour * - * @param int|null $hour hour + * @param int|null $hour The hour component of the time. * * @return self */ @@ -481,82 +485,109 @@ public function setHour($hour) } /** - * Gets year + * Gets millisecond * - * @return int + * @return int|null */ - public function getYear() + public function getMillisecond() { - return $this->container['year']; + return $this->container['millisecond']; } /** - * Sets year + * Sets millisecond * - * @param int $year year + * @param int|null $millisecond The millisecond component of the time. * * @return self */ - public function setYear($year) + public function setMillisecond($millisecond) { - if (is_null($year)) { - throw new \InvalidArgumentException('non-nullable year cannot be null'); + if (is_null($millisecond)) { + throw new \InvalidArgumentException('non-nullable millisecond cannot be null'); } - $this->container['year'] = $year; + $this->container['millisecond'] = $millisecond; return $this; } /** - * Gets timezone_source + * Gets minute * - * @return string|null + * @return int|null */ - public function getTimezoneSource() + public function getMinute() { - return $this->container['timezone_source']; + return $this->container['minute']; } /** - * Sets timezone_source + * Sets minute * - * @param string|null $timezone_source timezone_source + * @param int|null $minute The minute component of the time. * * @return self */ - public function setTimezoneSource($timezone_source) + public function setMinute($minute) { - if (is_null($timezone_source)) { - throw new \InvalidArgumentException('non-nullable timezone_source cannot be null'); + if (is_null($minute)) { + throw new \InvalidArgumentException('non-nullable minute cannot be null'); } - $this->container['timezone_source'] = $timezone_source; + $this->container['minute'] = $minute; return $this; } /** - * Gets millisecond + * Gets month + * + * @return int + */ + public function getMonth() + { + return $this->container['month']; + } + + /** + * Sets month + * + * @param int $month The month component of the date. + * + * @return self + */ + public function setMonth($month) + { + if (is_null($month)) { + throw new \InvalidArgumentException('non-nullable month cannot be null'); + } + $this->container['month'] = $month; + + return $this; + } + + /** + * Gets second * * @return int|null */ - public function getMillisecond() + public function getSecond() { - return $this->container['millisecond']; + return $this->container['second']; } /** - * Sets millisecond + * Sets second * - * @param int|null $millisecond millisecond + * @param int|null $second The second component of the time. * * @return self */ - public function setMillisecond($millisecond) + public function setSecond($second) { - if (is_null($millisecond)) { - throw new \InvalidArgumentException('non-nullable millisecond cannot be null'); + if (is_null($second)) { + throw new \InvalidArgumentException('non-nullable second cannot be null'); } - $this->container['millisecond'] = $millisecond; + $this->container['second'] = $second; return $this; } @@ -574,7 +605,7 @@ public function getTimeType() /** * Sets time_type * - * @param string $time_type time_type + * @param string $time_type Defines the type of time (PROPERTY_REFERENCED). * * @return self */ @@ -599,109 +630,109 @@ public function setTimeType($time_type) } /** - * Gets zone_id + * Gets timezone_source * - * @return string + * @return string|null */ - public function getZoneId() + public function getTimezoneSource() { - return $this->container['zone_id']; + return $this->container['timezone_source']; } /** - * Sets zone_id + * Sets timezone_source * - * @param string $zone_id zone_id + * @param string|null $timezone_source Specifies the source of the time zone information for the property (CUSTOM, USER, PORTAL). * * @return self */ - public function setZoneId($zone_id) + public function setTimezoneSource($timezone_source) { - if (is_null($zone_id)) { - throw new \InvalidArgumentException('non-nullable zone_id cannot be null'); + if (is_null($timezone_source)) { + throw new \InvalidArgumentException('non-nullable timezone_source cannot be null'); } - $this->container['zone_id'] = $zone_id; + $this->container['timezone_source'] = $timezone_source; return $this; } /** - * Gets day + * Gets year * * @return int */ - public function getDay() + public function getYear() { - return $this->container['day']; + return $this->container['year']; } /** - * Sets day + * Sets year * - * @param int $day day + * @param int $year The year component of the date. * * @return self */ - public function setDay($day) + public function setYear($year) { - if (is_null($day)) { - throw new \InvalidArgumentException('non-nullable day cannot be null'); + if (is_null($year)) { + throw new \InvalidArgumentException('non-nullable year cannot be null'); } - $this->container['day'] = $day; + $this->container['year'] = $year; return $this; } /** - * Gets minute + * Gets zone_id * - * @return int|null + * @return string */ - public function getMinute() + public function getZoneId() { - return $this->container['minute']; + return $this->container['zone_id']; } /** - * Sets minute + * Sets zone_id * - * @param int|null $minute minute + * @param string $zone_id Indicates the identifier for the time zone associated with the property. * * @return self */ - public function setMinute($minute) + public function setZoneId($zone_id) { - if (is_null($minute)) { - throw new \InvalidArgumentException('non-nullable minute cannot be null'); + if (is_null($zone_id)) { + throw new \InvalidArgumentException('non-nullable zone_id cannot be null'); } - $this->container['minute'] = $minute; + $this->container['zone_id'] = $zone_id; return $this; } /** - * Gets second + * Gets index_reference * - * @return int|null + * @return \HubSpot\Client\Crm\Lists\Model\PublicIndexedTimePointIndexReference */ - public function getSecond() + public function getIndexReference() { - return $this->container['second']; + return $this->container['index_reference']; } /** - * Sets second + * Sets index_reference * - * @param int|null $second second + * @param \HubSpot\Client\Crm\Lists\Model\PublicIndexedTimePointIndexReference $index_reference index_reference * * @return self */ - public function setSecond($second) + public function setIndexReference($index_reference) { - if (is_null($second)) { - throw new \InvalidArgumentException('non-nullable second cannot be null'); + if (is_null($index_reference)) { + throw new \InvalidArgumentException('non-nullable index_reference cannot be null'); } - $this->container['second'] = $second; + $this->container['index_reference'] = $index_reference; return $this; } @@ -733,33 +764,6 @@ public function setOffset($offset) return $this; } - /** - * Gets index_reference - * - * @return \HubSpot\Client\Crm\Lists\Model\PublicIndexedTimePointIndexReference - */ - public function getIndexReference() - { - return $this->container['index_reference']; - } - - /** - * Sets index_reference - * - * @param \HubSpot\Client\Crm\Lists\Model\PublicIndexedTimePointIndexReference $index_reference index_reference - * - * @return self - */ - public function setIndexReference($index_reference) - { - if (is_null($index_reference)) { - throw new \InvalidArgumentException('non-nullable index_reference cannot be null'); - } - $this->container['index_reference'] = $index_reference; - - return $this; - } - /** * Gets property * @@ -773,7 +777,7 @@ public function getProperty() /** * Sets property * - * @param string $property property + * @param string $property Specifies the name of the property that the time reference is applied to. * * @return self */ @@ -800,7 +804,7 @@ public function getReferenceType() /** * Sets reference_type * - * @param string $reference_type reference_type + * @param string $reference_type Specifies the type of reference for the property (VALUE, UPDATED_AT, ANNIVERSARY, VALUE_WITH_ZONE_SAME_LOCAL_CONVERSION, ANNIVERSARY_WITH_ZONE_SAME_LOCAL_CONVERSION). * * @return self */ @@ -816,11 +820,11 @@ public function setReferenceType($reference_type) /** * 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]); } @@ -828,12 +832,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; } @@ -858,11 +862,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/Lists/Model/PublicTodayReference.php b/codegen/Crm/Lists/Model/PublicTodayReference.php index 2e14390c9..e150149ab 100644 --- a/codegen/Crm/Lists/Model/PublicTodayReference.php +++ b/codegen/Crm/Lists/Model/PublicTodayReference.php @@ -2,7 +2,7 @@ /** * PublicTodayReference * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -59,8 +59,8 @@ class PublicTodayReference implements ModelInterface, ArrayAccess, \JsonSerializ protected static $openAPITypes = [ 'hour' => 'int', 'millisecond' => 'int', - 'reference_type' => 'string', 'minute' => 'int', + 'reference_type' => 'string', 'second' => 'int' ]; @@ -74,8 +74,8 @@ class PublicTodayReference implements ModelInterface, ArrayAccess, \JsonSerializ protected static $openAPIFormats = [ 'hour' => 'int32', 'millisecond' => 'int32', - 'reference_type' => null, 'minute' => 'int32', + 'reference_type' => null, 'second' => 'int32' ]; @@ -87,8 +87,8 @@ class PublicTodayReference implements ModelInterface, ArrayAccess, \JsonSerializ protected static array $openAPINullables = [ 'hour' => false, 'millisecond' => false, - 'reference_type' => false, 'minute' => false, + 'reference_type' => false, 'second' => false ]; @@ -180,8 +180,8 @@ public function isNullableSetToNull(string $property): bool protected static $attributeMap = [ 'hour' => 'hour', 'millisecond' => 'millisecond', - 'reference_type' => 'referenceType', 'minute' => 'minute', + 'reference_type' => 'referenceType', 'second' => 'second' ]; @@ -193,8 +193,8 @@ public function isNullableSetToNull(string $property): bool protected static $setters = [ 'hour' => 'setHour', 'millisecond' => 'setMillisecond', - 'reference_type' => 'setReferenceType', 'minute' => 'setMinute', + 'reference_type' => 'setReferenceType', 'second' => 'setSecond' ]; @@ -206,8 +206,8 @@ public function isNullableSetToNull(string $property): bool protected static $getters = [ 'hour' => 'getHour', 'millisecond' => 'getMillisecond', - 'reference_type' => 'getReferenceType', 'minute' => 'getMinute', + 'reference_type' => 'getReferenceType', 'second' => 'getSecond' ]; @@ -283,8 +283,8 @@ public function __construct(?array $data = null) { $this->setIfExists('hour', $data ?? [], null); $this->setIfExists('millisecond', $data ?? [], null); - $this->setIfExists('reference_type', $data ?? [], 'TODAY'); $this->setIfExists('minute', $data ?? [], null); + $this->setIfExists('reference_type', $data ?? [], 'TODAY'); $this->setIfExists('second', $data ?? [], null); } @@ -355,7 +355,7 @@ public function getHour() /** * Sets hour * - * @param int|null $hour hour + * @param int|null $hour The hour component of the current day reference. * * @return self */ @@ -382,7 +382,7 @@ public function getMillisecond() /** * Sets millisecond * - * @param int|null $millisecond millisecond + * @param int|null $millisecond The millisecond component of the current day reference. * * @return self */ @@ -396,6 +396,33 @@ public function setMillisecond($millisecond) return $this; } + /** + * Gets minute + * + * @return int|null + */ + public function getMinute() + { + return $this->container['minute']; + } + + /** + * Sets minute + * + * @param int|null $minute The minute component of the current day reference. + * + * @return self + */ + public function setMinute($minute) + { + if (is_null($minute)) { + throw new \InvalidArgumentException('non-nullable minute cannot be null'); + } + $this->container['minute'] = $minute; + + return $this; + } + /** * Gets reference_type * @@ -409,7 +436,7 @@ public function getReferenceType() /** * Sets reference_type * - * @param string $reference_type reference_type + * @param string $reference_type Indicates the type of reference (TODAY). * * @return self */ @@ -433,33 +460,6 @@ public function setReferenceType($reference_type) return $this; } - /** - * Gets minute - * - * @return int|null - */ - public function getMinute() - { - return $this->container['minute']; - } - - /** - * Sets minute - * - * @param int|null $minute minute - * - * @return self - */ - public function setMinute($minute) - { - if (is_null($minute)) { - throw new \InvalidArgumentException('non-nullable minute cannot be null'); - } - $this->container['minute'] = $minute; - - return $this; - } - /** * Gets second * @@ -473,7 +473,7 @@ public function getSecond() /** * Sets second * - * @param int|null $second second + * @param int|null $second The second component of the current day reference. * * @return self */ @@ -489,11 +489,11 @@ public function setSecond($second) /** * 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]); } @@ -501,12 +501,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; } @@ -531,11 +531,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/Lists/Model/PublicUnifiedEventsFilter.php b/codegen/Crm/Lists/Model/PublicUnifiedEventsFilter.php index b4b2c1946..03b4685e0 100644 --- a/codegen/Crm/Lists/Model/PublicUnifiedEventsFilter.php +++ b/codegen/Crm/Lists/Model/PublicUnifiedEventsFilter.php @@ -2,7 +2,7 @@ /** * PublicUnifiedEventsFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -60,8 +60,8 @@ class PublicUnifiedEventsFilter implements ModelInterface, ArrayAccess, \JsonSer 'coalescing_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', 'event_type_id' => 'string', 'filter_lines' => '\HubSpot\Client\Crm\Lists\Model\PublicEventFilterMetadata[]', - 'pruning_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', - 'filter_type' => 'string' + 'filter_type' => 'string', + 'pruning_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy' ]; /** @@ -75,8 +75,8 @@ class PublicUnifiedEventsFilter implements ModelInterface, ArrayAccess, \JsonSer 'coalescing_refine_by' => null, 'event_type_id' => null, 'filter_lines' => null, - 'pruning_refine_by' => null, - 'filter_type' => null + 'filter_type' => null, + 'pruning_refine_by' => null ]; /** @@ -88,8 +88,8 @@ class PublicUnifiedEventsFilter implements ModelInterface, ArrayAccess, \JsonSer 'coalescing_refine_by' => false, 'event_type_id' => false, 'filter_lines' => false, - 'pruning_refine_by' => false, - 'filter_type' => false + 'filter_type' => false, + 'pruning_refine_by' => false ]; /** @@ -181,8 +181,8 @@ public function isNullableSetToNull(string $property): bool 'coalescing_refine_by' => 'coalescingRefineBy', 'event_type_id' => 'eventTypeId', 'filter_lines' => 'filterLines', - 'pruning_refine_by' => 'pruningRefineBy', - 'filter_type' => 'filterType' + 'filter_type' => 'filterType', + 'pruning_refine_by' => 'pruningRefineBy' ]; /** @@ -194,8 +194,8 @@ public function isNullableSetToNull(string $property): bool 'coalescing_refine_by' => 'setCoalescingRefineBy', 'event_type_id' => 'setEventTypeId', 'filter_lines' => 'setFilterLines', - 'pruning_refine_by' => 'setPruningRefineBy', - 'filter_type' => 'setFilterType' + 'filter_type' => 'setFilterType', + 'pruning_refine_by' => 'setPruningRefineBy' ]; /** @@ -207,8 +207,8 @@ public function isNullableSetToNull(string $property): bool 'coalescing_refine_by' => 'getCoalescingRefineBy', 'event_type_id' => 'getEventTypeId', 'filter_lines' => 'getFilterLines', - 'pruning_refine_by' => 'getPruningRefineBy', - 'filter_type' => 'getFilterType' + 'filter_type' => 'getFilterType', + 'pruning_refine_by' => 'getPruningRefineBy' ]; /** @@ -284,8 +284,8 @@ public function __construct(?array $data = null) $this->setIfExists('coalescing_refine_by', $data ?? [], null); $this->setIfExists('event_type_id', $data ?? [], null); $this->setIfExists('filter_lines', $data ?? [], null); - $this->setIfExists('pruning_refine_by', $data ?? [], null); $this->setIfExists('filter_type', $data ?? [], 'UNIFIED_EVENTS'); + $this->setIfExists('pruning_refine_by', $data ?? [], null); } /** @@ -385,7 +385,7 @@ public function getEventTypeId() /** * Sets event_type_id * - * @param string|null $event_type_id event_type_id + * @param string|null $event_type_id The identifier for the type of event in the unified events filter. * * @return self */ @@ -426,33 +426,6 @@ public function setFilterLines($filter_lines) return $this; } - /** - * Gets pruning_refine_by - * - * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null - */ - public function getPruningRefineBy() - { - return $this->container['pruning_refine_by']; - } - - /** - * Sets pruning_refine_by - * - * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null $pruning_refine_by pruning_refine_by - * - * @return self - */ - public function setPruningRefineBy($pruning_refine_by) - { - if (is_null($pruning_refine_by)) { - throw new \InvalidArgumentException('non-nullable pruning_refine_by cannot be null'); - } - $this->container['pruning_refine_by'] = $pruning_refine_by; - - return $this; - } - /** * Gets filter_type * @@ -466,7 +439,7 @@ public function getFilterType() /** * Sets filter_type * - * @param string $filter_type filter_type + * @param string $filter_type Indicates the type of filter being applied (UNIFIED_EVENTS). * * @return self */ @@ -489,14 +462,41 @@ public function setFilterType($filter_type) return $this; } + + /** + * Gets pruning_refine_by + * + * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy|null + */ + public function getPruningRefineBy() + { + return $this->container['pruning_refine_by']; + } + + /** + * Sets pruning_refine_by + * + * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterPruningRefineBy|null $pruning_refine_by pruning_refine_by + * + * @return self + */ + public function setPruningRefineBy($pruning_refine_by) + { + if (is_null($pruning_refine_by)) { + throw new \InvalidArgumentException('non-nullable pruning_refine_by cannot be null'); + } + $this->container['pruning_refine_by'] = $pruning_refine_by; + + 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]); } @@ -504,12 +504,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; } @@ -534,11 +534,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/Lists/Model/PublicUnifiedEventsFilterBranch.php b/codegen/Crm/Lists/Model/PublicUnifiedEventsFilterBranch.php index 77f3e2762..5f0e8793d 100644 --- a/codegen/Crm/Lists/Model/PublicUnifiedEventsFilterBranch.php +++ b/codegen/Crm/Lists/Model/PublicUnifiedEventsFilterBranch.php @@ -2,7 +2,7 @@ /** * PublicUnifiedEventsFilterBranch * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,11 +57,11 @@ class PublicUnifiedEventsFilterBranch implements ModelInterface, ArrayAccess, \J * @var string[] */ protected static $openAPITypes = [ - 'filter_branch_type' => 'string', - 'filter_branches' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[]', - 'event_type_id' => 'string', 'coalescing_refine_by' => '\HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy', + 'event_type_id' => 'string', 'filter_branch_operator' => 'string', + 'filter_branch_type' => 'string', + 'filter_branches' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[]', 'filters' => '\HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFiltersInner[]', 'operator' => 'string' ]; @@ -74,11 +74,11 @@ class PublicUnifiedEventsFilterBranch implements ModelInterface, ArrayAccess, \J * @psalm-var array */ protected static $openAPIFormats = [ - 'filter_branch_type' => null, - 'filter_branches' => null, - 'event_type_id' => null, 'coalescing_refine_by' => null, + 'event_type_id' => null, 'filter_branch_operator' => null, + 'filter_branch_type' => null, + 'filter_branches' => null, 'filters' => null, 'operator' => null ]; @@ -89,11 +89,11 @@ class PublicUnifiedEventsFilterBranch implements ModelInterface, ArrayAccess, \J * @var boolean[] */ protected static array $openAPINullables = [ - 'filter_branch_type' => false, - 'filter_branches' => false, - 'event_type_id' => false, 'coalescing_refine_by' => false, + 'event_type_id' => false, 'filter_branch_operator' => false, + 'filter_branch_type' => false, + 'filter_branches' => false, 'filters' => false, 'operator' => false ]; @@ -184,11 +184,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'filter_branch_type' => 'filterBranchType', - 'filter_branches' => 'filterBranches', - 'event_type_id' => 'eventTypeId', 'coalescing_refine_by' => 'coalescingRefineBy', + 'event_type_id' => 'eventTypeId', 'filter_branch_operator' => 'filterBranchOperator', + 'filter_branch_type' => 'filterBranchType', + 'filter_branches' => 'filterBranches', 'filters' => 'filters', 'operator' => 'operator' ]; @@ -199,11 +199,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'filter_branch_type' => 'setFilterBranchType', - 'filter_branches' => 'setFilterBranches', - 'event_type_id' => 'setEventTypeId', 'coalescing_refine_by' => 'setCoalescingRefineBy', + 'event_type_id' => 'setEventTypeId', 'filter_branch_operator' => 'setFilterBranchOperator', + 'filter_branch_type' => 'setFilterBranchType', + 'filter_branches' => 'setFilterBranches', 'filters' => 'setFilters', 'operator' => 'setOperator' ]; @@ -214,11 +214,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'filter_branch_type' => 'getFilterBranchType', - 'filter_branches' => 'getFilterBranches', - 'event_type_id' => 'getEventTypeId', 'coalescing_refine_by' => 'getCoalescingRefineBy', + 'event_type_id' => 'getEventTypeId', 'filter_branch_operator' => 'getFilterBranchOperator', + 'filter_branch_type' => 'getFilterBranchType', + 'filter_branches' => 'getFilterBranches', 'filters' => 'getFilters', 'operator' => 'getOperator' ]; @@ -308,11 +308,11 @@ public function getOperatorAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('filter_branch_type', $data ?? [], 'UNIFIED_EVENTS'); - $this->setIfExists('filter_branches', $data ?? [], null); - $this->setIfExists('event_type_id', $data ?? [], null); $this->setIfExists('coalescing_refine_by', $data ?? [], null); + $this->setIfExists('event_type_id', $data ?? [], null); $this->setIfExists('filter_branch_operator', $data ?? [], null); + $this->setIfExists('filter_branch_type', $data ?? [], 'UNIFIED_EVENTS'); + $this->setIfExists('filter_branches', $data ?? [], null); $this->setIfExists('filters', $data ?? [], null); $this->setIfExists('operator', $data ?? [], null); } @@ -344,6 +344,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['event_type_id'] === null) { + $invalidProperties[] = "'event_type_id' can't be null"; + } + if ($this->container['filter_branch_operator'] === null) { + $invalidProperties[] = "'filter_branch_operator' can't be null"; + } if ($this->container['filter_branch_type'] === null) { $invalidProperties[] = "'filter_branch_type' can't be null"; } @@ -359,12 +365,6 @@ public function listInvalidProperties() if ($this->container['filter_branches'] === null) { $invalidProperties[] = "'filter_branches' can't be null"; } - if ($this->container['event_type_id'] === null) { - $invalidProperties[] = "'event_type_id' can't be null"; - } - if ($this->container['filter_branch_operator'] === null) { - $invalidProperties[] = "'filter_branch_operator' can't be null"; - } if ($this->container['filters'] === null) { $invalidProperties[] = "'filters' can't be null"; } @@ -396,146 +396,146 @@ public function valid() /** - * Gets filter_branch_type + * Gets coalescing_refine_by * - * @return string + * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null */ - public function getFilterBranchType() + public function getCoalescingRefineBy() { - return $this->container['filter_branch_type']; + return $this->container['coalescing_refine_by']; } /** - * Sets filter_branch_type + * Sets coalescing_refine_by * - * @param string $filter_branch_type filter_branch_type + * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null $coalescing_refine_by coalescing_refine_by * * @return self */ - public function setFilterBranchType($filter_branch_type) + public function setCoalescingRefineBy($coalescing_refine_by) { - if (is_null($filter_branch_type)) { - throw new \InvalidArgumentException('non-nullable filter_branch_type cannot be null'); - } - $allowedValues = $this->getFilterBranchTypeAllowableValues(); - if (!in_array($filter_branch_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'filter_branch_type', must be one of '%s'", - $filter_branch_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($coalescing_refine_by)) { + throw new \InvalidArgumentException('non-nullable coalescing_refine_by cannot be null'); } - $this->container['filter_branch_type'] = $filter_branch_type; + $this->container['coalescing_refine_by'] = $coalescing_refine_by; return $this; } /** - * Gets filter_branches + * Gets event_type_id * - * @return \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[] + * @return string */ - public function getFilterBranches() + public function getEventTypeId() { - return $this->container['filter_branches']; + return $this->container['event_type_id']; } /** - * Sets filter_branches + * Sets event_type_id * - * @param \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[] $filter_branches filter_branches + * @param string $event_type_id The identifier for the type of event associated with the filter branch. * * @return self */ - public function setFilterBranches($filter_branches) + public function setEventTypeId($event_type_id) { - if (is_null($filter_branches)) { - throw new \InvalidArgumentException('non-nullable filter_branches cannot be null'); + if (is_null($event_type_id)) { + throw new \InvalidArgumentException('non-nullable event_type_id cannot be null'); } - $this->container['filter_branches'] = $filter_branches; + $this->container['event_type_id'] = $event_type_id; return $this; } /** - * Gets event_type_id + * Gets filter_branch_operator * * @return string */ - public function getEventTypeId() + public function getFilterBranchOperator() { - return $this->container['event_type_id']; + return $this->container['filter_branch_operator']; } /** - * Sets event_type_id + * Sets filter_branch_operator * - * @param string $event_type_id event_type_id + * @param string $filter_branch_operator The logical operator used to combine filters within the branch (AND). * * @return self */ - public function setEventTypeId($event_type_id) + public function setFilterBranchOperator($filter_branch_operator) { - if (is_null($event_type_id)) { - throw new \InvalidArgumentException('non-nullable event_type_id cannot be null'); + if (is_null($filter_branch_operator)) { + throw new \InvalidArgumentException('non-nullable filter_branch_operator cannot be null'); } - $this->container['event_type_id'] = $event_type_id; + $this->container['filter_branch_operator'] = $filter_branch_operator; return $this; } /** - * Gets coalescing_refine_by + * Gets filter_branch_type * - * @return \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null + * @return string */ - public function getCoalescingRefineBy() + public function getFilterBranchType() { - return $this->container['coalescing_refine_by']; + return $this->container['filter_branch_type']; } /** - * Sets coalescing_refine_by + * Sets filter_branch_type * - * @param \HubSpot\Client\Crm\Lists\Model\PublicFormSubmissionFilterCoalescingRefineBy|null $coalescing_refine_by coalescing_refine_by + * @param string $filter_branch_type The type of the filter branch (UNIFIED_EVENTS). * * @return self */ - public function setCoalescingRefineBy($coalescing_refine_by) + public function setFilterBranchType($filter_branch_type) { - if (is_null($coalescing_refine_by)) { - throw new \InvalidArgumentException('non-nullable coalescing_refine_by cannot be null'); + if (is_null($filter_branch_type)) { + throw new \InvalidArgumentException('non-nullable filter_branch_type cannot be null'); } - $this->container['coalescing_refine_by'] = $coalescing_refine_by; + $allowedValues = $this->getFilterBranchTypeAllowableValues(); + if (!in_array($filter_branch_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'filter_branch_type', must be one of '%s'", + $filter_branch_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['filter_branch_type'] = $filter_branch_type; return $this; } /** - * Gets filter_branch_operator + * Gets filter_branches * - * @return string + * @return \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[] */ - public function getFilterBranchOperator() + public function getFilterBranches() { - return $this->container['filter_branch_operator']; + return $this->container['filter_branches']; } /** - * Sets filter_branch_operator + * Sets filter_branches * - * @param string $filter_branch_operator filter_branch_operator + * @param \HubSpot\Client\Crm\Lists\Model\PublicPropertyAssociationFilterBranchFilterBranchesInner[] $filter_branches filter_branches * * @return self */ - public function setFilterBranchOperator($filter_branch_operator) + public function setFilterBranches($filter_branches) { - if (is_null($filter_branch_operator)) { - throw new \InvalidArgumentException('non-nullable filter_branch_operator cannot be null'); + if (is_null($filter_branches)) { + throw new \InvalidArgumentException('non-nullable filter_branches cannot be null'); } - $this->container['filter_branch_operator'] = $filter_branch_operator; + $this->container['filter_branches'] = $filter_branches; return $this; } @@ -580,7 +580,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Defines the operation to be applied within the filter branch (HAS_COMPLETED, HAS_NOT_COMPLETED). * * @return self */ @@ -606,11 +606,11 @@ public function setOperator($operator) /** * 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]); } @@ -618,12 +618,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; } @@ -648,11 +648,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/Lists/Model/PublicWebinarFilter.php b/codegen/Crm/Lists/Model/PublicWebinarFilter.php index 49c47765c..b1a8ff5a5 100644 --- a/codegen/Crm/Lists/Model/PublicWebinarFilter.php +++ b/codegen/Crm/Lists/Model/PublicWebinarFilter.php @@ -2,7 +2,7 @@ /** * PublicWebinarFilter * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,9 +57,9 @@ class PublicWebinarFilter implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'webinar_id' => 'string', 'filter_type' => 'string', - 'operator' => 'string' + 'operator' => 'string', + 'webinar_id' => 'string' ]; /** @@ -70,9 +70,9 @@ class PublicWebinarFilter implements ModelInterface, ArrayAccess, \JsonSerializa * @psalm-var array */ protected static $openAPIFormats = [ - 'webinar_id' => null, 'filter_type' => null, - 'operator' => null + 'operator' => null, + 'webinar_id' => null ]; /** @@ -81,9 +81,9 @@ class PublicWebinarFilter implements ModelInterface, ArrayAccess, \JsonSerializa * @var boolean[] */ protected static array $openAPINullables = [ - 'webinar_id' => false, 'filter_type' => false, - 'operator' => false + 'operator' => false, + 'webinar_id' => false ]; /** @@ -172,9 +172,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'webinar_id' => 'webinarId', 'filter_type' => 'filterType', - 'operator' => 'operator' + 'operator' => 'operator', + 'webinar_id' => 'webinarId' ]; /** @@ -183,9 +183,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'webinar_id' => 'setWebinarId', 'filter_type' => 'setFilterType', - 'operator' => 'setOperator' + 'operator' => 'setOperator', + 'webinar_id' => 'setWebinarId' ]; /** @@ -194,9 +194,9 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'webinar_id' => 'getWebinarId', 'filter_type' => 'getFilterType', - 'operator' => 'getOperator' + 'operator' => 'getOperator', + 'webinar_id' => 'getWebinarId' ]; /** @@ -269,9 +269,9 @@ public function getFilterTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('webinar_id', $data ?? [], null); $this->setIfExists('filter_type', $data ?? [], 'WEBINAR'); $this->setIfExists('operator', $data ?? [], null); + $this->setIfExists('webinar_id', $data ?? [], null); } /** @@ -331,33 +331,6 @@ public function valid() } - /** - * Gets webinar_id - * - * @return string|null - */ - public function getWebinarId() - { - return $this->container['webinar_id']; - } - - /** - * Sets webinar_id - * - * @param string|null $webinar_id webinar_id - * - * @return self - */ - public function setWebinarId($webinar_id) - { - if (is_null($webinar_id)) { - throw new \InvalidArgumentException('non-nullable webinar_id cannot be null'); - } - $this->container['webinar_id'] = $webinar_id; - - return $this; - } - /** * Gets filter_type * @@ -371,7 +344,7 @@ public function getFilterType() /** * Sets filter_type * - * @param string $filter_type filter_type + * @param string $filter_type Indicates the type of filter, (WEBINAR). * * @return self */ @@ -408,7 +381,7 @@ public function getOperator() /** * Sets operator * - * @param string $operator operator + * @param string $operator Specifies the operation to be performed by the filter (HAS_WEBINAR_REGISTRATION, NOT_HAS_WEBINAR_REGISTRATION, HAS_WEBINAR_ATTENDANCE, NOT_HAS_WEBINAR_ATTENDANCE). * * @return self */ @@ -421,14 +394,41 @@ public function setOperator($operator) return $this; } + + /** + * Gets webinar_id + * + * @return string|null + */ + public function getWebinarId() + { + return $this->container['webinar_id']; + } + + /** + * Sets webinar_id + * + * @param string|null $webinar_id The ID of the webinar associated with the filter. + * + * @return self + */ + public function setWebinarId($webinar_id) + { + if (is_null($webinar_id)) { + throw new \InvalidArgumentException('non-nullable webinar_id cannot be null'); + } + $this->container['webinar_id'] = $webinar_id; + + 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]); } @@ -436,12 +436,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; } @@ -466,11 +466,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/Lists/Model/PublicWeekReference.php b/codegen/Crm/Lists/Model/PublicWeekReference.php index 6b61e6817..fa5eae570 100644 --- a/codegen/Crm/Lists/Model/PublicWeekReference.php +++ b/codegen/Crm/Lists/Model/PublicWeekReference.php @@ -2,7 +2,7 @@ /** * PublicWeekReference * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -60,8 +60,8 @@ class PublicWeekReference implements ModelInterface, ArrayAccess, \JsonSerializa 'day_of_week' => 'string', 'hour' => 'int', 'millisecond' => 'int', - 'reference_type' => 'string', 'minute' => 'int', + 'reference_type' => 'string', 'second' => 'int' ]; @@ -76,8 +76,8 @@ class PublicWeekReference implements ModelInterface, ArrayAccess, \JsonSerializa 'day_of_week' => null, 'hour' => 'int32', 'millisecond' => 'int32', - 'reference_type' => null, 'minute' => 'int32', + 'reference_type' => null, 'second' => 'int32' ]; @@ -90,8 +90,8 @@ class PublicWeekReference implements ModelInterface, ArrayAccess, \JsonSerializa 'day_of_week' => false, 'hour' => false, 'millisecond' => false, - 'reference_type' => false, 'minute' => false, + 'reference_type' => false, 'second' => false ]; @@ -184,8 +184,8 @@ public function isNullableSetToNull(string $property): bool 'day_of_week' => 'dayOfWeek', 'hour' => 'hour', 'millisecond' => 'millisecond', - 'reference_type' => 'referenceType', 'minute' => 'minute', + 'reference_type' => 'referenceType', 'second' => 'second' ]; @@ -198,8 +198,8 @@ public function isNullableSetToNull(string $property): bool 'day_of_week' => 'setDayOfWeek', 'hour' => 'setHour', 'millisecond' => 'setMillisecond', - 'reference_type' => 'setReferenceType', 'minute' => 'setMinute', + 'reference_type' => 'setReferenceType', 'second' => 'setSecond' ]; @@ -212,8 +212,8 @@ public function isNullableSetToNull(string $property): bool 'day_of_week' => 'getDayOfWeek', 'hour' => 'getHour', 'millisecond' => 'getMillisecond', - 'reference_type' => 'getReferenceType', 'minute' => 'getMinute', + 'reference_type' => 'getReferenceType', 'second' => 'getSecond' ]; @@ -258,13 +258,13 @@ public function getModelName() return self::$openAPIModelName; } - public const DAY_OF_WEEK_MONDAY = 'MONDAY'; - public const DAY_OF_WEEK_TUESDAY = 'TUESDAY'; - public const DAY_OF_WEEK_WEDNESDAY = 'WEDNESDAY'; - public const DAY_OF_WEEK_THURSDAY = 'THURSDAY'; public const DAY_OF_WEEK_FRIDAY = 'FRIDAY'; + public const DAY_OF_WEEK_MONDAY = 'MONDAY'; public const DAY_OF_WEEK_SATURDAY = 'SATURDAY'; public const DAY_OF_WEEK_SUNDAY = 'SUNDAY'; + public const DAY_OF_WEEK_THURSDAY = 'THURSDAY'; + public const DAY_OF_WEEK_TUESDAY = 'TUESDAY'; + public const DAY_OF_WEEK_WEDNESDAY = 'WEDNESDAY'; public const REFERENCE_TYPE_WEEK = 'WEEK'; /** @@ -275,13 +275,13 @@ public function getModelName() public function getDayOfWeekAllowableValues() { return [ - self::DAY_OF_WEEK_MONDAY, - self::DAY_OF_WEEK_TUESDAY, - self::DAY_OF_WEEK_WEDNESDAY, - self::DAY_OF_WEEK_THURSDAY, self::DAY_OF_WEEK_FRIDAY, + self::DAY_OF_WEEK_MONDAY, self::DAY_OF_WEEK_SATURDAY, self::DAY_OF_WEEK_SUNDAY, + self::DAY_OF_WEEK_THURSDAY, + self::DAY_OF_WEEK_TUESDAY, + self::DAY_OF_WEEK_WEDNESDAY, ]; } @@ -315,8 +315,8 @@ public function __construct(?array $data = null) $this->setIfExists('day_of_week', $data ?? [], null); $this->setIfExists('hour', $data ?? [], null); $this->setIfExists('millisecond', $data ?? [], null); - $this->setIfExists('reference_type', $data ?? [], 'WEEK'); $this->setIfExists('minute', $data ?? [], null); + $this->setIfExists('reference_type', $data ?? [], 'WEEK'); $this->setIfExists('second', $data ?? [], null); } @@ -399,7 +399,7 @@ public function getDayOfWeek() /** * Sets day_of_week * - * @param string $day_of_week day_of_week + * @param string $day_of_week The day of the week (SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY). * * @return self */ @@ -436,7 +436,7 @@ public function getHour() /** * Sets hour * - * @param int|null $hour hour + * @param int|null $hour The hour component of the week reference. * * @return self */ @@ -463,7 +463,7 @@ public function getMillisecond() /** * Sets millisecond * - * @param int|null $millisecond millisecond + * @param int|null $millisecond The millisecond component of the week reference. * * @return self */ @@ -477,6 +477,33 @@ public function setMillisecond($millisecond) return $this; } + /** + * Gets minute + * + * @return int|null + */ + public function getMinute() + { + return $this->container['minute']; + } + + /** + * Sets minute + * + * @param int|null $minute The minute component of the week reference. + * + * @return self + */ + public function setMinute($minute) + { + if (is_null($minute)) { + throw new \InvalidArgumentException('non-nullable minute cannot be null'); + } + $this->container['minute'] = $minute; + + return $this; + } + /** * Gets reference_type * @@ -490,7 +517,7 @@ public function getReferenceType() /** * Sets reference_type * - * @param string $reference_type reference_type + * @param string $reference_type Indicates the type of reference (WEEK). * * @return self */ @@ -514,33 +541,6 @@ public function setReferenceType($reference_type) return $this; } - /** - * Gets minute - * - * @return int|null - */ - public function getMinute() - { - return $this->container['minute']; - } - - /** - * Sets minute - * - * @param int|null $minute minute - * - * @return self - */ - public function setMinute($minute) - { - if (is_null($minute)) { - throw new \InvalidArgumentException('non-nullable minute cannot be null'); - } - $this->container['minute'] = $minute; - - return $this; - } - /** * Gets second * @@ -554,7 +554,7 @@ public function getSecond() /** * Sets second * - * @param int|null $second second + * @param int|null $second The second component of the week reference. * * @return self */ @@ -570,11 +570,11 @@ public function setSecond($second) /** * 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]); } @@ -582,12 +582,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; } @@ -612,11 +612,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/Lists/Model/PublicYearReference.php b/codegen/Crm/Lists/Model/PublicYearReference.php index 1c1358f8b..6f92287e9 100644 --- a/codegen/Crm/Lists/Model/PublicYearReference.php +++ b/codegen/Crm/Lists/Model/PublicYearReference.php @@ -2,7 +2,7 @@ /** * PublicYearReference * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -57,12 +57,12 @@ class PublicYearReference implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ + 'day' => 'int', 'hour' => 'int', - 'month' => 'int', 'millisecond' => 'int', - 'reference_type' => 'string', - 'day' => 'int', 'minute' => 'int', + 'month' => 'int', + 'reference_type' => 'string', 'second' => 'int' ]; @@ -74,12 +74,12 @@ class PublicYearReference implements ModelInterface, ArrayAccess, \JsonSerializa * @psalm-var array */ protected static $openAPIFormats = [ + 'day' => 'int32', 'hour' => 'int32', - 'month' => 'int32', 'millisecond' => 'int32', - 'reference_type' => null, - 'day' => 'int32', 'minute' => 'int32', + 'month' => 'int32', + 'reference_type' => null, 'second' => 'int32' ]; @@ -89,12 +89,12 @@ class PublicYearReference implements ModelInterface, ArrayAccess, \JsonSerializa * @var boolean[] */ protected static array $openAPINullables = [ + 'day' => false, 'hour' => false, - 'month' => false, 'millisecond' => false, - 'reference_type' => false, - 'day' => false, 'minute' => false, + 'month' => false, + 'reference_type' => false, 'second' => false ]; @@ -184,12 +184,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'day' => 'day', 'hour' => 'hour', - 'month' => 'month', 'millisecond' => 'millisecond', - 'reference_type' => 'referenceType', - 'day' => 'day', 'minute' => 'minute', + 'month' => 'month', + 'reference_type' => 'referenceType', 'second' => 'second' ]; @@ -199,12 +199,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'day' => 'setDay', 'hour' => 'setHour', - 'month' => 'setMonth', 'millisecond' => 'setMillisecond', - 'reference_type' => 'setReferenceType', - 'day' => 'setDay', 'minute' => 'setMinute', + 'month' => 'setMonth', + 'reference_type' => 'setReferenceType', 'second' => 'setSecond' ]; @@ -214,12 +214,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'day' => 'getDay', 'hour' => 'getHour', - 'month' => 'getMonth', 'millisecond' => 'getMillisecond', - 'reference_type' => 'getReferenceType', - 'day' => 'getDay', 'minute' => 'getMinute', + 'month' => 'getMonth', + 'reference_type' => 'getReferenceType', 'second' => 'getSecond' ]; @@ -293,12 +293,12 @@ public function getReferenceTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('day', $data ?? [], null); $this->setIfExists('hour', $data ?? [], null); - $this->setIfExists('month', $data ?? [], null); $this->setIfExists('millisecond', $data ?? [], null); - $this->setIfExists('reference_type', $data ?? [], 'YEAR'); - $this->setIfExists('day', $data ?? [], null); $this->setIfExists('minute', $data ?? [], null); + $this->setIfExists('month', $data ?? [], null); + $this->setIfExists('reference_type', $data ?? [], 'YEAR'); $this->setIfExists('second', $data ?? [], null); } @@ -329,6 +329,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['day'] === null) { + $invalidProperties[] = "'day' can't be null"; + } if ($this->container['month'] === null) { $invalidProperties[] = "'month' can't be null"; } @@ -344,9 +347,6 @@ public function listInvalidProperties() ); } - if ($this->container['day'] === null) { - $invalidProperties[] = "'day' can't be null"; - } return $invalidProperties; } @@ -363,55 +363,55 @@ public function valid() /** - * Gets hour + * Gets day * - * @return int|null + * @return int */ - public function getHour() + public function getDay() { - return $this->container['hour']; + return $this->container['day']; } /** - * Sets hour + * Sets day * - * @param int|null $hour hour + * @param int $day The day component of the year reference. * * @return self */ - public function setHour($hour) + public function setDay($day) { - if (is_null($hour)) { - throw new \InvalidArgumentException('non-nullable hour cannot be null'); + if (is_null($day)) { + throw new \InvalidArgumentException('non-nullable day cannot be null'); } - $this->container['hour'] = $hour; + $this->container['day'] = $day; return $this; } /** - * Gets month + * Gets hour * - * @return int + * @return int|null */ - public function getMonth() + public function getHour() { - return $this->container['month']; + return $this->container['hour']; } /** - * Sets month + * Sets hour * - * @param int $month month + * @param int|null $hour The hour component of the year reference. * * @return self */ - public function setMonth($month) + public function setHour($hour) { - if (is_null($month)) { - throw new \InvalidArgumentException('non-nullable month cannot be null'); + if (is_null($hour)) { + throw new \InvalidArgumentException('non-nullable hour cannot be null'); } - $this->container['month'] = $month; + $this->container['hour'] = $hour; return $this; } @@ -429,7 +429,7 @@ public function getMillisecond() /** * Sets millisecond * - * @param int|null $millisecond millisecond + * @param int|null $millisecond The millisecond component of the year reference. * * @return self */ @@ -444,92 +444,92 @@ public function setMillisecond($millisecond) } /** - * Gets reference_type + * Gets minute * - * @return string + * @return int|null */ - public function getReferenceType() + public function getMinute() { - return $this->container['reference_type']; + return $this->container['minute']; } /** - * Sets reference_type + * Sets minute * - * @param string $reference_type reference_type + * @param int|null $minute The minute component of the year reference. * * @return self */ - public function setReferenceType($reference_type) + public function setMinute($minute) { - if (is_null($reference_type)) { - throw new \InvalidArgumentException('non-nullable reference_type cannot be null'); - } - $allowedValues = $this->getReferenceTypeAllowableValues(); - if (!in_array($reference_type, $allowedValues, true)) { - throw new \InvalidArgumentException( - sprintf( - "Invalid value '%s' for 'reference_type', must be one of '%s'", - $reference_type, - implode("', '", $allowedValues) - ) - ); + if (is_null($minute)) { + throw new \InvalidArgumentException('non-nullable minute cannot be null'); } - $this->container['reference_type'] = $reference_type; + $this->container['minute'] = $minute; return $this; } /** - * Gets day + * Gets month * * @return int */ - public function getDay() + public function getMonth() { - return $this->container['day']; + return $this->container['month']; } /** - * Sets day + * Sets month * - * @param int $day day + * @param int $month The month component of the year reference. * * @return self */ - public function setDay($day) + public function setMonth($month) { - if (is_null($day)) { - throw new \InvalidArgumentException('non-nullable day cannot be null'); + if (is_null($month)) { + throw new \InvalidArgumentException('non-nullable month cannot be null'); } - $this->container['day'] = $day; + $this->container['month'] = $month; return $this; } /** - * Gets minute + * Gets reference_type * - * @return int|null + * @return string */ - public function getMinute() + public function getReferenceType() { - return $this->container['minute']; + return $this->container['reference_type']; } /** - * Sets minute + * Sets reference_type * - * @param int|null $minute minute + * @param string $reference_type Indicates the type of reference (YEAR). * * @return self */ - public function setMinute($minute) + public function setReferenceType($reference_type) { - if (is_null($minute)) { - throw new \InvalidArgumentException('non-nullable minute cannot be null'); + if (is_null($reference_type)) { + throw new \InvalidArgumentException('non-nullable reference_type cannot be null'); } - $this->container['minute'] = $minute; + $allowedValues = $this->getReferenceTypeAllowableValues(); + if (!in_array($reference_type, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value '%s' for 'reference_type', must be one of '%s'", + $reference_type, + implode("', '", $allowedValues) + ) + ); + } + $this->container['reference_type'] = $reference_type; return $this; } @@ -547,7 +547,7 @@ public function getSecond() /** * Sets second * - * @param int|null $second second + * @param int|null $second The second component of the year reference. * * @return self */ @@ -563,11 +563,11 @@ public function setSecond($second) /** * 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]); } @@ -575,12 +575,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; } @@ -605,11 +605,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/Lists/Model/RecordListMembership.php b/codegen/Crm/Lists/Model/RecordListMembership.php index ba2a296fe..ef7bbdfaa 100644 --- a/codegen/Crm/Lists/Model/RecordListMembership.php +++ b/codegen/Crm/Lists/Model/RecordListMembership.php @@ -2,7 +2,7 @@ /** * RecordListMembership * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.0 */ /** @@ -35,6 +35,7 @@ * RecordListMembership Class Doc Comment * * @category Class + * @description Lists record is member of * @package HubSpot\Client\Crm\Lists * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,10 +58,11 @@ class RecordListMembership implements ModelInterface, ArrayAccess, \JsonSerializ * @var string[] */ protected static $openAPITypes = [ - 'list_id' => 'string', - 'list_version' => 'int', + 'first_added_timestamp' => '\DateTime', + 'is_public_list' => 'bool', 'last_added_timestamp' => '\DateTime', - 'first_added_timestamp' => '\DateTime' + 'list_id' => 'string', + 'list_version' => 'int' ]; /** @@ -71,10 +73,11 @@ class RecordListMembership implements ModelInterface, ArrayAccess, \JsonSerializ * @psalm-var array */ protected static $openAPIFormats = [ - 'list_id' => null, - 'list_version' => 'int32', + 'first_added_timestamp' => 'date-time', + 'is_public_list' => null, 'last_added_timestamp' => 'date-time', - 'first_added_timestamp' => 'date-time' + 'list_id' => null, + 'list_version' => 'int32' ]; /** @@ -83,10 +86,11 @@ class RecordListMembership implements ModelInterface, ArrayAccess, \JsonSerializ * @var boolean[] */ protected static array $openAPINullables = [ - 'list_id' => false, - 'list_version' => false, + 'first_added_timestamp' => false, + 'is_public_list' => false, 'last_added_timestamp' => false, - 'first_added_timestamp' => false + 'list_id' => false, + 'list_version' => false ]; /** @@ -175,10 +179,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'list_id' => 'listId', - 'list_version' => 'listVersion', + 'first_added_timestamp' => 'firstAddedTimestamp', + 'is_public_list' => 'isPublicList', 'last_added_timestamp' => 'lastAddedTimestamp', - 'first_added_timestamp' => 'firstAddedTimestamp' + 'list_id' => 'listId', + 'list_version' => 'listVersion' ]; /** @@ -187,10 +192,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'list_id' => 'setListId', - 'list_version' => 'setListVersion', + 'first_added_timestamp' => 'setFirstAddedTimestamp', + 'is_public_list' => 'setIsPublicList', 'last_added_timestamp' => 'setLastAddedTimestamp', - 'first_added_timestamp' => 'setFirstAddedTimestamp' + 'list_id' => 'setListId', + 'list_version' => 'setListVersion' ]; /** @@ -199,10 +205,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'list_id' => 'getListId', - 'list_version' => 'getListVersion', + 'first_added_timestamp' => 'getFirstAddedTimestamp', + 'is_public_list' => 'getIsPublicList', 'last_added_timestamp' => 'getLastAddedTimestamp', - 'first_added_timestamp' => 'getFirstAddedTimestamp' + 'list_id' => 'getListId', + 'list_version' => 'getListVersion' ]; /** @@ -262,10 +269,11 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('first_added_timestamp', $data ?? [], null); + $this->setIfExists('is_public_list', $data ?? [], null); + $this->setIfExists('last_added_timestamp', $data ?? [], null); $this->setIfExists('list_id', $data ?? [], null); $this->setIfExists('list_version', $data ?? [], null); - $this->setIfExists('last_added_timestamp', $data ?? [], null); - $this->setIfExists('first_added_timestamp', $data ?? [], null); } /** @@ -301,12 +309,6 @@ public function listInvalidProperties() if ($this->container['list_version'] === null) { $invalidProperties[] = "'list_version' can't be null"; } - if ($this->container['last_added_timestamp'] === null) { - $invalidProperties[] = "'last_added_timestamp' can't be null"; - } - if ($this->container['first_added_timestamp'] === null) { - $invalidProperties[] = "'first_added_timestamp' can't be null"; - } return $invalidProperties; } @@ -323,55 +325,55 @@ public function valid() /** - * Gets list_id + * Gets first_added_timestamp * - * @return string + * @return \DateTime|null */ - public function getListId() + public function getFirstAddedTimestamp() { - return $this->container['list_id']; + return $this->container['first_added_timestamp']; } /** - * Sets list_id + * Sets first_added_timestamp * - * @param string $list_id list_id + * @param \DateTime|null $first_added_timestamp The timestamp when the record was first added to the list. * * @return self */ - public function setListId($list_id) + public function setFirstAddedTimestamp($first_added_timestamp) { - if (is_null($list_id)) { - throw new \InvalidArgumentException('non-nullable list_id cannot be null'); + if (is_null($first_added_timestamp)) { + throw new \InvalidArgumentException('non-nullable first_added_timestamp cannot be null'); } - $this->container['list_id'] = $list_id; + $this->container['first_added_timestamp'] = $first_added_timestamp; return $this; } /** - * Gets list_version + * Gets is_public_list * - * @return int + * @return bool|null */ - public function getListVersion() + public function getIsPublicList() { - return $this->container['list_version']; + return $this->container['is_public_list']; } /** - * Sets list_version + * Sets is_public_list * - * @param int $list_version list_version + * @param bool|null $is_public_list Indicates whether the list is public. * * @return self */ - public function setListVersion($list_version) + public function setIsPublicList($is_public_list) { - if (is_null($list_version)) { - throw new \InvalidArgumentException('non-nullable list_version cannot be null'); + if (is_null($is_public_list)) { + throw new \InvalidArgumentException('non-nullable is_public_list cannot be null'); } - $this->container['list_version'] = $list_version; + $this->container['is_public_list'] = $is_public_list; return $this; } @@ -379,7 +381,7 @@ public function setListVersion($list_version) /** * Gets last_added_timestamp * - * @return \DateTime + * @return \DateTime|null */ public function getLastAddedTimestamp() { @@ -389,7 +391,7 @@ public function getLastAddedTimestamp() /** * Sets last_added_timestamp * - * @param \DateTime $last_added_timestamp last_added_timestamp + * @param \DateTime|null $last_added_timestamp The timestamp when the record was last added to the list. * * @return self */ @@ -404,39 +406,66 @@ public function setLastAddedTimestamp($last_added_timestamp) } /** - * Gets first_added_timestamp + * Gets list_id * - * @return \DateTime + * @return string */ - public function getFirstAddedTimestamp() + public function getListId() { - return $this->container['first_added_timestamp']; + return $this->container['list_id']; } /** - * Sets first_added_timestamp + * Sets list_id * - * @param \DateTime $first_added_timestamp first_added_timestamp + * @param string $list_id The unique identifier of the list. * * @return self */ - public function setFirstAddedTimestamp($first_added_timestamp) + public function setListId($list_id) { - if (is_null($first_added_timestamp)) { - throw new \InvalidArgumentException('non-nullable first_added_timestamp cannot be null'); + if (is_null($list_id)) { + throw new \InvalidArgumentException('non-nullable list_id cannot be null'); } - $this->container['first_added_timestamp'] = $first_added_timestamp; + $this->container['list_id'] = $list_id; + + return $this; + } + + /** + * Gets list_version + * + * @return int + */ + public function getListVersion() + { + return $this->container['list_version']; + } + + /** + * Sets list_version + * + * @param int $list_version The version number of the list. + * + * @return self + */ + public function setListVersion($list_version) + { + if (is_null($list_version)) { + throw new \InvalidArgumentException('non-nullable list_version cannot be null'); + } + $this->container['list_version'] = $list_version; 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]); } @@ -444,12 +473,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; } @@ -474,11 +503,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/Lists/ObjectSerializer.php b/codegen/Crm/Lists/ObjectSerializer.php index f3cc8e5f4..2aa3cb70e 100644 --- a/codegen/Crm/Lists/ObjectSerializer.php +++ b/codegen/Crm/Lists/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Crm\Lists @@ -11,13 +11,13 @@ */ /** - * Lists + * CRM Lists * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * CRUD operations to manage lists and list memberships * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.19.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) : ''; } } diff --git a/lib/Discovery/Crm/Lists/Discovery.php b/lib/Discovery/Crm/Lists/Discovery.php index 60e1f3f9c..28cf0ba3a 100644 --- a/lib/Discovery/Crm/Lists/Discovery.php +++ b/lib/Discovery/Crm/Lists/Discovery.php @@ -2,16 +2,26 @@ namespace HubSpot\Discovery\Crm\Lists; -use HubSpot\Client\Crm\Lists\Api\FoldersApi; +use HubSpot\Client\Crm\Lists\Api\IDMappingApi; +use HubSpot\Client\Crm\Lists\Api\JoinOrderApi; +use HubSpot\Client\Crm\Lists\Api\ListManagementApi; use HubSpot\Client\Crm\Lists\Api\ListsApi; -use HubSpot\Client\Crm\Lists\Api\MappingApi; use HubSpot\Client\Crm\Lists\Api\MembershipsApi; +use HubSpot\Discovery\Crm\Lists\Configuration; use HubSpot\Discovery\DiscoveryBase; /** - * @method FoldersApi foldersApi() - * @method ListsApi listsApi() - * @method MappingApi mappingApi() - * @method MembershipsApi membershipsApi() + * @method IDMappingApi idMappingApi() + * @method JoinOrderApi joinOrderApi() + * @method ListManagementApi listManagementApi() + * @method ListsApi listsApi() + * @method MembershipsApi membershipsApi() */ -class Discovery extends DiscoveryBase {} +class Discovery extends DiscoveryBase { + public function idMappingApi() + { + $config = $this->config->convertToClientConfig(Configuration::class); + + return new IDMappingApi($this->client, $config); + } +} diff --git a/tests/spec/Discovery/Crm/Lists/DiscoverySpec.php b/tests/spec/Discovery/Crm/Lists/DiscoverySpec.php index 12808a7bf..530c62339 100644 --- a/tests/spec/Discovery/Crm/Lists/DiscoverySpec.php +++ b/tests/spec/Discovery/Crm/Lists/DiscoverySpec.php @@ -3,9 +3,10 @@ namespace spec\HubSpot\Discovery\Crm\Lists; use GuzzleHttp\Client; -use HubSpot\Client\Crm\Lists\Api\FoldersApi; +use HubSpot\Client\Crm\Lists\Api\IDMappingApi; +use HubSpot\Client\Crm\Lists\Api\JoinOrderApi; +use HubSpot\Client\Crm\Lists\Api\ListManagementApi; use HubSpot\Client\Crm\Lists\Api\ListsApi; -use HubSpot\Client\Crm\Lists\Api\MappingApi; use HubSpot\Client\Crm\Lists\Api\MembershipsApi; use HubSpot\Config; use HubSpot\Discovery\Crm\Lists\Discovery; @@ -25,9 +26,10 @@ public function it_is_initializable() public function it_creates_clients() { - $this->foldersApi()->shouldHaveType(FoldersApi::class); + $this->idMappingApi()->shouldHaveType(IDMappingApi::class); + $this->joinOrderApi()->shouldHaveType(JoinOrderApi::class); + $this->listManagementApi()->shouldHaveType(ListManagementApi::class); $this->listsApi()->shouldHaveType(ListsApi::class); - $this->mappingApi()->shouldHaveType(MappingApi::class); $this->membershipsApi()->shouldHaveType(MembershipsApi::class); } }