From 81d4ee915b43a71f7e1f95bcfec2be7464d32d74 Mon Sep 17 00:00:00 2001 From: Cedric Ziel Date: Tue, 6 Aug 2024 21:19:00 +0200 Subject: [PATCH 1/2] fix: remove demo content from create rows example --- generated/Client.php | 4 +- .../Endpoint/BatchCreateDatabaseTableRows.php | 8 +- generated/Endpoint/CreateDatabaseTableRow.php | 8 +- ...sRequest.php => BatchCreateRowRequest.php} | 8 +- generated/Model/CreateRowRequest.php | 24 + ...RowRequestSerializerWithUserFieldNames.php | 465 ---------------- ...hp => BatchCreateRowRequestNormalizer.php} | 24 +- .../Normalizer/CreateRowRequestNormalizer.php | 139 +++++ ...SerializerWithUserFieldNamesNormalizer.php | 495 ------------------ generated/Normalizer/JaneObjectNormalizer.php | 16 +- openapi.json | 22 +- 11 files changed, 209 insertions(+), 1004 deletions(-) rename generated/Model/{ExampleBatchRowsRequest.php => BatchCreateRowRequest.php} (72%) create mode 100644 generated/Model/CreateRowRequest.php delete mode 100644 generated/Model/ExampleRowRequestSerializerWithUserFieldNames.php rename generated/Normalizer/{ExampleBatchRowsRequestNormalizer.php => BatchCreateRowRequestNormalizer.php} (81%) create mode 100644 generated/Normalizer/CreateRowRequestNormalizer.php delete mode 100644 generated/Normalizer/ExampleRowRequestSerializerWithUserFieldNamesNormalizer.php diff --git a/generated/Client.php b/generated/Client.php index 16dfb4e..21562a8 100644 --- a/generated/Client.php +++ b/generated/Client.php @@ -1948,7 +1948,7 @@ public function listDatabaseTableRows(int $tableId, array $queryParameters = [], * @throws Exception\CreateDatabaseTableRowUnauthorizedException * @throws Exception\CreateDatabaseTableRowNotFoundException */ - public function createDatabaseTableRow(int $tableId, ?Model\ExampleRowRequestSerializerWithUserFieldNames $requestBody = null, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function createDatabaseTableRow(int $tableId, ?Model\CreateRowRequest $requestBody = null, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\CreateDatabaseTableRow($tableId, $requestBody, $queryParameters, $headerParameters), $fetch); } @@ -2161,7 +2161,7 @@ public function batchUpdateDatabaseTableRows(int $tableId, ?Model\PatchRowsReque * @throws Exception\BatchCreateDatabaseTableRowsUnauthorizedException * @throws Exception\BatchCreateDatabaseTableRowsNotFoundException */ - public function batchCreateDatabaseTableRows(int $tableId, Model\ExampleBatchRowsRequest $requestBody, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) + public function batchCreateDatabaseTableRows(int $tableId, Model\BatchCreateRowRequest $requestBody, array $queryParameters = [], array $headerParameters = [], string $fetch = self::FETCH_OBJECT) { return $this->executeEndpoint(new Endpoint\BatchCreateDatabaseTableRows($tableId, $requestBody, $queryParameters, $headerParameters), $fetch); } diff --git a/generated/Endpoint/BatchCreateDatabaseTableRows.php b/generated/Endpoint/BatchCreateDatabaseTableRows.php index bd787e8..bd7e5a1 100644 --- a/generated/Endpoint/BatchCreateDatabaseTableRows.php +++ b/generated/Endpoint/BatchCreateDatabaseTableRows.php @@ -32,7 +32,7 @@ class BatchCreateDatabaseTableRows extends \CedricZiel\Baserow\Generated\Runtime * @var string $ClientUndoRedoActionGroupId An optional header that marks the action performed by this request as having occurred in a particular action group.Then calling the undo/redo endpoint with the same ClientSessionId header, all the actions belonging to the same action group can be undone/redone together in a single API call. * } */ - public function __construct(int $tableId, \CedricZiel\Baserow\Generated\Model\ExampleBatchRowsRequest $requestBody, array $queryParameters = [], array $headerParameters = []) + public function __construct(int $tableId, \CedricZiel\Baserow\Generated\Model\BatchCreateRowRequest $requestBody, array $queryParameters = [], array $headerParameters = []) { $this->table_id = $tableId; $this->body = $requestBody; @@ -52,13 +52,13 @@ public function getUri(): string public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - if ($this->body instanceof \CedricZiel\Baserow\Generated\Model\ExampleBatchRowsRequest) { + if ($this->body instanceof \CedricZiel\Baserow\Generated\Model\BatchCreateRowRequest) { return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - if ($this->body instanceof \CedricZiel\Baserow\Generated\Model\ExampleBatchRowsRequest) { + if ($this->body instanceof \CedricZiel\Baserow\Generated\Model\BatchCreateRowRequest) { return [['Content-Type' => ['application/x-www-form-urlencoded']], http_build_query($serializer->normalize($this->body, 'json'))]; } - if ($this->body instanceof \CedricZiel\Baserow\Generated\Model\ExampleBatchRowsRequest) { + if ($this->body instanceof \CedricZiel\Baserow\Generated\Model\BatchCreateRowRequest) { $bodyBuilder = new \Http\Message\MultipartStream\MultipartStreamBuilder($streamFactory); $formParameters = $serializer->normalize($this->body, 'json'); foreach ($formParameters as $key => $value) { diff --git a/generated/Endpoint/CreateDatabaseTableRow.php b/generated/Endpoint/CreateDatabaseTableRow.php index 2cdc46e..7b41edb 100644 --- a/generated/Endpoint/CreateDatabaseTableRow.php +++ b/generated/Endpoint/CreateDatabaseTableRow.php @@ -31,7 +31,7 @@ class CreateDatabaseTableRow extends \CedricZiel\Baserow\Generated\Runtime\Clien * @var string $ClientUndoRedoActionGroupId An optional header that marks the action performed by this request as having occurred in a particular action group.Then calling the undo/redo endpoint with the same ClientSessionId header, all the actions belonging to the same action group can be undone/redone together in a single API call. * } */ - public function __construct(int $tableId, ?\CedricZiel\Baserow\Generated\Model\ExampleRowRequestSerializerWithUserFieldNames $requestBody = null, array $queryParameters = [], array $headerParameters = []) + public function __construct(int $tableId, ?\CedricZiel\Baserow\Generated\Model\CreateRowRequest $requestBody = null, array $queryParameters = [], array $headerParameters = []) { $this->table_id = $tableId; $this->body = $requestBody; @@ -51,13 +51,13 @@ public function getUri(): string public function getBody(\Symfony\Component\Serializer\SerializerInterface $serializer, $streamFactory = null): array { - if ($this->body instanceof \CedricZiel\Baserow\Generated\Model\ExampleRowRequestSerializerWithUserFieldNames) { + if ($this->body instanceof \CedricZiel\Baserow\Generated\Model\CreateRowRequest) { return [['Content-Type' => ['application/json']], $serializer->serialize($this->body, 'json')]; } - if ($this->body instanceof \CedricZiel\Baserow\Generated\Model\ExampleRowRequestSerializerWithUserFieldNames) { + if ($this->body instanceof \CedricZiel\Baserow\Generated\Model\CreateRowRequest) { return [['Content-Type' => ['application/x-www-form-urlencoded']], http_build_query($serializer->normalize($this->body, 'json'))]; } - if ($this->body instanceof \CedricZiel\Baserow\Generated\Model\ExampleRowRequestSerializerWithUserFieldNames) { + if ($this->body instanceof \CedricZiel\Baserow\Generated\Model\CreateRowRequest) { $bodyBuilder = new \Http\Message\MultipartStream\MultipartStreamBuilder($streamFactory); $formParameters = $serializer->normalize($this->body, 'json'); foreach ($formParameters as $key => $value) { diff --git a/generated/Model/ExampleBatchRowsRequest.php b/generated/Model/BatchCreateRowRequest.php similarity index 72% rename from generated/Model/ExampleBatchRowsRequest.php rename to generated/Model/BatchCreateRowRequest.php index fa14a4d..658c387 100644 --- a/generated/Model/ExampleBatchRowsRequest.php +++ b/generated/Model/BatchCreateRowRequest.php @@ -10,7 +10,7 @@ namespace CedricZiel\Baserow\Generated\Model; -class ExampleBatchRowsRequest extends \ArrayObject +class BatchCreateRowRequest extends \ArrayObject { /** * @var array @@ -22,12 +22,12 @@ public function isInitialized($property): bool return array_key_exists($property, $this->initialized); } /** - * @var list + * @var list */ protected $items; /** - * @return list + * @return list */ public function getItems(): array { @@ -35,7 +35,7 @@ public function getItems(): array } /** - * @param list $items + * @param list $items */ public function setItems(array $items): self { diff --git a/generated/Model/CreateRowRequest.php b/generated/Model/CreateRowRequest.php new file mode 100644 index 0000000..889bed2 --- /dev/null +++ b/generated/Model/CreateRowRequest.php @@ -0,0 +1,24 @@ +initialized); + } +} diff --git a/generated/Model/ExampleRowRequestSerializerWithUserFieldNames.php b/generated/Model/ExampleRowRequestSerializerWithUserFieldNames.php deleted file mode 100644 index 9489418..0000000 --- a/generated/Model/ExampleRowRequestSerializerWithUserFieldNames.php +++ /dev/null @@ -1,465 +0,0 @@ -initialized); - } - /** - * This field represents the `text` field. The number in field_1 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - * - * @var string|null - */ - protected $field1; - /** - * This field represents the `long_text` field. The number in field_2 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - * - * @var string|null - */ - protected $field2; - /** - * This field represents the `url` field. The number in field_3 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - * - * @var string|null - */ - protected $field3; - /** - * This field represents the `email` field. The number in field_4 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - * - * @var string|null - */ - protected $field4; - /** - * This field represents the `number` field. The number in field_5 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - * - * @var string|null - */ - protected $field5; - /** - * This field represents the `rating` field. The number in field_6 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - * - * @var int - */ - protected $field6 = 0; - /** - * This field represents the `boolean` field. The number in field_7 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - * - * @var bool - */ - protected $field7 = false; - /** - * This field represents the `date` field. The number in field_8 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - * - * @var \DateTime|null - */ - protected $field8; - /** - * This field represents the `duration` field. The number in field_13 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. The provided value can be a string in one of the available formats or a number representing the duration in seconds. In any case, the value will be rounded to match the field's duration format. - * - * @var float|null - */ - protected $field13; - /** - * This field represents the `link_row` field. The number in field_14 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. This field accepts an `array` containing the ids or the names of the related rows. A name is the value of the primary key of the related row. This field also accepts a string with names separated by a comma or an array of row names. You can also provide a unique row Id.The response contains a list of objects containing the `id` and the primary field's `value` as a string for display purposes. - * - * @var list - */ - protected $field14; - /** - * This field represents the `file` field. The number in field_15 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. This field accepts an `array` containing objects with the name of the file. The response contains an `array` of more detailed objects related to the files. - * - * @var list|null - */ - protected $field15; - /** - * This field represents the `single_select` field. The number in field_16 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. This field accepts an `integer` representing the chosen select option id related to the field. Available ids can be found when getting or listing the field. The response represents chosen field, but also the value and color is exposed. - * - * @var int|null - */ - protected $field16; - /** - * This field represents the `multiple_select` field. The number in field_17 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. This field accepts a list of `integer` each of which representing the chosen select option id related to the field. Available ids can be foundwhen getting or listing the field. You can also send a list of option names in which case the option are searched by name. The first one that matches is used. This field also accepts a string with names separated by a comma or an array of file names. The response represents chosen field, but also the value and color is exposed. - * - * @var list - */ - protected $field17; - /** - * This field represents the `phone_number` field. The number in field_18 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - * - * @var string|null - */ - protected $field18; - /** - * This field represents the `multiple_collaborators` field. The number in field_23 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. This field accepts a list of objects representing the chosen collaborators through the object's `id` property. The id is Baserow user id. The response objects also contains the collaborator name directly along with its id. - * - * @var list - */ - protected $field23; - /** - * This field represents the `password` field. The number in field_26 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. Allows setting a write only password value. Providing a string will set the password, `null` will unset it, `true` will be ignored. The response will respond with `true` is a password is set, but will never expose the password itself. - * - * @var string|null - */ - protected $field26; - /** - * This field represents the `ai` field. The number in field_27 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. Holds a text value that is generated by a generative AI model using a dynamic prompt. - * - * @var string|null - */ - protected $field27; - - /** - * This field represents the `text` field. The number in field_1 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - */ - public function getField1(): ?string - { - return $this->field1; - } - - /** - * This field represents the `text` field. The number in field_1 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - */ - public function setField1(?string $field1): self - { - $this->initialized['field1'] = true; - $this->field1 = $field1; - - return $this; - } - - /** - * This field represents the `long_text` field. The number in field_2 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - */ - public function getField2(): ?string - { - return $this->field2; - } - - /** - * This field represents the `long_text` field. The number in field_2 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - */ - public function setField2(?string $field2): self - { - $this->initialized['field2'] = true; - $this->field2 = $field2; - - return $this; - } - - /** - * This field represents the `url` field. The number in field_3 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - */ - public function getField3(): ?string - { - return $this->field3; - } - - /** - * This field represents the `url` field. The number in field_3 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - */ - public function setField3(?string $field3): self - { - $this->initialized['field3'] = true; - $this->field3 = $field3; - - return $this; - } - - /** - * This field represents the `email` field. The number in field_4 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - */ - public function getField4(): ?string - { - return $this->field4; - } - - /** - * This field represents the `email` field. The number in field_4 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - */ - public function setField4(?string $field4): self - { - $this->initialized['field4'] = true; - $this->field4 = $field4; - - return $this; - } - - /** - * This field represents the `number` field. The number in field_5 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - */ - public function getField5(): ?string - { - return $this->field5; - } - - /** - * This field represents the `number` field. The number in field_5 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - */ - public function setField5(?string $field5): self - { - $this->initialized['field5'] = true; - $this->field5 = $field5; - - return $this; - } - - /** - * This field represents the `rating` field. The number in field_6 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - */ - public function getField6(): int - { - return $this->field6; - } - - /** - * This field represents the `rating` field. The number in field_6 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - */ - public function setField6(int $field6): self - { - $this->initialized['field6'] = true; - $this->field6 = $field6; - - return $this; - } - - /** - * This field represents the `boolean` field. The number in field_7 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - */ - public function getField7(): bool - { - return $this->field7; - } - - /** - * This field represents the `boolean` field. The number in field_7 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - */ - public function setField7(bool $field7): self - { - $this->initialized['field7'] = true; - $this->field7 = $field7; - - return $this; - } - - /** - * This field represents the `date` field. The number in field_8 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - */ - public function getField8(): ?\DateTime - { - return $this->field8; - } - - /** - * This field represents the `date` field. The number in field_8 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - */ - public function setField8(?\DateTime $field8): self - { - $this->initialized['field8'] = true; - $this->field8 = $field8; - - return $this; - } - - /** - * This field represents the `duration` field. The number in field_13 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. The provided value can be a string in one of the available formats or a number representing the duration in seconds. In any case, the value will be rounded to match the field's duration format. - */ - public function getField13(): ?float - { - return $this->field13; - } - - /** - * This field represents the `duration` field. The number in field_13 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. The provided value can be a string in one of the available formats or a number representing the duration in seconds. In any case, the value will be rounded to match the field's duration format. - */ - public function setField13(?float $field13): self - { - $this->initialized['field13'] = true; - $this->field13 = $field13; - - return $this; - } - - /** - * This field represents the `link_row` field. The number in field_14 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. This field accepts an `array` containing the ids or the names of the related rows. A name is the value of the primary key of the related row. This field also accepts a string with names separated by a comma or an array of row names. You can also provide a unique row Id.The response contains a list of objects containing the `id` and the primary field's `value` as a string for display purposes. - * - * @return list - */ - public function getField14(): array - { - return $this->field14; - } - - /** - * This field represents the `link_row` field. The number in field_14 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. This field accepts an `array` containing the ids or the names of the related rows. A name is the value of the primary key of the related row. This field also accepts a string with names separated by a comma or an array of row names. You can also provide a unique row Id.The response contains a list of objects containing the `id` and the primary field's `value` as a string for display purposes. - * - * @param list $field14 - */ - public function setField14(array $field14): self - { - $this->initialized['field14'] = true; - $this->field14 = $field14; - - return $this; - } - - /** - * This field represents the `file` field. The number in field_15 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. This field accepts an `array` containing objects with the name of the file. The response contains an `array` of more detailed objects related to the files. - * - * @return list|null - */ - public function getField15(): ?array - { - return $this->field15; - } - - /** - * This field represents the `file` field. The number in field_15 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. This field accepts an `array` containing objects with the name of the file. The response contains an `array` of more detailed objects related to the files. - * - * @param list|null $field15 - */ - public function setField15(?array $field15): self - { - $this->initialized['field15'] = true; - $this->field15 = $field15; - - return $this; - } - - /** - * This field represents the `single_select` field. The number in field_16 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. This field accepts an `integer` representing the chosen select option id related to the field. Available ids can be found when getting or listing the field. The response represents chosen field, but also the value and color is exposed. - */ - public function getField16(): ?int - { - return $this->field16; - } - - /** - * This field represents the `single_select` field. The number in field_16 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. This field accepts an `integer` representing the chosen select option id related to the field. Available ids can be found when getting or listing the field. The response represents chosen field, but also the value and color is exposed. - */ - public function setField16(?int $field16): self - { - $this->initialized['field16'] = true; - $this->field16 = $field16; - - return $this; - } - - /** - * This field represents the `multiple_select` field. The number in field_17 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. This field accepts a list of `integer` each of which representing the chosen select option id related to the field. Available ids can be foundwhen getting or listing the field. You can also send a list of option names in which case the option are searched by name. The first one that matches is used. This field also accepts a string with names separated by a comma or an array of file names. The response represents chosen field, but also the value and color is exposed. - * - * @return list - */ - public function getField17(): array - { - return $this->field17; - } - - /** - * This field represents the `multiple_select` field. The number in field_17 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. This field accepts a list of `integer` each of which representing the chosen select option id related to the field. Available ids can be foundwhen getting or listing the field. You can also send a list of option names in which case the option are searched by name. The first one that matches is used. This field also accepts a string with names separated by a comma or an array of file names. The response represents chosen field, but also the value and color is exposed. - * - * @param list $field17 - */ - public function setField17(array $field17): self - { - $this->initialized['field17'] = true; - $this->field17 = $field17; - - return $this; - } - - /** - * This field represents the `phone_number` field. The number in field_18 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - */ - public function getField18(): ?string - { - return $this->field18; - } - - /** - * This field represents the `phone_number` field. The number in field_18 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. - */ - public function setField18(?string $field18): self - { - $this->initialized['field18'] = true; - $this->field18 = $field18; - - return $this; - } - - /** - * This field represents the `multiple_collaborators` field. The number in field_23 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. This field accepts a list of objects representing the chosen collaborators through the object's `id` property. The id is Baserow user id. The response objects also contains the collaborator name directly along with its id. - * - * @return list - */ - public function getField23(): array - { - return $this->field23; - } - - /** - * This field represents the `multiple_collaborators` field. The number in field_23 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. This field accepts a list of objects representing the chosen collaborators through the object's `id` property. The id is Baserow user id. The response objects also contains the collaborator name directly along with its id. - * - * @param list $field23 - */ - public function setField23(array $field23): self - { - $this->initialized['field23'] = true; - $this->field23 = $field23; - - return $this; - } - - /** - * This field represents the `password` field. The number in field_26 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. Allows setting a write only password value. Providing a string will set the password, `null` will unset it, `true` will be ignored. The response will respond with `true` is a password is set, but will never expose the password itself. - */ - public function getField26(): ?string - { - return $this->field26; - } - - /** - * This field represents the `password` field. The number in field_26 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. Allows setting a write only password value. Providing a string will set the password, `null` will unset it, `true` will be ignored. The response will respond with `true` is a password is set, but will never expose the password itself. - */ - public function setField26(?string $field26): self - { - $this->initialized['field26'] = true; - $this->field26 = $field26; - - return $this; - } - - /** - * This field represents the `ai` field. The number in field_27 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. Holds a text value that is generated by a generative AI model using a dynamic prompt. - */ - public function getField27(): ?string - { - return $this->field27; - } - - /** - * This field represents the `ai` field. The number in field_27 is in a normal request or response the id of the field. If the GET parameter `user_field_names` is provided then the key will instead be the actual name of the field. Holds a text value that is generated by a generative AI model using a dynamic prompt. - */ - public function setField27(?string $field27): self - { - $this->initialized['field27'] = true; - $this->field27 = $field27; - - return $this; - } -} diff --git a/generated/Normalizer/ExampleBatchRowsRequestNormalizer.php b/generated/Normalizer/BatchCreateRowRequestNormalizer.php similarity index 81% rename from generated/Normalizer/ExampleBatchRowsRequestNormalizer.php rename to generated/Normalizer/BatchCreateRowRequestNormalizer.php index 8a3e4ed..6a88b40 100644 --- a/generated/Normalizer/ExampleBatchRowsRequestNormalizer.php +++ b/generated/Normalizer/BatchCreateRowRequestNormalizer.php @@ -22,7 +22,7 @@ use Symfony\Component\Serializer\Normalizer\NormalizerInterface; if (!class_exists(Kernel::class) or (Kernel::MAJOR_VERSION >= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { - class ExampleBatchRowsRequestNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + class BatchCreateRowRequestNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { use DenormalizerAwareTrait; use NormalizerAwareTrait; @@ -31,12 +31,12 @@ class ExampleBatchRowsRequestNormalizer implements DenormalizerInterface, Normal public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool { - return \CedricZiel\Baserow\Generated\Model\ExampleBatchRowsRequest::class === $type; + return \CedricZiel\Baserow\Generated\Model\BatchCreateRowRequest::class === $type; } public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return is_object($data) && \CedricZiel\Baserow\Generated\Model\ExampleBatchRowsRequest::class === get_class($data); + return is_object($data) && \CedricZiel\Baserow\Generated\Model\BatchCreateRowRequest::class === get_class($data); } public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed @@ -47,14 +47,14 @@ public function denormalize(mixed $data, string $type, ?string $format = null, a if (isset($data['$recursiveRef'])) { return new Reference($data['$recursiveRef'], $context['document-origin']); } - $object = new \CedricZiel\Baserow\Generated\Model\ExampleBatchRowsRequest(); + $object = new \CedricZiel\Baserow\Generated\Model\BatchCreateRowRequest(); if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('items', $data)) { $values = []; foreach ($data['items'] as $value) { - $values[] = $this->denormalizer->denormalize($value, \CedricZiel\Baserow\Generated\Model\ExampleRowRequestSerializerWithUserFieldNames::class, 'json', $context); + $values[] = $this->denormalizer->denormalize($value, \CedricZiel\Baserow\Generated\Model\CreateRowRequest::class, 'json', $context); } $object->setItems($values); unset($data['items']); @@ -87,11 +87,11 @@ public function normalize(mixed $object, ?string $format = null, array $context public function getSupportedTypes(?string $format = null): array { - return [\CedricZiel\Baserow\Generated\Model\ExampleBatchRowsRequest::class => false]; + return [\CedricZiel\Baserow\Generated\Model\BatchCreateRowRequest::class => false]; } } } else { - class ExampleBatchRowsRequestNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + class BatchCreateRowRequestNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface { use DenormalizerAwareTrait; use NormalizerAwareTrait; @@ -100,12 +100,12 @@ class ExampleBatchRowsRequestNormalizer implements DenormalizerInterface, Normal public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool { - return \CedricZiel\Baserow\Generated\Model\ExampleBatchRowsRequest::class === $type; + return \CedricZiel\Baserow\Generated\Model\BatchCreateRowRequest::class === $type; } public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool { - return is_object($data) && \CedricZiel\Baserow\Generated\Model\ExampleBatchRowsRequest::class === get_class($data); + return is_object($data) && \CedricZiel\Baserow\Generated\Model\BatchCreateRowRequest::class === get_class($data); } public function denormalize($data, $type, $format = null, array $context = []) @@ -116,14 +116,14 @@ public function denormalize($data, $type, $format = null, array $context = []) if (isset($data['$recursiveRef'])) { return new Reference($data['$recursiveRef'], $context['document-origin']); } - $object = new \CedricZiel\Baserow\Generated\Model\ExampleBatchRowsRequest(); + $object = new \CedricZiel\Baserow\Generated\Model\BatchCreateRowRequest(); if (null === $data || false === \is_array($data)) { return $object; } if (\array_key_exists('items', $data)) { $values = []; foreach ($data['items'] as $value) { - $values[] = $this->denormalizer->denormalize($value, \CedricZiel\Baserow\Generated\Model\ExampleRowRequestSerializerWithUserFieldNames::class, 'json', $context); + $values[] = $this->denormalizer->denormalize($value, \CedricZiel\Baserow\Generated\Model\CreateRowRequest::class, 'json', $context); } $object->setItems($values); unset($data['items']); @@ -159,7 +159,7 @@ public function normalize($object, $format = null, array $context = []) public function getSupportedTypes(?string $format = null): array { - return [\CedricZiel\Baserow\Generated\Model\ExampleBatchRowsRequest::class => false]; + return [\CedricZiel\Baserow\Generated\Model\BatchCreateRowRequest::class => false]; } } } diff --git a/generated/Normalizer/CreateRowRequestNormalizer.php b/generated/Normalizer/CreateRowRequestNormalizer.php new file mode 100644 index 0000000..b7ab605 --- /dev/null +++ b/generated/Normalizer/CreateRowRequestNormalizer.php @@ -0,0 +1,139 @@ += 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { + class CreateRowRequestNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool + { + return \CedricZiel\Baserow\Generated\Model\CreateRowRequest::class === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return is_object($data) && \CedricZiel\Baserow\Generated\Model\CreateRowRequest::class === get_class($data); + } + + public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \CedricZiel\Baserow\Generated\Model\CreateRowRequest(); + if (null === $data || false === \is_array($data)) { + return $object; + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null + { + $data = []; + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\CedricZiel\Baserow\Generated\Model\CreateRowRequest::class => false]; + } + } +} else { + class CreateRowRequestNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface + { + use DenormalizerAwareTrait; + use NormalizerAwareTrait; + use CheckArray; + use ValidatorTrait; + + public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool + { + return \CedricZiel\Baserow\Generated\Model\CreateRowRequest::class === $type; + } + + public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool + { + return is_object($data) && \CedricZiel\Baserow\Generated\Model\CreateRowRequest::class === get_class($data); + } + + public function denormalize($data, $type, $format = null, array $context = []) + { + if (isset($data['$ref'])) { + return new Reference($data['$ref'], $context['document-origin']); + } + if (isset($data['$recursiveRef'])) { + return new Reference($data['$recursiveRef'], $context['document-origin']); + } + $object = new \CedricZiel\Baserow\Generated\Model\CreateRowRequest(); + if (null === $data || false === \is_array($data)) { + return $object; + } + foreach ($data as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $object[$key] = $value; + } + } + + return $object; + } + + /** + * @return array|string|int|float|bool|\ArrayObject|null + */ + public function normalize($object, $format = null, array $context = []) + { + $data = []; + foreach ($object as $key => $value) { + if (preg_match('/.*/', (string) $key)) { + $data[$key] = $value; + } + } + + return $data; + } + + public function getSupportedTypes(?string $format = null): array + { + return [\CedricZiel\Baserow\Generated\Model\CreateRowRequest::class => false]; + } + } +} diff --git a/generated/Normalizer/ExampleRowRequestSerializerWithUserFieldNamesNormalizer.php b/generated/Normalizer/ExampleRowRequestSerializerWithUserFieldNamesNormalizer.php deleted file mode 100644 index d862247..0000000 --- a/generated/Normalizer/ExampleRowRequestSerializerWithUserFieldNamesNormalizer.php +++ /dev/null @@ -1,495 +0,0 @@ -= 7 or Kernel::MAJOR_VERSION === 6 and Kernel::MINOR_VERSION === 4)) { - class ExampleRowRequestSerializerWithUserFieldNamesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface - { - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization(mixed $data, string $type, ?string $format = null, array $context = []): bool - { - return \CedricZiel\Baserow\Generated\Model\ExampleRowRequestSerializerWithUserFieldNames::class === $type; - } - - public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool - { - return is_object($data) && \CedricZiel\Baserow\Generated\Model\ExampleRowRequestSerializerWithUserFieldNames::class === get_class($data); - } - - public function denormalize(mixed $data, string $type, ?string $format = null, array $context = []): mixed - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); - } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); - } - $object = new \CedricZiel\Baserow\Generated\Model\ExampleRowRequestSerializerWithUserFieldNames(); - if (\array_key_exists('field_13', $data) && \is_int($data['field_13'])) { - $data['field_13'] = (float) $data['field_13']; - } - if (null === $data || false === \is_array($data)) { - return $object; - } - if (\array_key_exists('field_1', $data) && null !== $data['field_1']) { - $object->setField1($data['field_1']); - unset($data['field_1']); - } elseif (\array_key_exists('field_1', $data) && null === $data['field_1']) { - $object->setField1(null); - } - if (\array_key_exists('field_2', $data) && null !== $data['field_2']) { - $object->setField2($data['field_2']); - unset($data['field_2']); - } elseif (\array_key_exists('field_2', $data) && null === $data['field_2']) { - $object->setField2(null); - } - if (\array_key_exists('field_3', $data) && null !== $data['field_3']) { - $object->setField3($data['field_3']); - unset($data['field_3']); - } elseif (\array_key_exists('field_3', $data) && null === $data['field_3']) { - $object->setField3(null); - } - if (\array_key_exists('field_4', $data) && null !== $data['field_4']) { - $object->setField4($data['field_4']); - unset($data['field_4']); - } elseif (\array_key_exists('field_4', $data) && null === $data['field_4']) { - $object->setField4(null); - } - if (\array_key_exists('field_5', $data) && null !== $data['field_5']) { - $object->setField5($data['field_5']); - unset($data['field_5']); - } elseif (\array_key_exists('field_5', $data) && null === $data['field_5']) { - $object->setField5(null); - } - if (\array_key_exists('field_6', $data)) { - $object->setField6($data['field_6']); - unset($data['field_6']); - } - if (\array_key_exists('field_7', $data)) { - $object->setField7($data['field_7']); - unset($data['field_7']); - } - if (\array_key_exists('field_8', $data) && null !== $data['field_8']) { - $object->setField8(\DateTime::createFromFormat('Y-m-d', $data['field_8'])->setTime(0, 0, 0)); - unset($data['field_8']); - } elseif (\array_key_exists('field_8', $data) && null === $data['field_8']) { - $object->setField8(null); - } - if (\array_key_exists('field_13', $data) && null !== $data['field_13']) { - $object->setField13($data['field_13']); - unset($data['field_13']); - } elseif (\array_key_exists('field_13', $data) && null === $data['field_13']) { - $object->setField13(null); - } - if (\array_key_exists('field_14', $data)) { - $values = []; - foreach ($data['field_14'] as $value) { - $values[] = $value; - } - $object->setField14($values); - unset($data['field_14']); - } - if (\array_key_exists('field_15', $data) && null !== $data['field_15']) { - $values_1 = []; - foreach ($data['field_15'] as $value_1) { - $values_1[] = $value_1; - } - $object->setField15($values_1); - unset($data['field_15']); - } elseif (\array_key_exists('field_15', $data) && null === $data['field_15']) { - $object->setField15(null); - } - if (\array_key_exists('field_16', $data) && null !== $data['field_16']) { - $object->setField16($data['field_16']); - unset($data['field_16']); - } elseif (\array_key_exists('field_16', $data) && null === $data['field_16']) { - $object->setField16(null); - } - if (\array_key_exists('field_17', $data)) { - $values_2 = []; - foreach ($data['field_17'] as $value_2) { - $values_2[] = $value_2; - } - $object->setField17($values_2); - unset($data['field_17']); - } - if (\array_key_exists('field_18', $data) && null !== $data['field_18']) { - $object->setField18($data['field_18']); - unset($data['field_18']); - } elseif (\array_key_exists('field_18', $data) && null === $data['field_18']) { - $object->setField18(null); - } - if (\array_key_exists('field_23', $data)) { - $values_3 = []; - foreach ($data['field_23'] as $value_3) { - $values_3[] = $this->denormalizer->denormalize($value_3, \CedricZiel\Baserow\Generated\Model\Collaborator::class, 'json', $context); - } - $object->setField23($values_3); - unset($data['field_23']); - } - if (\array_key_exists('field_26', $data) && null !== $data['field_26']) { - $object->setField26($data['field_26']); - unset($data['field_26']); - } elseif (\array_key_exists('field_26', $data) && null === $data['field_26']) { - $object->setField26(null); - } - if (\array_key_exists('field_27', $data) && null !== $data['field_27']) { - $object->setField27($data['field_27']); - unset($data['field_27']); - } elseif (\array_key_exists('field_27', $data) && null === $data['field_27']) { - $object->setField27(null); - } - foreach ($data as $key => $value_4) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_4; - } - } - - return $object; - } - - public function normalize(mixed $object, ?string $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null - { - $data = []; - if ($object->isInitialized('field1') && null !== $object->getField1()) { - $data['field_1'] = $object->getField1(); - } - if ($object->isInitialized('field2') && null !== $object->getField2()) { - $data['field_2'] = $object->getField2(); - } - if ($object->isInitialized('field3') && null !== $object->getField3()) { - $data['field_3'] = $object->getField3(); - } - if ($object->isInitialized('field4') && null !== $object->getField4()) { - $data['field_4'] = $object->getField4(); - } - if ($object->isInitialized('field5') && null !== $object->getField5()) { - $data['field_5'] = $object->getField5(); - } - if ($object->isInitialized('field6') && null !== $object->getField6()) { - $data['field_6'] = $object->getField6(); - } - if ($object->isInitialized('field7') && null !== $object->getField7()) { - $data['field_7'] = $object->getField7(); - } - if ($object->isInitialized('field8') && null !== $object->getField8()) { - $data['field_8'] = $object->getField8()->format('Y-m-d'); - } - if ($object->isInitialized('field13') && null !== $object->getField13()) { - $data['field_13'] = $object->getField13(); - } - if ($object->isInitialized('field14') && null !== $object->getField14()) { - $values = []; - foreach ($object->getField14() as $value) { - $values[] = $value; - } - $data['field_14'] = $values; - } - if ($object->isInitialized('field15') && null !== $object->getField15()) { - $values_1 = []; - foreach ($object->getField15() as $value_1) { - $values_1[] = $value_1; - } - $data['field_15'] = $values_1; - } - if ($object->isInitialized('field16') && null !== $object->getField16()) { - $data['field_16'] = $object->getField16(); - } - if ($object->isInitialized('field17') && null !== $object->getField17()) { - $values_2 = []; - foreach ($object->getField17() as $value_2) { - $values_2[] = $value_2; - } - $data['field_17'] = $values_2; - } - if ($object->isInitialized('field18') && null !== $object->getField18()) { - $data['field_18'] = $object->getField18(); - } - if ($object->isInitialized('field23') && null !== $object->getField23()) { - $values_3 = []; - foreach ($object->getField23() as $value_3) { - $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); - } - $data['field_23'] = $values_3; - } - if ($object->isInitialized('field26') && null !== $object->getField26()) { - $data['field_26'] = $object->getField26(); - } - if ($object->isInitialized('field27') && null !== $object->getField27()) { - $data['field_27'] = $object->getField27(); - } - foreach ($object as $key => $value_4) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_4; - } - } - - return $data; - } - - public function getSupportedTypes(?string $format = null): array - { - return [\CedricZiel\Baserow\Generated\Model\ExampleRowRequestSerializerWithUserFieldNames::class => false]; - } - } -} else { - class ExampleRowRequestSerializerWithUserFieldNamesNormalizer implements DenormalizerInterface, NormalizerInterface, DenormalizerAwareInterface, NormalizerAwareInterface - { - use DenormalizerAwareTrait; - use NormalizerAwareTrait; - use CheckArray; - use ValidatorTrait; - - public function supportsDenormalization($data, $type, ?string $format = null, array $context = []): bool - { - return \CedricZiel\Baserow\Generated\Model\ExampleRowRequestSerializerWithUserFieldNames::class === $type; - } - - public function supportsNormalization(mixed $data, ?string $format = null, array $context = []): bool - { - return is_object($data) && \CedricZiel\Baserow\Generated\Model\ExampleRowRequestSerializerWithUserFieldNames::class === get_class($data); - } - - public function denormalize($data, $type, $format = null, array $context = []) - { - if (isset($data['$ref'])) { - return new Reference($data['$ref'], $context['document-origin']); - } - if (isset($data['$recursiveRef'])) { - return new Reference($data['$recursiveRef'], $context['document-origin']); - } - $object = new \CedricZiel\Baserow\Generated\Model\ExampleRowRequestSerializerWithUserFieldNames(); - if (\array_key_exists('field_13', $data) && \is_int($data['field_13'])) { - $data['field_13'] = (float) $data['field_13']; - } - if (null === $data || false === \is_array($data)) { - return $object; - } - if (\array_key_exists('field_1', $data) && null !== $data['field_1']) { - $object->setField1($data['field_1']); - unset($data['field_1']); - } elseif (\array_key_exists('field_1', $data) && null === $data['field_1']) { - $object->setField1(null); - } - if (\array_key_exists('field_2', $data) && null !== $data['field_2']) { - $object->setField2($data['field_2']); - unset($data['field_2']); - } elseif (\array_key_exists('field_2', $data) && null === $data['field_2']) { - $object->setField2(null); - } - if (\array_key_exists('field_3', $data) && null !== $data['field_3']) { - $object->setField3($data['field_3']); - unset($data['field_3']); - } elseif (\array_key_exists('field_3', $data) && null === $data['field_3']) { - $object->setField3(null); - } - if (\array_key_exists('field_4', $data) && null !== $data['field_4']) { - $object->setField4($data['field_4']); - unset($data['field_4']); - } elseif (\array_key_exists('field_4', $data) && null === $data['field_4']) { - $object->setField4(null); - } - if (\array_key_exists('field_5', $data) && null !== $data['field_5']) { - $object->setField5($data['field_5']); - unset($data['field_5']); - } elseif (\array_key_exists('field_5', $data) && null === $data['field_5']) { - $object->setField5(null); - } - if (\array_key_exists('field_6', $data)) { - $object->setField6($data['field_6']); - unset($data['field_6']); - } - if (\array_key_exists('field_7', $data)) { - $object->setField7($data['field_7']); - unset($data['field_7']); - } - if (\array_key_exists('field_8', $data) && null !== $data['field_8']) { - $object->setField8(\DateTime::createFromFormat('Y-m-d', $data['field_8'])->setTime(0, 0, 0)); - unset($data['field_8']); - } elseif (\array_key_exists('field_8', $data) && null === $data['field_8']) { - $object->setField8(null); - } - if (\array_key_exists('field_13', $data) && null !== $data['field_13']) { - $object->setField13($data['field_13']); - unset($data['field_13']); - } elseif (\array_key_exists('field_13', $data) && null === $data['field_13']) { - $object->setField13(null); - } - if (\array_key_exists('field_14', $data)) { - $values = []; - foreach ($data['field_14'] as $value) { - $values[] = $value; - } - $object->setField14($values); - unset($data['field_14']); - } - if (\array_key_exists('field_15', $data) && null !== $data['field_15']) { - $values_1 = []; - foreach ($data['field_15'] as $value_1) { - $values_1[] = $value_1; - } - $object->setField15($values_1); - unset($data['field_15']); - } elseif (\array_key_exists('field_15', $data) && null === $data['field_15']) { - $object->setField15(null); - } - if (\array_key_exists('field_16', $data) && null !== $data['field_16']) { - $object->setField16($data['field_16']); - unset($data['field_16']); - } elseif (\array_key_exists('field_16', $data) && null === $data['field_16']) { - $object->setField16(null); - } - if (\array_key_exists('field_17', $data)) { - $values_2 = []; - foreach ($data['field_17'] as $value_2) { - $values_2[] = $value_2; - } - $object->setField17($values_2); - unset($data['field_17']); - } - if (\array_key_exists('field_18', $data) && null !== $data['field_18']) { - $object->setField18($data['field_18']); - unset($data['field_18']); - } elseif (\array_key_exists('field_18', $data) && null === $data['field_18']) { - $object->setField18(null); - } - if (\array_key_exists('field_23', $data)) { - $values_3 = []; - foreach ($data['field_23'] as $value_3) { - $values_3[] = $this->denormalizer->denormalize($value_3, \CedricZiel\Baserow\Generated\Model\Collaborator::class, 'json', $context); - } - $object->setField23($values_3); - unset($data['field_23']); - } - if (\array_key_exists('field_26', $data) && null !== $data['field_26']) { - $object->setField26($data['field_26']); - unset($data['field_26']); - } elseif (\array_key_exists('field_26', $data) && null === $data['field_26']) { - $object->setField26(null); - } - if (\array_key_exists('field_27', $data) && null !== $data['field_27']) { - $object->setField27($data['field_27']); - unset($data['field_27']); - } elseif (\array_key_exists('field_27', $data) && null === $data['field_27']) { - $object->setField27(null); - } - foreach ($data as $key => $value_4) { - if (preg_match('/.*/', (string) $key)) { - $object[$key] = $value_4; - } - } - - return $object; - } - - /** - * @return array|string|int|float|bool|\ArrayObject|null - */ - public function normalize($object, $format = null, array $context = []) - { - $data = []; - if ($object->isInitialized('field1') && null !== $object->getField1()) { - $data['field_1'] = $object->getField1(); - } - if ($object->isInitialized('field2') && null !== $object->getField2()) { - $data['field_2'] = $object->getField2(); - } - if ($object->isInitialized('field3') && null !== $object->getField3()) { - $data['field_3'] = $object->getField3(); - } - if ($object->isInitialized('field4') && null !== $object->getField4()) { - $data['field_4'] = $object->getField4(); - } - if ($object->isInitialized('field5') && null !== $object->getField5()) { - $data['field_5'] = $object->getField5(); - } - if ($object->isInitialized('field6') && null !== $object->getField6()) { - $data['field_6'] = $object->getField6(); - } - if ($object->isInitialized('field7') && null !== $object->getField7()) { - $data['field_7'] = $object->getField7(); - } - if ($object->isInitialized('field8') && null !== $object->getField8()) { - $data['field_8'] = $object->getField8()->format('Y-m-d'); - } - if ($object->isInitialized('field13') && null !== $object->getField13()) { - $data['field_13'] = $object->getField13(); - } - if ($object->isInitialized('field14') && null !== $object->getField14()) { - $values = []; - foreach ($object->getField14() as $value) { - $values[] = $value; - } - $data['field_14'] = $values; - } - if ($object->isInitialized('field15') && null !== $object->getField15()) { - $values_1 = []; - foreach ($object->getField15() as $value_1) { - $values_1[] = $value_1; - } - $data['field_15'] = $values_1; - } - if ($object->isInitialized('field16') && null !== $object->getField16()) { - $data['field_16'] = $object->getField16(); - } - if ($object->isInitialized('field17') && null !== $object->getField17()) { - $values_2 = []; - foreach ($object->getField17() as $value_2) { - $values_2[] = $value_2; - } - $data['field_17'] = $values_2; - } - if ($object->isInitialized('field18') && null !== $object->getField18()) { - $data['field_18'] = $object->getField18(); - } - if ($object->isInitialized('field23') && null !== $object->getField23()) { - $values_3 = []; - foreach ($object->getField23() as $value_3) { - $values_3[] = $this->normalizer->normalize($value_3, 'json', $context); - } - $data['field_23'] = $values_3; - } - if ($object->isInitialized('field26') && null !== $object->getField26()) { - $data['field_26'] = $object->getField26(); - } - if ($object->isInitialized('field27') && null !== $object->getField27()) { - $data['field_27'] = $object->getField27(); - } - foreach ($object as $key => $value_4) { - if (preg_match('/.*/', (string) $key)) { - $data[$key] = $value_4; - } - } - - return $data; - } - - public function getSupportedTypes(?string $format = null): array - { - return [\CedricZiel\Baserow\Generated\Model\ExampleRowRequestSerializerWithUserFieldNames::class => false]; - } - } -} diff --git a/generated/Normalizer/JaneObjectNormalizer.php b/generated/Normalizer/JaneObjectNormalizer.php index c2443de..dec30c0 100644 --- a/generated/Normalizer/JaneObjectNormalizer.php +++ b/generated/Normalizer/JaneObjectNormalizer.php @@ -348,7 +348,7 @@ class JaneObjectNormalizer implements DenormalizerInterface, NormalizerInterface \CedricZiel\Baserow\Generated\Model\EmailTesterResponse::class => EmailTesterResponseNormalizer::class, - \CedricZiel\Baserow\Generated\Model\ExampleBatchRowsRequest::class => ExampleBatchRowsRequestNormalizer::class, + \CedricZiel\Baserow\Generated\Model\BatchCreateRowRequest::class => BatchCreateRowRequestNormalizer::class, \CedricZiel\Baserow\Generated\Model\ExampleBatchRowsResponse::class => ExampleBatchRowsResponseNormalizer::class, @@ -356,7 +356,7 @@ class JaneObjectNormalizer implements DenormalizerInterface, NormalizerInterface \CedricZiel\Baserow\Generated\Model\ExampleRowRequest::class => ExampleRowRequestNormalizer::class, - \CedricZiel\Baserow\Generated\Model\ExampleRowRequestSerializerWithUserFieldNames::class => ExampleRowRequestSerializerWithUserFieldNamesNormalizer::class, + \CedricZiel\Baserow\Generated\Model\CreateRowRequest::class => CreateRowRequestNormalizer::class, \CedricZiel\Baserow\Generated\Model\ExampleRowResponse::class => ExampleRowResponseNormalizer::class, @@ -2544,11 +2544,11 @@ public function getSupportedTypes(?string $format = null): array \CedricZiel\Baserow\Generated\Model\EmailFieldUpdateField::class => false, \CedricZiel\Baserow\Generated\Model\EmailTesterRequest::class => false, \CedricZiel\Baserow\Generated\Model\EmailTesterResponse::class => false, - \CedricZiel\Baserow\Generated\Model\ExampleBatchRowsRequest::class => false, + \CedricZiel\Baserow\Generated\Model\BatchCreateRowRequest::class => false, \CedricZiel\Baserow\Generated\Model\ExampleBatchRowsResponse::class => false, \CedricZiel\Baserow\Generated\Model\BatchUpdateRow::class => false, \CedricZiel\Baserow\Generated\Model\ExampleRowRequest::class => false, - \CedricZiel\Baserow\Generated\Model\ExampleRowRequestSerializerWithUserFieldNames::class => false, + \CedricZiel\Baserow\Generated\Model\CreateRowRequest::class => false, \CedricZiel\Baserow\Generated\Model\ExampleRowResponse::class => false, \CedricZiel\Baserow\Generated\Model\ExampleRowResponseField10::class => false, \CedricZiel\Baserow\Generated\Model\ExampleRowResponseField12::class => false, @@ -3870,7 +3870,7 @@ class JaneObjectNormalizer implements DenormalizerInterface, NormalizerInterface \CedricZiel\Baserow\Generated\Model\EmailTesterResponse::class => EmailTesterResponseNormalizer::class, - \CedricZiel\Baserow\Generated\Model\ExampleBatchRowsRequest::class => ExampleBatchRowsRequestNormalizer::class, + \CedricZiel\Baserow\Generated\Model\BatchCreateRowRequest::class => BatchCreateRowRequestNormalizer::class, \CedricZiel\Baserow\Generated\Model\ExampleBatchRowsResponse::class => ExampleBatchRowsResponseNormalizer::class, @@ -3878,7 +3878,7 @@ class JaneObjectNormalizer implements DenormalizerInterface, NormalizerInterface \CedricZiel\Baserow\Generated\Model\ExampleRowRequest::class => ExampleRowRequestNormalizer::class, - \CedricZiel\Baserow\Generated\Model\ExampleRowRequestSerializerWithUserFieldNames::class => ExampleRowRequestSerializerWithUserFieldNamesNormalizer::class, + \CedricZiel\Baserow\Generated\Model\CreateRowRequest::class => CreateRowRequestNormalizer::class, \CedricZiel\Baserow\Generated\Model\ExampleRowResponse::class => ExampleRowResponseNormalizer::class, @@ -6069,11 +6069,11 @@ public function getSupportedTypes(?string $format = null): array \CedricZiel\Baserow\Generated\Model\EmailFieldUpdateField::class => false, \CedricZiel\Baserow\Generated\Model\EmailTesterRequest::class => false, \CedricZiel\Baserow\Generated\Model\EmailTesterResponse::class => false, - \CedricZiel\Baserow\Generated\Model\ExampleBatchRowsRequest::class => false, + \CedricZiel\Baserow\Generated\Model\BatchCreateRowRequest::class => false, \CedricZiel\Baserow\Generated\Model\ExampleBatchRowsResponse::class => false, \CedricZiel\Baserow\Generated\Model\BatchUpdateRow::class => false, \CedricZiel\Baserow\Generated\Model\ExampleRowRequest::class => false, - \CedricZiel\Baserow\Generated\Model\ExampleRowRequestSerializerWithUserFieldNames::class => false, + \CedricZiel\Baserow\Generated\Model\CreateRowRequest::class => false, \CedricZiel\Baserow\Generated\Model\ExampleRowResponse::class => false, \CedricZiel\Baserow\Generated\Model\ExampleRowResponseField10::class => false, \CedricZiel\Baserow\Generated\Model\ExampleRowResponseField12::class => false, diff --git a/openapi.json b/openapi.json index d45e05c..59df144 100644 --- a/openapi.json +++ b/openapi.json @@ -9996,17 +9996,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ExampleRowRequestSerializerWithUserFieldNames" + "$ref": "#/components/schemas/CreateRowRequest" } }, "application/x-www-form-urlencoded": { "schema": { - "$ref": "#/components/schemas/ExampleRowRequestSerializerWithUserFieldNames" + "$ref": "#/components/schemas/CreateRowRequest" } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ExampleRowRequestSerializerWithUserFieldNames" + "$ref": "#/components/schemas/CreateRowRequest" } } } @@ -11141,17 +11141,17 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ExampleBatchRowsRequest" + "$ref": "#/components/schemas/BatchCreateRowRequest" } }, "application/x-www-form-urlencoded": { "schema": { - "$ref": "#/components/schemas/ExampleBatchRowsRequest" + "$ref": "#/components/schemas/BatchCreateRowRequest" } }, "multipart/form-data": { "schema": { - "$ref": "#/components/schemas/ExampleBatchRowsRequest" + "$ref": "#/components/schemas/BatchCreateRowRequest" } } }, @@ -42811,13 +42811,13 @@ "type": "string", "description": "* `rows.created` - rows.created\n* `row.created` - row.created\n* `rows.updated` - rows.updated\n* `row.updated` - row.updated\n* `rows.deleted` - rows.deleted\n* `row.deleted` - row.deleted" }, - "ExampleBatchRowsRequest": { + "BatchCreateRowRequest": { "type": "object", "properties": { "items": { "type": "array", "items": { - "$ref": "#/components/schemas/ExampleRowRequestSerializerWithUserFieldNames" + "$ref": "#/components/schemas/CreateRowRequest" }, "maxItems": 200, "minItems": 1 @@ -43063,9 +43063,11 @@ } } }, - "ExampleRowRequestSerializerWithUserFieldNames": { + "CreateRowRequest": { "type": "object", - "properties": { + "additionalProperties": true, + "properties": {} + "example": { "field_1": { "type": "string", "nullable": true, From 1aa112ae1d89bc0641ee6e2ed57312af6ac205e5 Mon Sep 17 00:00:00 2001 From: Cedric Ziel Date: Tue, 6 Aug 2024 21:21:53 +0200 Subject: [PATCH 2/2] fix: remove demo content from create rows example --- openapi.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi.json b/openapi.json index 59df144..acd69a5 100644 --- a/openapi.json +++ b/openapi.json @@ -43066,7 +43066,7 @@ "CreateRowRequest": { "type": "object", "additionalProperties": true, - "properties": {} + "properties": {}, "example": { "field_1": { "type": "string",