diff --git a/codegen/Cms/Hubdb/Api/RowsApi.php b/codegen/Cms/Hubdb/Api/RowsApi.php index 78168bdc..a62af567 100644 --- a/codegen/Cms/Hubdb/Api/RowsApi.php +++ b/codegen/Cms/Hubdb/Api/RowsApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3' !== '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\Cms\Hubdb\Model\HubDbTableRowV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -277,34 +240,11 @@ public function cloneDraftTableRowWithHttpInfo($table_id_or_name, $row_id, $name ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3'; - 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\Cms\Hubdb\Model\HubDbTableRowV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -314,7 +254,7 @@ public function cloneDraftTableRowWithHttpInfo($table_id_or_name, $row_id, $name $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -322,8 +262,10 @@ public function cloneDraftTableRowWithHttpInfo($table_id_or_name, $row_id, $name $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -335,7 +277,7 @@ public function cloneDraftTableRowWithHttpInfo($table_id_or_name, $row_id, $name * * @param string $table_id_or_name The ID or name of the table (required) * @param string $row_id The ID of the row (required) - * @param string|null $name (optional) + * @param string|null $name The name for the cloned row. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cloneDraftTableRow'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -358,7 +300,7 @@ function ($response) { * * @param string $table_id_or_name The ID or name of the table (required) * @param string $row_id The ID of the row (required) - * @param string|null $name (optional) + * @param string|null $name The name for the cloned row. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cloneDraftTableRow'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -410,7 +352,7 @@ function ($exception) { * * @param string $table_id_or_name The ID or name of the table (required) * @param string $row_id The ID of the row (required) - * @param string|null $name (optional) + * @param string|null $name The name for the cloned row. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['cloneDraftTableRow'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -592,61 +534,21 @@ public function createTableRowWithHttpInfo($table_id_or_name, $hub_db_table_row_ switch($statusCode) { case 201: - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3' !== '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\Cms\Hubdb\Model\HubDbTableRowV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -660,34 +562,11 @@ public function createTableRowWithHttpInfo($table_id_or_name, $hub_db_table_row_ ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3'; - 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\Cms\Hubdb\Model\HubDbTableRowV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 201: @@ -697,7 +576,7 @@ public function createTableRowWithHttpInfo($table_id_or_name, $hub_db_table_row_ $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -705,8 +584,10 @@ public function createTableRowWithHttpInfo($table_id_or_name, $hub_db_table_row_ $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -904,7 +785,7 @@ public function createTableRowRequest($table_id_or_name, $hub_db_table_row_v3_re * * @param string $table_id_or_name The ID or name of the table (required) * @param string $row_id The ID of the row (required) - * @param bool|null $archived (optional) + * @param bool|null $archived Set this to `true` to return an archived row. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDraftTableRowById'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Hubdb\ApiException on non-2xx response or if the response body is not in the expected format @@ -924,7 +805,7 @@ public function getDraftTableRowById($table_id_or_name, $row_id, $archived = nul * * @param string $table_id_or_name The ID or name of the table (required) * @param string $row_id The ID of the row (required) - * @param bool|null $archived (optional) + * @param bool|null $archived Set this to `true` to return an archived row. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDraftTableRowById'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Hubdb\ApiException on non-2xx response or if the response body is not in the expected format @@ -960,61 +841,21 @@ public function getDraftTableRowByIdWithHttpInfo($table_id_or_name, $row_id, $ar switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3' !== '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\Cms\Hubdb\Model\HubDbTableRowV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1028,34 +869,11 @@ public function getDraftTableRowByIdWithHttpInfo($table_id_or_name, $row_id, $ar ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3'; - 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\Cms\Hubdb\Model\HubDbTableRowV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1065,7 +883,7 @@ public function getDraftTableRowByIdWithHttpInfo($table_id_or_name, $row_id, $ar $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1073,8 +891,10 @@ public function getDraftTableRowByIdWithHttpInfo($table_id_or_name, $row_id, $ar $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1086,7 +906,7 @@ public function getDraftTableRowByIdWithHttpInfo($table_id_or_name, $row_id, $ar * * @param string $table_id_or_name The ID or name of the table (required) * @param string $row_id The ID of the row (required) - * @param bool|null $archived (optional) + * @param bool|null $archived Set this to `true` to return an archived row. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDraftTableRowById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1109,7 +929,7 @@ function ($response) { * * @param string $table_id_or_name The ID or name of the table (required) * @param string $row_id The ID of the row (required) - * @param bool|null $archived (optional) + * @param bool|null $archived Set this to `true` to return an archived row. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDraftTableRowById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1161,7 +981,7 @@ function ($exception) { * * @param string $table_id_or_name The ID or name of the table (required) * @param string $row_id The ID of the row (required) - * @param bool|null $archived (optional) + * @param bool|null $archived Set this to `true` to return an archived row. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDraftTableRowById'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1289,7 +1109,7 @@ public function getDraftTableRowByIdRequest($table_id_or_name, $row_id, $archive * * @param string $table_id_or_name The ID or name of the table (required) * @param string $row_id The ID of the row (required) - * @param bool|null $archived (optional) + * @param bool|null $archived Specifies whether to return an archived row. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTableRow'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Hubdb\ApiException on non-2xx response or if the response body is not in the expected format @@ -1309,7 +1129,7 @@ public function getTableRow($table_id_or_name, $row_id, $archived = null, string * * @param string $table_id_or_name The ID or name of the table (required) * @param string $row_id The ID of the row (required) - * @param bool|null $archived (optional) + * @param bool|null $archived Specifies whether to return an archived row. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTableRow'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Hubdb\ApiException on non-2xx response or if the response body is not in the expected format @@ -1345,61 +1165,21 @@ public function getTableRowWithHttpInfo($table_id_or_name, $row_id, $archived = switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3' !== '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\Cms\Hubdb\Model\HubDbTableRowV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1413,34 +1193,11 @@ public function getTableRowWithHttpInfo($table_id_or_name, $row_id, $archived = ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3'; - 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\Cms\Hubdb\Model\HubDbTableRowV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1450,7 +1207,7 @@ public function getTableRowWithHttpInfo($table_id_or_name, $row_id, $archived = $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1458,8 +1215,10 @@ public function getTableRowWithHttpInfo($table_id_or_name, $row_id, $archived = $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1471,7 +1230,7 @@ public function getTableRowWithHttpInfo($table_id_or_name, $row_id, $archived = * * @param string $table_id_or_name The ID or name of the table (required) * @param string $row_id The ID of the row (required) - * @param bool|null $archived (optional) + * @param bool|null $archived Specifies whether to return an archived row. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTableRow'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1494,7 +1253,7 @@ function ($response) { * * @param string $table_id_or_name The ID or name of the table (required) * @param string $row_id The ID of the row (required) - * @param bool|null $archived (optional) + * @param bool|null $archived Specifies whether to return an archived row. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTableRow'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1546,7 +1305,7 @@ function ($exception) { * * @param string $table_id_or_name The ID or name of the table (required) * @param string $row_id The ID of the row (required) - * @param bool|null $archived (optional) + * @param bool|null $archived Specifies whether to return an archived row. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTableRow'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1677,8 +1436,8 @@ public function getTableRowRequest($table_id_or_name, $row_id, $archived = null, * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param int|null $limit The maximum number of results to return. Default is `1000`. (optional) * @param string[]|null $properties Specify the column names to get results containing only the required columns instead of all column details. (optional) - * @param int|null $offset (optional) - * @param bool|null $archived (optional) + * @param int|null $offset The number of rows to skip before starting to return results. (optional) + * @param bool|null $archived Specifies whether to include archived rows in the response. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTableRows'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Hubdb\ApiException on non-2xx response or if the response body is not in the expected format @@ -1701,8 +1460,8 @@ public function getTableRows($table_id_or_name, $sort = null, $after = null, $li * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param int|null $limit The maximum number of results to return. Default is `1000`. (optional) * @param string[]|null $properties Specify the column names to get results containing only the required columns instead of all column details. (optional) - * @param int|null $offset (optional) - * @param bool|null $archived (optional) + * @param int|null $offset The number of rows to skip before starting to return results. (optional) + * @param bool|null $archived Specifies whether to include archived rows in the response. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTableRows'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Hubdb\ApiException on non-2xx response or if the response body is not in the expected format @@ -1738,61 +1497,21 @@ public function getTableRowsWithHttpInfo($table_id_or_name, $sort = null, $after switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3' !== '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\Cms\Hubdb\Model\UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1806,34 +1525,11 @@ public function getTableRowsWithHttpInfo($table_id_or_name, $sort = null, $after ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3'; - 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\Cms\Hubdb\Model\UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1843,7 +1539,7 @@ public function getTableRowsWithHttpInfo($table_id_or_name, $sort = null, $after $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1851,8 +1547,10 @@ public function getTableRowsWithHttpInfo($table_id_or_name, $sort = null, $after $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1867,8 +1565,8 @@ public function getTableRowsWithHttpInfo($table_id_or_name, $sort = null, $after * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param int|null $limit The maximum number of results to return. Default is `1000`. (optional) * @param string[]|null $properties Specify the column names to get results containing only the required columns instead of all column details. (optional) - * @param int|null $offset (optional) - * @param bool|null $archived (optional) + * @param int|null $offset The number of rows to skip before starting to return results. (optional) + * @param bool|null $archived Specifies whether to include archived rows in the response. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTableRows'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1894,8 +1592,8 @@ function ($response) { * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param int|null $limit The maximum number of results to return. Default is `1000`. (optional) * @param string[]|null $properties Specify the column names to get results containing only the required columns instead of all column details. (optional) - * @param int|null $offset (optional) - * @param bool|null $archived (optional) + * @param int|null $offset The number of rows to skip before starting to return results. (optional) + * @param bool|null $archived Specifies whether to include archived rows in the response. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTableRows'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -1950,8 +1648,8 @@ function ($exception) { * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param int|null $limit The maximum number of results to return. Default is `1000`. (optional) * @param string[]|null $properties Specify the column names to get results containing only the required columns instead of all column details. (optional) - * @param int|null $offset (optional) - * @param bool|null $archived (optional) + * @param int|null $offset The number of rows to skip before starting to return results. (optional) + * @param bool|null $archived Specifies whether to include archived rows in the response. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTableRows'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2163,7 +1861,6 @@ public function purgeDraftTableRowWithHttpInfo($table_id_or_name, $row_id, strin return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -2173,8 +1870,10 @@ public function purgeDraftTableRowWithHttpInfo($table_id_or_name, $row_id, strin $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2366,8 +2065,8 @@ public function purgeDraftTableRowRequest($table_id_or_name, $row_id, string $co * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param int|null $limit The maximum number of results to return. Default is `1000`. (optional) * @param string[]|null $properties Specify the column names to get results containing only the required columns instead of all column details. If you want to include multiple columns in the result, use this query param as many times. (optional) - * @param int|null $offset (optional) - * @param bool|null $archived (optional) + * @param int|null $offset The number of rows to skip before starting to return results. (optional) + * @param bool|null $archived Specifies whether to return archived rows. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readDraftTableRows'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Hubdb\ApiException on non-2xx response or if the response body is not in the expected format @@ -2390,8 +2089,8 @@ public function readDraftTableRows($table_id_or_name, $sort = null, $after = nul * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param int|null $limit The maximum number of results to return. Default is `1000`. (optional) * @param string[]|null $properties Specify the column names to get results containing only the required columns instead of all column details. If you want to include multiple columns in the result, use this query param as many times. (optional) - * @param int|null $offset (optional) - * @param bool|null $archived (optional) + * @param int|null $offset The number of rows to skip before starting to return results. (optional) + * @param bool|null $archived Specifies whether to return archived rows. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readDraftTableRows'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Hubdb\ApiException on non-2xx response or if the response body is not in the expected format @@ -2427,61 +2126,21 @@ public function readDraftTableRowsWithHttpInfo($table_id_or_name, $sort = null, switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3' !== '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\Cms\Hubdb\Model\UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2495,34 +2154,11 @@ public function readDraftTableRowsWithHttpInfo($table_id_or_name, $sort = null, ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3'; - 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\Cms\Hubdb\Model\UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2532,7 +2168,7 @@ public function readDraftTableRowsWithHttpInfo($table_id_or_name, $sort = null, $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2540,8 +2176,10 @@ public function readDraftTableRowsWithHttpInfo($table_id_or_name, $sort = null, $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2556,8 +2194,8 @@ public function readDraftTableRowsWithHttpInfo($table_id_or_name, $sort = null, * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param int|null $limit The maximum number of results to return. Default is `1000`. (optional) * @param string[]|null $properties Specify the column names to get results containing only the required columns instead of all column details. If you want to include multiple columns in the result, use this query param as many times. (optional) - * @param int|null $offset (optional) - * @param bool|null $archived (optional) + * @param int|null $offset The number of rows to skip before starting to return results. (optional) + * @param bool|null $archived Specifies whether to return archived rows. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readDraftTableRows'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2583,8 +2221,8 @@ function ($response) { * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param int|null $limit The maximum number of results to return. Default is `1000`. (optional) * @param string[]|null $properties Specify the column names to get results containing only the required columns instead of all column details. If you want to include multiple columns in the result, use this query param as many times. (optional) - * @param int|null $offset (optional) - * @param bool|null $archived (optional) + * @param int|null $offset The number of rows to skip before starting to return results. (optional) + * @param bool|null $archived Specifies whether to return archived rows. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readDraftTableRows'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2639,8 +2277,8 @@ function ($exception) { * @param string|null $after The cursor token value to get the next set of results. You can get this from the `paging.next.after` JSON property of a paged response containing more results. (optional) * @param int|null $limit The maximum number of results to return. Default is `1000`. (optional) * @param string[]|null $properties Specify the column names to get results containing only the required columns instead of all column details. If you want to include multiple columns in the result, use this query param as many times. (optional) - * @param int|null $offset (optional) - * @param bool|null $archived (optional) + * @param int|null $offset The number of rows to skip before starting to return results. (optional) + * @param bool|null $archived Specifies whether to return archived rows. Defaults to `false`. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['readDraftTableRows'] to see the possible values for this operation * * @throws \InvalidArgumentException @@ -2856,61 +2494,21 @@ public function replaceDraftTableRowWithHttpInfo($table_id_or_name, $row_id, $hu switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3' !== '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\Cms\Hubdb\Model\HubDbTableRowV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2924,34 +2522,11 @@ public function replaceDraftTableRowWithHttpInfo($table_id_or_name, $row_id, $hu ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3'; - 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\Cms\Hubdb\Model\HubDbTableRowV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2961,7 +2536,7 @@ public function replaceDraftTableRowWithHttpInfo($table_id_or_name, $row_id, $hu $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2969,8 +2544,10 @@ public function replaceDraftTableRowWithHttpInfo($table_id_or_name, $row_id, $hu $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -3245,61 +2822,21 @@ public function updateDraftTableRowWithHttpInfo($table_id_or_name, $row_id, $hub switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3' !== '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\Cms\Hubdb\Model\HubDbTableRowV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -3313,34 +2850,11 @@ public function updateDraftTableRowWithHttpInfo($table_id_or_name, $row_id, $hub ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3'; - 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\Cms\Hubdb\Model\HubDbTableRowV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -3350,7 +2864,7 @@ public function updateDraftTableRowWithHttpInfo($table_id_or_name, $row_id, $hub $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3358,8 +2872,10 @@ public function updateDraftTableRowWithHttpInfo($table_id_or_name, $row_id, $hub $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -3587,6 +3103,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/Cms/Hubdb/Api/RowsBatchApi.php b/codegen/Cms/Hubdb/Api/RowsBatchApi.php index 6915d026..ce005728 100644 --- a/codegen/Cms/Hubdb/Api/RowsBatchApi.php +++ b/codegen/Cms/Hubdb/Api/RowsBatchApi.php @@ -1,7 +1,7 @@ getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3' !== '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\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -269,34 +232,11 @@ public function cloneDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input_ ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3'; - 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\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -306,7 +246,7 @@ public function cloneDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input_ $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -314,8 +254,10 @@ public function cloneDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input_ $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -567,88 +509,27 @@ public function createDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input switch($statusCode) { case 201: - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3' !== '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\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3', + $request, + $response, + ); case 207: - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors' !== '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\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -662,34 +543,11 @@ public function createDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3'; - 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\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 201: @@ -699,7 +557,7 @@ public function createDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 207: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -707,7 +565,7 @@ public function createDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -715,8 +573,10 @@ public function createDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -966,7 +826,6 @@ public function purgeDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input_ return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -976,8 +835,10 @@ public function purgeDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input_ $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1216,88 +1077,27 @@ public function readDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input_s switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3' !== '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\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3', + $request, + $response, + ); case 207: - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors' !== '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\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1311,34 +1111,11 @@ public function readDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input_s ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3'; - 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\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1348,7 +1125,7 @@ public function readDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input_s $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 207: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1356,7 +1133,7 @@ public function readDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input_s $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1364,8 +1141,10 @@ public function readDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input_s $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1617,88 +1396,27 @@ public function readTableRowsWithHttpInfo($table_id_or_name, $batch_input_string switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3' !== '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\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3', + $request, + $response, + ); case 207: - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors' !== '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\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1712,34 +1430,11 @@ public function readTableRowsWithHttpInfo($table_id_or_name, $batch_input_string ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3'; - 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\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1749,7 +1444,7 @@ public function readTableRowsWithHttpInfo($table_id_or_name, $batch_input_string $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 207: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1757,7 +1452,7 @@ public function readTableRowsWithHttpInfo($table_id_or_name, $batch_input_string $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1765,8 +1460,10 @@ public function readTableRowsWithHttpInfo($table_id_or_name, $batch_input_string $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2018,88 +1715,27 @@ public function replaceDraftTableRowsWithHttpInfo($table_id_or_name, $batch_inpu switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3' !== '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\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3', + $request, + $response, + ); case 207: - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors' !== '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\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2113,34 +1749,11 @@ public function replaceDraftTableRowsWithHttpInfo($table_id_or_name, $batch_inpu ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3'; - 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\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2150,7 +1763,7 @@ public function replaceDraftTableRowsWithHttpInfo($table_id_or_name, $batch_inpu $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 207: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2158,7 +1771,7 @@ public function replaceDraftTableRowsWithHttpInfo($table_id_or_name, $batch_inpu $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2166,8 +1779,10 @@ public function replaceDraftTableRowsWithHttpInfo($table_id_or_name, $batch_inpu $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2419,88 +2034,27 @@ public function updateDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3' !== '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\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3', + $request, + $response, + ); case 207: - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors' !== '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\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3WithErrors', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2514,34 +2068,11 @@ public function updateDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3'; - 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\Cms\Hubdb\Model\BatchResponseHubDbTableRowV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2551,7 +2082,7 @@ public function updateDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; case 207: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2559,7 +2090,7 @@ public function updateDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2567,8 +2098,10 @@ public function updateDraftTableRowsWithHttpInfo($table_id_or_name, $batch_input $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2775,6 +2308,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/Cms/Hubdb/Api/TablesApi.php b/codegen/Cms/Hubdb/Api/TablesApi.php index 169a8a22..9f2ba323 100644 --- a/codegen/Cms/Hubdb/Api/TablesApi.php +++ b/codegen/Cms/Hubdb/Api/TablesApi.php @@ -1,7 +1,7 @@ [ 'application/json', ], + 'removeTableVersion' => [ + 'application/json', + ], 'resetDraftTable' => [ 'application/json', ], @@ -218,7 +224,6 @@ public function archiveTableWithHttpInfo($table_id_or_name, string $contentType return [null, $statusCode, $response->getHeaders()]; - } catch (ApiException $e) { switch ($e->getCode()) { default: @@ -228,8 +233,10 @@ public function archiveTableWithHttpInfo($table_id_or_name, string $contentType $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -451,61 +458,21 @@ public function cloneDraftTableWithHttpInfo($table_id_or_name, $hub_db_table_clo switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3' !== '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\Cms\Hubdb\Model\HubDbTableV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -519,34 +486,11 @@ public function cloneDraftTableWithHttpInfo($table_id_or_name, $hub_db_table_clo ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3'; - 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\Cms\Hubdb\Model\HubDbTableV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -556,7 +500,7 @@ public function cloneDraftTableWithHttpInfo($table_id_or_name, $hub_db_table_clo $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -564,8 +508,10 @@ public function cloneDraftTableWithHttpInfo($table_id_or_name, $hub_db_table_clo $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -815,61 +761,21 @@ public function createTableWithHttpInfo($hub_db_table_v3_request, string $conten switch($statusCode) { case 201: - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3' !== '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\Cms\Hubdb\Model\HubDbTableV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -883,34 +789,11 @@ public function createTableWithHttpInfo($hub_db_table_v3_request, string $conten ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3'; - 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\Cms\Hubdb\Model\HubDbTableV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 201: @@ -920,7 +803,7 @@ public function createTableWithHttpInfo($hub_db_table_v3_request, string $conten $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -928,8 +811,10 @@ public function createTableWithHttpInfo($hub_db_table_v3_request, string $conten $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1163,61 +1048,21 @@ public function exportDraftTableWithHttpInfo($table_id_or_name, $format = null, switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== '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, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1231,34 +1076,11 @@ public function exportDraftTableWithHttpInfo($table_id_or_name, $format = null, ); } - $returnType = '\SplFileObject'; - 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( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1268,7 +1090,7 @@ public function exportDraftTableWithHttpInfo($table_id_or_name, $format = null, $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1276,8 +1098,10 @@ public function exportDraftTableWithHttpInfo($table_id_or_name, $format = null, $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1525,61 +1349,21 @@ public function exportTableWithHttpInfo($table_id_or_name, $format = null, strin switch($statusCode) { case 200: - if ('\SplFileObject' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\SplFileObject' !== '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, '\SplFileObject', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\SplFileObject', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1593,34 +1377,11 @@ public function exportTableWithHttpInfo($table_id_or_name, $format = null, strin ); } - $returnType = '\SplFileObject'; - 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( + '\SplFileObject', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -1630,7 +1391,7 @@ public function exportTableWithHttpInfo($table_id_or_name, $format = null, strin $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -1638,8 +1399,10 @@ public function exportTableWithHttpInfo($table_id_or_name, $format = null, strin $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -1840,17 +1603,18 @@ public function exportTableRequest($table_id_or_name, $format = null, string $co * @param \DateTime|null $updated_at Only return tables last updated at exactly the specified time. (optional) * @param \DateTime|null $updated_after Only return tables last updated after the specified time. (optional) * @param \DateTime|null $updated_before Only return tables last updated before the specified time. (optional) - * @param string|null $content_type (optional) + * @param string|null $content_type Specifies the content type for the response. (optional) * @param bool|null $archived Specifies whether to return archived tables. Defaults to `false`. (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllDraftTables'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Hubdb\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \HubSpot\Client\Cms\Hubdb\Model\CollectionResponseWithTotalHubDbTableV3ForwardPaging|\HubSpot\Client\Cms\Hubdb\Model\Error */ - public function getAllDraftTables($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, string $contentType = self::contentTypes['getAllDraftTables'][0]) + public function getAllDraftTables($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, $is_get_localized_schema = null, string $contentType = self::contentTypes['getAllDraftTables'][0]) { - list($response) = $this->getAllDraftTablesWithHttpInfo($sort, $after, $limit, $created_at, $created_after, $created_before, $updated_at, $updated_after, $updated_before, $content_type, $archived, $contentType); + list($response) = $this->getAllDraftTablesWithHttpInfo($sort, $after, $limit, $created_at, $created_after, $created_before, $updated_at, $updated_after, $updated_before, $content_type, $archived, $is_get_localized_schema, $contentType); return $response; } @@ -1868,17 +1632,18 @@ public function getAllDraftTables($sort = null, $after = null, $limit = null, $c * @param \DateTime|null $updated_at Only return tables last updated at exactly the specified time. (optional) * @param \DateTime|null $updated_after Only return tables last updated after the specified time. (optional) * @param \DateTime|null $updated_before Only return tables last updated before the specified time. (optional) - * @param string|null $content_type (optional) + * @param string|null $content_type Specifies the content type for the response. (optional) * @param bool|null $archived Specifies whether to return archived tables. Defaults to `false`. (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllDraftTables'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Hubdb\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \HubSpot\Client\Cms\Hubdb\Model\CollectionResponseWithTotalHubDbTableV3ForwardPaging|\HubSpot\Client\Cms\Hubdb\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function getAllDraftTablesWithHttpInfo($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, string $contentType = self::contentTypes['getAllDraftTables'][0]) + public function getAllDraftTablesWithHttpInfo($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, $is_get_localized_schema = null, string $contentType = self::contentTypes['getAllDraftTables'][0]) { - $request = $this->getAllDraftTablesRequest($sort, $after, $limit, $created_at, $created_after, $created_before, $updated_at, $updated_after, $updated_before, $content_type, $archived, $contentType); + $request = $this->getAllDraftTablesRequest($sort, $after, $limit, $created_at, $created_after, $created_before, $updated_at, $updated_after, $updated_before, $content_type, $archived, $is_get_localized_schema, $contentType); try { $options = $this->createHttpClientOption(); @@ -1905,61 +1670,21 @@ public function getAllDraftTablesWithHttpInfo($sort = null, $after = null, $limi switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\CollectionResponseWithTotalHubDbTableV3ForwardPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\CollectionResponseWithTotalHubDbTableV3ForwardPaging' !== '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\Cms\Hubdb\Model\CollectionResponseWithTotalHubDbTableV3ForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\CollectionResponseWithTotalHubDbTableV3ForwardPaging', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -1973,34 +1698,11 @@ public function getAllDraftTablesWithHttpInfo($sort = null, $after = null, $limi ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\CollectionResponseWithTotalHubDbTableV3ForwardPaging'; - 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\Cms\Hubdb\Model\CollectionResponseWithTotalHubDbTableV3ForwardPaging', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2010,7 +1712,7 @@ public function getAllDraftTablesWithHttpInfo($sort = null, $after = null, $limi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2018,8 +1720,10 @@ public function getAllDraftTablesWithHttpInfo($sort = null, $after = null, $limi $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2038,16 +1742,17 @@ public function getAllDraftTablesWithHttpInfo($sort = null, $after = null, $limi * @param \DateTime|null $updated_at Only return tables last updated at exactly the specified time. (optional) * @param \DateTime|null $updated_after Only return tables last updated after the specified time. (optional) * @param \DateTime|null $updated_before Only return tables last updated before the specified time. (optional) - * @param string|null $content_type (optional) + * @param string|null $content_type Specifies the content type for the response. (optional) * @param bool|null $archived Specifies whether to return archived tables. Defaults to `false`. (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllDraftTables'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAllDraftTablesAsync($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, string $contentType = self::contentTypes['getAllDraftTables'][0]) + public function getAllDraftTablesAsync($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, $is_get_localized_schema = null, string $contentType = self::contentTypes['getAllDraftTables'][0]) { - return $this->getAllDraftTablesAsyncWithHttpInfo($sort, $after, $limit, $created_at, $created_after, $created_before, $updated_at, $updated_after, $updated_before, $content_type, $archived, $contentType) + return $this->getAllDraftTablesAsyncWithHttpInfo($sort, $after, $limit, $created_at, $created_after, $created_before, $updated_at, $updated_after, $updated_before, $content_type, $archived, $is_get_localized_schema, $contentType) ->then( function ($response) { return $response[0]; @@ -2069,17 +1774,18 @@ function ($response) { * @param \DateTime|null $updated_at Only return tables last updated at exactly the specified time. (optional) * @param \DateTime|null $updated_after Only return tables last updated after the specified time. (optional) * @param \DateTime|null $updated_before Only return tables last updated before the specified time. (optional) - * @param string|null $content_type (optional) + * @param string|null $content_type Specifies the content type for the response. (optional) * @param bool|null $archived Specifies whether to return archived tables. Defaults to `false`. (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllDraftTables'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAllDraftTablesAsyncWithHttpInfo($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, string $contentType = self::contentTypes['getAllDraftTables'][0]) + public function getAllDraftTablesAsyncWithHttpInfo($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, $is_get_localized_schema = null, string $contentType = self::contentTypes['getAllDraftTables'][0]) { $returnType = '\HubSpot\Client\Cms\Hubdb\Model\CollectionResponseWithTotalHubDbTableV3ForwardPaging'; - $request = $this->getAllDraftTablesRequest($sort, $after, $limit, $created_at, $created_after, $created_before, $updated_at, $updated_after, $updated_before, $content_type, $archived, $contentType); + $request = $this->getAllDraftTablesRequest($sort, $after, $limit, $created_at, $created_after, $created_before, $updated_at, $updated_after, $updated_before, $content_type, $archived, $is_get_localized_schema, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2129,14 +1835,15 @@ function ($exception) { * @param \DateTime|null $updated_at Only return tables last updated at exactly the specified time. (optional) * @param \DateTime|null $updated_after Only return tables last updated after the specified time. (optional) * @param \DateTime|null $updated_before Only return tables last updated before the specified time. (optional) - * @param string|null $content_type (optional) + * @param string|null $content_type Specifies the content type for the response. (optional) * @param bool|null $archived Specifies whether to return archived tables. Defaults to `false`. (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllDraftTables'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getAllDraftTablesRequest($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, string $contentType = self::contentTypes['getAllDraftTables'][0]) + public function getAllDraftTablesRequest($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, $is_get_localized_schema = null, string $contentType = self::contentTypes['getAllDraftTables'][0]) { @@ -2151,6 +1858,7 @@ public function getAllDraftTablesRequest($sort = null, $after = null, $limit = n + $resourcePath = '/cms/v3/hubdb/tables/draft'; $formParams = []; $queryParams = []; @@ -2257,6 +1965,15 @@ public function getAllDraftTablesRequest($sort = null, $after = null, $limit = n true, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_get_localized_schema, + 'isGetLocalizedSchema', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); @@ -2332,17 +2049,18 @@ public function getAllDraftTablesRequest($sort = null, $after = null, $limit = n * @param \DateTime|null $updated_at Only return tables last updated at exactly the specified time. (optional) * @param \DateTime|null $updated_after Only return tables last updated after the specified time. (optional) * @param \DateTime|null $updated_before Only return tables last updated before the specified time. (optional) - * @param string|null $content_type (optional) + * @param string|null $content_type Specifies the content type for the response. (optional) * @param bool|null $archived Specifies whether to return archived tables. Defaults to `false`. (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the tables. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllTables'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Hubdb\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return \HubSpot\Client\Cms\Hubdb\Model\CollectionResponseWithTotalHubDbTableV3ForwardPaging|\HubSpot\Client\Cms\Hubdb\Model\Error */ - public function getAllTables($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, string $contentType = self::contentTypes['getAllTables'][0]) + public function getAllTables($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, $is_get_localized_schema = null, string $contentType = self::contentTypes['getAllTables'][0]) { - list($response) = $this->getAllTablesWithHttpInfo($sort, $after, $limit, $created_at, $created_after, $created_before, $updated_at, $updated_after, $updated_before, $content_type, $archived, $contentType); + list($response) = $this->getAllTablesWithHttpInfo($sort, $after, $limit, $created_at, $created_after, $created_before, $updated_at, $updated_after, $updated_before, $content_type, $archived, $is_get_localized_schema, $contentType); return $response; } @@ -2360,17 +2078,18 @@ public function getAllTables($sort = null, $after = null, $limit = null, $create * @param \DateTime|null $updated_at Only return tables last updated at exactly the specified time. (optional) * @param \DateTime|null $updated_after Only return tables last updated after the specified time. (optional) * @param \DateTime|null $updated_before Only return tables last updated before the specified time. (optional) - * @param string|null $content_type (optional) + * @param string|null $content_type Specifies the content type for the response. (optional) * @param bool|null $archived Specifies whether to return archived tables. Defaults to `false`. (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the tables. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllTables'] to see the possible values for this operation * * @throws \HubSpot\Client\Cms\Hubdb\ApiException on non-2xx response or if the response body is not in the expected format * @throws \InvalidArgumentException * @return array of \HubSpot\Client\Cms\Hubdb\Model\CollectionResponseWithTotalHubDbTableV3ForwardPaging|\HubSpot\Client\Cms\Hubdb\Model\Error, HTTP status code, HTTP response headers (array of strings) */ - public function getAllTablesWithHttpInfo($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, string $contentType = self::contentTypes['getAllTables'][0]) + public function getAllTablesWithHttpInfo($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, $is_get_localized_schema = null, string $contentType = self::contentTypes['getAllTables'][0]) { - $request = $this->getAllTablesRequest($sort, $after, $limit, $created_at, $created_after, $created_before, $updated_at, $updated_after, $updated_before, $content_type, $archived, $contentType); + $request = $this->getAllTablesRequest($sort, $after, $limit, $created_at, $created_after, $created_before, $updated_at, $updated_after, $updated_before, $content_type, $archived, $is_get_localized_schema, $contentType); try { $options = $this->createHttpClientOption(); @@ -2397,61 +2116,21 @@ public function getAllTablesWithHttpInfo($sort = null, $after = null, $limit = n switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\CollectionResponseWithTotalHubDbTableV3ForwardPaging' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\CollectionResponseWithTotalHubDbTableV3ForwardPaging' !== '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\Cms\Hubdb\Model\CollectionResponseWithTotalHubDbTableV3ForwardPaging', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\CollectionResponseWithTotalHubDbTableV3ForwardPaging', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2465,34 +2144,11 @@ public function getAllTablesWithHttpInfo($sort = null, $after = null, $limit = n ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\CollectionResponseWithTotalHubDbTableV3ForwardPaging'; - 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\Cms\Hubdb\Model\CollectionResponseWithTotalHubDbTableV3ForwardPaging', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2502,7 +2158,7 @@ public function getAllTablesWithHttpInfo($sort = null, $after = null, $limit = n $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2510,8 +2166,10 @@ public function getAllTablesWithHttpInfo($sort = null, $after = null, $limit = n $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -2530,16 +2188,17 @@ public function getAllTablesWithHttpInfo($sort = null, $after = null, $limit = n * @param \DateTime|null $updated_at Only return tables last updated at exactly the specified time. (optional) * @param \DateTime|null $updated_after Only return tables last updated after the specified time. (optional) * @param \DateTime|null $updated_before Only return tables last updated before the specified time. (optional) - * @param string|null $content_type (optional) + * @param string|null $content_type Specifies the content type for the response. (optional) * @param bool|null $archived Specifies whether to return archived tables. Defaults to `false`. (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the tables. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllTables'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAllTablesAsync($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, string $contentType = self::contentTypes['getAllTables'][0]) + public function getAllTablesAsync($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, $is_get_localized_schema = null, string $contentType = self::contentTypes['getAllTables'][0]) { - return $this->getAllTablesAsyncWithHttpInfo($sort, $after, $limit, $created_at, $created_after, $created_before, $updated_at, $updated_after, $updated_before, $content_type, $archived, $contentType) + return $this->getAllTablesAsyncWithHttpInfo($sort, $after, $limit, $created_at, $created_after, $created_before, $updated_at, $updated_after, $updated_before, $content_type, $archived, $is_get_localized_schema, $contentType) ->then( function ($response) { return $response[0]; @@ -2561,17 +2220,18 @@ function ($response) { * @param \DateTime|null $updated_at Only return tables last updated at exactly the specified time. (optional) * @param \DateTime|null $updated_after Only return tables last updated after the specified time. (optional) * @param \DateTime|null $updated_before Only return tables last updated before the specified time. (optional) - * @param string|null $content_type (optional) + * @param string|null $content_type Specifies the content type for the response. (optional) * @param bool|null $archived Specifies whether to return archived tables. Defaults to `false`. (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the tables. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllTables'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Promise\PromiseInterface */ - public function getAllTablesAsyncWithHttpInfo($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, string $contentType = self::contentTypes['getAllTables'][0]) + public function getAllTablesAsyncWithHttpInfo($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, $is_get_localized_schema = null, string $contentType = self::contentTypes['getAllTables'][0]) { $returnType = '\HubSpot\Client\Cms\Hubdb\Model\CollectionResponseWithTotalHubDbTableV3ForwardPaging'; - $request = $this->getAllTablesRequest($sort, $after, $limit, $created_at, $created_after, $created_before, $updated_at, $updated_after, $updated_before, $content_type, $archived, $contentType); + $request = $this->getAllTablesRequest($sort, $after, $limit, $created_at, $created_after, $created_before, $updated_at, $updated_after, $updated_before, $content_type, $archived, $is_get_localized_schema, $contentType); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -2621,14 +2281,15 @@ function ($exception) { * @param \DateTime|null $updated_at Only return tables last updated at exactly the specified time. (optional) * @param \DateTime|null $updated_after Only return tables last updated after the specified time. (optional) * @param \DateTime|null $updated_before Only return tables last updated before the specified time. (optional) - * @param string|null $content_type (optional) + * @param string|null $content_type Specifies the content type for the response. (optional) * @param bool|null $archived Specifies whether to return archived tables. Defaults to `false`. (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the tables. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getAllTables'] to see the possible values for this operation * * @throws \InvalidArgumentException * @return \GuzzleHttp\Psr7\Request */ - public function getAllTablesRequest($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, string $contentType = self::contentTypes['getAllTables'][0]) + public function getAllTablesRequest($sort = null, $after = null, $limit = null, $created_at = null, $created_after = null, $created_before = null, $updated_at = null, $updated_after = null, $updated_before = null, $content_type = null, $archived = null, $is_get_localized_schema = null, string $contentType = self::contentTypes['getAllTables'][0]) { @@ -2643,6 +2304,7 @@ public function getAllTablesRequest($sort = null, $after = null, $limit = null, + $resourcePath = '/cms/v3/hubdb/tables'; $formParams = []; $queryParams = []; @@ -2749,6 +2411,15 @@ public function getAllTablesRequest($sort = null, $after = null, $limit = null, true, // explode false // required ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $is_get_localized_schema, + 'isGetLocalizedSchema', // param base name + 'boolean', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); @@ -2816,7 +2487,7 @@ public function getAllTablesRequest($sort = null, $after = null, $limit = null, * Get details for a draft table * * @param string $table_id_or_name The ID or name of the table to return. (required) - * @param bool|null $is_get_localized_schema (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the table. (optional) * @param bool|null $archived Set this to `true` to return an archived table. Defaults to `false`. (optional) * @param bool|null $include_foreign_ids Set this to `true` to populate foreign ID values in the result. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDraftTableDetailsById'] to see the possible values for this operation @@ -2837,7 +2508,7 @@ public function getDraftTableDetailsById($table_id_or_name, $is_get_localized_sc * Get details for a draft table * * @param string $table_id_or_name The ID or name of the table to return. (required) - * @param bool|null $is_get_localized_schema (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the table. (optional) * @param bool|null $archived Set this to `true` to return an archived table. Defaults to `false`. (optional) * @param bool|null $include_foreign_ids Set this to `true` to populate foreign ID values in the result. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDraftTableDetailsById'] to see the possible values for this operation @@ -2875,61 +2546,21 @@ public function getDraftTableDetailsByIdWithHttpInfo($table_id_or_name, $is_get_ switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3' !== '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\Cms\Hubdb\Model\HubDbTableV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -2943,34 +2574,11 @@ public function getDraftTableDetailsByIdWithHttpInfo($table_id_or_name, $is_get_ ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3'; - 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\Cms\Hubdb\Model\HubDbTableV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -2980,7 +2588,7 @@ public function getDraftTableDetailsByIdWithHttpInfo($table_id_or_name, $is_get_ $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -2988,8 +2596,10 @@ public function getDraftTableDetailsByIdWithHttpInfo($table_id_or_name, $is_get_ $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -3000,7 +2610,7 @@ public function getDraftTableDetailsByIdWithHttpInfo($table_id_or_name, $is_get_ * Get details for a draft table * * @param string $table_id_or_name The ID or name of the table to return. (required) - * @param bool|null $is_get_localized_schema (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the table. (optional) * @param bool|null $archived Set this to `true` to return an archived table. Defaults to `false`. (optional) * @param bool|null $include_foreign_ids Set this to `true` to populate foreign ID values in the result. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDraftTableDetailsById'] to see the possible values for this operation @@ -3024,7 +2634,7 @@ function ($response) { * Get details for a draft table * * @param string $table_id_or_name The ID or name of the table to return. (required) - * @param bool|null $is_get_localized_schema (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the table. (optional) * @param bool|null $archived Set this to `true` to return an archived table. Defaults to `false`. (optional) * @param bool|null $include_foreign_ids Set this to `true` to populate foreign ID values in the result. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDraftTableDetailsById'] to see the possible values for this operation @@ -3077,7 +2687,7 @@ function ($exception) { * Create request for operation 'getDraftTableDetailsById' * * @param string $table_id_or_name The ID or name of the table to return. (required) - * @param bool|null $is_get_localized_schema (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the table. (optional) * @param bool|null $archived Set this to `true` to return an archived table. Defaults to `false`. (optional) * @param bool|null $include_foreign_ids Set this to `true` to populate foreign ID values in the result. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getDraftTableDetailsById'] to see the possible values for this operation @@ -3208,7 +2818,7 @@ public function getDraftTableDetailsByIdRequest($table_id_or_name, $is_get_local * Get details of a published table * * @param string $table_id_or_name The ID or name of the table to return. (required) - * @param bool|null $is_get_localized_schema (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the tables. (optional) * @param bool|null $archived Set this to `true` to return details for an archived table. Defaults to `false`. (optional) * @param bool|null $include_foreign_ids Set this to `true` to populate foreign ID values in the result. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTableDetails'] to see the possible values for this operation @@ -3229,7 +2839,7 @@ public function getTableDetails($table_id_or_name, $is_get_localized_schema = nu * Get details of a published table * * @param string $table_id_or_name The ID or name of the table to return. (required) - * @param bool|null $is_get_localized_schema (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the tables. (optional) * @param bool|null $archived Set this to `true` to return details for an archived table. Defaults to `false`. (optional) * @param bool|null $include_foreign_ids Set this to `true` to populate foreign ID values in the result. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTableDetails'] to see the possible values for this operation @@ -3267,61 +2877,21 @@ public function getTableDetailsWithHttpInfo($table_id_or_name, $is_get_localized switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3' !== '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\Cms\Hubdb\Model\HubDbTableV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -3335,34 +2905,11 @@ public function getTableDetailsWithHttpInfo($table_id_or_name, $is_get_localized ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3'; - 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\Cms\Hubdb\Model\HubDbTableV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -3372,7 +2919,7 @@ public function getTableDetailsWithHttpInfo($table_id_or_name, $is_get_localized $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3380,8 +2927,10 @@ public function getTableDetailsWithHttpInfo($table_id_or_name, $is_get_localized $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -3392,7 +2941,7 @@ public function getTableDetailsWithHttpInfo($table_id_or_name, $is_get_localized * Get details of a published table * * @param string $table_id_or_name The ID or name of the table to return. (required) - * @param bool|null $is_get_localized_schema (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the tables. (optional) * @param bool|null $archived Set this to `true` to return details for an archived table. Defaults to `false`. (optional) * @param bool|null $include_foreign_ids Set this to `true` to populate foreign ID values in the result. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTableDetails'] to see the possible values for this operation @@ -3416,7 +2965,7 @@ function ($response) { * Get details of a published table * * @param string $table_id_or_name The ID or name of the table to return. (required) - * @param bool|null $is_get_localized_schema (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the tables. (optional) * @param bool|null $archived Set this to `true` to return details for an archived table. Defaults to `false`. (optional) * @param bool|null $include_foreign_ids Set this to `true` to populate foreign ID values in the result. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTableDetails'] to see the possible values for this operation @@ -3469,7 +3018,7 @@ function ($exception) { * Create request for operation 'getTableDetails' * * @param string $table_id_or_name The ID or name of the table to return. (required) - * @param bool|null $is_get_localized_schema (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the tables. (optional) * @param bool|null $archived Set this to `true` to return details for an archived table. Defaults to `false`. (optional) * @param bool|null $include_foreign_ids Set this to `true` to populate foreign ID values in the result. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['getTableDetails'] to see the possible values for this operation @@ -3657,61 +3206,21 @@ public function importDraftTableWithHttpInfo($table_id_or_name, $config = null, switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\ImportResult' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\ImportResult' !== '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\Cms\Hubdb\Model\ImportResult', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\ImportResult', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -3725,34 +3234,11 @@ public function importDraftTableWithHttpInfo($table_id_or_name, $config = null, ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\ImportResult'; - 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\Cms\Hubdb\Model\ImportResult', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -3762,7 +3248,7 @@ public function importDraftTableWithHttpInfo($table_id_or_name, $config = null, $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -3770,8 +3256,10 @@ public function importDraftTableWithHttpInfo($table_id_or_name, $config = null, $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -3896,21 +3384,15 @@ public function importDraftTableRequest($table_id_or_name, $config = null, $file } // form params - if ($config !== null) { - $formParams['config'] = ObjectSerializer::toFormValue($config); - } - // form params - if ($file !== null) { - $multipart = true; - $formParams['file'] = []; - $paramFiles = is_array($file) ? $file : [$file]; - foreach ($paramFiles as $paramFile) { - $formParams['file'][] = \GuzzleHttp\Psr7\Utils::tryFopen( - ObjectSerializer::toFormValue($paramFile), - 'rb' - ); - } - } + $formDataProcessor = new FormDataProcessor(); + + $formData = $formDataProcessor->prepare([ + 'config' => $config, + 'file' => $file, + ]); + + $formParams = $formDataProcessor->flatten($formData); + $multipart = $formDataProcessor->has_file; $multipart = true; $headers = $this->headerSelector->selectHeaders( @@ -4031,61 +3513,21 @@ public function publishDraftTableWithHttpInfo($table_id_or_name, $include_foreig switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3' !== '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\Cms\Hubdb\Model\HubDbTableV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -4099,34 +3541,11 @@ public function publishDraftTableWithHttpInfo($table_id_or_name, $include_foreig ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3'; - 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\Cms\Hubdb\Model\HubDbTableV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -4136,7 +3555,7 @@ public function publishDraftTableWithHttpInfo($table_id_or_name, $include_foreig $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4144,8 +3563,10 @@ public function publishDraftTableWithHttpInfo($table_id_or_name, $include_foreig $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -4332,6 +3753,259 @@ public function publishDraftTableRequest($table_id_or_name, $include_foreign_ids ); } + /** + * Operation removeTableVersion + * + * Delete a table version + * + * @param string $table_id_or_name The ID or name of the table whose version is to be deleted. (required) + * @param int $version_id The ID of the specific version of the table to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeTableVersion'] to see the possible values for this operation + * + * @throws \HubSpot\Client\Cms\Hubdb\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function removeTableVersion($table_id_or_name, $version_id, string $contentType = self::contentTypes['removeTableVersion'][0]) + { + $this->removeTableVersionWithHttpInfo($table_id_or_name, $version_id, $contentType); + } + + /** + * Operation removeTableVersionWithHttpInfo + * + * Delete a table version + * + * @param string $table_id_or_name The ID or name of the table whose version is to be deleted. (required) + * @param int $version_id The ID of the specific version of the table to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeTableVersion'] to see the possible values for this operation + * + * @throws \HubSpot\Client\Cms\Hubdb\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 removeTableVersionWithHttpInfo($table_id_or_name, $version_id, string $contentType = self::contentTypes['removeTableVersion'][0]) + { + $request = $this->removeTableVersionRequest($table_id_or_name, $version_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(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + default: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation removeTableVersionAsync + * + * Delete a table version + * + * @param string $table_id_or_name The ID or name of the table whose version is to be deleted. (required) + * @param int $version_id The ID of the specific version of the table to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeTableVersion'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function removeTableVersionAsync($table_id_or_name, $version_id, string $contentType = self::contentTypes['removeTableVersion'][0]) + { + return $this->removeTableVersionAsyncWithHttpInfo($table_id_or_name, $version_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation removeTableVersionAsyncWithHttpInfo + * + * Delete a table version + * + * @param string $table_id_or_name The ID or name of the table whose version is to be deleted. (required) + * @param int $version_id The ID of the specific version of the table to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeTableVersion'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function removeTableVersionAsyncWithHttpInfo($table_id_or_name, $version_id, string $contentType = self::contentTypes['removeTableVersion'][0]) + { + $returnType = ''; + $request = $this->removeTableVersionRequest($table_id_or_name, $version_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $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 'removeTableVersion' + * + * @param string $table_id_or_name The ID or name of the table whose version is to be deleted. (required) + * @param int $version_id The ID of the specific version of the table to delete. (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['removeTableVersion'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function removeTableVersionRequest($table_id_or_name, $version_id, string $contentType = self::contentTypes['removeTableVersion'][0]) + { + + // verify the required parameter 'table_id_or_name' is set + if ($table_id_or_name === null || (is_array($table_id_or_name) && count($table_id_or_name) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $table_id_or_name when calling removeTableVersion' + ); + } + + // verify the required parameter 'version_id' is set + if ($version_id === null || (is_array($version_id) && count($version_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $version_id when calling removeTableVersion' + ); + } + if (!preg_match("/\\d+/", $version_id)) { + throw new \InvalidArgumentException("invalid value for \"version_id\" when calling TablesApi.removeTableVersion, must conform to the pattern /\\d+/."); + } + + + $resourcePath = '/cms/v3/hubdb/tables/{tableIdOrName}/versions/{versionId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($table_id_or_name !== null) { + $resourcePath = str_replace( + '{' . 'tableIdOrName' . '}', + ObjectSerializer::toPathValue($table_id_or_name), + $resourcePath + ); + } + // path params + if ($version_id !== null) { + $resourcePath = str_replace( + '{' . 'versionId' . '}', + ObjectSerializer::toPathValue($version_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['*/*', ], + $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( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Operation resetDraftTable * @@ -4393,61 +4067,21 @@ public function resetDraftTableWithHttpInfo($table_id_or_name, $include_foreign_ switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3' !== '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\Cms\Hubdb\Model\HubDbTableV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -4461,34 +4095,11 @@ public function resetDraftTableWithHttpInfo($table_id_or_name, $include_foreign_ ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3'; - 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\Cms\Hubdb\Model\HubDbTableV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -4498,7 +4109,7 @@ public function resetDraftTableWithHttpInfo($table_id_or_name, $include_foreign_ $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4506,8 +4117,10 @@ public function resetDraftTableWithHttpInfo($table_id_or_name, $include_foreign_ $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -4755,61 +4368,21 @@ public function unpublishTableWithHttpInfo($table_id_or_name, $include_foreign_i switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3' !== '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\Cms\Hubdb\Model\HubDbTableV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -4823,34 +4396,11 @@ public function unpublishTableWithHttpInfo($table_id_or_name, $include_foreign_i ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3'; - 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\Cms\Hubdb\Model\HubDbTableV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -4860,7 +4410,7 @@ public function unpublishTableWithHttpInfo($table_id_or_name, $include_foreign_i $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -4868,8 +4418,10 @@ public function unpublishTableWithHttpInfo($table_id_or_name, $include_foreign_i $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -5063,7 +4615,7 @@ public function unpublishTableRequest($table_id_or_name, $include_foreign_ids = * * @param string $table_id_or_name The ID or name of the table to update. (required) * @param \HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3Request $hub_db_table_v3_request hub_db_table_v3_request (required) - * @param bool|null $is_get_localized_schema (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the table. (optional) * @param bool|null $archived Specifies whether to return archived tables. Defaults to `false`. (optional) * @param bool|null $include_foreign_ids Set this to `true` to populate foreign ID values in the result. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDraftTable'] to see the possible values for this operation @@ -5085,7 +4637,7 @@ public function updateDraftTable($table_id_or_name, $hub_db_table_v3_request, $i * * @param string $table_id_or_name The ID or name of the table to update. (required) * @param \HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3Request $hub_db_table_v3_request (required) - * @param bool|null $is_get_localized_schema (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the table. (optional) * @param bool|null $archived Specifies whether to return archived tables. Defaults to `false`. (optional) * @param bool|null $include_foreign_ids Set this to `true` to populate foreign ID values in the result. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDraftTable'] to see the possible values for this operation @@ -5123,61 +4675,21 @@ public function updateDraftTableWithHttpInfo($table_id_or_name, $hub_db_table_v3 switch($statusCode) { case 200: - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3' !== '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\Cms\Hubdb\Model\HubDbTableV3', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3', + $request, + $response, + ); default: - if ('\HubSpot\Client\Cms\Hubdb\Model\Error' === '\SplFileObject') { - $content = $response->getBody(); //stream goes to serializer - } else { - $content = (string) $response->getBody(); - if ('\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\Error', []), - $response->getStatusCode(), - $response->getHeaders() - ]; + return $this->handleResponseWithDataType( + '\HubSpot\Client\Cms\Hubdb\Model\Error', + $request, + $response, + ); } + + if ($statusCode < 200 || $statusCode > 299) { throw new ApiException( sprintf( @@ -5191,34 +4703,11 @@ public function updateDraftTableWithHttpInfo($table_id_or_name, $hub_db_table_v3 ); } - $returnType = '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3'; - 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\Cms\Hubdb\Model\HubDbTableV3', + $request, + $response, + ); } catch (ApiException $e) { switch ($e->getCode()) { case 200: @@ -5228,7 +4717,7 @@ public function updateDraftTableWithHttpInfo($table_id_or_name, $hub_db_table_v3 $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; default: $data = ObjectSerializer::deserialize( $e->getResponseBody(), @@ -5236,8 +4725,10 @@ public function updateDraftTableWithHttpInfo($table_id_or_name, $hub_db_table_v3 $e->getResponseHeaders() ); $e->setResponseObject($data); - break; + throw $e; } + + throw $e; } } @@ -5249,7 +4740,7 @@ public function updateDraftTableWithHttpInfo($table_id_or_name, $hub_db_table_v3 * * @param string $table_id_or_name The ID or name of the table to update. (required) * @param \HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3Request $hub_db_table_v3_request (required) - * @param bool|null $is_get_localized_schema (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the table. (optional) * @param bool|null $archived Specifies whether to return archived tables. Defaults to `false`. (optional) * @param bool|null $include_foreign_ids Set this to `true` to populate foreign ID values in the result. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDraftTable'] to see the possible values for this operation @@ -5274,7 +4765,7 @@ function ($response) { * * @param string $table_id_or_name The ID or name of the table to update. (required) * @param \HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3Request $hub_db_table_v3_request (required) - * @param bool|null $is_get_localized_schema (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the table. (optional) * @param bool|null $archived Specifies whether to return archived tables. Defaults to `false`. (optional) * @param bool|null $include_foreign_ids Set this to `true` to populate foreign ID values in the result. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDraftTable'] to see the possible values for this operation @@ -5328,7 +4819,7 @@ function ($exception) { * * @param string $table_id_or_name The ID or name of the table to update. (required) * @param \HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3Request $hub_db_table_v3_request (required) - * @param bool|null $is_get_localized_schema (optional) + * @param bool|null $is_get_localized_schema Indicates whether to retrieve the localized schema for the table. (optional) * @param bool|null $archived Specifies whether to return archived tables. Defaults to `false`. (optional) * @param bool|null $include_foreign_ids Set this to `true` to populate foreign ID values in the result. (optional) * @param string $contentType The value for the Content-Type header. Check self::contentTypes['updateDraftTable'] to see the possible values for this operation @@ -5483,6 +4974,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/Cms/Hubdb/ApiException.php b/codegen/Cms/Hubdb/ApiException.php index 6926824e..d675ac38 100644 --- a/codegen/Cms/Hubdb/ApiException.php +++ b/codegen/Cms/Hubdb/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/Cms/Hubdb/FormDataProcessor.php b/codegen/Cms/Hubdb/FormDataProcessor.php new file mode 100644 index 00000000..1ef1ed45 --- /dev/null +++ b/codegen/Cms/Hubdb/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/Cms/Hubdb/HeaderSelector.php b/codegen/Cms/Hubdb/HeaderSelector.php index 637d0935..14dfd7af 100644 --- a/codegen/Cms/Hubdb/HeaderSelector.php +++ b/codegen/Cms/Hubdb/HeaderSelector.php @@ -1,7 +1,7 @@ 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/Cms/Hubdb/Model/BatchInputHubDbTableRowV3BatchUpdateRequest.php b/codegen/Cms/Hubdb/Model/BatchInputHubDbTableRowV3BatchUpdateRequest.php index c000566f..9a7c4def 100644 --- a/codegen/Cms/Hubdb/Model/BatchInputHubDbTableRowV3BatchUpdateRequest.php +++ b/codegen/Cms/Hubdb/Model/BatchInputHubDbTableRowV3BatchUpdateRequest.php @@ -2,7 +2,7 @@ /** * BatchInputHubDbTableRowV3BatchUpdateRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -321,11 +321,11 @@ public function setInputs($inputs) /** * 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/Cms/Hubdb/Model/BatchInputHubDbTableRowV3Request.php b/codegen/Cms/Hubdb/Model/BatchInputHubDbTableRowV3Request.php index 3293a98b..82620542 100644 --- a/codegen/Cms/Hubdb/Model/BatchInputHubDbTableRowV3Request.php +++ b/codegen/Cms/Hubdb/Model/BatchInputHubDbTableRowV3Request.php @@ -2,7 +2,7 @@ /** * BatchInputHubDbTableRowV3Request * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -305,7 +305,7 @@ public function getInputs() /** * Sets inputs * - * @param \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3Request[] $inputs + * @param \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3Request[] $inputs inputs * * @return self */ @@ -321,11 +321,11 @@ public function setInputs($inputs) /** * 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/Cms/Hubdb/Model/BatchInputString.php b/codegen/Cms/Hubdb/Model/BatchInputString.php index fd434a82..79c3a4d4 100644 --- a/codegen/Cms/Hubdb/Model/BatchInputString.php +++ b/codegen/Cms/Hubdb/Model/BatchInputString.php @@ -2,7 +2,7 @@ /** * BatchInputString * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -305,7 +305,7 @@ public function getInputs() /** * Sets inputs * - * @param string[] $inputs + * @param string[] $inputs inputs * * @return self */ @@ -321,11 +321,11 @@ public function setInputs($inputs) /** * 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/Cms/Hubdb/Model/BatchResponseHubDbTableRowV3.php b/codegen/Cms/Hubdb/Model/BatchResponseHubDbTableRowV3.php index a2f5fcc2..27b7afde 100644 --- a/codegen/Cms/Hubdb/Model/BatchResponseHubDbTableRowV3.php +++ b/codegen/Cms/Hubdb/Model/BatchResponseHubDbTableRowV3.php @@ -2,7 +2,7 @@ /** * BatchResponseHubDbTableRowV3 * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -58,10 +58,10 @@ class BatchResponseHubDbTableRowV3 implements ModelInterface, ArrayAccess, \Json */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', - 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', 'links' => 'array', + 'requested_at' => '\DateTime', 'results' => '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[]', + 'started_at' => '\DateTime', 'status' => 'string' ]; @@ -74,10 +74,10 @@ class BatchResponseHubDbTableRowV3 implements ModelInterface, ArrayAccess, \Json */ protected static $openAPIFormats = [ 'completed_at' => 'date-time', - 'requested_at' => 'date-time', - 'started_at' => 'date-time', 'links' => null, + 'requested_at' => 'date-time', 'results' => null, + 'started_at' => 'date-time', 'status' => null ]; @@ -88,10 +88,10 @@ class BatchResponseHubDbTableRowV3 implements ModelInterface, ArrayAccess, \Json */ protected static array $openAPINullables = [ 'completed_at' => false, - 'requested_at' => false, - 'started_at' => false, 'links' => false, + 'requested_at' => false, 'results' => false, + 'started_at' => false, 'status' => false ]; @@ -182,10 +182,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'completed_at' => 'completedAt', - 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', 'links' => 'links', + 'requested_at' => 'requestedAt', 'results' => 'results', + 'started_at' => 'startedAt', 'status' => 'status' ]; @@ -196,10 +196,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'completed_at' => 'setCompletedAt', - 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', 'links' => 'setLinks', + 'requested_at' => 'setRequestedAt', 'results' => 'setResults', + 'started_at' => 'setStartedAt', 'status' => 'setStatus' ]; @@ -210,10 +210,10 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'completed_at' => 'getCompletedAt', - 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', 'links' => 'getLinks', + 'requested_at' => 'getRequestedAt', 'results' => 'getResults', + 'started_at' => 'getStartedAt', 'status' => 'getStatus' ]; @@ -258,10 +258,10 @@ public function getModelName() return self::$openAPIModelName; } - public const STATUS_PENDING = 'PENDING'; - public const STATUS_PROCESSING = 'PROCESSING'; public const STATUS_CANCELED = 'CANCELED'; public const STATUS_COMPLETE = 'COMPLETE'; + public const STATUS_PENDING = 'PENDING'; + public const STATUS_PROCESSING = 'PROCESSING'; /** * Gets allowable values of the enum @@ -271,10 +271,10 @@ public function getModelName() public function getStatusAllowableValues() { return [ - self::STATUS_PENDING, - self::STATUS_PROCESSING, self::STATUS_CANCELED, self::STATUS_COMPLETE, + self::STATUS_PENDING, + self::STATUS_PROCESSING, ]; } @@ -294,10 +294,10 @@ public function getStatusAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('completed_at', $data ?? [], null); - $this->setIfExists('requested_at', $data ?? [], null); - $this->setIfExists('started_at', $data ?? [], null); $this->setIfExists('links', $data ?? [], null); + $this->setIfExists('requested_at', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('started_at', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); } @@ -328,6 +328,18 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['completed_at'] === null) { + $invalidProperties[] = "'completed_at' can't be null"; + } + if ($this->container['results'] === null) { + $invalidProperties[] = "'results' can't be null"; + } + if ($this->container['started_at'] === null) { + $invalidProperties[] = "'started_at' can't be null"; + } + if ($this->container['status'] === null) { + $invalidProperties[] = "'status' can't be null"; + } $allowedValues = $this->getStatusAllowableValues(); if (!is_null($this->container['status']) && !in_array($this->container['status'], $allowedValues, true)) { $invalidProperties[] = sprintf( @@ -355,7 +367,7 @@ public function valid() /** * Gets completed_at * - * @return \DateTime|null + * @return \DateTime */ public function getCompletedAt() { @@ -365,7 +377,7 @@ public function getCompletedAt() /** * Sets completed_at * - * @param \DateTime|null $completed_at completed_at + * @param \DateTime $completed_at The timestamp indicating when the batch processing was completed. * * @return self */ @@ -380,109 +392,109 @@ public function setCompletedAt($completed_at) } /** - * Gets requested_at + * Gets links * - * @return \DateTime|null + * @return array|null */ - public function getRequestedAt() + public function getLinks() { - return $this->container['requested_at']; + return $this->container['links']; } /** - * Sets requested_at + * Sets links * - * @param \DateTime|null $requested_at requested_at + * @param array|null $links A collection of related links associated with the batch response. * * @return self */ - public function setRequestedAt($requested_at) + public function setLinks($links) { - if (is_null($requested_at)) { - throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['requested_at'] = $requested_at; + $this->container['links'] = $links; return $this; } /** - * Gets started_at + * Gets requested_at * * @return \DateTime|null */ - public function getStartedAt() + public function getRequestedAt() { - return $this->container['started_at']; + return $this->container['requested_at']; } /** - * Sets started_at + * Sets requested_at * - * @param \DateTime|null $started_at started_at + * @param \DateTime|null $requested_at The timestamp indicating when the batch request was made. * * @return self */ - public function setStartedAt($started_at) + public function setRequestedAt($requested_at) { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + if (is_null($requested_at)) { + throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); } - $this->container['started_at'] = $started_at; + $this->container['requested_at'] = $requested_at; return $this; } /** - * Gets links + * Gets results * - * @return array|null + * @return \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[] */ - public function getLinks() + public function getResults() { - return $this->container['links']; + return $this->container['results']; } /** - * Sets links + * Sets results * - * @param array|null $links links + * @param \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[] $results results * * @return self */ - public function setLinks($links) + public function setResults($results) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); } - $this->container['links'] = $links; + $this->container['results'] = $results; return $this; } /** - * Gets results + * Gets started_at * - * @return \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[]|null + * @return \DateTime */ - public function getResults() + public function getStartedAt() { - return $this->container['results']; + return $this->container['started_at']; } /** - * Sets results + * Sets started_at * - * @param \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[]|null $results results + * @param \DateTime $started_at The timestamp indicating when the batch processing began. * * @return self */ - public function setResults($results) + public function setStartedAt($started_at) { - if (is_null($results)) { - throw new \InvalidArgumentException('non-nullable results cannot be null'); + if (is_null($started_at)) { + throw new \InvalidArgumentException('non-nullable started_at cannot be null'); } - $this->container['results'] = $results; + $this->container['started_at'] = $started_at; return $this; } @@ -490,7 +502,7 @@ public function setResults($results) /** * Gets status * - * @return string|null + * @return string */ public function getStatus() { @@ -500,7 +512,7 @@ public function getStatus() /** * Sets status * - * @param string|null $status status + * @param string $status The current status of the batch operation, with possible values: CANCELED, COMPLETE, PENDING, PROCESSING. * * @return self */ @@ -526,11 +538,11 @@ public function setStatus($status) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -538,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; } @@ -568,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/Cms/Hubdb/Model/BatchResponseHubDbTableRowV3WithErrors.php b/codegen/Cms/Hubdb/Model/BatchResponseHubDbTableRowV3WithErrors.php index e019b042..75d1e863 100644 --- a/codegen/Cms/Hubdb/Model/BatchResponseHubDbTableRowV3WithErrors.php +++ b/codegen/Cms/Hubdb/Model/BatchResponseHubDbTableRowV3WithErrors.php @@ -2,7 +2,7 @@ /** * BatchResponseHubDbTableRowV3WithErrors * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -58,12 +58,12 @@ class BatchResponseHubDbTableRowV3WithErrors implements ModelInterface, ArrayAcc */ protected static $openAPITypes = [ 'completed_at' => '\DateTime', + 'errors' => '\HubSpot\Client\Cms\Hubdb\Model\StandardError[]', + 'links' => 'array', 'num_errors' => 'int', 'requested_at' => '\DateTime', - 'started_at' => '\DateTime', - 'links' => 'array', 'results' => '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[]', - 'errors' => '\HubSpot\Client\Cms\Hubdb\Model\StandardError[]', + 'started_at' => '\DateTime', 'status' => 'string' ]; @@ -76,12 +76,12 @@ class BatchResponseHubDbTableRowV3WithErrors implements ModelInterface, ArrayAcc */ protected static $openAPIFormats = [ 'completed_at' => 'date-time', + 'errors' => null, + 'links' => null, 'num_errors' => 'int32', 'requested_at' => 'date-time', - 'started_at' => 'date-time', - 'links' => null, 'results' => null, - 'errors' => null, + 'started_at' => 'date-time', 'status' => null ]; @@ -92,12 +92,12 @@ class BatchResponseHubDbTableRowV3WithErrors implements ModelInterface, ArrayAcc */ protected static array $openAPINullables = [ 'completed_at' => false, + 'errors' => false, + 'links' => false, 'num_errors' => false, 'requested_at' => false, - 'started_at' => false, - 'links' => false, 'results' => false, - 'errors' => false, + 'started_at' => false, 'status' => false ]; @@ -188,12 +188,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $attributeMap = [ 'completed_at' => 'completedAt', + 'errors' => 'errors', + 'links' => 'links', 'num_errors' => 'numErrors', 'requested_at' => 'requestedAt', - 'started_at' => 'startedAt', - 'links' => 'links', 'results' => 'results', - 'errors' => 'errors', + 'started_at' => 'startedAt', 'status' => 'status' ]; @@ -204,12 +204,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $setters = [ 'completed_at' => 'setCompletedAt', + 'errors' => 'setErrors', + 'links' => 'setLinks', 'num_errors' => 'setNumErrors', 'requested_at' => 'setRequestedAt', - 'started_at' => 'setStartedAt', - 'links' => 'setLinks', 'results' => 'setResults', - 'errors' => 'setErrors', + 'started_at' => 'setStartedAt', 'status' => 'setStatus' ]; @@ -220,12 +220,12 @@ public function isNullableSetToNull(string $property): bool */ protected static $getters = [ 'completed_at' => 'getCompletedAt', + 'errors' => 'getErrors', + 'links' => 'getLinks', 'num_errors' => 'getNumErrors', 'requested_at' => 'getRequestedAt', - 'started_at' => 'getStartedAt', - 'links' => 'getLinks', 'results' => 'getResults', - 'errors' => 'getErrors', + 'started_at' => 'getStartedAt', 'status' => 'getStatus' ]; @@ -270,10 +270,10 @@ public function getModelName() return self::$openAPIModelName; } - public const STATUS_PENDING = 'PENDING'; - public const STATUS_PROCESSING = 'PROCESSING'; public const STATUS_CANCELED = 'CANCELED'; public const STATUS_COMPLETE = 'COMPLETE'; + public const STATUS_PENDING = 'PENDING'; + public const STATUS_PROCESSING = 'PROCESSING'; /** * Gets allowable values of the enum @@ -283,10 +283,10 @@ public function getModelName() public function getStatusAllowableValues() { return [ - self::STATUS_PENDING, - self::STATUS_PROCESSING, self::STATUS_CANCELED, self::STATUS_COMPLETE, + self::STATUS_PENDING, + self::STATUS_PROCESSING, ]; } @@ -306,12 +306,12 @@ public function getStatusAllowableValues() public function __construct(?array $data = null) { $this->setIfExists('completed_at', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('links', $data ?? [], null); $this->setIfExists('num_errors', $data ?? [], null); $this->setIfExists('requested_at', $data ?? [], null); - $this->setIfExists('started_at', $data ?? [], null); - $this->setIfExists('links', $data ?? [], null); $this->setIfExists('results', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('started_at', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); } @@ -345,12 +345,12 @@ public function listInvalidProperties() if ($this->container['completed_at'] === null) { $invalidProperties[] = "'completed_at' can't be null"; } - if ($this->container['started_at'] === null) { - $invalidProperties[] = "'started_at' can't be null"; - } if ($this->container['results'] === null) { $invalidProperties[] = "'results' can't be null"; } + if ($this->container['started_at'] === null) { + $invalidProperties[] = "'started_at' can't be null"; + } if ($this->container['status'] === null) { $invalidProperties[] = "'status' can't be null"; } @@ -391,7 +391,7 @@ public function getCompletedAt() /** * Sets completed_at * - * @param \DateTime $completed_at + * @param \DateTime $completed_at The timestamp indicating when the batch processing was completed. * * @return self */ @@ -406,109 +406,109 @@ public function setCompletedAt($completed_at) } /** - * Gets num_errors + * Gets errors * - * @return int|null + * @return \HubSpot\Client\Cms\Hubdb\Model\StandardError[]|null */ - public function getNumErrors() + public function getErrors() { - return $this->container['num_errors']; + return $this->container['errors']; } /** - * Sets num_errors + * Sets errors * - * @param int|null $num_errors + * @param \HubSpot\Client\Cms\Hubdb\Model\StandardError[]|null $errors errors * * @return self */ - public function setNumErrors($num_errors) + public function setErrors($errors) { - if (is_null($num_errors)) { - throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['num_errors'] = $num_errors; + $this->container['errors'] = $errors; return $this; } /** - * Gets requested_at + * Gets links * - * @return \DateTime|null + * @return array|null */ - public function getRequestedAt() + public function getLinks() { - return $this->container['requested_at']; + return $this->container['links']; } /** - * Sets requested_at + * Sets links * - * @param \DateTime|null $requested_at + * @param array|null $links A collection of related links associated with the batch response. * * @return self */ - public function setRequestedAt($requested_at) + public function setLinks($links) { - if (is_null($requested_at)) { - throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['requested_at'] = $requested_at; + $this->container['links'] = $links; return $this; } /** - * Gets started_at + * Gets num_errors * - * @return \DateTime + * @return int|null */ - public function getStartedAt() + public function getNumErrors() { - return $this->container['started_at']; + return $this->container['num_errors']; } /** - * Sets started_at + * Sets num_errors * - * @param \DateTime $started_at + * @param int|null $num_errors The number of errors encountered during the batch operation. * * @return self */ - public function setStartedAt($started_at) + public function setNumErrors($num_errors) { - if (is_null($started_at)) { - throw new \InvalidArgumentException('non-nullable started_at cannot be null'); + if (is_null($num_errors)) { + throw new \InvalidArgumentException('non-nullable num_errors cannot be null'); } - $this->container['started_at'] = $started_at; + $this->container['num_errors'] = $num_errors; return $this; } /** - * Gets links + * Gets requested_at * - * @return array|null + * @return \DateTime|null */ - public function getLinks() + public function getRequestedAt() { - return $this->container['links']; + return $this->container['requested_at']; } /** - * Sets links + * Sets requested_at * - * @param array|null $links + * @param \DateTime|null $requested_at The timestamp indicating when the batch request was made. * * @return self */ - public function setLinks($links) + public function setRequestedAt($requested_at) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($requested_at)) { + throw new \InvalidArgumentException('non-nullable requested_at cannot be null'); } - $this->container['links'] = $links; + $this->container['requested_at'] = $requested_at; return $this; } @@ -526,7 +526,7 @@ public function getResults() /** * Sets results * - * @param \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[] $results + * @param \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[] $results results * * @return self */ @@ -541,28 +541,28 @@ public function setResults($results) } /** - * Gets errors + * Gets started_at * - * @return \HubSpot\Client\Cms\Hubdb\Model\StandardError[]|null + * @return \DateTime */ - public function getErrors() + public function getStartedAt() { - return $this->container['errors']; + return $this->container['started_at']; } /** - * Sets errors + * Sets started_at * - * @param \HubSpot\Client\Cms\Hubdb\Model\StandardError[]|null $errors + * @param \DateTime $started_at The timestamp indicating when the batch processing began. * * @return self */ - public function setErrors($errors) + public function setStartedAt($started_at) { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); + if (is_null($started_at)) { + throw new \InvalidArgumentException('non-nullable started_at cannot be null'); } - $this->container['errors'] = $errors; + $this->container['started_at'] = $started_at; return $this; } @@ -580,7 +580,7 @@ public function getStatus() /** * Sets status * - * @param string $status + * @param string $status The current status of the batch operation, with possible values: CANCELED, COMPLETE, PENDING, PROCESSING. * * @return self */ @@ -606,11 +606,11 @@ public function setStatus($status) /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -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/Cms/Hubdb/Model/BoundedNextPage.php b/codegen/Cms/Hubdb/Model/BoundedNextPage.php index 67a17384..8bcfb727 100644 --- a/codegen/Cms/Hubdb/Model/BoundedNextPage.php +++ b/codegen/Cms/Hubdb/Model/BoundedNextPage.php @@ -2,7 +2,7 @@ /** * BoundedNextPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,8 +57,8 @@ class BoundedNextPage implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'offset' => 'int', - 'link' => 'string' + 'link' => 'string', + 'offset' => 'int' ]; /** @@ -69,8 +69,8 @@ class BoundedNextPage implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'offset' => 'int32', - 'link' => null + 'link' => null, + 'offset' => 'int32' ]; /** @@ -79,8 +79,8 @@ class BoundedNextPage implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'offset' => false, - 'link' => false + 'link' => false, + 'offset' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'offset' => 'offset', - 'link' => 'link' + 'link' => 'link', + 'offset' => 'offset' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'offset' => 'setOffset', - 'link' => 'setLink' + 'link' => 'setLink', + 'offset' => 'setOffset' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'offset' => 'getOffset', - 'link' => 'getLink' + 'link' => 'getLink', + 'offset' => 'getOffset' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('offset', $data ?? [], null); $this->setIfExists('link', $data ?? [], null); + $this->setIfExists('offset', $data ?? [], null); } /** @@ -300,66 +300,66 @@ public function valid() /** - * Gets offset + * Gets link * - * @return int + * @return string|null */ - public function getOffset() + public function getLink() { - return $this->container['offset']; + return $this->container['link']; } /** - * Sets offset + * Sets link * - * @param int $offset offset + * @param string|null $link A URL that can be used to retrieve the next set of results. * * @return self */ - public function setOffset($offset) + public function setLink($link) { - if (is_null($offset)) { - throw new \InvalidArgumentException('non-nullable offset cannot be null'); + if (is_null($link)) { + throw new \InvalidArgumentException('non-nullable link cannot be null'); } - $this->container['offset'] = $offset; + $this->container['link'] = $link; return $this; } /** - * Gets link + * Gets offset * - * @return string|null + * @return int */ - public function getLink() + public function getOffset() { - return $this->container['link']; + return $this->container['offset']; } /** - * Sets link + * Sets offset * - * @param string|null $link link + * @param int $offset The offset value indicating the starting point for the next set of results. * * @return self */ - public function setLink($link) + public function setOffset($offset) { - if (is_null($link)) { - throw new \InvalidArgumentException('non-nullable link cannot be null'); + if (is_null($offset)) { + throw new \InvalidArgumentException('non-nullable offset cannot be null'); } - $this->container['link'] = $link; + $this->container['offset'] = $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]); } @@ -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/Cms/Hubdb/Model/BoundedPaging.php b/codegen/Cms/Hubdb/Model/BoundedPaging.php index c9c9b33e..199ecf7d 100644 --- a/codegen/Cms/Hubdb/Model/BoundedPaging.php +++ b/codegen/Cms/Hubdb/Model/BoundedPaging.php @@ -2,7 +2,7 @@ /** * BoundedPaging * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -318,11 +318,11 @@ public function setNext($next) /** * 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 +330,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 +360,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/Cms/Hubdb/Model/CollectionResponseWithTotalHubDbTableV3ForwardPaging.php b/codegen/Cms/Hubdb/Model/CollectionResponseWithTotalHubDbTableV3ForwardPaging.php index 2fbb2ce5..ab726807 100644 --- a/codegen/Cms/Hubdb/Model/CollectionResponseWithTotalHubDbTableV3ForwardPaging.php +++ b/codegen/Cms/Hubdb/Model/CollectionResponseWithTotalHubDbTableV3ForwardPaging.php @@ -2,7 +2,7 @@ /** * CollectionResponseWithTotalHubDbTableV3ForwardPaging * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,9 +57,9 @@ class CollectionResponseWithTotalHubDbTableV3ForwardPaging implements ModelInter * @var string[] */ protected static $openAPITypes = [ - 'total' => 'int', 'paging' => '\HubSpot\Client\Cms\Hubdb\Model\ForwardPaging', - 'results' => '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3[]' + 'results' => '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3[]', + 'total' => 'int' ]; /** @@ -70,9 +70,9 @@ class CollectionResponseWithTotalHubDbTableV3ForwardPaging implements ModelInter * @psalm-var array */ protected static $openAPIFormats = [ - 'total' => 'int32', 'paging' => null, - 'results' => null + 'results' => null, + 'total' => 'int32' ]; /** @@ -81,9 +81,9 @@ class CollectionResponseWithTotalHubDbTableV3ForwardPaging implements ModelInter * @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); } /** @@ -288,12 +288,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['total'] === null) { - $invalidProperties[] = "'total' can't be null"; - } if ($this->container['results'] === null) { $invalidProperties[] = "'results' can't be null"; } + if ($this->container['total'] === null) { + $invalidProperties[] = "'total' can't be null"; + } return $invalidProperties; } @@ -309,33 +309,6 @@ public function valid() } - /** - * Gets total - * - * @return int - */ - public function getTotal() - { - return $this->container['total']; - } - - /** - * Sets total - * - * @param int $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 * @@ -376,7 +349,7 @@ public function getResults() /** * Sets results * - * @param \HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3[] $results + * @param \HubSpot\Client\Cms\Hubdb\Model\HubDbTableV3[] $results results * * @return self */ @@ -389,14 +362,41 @@ public function setResults($results) return $this; } + + /** + * Gets total + * + * @return int + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int $total The total number of tables available in the collection. + * + * @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]); } @@ -404,12 +404,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; } @@ -434,11 +434,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/Cms/Hubdb/Model/Column.php b/codegen/Cms/Hubdb/Model/Column.php index a98b09b7..8b613072 100644 --- a/codegen/Cms/Hubdb/Model/Column.php +++ b/codegen/Cms/Hubdb/Model/Column.php @@ -2,7 +2,7 @@ /** * Column * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,26 +57,26 @@ class Column implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'created_at' => '\DateTime', + 'created_by' => '\HubSpot\Client\Cms\Hubdb\Model\SimpleUser', 'created_by_user_id' => 'int', - 'foreign_table_id' => 'int', - 'updated_by' => '\HubSpot\Client\Cms\Hubdb\Model\SimpleUser', + 'deleted' => 'bool', 'description' => 'string', - 'label' => 'string', - 'updated_by_user_id' => 'int', - 'type' => 'string', - 'option_count' => 'int', + 'foreign_column_id' => 'int', 'foreign_ids' => '\HubSpot\Client\Cms\Hubdb\Model\ForeignId[]', - 'created_at' => '\DateTime', - 'deleted' => 'bool', - 'created_by' => '\HubSpot\Client\Cms\Hubdb\Model\SimpleUser', - 'name' => 'string', - 'options' => '\HubSpot\Client\Cms\Hubdb\Model\Option[]', - 'width' => 'int', - 'id' => 'string', 'foreign_ids_by_id' => 'array', - 'foreign_column_id' => 'int', 'foreign_ids_by_name' => 'array', - 'updated_at' => '\DateTime' + 'foreign_table_id' => 'int', + 'id' => 'string', + 'label' => 'string', + 'name' => 'string', + 'option_count' => 'int', + 'options' => '\HubSpot\Client\Cms\Hubdb\Model\Option[]', + 'type' => 'string', + 'updated_at' => '\DateTime', + 'updated_by' => '\HubSpot\Client\Cms\Hubdb\Model\SimpleUser', + 'updated_by_user_id' => 'int', + 'width' => 'int' ]; /** @@ -87,26 +87,26 @@ class Column implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'created_at' => 'date-time', + 'created_by' => null, 'created_by_user_id' => 'int32', - 'foreign_table_id' => 'int64', - 'updated_by' => null, + 'deleted' => null, 'description' => null, - 'label' => null, - 'updated_by_user_id' => 'int32', - 'type' => null, - 'option_count' => 'int32', + 'foreign_column_id' => 'int32', 'foreign_ids' => null, - 'created_at' => 'date-time', - 'deleted' => null, - 'created_by' => null, - 'name' => null, - 'options' => null, - 'width' => 'int32', - 'id' => null, 'foreign_ids_by_id' => null, - 'foreign_column_id' => 'int32', 'foreign_ids_by_name' => null, - 'updated_at' => 'date-time' + 'foreign_table_id' => 'int64', + 'id' => null, + 'label' => null, + 'name' => null, + 'option_count' => 'int32', + 'options' => null, + 'type' => null, + 'updated_at' => 'date-time', + 'updated_by' => null, + 'updated_by_user_id' => 'int32', + 'width' => 'int32' ]; /** @@ -115,26 +115,26 @@ class Column implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ + 'created_at' => false, + 'created_by' => false, 'created_by_user_id' => false, - 'foreign_table_id' => false, - 'updated_by' => false, + 'deleted' => false, 'description' => false, - 'label' => false, - 'updated_by_user_id' => false, - 'type' => false, - 'option_count' => false, + 'foreign_column_id' => false, 'foreign_ids' => false, - 'created_at' => false, - 'deleted' => false, - 'created_by' => false, - 'name' => false, - 'options' => false, - 'width' => false, - 'id' => false, 'foreign_ids_by_id' => false, - 'foreign_column_id' => false, 'foreign_ids_by_name' => false, - 'updated_at' => false + 'foreign_table_id' => false, + 'id' => false, + 'label' => false, + 'name' => false, + 'option_count' => false, + 'options' => false, + 'type' => false, + 'updated_at' => false, + 'updated_by' => false, + 'updated_by_user_id' => false, + 'width' => false ]; /** @@ -223,26 +223,26 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'created_at' => 'createdAt', + 'created_by' => 'createdBy', 'created_by_user_id' => 'createdByUserId', - 'foreign_table_id' => 'foreignTableId', - 'updated_by' => 'updatedBy', + 'deleted' => 'deleted', 'description' => 'description', - 'label' => 'label', - 'updated_by_user_id' => 'updatedByUserId', - 'type' => 'type', - 'option_count' => 'optionCount', + 'foreign_column_id' => 'foreignColumnId', 'foreign_ids' => 'foreignIds', - 'created_at' => 'createdAt', - 'deleted' => 'deleted', - 'created_by' => 'createdBy', - 'name' => 'name', - 'options' => 'options', - 'width' => 'width', - 'id' => 'id', 'foreign_ids_by_id' => 'foreignIdsById', - 'foreign_column_id' => 'foreignColumnId', 'foreign_ids_by_name' => 'foreignIdsByName', - 'updated_at' => 'updatedAt' + 'foreign_table_id' => 'foreignTableId', + 'id' => 'id', + 'label' => 'label', + 'name' => 'name', + 'option_count' => 'optionCount', + 'options' => 'options', + 'type' => 'type', + 'updated_at' => 'updatedAt', + 'updated_by' => 'updatedBy', + 'updated_by_user_id' => 'updatedByUserId', + 'width' => 'width' ]; /** @@ -251,26 +251,26 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'created_at' => 'setCreatedAt', + 'created_by' => 'setCreatedBy', 'created_by_user_id' => 'setCreatedByUserId', - 'foreign_table_id' => 'setForeignTableId', - 'updated_by' => 'setUpdatedBy', + 'deleted' => 'setDeleted', 'description' => 'setDescription', - 'label' => 'setLabel', - 'updated_by_user_id' => 'setUpdatedByUserId', - 'type' => 'setType', - 'option_count' => 'setOptionCount', + 'foreign_column_id' => 'setForeignColumnId', 'foreign_ids' => 'setForeignIds', - 'created_at' => 'setCreatedAt', - 'deleted' => 'setDeleted', - 'created_by' => 'setCreatedBy', - 'name' => 'setName', - 'options' => 'setOptions', - 'width' => 'setWidth', - 'id' => 'setId', 'foreign_ids_by_id' => 'setForeignIdsById', - 'foreign_column_id' => 'setForeignColumnId', 'foreign_ids_by_name' => 'setForeignIdsByName', - 'updated_at' => 'setUpdatedAt' + 'foreign_table_id' => 'setForeignTableId', + 'id' => 'setId', + 'label' => 'setLabel', + 'name' => 'setName', + 'option_count' => 'setOptionCount', + 'options' => 'setOptions', + 'type' => 'setType', + 'updated_at' => 'setUpdatedAt', + 'updated_by' => 'setUpdatedBy', + 'updated_by_user_id' => 'setUpdatedByUserId', + 'width' => 'setWidth' ]; /** @@ -279,26 +279,26 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'created_at' => 'getCreatedAt', + 'created_by' => 'getCreatedBy', 'created_by_user_id' => 'getCreatedByUserId', - 'foreign_table_id' => 'getForeignTableId', - 'updated_by' => 'getUpdatedBy', + 'deleted' => 'getDeleted', 'description' => 'getDescription', - 'label' => 'getLabel', - 'updated_by_user_id' => 'getUpdatedByUserId', - 'type' => 'getType', - 'option_count' => 'getOptionCount', + 'foreign_column_id' => 'getForeignColumnId', 'foreign_ids' => 'getForeignIds', - 'created_at' => 'getCreatedAt', - 'deleted' => 'getDeleted', - 'created_by' => 'getCreatedBy', - 'name' => 'getName', - 'options' => 'getOptions', - 'width' => 'getWidth', - 'id' => 'getId', 'foreign_ids_by_id' => 'getForeignIdsById', - 'foreign_column_id' => 'getForeignColumnId', 'foreign_ids_by_name' => 'getForeignIdsByName', - 'updated_at' => 'getUpdatedAt' + 'foreign_table_id' => 'getForeignTableId', + 'id' => 'getId', + 'label' => 'getLabel', + 'name' => 'getName', + 'option_count' => 'getOptionCount', + 'options' => 'getOptions', + 'type' => 'getType', + 'updated_at' => 'getUpdatedAt', + 'updated_by' => 'getUpdatedBy', + 'updated_by_user_id' => 'getUpdatedByUserId', + 'width' => 'getWidth' ]; /** @@ -342,26 +342,28 @@ public function getModelName() return self::$openAPIModelName; } - public const TYPE_NULL = 'NULL'; - public const TYPE_TEXT = 'TEXT'; - public const TYPE_NUMBER = 'NUMBER'; - public const TYPE_URL = 'URL'; - public const TYPE_IMAGE = 'IMAGE'; - public const TYPE_SELECT = 'SELECT'; - public const TYPE_MULTISELECT = 'MULTISELECT'; public const TYPE_BOOLEAN = 'BOOLEAN'; - public const TYPE_LOCATION = 'LOCATION'; + public const TYPE_CODE = 'CODE'; + public const TYPE_COMPOSITE = 'COMPOSITE'; + public const TYPE_CTA = 'CTA'; + public const TYPE_CURRENCY = 'CURRENCY'; public const TYPE_DATE = 'DATE'; public const TYPE_DATETIME = 'DATETIME'; - public const TYPE_CURRENCY = 'CURRENCY'; - public const TYPE_RICHTEXT = 'RICHTEXT'; - public const TYPE_FOREIGN_ID = 'FOREIGN_ID'; - public const TYPE_VIDEO = 'VIDEO'; - public const TYPE_CTA = 'CTA'; + public const TYPE_EMBED = 'EMBED'; public const TYPE_FILE = 'FILE'; + public const TYPE_FOREIGN_ID = 'FOREIGN_ID'; + public const TYPE_HUBSPOT_VIDEO = 'HUBSPOT_VIDEO'; + public const TYPE_IMAGE = 'IMAGE'; public const TYPE_JSON = 'JSON'; - public const TYPE_COMPOSITE = 'COMPOSITE'; - public const TYPE_CODE = 'CODE'; + public const TYPE_LOCATION = 'LOCATION'; + public const TYPE_MULTISELECT = 'MULTISELECT'; + public const TYPE_NULL = 'NULL'; + public const TYPE_NUMBER = 'NUMBER'; + public const TYPE_RICHTEXT = 'RICHTEXT'; + public const TYPE_SELECT = 'SELECT'; + public const TYPE_TEXT = 'TEXT'; + public const TYPE_URL = 'URL'; + public const TYPE_VIDEO = 'VIDEO'; /** * Gets allowable values of the enum @@ -371,26 +373,28 @@ public function getModelName() public function getTypeAllowableValues() { return [ - self::TYPE_NULL, - self::TYPE_TEXT, - self::TYPE_NUMBER, - self::TYPE_URL, - self::TYPE_IMAGE, - self::TYPE_SELECT, - self::TYPE_MULTISELECT, self::TYPE_BOOLEAN, - self::TYPE_LOCATION, + self::TYPE_CODE, + self::TYPE_COMPOSITE, + self::TYPE_CTA, + self::TYPE_CURRENCY, self::TYPE_DATE, self::TYPE_DATETIME, - self::TYPE_CURRENCY, - self::TYPE_RICHTEXT, - self::TYPE_FOREIGN_ID, - self::TYPE_VIDEO, - self::TYPE_CTA, + self::TYPE_EMBED, self::TYPE_FILE, + self::TYPE_FOREIGN_ID, + self::TYPE_HUBSPOT_VIDEO, + self::TYPE_IMAGE, self::TYPE_JSON, - self::TYPE_COMPOSITE, - self::TYPE_CODE, + self::TYPE_LOCATION, + self::TYPE_MULTISELECT, + self::TYPE_NULL, + self::TYPE_NUMBER, + self::TYPE_RICHTEXT, + self::TYPE_SELECT, + self::TYPE_TEXT, + self::TYPE_URL, + self::TYPE_VIDEO, ]; } @@ -409,26 +413,26 @@ public function getTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('created_by', $data ?? [], null); $this->setIfExists('created_by_user_id', $data ?? [], null); - $this->setIfExists('foreign_table_id', $data ?? [], null); - $this->setIfExists('updated_by', $data ?? [], null); + $this->setIfExists('deleted', $data ?? [], null); $this->setIfExists('description', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); - $this->setIfExists('updated_by_user_id', $data ?? [], null); - $this->setIfExists('type', $data ?? [], null); - $this->setIfExists('option_count', $data ?? [], null); + $this->setIfExists('foreign_column_id', $data ?? [], null); $this->setIfExists('foreign_ids', $data ?? [], null); - $this->setIfExists('created_at', $data ?? [], null); - $this->setIfExists('deleted', $data ?? [], null); - $this->setIfExists('created_by', $data ?? [], null); - $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('options', $data ?? [], null); - $this->setIfExists('width', $data ?? [], null); - $this->setIfExists('id', $data ?? [], null); $this->setIfExists('foreign_ids_by_id', $data ?? [], null); - $this->setIfExists('foreign_column_id', $data ?? [], null); $this->setIfExists('foreign_ids_by_name', $data ?? [], null); + $this->setIfExists('foreign_table_id', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('option_count', $data ?? [], null); + $this->setIfExists('options', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('updated_by', $data ?? [], null); + $this->setIfExists('updated_by_user_id', $data ?? [], null); + $this->setIfExists('width', $data ?? [], null); } /** @@ -458,9 +462,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['deleted'] === null) { + $invalidProperties[] = "'deleted' can't be null"; + } + if ($this->container['description'] === null) { + $invalidProperties[] = "'description' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } if ($this->container['label'] === null) { $invalidProperties[] = "'label' can't be null"; } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } @@ -473,9 +489,6 @@ public function listInvalidProperties() ); } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } return $invalidProperties; } @@ -492,335 +505,325 @@ public function valid() /** - * Gets created_by_user_id + * Gets created_at * - * @return int|null + * @return \DateTime|null */ - public function getCreatedByUserId() + public function getCreatedAt() { - return $this->container['created_by_user_id']; + return $this->container['created_at']; } /** - * Sets created_by_user_id + * Sets created_at * - * @param int|null $created_by_user_id created_by_user_id + * @param \DateTime|null $created_at The timestamp when the column was created. * * @return self */ - public function setCreatedByUserId($created_by_user_id) + public function setCreatedAt($created_at) { - if (is_null($created_by_user_id)) { - throw new \InvalidArgumentException('non-nullable created_by_user_id cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['created_by_user_id'] = $created_by_user_id; + $this->container['created_at'] = $created_at; return $this; } /** - * Gets foreign_table_id + * Gets created_by * - * @return int|null + * @return \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null */ - public function getForeignTableId() + public function getCreatedBy() { - return $this->container['foreign_table_id']; + return $this->container['created_by']; } /** - * Sets foreign_table_id + * Sets created_by * - * @param int|null $foreign_table_id Foreign table id referenced + * @param \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null $created_by created_by * * @return self */ - public function setForeignTableId($foreign_table_id) + public function setCreatedBy($created_by) { - if (is_null($foreign_table_id)) { - throw new \InvalidArgumentException('non-nullable foreign_table_id cannot be null'); + if (is_null($created_by)) { + throw new \InvalidArgumentException('non-nullable created_by cannot be null'); } - $this->container['foreign_table_id'] = $foreign_table_id; + $this->container['created_by'] = $created_by; return $this; } /** - * Gets updated_by + * Gets created_by_user_id * - * @return \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null + * @return int|null */ - public function getUpdatedBy() + public function getCreatedByUserId() { - return $this->container['updated_by']; + return $this->container['created_by_user_id']; } /** - * Sets updated_by + * Sets created_by_user_id * - * @param \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null $updated_by updated_by + * @param int|null $created_by_user_id The ID of the user who created the column. * * @return self */ - public function setUpdatedBy($updated_by) + public function setCreatedByUserId($created_by_user_id) { - if (is_null($updated_by)) { - throw new \InvalidArgumentException('non-nullable updated_by cannot be null'); + if (is_null($created_by_user_id)) { + throw new \InvalidArgumentException('non-nullable created_by_user_id cannot be null'); } - $this->container['updated_by'] = $updated_by; + $this->container['created_by_user_id'] = $created_by_user_id; return $this; } /** - * Gets description + * Gets deleted * - * @return string|null + * @return bool */ - public function getDescription() + public function getDeleted() { - return $this->container['description']; + return $this->container['deleted']; } /** - * Sets description + * Sets deleted * - * @param string|null $description description + * @param bool $deleted Indicates whether the column has been deleted. * * @return self */ - public function setDescription($description) + public function setDeleted($deleted) { - if (is_null($description)) { - throw new \InvalidArgumentException('non-nullable description cannot be null'); + if (is_null($deleted)) { + throw new \InvalidArgumentException('non-nullable deleted cannot be null'); } - $this->container['description'] = $description; + $this->container['deleted'] = $deleted; return $this; } /** - * Gets label + * Gets description * * @return string */ - public function getLabel() + public function getDescription() { - return $this->container['label']; + return $this->container['description']; } /** - * Sets label + * Sets description * - * @param string $label Label of the column + * @param string $description The description of the column. * * @return self */ - public function setLabel($label) + public function setDescription($description) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($description)) { + throw new \InvalidArgumentException('non-nullable description cannot be null'); } - $this->container['label'] = $label; + $this->container['description'] = $description; return $this; } /** - * Gets updated_by_user_id + * Gets foreign_column_id * * @return int|null */ - public function getUpdatedByUserId() + public function getForeignColumnId() { - return $this->container['updated_by_user_id']; + return $this->container['foreign_column_id']; } /** - * Sets updated_by_user_id + * Sets foreign_column_id * - * @param int|null $updated_by_user_id updated_by_user_id + * @param int|null $foreign_column_id Foreign Column id * * @return self */ - public function setUpdatedByUserId($updated_by_user_id) + public function setForeignColumnId($foreign_column_id) { - if (is_null($updated_by_user_id)) { - throw new \InvalidArgumentException('non-nullable updated_by_user_id cannot be null'); + if (is_null($foreign_column_id)) { + throw new \InvalidArgumentException('non-nullable foreign_column_id cannot be null'); } - $this->container['updated_by_user_id'] = $updated_by_user_id; + $this->container['foreign_column_id'] = $foreign_column_id; return $this; } /** - * Gets type + * Gets foreign_ids * - * @return string + * @return \HubSpot\Client\Cms\Hubdb\Model\ForeignId[]|null */ - public function getType() + public function getForeignIds() { - return $this->container['type']; + return $this->container['foreign_ids']; } /** - * Sets type + * Sets foreign_ids * - * @param string $type Type of the column + * @param \HubSpot\Client\Cms\Hubdb\Model\ForeignId[]|null $foreign_ids Foreign Ids * * @return self */ - public function setType($type) + public function setForeignIds($foreign_ids) { - 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($foreign_ids)) { + throw new \InvalidArgumentException('non-nullable foreign_ids cannot be null'); } - $this->container['type'] = $type; + $this->container['foreign_ids'] = $foreign_ids; return $this; } /** - * Gets option_count + * Gets foreign_ids_by_id * - * @return int|null + * @return array|null */ - public function getOptionCount() + public function getForeignIdsById() { - return $this->container['option_count']; + return $this->container['foreign_ids_by_id']; } /** - * Sets option_count + * Sets foreign_ids_by_id * - * @param int|null $option_count Number of options available + * @param array|null $foreign_ids_by_id Foreign ids * * @return self */ - public function setOptionCount($option_count) + public function setForeignIdsById($foreign_ids_by_id) { - if (is_null($option_count)) { - throw new \InvalidArgumentException('non-nullable option_count cannot be null'); + if (is_null($foreign_ids_by_id)) { + throw new \InvalidArgumentException('non-nullable foreign_ids_by_id cannot be null'); } - $this->container['option_count'] = $option_count; + $this->container['foreign_ids_by_id'] = $foreign_ids_by_id; return $this; } /** - * Gets foreign_ids + * Gets foreign_ids_by_name * - * @return \HubSpot\Client\Cms\Hubdb\Model\ForeignId[]|null + * @return array|null */ - public function getForeignIds() + public function getForeignIdsByName() { - return $this->container['foreign_ids']; + return $this->container['foreign_ids_by_name']; } /** - * Sets foreign_ids + * Sets foreign_ids_by_name * - * @param \HubSpot\Client\Cms\Hubdb\Model\ForeignId[]|null $foreign_ids Foreign Ids + * @param array|null $foreign_ids_by_name Foreign ids by name * * @return self */ - public function setForeignIds($foreign_ids) + public function setForeignIdsByName($foreign_ids_by_name) { - if (is_null($foreign_ids)) { - throw new \InvalidArgumentException('non-nullable foreign_ids cannot be null'); + if (is_null($foreign_ids_by_name)) { + throw new \InvalidArgumentException('non-nullable foreign_ids_by_name cannot be null'); } - $this->container['foreign_ids'] = $foreign_ids; + $this->container['foreign_ids_by_name'] = $foreign_ids_by_name; return $this; } /** - * Gets created_at + * Gets foreign_table_id * - * @return \DateTime|null + * @return int|null */ - public function getCreatedAt() + public function getForeignTableId() { - return $this->container['created_at']; + return $this->container['foreign_table_id']; } /** - * Sets created_at + * Sets foreign_table_id * - * @param \DateTime|null $created_at created_at + * @param int|null $foreign_table_id Foreign table id referenced * * @return self */ - public function setCreatedAt($created_at) + public function setForeignTableId($foreign_table_id) { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + if (is_null($foreign_table_id)) { + throw new \InvalidArgumentException('non-nullable foreign_table_id cannot be null'); } - $this->container['created_at'] = $created_at; + $this->container['foreign_table_id'] = $foreign_table_id; return $this; } /** - * Gets deleted + * Gets id * - * @return bool|null + * @return string */ - public function getDeleted() + public function getId() { - return $this->container['deleted']; + return $this->container['id']; } /** - * Sets deleted + * Sets id * - * @param bool|null $deleted deleted + * @param string $id Column Id * * @return self */ - public function setDeleted($deleted) + public function setId($id) { - if (is_null($deleted)) { - throw new \InvalidArgumentException('non-nullable deleted cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['deleted'] = $deleted; + $this->container['id'] = $id; return $this; } /** - * Gets created_by + * Gets label * - * @return \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null + * @return string */ - public function getCreatedBy() + public function getLabel() { - return $this->container['created_by']; + return $this->container['label']; } /** - * Sets created_by + * Sets label * - * @param \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null $created_by created_by + * @param string $label Label of the column * * @return self */ - public function setCreatedBy($created_by) + public function setLabel($label) { - if (is_null($created_by)) { - throw new \InvalidArgumentException('non-nullable created_by cannot be null'); + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); } - $this->container['created_by'] = $created_by; + $this->container['label'] = $label; return $this; } @@ -853,201 +856,211 @@ public function setName($name) } /** - * Gets options + * Gets option_count * - * @return \HubSpot\Client\Cms\Hubdb\Model\Option[]|null + * @return int|null */ - public function getOptions() + public function getOptionCount() { - return $this->container['options']; + return $this->container['option_count']; } /** - * Sets options + * Sets option_count * - * @param \HubSpot\Client\Cms\Hubdb\Model\Option[]|null $options Options to choose for select and multi-select columns + * @param int|null $option_count Number of options available * * @return self */ - public function setOptions($options) + public function setOptionCount($option_count) { - if (is_null($options)) { - throw new \InvalidArgumentException('non-nullable options cannot be null'); + if (is_null($option_count)) { + throw new \InvalidArgumentException('non-nullable option_count cannot be null'); } - $this->container['options'] = $options; + $this->container['option_count'] = $option_count; return $this; } /** - * Gets width + * Gets options * - * @return int|null + * @return \HubSpot\Client\Cms\Hubdb\Model\Option[]|null */ - public function getWidth() + public function getOptions() { - return $this->container['width']; + return $this->container['options']; } /** - * Sets width + * Sets options * - * @param int|null $width Column width for HubDB UI + * @param \HubSpot\Client\Cms\Hubdb\Model\Option[]|null $options Options to choose for select and multi-select columns * * @return self */ - public function setWidth($width) + public function setOptions($options) { - if (is_null($width)) { - throw new \InvalidArgumentException('non-nullable width cannot be null'); + if (is_null($options)) { + throw new \InvalidArgumentException('non-nullable options cannot be null'); } - $this->container['width'] = $width; + $this->container['options'] = $options; return $this; } /** - * Gets id + * Gets type * - * @return string|null + * @return string */ - public function getId() + public function getType() { - return $this->container['id']; + return $this->container['type']; } /** - * Sets id + * Sets type * - * @param string|null $id Column Id + * @param string $type Type of the column * * @return self */ - public function setId($id) + public function setType($type) { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); } - $this->container['id'] = $id; + $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 foreign_ids_by_id + * Gets updated_at * - * @return array|null + * @return \DateTime|null */ - public function getForeignIdsById() + public function getUpdatedAt() { - return $this->container['foreign_ids_by_id']; + return $this->container['updated_at']; } /** - * Sets foreign_ids_by_id + * Sets updated_at * - * @param array|null $foreign_ids_by_id Foreign ids + * @param \DateTime|null $updated_at The timestamp when the column was last updated. * * @return self */ - public function setForeignIdsById($foreign_ids_by_id) + public function setUpdatedAt($updated_at) { - if (is_null($foreign_ids_by_id)) { - throw new \InvalidArgumentException('non-nullable foreign_ids_by_id cannot be null'); + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); } - $this->container['foreign_ids_by_id'] = $foreign_ids_by_id; + $this->container['updated_at'] = $updated_at; return $this; } /** - * Gets foreign_column_id + * Gets updated_by * - * @return int|null + * @return \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null */ - public function getForeignColumnId() + public function getUpdatedBy() { - return $this->container['foreign_column_id']; + return $this->container['updated_by']; } /** - * Sets foreign_column_id + * Sets updated_by * - * @param int|null $foreign_column_id Foreign Column id + * @param \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null $updated_by updated_by * * @return self */ - public function setForeignColumnId($foreign_column_id) + public function setUpdatedBy($updated_by) { - if (is_null($foreign_column_id)) { - throw new \InvalidArgumentException('non-nullable foreign_column_id cannot be null'); + if (is_null($updated_by)) { + throw new \InvalidArgumentException('non-nullable updated_by cannot be null'); } - $this->container['foreign_column_id'] = $foreign_column_id; + $this->container['updated_by'] = $updated_by; return $this; } /** - * Gets foreign_ids_by_name + * Gets updated_by_user_id * - * @return array|null + * @return int|null */ - public function getForeignIdsByName() + public function getUpdatedByUserId() { - return $this->container['foreign_ids_by_name']; + return $this->container['updated_by_user_id']; } /** - * Sets foreign_ids_by_name + * Sets updated_by_user_id * - * @param array|null $foreign_ids_by_name Foreign ids by name + * @param int|null $updated_by_user_id The ID of the user who last updated the column. * * @return self */ - public function setForeignIdsByName($foreign_ids_by_name) + public function setUpdatedByUserId($updated_by_user_id) { - if (is_null($foreign_ids_by_name)) { - throw new \InvalidArgumentException('non-nullable foreign_ids_by_name cannot be null'); + if (is_null($updated_by_user_id)) { + throw new \InvalidArgumentException('non-nullable updated_by_user_id cannot be null'); } - $this->container['foreign_ids_by_name'] = $foreign_ids_by_name; + $this->container['updated_by_user_id'] = $updated_by_user_id; return $this; } /** - * Gets updated_at + * Gets width * - * @return \DateTime|null + * @return int|null */ - public function getUpdatedAt() + public function getWidth() { - return $this->container['updated_at']; + return $this->container['width']; } /** - * Sets updated_at + * Sets width * - * @param \DateTime|null $updated_at updated_at + * @param int|null $width Column width for HubDB UI * * @return self */ - public function setUpdatedAt($updated_at) + public function setWidth($width) { - if (is_null($updated_at)) { - throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + if (is_null($width)) { + throw new \InvalidArgumentException('non-nullable width cannot be null'); } - $this->container['updated_at'] = $updated_at; + $this->container['width'] = $width; 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]); } @@ -1055,12 +1068,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; } @@ -1085,11 +1098,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/Cms/Hubdb/Model/ColumnRequest.php b/codegen/Cms/Hubdb/Model/ColumnRequest.php index 85e2845e..a0c03b19 100644 --- a/codegen/Cms/Hubdb/Model/ColumnRequest.php +++ b/codegen/Cms/Hubdb/Model/ColumnRequest.php @@ -2,7 +2,7 @@ /** * ColumnRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,13 +57,15 @@ class ColumnRequest implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'foreign_column_id' => 'int', 'foreign_table_id' => 'int', - 'name' => 'string', - 'options' => '\HubSpot\Client\Cms\Hubdb\Model\Option[]', 'id' => 'int', 'label' => 'string', - 'type' => 'string', - 'foreign_column_id' => 'int' + 'max_number_of_characters' => 'int', + 'max_number_of_options' => 'int', + 'name' => 'string', + 'options' => '\HubSpot\Client\Cms\Hubdb\Model\Option[]', + 'type' => 'string' ]; /** @@ -74,13 +76,15 @@ class ColumnRequest implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'foreign_column_id' => 'int32', 'foreign_table_id' => 'int64', - 'name' => null, - 'options' => null, 'id' => 'int32', 'label' => null, - 'type' => null, - 'foreign_column_id' => 'int32' + 'max_number_of_characters' => 'int32', + 'max_number_of_options' => 'int32', + 'name' => null, + 'options' => null, + 'type' => null ]; /** @@ -89,13 +93,15 @@ class ColumnRequest implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ + 'foreign_column_id' => false, 'foreign_table_id' => false, - 'name' => false, - 'options' => false, 'id' => false, 'label' => false, - 'type' => false, - 'foreign_column_id' => false + 'max_number_of_characters' => false, + 'max_number_of_options' => false, + 'name' => false, + 'options' => false, + 'type' => false ]; /** @@ -184,13 +190,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'foreign_column_id' => 'foreignColumnId', 'foreign_table_id' => 'foreignTableId', - 'name' => 'name', - 'options' => 'options', 'id' => 'id', 'label' => 'label', - 'type' => 'type', - 'foreign_column_id' => 'foreignColumnId' + 'max_number_of_characters' => 'maxNumberOfCharacters', + 'max_number_of_options' => 'maxNumberOfOptions', + 'name' => 'name', + 'options' => 'options', + 'type' => 'type' ]; /** @@ -199,13 +207,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'foreign_column_id' => 'setForeignColumnId', 'foreign_table_id' => 'setForeignTableId', - 'name' => 'setName', - 'options' => 'setOptions', 'id' => 'setId', 'label' => 'setLabel', - 'type' => 'setType', - 'foreign_column_id' => 'setForeignColumnId' + 'max_number_of_characters' => 'setMaxNumberOfCharacters', + 'max_number_of_options' => 'setMaxNumberOfOptions', + 'name' => 'setName', + 'options' => 'setOptions', + 'type' => 'setType' ]; /** @@ -214,13 +224,15 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'foreign_column_id' => 'getForeignColumnId', 'foreign_table_id' => 'getForeignTableId', - 'name' => 'getName', - 'options' => 'getOptions', 'id' => 'getId', 'label' => 'getLabel', - 'type' => 'getType', - 'foreign_column_id' => 'getForeignColumnId' + 'max_number_of_characters' => 'getMaxNumberOfCharacters', + 'max_number_of_options' => 'getMaxNumberOfOptions', + 'name' => 'getName', + 'options' => 'getOptions', + 'type' => 'getType' ]; /** @@ -264,26 +276,28 @@ public function getModelName() return self::$openAPIModelName; } - public const TYPE_NULL = 'NULL'; - public const TYPE_TEXT = 'TEXT'; - public const TYPE_NUMBER = 'NUMBER'; - public const TYPE_URL = 'URL'; - public const TYPE_IMAGE = 'IMAGE'; - public const TYPE_SELECT = 'SELECT'; - public const TYPE_MULTISELECT = 'MULTISELECT'; public const TYPE_BOOLEAN = 'BOOLEAN'; - public const TYPE_LOCATION = 'LOCATION'; + public const TYPE_CODE = 'CODE'; + public const TYPE_COMPOSITE = 'COMPOSITE'; + public const TYPE_CTA = 'CTA'; + public const TYPE_CURRENCY = 'CURRENCY'; public const TYPE_DATE = 'DATE'; public const TYPE_DATETIME = 'DATETIME'; - public const TYPE_CURRENCY = 'CURRENCY'; - public const TYPE_RICHTEXT = 'RICHTEXT'; - public const TYPE_FOREIGN_ID = 'FOREIGN_ID'; - public const TYPE_VIDEO = 'VIDEO'; - public const TYPE_CTA = 'CTA'; + public const TYPE_EMBED = 'EMBED'; public const TYPE_FILE = 'FILE'; + public const TYPE_FOREIGN_ID = 'FOREIGN_ID'; + public const TYPE_HUBSPOT_VIDEO = 'HUBSPOT_VIDEO'; + public const TYPE_IMAGE = 'IMAGE'; public const TYPE_JSON = 'JSON'; - public const TYPE_COMPOSITE = 'COMPOSITE'; - public const TYPE_CODE = 'CODE'; + public const TYPE_LOCATION = 'LOCATION'; + public const TYPE_MULTISELECT = 'MULTISELECT'; + public const TYPE_NULL = 'NULL'; + public const TYPE_NUMBER = 'NUMBER'; + public const TYPE_RICHTEXT = 'RICHTEXT'; + public const TYPE_SELECT = 'SELECT'; + public const TYPE_TEXT = 'TEXT'; + public const TYPE_URL = 'URL'; + public const TYPE_VIDEO = 'VIDEO'; /** * Gets allowable values of the enum @@ -293,26 +307,28 @@ public function getModelName() public function getTypeAllowableValues() { return [ - self::TYPE_NULL, - self::TYPE_TEXT, - self::TYPE_NUMBER, - self::TYPE_URL, - self::TYPE_IMAGE, - self::TYPE_SELECT, - self::TYPE_MULTISELECT, self::TYPE_BOOLEAN, - self::TYPE_LOCATION, + self::TYPE_CODE, + self::TYPE_COMPOSITE, + self::TYPE_CTA, + self::TYPE_CURRENCY, self::TYPE_DATE, self::TYPE_DATETIME, - self::TYPE_CURRENCY, - self::TYPE_RICHTEXT, - self::TYPE_FOREIGN_ID, - self::TYPE_VIDEO, - self::TYPE_CTA, + self::TYPE_EMBED, self::TYPE_FILE, + self::TYPE_FOREIGN_ID, + self::TYPE_HUBSPOT_VIDEO, + self::TYPE_IMAGE, self::TYPE_JSON, - self::TYPE_COMPOSITE, - self::TYPE_CODE, + self::TYPE_LOCATION, + self::TYPE_MULTISELECT, + self::TYPE_NULL, + self::TYPE_NUMBER, + self::TYPE_RICHTEXT, + self::TYPE_SELECT, + self::TYPE_TEXT, + self::TYPE_URL, + self::TYPE_VIDEO, ]; } @@ -331,13 +347,15 @@ public function getTypeAllowableValues() */ public function __construct(?array $data = null) { + $this->setIfExists('foreign_column_id', $data ?? [], null); $this->setIfExists('foreign_table_id', $data ?? [], null); - $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('options', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('label', $data ?? [], null); + $this->setIfExists('max_number_of_characters', $data ?? [], null); + $this->setIfExists('max_number_of_options', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('options', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); - $this->setIfExists('foreign_column_id', $data ?? [], null); } /** @@ -367,18 +385,18 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } - if ($this->container['options'] === null) { - $invalidProperties[] = "'options' can't be null"; - } if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } if ($this->container['label'] === null) { $invalidProperties[] = "'label' can't be null"; } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['options'] === null) { + $invalidProperties[] = "'options' can't be null"; + } if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } @@ -406,6 +424,33 @@ public function valid() } + /** + * Gets foreign_column_id + * + * @return int|null + */ + public function getForeignColumnId() + { + return $this->container['foreign_column_id']; + } + + /** + * Sets foreign_column_id + * + * @param int|null $foreign_column_id The id of the column from another table to which the column refers/points to. + * + * @return self + */ + public function setForeignColumnId($foreign_column_id) + { + if (is_null($foreign_column_id)) { + throw new \InvalidArgumentException('non-nullable foreign_column_id cannot be null'); + } + $this->container['foreign_column_id'] = $foreign_column_id; + + return $this; + } + /** * Gets foreign_table_id * @@ -434,109 +479,163 @@ public function setForeignTableId($foreign_table_id) } /** - * Gets name + * Gets id + * + * @return int + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param int $id Column Id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets label * * @return string */ - public function getName() + public function getLabel() { - return $this->container['name']; + return $this->container['label']; } /** - * Sets name + * Sets label * - * @param string $name Name of the column + * @param string $label Label of the column * * @return self */ - public function setName($name) + public function setLabel($label) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); } - $this->container['name'] = $name; + $this->container['label'] = $label; return $this; } /** - * Gets options + * Gets max_number_of_characters * - * @return \HubSpot\Client\Cms\Hubdb\Model\Option[] + * @return int|null */ - public function getOptions() + public function getMaxNumberOfCharacters() { - return $this->container['options']; + return $this->container['max_number_of_characters']; } /** - * Sets options + * Sets max_number_of_characters * - * @param \HubSpot\Client\Cms\Hubdb\Model\Option[] $options Options to choose for select and multi-select columns + * @param int|null $max_number_of_characters Defines the maximum number of characters allowed in the column. * * @return self */ - public function setOptions($options) + public function setMaxNumberOfCharacters($max_number_of_characters) { - if (is_null($options)) { - throw new \InvalidArgumentException('non-nullable options cannot be null'); + if (is_null($max_number_of_characters)) { + throw new \InvalidArgumentException('non-nullable max_number_of_characters cannot be null'); } - $this->container['options'] = $options; + $this->container['max_number_of_characters'] = $max_number_of_characters; return $this; } /** - * Gets id + * Gets max_number_of_options * - * @return int + * @return int|null */ - public function getId() + public function getMaxNumberOfOptions() { - return $this->container['id']; + return $this->container['max_number_of_options']; } /** - * Sets id + * Sets max_number_of_options * - * @param int $id Column Id + * @param int|null $max_number_of_options Specifies the maximum number of options that can be set for select and multi-select columns. * * @return self */ - public function setId($id) + public function setMaxNumberOfOptions($max_number_of_options) { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + if (is_null($max_number_of_options)) { + throw new \InvalidArgumentException('non-nullable max_number_of_options cannot be null'); } - $this->container['id'] = $id; + $this->container['max_number_of_options'] = $max_number_of_options; return $this; } /** - * Gets label + * Gets name * * @return string */ - public function getLabel() + public function getName() { - return $this->container['label']; + return $this->container['name']; } /** - * Sets label + * Sets name * - * @param string $label Label of the column + * @param string $name Name of the column * * @return self */ - public function setLabel($label) + public function setName($name) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['label'] = $label; + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets options + * + * @return \HubSpot\Client\Cms\Hubdb\Model\Option[] + */ + public function getOptions() + { + return $this->container['options']; + } + + /** + * Sets options + * + * @param \HubSpot\Client\Cms\Hubdb\Model\Option[] $options Options to choose for select and multi-select columns + * + * @return self + */ + public function setOptions($options) + { + if (is_null($options)) { + throw new \InvalidArgumentException('non-nullable options cannot be null'); + } + $this->container['options'] = $options; return $this; } @@ -577,41 +676,14 @@ public function setType($type) return $this; } - - /** - * Gets foreign_column_id - * - * @return int|null - */ - public function getForeignColumnId() - { - return $this->container['foreign_column_id']; - } - - /** - * Sets foreign_column_id - * - * @param int|null $foreign_column_id The id of the column from another table to which the column refers/points to. - * - * @return self - */ - public function setForeignColumnId($foreign_column_id) - { - if (is_null($foreign_column_id)) { - throw new \InvalidArgumentException('non-nullable foreign_column_id cannot be null'); - } - $this->container['foreign_column_id'] = $foreign_column_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]); } @@ -619,12 +691,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; } @@ -649,11 +721,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/Cms/Hubdb/Model/Error.php b/codegen/Cms/Hubdb/Model/Error.php index 67b78c4e..6d8a8a98 100644 --- a/codegen/Cms/Hubdb/Model/Error.php +++ b/codegen/Cms/Hubdb/Model/Error.php @@ -2,7 +2,7 @@ /** * Error * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,13 +57,13 @@ class Error implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'string', + 'category' => 'string', 'context' => 'array', 'correlation_id' => 'string', + 'errors' => '\HubSpot\Client\Cms\Hubdb\Model\ErrorDetail[]', 'links' => 'array', 'message' => 'string', - 'category' => 'string', - 'errors' => '\HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\Model\ErrorDetail[]|null + */ + public function getErrors() + { + return $this->container['errors']; + } + + /** + * Sets errors + * + * @param \HubSpot\Client\Cms\Hubdb\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\Cms\Hubdb\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\Cms\Hubdb\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/Cms/Hubdb/Model/ErrorDetail.php b/codegen/Cms/Hubdb/Model/ErrorDetail.php index c7183e0d..95ad9a95 100644 --- a/codegen/Cms/Hubdb/Model/ErrorDetail.php +++ b/codegen/Cms/Hubdb/Model/ErrorDetail.php @@ -2,7 +2,7 @@ /** * ErrorDetail * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,11 +57,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'string', 'code' => 'string', - 'in' => 'string', 'context' => 'array', - 'message' => 'string' + 'in' => 'string', + 'message' => 'string', + 'sub_category' => 'string' ]; /** @@ -72,11 +72,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'sub_category' => null, 'code' => null, - 'in' => null, 'context' => null, - 'message' => null + 'in' => null, + 'message' => null, + 'sub_category' => null ]; /** @@ -85,11 +85,11 @@ class ErrorDetail implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'sub_category' => false, 'code' => false, - 'in' => false, 'context' => false, - 'message' => false + 'in' => false, + 'message' => false, + 'sub_category' => false ]; /** @@ -178,11 +178,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'sub_category' => 'subCategory', 'code' => 'code', - 'in' => 'in', 'context' => 'context', - 'message' => 'message' + 'in' => 'in', + 'message' => 'message', + 'sub_category' => 'subCategory' ]; /** @@ -191,11 +191,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'sub_category' => 'setSubCategory', 'code' => 'setCode', - 'in' => 'setIn', 'context' => 'setContext', - 'message' => 'setMessage' + 'in' => 'setIn', + 'message' => 'setMessage', + 'sub_category' => 'setSubCategory' ]; /** @@ -204,11 +204,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'sub_category' => 'getSubCategory', 'code' => 'getCode', - 'in' => 'getIn', 'context' => 'getContext', - 'message' => 'getMessage' + 'in' => 'getIn', + 'message' => 'getMessage', + 'sub_category' => 'getSubCategory' ]; /** @@ -268,11 +268,11 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('sub_category', $data ?? [], null); $this->setIfExists('code', $data ?? [], null); - $this->setIfExists('in', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); + $this->setIfExists('in', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); + $this->setIfExists('sub_category', $data ?? [], null); } /** @@ -321,55 +321,55 @@ public function valid() /** - * Gets sub_category + * Gets code * * @return string|null */ - public function getSubCategory() + public function getCode() { - return $this->container['sub_category']; + return $this->container['code']; } /** - * Sets sub_category + * Sets code * - * @param string|null $sub_category A specific category that contains more specific detail about the error + * @param string|null $code The status code associated with the error detail * * @return self */ - public function setSubCategory($sub_category) + public function setCode($code) { - if (is_null($sub_category)) { - throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); + if (is_null($code)) { + throw new \InvalidArgumentException('non-nullable code cannot be null'); } - $this->container['sub_category'] = $sub_category; + $this->container['code'] = $code; return $this; } /** - * Gets code + * Gets context * - * @return string|null + * @return array|null */ - public function getCode() + public function getContext() { - return $this->container['code']; + return $this->container['context']; } /** - * Sets code + * Sets context * - * @param string|null $code The status code associated with the error detail + * @param array|null $context Context about the error condition. * * @return self */ - public function setCode($code) + public function setContext($context) { - if (is_null($code)) { - throw new \InvalidArgumentException('non-nullable code cannot be null'); + if (is_null($context)) { + throw new \InvalidArgumentException('non-nullable context cannot be null'); } - $this->container['code'] = $code; + $this->container['context'] = $context; return $this; } @@ -402,66 +402,66 @@ public function setIn($in) } /** - * Gets context + * Gets message * - * @return array|null + * @return string */ - public function getContext() + public function getMessage() { - return $this->container['context']; + return $this->container['message']; } /** - * Sets context + * Sets message * - * @param array|null $context Context about the error condition + * @param string $message A human readable message describing the error along with remediation steps where appropriate * * @return self */ - public function setContext($context) + public function setMessage($message) { - if (is_null($context)) { - throw new \InvalidArgumentException('non-nullable context cannot be null'); + if (is_null($message)) { + throw new \InvalidArgumentException('non-nullable message cannot be null'); } - $this->container['context'] = $context; + $this->container['message'] = $message; return $this; } /** - * Gets message + * Gets sub_category * - * @return string + * @return string|null */ - public function getMessage() + public function getSubCategory() { - return $this->container['message']; + return $this->container['sub_category']; } /** - * Sets message + * Sets sub_category * - * @param string $message A human readable message describing the error along with remediation steps where appropriate + * @param string|null $sub_category A specific category that contains more specific detail about the error * * @return self */ - public function setMessage($message) + public function setSubCategory($sub_category) { - if (is_null($message)) { - throw new \InvalidArgumentException('non-nullable message cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['message'] = $message; + $this->container['sub_category'] = $sub_category; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -469,12 +469,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -499,11 +499,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Cms/Hubdb/Model/ForeignId.php b/codegen/Cms/Hubdb/Model/ForeignId.php index 778a7c34..82e1e542 100644 --- a/codegen/Cms/Hubdb/Model/ForeignId.php +++ b/codegen/Cms/Hubdb/Model/ForeignId.php @@ -2,7 +2,7 @@ /** * ForeignId * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,8 +57,8 @@ class ForeignId implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'name' => 'string', 'id' => 'string', + 'name' => 'string', 'type' => 'string' ]; @@ -70,8 +70,8 @@ class ForeignId implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'name' => null, 'id' => null, + 'name' => null, 'type' => null ]; @@ -81,8 +81,8 @@ class ForeignId implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'name' => false, 'id' => false, + 'name' => false, 'type' => false ]; @@ -172,8 +172,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'name' => 'name', 'id' => 'id', + 'name' => 'name', 'type' => 'type' ]; @@ -183,8 +183,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'name' => 'setName', 'id' => 'setId', + 'name' => 'setName', 'type' => 'setType' ]; @@ -194,8 +194,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'name' => 'getName', 'id' => 'getId', + 'name' => 'getName', 'type' => 'getType' ]; @@ -256,8 +256,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('name', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); $this->setIfExists('type', $data ?? [], null); } @@ -288,12 +288,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } if ($this->container['type'] === null) { $invalidProperties[] = "'type' can't be null"; } @@ -313,55 +313,55 @@ public function valid() /** - * Gets name + * Gets id * * @return string */ - public function getName() + public function getId() { - return $this->container['name']; + return $this->container['id']; } /** - * Sets name + * Sets id * - * @param string $name + * @param string $id Unique identifier for the foreign ID. * * @return self */ - public function setName($name) + public function setId($id) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['name'] = $name; + $this->container['id'] = $id; return $this; } /** - * Gets id + * Gets name * * @return string */ - public function getId() + public function getName() { - return $this->container['id']; + return $this->container['name']; } /** - * Sets id + * Sets name * - * @param string $id + * @param string $name Name of the foreign ID. * * @return self */ - public function setId($id) + public function setName($name) { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['id'] = $id; + $this->container['name'] = $name; return $this; } @@ -379,7 +379,7 @@ public function getType() /** * Sets type * - * @param string $type + * @param string $type Type of the foreign ID. * * @return self */ @@ -395,11 +395,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]); } @@ -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/Cms/Hubdb/Model/ForwardPaging.php b/codegen/Cms/Hubdb/Model/ForwardPaging.php index 6911fea9..4e5a2529 100644 --- a/codegen/Cms/Hubdb/Model/ForwardPaging.php +++ b/codegen/Cms/Hubdb/Model/ForwardPaging.php @@ -2,7 +2,7 @@ /** * ForwardPaging * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -318,11 +318,11 @@ public function setNext($next) /** * 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 +330,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 +360,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/Cms/Hubdb/Model/HubDbTableCloneRequest.php b/codegen/Cms/Hubdb/Model/HubDbTableCloneRequest.php index 4a254e81..5be45e7c 100644 --- a/codegen/Cms/Hubdb/Model/HubDbTableCloneRequest.php +++ b/codegen/Cms/Hubdb/Model/HubDbTableCloneRequest.php @@ -2,7 +2,7 @@ /** * HubDbTableCloneRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,10 +57,10 @@ class HubDbTableCloneRequest implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $openAPITypes = [ - 'new_name' => 'string', + 'copy_rows' => 'bool', 'is_hubspot_defined' => 'bool', 'new_label' => 'string', - 'copy_rows' => 'bool' + 'new_name' => 'string' ]; /** @@ -71,10 +71,10 @@ class HubDbTableCloneRequest implements ModelInterface, ArrayAccess, \JsonSerial * @psalm-var array */ protected static $openAPIFormats = [ - 'new_name' => null, + 'copy_rows' => null, 'is_hubspot_defined' => null, 'new_label' => null, - 'copy_rows' => null + 'new_name' => null ]; /** @@ -83,10 +83,10 @@ class HubDbTableCloneRequest implements ModelInterface, ArrayAccess, \JsonSerial * @var boolean[] */ protected static array $openAPINullables = [ - 'new_name' => false, + 'copy_rows' => false, 'is_hubspot_defined' => false, 'new_label' => false, - 'copy_rows' => false + 'new_name' => false ]; /** @@ -175,10 +175,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'new_name' => 'newName', + 'copy_rows' => 'copyRows', 'is_hubspot_defined' => 'isHubspotDefined', 'new_label' => 'newLabel', - 'copy_rows' => 'copyRows' + 'new_name' => 'newName' ]; /** @@ -187,10 +187,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'new_name' => 'setNewName', + 'copy_rows' => 'setCopyRows', 'is_hubspot_defined' => 'setIsHubspotDefined', 'new_label' => 'setNewLabel', - 'copy_rows' => 'setCopyRows' + 'new_name' => 'setNewName' ]; /** @@ -199,10 +199,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'new_name' => 'getNewName', + 'copy_rows' => 'getCopyRows', 'is_hubspot_defined' => 'getIsHubspotDefined', 'new_label' => 'getNewLabel', - 'copy_rows' => 'getCopyRows' + 'new_name' => 'getNewName' ]; /** @@ -262,10 +262,10 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('new_name', $data ?? [], null); + $this->setIfExists('copy_rows', $data ?? [], null); $this->setIfExists('is_hubspot_defined', $data ?? [], null); $this->setIfExists('new_label', $data ?? [], null); - $this->setIfExists('copy_rows', $data ?? [], null); + $this->setIfExists('new_name', $data ?? [], null); } /** @@ -295,12 +295,12 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['is_hubspot_defined'] === null) { - $invalidProperties[] = "'is_hubspot_defined' can't be null"; - } if ($this->container['copy_rows'] === null) { $invalidProperties[] = "'copy_rows' can't be null"; } + if ($this->container['is_hubspot_defined'] === null) { + $invalidProperties[] = "'is_hubspot_defined' can't be null"; + } return $invalidProperties; } @@ -317,28 +317,28 @@ public function valid() /** - * Gets new_name + * Gets copy_rows * - * @return string|null + * @return bool */ - public function getNewName() + public function getCopyRows() { - return $this->container['new_name']; + return $this->container['copy_rows']; } /** - * Sets new_name + * Sets copy_rows * - * @param string|null $new_name The new name for the cloned table + * @param bool $copy_rows Specifies whether to copy the rows during clone * * @return self */ - public function setNewName($new_name) + public function setCopyRows($copy_rows) { - if (is_null($new_name)) { - throw new \InvalidArgumentException('non-nullable new_name cannot be null'); + if (is_null($copy_rows)) { + throw new \InvalidArgumentException('non-nullable copy_rows cannot be null'); } - $this->container['new_name'] = $new_name; + $this->container['copy_rows'] = $copy_rows; return $this; } @@ -356,7 +356,7 @@ public function getIsHubspotDefined() /** * Sets is_hubspot_defined * - * @param bool $is_hubspot_defined is_hubspot_defined + * @param bool $is_hubspot_defined Indicates whether the table is defined by HubSpot. * * @return self */ @@ -398,39 +398,39 @@ public function setNewLabel($new_label) } /** - * Gets copy_rows + * Gets new_name * - * @return bool + * @return string|null */ - public function getCopyRows() + public function getNewName() { - return $this->container['copy_rows']; + return $this->container['new_name']; } /** - * Sets copy_rows + * Sets new_name * - * @param bool $copy_rows Specifies whether to copy the rows during clone + * @param string|null $new_name The new name for the cloned table * * @return self */ - public function setCopyRows($copy_rows) + public function setNewName($new_name) { - if (is_null($copy_rows)) { - throw new \InvalidArgumentException('non-nullable copy_rows cannot be null'); + if (is_null($new_name)) { + throw new \InvalidArgumentException('non-nullable new_name cannot be null'); } - $this->container['copy_rows'] = $copy_rows; + $this->container['new_name'] = $new_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]); } @@ -438,12 +438,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; } @@ -468,11 +468,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/Cms/Hubdb/Model/HubDbTableRowBatchCloneRequest.php b/codegen/Cms/Hubdb/Model/HubDbTableRowBatchCloneRequest.php index 9e35ee21..7ea334aa 100644 --- a/codegen/Cms/Hubdb/Model/HubDbTableRowBatchCloneRequest.php +++ b/codegen/Cms/Hubdb/Model/HubDbTableRowBatchCloneRequest.php @@ -2,7 +2,7 @@ /** * HubDbTableRowBatchCloneRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,8 +57,8 @@ class HubDbTableRowBatchCloneRequest implements ModelInterface, ArrayAccess, \Js * @var string[] */ protected static $openAPITypes = [ - 'name' => 'string', - 'id' => 'string' + 'id' => 'string', + 'name' => 'string' ]; /** @@ -69,8 +69,8 @@ class HubDbTableRowBatchCloneRequest implements ModelInterface, ArrayAccess, \Js * @psalm-var array */ protected static $openAPIFormats = [ - 'name' => null, - 'id' => null + 'id' => null, + 'name' => null ]; /** @@ -79,8 +79,8 @@ class HubDbTableRowBatchCloneRequest implements ModelInterface, ArrayAccess, \Js * @var boolean[] */ protected static array $openAPINullables = [ - 'name' => false, - 'id' => false + 'id' => false, + 'name' => false ]; /** @@ -169,8 +169,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'name' => 'name', - 'id' => 'id' + 'id' => 'id', + 'name' => 'name' ]; /** @@ -179,8 +179,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'name' => 'setName', - 'id' => 'setId' + 'id' => 'setId', + 'name' => 'setName' ]; /** @@ -189,8 +189,8 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'name' => 'getName', - 'id' => 'getId' + 'id' => 'getId', + 'name' => 'getName' ]; /** @@ -250,8 +250,8 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('name', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); } /** @@ -300,66 +300,66 @@ public function valid() /** - * Gets name + * Gets id * - * @return string|null + * @return string */ - public function getName() + public function getId() { - return $this->container['name']; + return $this->container['id']; } /** - * Sets name + * Sets id * - * @param string|null $name name + * @param string $id The ID of the row to be cloned. * * @return self */ - public function setName($name) + public function setId($id) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['name'] = $name; + $this->container['id'] = $id; return $this; } /** - * Gets id + * Gets name * - * @return string + * @return string|null */ - public function getId() + public function getName() { - return $this->container['id']; + return $this->container['name']; } /** - * Sets id + * Sets name * - * @param string $id id + * @param string|null $name The name for the cloned row. * * @return self */ - public function setId($id) + public function setName($name) { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['id'] = $id; + $this->container['name'] = $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]); } @@ -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/Cms/Hubdb/Model/HubDbTableRowV3.php b/codegen/Cms/Hubdb/Model/HubDbTableRowV3.php index da978ceb..74333296 100644 --- a/codegen/Cms/Hubdb/Model/HubDbTableRowV3.php +++ b/codegen/Cms/Hubdb/Model/HubDbTableRowV3.php @@ -2,7 +2,7 @@ /** * HubDbTableRowV3 * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,14 +57,14 @@ class HubDbTableRowV3 implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'path' => 'string', - 'created_at' => '\DateTime', 'child_table_id' => 'string', - 'published_at' => '\DateTime', - 'values' => 'array', - 'name' => 'string', + 'created_at' => '\DateTime', 'id' => 'string', - 'updated_at' => '\DateTime' + 'name' => 'string', + 'path' => 'string', + 'published_at' => '\DateTime', + 'updated_at' => '\DateTime', + 'values' => 'array' ]; /** @@ -75,14 +75,14 @@ class HubDbTableRowV3 implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'path' => null, - 'created_at' => 'date-time', 'child_table_id' => null, - 'published_at' => 'date-time', - 'values' => null, - 'name' => null, + 'created_at' => 'date-time', 'id' => null, - 'updated_at' => 'date-time' + 'name' => null, + 'path' => null, + 'published_at' => 'date-time', + 'updated_at' => 'date-time', + 'values' => null ]; /** @@ -91,14 +91,14 @@ class HubDbTableRowV3 implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'path' => false, - 'created_at' => false, 'child_table_id' => false, - 'published_at' => false, - 'values' => false, - 'name' => false, + 'created_at' => false, 'id' => false, - 'updated_at' => false + 'name' => false, + 'path' => false, + 'published_at' => false, + 'updated_at' => false, + 'values' => false ]; /** @@ -187,14 +187,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'path' => 'path', - 'created_at' => 'createdAt', 'child_table_id' => 'childTableId', - 'published_at' => 'publishedAt', - 'values' => 'values', - 'name' => 'name', + 'created_at' => 'createdAt', 'id' => 'id', - 'updated_at' => 'updatedAt' + 'name' => 'name', + 'path' => 'path', + 'published_at' => 'publishedAt', + 'updated_at' => 'updatedAt', + 'values' => 'values' ]; /** @@ -203,14 +203,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'path' => 'setPath', - 'created_at' => 'setCreatedAt', 'child_table_id' => 'setChildTableId', - 'published_at' => 'setPublishedAt', - 'values' => 'setValues', - 'name' => 'setName', + 'created_at' => 'setCreatedAt', 'id' => 'setId', - 'updated_at' => 'setUpdatedAt' + 'name' => 'setName', + 'path' => 'setPath', + 'published_at' => 'setPublishedAt', + 'updated_at' => 'setUpdatedAt', + 'values' => 'setValues' ]; /** @@ -219,14 +219,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'path' => 'getPath', - 'created_at' => 'getCreatedAt', 'child_table_id' => 'getChildTableId', - 'published_at' => 'getPublishedAt', - 'values' => 'getValues', - 'name' => 'getName', + 'created_at' => 'getCreatedAt', 'id' => 'getId', - 'updated_at' => 'getUpdatedAt' + 'name' => 'getName', + 'path' => 'getPath', + 'published_at' => 'getPublishedAt', + 'updated_at' => 'getUpdatedAt', + 'values' => 'getValues' ]; /** @@ -286,14 +286,14 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('path', $data ?? [], null); - $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('child_table_id', $data ?? [], null); - $this->setIfExists('published_at', $data ?? [], null); - $this->setIfExists('values', $data ?? [], null); - $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('path', $data ?? [], null); + $this->setIfExists('published_at', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); } /** @@ -323,6 +323,27 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['child_table_id'] === null) { + $invalidProperties[] = "'child_table_id' can't be null"; + } + if ($this->container['created_at'] === null) { + $invalidProperties[] = "'created_at' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['path'] === null) { + $invalidProperties[] = "'path' can't be null"; + } + if ($this->container['published_at'] === null) { + $invalidProperties[] = "'published_at' can't be null"; + } + if ($this->container['updated_at'] === null) { + $invalidProperties[] = "'updated_at' can't be null"; + } if ($this->container['values'] === null) { $invalidProperties[] = "'values' can't be null"; } @@ -342,28 +363,28 @@ public function valid() /** - * Gets path + * Gets child_table_id * - * @return string|null + * @return string */ - public function getPath() + public function getChildTableId() { - return $this->container['path']; + return $this->container['child_table_id']; } /** - * Sets path + * Sets child_table_id * - * @param string|null $path Specifies the value for `hs_path` column, which will be used as slug in the dynamic pages + * @param string $child_table_id Specifies the value for the column child table id * * @return self */ - public function setPath($path) + public function setChildTableId($child_table_id) { - if (is_null($path)) { - throw new \InvalidArgumentException('non-nullable path cannot be null'); + if (is_null($child_table_id)) { + throw new \InvalidArgumentException('non-nullable child_table_id cannot be null'); } - $this->container['path'] = $path; + $this->container['child_table_id'] = $child_table_id; return $this; } @@ -371,7 +392,7 @@ public function setPath($path) /** * Gets created_at * - * @return \DateTime|null + * @return \DateTime */ public function getCreatedAt() { @@ -381,7 +402,7 @@ public function getCreatedAt() /** * Sets created_at * - * @param \DateTime|null $created_at Timestamp at which the row is created + * @param \DateTime $created_at Timestamp at which the row is created * * @return self */ @@ -396,174 +417,174 @@ public function setCreatedAt($created_at) } /** - * Gets child_table_id + * Gets id * - * @return string|null + * @return string */ - public function getChildTableId() + public function getId() { - return $this->container['child_table_id']; + return $this->container['id']; } /** - * Sets child_table_id + * Sets id * - * @param string|null $child_table_id Specifies the value for the column child table id + * @param string $id The id of the table row * * @return self */ - public function setChildTableId($child_table_id) + public function setId($id) { - if (is_null($child_table_id)) { - throw new \InvalidArgumentException('non-nullable child_table_id cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['child_table_id'] = $child_table_id; + $this->container['id'] = $id; return $this; } /** - * Gets published_at + * Gets name * - * @return \DateTime|null + * @return string */ - public function getPublishedAt() + public function getName() { - return $this->container['published_at']; + return $this->container['name']; } /** - * Sets published_at + * Sets name * - * @param \DateTime|null $published_at published_at + * @param string $name Specifies the value for `hs_name` column, which will be used as title in the dynamic pages * * @return self */ - public function setPublishedAt($published_at) + public function setName($name) { - if (is_null($published_at)) { - throw new \InvalidArgumentException('non-nullable published_at cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['published_at'] = $published_at; + $this->container['name'] = $name; return $this; } /** - * Gets values + * Gets path * - * @return array + * @return string */ - public function getValues() + public function getPath() { - return $this->container['values']; + return $this->container['path']; } /** - * Sets values + * Sets path * - * @param array $values List of key value pairs with the column name and column value + * @param string $path Specifies the value for `hs_path` column, which will be used as slug in the dynamic pages * * @return self */ - public function setValues($values) + public function setPath($path) { - if (is_null($values)) { - throw new \InvalidArgumentException('non-nullable values cannot be null'); + if (is_null($path)) { + throw new \InvalidArgumentException('non-nullable path cannot be null'); } - $this->container['values'] = $values; + $this->container['path'] = $path; return $this; } /** - * Gets name + * Gets published_at * - * @return string|null + * @return \DateTime */ - public function getName() + public function getPublishedAt() { - return $this->container['name']; + return $this->container['published_at']; } /** - * Sets name + * Sets published_at * - * @param string|null $name Specifies the value for `hs_name` column, which will be used as title in the dynamic pages + * @param \DateTime $published_at The timestamp indicating when the row was last published, in date-time format. * * @return self */ - public function setName($name) + public function setPublishedAt($published_at) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($published_at)) { + throw new \InvalidArgumentException('non-nullable published_at cannot be null'); } - $this->container['name'] = $name; + $this->container['published_at'] = $published_at; return $this; } /** - * Gets id + * Gets updated_at * - * @return string|null + * @return \DateTime */ - public function getId() + public function getUpdatedAt() { - return $this->container['id']; + return $this->container['updated_at']; } /** - * Sets id + * Sets updated_at * - * @param string|null $id The id of the table row + * @param \DateTime $updated_at Timestamp at which the row is updated last time * * @return self */ - public function setId($id) + public function setUpdatedAt($updated_at) { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); } - $this->container['id'] = $id; + $this->container['updated_at'] = $updated_at; return $this; } /** - * Gets updated_at + * Gets values * - * @return \DateTime|null + * @return array */ - public function getUpdatedAt() + public function getValues() { - return $this->container['updated_at']; + return $this->container['values']; } /** - * Sets updated_at + * Sets values * - * @param \DateTime|null $updated_at Timestamp at which the row is updated last time + * @param array $values List of key value pairs with the column name and column value * * @return self */ - public function setUpdatedAt($updated_at) + public function setValues($values) { - if (is_null($updated_at)) { - throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); } - $this->container['updated_at'] = $updated_at; + $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]); } @@ -571,12 +592,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; } @@ -601,11 +622,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/Cms/Hubdb/Model/HubDbTableRowV3BatchUpdateRequest.php b/codegen/Cms/Hubdb/Model/HubDbTableRowV3BatchUpdateRequest.php index b6299943..559195b7 100644 --- a/codegen/Cms/Hubdb/Model/HubDbTableRowV3BatchUpdateRequest.php +++ b/codegen/Cms/Hubdb/Model/HubDbTableRowV3BatchUpdateRequest.php @@ -2,7 +2,7 @@ /** * HubDbTableRowV3BatchUpdateRequest * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,12 +57,12 @@ class HubDbTableRowV3BatchUpdateRequest implements ModelInterface, ArrayAccess, * @var string[] */ protected static $openAPITypes = [ - 'path' => 'string', 'child_table_id' => 'int', - 'values' => 'array', - 'name' => 'string', + 'display_index' => 'int', 'id' => 'string', - 'display_index' => 'int' + 'name' => 'string', + 'path' => 'string', + 'values' => 'array' ]; /** @@ -73,12 +73,12 @@ class HubDbTableRowV3BatchUpdateRequest implements ModelInterface, ArrayAccess, * @psalm-var array */ protected static $openAPIFormats = [ - 'path' => null, 'child_table_id' => 'int32', - 'values' => null, - 'name' => null, + 'display_index' => 'int32', 'id' => null, - 'display_index' => 'int32' + 'name' => null, + 'path' => null, + 'values' => null ]; /** @@ -87,12 +87,12 @@ class HubDbTableRowV3BatchUpdateRequest implements ModelInterface, ArrayAccess, * @var boolean[] */ protected static array $openAPINullables = [ - 'path' => false, 'child_table_id' => false, - 'values' => false, - 'name' => false, + 'display_index' => false, 'id' => false, - 'display_index' => false + 'name' => false, + 'path' => false, + 'values' => false ]; /** @@ -181,12 +181,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'path' => 'path', 'child_table_id' => 'childTableId', - 'values' => 'values', - 'name' => 'name', + 'display_index' => 'displayIndex', 'id' => 'id', - 'display_index' => 'displayIndex' + 'name' => 'name', + 'path' => 'path', + 'values' => 'values' ]; /** @@ -195,12 +195,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'path' => 'setPath', 'child_table_id' => 'setChildTableId', - 'values' => 'setValues', - 'name' => 'setName', + 'display_index' => 'setDisplayIndex', 'id' => 'setId', - 'display_index' => 'setDisplayIndex' + 'name' => 'setName', + 'path' => 'setPath', + 'values' => 'setValues' ]; /** @@ -209,12 +209,12 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'path' => 'getPath', 'child_table_id' => 'getChildTableId', - 'values' => 'getValues', - 'name' => 'getName', + 'display_index' => 'getDisplayIndex', 'id' => 'getId', - 'display_index' => 'getDisplayIndex' + 'name' => 'getName', + 'path' => 'getPath', + 'values' => 'getValues' ]; /** @@ -274,12 +274,12 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('path', $data ?? [], null); $this->setIfExists('child_table_id', $data ?? [], null); - $this->setIfExists('values', $data ?? [], null); - $this->setIfExists('name', $data ?? [], null); - $this->setIfExists('id', $data ?? [], null); $this->setIfExists('display_index', $data ?? [], null); + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('path', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); } /** @@ -309,12 +309,15 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['child_table_id'] === null) { + $invalidProperties[] = "'child_table_id' can't be null"; + } + if ($this->container['display_index'] === null) { + $invalidProperties[] = "'display_index' can't be null"; + } if ($this->container['values'] === null) { $invalidProperties[] = "'values' can't be null"; } - if ($this->container['id'] === null) { - $invalidProperties[] = "'id' can't be null"; - } return $invalidProperties; } @@ -331,82 +334,82 @@ public function valid() /** - * Gets path + * Gets child_table_id * - * @return string|null + * @return int */ - public function getPath() + public function getChildTableId() { - return $this->container['path']; + return $this->container['child_table_id']; } /** - * Sets path + * Sets child_table_id * - * @param string|null $path Specifies the value for `hs_path` column, which will be used as slug in the dynamic pages + * @param int $child_table_id Specifies the value for the column child table id * * @return self */ - public function setPath($path) + public function setChildTableId($child_table_id) { - if (is_null($path)) { - throw new \InvalidArgumentException('non-nullable path cannot be null'); + if (is_null($child_table_id)) { + throw new \InvalidArgumentException('non-nullable child_table_id cannot be null'); } - $this->container['path'] = $path; + $this->container['child_table_id'] = $child_table_id; return $this; } /** - * Gets child_table_id + * Gets display_index * - * @return int|null + * @return int */ - public function getChildTableId() + public function getDisplayIndex() { - return $this->container['child_table_id']; + return $this->container['display_index']; } /** - * Sets child_table_id + * Sets display_index * - * @param int|null $child_table_id Specifies the value for the column child table id + * @param int $display_index The index position for displaying the row within the table. * * @return self */ - public function setChildTableId($child_table_id) + public function setDisplayIndex($display_index) { - if (is_null($child_table_id)) { - throw new \InvalidArgumentException('non-nullable child_table_id cannot be null'); + if (is_null($display_index)) { + throw new \InvalidArgumentException('non-nullable display_index cannot be null'); } - $this->container['child_table_id'] = $child_table_id; + $this->container['display_index'] = $display_index; return $this; } /** - * Gets values + * Gets id * - * @return array + * @return string|null */ - public function getValues() + public function getId() { - return $this->container['values']; + return $this->container['id']; } /** - * Sets values + * Sets id * - * @param array $values List of key value pairs with the column name and column value + * @param string|null $id The id of the table row * * @return self */ - public function setValues($values) + public function setId($id) { - if (is_null($values)) { - throw new \InvalidArgumentException('non-nullable values cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['values'] = $values; + $this->container['id'] = $id; return $this; } @@ -439,66 +442,66 @@ public function setName($name) } /** - * Gets id + * Gets path * - * @return string + * @return string|null */ - public function getId() + public function getPath() { - return $this->container['id']; + return $this->container['path']; } /** - * Sets id + * Sets path * - * @param string $id The id of the table row + * @param string|null $path Specifies the value for `hs_path` column, which will be used as slug in the dynamic pages * * @return self */ - public function setId($id) + public function setPath($path) { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + if (is_null($path)) { + throw new \InvalidArgumentException('non-nullable path cannot be null'); } - $this->container['id'] = $id; + $this->container['path'] = $path; return $this; } /** - * Gets display_index + * Gets values * - * @return int|null + * @return array */ - public function getDisplayIndex() + public function getValues() { - return $this->container['display_index']; + return $this->container['values']; } /** - * Sets display_index + * Sets values * - * @param int|null $display_index display_index + * @param array $values List of key value pairs with the column name and column value * * @return self */ - public function setDisplayIndex($display_index) + public function setValues($values) { - if (is_null($display_index)) { - throw new \InvalidArgumentException('non-nullable display_index cannot be null'); + if (is_null($values)) { + throw new \InvalidArgumentException('non-nullable values cannot be null'); } - $this->container['display_index'] = $display_index; + $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]); } @@ -506,12 +509,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; } @@ -536,11 +539,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/Cms/Hubdb/Model/HubDbTableRowV3Request.php b/codegen/Cms/Hubdb/Model/HubDbTableRowV3Request.php index 392bf3d6..fd0d2511 100644 --- a/codegen/Cms/Hubdb/Model/HubDbTableRowV3Request.php +++ b/codegen/Cms/Hubdb/Model/HubDbTableRowV3Request.php @@ -2,7 +2,7 @@ /** * HubDbTableRowV3Request * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,11 +57,11 @@ class HubDbTableRowV3Request implements ModelInterface, ArrayAccess, \JsonSerial * @var string[] */ protected static $openAPITypes = [ - 'path' => 'string', 'child_table_id' => 'int', - 'values' => 'array', + 'display_index' => 'int', 'name' => 'string', - 'display_index' => 'int' + 'path' => 'string', + 'values' => 'array' ]; /** @@ -72,11 +72,11 @@ class HubDbTableRowV3Request implements ModelInterface, ArrayAccess, \JsonSerial * @psalm-var array */ protected static $openAPIFormats = [ - 'path' => null, 'child_table_id' => 'int64', - 'values' => null, + 'display_index' => 'int32', 'name' => null, - 'display_index' => 'int32' + 'path' => null, + 'values' => null ]; /** @@ -85,11 +85,11 @@ class HubDbTableRowV3Request implements ModelInterface, ArrayAccess, \JsonSerial * @var boolean[] */ protected static array $openAPINullables = [ - 'path' => false, 'child_table_id' => false, - 'values' => false, + 'display_index' => false, 'name' => false, - 'display_index' => false + 'path' => false, + 'values' => false ]; /** @@ -178,11 +178,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'path' => 'path', 'child_table_id' => 'childTableId', - 'values' => 'values', + 'display_index' => 'displayIndex', 'name' => 'name', - 'display_index' => 'displayIndex' + 'path' => 'path', + 'values' => 'values' ]; /** @@ -191,11 +191,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'path' => 'setPath', 'child_table_id' => 'setChildTableId', - 'values' => 'setValues', + 'display_index' => 'setDisplayIndex', 'name' => 'setName', - 'display_index' => 'setDisplayIndex' + 'path' => 'setPath', + 'values' => 'setValues' ]; /** @@ -204,11 +204,11 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'path' => 'getPath', 'child_table_id' => 'getChildTableId', - 'values' => 'getValues', + 'display_index' => 'getDisplayIndex', 'name' => 'getName', - 'display_index' => 'getDisplayIndex' + 'path' => 'getPath', + 'values' => 'getValues' ]; /** @@ -268,11 +268,11 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('path', $data ?? [], null); $this->setIfExists('child_table_id', $data ?? [], null); - $this->setIfExists('values', $data ?? [], null); - $this->setIfExists('name', $data ?? [], null); $this->setIfExists('display_index', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('path', $data ?? [], null); + $this->setIfExists('values', $data ?? [], null); } /** @@ -302,6 +302,12 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['child_table_id'] === null) { + $invalidProperties[] = "'child_table_id' can't be null"; + } + if ($this->container['display_index'] === null) { + $invalidProperties[] = "'display_index' can't be null"; + } if ($this->container['values'] === null) { $invalidProperties[] = "'values' can't be null"; } @@ -320,37 +326,10 @@ public function valid() } - /** - * Gets path - * - * @return string|null - */ - public function getPath() - { - return $this->container['path']; - } - - /** - * Sets path - * - * @param string|null $path Specifies the value for `hs_path` column, which will be used as slug in the dynamic pages - * - * @return self - */ - public function setPath($path) - { - if (is_null($path)) { - throw new \InvalidArgumentException('non-nullable path cannot be null'); - } - $this->container['path'] = $path; - - return $this; - } - /** * Gets child_table_id * - * @return int|null + * @return int */ public function getChildTableId() { @@ -360,7 +339,7 @@ public function getChildTableId() /** * Sets child_table_id * - * @param int|null $child_table_id Specifies the value for the column child table id + * @param int $child_table_id Specifies the value for the column child table id * * @return self */ @@ -375,28 +354,28 @@ public function setChildTableId($child_table_id) } /** - * Gets values + * Gets display_index * - * @return array + * @return int */ - public function getValues() + public function getDisplayIndex() { - return $this->container['values']; + return $this->container['display_index']; } /** - * Sets values + * Sets display_index * - * @param array $values List of key value pairs with the column name and column value + * @param int $display_index The index position for displaying the row within the table. * * @return self */ - public function setValues($values) + public function setDisplayIndex($display_index) { - if (is_null($values)) { - throw new \InvalidArgumentException('non-nullable values cannot be null'); + if (is_null($display_index)) { + throw new \InvalidArgumentException('non-nullable display_index cannot be null'); } - $this->container['values'] = $values; + $this->container['display_index'] = $display_index; return $this; } @@ -429,39 +408,66 @@ public function setName($name) } /** - * Gets display_index + * Gets path * - * @return int|null + * @return string|null */ - public function getDisplayIndex() + public function getPath() { - return $this->container['display_index']; + return $this->container['path']; } /** - * Sets display_index + * Sets path * - * @param int|null $display_index display_index + * @param string|null $path Specifies the value for `hs_path` column, which will be used as slug in the dynamic pages * * @return self */ - public function setDisplayIndex($display_index) + public function setPath($path) { - if (is_null($display_index)) { - throw new \InvalidArgumentException('non-nullable display_index cannot be null'); + if (is_null($path)) { + throw new \InvalidArgumentException('non-nullable path cannot be null'); } - $this->container['display_index'] = $display_index; + $this->container['path'] = $path; + + return $this; + } + + /** + * Gets values + * + * @return array + */ + public function getValues() + { + return $this->container['values']; + } + + /** + * Sets values + * + * @param array $values List of key value pairs with the column name and column value + * + * @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]); } @@ -469,12 +475,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 +505,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/Cms/Hubdb/Model/HubDbTableV3.php b/codegen/Cms/Hubdb/Model/HubDbTableV3.php index c44fd7b9..69cbbfc2 100644 --- a/codegen/Cms/Hubdb/Model/HubDbTableV3.php +++ b/codegen/Cms/Hubdb/Model/HubDbTableV3.php @@ -2,7 +2,7 @@ /** * HubDbTableV3 * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,25 +57,26 @@ class HubDbTableV3 implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'dynamic_meta_tags' => 'array', - 'updated_by' => '\HubSpot\Client\Cms\Hubdb\Model\SimpleUser', + 'allow_child_tables' => 'bool', 'allow_public_api_access' => 'bool', - 'use_for_pages' => 'bool', - 'published_at' => '\DateTime', - 'columns' => '\HubSpot\Client\Cms\Hubdb\Model\Column[]', - 'label' => 'string', - 'published' => 'bool', 'column_count' => 'int', - 'allow_child_tables' => 'bool', + 'columns' => '\HubSpot\Client\Cms\Hubdb\Model\Column[]', 'created_at' => '\DateTime', - 'deleted' => 'bool', 'created_by' => '\HubSpot\Client\Cms\Hubdb\Model\SimpleUser', - 'name' => 'string', + 'deleted' => 'bool', + 'deleted_at' => '\DateTime', + 'dynamic_meta_tags' => 'array', 'enable_child_table_pages' => 'bool', 'id' => 'string', - 'row_count' => 'int', 'is_ordered_manually' => 'bool', - 'updated_at' => '\DateTime' + 'label' => 'string', + 'name' => 'string', + 'published' => 'bool', + 'published_at' => '\DateTime', + 'row_count' => 'int', + 'updated_at' => '\DateTime', + 'updated_by' => '\HubSpot\Client\Cms\Hubdb\Model\SimpleUser', + 'use_for_pages' => 'bool' ]; /** @@ -86,25 +87,26 @@ class HubDbTableV3 implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'dynamic_meta_tags' => 'int32', - 'updated_by' => null, + 'allow_child_tables' => null, 'allow_public_api_access' => null, - 'use_for_pages' => null, - 'published_at' => 'date-time', - 'columns' => null, - 'label' => null, - 'published' => null, 'column_count' => 'int32', - 'allow_child_tables' => null, + 'columns' => null, 'created_at' => 'date-time', - 'deleted' => null, 'created_by' => null, - 'name' => null, + 'deleted' => null, + 'deleted_at' => 'date-time', + 'dynamic_meta_tags' => 'int32', 'enable_child_table_pages' => null, 'id' => null, - 'row_count' => 'int32', 'is_ordered_manually' => null, - 'updated_at' => 'date-time' + 'label' => null, + 'name' => null, + 'published' => null, + 'published_at' => 'date-time', + 'row_count' => 'int32', + 'updated_at' => 'date-time', + 'updated_by' => null, + 'use_for_pages' => null ]; /** @@ -113,25 +115,26 @@ class HubDbTableV3 implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'dynamic_meta_tags' => false, - 'updated_by' => false, + 'allow_child_tables' => false, 'allow_public_api_access' => false, - 'use_for_pages' => false, - 'published_at' => false, - 'columns' => false, - 'label' => false, - 'published' => false, 'column_count' => false, - 'allow_child_tables' => false, + 'columns' => false, 'created_at' => false, - 'deleted' => false, 'created_by' => false, - 'name' => false, + 'deleted' => false, + 'deleted_at' => false, + 'dynamic_meta_tags' => false, 'enable_child_table_pages' => false, 'id' => false, - 'row_count' => false, 'is_ordered_manually' => false, - 'updated_at' => false + 'label' => false, + 'name' => false, + 'published' => false, + 'published_at' => false, + 'row_count' => false, + 'updated_at' => false, + 'updated_by' => false, + 'use_for_pages' => false ]; /** @@ -220,25 +223,26 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'dynamic_meta_tags' => 'dynamicMetaTags', - 'updated_by' => 'updatedBy', + 'allow_child_tables' => 'allowChildTables', 'allow_public_api_access' => 'allowPublicApiAccess', - 'use_for_pages' => 'useForPages', - 'published_at' => 'publishedAt', - 'columns' => 'columns', - 'label' => 'label', - 'published' => 'published', 'column_count' => 'columnCount', - 'allow_child_tables' => 'allowChildTables', + 'columns' => 'columns', 'created_at' => 'createdAt', - 'deleted' => 'deleted', 'created_by' => 'createdBy', - 'name' => 'name', + 'deleted' => 'deleted', + 'deleted_at' => 'deletedAt', + 'dynamic_meta_tags' => 'dynamicMetaTags', 'enable_child_table_pages' => 'enableChildTablePages', 'id' => 'id', - 'row_count' => 'rowCount', 'is_ordered_manually' => 'isOrderedManually', - 'updated_at' => 'updatedAt' + 'label' => 'label', + 'name' => 'name', + 'published' => 'published', + 'published_at' => 'publishedAt', + 'row_count' => 'rowCount', + 'updated_at' => 'updatedAt', + 'updated_by' => 'updatedBy', + 'use_for_pages' => 'useForPages' ]; /** @@ -247,25 +251,26 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'dynamic_meta_tags' => 'setDynamicMetaTags', - 'updated_by' => 'setUpdatedBy', + 'allow_child_tables' => 'setAllowChildTables', 'allow_public_api_access' => 'setAllowPublicApiAccess', - 'use_for_pages' => 'setUseForPages', - 'published_at' => 'setPublishedAt', - 'columns' => 'setColumns', - 'label' => 'setLabel', - 'published' => 'setPublished', 'column_count' => 'setColumnCount', - 'allow_child_tables' => 'setAllowChildTables', + 'columns' => 'setColumns', 'created_at' => 'setCreatedAt', - 'deleted' => 'setDeleted', 'created_by' => 'setCreatedBy', - 'name' => 'setName', + 'deleted' => 'setDeleted', + 'deleted_at' => 'setDeletedAt', + 'dynamic_meta_tags' => 'setDynamicMetaTags', 'enable_child_table_pages' => 'setEnableChildTablePages', 'id' => 'setId', - 'row_count' => 'setRowCount', 'is_ordered_manually' => 'setIsOrderedManually', - 'updated_at' => 'setUpdatedAt' + 'label' => 'setLabel', + 'name' => 'setName', + 'published' => 'setPublished', + 'published_at' => 'setPublishedAt', + 'row_count' => 'setRowCount', + 'updated_at' => 'setUpdatedAt', + 'updated_by' => 'setUpdatedBy', + 'use_for_pages' => 'setUseForPages' ]; /** @@ -274,25 +279,26 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'dynamic_meta_tags' => 'getDynamicMetaTags', - 'updated_by' => 'getUpdatedBy', + 'allow_child_tables' => 'getAllowChildTables', 'allow_public_api_access' => 'getAllowPublicApiAccess', - 'use_for_pages' => 'getUseForPages', - 'published_at' => 'getPublishedAt', - 'columns' => 'getColumns', - 'label' => 'getLabel', - 'published' => 'getPublished', 'column_count' => 'getColumnCount', - 'allow_child_tables' => 'getAllowChildTables', + 'columns' => 'getColumns', 'created_at' => 'getCreatedAt', - 'deleted' => 'getDeleted', 'created_by' => 'getCreatedBy', - 'name' => 'getName', + 'deleted' => 'getDeleted', + 'deleted_at' => 'getDeletedAt', + 'dynamic_meta_tags' => 'getDynamicMetaTags', 'enable_child_table_pages' => 'getEnableChildTablePages', 'id' => 'getId', - 'row_count' => 'getRowCount', 'is_ordered_manually' => 'getIsOrderedManually', - 'updated_at' => 'getUpdatedAt' + 'label' => 'getLabel', + 'name' => 'getName', + 'published' => 'getPublished', + 'published_at' => 'getPublishedAt', + 'row_count' => 'getRowCount', + 'updated_at' => 'getUpdatedAt', + 'updated_by' => 'getUpdatedBy', + 'use_for_pages' => 'getUseForPages' ]; /** @@ -352,25 +358,26 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('dynamic_meta_tags', $data ?? [], null); - $this->setIfExists('updated_by', $data ?? [], null); + $this->setIfExists('allow_child_tables', $data ?? [], null); $this->setIfExists('allow_public_api_access', $data ?? [], null); - $this->setIfExists('use_for_pages', $data ?? [], null); - $this->setIfExists('published_at', $data ?? [], null); - $this->setIfExists('columns', $data ?? [], null); - $this->setIfExists('label', $data ?? [], null); - $this->setIfExists('published', $data ?? [], null); $this->setIfExists('column_count', $data ?? [], null); - $this->setIfExists('allow_child_tables', $data ?? [], null); + $this->setIfExists('columns', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); - $this->setIfExists('deleted', $data ?? [], null); $this->setIfExists('created_by', $data ?? [], null); - $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('deleted', $data ?? [], null); + $this->setIfExists('deleted_at', $data ?? [], null); + $this->setIfExists('dynamic_meta_tags', $data ?? [], null); $this->setIfExists('enable_child_table_pages', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); - $this->setIfExists('row_count', $data ?? [], null); $this->setIfExists('is_ordered_manually', $data ?? [], null); + $this->setIfExists('label', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('published', $data ?? [], null); + $this->setIfExists('published_at', $data ?? [], null); + $this->setIfExists('row_count', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('updated_by', $data ?? [], null); + $this->setIfExists('use_for_pages', $data ?? [], null); } /** @@ -400,12 +407,57 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['allow_child_tables'] === null) { + $invalidProperties[] = "'allow_child_tables' can't be null"; + } + if ($this->container['allow_public_api_access'] === null) { + $invalidProperties[] = "'allow_public_api_access' can't be null"; + } + if ($this->container['column_count'] === null) { + $invalidProperties[] = "'column_count' can't be null"; + } + if ($this->container['columns'] === null) { + $invalidProperties[] = "'columns' can't be null"; + } + if ($this->container['created_at'] === null) { + $invalidProperties[] = "'created_at' can't be null"; + } + if ($this->container['deleted'] === null) { + $invalidProperties[] = "'deleted' can't be null"; + } + if ($this->container['deleted_at'] === null) { + $invalidProperties[] = "'deleted_at' can't be null"; + } + if ($this->container['dynamic_meta_tags'] === null) { + $invalidProperties[] = "'dynamic_meta_tags' can't be null"; + } + if ($this->container['enable_child_table_pages'] === null) { + $invalidProperties[] = "'enable_child_table_pages' can't be null"; + } + if ($this->container['id'] === null) { + $invalidProperties[] = "'id' can't be null"; + } if ($this->container['label'] === null) { $invalidProperties[] = "'label' can't be null"; } if ($this->container['name'] === null) { $invalidProperties[] = "'name' can't be null"; } + if ($this->container['published'] === null) { + $invalidProperties[] = "'published' can't be null"; + } + if ($this->container['published_at'] === null) { + $invalidProperties[] = "'published_at' can't be null"; + } + if ($this->container['row_count'] === null) { + $invalidProperties[] = "'row_count' can't be null"; + } + if ($this->container['updated_at'] === null) { + $invalidProperties[] = "'updated_at' can't be null"; + } + if ($this->container['use_for_pages'] === null) { + $invalidProperties[] = "'use_for_pages' can't be null"; + } return $invalidProperties; } @@ -422,352 +474,352 @@ public function valid() /** - * Gets dynamic_meta_tags + * Gets allow_child_tables * - * @return array|null + * @return bool */ - public function getDynamicMetaTags() + public function getAllowChildTables() { - return $this->container['dynamic_meta_tags']; + return $this->container['allow_child_tables']; } /** - * Sets dynamic_meta_tags + * Sets allow_child_tables * - * @param array|null $dynamic_meta_tags Specifies the key value pairs of the [metadata fields](https://developers.hubspot.com/docs/cms/guides/dynamic-pages/hubdb#dynamic-pages) with the associated column IDs. + * @param bool $allow_child_tables Specifies whether child tables can be created * * @return self */ - public function setDynamicMetaTags($dynamic_meta_tags) + public function setAllowChildTables($allow_child_tables) { - if (is_null($dynamic_meta_tags)) { - throw new \InvalidArgumentException('non-nullable dynamic_meta_tags cannot be null'); + if (is_null($allow_child_tables)) { + throw new \InvalidArgumentException('non-nullable allow_child_tables cannot be null'); } - $this->container['dynamic_meta_tags'] = $dynamic_meta_tags; + $this->container['allow_child_tables'] = $allow_child_tables; return $this; } /** - * Gets updated_by + * Gets allow_public_api_access * - * @return \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null + * @return bool */ - public function getUpdatedBy() + public function getAllowPublicApiAccess() { - return $this->container['updated_by']; + return $this->container['allow_public_api_access']; } /** - * Sets updated_by + * Sets allow_public_api_access * - * @param \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null $updated_by updated_by + * @param bool $allow_public_api_access Specifies whether the table can be read by public without authorization * * @return self */ - public function setUpdatedBy($updated_by) + public function setAllowPublicApiAccess($allow_public_api_access) { - if (is_null($updated_by)) { - throw new \InvalidArgumentException('non-nullable updated_by cannot be null'); + if (is_null($allow_public_api_access)) { + throw new \InvalidArgumentException('non-nullable allow_public_api_access cannot be null'); } - $this->container['updated_by'] = $updated_by; + $this->container['allow_public_api_access'] = $allow_public_api_access; return $this; } /** - * Gets allow_public_api_access + * Gets column_count * - * @return bool|null + * @return int */ - public function getAllowPublicApiAccess() + public function getColumnCount() { - return $this->container['allow_public_api_access']; + return $this->container['column_count']; } /** - * Sets allow_public_api_access + * Sets column_count * - * @param bool|null $allow_public_api_access Specifies whether the table can be read by public without authorization + * @param int $column_count Number of columns including deleted * * @return self */ - public function setAllowPublicApiAccess($allow_public_api_access) + public function setColumnCount($column_count) { - if (is_null($allow_public_api_access)) { - throw new \InvalidArgumentException('non-nullable allow_public_api_access cannot be null'); + if (is_null($column_count)) { + throw new \InvalidArgumentException('non-nullable column_count cannot be null'); } - $this->container['allow_public_api_access'] = $allow_public_api_access; + $this->container['column_count'] = $column_count; return $this; } /** - * Gets use_for_pages + * Gets columns * - * @return bool|null + * @return \HubSpot\Client\Cms\Hubdb\Model\Column[] */ - public function getUseForPages() + public function getColumns() { - return $this->container['use_for_pages']; + return $this->container['columns']; } /** - * Sets use_for_pages + * Sets columns * - * @param bool|null $use_for_pages Specifies whether the table can be used for creation of dynamic pages + * @param \HubSpot\Client\Cms\Hubdb\Model\Column[] $columns List of columns in the table * * @return self */ - public function setUseForPages($use_for_pages) + public function setColumns($columns) { - if (is_null($use_for_pages)) { - throw new \InvalidArgumentException('non-nullable use_for_pages cannot be null'); + if (is_null($columns)) { + throw new \InvalidArgumentException('non-nullable columns cannot be null'); } - $this->container['use_for_pages'] = $use_for_pages; + $this->container['columns'] = $columns; return $this; } /** - * Gets published_at + * Gets created_at * - * @return \DateTime|null + * @return \DateTime */ - public function getPublishedAt() + public function getCreatedAt() { - return $this->container['published_at']; + return $this->container['created_at']; } /** - * Sets published_at + * Sets created_at * - * @param \DateTime|null $published_at Timestamp at which the table is published recently + * @param \DateTime $created_at Timestamp at which the table is created * * @return self */ - public function setPublishedAt($published_at) + public function setCreatedAt($created_at) { - if (is_null($published_at)) { - throw new \InvalidArgumentException('non-nullable published_at cannot be null'); + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); } - $this->container['published_at'] = $published_at; + $this->container['created_at'] = $created_at; return $this; } /** - * Gets columns + * Gets created_by * - * @return \HubSpot\Client\Cms\Hubdb\Model\Column[]|null + * @return \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null */ - public function getColumns() + public function getCreatedBy() { - return $this->container['columns']; + return $this->container['created_by']; } /** - * Sets columns + * Sets created_by * - * @param \HubSpot\Client\Cms\Hubdb\Model\Column[]|null $columns List of columns in the table + * @param \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null $created_by created_by * * @return self */ - public function setColumns($columns) + public function setCreatedBy($created_by) { - if (is_null($columns)) { - throw new \InvalidArgumentException('non-nullable columns cannot be null'); + if (is_null($created_by)) { + throw new \InvalidArgumentException('non-nullable created_by cannot be null'); } - $this->container['columns'] = $columns; + $this->container['created_by'] = $created_by; return $this; } /** - * Gets label + * Gets deleted * - * @return string + * @return bool */ - public function getLabel() + public function getDeleted() { - return $this->container['label']; + return $this->container['deleted']; } /** - * Sets label + * Sets deleted * - * @param string $label Label of the table + * @param bool $deleted Specifies whether the table is marked as deleted. * * @return self */ - public function setLabel($label) + public function setDeleted($deleted) { - if (is_null($label)) { - throw new \InvalidArgumentException('non-nullable label cannot be null'); + if (is_null($deleted)) { + throw new \InvalidArgumentException('non-nullable deleted cannot be null'); } - $this->container['label'] = $label; + $this->container['deleted'] = $deleted; return $this; } /** - * Gets published + * Gets deleted_at * - * @return bool|null + * @return \DateTime */ - public function getPublished() + public function getDeletedAt() { - return $this->container['published']; + return $this->container['deleted_at']; } /** - * Sets published + * Sets deleted_at * - * @param bool|null $published published + * @param \DateTime $deleted_at The timestamp indicating when the table was deleted. * * @return self */ - public function setPublished($published) + public function setDeletedAt($deleted_at) { - if (is_null($published)) { - throw new \InvalidArgumentException('non-nullable published cannot be null'); + if (is_null($deleted_at)) { + throw new \InvalidArgumentException('non-nullable deleted_at cannot be null'); } - $this->container['published'] = $published; + $this->container['deleted_at'] = $deleted_at; return $this; } /** - * Gets column_count + * Gets dynamic_meta_tags * - * @return int|null + * @return array */ - public function getColumnCount() + public function getDynamicMetaTags() { - return $this->container['column_count']; + return $this->container['dynamic_meta_tags']; } /** - * Sets column_count + * Sets dynamic_meta_tags * - * @param int|null $column_count Number of columns including deleted + * @param array $dynamic_meta_tags Specifies the key value pairs of the [metadata fields](https://developers.hubspot.com/docs/cms/guides/dynamic-pages/hubdb#dynamic-pages) with the associated column IDs. * * @return self */ - public function setColumnCount($column_count) + public function setDynamicMetaTags($dynamic_meta_tags) { - if (is_null($column_count)) { - throw new \InvalidArgumentException('non-nullable column_count cannot be null'); + if (is_null($dynamic_meta_tags)) { + throw new \InvalidArgumentException('non-nullable dynamic_meta_tags cannot be null'); } - $this->container['column_count'] = $column_count; + $this->container['dynamic_meta_tags'] = $dynamic_meta_tags; return $this; } /** - * Gets allow_child_tables + * Gets enable_child_table_pages * - * @return bool|null + * @return bool */ - public function getAllowChildTables() + public function getEnableChildTablePages() { - return $this->container['allow_child_tables']; + return $this->container['enable_child_table_pages']; } /** - * Sets allow_child_tables + * Sets enable_child_table_pages * - * @param bool|null $allow_child_tables Specifies whether child tables can be created + * @param bool $enable_child_table_pages Specifies creation of multi-level dynamic pages using child tables * * @return self */ - public function setAllowChildTables($allow_child_tables) + public function setEnableChildTablePages($enable_child_table_pages) { - if (is_null($allow_child_tables)) { - throw new \InvalidArgumentException('non-nullable allow_child_tables cannot be null'); + if (is_null($enable_child_table_pages)) { + throw new \InvalidArgumentException('non-nullable enable_child_table_pages cannot be null'); } - $this->container['allow_child_tables'] = $allow_child_tables; + $this->container['enable_child_table_pages'] = $enable_child_table_pages; return $this; } /** - * Gets created_at + * Gets id * - * @return \DateTime|null + * @return string */ - public function getCreatedAt() + public function getId() { - return $this->container['created_at']; + return $this->container['id']; } /** - * Sets created_at + * Sets id * - * @param \DateTime|null $created_at Timestamp at which the table is created + * @param string $id Id of the table * * @return self */ - public function setCreatedAt($created_at) + public function setId($id) { - if (is_null($created_at)) { - throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); } - $this->container['created_at'] = $created_at; + $this->container['id'] = $id; return $this; } /** - * Gets deleted + * Gets is_ordered_manually * * @return bool|null */ - public function getDeleted() + public function getIsOrderedManually() { - return $this->container['deleted']; + return $this->container['is_ordered_manually']; } /** - * Sets deleted + * Sets is_ordered_manually * - * @param bool|null $deleted deleted + * @param bool|null $is_ordered_manually Indicates whether the table rows are ordered manually. * * @return self */ - public function setDeleted($deleted) + public function setIsOrderedManually($is_ordered_manually) { - if (is_null($deleted)) { - throw new \InvalidArgumentException('non-nullable deleted cannot be null'); + if (is_null($is_ordered_manually)) { + throw new \InvalidArgumentException('non-nullable is_ordered_manually cannot be null'); } - $this->container['deleted'] = $deleted; + $this->container['is_ordered_manually'] = $is_ordered_manually; return $this; } /** - * Gets created_by + * Gets label * - * @return \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null + * @return string */ - public function getCreatedBy() + public function getLabel() { - return $this->container['created_by']; + return $this->container['label']; } /** - * Sets created_by + * Sets label * - * @param \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null $created_by created_by + * @param string $label Label of the table * * @return self */ - public function setCreatedBy($created_by) + public function setLabel($label) { - if (is_null($created_by)) { - throw new \InvalidArgumentException('non-nullable created_by cannot be null'); + if (is_null($label)) { + throw new \InvalidArgumentException('non-nullable label cannot be null'); } - $this->container['created_by'] = $created_by; + $this->container['label'] = $label; return $this; } @@ -800,55 +852,55 @@ public function setName($name) } /** - * Gets enable_child_table_pages + * Gets published * - * @return bool|null + * @return bool */ - public function getEnableChildTablePages() + public function getPublished() { - return $this->container['enable_child_table_pages']; + return $this->container['published']; } /** - * Sets enable_child_table_pages + * Sets published * - * @param bool|null $enable_child_table_pages Specifies creation of multi-level dynamic pages using child tables + * @param bool $published Indicates whether the table is currently published. * * @return self */ - public function setEnableChildTablePages($enable_child_table_pages) + public function setPublished($published) { - if (is_null($enable_child_table_pages)) { - throw new \InvalidArgumentException('non-nullable enable_child_table_pages cannot be null'); + if (is_null($published)) { + throw new \InvalidArgumentException('non-nullable published cannot be null'); } - $this->container['enable_child_table_pages'] = $enable_child_table_pages; + $this->container['published'] = $published; return $this; } /** - * Gets id + * Gets published_at * - * @return string|null + * @return \DateTime */ - public function getId() + public function getPublishedAt() { - return $this->container['id']; + return $this->container['published_at']; } /** - * Sets id + * Sets published_at * - * @param string|null $id Id of the table + * @param \DateTime $published_at Timestamp at which the table is published recently * * @return self */ - public function setId($id) + public function setPublishedAt($published_at) { - if (is_null($id)) { - throw new \InvalidArgumentException('non-nullable id cannot be null'); + if (is_null($published_at)) { + throw new \InvalidArgumentException('non-nullable published_at cannot be null'); } - $this->container['id'] = $id; + $this->container['published_at'] = $published_at; return $this; } @@ -856,7 +908,7 @@ public function setId($id) /** * Gets row_count * - * @return int|null + * @return int */ public function getRowCount() { @@ -866,7 +918,7 @@ public function getRowCount() /** * Sets row_count * - * @param int|null $row_count Number of rows in the table + * @param int $row_count Number of rows in the table * * @return self */ @@ -881,66 +933,93 @@ public function setRowCount($row_count) } /** - * Gets is_ordered_manually + * Gets updated_at * - * @return bool|null + * @return \DateTime */ - public function getIsOrderedManually() + public function getUpdatedAt() { - return $this->container['is_ordered_manually']; + return $this->container['updated_at']; } /** - * Sets is_ordered_manually + * Sets updated_at * - * @param bool|null $is_ordered_manually is_ordered_manually + * @param \DateTime $updated_at Timestamp at which the table is updated recently * * @return self */ - public function setIsOrderedManually($is_ordered_manually) + public function setUpdatedAt($updated_at) { - if (is_null($is_ordered_manually)) { - throw new \InvalidArgumentException('non-nullable is_ordered_manually cannot be null'); + if (is_null($updated_at)) { + throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); } - $this->container['is_ordered_manually'] = $is_ordered_manually; + $this->container['updated_at'] = $updated_at; return $this; } /** - * Gets updated_at + * Gets updated_by * - * @return \DateTime|null + * @return \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null */ - public function getUpdatedAt() + public function getUpdatedBy() { - return $this->container['updated_at']; + return $this->container['updated_by']; } /** - * Sets updated_at + * Sets updated_by * - * @param \DateTime|null $updated_at Timestamp at which the table is updated recently + * @param \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null $updated_by updated_by * * @return self */ - public function setUpdatedAt($updated_at) + public function setUpdatedBy($updated_by) { - if (is_null($updated_at)) { - throw new \InvalidArgumentException('non-nullable updated_at cannot be null'); + if (is_null($updated_by)) { + throw new \InvalidArgumentException('non-nullable updated_by cannot be null'); } - $this->container['updated_at'] = $updated_at; + $this->container['updated_by'] = $updated_by; + + return $this; + } + + /** + * Gets use_for_pages + * + * @return bool + */ + public function getUseForPages() + { + return $this->container['use_for_pages']; + } + + /** + * Sets use_for_pages + * + * @param bool $use_for_pages Specifies whether the table can be used for creation of dynamic pages + * + * @return self + */ + public function setUseForPages($use_for_pages) + { + if (is_null($use_for_pages)) { + throw new \InvalidArgumentException('non-nullable use_for_pages cannot be null'); + } + $this->container['use_for_pages'] = $use_for_pages; 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]); } @@ -948,12 +1027,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; } @@ -978,11 +1057,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/Cms/Hubdb/Model/HubDbTableV3Request.php b/codegen/Cms/Hubdb/Model/HubDbTableV3Request.php index 8536f85f..8a19256e 100644 --- a/codegen/Cms/Hubdb/Model/HubDbTableV3Request.php +++ b/codegen/Cms/Hubdb/Model/HubDbTableV3Request.php @@ -2,7 +2,7 @@ /** * HubDbTableV3Request * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,14 +57,14 @@ class HubDbTableV3Request implements ModelInterface, ArrayAccess, \JsonSerializa * @var string[] */ protected static $openAPITypes = [ - 'dynamic_meta_tags' => 'array', + 'allow_child_tables' => 'bool', 'allow_public_api_access' => 'bool', - 'use_for_pages' => 'bool', 'columns' => '\HubSpot\Client\Cms\Hubdb\Model\ColumnRequest[]', - 'name' => 'string', + 'dynamic_meta_tags' => 'array', 'enable_child_table_pages' => 'bool', 'label' => 'string', - 'allow_child_tables' => 'bool' + 'name' => 'string', + 'use_for_pages' => 'bool' ]; /** @@ -75,14 +75,14 @@ class HubDbTableV3Request implements ModelInterface, ArrayAccess, \JsonSerializa * @psalm-var array */ protected static $openAPIFormats = [ - 'dynamic_meta_tags' => 'int32', + 'allow_child_tables' => null, 'allow_public_api_access' => null, - 'use_for_pages' => null, 'columns' => null, - 'name' => null, + 'dynamic_meta_tags' => 'int32', 'enable_child_table_pages' => null, 'label' => null, - 'allow_child_tables' => null + 'name' => null, + 'use_for_pages' => null ]; /** @@ -91,14 +91,14 @@ class HubDbTableV3Request implements ModelInterface, ArrayAccess, \JsonSerializa * @var boolean[] */ protected static array $openAPINullables = [ - 'dynamic_meta_tags' => false, + 'allow_child_tables' => false, 'allow_public_api_access' => false, - 'use_for_pages' => false, 'columns' => false, - 'name' => false, + 'dynamic_meta_tags' => false, 'enable_child_table_pages' => false, 'label' => false, - 'allow_child_tables' => false + 'name' => false, + 'use_for_pages' => false ]; /** @@ -187,14 +187,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'dynamic_meta_tags' => 'dynamicMetaTags', + 'allow_child_tables' => 'allowChildTables', 'allow_public_api_access' => 'allowPublicApiAccess', - 'use_for_pages' => 'useForPages', 'columns' => 'columns', - 'name' => 'name', + 'dynamic_meta_tags' => 'dynamicMetaTags', 'enable_child_table_pages' => 'enableChildTablePages', 'label' => 'label', - 'allow_child_tables' => 'allowChildTables' + 'name' => 'name', + 'use_for_pages' => 'useForPages' ]; /** @@ -203,14 +203,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'dynamic_meta_tags' => 'setDynamicMetaTags', + 'allow_child_tables' => 'setAllowChildTables', 'allow_public_api_access' => 'setAllowPublicApiAccess', - 'use_for_pages' => 'setUseForPages', 'columns' => 'setColumns', - 'name' => 'setName', + 'dynamic_meta_tags' => 'setDynamicMetaTags', 'enable_child_table_pages' => 'setEnableChildTablePages', 'label' => 'setLabel', - 'allow_child_tables' => 'setAllowChildTables' + 'name' => 'setName', + 'use_for_pages' => 'setUseForPages' ]; /** @@ -219,14 +219,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'dynamic_meta_tags' => 'getDynamicMetaTags', + 'allow_child_tables' => 'getAllowChildTables', 'allow_public_api_access' => 'getAllowPublicApiAccess', - 'use_for_pages' => 'getUseForPages', 'columns' => 'getColumns', - 'name' => 'getName', + 'dynamic_meta_tags' => 'getDynamicMetaTags', 'enable_child_table_pages' => 'getEnableChildTablePages', 'label' => 'getLabel', - 'allow_child_tables' => 'getAllowChildTables' + 'name' => 'getName', + 'use_for_pages' => 'getUseForPages' ]; /** @@ -286,14 +286,14 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('dynamic_meta_tags', $data ?? [], null); + $this->setIfExists('allow_child_tables', $data ?? [], null); $this->setIfExists('allow_public_api_access', $data ?? [], null); - $this->setIfExists('use_for_pages', $data ?? [], null); $this->setIfExists('columns', $data ?? [], null); - $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('dynamic_meta_tags', $data ?? [], null); $this->setIfExists('enable_child_table_pages', $data ?? [], null); $this->setIfExists('label', $data ?? [], null); - $this->setIfExists('allow_child_tables', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('use_for_pages', $data ?? [], null); } /** @@ -323,12 +323,30 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; + if ($this->container['allow_child_tables'] === null) { + $invalidProperties[] = "'allow_child_tables' can't be null"; + } + if ($this->container['allow_public_api_access'] === null) { + $invalidProperties[] = "'allow_public_api_access' can't be null"; + } + if ($this->container['columns'] === null) { + $invalidProperties[] = "'columns' can't be null"; + } + if ($this->container['dynamic_meta_tags'] === null) { + $invalidProperties[] = "'dynamic_meta_tags' can't be null"; + } + if ($this->container['enable_child_table_pages'] === null) { + $invalidProperties[] = "'enable_child_table_pages' can't be null"; } if ($this->container['label'] === null) { $invalidProperties[] = "'label' can't be null"; } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; + } + if ($this->container['use_for_pages'] === null) { + $invalidProperties[] = "'use_for_pages' can't be null"; + } return $invalidProperties; } @@ -345,28 +363,28 @@ public function valid() /** - * Gets dynamic_meta_tags + * Gets allow_child_tables * - * @return array|null + * @return bool */ - public function getDynamicMetaTags() + public function getAllowChildTables() { - return $this->container['dynamic_meta_tags']; + return $this->container['allow_child_tables']; } /** - * Sets dynamic_meta_tags + * Sets allow_child_tables * - * @param array|null $dynamic_meta_tags Specifies the key value pairs of the [metadata fields](https://developers.hubspot.com/docs/cms/guides/dynamic-pages/hubdb#dynamic-pages) with the associated column IDs. + * @param bool $allow_child_tables Specifies whether child tables can be created * * @return self */ - public function setDynamicMetaTags($dynamic_meta_tags) + public function setAllowChildTables($allow_child_tables) { - if (is_null($dynamic_meta_tags)) { - throw new \InvalidArgumentException('non-nullable dynamic_meta_tags cannot be null'); + if (is_null($allow_child_tables)) { + throw new \InvalidArgumentException('non-nullable allow_child_tables cannot be null'); } - $this->container['dynamic_meta_tags'] = $dynamic_meta_tags; + $this->container['allow_child_tables'] = $allow_child_tables; return $this; } @@ -374,7 +392,7 @@ public function setDynamicMetaTags($dynamic_meta_tags) /** * Gets allow_public_api_access * - * @return bool|null + * @return bool */ public function getAllowPublicApiAccess() { @@ -384,7 +402,7 @@ public function getAllowPublicApiAccess() /** * Sets allow_public_api_access * - * @param bool|null $allow_public_api_access Specifies whether the table can be read by public without authorization + * @param bool $allow_public_api_access Specifies whether the table can be read by public without authorization * * @return self */ @@ -398,37 +416,10 @@ public function setAllowPublicApiAccess($allow_public_api_access) return $this; } - /** - * Gets use_for_pages - * - * @return bool|null - */ - public function getUseForPages() - { - return $this->container['use_for_pages']; - } - - /** - * Sets use_for_pages - * - * @param bool|null $use_for_pages Specifies whether the table can be used for creation of dynamic pages - * - * @return self - */ - public function setUseForPages($use_for_pages) - { - if (is_null($use_for_pages)) { - throw new \InvalidArgumentException('non-nullable use_for_pages cannot be null'); - } - $this->container['use_for_pages'] = $use_for_pages; - - return $this; - } - /** * Gets columns * - * @return \HubSpot\Client\Cms\Hubdb\Model\ColumnRequest[]|null + * @return \HubSpot\Client\Cms\Hubdb\Model\ColumnRequest[] */ public function getColumns() { @@ -438,7 +429,7 @@ public function getColumns() /** * Sets columns * - * @param \HubSpot\Client\Cms\Hubdb\Model\ColumnRequest[]|null $columns List of columns in the table + * @param \HubSpot\Client\Cms\Hubdb\Model\ColumnRequest[] $columns List of columns in the table * * @return self */ @@ -453,28 +444,28 @@ public function setColumns($columns) } /** - * Gets name + * Gets dynamic_meta_tags * - * @return string + * @return array */ - public function getName() + public function getDynamicMetaTags() { - return $this->container['name']; + return $this->container['dynamic_meta_tags']; } /** - * Sets name + * Sets dynamic_meta_tags * - * @param string $name Name of the table + * @param array $dynamic_meta_tags Specifies the key value pairs of the [metadata fields](https://developers.hubspot.com/docs/cms/guides/dynamic-pages/hubdb#dynamic-pages) with the associated column IDs. * * @return self */ - public function setName($name) + public function setDynamicMetaTags($dynamic_meta_tags) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($dynamic_meta_tags)) { + throw new \InvalidArgumentException('non-nullable dynamic_meta_tags cannot be null'); } - $this->container['name'] = $name; + $this->container['dynamic_meta_tags'] = $dynamic_meta_tags; return $this; } @@ -482,7 +473,7 @@ public function setName($name) /** * Gets enable_child_table_pages * - * @return bool|null + * @return bool */ public function getEnableChildTablePages() { @@ -492,7 +483,7 @@ public function getEnableChildTablePages() /** * Sets enable_child_table_pages * - * @param bool|null $enable_child_table_pages Specifies creation of multi-level dynamic pages using child tables + * @param bool $enable_child_table_pages Specifies creation of multi-level dynamic pages using child tables * * @return self */ @@ -534,39 +525,66 @@ public function setLabel($label) } /** - * Gets allow_child_tables + * Gets name * - * @return bool|null + * @return string */ - public function getAllowChildTables() + public function getName() { - return $this->container['allow_child_tables']; + return $this->container['name']; } /** - * Sets allow_child_tables + * Sets name * - * @param bool|null $allow_child_tables Specifies whether child tables can be created + * @param string $name Name of the table * * @return self */ - public function setAllowChildTables($allow_child_tables) + public function setName($name) { - if (is_null($allow_child_tables)) { - throw new \InvalidArgumentException('non-nullable allow_child_tables cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['allow_child_tables'] = $allow_child_tables; + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets use_for_pages + * + * @return bool + */ + public function getUseForPages() + { + return $this->container['use_for_pages']; + } + + /** + * Sets use_for_pages + * + * @param bool $use_for_pages Specifies whether the table can be used for creation of dynamic pages + * + * @return self + */ + public function setUseForPages($use_for_pages) + { + if (is_null($use_for_pages)) { + throw new \InvalidArgumentException('non-nullable use_for_pages cannot be null'); + } + $this->container['use_for_pages'] = $use_for_pages; 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]); } @@ -574,12 +592,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; } @@ -604,11 +622,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/Cms/Hubdb/Model/ImportResult.php b/codegen/Cms/Hubdb/Model/ImportResult.php index 09976c40..9493c168 100644 --- a/codegen/Cms/Hubdb/Model/ImportResult.php +++ b/codegen/Cms/Hubdb/Model/ImportResult.php @@ -2,7 +2,7 @@ /** * ImportResult * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,10 +57,10 @@ class ImportResult implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'row_limit_exceeded' => 'bool', 'duplicate_rows' => 'int', - 'rows_imported' => 'int', - 'errors' => '\HubSpot\Client\Cms\Hubdb\Model\Error[]' + 'errors' => '\HubSpot\Client\Cms\Hubdb\Model\Error[]', + 'row_limit_exceeded' => 'bool', + 'rows_imported' => 'int' ]; /** @@ -71,10 +71,10 @@ class ImportResult implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'row_limit_exceeded' => null, 'duplicate_rows' => 'int32', - 'rows_imported' => 'int32', - 'errors' => null + 'errors' => null, + 'row_limit_exceeded' => null, + 'rows_imported' => 'int32' ]; /** @@ -83,10 +83,10 @@ class ImportResult implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'row_limit_exceeded' => false, 'duplicate_rows' => false, - 'rows_imported' => false, - 'errors' => false + 'errors' => false, + 'row_limit_exceeded' => false, + 'rows_imported' => false ]; /** @@ -175,10 +175,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'row_limit_exceeded' => 'rowLimitExceeded', 'duplicate_rows' => 'duplicateRows', - 'rows_imported' => 'rowsImported', - 'errors' => 'errors' + 'errors' => 'errors', + 'row_limit_exceeded' => 'rowLimitExceeded', + 'rows_imported' => 'rowsImported' ]; /** @@ -187,10 +187,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'row_limit_exceeded' => 'setRowLimitExceeded', 'duplicate_rows' => 'setDuplicateRows', - 'rows_imported' => 'setRowsImported', - 'errors' => 'setErrors' + 'errors' => 'setErrors', + 'row_limit_exceeded' => 'setRowLimitExceeded', + 'rows_imported' => 'setRowsImported' ]; /** @@ -199,10 +199,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'row_limit_exceeded' => 'getRowLimitExceeded', 'duplicate_rows' => 'getDuplicateRows', - 'rows_imported' => 'getRowsImported', - 'errors' => 'getErrors' + 'errors' => 'getErrors', + 'row_limit_exceeded' => 'getRowLimitExceeded', + 'rows_imported' => 'getRowsImported' ]; /** @@ -262,10 +262,10 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('row_limit_exceeded', $data ?? [], null); $this->setIfExists('duplicate_rows', $data ?? [], null); - $this->setIfExists('rows_imported', $data ?? [], null); $this->setIfExists('errors', $data ?? [], null); + $this->setIfExists('row_limit_exceeded', $data ?? [], null); + $this->setIfExists('rows_imported', $data ?? [], null); } /** @@ -295,18 +295,18 @@ public function listInvalidProperties() { $invalidProperties = []; - if ($this->container['row_limit_exceeded'] === null) { - $invalidProperties[] = "'row_limit_exceeded' can't be null"; - } if ($this->container['duplicate_rows'] === null) { $invalidProperties[] = "'duplicate_rows' can't be null"; } - if ($this->container['rows_imported'] === null) { - $invalidProperties[] = "'rows_imported' can't be null"; - } if ($this->container['errors'] === null) { $invalidProperties[] = "'errors' can't be null"; } + if ($this->container['row_limit_exceeded'] === null) { + $invalidProperties[] = "'row_limit_exceeded' can't be null"; + } + if ($this->container['rows_imported'] === null) { + $invalidProperties[] = "'rows_imported' can't be null"; + } return $invalidProperties; } @@ -323,120 +323,120 @@ public function valid() /** - * Gets row_limit_exceeded + * Gets duplicate_rows * - * @return bool + * @return int */ - public function getRowLimitExceeded() + public function getDuplicateRows() { - return $this->container['row_limit_exceeded']; + return $this->container['duplicate_rows']; } /** - * Sets row_limit_exceeded + * Sets duplicate_rows * - * @param bool $row_limit_exceeded Specifies whether row limit exceeded during import + * @param int $duplicate_rows Specifies number of duplicate rows * * @return self */ - public function setRowLimitExceeded($row_limit_exceeded) + public function setDuplicateRows($duplicate_rows) { - if (is_null($row_limit_exceeded)) { - throw new \InvalidArgumentException('non-nullable row_limit_exceeded cannot be null'); + if (is_null($duplicate_rows)) { + throw new \InvalidArgumentException('non-nullable duplicate_rows cannot be null'); } - $this->container['row_limit_exceeded'] = $row_limit_exceeded; + $this->container['duplicate_rows'] = $duplicate_rows; return $this; } /** - * Gets duplicate_rows + * Gets errors * - * @return int + * @return \HubSpot\Client\Cms\Hubdb\Model\Error[] */ - public function getDuplicateRows() + public function getErrors() { - return $this->container['duplicate_rows']; + return $this->container['errors']; } /** - * Sets duplicate_rows + * Sets errors * - * @param int $duplicate_rows Specifies number of duplicate rows + * @param \HubSpot\Client\Cms\Hubdb\Model\Error[] $errors List of errors during import * * @return self */ - public function setDuplicateRows($duplicate_rows) + public function setErrors($errors) { - if (is_null($duplicate_rows)) { - throw new \InvalidArgumentException('non-nullable duplicate_rows cannot be null'); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['duplicate_rows'] = $duplicate_rows; + $this->container['errors'] = $errors; return $this; } /** - * Gets rows_imported + * Gets row_limit_exceeded * - * @return int + * @return bool */ - public function getRowsImported() + public function getRowLimitExceeded() { - return $this->container['rows_imported']; + return $this->container['row_limit_exceeded']; } /** - * Sets rows_imported + * Sets row_limit_exceeded * - * @param int $rows_imported Specifies number of rows imported + * @param bool $row_limit_exceeded Specifies whether row limit exceeded during import * * @return self */ - public function setRowsImported($rows_imported) + public function setRowLimitExceeded($row_limit_exceeded) { - if (is_null($rows_imported)) { - throw new \InvalidArgumentException('non-nullable rows_imported cannot be null'); + if (is_null($row_limit_exceeded)) { + throw new \InvalidArgumentException('non-nullable row_limit_exceeded cannot be null'); } - $this->container['rows_imported'] = $rows_imported; + $this->container['row_limit_exceeded'] = $row_limit_exceeded; return $this; } /** - * Gets errors + * Gets rows_imported * - * @return \HubSpot\Client\Cms\Hubdb\Model\Error[] + * @return int */ - public function getErrors() + public function getRowsImported() { - return $this->container['errors']; + return $this->container['rows_imported']; } /** - * Sets errors + * Sets rows_imported * - * @param \HubSpot\Client\Cms\Hubdb\Model\Error[] $errors List of errors during import + * @param int $rows_imported Specifies number of rows imported * * @return self */ - public function setErrors($errors) + public function setRowsImported($rows_imported) { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); + if (is_null($rows_imported)) { + throw new \InvalidArgumentException('non-nullable rows_imported cannot be null'); } - $this->container['errors'] = $errors; + $this->container['rows_imported'] = $rows_imported; 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 +444,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 +474,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/Cms/Hubdb/Model/ModelInterface.php b/codegen/Cms/Hubdb/Model/ModelInterface.php index bb60d9b2..933dc084 100644 --- a/codegen/Cms/Hubdb/Model/ModelInterface.php +++ b/codegen/Cms/Hubdb/Model/ModelInterface.php @@ -2,7 +2,7 @@ /** * ModelInterface * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb\Model @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** diff --git a/codegen/Cms/Hubdb/Model/NextPage.php b/codegen/Cms/Hubdb/Model/NextPage.php index 9dd35ee0..a53fc0a3 100644 --- a/codegen/Cms/Hubdb/Model/NextPage.php +++ b/codegen/Cms/Hubdb/Model/NextPage.php @@ -2,7 +2,7 @@ /** * NextPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -35,6 +35,7 @@ * NextPage Class Doc Comment * * @category Class + * @description Specifies the paging information needed to retrieve the next set of results in a paginated API response * @package HubSpot\Client\Cms\Hubdb * @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 + * @param string $after A paging cursor token for retrieving subsequent pages. * * @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 + * @param string|null $link A URL that can be used to retrieve the next page results. * * @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/Cms/Hubdb/Model/Option.php b/codegen/Cms/Hubdb/Model/Option.php index 04627d15..7bef565e 100644 --- a/codegen/Cms/Hubdb/Model/Option.php +++ b/codegen/Cms/Hubdb/Model/Option.php @@ -2,7 +2,7 @@ /** * Option * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -35,6 +35,7 @@ * Option Class Doc Comment * * @category Class + * @description A HubSpot property option * @package HubSpot\Client\Cms\Hubdb * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,17 +58,17 @@ class Option implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'created_by_user_id' => 'int', 'created_at' => '\DateTime', - 'updated_by' => '\HubSpot\Client\Cms\Hubdb\Model\SimpleUser', 'created_by' => '\HubSpot\Client\Cms\Hubdb\Model\SimpleUser', - 'name' => 'string', + 'created_by_user_id' => 'int', 'id' => 'string', 'label' => 'string', - 'updated_by_user_id' => 'int', - 'type' => 'string', + 'name' => 'string', 'order' => 'int', - 'updated_at' => '\DateTime' + 'type' => 'string', + 'updated_at' => '\DateTime', + 'updated_by' => '\HubSpot\Client\Cms\Hubdb\Model\SimpleUser', + 'updated_by_user_id' => 'int' ]; /** @@ -78,17 +79,17 @@ class Option implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'created_by_user_id' => 'int32', 'created_at' => 'date-time', - 'updated_by' => null, 'created_by' => null, - 'name' => null, + 'created_by_user_id' => 'int32', 'id' => null, 'label' => null, - 'updated_by_user_id' => 'int32', - 'type' => null, + 'name' => null, 'order' => 'int32', - 'updated_at' => 'date-time' + 'type' => null, + 'updated_at' => 'date-time', + 'updated_by' => null, + 'updated_by_user_id' => 'int32' ]; /** @@ -97,17 +98,17 @@ class Option implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'created_by_user_id' => false, 'created_at' => false, - 'updated_by' => false, 'created_by' => false, - 'name' => false, + 'created_by_user_id' => false, 'id' => false, 'label' => false, - 'updated_by_user_id' => false, - 'type' => false, + 'name' => false, 'order' => false, - 'updated_at' => false + 'type' => false, + 'updated_at' => false, + 'updated_by' => false, + 'updated_by_user_id' => false ]; /** @@ -196,17 +197,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'created_by_user_id' => 'createdByUserId', 'created_at' => 'createdAt', - 'updated_by' => 'updatedBy', 'created_by' => 'createdBy', - 'name' => 'name', + 'created_by_user_id' => 'createdByUserId', 'id' => 'id', 'label' => 'label', - 'updated_by_user_id' => 'updatedByUserId', - 'type' => 'type', + 'name' => 'name', 'order' => 'order', - 'updated_at' => 'updatedAt' + 'type' => 'type', + 'updated_at' => 'updatedAt', + 'updated_by' => 'updatedBy', + 'updated_by_user_id' => 'updatedByUserId' ]; /** @@ -215,17 +216,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'created_by_user_id' => 'setCreatedByUserId', 'created_at' => 'setCreatedAt', - 'updated_by' => 'setUpdatedBy', 'created_by' => 'setCreatedBy', - 'name' => 'setName', + 'created_by_user_id' => 'setCreatedByUserId', 'id' => 'setId', 'label' => 'setLabel', - 'updated_by_user_id' => 'setUpdatedByUserId', - 'type' => 'setType', + 'name' => 'setName', 'order' => 'setOrder', - 'updated_at' => 'setUpdatedAt' + 'type' => 'setType', + 'updated_at' => 'setUpdatedAt', + 'updated_by' => 'setUpdatedBy', + 'updated_by_user_id' => 'setUpdatedByUserId' ]; /** @@ -234,17 +235,17 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'created_by_user_id' => 'getCreatedByUserId', 'created_at' => 'getCreatedAt', - 'updated_by' => 'getUpdatedBy', 'created_by' => 'getCreatedBy', - 'name' => 'getName', + 'created_by_user_id' => 'getCreatedByUserId', 'id' => 'getId', 'label' => 'getLabel', - 'updated_by_user_id' => 'getUpdatedByUserId', - 'type' => 'getType', + 'name' => 'getName', 'order' => 'getOrder', - 'updated_at' => 'getUpdatedAt' + 'type' => 'getType', + 'updated_at' => 'getUpdatedAt', + 'updated_by' => 'getUpdatedBy', + 'updated_by_user_id' => 'getUpdatedByUserId' ]; /** @@ -304,17 +305,17 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('created_by_user_id', $data ?? [], null); $this->setIfExists('created_at', $data ?? [], null); - $this->setIfExists('updated_by', $data ?? [], null); $this->setIfExists('created_by', $data ?? [], null); - $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('created_by_user_id', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); $this->setIfExists('label', $data ?? [], null); - $this->setIfExists('updated_by_user_id', $data ?? [], null); - $this->setIfExists('type', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); $this->setIfExists('order', $data ?? [], null); + $this->setIfExists('type', $data ?? [], null); $this->setIfExists('updated_at', $data ?? [], null); + $this->setIfExists('updated_by', $data ?? [], null); + $this->setIfExists('updated_by_user_id', $data ?? [], null); } /** @@ -347,18 +348,21 @@ public function listInvalidProperties() if ($this->container['created_at'] === null) { $invalidProperties[] = "'created_at' can't be null"; } - if ($this->container['name'] === null) { - $invalidProperties[] = "'name' can't be null"; - } if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ($this->container['type'] === null) { - $invalidProperties[] = "'type' can't be null"; + if ($this->container['label'] === null) { + $invalidProperties[] = "'label' can't be null"; + } + if ($this->container['name'] === null) { + $invalidProperties[] = "'name' can't be null"; } if ($this->container['order'] === null) { $invalidProperties[] = "'order' can't be null"; } + if ($this->container['type'] === null) { + $invalidProperties[] = "'type' can't be null"; + } if ($this->container['updated_at'] === null) { $invalidProperties[] = "'updated_at' can't be null"; } @@ -377,33 +381,6 @@ public function valid() } - /** - * Gets created_by_user_id - * - * @return int|null - */ - public function getCreatedByUserId() - { - return $this->container['created_by_user_id']; - } - - /** - * Sets created_by_user_id - * - * @param int|null $created_by_user_id created_by_user_id - * - * @return self - */ - public function setCreatedByUserId($created_by_user_id) - { - if (is_null($created_by_user_id)) { - throw new \InvalidArgumentException('non-nullable created_by_user_id cannot be null'); - } - $this->container['created_by_user_id'] = $created_by_user_id; - - return $this; - } - /** * Gets created_at * @@ -417,7 +394,7 @@ public function getCreatedAt() /** * Sets created_at * - * @param \DateTime $created_at created_at + * @param \DateTime $created_at The timestamp when the option was created, in ISO 8601 format. * * @return self */ @@ -431,33 +408,6 @@ public function setCreatedAt($created_at) return $this; } - /** - * Gets updated_by - * - * @return \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null - */ - public function getUpdatedBy() - { - return $this->container['updated_by']; - } - - /** - * Sets updated_by - * - * @param \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null $updated_by updated_by - * - * @return self - */ - public function setUpdatedBy($updated_by) - { - if (is_null($updated_by)) { - throw new \InvalidArgumentException('non-nullable updated_by cannot be null'); - } - $this->container['updated_by'] = $updated_by; - - return $this; - } - /** * Gets created_by * @@ -486,28 +436,28 @@ public function setCreatedBy($created_by) } /** - * Gets name + * Gets created_by_user_id * - * @return string + * @return int|null */ - public function getName() + public function getCreatedByUserId() { - return $this->container['name']; + return $this->container['created_by_user_id']; } /** - * Sets name + * Sets created_by_user_id * - * @param string $name + * @param int|null $created_by_user_id The ID of the user who created the option. * * @return self */ - public function setName($name) + public function setCreatedByUserId($created_by_user_id) { - if (is_null($name)) { - throw new \InvalidArgumentException('non-nullable name cannot be null'); + if (is_null($created_by_user_id)) { + throw new \InvalidArgumentException('non-nullable created_by_user_id cannot be null'); } - $this->container['name'] = $name; + $this->container['created_by_user_id'] = $created_by_user_id; return $this; } @@ -525,7 +475,7 @@ public function getId() /** * Sets id * - * @param string $id + * @param string $id The unique ID of the option. * * @return self */ @@ -542,7 +492,7 @@ public function setId($id) /** * Gets label * - * @return string|null + * @return string */ public function getLabel() { @@ -552,7 +502,7 @@ public function getLabel() /** * Sets label * - * @param string|null $label label + * @param string $label A user-friendly label that identifies the option. * * @return self */ @@ -567,82 +517,82 @@ public function setLabel($label) } /** - * Gets updated_by_user_id + * Gets name * - * @return int|null + * @return string */ - public function getUpdatedByUserId() + public function getName() { - return $this->container['updated_by_user_id']; + return $this->container['name']; } /** - * Sets updated_by_user_id + * Sets name * - * @param int|null $updated_by_user_id updated_by_user_id + * @param string $name An internal name assigned to the option, distinct from the label. * * @return self */ - public function setUpdatedByUserId($updated_by_user_id) + public function setName($name) { - if (is_null($updated_by_user_id)) { - throw new \InvalidArgumentException('non-nullable updated_by_user_id cannot be null'); + if (is_null($name)) { + throw new \InvalidArgumentException('non-nullable name cannot be null'); } - $this->container['updated_by_user_id'] = $updated_by_user_id; + $this->container['name'] = $name; return $this; } /** - * Gets type + * Gets order * - * @return string + * @return int */ - public function getType() + public function getOrder() { - return $this->container['type']; + return $this->container['order']; } /** - * Sets type + * Sets order * - * @param string $type + * @param int $order The order in which the option appears, represented as an integer. * * @return self */ - public function setType($type) + public function setOrder($order) { - if (is_null($type)) { - throw new \InvalidArgumentException('non-nullable type cannot be null'); + if (is_null($order)) { + throw new \InvalidArgumentException('non-nullable order cannot be null'); } - $this->container['type'] = $type; + $this->container['order'] = $order; return $this; } /** - * Gets order + * Gets type * - * @return int + * @return string */ - public function getOrder() + public function getType() { - return $this->container['order']; + return $this->container['type']; } /** - * Sets order + * Sets type * - * @param int $order + * @param string $type Indicates the category or data type of the option (e.g., string, number). * * @return self */ - public function setOrder($order) + public function setType($type) { - if (is_null($order)) { - throw new \InvalidArgumentException('non-nullable order cannot be null'); + if (is_null($type)) { + throw new \InvalidArgumentException('non-nullable type cannot be null'); } - $this->container['order'] = $order; + $this->container['type'] = $type; return $this; } @@ -660,7 +610,7 @@ public function getUpdatedAt() /** * Sets updated_at * - * @param \DateTime $updated_at updated_at + * @param \DateTime $updated_at The timestamp when the option was last updated, in ISO 8601 format. * * @return self */ @@ -673,14 +623,68 @@ public function setUpdatedAt($updated_at) return $this; } + + /** + * Gets updated_by + * + * @return \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null + */ + public function getUpdatedBy() + { + return $this->container['updated_by']; + } + + /** + * Sets updated_by + * + * @param \HubSpot\Client\Cms\Hubdb\Model\SimpleUser|null $updated_by updated_by + * + * @return self + */ + public function setUpdatedBy($updated_by) + { + if (is_null($updated_by)) { + throw new \InvalidArgumentException('non-nullable updated_by cannot be null'); + } + $this->container['updated_by'] = $updated_by; + + return $this; + } + + /** + * Gets updated_by_user_id + * + * @return int|null + */ + public function getUpdatedByUserId() + { + return $this->container['updated_by_user_id']; + } + + /** + * Sets updated_by_user_id + * + * @param int|null $updated_by_user_id The ID of the user who last updated the option. + * + * @return self + */ + public function setUpdatedByUserId($updated_by_user_id) + { + if (is_null($updated_by_user_id)) { + throw new \InvalidArgumentException('non-nullable updated_by_user_id cannot be null'); + } + $this->container['updated_by_user_id'] = $updated_by_user_id; + + return $this; + } /** * 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]); } @@ -688,12 +692,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; } @@ -718,11 +722,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/Cms/Hubdb/Model/Paging.php b/codegen/Cms/Hubdb/Model/Paging.php index 6504e028..83cf1423 100644 --- a/codegen/Cms/Hubdb/Model/Paging.php +++ b/codegen/Cms/Hubdb/Model/Paging.php @@ -2,7 +2,7 @@ /** * Paging * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -352,11 +352,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 +364,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 +394,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/Cms/Hubdb/Model/PreviousPage.php b/codegen/Cms/Hubdb/Model/PreviousPage.php index 510e7831..e234dda5 100644 --- a/codegen/Cms/Hubdb/Model/PreviousPage.php +++ b/codegen/Cms/Hubdb/Model/PreviousPage.php @@ -2,7 +2,7 @@ /** * PreviousPage * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -35,6 +35,7 @@ * PreviousPage Class Doc Comment * * @category Class + * @description specifies the paging information needed to retrieve the previous set of results in a paginated API response * @package HubSpot\Client\Cms\Hubdb * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -312,7 +313,7 @@ public function getBefore() /** * Sets before * - * @param string $before before + * @param string $before A paging cursor token for retrieving previous pages. * * @return self */ @@ -339,7 +340,7 @@ public function getLink() /** * Sets link * - * @param string|null $link link + * @param string|null $link A URL that can be used to retrieve the previous pages' results. * * @return self */ @@ -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/Cms/Hubdb/Model/RandomAccessCollectionResponseWithTotalHubDbTableRowV3.php b/codegen/Cms/Hubdb/Model/RandomAccessCollectionResponseWithTotalHubDbTableRowV3.php index e40ec2b7..7b2dc534 100644 --- a/codegen/Cms/Hubdb/Model/RandomAccessCollectionResponseWithTotalHubDbTableRowV3.php +++ b/codegen/Cms/Hubdb/Model/RandomAccessCollectionResponseWithTotalHubDbTableRowV3.php @@ -2,7 +2,7 @@ /** * RandomAccessCollectionResponseWithTotalHubDbTableRowV3 * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,10 +57,10 @@ class RandomAccessCollectionResponseWithTotalHubDbTableRowV3 implements ModelInt * @var string[] */ protected static $openAPITypes = [ - 'total' => 'int', 'paging' => '\HubSpot\Client\Cms\Hubdb\Model\BoundedPaging', - 'type' => 'string', - 'results' => '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[]' + 'results' => '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[]', + 'total' => 'int', + 'type' => 'string' ]; /** @@ -71,10 +71,10 @@ class RandomAccessCollectionResponseWithTotalHubDbTableRowV3 implements ModelInt * @psalm-var array */ protected static $openAPIFormats = [ - 'total' => 'int32', 'paging' => null, - 'type' => null, - 'results' => null + 'results' => null, + 'total' => 'int32', + 'type' => null ]; /** @@ -83,10 +83,10 @@ class RandomAccessCollectionResponseWithTotalHubDbTableRowV3 implements ModelInt * @var boolean[] */ protected static array $openAPINullables = [ - 'total' => false, 'paging' => false, - 'type' => false, - 'results' => false + 'results' => false, + 'total' => false, + 'type' => false ]; /** @@ -175,10 +175,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'total' => 'total', 'paging' => 'paging', - 'type' => 'type', - 'results' => 'results' + 'results' => 'results', + 'total' => 'total', + 'type' => 'type' ]; /** @@ -187,10 +187,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'total' => 'setTotal', 'paging' => 'setPaging', - 'type' => 'setType', - 'results' => 'setResults' + 'results' => 'setResults', + 'total' => 'setTotal', + 'type' => 'setType' ]; /** @@ -199,10 +199,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'total' => 'getTotal', 'paging' => 'getPaging', - 'type' => 'getType', - 'results' => 'getResults' + 'results' => 'getResults', + 'total' => 'getTotal', + 'type' => 'getType' ]; /** @@ -275,10 +275,10 @@ public function getTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('total', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); - $this->setIfExists('type', $data ?? [], 'RANDOM_ACCESS'); $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'RANDOM_ACCESS'); } /** @@ -308,6 +308,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['results'] === null) { + $invalidProperties[] = "'results' can't be null"; + } if ($this->container['total'] === null) { $invalidProperties[] = "'total' can't be null"; } @@ -323,9 +326,6 @@ public function listInvalidProperties() ); } - if ($this->container['results'] === null) { - $invalidProperties[] = "'results' can't be null"; - } return $invalidProperties; } @@ -342,55 +342,82 @@ public function valid() /** - * Gets total + * Gets paging * - * @return int + * @return \HubSpot\Client\Cms\Hubdb\Model\BoundedPaging|null */ - public function getTotal() + public function getPaging() { - return $this->container['total']; + return $this->container['paging']; } /** - * Sets total + * Sets paging * - * @param int $total total + * @param \HubSpot\Client\Cms\Hubdb\Model\BoundedPaging|null $paging paging * * @return self */ - public function setTotal($total) + public function setPaging($paging) { - if (is_null($total)) { - throw new \InvalidArgumentException('non-nullable total cannot be null'); + if (is_null($paging)) { + throw new \InvalidArgumentException('non-nullable paging cannot be null'); } - $this->container['total'] = $total; + $this->container['paging'] = $paging; return $this; } /** - * Gets paging + * Gets results * - * @return \HubSpot\Client\Cms\Hubdb\Model\BoundedPaging|null + * @return \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[] */ - public function getPaging() + public function getResults() { - return $this->container['paging']; + return $this->container['results']; } /** - * Sets paging + * Sets results * - * @param \HubSpot\Client\Cms\Hubdb\Model\BoundedPaging|null $paging paging + * @param \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[] $results results * * @return self */ - public function setPaging($paging) + public function setResults($results) { - if (is_null($paging)) { - throw new \InvalidArgumentException('non-nullable paging cannot be null'); + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); } - $this->container['paging'] = $paging; + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets total + * + * @return int + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int $total The total number of rows available in the collection. + * + * @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; } @@ -408,7 +435,7 @@ public function getType() /** * Sets type * - * @param string $type type + * @param string $type Indicates the type of response, which is 'RANDOM_ACCESS' by default. * * @return self */ @@ -431,41 +458,14 @@ public function setType($type) return $this; } - - /** - * Gets results - * - * @return \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[] $results results - * - * @return self - */ - public function setResults($results) - { - if (is_null($results)) { - throw new \InvalidArgumentException('non-nullable results cannot be null'); - } - $this->container['results'] = $results; - - 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/Cms/Hubdb/Model/SimpleUser.php b/codegen/Cms/Hubdb/Model/SimpleUser.php index 95d4bb27..51a2f6b1 100644 --- a/codegen/Cms/Hubdb/Model/SimpleUser.php +++ b/codegen/Cms/Hubdb/Model/SimpleUser.php @@ -2,7 +2,7 @@ /** * SimpleUser * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,10 +57,10 @@ class SimpleUser implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ + 'email' => 'string', 'first_name' => 'string', - 'last_name' => 'string', 'id' => 'string', - 'email' => 'string' + 'last_name' => 'string' ]; /** @@ -71,10 +71,10 @@ class SimpleUser implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ + 'email' => null, 'first_name' => null, - 'last_name' => null, 'id' => null, - 'email' => null + 'last_name' => null ]; /** @@ -83,10 +83,10 @@ class SimpleUser implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ + 'email' => false, 'first_name' => false, - 'last_name' => false, 'id' => false, - 'email' => false + 'last_name' => false ]; /** @@ -175,10 +175,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ + 'email' => 'email', 'first_name' => 'firstName', - 'last_name' => 'lastName', 'id' => 'id', - 'email' => 'email' + 'last_name' => 'lastName' ]; /** @@ -187,10 +187,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ + 'email' => 'setEmail', 'first_name' => 'setFirstName', - 'last_name' => 'setLastName', 'id' => 'setId', - 'email' => 'setEmail' + 'last_name' => 'setLastName' ]; /** @@ -199,10 +199,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ + 'email' => 'getEmail', 'first_name' => 'getFirstName', - 'last_name' => 'getLastName', 'id' => 'getId', - 'email' => 'getEmail' + 'last_name' => 'getLastName' ]; /** @@ -262,10 +262,10 @@ public function getModelName() */ public function __construct(?array $data = null) { + $this->setIfExists('email', $data ?? [], null); $this->setIfExists('first_name', $data ?? [], null); - $this->setIfExists('last_name', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); - $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); } /** @@ -295,17 +295,17 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['email'] === null) { + $invalidProperties[] = "'email' can't be null"; + } if ($this->container['first_name'] === null) { $invalidProperties[] = "'first_name' can't be null"; } - if ($this->container['last_name'] === null) { - $invalidProperties[] = "'last_name' can't be null"; - } if ($this->container['id'] === null) { $invalidProperties[] = "'id' can't be null"; } - if ($this->container['email'] === null) { - $invalidProperties[] = "'email' can't be null"; + if ($this->container['last_name'] === null) { + $invalidProperties[] = "'last_name' can't be null"; } return $invalidProperties; } @@ -323,55 +323,55 @@ public function valid() /** - * Gets first_name + * Gets email * * @return string */ - public function getFirstName() + public function getEmail() { - return $this->container['first_name']; + return $this->container['email']; } /** - * Sets first_name + * Sets email * - * @param string $first_name + * @param string $email The email address of the user. * * @return self */ - public function setFirstName($first_name) + public function setEmail($email) { - if (is_null($first_name)) { - throw new \InvalidArgumentException('non-nullable first_name cannot be null'); + if (is_null($email)) { + throw new \InvalidArgumentException('non-nullable email cannot be null'); } - $this->container['first_name'] = $first_name; + $this->container['email'] = $email; return $this; } /** - * Gets last_name + * Gets first_name * * @return string */ - public function getLastName() + public function getFirstName() { - return $this->container['last_name']; + return $this->container['first_name']; } /** - * Sets last_name + * Sets first_name * - * @param string $last_name + * @param string $first_name The first name of the user. * * @return self */ - public function setLastName($last_name) + public function setFirstName($first_name) { - if (is_null($last_name)) { - throw new \InvalidArgumentException('non-nullable last_name cannot be null'); + if (is_null($first_name)) { + throw new \InvalidArgumentException('non-nullable first_name cannot be null'); } - $this->container['last_name'] = $last_name; + $this->container['first_name'] = $first_name; return $this; } @@ -389,7 +389,7 @@ public function getId() /** * Sets id * - * @param string $id + * @param string $id The unique identifier for the user. * * @return self */ @@ -404,39 +404,39 @@ public function setId($id) } /** - * Gets email + * Gets last_name * * @return string */ - public function getEmail() + public function getLastName() { - return $this->container['email']; + return $this->container['last_name']; } /** - * Sets email + * Sets last_name * - * @param string $email + * @param string $last_name The last name of the user. * * @return self */ - public function setEmail($email) + public function setLastName($last_name) { - if (is_null($email)) { - throw new \InvalidArgumentException('non-nullable email cannot be null'); + if (is_null($last_name)) { + throw new \InvalidArgumentException('non-nullable last_name cannot be null'); } - $this->container['email'] = $email; + $this->container['last_name'] = $last_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]); } @@ -444,12 +444,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 +474,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/Cms/Hubdb/Model/StandardError.php b/codegen/Cms/Hubdb/Model/StandardError.php index d217244b..195b3350 100644 --- a/codegen/Cms/Hubdb/Model/StandardError.php +++ b/codegen/Cms/Hubdb/Model/StandardError.php @@ -2,7 +2,7 @@ /** * StandardError * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -35,6 +35,7 @@ * StandardError Class Doc Comment * * @category Class + * @description Ye olde error * @package HubSpot\Client\Cms\Hubdb * @author OpenAPI Generator team * @link https://openapi-generator.tech @@ -57,14 +58,14 @@ class StandardError implements ModelInterface, ArrayAccess, \JsonSerializable * @var string[] */ protected static $openAPITypes = [ - 'sub_category' => 'object', + 'category' => 'string', 'context' => 'array', - 'links' => 'array', + 'errors' => '\HubSpot\Client\Cms\Hubdb\Model\ErrorDetail[]', 'id' => 'string', - 'category' => 'string', + 'links' => 'array', 'message' => 'string', - 'errors' => '\HubSpot\Client\Cms\Hubdb\Model\ErrorDetail[]', - 'status' => 'string' + 'status' => 'string', + 'sub_category' => 'object' ]; /** @@ -75,14 +76,14 @@ class StandardError implements ModelInterface, ArrayAccess, \JsonSerializable * @psalm-var array */ protected static $openAPIFormats = [ - 'sub_category' => null, + 'category' => null, 'context' => null, - 'links' => null, + 'errors' => null, 'id' => null, - 'category' => null, + 'links' => null, 'message' => null, - 'errors' => null, - 'status' => null + 'status' => null, + 'sub_category' => null ]; /** @@ -91,14 +92,14 @@ class StandardError implements ModelInterface, ArrayAccess, \JsonSerializable * @var boolean[] */ protected static array $openAPINullables = [ - 'sub_category' => false, + 'category' => false, 'context' => false, - 'links' => false, + 'errors' => false, 'id' => false, - 'category' => false, + 'links' => false, 'message' => false, - 'errors' => false, - 'status' => false + 'status' => false, + 'sub_category' => false ]; /** @@ -187,14 +188,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'sub_category' => 'subCategory', + 'category' => 'category', 'context' => 'context', - 'links' => 'links', + 'errors' => 'errors', 'id' => 'id', - 'category' => 'category', + 'links' => 'links', 'message' => 'message', - 'errors' => 'errors', - 'status' => 'status' + 'status' => 'status', + 'sub_category' => 'subCategory' ]; /** @@ -203,14 +204,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'sub_category' => 'setSubCategory', + 'category' => 'setCategory', 'context' => 'setContext', - 'links' => 'setLinks', + 'errors' => 'setErrors', 'id' => 'setId', - 'category' => 'setCategory', + 'links' => 'setLinks', 'message' => 'setMessage', - 'errors' => 'setErrors', - 'status' => 'setStatus' + 'status' => 'setStatus', + 'sub_category' => 'setSubCategory' ]; /** @@ -219,14 +220,14 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'sub_category' => 'getSubCategory', + 'category' => 'getCategory', 'context' => 'getContext', - 'links' => 'getLinks', + 'errors' => 'getErrors', 'id' => 'getId', - 'category' => 'getCategory', + 'links' => 'getLinks', 'message' => 'getMessage', - 'errors' => 'getErrors', - 'status' => 'getStatus' + 'status' => 'getStatus', + 'sub_category' => 'getSubCategory' ]; /** @@ -286,14 +287,14 @@ public function getModelName() */ public function __construct(?array $data = null) { - $this->setIfExists('sub_category', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); $this->setIfExists('context', $data ?? [], null); - $this->setIfExists('links', $data ?? [], null); + $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('id', $data ?? [], null); - $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('links', $data ?? [], null); $this->setIfExists('message', $data ?? [], null); - $this->setIfExists('errors', $data ?? [], null); $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('sub_category', $data ?? [], null); } /** @@ -323,21 +324,21 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['category'] === null) { + $invalidProperties[] = "'category' can't be null"; + } if ($this->container['context'] === null) { $invalidProperties[] = "'context' can't be null"; } + if ($this->container['errors'] === null) { + $invalidProperties[] = "'errors' can't be null"; + } if ($this->container['links'] === null) { $invalidProperties[] = "'links' can't be null"; } - if ($this->container['category'] === null) { - $invalidProperties[] = "'category' can't be null"; - } if ($this->container['message'] === null) { $invalidProperties[] = "'message' can't be null"; } - if ($this->container['errors'] === null) { - $invalidProperties[] = "'errors' can't be null"; - } if ($this->container['status'] === null) { $invalidProperties[] = "'status' can't be null"; } @@ -357,28 +358,28 @@ public function valid() /** - * Gets sub_category + * Gets category * - * @return object|null + * @return string */ - public function getSubCategory() + public function getCategory() { - return $this->container['sub_category']; + return $this->container['category']; } /** - * Sets sub_category + * Sets category * - * @param object|null $sub_category Identifies the subcategory of the error, providing more specific context within the main category. + * @param string $category Specifies the main category of the error, determining the broad area of issue. * * @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; } @@ -411,28 +412,28 @@ public function setContext($context) } /** - * Gets links + * Gets errors * - * @return array + * @return \HubSpot\Client\Cms\Hubdb\Model\ErrorDetail[] */ - public function getLinks() + public function getErrors() { - return $this->container['links']; + return $this->container['errors']; } /** - * Sets links + * Sets errors * - * @param array $links An object containing links related to the error, such as documentation URLs or support contact pages. + * @param \HubSpot\Client\Cms\Hubdb\Model\ErrorDetail[] $errors The detailed error objects. * * @return self */ - public function setLinks($links) + public function setErrors($errors) { - if (is_null($links)) { - throw new \InvalidArgumentException('non-nullable links cannot be null'); + if (is_null($errors)) { + throw new \InvalidArgumentException('non-nullable errors cannot be null'); } - $this->container['links'] = $links; + $this->container['errors'] = $errors; return $this; } @@ -465,28 +466,28 @@ public function setId($id) } /** - * Gets category + * Gets links * - * @return string + * @return array */ - public function getCategory() + public function getLinks() { - return $this->container['category']; + return $this->container['links']; } /** - * Sets category + * Sets links * - * @param string $category Specifies the main category of the error, determining the broad area of issue. + * @param array $links An object containing links related to the error, such as documentation URLs or support contact pages. * * @return self */ - public function setCategory($category) + public function setLinks($links) { - if (is_null($category)) { - throw new \InvalidArgumentException('non-nullable category cannot be null'); + if (is_null($links)) { + throw new \InvalidArgumentException('non-nullable links cannot be null'); } - $this->container['category'] = $category; + $this->container['links'] = $links; return $this; } @@ -519,66 +520,66 @@ public function setMessage($message) } /** - * Gets errors + * Gets status * - * @return \HubSpot\Client\Cms\Hubdb\Model\ErrorDetail[] + * @return string */ - public function getErrors() + public function getStatus() { - return $this->container['errors']; + return $this->container['status']; } /** - * Sets errors + * Sets status * - * @param \HubSpot\Client\Cms\Hubdb\Model\ErrorDetail[] $errors + * @param string $status The HTTP status code associated with the error. * * @return self */ - public function setErrors($errors) + public function setStatus($status) { - if (is_null($errors)) { - throw new \InvalidArgumentException('non-nullable errors cannot be null'); + if (is_null($status)) { + throw new \InvalidArgumentException('non-nullable status cannot be null'); } - $this->container['errors'] = $errors; + $this->container['status'] = $status; return $this; } /** - * Gets status + * Gets sub_category * - * @return string + * @return object|null */ - public function getStatus() + public function getSubCategory() { - return $this->container['status']; + return $this->container['sub_category']; } /** - * Sets status + * Sets sub_category * - * @param string $status The HTTP status code associated with the error. + * @param object|null $sub_category Identifies the subcategory of the error, providing more specific context within the main category. * * @return self */ - public function setStatus($status) + public function setSubCategory($sub_category) { - if (is_null($status)) { - throw new \InvalidArgumentException('non-nullable status cannot be null'); + if (is_null($sub_category)) { + throw new \InvalidArgumentException('non-nullable sub_category cannot be null'); } - $this->container['status'] = $status; + $this->container['sub_category'] = $sub_category; return $this; } /** * Returns true if offset exists. False otherwise. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return boolean */ - public function offsetExists($offset): bool + public function offsetExists(mixed $offset): bool { return isset($this->container[$offset]); } @@ -586,12 +587,12 @@ public function offsetExists($offset): bool /** * Gets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return mixed|null */ #[\ReturnTypeWillChange] - public function offsetGet($offset) + public function offsetGet(mixed $offset) { return $this->container[$offset] ?? null; } @@ -616,11 +617,11 @@ public function offsetSet($offset, $value): void /** * Unsets offset. * - * @param integer $offset Offset + * @param integer|string $offset Offset * * @return void */ - public function offsetUnset($offset): void + public function offsetUnset(mixed $offset): void { unset($this->container[$offset]); } diff --git a/codegen/Cms/Hubdb/Model/StreamingCollectionResponseWithTotalHubDbTableRowV3.php b/codegen/Cms/Hubdb/Model/StreamingCollectionResponseWithTotalHubDbTableRowV3.php index 2e16f427..59fef980 100644 --- a/codegen/Cms/Hubdb/Model/StreamingCollectionResponseWithTotalHubDbTableRowV3.php +++ b/codegen/Cms/Hubdb/Model/StreamingCollectionResponseWithTotalHubDbTableRowV3.php @@ -2,7 +2,7 @@ /** * StreamingCollectionResponseWithTotalHubDbTableRowV3 * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -57,10 +57,10 @@ class StreamingCollectionResponseWithTotalHubDbTableRowV3 implements ModelInterf * @var string[] */ protected static $openAPITypes = [ - 'total' => 'int', 'paging' => '\HubSpot\Client\Cms\Hubdb\Model\Paging', - 'type' => 'string', - 'results' => '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[]' + 'results' => '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[]', + 'total' => 'int', + 'type' => 'string' ]; /** @@ -71,10 +71,10 @@ class StreamingCollectionResponseWithTotalHubDbTableRowV3 implements ModelInterf * @psalm-var array */ protected static $openAPIFormats = [ - 'total' => 'int32', 'paging' => null, - 'type' => null, - 'results' => null + 'results' => null, + 'total' => 'int32', + 'type' => null ]; /** @@ -83,10 +83,10 @@ class StreamingCollectionResponseWithTotalHubDbTableRowV3 implements ModelInterf * @var boolean[] */ protected static array $openAPINullables = [ - 'total' => false, 'paging' => false, - 'type' => false, - 'results' => false + 'results' => false, + 'total' => false, + 'type' => false ]; /** @@ -175,10 +175,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'total' => 'total', 'paging' => 'paging', - 'type' => 'type', - 'results' => 'results' + 'results' => 'results', + 'total' => 'total', + 'type' => 'type' ]; /** @@ -187,10 +187,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'total' => 'setTotal', 'paging' => 'setPaging', - 'type' => 'setType', - 'results' => 'setResults' + 'results' => 'setResults', + 'total' => 'setTotal', + 'type' => 'setType' ]; /** @@ -199,10 +199,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'total' => 'getTotal', 'paging' => 'getPaging', - 'type' => 'getType', - 'results' => 'getResults' + 'results' => 'getResults', + 'total' => 'getTotal', + 'type' => 'getType' ]; /** @@ -275,10 +275,10 @@ public function getTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('total', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); - $this->setIfExists('type', $data ?? [], 'STREAMING'); $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'STREAMING'); } /** @@ -308,6 +308,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['results'] === null) { + $invalidProperties[] = "'results' can't be null"; + } if ($this->container['total'] === null) { $invalidProperties[] = "'total' can't be null"; } @@ -323,9 +326,6 @@ public function listInvalidProperties() ); } - if ($this->container['results'] === null) { - $invalidProperties[] = "'results' can't be null"; - } return $invalidProperties; } @@ -342,55 +342,82 @@ public function valid() /** - * Gets total + * Gets paging * - * @return int + * @return \HubSpot\Client\Cms\Hubdb\Model\Paging|null */ - public function getTotal() + public function getPaging() { - return $this->container['total']; + return $this->container['paging']; } /** - * Sets total + * Sets paging * - * @param int $total total + * @param \HubSpot\Client\Cms\Hubdb\Model\Paging|null $paging paging * * @return self */ - public function setTotal($total) + public function setPaging($paging) { - if (is_null($total)) { - throw new \InvalidArgumentException('non-nullable total cannot be null'); + if (is_null($paging)) { + throw new \InvalidArgumentException('non-nullable paging cannot be null'); } - $this->container['total'] = $total; + $this->container['paging'] = $paging; return $this; } /** - * Gets paging + * Gets results * - * @return \HubSpot\Client\Cms\Hubdb\Model\Paging|null + * @return \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[] */ - public function getPaging() + public function getResults() { - return $this->container['paging']; + return $this->container['results']; } /** - * Sets paging + * Sets results * - * @param \HubSpot\Client\Cms\Hubdb\Model\Paging|null $paging paging + * @param \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[] $results results * * @return self */ - public function setPaging($paging) + public function setResults($results) { - if (is_null($paging)) { - throw new \InvalidArgumentException('non-nullable paging cannot be null'); + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); } - $this->container['paging'] = $paging; + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets total + * + * @return int + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int $total The total number of rows available in the collection. + * + * @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; } @@ -408,7 +435,7 @@ public function getType() /** * Sets type * - * @param string $type type + * @param string $type Indicates the type of response, which is 'STREAMING' by default. * * @return self */ @@ -431,41 +458,14 @@ public function setType($type) return $this; } - - /** - * Gets results - * - * @return \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[] $results results - * - * @return self - */ - public function setResults($results) - { - if (is_null($results)) { - throw new \InvalidArgumentException('non-nullable results cannot be null'); - } - $this->container['results'] = $results; - - 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/Cms/Hubdb/Model/UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3.php b/codegen/Cms/Hubdb/Model/UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3.php index fd93e4ae..654c3d9b 100644 --- a/codegen/Cms/Hubdb/Model/UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3.php +++ b/codegen/Cms/Hubdb/Model/UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3.php @@ -2,7 +2,7 @@ /** * UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3 * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -42,7 +42,7 @@ */ class UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3 implements ModelInterface, ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = null; + public const DISCRIMINATOR = 'type'; /** * The original name of the model. @@ -57,10 +57,10 @@ class UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3 implements ModelInte * @var string[] */ protected static $openAPITypes = [ - 'total' => 'int', 'paging' => '\HubSpot\Client\Cms\Hubdb\Model\Paging', - 'type' => 'string', - 'results' => '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[]' + 'results' => '\HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[]', + 'total' => 'int', + 'type' => 'string' ]; /** @@ -71,10 +71,10 @@ class UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3 implements ModelInte * @psalm-var array */ protected static $openAPIFormats = [ - 'total' => 'int32', 'paging' => null, - 'type' => null, - 'results' => null + 'results' => null, + 'total' => 'int32', + 'type' => null ]; /** @@ -83,10 +83,10 @@ class UnifiedCollectionResponseWithTotalBaseHubDbTableRowV3 implements ModelInte * @var boolean[] */ protected static array $openAPINullables = [ - 'total' => false, 'paging' => false, - 'type' => false, - 'results' => false + 'results' => false, + 'total' => false, + 'type' => false ]; /** @@ -175,10 +175,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $attributeMap = [ - 'total' => 'total', 'paging' => 'paging', - 'type' => 'type', - 'results' => 'results' + 'results' => 'results', + 'total' => 'total', + 'type' => 'type' ]; /** @@ -187,10 +187,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $setters = [ - 'total' => 'setTotal', 'paging' => 'setPaging', - 'type' => 'setType', - 'results' => 'setResults' + 'results' => 'setResults', + 'total' => 'setTotal', + 'type' => 'setType' ]; /** @@ -199,10 +199,10 @@ public function isNullableSetToNull(string $property): bool * @var string[] */ protected static $getters = [ - 'total' => 'getTotal', 'paging' => 'getPaging', - 'type' => 'getType', - 'results' => 'getResults' + 'results' => 'getResults', + 'total' => 'getTotal', + 'type' => 'getType' ]; /** @@ -277,10 +277,13 @@ public function getTypeAllowableValues() */ public function __construct(?array $data = null) { - $this->setIfExists('total', $data ?? [], null); $this->setIfExists('paging', $data ?? [], null); - $this->setIfExists('type', $data ?? [], 'RANDOM_ACCESS'); $this->setIfExists('results', $data ?? [], null); + $this->setIfExists('total', $data ?? [], null); + $this->setIfExists('type', $data ?? [], 'RANDOM_ACCESS'); + + // Initialize discriminator property with the model name. + $this->container['type'] = static::$openAPIModelName; } /** @@ -310,6 +313,9 @@ public function listInvalidProperties() { $invalidProperties = []; + if ($this->container['results'] === null) { + $invalidProperties[] = "'results' can't be null"; + } if ($this->container['total'] === null) { $invalidProperties[] = "'total' can't be null"; } @@ -325,9 +331,6 @@ public function listInvalidProperties() ); } - if ($this->container['results'] === null) { - $invalidProperties[] = "'results' can't be null"; - } return $invalidProperties; } @@ -344,55 +347,82 @@ public function valid() /** - * Gets total + * Gets paging * - * @return int + * @return \HubSpot\Client\Cms\Hubdb\Model\Paging|null */ - public function getTotal() + public function getPaging() { - return $this->container['total']; + return $this->container['paging']; } /** - * Sets total + * Sets paging * - * @param int $total total + * @param \HubSpot\Client\Cms\Hubdb\Model\Paging|null $paging paging * * @return self */ - public function setTotal($total) + public function setPaging($paging) { - if (is_null($total)) { - throw new \InvalidArgumentException('non-nullable total cannot be null'); + if (is_null($paging)) { + throw new \InvalidArgumentException('non-nullable paging cannot be null'); } - $this->container['total'] = $total; + $this->container['paging'] = $paging; return $this; } /** - * Gets paging + * Gets results * - * @return \HubSpot\Client\Cms\Hubdb\Model\Paging|null + * @return \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[] */ - public function getPaging() + public function getResults() { - return $this->container['paging']; + return $this->container['results']; } /** - * Sets paging + * Sets results * - * @param \HubSpot\Client\Cms\Hubdb\Model\Paging|null $paging paging + * @param \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[] $results results * * @return self */ - public function setPaging($paging) + public function setResults($results) { - if (is_null($paging)) { - throw new \InvalidArgumentException('non-nullable paging cannot be null'); + if (is_null($results)) { + throw new \InvalidArgumentException('non-nullable results cannot be null'); } - $this->container['paging'] = $paging; + $this->container['results'] = $results; + + return $this; + } + + /** + * Gets total + * + * @return int + */ + public function getTotal() + { + return $this->container['total']; + } + + /** + * Sets total + * + * @param int $total The total number of rows available in the collection. + * + * @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; } @@ -410,7 +440,7 @@ public function getType() /** * Sets type * - * @param string $type type + * @param string $type Indicates the type of response, which is 'RANDOM_ACCESS' by default. * * @return self */ @@ -433,41 +463,14 @@ public function setType($type) return $this; } - - /** - * Gets results - * - * @return \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[] - */ - public function getResults() - { - return $this->container['results']; - } - - /** - * Sets results - * - * @param \HubSpot\Client\Cms\Hubdb\Model\HubDbTableRowV3[] $results results - * - * @return self - */ - public function setResults($results) - { - if (is_null($results)) { - throw new \InvalidArgumentException('non-nullable results cannot be null'); - } - $this->container['results'] = $results; - - 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]); } @@ -475,12 +478,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; } @@ -505,11 +508,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/Cms/Hubdb/ObjectSerializer.php b/codegen/Cms/Hubdb/ObjectSerializer.php index bc8b3d73..7fef5b93 100644 --- a/codegen/Cms/Hubdb/ObjectSerializer.php +++ b/codegen/Cms/Hubdb/ObjectSerializer.php @@ -2,7 +2,7 @@ /** * ObjectSerializer * - * PHP version 7.4 + * PHP version 8.1 * * @category Class * @package HubSpot\Client\Cms\Hubdb @@ -13,11 +13,11 @@ /** * Hubdb * - * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + * Basepom for all HubSpot Projects * * The version of the OpenAPI document: v3 * Generated by: https://openapi-generator.tech - * Generator version: 7.12.0 + * Generator version: 7.17.0 */ /** @@ -323,24 +323,6 @@ public static function toHeaderValue($value) return self::toString($value); } - /** - * Take value and turn it into a string suitable for inclusion in - * the http body (form parameter). If it's a string, pass through unchanged - * If it's a datetime object, format it in ISO8601 - * - * @param string|\SplFileObject $value the value of the form parameter - * - * @return string the form string - */ - public static function toFormValue($value) - { - if ($value instanceof \SplFileObject) { - return $value->getRealPath(); - } else { - return self::toString($value); - } - } - /** * Take value and turn it into a string suitable for inclusion in * the parameter. If it's a string, pass through unchanged @@ -612,6 +594,6 @@ public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): } } - return $qs ? (string) substr($qs, 0, -1) : ''; + return $qs ? substr($qs, 0, -1) : ''; } }