public function validateCollectionUpdateStruct(Collection $collection, CollectionUpdateStruct $collectionUpdateStruct): void
    {
        if ($collectionUpdateStruct->offset !== null) {
            $offsetConstraints = [
                new Constraints\NotBlank(),
                new Constraints\Type(['type' => 'int']),
            ];

            $offsetConstraints[] = $collection->hasQuery() ?
                new Constraints\GreaterThanOrEqual(['value' => 0]) :
                new Constraints\EqualTo(['value' => 0]);

            $this->validate(
                $collectionUpdateStruct->offset,
                $offsetConstraints,
                'offset'
            );
        }

        if ($collectionUpdateStruct->limit !== null) {
            $this->validate(
                $collectionUpdateStruct->limit,
                [
                    new Constraints\NotBlank(),
                    new Constraints\Type(['type' => 'int']),
                    new Constraints\GreaterThanOrEqual(['value' => 0]),
                ],
                'limit'
            );
        }
    }