diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 230f692..f51017d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,4 +42,7 @@ jobs: run: vendor/bin/php-cs-fixer fix -v --diff --allow-risky=yes --config=.php-cs-fixer.php - name: Run test suite - run: vendor/bin/phpunit tests/ \ No newline at end of file + run: vendor/bin/phpunit tests/ + + - name: Run static analysis + run: composer analyse diff --git a/.gitignore b/.gitignore index a4bb621..2b9cb1d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /vendor/ -/.php-cs-fixer.cache \ No newline at end of file +/.php-cs-fixer.cache +/tmp/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index dad65b5..6d5b175 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,6 +15,9 @@ before_script: .test: &test - vendor/bin/phpunit tests/ +.analyse: &analyse + - vendor/bin/phpstan analyse --debug --memory-limit=1G + lint:php7.4: image: php:7.4 script: @@ -30,7 +33,47 @@ test:php7.4: script: - *test +test:php8.0: + image: php:8.0 + script: + - *test + +test:php8.1: + image: php:8.1 + script: + - *test + test:php8.2: image: php:8.2 script: - - *test \ No newline at end of file + - *test + +test:php8.3: + image: php:8.3 + script: + - *test + +analyse:php7.4: + image: php:7.4 + script: + - *analyse + +analyse:php8.0: + image: php:8.0 + script: + - *analyse + +analyse:php8.1: + image: php:8.1 + script: + - *analyse + +analyse:php8.2: + image: php:8.2 + script: + - *analyse + +analyse:php8.3: + image: php:8.3 + script: + - *analyse diff --git a/README.md b/README.md index 780f0cd..38d1beb 100644 --- a/README.md +++ b/README.md @@ -24,55 +24,85 @@ $client = new \ThothApi\GraphQL\Client(); #### Queries -The client maps all queries from the Thoth GraphQL API. Methods return data in an object-oriented format, making it easy to use and manipulate information. - -```php -$contributors = $client->contributors(); - -echo print_r($contributors, true); -/** - * Array ( - * [0] => ThothApi\GraphQL\Models\Contributor Object ( - * [data] => Array ( - * [contributorId] => e1de541c-e84b-4092-941f-dab9b5dac865 - * [firstName] => Aaron - * [lastName] => Ansell - * [fullName] => Aaron Ansell - * [orcid] => https://orcid.org/0000-0001-6365-5168 - * [website] => - * ) - * ) - * [1] => ThothApi\GraphQL\Models\Contributor Object ( - * [data] => Array ( - * [contributorId] => 1c3aade6-6d48-41b4-8def-b435f4b43573 - * [firstName] => Aaron D. - * [lastName] => Hornkohl - * [fullName] => Aaron D. Hornkohl - * [orcid] => - * [website] => https://www.ames.cam.ac.uk/people/dr-aaron-d-hornkohl - * ) - * ) - * ... - * ) -*/ - -$contributor = array_shift($contributors); - -echo $contributor->getLastName(); // Ansell -echo $contributor->getOrcid(); // https://orcid.org/0000-0001-6365-5168 -``` - -Queries can accept an array with the required arguments as specified in the Thoth GraphQL schema. It's possible to use the "order" argument specifying only the field and the desired direction. +Query, mutation, schema, input, enum and scalar classes are generated from the Thoth GraphQL +introspection schema. The most convenient API is the dynamic client method named after the GraphQL +operation. ```php +$works = $client->works(5, [ + 'workId', + 'fullTitle', +]); + +echo $works[0]->getWorkId(); +echo $works[0]->getFullTitle(); +``` + +Arguments can be passed positionally or by name. Enum values can be passed directly using generated +enum constants. `OperationRequest::enum()` is still supported for custom operations. + +```php +use ThothApi\GraphQL\Enums\Direction; +use ThothApi\GraphQL\Enums\WorkField; + $works = $client->works([ 'publishers' => ['71faf1c3-900a-4b8c-bca7-4f927699fb90'], 'limit' => 5, - 'field' => 'PUBLICATION_DATE', - 'direction' => 'DESC' + 'order' => [ + 'field' => WorkField::PUBLICATION_DATE, + 'direction' => Direction::DESC, + ], +], [ + 'workId', + 'fullTitle', + 'doi', ]); ``` +Selections can include nested fields. Returned object fields and lists are hydrated into generated +schema classes. + +```php +$work = $client->work('5a5b0fe3-03a9-444b-b221-ecae5370ff30', [ + 'workId', + 'fullTitle', + 'titles' => [ + 'titleId', + 'fullTitle', + ], + 'imprint' => [ + 'imprintId', + 'publisher' => [ + 'publisherId', + 'publisherName', + ], + ], +]); + +echo $work->getImprint()->getPublisher()->getPublisherName(); +echo $work->getTitles()[0]->getFullTitle(); +``` + +The generic executor is still available when you want to use the generated operation classes +directly. It returns raw arrays instead of hydrated schema objects. + +```php +use ThothApi\GraphQL\Queries\WorksQuery; + +$works = $client->execute(WorksQuery::operation([ + 'limit' => 5, +], [ + 'workId', + 'fullTitle', +])); +``` + +Raw GraphQL queries are supported and use the configured token. + +```php +$data = $client->rawQuery('query { workCount }'); +``` + #### Mutations To execute mutations, provide a valid personal access token to the client. @@ -81,20 +111,60 @@ To execute mutations, provide a valid personal access token to the client. $client->setToken($token); ``` -Mutations can be executed by providing an instance of the model class corresponding to the mutation type. To delete mutations, only the object's ID is required. When the operation is successful, the object's ID is returned. +Inputs are generated from the schema. They can be created from arrays, from DTOs that expose +`getAllData()`, or from `JsonSerializable` objects. + +```php +use ThothApi\GraphQL\Enums\SubjectType; +use ThothApi\GraphQL\Inputs\NewSubject; + +$newSubject = new NewSubject([ + 'workId' => '5a5b0fe3-03a9-444b-b221-ecae5370ff30', + 'subjectType' => SubjectType::BIC, + 'subjectCode' => '1D', + 'subjectOrdinal' => 3, +]); + +$subjectId = $client->createSubject($newSubject); +``` + +By default, mutations returning objects select the first `*Id` field and return that scalar value, so +existing calls stay short. + +```php +$subjectId = $client->createSubject($newSubject); +``` + +Pass an explicit selection when you want a hydrated schema object with getters, setters and `toArray()`. + +```php +$subject = $client->createSubject($newSubject, [ + 'subjectId', + 'subjectCode', +]); + +echo $subject->getSubjectId(); +echo $subject->getSubjectCode(); +print_r($subject->toArray()); +``` + +Schema objects can also be instantiated and populated manually. ```php -use ThothApi\GraphQL\Models\Subject; +use ThothApi\GraphQL\Schemas\Work; + +$work = (new Work()) + ->setWorkId('5a5b0fe3-03a9-444b-b221-ecae5370ff30') + ->setFullTitle('Example title'); -$subject = new Subject(); -$subject->setWorkId('5a5b0fe3-03a9-444b-b221-ecae5370ff30'); -$subject->setSubjectType(Subject::SUBJECT_TYPE_BIC); -$subject->setSubjectCode('1D'); -$subject->setSubjectOrdinal(3); +echo $work->getFullTitle(); +print_r($work->toArray()); +``` -$subjectId = $client->createSubject($subject); // 1d5ae47b-9e0c-4fba-b2d4-a3a2cdd8860c +Regenerate the GraphQL classes from the current Thoth GraphQL schema: -$client->deleteSubject($subjectId); +```bash +composer generate-graphql-client ``` #### Exceptions @@ -103,10 +173,11 @@ A QueryException is thrown in case of an error in the request to the GraphQL API ```php try { - $work = new \ThothApi\GraphQL\Models\Work([ - 'doi' => 'https://doi.org/10.00000/00000000', - ]); - $workId = $client->createWork($work); + $client->execute(\ThothApi\GraphQL\Mutations\CreateWorkMutation::operation([ + 'data' => [ + 'doi' => 'https://doi.org/10.00000/00000000', + ], + ], ['workId'])); } catch (\ThothApi\Exception\QueryException $exception) { echo $exception->getMessage(); /** @@ -125,6 +196,8 @@ try { * ) * ) */ + echo $exception->getQuery(); + echo print_r($exception->getVariables(), true); } ``` @@ -134,44 +207,17 @@ API Documentation: https://export.thoth.pub/ ```php $client = new \ThothApi\Rest\Client(); +``` + +The REST client exports metadata in the formats exposed by the Thoth export API. + +```php +$formats = $client->formats(); -echo(print_r($client->work('doideposit::crossref', 'e0f748b2-984f-45cc-8b9e-13989c31dda4'), true)); -/** - * - * - * - * e0f748b2-984f-45cc-8b9e-13989c31dda4_20241010195624 - * 20241010195624 - * - * Thoth - * distribution@thoth.pub - * - * Thoth - * - * - * - * - * - * - * Ammiel - * Alcalay - * - * - * Queens College, CUNY - * https://ror.org/03v8adn41 - * - * - * The Graduate Center, CUNY - * https://ror.org/00awd9g61 - * - * - * - * - * - * A Bibliography for After Jews and Arabs - * - * ... - */ +$metadata = $client->work( + 'doideposit::crossref', + 'e0f748b2-984f-45cc-8b9e-13989c31dda4' +); ``` #### Exceptions @@ -192,14 +238,13 @@ The constructor of both Clients can receive an optional array to add custom [Guz $client = new Client([ 'allow_redirects' => false, 'connect_timeout' => 3.14, - 'timeout' => 3.14 + 'timeout' => 3.14, 'proxy' => [ - 'http' => 'http://localhost:8125', // Use this proxy with "http" - 'https' => 'http://localhost:9124', // Use this proxy with "https", - 'no' => ['.mit.edu', 'foo.com'] // Don't use a proxy with these + 'http' => 'http://localhost:8125', + 'https' => 'http://localhost:9124', + 'no' => ['.mit.edu', 'foo.com'], ], - 'debug' => true - ... + 'debug' => true, ]); ``` diff --git a/composer.json b/composer.json index 4631857..6497d14 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,13 @@ }, "require-dev": { "phpunit/phpunit": "^9.6", - "friendsofphp/php-cs-fixer": "^3.64" + "friendsofphp/php-cs-fixer": "^3.64", + "phpstan/phpstan": "^2.2" + }, + "config": { + "platform": { + "php": "7.4.33" + } }, "license": "Apache-2.0", "autoload": { @@ -23,6 +29,8 @@ }, "scripts" : { "test": "vendor/bin/phpunit --colors --testdox tests/", - "lint": "vendor/bin/php-cs-fixer fix -v --diff --allow-risky=yes --config=.php-cs-fixer.php" + "analyse": "vendor/bin/phpstan analyse --debug --memory-limit=1G", + "lint": "vendor/bin/php-cs-fixer fix -v --diff --allow-risky=yes --config=.php-cs-fixer.php", + "generate-graphql-client": "php tools/generate-graphql-client.php" } } diff --git a/composer.lock b/composer.lock index 4ae247e..2bb7cc2 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5b40a8131540e685fa85043392b74191", + "content-hash": "505f4f248e74f71a0be446e96ff373bb", "packages": [ { "name": "guzzlehttp/guzzle", @@ -217,23 +217,25 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.7.0", + "version": "2.11.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" + "reference": "640e2897bbee822dbc8af761d49e1a29b1f2a6b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", - "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/640e2897bbee822dbc8af761d49e1a29b1f2a6b1", + "reference": "640e2897bbee822dbc8af761d49e1a29b1f2a6b1", "shasum": "" }, "require": { "php": "^7.2.5 || ^8.0", "psr/http-factory": "^1.0", "psr/http-message": "^1.1 || ^2.0", - "ralouphie/getallheaders": "^3.0" + "ralouphie/getallheaders": "^3.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0", + "symfony/polyfill-php80": "^1.24" }, "provide": { "psr/http-factory-implementation": "1.0", @@ -241,8 +243,9 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "http-interop/http-factory-tests": "0.9.0", - "phpunit/phpunit": "^8.5.39 || ^9.6.20" + "http-interop/http-factory-tests": "1.1.0", + "jshttp/mime-db": "1.54.0.1", + "phpunit/phpunit": "^8.5.52 || ^9.6.34" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -313,7 +316,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.7.0" + "source": "https://github.com/guzzle/psr7/tree/2.11.1" }, "funding": [ { @@ -329,7 +332,7 @@ "type": "tidelift" } ], - "time": "2024-07-18T11:15:46+00:00" + "time": "2026-06-12T21:50:12+00:00" }, { "name": "psr/http-client", @@ -601,6 +604,90 @@ } ], "time": "2024-09-25T14:11:13+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.37.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dfb55726c3a76ea3b6459fcfda1ec2d80a682411", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.37.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-10T16:19:22+00:00" } ], "packages-dev": [ @@ -1411,6 +1498,70 @@ }, "time": "2022-02-21T01:04:05+00:00" }, + { + "name": "phpstan/phpstan", + "version": "2.2.2", + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/e5cc34d491a90e79c216d824f60fe21fd4d93bd6", + "reference": "e5cc34d491a90e79c216d824f60fe21fd4d93bd6", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ondřej Mirtes" + }, + { + "name": "Markus Staab" + }, + { + "name": "Vincent Langlet" + } + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2026-06-05T09:00:01+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "9.2.32", @@ -4382,90 +4533,6 @@ ], "time": "2024-09-09T11:45:10+00:00" }, - { - "name": "symfony/polyfill-php80", - "version": "v1.33.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", - "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.33.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2025-01-02T08:10:11+00:00" - }, { "name": "symfony/polyfill-php81", "version": "v1.31.0", @@ -4899,5 +4966,8 @@ "php": ">=7.4" }, "platform-dev": {}, + "platform-overrides": { + "php": "7.4.33" + }, "plugin-api-version": "2.9.0" } diff --git a/docs/README-es.md b/docs/README-es.md index 41bdd3f..c6fe919 100644 --- a/docs/README-es.md +++ b/docs/README-es.md @@ -4,6 +4,14 @@ Cliente PHP para las API GraphQL y REST de Thoth. +## Instalación + +Esta biblioteca se puede instalar con Composer: + +```bash +composer require thoth-pub/thoth-client-php +``` + ## Uso ### GraphQL @@ -16,55 +24,86 @@ $client = new \ThothApi\GraphQL\Client(); #### Consultas -El cliente mapea todas las consultas de la API GraphQL de Thoth. Los métodos retornan datos en formato orientado a objetos, facilitando el uso y manipulación de la información. +Las clases de consultas, mutaciones, schemas, inputs, enums y scalars se generan a partir del schema +de introspección GraphQL de Thoth. La API más simple es llamar en el cliente al método con el mismo +nombre de la operación GraphQL. ```php -$contributors = $client->contributors(); - -echo print_r($contributors, true); -/** - * Array ( - * [0] => ThothApi\GraphQL\Models\Contributor Object ( - * [data] => Array ( - * [contributorId] => e1de541c-e84b-4092-941f-dab9b5dac865 - * [firstName] => Aaron - * [lastName] => Ansell - * [fullName] => Aaron Ansell - * [orcid] => https://orcid.org/0000-0001-6365-5168 - * [website] => - * ) - * ) - * [1] => ThothApi\GraphQL\Models\Contributor Object ( - * [data] => Array ( - * [contributorId] => 1c3aade6-6d48-41b4-8def-b435f4b43573 - * [firstName] => Aaron D. - * [lastName] => Hornkohl - * [fullName] => Aaron D. Hornkohl - * [orcid] => - * [website] => https://www.ames.cam.ac.uk/people/dr-aaron-d-hornkohl - * ) - * ) - * ... - * ) -*/ - -$contributor = array_shift($contributors); +$works = $client->works(5, [ + 'workId', + 'fullTitle', +]); -echo $contributor->getLastName(); // Ansell -echo $contributor->getOrcid(); // https://orcid.org/0000-0001-6365-5168 +echo $works[0]->getWorkId(); +echo $works[0]->getFullTitle(); ``` -Las consultas pueden aceptar un array con los argumentos necesarios, según lo especificado en el esquema GraphQL de Thoth. Es posible utilizar el argumento "order" especificando solo el campo y la dirección deseada. +Los argumentos pueden pasarse por posición o por nombre. Los valores enum pueden pasarse directamente +con constantes de las clases enum generadas. `OperationRequest::enum()` sigue disponible para +operaciones personalizadas. ```php +use ThothApi\GraphQL\Enums\Direction; +use ThothApi\GraphQL\Enums\WorkField; + $works = $client->works([ 'publishers' => ['71faf1c3-900a-4b8c-bca7-4f927699fb90'], 'limit' => 5, - 'field' => 'PUBLICATION_DATE', - 'direction' => 'DESC' + 'order' => [ + 'field' => WorkField::PUBLICATION_DATE, + 'direction' => Direction::DESC, + ], +], [ + 'workId', + 'fullTitle', + 'doi', ]); ``` +La selección puede incluir campos anidados. Los campos que devuelven objetos o listas se hidratan en +clases generadas de schema. + +```php +$work = $client->work('5a5b0fe3-03a9-444b-b221-ecae5370ff30', [ + 'workId', + 'fullTitle', + 'titles' => [ + 'titleId', + 'fullTitle', + ], + 'imprint' => [ + 'imprintId', + 'publisher' => [ + 'publisherId', + 'publisherName', + ], + ], +]); + +echo $work->getImprint()->getPublisher()->getPublisherName(); +echo $work->getTitles()[0]->getFullTitle(); +``` + +El ejecutor genérico sigue disponible cuando sea mejor usar directamente las clases generadas de +operación. Devuelve arrays sin hidratar objetos de schema. + +```php +use ThothApi\GraphQL\Queries\WorksQuery; + +$works = $client->execute(WorksQuery::operation([ + 'limit' => 5, +], [ + 'workId', + 'fullTitle', +])); +``` + +También es posible ejecutar GraphQL bruto. El token configurado con `setToken()` se usa en este camino. + +```php +$data = $client->rawQuery('query { workCount }'); +``` + #### Mutaciones Para ejecutar mutaciones, proporcione al cliente un personal access token valido. @@ -73,50 +112,77 @@ Para ejecutar mutaciones, proporcione al cliente un personal access token valido $client->setToken($token); ``` -Las mutaciones pueden ejecutarse proporcionando una instancia de la clase modelo correspondiente al tipo de mutación. Para las mutaciones de eliminación, solo es necesario proporcionar la ID del objeto. Cuando la operación se realiza con éxito, se devuelve la ID del objeto. +Los inputs se generan a partir del schema. Se pueden crear con arrays, a partir de DTOs que exponen +`getAllData()` o con objetos `JsonSerializable`. + +```php +use ThothApi\GraphQL\Enums\SubjectType; +use ThothApi\GraphQL\Inputs\NewSubject; + +$newSubject = new NewSubject([ + 'workId' => '5a5b0fe3-03a9-444b-b221-ecae5370ff30', + 'subjectType' => SubjectType::BIC, + 'subjectCode' => '1D', + 'subjectOrdinal' => 3, +]); + +$subjectId = $client->createSubject($newSubject); +``` + +Por defecto, las mutaciones que devuelven objetos seleccionan el primer campo `*Id` y devuelven ese +valor escalar. + +```php +$subjectId = $client->createSubject($newSubject); +``` + +Indique una selección explícita cuando quiera recibir un objeto de schema hidratado con getters, +setters y `toArray()`. ```php -use ThothApi\GraphQL\Models\Subject; +$subject = $client->createSubject($newSubject, [ + 'subjectId', + 'subjectCode', +]); + +echo $subject->getSubjectId(); +echo $subject->getSubjectCode(); +print_r($subject->toArray()); +``` + +Las clases de schema también pueden instanciarse y poblarse manualmente. + +```php +use ThothApi\GraphQL\Schemas\Work; -$subject = new Subject(); -$subject->setWorkId('5a5b0fe3-03a9-444b-b221-ecae5370ff30'); -$subject->setSubjectType(Subject::SUBJECT_TYPE_BIC); -$subject->setSubjectCode('1D'); -$subject->setSubjectOrdinal(3); +$work = (new Work()) + ->setWorkId('5a5b0fe3-03a9-444b-b221-ecae5370ff30') + ->setFullTitle('Titulo de ejemplo'); -$subjectId = $client->createSubject($subject); // 1d5ae47b-9e0c-4fba-b2d4-a3a2cdd8860c +echo $work->getFullTitle(); +print_r($work->toArray()); +``` + +Regenera las clases GraphQL a partir del schema actual de Thoth: -$client->deleteSubject($subjectId); +```bash +composer generate-graphql-client ``` #### Excepciones -Se lanza una excepción del tipo *QueryException* en caso de error en la solicitud a la API GraphQL. Es posible recuperar el mensaje del error y una descripción más detallada a partir de la excepción. +Se lanza una excepción del tipo *QueryException* en caso de error en la solicitud a la API GraphQL. Es posible recuperar el mensaje, los detalles, la query y las variables enviadas. ```php try { - $work = new \ThothApi\GraphQL\Models\Work([ + $client->createWork(new \ThothApi\GraphQL\Inputs\NewWork([ 'doi' => 'https://doi.org/10.00000/00000000', - ]); - $workId = $client->createWork($work); + ])); } catch (\ThothApi\Exception\QueryException $exception) { echo $exception->getMessage(); - /** - * Invalid value for argument "data", reason: - * "NewWork" is missing fields: "imprintId", "workStatus", "workType" - */ - echo print_r($exception->getDetails()); - /** - * Array ( - * [message] => Invalid value for argument "data", reason: "NewWork" is missing fields: "imprintId", "workStatus", "workType" - * [locations] => Array ( - * [0] => Array ( - * [line] => 3 - * [column] => 15 - * ) - * ) - * ) - */ + echo print_r($exception->getDetails(), true); + echo $exception->getQuery(); + echo print_r($exception->getVariables(), true); } ``` @@ -126,44 +192,17 @@ Documentación de la API: https://export.thoth.pub/ ```php $client = new \ThothApi\Rest\Client(); +``` + +El cliente REST exporta metadatos en los formatos expuestos por la API de exportación de Thoth. + +```php +$formats = $client->formats(); -echo(print_r($client->work('doideposit::crossref', 'e0f748b2-984f-45cc-8b9e-13989c31dda4'), true)); -/** - * - * - * - * e0f748b2-984f-45cc-8b9e-13989c31dda4_20241010195624 - * 20241010195624 - * - * Thoth - * distribution@thoth.pub - * - * Thoth - * - * - * - * - * - * - * Ammiel - * Alcalay - * - * - * Queens College, CUNY - * https://ror.org/03v8adn41 - * - * - * The Graduate Center, CUNY - * https://ror.org/00awd9g61 - * - * - * - * - * - * A Bibliography for After Jews and Arabs - * - * ... - */ +$metadata = $client->work( + 'doideposit::crossref', + 'e0f748b2-984f-45cc-8b9e-13989c31dda4' +); ``` #### Excepciones @@ -184,14 +223,13 @@ El constructor de ambos Clientes puede recibir un array opcional para agregar co $client = new Client([ 'allow_redirects' => false, 'connect_timeout' => 3.14, - 'timeout' => 3.14 + 'timeout' => 3.14, 'proxy' => [ - 'http' => 'http://localhost:8125', // Use this proxy with "http" - 'https' => 'http://localhost:9124', // Use this proxy with "https", - 'no' => ['.mit.edu', 'foo.com'] // Don't use a proxy with these + 'http' => 'http://localhost:8125', + 'https' => 'http://localhost:9124', + 'no' => ['.mit.edu', 'foo.com'], ], - 'debug' => true - ... + 'debug' => true, ]); ``` diff --git a/docs/README-pt_BR.md b/docs/README-pt_BR.md index b339d1b..51e6412 100644 --- a/docs/README-pt_BR.md +++ b/docs/README-pt_BR.md @@ -4,6 +4,14 @@ Cliente PHP para as APIs GraphQL e REST do Thoth. +## Instalação + +Esta biblioteca pode ser instalada via Composer: + +```bash +composer require thoth-pub/thoth-client-php +``` + ## Uso ### GraphQL @@ -16,55 +24,86 @@ $client = new \ThothApi\GraphQL\Client(); #### Consultas -O cliente mapeia todas as consultas da API GraphQL do Thoth. Os métodos retornam dados no formato orientado a objetos, facilitando o uso e manipulação das informações. +As classes de consultas, mutações, schemas, inputs, enums e scalars são geradas a partir do schema de +introspecção GraphQL do Thoth. A API mais simples é chamar no cliente o método com o mesmo nome da +operação GraphQL. ```php -$contributors = $client->contributors(); - -echo print_r($contributors, true); -/** - * Array ( - * [0] => ThothApi\GraphQL\Models\Contributor Object ( - * [data] => Array ( - * [contributorId] => e1de541c-e84b-4092-941f-dab9b5dac865 - * [firstName] => Aaron - * [lastName] => Ansell - * [fullName] => Aaron Ansell - * [orcid] => https://orcid.org/0000-0001-6365-5168 - * [website] => - * ) - * ) - * [1] => ThothApi\GraphQL\Models\Contributor Object ( - * [data] => Array ( - * [contributorId] => 1c3aade6-6d48-41b4-8def-b435f4b43573 - * [firstName] => Aaron D. - * [lastName] => Hornkohl - * [fullName] => Aaron D. Hornkohl - * [orcid] => - * [website] => https://www.ames.cam.ac.uk/people/dr-aaron-d-hornkohl - * ) - * ) - * ... - * ) -*/ - -$contributor = array_shift($contributors); +$works = $client->works(5, [ + 'workId', + 'fullTitle', +]); -echo $contributor->getLastName(); // Ansell -echo $contributor->getOrcid(); // https://orcid.org/0000-0001-6365-5168 +echo $works[0]->getWorkId(); +echo $works[0]->getFullTitle(); ``` -As consultas podem aceitar um array com os argumentos necessários, conforme especificado no esquema GraphQL da Thoth. É possível utilizar o argumento "order" especificando apenas o campo e a direção desejada. +Os argumentos podem ser passados por posição ou por nome. Valores de enum podem ser passados +diretamente com constantes das classes de enum geradas. `OperationRequest::enum()` continua disponível +para operações customizadas. ```php +use ThothApi\GraphQL\Enums\Direction; +use ThothApi\GraphQL\Enums\WorkField; + $works = $client->works([ 'publishers' => ['71faf1c3-900a-4b8c-bca7-4f927699fb90'], 'limit' => 5, - 'field' => 'PUBLICATION_DATE', - 'direction' => 'DESC' + 'order' => [ + 'field' => WorkField::PUBLICATION_DATE, + 'direction' => Direction::DESC, + ], +], [ + 'workId', + 'fullTitle', + 'doi', ]); ``` +A seleção pode incluir campos aninhados. Campos que retornam objetos ou listas são hidratados em +classes geradas de schema. + +```php +$work = $client->work('5a5b0fe3-03a9-444b-b221-ecae5370ff30', [ + 'workId', + 'fullTitle', + 'titles' => [ + 'titleId', + 'fullTitle', + ], + 'imprint' => [ + 'imprintId', + 'publisher' => [ + 'publisherId', + 'publisherName', + ], + ], +]); + +echo $work->getImprint()->getPublisher()->getPublisherName(); +echo $work->getTitles()[0]->getFullTitle(); +``` + +O executor genérico continua disponível quando for melhor usar diretamente as classes geradas de +operação. Ele retorna arrays brutos, sem hidratar objetos de schema. + +```php +use ThothApi\GraphQL\Queries\WorksQuery; + +$works = $client->execute(WorksQuery::operation([ + 'limit' => 5, +], [ + 'workId', + 'fullTitle', +])); +``` + +Também é possível executar GraphQL bruto. O token configurado com `setToken()` é usado nesse caminho. + +```php +$data = $client->rawQuery('query { workCount }'); +``` + #### Mutações Para executar mutações, forneça ao cliente um personal access token válido. @@ -73,50 +112,77 @@ Para executar mutações, forneça ao cliente um personal access token válido. $client->setToken($token); ``` -Mutações podem ser executadas fornecendo uma instância da classe modelo correspondente ao tipo da mutação. Para mutações de exclusão, é necessário apenas fornecer o ID do objeto. Quando a operação é bem-sucedida, o ID do objeto é retornado. +Inputs são gerados a partir do schema. Eles podem ser criados com arrays, a partir de DTOs que expõem +`getAllData()` ou de objetos `JsonSerializable`. + +```php +use ThothApi\GraphQL\Enums\SubjectType; +use ThothApi\GraphQL\Inputs\NewSubject; + +$newSubject = new NewSubject([ + 'workId' => '5a5b0fe3-03a9-444b-b221-ecae5370ff30', + 'subjectType' => SubjectType::BIC, + 'subjectCode' => '1D', + 'subjectOrdinal' => 3, +]); + +$subjectId = $client->createSubject($newSubject); +``` + +Por padrão, mutações que retornam objetos selecionam o primeiro campo `*Id` e retornam esse valor +escalar. + +```php +$subjectId = $client->createSubject($newSubject); +``` + +Informe uma seleção explícita quando quiser receber um objeto de schema hidratado com getters, +setters e `toArray()`. ```php -use ThothApi\GraphQL\Models\Subject; +$subject = $client->createSubject($newSubject, [ + 'subjectId', + 'subjectCode', +]); + +echo $subject->getSubjectId(); +echo $subject->getSubjectCode(); +print_r($subject->toArray()); +``` + +As classes de schema também podem ser instanciadas e populadas manualmente. + +```php +use ThothApi\GraphQL\Schemas\Work; -$subject = new Subject(); -$subject->setWorkId('5a5b0fe3-03a9-444b-b221-ecae5370ff30'); -$subject->setSubjectType(Subject::SUBJECT_TYPE_BIC); -$subject->setSubjectCode('1D'); -$subject->setSubjectOrdinal(3); +$work = (new Work()) + ->setWorkId('5a5b0fe3-03a9-444b-b221-ecae5370ff30') + ->setFullTitle('Titulo de exemplo'); -$subjectId = $client->createSubject($subject); // 1d5ae47b-9e0c-4fba-b2d4-a3a2cdd8860c +echo $work->getFullTitle(); +print_r($work->toArray()); +``` + +Regere as classes GraphQL a partir do schema atual do Thoth: -$client->deleteSubject($subjectId); +```bash +composer generate-graphql-client ``` #### Exceções -Uma exceção do tipo *QueryException* é lançada em caso de erro na solicitação à API GraphQL. É possível recuperar a mensagem do erro e uma descrição mais detalhada a partir da exceção. +Uma exceção do tipo *QueryException* é lançada em caso de erro na solicitação à API GraphQL. É possível recuperar a mensagem do erro, os detalhes, a query e as variáveis enviadas. ```php try { - $work = new \ThothApi\GraphQL\Models\Work([ + $client->createWork(new \ThothApi\GraphQL\Inputs\NewWork([ 'doi' => 'https://doi.org/10.00000/00000000', - ]); - $workId = $client->createWork($work); + ])); } catch (\ThothApi\Exception\QueryException $exception) { echo $exception->getMessage(); - /** - * Invalid value for argument "data", reason: - * "NewWork" is missing fields: "imprintId", "workStatus", "workType" - */ - echo print_r($exception->getDetails()); - /** - * Array ( - * [message] => Invalid value for argument "data", reason: "NewWork" is missing fields: "imprintId", "workStatus", "workType" - * [locations] => Array ( - * [0] => Array ( - * [line] => 3 - * [column] => 15 - * ) - * ) - * ) - */ + echo print_r($exception->getDetails(), true); + echo $exception->getQuery(); + echo print_r($exception->getVariables(), true); } ``` @@ -126,44 +192,17 @@ Documentação da API: https://export.thoth.pub/ ```php $client = new \ThothApi\Rest\Client(); +``` + +O client REST exporta metadados nos formatos disponibilizados pela API de exportação do Thoth. + +```php +$formats = $client->formats(); -echo(print_r($client->work('doideposit::crossref', 'e0f748b2-984f-45cc-8b9e-13989c31dda4'), true)); -/** - * - * - * - * e0f748b2-984f-45cc-8b9e-13989c31dda4_20241010195624 - * 20241010195624 - * - * Thoth - * distribution@thoth.pub - * - * Thoth - * - * - * - * - * - * - * Ammiel - * Alcalay - * - * - * Queens College, CUNY - * https://ror.org/03v8adn41 - * - * - * The Graduate Center, CUNY - * https://ror.org/00awd9g61 - * - * - * - * - * - * A Bibliography for After Jews and Arabs - * - * ... - */ +$metadata = $client->work( + 'doideposit::crossref', + 'e0f748b2-984f-45cc-8b9e-13989c31dda4' +); ``` #### Exceções @@ -184,14 +223,13 @@ O construtor de ambos os Clientes pode receber um array opcional para adicionar $client = new Client([ 'allow_redirects' => false, 'connect_timeout' => 3.14, - 'timeout' => 3.14 + 'timeout' => 3.14, 'proxy' => [ - 'http' => 'http://localhost:8125', // Use this proxy with "http" - 'https' => 'http://localhost:9124', // Use this proxy with "https", - 'no' => ['.mit.edu', 'foo.com'] // Don't use a proxy with these + 'http' => 'http://localhost:8125', + 'https' => 'http://localhost:9124', + 'no' => ['.mit.edu', 'foo.com'], ], - 'debug' => true - ... + 'debug' => true, ]); ``` diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..2c6bf2f --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,6 @@ +parameters: + level: 5 + paths: + - src + - tools + tmpDir: tmp/phpstan diff --git a/src/Exception/QueryException.php b/src/Exception/QueryException.php index b69e170..cded02b 100644 --- a/src/Exception/QueryException.php +++ b/src/Exception/QueryException.php @@ -6,9 +6,26 @@ class QueryException extends \RuntimeException { private array $details; - public function __construct(array $error) - { + private array $errors; + + private ?int $statusCode; + + private ?string $query; + + private ?array $variables; + + public function __construct( + array $error, + ?string $query = null, + ?array $variables = null, + ?array $errors = null, + ?int $statusCode = null + ) { $this->details = $error; + $this->errors = $errors ?? [$error]; + $this->statusCode = $statusCode; + $this->query = $query; + $this->variables = $variables; parent::__construct($error['message']); } @@ -16,4 +33,24 @@ public function getDetails(): array { return $this->details; } + + public function getErrors(): array + { + return $this->errors; + } + + public function getStatusCode(): ?int + { + return $this->statusCode; + } + + public function getQuery(): ?string + { + return $this->query; + } + + public function getVariables(): ?array + { + return $this->variables; + } } diff --git a/src/GraphQL/Client.php b/src/GraphQL/Client.php index 4599052..b46bc5b 100644 --- a/src/GraphQL/Client.php +++ b/src/GraphQL/Client.php @@ -2,23 +2,198 @@ namespace ThothApi\GraphQL; -use ThothApi\GraphQL\Concerns\HasMutationOperations; -use ThothApi\GraphQL\Concerns\HasQueryOperations; -use ThothApi\GraphQL\Models\AbstractModel; -use ThothApi\GraphQL\Models\AbstractText; -use ThothApi\GraphQL\Models\AdditionalResource; -use ThothApi\GraphQL\Models\Me; -use ThothApi\GraphQL\Models\Work; +use ThothApi\GraphQL\Operation\OperationCallArguments; +/** + * GraphQL API client. + * + * + * @method \ThothApi\GraphQL\Schemas\GraphQLAbstract abstract(string $abstractId, string|null $markupFormat = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\GraphQLAbstract[] abstracts(int|null $limit = null, int|null $offset = null, string|null $filter = null, \ThothApi\GraphQL\Inputs\AbstractOrderBy|array|null $order = null, string[]|null $localeCodes = null, string|null $markupFormat = null, array $selection = []) + * @method int additionalResourceCount(array $selection = []) + * @method \ThothApi\GraphQL\Schemas\WorkResource additionalResource(string $additionalResourceId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\WorkResource[] additionalResources(int|null $limit = null, int|null $offset = null, \ThothApi\GraphQL\Inputs\AdditionalResourceOrderBy|array|null $order = null, string[]|null $publishers = null, array $selection = []) + * @method int affiliationCount(array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Affiliation affiliation(string $affiliationId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Affiliation[] affiliations(int|null $limit = null, int|null $offset = null, \ThothApi\GraphQL\Inputs\AffiliationOrderBy|array|null $order = null, string[]|null $publishers = null, array $selection = []) + * @method int awardCount(array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Award award(string $awardId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Award[] awards(int|null $limit = null, int|null $offset = null, \ThothApi\GraphQL\Inputs\AwardOrderBy|array|null $order = null, string[]|null $publishers = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Biography[] biographies(int|null $limit = null, int|null $offset = null, string|null $filter = null, \ThothApi\GraphQL\Inputs\BiographyOrderBy|array|null $order = null, string[]|null $localeCodes = null, string|null $markupFormat = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Biography biography(string $biographyId, string|null $markupFormat = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Work bookByDoi(string $doi, array $selection = []) + * @method int bookCount(string|null $filter = null, string[]|null $publishers = null, string|null $workStatus = null, string[]|null $workStatuses = null, \ThothApi\GraphQL\Inputs\TimeExpression|array|null $publicationDate = null, \ThothApi\GraphQL\Inputs\TimeExpression|array|null $updatedAtWithRelations = null, array $selection = []) + * @method int bookReviewCount(array $selection = []) + * @method \ThothApi\GraphQL\Schemas\BookReview bookReview(string $bookReviewId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\BookReview[] bookReviews(int|null $limit = null, int|null $offset = null, \ThothApi\GraphQL\Inputs\BookReviewOrderBy|array|null $order = null, string[]|null $publishers = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Work[] books(int|null $limit = null, int|null $offset = null, string|null $filter = null, \ThothApi\GraphQL\Inputs\WorkOrderBy|array|null $order = null, string[]|null $publishers = null, string|null $workStatus = null, string[]|null $workStatuses = null, \ThothApi\GraphQL\Inputs\TimeExpression|array|null $publicationDate = null, \ThothApi\GraphQL\Inputs\TimeExpression|array|null $updatedAtWithRelations = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Work chapterByDoi(string $doi, array $selection = []) + * @method int chapterCount(string|null $filter = null, string[]|null $publishers = null, string|null $workStatus = null, string[]|null $workStatuses = null, \ThothApi\GraphQL\Inputs\TimeExpression|array|null $publicationDate = null, \ThothApi\GraphQL\Inputs\TimeExpression|array|null $updatedAtWithRelations = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Work[] chapters(int|null $limit = null, int|null $offset = null, string|null $filter = null, \ThothApi\GraphQL\Inputs\WorkOrderBy|array|null $order = null, string[]|null $publishers = null, string|null $workStatus = null, string[]|null $workStatuses = null, \ThothApi\GraphQL\Inputs\TimeExpression|array|null $publicationDate = null, \ThothApi\GraphQL\Inputs\TimeExpression|array|null $updatedAtWithRelations = null, array $selection = []) + * @method int contactCount(string[]|null $contactTypes = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Contact contact(string $contactId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Contact[] contacts(int|null $limit = null, int|null $offset = null, \ThothApi\GraphQL\Inputs\ContactOrderBy|array|null $order = null, string[]|null $publishers = null, string[]|null $contactTypes = null, array $selection = []) + * @method int contributionCount(string[]|null $contributionTypes = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Contribution contribution(string $contributionId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Contribution[] contributions(int|null $limit = null, int|null $offset = null, \ThothApi\GraphQL\Inputs\ContributionOrderBy|array|null $order = null, string[]|null $publishers = null, string[]|null $contributionTypes = null, array $selection = []) + * @method int contributorCount(string|null $filter = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Contributor contributor(string $contributorId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Contributor[] contributors(int|null $limit = null, int|null $offset = null, string|null $filter = null, \ThothApi\GraphQL\Inputs\ContributorOrderBy|array|null $order = null, array $selection = []) + * @method int endorsementCount(array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Endorsement endorsement(string $endorsementId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Endorsement[] endorsements(int|null $limit = null, int|null $offset = null, \ThothApi\GraphQL\Inputs\EndorsementOrderBy|array|null $order = null, string[]|null $publishers = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\File file(string $fileId, array $selection = []) + * @method int fundingCount(array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Funding funding(string $fundingId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Funding[] fundings(int|null $limit = null, int|null $offset = null, \ThothApi\GraphQL\Inputs\FundingOrderBy|array|null $order = null, string[]|null $publishers = null, array $selection = []) + * @method int imprintCount(string|null $filter = null, string[]|null $publishers = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Imprint imprint(string $imprintId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Imprint[] imprints(int|null $limit = null, int|null $offset = null, string|null $filter = null, \ThothApi\GraphQL\Inputs\ImprintOrderBy|array|null $order = null, string[]|null $publishers = null, array $selection = []) + * @method int institutionCount(string|null $filter = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Institution institution(string $institutionId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Institution[] institutions(int|null $limit = null, int|null $offset = null, string|null $filter = null, \ThothApi\GraphQL\Inputs\InstitutionOrderBy|array|null $order = null, array $selection = []) + * @method int issueCount(array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Issue issue(string $issueId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Issue[] issues(int|null $limit = null, int|null $offset = null, \ThothApi\GraphQL\Inputs\IssueOrderBy|array|null $order = null, string[]|null $publishers = null, array $selection = []) + * @method int languageCount(string[]|null $languageCodes = null, string|null $languageRelation = null, string[]|null $languageRelations = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Language language(string $languageId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Language[] languages(int|null $limit = null, int|null $offset = null, \ThothApi\GraphQL\Inputs\LanguageOrderBy|array|null $order = null, string[]|null $publishers = null, string[]|null $languageCodes = null, string|null $languageRelation = null, string[]|null $languageRelations = null, array $selection = []) + * @method int locationCount(string[]|null $locationPlatforms = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Location location(string $locationId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Location[] locations(int|null $limit = null, int|null $offset = null, \ThothApi\GraphQL\Inputs\LocationOrderBy|array|null $order = null, string[]|null $publishers = null, string[]|null $locationPlatforms = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Me me(array $selection = []) + * @method int priceCount(string[]|null $currencyCodes = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Price price(string $priceId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Price[] prices(int|null $limit = null, int|null $offset = null, \ThothApi\GraphQL\Inputs\PriceOrderBy|array|null $order = null, string[]|null $publishers = null, string[]|null $currencyCodes = null, array $selection = []) + * @method int publicationCount(string|null $filter = null, string[]|null $publishers = null, string[]|null $publicationTypes = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Publication publication(string $publicationId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Publication[] publications(int|null $limit = null, int|null $offset = null, string|null $filter = null, \ThothApi\GraphQL\Inputs\PublicationOrderBy|array|null $order = null, string[]|null $publishers = null, string[]|null $publicationTypes = null, array $selection = []) + * @method int publisherCount(string|null $filter = null, string[]|null $publishers = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Publisher publisher(string $publisherId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Publisher[] publishers(int|null $limit = null, int|null $offset = null, string|null $filter = null, \ThothApi\GraphQL\Inputs\PublisherOrderBy|array|null $order = null, string[]|null $publishers = null, array $selection = []) + * @method int referenceCount(array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Reference reference(string $referenceId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Reference[] references(int|null $limit = null, int|null $offset = null, \ThothApi\GraphQL\Inputs\ReferenceOrderBy|array|null $order = null, string[]|null $publishers = null, array $selection = []) + * @method int seriesCount(string|null $filter = null, string[]|null $publishers = null, string[]|null $seriesTypes = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Series series(string $seriesId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Series[] serieses(int|null $limit = null, int|null $offset = null, string|null $filter = null, \ThothApi\GraphQL\Inputs\SeriesOrderBy|array|null $order = null, string[]|null $publishers = null, string[]|null $seriesTypes = null, array $selection = []) + * @method int subjectCount(string|null $filter = null, string[]|null $subjectTypes = null, string[]|null $workStatuses = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Subject subject(string $subjectId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Subject[] subjects(int|null $limit = null, int|null $offset = null, string|null $filter = null, \ThothApi\GraphQL\Inputs\SubjectOrderBy|array|null $order = null, string[]|null $publishers = null, string[]|null $subjectTypes = null, string[]|null $workStatuses = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Title title(string $titleId, string|null $markupFormat = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Title[] titles(int|null $limit = null, int|null $offset = null, string|null $filter = null, \ThothApi\GraphQL\Inputs\TitleOrderBy|array|null $order = null, string[]|null $localeCodes = null, string|null $markupFormat = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Work workByDoi(string $doi, array $selection = []) + * @method int workCount(string|null $filter = null, string[]|null $publishers = null, string[]|null $workTypes = null, string|null $workStatus = null, string[]|null $workStatuses = null, \ThothApi\GraphQL\Inputs\TimeExpression|array|null $publicationDate = null, \ThothApi\GraphQL\Inputs\TimeExpression|array|null $updatedAtWithRelations = null, array $selection = []) + * @method int workFeaturedVideoCount(array $selection = []) + * @method \ThothApi\GraphQL\Schemas\WorkFeaturedVideo workFeaturedVideo(string $workFeaturedVideoId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\WorkFeaturedVideo[] workFeaturedVideos(int|null $limit = null, int|null $offset = null, \ThothApi\GraphQL\Inputs\WorkFeaturedVideoOrderBy|array|null $order = null, string[]|null $publishers = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Work work(string $workId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Work[] works(int|null $limit = null, int|null $offset = null, string|null $filter = null, \ThothApi\GraphQL\Inputs\WorkOrderBy|array|null $order = null, string[]|null $publishers = null, string[]|null $workTypes = null, string|null $workStatus = null, string[]|null $workStatuses = null, \ThothApi\GraphQL\Inputs\TimeExpression|array|null $publicationDate = null, \ThothApi\GraphQL\Inputs\TimeExpression|array|null $updatedAtWithRelations = null, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\File completeFileUpload(\ThothApi\GraphQL\Inputs\CompleteFileUpload|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\GraphQLAbstract createAbstract(string|null $markupFormat = null, \ThothApi\GraphQL\Inputs\NewAbstract|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\WorkResource createAdditionalResource(string|null $markupFormat = null, \ThothApi\GraphQL\Inputs\NewAdditionalResource|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Affiliation createAffiliation(\ThothApi\GraphQL\Inputs\NewAffiliation|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Award createAward(string|null $markupFormat = null, \ThothApi\GraphQL\Inputs\NewAward|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Biography createBiography(string|null $markupFormat = null, \ThothApi\GraphQL\Inputs\NewBiography|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\BookReview createBookReview(string|null $markupFormat = null, \ThothApi\GraphQL\Inputs\NewBookReview|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Contact createContact(\ThothApi\GraphQL\Inputs\NewContact|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Contribution createContribution(\ThothApi\GraphQL\Inputs\NewContribution|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Contributor createContributor(\ThothApi\GraphQL\Inputs\NewContributor|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Endorsement createEndorsement(string|null $markupFormat = null, \ThothApi\GraphQL\Inputs\NewEndorsement|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Funding createFunding(\ThothApi\GraphQL\Inputs\NewFunding|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Imprint createImprint(\ThothApi\GraphQL\Inputs\NewImprint|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Institution createInstitution(\ThothApi\GraphQL\Inputs\NewInstitution|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Issue createIssue(\ThothApi\GraphQL\Inputs\NewIssue|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Language createLanguage(\ThothApi\GraphQL\Inputs\NewLanguage|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Location createLocation(\ThothApi\GraphQL\Inputs\NewLocation|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Price createPrice(\ThothApi\GraphQL\Inputs\NewPrice|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Publication createPublication(\ThothApi\GraphQL\Inputs\NewPublication|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Publisher createPublisher(\ThothApi\GraphQL\Inputs\NewPublisher|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Reference createReference(\ThothApi\GraphQL\Inputs\NewReference|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Series createSeries(string|null $markupFormat = null, \ThothApi\GraphQL\Inputs\NewSeries|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Subject createSubject(\ThothApi\GraphQL\Inputs\NewSubject|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Title createTitle(string|null $markupFormat = null, \ThothApi\GraphQL\Inputs\NewTitle|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\WorkFeaturedVideo createWorkFeaturedVideo(\ThothApi\GraphQL\Inputs\NewWorkFeaturedVideo|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Work createWork(\ThothApi\GraphQL\Inputs\NewWork|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\WorkRelation createWorkRelation(\ThothApi\GraphQL\Inputs\NewWorkRelation|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\GraphQLAbstract deleteAbstract(string $abstractId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\WorkResource deleteAdditionalResource(string $additionalResourceId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Affiliation deleteAffiliation(string $affiliationId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Award deleteAward(string $awardId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Biography deleteBiography(string $biographyId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\BookReview deleteBookReview(string $bookReviewId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Contact deleteContact(string $contactId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Contribution deleteContribution(string $contributionId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Contributor deleteContributor(string $contributorId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Endorsement deleteEndorsement(string $endorsementId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Funding deleteFunding(string $fundingId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Imprint deleteImprint(string $imprintId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Institution deleteInstitution(string $institutionId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Issue deleteIssue(string $issueId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Language deleteLanguage(string $languageId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Location deleteLocation(string $locationId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Price deletePrice(string $priceId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Publication deletePublication(string $publicationId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Publisher deletePublisher(string $publisherId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Reference deleteReference(string $referenceId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Series deleteSeries(string $seriesId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Subject deleteSubject(string $subjectId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Title deleteTitle(string $titleId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\WorkFeaturedVideo deleteWorkFeaturedVideo(string $workFeaturedVideoId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Work deleteWork(string $workId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\WorkRelation deleteWorkRelation(string $workRelationId, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\FileUploadResponse initAdditionalResourceFileUpload(\ThothApi\GraphQL\Inputs\NewAdditionalResourceFileUpload|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\FileUploadResponse initFrontcoverFileUpload(\ThothApi\GraphQL\Inputs\NewFrontcoverFileUpload|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\FileUploadResponse initPublicationFileUpload(\ThothApi\GraphQL\Inputs\NewPublicationFileUpload|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\FileUploadResponse initWorkFeaturedVideoFileUpload(\ThothApi\GraphQL\Inputs\NewWorkFeaturedVideoFileUpload|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\WorkResource moveAdditionalResource(string $additionalResourceId, int $newOrdinal, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Affiliation moveAffiliation(string $affiliationId, int $newOrdinal, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Award moveAward(string $awardId, int $newOrdinal, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\BookReview moveBookReview(string $bookReviewId, int $newOrdinal, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Contribution moveContribution(string $contributionId, int $newOrdinal, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Endorsement moveEndorsement(string $endorsementId, int $newOrdinal, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Issue moveIssue(string $issueId, int $newOrdinal, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Reference moveReference(string $referenceId, int $newOrdinal, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Subject moveSubject(string $subjectId, int $newOrdinal, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\WorkRelation moveWorkRelation(string $workRelationId, int $newOrdinal, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\GraphQLAbstract updateAbstract(string|null $markupFormat = null, \ThothApi\GraphQL\Inputs\PatchAbstract|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\WorkResource updateAdditionalResource(string|null $markupFormat = null, \ThothApi\GraphQL\Inputs\PatchAdditionalResource|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Affiliation updateAffiliation(\ThothApi\GraphQL\Inputs\PatchAffiliation|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Award updateAward(string|null $markupFormat = null, \ThothApi\GraphQL\Inputs\PatchAward|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Biography updateBiography(string|null $markupFormat = null, \ThothApi\GraphQL\Inputs\PatchBiography|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\BookReview updateBookReview(string|null $markupFormat = null, \ThothApi\GraphQL\Inputs\PatchBookReview|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Contact updateContact(\ThothApi\GraphQL\Inputs\PatchContact|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Contribution updateContribution(\ThothApi\GraphQL\Inputs\PatchContribution|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Contributor updateContributor(\ThothApi\GraphQL\Inputs\PatchContributor|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Endorsement updateEndorsement(string|null $markupFormat = null, \ThothApi\GraphQL\Inputs\PatchEndorsement|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Funding updateFunding(\ThothApi\GraphQL\Inputs\PatchFunding|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Imprint updateImprint(\ThothApi\GraphQL\Inputs\PatchImprint|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Institution updateInstitution(\ThothApi\GraphQL\Inputs\PatchInstitution|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Issue updateIssue(\ThothApi\GraphQL\Inputs\PatchIssue|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Language updateLanguage(\ThothApi\GraphQL\Inputs\PatchLanguage|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Location updateLocation(\ThothApi\GraphQL\Inputs\PatchLocation|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Price updatePrice(\ThothApi\GraphQL\Inputs\PatchPrice|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Publication updatePublication(\ThothApi\GraphQL\Inputs\PatchPublication|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Publisher updatePublisher(\ThothApi\GraphQL\Inputs\PatchPublisher|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Reference updateReference(\ThothApi\GraphQL\Inputs\PatchReference|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Series updateSeries(string|null $markupFormat = null, \ThothApi\GraphQL\Inputs\PatchSeries|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Subject updateSubject(\ThothApi\GraphQL\Inputs\PatchSubject|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Title updateTitle(string|null $markupFormat = null, \ThothApi\GraphQL\Inputs\PatchTitle|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\WorkFeaturedVideo updateWorkFeaturedVideo(\ThothApi\GraphQL\Inputs\PatchWorkFeaturedVideo|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\Work updateWork(\ThothApi\GraphQL\Inputs\PatchWork|array $data, array $selection = []) + * @method \ThothApi\GraphQL\Schemas\WorkRelation updateWorkRelation(\ThothApi\GraphQL\Inputs\PatchWorkRelation|array $data, array $selection = []) + * + */ class Client { - use HasMutationOperations; - use HasQueryOperations; + private const SCALAR_TYPES = ['Boolean', 'Date', 'Doi', 'Float', 'Int', 'Isbn', 'Orcid', 'Ror', 'String', 'Timestamp', 'Uuid']; private Request $request; private string $token = ''; + private static array $defaultSelections = []; + public const THOTH_BASE_URI = 'https://api.thoth.pub/'; public function __construct(array $httpConfig = []) @@ -37,103 +212,105 @@ public function setToken(string $token): self public function rawQuery(string $rawQuery, array $args = []): array { - $response = $this->request->runQuery($rawQuery, $args); + $response = $this->request->runQuery($rawQuery, $args, $this->token ?: null); return $response->getData(); } - private function get(string $entityName, string $entityId, array $args = []): AbstractModel + public function execute(OperationRequest $operation) { - $entityClass = $this->getModelClass($entityName); - $args = array_merge( - [$this->getIdentifierField($entityName) => $entityId], - array_filter($args, fn ($value) => $value !== null) - ); + $response = $this->request->runQuery($operation->toGraphQL(), $operation->getVariables(), $this->token ?: null); + $data = $response->getData(); - $result = $this->query($entityName, $args, $entityName === 'me' ? $this->token : null); - return new $entityClass($result[$entityName]); + return $data[$operation->getField()->getName()]; } - private function getMany(string $entityName, array $args = []): array + public function __call(string $name, array $arguments) { - $entityClass = $this->getModelClass($entityName); - $queryName = $this->getPluralQueryName($entityName); + $operationClass = $this->getOperationClass($name); + $field = $operationClass::field(); + $operationCall = (new OperationCallArguments())->build($field->getArguments(), $arguments); + $selection = $operationCall['selection']; + $operation = $operationClass::operation( + $operationCall['arguments'], + $selection ?: $this->getDefaultSelection($field->getType()->baseName()) + ); - $result = $this->query($queryName, $args); - return array_map(fn ($data) => new $entityClass($data), $result[$queryName]); - } + $result = $this->execute($operation); + $unwrappedResult = $this->unwrapSingleSelection($result, $operation->getSelection()); - private function count(string $entityName, array $args = []): int - { - $queryName = $entityName . 'Count'; - $result = $this->query($queryName, $args); - return $result[$queryName]; - } + if ($unwrappedResult !== $result) { + return $unwrappedResult; + } - private function getByDoi(string $entityName, string $doi): AbstractModel - { - $entityClass = $this->getModelClass($entityName); - $queryName = $entityName . 'ByDoi'; - $result = $this->query($queryName, ['doi' => $doi]); - return new $entityClass($result[$queryName]); + return (new ValueHydrator())->hydrate($result, $field->getType()); } - private function mutation(string $mutationName, array $data, string $returnValue, array $extraArgs = []): string + private function getOperationClass(string $name): string { - $result = $this->runMutation($mutationName, $data, $extraArgs); - return $result[$returnValue]; - } + $className = $this->studly($name); + $mutationClass = '\\ThothApi\\GraphQL\\Mutations\\' . $className . 'Mutation'; - private function runMutation(string $mutationName, array $data, array $extraArgs = []): array - { - $mutation = MutationBuilder::build($mutationName, $data, $extraArgs); - $response = $this->request->runQuery($mutation, null, $this->token); - $body = $response->getData(); - return $body[$mutationName]; - } + if (class_exists($mutationClass)) { + return $mutationClass; + } - private function getModelClass(string $entityName): string - { - $mapping = [ - 'abstract' => AbstractText::class, - 'additionalResource' => AdditionalResource::class, - 'book' => Work::class, - 'chapter' => Work::class, - 'me' => Me::class, - ]; - - return $mapping[$entityName] ?? '\\ThothApi\\GraphQL\\Models\\' . ucfirst($entityName); + $queryClass = '\\ThothApi\\GraphQL\\Queries\\' . $className . 'Query'; + + if (class_exists($queryClass)) { + return $queryClass; + } + + throw new \BadMethodCallException("Operation '{$name}' not found."); } - private function getIdentifierField(string $entityName): string + private function getDefaultSelection(?string $typeName): array { - switch ($entityName) { - case 'additionalResource': - return 'additionalResourceId'; - case 'bookReview': - return 'bookReviewId'; - case 'workFeaturedVideo': - return 'workFeaturedVideoId'; - default: - return $entityName . 'Id'; + if ($typeName === null || in_array($typeName, self::SCALAR_TYPES, true)) { + return []; + } + + if (array_key_exists($typeName, self::$defaultSelections)) { + return self::$defaultSelections[$typeName]; + } + + $schemaClass = '\\ThothApi\\GraphQL\\Schemas\\' . ($typeName === 'Abstract' ? 'GraphQLAbstract' : $typeName); + + if (!class_exists($schemaClass)) { + self::$defaultSelections[$typeName] = []; + return self::$defaultSelections[$typeName]; + } + + foreach ($schemaClass::definition()->getFields() as $field) { + if (substr($field->getName(), -2) === 'Id') { + self::$defaultSelections[$typeName] = [$field->getName()]; + return self::$defaultSelections[$typeName]; + } } + + self::$defaultSelections[$typeName] = []; + return self::$defaultSelections[$typeName]; } - private function getPluralQueryName(string $entityName): string + private function unwrapSingleSelection($result, array $selection) { - switch ($entityName) { - case 'biography': - return 'biographies'; - case 'series': - return 'serieses'; - default: - return $entityName . 's'; + if (!is_array($result) || count($selection) !== 1 || !is_string($selection[0])) { + return $result; } + + return array_key_exists($selection[0], $result) ? $result[$selection[0]] : $result; } - private function query(string $queryName, array $args = [], ?string $token = null): array + private function studly(string $value): string { - $query = QueryProvider::get($queryName); - $response = $this->request->runQuery($query, array_filter($args, fn ($value) => $value !== null), $token); - return $response->getData(); + $value = preg_replace('/[^A-Za-z0-9]+/', ' ', $value); + $value = preg_replace('/(?mutation( - 'createAdditionalResource', - $additionalResource->getAllData(), - 'workResourceId', - ['markupFormat' => $markupFormat] - ); - } - - public function updateAdditionalResource(AdditionalResource $additionalResource, ?string $markupFormat = null): string - { - return $this->mutation( - 'updateAdditionalResource', - $additionalResource->getAllData(), - 'workResourceId', - ['markupFormat' => $markupFormat] - ); - } - - public function deleteAdditionalResource(string $additionalResourceId): string - { - return $this->mutation( - 'deleteAdditionalResource', - ['additionalResourceId' => $additionalResourceId], - 'workResourceId' - ); - } - - public function createAffiliation(Affiliation $affiliation): string - { - return $this->mutation('createAffiliation', $affiliation->getAllData(), 'affiliationId'); - } - - public function updateAffiliation(Affiliation $affiliation): string - { - return $this->mutation('updateAffiliation', $affiliation->getAllData(), 'affiliationId'); - } - - public function deleteAffiliation(string $affiliationId): string - { - return $this->mutation('deleteAffiliation', ['affiliationId' => $affiliationId], 'affiliationId'); - } - - public function createAbstract(AbstractText $abstract, ?string $markupFormat = null): string - { - return $this->mutation('createAbstract', $abstract->getAllData(), 'abstractId', ['markupFormat' => $markupFormat]); - } - - public function updateAbstract(AbstractText $abstract, ?string $markupFormat = null): string - { - return $this->mutation('updateAbstract', $abstract->getAllData(), 'abstractId', ['markupFormat' => $markupFormat]); - } - - public function deleteAbstract(string $abstractId): string - { - return $this->mutation('deleteAbstract', ['abstractId' => $abstractId], 'abstractId'); - } - - public function createAward(Award $award, ?string $markupFormat = null): string - { - return $this->mutation('createAward', $award->getAllData(), 'awardId', ['markupFormat' => $markupFormat]); - } - - public function updateAward(Award $award, ?string $markupFormat = null): string - { - return $this->mutation('updateAward', $award->getAllData(), 'awardId', ['markupFormat' => $markupFormat]); - } - - public function deleteAward(string $awardId): string - { - return $this->mutation('deleteAward', ['awardId' => $awardId], 'awardId'); - } - - public function createBiography(Biography $biography, ?string $markupFormat = null): string - { - return $this->mutation('createBiography', $biography->getAllData(), 'biographyId', ['markupFormat' => $markupFormat]); - } - - public function updateBiography(Biography $biography, ?string $markupFormat = null): string - { - return $this->mutation('updateBiography', $biography->getAllData(), 'biographyId', ['markupFormat' => $markupFormat]); - } - - public function deleteBiography(string $biographyId): string - { - return $this->mutation('deleteBiography', ['biographyId' => $biographyId], 'biographyId'); - } - - public function createBookReview(BookReview $bookReview, ?string $markupFormat = null): string - { - return $this->mutation('createBookReview', $bookReview->getAllData(), 'bookReviewId', ['markupFormat' => $markupFormat]); - } - - public function updateBookReview(BookReview $bookReview, ?string $markupFormat = null): string - { - return $this->mutation('updateBookReview', $bookReview->getAllData(), 'bookReviewId', ['markupFormat' => $markupFormat]); - } - - public function deleteBookReview(string $bookReviewId): string - { - return $this->mutation('deleteBookReview', ['bookReviewId' => $bookReviewId], 'bookReviewId'); - } - - public function createContact(Contact $contact): string - { - return $this->mutation('createContact', $contact->getAllData(), 'contactId'); - } - - public function updateContact(Contact $contact): string - { - return $this->mutation('updateContact', $contact->getAllData(), 'contactId'); - } - - public function deleteContact(string $contactId): string - { - return $this->mutation('deleteContact', ['contactId' => $contactId], 'contactId'); - } - - public function createContribution(Contribution $contribution): string - { - return $this->mutation('createContribution', $contribution->getAllData(), 'contributionId'); - } - - public function updateContribution(Contribution $contribution): string - { - return $this->mutation('updateContribution', $contribution->getAllData(), 'contributionId'); - } - - public function deleteContribution(string $contributionId): string - { - return $this->mutation('deleteContribution', ['contributionId' => $contributionId], 'contributionId'); - } - - public function createContributor(Contributor $contributor): string - { - return $this->mutation('createContributor', $contributor->getAllData(), 'contributorId'); - } - - public function updateContributor(Contributor $contributor): string - { - return $this->mutation('updateContributor', $contributor->getAllData(), 'contributorId'); - } - - public function deleteContributor(string $contributorId): string - { - return $this->mutation('deleteContributor', ['contributorId' => $contributorId], 'contributorId'); - } - - public function createEndorsement(Endorsement $endorsement, ?string $markupFormat = null): string - { - return $this->mutation( - 'createEndorsement', - $endorsement->getAllData(), - 'endorsementId', - ['markupFormat' => $markupFormat] - ); - } - - public function updateEndorsement(Endorsement $endorsement, ?string $markupFormat = null): string - { - return $this->mutation( - 'updateEndorsement', - $endorsement->getAllData(), - 'endorsementId', - ['markupFormat' => $markupFormat] - ); - } - - public function deleteEndorsement(string $endorsementId): string - { - return $this->mutation('deleteEndorsement', ['endorsementId' => $endorsementId], 'endorsementId'); - } - - public function createFunding(Funding $funding): string - { - return $this->mutation('createFunding', $funding->getAllData(), 'fundingId'); - } - - public function updateFunding(Funding $funding): string - { - return $this->mutation('updateFunding', $funding->getAllData(), 'fundingId'); - } - - public function deleteFunding(string $fundingId): string - { - return $this->mutation('deleteFunding', ['fundingId' => $fundingId], 'fundingId'); - } - - public function createImprint(Imprint $imprint): string - { - return $this->mutation('createImprint', $imprint->getAllData(), 'imprintId'); - } - - public function updateImprint(Imprint $imprint): string - { - return $this->mutation('updateImprint', $imprint->getAllData(), 'imprintId'); - } - - public function deleteImprint(string $imprintId): string - { - return $this->mutation('deleteImprint', ['imprintId' => $imprintId], 'imprintId'); - } - - public function createInstitution(Institution $institution): string - { - return $this->mutation('createInstitution', $institution->getAllData(), 'institutionId'); - } - - public function updateInstitution(Institution $institution): string - { - return $this->mutation('updateInstitution', $institution->getAllData(), 'institutionId'); - } - - public function deleteInstitution(string $institutionId): string - { - return $this->mutation('deleteInstitution', ['institutionId' => $institutionId], 'institutionId'); - } - - public function createIssue(Issue $issue): string - { - return $this->mutation('createIssue', $issue->getAllData(), 'issueId'); - } - - public function updateIssue(Issue $issue): string - { - return $this->mutation('updateIssue', $issue->getAllData(), 'issueId'); - } - - public function deleteIssue(string $issueId): string - { - return $this->mutation('deleteIssue', ['issueId' => $issueId], 'issueId'); - } - - public function createLanguage(Language $language): string - { - return $this->mutation('createLanguage', $language->getAllData(), 'languageId'); - } - - public function updateLanguage(Language $language): string - { - return $this->mutation('updateLanguage', $language->getAllData(), 'languageId'); - } - - public function deleteLanguage(string $languageId): string - { - return $this->mutation('deleteLanguage', ['languageId' => $languageId], 'languageId'); - } - - public function createLocation(Location $location): string - { - return $this->mutation('createLocation', $location->getAllData(), 'locationId'); - } - - public function updateLocation(Location $location): string - { - return $this->mutation('updateLocation', $location->getAllData(), 'locationId'); - } - - public function deleteLocation(string $locationId): string - { - return $this->mutation('deleteLocation', ['locationId' => $locationId], 'locationId'); - } - - public function createPrice(Price $price): string - { - return $this->mutation('createPrice', $price->getAllData(), 'priceId'); - } - - public function updatePrice(Price $price): string - { - return $this->mutation('updatePrice', $price->getAllData(), 'priceId'); - } - - public function deletePrice(string $priceId): string - { - return $this->mutation('deletePrice', ['priceId' => $priceId], 'priceId'); - } - - public function createPublication(Publication $publication): string - { - return $this->mutation('createPublication', $publication->getAllData(), 'publicationId'); - } - - public function updatePublication(Publication $publication): string - { - return $this->mutation('updatePublication', $publication->getAllData(), 'publicationId'); - } - - public function deletePublication(string $publicationId): string - { - return $this->mutation('deletePublication', ['publicationId' => $publicationId], 'publicationId'); - } - - public function createPublisher(Publisher $publisher): string - { - return $this->mutation('createPublisher', $publisher->getAllData(), 'publisherId'); - } - - public function updatePublisher(Publisher $publisher): string - { - return $this->mutation('updatePublisher', $publisher->getAllData(), 'publisherId'); - } - - public function deletePublisher(string $publisherId): string - { - return $this->mutation('deletePublisher', ['publisherId' => $publisherId], 'publisherId'); - } - - public function createReference(Reference $reference): string - { - return $this->mutation('createReference', $reference->getAllData(), 'referenceId'); - } - - public function updateReference(Reference $reference): string - { - return $this->mutation('updateReference', $reference->getAllData(), 'referenceId'); - } - - public function deleteReference(string $referenceId): string - { - return $this->mutation('deleteReference', ['referenceId' => $referenceId], 'referenceId'); - } - - public function createSeries(Series $series): string - { - return $this->mutation('createSeries', $series->getAllData(), 'seriesId'); - } - - public function updateSeries(Series $series): string - { - return $this->mutation('updateSeries', $series->getAllData(), 'seriesId'); - } - - public function deleteSeries(string $seriesId): string - { - return $this->mutation('deleteSeries', ['seriesId' => $seriesId], 'seriesId'); - } - - public function createSubject(Subject $subject): string - { - return $this->mutation('createSubject', $subject->getAllData(), 'subjectId'); - } - - public function updateSubject(Subject $subject): string - { - return $this->mutation('updateSubject', $subject->getAllData(), 'subjectId'); - } - - public function deleteSubject(string $subjectId): string - { - return $this->mutation('deleteSubject', ['subjectId' => $subjectId], 'subjectId'); - } - - public function createTitle(Title $title, ?string $markupFormat = null): string - { - return $this->mutation('createTitle', $title->getAllData(), 'titleId', ['markupFormat' => $markupFormat]); - } - - public function updateTitle(Title $title, ?string $markupFormat = null): string - { - return $this->mutation('updateTitle', $title->getAllData(), 'titleId', ['markupFormat' => $markupFormat]); - } - - public function deleteTitle(string $titleId): string - { - return $this->mutation('deleteTitle', ['titleId' => $titleId], 'titleId'); - } - - public function createWork(Work $work): string - { - return $this->mutation('createWork', $work->getAllData(), 'workId'); - } - - public function updateWork(Work $work): string - { - return $this->mutation('updateWork', $work->getAllData(), 'workId'); - } - - public function deleteWork(string $workId): string - { - return $this->mutation('deleteWork', ['workId' => $workId], 'workId'); - } - - public function createWorkFeaturedVideo(WorkFeaturedVideo $workFeaturedVideo): string - { - return $this->mutation('createWorkFeaturedVideo', $workFeaturedVideo->getAllData(), 'workFeaturedVideoId'); - } - - public function updateWorkFeaturedVideo(WorkFeaturedVideo $workFeaturedVideo): string - { - return $this->mutation('updateWorkFeaturedVideo', $workFeaturedVideo->getAllData(), 'workFeaturedVideoId'); - } - - public function deleteWorkFeaturedVideo(string $workFeaturedVideoId): string - { - return $this->mutation('deleteWorkFeaturedVideo', ['workFeaturedVideoId' => $workFeaturedVideoId], 'workFeaturedVideoId'); - } - - public function createWorkRelation(WorkRelation $workRelation): string - { - return $this->mutation('createWorkRelation', $workRelation->getAllData(), 'workRelationId'); - } - - public function updateWorkRelation(WorkRelation $workRelation): string - { - return $this->mutation('updateWorkRelation', $workRelation->getAllData(), 'workRelationId'); - } - - public function deleteWorkRelation(string $workRelationId): string - { - return $this->mutation('deleteWorkRelation', ['workRelationId' => $workRelationId], 'workRelationId'); - } - - public function moveAffiliation(string $affiliationId, int $newOrdinal): string - { - return $this->mutation('moveAffiliation', compact('affiliationId', 'newOrdinal'), 'affiliationId'); - } - - public function moveContribution(string $contributionId, int $newOrdinal): string - { - return $this->mutation('moveContribution', compact('contributionId', 'newOrdinal'), 'contributionId'); - } - - public function moveIssue(string $issueId, int $newOrdinal): string - { - return $this->mutation('moveIssue', compact('issueId', 'newOrdinal'), 'issueId'); - } - - public function moveReference(string $referenceId, int $newOrdinal): string - { - return $this->mutation('moveReference', compact('referenceId', 'newOrdinal'), 'referenceId'); - } - - public function moveAdditionalResource(string $additionalResourceId, int $newOrdinal): string - { - return $this->mutation('moveAdditionalResource', compact('additionalResourceId', 'newOrdinal'), 'workResourceId'); - } - - public function moveAward(string $awardId, int $newOrdinal): string - { - return $this->mutation('moveAward', compact('awardId', 'newOrdinal'), 'awardId'); - } - - public function moveEndorsement(string $endorsementId, int $newOrdinal): string - { - return $this->mutation('moveEndorsement', compact('endorsementId', 'newOrdinal'), 'endorsementId'); - } - - public function moveBookReview(string $bookReviewId, int $newOrdinal): string - { - return $this->mutation('moveBookReview', compact('bookReviewId', 'newOrdinal'), 'bookReviewId'); - } - - public function moveSubject(string $subjectId, int $newOrdinal): string - { - return $this->mutation('moveSubject', compact('subjectId', 'newOrdinal'), 'subjectId'); - } - - public function moveWorkRelation(string $workRelationId, int $newOrdinal): string - { - return $this->mutation('moveWorkRelation', compact('workRelationId', 'newOrdinal'), 'workRelationId'); - } - - public function initPublicationFileUpload(array $data): FileUploadResponse - { - return new FileUploadResponse($this->runMutation('initPublicationFileUpload', $data)); - } - - public function initFrontcoverFileUpload(array $data): FileUploadResponse - { - return new FileUploadResponse($this->runMutation('initFrontcoverFileUpload', $data)); - } - - public function initAdditionalResourceFileUpload(array $data): FileUploadResponse - { - return new FileUploadResponse($this->runMutation('initAdditionalResourceFileUpload', $data)); - } - - public function initWorkFeaturedVideoFileUpload(array $data): FileUploadResponse - { - return new FileUploadResponse($this->runMutation('initWorkFeaturedVideoFileUpload', $data)); - } - - public function completeFileUpload(array $data): File - { - return new File($this->runMutation('completeFileUpload', $data)); - } -} diff --git a/src/GraphQL/Concerns/HasQueryOperations.php b/src/GraphQL/Concerns/HasQueryOperations.php deleted file mode 100644 index c5e1d09..0000000 --- a/src/GraphQL/Concerns/HasQueryOperations.php +++ /dev/null @@ -1,447 +0,0 @@ -get('additionalResource', $additionalResourceId); - } - - public function additionalResources(array $args = []): array - { - return $this->getMany('additionalResource', $args); - } - - public function additionalResourceCount(): int - { - return $this->count('additionalResource'); - } - - public function affiliation(string $affiliationId): Affiliation - { - return $this->get('affiliation', $affiliationId); - } - - public function affiliations(array $args = []): array - { - return $this->getMany('affiliation', $args); - } - - public function affiliationCount(): int - { - return $this->count('affiliation'); - } - - public function abstract(string $abstractId, ?string $markupFormat = null): AbstractText - { - return $this->get('abstract', $abstractId, ['markupFormat' => $markupFormat]); - } - - public function abstracts(array $args = []): array - { - return $this->getMany('abstract', $args); - } - - public function award(string $awardId): Award - { - return $this->get('award', $awardId); - } - - public function awards(array $args = []): array - { - return $this->getMany('award', $args); - } - - public function awardCount(): int - { - return $this->count('award'); - } - - public function biography(string $biographyId, ?string $markupFormat = null): Biography - { - return $this->get('biography', $biographyId, ['markupFormat' => $markupFormat]); - } - - public function biographies(array $args = []): array - { - return $this->getMany('biography', $args); - } - - public function books(array $args = []): array - { - return $this->getMany('book', $args); - } - - public function bookByDoi(string $doi): Work - { - return $this->getByDoi('book', $doi); - } - - public function bookCount(array $args = []): int - { - return $this->count('book', $args); - } - - public function bookReview(string $bookReviewId): BookReview - { - return $this->get('bookReview', $bookReviewId); - } - - public function bookReviews(array $args = []): array - { - return $this->getMany('bookReview', $args); - } - - public function bookReviewCount(): int - { - return $this->count('bookReview'); - } - - public function chapters(array $args = []): array - { - return $this->getMany('chapter', $args); - } - - public function chapterByDoi(string $doi): Work - { - return $this->getByDoi('chapter', $doi); - } - - public function chapterCount(array $args = []): int - { - return $this->count('chapter', $args); - } - - public function contact(string $contactId): Contact - { - return $this->get('contact', $contactId); - } - - public function contacts(array $args = []): array - { - return $this->getMany('contact', $args); - } - - public function contactCount(array $args = []): int - { - return $this->count('contact', $args); - } - - public function contribution(string $contributionId): Contribution - { - return $this->get('contribution', $contributionId); - } - - public function contributions(array $args = []): array - { - return $this->getMany('contribution', $args); - } - - public function contributionCount(array $args = []): int - { - return $this->count('contribution', $args); - } - - public function contributor(string $contributorId): Contributor - { - return $this->get('contributor', $contributorId); - } - - public function contributors(array $args = []): array - { - return $this->getMany('contributor', $args); - } - - public function contributorCount(array $args = []): int - { - return $this->count('contributor', $args); - } - - public function endorsement(string $endorsementId): Endorsement - { - return $this->get('endorsement', $endorsementId); - } - - public function endorsements(array $args = []): array - { - return $this->getMany('endorsement', $args); - } - - public function endorsementCount(): int - { - return $this->count('endorsement'); - } - - public function file(string $fileId): File - { - return $this->get('file', $fileId); - } - - public function funding(string $fundingId): Funding - { - return $this->get('funding', $fundingId); - } - - public function fundings(array $args = []): array - { - return $this->getMany('funding', $args); - } - - public function fundingCount(): int - { - return $this->count('funding'); - } - - public function imprint(string $imprintId): Imprint - { - return $this->get('imprint', $imprintId); - } - - public function imprints(array $args = [], bool $includeRestrictedFields = false): array - { - if (!$includeRestrictedFields) { - return $this->getMany('imprint', $args); - } - - $query = (new ImprintQuery())->getManyQueryWithRestrictedFields(true); - $result = $this->runGraphqlQuery($query, array_filter($args, fn ($value) => $value !== null))->getData(); - return array_map(fn ($data) => new Imprint($data), $result['imprints']); - } - - public function imprintCount(array $args = []): int - { - return $this->count('imprint', $args); - } - - public function institution(string $institutionId): Institution - { - return $this->get('institution', $institutionId); - } - - public function institutions(array $args = []): array - { - return $this->getMany('institution', $args); - } - - public function institutionCount(array $args = []): int - { - return $this->count('institution', $args); - } - - public function issue(string $issueId): Issue - { - return $this->get('issue', $issueId); - } - - public function issues(array $args = []): array - { - return $this->getMany('issue', $args); - } - - public function issueCount(): int - { - return $this->count('issue'); - } - - public function language(string $languageId): Language - { - return $this->get('language', $languageId); - } - - public function languages(array $args = []): array - { - return $this->getMany('language', $args); - } - - public function languageCount(array $args = []): int - { - return $this->count('language', $args); - } - - public function location(string $locationId): Location - { - return $this->get('location', $locationId); - } - - public function locations(array $args = []): array - { - return $this->getMany('location', $args); - } - - public function locationCount(array $args = []): int - { - return $this->count('location', $args); - } - - public function me(): Me - { - $result = $this->query('me', [], $this->token); - return new Me($result['me']); - } - - public function price(string $priceId): Price - { - return $this->get('price', $priceId); - } - - public function prices(array $args = []): array - { - return $this->getMany('price', $args); - } - - public function priceCount(array $args = []): int - { - return $this->count('price', $args); - } - - public function publication(string $publicationId): Publication - { - return $this->get('publication', $publicationId); - } - - public function publications(array $args = []): array - { - return $this->getMany('publication', $args); - } - - public function publicationCount(array $args = []): int - { - return $this->count('publication', $args); - } - - public function publisher(string $publisherId): Publisher - { - return $this->get('publisher', $publisherId); - } - - public function publishers(array $args = []): array - { - return $this->getMany('publisher', $args); - } - - public function publisherCount(array $args = []): int - { - return $this->count('publisher', $args); - } - - public function reference(string $referenceId): Reference - { - return $this->get('reference', $referenceId); - } - - public function references(array $args = []): array - { - return $this->getMany('reference', $args); - } - - public function referenceCount(): int - { - return $this->count('reference'); - } - - public function series(string $seriesId): Series - { - return $this->get('series', $seriesId); - } - - public function serieses(array $args = []): array - { - return $this->getMany('series', $args); - } - - public function seriesCount(array $args = []): int - { - return $this->count('series', $args); - } - - public function subject(string $subjectId): Subject - { - return $this->get('subject', $subjectId); - } - - public function subjects(array $args = []): array - { - return $this->getMany('subject', $args); - } - - public function subjectCount(array $args = []): int - { - return $this->count('subject', $args); - } - - public function title(string $titleId, ?string $markupFormat = null): Title - { - return $this->get('title', $titleId, ['markupFormat' => $markupFormat]); - } - - public function titles(array $args = []): array - { - return $this->getMany('title', $args); - } - - public function work(string $workId): Work - { - return $this->get('work', $workId); - } - - public function works(array $args = []): array - { - return $this->getMany('work', $args); - } - - public function workByDoi(string $doi): Work - { - return $this->getByDoi('work', $doi); - } - - public function workCount(array $args = []): int - { - return $this->count('work', $args); - } - - public function workFeaturedVideo(string $workFeaturedVideoId): WorkFeaturedVideo - { - return $this->get('workFeaturedVideo', $workFeaturedVideoId); - } - - public function workFeaturedVideos(array $args = []): array - { - return $this->getMany('workFeaturedVideo', $args); - } - - public function workFeaturedVideoCount(): int - { - return $this->count('workFeaturedVideo'); - } -} diff --git a/src/GraphQL/Definition/ArgumentDefinition.php b/src/GraphQL/Definition/ArgumentDefinition.php new file mode 100644 index 0000000..e3d85c8 --- /dev/null +++ b/src/GraphQL/Definition/ArgumentDefinition.php @@ -0,0 +1,56 @@ +name = $name; + $this->type = $type; + $this->description = $description; + $this->defaultValue = $defaultValue; + } + + public static function fromIntrospection(array $argument): self + { + return new self( + $argument['name'], + TypeReference::fromIntrospection($argument['type']), + $argument['description'] ?? null, + $argument['defaultValue'] ?? null + ); + } + + public function getName(): string + { + return $this->name; + } + + public function getType(): TypeReference + { + return $this->type; + } + + public function getDescription(): ?string + { + return $this->description; + } + + public function getDefaultValue(): ?string + { + return $this->defaultValue; + } +} diff --git a/src/GraphQL/Definition/EnumTypeDefinition.php b/src/GraphQL/Definition/EnumTypeDefinition.php new file mode 100644 index 0000000..7c88e51 --- /dev/null +++ b/src/GraphQL/Definition/EnumTypeDefinition.php @@ -0,0 +1,26 @@ +name = $name; + $this->values = $values; + } + + public function getName(): string + { + return $this->name; + } + + public function getValues(): array + { + return $this->values; + } +} diff --git a/src/GraphQL/Definition/FieldDefinition.php b/src/GraphQL/Definition/FieldDefinition.php new file mode 100644 index 0000000..c78a806 --- /dev/null +++ b/src/GraphQL/Definition/FieldDefinition.php @@ -0,0 +1,63 @@ +name = $name; + $this->type = $type; + $this->arguments = $arguments; + $this->description = $description; + } + + public static function fromIntrospection(array $field): self + { + $arguments = array_map( + static function (array $argument): ArgumentDefinition { + return ArgumentDefinition::fromIntrospection($argument); + }, + $field['args'] ?? [] + ); + + return new self( + $field['name'], + TypeReference::fromIntrospection($field['type']), + $arguments, + $field['description'] ?? null + ); + } + + public function getName(): string + { + return $this->name; + } + + public function getType(): TypeReference + { + return $this->type; + } + + public function getArguments(): array + { + return $this->arguments; + } + + public function getDescription(): ?string + { + return $this->description; + } +} diff --git a/src/GraphQL/Definition/InputObjectTypeDefinition.php b/src/GraphQL/Definition/InputObjectTypeDefinition.php new file mode 100644 index 0000000..bcf8619 --- /dev/null +++ b/src/GraphQL/Definition/InputObjectTypeDefinition.php @@ -0,0 +1,26 @@ +name = $name; + $this->fields = $fields; + } + + public function getName(): string + { + return $this->name; + } + + public function getFields(): array + { + return $this->fields; + } +} diff --git a/src/GraphQL/Definition/ObjectTypeDefinition.php b/src/GraphQL/Definition/ObjectTypeDefinition.php new file mode 100644 index 0000000..99e0ee1 --- /dev/null +++ b/src/GraphQL/Definition/ObjectTypeDefinition.php @@ -0,0 +1,26 @@ +name = $name; + $this->fields = $fields; + } + + public function getName(): string + { + return $this->name; + } + + public function getFields(): array + { + return $this->fields; + } +} diff --git a/src/GraphQL/Definition/ScalarTypeDefinition.php b/src/GraphQL/Definition/ScalarTypeDefinition.php new file mode 100644 index 0000000..f32cb89 --- /dev/null +++ b/src/GraphQL/Definition/ScalarTypeDefinition.php @@ -0,0 +1,26 @@ +name = $name; + $this->description = $description; + } + + public function getName(): string + { + return $this->name; + } + + public function getDescription(): ?string + { + return $this->description; + } +} diff --git a/src/GraphQL/Definition/TypeReference.php b/src/GraphQL/Definition/TypeReference.php new file mode 100644 index 0000000..6464807 --- /dev/null +++ b/src/GraphQL/Definition/TypeReference.php @@ -0,0 +1,84 @@ +kind = $kind; + $this->name = $name; + $this->ofType = $ofType; + } + + public static function named(string $name): self + { + return new self('NAMED', $name); + } + + public static function listOf(self $ofType): self + { + return new self('LIST', null, $ofType); + } + + public static function nonNull(self $ofType): self + { + return new self('NON_NULL', null, $ofType); + } + + public static function fromIntrospection(array $type): self + { + if (isset($type['ofType']) && is_array($type['ofType'])) { + return new self($type['kind'], $type['name'] ?? null, self::fromIntrospection($type['ofType'])); + } + + if ($type['kind'] === 'LIST' || $type['kind'] === 'NON_NULL') { + return new self($type['kind'], $type['name'] ?? null); + } + + return self::named($type['name']); + } + + public function getKind(): string + { + return $this->kind; + } + + public function getName(): ?string + { + return $this->name; + } + + public function getOfType(): ?self + { + return $this->ofType; + } + + public function toGraphQL(): string + { + if ($this->kind === 'NON_NULL') { + return ($this->ofType ? $this->ofType->toGraphQL() : '') . '!'; + } + + if ($this->kind === 'LIST') { + return '[' . ($this->ofType ? $this->ofType->toGraphQL() : '') . ']'; + } + + return (string) $this->name; + } + + public function baseName(): ?string + { + if ($this->name !== null) { + return $this->name; + } + + return $this->ofType ? $this->ofType->baseName() : null; + } +} diff --git a/src/GraphQL/EnumValue.php b/src/GraphQL/EnumValue.php new file mode 100644 index 0000000..e331599 --- /dev/null +++ b/src/GraphQL/EnumValue.php @@ -0,0 +1,18 @@ +value = $value; + } + + public function __toString(): string + { + return $this->value; + } +} diff --git a/src/GraphQL/Enums/AbstractField.php b/src/GraphQL/Enums/AbstractField.php new file mode 100644 index 0000000..7db3f66 --- /dev/null +++ b/src/GraphQL/Enums/AbstractField.php @@ -0,0 +1,33 @@ +data = $data; + } + + public function getAllData(): array + { + return $this->data; + } + + protected function get(string $field) + { + return $this->data[$field] ?? null; + } + + protected function set(string $field, $value): self + { + $this->data[$field] = $value; + return $this; + } + + protected function has(string $field): bool + { + return array_key_exists($field, $this->data); + } + + protected function remove(string $field): self + { + unset($this->data[$field]); + return $this; + } +} diff --git a/src/GraphQL/Inputs/AbstractOrderBy.php b/src/GraphQL/Inputs/AbstractOrderBy.php new file mode 100644 index 0000000..2dc4765 --- /dev/null +++ b/src/GraphQL/Inputs/AbstractOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('AbstractOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'AbstractField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/AdditionalResourceOrderBy.php b/src/GraphQL/Inputs/AdditionalResourceOrderBy.php new file mode 100644 index 0000000..9e9a808 --- /dev/null +++ b/src/GraphQL/Inputs/AdditionalResourceOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('AdditionalResourceOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'AdditionalResourceField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/AffiliationOrderBy.php b/src/GraphQL/Inputs/AffiliationOrderBy.php new file mode 100644 index 0000000..428933d --- /dev/null +++ b/src/GraphQL/Inputs/AffiliationOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('AffiliationOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'AffiliationField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/AwardOrderBy.php b/src/GraphQL/Inputs/AwardOrderBy.php new file mode 100644 index 0000000..a42facc --- /dev/null +++ b/src/GraphQL/Inputs/AwardOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('AwardOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'AwardField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/BiographyOrderBy.php b/src/GraphQL/Inputs/BiographyOrderBy.php new file mode 100644 index 0000000..1b9573a --- /dev/null +++ b/src/GraphQL/Inputs/BiographyOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('BiographyOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'BiographyField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/BookReviewOrderBy.php b/src/GraphQL/Inputs/BookReviewOrderBy.php new file mode 100644 index 0000000..a3ff507 --- /dev/null +++ b/src/GraphQL/Inputs/BookReviewOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('BookReviewOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'BookReviewField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/CompleteFileUpload.php b/src/GraphQL/Inputs/CompleteFileUpload.php new file mode 100644 index 0000000..8cdbf93 --- /dev/null +++ b/src/GraphQL/Inputs/CompleteFileUpload.php @@ -0,0 +1,57 @@ +get('fileUploadId'); + } + + /** + * @param string $value + */ + public function setFileUploadId($value): self + { + $this->set('fileUploadId', $value); + return $this; + } + + public function hasFileUploadId(): bool + { + return $this->has('fileUploadId'); + } + + public function unsetFileUploadId(): self + { + $this->remove('fileUploadId'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('CompleteFileUpload', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'fileUploadId', + 'description' => 'ID of the upload session to complete.', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/ContactOrderBy.php b/src/GraphQL/Inputs/ContactOrderBy.php new file mode 100644 index 0000000..7937c25 --- /dev/null +++ b/src/GraphQL/Inputs/ContactOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('ContactOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ContactField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/ContributionOrderBy.php b/src/GraphQL/Inputs/ContributionOrderBy.php new file mode 100644 index 0000000..4fa3509 --- /dev/null +++ b/src/GraphQL/Inputs/ContributionOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('ContributionOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ContributionField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/ContributorOrderBy.php b/src/GraphQL/Inputs/ContributorOrderBy.php new file mode 100644 index 0000000..2a77e9b --- /dev/null +++ b/src/GraphQL/Inputs/ContributorOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('ContributorOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ContributorField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/EndorsementOrderBy.php b/src/GraphQL/Inputs/EndorsementOrderBy.php new file mode 100644 index 0000000..f021d96 --- /dev/null +++ b/src/GraphQL/Inputs/EndorsementOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('EndorsementOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'EndorsementField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/FundingOrderBy.php b/src/GraphQL/Inputs/FundingOrderBy.php new file mode 100644 index 0000000..d0bcbab --- /dev/null +++ b/src/GraphQL/Inputs/FundingOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('FundingOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'FundingField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/ImprintOrderBy.php b/src/GraphQL/Inputs/ImprintOrderBy.php new file mode 100644 index 0000000..8eeeaaa --- /dev/null +++ b/src/GraphQL/Inputs/ImprintOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('ImprintOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ImprintField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/InstitutionOrderBy.php b/src/GraphQL/Inputs/InstitutionOrderBy.php new file mode 100644 index 0000000..5983529 --- /dev/null +++ b/src/GraphQL/Inputs/InstitutionOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('InstitutionOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'InstitutionField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/IssueOrderBy.php b/src/GraphQL/Inputs/IssueOrderBy.php new file mode 100644 index 0000000..a806805 --- /dev/null +++ b/src/GraphQL/Inputs/IssueOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('IssueOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'IssueField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/LanguageOrderBy.php b/src/GraphQL/Inputs/LanguageOrderBy.php new file mode 100644 index 0000000..1ed65c9 --- /dev/null +++ b/src/GraphQL/Inputs/LanguageOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('LanguageOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LanguageField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/LocationOrderBy.php b/src/GraphQL/Inputs/LocationOrderBy.php new file mode 100644 index 0000000..2fddb1c --- /dev/null +++ b/src/GraphQL/Inputs/LocationOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('LocationOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocationField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewAbstract.php b/src/GraphQL/Inputs/NewAbstract.php new file mode 100644 index 0000000..549dd06 --- /dev/null +++ b/src/GraphQL/Inputs/NewAbstract.php @@ -0,0 +1,225 @@ +get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getContent() + { + return $this->get('content'); + } + + /** + * @param string $value + */ + public function setContent($value): self + { + $this->set('content', $value); + return $this; + } + + public function hasContent(): bool + { + return $this->has('content'); + } + + public function unsetContent(): self + { + $this->remove('content'); + return $this; + } + + /** + * @return string + */ + public function getLocaleCode() + { + return $this->get('localeCode'); + } + + /** + * @param string $value + */ + public function setLocaleCode($value): self + { + $this->set('localeCode', $value); + return $this; + } + + public function hasLocaleCode(): bool + { + return $this->has('localeCode'); + } + + public function unsetLocaleCode(): self + { + $this->remove('localeCode'); + return $this; + } + + /** + * @return string + */ + public function getAbstractType() + { + return $this->get('abstractType'); + } + + /** + * @param string $value + */ + public function setAbstractType($value): self + { + $this->set('abstractType', $value); + return $this; + } + + public function hasAbstractType(): bool + { + return $this->has('abstractType'); + } + + public function unsetAbstractType(): self + { + $this->remove('abstractType'); + return $this; + } + + /** + * @return bool + */ + public function getCanonical() + { + return $this->get('canonical'); + } + + /** + * @param bool $value + */ + public function setCanonical($value): self + { + $this->set('canonical', $value); + return $this; + } + + public function hasCanonical(): bool + { + return $this->has('canonical'); + } + + public function unsetCanonical(): self + { + $this->remove('canonical'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewAbstract', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'content', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'localeCode', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocaleCode', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'abstractType', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'AbstractType', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'canonical', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Boolean', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewAdditionalResource.php b/src/GraphQL/Inputs/NewAdditionalResource.php new file mode 100644 index 0000000..74312ec --- /dev/null +++ b/src/GraphQL/Inputs/NewAdditionalResource.php @@ -0,0 +1,411 @@ +get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getTitle() + { + return $this->get('title'); + } + + /** + * @param string $value + */ + public function setTitle($value): self + { + $this->set('title', $value); + return $this; + } + + public function hasTitle(): bool + { + return $this->has('title'); + } + + public function unsetTitle(): self + { + $this->remove('title'); + return $this; + } + + /** + * @return string|null + */ + public function getDescription() + { + return $this->get('description'); + } + + /** + * @param string|null $value + */ + public function setDescription($value): self + { + $this->set('description', $value); + return $this; + } + + public function hasDescription(): bool + { + return $this->has('description'); + } + + public function unsetDescription(): self + { + $this->remove('description'); + return $this; + } + + /** + * @return string|null + */ + public function getAttribution() + { + return $this->get('attribution'); + } + + /** + * @param string|null $value + */ + public function setAttribution($value): self + { + $this->set('attribution', $value); + return $this; + } + + public function hasAttribution(): bool + { + return $this->has('attribution'); + } + + public function unsetAttribution(): self + { + $this->remove('attribution'); + return $this; + } + + /** + * @return string + */ + public function getResourceType() + { + return $this->get('resourceType'); + } + + /** + * @param string $value + */ + public function setResourceType($value): self + { + $this->set('resourceType', $value); + return $this; + } + + public function hasResourceType(): bool + { + return $this->has('resourceType'); + } + + public function unsetResourceType(): self + { + $this->remove('resourceType'); + return $this; + } + + /** + * @return string|null + */ + public function getDoi() + { + return $this->get('doi'); + } + + /** + * @param string|null $value + */ + public function setDoi($value): self + { + $this->set('doi', $value); + return $this; + } + + public function hasDoi(): bool + { + return $this->has('doi'); + } + + public function unsetDoi(): self + { + $this->remove('doi'); + return $this; + } + + /** + * @return string|null + */ + public function getHandle() + { + return $this->get('handle'); + } + + /** + * @param string|null $value + */ + public function setHandle($value): self + { + $this->set('handle', $value); + return $this; + } + + public function hasHandle(): bool + { + return $this->has('handle'); + } + + public function unsetHandle(): self + { + $this->remove('handle'); + return $this; + } + + /** + * @return string|null + */ + public function getUrl() + { + return $this->get('url'); + } + + /** + * @param string|null $value + */ + public function setUrl($value): self + { + $this->set('url', $value); + return $this; + } + + public function hasUrl(): bool + { + return $this->has('url'); + } + + public function unsetUrl(): self + { + $this->remove('url'); + return $this; + } + + /** + * @return string|null + */ + public function getDate() + { + return $this->get('date'); + } + + /** + * @param string|null $value + */ + public function setDate($value): self + { + $this->set('date', $value); + return $this; + } + + public function hasDate(): bool + { + return $this->has('date'); + } + + public function unsetDate(): self + { + $this->remove('date'); + return $this; + } + + /** + * @return int + */ + public function getResourceOrdinal() + { + return $this->get('resourceOrdinal'); + } + + /** + * @param int $value + */ + public function setResourceOrdinal($value): self + { + $this->set('resourceOrdinal', $value); + return $this; + } + + public function hasResourceOrdinal(): bool + { + return $this->has('resourceOrdinal'); + } + + public function unsetResourceOrdinal(): self + { + $this->remove('resourceOrdinal'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewAdditionalResource', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'title', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'description', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'attribution', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'resourceType', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ResourceType', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'doi', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'handle', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'url', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'date', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Date', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'resourceOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewAdditionalResourceFileUpload.php b/src/GraphQL/Inputs/NewAdditionalResourceFileUpload.php new file mode 100644 index 0000000..a5d894e --- /dev/null +++ b/src/GraphQL/Inputs/NewAdditionalResourceFileUpload.php @@ -0,0 +1,183 @@ +get('additionalResourceId'); + } + + /** + * @param string $value + */ + public function setAdditionalResourceId($value): self + { + $this->set('additionalResourceId', $value); + return $this; + } + + public function hasAdditionalResourceId(): bool + { + return $this->has('additionalResourceId'); + } + + public function unsetAdditionalResourceId(): self + { + $this->remove('additionalResourceId'); + return $this; + } + + /** + * @return string + */ + public function getDeclaredMimeType() + { + return $this->get('declaredMimeType'); + } + + /** + * @param string $value + */ + public function setDeclaredMimeType($value): self + { + $this->set('declaredMimeType', $value); + return $this; + } + + public function hasDeclaredMimeType(): bool + { + return $this->has('declaredMimeType'); + } + + public function unsetDeclaredMimeType(): self + { + $this->remove('declaredMimeType'); + return $this; + } + + /** + * @return string + */ + public function getDeclaredExtension() + { + return $this->get('declaredExtension'); + } + + /** + * @param string $value + */ + public function setDeclaredExtension($value): self + { + $this->set('declaredExtension', $value); + return $this; + } + + public function hasDeclaredExtension(): bool + { + return $this->has('declaredExtension'); + } + + public function unsetDeclaredExtension(): self + { + $this->remove('declaredExtension'); + return $this; + } + + /** + * @return string + */ + public function getDeclaredSha256() + { + return $this->get('declaredSha256'); + } + + /** + * @param string $value + */ + public function setDeclaredSha256($value): self + { + $this->set('declaredSha256', $value); + return $this; + } + + public function hasDeclaredSha256(): bool + { + return $this->has('declaredSha256'); + } + + public function unsetDeclaredSha256(): self + { + $this->remove('declaredSha256'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewAdditionalResourceFileUpload', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'additionalResourceId', + 'description' => 'Thoth ID of the additional resource linked to this file.', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'declaredMimeType', + 'description' => 'MIME type declared by the client (used for validation and in the presigned URL).', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'declaredExtension', + 'description' => 'File extension to use in the final canonical key, e.g. \'jpg\', \'png\', \'mp4\', \'xlsx\'.', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'declaredSha256', + 'description' => 'SHA-256 checksum of the file, hex-encoded.', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewAffiliation.php b/src/GraphQL/Inputs/NewAffiliation.php new file mode 100644 index 0000000..fb80a39 --- /dev/null +++ b/src/GraphQL/Inputs/NewAffiliation.php @@ -0,0 +1,179 @@ +get('contributionId'); + } + + /** + * @param string $value + */ + public function setContributionId($value): self + { + $this->set('contributionId', $value); + return $this; + } + + public function hasContributionId(): bool + { + return $this->has('contributionId'); + } + + public function unsetContributionId(): self + { + $this->remove('contributionId'); + return $this; + } + + /** + * @return string + */ + public function getInstitutionId() + { + return $this->get('institutionId'); + } + + /** + * @param string $value + */ + public function setInstitutionId($value): self + { + $this->set('institutionId', $value); + return $this; + } + + public function hasInstitutionId(): bool + { + return $this->has('institutionId'); + } + + public function unsetInstitutionId(): self + { + $this->remove('institutionId'); + return $this; + } + + /** + * @return int + */ + public function getAffiliationOrdinal() + { + return $this->get('affiliationOrdinal'); + } + + /** + * @param int $value + */ + public function setAffiliationOrdinal($value): self + { + $this->set('affiliationOrdinal', $value); + return $this; + } + + public function hasAffiliationOrdinal(): bool + { + return $this->has('affiliationOrdinal'); + } + + public function unsetAffiliationOrdinal(): self + { + $this->remove('affiliationOrdinal'); + return $this; + } + + /** + * @return string|null + */ + public function getPosition() + { + return $this->get('position'); + } + + /** + * @param string|null $value + */ + public function setPosition($value): self + { + $this->set('position', $value); + return $this; + } + + public function hasPosition(): bool + { + return $this->has('position'); + } + + public function unsetPosition(): self + { + $this->remove('position'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewAffiliation', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'contributionId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'institutionId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'affiliationOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'position', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewAward.php b/src/GraphQL/Inputs/NewAward.php new file mode 100644 index 0000000..2b46876 --- /dev/null +++ b/src/GraphQL/Inputs/NewAward.php @@ -0,0 +1,407 @@ +get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getTitle() + { + return $this->get('title'); + } + + /** + * @param string $value + */ + public function setTitle($value): self + { + $this->set('title', $value); + return $this; + } + + public function hasTitle(): bool + { + return $this->has('title'); + } + + public function unsetTitle(): self + { + $this->remove('title'); + return $this; + } + + /** + * @return string|null + */ + public function getUrl() + { + return $this->get('url'); + } + + /** + * @param string|null $value + */ + public function setUrl($value): self + { + $this->set('url', $value); + return $this; + } + + public function hasUrl(): bool + { + return $this->has('url'); + } + + public function unsetUrl(): self + { + $this->remove('url'); + return $this; + } + + /** + * @return string|null + */ + public function getCategory() + { + return $this->get('category'); + } + + /** + * @param string|null $value + */ + public function setCategory($value): self + { + $this->set('category', $value); + return $this; + } + + public function hasCategory(): bool + { + return $this->has('category'); + } + + public function unsetCategory(): self + { + $this->remove('category'); + return $this; + } + + /** + * @return string|null + */ + public function getYear() + { + return $this->get('year'); + } + + /** + * @param string|null $value + */ + public function setYear($value): self + { + $this->set('year', $value); + return $this; + } + + public function hasYear(): bool + { + return $this->has('year'); + } + + public function unsetYear(): self + { + $this->remove('year'); + return $this; + } + + /** + * @return string|null + */ + public function getJury() + { + return $this->get('jury'); + } + + /** + * @param string|null $value + */ + public function setJury($value): self + { + $this->set('jury', $value); + return $this; + } + + public function hasJury(): bool + { + return $this->has('jury'); + } + + public function unsetJury(): self + { + $this->remove('jury'); + return $this; + } + + /** + * @return string|null + */ + public function getCountry() + { + return $this->get('country'); + } + + /** + * @param string|null $value + */ + public function setCountry($value): self + { + $this->set('country', $value); + return $this; + } + + public function hasCountry(): bool + { + return $this->has('country'); + } + + public function unsetCountry(): self + { + $this->remove('country'); + return $this; + } + + /** + * @return string|null + */ + public function getPrizeStatement() + { + return $this->get('prizeStatement'); + } + + /** + * @param string|null $value + */ + public function setPrizeStatement($value): self + { + $this->set('prizeStatement', $value); + return $this; + } + + public function hasPrizeStatement(): bool + { + return $this->has('prizeStatement'); + } + + public function unsetPrizeStatement(): self + { + $this->remove('prizeStatement'); + return $this; + } + + /** + * @return string|null + */ + public function getRole() + { + return $this->get('role'); + } + + /** + * @param string|null $value + */ + public function setRole($value): self + { + $this->set('role', $value); + return $this; + } + + public function hasRole(): bool + { + return $this->has('role'); + } + + public function unsetRole(): self + { + $this->remove('role'); + return $this; + } + + /** + * @return int + */ + public function getAwardOrdinal() + { + return $this->get('awardOrdinal'); + } + + /** + * @param int $value + */ + public function setAwardOrdinal($value): self + { + $this->set('awardOrdinal', $value); + return $this; + } + + public function hasAwardOrdinal(): bool + { + return $this->has('awardOrdinal'); + } + + public function unsetAwardOrdinal(): self + { + $this->remove('awardOrdinal'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewAward', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'title', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'url', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'category', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'year', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'jury', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'country', + 'description' => null, + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'CountryCode', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'prizeStatement', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'role', + 'description' => null, + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'AwardRole', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'awardOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewBiography.php b/src/GraphQL/Inputs/NewBiography.php new file mode 100644 index 0000000..19b7010 --- /dev/null +++ b/src/GraphQL/Inputs/NewBiography.php @@ -0,0 +1,183 @@ +get('contributionId'); + } + + /** + * @param string $value + */ + public function setContributionId($value): self + { + $this->set('contributionId', $value); + return $this; + } + + public function hasContributionId(): bool + { + return $this->has('contributionId'); + } + + public function unsetContributionId(): self + { + $this->remove('contributionId'); + return $this; + } + + /** + * @return string + */ + public function getContent() + { + return $this->get('content'); + } + + /** + * @param string $value + */ + public function setContent($value): self + { + $this->set('content', $value); + return $this; + } + + public function hasContent(): bool + { + return $this->has('content'); + } + + public function unsetContent(): self + { + $this->remove('content'); + return $this; + } + + /** + * @return bool + */ + public function getCanonical() + { + return $this->get('canonical'); + } + + /** + * @param bool $value + */ + public function setCanonical($value): self + { + $this->set('canonical', $value); + return $this; + } + + public function hasCanonical(): bool + { + return $this->has('canonical'); + } + + public function unsetCanonical(): self + { + $this->remove('canonical'); + return $this; + } + + /** + * @return string + */ + public function getLocaleCode() + { + return $this->get('localeCode'); + } + + /** + * @param string $value + */ + public function setLocaleCode($value): self + { + $this->set('localeCode', $value); + return $this; + } + + public function hasLocaleCode(): bool + { + return $this->has('localeCode'); + } + + public function unsetLocaleCode(): self + { + $this->remove('localeCode'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewBiography', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'contributionId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'content', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'canonical', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Boolean', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'localeCode', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocaleCode', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewBookReview.php b/src/GraphQL/Inputs/NewBookReview.php new file mode 100644 index 0000000..6416907 --- /dev/null +++ b/src/GraphQL/Inputs/NewBookReview.php @@ -0,0 +1,593 @@ +get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string|null + */ + public function getTitle() + { + return $this->get('title'); + } + + /** + * @param string|null $value + */ + public function setTitle($value): self + { + $this->set('title', $value); + return $this; + } + + public function hasTitle(): bool + { + return $this->has('title'); + } + + public function unsetTitle(): self + { + $this->remove('title'); + return $this; + } + + /** + * @return string|null + */ + public function getAuthorName() + { + return $this->get('authorName'); + } + + /** + * @param string|null $value + */ + public function setAuthorName($value): self + { + $this->set('authorName', $value); + return $this; + } + + public function hasAuthorName(): bool + { + return $this->has('authorName'); + } + + public function unsetAuthorName(): self + { + $this->remove('authorName'); + return $this; + } + + /** + * @return string|null + */ + public function getReviewerOrcid() + { + return $this->get('reviewerOrcid'); + } + + /** + * @param string|null $value + */ + public function setReviewerOrcid($value): self + { + $this->set('reviewerOrcid', $value); + return $this; + } + + public function hasReviewerOrcid(): bool + { + return $this->has('reviewerOrcid'); + } + + public function unsetReviewerOrcid(): self + { + $this->remove('reviewerOrcid'); + return $this; + } + + /** + * @return string|null + */ + public function getReviewerInstitutionId() + { + return $this->get('reviewerInstitutionId'); + } + + /** + * @param string|null $value + */ + public function setReviewerInstitutionId($value): self + { + $this->set('reviewerInstitutionId', $value); + return $this; + } + + public function hasReviewerInstitutionId(): bool + { + return $this->has('reviewerInstitutionId'); + } + + public function unsetReviewerInstitutionId(): self + { + $this->remove('reviewerInstitutionId'); + return $this; + } + + /** + * @return string|null + */ + public function getUrl() + { + return $this->get('url'); + } + + /** + * @param string|null $value + */ + public function setUrl($value): self + { + $this->set('url', $value); + return $this; + } + + public function hasUrl(): bool + { + return $this->has('url'); + } + + public function unsetUrl(): self + { + $this->remove('url'); + return $this; + } + + /** + * @return string|null + */ + public function getDoi() + { + return $this->get('doi'); + } + + /** + * @param string|null $value + */ + public function setDoi($value): self + { + $this->set('doi', $value); + return $this; + } + + public function hasDoi(): bool + { + return $this->has('doi'); + } + + public function unsetDoi(): self + { + $this->remove('doi'); + return $this; + } + + /** + * @return string|null + */ + public function getReviewDate() + { + return $this->get('reviewDate'); + } + + /** + * @param string|null $value + */ + public function setReviewDate($value): self + { + $this->set('reviewDate', $value); + return $this; + } + + public function hasReviewDate(): bool + { + return $this->has('reviewDate'); + } + + public function unsetReviewDate(): self + { + $this->remove('reviewDate'); + return $this; + } + + /** + * @return string|null + */ + public function getJournalName() + { + return $this->get('journalName'); + } + + /** + * @param string|null $value + */ + public function setJournalName($value): self + { + $this->set('journalName', $value); + return $this; + } + + public function hasJournalName(): bool + { + return $this->has('journalName'); + } + + public function unsetJournalName(): self + { + $this->remove('journalName'); + return $this; + } + + /** + * @return string|null + */ + public function getJournalVolume() + { + return $this->get('journalVolume'); + } + + /** + * @param string|null $value + */ + public function setJournalVolume($value): self + { + $this->set('journalVolume', $value); + return $this; + } + + public function hasJournalVolume(): bool + { + return $this->has('journalVolume'); + } + + public function unsetJournalVolume(): self + { + $this->remove('journalVolume'); + return $this; + } + + /** + * @return string|null + */ + public function getJournalNumber() + { + return $this->get('journalNumber'); + } + + /** + * @param string|null $value + */ + public function setJournalNumber($value): self + { + $this->set('journalNumber', $value); + return $this; + } + + public function hasJournalNumber(): bool + { + return $this->has('journalNumber'); + } + + public function unsetJournalNumber(): self + { + $this->remove('journalNumber'); + return $this; + } + + /** + * @return string|null + */ + public function getJournalIssn() + { + return $this->get('journalIssn'); + } + + /** + * @param string|null $value + */ + public function setJournalIssn($value): self + { + $this->set('journalIssn', $value); + return $this; + } + + public function hasJournalIssn(): bool + { + return $this->has('journalIssn'); + } + + public function unsetJournalIssn(): self + { + $this->remove('journalIssn'); + return $this; + } + + /** + * @return string|null + */ + public function getPageRange() + { + return $this->get('pageRange'); + } + + /** + * @param string|null $value + */ + public function setPageRange($value): self + { + $this->set('pageRange', $value); + return $this; + } + + public function hasPageRange(): bool + { + return $this->has('pageRange'); + } + + public function unsetPageRange(): self + { + $this->remove('pageRange'); + return $this; + } + + /** + * @return string|null + */ + public function getText() + { + return $this->get('text'); + } + + /** + * @param string|null $value + */ + public function setText($value): self + { + $this->set('text', $value); + return $this; + } + + public function hasText(): bool + { + return $this->has('text'); + } + + public function unsetText(): self + { + $this->remove('text'); + return $this; + } + + /** + * @return int + */ + public function getReviewOrdinal() + { + return $this->get('reviewOrdinal'); + } + + /** + * @param int $value + */ + public function setReviewOrdinal($value): self + { + $this->set('reviewOrdinal', $value); + return $this; + } + + public function hasReviewOrdinal(): bool + { + return $this->has('reviewOrdinal'); + } + + public function unsetReviewOrdinal(): self + { + $this->remove('reviewOrdinal'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewBookReview', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'title', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'authorName', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'reviewerOrcid', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Orcid', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'reviewerInstitutionId', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'url', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'doi', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'reviewDate', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Date', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'journalName', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'journalVolume', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'journalNumber', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'journalIssn', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'pageRange', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'text', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'reviewOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewContact.php b/src/GraphQL/Inputs/NewContact.php new file mode 100644 index 0000000..bf82e03 --- /dev/null +++ b/src/GraphQL/Inputs/NewContact.php @@ -0,0 +1,141 @@ +get('publisherId'); + } + + /** + * @param string $value + */ + public function setPublisherId($value): self + { + $this->set('publisherId', $value); + return $this; + } + + public function hasPublisherId(): bool + { + return $this->has('publisherId'); + } + + public function unsetPublisherId(): self + { + $this->remove('publisherId'); + return $this; + } + + /** + * @return string + */ + public function getContactType() + { + return $this->get('contactType'); + } + + /** + * @param string $value + */ + public function setContactType($value): self + { + $this->set('contactType', $value); + return $this; + } + + public function hasContactType(): bool + { + return $this->has('contactType'); + } + + public function unsetContactType(): self + { + $this->remove('contactType'); + return $this; + } + + /** + * @return string + */ + public function getEmail() + { + return $this->get('email'); + } + + /** + * @param string $value + */ + public function setEmail($value): self + { + $this->set('email', $value); + return $this; + } + + public function hasEmail(): bool + { + return $this->has('email'); + } + + public function unsetEmail(): self + { + $this->remove('email'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewContact', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publisherId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'contactType', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ContactType', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'email', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewContribution.php b/src/GraphQL/Inputs/NewContribution.php new file mode 100644 index 0000000..28393ef --- /dev/null +++ b/src/GraphQL/Inputs/NewContribution.php @@ -0,0 +1,347 @@ +get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getContributorId() + { + return $this->get('contributorId'); + } + + /** + * @param string $value + */ + public function setContributorId($value): self + { + $this->set('contributorId', $value); + return $this; + } + + public function hasContributorId(): bool + { + return $this->has('contributorId'); + } + + public function unsetContributorId(): self + { + $this->remove('contributorId'); + return $this; + } + + /** + * @return string + */ + public function getContributionType() + { + return $this->get('contributionType'); + } + + /** + * @param string $value + */ + public function setContributionType($value): self + { + $this->set('contributionType', $value); + return $this; + } + + public function hasContributionType(): bool + { + return $this->has('contributionType'); + } + + public function unsetContributionType(): self + { + $this->remove('contributionType'); + return $this; + } + + /** + * @return bool + */ + public function getMainContribution() + { + return $this->get('mainContribution'); + } + + /** + * @param bool $value + */ + public function setMainContribution($value): self + { + $this->set('mainContribution', $value); + return $this; + } + + public function hasMainContribution(): bool + { + return $this->has('mainContribution'); + } + + public function unsetMainContribution(): self + { + $this->remove('mainContribution'); + return $this; + } + + /** + * @return string|null + */ + public function getFirstName() + { + return $this->get('firstName'); + } + + /** + * @param string|null $value + */ + public function setFirstName($value): self + { + $this->set('firstName', $value); + return $this; + } + + public function hasFirstName(): bool + { + return $this->has('firstName'); + } + + public function unsetFirstName(): self + { + $this->remove('firstName'); + return $this; + } + + /** + * @return string + */ + public function getLastName() + { + return $this->get('lastName'); + } + + /** + * @param string $value + */ + public function setLastName($value): self + { + $this->set('lastName', $value); + return $this; + } + + public function hasLastName(): bool + { + return $this->has('lastName'); + } + + public function unsetLastName(): self + { + $this->remove('lastName'); + return $this; + } + + /** + * @return string + */ + public function getFullName() + { + return $this->get('fullName'); + } + + /** + * @param string $value + */ + public function setFullName($value): self + { + $this->set('fullName', $value); + return $this; + } + + public function hasFullName(): bool + { + return $this->has('fullName'); + } + + public function unsetFullName(): self + { + $this->remove('fullName'); + return $this; + } + + /** + * @return int + */ + public function getContributionOrdinal() + { + return $this->get('contributionOrdinal'); + } + + /** + * @param int $value + */ + public function setContributionOrdinal($value): self + { + $this->set('contributionOrdinal', $value); + return $this; + } + + public function hasContributionOrdinal(): bool + { + return $this->has('contributionOrdinal'); + } + + public function unsetContributionOrdinal(): self + { + $this->remove('contributionOrdinal'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewContribution', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'contributorId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'contributionType', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ContributionType', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'mainContribution', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Boolean', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'firstName', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'lastName', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'fullName', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'contributionOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewContributor.php b/src/GraphQL/Inputs/NewContributor.php new file mode 100644 index 0000000..1401e2f --- /dev/null +++ b/src/GraphQL/Inputs/NewContributor.php @@ -0,0 +1,213 @@ +get('firstName'); + } + + /** + * @param string|null $value + */ + public function setFirstName($value): self + { + $this->set('firstName', $value); + return $this; + } + + public function hasFirstName(): bool + { + return $this->has('firstName'); + } + + public function unsetFirstName(): self + { + $this->remove('firstName'); + return $this; + } + + /** + * @return string + */ + public function getLastName() + { + return $this->get('lastName'); + } + + /** + * @param string $value + */ + public function setLastName($value): self + { + $this->set('lastName', $value); + return $this; + } + + public function hasLastName(): bool + { + return $this->has('lastName'); + } + + public function unsetLastName(): self + { + $this->remove('lastName'); + return $this; + } + + /** + * @return string + */ + public function getFullName() + { + return $this->get('fullName'); + } + + /** + * @param string $value + */ + public function setFullName($value): self + { + $this->set('fullName', $value); + return $this; + } + + public function hasFullName(): bool + { + return $this->has('fullName'); + } + + public function unsetFullName(): self + { + $this->remove('fullName'); + return $this; + } + + /** + * @return string|null + */ + public function getOrcid() + { + return $this->get('orcid'); + } + + /** + * @param string|null $value + */ + public function setOrcid($value): self + { + $this->set('orcid', $value); + return $this; + } + + public function hasOrcid(): bool + { + return $this->has('orcid'); + } + + public function unsetOrcid(): self + { + $this->remove('orcid'); + return $this; + } + + /** + * @return string|null + */ + public function getWebsite() + { + return $this->get('website'); + } + + /** + * @param string|null $value + */ + public function setWebsite($value): self + { + $this->set('website', $value); + return $this; + } + + public function hasWebsite(): bool + { + return $this->has('website'); + } + + public function unsetWebsite(): self + { + $this->remove('website'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewContributor', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'firstName', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'lastName', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'fullName', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'orcid', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Orcid', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'website', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewEndorsement.php b/src/GraphQL/Inputs/NewEndorsement.php new file mode 100644 index 0000000..e5c506c --- /dev/null +++ b/src/GraphQL/Inputs/NewEndorsement.php @@ -0,0 +1,331 @@ +get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getAuthorName() + { + return $this->get('authorName'); + } + + /** + * @param string $value + */ + public function setAuthorName($value): self + { + $this->set('authorName', $value); + return $this; + } + + public function hasAuthorName(): bool + { + return $this->has('authorName'); + } + + public function unsetAuthorName(): self + { + $this->remove('authorName'); + return $this; + } + + /** + * @return string|null + */ + public function getAuthorRole() + { + return $this->get('authorRole'); + } + + /** + * @param string|null $value + */ + public function setAuthorRole($value): self + { + $this->set('authorRole', $value); + return $this; + } + + public function hasAuthorRole(): bool + { + return $this->has('authorRole'); + } + + public function unsetAuthorRole(): self + { + $this->remove('authorRole'); + return $this; + } + + /** + * @return string|null + */ + public function getAuthorOrcid() + { + return $this->get('authorOrcid'); + } + + /** + * @param string|null $value + */ + public function setAuthorOrcid($value): self + { + $this->set('authorOrcid', $value); + return $this; + } + + public function hasAuthorOrcid(): bool + { + return $this->has('authorOrcid'); + } + + public function unsetAuthorOrcid(): self + { + $this->remove('authorOrcid'); + return $this; + } + + /** + * @return string|null + */ + public function getAuthorInstitutionId() + { + return $this->get('authorInstitutionId'); + } + + /** + * @param string|null $value + */ + public function setAuthorInstitutionId($value): self + { + $this->set('authorInstitutionId', $value); + return $this; + } + + public function hasAuthorInstitutionId(): bool + { + return $this->has('authorInstitutionId'); + } + + public function unsetAuthorInstitutionId(): self + { + $this->remove('authorInstitutionId'); + return $this; + } + + /** + * @return string|null + */ + public function getUrl() + { + return $this->get('url'); + } + + /** + * @param string|null $value + */ + public function setUrl($value): self + { + $this->set('url', $value); + return $this; + } + + public function hasUrl(): bool + { + return $this->has('url'); + } + + public function unsetUrl(): self + { + $this->remove('url'); + return $this; + } + + /** + * @return string|null + */ + public function getText() + { + return $this->get('text'); + } + + /** + * @param string|null $value + */ + public function setText($value): self + { + $this->set('text', $value); + return $this; + } + + public function hasText(): bool + { + return $this->has('text'); + } + + public function unsetText(): self + { + $this->remove('text'); + return $this; + } + + /** + * @return int + */ + public function getEndorsementOrdinal() + { + return $this->get('endorsementOrdinal'); + } + + /** + * @param int $value + */ + public function setEndorsementOrdinal($value): self + { + $this->set('endorsementOrdinal', $value); + return $this; + } + + public function hasEndorsementOrdinal(): bool + { + return $this->has('endorsementOrdinal'); + } + + public function unsetEndorsementOrdinal(): self + { + $this->remove('endorsementOrdinal'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewEndorsement', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'authorName', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'authorRole', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'authorOrcid', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Orcid', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'authorInstitutionId', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'url', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'text', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'endorsementOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewFrontcoverFileUpload.php b/src/GraphQL/Inputs/NewFrontcoverFileUpload.php new file mode 100644 index 0000000..7dfcaef --- /dev/null +++ b/src/GraphQL/Inputs/NewFrontcoverFileUpload.php @@ -0,0 +1,183 @@ +get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getDeclaredMimeType() + { + return $this->get('declaredMimeType'); + } + + /** + * @param string $value + */ + public function setDeclaredMimeType($value): self + { + $this->set('declaredMimeType', $value); + return $this; + } + + public function hasDeclaredMimeType(): bool + { + return $this->has('declaredMimeType'); + } + + public function unsetDeclaredMimeType(): self + { + $this->remove('declaredMimeType'); + return $this; + } + + /** + * @return string + */ + public function getDeclaredExtension() + { + return $this->get('declaredExtension'); + } + + /** + * @param string $value + */ + public function setDeclaredExtension($value): self + { + $this->set('declaredExtension', $value); + return $this; + } + + public function hasDeclaredExtension(): bool + { + return $this->has('declaredExtension'); + } + + public function unsetDeclaredExtension(): self + { + $this->remove('declaredExtension'); + return $this; + } + + /** + * @return string + */ + public function getDeclaredSha256() + { + return $this->get('declaredSha256'); + } + + /** + * @param string $value + */ + public function setDeclaredSha256($value): self + { + $this->set('declaredSha256', $value); + return $this; + } + + public function hasDeclaredSha256(): bool + { + return $this->has('declaredSha256'); + } + + public function unsetDeclaredSha256(): self + { + $this->remove('declaredSha256'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewFrontcoverFileUpload', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => 'Thoth ID of the work this front cover belongs to.', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'declaredMimeType', + 'description' => 'MIME type declared by the client (e.g. \'image/jpeg\').', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'declaredExtension', + 'description' => 'File extension to use in the final canonical key, e.g. \'jpg\', \'png\', \'webp\'.', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'declaredSha256', + 'description' => 'SHA-256 checksum of the file, hex-encoded.', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewFunding.php b/src/GraphQL/Inputs/NewFunding.php new file mode 100644 index 0000000..e54c59c --- /dev/null +++ b/src/GraphQL/Inputs/NewFunding.php @@ -0,0 +1,251 @@ +get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getInstitutionId() + { + return $this->get('institutionId'); + } + + /** + * @param string $value + */ + public function setInstitutionId($value): self + { + $this->set('institutionId', $value); + return $this; + } + + public function hasInstitutionId(): bool + { + return $this->has('institutionId'); + } + + public function unsetInstitutionId(): self + { + $this->remove('institutionId'); + return $this; + } + + /** + * @return string|null + */ + public function getProgram() + { + return $this->get('program'); + } + + /** + * @param string|null $value + */ + public function setProgram($value): self + { + $this->set('program', $value); + return $this; + } + + public function hasProgram(): bool + { + return $this->has('program'); + } + + public function unsetProgram(): self + { + $this->remove('program'); + return $this; + } + + /** + * @return string|null + */ + public function getProjectName() + { + return $this->get('projectName'); + } + + /** + * @param string|null $value + */ + public function setProjectName($value): self + { + $this->set('projectName', $value); + return $this; + } + + public function hasProjectName(): bool + { + return $this->has('projectName'); + } + + public function unsetProjectName(): self + { + $this->remove('projectName'); + return $this; + } + + /** + * @return string|null + */ + public function getProjectShortname() + { + return $this->get('projectShortname'); + } + + /** + * @param string|null $value + */ + public function setProjectShortname($value): self + { + $this->set('projectShortname', $value); + return $this; + } + + public function hasProjectShortname(): bool + { + return $this->has('projectShortname'); + } + + public function unsetProjectShortname(): self + { + $this->remove('projectShortname'); + return $this; + } + + /** + * @return string|null + */ + public function getGrantNumber() + { + return $this->get('grantNumber'); + } + + /** + * @param string|null $value + */ + public function setGrantNumber($value): self + { + $this->set('grantNumber', $value); + return $this; + } + + public function hasGrantNumber(): bool + { + return $this->has('grantNumber'); + } + + public function unsetGrantNumber(): self + { + $this->remove('grantNumber'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewFunding', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'institutionId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'program', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'projectName', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'projectShortname', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'grantNumber', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewImprint.php b/src/GraphQL/Inputs/NewImprint.php new file mode 100644 index 0000000..8b167a1 --- /dev/null +++ b/src/GraphQL/Inputs/NewImprint.php @@ -0,0 +1,403 @@ +get('publisherId'); + } + + /** + * @param string $value + */ + public function setPublisherId($value): self + { + $this->set('publisherId', $value); + return $this; + } + + public function hasPublisherId(): bool + { + return $this->has('publisherId'); + } + + public function unsetPublisherId(): self + { + $this->remove('publisherId'); + return $this; + } + + /** + * @return string + */ + public function getImprintName() + { + return $this->get('imprintName'); + } + + /** + * @param string $value + */ + public function setImprintName($value): self + { + $this->set('imprintName', $value); + return $this; + } + + public function hasImprintName(): bool + { + return $this->has('imprintName'); + } + + public function unsetImprintName(): self + { + $this->remove('imprintName'); + return $this; + } + + /** + * @return string|null + */ + public function getImprintUrl() + { + return $this->get('imprintUrl'); + } + + /** + * @param string|null $value + */ + public function setImprintUrl($value): self + { + $this->set('imprintUrl', $value); + return $this; + } + + public function hasImprintUrl(): bool + { + return $this->has('imprintUrl'); + } + + public function unsetImprintUrl(): self + { + $this->remove('imprintUrl'); + return $this; + } + + /** + * @return string|null + */ + public function getCrossmarkDoi() + { + return $this->get('crossmarkDoi'); + } + + /** + * @param string|null $value + */ + public function setCrossmarkDoi($value): self + { + $this->set('crossmarkDoi', $value); + return $this; + } + + public function hasCrossmarkDoi(): bool + { + return $this->has('crossmarkDoi'); + } + + public function unsetCrossmarkDoi(): self + { + $this->remove('crossmarkDoi'); + return $this; + } + + /** + * @return string|null + */ + public function getS3Bucket() + { + return $this->get('s3Bucket'); + } + + /** + * @param string|null $value + */ + public function setS3Bucket($value): self + { + $this->set('s3Bucket', $value); + return $this; + } + + public function hasS3Bucket(): bool + { + return $this->has('s3Bucket'); + } + + public function unsetS3Bucket(): self + { + $this->remove('s3Bucket'); + return $this; + } + + /** + * @return string|null + */ + public function getCdnDomain() + { + return $this->get('cdnDomain'); + } + + /** + * @param string|null $value + */ + public function setCdnDomain($value): self + { + $this->set('cdnDomain', $value); + return $this; + } + + public function hasCdnDomain(): bool + { + return $this->has('cdnDomain'); + } + + public function unsetCdnDomain(): self + { + $this->remove('cdnDomain'); + return $this; + } + + /** + * @return string|null + */ + public function getCloudfrontDistId() + { + return $this->get('cloudfrontDistId'); + } + + /** + * @param string|null $value + */ + public function setCloudfrontDistId($value): self + { + $this->set('cloudfrontDistId', $value); + return $this; + } + + public function hasCloudfrontDistId(): bool + { + return $this->has('cloudfrontDistId'); + } + + public function unsetCloudfrontDistId(): self + { + $this->remove('cloudfrontDistId'); + return $this; + } + + /** + * @return string|null + */ + public function getDefaultCurrency() + { + return $this->get('defaultCurrency'); + } + + /** + * @param string|null $value + */ + public function setDefaultCurrency($value): self + { + $this->set('defaultCurrency', $value); + return $this; + } + + public function hasDefaultCurrency(): bool + { + return $this->has('defaultCurrency'); + } + + public function unsetDefaultCurrency(): self + { + $this->remove('defaultCurrency'); + return $this; + } + + /** + * @return string|null + */ + public function getDefaultPlace() + { + return $this->get('defaultPlace'); + } + + /** + * @param string|null $value + */ + public function setDefaultPlace($value): self + { + $this->set('defaultPlace', $value); + return $this; + } + + public function hasDefaultPlace(): bool + { + return $this->has('defaultPlace'); + } + + public function unsetDefaultPlace(): self + { + $this->remove('defaultPlace'); + return $this; + } + + /** + * @return string|null + */ + public function getDefaultLocale() + { + return $this->get('defaultLocale'); + } + + /** + * @param string|null $value + */ + public function setDefaultLocale($value): self + { + $this->set('defaultLocale', $value); + return $this; + } + + public function hasDefaultLocale(): bool + { + return $this->has('defaultLocale'); + } + + public function unsetDefaultLocale(): self + { + $this->remove('defaultLocale'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewImprint', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publisherId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'imprintName', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'imprintUrl', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'crossmarkDoi', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 's3Bucket', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'cdnDomain', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'cloudfrontDistId', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'defaultCurrency', + 'description' => null, + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'CurrencyCode', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'defaultPlace', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'defaultLocale', + 'description' => null, + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'LocaleCode', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewInstitution.php b/src/GraphQL/Inputs/NewInstitution.php new file mode 100644 index 0000000..9e8faac --- /dev/null +++ b/src/GraphQL/Inputs/NewInstitution.php @@ -0,0 +1,171 @@ +get('institutionName'); + } + + /** + * @param string $value + */ + public function setInstitutionName($value): self + { + $this->set('institutionName', $value); + return $this; + } + + public function hasInstitutionName(): bool + { + return $this->has('institutionName'); + } + + public function unsetInstitutionName(): self + { + $this->remove('institutionName'); + return $this; + } + + /** + * @return string|null + */ + public function getInstitutionDoi() + { + return $this->get('institutionDoi'); + } + + /** + * @param string|null $value + */ + public function setInstitutionDoi($value): self + { + $this->set('institutionDoi', $value); + return $this; + } + + public function hasInstitutionDoi(): bool + { + return $this->has('institutionDoi'); + } + + public function unsetInstitutionDoi(): self + { + $this->remove('institutionDoi'); + return $this; + } + + /** + * @return string|null + */ + public function getRor() + { + return $this->get('ror'); + } + + /** + * @param string|null $value + */ + public function setRor($value): self + { + $this->set('ror', $value); + return $this; + } + + public function hasRor(): bool + { + return $this->has('ror'); + } + + public function unsetRor(): self + { + $this->remove('ror'); + return $this; + } + + /** + * @return string|null + */ + public function getCountryCode() + { + return $this->get('countryCode'); + } + + /** + * @param string|null $value + */ + public function setCountryCode($value): self + { + $this->set('countryCode', $value); + return $this; + } + + public function hasCountryCode(): bool + { + return $this->has('countryCode'); + } + + public function unsetCountryCode(): self + { + $this->remove('countryCode'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewInstitution', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'institutionName', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'institutionDoi', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'ror', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Ror', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'countryCode', + 'description' => null, + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'CountryCode', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewIssue.php b/src/GraphQL/Inputs/NewIssue.php new file mode 100644 index 0000000..957100d --- /dev/null +++ b/src/GraphQL/Inputs/NewIssue.php @@ -0,0 +1,179 @@ +get('seriesId'); + } + + /** + * @param string $value + */ + public function setSeriesId($value): self + { + $this->set('seriesId', $value); + return $this; + } + + public function hasSeriesId(): bool + { + return $this->has('seriesId'); + } + + public function unsetSeriesId(): self + { + $this->remove('seriesId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return int + */ + public function getIssueOrdinal() + { + return $this->get('issueOrdinal'); + } + + /** + * @param int $value + */ + public function setIssueOrdinal($value): self + { + $this->set('issueOrdinal', $value); + return $this; + } + + public function hasIssueOrdinal(): bool + { + return $this->has('issueOrdinal'); + } + + public function unsetIssueOrdinal(): self + { + $this->remove('issueOrdinal'); + return $this; + } + + /** + * @return int|null + */ + public function getIssueNumber() + { + return $this->get('issueNumber'); + } + + /** + * @param int|null $value + */ + public function setIssueNumber($value): self + { + $this->set('issueNumber', $value); + return $this; + } + + public function hasIssueNumber(): bool + { + return $this->has('issueNumber'); + } + + public function unsetIssueNumber(): self + { + $this->remove('issueNumber'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewIssue', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'seriesId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'issueOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'issueNumber', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewLanguage.php b/src/GraphQL/Inputs/NewLanguage.php new file mode 100644 index 0000000..d10bd6d --- /dev/null +++ b/src/GraphQL/Inputs/NewLanguage.php @@ -0,0 +1,141 @@ +get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getLanguageCode() + { + return $this->get('languageCode'); + } + + /** + * @param string $value + */ + public function setLanguageCode($value): self + { + $this->set('languageCode', $value); + return $this; + } + + public function hasLanguageCode(): bool + { + return $this->has('languageCode'); + } + + public function unsetLanguageCode(): self + { + $this->remove('languageCode'); + return $this; + } + + /** + * @return string + */ + public function getLanguageRelation() + { + return $this->get('languageRelation'); + } + + /** + * @param string $value + */ + public function setLanguageRelation($value): self + { + $this->set('languageRelation', $value); + return $this; + } + + public function hasLanguageRelation(): bool + { + return $this->has('languageRelation'); + } + + public function unsetLanguageRelation(): self + { + $this->remove('languageRelation'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewLanguage', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'languageCode', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LanguageCode', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'languageRelation', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LanguageRelation', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewLocation.php b/src/GraphQL/Inputs/NewLocation.php new file mode 100644 index 0000000..ea996da --- /dev/null +++ b/src/GraphQL/Inputs/NewLocation.php @@ -0,0 +1,293 @@ +get('publicationId'); + } + + /** + * @param string $value + */ + public function setPublicationId($value): self + { + $this->set('publicationId', $value); + return $this; + } + + public function hasPublicationId(): bool + { + return $this->has('publicationId'); + } + + public function unsetPublicationId(): self + { + $this->remove('publicationId'); + return $this; + } + + /** + * @return string|null + */ + public function getLandingPage() + { + return $this->get('landingPage'); + } + + /** + * @param string|null $value + */ + public function setLandingPage($value): self + { + $this->set('landingPage', $value); + return $this; + } + + public function hasLandingPage(): bool + { + return $this->has('landingPage'); + } + + public function unsetLandingPage(): self + { + $this->remove('landingPage'); + return $this; + } + + /** + * @return string|null + */ + public function getFullTextUrl() + { + return $this->get('fullTextUrl'); + } + + /** + * @param string|null $value + */ + public function setFullTextUrl($value): self + { + $this->set('fullTextUrl', $value); + return $this; + } + + public function hasFullTextUrl(): bool + { + return $this->has('fullTextUrl'); + } + + public function unsetFullTextUrl(): self + { + $this->remove('fullTextUrl'); + return $this; + } + + /** + * @return string + */ + public function getLocationPlatform() + { + return $this->get('locationPlatform'); + } + + /** + * @param string $value + */ + public function setLocationPlatform($value): self + { + $this->set('locationPlatform', $value); + return $this; + } + + public function hasLocationPlatform(): bool + { + return $this->has('locationPlatform'); + } + + public function unsetLocationPlatform(): self + { + $this->remove('locationPlatform'); + return $this; + } + + /** + * @return bool + */ + public function getCanonical() + { + return $this->get('canonical'); + } + + /** + * @param bool $value + */ + public function setCanonical($value): self + { + $this->set('canonical', $value); + return $this; + } + + public function hasCanonical(): bool + { + return $this->has('canonical'); + } + + public function unsetCanonical(): self + { + $this->remove('canonical'); + return $this; + } + + /** + * @return string|null + */ + public function getChecksum() + { + return $this->get('checksum'); + } + + /** + * @param string|null $value + */ + public function setChecksum($value): self + { + $this->set('checksum', $value); + return $this; + } + + public function hasChecksum(): bool + { + return $this->has('checksum'); + } + + public function unsetChecksum(): self + { + $this->remove('checksum'); + return $this; + } + + /** + * @return string|null + */ + public function getChecksumAlgorithm() + { + return $this->get('checksumAlgorithm'); + } + + /** + * @param string|null $value + */ + public function setChecksumAlgorithm($value): self + { + $this->set('checksumAlgorithm', $value); + return $this; + } + + public function hasChecksumAlgorithm(): bool + { + return $this->has('checksumAlgorithm'); + } + + public function unsetChecksumAlgorithm(): self + { + $this->remove('checksumAlgorithm'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewLocation', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publicationId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'landingPage', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'fullTextUrl', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'locationPlatform', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocationPlatform', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'canonical', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Boolean', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'checksum', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'checksumAlgorithm', + 'description' => null, + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'ChecksumAlgorithm', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewPrice.php b/src/GraphQL/Inputs/NewPrice.php new file mode 100644 index 0000000..fd17227 --- /dev/null +++ b/src/GraphQL/Inputs/NewPrice.php @@ -0,0 +1,141 @@ +get('publicationId'); + } + + /** + * @param string $value + */ + public function setPublicationId($value): self + { + $this->set('publicationId', $value); + return $this; + } + + public function hasPublicationId(): bool + { + return $this->has('publicationId'); + } + + public function unsetPublicationId(): self + { + $this->remove('publicationId'); + return $this; + } + + /** + * @return string + */ + public function getCurrencyCode() + { + return $this->get('currencyCode'); + } + + /** + * @param string $value + */ + public function setCurrencyCode($value): self + { + $this->set('currencyCode', $value); + return $this; + } + + public function hasCurrencyCode(): bool + { + return $this->has('currencyCode'); + } + + public function unsetCurrencyCode(): self + { + $this->remove('currencyCode'); + return $this; + } + + /** + * @return float + */ + public function getUnitPrice() + { + return $this->get('unitPrice'); + } + + /** + * @param float $value + */ + public function setUnitPrice($value): self + { + $this->set('unitPrice', $value); + return $this; + } + + public function hasUnitPrice(): bool + { + return $this->has('unitPrice'); + } + + public function unsetUnitPrice(): self + { + $this->remove('unitPrice'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewPrice', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publicationId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'currencyCode', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'CurrencyCode', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'unitPrice', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewPublication.php b/src/GraphQL/Inputs/NewPublication.php new file mode 100644 index 0000000..d9509bb --- /dev/null +++ b/src/GraphQL/Inputs/NewPublication.php @@ -0,0 +1,593 @@ +get('publicationType'); + } + + /** + * @param string $value + */ + public function setPublicationType($value): self + { + $this->set('publicationType', $value); + return $this; + } + + public function hasPublicationType(): bool + { + return $this->has('publicationType'); + } + + public function unsetPublicationType(): self + { + $this->remove('publicationType'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string|null + */ + public function getIsbn() + { + return $this->get('isbn'); + } + + /** + * @param string|null $value + */ + public function setIsbn($value): self + { + $this->set('isbn', $value); + return $this; + } + + public function hasIsbn(): bool + { + return $this->has('isbn'); + } + + public function unsetIsbn(): self + { + $this->remove('isbn'); + return $this; + } + + /** + * @return float|null + */ + public function getWidthMm() + { + return $this->get('widthMm'); + } + + /** + * @param float|null $value + */ + public function setWidthMm($value): self + { + $this->set('widthMm', $value); + return $this; + } + + public function hasWidthMm(): bool + { + return $this->has('widthMm'); + } + + public function unsetWidthMm(): self + { + $this->remove('widthMm'); + return $this; + } + + /** + * @return float|null + */ + public function getWidthIn() + { + return $this->get('widthIn'); + } + + /** + * @param float|null $value + */ + public function setWidthIn($value): self + { + $this->set('widthIn', $value); + return $this; + } + + public function hasWidthIn(): bool + { + return $this->has('widthIn'); + } + + public function unsetWidthIn(): self + { + $this->remove('widthIn'); + return $this; + } + + /** + * @return float|null + */ + public function getHeightMm() + { + return $this->get('heightMm'); + } + + /** + * @param float|null $value + */ + public function setHeightMm($value): self + { + $this->set('heightMm', $value); + return $this; + } + + public function hasHeightMm(): bool + { + return $this->has('heightMm'); + } + + public function unsetHeightMm(): self + { + $this->remove('heightMm'); + return $this; + } + + /** + * @return float|null + */ + public function getHeightIn() + { + return $this->get('heightIn'); + } + + /** + * @param float|null $value + */ + public function setHeightIn($value): self + { + $this->set('heightIn', $value); + return $this; + } + + public function hasHeightIn(): bool + { + return $this->has('heightIn'); + } + + public function unsetHeightIn(): self + { + $this->remove('heightIn'); + return $this; + } + + /** + * @return float|null + */ + public function getDepthMm() + { + return $this->get('depthMm'); + } + + /** + * @param float|null $value + */ + public function setDepthMm($value): self + { + $this->set('depthMm', $value); + return $this; + } + + public function hasDepthMm(): bool + { + return $this->has('depthMm'); + } + + public function unsetDepthMm(): self + { + $this->remove('depthMm'); + return $this; + } + + /** + * @return float|null + */ + public function getDepthIn() + { + return $this->get('depthIn'); + } + + /** + * @param float|null $value + */ + public function setDepthIn($value): self + { + $this->set('depthIn', $value); + return $this; + } + + public function hasDepthIn(): bool + { + return $this->has('depthIn'); + } + + public function unsetDepthIn(): self + { + $this->remove('depthIn'); + return $this; + } + + /** + * @return float|null + */ + public function getWeightG() + { + return $this->get('weightG'); + } + + /** + * @param float|null $value + */ + public function setWeightG($value): self + { + $this->set('weightG', $value); + return $this; + } + + public function hasWeightG(): bool + { + return $this->has('weightG'); + } + + public function unsetWeightG(): self + { + $this->remove('weightG'); + return $this; + } + + /** + * @return float|null + */ + public function getWeightOz() + { + return $this->get('weightOz'); + } + + /** + * @param float|null $value + */ + public function setWeightOz($value): self + { + $this->set('weightOz', $value); + return $this; + } + + public function hasWeightOz(): bool + { + return $this->has('weightOz'); + } + + public function unsetWeightOz(): self + { + $this->remove('weightOz'); + return $this; + } + + /** + * @return string|null + */ + public function getAccessibilityStandard() + { + return $this->get('accessibilityStandard'); + } + + /** + * @param string|null $value + */ + public function setAccessibilityStandard($value): self + { + $this->set('accessibilityStandard', $value); + return $this; + } + + public function hasAccessibilityStandard(): bool + { + return $this->has('accessibilityStandard'); + } + + public function unsetAccessibilityStandard(): self + { + $this->remove('accessibilityStandard'); + return $this; + } + + /** + * @return string|null + */ + public function getAccessibilityAdditionalStandard() + { + return $this->get('accessibilityAdditionalStandard'); + } + + /** + * @param string|null $value + */ + public function setAccessibilityAdditionalStandard($value): self + { + $this->set('accessibilityAdditionalStandard', $value); + return $this; + } + + public function hasAccessibilityAdditionalStandard(): bool + { + return $this->has('accessibilityAdditionalStandard'); + } + + public function unsetAccessibilityAdditionalStandard(): self + { + $this->remove('accessibilityAdditionalStandard'); + return $this; + } + + /** + * @return string|null + */ + public function getAccessibilityException() + { + return $this->get('accessibilityException'); + } + + /** + * @param string|null $value + */ + public function setAccessibilityException($value): self + { + $this->set('accessibilityException', $value); + return $this; + } + + public function hasAccessibilityException(): bool + { + return $this->has('accessibilityException'); + } + + public function unsetAccessibilityException(): self + { + $this->remove('accessibilityException'); + return $this; + } + + /** + * @return string|null + */ + public function getAccessibilityReportUrl() + { + return $this->get('accessibilityReportUrl'); + } + + /** + * @param string|null $value + */ + public function setAccessibilityReportUrl($value): self + { + $this->set('accessibilityReportUrl', $value); + return $this; + } + + public function hasAccessibilityReportUrl(): bool + { + return $this->has('accessibilityReportUrl'); + } + + public function unsetAccessibilityReportUrl(): self + { + $this->remove('accessibilityReportUrl'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewPublication', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publicationType', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'PublicationType', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'isbn', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Isbn', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'widthMm', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'widthIn', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'heightMm', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'heightIn', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'depthMm', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'depthIn', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'weightG', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'weightOz', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'accessibilityStandard', + 'description' => null, + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'AccessibilityStandard', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'accessibilityAdditionalStandard', + 'description' => null, + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'AccessibilityStandard', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'accessibilityException', + 'description' => null, + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'AccessibilityException', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'accessibilityReportUrl', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewPublicationFileUpload.php b/src/GraphQL/Inputs/NewPublicationFileUpload.php new file mode 100644 index 0000000..d86814a --- /dev/null +++ b/src/GraphQL/Inputs/NewPublicationFileUpload.php @@ -0,0 +1,183 @@ +get('publicationId'); + } + + /** + * @param string $value + */ + public function setPublicationId($value): self + { + $this->set('publicationId', $value); + return $this; + } + + public function hasPublicationId(): bool + { + return $this->has('publicationId'); + } + + public function unsetPublicationId(): self + { + $this->remove('publicationId'); + return $this; + } + + /** + * @return string + */ + public function getDeclaredMimeType() + { + return $this->get('declaredMimeType'); + } + + /** + * @param string $value + */ + public function setDeclaredMimeType($value): self + { + $this->set('declaredMimeType', $value); + return $this; + } + + public function hasDeclaredMimeType(): bool + { + return $this->has('declaredMimeType'); + } + + public function unsetDeclaredMimeType(): self + { + $this->remove('declaredMimeType'); + return $this; + } + + /** + * @return string + */ + public function getDeclaredExtension() + { + return $this->get('declaredExtension'); + } + + /** + * @param string $value + */ + public function setDeclaredExtension($value): self + { + $this->set('declaredExtension', $value); + return $this; + } + + public function hasDeclaredExtension(): bool + { + return $this->has('declaredExtension'); + } + + public function unsetDeclaredExtension(): self + { + $this->remove('declaredExtension'); + return $this; + } + + /** + * @return string + */ + public function getDeclaredSha256() + { + return $this->get('declaredSha256'); + } + + /** + * @param string $value + */ + public function setDeclaredSha256($value): self + { + $this->set('declaredSha256', $value); + return $this; + } + + public function hasDeclaredSha256(): bool + { + return $this->has('declaredSha256'); + } + + public function unsetDeclaredSha256(): self + { + $this->remove('declaredSha256'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewPublicationFileUpload', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publicationId', + 'description' => 'Thoth ID of the publication linked to this file.', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'declaredMimeType', + 'description' => 'MIME type declared by the client (used for validation and in the presigned URL).', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'declaredExtension', + 'description' => 'File extension to use in the final canonical key, e.g. \'pdf\', \'epub\', \'xml\'.', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'declaredSha256', + 'description' => 'SHA-256 checksum of the file, hex-encoded.', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewPublisher.php b/src/GraphQL/Inputs/NewPublisher.php new file mode 100644 index 0000000..364d8f0 --- /dev/null +++ b/src/GraphQL/Inputs/NewPublisher.php @@ -0,0 +1,247 @@ +get('publisherName'); + } + + /** + * @param string $value + */ + public function setPublisherName($value): self + { + $this->set('publisherName', $value); + return $this; + } + + public function hasPublisherName(): bool + { + return $this->has('publisherName'); + } + + public function unsetPublisherName(): self + { + $this->remove('publisherName'); + return $this; + } + + /** + * @return string|null + */ + public function getPublisherShortname() + { + return $this->get('publisherShortname'); + } + + /** + * @param string|null $value + */ + public function setPublisherShortname($value): self + { + $this->set('publisherShortname', $value); + return $this; + } + + public function hasPublisherShortname(): bool + { + return $this->has('publisherShortname'); + } + + public function unsetPublisherShortname(): self + { + $this->remove('publisherShortname'); + return $this; + } + + /** + * @return string|null + */ + public function getPublisherUrl() + { + return $this->get('publisherUrl'); + } + + /** + * @param string|null $value + */ + public function setPublisherUrl($value): self + { + $this->set('publisherUrl', $value); + return $this; + } + + public function hasPublisherUrl(): bool + { + return $this->has('publisherUrl'); + } + + public function unsetPublisherUrl(): self + { + $this->remove('publisherUrl'); + return $this; + } + + /** + * @return string|null + */ + public function getZitadelId() + { + return $this->get('zitadelId'); + } + + /** + * @param string|null $value + */ + public function setZitadelId($value): self + { + $this->set('zitadelId', $value); + return $this; + } + + public function hasZitadelId(): bool + { + return $this->has('zitadelId'); + } + + public function unsetZitadelId(): self + { + $this->remove('zitadelId'); + return $this; + } + + /** + * @return string|null + */ + public function getAccessibilityStatement() + { + return $this->get('accessibilityStatement'); + } + + /** + * @param string|null $value + */ + public function setAccessibilityStatement($value): self + { + $this->set('accessibilityStatement', $value); + return $this; + } + + public function hasAccessibilityStatement(): bool + { + return $this->has('accessibilityStatement'); + } + + public function unsetAccessibilityStatement(): self + { + $this->remove('accessibilityStatement'); + return $this; + } + + /** + * @return string|null + */ + public function getAccessibilityReportUrl() + { + return $this->get('accessibilityReportUrl'); + } + + /** + * @param string|null $value + */ + public function setAccessibilityReportUrl($value): self + { + $this->set('accessibilityReportUrl', $value); + return $this; + } + + public function hasAccessibilityReportUrl(): bool + { + return $this->has('accessibilityReportUrl'); + } + + public function unsetAccessibilityReportUrl(): self + { + $this->remove('accessibilityReportUrl'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewPublisher', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publisherName', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publisherShortname', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publisherUrl', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'zitadelId', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'accessibilityStatement', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'accessibilityReportUrl', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewReference.php b/src/GraphQL/Inputs/NewReference.php new file mode 100644 index 0000000..0b68665 --- /dev/null +++ b/src/GraphQL/Inputs/NewReference.php @@ -0,0 +1,859 @@ +get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return int + */ + public function getReferenceOrdinal() + { + return $this->get('referenceOrdinal'); + } + + /** + * @param int $value + */ + public function setReferenceOrdinal($value): self + { + $this->set('referenceOrdinal', $value); + return $this; + } + + public function hasReferenceOrdinal(): bool + { + return $this->has('referenceOrdinal'); + } + + public function unsetReferenceOrdinal(): self + { + $this->remove('referenceOrdinal'); + return $this; + } + + /** + * @return string|null + */ + public function getDoi() + { + return $this->get('doi'); + } + + /** + * @param string|null $value + */ + public function setDoi($value): self + { + $this->set('doi', $value); + return $this; + } + + public function hasDoi(): bool + { + return $this->has('doi'); + } + + public function unsetDoi(): self + { + $this->remove('doi'); + return $this; + } + + /** + * @return string|null + */ + public function getUnstructuredCitation() + { + return $this->get('unstructuredCitation'); + } + + /** + * @param string|null $value + */ + public function setUnstructuredCitation($value): self + { + $this->set('unstructuredCitation', $value); + return $this; + } + + public function hasUnstructuredCitation(): bool + { + return $this->has('unstructuredCitation'); + } + + public function unsetUnstructuredCitation(): self + { + $this->remove('unstructuredCitation'); + return $this; + } + + /** + * @return string|null + */ + public function getIssn() + { + return $this->get('issn'); + } + + /** + * @param string|null $value + */ + public function setIssn($value): self + { + $this->set('issn', $value); + return $this; + } + + public function hasIssn(): bool + { + return $this->has('issn'); + } + + public function unsetIssn(): self + { + $this->remove('issn'); + return $this; + } + + /** + * @return string|null + */ + public function getIsbn() + { + return $this->get('isbn'); + } + + /** + * @param string|null $value + */ + public function setIsbn($value): self + { + $this->set('isbn', $value); + return $this; + } + + public function hasIsbn(): bool + { + return $this->has('isbn'); + } + + public function unsetIsbn(): self + { + $this->remove('isbn'); + return $this; + } + + /** + * @return string|null + */ + public function getJournalTitle() + { + return $this->get('journalTitle'); + } + + /** + * @param string|null $value + */ + public function setJournalTitle($value): self + { + $this->set('journalTitle', $value); + return $this; + } + + public function hasJournalTitle(): bool + { + return $this->has('journalTitle'); + } + + public function unsetJournalTitle(): self + { + $this->remove('journalTitle'); + return $this; + } + + /** + * @return string|null + */ + public function getArticleTitle() + { + return $this->get('articleTitle'); + } + + /** + * @param string|null $value + */ + public function setArticleTitle($value): self + { + $this->set('articleTitle', $value); + return $this; + } + + public function hasArticleTitle(): bool + { + return $this->has('articleTitle'); + } + + public function unsetArticleTitle(): self + { + $this->remove('articleTitle'); + return $this; + } + + /** + * @return string|null + */ + public function getSeriesTitle() + { + return $this->get('seriesTitle'); + } + + /** + * @param string|null $value + */ + public function setSeriesTitle($value): self + { + $this->set('seriesTitle', $value); + return $this; + } + + public function hasSeriesTitle(): bool + { + return $this->has('seriesTitle'); + } + + public function unsetSeriesTitle(): self + { + $this->remove('seriesTitle'); + return $this; + } + + /** + * @return string|null + */ + public function getVolumeTitle() + { + return $this->get('volumeTitle'); + } + + /** + * @param string|null $value + */ + public function setVolumeTitle($value): self + { + $this->set('volumeTitle', $value); + return $this; + } + + public function hasVolumeTitle(): bool + { + return $this->has('volumeTitle'); + } + + public function unsetVolumeTitle(): self + { + $this->remove('volumeTitle'); + return $this; + } + + /** + * @return int|null + */ + public function getEdition() + { + return $this->get('edition'); + } + + /** + * @param int|null $value + */ + public function setEdition($value): self + { + $this->set('edition', $value); + return $this; + } + + public function hasEdition(): bool + { + return $this->has('edition'); + } + + public function unsetEdition(): self + { + $this->remove('edition'); + return $this; + } + + /** + * @return string|null + */ + public function getAuthor() + { + return $this->get('author'); + } + + /** + * @param string|null $value + */ + public function setAuthor($value): self + { + $this->set('author', $value); + return $this; + } + + public function hasAuthor(): bool + { + return $this->has('author'); + } + + public function unsetAuthor(): self + { + $this->remove('author'); + return $this; + } + + /** + * @return string|null + */ + public function getVolume() + { + return $this->get('volume'); + } + + /** + * @param string|null $value + */ + public function setVolume($value): self + { + $this->set('volume', $value); + return $this; + } + + public function hasVolume(): bool + { + return $this->has('volume'); + } + + public function unsetVolume(): self + { + $this->remove('volume'); + return $this; + } + + /** + * @return string|null + */ + public function getIssue() + { + return $this->get('issue'); + } + + /** + * @param string|null $value + */ + public function setIssue($value): self + { + $this->set('issue', $value); + return $this; + } + + public function hasIssue(): bool + { + return $this->has('issue'); + } + + public function unsetIssue(): self + { + $this->remove('issue'); + return $this; + } + + /** + * @return string|null + */ + public function getFirstPage() + { + return $this->get('firstPage'); + } + + /** + * @param string|null $value + */ + public function setFirstPage($value): self + { + $this->set('firstPage', $value); + return $this; + } + + public function hasFirstPage(): bool + { + return $this->has('firstPage'); + } + + public function unsetFirstPage(): self + { + $this->remove('firstPage'); + return $this; + } + + /** + * @return string|null + */ + public function getComponentNumber() + { + return $this->get('componentNumber'); + } + + /** + * @param string|null $value + */ + public function setComponentNumber($value): self + { + $this->set('componentNumber', $value); + return $this; + } + + public function hasComponentNumber(): bool + { + return $this->has('componentNumber'); + } + + public function unsetComponentNumber(): self + { + $this->remove('componentNumber'); + return $this; + } + + /** + * @return string|null + */ + public function getStandardDesignator() + { + return $this->get('standardDesignator'); + } + + /** + * @param string|null $value + */ + public function setStandardDesignator($value): self + { + $this->set('standardDesignator', $value); + return $this; + } + + public function hasStandardDesignator(): bool + { + return $this->has('standardDesignator'); + } + + public function unsetStandardDesignator(): self + { + $this->remove('standardDesignator'); + return $this; + } + + /** + * @return string|null + */ + public function getStandardsBodyName() + { + return $this->get('standardsBodyName'); + } + + /** + * @param string|null $value + */ + public function setStandardsBodyName($value): self + { + $this->set('standardsBodyName', $value); + return $this; + } + + public function hasStandardsBodyName(): bool + { + return $this->has('standardsBodyName'); + } + + public function unsetStandardsBodyName(): self + { + $this->remove('standardsBodyName'); + return $this; + } + + /** + * @return string|null + */ + public function getStandardsBodyAcronym() + { + return $this->get('standardsBodyAcronym'); + } + + /** + * @param string|null $value + */ + public function setStandardsBodyAcronym($value): self + { + $this->set('standardsBodyAcronym', $value); + return $this; + } + + public function hasStandardsBodyAcronym(): bool + { + return $this->has('standardsBodyAcronym'); + } + + public function unsetStandardsBodyAcronym(): self + { + $this->remove('standardsBodyAcronym'); + return $this; + } + + /** + * @return string|null + */ + public function getUrl() + { + return $this->get('url'); + } + + /** + * @param string|null $value + */ + public function setUrl($value): self + { + $this->set('url', $value); + return $this; + } + + public function hasUrl(): bool + { + return $this->has('url'); + } + + public function unsetUrl(): self + { + $this->remove('url'); + return $this; + } + + /** + * @return string|null + */ + public function getPublicationDate() + { + return $this->get('publicationDate'); + } + + /** + * @param string|null $value + */ + public function setPublicationDate($value): self + { + $this->set('publicationDate', $value); + return $this; + } + + public function hasPublicationDate(): bool + { + return $this->has('publicationDate'); + } + + public function unsetPublicationDate(): self + { + $this->remove('publicationDate'); + return $this; + } + + /** + * @return string|null + */ + public function getRetrievalDate() + { + return $this->get('retrievalDate'); + } + + /** + * @param string|null $value + */ + public function setRetrievalDate($value): self + { + $this->set('retrievalDate', $value); + return $this; + } + + public function hasRetrievalDate(): bool + { + return $this->has('retrievalDate'); + } + + public function unsetRetrievalDate(): self + { + $this->remove('retrievalDate'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewReference', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'referenceOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'doi', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'unstructuredCitation', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'issn', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'isbn', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Isbn', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'journalTitle', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'articleTitle', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'seriesTitle', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'volumeTitle', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'edition', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'author', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'volume', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'issue', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'firstPage', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'componentNumber', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'standardDesignator', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'standardsBodyName', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'standardsBodyAcronym', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'url', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publicationDate', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Date', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'retrievalDate', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Date', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewSeries.php b/src/GraphQL/Inputs/NewSeries.php new file mode 100644 index 0000000..d1c0e50 --- /dev/null +++ b/src/GraphQL/Inputs/NewSeries.php @@ -0,0 +1,331 @@ +get('seriesType'); + } + + /** + * @param string $value + */ + public function setSeriesType($value): self + { + $this->set('seriesType', $value); + return $this; + } + + public function hasSeriesType(): bool + { + return $this->has('seriesType'); + } + + public function unsetSeriesType(): self + { + $this->remove('seriesType'); + return $this; + } + + /** + * @return string + */ + public function getSeriesName() + { + return $this->get('seriesName'); + } + + /** + * @param string $value + */ + public function setSeriesName($value): self + { + $this->set('seriesName', $value); + return $this; + } + + public function hasSeriesName(): bool + { + return $this->has('seriesName'); + } + + public function unsetSeriesName(): self + { + $this->remove('seriesName'); + return $this; + } + + /** + * @return string|null + */ + public function getIssnPrint() + { + return $this->get('issnPrint'); + } + + /** + * @param string|null $value + */ + public function setIssnPrint($value): self + { + $this->set('issnPrint', $value); + return $this; + } + + public function hasIssnPrint(): bool + { + return $this->has('issnPrint'); + } + + public function unsetIssnPrint(): self + { + $this->remove('issnPrint'); + return $this; + } + + /** + * @return string|null + */ + public function getIssnDigital() + { + return $this->get('issnDigital'); + } + + /** + * @param string|null $value + */ + public function setIssnDigital($value): self + { + $this->set('issnDigital', $value); + return $this; + } + + public function hasIssnDigital(): bool + { + return $this->has('issnDigital'); + } + + public function unsetIssnDigital(): self + { + $this->remove('issnDigital'); + return $this; + } + + /** + * @return string|null + */ + public function getSeriesUrl() + { + return $this->get('seriesUrl'); + } + + /** + * @param string|null $value + */ + public function setSeriesUrl($value): self + { + $this->set('seriesUrl', $value); + return $this; + } + + public function hasSeriesUrl(): bool + { + return $this->has('seriesUrl'); + } + + public function unsetSeriesUrl(): self + { + $this->remove('seriesUrl'); + return $this; + } + + /** + * @return string|null + */ + public function getSeriesDescription() + { + return $this->get('seriesDescription'); + } + + /** + * @param string|null $value + */ + public function setSeriesDescription($value): self + { + $this->set('seriesDescription', $value); + return $this; + } + + public function hasSeriesDescription(): bool + { + return $this->has('seriesDescription'); + } + + public function unsetSeriesDescription(): self + { + $this->remove('seriesDescription'); + return $this; + } + + /** + * @return string|null + */ + public function getSeriesCfpUrl() + { + return $this->get('seriesCfpUrl'); + } + + /** + * @param string|null $value + */ + public function setSeriesCfpUrl($value): self + { + $this->set('seriesCfpUrl', $value); + return $this; + } + + public function hasSeriesCfpUrl(): bool + { + return $this->has('seriesCfpUrl'); + } + + public function unsetSeriesCfpUrl(): self + { + $this->remove('seriesCfpUrl'); + return $this; + } + + /** + * @return string + */ + public function getImprintId() + { + return $this->get('imprintId'); + } + + /** + * @param string $value + */ + public function setImprintId($value): self + { + $this->set('imprintId', $value); + return $this; + } + + public function hasImprintId(): bool + { + return $this->has('imprintId'); + } + + public function unsetImprintId(): self + { + $this->remove('imprintId'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewSeries', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'seriesType', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'SeriesType', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'seriesName', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'issnPrint', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'issnDigital', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'seriesUrl', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'seriesDescription', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'seriesCfpUrl', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'imprintId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewSubject.php b/src/GraphQL/Inputs/NewSubject.php new file mode 100644 index 0000000..cc630f2 --- /dev/null +++ b/src/GraphQL/Inputs/NewSubject.php @@ -0,0 +1,183 @@ +get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getSubjectType() + { + return $this->get('subjectType'); + } + + /** + * @param string $value + */ + public function setSubjectType($value): self + { + $this->set('subjectType', $value); + return $this; + } + + public function hasSubjectType(): bool + { + return $this->has('subjectType'); + } + + public function unsetSubjectType(): self + { + $this->remove('subjectType'); + return $this; + } + + /** + * @return string + */ + public function getSubjectCode() + { + return $this->get('subjectCode'); + } + + /** + * @param string $value + */ + public function setSubjectCode($value): self + { + $this->set('subjectCode', $value); + return $this; + } + + public function hasSubjectCode(): bool + { + return $this->has('subjectCode'); + } + + public function unsetSubjectCode(): self + { + $this->remove('subjectCode'); + return $this; + } + + /** + * @return int + */ + public function getSubjectOrdinal() + { + return $this->get('subjectOrdinal'); + } + + /** + * @param int $value + */ + public function setSubjectOrdinal($value): self + { + $this->set('subjectOrdinal', $value); + return $this; + } + + public function hasSubjectOrdinal(): bool + { + return $this->has('subjectOrdinal'); + } + + public function unsetSubjectOrdinal(): self + { + $this->remove('subjectOrdinal'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewSubject', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'subjectType', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'SubjectType', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'subjectCode', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'subjectOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewTitle.php b/src/GraphQL/Inputs/NewTitle.php new file mode 100644 index 0000000..b3e4da0 --- /dev/null +++ b/src/GraphQL/Inputs/NewTitle.php @@ -0,0 +1,263 @@ +get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getLocaleCode() + { + return $this->get('localeCode'); + } + + /** + * @param string $value + */ + public function setLocaleCode($value): self + { + $this->set('localeCode', $value); + return $this; + } + + public function hasLocaleCode(): bool + { + return $this->has('localeCode'); + } + + public function unsetLocaleCode(): self + { + $this->remove('localeCode'); + return $this; + } + + /** + * @return string + */ + public function getFullTitle() + { + return $this->get('fullTitle'); + } + + /** + * @param string $value + */ + public function setFullTitle($value): self + { + $this->set('fullTitle', $value); + return $this; + } + + public function hasFullTitle(): bool + { + return $this->has('fullTitle'); + } + + public function unsetFullTitle(): self + { + $this->remove('fullTitle'); + return $this; + } + + /** + * @return string + */ + public function getTitle() + { + return $this->get('title'); + } + + /** + * @param string $value + */ + public function setTitle($value): self + { + $this->set('title', $value); + return $this; + } + + public function hasTitle(): bool + { + return $this->has('title'); + } + + public function unsetTitle(): self + { + $this->remove('title'); + return $this; + } + + /** + * @return string|null + */ + public function getSubtitle() + { + return $this->get('subtitle'); + } + + /** + * @param string|null $value + */ + public function setSubtitle($value): self + { + $this->set('subtitle', $value); + return $this; + } + + public function hasSubtitle(): bool + { + return $this->has('subtitle'); + } + + public function unsetSubtitle(): self + { + $this->remove('subtitle'); + return $this; + } + + /** + * @return bool + */ + public function getCanonical() + { + return $this->get('canonical'); + } + + /** + * @param bool $value + */ + public function setCanonical($value): self + { + $this->set('canonical', $value); + return $this; + } + + public function hasCanonical(): bool + { + return $this->has('canonical'); + } + + public function unsetCanonical(): self + { + $this->remove('canonical'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewTitle', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'localeCode', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocaleCode', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'fullTitle', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'title', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'subtitle', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'canonical', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Boolean', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewWork.php b/src/GraphQL/Inputs/NewWork.php new file mode 100644 index 0000000..7c90715 --- /dev/null +++ b/src/GraphQL/Inputs/NewWork.php @@ -0,0 +1,1129 @@ +get('workType'); + } + + /** + * @param string $value + */ + public function setWorkType($value): self + { + $this->set('workType', $value); + return $this; + } + + public function hasWorkType(): bool + { + return $this->has('workType'); + } + + public function unsetWorkType(): self + { + $this->remove('workType'); + return $this; + } + + /** + * @return string + */ + public function getWorkStatus() + { + return $this->get('workStatus'); + } + + /** + * @param string $value + */ + public function setWorkStatus($value): self + { + $this->set('workStatus', $value); + return $this; + } + + public function hasWorkStatus(): bool + { + return $this->has('workStatus'); + } + + public function unsetWorkStatus(): self + { + $this->remove('workStatus'); + return $this; + } + + /** + * @return string|null + */ + public function getReference() + { + return $this->get('reference'); + } + + /** + * @param string|null $value + */ + public function setReference($value): self + { + $this->set('reference', $value); + return $this; + } + + public function hasReference(): bool + { + return $this->has('reference'); + } + + public function unsetReference(): self + { + $this->remove('reference'); + return $this; + } + + /** + * @return int|null + */ + public function getEdition() + { + return $this->get('edition'); + } + + /** + * @param int|null $value + */ + public function setEdition($value): self + { + $this->set('edition', $value); + return $this; + } + + public function hasEdition(): bool + { + return $this->has('edition'); + } + + public function unsetEdition(): self + { + $this->remove('edition'); + return $this; + } + + /** + * @return string + */ + public function getImprintId() + { + return $this->get('imprintId'); + } + + /** + * @param string $value + */ + public function setImprintId($value): self + { + $this->set('imprintId', $value); + return $this; + } + + public function hasImprintId(): bool + { + return $this->has('imprintId'); + } + + public function unsetImprintId(): self + { + $this->remove('imprintId'); + return $this; + } + + /** + * @return string|null + */ + public function getDoi() + { + return $this->get('doi'); + } + + /** + * @param string|null $value + */ + public function setDoi($value): self + { + $this->set('doi', $value); + return $this; + } + + public function hasDoi(): bool + { + return $this->has('doi'); + } + + public function unsetDoi(): self + { + $this->remove('doi'); + return $this; + } + + /** + * @return string|null + */ + public function getPublicationDate() + { + return $this->get('publicationDate'); + } + + /** + * @param string|null $value + */ + public function setPublicationDate($value): self + { + $this->set('publicationDate', $value); + return $this; + } + + public function hasPublicationDate(): bool + { + return $this->has('publicationDate'); + } + + public function unsetPublicationDate(): self + { + $this->remove('publicationDate'); + return $this; + } + + /** + * @return string|null + */ + public function getWithdrawnDate() + { + return $this->get('withdrawnDate'); + } + + /** + * @param string|null $value + */ + public function setWithdrawnDate($value): self + { + $this->set('withdrawnDate', $value); + return $this; + } + + public function hasWithdrawnDate(): bool + { + return $this->has('withdrawnDate'); + } + + public function unsetWithdrawnDate(): self + { + $this->remove('withdrawnDate'); + return $this; + } + + /** + * @return string|null + */ + public function getPlace() + { + return $this->get('place'); + } + + /** + * @param string|null $value + */ + public function setPlace($value): self + { + $this->set('place', $value); + return $this; + } + + public function hasPlace(): bool + { + return $this->has('place'); + } + + public function unsetPlace(): self + { + $this->remove('place'); + return $this; + } + + /** + * @return int|null + */ + public function getPageCount() + { + return $this->get('pageCount'); + } + + /** + * @param int|null $value + */ + public function setPageCount($value): self + { + $this->set('pageCount', $value); + return $this; + } + + public function hasPageCount(): bool + { + return $this->has('pageCount'); + } + + public function unsetPageCount(): self + { + $this->remove('pageCount'); + return $this; + } + + /** + * @return string|null + */ + public function getPageBreakdown() + { + return $this->get('pageBreakdown'); + } + + /** + * @param string|null $value + */ + public function setPageBreakdown($value): self + { + $this->set('pageBreakdown', $value); + return $this; + } + + public function hasPageBreakdown(): bool + { + return $this->has('pageBreakdown'); + } + + public function unsetPageBreakdown(): self + { + $this->remove('pageBreakdown'); + return $this; + } + + /** + * @return int|null + */ + public function getImageCount() + { + return $this->get('imageCount'); + } + + /** + * @param int|null $value + */ + public function setImageCount($value): self + { + $this->set('imageCount', $value); + return $this; + } + + public function hasImageCount(): bool + { + return $this->has('imageCount'); + } + + public function unsetImageCount(): self + { + $this->remove('imageCount'); + return $this; + } + + /** + * @return int|null + */ + public function getTableCount() + { + return $this->get('tableCount'); + } + + /** + * @param int|null $value + */ + public function setTableCount($value): self + { + $this->set('tableCount', $value); + return $this; + } + + public function hasTableCount(): bool + { + return $this->has('tableCount'); + } + + public function unsetTableCount(): self + { + $this->remove('tableCount'); + return $this; + } + + /** + * @return int|null + */ + public function getAudioCount() + { + return $this->get('audioCount'); + } + + /** + * @param int|null $value + */ + public function setAudioCount($value): self + { + $this->set('audioCount', $value); + return $this; + } + + public function hasAudioCount(): bool + { + return $this->has('audioCount'); + } + + public function unsetAudioCount(): self + { + $this->remove('audioCount'); + return $this; + } + + /** + * @return int|null + */ + public function getVideoCount() + { + return $this->get('videoCount'); + } + + /** + * @param int|null $value + */ + public function setVideoCount($value): self + { + $this->set('videoCount', $value); + return $this; + } + + public function hasVideoCount(): bool + { + return $this->has('videoCount'); + } + + public function unsetVideoCount(): self + { + $this->remove('videoCount'); + return $this; + } + + /** + * @return string|null + */ + public function getLicense() + { + return $this->get('license'); + } + + /** + * @param string|null $value + */ + public function setLicense($value): self + { + $this->set('license', $value); + return $this; + } + + public function hasLicense(): bool + { + return $this->has('license'); + } + + public function unsetLicense(): self + { + $this->remove('license'); + return $this; + } + + /** + * @return string|null + */ + public function getCopyrightHolder() + { + return $this->get('copyrightHolder'); + } + + /** + * @param string|null $value + */ + public function setCopyrightHolder($value): self + { + $this->set('copyrightHolder', $value); + return $this; + } + + public function hasCopyrightHolder(): bool + { + return $this->has('copyrightHolder'); + } + + public function unsetCopyrightHolder(): self + { + $this->remove('copyrightHolder'); + return $this; + } + + /** + * @return string|null + */ + public function getLandingPage() + { + return $this->get('landingPage'); + } + + /** + * @param string|null $value + */ + public function setLandingPage($value): self + { + $this->set('landingPage', $value); + return $this; + } + + public function hasLandingPage(): bool + { + return $this->has('landingPage'); + } + + public function unsetLandingPage(): self + { + $this->remove('landingPage'); + return $this; + } + + /** + * @return string|null + */ + public function getLccn() + { + return $this->get('lccn'); + } + + /** + * @param string|null $value + */ + public function setLccn($value): self + { + $this->set('lccn', $value); + return $this; + } + + public function hasLccn(): bool + { + return $this->has('lccn'); + } + + public function unsetLccn(): self + { + $this->remove('lccn'); + return $this; + } + + /** + * @return string|null + */ + public function getOclc() + { + return $this->get('oclc'); + } + + /** + * @param string|null $value + */ + public function setOclc($value): self + { + $this->set('oclc', $value); + return $this; + } + + public function hasOclc(): bool + { + return $this->has('oclc'); + } + + public function unsetOclc(): self + { + $this->remove('oclc'); + return $this; + } + + /** + * @return string|null + */ + public function getGeneralNote() + { + return $this->get('generalNote'); + } + + /** + * @param string|null $value + */ + public function setGeneralNote($value): self + { + $this->set('generalNote', $value); + return $this; + } + + public function hasGeneralNote(): bool + { + return $this->has('generalNote'); + } + + public function unsetGeneralNote(): self + { + $this->remove('generalNote'); + return $this; + } + + /** + * @return string|null + */ + public function getBibliographyNote() + { + return $this->get('bibliographyNote'); + } + + /** + * @param string|null $value + */ + public function setBibliographyNote($value): self + { + $this->set('bibliographyNote', $value); + return $this; + } + + public function hasBibliographyNote(): bool + { + return $this->has('bibliographyNote'); + } + + public function unsetBibliographyNote(): self + { + $this->remove('bibliographyNote'); + return $this; + } + + /** + * @return string|null + */ + public function getToc() + { + return $this->get('toc'); + } + + /** + * @param string|null $value + */ + public function setToc($value): self + { + $this->set('toc', $value); + return $this; + } + + public function hasToc(): bool + { + return $this->has('toc'); + } + + public function unsetToc(): self + { + $this->remove('toc'); + return $this; + } + + /** + * @return string|null + */ + public function getResourcesDescription() + { + return $this->get('resourcesDescription'); + } + + /** + * @param string|null $value + */ + public function setResourcesDescription($value): self + { + $this->set('resourcesDescription', $value); + return $this; + } + + public function hasResourcesDescription(): bool + { + return $this->has('resourcesDescription'); + } + + public function unsetResourcesDescription(): self + { + $this->remove('resourcesDescription'); + return $this; + } + + /** + * @return string|null + */ + public function getCoverUrl() + { + return $this->get('coverUrl'); + } + + /** + * @param string|null $value + */ + public function setCoverUrl($value): self + { + $this->set('coverUrl', $value); + return $this; + } + + public function hasCoverUrl(): bool + { + return $this->has('coverUrl'); + } + + public function unsetCoverUrl(): self + { + $this->remove('coverUrl'); + return $this; + } + + /** + * @return string|null + */ + public function getCoverCaption() + { + return $this->get('coverCaption'); + } + + /** + * @param string|null $value + */ + public function setCoverCaption($value): self + { + $this->set('coverCaption', $value); + return $this; + } + + public function hasCoverCaption(): bool + { + return $this->has('coverCaption'); + } + + public function unsetCoverCaption(): self + { + $this->remove('coverCaption'); + return $this; + } + + /** + * @return string|null + */ + public function getFirstPage() + { + return $this->get('firstPage'); + } + + /** + * @param string|null $value + */ + public function setFirstPage($value): self + { + $this->set('firstPage', $value); + return $this; + } + + public function hasFirstPage(): bool + { + return $this->has('firstPage'); + } + + public function unsetFirstPage(): self + { + $this->remove('firstPage'); + return $this; + } + + /** + * @return string|null + */ + public function getLastPage() + { + return $this->get('lastPage'); + } + + /** + * @param string|null $value + */ + public function setLastPage($value): self + { + $this->set('lastPage', $value); + return $this; + } + + public function hasLastPage(): bool + { + return $this->has('lastPage'); + } + + public function unsetLastPage(): self + { + $this->remove('lastPage'); + return $this; + } + + /** + * @return string|null + */ + public function getPageInterval() + { + return $this->get('pageInterval'); + } + + /** + * @param string|null $value + */ + public function setPageInterval($value): self + { + $this->set('pageInterval', $value); + return $this; + } + + public function hasPageInterval(): bool + { + return $this->has('pageInterval'); + } + + public function unsetPageInterval(): self + { + $this->remove('pageInterval'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewWork', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workType', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkType', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workStatus', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkStatus', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'reference', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'edition', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'imprintId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'doi', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publicationDate', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Date', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'withdrawnDate', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Date', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'place', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'pageCount', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'pageBreakdown', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'imageCount', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'tableCount', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'audioCount', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'videoCount', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'license', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'copyrightHolder', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'landingPage', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'lccn', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'oclc', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'generalNote', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'bibliographyNote', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'toc', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'resourcesDescription', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'coverUrl', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'coverCaption', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'firstPage', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'lastPage', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'pageInterval', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewWorkFeaturedVideo.php b/src/GraphQL/Inputs/NewWorkFeaturedVideo.php new file mode 100644 index 0000000..9ab83a3 --- /dev/null +++ b/src/GraphQL/Inputs/NewWorkFeaturedVideo.php @@ -0,0 +1,221 @@ +get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getTitle() + { + return $this->get('title'); + } + + /** + * @param string $value + */ + public function setTitle($value): self + { + $this->set('title', $value); + return $this; + } + + public function hasTitle(): bool + { + return $this->has('title'); + } + + public function unsetTitle(): self + { + $this->remove('title'); + return $this; + } + + /** + * @return string|null + */ + public function getUrl() + { + return $this->get('url'); + } + + /** + * @param string|null $value + */ + public function setUrl($value): self + { + $this->set('url', $value); + return $this; + } + + public function hasUrl(): bool + { + return $this->has('url'); + } + + public function unsetUrl(): self + { + $this->remove('url'); + return $this; + } + + /** + * @return int + */ + public function getWidth() + { + return $this->get('width'); + } + + /** + * @param int $value + */ + public function setWidth($value): self + { + $this->set('width', $value); + return $this; + } + + public function hasWidth(): bool + { + return $this->has('width'); + } + + public function unsetWidth(): self + { + $this->remove('width'); + return $this; + } + + /** + * @return int + */ + public function getHeight() + { + return $this->get('height'); + } + + /** + * @param int $value + */ + public function setHeight($value): self + { + $this->set('height', $value); + return $this; + } + + public function hasHeight(): bool + { + return $this->has('height'); + } + + public function unsetHeight(): self + { + $this->remove('height'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewWorkFeaturedVideo', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'title', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'url', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'width', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'height', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewWorkFeaturedVideoFileUpload.php b/src/GraphQL/Inputs/NewWorkFeaturedVideoFileUpload.php new file mode 100644 index 0000000..55f0577 --- /dev/null +++ b/src/GraphQL/Inputs/NewWorkFeaturedVideoFileUpload.php @@ -0,0 +1,183 @@ +get('workFeaturedVideoId'); + } + + /** + * @param string $value + */ + public function setWorkFeaturedVideoId($value): self + { + $this->set('workFeaturedVideoId', $value); + return $this; + } + + public function hasWorkFeaturedVideoId(): bool + { + return $this->has('workFeaturedVideoId'); + } + + public function unsetWorkFeaturedVideoId(): self + { + $this->remove('workFeaturedVideoId'); + return $this; + } + + /** + * @return string + */ + public function getDeclaredMimeType() + { + return $this->get('declaredMimeType'); + } + + /** + * @param string $value + */ + public function setDeclaredMimeType($value): self + { + $this->set('declaredMimeType', $value); + return $this; + } + + public function hasDeclaredMimeType(): bool + { + return $this->has('declaredMimeType'); + } + + public function unsetDeclaredMimeType(): self + { + $this->remove('declaredMimeType'); + return $this; + } + + /** + * @return string + */ + public function getDeclaredExtension() + { + return $this->get('declaredExtension'); + } + + /** + * @param string $value + */ + public function setDeclaredExtension($value): self + { + $this->set('declaredExtension', $value); + return $this; + } + + public function hasDeclaredExtension(): bool + { + return $this->has('declaredExtension'); + } + + public function unsetDeclaredExtension(): self + { + $this->remove('declaredExtension'); + return $this; + } + + /** + * @return string + */ + public function getDeclaredSha256() + { + return $this->get('declaredSha256'); + } + + /** + * @param string $value + */ + public function setDeclaredSha256($value): self + { + $this->set('declaredSha256', $value); + return $this; + } + + public function hasDeclaredSha256(): bool + { + return $this->has('declaredSha256'); + } + + public function unsetDeclaredSha256(): self + { + $this->remove('declaredSha256'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewWorkFeaturedVideoFileUpload', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workFeaturedVideoId', + 'description' => 'Thoth ID of the work featured video linked to this file.', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'declaredMimeType', + 'description' => 'MIME type declared by the client (used for validation and in the presigned URL).', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'declaredExtension', + 'description' => 'File extension to use in the final canonical key, e.g. \'mp4\', \'webm\', \'mov\'.', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'declaredSha256', + 'description' => 'SHA-256 checksum of the file, hex-encoded.', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/NewWorkRelation.php b/src/GraphQL/Inputs/NewWorkRelation.php new file mode 100644 index 0000000..237c576 --- /dev/null +++ b/src/GraphQL/Inputs/NewWorkRelation.php @@ -0,0 +1,183 @@ +get('relatorWorkId'); + } + + /** + * @param string $value + */ + public function setRelatorWorkId($value): self + { + $this->set('relatorWorkId', $value); + return $this; + } + + public function hasRelatorWorkId(): bool + { + return $this->has('relatorWorkId'); + } + + public function unsetRelatorWorkId(): self + { + $this->remove('relatorWorkId'); + return $this; + } + + /** + * @return string + */ + public function getRelatedWorkId() + { + return $this->get('relatedWorkId'); + } + + /** + * @param string $value + */ + public function setRelatedWorkId($value): self + { + $this->set('relatedWorkId', $value); + return $this; + } + + public function hasRelatedWorkId(): bool + { + return $this->has('relatedWorkId'); + } + + public function unsetRelatedWorkId(): self + { + $this->remove('relatedWorkId'); + return $this; + } + + /** + * @return string + */ + public function getRelationType() + { + return $this->get('relationType'); + } + + /** + * @param string $value + */ + public function setRelationType($value): self + { + $this->set('relationType', $value); + return $this; + } + + public function hasRelationType(): bool + { + return $this->has('relationType'); + } + + public function unsetRelationType(): self + { + $this->remove('relationType'); + return $this; + } + + /** + * @return int + */ + public function getRelationOrdinal() + { + return $this->get('relationOrdinal'); + } + + /** + * @param int $value + */ + public function setRelationOrdinal($value): self + { + $this->set('relationOrdinal', $value); + return $this; + } + + public function hasRelationOrdinal(): bool + { + return $this->has('relationOrdinal'); + } + + public function unsetRelationOrdinal(): self + { + $this->remove('relationOrdinal'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('NewWorkRelation', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'relatorWorkId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'relatedWorkId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'relationType', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'RelationType', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'relationOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchAbstract.php b/src/GraphQL/Inputs/PatchAbstract.php new file mode 100644 index 0000000..72dd4d6 --- /dev/null +++ b/src/GraphQL/Inputs/PatchAbstract.php @@ -0,0 +1,267 @@ +get('abstractId'); + } + + /** + * @param string $value + */ + public function setAbstractId($value): self + { + $this->set('abstractId', $value); + return $this; + } + + public function hasAbstractId(): bool + { + return $this->has('abstractId'); + } + + public function unsetAbstractId(): self + { + $this->remove('abstractId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getContent() + { + return $this->get('content'); + } + + /** + * @param string $value + */ + public function setContent($value): self + { + $this->set('content', $value); + return $this; + } + + public function hasContent(): bool + { + return $this->has('content'); + } + + public function unsetContent(): self + { + $this->remove('content'); + return $this; + } + + /** + * @return string + */ + public function getLocaleCode() + { + return $this->get('localeCode'); + } + + /** + * @param string $value + */ + public function setLocaleCode($value): self + { + $this->set('localeCode', $value); + return $this; + } + + public function hasLocaleCode(): bool + { + return $this->has('localeCode'); + } + + public function unsetLocaleCode(): self + { + $this->remove('localeCode'); + return $this; + } + + /** + * @return string + */ + public function getAbstractType() + { + return $this->get('abstractType'); + } + + /** + * @param string $value + */ + public function setAbstractType($value): self + { + $this->set('abstractType', $value); + return $this; + } + + public function hasAbstractType(): bool + { + return $this->has('abstractType'); + } + + public function unsetAbstractType(): self + { + $this->remove('abstractType'); + return $this; + } + + /** + * @return bool + */ + public function getCanonical() + { + return $this->get('canonical'); + } + + /** + * @param bool $value + */ + public function setCanonical($value): self + { + $this->set('canonical', $value); + return $this; + } + + public function hasCanonical(): bool + { + return $this->has('canonical'); + } + + public function unsetCanonical(): self + { + $this->remove('canonical'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchAbstract', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'abstractId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'content', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'localeCode', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocaleCode', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'abstractType', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'AbstractType', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'canonical', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Boolean', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchAdditionalResource.php b/src/GraphQL/Inputs/PatchAdditionalResource.php new file mode 100644 index 0000000..3c99c68 --- /dev/null +++ b/src/GraphQL/Inputs/PatchAdditionalResource.php @@ -0,0 +1,453 @@ +get('additionalResourceId'); + } + + /** + * @param string $value + */ + public function setAdditionalResourceId($value): self + { + $this->set('additionalResourceId', $value); + return $this; + } + + public function hasAdditionalResourceId(): bool + { + return $this->has('additionalResourceId'); + } + + public function unsetAdditionalResourceId(): self + { + $this->remove('additionalResourceId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getTitle() + { + return $this->get('title'); + } + + /** + * @param string $value + */ + public function setTitle($value): self + { + $this->set('title', $value); + return $this; + } + + public function hasTitle(): bool + { + return $this->has('title'); + } + + public function unsetTitle(): self + { + $this->remove('title'); + return $this; + } + + /** + * @return string|null + */ + public function getDescription() + { + return $this->get('description'); + } + + /** + * @param string|null $value + */ + public function setDescription($value): self + { + $this->set('description', $value); + return $this; + } + + public function hasDescription(): bool + { + return $this->has('description'); + } + + public function unsetDescription(): self + { + $this->remove('description'); + return $this; + } + + /** + * @return string|null + */ + public function getAttribution() + { + return $this->get('attribution'); + } + + /** + * @param string|null $value + */ + public function setAttribution($value): self + { + $this->set('attribution', $value); + return $this; + } + + public function hasAttribution(): bool + { + return $this->has('attribution'); + } + + public function unsetAttribution(): self + { + $this->remove('attribution'); + return $this; + } + + /** + * @return string + */ + public function getResourceType() + { + return $this->get('resourceType'); + } + + /** + * @param string $value + */ + public function setResourceType($value): self + { + $this->set('resourceType', $value); + return $this; + } + + public function hasResourceType(): bool + { + return $this->has('resourceType'); + } + + public function unsetResourceType(): self + { + $this->remove('resourceType'); + return $this; + } + + /** + * @return string|null + */ + public function getDoi() + { + return $this->get('doi'); + } + + /** + * @param string|null $value + */ + public function setDoi($value): self + { + $this->set('doi', $value); + return $this; + } + + public function hasDoi(): bool + { + return $this->has('doi'); + } + + public function unsetDoi(): self + { + $this->remove('doi'); + return $this; + } + + /** + * @return string|null + */ + public function getHandle() + { + return $this->get('handle'); + } + + /** + * @param string|null $value + */ + public function setHandle($value): self + { + $this->set('handle', $value); + return $this; + } + + public function hasHandle(): bool + { + return $this->has('handle'); + } + + public function unsetHandle(): self + { + $this->remove('handle'); + return $this; + } + + /** + * @return string|null + */ + public function getUrl() + { + return $this->get('url'); + } + + /** + * @param string|null $value + */ + public function setUrl($value): self + { + $this->set('url', $value); + return $this; + } + + public function hasUrl(): bool + { + return $this->has('url'); + } + + public function unsetUrl(): self + { + $this->remove('url'); + return $this; + } + + /** + * @return string|null + */ + public function getDate() + { + return $this->get('date'); + } + + /** + * @param string|null $value + */ + public function setDate($value): self + { + $this->set('date', $value); + return $this; + } + + public function hasDate(): bool + { + return $this->has('date'); + } + + public function unsetDate(): self + { + $this->remove('date'); + return $this; + } + + /** + * @return int + */ + public function getResourceOrdinal() + { + return $this->get('resourceOrdinal'); + } + + /** + * @param int $value + */ + public function setResourceOrdinal($value): self + { + $this->set('resourceOrdinal', $value); + return $this; + } + + public function hasResourceOrdinal(): bool + { + return $this->has('resourceOrdinal'); + } + + public function unsetResourceOrdinal(): self + { + $this->remove('resourceOrdinal'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchAdditionalResource', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'additionalResourceId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'title', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'description', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'attribution', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'resourceType', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ResourceType', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'doi', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'handle', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'url', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'date', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Date', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'resourceOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchAffiliation.php b/src/GraphQL/Inputs/PatchAffiliation.php new file mode 100644 index 0000000..86a01fd --- /dev/null +++ b/src/GraphQL/Inputs/PatchAffiliation.php @@ -0,0 +1,221 @@ +get('affiliationId'); + } + + /** + * @param string $value + */ + public function setAffiliationId($value): self + { + $this->set('affiliationId', $value); + return $this; + } + + public function hasAffiliationId(): bool + { + return $this->has('affiliationId'); + } + + public function unsetAffiliationId(): self + { + $this->remove('affiliationId'); + return $this; + } + + /** + * @return string + */ + public function getContributionId() + { + return $this->get('contributionId'); + } + + /** + * @param string $value + */ + public function setContributionId($value): self + { + $this->set('contributionId', $value); + return $this; + } + + public function hasContributionId(): bool + { + return $this->has('contributionId'); + } + + public function unsetContributionId(): self + { + $this->remove('contributionId'); + return $this; + } + + /** + * @return string + */ + public function getInstitutionId() + { + return $this->get('institutionId'); + } + + /** + * @param string $value + */ + public function setInstitutionId($value): self + { + $this->set('institutionId', $value); + return $this; + } + + public function hasInstitutionId(): bool + { + return $this->has('institutionId'); + } + + public function unsetInstitutionId(): self + { + $this->remove('institutionId'); + return $this; + } + + /** + * @return int + */ + public function getAffiliationOrdinal() + { + return $this->get('affiliationOrdinal'); + } + + /** + * @param int $value + */ + public function setAffiliationOrdinal($value): self + { + $this->set('affiliationOrdinal', $value); + return $this; + } + + public function hasAffiliationOrdinal(): bool + { + return $this->has('affiliationOrdinal'); + } + + public function unsetAffiliationOrdinal(): self + { + $this->remove('affiliationOrdinal'); + return $this; + } + + /** + * @return string|null + */ + public function getPosition() + { + return $this->get('position'); + } + + /** + * @param string|null $value + */ + public function setPosition($value): self + { + $this->set('position', $value); + return $this; + } + + public function hasPosition(): bool + { + return $this->has('position'); + } + + public function unsetPosition(): self + { + $this->remove('position'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchAffiliation', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'affiliationId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'contributionId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'institutionId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'affiliationOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'position', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchAward.php b/src/GraphQL/Inputs/PatchAward.php new file mode 100644 index 0000000..6c936c2 --- /dev/null +++ b/src/GraphQL/Inputs/PatchAward.php @@ -0,0 +1,449 @@ +get('awardId'); + } + + /** + * @param string $value + */ + public function setAwardId($value): self + { + $this->set('awardId', $value); + return $this; + } + + public function hasAwardId(): bool + { + return $this->has('awardId'); + } + + public function unsetAwardId(): self + { + $this->remove('awardId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getTitle() + { + return $this->get('title'); + } + + /** + * @param string $value + */ + public function setTitle($value): self + { + $this->set('title', $value); + return $this; + } + + public function hasTitle(): bool + { + return $this->has('title'); + } + + public function unsetTitle(): self + { + $this->remove('title'); + return $this; + } + + /** + * @return string|null + */ + public function getUrl() + { + return $this->get('url'); + } + + /** + * @param string|null $value + */ + public function setUrl($value): self + { + $this->set('url', $value); + return $this; + } + + public function hasUrl(): bool + { + return $this->has('url'); + } + + public function unsetUrl(): self + { + $this->remove('url'); + return $this; + } + + /** + * @return string|null + */ + public function getCategory() + { + return $this->get('category'); + } + + /** + * @param string|null $value + */ + public function setCategory($value): self + { + $this->set('category', $value); + return $this; + } + + public function hasCategory(): bool + { + return $this->has('category'); + } + + public function unsetCategory(): self + { + $this->remove('category'); + return $this; + } + + /** + * @return string|null + */ + public function getYear() + { + return $this->get('year'); + } + + /** + * @param string|null $value + */ + public function setYear($value): self + { + $this->set('year', $value); + return $this; + } + + public function hasYear(): bool + { + return $this->has('year'); + } + + public function unsetYear(): self + { + $this->remove('year'); + return $this; + } + + /** + * @return string|null + */ + public function getJury() + { + return $this->get('jury'); + } + + /** + * @param string|null $value + */ + public function setJury($value): self + { + $this->set('jury', $value); + return $this; + } + + public function hasJury(): bool + { + return $this->has('jury'); + } + + public function unsetJury(): self + { + $this->remove('jury'); + return $this; + } + + /** + * @return string|null + */ + public function getCountry() + { + return $this->get('country'); + } + + /** + * @param string|null $value + */ + public function setCountry($value): self + { + $this->set('country', $value); + return $this; + } + + public function hasCountry(): bool + { + return $this->has('country'); + } + + public function unsetCountry(): self + { + $this->remove('country'); + return $this; + } + + /** + * @return string|null + */ + public function getPrizeStatement() + { + return $this->get('prizeStatement'); + } + + /** + * @param string|null $value + */ + public function setPrizeStatement($value): self + { + $this->set('prizeStatement', $value); + return $this; + } + + public function hasPrizeStatement(): bool + { + return $this->has('prizeStatement'); + } + + public function unsetPrizeStatement(): self + { + $this->remove('prizeStatement'); + return $this; + } + + /** + * @return string|null + */ + public function getRole() + { + return $this->get('role'); + } + + /** + * @param string|null $value + */ + public function setRole($value): self + { + $this->set('role', $value); + return $this; + } + + public function hasRole(): bool + { + return $this->has('role'); + } + + public function unsetRole(): self + { + $this->remove('role'); + return $this; + } + + /** + * @return int + */ + public function getAwardOrdinal() + { + return $this->get('awardOrdinal'); + } + + /** + * @param int $value + */ + public function setAwardOrdinal($value): self + { + $this->set('awardOrdinal', $value); + return $this; + } + + public function hasAwardOrdinal(): bool + { + return $this->has('awardOrdinal'); + } + + public function unsetAwardOrdinal(): self + { + $this->remove('awardOrdinal'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchAward', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'awardId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'title', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'url', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'category', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'year', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'jury', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'country', + 'description' => null, + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'CountryCode', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'prizeStatement', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'role', + 'description' => null, + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'AwardRole', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'awardOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchBiography.php b/src/GraphQL/Inputs/PatchBiography.php new file mode 100644 index 0000000..0b8f2fd --- /dev/null +++ b/src/GraphQL/Inputs/PatchBiography.php @@ -0,0 +1,225 @@ +get('biographyId'); + } + + /** + * @param string $value + */ + public function setBiographyId($value): self + { + $this->set('biographyId', $value); + return $this; + } + + public function hasBiographyId(): bool + { + return $this->has('biographyId'); + } + + public function unsetBiographyId(): self + { + $this->remove('biographyId'); + return $this; + } + + /** + * @return string + */ + public function getContributionId() + { + return $this->get('contributionId'); + } + + /** + * @param string $value + */ + public function setContributionId($value): self + { + $this->set('contributionId', $value); + return $this; + } + + public function hasContributionId(): bool + { + return $this->has('contributionId'); + } + + public function unsetContributionId(): self + { + $this->remove('contributionId'); + return $this; + } + + /** + * @return string + */ + public function getContent() + { + return $this->get('content'); + } + + /** + * @param string $value + */ + public function setContent($value): self + { + $this->set('content', $value); + return $this; + } + + public function hasContent(): bool + { + return $this->has('content'); + } + + public function unsetContent(): self + { + $this->remove('content'); + return $this; + } + + /** + * @return bool + */ + public function getCanonical() + { + return $this->get('canonical'); + } + + /** + * @param bool $value + */ + public function setCanonical($value): self + { + $this->set('canonical', $value); + return $this; + } + + public function hasCanonical(): bool + { + return $this->has('canonical'); + } + + public function unsetCanonical(): self + { + $this->remove('canonical'); + return $this; + } + + /** + * @return string + */ + public function getLocaleCode() + { + return $this->get('localeCode'); + } + + /** + * @param string $value + */ + public function setLocaleCode($value): self + { + $this->set('localeCode', $value); + return $this; + } + + public function hasLocaleCode(): bool + { + return $this->has('localeCode'); + } + + public function unsetLocaleCode(): self + { + $this->remove('localeCode'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchBiography', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'biographyId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'contributionId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'content', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'canonical', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Boolean', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'localeCode', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocaleCode', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchBookReview.php b/src/GraphQL/Inputs/PatchBookReview.php new file mode 100644 index 0000000..c4cb900 --- /dev/null +++ b/src/GraphQL/Inputs/PatchBookReview.php @@ -0,0 +1,635 @@ +get('bookReviewId'); + } + + /** + * @param string $value + */ + public function setBookReviewId($value): self + { + $this->set('bookReviewId', $value); + return $this; + } + + public function hasBookReviewId(): bool + { + return $this->has('bookReviewId'); + } + + public function unsetBookReviewId(): self + { + $this->remove('bookReviewId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string|null + */ + public function getTitle() + { + return $this->get('title'); + } + + /** + * @param string|null $value + */ + public function setTitle($value): self + { + $this->set('title', $value); + return $this; + } + + public function hasTitle(): bool + { + return $this->has('title'); + } + + public function unsetTitle(): self + { + $this->remove('title'); + return $this; + } + + /** + * @return string|null + */ + public function getAuthorName() + { + return $this->get('authorName'); + } + + /** + * @param string|null $value + */ + public function setAuthorName($value): self + { + $this->set('authorName', $value); + return $this; + } + + public function hasAuthorName(): bool + { + return $this->has('authorName'); + } + + public function unsetAuthorName(): self + { + $this->remove('authorName'); + return $this; + } + + /** + * @return string|null + */ + public function getReviewerOrcid() + { + return $this->get('reviewerOrcid'); + } + + /** + * @param string|null $value + */ + public function setReviewerOrcid($value): self + { + $this->set('reviewerOrcid', $value); + return $this; + } + + public function hasReviewerOrcid(): bool + { + return $this->has('reviewerOrcid'); + } + + public function unsetReviewerOrcid(): self + { + $this->remove('reviewerOrcid'); + return $this; + } + + /** + * @return string|null + */ + public function getReviewerInstitutionId() + { + return $this->get('reviewerInstitutionId'); + } + + /** + * @param string|null $value + */ + public function setReviewerInstitutionId($value): self + { + $this->set('reviewerInstitutionId', $value); + return $this; + } + + public function hasReviewerInstitutionId(): bool + { + return $this->has('reviewerInstitutionId'); + } + + public function unsetReviewerInstitutionId(): self + { + $this->remove('reviewerInstitutionId'); + return $this; + } + + /** + * @return string|null + */ + public function getUrl() + { + return $this->get('url'); + } + + /** + * @param string|null $value + */ + public function setUrl($value): self + { + $this->set('url', $value); + return $this; + } + + public function hasUrl(): bool + { + return $this->has('url'); + } + + public function unsetUrl(): self + { + $this->remove('url'); + return $this; + } + + /** + * @return string|null + */ + public function getDoi() + { + return $this->get('doi'); + } + + /** + * @param string|null $value + */ + public function setDoi($value): self + { + $this->set('doi', $value); + return $this; + } + + public function hasDoi(): bool + { + return $this->has('doi'); + } + + public function unsetDoi(): self + { + $this->remove('doi'); + return $this; + } + + /** + * @return string|null + */ + public function getReviewDate() + { + return $this->get('reviewDate'); + } + + /** + * @param string|null $value + */ + public function setReviewDate($value): self + { + $this->set('reviewDate', $value); + return $this; + } + + public function hasReviewDate(): bool + { + return $this->has('reviewDate'); + } + + public function unsetReviewDate(): self + { + $this->remove('reviewDate'); + return $this; + } + + /** + * @return string|null + */ + public function getJournalName() + { + return $this->get('journalName'); + } + + /** + * @param string|null $value + */ + public function setJournalName($value): self + { + $this->set('journalName', $value); + return $this; + } + + public function hasJournalName(): bool + { + return $this->has('journalName'); + } + + public function unsetJournalName(): self + { + $this->remove('journalName'); + return $this; + } + + /** + * @return string|null + */ + public function getJournalVolume() + { + return $this->get('journalVolume'); + } + + /** + * @param string|null $value + */ + public function setJournalVolume($value): self + { + $this->set('journalVolume', $value); + return $this; + } + + public function hasJournalVolume(): bool + { + return $this->has('journalVolume'); + } + + public function unsetJournalVolume(): self + { + $this->remove('journalVolume'); + return $this; + } + + /** + * @return string|null + */ + public function getJournalNumber() + { + return $this->get('journalNumber'); + } + + /** + * @param string|null $value + */ + public function setJournalNumber($value): self + { + $this->set('journalNumber', $value); + return $this; + } + + public function hasJournalNumber(): bool + { + return $this->has('journalNumber'); + } + + public function unsetJournalNumber(): self + { + $this->remove('journalNumber'); + return $this; + } + + /** + * @return string|null + */ + public function getJournalIssn() + { + return $this->get('journalIssn'); + } + + /** + * @param string|null $value + */ + public function setJournalIssn($value): self + { + $this->set('journalIssn', $value); + return $this; + } + + public function hasJournalIssn(): bool + { + return $this->has('journalIssn'); + } + + public function unsetJournalIssn(): self + { + $this->remove('journalIssn'); + return $this; + } + + /** + * @return string|null + */ + public function getPageRange() + { + return $this->get('pageRange'); + } + + /** + * @param string|null $value + */ + public function setPageRange($value): self + { + $this->set('pageRange', $value); + return $this; + } + + public function hasPageRange(): bool + { + return $this->has('pageRange'); + } + + public function unsetPageRange(): self + { + $this->remove('pageRange'); + return $this; + } + + /** + * @return string|null + */ + public function getText() + { + return $this->get('text'); + } + + /** + * @param string|null $value + */ + public function setText($value): self + { + $this->set('text', $value); + return $this; + } + + public function hasText(): bool + { + return $this->has('text'); + } + + public function unsetText(): self + { + $this->remove('text'); + return $this; + } + + /** + * @return int + */ + public function getReviewOrdinal() + { + return $this->get('reviewOrdinal'); + } + + /** + * @param int $value + */ + public function setReviewOrdinal($value): self + { + $this->set('reviewOrdinal', $value); + return $this; + } + + public function hasReviewOrdinal(): bool + { + return $this->has('reviewOrdinal'); + } + + public function unsetReviewOrdinal(): self + { + $this->remove('reviewOrdinal'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchBookReview', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'bookReviewId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'title', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'authorName', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'reviewerOrcid', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Orcid', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'reviewerInstitutionId', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'url', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'doi', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'reviewDate', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Date', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'journalName', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'journalVolume', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'journalNumber', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'journalIssn', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'pageRange', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'text', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'reviewOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchContact.php b/src/GraphQL/Inputs/PatchContact.php new file mode 100644 index 0000000..97832d3 --- /dev/null +++ b/src/GraphQL/Inputs/PatchContact.php @@ -0,0 +1,183 @@ +get('contactId'); + } + + /** + * @param string $value + */ + public function setContactId($value): self + { + $this->set('contactId', $value); + return $this; + } + + public function hasContactId(): bool + { + return $this->has('contactId'); + } + + public function unsetContactId(): self + { + $this->remove('contactId'); + return $this; + } + + /** + * @return string + */ + public function getPublisherId() + { + return $this->get('publisherId'); + } + + /** + * @param string $value + */ + public function setPublisherId($value): self + { + $this->set('publisherId', $value); + return $this; + } + + public function hasPublisherId(): bool + { + return $this->has('publisherId'); + } + + public function unsetPublisherId(): self + { + $this->remove('publisherId'); + return $this; + } + + /** + * @return string + */ + public function getContactType() + { + return $this->get('contactType'); + } + + /** + * @param string $value + */ + public function setContactType($value): self + { + $this->set('contactType', $value); + return $this; + } + + public function hasContactType(): bool + { + return $this->has('contactType'); + } + + public function unsetContactType(): self + { + $this->remove('contactType'); + return $this; + } + + /** + * @return string + */ + public function getEmail() + { + return $this->get('email'); + } + + /** + * @param string $value + */ + public function setEmail($value): self + { + $this->set('email', $value); + return $this; + } + + public function hasEmail(): bool + { + return $this->has('email'); + } + + public function unsetEmail(): self + { + $this->remove('email'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchContact', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'contactId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publisherId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'contactType', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ContactType', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'email', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchContribution.php b/src/GraphQL/Inputs/PatchContribution.php new file mode 100644 index 0000000..7209dd7 --- /dev/null +++ b/src/GraphQL/Inputs/PatchContribution.php @@ -0,0 +1,389 @@ +get('contributionId'); + } + + /** + * @param string $value + */ + public function setContributionId($value): self + { + $this->set('contributionId', $value); + return $this; + } + + public function hasContributionId(): bool + { + return $this->has('contributionId'); + } + + public function unsetContributionId(): self + { + $this->remove('contributionId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getContributorId() + { + return $this->get('contributorId'); + } + + /** + * @param string $value + */ + public function setContributorId($value): self + { + $this->set('contributorId', $value); + return $this; + } + + public function hasContributorId(): bool + { + return $this->has('contributorId'); + } + + public function unsetContributorId(): self + { + $this->remove('contributorId'); + return $this; + } + + /** + * @return string + */ + public function getContributionType() + { + return $this->get('contributionType'); + } + + /** + * @param string $value + */ + public function setContributionType($value): self + { + $this->set('contributionType', $value); + return $this; + } + + public function hasContributionType(): bool + { + return $this->has('contributionType'); + } + + public function unsetContributionType(): self + { + $this->remove('contributionType'); + return $this; + } + + /** + * @return bool + */ + public function getMainContribution() + { + return $this->get('mainContribution'); + } + + /** + * @param bool $value + */ + public function setMainContribution($value): self + { + $this->set('mainContribution', $value); + return $this; + } + + public function hasMainContribution(): bool + { + return $this->has('mainContribution'); + } + + public function unsetMainContribution(): self + { + $this->remove('mainContribution'); + return $this; + } + + /** + * @return string|null + */ + public function getFirstName() + { + return $this->get('firstName'); + } + + /** + * @param string|null $value + */ + public function setFirstName($value): self + { + $this->set('firstName', $value); + return $this; + } + + public function hasFirstName(): bool + { + return $this->has('firstName'); + } + + public function unsetFirstName(): self + { + $this->remove('firstName'); + return $this; + } + + /** + * @return string + */ + public function getLastName() + { + return $this->get('lastName'); + } + + /** + * @param string $value + */ + public function setLastName($value): self + { + $this->set('lastName', $value); + return $this; + } + + public function hasLastName(): bool + { + return $this->has('lastName'); + } + + public function unsetLastName(): self + { + $this->remove('lastName'); + return $this; + } + + /** + * @return string + */ + public function getFullName() + { + return $this->get('fullName'); + } + + /** + * @param string $value + */ + public function setFullName($value): self + { + $this->set('fullName', $value); + return $this; + } + + public function hasFullName(): bool + { + return $this->has('fullName'); + } + + public function unsetFullName(): self + { + $this->remove('fullName'); + return $this; + } + + /** + * @return int + */ + public function getContributionOrdinal() + { + return $this->get('contributionOrdinal'); + } + + /** + * @param int $value + */ + public function setContributionOrdinal($value): self + { + $this->set('contributionOrdinal', $value); + return $this; + } + + public function hasContributionOrdinal(): bool + { + return $this->has('contributionOrdinal'); + } + + public function unsetContributionOrdinal(): self + { + $this->remove('contributionOrdinal'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchContribution', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'contributionId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'contributorId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'contributionType', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ContributionType', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'mainContribution', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Boolean', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'firstName', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'lastName', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'fullName', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'contributionOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchContributor.php b/src/GraphQL/Inputs/PatchContributor.php new file mode 100644 index 0000000..c0a79df --- /dev/null +++ b/src/GraphQL/Inputs/PatchContributor.php @@ -0,0 +1,255 @@ +get('contributorId'); + } + + /** + * @param string $value + */ + public function setContributorId($value): self + { + $this->set('contributorId', $value); + return $this; + } + + public function hasContributorId(): bool + { + return $this->has('contributorId'); + } + + public function unsetContributorId(): self + { + $this->remove('contributorId'); + return $this; + } + + /** + * @return string|null + */ + public function getFirstName() + { + return $this->get('firstName'); + } + + /** + * @param string|null $value + */ + public function setFirstName($value): self + { + $this->set('firstName', $value); + return $this; + } + + public function hasFirstName(): bool + { + return $this->has('firstName'); + } + + public function unsetFirstName(): self + { + $this->remove('firstName'); + return $this; + } + + /** + * @return string + */ + public function getLastName() + { + return $this->get('lastName'); + } + + /** + * @param string $value + */ + public function setLastName($value): self + { + $this->set('lastName', $value); + return $this; + } + + public function hasLastName(): bool + { + return $this->has('lastName'); + } + + public function unsetLastName(): self + { + $this->remove('lastName'); + return $this; + } + + /** + * @return string + */ + public function getFullName() + { + return $this->get('fullName'); + } + + /** + * @param string $value + */ + public function setFullName($value): self + { + $this->set('fullName', $value); + return $this; + } + + public function hasFullName(): bool + { + return $this->has('fullName'); + } + + public function unsetFullName(): self + { + $this->remove('fullName'); + return $this; + } + + /** + * @return string|null + */ + public function getOrcid() + { + return $this->get('orcid'); + } + + /** + * @param string|null $value + */ + public function setOrcid($value): self + { + $this->set('orcid', $value); + return $this; + } + + public function hasOrcid(): bool + { + return $this->has('orcid'); + } + + public function unsetOrcid(): self + { + $this->remove('orcid'); + return $this; + } + + /** + * @return string|null + */ + public function getWebsite() + { + return $this->get('website'); + } + + /** + * @param string|null $value + */ + public function setWebsite($value): self + { + $this->set('website', $value); + return $this; + } + + public function hasWebsite(): bool + { + return $this->has('website'); + } + + public function unsetWebsite(): self + { + $this->remove('website'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchContributor', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'contributorId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'firstName', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'lastName', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'fullName', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'orcid', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Orcid', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'website', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchEndorsement.php b/src/GraphQL/Inputs/PatchEndorsement.php new file mode 100644 index 0000000..a50c787 --- /dev/null +++ b/src/GraphQL/Inputs/PatchEndorsement.php @@ -0,0 +1,373 @@ +get('endorsementId'); + } + + /** + * @param string $value + */ + public function setEndorsementId($value): self + { + $this->set('endorsementId', $value); + return $this; + } + + public function hasEndorsementId(): bool + { + return $this->has('endorsementId'); + } + + public function unsetEndorsementId(): self + { + $this->remove('endorsementId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getAuthorName() + { + return $this->get('authorName'); + } + + /** + * @param string $value + */ + public function setAuthorName($value): self + { + $this->set('authorName', $value); + return $this; + } + + public function hasAuthorName(): bool + { + return $this->has('authorName'); + } + + public function unsetAuthorName(): self + { + $this->remove('authorName'); + return $this; + } + + /** + * @return string|null + */ + public function getAuthorRole() + { + return $this->get('authorRole'); + } + + /** + * @param string|null $value + */ + public function setAuthorRole($value): self + { + $this->set('authorRole', $value); + return $this; + } + + public function hasAuthorRole(): bool + { + return $this->has('authorRole'); + } + + public function unsetAuthorRole(): self + { + $this->remove('authorRole'); + return $this; + } + + /** + * @return string|null + */ + public function getAuthorOrcid() + { + return $this->get('authorOrcid'); + } + + /** + * @param string|null $value + */ + public function setAuthorOrcid($value): self + { + $this->set('authorOrcid', $value); + return $this; + } + + public function hasAuthorOrcid(): bool + { + return $this->has('authorOrcid'); + } + + public function unsetAuthorOrcid(): self + { + $this->remove('authorOrcid'); + return $this; + } + + /** + * @return string|null + */ + public function getAuthorInstitutionId() + { + return $this->get('authorInstitutionId'); + } + + /** + * @param string|null $value + */ + public function setAuthorInstitutionId($value): self + { + $this->set('authorInstitutionId', $value); + return $this; + } + + public function hasAuthorInstitutionId(): bool + { + return $this->has('authorInstitutionId'); + } + + public function unsetAuthorInstitutionId(): self + { + $this->remove('authorInstitutionId'); + return $this; + } + + /** + * @return string|null + */ + public function getUrl() + { + return $this->get('url'); + } + + /** + * @param string|null $value + */ + public function setUrl($value): self + { + $this->set('url', $value); + return $this; + } + + public function hasUrl(): bool + { + return $this->has('url'); + } + + public function unsetUrl(): self + { + $this->remove('url'); + return $this; + } + + /** + * @return string|null + */ + public function getText() + { + return $this->get('text'); + } + + /** + * @param string|null $value + */ + public function setText($value): self + { + $this->set('text', $value); + return $this; + } + + public function hasText(): bool + { + return $this->has('text'); + } + + public function unsetText(): self + { + $this->remove('text'); + return $this; + } + + /** + * @return int + */ + public function getEndorsementOrdinal() + { + return $this->get('endorsementOrdinal'); + } + + /** + * @param int $value + */ + public function setEndorsementOrdinal($value): self + { + $this->set('endorsementOrdinal', $value); + return $this; + } + + public function hasEndorsementOrdinal(): bool + { + return $this->has('endorsementOrdinal'); + } + + public function unsetEndorsementOrdinal(): self + { + $this->remove('endorsementOrdinal'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchEndorsement', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'endorsementId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'authorName', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'authorRole', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'authorOrcid', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Orcid', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'authorInstitutionId', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'url', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'text', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'endorsementOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchFunding.php b/src/GraphQL/Inputs/PatchFunding.php new file mode 100644 index 0000000..a12be48 --- /dev/null +++ b/src/GraphQL/Inputs/PatchFunding.php @@ -0,0 +1,293 @@ +get('fundingId'); + } + + /** + * @param string $value + */ + public function setFundingId($value): self + { + $this->set('fundingId', $value); + return $this; + } + + public function hasFundingId(): bool + { + return $this->has('fundingId'); + } + + public function unsetFundingId(): self + { + $this->remove('fundingId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getInstitutionId() + { + return $this->get('institutionId'); + } + + /** + * @param string $value + */ + public function setInstitutionId($value): self + { + $this->set('institutionId', $value); + return $this; + } + + public function hasInstitutionId(): bool + { + return $this->has('institutionId'); + } + + public function unsetInstitutionId(): self + { + $this->remove('institutionId'); + return $this; + } + + /** + * @return string|null + */ + public function getProgram() + { + return $this->get('program'); + } + + /** + * @param string|null $value + */ + public function setProgram($value): self + { + $this->set('program', $value); + return $this; + } + + public function hasProgram(): bool + { + return $this->has('program'); + } + + public function unsetProgram(): self + { + $this->remove('program'); + return $this; + } + + /** + * @return string|null + */ + public function getProjectName() + { + return $this->get('projectName'); + } + + /** + * @param string|null $value + */ + public function setProjectName($value): self + { + $this->set('projectName', $value); + return $this; + } + + public function hasProjectName(): bool + { + return $this->has('projectName'); + } + + public function unsetProjectName(): self + { + $this->remove('projectName'); + return $this; + } + + /** + * @return string|null + */ + public function getProjectShortname() + { + return $this->get('projectShortname'); + } + + /** + * @param string|null $value + */ + public function setProjectShortname($value): self + { + $this->set('projectShortname', $value); + return $this; + } + + public function hasProjectShortname(): bool + { + return $this->has('projectShortname'); + } + + public function unsetProjectShortname(): self + { + $this->remove('projectShortname'); + return $this; + } + + /** + * @return string|null + */ + public function getGrantNumber() + { + return $this->get('grantNumber'); + } + + /** + * @param string|null $value + */ + public function setGrantNumber($value): self + { + $this->set('grantNumber', $value); + return $this; + } + + public function hasGrantNumber(): bool + { + return $this->has('grantNumber'); + } + + public function unsetGrantNumber(): self + { + $this->remove('grantNumber'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchFunding', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'fundingId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'institutionId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'program', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'projectName', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'projectShortname', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'grantNumber', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchImprint.php b/src/GraphQL/Inputs/PatchImprint.php new file mode 100644 index 0000000..69327f8 --- /dev/null +++ b/src/GraphQL/Inputs/PatchImprint.php @@ -0,0 +1,445 @@ +get('imprintId'); + } + + /** + * @param string $value + */ + public function setImprintId($value): self + { + $this->set('imprintId', $value); + return $this; + } + + public function hasImprintId(): bool + { + return $this->has('imprintId'); + } + + public function unsetImprintId(): self + { + $this->remove('imprintId'); + return $this; + } + + /** + * @return string + */ + public function getPublisherId() + { + return $this->get('publisherId'); + } + + /** + * @param string $value + */ + public function setPublisherId($value): self + { + $this->set('publisherId', $value); + return $this; + } + + public function hasPublisherId(): bool + { + return $this->has('publisherId'); + } + + public function unsetPublisherId(): self + { + $this->remove('publisherId'); + return $this; + } + + /** + * @return string + */ + public function getImprintName() + { + return $this->get('imprintName'); + } + + /** + * @param string $value + */ + public function setImprintName($value): self + { + $this->set('imprintName', $value); + return $this; + } + + public function hasImprintName(): bool + { + return $this->has('imprintName'); + } + + public function unsetImprintName(): self + { + $this->remove('imprintName'); + return $this; + } + + /** + * @return string|null + */ + public function getImprintUrl() + { + return $this->get('imprintUrl'); + } + + /** + * @param string|null $value + */ + public function setImprintUrl($value): self + { + $this->set('imprintUrl', $value); + return $this; + } + + public function hasImprintUrl(): bool + { + return $this->has('imprintUrl'); + } + + public function unsetImprintUrl(): self + { + $this->remove('imprintUrl'); + return $this; + } + + /** + * @return string|null + */ + public function getCrossmarkDoi() + { + return $this->get('crossmarkDoi'); + } + + /** + * @param string|null $value + */ + public function setCrossmarkDoi($value): self + { + $this->set('crossmarkDoi', $value); + return $this; + } + + public function hasCrossmarkDoi(): bool + { + return $this->has('crossmarkDoi'); + } + + public function unsetCrossmarkDoi(): self + { + $this->remove('crossmarkDoi'); + return $this; + } + + /** + * @return string|null + */ + public function getS3Bucket() + { + return $this->get('s3Bucket'); + } + + /** + * @param string|null $value + */ + public function setS3Bucket($value): self + { + $this->set('s3Bucket', $value); + return $this; + } + + public function hasS3Bucket(): bool + { + return $this->has('s3Bucket'); + } + + public function unsetS3Bucket(): self + { + $this->remove('s3Bucket'); + return $this; + } + + /** + * @return string|null + */ + public function getCdnDomain() + { + return $this->get('cdnDomain'); + } + + /** + * @param string|null $value + */ + public function setCdnDomain($value): self + { + $this->set('cdnDomain', $value); + return $this; + } + + public function hasCdnDomain(): bool + { + return $this->has('cdnDomain'); + } + + public function unsetCdnDomain(): self + { + $this->remove('cdnDomain'); + return $this; + } + + /** + * @return string|null + */ + public function getCloudfrontDistId() + { + return $this->get('cloudfrontDistId'); + } + + /** + * @param string|null $value + */ + public function setCloudfrontDistId($value): self + { + $this->set('cloudfrontDistId', $value); + return $this; + } + + public function hasCloudfrontDistId(): bool + { + return $this->has('cloudfrontDistId'); + } + + public function unsetCloudfrontDistId(): self + { + $this->remove('cloudfrontDistId'); + return $this; + } + + /** + * @return string|null + */ + public function getDefaultCurrency() + { + return $this->get('defaultCurrency'); + } + + /** + * @param string|null $value + */ + public function setDefaultCurrency($value): self + { + $this->set('defaultCurrency', $value); + return $this; + } + + public function hasDefaultCurrency(): bool + { + return $this->has('defaultCurrency'); + } + + public function unsetDefaultCurrency(): self + { + $this->remove('defaultCurrency'); + return $this; + } + + /** + * @return string|null + */ + public function getDefaultPlace() + { + return $this->get('defaultPlace'); + } + + /** + * @param string|null $value + */ + public function setDefaultPlace($value): self + { + $this->set('defaultPlace', $value); + return $this; + } + + public function hasDefaultPlace(): bool + { + return $this->has('defaultPlace'); + } + + public function unsetDefaultPlace(): self + { + $this->remove('defaultPlace'); + return $this; + } + + /** + * @return string|null + */ + public function getDefaultLocale() + { + return $this->get('defaultLocale'); + } + + /** + * @param string|null $value + */ + public function setDefaultLocale($value): self + { + $this->set('defaultLocale', $value); + return $this; + } + + public function hasDefaultLocale(): bool + { + return $this->has('defaultLocale'); + } + + public function unsetDefaultLocale(): self + { + $this->remove('defaultLocale'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchImprint', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'imprintId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publisherId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'imprintName', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'imprintUrl', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'crossmarkDoi', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 's3Bucket', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'cdnDomain', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'cloudfrontDistId', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'defaultCurrency', + 'description' => null, + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'CurrencyCode', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'defaultPlace', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'defaultLocale', + 'description' => null, + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'LocaleCode', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchInstitution.php b/src/GraphQL/Inputs/PatchInstitution.php new file mode 100644 index 0000000..f96aaa9 --- /dev/null +++ b/src/GraphQL/Inputs/PatchInstitution.php @@ -0,0 +1,213 @@ +get('institutionId'); + } + + /** + * @param string $value + */ + public function setInstitutionId($value): self + { + $this->set('institutionId', $value); + return $this; + } + + public function hasInstitutionId(): bool + { + return $this->has('institutionId'); + } + + public function unsetInstitutionId(): self + { + $this->remove('institutionId'); + return $this; + } + + /** + * @return string + */ + public function getInstitutionName() + { + return $this->get('institutionName'); + } + + /** + * @param string $value + */ + public function setInstitutionName($value): self + { + $this->set('institutionName', $value); + return $this; + } + + public function hasInstitutionName(): bool + { + return $this->has('institutionName'); + } + + public function unsetInstitutionName(): self + { + $this->remove('institutionName'); + return $this; + } + + /** + * @return string|null + */ + public function getInstitutionDoi() + { + return $this->get('institutionDoi'); + } + + /** + * @param string|null $value + */ + public function setInstitutionDoi($value): self + { + $this->set('institutionDoi', $value); + return $this; + } + + public function hasInstitutionDoi(): bool + { + return $this->has('institutionDoi'); + } + + public function unsetInstitutionDoi(): self + { + $this->remove('institutionDoi'); + return $this; + } + + /** + * @return string|null + */ + public function getRor() + { + return $this->get('ror'); + } + + /** + * @param string|null $value + */ + public function setRor($value): self + { + $this->set('ror', $value); + return $this; + } + + public function hasRor(): bool + { + return $this->has('ror'); + } + + public function unsetRor(): self + { + $this->remove('ror'); + return $this; + } + + /** + * @return string|null + */ + public function getCountryCode() + { + return $this->get('countryCode'); + } + + /** + * @param string|null $value + */ + public function setCountryCode($value): self + { + $this->set('countryCode', $value); + return $this; + } + + public function hasCountryCode(): bool + { + return $this->has('countryCode'); + } + + public function unsetCountryCode(): self + { + $this->remove('countryCode'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchInstitution', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'institutionId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'institutionName', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'institutionDoi', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'ror', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Ror', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'countryCode', + 'description' => null, + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'CountryCode', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchIssue.php b/src/GraphQL/Inputs/PatchIssue.php new file mode 100644 index 0000000..dc37698 --- /dev/null +++ b/src/GraphQL/Inputs/PatchIssue.php @@ -0,0 +1,221 @@ +get('issueId'); + } + + /** + * @param string $value + */ + public function setIssueId($value): self + { + $this->set('issueId', $value); + return $this; + } + + public function hasIssueId(): bool + { + return $this->has('issueId'); + } + + public function unsetIssueId(): self + { + $this->remove('issueId'); + return $this; + } + + /** + * @return string + */ + public function getSeriesId() + { + return $this->get('seriesId'); + } + + /** + * @param string $value + */ + public function setSeriesId($value): self + { + $this->set('seriesId', $value); + return $this; + } + + public function hasSeriesId(): bool + { + return $this->has('seriesId'); + } + + public function unsetSeriesId(): self + { + $this->remove('seriesId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return int + */ + public function getIssueOrdinal() + { + return $this->get('issueOrdinal'); + } + + /** + * @param int $value + */ + public function setIssueOrdinal($value): self + { + $this->set('issueOrdinal', $value); + return $this; + } + + public function hasIssueOrdinal(): bool + { + return $this->has('issueOrdinal'); + } + + public function unsetIssueOrdinal(): self + { + $this->remove('issueOrdinal'); + return $this; + } + + /** + * @return int|null + */ + public function getIssueNumber() + { + return $this->get('issueNumber'); + } + + /** + * @param int|null $value + */ + public function setIssueNumber($value): self + { + $this->set('issueNumber', $value); + return $this; + } + + public function hasIssueNumber(): bool + { + return $this->has('issueNumber'); + } + + public function unsetIssueNumber(): self + { + $this->remove('issueNumber'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchIssue', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'issueId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'seriesId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'issueOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'issueNumber', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchLanguage.php b/src/GraphQL/Inputs/PatchLanguage.php new file mode 100644 index 0000000..43fc5dd --- /dev/null +++ b/src/GraphQL/Inputs/PatchLanguage.php @@ -0,0 +1,183 @@ +get('languageId'); + } + + /** + * @param string $value + */ + public function setLanguageId($value): self + { + $this->set('languageId', $value); + return $this; + } + + public function hasLanguageId(): bool + { + return $this->has('languageId'); + } + + public function unsetLanguageId(): self + { + $this->remove('languageId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getLanguageCode() + { + return $this->get('languageCode'); + } + + /** + * @param string $value + */ + public function setLanguageCode($value): self + { + $this->set('languageCode', $value); + return $this; + } + + public function hasLanguageCode(): bool + { + return $this->has('languageCode'); + } + + public function unsetLanguageCode(): self + { + $this->remove('languageCode'); + return $this; + } + + /** + * @return string + */ + public function getLanguageRelation() + { + return $this->get('languageRelation'); + } + + /** + * @param string $value + */ + public function setLanguageRelation($value): self + { + $this->set('languageRelation', $value); + return $this; + } + + public function hasLanguageRelation(): bool + { + return $this->has('languageRelation'); + } + + public function unsetLanguageRelation(): self + { + $this->remove('languageRelation'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchLanguage', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'languageId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'languageCode', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LanguageCode', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'languageRelation', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LanguageRelation', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchLocation.php b/src/GraphQL/Inputs/PatchLocation.php new file mode 100644 index 0000000..2288b1f --- /dev/null +++ b/src/GraphQL/Inputs/PatchLocation.php @@ -0,0 +1,335 @@ +get('locationId'); + } + + /** + * @param string $value + */ + public function setLocationId($value): self + { + $this->set('locationId', $value); + return $this; + } + + public function hasLocationId(): bool + { + return $this->has('locationId'); + } + + public function unsetLocationId(): self + { + $this->remove('locationId'); + return $this; + } + + /** + * @return string + */ + public function getPublicationId() + { + return $this->get('publicationId'); + } + + /** + * @param string $value + */ + public function setPublicationId($value): self + { + $this->set('publicationId', $value); + return $this; + } + + public function hasPublicationId(): bool + { + return $this->has('publicationId'); + } + + public function unsetPublicationId(): self + { + $this->remove('publicationId'); + return $this; + } + + /** + * @return string|null + */ + public function getLandingPage() + { + return $this->get('landingPage'); + } + + /** + * @param string|null $value + */ + public function setLandingPage($value): self + { + $this->set('landingPage', $value); + return $this; + } + + public function hasLandingPage(): bool + { + return $this->has('landingPage'); + } + + public function unsetLandingPage(): self + { + $this->remove('landingPage'); + return $this; + } + + /** + * @return string|null + */ + public function getFullTextUrl() + { + return $this->get('fullTextUrl'); + } + + /** + * @param string|null $value + */ + public function setFullTextUrl($value): self + { + $this->set('fullTextUrl', $value); + return $this; + } + + public function hasFullTextUrl(): bool + { + return $this->has('fullTextUrl'); + } + + public function unsetFullTextUrl(): self + { + $this->remove('fullTextUrl'); + return $this; + } + + /** + * @return string + */ + public function getLocationPlatform() + { + return $this->get('locationPlatform'); + } + + /** + * @param string $value + */ + public function setLocationPlatform($value): self + { + $this->set('locationPlatform', $value); + return $this; + } + + public function hasLocationPlatform(): bool + { + return $this->has('locationPlatform'); + } + + public function unsetLocationPlatform(): self + { + $this->remove('locationPlatform'); + return $this; + } + + /** + * @return bool + */ + public function getCanonical() + { + return $this->get('canonical'); + } + + /** + * @param bool $value + */ + public function setCanonical($value): self + { + $this->set('canonical', $value); + return $this; + } + + public function hasCanonical(): bool + { + return $this->has('canonical'); + } + + public function unsetCanonical(): self + { + $this->remove('canonical'); + return $this; + } + + /** + * @return string|null + */ + public function getChecksum() + { + return $this->get('checksum'); + } + + /** + * @param string|null $value + */ + public function setChecksum($value): self + { + $this->set('checksum', $value); + return $this; + } + + public function hasChecksum(): bool + { + return $this->has('checksum'); + } + + public function unsetChecksum(): self + { + $this->remove('checksum'); + return $this; + } + + /** + * @return string|null + */ + public function getChecksumAlgorithm() + { + return $this->get('checksumAlgorithm'); + } + + /** + * @param string|null $value + */ + public function setChecksumAlgorithm($value): self + { + $this->set('checksumAlgorithm', $value); + return $this; + } + + public function hasChecksumAlgorithm(): bool + { + return $this->has('checksumAlgorithm'); + } + + public function unsetChecksumAlgorithm(): self + { + $this->remove('checksumAlgorithm'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchLocation', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'locationId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publicationId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'landingPage', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'fullTextUrl', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'locationPlatform', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocationPlatform', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'canonical', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Boolean', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'checksum', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'checksumAlgorithm', + 'description' => null, + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'ChecksumAlgorithm', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchPrice.php b/src/GraphQL/Inputs/PatchPrice.php new file mode 100644 index 0000000..b9b9720 --- /dev/null +++ b/src/GraphQL/Inputs/PatchPrice.php @@ -0,0 +1,183 @@ +get('priceId'); + } + + /** + * @param string $value + */ + public function setPriceId($value): self + { + $this->set('priceId', $value); + return $this; + } + + public function hasPriceId(): bool + { + return $this->has('priceId'); + } + + public function unsetPriceId(): self + { + $this->remove('priceId'); + return $this; + } + + /** + * @return string + */ + public function getPublicationId() + { + return $this->get('publicationId'); + } + + /** + * @param string $value + */ + public function setPublicationId($value): self + { + $this->set('publicationId', $value); + return $this; + } + + public function hasPublicationId(): bool + { + return $this->has('publicationId'); + } + + public function unsetPublicationId(): self + { + $this->remove('publicationId'); + return $this; + } + + /** + * @return string + */ + public function getCurrencyCode() + { + return $this->get('currencyCode'); + } + + /** + * @param string $value + */ + public function setCurrencyCode($value): self + { + $this->set('currencyCode', $value); + return $this; + } + + public function hasCurrencyCode(): bool + { + return $this->has('currencyCode'); + } + + public function unsetCurrencyCode(): self + { + $this->remove('currencyCode'); + return $this; + } + + /** + * @return float + */ + public function getUnitPrice() + { + return $this->get('unitPrice'); + } + + /** + * @param float $value + */ + public function setUnitPrice($value): self + { + $this->set('unitPrice', $value); + return $this; + } + + public function hasUnitPrice(): bool + { + return $this->has('unitPrice'); + } + + public function unsetUnitPrice(): self + { + $this->remove('unitPrice'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchPrice', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'priceId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publicationId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'currencyCode', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'CurrencyCode', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'unitPrice', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchPublication.php b/src/GraphQL/Inputs/PatchPublication.php new file mode 100644 index 0000000..06109f2 --- /dev/null +++ b/src/GraphQL/Inputs/PatchPublication.php @@ -0,0 +1,635 @@ +get('publicationId'); + } + + /** + * @param string $value + */ + public function setPublicationId($value): self + { + $this->set('publicationId', $value); + return $this; + } + + public function hasPublicationId(): bool + { + return $this->has('publicationId'); + } + + public function unsetPublicationId(): self + { + $this->remove('publicationId'); + return $this; + } + + /** + * @return string + */ + public function getPublicationType() + { + return $this->get('publicationType'); + } + + /** + * @param string $value + */ + public function setPublicationType($value): self + { + $this->set('publicationType', $value); + return $this; + } + + public function hasPublicationType(): bool + { + return $this->has('publicationType'); + } + + public function unsetPublicationType(): self + { + $this->remove('publicationType'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string|null + */ + public function getIsbn() + { + return $this->get('isbn'); + } + + /** + * @param string|null $value + */ + public function setIsbn($value): self + { + $this->set('isbn', $value); + return $this; + } + + public function hasIsbn(): bool + { + return $this->has('isbn'); + } + + public function unsetIsbn(): self + { + $this->remove('isbn'); + return $this; + } + + /** + * @return float|null + */ + public function getWidthMm() + { + return $this->get('widthMm'); + } + + /** + * @param float|null $value + */ + public function setWidthMm($value): self + { + $this->set('widthMm', $value); + return $this; + } + + public function hasWidthMm(): bool + { + return $this->has('widthMm'); + } + + public function unsetWidthMm(): self + { + $this->remove('widthMm'); + return $this; + } + + /** + * @return float|null + */ + public function getWidthIn() + { + return $this->get('widthIn'); + } + + /** + * @param float|null $value + */ + public function setWidthIn($value): self + { + $this->set('widthIn', $value); + return $this; + } + + public function hasWidthIn(): bool + { + return $this->has('widthIn'); + } + + public function unsetWidthIn(): self + { + $this->remove('widthIn'); + return $this; + } + + /** + * @return float|null + */ + public function getHeightMm() + { + return $this->get('heightMm'); + } + + /** + * @param float|null $value + */ + public function setHeightMm($value): self + { + $this->set('heightMm', $value); + return $this; + } + + public function hasHeightMm(): bool + { + return $this->has('heightMm'); + } + + public function unsetHeightMm(): self + { + $this->remove('heightMm'); + return $this; + } + + /** + * @return float|null + */ + public function getHeightIn() + { + return $this->get('heightIn'); + } + + /** + * @param float|null $value + */ + public function setHeightIn($value): self + { + $this->set('heightIn', $value); + return $this; + } + + public function hasHeightIn(): bool + { + return $this->has('heightIn'); + } + + public function unsetHeightIn(): self + { + $this->remove('heightIn'); + return $this; + } + + /** + * @return float|null + */ + public function getDepthMm() + { + return $this->get('depthMm'); + } + + /** + * @param float|null $value + */ + public function setDepthMm($value): self + { + $this->set('depthMm', $value); + return $this; + } + + public function hasDepthMm(): bool + { + return $this->has('depthMm'); + } + + public function unsetDepthMm(): self + { + $this->remove('depthMm'); + return $this; + } + + /** + * @return float|null + */ + public function getDepthIn() + { + return $this->get('depthIn'); + } + + /** + * @param float|null $value + */ + public function setDepthIn($value): self + { + $this->set('depthIn', $value); + return $this; + } + + public function hasDepthIn(): bool + { + return $this->has('depthIn'); + } + + public function unsetDepthIn(): self + { + $this->remove('depthIn'); + return $this; + } + + /** + * @return float|null + */ + public function getWeightG() + { + return $this->get('weightG'); + } + + /** + * @param float|null $value + */ + public function setWeightG($value): self + { + $this->set('weightG', $value); + return $this; + } + + public function hasWeightG(): bool + { + return $this->has('weightG'); + } + + public function unsetWeightG(): self + { + $this->remove('weightG'); + return $this; + } + + /** + * @return float|null + */ + public function getWeightOz() + { + return $this->get('weightOz'); + } + + /** + * @param float|null $value + */ + public function setWeightOz($value): self + { + $this->set('weightOz', $value); + return $this; + } + + public function hasWeightOz(): bool + { + return $this->has('weightOz'); + } + + public function unsetWeightOz(): self + { + $this->remove('weightOz'); + return $this; + } + + /** + * @return string|null + */ + public function getAccessibilityStandard() + { + return $this->get('accessibilityStandard'); + } + + /** + * @param string|null $value + */ + public function setAccessibilityStandard($value): self + { + $this->set('accessibilityStandard', $value); + return $this; + } + + public function hasAccessibilityStandard(): bool + { + return $this->has('accessibilityStandard'); + } + + public function unsetAccessibilityStandard(): self + { + $this->remove('accessibilityStandard'); + return $this; + } + + /** + * @return string|null + */ + public function getAccessibilityAdditionalStandard() + { + return $this->get('accessibilityAdditionalStandard'); + } + + /** + * @param string|null $value + */ + public function setAccessibilityAdditionalStandard($value): self + { + $this->set('accessibilityAdditionalStandard', $value); + return $this; + } + + public function hasAccessibilityAdditionalStandard(): bool + { + return $this->has('accessibilityAdditionalStandard'); + } + + public function unsetAccessibilityAdditionalStandard(): self + { + $this->remove('accessibilityAdditionalStandard'); + return $this; + } + + /** + * @return string|null + */ + public function getAccessibilityException() + { + return $this->get('accessibilityException'); + } + + /** + * @param string|null $value + */ + public function setAccessibilityException($value): self + { + $this->set('accessibilityException', $value); + return $this; + } + + public function hasAccessibilityException(): bool + { + return $this->has('accessibilityException'); + } + + public function unsetAccessibilityException(): self + { + $this->remove('accessibilityException'); + return $this; + } + + /** + * @return string|null + */ + public function getAccessibilityReportUrl() + { + return $this->get('accessibilityReportUrl'); + } + + /** + * @param string|null $value + */ + public function setAccessibilityReportUrl($value): self + { + $this->set('accessibilityReportUrl', $value); + return $this; + } + + public function hasAccessibilityReportUrl(): bool + { + return $this->has('accessibilityReportUrl'); + } + + public function unsetAccessibilityReportUrl(): self + { + $this->remove('accessibilityReportUrl'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchPublication', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publicationId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publicationType', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'PublicationType', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'isbn', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Isbn', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'widthMm', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'widthIn', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'heightMm', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'heightIn', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'depthMm', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'depthIn', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'weightG', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'weightOz', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'accessibilityStandard', + 'description' => null, + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'AccessibilityStandard', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'accessibilityAdditionalStandard', + 'description' => null, + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'AccessibilityStandard', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'accessibilityException', + 'description' => null, + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'AccessibilityException', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'accessibilityReportUrl', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchPublisher.php b/src/GraphQL/Inputs/PatchPublisher.php new file mode 100644 index 0000000..d75e33b --- /dev/null +++ b/src/GraphQL/Inputs/PatchPublisher.php @@ -0,0 +1,289 @@ +get('publisherId'); + } + + /** + * @param string $value + */ + public function setPublisherId($value): self + { + $this->set('publisherId', $value); + return $this; + } + + public function hasPublisherId(): bool + { + return $this->has('publisherId'); + } + + public function unsetPublisherId(): self + { + $this->remove('publisherId'); + return $this; + } + + /** + * @return string + */ + public function getPublisherName() + { + return $this->get('publisherName'); + } + + /** + * @param string $value + */ + public function setPublisherName($value): self + { + $this->set('publisherName', $value); + return $this; + } + + public function hasPublisherName(): bool + { + return $this->has('publisherName'); + } + + public function unsetPublisherName(): self + { + $this->remove('publisherName'); + return $this; + } + + /** + * @return string|null + */ + public function getPublisherShortname() + { + return $this->get('publisherShortname'); + } + + /** + * @param string|null $value + */ + public function setPublisherShortname($value): self + { + $this->set('publisherShortname', $value); + return $this; + } + + public function hasPublisherShortname(): bool + { + return $this->has('publisherShortname'); + } + + public function unsetPublisherShortname(): self + { + $this->remove('publisherShortname'); + return $this; + } + + /** + * @return string|null + */ + public function getPublisherUrl() + { + return $this->get('publisherUrl'); + } + + /** + * @param string|null $value + */ + public function setPublisherUrl($value): self + { + $this->set('publisherUrl', $value); + return $this; + } + + public function hasPublisherUrl(): bool + { + return $this->has('publisherUrl'); + } + + public function unsetPublisherUrl(): self + { + $this->remove('publisherUrl'); + return $this; + } + + /** + * @return string|null + */ + public function getZitadelId() + { + return $this->get('zitadelId'); + } + + /** + * @param string|null $value + */ + public function setZitadelId($value): self + { + $this->set('zitadelId', $value); + return $this; + } + + public function hasZitadelId(): bool + { + return $this->has('zitadelId'); + } + + public function unsetZitadelId(): self + { + $this->remove('zitadelId'); + return $this; + } + + /** + * @return string|null + */ + public function getAccessibilityStatement() + { + return $this->get('accessibilityStatement'); + } + + /** + * @param string|null $value + */ + public function setAccessibilityStatement($value): self + { + $this->set('accessibilityStatement', $value); + return $this; + } + + public function hasAccessibilityStatement(): bool + { + return $this->has('accessibilityStatement'); + } + + public function unsetAccessibilityStatement(): self + { + $this->remove('accessibilityStatement'); + return $this; + } + + /** + * @return string|null + */ + public function getAccessibilityReportUrl() + { + return $this->get('accessibilityReportUrl'); + } + + /** + * @param string|null $value + */ + public function setAccessibilityReportUrl($value): self + { + $this->set('accessibilityReportUrl', $value); + return $this; + } + + public function hasAccessibilityReportUrl(): bool + { + return $this->has('accessibilityReportUrl'); + } + + public function unsetAccessibilityReportUrl(): self + { + $this->remove('accessibilityReportUrl'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchPublisher', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publisherId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publisherName', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publisherShortname', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publisherUrl', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'zitadelId', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'accessibilityStatement', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'accessibilityReportUrl', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchReference.php b/src/GraphQL/Inputs/PatchReference.php new file mode 100644 index 0000000..d907b1d --- /dev/null +++ b/src/GraphQL/Inputs/PatchReference.php @@ -0,0 +1,901 @@ +get('referenceId'); + } + + /** + * @param string $value + */ + public function setReferenceId($value): self + { + $this->set('referenceId', $value); + return $this; + } + + public function hasReferenceId(): bool + { + return $this->has('referenceId'); + } + + public function unsetReferenceId(): self + { + $this->remove('referenceId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return int + */ + public function getReferenceOrdinal() + { + return $this->get('referenceOrdinal'); + } + + /** + * @param int $value + */ + public function setReferenceOrdinal($value): self + { + $this->set('referenceOrdinal', $value); + return $this; + } + + public function hasReferenceOrdinal(): bool + { + return $this->has('referenceOrdinal'); + } + + public function unsetReferenceOrdinal(): self + { + $this->remove('referenceOrdinal'); + return $this; + } + + /** + * @return string|null + */ + public function getDoi() + { + return $this->get('doi'); + } + + /** + * @param string|null $value + */ + public function setDoi($value): self + { + $this->set('doi', $value); + return $this; + } + + public function hasDoi(): bool + { + return $this->has('doi'); + } + + public function unsetDoi(): self + { + $this->remove('doi'); + return $this; + } + + /** + * @return string|null + */ + public function getUnstructuredCitation() + { + return $this->get('unstructuredCitation'); + } + + /** + * @param string|null $value + */ + public function setUnstructuredCitation($value): self + { + $this->set('unstructuredCitation', $value); + return $this; + } + + public function hasUnstructuredCitation(): bool + { + return $this->has('unstructuredCitation'); + } + + public function unsetUnstructuredCitation(): self + { + $this->remove('unstructuredCitation'); + return $this; + } + + /** + * @return string|null + */ + public function getIssn() + { + return $this->get('issn'); + } + + /** + * @param string|null $value + */ + public function setIssn($value): self + { + $this->set('issn', $value); + return $this; + } + + public function hasIssn(): bool + { + return $this->has('issn'); + } + + public function unsetIssn(): self + { + $this->remove('issn'); + return $this; + } + + /** + * @return string|null + */ + public function getIsbn() + { + return $this->get('isbn'); + } + + /** + * @param string|null $value + */ + public function setIsbn($value): self + { + $this->set('isbn', $value); + return $this; + } + + public function hasIsbn(): bool + { + return $this->has('isbn'); + } + + public function unsetIsbn(): self + { + $this->remove('isbn'); + return $this; + } + + /** + * @return string|null + */ + public function getJournalTitle() + { + return $this->get('journalTitle'); + } + + /** + * @param string|null $value + */ + public function setJournalTitle($value): self + { + $this->set('journalTitle', $value); + return $this; + } + + public function hasJournalTitle(): bool + { + return $this->has('journalTitle'); + } + + public function unsetJournalTitle(): self + { + $this->remove('journalTitle'); + return $this; + } + + /** + * @return string|null + */ + public function getArticleTitle() + { + return $this->get('articleTitle'); + } + + /** + * @param string|null $value + */ + public function setArticleTitle($value): self + { + $this->set('articleTitle', $value); + return $this; + } + + public function hasArticleTitle(): bool + { + return $this->has('articleTitle'); + } + + public function unsetArticleTitle(): self + { + $this->remove('articleTitle'); + return $this; + } + + /** + * @return string|null + */ + public function getSeriesTitle() + { + return $this->get('seriesTitle'); + } + + /** + * @param string|null $value + */ + public function setSeriesTitle($value): self + { + $this->set('seriesTitle', $value); + return $this; + } + + public function hasSeriesTitle(): bool + { + return $this->has('seriesTitle'); + } + + public function unsetSeriesTitle(): self + { + $this->remove('seriesTitle'); + return $this; + } + + /** + * @return string|null + */ + public function getVolumeTitle() + { + return $this->get('volumeTitle'); + } + + /** + * @param string|null $value + */ + public function setVolumeTitle($value): self + { + $this->set('volumeTitle', $value); + return $this; + } + + public function hasVolumeTitle(): bool + { + return $this->has('volumeTitle'); + } + + public function unsetVolumeTitle(): self + { + $this->remove('volumeTitle'); + return $this; + } + + /** + * @return int|null + */ + public function getEdition() + { + return $this->get('edition'); + } + + /** + * @param int|null $value + */ + public function setEdition($value): self + { + $this->set('edition', $value); + return $this; + } + + public function hasEdition(): bool + { + return $this->has('edition'); + } + + public function unsetEdition(): self + { + $this->remove('edition'); + return $this; + } + + /** + * @return string|null + */ + public function getAuthor() + { + return $this->get('author'); + } + + /** + * @param string|null $value + */ + public function setAuthor($value): self + { + $this->set('author', $value); + return $this; + } + + public function hasAuthor(): bool + { + return $this->has('author'); + } + + public function unsetAuthor(): self + { + $this->remove('author'); + return $this; + } + + /** + * @return string|null + */ + public function getVolume() + { + return $this->get('volume'); + } + + /** + * @param string|null $value + */ + public function setVolume($value): self + { + $this->set('volume', $value); + return $this; + } + + public function hasVolume(): bool + { + return $this->has('volume'); + } + + public function unsetVolume(): self + { + $this->remove('volume'); + return $this; + } + + /** + * @return string|null + */ + public function getIssue() + { + return $this->get('issue'); + } + + /** + * @param string|null $value + */ + public function setIssue($value): self + { + $this->set('issue', $value); + return $this; + } + + public function hasIssue(): bool + { + return $this->has('issue'); + } + + public function unsetIssue(): self + { + $this->remove('issue'); + return $this; + } + + /** + * @return string|null + */ + public function getFirstPage() + { + return $this->get('firstPage'); + } + + /** + * @param string|null $value + */ + public function setFirstPage($value): self + { + $this->set('firstPage', $value); + return $this; + } + + public function hasFirstPage(): bool + { + return $this->has('firstPage'); + } + + public function unsetFirstPage(): self + { + $this->remove('firstPage'); + return $this; + } + + /** + * @return string|null + */ + public function getComponentNumber() + { + return $this->get('componentNumber'); + } + + /** + * @param string|null $value + */ + public function setComponentNumber($value): self + { + $this->set('componentNumber', $value); + return $this; + } + + public function hasComponentNumber(): bool + { + return $this->has('componentNumber'); + } + + public function unsetComponentNumber(): self + { + $this->remove('componentNumber'); + return $this; + } + + /** + * @return string|null + */ + public function getStandardDesignator() + { + return $this->get('standardDesignator'); + } + + /** + * @param string|null $value + */ + public function setStandardDesignator($value): self + { + $this->set('standardDesignator', $value); + return $this; + } + + public function hasStandardDesignator(): bool + { + return $this->has('standardDesignator'); + } + + public function unsetStandardDesignator(): self + { + $this->remove('standardDesignator'); + return $this; + } + + /** + * @return string|null + */ + public function getStandardsBodyName() + { + return $this->get('standardsBodyName'); + } + + /** + * @param string|null $value + */ + public function setStandardsBodyName($value): self + { + $this->set('standardsBodyName', $value); + return $this; + } + + public function hasStandardsBodyName(): bool + { + return $this->has('standardsBodyName'); + } + + public function unsetStandardsBodyName(): self + { + $this->remove('standardsBodyName'); + return $this; + } + + /** + * @return string|null + */ + public function getStandardsBodyAcronym() + { + return $this->get('standardsBodyAcronym'); + } + + /** + * @param string|null $value + */ + public function setStandardsBodyAcronym($value): self + { + $this->set('standardsBodyAcronym', $value); + return $this; + } + + public function hasStandardsBodyAcronym(): bool + { + return $this->has('standardsBodyAcronym'); + } + + public function unsetStandardsBodyAcronym(): self + { + $this->remove('standardsBodyAcronym'); + return $this; + } + + /** + * @return string|null + */ + public function getUrl() + { + return $this->get('url'); + } + + /** + * @param string|null $value + */ + public function setUrl($value): self + { + $this->set('url', $value); + return $this; + } + + public function hasUrl(): bool + { + return $this->has('url'); + } + + public function unsetUrl(): self + { + $this->remove('url'); + return $this; + } + + /** + * @return string|null + */ + public function getPublicationDate() + { + return $this->get('publicationDate'); + } + + /** + * @param string|null $value + */ + public function setPublicationDate($value): self + { + $this->set('publicationDate', $value); + return $this; + } + + public function hasPublicationDate(): bool + { + return $this->has('publicationDate'); + } + + public function unsetPublicationDate(): self + { + $this->remove('publicationDate'); + return $this; + } + + /** + * @return string|null + */ + public function getRetrievalDate() + { + return $this->get('retrievalDate'); + } + + /** + * @param string|null $value + */ + public function setRetrievalDate($value): self + { + $this->set('retrievalDate', $value); + return $this; + } + + public function hasRetrievalDate(): bool + { + return $this->has('retrievalDate'); + } + + public function unsetRetrievalDate(): self + { + $this->remove('retrievalDate'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchReference', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'referenceId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'referenceOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'doi', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'unstructuredCitation', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'issn', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'isbn', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Isbn', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'journalTitle', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'articleTitle', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'seriesTitle', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'volumeTitle', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'edition', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'author', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'volume', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'issue', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'firstPage', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'componentNumber', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'standardDesignator', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'standardsBodyName', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'standardsBodyAcronym', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'url', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publicationDate', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Date', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'retrievalDate', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Date', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchSeries.php b/src/GraphQL/Inputs/PatchSeries.php new file mode 100644 index 0000000..432f844 --- /dev/null +++ b/src/GraphQL/Inputs/PatchSeries.php @@ -0,0 +1,373 @@ +get('seriesId'); + } + + /** + * @param string $value + */ + public function setSeriesId($value): self + { + $this->set('seriesId', $value); + return $this; + } + + public function hasSeriesId(): bool + { + return $this->has('seriesId'); + } + + public function unsetSeriesId(): self + { + $this->remove('seriesId'); + return $this; + } + + /** + * @return string + */ + public function getSeriesType() + { + return $this->get('seriesType'); + } + + /** + * @param string $value + */ + public function setSeriesType($value): self + { + $this->set('seriesType', $value); + return $this; + } + + public function hasSeriesType(): bool + { + return $this->has('seriesType'); + } + + public function unsetSeriesType(): self + { + $this->remove('seriesType'); + return $this; + } + + /** + * @return string + */ + public function getSeriesName() + { + return $this->get('seriesName'); + } + + /** + * @param string $value + */ + public function setSeriesName($value): self + { + $this->set('seriesName', $value); + return $this; + } + + public function hasSeriesName(): bool + { + return $this->has('seriesName'); + } + + public function unsetSeriesName(): self + { + $this->remove('seriesName'); + return $this; + } + + /** + * @return string|null + */ + public function getIssnPrint() + { + return $this->get('issnPrint'); + } + + /** + * @param string|null $value + */ + public function setIssnPrint($value): self + { + $this->set('issnPrint', $value); + return $this; + } + + public function hasIssnPrint(): bool + { + return $this->has('issnPrint'); + } + + public function unsetIssnPrint(): self + { + $this->remove('issnPrint'); + return $this; + } + + /** + * @return string|null + */ + public function getIssnDigital() + { + return $this->get('issnDigital'); + } + + /** + * @param string|null $value + */ + public function setIssnDigital($value): self + { + $this->set('issnDigital', $value); + return $this; + } + + public function hasIssnDigital(): bool + { + return $this->has('issnDigital'); + } + + public function unsetIssnDigital(): self + { + $this->remove('issnDigital'); + return $this; + } + + /** + * @return string|null + */ + public function getSeriesUrl() + { + return $this->get('seriesUrl'); + } + + /** + * @param string|null $value + */ + public function setSeriesUrl($value): self + { + $this->set('seriesUrl', $value); + return $this; + } + + public function hasSeriesUrl(): bool + { + return $this->has('seriesUrl'); + } + + public function unsetSeriesUrl(): self + { + $this->remove('seriesUrl'); + return $this; + } + + /** + * @return string|null + */ + public function getSeriesDescription() + { + return $this->get('seriesDescription'); + } + + /** + * @param string|null $value + */ + public function setSeriesDescription($value): self + { + $this->set('seriesDescription', $value); + return $this; + } + + public function hasSeriesDescription(): bool + { + return $this->has('seriesDescription'); + } + + public function unsetSeriesDescription(): self + { + $this->remove('seriesDescription'); + return $this; + } + + /** + * @return string|null + */ + public function getSeriesCfpUrl() + { + return $this->get('seriesCfpUrl'); + } + + /** + * @param string|null $value + */ + public function setSeriesCfpUrl($value): self + { + $this->set('seriesCfpUrl', $value); + return $this; + } + + public function hasSeriesCfpUrl(): bool + { + return $this->has('seriesCfpUrl'); + } + + public function unsetSeriesCfpUrl(): self + { + $this->remove('seriesCfpUrl'); + return $this; + } + + /** + * @return string + */ + public function getImprintId() + { + return $this->get('imprintId'); + } + + /** + * @param string $value + */ + public function setImprintId($value): self + { + $this->set('imprintId', $value); + return $this; + } + + public function hasImprintId(): bool + { + return $this->has('imprintId'); + } + + public function unsetImprintId(): self + { + $this->remove('imprintId'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchSeries', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'seriesId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'seriesType', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'SeriesType', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'seriesName', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'issnPrint', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'issnDigital', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'seriesUrl', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'seriesDescription', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'seriesCfpUrl', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'imprintId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchSubject.php b/src/GraphQL/Inputs/PatchSubject.php new file mode 100644 index 0000000..a89c65f --- /dev/null +++ b/src/GraphQL/Inputs/PatchSubject.php @@ -0,0 +1,225 @@ +get('subjectId'); + } + + /** + * @param string $value + */ + public function setSubjectId($value): self + { + $this->set('subjectId', $value); + return $this; + } + + public function hasSubjectId(): bool + { + return $this->has('subjectId'); + } + + public function unsetSubjectId(): self + { + $this->remove('subjectId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getSubjectType() + { + return $this->get('subjectType'); + } + + /** + * @param string $value + */ + public function setSubjectType($value): self + { + $this->set('subjectType', $value); + return $this; + } + + public function hasSubjectType(): bool + { + return $this->has('subjectType'); + } + + public function unsetSubjectType(): self + { + $this->remove('subjectType'); + return $this; + } + + /** + * @return string + */ + public function getSubjectCode() + { + return $this->get('subjectCode'); + } + + /** + * @param string $value + */ + public function setSubjectCode($value): self + { + $this->set('subjectCode', $value); + return $this; + } + + public function hasSubjectCode(): bool + { + return $this->has('subjectCode'); + } + + public function unsetSubjectCode(): self + { + $this->remove('subjectCode'); + return $this; + } + + /** + * @return int + */ + public function getSubjectOrdinal() + { + return $this->get('subjectOrdinal'); + } + + /** + * @param int $value + */ + public function setSubjectOrdinal($value): self + { + $this->set('subjectOrdinal', $value); + return $this; + } + + public function hasSubjectOrdinal(): bool + { + return $this->has('subjectOrdinal'); + } + + public function unsetSubjectOrdinal(): self + { + $this->remove('subjectOrdinal'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchSubject', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'subjectId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'subjectType', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'SubjectType', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'subjectCode', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'subjectOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchTitle.php b/src/GraphQL/Inputs/PatchTitle.php new file mode 100644 index 0000000..6dfe5f2 --- /dev/null +++ b/src/GraphQL/Inputs/PatchTitle.php @@ -0,0 +1,305 @@ +get('titleId'); + } + + /** + * @param string $value + */ + public function setTitleId($value): self + { + $this->set('titleId', $value); + return $this; + } + + public function hasTitleId(): bool + { + return $this->has('titleId'); + } + + public function unsetTitleId(): self + { + $this->remove('titleId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getLocaleCode() + { + return $this->get('localeCode'); + } + + /** + * @param string $value + */ + public function setLocaleCode($value): self + { + $this->set('localeCode', $value); + return $this; + } + + public function hasLocaleCode(): bool + { + return $this->has('localeCode'); + } + + public function unsetLocaleCode(): self + { + $this->remove('localeCode'); + return $this; + } + + /** + * @return string + */ + public function getFullTitle() + { + return $this->get('fullTitle'); + } + + /** + * @param string $value + */ + public function setFullTitle($value): self + { + $this->set('fullTitle', $value); + return $this; + } + + public function hasFullTitle(): bool + { + return $this->has('fullTitle'); + } + + public function unsetFullTitle(): self + { + $this->remove('fullTitle'); + return $this; + } + + /** + * @return string + */ + public function getTitle() + { + return $this->get('title'); + } + + /** + * @param string $value + */ + public function setTitle($value): self + { + $this->set('title', $value); + return $this; + } + + public function hasTitle(): bool + { + return $this->has('title'); + } + + public function unsetTitle(): self + { + $this->remove('title'); + return $this; + } + + /** + * @return string|null + */ + public function getSubtitle() + { + return $this->get('subtitle'); + } + + /** + * @param string|null $value + */ + public function setSubtitle($value): self + { + $this->set('subtitle', $value); + return $this; + } + + public function hasSubtitle(): bool + { + return $this->has('subtitle'); + } + + public function unsetSubtitle(): self + { + $this->remove('subtitle'); + return $this; + } + + /** + * @return bool + */ + public function getCanonical() + { + return $this->get('canonical'); + } + + /** + * @param bool $value + */ + public function setCanonical($value): self + { + $this->set('canonical', $value); + return $this; + } + + public function hasCanonical(): bool + { + return $this->has('canonical'); + } + + public function unsetCanonical(): self + { + $this->remove('canonical'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchTitle', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'titleId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'localeCode', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocaleCode', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'fullTitle', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'title', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'subtitle', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'canonical', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Boolean', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchWork.php b/src/GraphQL/Inputs/PatchWork.php new file mode 100644 index 0000000..af1e5f5 --- /dev/null +++ b/src/GraphQL/Inputs/PatchWork.php @@ -0,0 +1,1171 @@ +get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getWorkType() + { + return $this->get('workType'); + } + + /** + * @param string $value + */ + public function setWorkType($value): self + { + $this->set('workType', $value); + return $this; + } + + public function hasWorkType(): bool + { + return $this->has('workType'); + } + + public function unsetWorkType(): self + { + $this->remove('workType'); + return $this; + } + + /** + * @return string + */ + public function getWorkStatus() + { + return $this->get('workStatus'); + } + + /** + * @param string $value + */ + public function setWorkStatus($value): self + { + $this->set('workStatus', $value); + return $this; + } + + public function hasWorkStatus(): bool + { + return $this->has('workStatus'); + } + + public function unsetWorkStatus(): self + { + $this->remove('workStatus'); + return $this; + } + + /** + * @return string|null + */ + public function getReference() + { + return $this->get('reference'); + } + + /** + * @param string|null $value + */ + public function setReference($value): self + { + $this->set('reference', $value); + return $this; + } + + public function hasReference(): bool + { + return $this->has('reference'); + } + + public function unsetReference(): self + { + $this->remove('reference'); + return $this; + } + + /** + * @return int|null + */ + public function getEdition() + { + return $this->get('edition'); + } + + /** + * @param int|null $value + */ + public function setEdition($value): self + { + $this->set('edition', $value); + return $this; + } + + public function hasEdition(): bool + { + return $this->has('edition'); + } + + public function unsetEdition(): self + { + $this->remove('edition'); + return $this; + } + + /** + * @return string + */ + public function getImprintId() + { + return $this->get('imprintId'); + } + + /** + * @param string $value + */ + public function setImprintId($value): self + { + $this->set('imprintId', $value); + return $this; + } + + public function hasImprintId(): bool + { + return $this->has('imprintId'); + } + + public function unsetImprintId(): self + { + $this->remove('imprintId'); + return $this; + } + + /** + * @return string|null + */ + public function getDoi() + { + return $this->get('doi'); + } + + /** + * @param string|null $value + */ + public function setDoi($value): self + { + $this->set('doi', $value); + return $this; + } + + public function hasDoi(): bool + { + return $this->has('doi'); + } + + public function unsetDoi(): self + { + $this->remove('doi'); + return $this; + } + + /** + * @return string|null + */ + public function getPublicationDate() + { + return $this->get('publicationDate'); + } + + /** + * @param string|null $value + */ + public function setPublicationDate($value): self + { + $this->set('publicationDate', $value); + return $this; + } + + public function hasPublicationDate(): bool + { + return $this->has('publicationDate'); + } + + public function unsetPublicationDate(): self + { + $this->remove('publicationDate'); + return $this; + } + + /** + * @return string|null + */ + public function getWithdrawnDate() + { + return $this->get('withdrawnDate'); + } + + /** + * @param string|null $value + */ + public function setWithdrawnDate($value): self + { + $this->set('withdrawnDate', $value); + return $this; + } + + public function hasWithdrawnDate(): bool + { + return $this->has('withdrawnDate'); + } + + public function unsetWithdrawnDate(): self + { + $this->remove('withdrawnDate'); + return $this; + } + + /** + * @return string|null + */ + public function getPlace() + { + return $this->get('place'); + } + + /** + * @param string|null $value + */ + public function setPlace($value): self + { + $this->set('place', $value); + return $this; + } + + public function hasPlace(): bool + { + return $this->has('place'); + } + + public function unsetPlace(): self + { + $this->remove('place'); + return $this; + } + + /** + * @return int|null + */ + public function getPageCount() + { + return $this->get('pageCount'); + } + + /** + * @param int|null $value + */ + public function setPageCount($value): self + { + $this->set('pageCount', $value); + return $this; + } + + public function hasPageCount(): bool + { + return $this->has('pageCount'); + } + + public function unsetPageCount(): self + { + $this->remove('pageCount'); + return $this; + } + + /** + * @return string|null + */ + public function getPageBreakdown() + { + return $this->get('pageBreakdown'); + } + + /** + * @param string|null $value + */ + public function setPageBreakdown($value): self + { + $this->set('pageBreakdown', $value); + return $this; + } + + public function hasPageBreakdown(): bool + { + return $this->has('pageBreakdown'); + } + + public function unsetPageBreakdown(): self + { + $this->remove('pageBreakdown'); + return $this; + } + + /** + * @return int|null + */ + public function getImageCount() + { + return $this->get('imageCount'); + } + + /** + * @param int|null $value + */ + public function setImageCount($value): self + { + $this->set('imageCount', $value); + return $this; + } + + public function hasImageCount(): bool + { + return $this->has('imageCount'); + } + + public function unsetImageCount(): self + { + $this->remove('imageCount'); + return $this; + } + + /** + * @return int|null + */ + public function getTableCount() + { + return $this->get('tableCount'); + } + + /** + * @param int|null $value + */ + public function setTableCount($value): self + { + $this->set('tableCount', $value); + return $this; + } + + public function hasTableCount(): bool + { + return $this->has('tableCount'); + } + + public function unsetTableCount(): self + { + $this->remove('tableCount'); + return $this; + } + + /** + * @return int|null + */ + public function getAudioCount() + { + return $this->get('audioCount'); + } + + /** + * @param int|null $value + */ + public function setAudioCount($value): self + { + $this->set('audioCount', $value); + return $this; + } + + public function hasAudioCount(): bool + { + return $this->has('audioCount'); + } + + public function unsetAudioCount(): self + { + $this->remove('audioCount'); + return $this; + } + + /** + * @return int|null + */ + public function getVideoCount() + { + return $this->get('videoCount'); + } + + /** + * @param int|null $value + */ + public function setVideoCount($value): self + { + $this->set('videoCount', $value); + return $this; + } + + public function hasVideoCount(): bool + { + return $this->has('videoCount'); + } + + public function unsetVideoCount(): self + { + $this->remove('videoCount'); + return $this; + } + + /** + * @return string|null + */ + public function getLicense() + { + return $this->get('license'); + } + + /** + * @param string|null $value + */ + public function setLicense($value): self + { + $this->set('license', $value); + return $this; + } + + public function hasLicense(): bool + { + return $this->has('license'); + } + + public function unsetLicense(): self + { + $this->remove('license'); + return $this; + } + + /** + * @return string|null + */ + public function getCopyrightHolder() + { + return $this->get('copyrightHolder'); + } + + /** + * @param string|null $value + */ + public function setCopyrightHolder($value): self + { + $this->set('copyrightHolder', $value); + return $this; + } + + public function hasCopyrightHolder(): bool + { + return $this->has('copyrightHolder'); + } + + public function unsetCopyrightHolder(): self + { + $this->remove('copyrightHolder'); + return $this; + } + + /** + * @return string|null + */ + public function getLandingPage() + { + return $this->get('landingPage'); + } + + /** + * @param string|null $value + */ + public function setLandingPage($value): self + { + $this->set('landingPage', $value); + return $this; + } + + public function hasLandingPage(): bool + { + return $this->has('landingPage'); + } + + public function unsetLandingPage(): self + { + $this->remove('landingPage'); + return $this; + } + + /** + * @return string|null + */ + public function getLccn() + { + return $this->get('lccn'); + } + + /** + * @param string|null $value + */ + public function setLccn($value): self + { + $this->set('lccn', $value); + return $this; + } + + public function hasLccn(): bool + { + return $this->has('lccn'); + } + + public function unsetLccn(): self + { + $this->remove('lccn'); + return $this; + } + + /** + * @return string|null + */ + public function getOclc() + { + return $this->get('oclc'); + } + + /** + * @param string|null $value + */ + public function setOclc($value): self + { + $this->set('oclc', $value); + return $this; + } + + public function hasOclc(): bool + { + return $this->has('oclc'); + } + + public function unsetOclc(): self + { + $this->remove('oclc'); + return $this; + } + + /** + * @return string|null + */ + public function getGeneralNote() + { + return $this->get('generalNote'); + } + + /** + * @param string|null $value + */ + public function setGeneralNote($value): self + { + $this->set('generalNote', $value); + return $this; + } + + public function hasGeneralNote(): bool + { + return $this->has('generalNote'); + } + + public function unsetGeneralNote(): self + { + $this->remove('generalNote'); + return $this; + } + + /** + * @return string|null + */ + public function getBibliographyNote() + { + return $this->get('bibliographyNote'); + } + + /** + * @param string|null $value + */ + public function setBibliographyNote($value): self + { + $this->set('bibliographyNote', $value); + return $this; + } + + public function hasBibliographyNote(): bool + { + return $this->has('bibliographyNote'); + } + + public function unsetBibliographyNote(): self + { + $this->remove('bibliographyNote'); + return $this; + } + + /** + * @return string|null + */ + public function getToc() + { + return $this->get('toc'); + } + + /** + * @param string|null $value + */ + public function setToc($value): self + { + $this->set('toc', $value); + return $this; + } + + public function hasToc(): bool + { + return $this->has('toc'); + } + + public function unsetToc(): self + { + $this->remove('toc'); + return $this; + } + + /** + * @return string|null + */ + public function getResourcesDescription() + { + return $this->get('resourcesDescription'); + } + + /** + * @param string|null $value + */ + public function setResourcesDescription($value): self + { + $this->set('resourcesDescription', $value); + return $this; + } + + public function hasResourcesDescription(): bool + { + return $this->has('resourcesDescription'); + } + + public function unsetResourcesDescription(): self + { + $this->remove('resourcesDescription'); + return $this; + } + + /** + * @return string|null + */ + public function getCoverUrl() + { + return $this->get('coverUrl'); + } + + /** + * @param string|null $value + */ + public function setCoverUrl($value): self + { + $this->set('coverUrl', $value); + return $this; + } + + public function hasCoverUrl(): bool + { + return $this->has('coverUrl'); + } + + public function unsetCoverUrl(): self + { + $this->remove('coverUrl'); + return $this; + } + + /** + * @return string|null + */ + public function getCoverCaption() + { + return $this->get('coverCaption'); + } + + /** + * @param string|null $value + */ + public function setCoverCaption($value): self + { + $this->set('coverCaption', $value); + return $this; + } + + public function hasCoverCaption(): bool + { + return $this->has('coverCaption'); + } + + public function unsetCoverCaption(): self + { + $this->remove('coverCaption'); + return $this; + } + + /** + * @return string|null + */ + public function getFirstPage() + { + return $this->get('firstPage'); + } + + /** + * @param string|null $value + */ + public function setFirstPage($value): self + { + $this->set('firstPage', $value); + return $this; + } + + public function hasFirstPage(): bool + { + return $this->has('firstPage'); + } + + public function unsetFirstPage(): self + { + $this->remove('firstPage'); + return $this; + } + + /** + * @return string|null + */ + public function getLastPage() + { + return $this->get('lastPage'); + } + + /** + * @param string|null $value + */ + public function setLastPage($value): self + { + $this->set('lastPage', $value); + return $this; + } + + public function hasLastPage(): bool + { + return $this->has('lastPage'); + } + + public function unsetLastPage(): self + { + $this->remove('lastPage'); + return $this; + } + + /** + * @return string|null + */ + public function getPageInterval() + { + return $this->get('pageInterval'); + } + + /** + * @param string|null $value + */ + public function setPageInterval($value): self + { + $this->set('pageInterval', $value); + return $this; + } + + public function hasPageInterval(): bool + { + return $this->has('pageInterval'); + } + + public function unsetPageInterval(): self + { + $this->remove('pageInterval'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchWork', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workType', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkType', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workStatus', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkStatus', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'reference', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'edition', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'imprintId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'doi', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'publicationDate', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Date', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'withdrawnDate', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Date', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'place', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'pageCount', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'pageBreakdown', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'imageCount', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'tableCount', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'audioCount', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'videoCount', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'license', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'copyrightHolder', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'landingPage', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'lccn', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'oclc', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'generalNote', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'bibliographyNote', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'toc', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'resourcesDescription', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'coverUrl', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'coverCaption', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'firstPage', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'lastPage', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'pageInterval', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchWorkFeaturedVideo.php b/src/GraphQL/Inputs/PatchWorkFeaturedVideo.php new file mode 100644 index 0000000..ad5690a --- /dev/null +++ b/src/GraphQL/Inputs/PatchWorkFeaturedVideo.php @@ -0,0 +1,263 @@ +get('workFeaturedVideoId'); + } + + /** + * @param string $value + */ + public function setWorkFeaturedVideoId($value): self + { + $this->set('workFeaturedVideoId', $value); + return $this; + } + + public function hasWorkFeaturedVideoId(): bool + { + return $this->has('workFeaturedVideoId'); + } + + public function unsetWorkFeaturedVideoId(): self + { + $this->remove('workFeaturedVideoId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getTitle() + { + return $this->get('title'); + } + + /** + * @param string $value + */ + public function setTitle($value): self + { + $this->set('title', $value); + return $this; + } + + public function hasTitle(): bool + { + return $this->has('title'); + } + + public function unsetTitle(): self + { + $this->remove('title'); + return $this; + } + + /** + * @return string|null + */ + public function getUrl() + { + return $this->get('url'); + } + + /** + * @param string|null $value + */ + public function setUrl($value): self + { + $this->set('url', $value); + return $this; + } + + public function hasUrl(): bool + { + return $this->has('url'); + } + + public function unsetUrl(): self + { + $this->remove('url'); + return $this; + } + + /** + * @return int + */ + public function getWidth() + { + return $this->get('width'); + } + + /** + * @param int $value + */ + public function setWidth($value): self + { + $this->set('width', $value); + return $this; + } + + public function hasWidth(): bool + { + return $this->has('width'); + } + + public function unsetWidth(): self + { + $this->remove('width'); + return $this; + } + + /** + * @return int + */ + public function getHeight() + { + return $this->get('height'); + } + + /** + * @param int $value + */ + public function setHeight($value): self + { + $this->set('height', $value); + return $this; + } + + public function hasHeight(): bool + { + return $this->has('height'); + } + + public function unsetHeight(): self + { + $this->remove('height'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchWorkFeaturedVideo', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workFeaturedVideoId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'title', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'url', + 'description' => null, + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'width', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'height', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PatchWorkRelation.php b/src/GraphQL/Inputs/PatchWorkRelation.php new file mode 100644 index 0000000..70d490b --- /dev/null +++ b/src/GraphQL/Inputs/PatchWorkRelation.php @@ -0,0 +1,225 @@ +get('workRelationId'); + } + + /** + * @param string $value + */ + public function setWorkRelationId($value): self + { + $this->set('workRelationId', $value); + return $this; + } + + public function hasWorkRelationId(): bool + { + return $this->has('workRelationId'); + } + + public function unsetWorkRelationId(): self + { + $this->remove('workRelationId'); + return $this; + } + + /** + * @return string + */ + public function getRelatorWorkId() + { + return $this->get('relatorWorkId'); + } + + /** + * @param string $value + */ + public function setRelatorWorkId($value): self + { + $this->set('relatorWorkId', $value); + return $this; + } + + public function hasRelatorWorkId(): bool + { + return $this->has('relatorWorkId'); + } + + public function unsetRelatorWorkId(): self + { + $this->remove('relatorWorkId'); + return $this; + } + + /** + * @return string + */ + public function getRelatedWorkId() + { + return $this->get('relatedWorkId'); + } + + /** + * @param string $value + */ + public function setRelatedWorkId($value): self + { + $this->set('relatedWorkId', $value); + return $this; + } + + public function hasRelatedWorkId(): bool + { + return $this->has('relatedWorkId'); + } + + public function unsetRelatedWorkId(): self + { + $this->remove('relatedWorkId'); + return $this; + } + + /** + * @return string + */ + public function getRelationType() + { + return $this->get('relationType'); + } + + /** + * @param string $value + */ + public function setRelationType($value): self + { + $this->set('relationType', $value); + return $this; + } + + public function hasRelationType(): bool + { + return $this->has('relationType'); + } + + public function unsetRelationType(): self + { + $this->remove('relationType'); + return $this; + } + + /** + * @return int + */ + public function getRelationOrdinal() + { + return $this->get('relationOrdinal'); + } + + /** + * @param int $value + */ + public function setRelationOrdinal($value): self + { + $this->set('relationOrdinal', $value); + return $this; + } + + public function hasRelationOrdinal(): bool + { + return $this->has('relationOrdinal'); + } + + public function unsetRelationOrdinal(): self + { + $this->remove('relationOrdinal'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PatchWorkRelation', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'workRelationId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'relatorWorkId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'relatedWorkId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'relationType', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'RelationType', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'relationOrdinal', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PriceOrderBy.php b/src/GraphQL/Inputs/PriceOrderBy.php new file mode 100644 index 0000000..da6b073 --- /dev/null +++ b/src/GraphQL/Inputs/PriceOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PriceOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'PriceField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PublicationOrderBy.php b/src/GraphQL/Inputs/PublicationOrderBy.php new file mode 100644 index 0000000..31f43d2 --- /dev/null +++ b/src/GraphQL/Inputs/PublicationOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PublicationOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'PublicationField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/PublisherOrderBy.php b/src/GraphQL/Inputs/PublisherOrderBy.php new file mode 100644 index 0000000..555cd8a --- /dev/null +++ b/src/GraphQL/Inputs/PublisherOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('PublisherOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'PublisherField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/ReferenceOrderBy.php b/src/GraphQL/Inputs/ReferenceOrderBy.php new file mode 100644 index 0000000..f9a8050 --- /dev/null +++ b/src/GraphQL/Inputs/ReferenceOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('ReferenceOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ReferenceField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/SeriesOrderBy.php b/src/GraphQL/Inputs/SeriesOrderBy.php new file mode 100644 index 0000000..2efc301 --- /dev/null +++ b/src/GraphQL/Inputs/SeriesOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('SeriesOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'SeriesField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/SubjectOrderBy.php b/src/GraphQL/Inputs/SubjectOrderBy.php new file mode 100644 index 0000000..94bc67d --- /dev/null +++ b/src/GraphQL/Inputs/SubjectOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('SubjectOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'SubjectField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/TimeExpression.php b/src/GraphQL/Inputs/TimeExpression.php new file mode 100644 index 0000000..3098f4c --- /dev/null +++ b/src/GraphQL/Inputs/TimeExpression.php @@ -0,0 +1,99 @@ +get('timestamp'); + } + + /** + * @param string $value + */ + public function setTimestamp($value): self + { + $this->set('timestamp', $value); + return $this; + } + + public function hasTimestamp(): bool + { + return $this->has('timestamp'); + } + + public function unsetTimestamp(): self + { + $this->remove('timestamp'); + return $this; + } + + /** + * @return string + */ + public function getExpression() + { + return $this->get('expression'); + } + + /** + * @param string $value + */ + public function setExpression($value): self + { + $this->set('expression', $value); + return $this; + } + + public function hasExpression(): bool + { + return $this->has('expression'); + } + + public function unsetExpression(): self + { + $this->remove('expression'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('TimeExpression', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'timestamp', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'expression', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Expression', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/TitleOrderBy.php b/src/GraphQL/Inputs/TitleOrderBy.php new file mode 100644 index 0000000..4b3b0fd --- /dev/null +++ b/src/GraphQL/Inputs/TitleOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('TitleOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'TitleField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/WorkFeaturedVideoOrderBy.php b/src/GraphQL/Inputs/WorkFeaturedVideoOrderBy.php new file mode 100644 index 0000000..db74dad --- /dev/null +++ b/src/GraphQL/Inputs/WorkFeaturedVideoOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('WorkFeaturedVideoOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkFeaturedVideoField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/WorkOrderBy.php b/src/GraphQL/Inputs/WorkOrderBy.php new file mode 100644 index 0000000..538553f --- /dev/null +++ b/src/GraphQL/Inputs/WorkOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('WorkOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Inputs/WorkRelationOrderBy.php b/src/GraphQL/Inputs/WorkRelationOrderBy.php new file mode 100644 index 0000000..c84f3c3 --- /dev/null +++ b/src/GraphQL/Inputs/WorkRelationOrderBy.php @@ -0,0 +1,99 @@ +get('field'); + } + + /** + * @param string $value + */ + public function setField($value): self + { + $this->set('field', $value); + return $this; + } + + public function hasField(): bool + { + return $this->has('field'); + } + + public function unsetField(): self + { + $this->remove('field'); + return $this; + } + + /** + * @return string + */ + public function getDirection() + { + return $this->get('direction'); + } + + /** + * @param string $value + */ + public function setDirection($value): self + { + $this->set('direction', $value); + return $this; + } + + public function hasDirection(): bool + { + return $this->has('direction'); + } + + public function unsetDirection(): self + { + $this->remove('direction'); + return $this; + } + + public static function definition(): InputObjectTypeDefinition + { + return new InputObjectTypeDefinition('WorkRelationOrderBy', [ + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'field', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkRelationField', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]), + \ThothApi\GraphQL\Definition\ArgumentDefinition::fromIntrospection([ + 'name' => 'direction', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'Direction', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Models/AbstractModel.php b/src/GraphQL/Models/AbstractModel.php deleted file mode 100644 index 73866b5..0000000 --- a/src/GraphQL/Models/AbstractModel.php +++ /dev/null @@ -1,50 +0,0 @@ -data = $data; - } - - public function getAllData() - { - return $this->data; - } - - public function getData($key) - { - return $this->data[$key] ?? null; - } - - public function setData($key, $value) - { - if ($value !== null) { - $this->data[$key] = $value; - return; - } - - if (array_key_exists($key, $this->data)) { - unset($this->data[$key]); - } - } - - public function __call(string $name, array $arguments) - { - if (preg_match('/^(get|set|is)(.+)$/', $name, $matches) !== 1) { - throw new \BadMethodCallException("Method '{$name}' does not exist."); - } - - $field = lcfirst($matches[2]); - if ($matches[1] === 'set') { - $this->setData($field, $arguments[0] ?? null); - return; - } - - return $this->getData($field); - } -} diff --git a/src/GraphQL/Models/AbstractText.php b/src/GraphQL/Models/AbstractText.php deleted file mode 100644 index fcb5bde..0000000 --- a/src/GraphQL/Models/AbstractText.php +++ /dev/null @@ -1,7 +0,0 @@ -getData('workResourceId'); - } - - public function setAdditionalResourceId(?string $additionalResourceId): void - { - $this->setData('workResourceId', $additionalResourceId); - } -} diff --git a/src/GraphQL/Models/Affiliation.php b/src/GraphQL/Models/Affiliation.php deleted file mode 100644 index afe7ce3..0000000 --- a/src/GraphQL/Models/Affiliation.php +++ /dev/null @@ -1,56 +0,0 @@ -getData('affiliationId'); - } - - public function setAffiliationId(?string $affiliationId): void - { - $this->setData('affiliationId', $affiliationId); - } - - public function getContributionId(): ?string - { - return $this->getData('contributionId'); - } - - public function setContributionId(?string $contributionId): void - { - $this->setData('contributionId', $contributionId); - } - - public function getInstitutionId(): ?string - { - return $this->getData('institutionId'); - } - - public function setInstitutionId(?string $institutionId): void - { - $this->setData('institutionId', $institutionId); - } - - public function getAffiliationOrdinal(): int - { - return $this->getData('affiliationOrdinal'); - } - - public function setAffiliationOrdinal(int $affiliationOrdinal): void - { - $this->setData('affiliationOrdinal', $affiliationOrdinal); - } - - public function getPosition(): ?string - { - return $this->getData('position'); - } - - public function setPosition(?string $position): void - { - $this->setData('position', $position); - } -} diff --git a/src/GraphQL/Models/Award.php b/src/GraphQL/Models/Award.php deleted file mode 100644 index a131bfb..0000000 --- a/src/GraphQL/Models/Award.php +++ /dev/null @@ -1,7 +0,0 @@ -getData('contributionId'); - } - - public function setContributionId(?string $contributionId): void - { - $this->setData('contributionId', $contributionId); - } - - public function getContributorId(): ?string - { - return $this->getData('contributorId'); - } - - public function setContributorId(?string $contributorId): void - { - $this->setData('contributorId', $contributorId); - } - - public function getWorkId(): ?string - { - return $this->getData('workId'); - } - - public function setWorkId(?string $workId): void - { - $this->setData('workId', $workId); - } - - public function getContributionType(): ?string - { - return $this->getData('contributionType'); - } - - public function setContributionType(?string $contributionType): void - { - $this->setData('contributionType', $contributionType); - } - - public function getMainContribution(): ?bool - { - return $this->getData('mainContribution'); - } - - public function setMainContribution(?bool $mainContribution): void - { - $this->setData('mainContribution', $mainContribution); - } - - public function getBiography(): ?string - { - return $this->getData('biography'); - } - - public function setBiography(?string $biography): void - { - $this->setData('biography', $biography); - } - - public function getFirstName(): ?string - { - return $this->getData('firstName'); - } - - public function setFirstName(?string $firstName): void - { - $this->setData('firstName', $firstName); - } - - public function getLastName(): ?string - { - return $this->getData('lastName'); - } - - public function setLastName(?string $lastName): void - { - $this->setData('lastName', $lastName); - } - - public function getFullName(): ?string - { - return $this->getData('fullName'); - } - - public function setFullName(?string $fullName): void - { - $this->setData('fullName', $fullName); - } - - public function getContributionOrdinal(): ?int - { - return $this->getData('contributionOrdinal'); - } - - public function setContributionOrdinal(?int $ContributionOrdinal): void - { - $this->setData('contributionOrdinal', $ContributionOrdinal); - } -} diff --git a/src/GraphQL/Models/Contributor.php b/src/GraphQL/Models/Contributor.php deleted file mode 100644 index 85fef27..0000000 --- a/src/GraphQL/Models/Contributor.php +++ /dev/null @@ -1,66 +0,0 @@ -getData('contributorId'); - } - - public function setContributorId(?string $contributorId): void - { - $this->setData('contributorId', $contributorId); - } - - public function getFirstName(): ?string - { - return $this->getData('firstName'); - } - - public function setFirstName(?string $firstName): void - { - $this->setData('firstName', $firstName); - } - - public function getLastName(): ?string - { - return $this->getData('lastName'); - } - - public function setLastName(?string $lastName): void - { - $this->setData('lastName', $lastName); - } - - public function getFullName(): ?string - { - return $this->getData('fullName'); - } - - public function setFullName(?string $fullName): void - { - $this->setData('fullName', $fullName); - } - - public function getOrcid(): ?string - { - return $this->getData('orcid'); - } - - public function setOrcid(?string $orcid): void - { - $this->setData('orcid', $orcid); - } - - public function getWebsite(): ?string - { - return $this->getData('website'); - } - - public function setWebsite(?string $website): void - { - $this->setData('website', $website); - } -} diff --git a/src/GraphQL/Models/Endorsement.php b/src/GraphQL/Models/Endorsement.php deleted file mode 100644 index ab23ab3..0000000 --- a/src/GraphQL/Models/Endorsement.php +++ /dev/null @@ -1,7 +0,0 @@ -getData('fundingId'); - } - - public function setFundingId(?string $fundingId): void - { - $this->setData('fundingId', $fundingId); - } - - public function getWorkId(): ?string - { - return $this->getData('workId'); - } - - public function setWorkId(?string $workId): void - { - $this->setData('workId', $workId); - } - - public function getInstitutionId(): ?string - { - return $this->getData('institutionId'); - } - - public function setInstitutionId(?string $institutionId): void - { - $this->setData('institutionId', $institutionId); - } - - public function getProgram(): ?string - { - return $this->getData('program'); - } - - public function setProgram(?string $program): void - { - $this->setData('program', $program); - } - - public function getProjectName(): ?string - { - return $this->getData('projectName'); - } - - public function setProjectName(?string $projectName): void - { - $this->setData('projectName', $projectName); - } - - public function getProjectShortName(): ?string - { - return $this->getData('projectShortname'); - } - - public function setProjectShortName(?string $projectShortName): void - { - $this->setData('projectShortname', $projectShortName); - } - - public function getGrantNumber(): ?string - { - return $this->getData('grantNumber'); - } - - public function setGrantNumber(?string $grantNumber): void - { - $this->setData('grantNumber', $grantNumber); - } - - public function getJurisdiction(): ?string - { - return $this->getData('jurisdiction'); - } - - public function setJurisdiction(?string $jurisdiction): void - { - $this->setData('jurisdiction', $jurisdiction); - } -} diff --git a/src/GraphQL/Models/Imprint.php b/src/GraphQL/Models/Imprint.php deleted file mode 100644 index ecf6df4..0000000 --- a/src/GraphQL/Models/Imprint.php +++ /dev/null @@ -1,56 +0,0 @@ -getData('imprintId'); - } - - public function setImprintId(?string $imprintId): void - { - $this->setData('imprintId', $imprintId); - } - - public function getPublisherId(): ?string - { - return $this->getData('publisherId'); - } - - public function setPublisherId(?string $publisherId): void - { - $this->setData('publisherId', $publisherId); - } - - public function getImprintName(): ?string - { - return $this->getData('imprintName'); - } - - public function setImprintName(?string $imprintName): void - { - $this->setData('imprintName', $imprintName); - } - - public function getImprintUrl(): ?string - { - return $this->getData('imprintUrl'); - } - - public function setImprintUrl(?string $imprintUrl): void - { - $this->setData('imprintUrl', $imprintUrl); - } - - public function getCrossmarkDoi(): ?string - { - return $this->getData('crossmarkDoi'); - } - - public function setCrossmarkDoi(?string $crossmarkDoi): void - { - $this->setData('crossmarkDoi', $crossmarkDoi); - } -} diff --git a/src/GraphQL/Models/Institution.php b/src/GraphQL/Models/Institution.php deleted file mode 100644 index d0d17d1..0000000 --- a/src/GraphQL/Models/Institution.php +++ /dev/null @@ -1,56 +0,0 @@ -getData('institutionId'); - } - - public function setInstitutionId(?string $institutionId): void - { - $this->setData('institutionId', $institutionId); - } - - public function getInstitutionName(): ?string - { - return $this->getData('institutionName'); - } - - public function setInstitutionName(?string $institutionName): void - { - $this->setData('institutionName', $institutionName); - } - - public function getInstitutionDoi(): ?string - { - return $this->getData('institutionDoi'); - } - - public function setInstitutionDoi(?string $institutionDoi): void - { - $this->setData('institutionDoi', $institutionDoi); - } - - public function getCountryCode(): ?string - { - return $this->getData('countryCode'); - } - - public function setCountryCode(?string $countryCode): void - { - $this->setData('countryCode', $countryCode); - } - - public function getRor(): ?string - { - return $this->getData('ror'); - } - - public function setRor(?string $ror): void - { - $this->setData('ror', $ror); - } -} diff --git a/src/GraphQL/Models/Issue.php b/src/GraphQL/Models/Issue.php deleted file mode 100644 index 8bf7fef..0000000 --- a/src/GraphQL/Models/Issue.php +++ /dev/null @@ -1,46 +0,0 @@ -getData('issueId'); - } - - public function setIssueId(?string $issueId): void - { - $this->setData('issueId', $issueId); - } - - public function getWorkId(): ?string - { - return $this->getData('workId'); - } - - public function setWorkId(?string $workId): void - { - $this->setData('workId', $workId); - } - - public function getSeriesId(): ?string - { - return $this->getData('seriesId'); - } - - public function setSeriesId(?string $seriesId): void - { - $this->setData('seriesId', $seriesId); - } - - public function getIssueOrdinal(): ?int - { - return $this->getData('issueOrdinal'); - } - - public function setIssueOrdinal(?int $issueOrdinal): void - { - $this->setData('issueOrdinal', $issueOrdinal); - } -} diff --git a/src/GraphQL/Models/Language.php b/src/GraphQL/Models/Language.php deleted file mode 100644 index d59dea2..0000000 --- a/src/GraphQL/Models/Language.php +++ /dev/null @@ -1,60 +0,0 @@ -getData('languageId'); - } - - public function setLanguageId(?string $languageId): void - { - $this->setData('languageId', $languageId); - } - - public function getWorkId(): ?string - { - return $this->getData('workId'); - } - - public function setWorkId(?string $workId): void - { - $this->setData('workId', $workId); - } - - public function getLanguageCode(): ?string - { - return $this->getData('languageCode'); - } - - public function setLanguageCode(?string $languageCode): void - { - $this->setData('languageCode', $languageCode); - } - - public function getLanguageRelation(): ?string - { - return $this->getData('languageRelation'); - } - - public function setLanguageRelation(?string $languageRelation): void - { - $this->setData('languageRelation', $languageRelation); - } - - public function getMainLanguage(): ?bool - { - return $this->getData('mainLanguage'); - } - - public function setMainLanguage(?bool $mainLanguage): void - { - $this->setData('mainLanguage', $mainLanguage); - } -} diff --git a/src/GraphQL/Models/Location.php b/src/GraphQL/Models/Location.php deleted file mode 100644 index d632224..0000000 --- a/src/GraphQL/Models/Location.php +++ /dev/null @@ -1,84 +0,0 @@ -getData('locationId'); - } - - public function setLocationId(?string $locationId): void - { - $this->setData('locationId', $locationId); - } - - public function getPublicationId(): ?string - { - return $this->getData('publicationId'); - } - - public function setPublicationId(?string $publicationId): void - { - $this->setData('publicationId', $publicationId); - } - - public function getLandingPage(): ?string - { - return $this->getData('landingPage'); - } - - public function setLandingPage(?string $landingPage): void - { - $this->setData('landingPage', $landingPage); - } - - public function getFullTextUrl(): ?string - { - return $this->getData('fullTextUrl'); - } - - public function setFullTextUrl(?string $fullTextUrl): void - { - $this->setData('fullTextUrl', $fullTextUrl); - } - - public function getLocationPlatform(): ?string - { - return $this->getData('locationPlatform'); - } - - public function setLocationPlatform(?string $locationPlatform): void - { - $this->setData('locationPlatform', $locationPlatform); - } - - public function getCanonical(): ?bool - { - return $this->getData('canonical'); - } - - public function setCanonical(?bool $canonical): void - { - $this->setData('canonical', $canonical); - } -} diff --git a/src/GraphQL/Models/Me.php b/src/GraphQL/Models/Me.php deleted file mode 100644 index 19e1dc8..0000000 --- a/src/GraphQL/Models/Me.php +++ /dev/null @@ -1,7 +0,0 @@ -getData('priceId'); - } - - public function setPriceId(?string $priceId): void - { - $this->setData('priceId', $priceId); - } - - public function getPublicationId(): ?string - { - return $this->getData('publicationId'); - } - - public function setPublicationId(?string $publicationId): void - { - $this->setData('publicationId', $publicationId); - } - - public function getCurrencyCode(): ?string - { - return $this->getData('currencyCode'); - } - - public function setCurrencyCode(?string $currencyCode): void - { - $this->setData('currencyCode', $currencyCode); - } - - public function getUnitPrice(): ?float - { - return $this->getData('unitPrice'); - } - - public function setUnitPrice(?float $unitPrice): void - { - $this->setData('unitPrice', $unitPrice); - } -} diff --git a/src/GraphQL/Models/Publication.php b/src/GraphQL/Models/Publication.php deleted file mode 100644 index 4ff5a6e..0000000 --- a/src/GraphQL/Models/Publication.php +++ /dev/null @@ -1,171 +0,0 @@ -getData('publicationId'); - } - - public function setPublicationId(?string $publicationId): void - { - $this->setData('publicationId', $publicationId); - } - - public function getWorkId(): ?string - { - return $this->getData('workId'); - } - - public function setWorkId(?string $workId): void - { - $this->setData('workId', $workId); - } - - public function getPublicationType(): ?string - { - return $this->getData('publicationType'); - } - - public function setPublicationType(?string $publicationType): void - { - $this->setData('publicationType', $publicationType); - } - - public function getIsbn(): ?string - { - return $this->getData('isbn'); - } - - public function setIsbn(?string $isbn): void - { - $this->setData('isbn', $isbn); - } - - public function getWidthMm(): ?float - { - return $this->getData('widthMm'); - } - - public function setWidthMm(?float $widthMm, bool $convert = false): void - { - $this->setData('widthMm', $widthMm); - - if ($convert) { - $this->setData('widthIn', $widthMm ? round($widthMm / 25.4, 2) : null); - } - } - - public function getWidthIn(): ?float - { - return $this->getData('widthIn'); - } - - public function setWidthIn(?float $widthIn, bool $convert = false): void - { - $this->setData('widthIn', $widthIn); - - if ($convert) { - $this->setData('widthMm', $widthIn ? round($widthIn * 25.4, 2) : null); - } - } - - public function getHeightMm(): ?float - { - return $this->getData('heightMm'); - } - - public function setHeightMm(?float $heightMm, bool $convert = false): void - { - $this->setData('heightMm', $heightMm); - - if ($convert) { - $this->setData('heightIn', $heightMm ? round($heightMm / 25.4, 2) : null); - } - } - - public function getHeightIn(): ?float - { - return $this->getData('heightIn'); - } - - public function setHeightIn(?float $heightIn, bool $convert = false): void - { - $this->setData('heightIn', $heightIn); - - if ($convert) { - $this->setData('heightMm', $heightIn ? round($heightIn * 25.4, 2) : null); - } - } - - public function getDepthMm(): ?float - { - return $this->getData('depthMm'); - } - - public function setDepthMm(?float $depthMm, bool $convert = false): void - { - $this->setData('depthMm', $depthMm); - - if ($convert) { - $this->setData('depthIn', $depthMm ? round($depthMm / 25.4, 2) : null); - } - } - - public function getDepthIn(): ?float - { - return $this->getData('depthIn'); - } - - public function setDepthIn(?float $depthIn, bool $convert = false): void - { - $this->setData('depthIn', $depthIn); - - if ($convert) { - $this->setData('depthMm', $depthIn ? round($depthIn * 25.4, 2) : null); - } - } - - public function getWeightG(): ?float - { - return $this->getData('weightG'); - } - - public function setWeightG(?float $weightG, bool $convert = false): void - { - $this->setData('weightG', $weightG); - - if ($convert) { - $this->setData('weightOz', $weightG ? round($weightG / 28.349523125, 4) : null); - } - } - - public function getWeightOz(): ?float - { - return $this->getData('weightOz'); - } - - public function setWeightOz(?float $weightOz, bool $convert = false): void - { - $this->setData('weightOz', $weightOz); - - if ($convert) { - $this->setData('weightG', $weightOz ? round($weightOz * 28.349523125, 4) : null); - } - } -} diff --git a/src/GraphQL/Models/Publisher.php b/src/GraphQL/Models/Publisher.php deleted file mode 100644 index 287d413..0000000 --- a/src/GraphQL/Models/Publisher.php +++ /dev/null @@ -1,46 +0,0 @@ -getData('publisherId'); - } - - public function setPublisherId(?string $publisherId): void - { - $this->setData('publisherId', $publisherId); - } - - public function getPublisherName(): ?string - { - return $this->getData('publisherName'); - } - - public function setPublisherName(?string $publisherName): void - { - $this->setData('publisherName', $publisherName); - } - - public function getPublisherShortName(): ?string - { - return $this->getData('publisherShortname'); - } - - public function setPublisherShortName(?string $publisherShortName): void - { - $this->setData('publisherShortname', $publisherShortName); - } - - public function getPublisherUrl(): ?string - { - return $this->getData('publisherUrl'); - } - - public function setPublisherUrl(?string $publisherUrl): void - { - $this->setData('publisherUrl', $publisherUrl); - } -} diff --git a/src/GraphQL/Models/Reference.php b/src/GraphQL/Models/Reference.php deleted file mode 100644 index 29f134c..0000000 --- a/src/GraphQL/Models/Reference.php +++ /dev/null @@ -1,236 +0,0 @@ -getData('referenceId'); - } - - public function setReferenceId(?string $referenceId): void - { - $this->setData('referenceId', $referenceId); - } - - public function getWorkId(): ?string - { - return $this->getData('workId'); - } - - public function setWorkId(?string $workId): void - { - $this->setData('workId', $workId); - } - - public function getReferenceOrdinal(): int - { - return $this->getData('referenceOrdinal'); - } - - public function setReferenceOrdinal(int $referenceOrdinal): void - { - $this->setData('referenceOrdinal', $referenceOrdinal); - } - - public function getDoi(): ?string - { - return $this->getData('doi'); - } - - public function setDoi(?string $doi): void - { - $this->setData('doi', $doi); - } - - public function getUnstructuredCitation(): ?string - { - return $this->getData('unstructuredCitation'); - } - - public function setUnstructuredCitation(?string $unstructuredCitation): void - { - $this->setData('unstructuredCitation', $unstructuredCitation); - } - - public function getIssn(): ?string - { - return $this->getData('issn'); - } - - public function setIssn(?string $issn): void - { - $this->setData('issn', $issn); - } - - public function getIsbn(): ?string - { - return $this->getData('isbn'); - } - - public function setIsbn(?string $isbn): void - { - $this->setData('isbn', $isbn); - } - - public function getJournalTitle(): ?string - { - return $this->getData('journalTitle'); - } - - public function setJournalTitle(?string $journalTitle): void - { - $this->setData('journalTitle', $journalTitle); - } - - public function getArticleTitle(): ?string - { - return $this->getData('articleTitle'); - } - - public function setArticleTitle(?string $articleTitle): void - { - $this->setData('articleTitle', $articleTitle); - } - - public function getSeriesTitle(): ?string - { - return $this->getData('seriesTitle'); - } - - public function setSeriesTitle(?string $seriesTitle): void - { - $this->setData('seriesTitle', $seriesTitle); - } - - public function getVolumeTitle(): ?string - { - return $this->getData('volumeTitle'); - } - - public function setVolumeTitle(?string $volumeTitle): void - { - $this->setData('volumeTitle', $volumeTitle); - } - - public function getEdition(): int - { - return $this->getData('edition'); - } - - public function setEdition(int $edition): void - { - $this->setData('edition', $edition); - } - - public function getAuthor(): ?string - { - return $this->getData('author'); - } - - public function setAuthor(?string $author): void - { - $this->setData('author', $author); - } - - public function getVolume(): ?string - { - return $this->getData('volume'); - } - - public function setVolume(?string $volume): void - { - $this->setData('volume', $volume); - } - - public function getIssue(): ?string - { - return $this->getData('issue'); - } - - public function setIssue(?string $issue): void - { - $this->setData('issue', $issue); - } - - public function getFirstPage(): ?string - { - return $this->getData('firstPage'); - } - - public function setFirstPage(?string $firstPage): void - { - $this->setData('firstPage', $firstPage); - } - - public function getComponentNumber(): ?string - { - return $this->getData('componentNumber'); - } - - public function setComponentNumber(?string $componentNumber): void - { - $this->setData('componentNumber', $componentNumber); - } - - public function getStandardDesignator(): ?string - { - return $this->getData('standardDesignator'); - } - - public function setStandardDesignator(?string $standardDesignator): void - { - $this->setData('standardDesignator', $standardDesignator); - } - - public function getStandardsBodyName(): ?string - { - return $this->getData('standardsBodyName'); - } - - public function setStandardsBodyName(?string $standardsBodyName): void - { - $this->setData('standardsBodyName', $standardsBodyName); - } - - public function getStandardsBodyAcronym(): ?string - { - return $this->getData('standardsBodyAcronym'); - } - - public function setStandardsBodyAcronym(?string $standardsBodyAcronym): void - { - $this->setData('standardsBodyAcronym', $standardsBodyAcronym); - } - - public function getUrl(): ?string - { - return $this->getData('url'); - } - - public function setUrl(?string $url): void - { - $this->setData('url', $url); - } - - public function getPublicationDate(): ?string - { - return $this->getData('publicationDate'); - } - - public function setPublicationDate(?string $publicationDate): void - { - $this->setData('publicationDate', $publicationDate); - } - - public function getRetrievalDate(): ?string - { - return $this->getData('retrievalDate'); - } - - public function setRetrievalDate(?string $retrievalDate): void - { - $this->setData('retrievalDate', $retrievalDate); - } -} diff --git a/src/GraphQL/Models/Series.php b/src/GraphQL/Models/Series.php deleted file mode 100644 index 87ff267..0000000 --- a/src/GraphQL/Models/Series.php +++ /dev/null @@ -1,99 +0,0 @@ -getData('seriesId'); - } - - public function setSeriesId(?string $seriesId): void - { - $this->setData('seriesId', $seriesId); - } - - public function getSeriesType(): ?string - { - return $this->getData('seriesType'); - } - - public function setSeriesType(?string $seriesType): void - { - $this->setData('seriesType', $seriesType); - } - - public function getSeriesName(): ?string - { - return $this->getData('seriesName'); - } - - public function setSeriesName(?string $seriesName): void - { - $this->setData('seriesName', $seriesName); - } - - public function getIssnPrint(): ?string - { - return $this->getData('issnPrint'); - } - - public function setIssnPrint(?string $issnPrint): void - { - $this->setData('issnPrint', $issnPrint); - } - - public function getIssnDigital(): ?string - { - return $this->getData('issnDigital'); - } - - public function setIssnDigital(?string $issnDigital): void - { - $this->setData('issnDigital', $issnDigital); - } - - public function getSeriesUrl(): ?string - { - return $this->getData('seriesUrl'); - } - - public function setSeriesUrl(?string $seriesUrl): void - { - $this->setData('seriesUrl', $seriesUrl); - } - - public function getSeriesDescription(): ?string - { - return $this->getData('seriesDescription'); - } - - public function setSeriesDescription(?string $seriesDescription): void - { - $this->setData('seriesDescription', $seriesDescription); - } - - public function getSeriesCfpUrl(): ?string - { - return $this->getData('seriesCfpUrl'); - } - - public function setSeriesCfpUrl(?string $seriesCfpUrl): void - { - $this->setData('seriesCfpUrl', $seriesCfpUrl); - } - - public function getImprintId(): ?string - { - return $this->getData('imprintId'); - } - - public function setImprintId(?string $imprintId): void - { - $this->setData('imprintId', $imprintId); - } -} diff --git a/src/GraphQL/Models/Subject.php b/src/GraphQL/Models/Subject.php deleted file mode 100644 index 6c5e635..0000000 --- a/src/GraphQL/Models/Subject.php +++ /dev/null @@ -1,63 +0,0 @@ -getData('subjectId'); - } - - public function setSubjectId(?string $subjectId): void - { - $this->setData('subjectId', $subjectId); - } - - public function getWorkId(): ?string - { - return $this->getData('workId'); - } - - public function setWorkId(?string $workId): void - { - $this->setData('workId', $workId); - } - - public function getSubjectType(): ?string - { - return $this->getData('subjectType'); - } - - public function setSubjectType(?string $subjectType): void - { - $this->setData('subjectType', $subjectType); - } - - public function getSubjectCode(): ?string - { - return $this->getData('subjectCode'); - } - - public function setSubjectCode(?string $subjectCode): void - { - $this->setData('subjectCode', $subjectCode); - } - - public function getSubjectOrdinal(): ?int - { - return $this->getData('subjectOrdinal'); - } - - public function setSubjectOrdinal(?int $subjectOrdinal): void - { - $this->setData('subjectOrdinal', $subjectOrdinal); - } -} diff --git a/src/GraphQL/Models/Title.php b/src/GraphQL/Models/Title.php deleted file mode 100644 index e1204e1..0000000 --- a/src/GraphQL/Models/Title.php +++ /dev/null @@ -1,7 +0,0 @@ -getData('workId'); - } - - public function setWorkId(?string $workId): void - { - $this->setData('workId', $workId); - } - - public function getWorkType(): ?string - { - return $this->getData('workType'); - } - - public function setWorkType(?string $workType): void - { - $this->setData('workType', $workType); - } - - public function getWorkStatus(): ?string - { - return $this->getData('workStatus'); - } - - public function setWorkStatus(?string $workStatus): void - { - $this->setData('workStatus', $workStatus); - } - - public function getFullTitle(): ?string - { - return $this->getData('fullTitle'); - } - - public function setFullTitle(?string $fullTitle): void - { - $this->setData('fullTitle', $fullTitle); - } - - public function getTitle(): ?string - { - return $this->getData('title'); - } - - public function setTitle(?string $title): void - { - $this->setData('title', $title); - } - - public function getSubtitle(): ?string - { - return $this->getData('subtitle'); - } - - public function setSubtitle(?string $subtitle): void - { - $this->setData('subtitle', $subtitle); - } - - public function getReference(): ?string - { - return $this->getData('reference'); - } - - public function setReference(?string $reference): void - { - $this->setData('reference', $reference); - } - - public function getEdition(): ?int - { - return $this->getData('edition'); - } - - public function setEdition(?int $edition): void - { - $this->setData('edition', $edition); - } - - public function getImprintId(): ?string - { - return $this->getData('imprintId'); - } - - public function setImprintId(?string $imprintId): void - { - $this->setData('imprintId', $imprintId); - } - - public function getDoi(): ?string - { - return $this->getData('doi'); - } - - public function setDoi(?string $doi): void - { - $this->setData('doi', $doi); - } - - public function getPublicationDate(): ?string - { - return $this->getData('publicationDate'); - } - - public function setPublicationDate(?string $publicationDate): void - { - $this->setData('publicationDate', $publicationDate); - } - - public function getWithdrawnDate(): ?string - { - return $this->getData('withdrawnDate'); - } - - public function setWithdrawnDate(?string $withdrawnDate): void - { - $this->setData('withdrawnDate', $withdrawnDate); - } - - public function getPlace(): ?string - { - return $this->getData('place'); - } - - public function setPlace(?string $place): void - { - $this->setData('place', $place); - } - - public function getPageCount(): ?int - { - return $this->getData('pageCount'); - } - - public function setPageCount(?int $pageCount): void - { - $this->setData('pageCount', $pageCount); - } - - public function getPageBreakdown(): ?string - { - return $this->getData('pageBreakdown'); - } - - public function setPageBreakdown(?string $pageBreakdown): void - { - $this->setData('pageBreakdown', $pageBreakdown); - } - - public function getImageCount(): ?int - { - return $this->getData('imageCount'); - } - - public function setImageCount(?int $imageCount): void - { - $this->setData('imageCount', $imageCount); - } - - public function getTableCount(): ?int - { - return $this->getData('tableCount'); - } - - public function setTableCount(?int $tableCount): void - { - $this->setData('tableCount', $tableCount); - } - - public function getAudioCount(): ?int - { - return $this->getData('audioCount'); - } - - public function setAudioCount(?int $audioCount): void - { - $this->setData('audioCount', $audioCount); - } - - public function getVideoCount(): ?int - { - return $this->getData('videoCount'); - } - - public function setVideoCount(?int $videoCount): void - { - $this->setData('videoCount', $videoCount); - } - - public function getLicense(): ?string - { - return $this->getData('license'); - } - - public function setLicense(?string $license): void - { - $this->setData('license', $license); - } - - public function getCopyrightHolder(): ?string - { - return $this->getData('copyrightHolder'); - } - - public function setCopyrightHolder(?string $copyrightHolder): void - { - $this->setData('copyrightHolder', $copyrightHolder); - } - - public function getLandingPage(): ?string - { - return $this->getData('landingPage'); - } - - public function setLandingPage(?string $landingPage): void - { - $this->setData('landingPage', $landingPage); - } - - public function getLccn(): ?string - { - return $this->getData('lccn'); - } - - public function setLccn(?string $lccn): void - { - $this->setData('lccn', $lccn); - } - - public function getOclc(): ?string - { - return $this->getData('oclc'); - } - - public function setOclc(?string $oclc): void - { - $this->setData('oclc', $oclc); - } - - public function getShortAbstract(): ?string - { - return $this->getData('shortAbstract'); - } - - public function setShortAbstract(?string $shortAbstract): void - { - $this->setData('shortAbstract', $shortAbstract); - } - - public function getLongAbstract(): ?string - { - return $this->getData('longAbstract'); - } - - public function setLongAbstract(?string $longAbstract): void - { - $this->setData('longAbstract', $longAbstract); - } - - public function getGeneralNote(): ?string - { - return $this->getData('generalNote'); - } - - public function setGeneralNote(?string $generalNote): void - { - $this->setData('generalNote', $generalNote); - } - - public function getBibliographyNote(): ?string - { - return $this->getData('bibliographyNote'); - } - - public function setBibliographyNote(?string $bibliographyNote): void - { - $this->setData('bibliographyNote', $bibliographyNote); - } - - public function getToc(): ?string - { - return $this->getData('toc'); - } - - public function setToc(?string $toc): void - { - $this->setData('toc', $toc); - } - - public function getCoverUrl(): ?string - { - return $this->getData('coverUrl'); - } - - public function setCoverUrl(?string $coverUrl): void - { - $this->setData('coverUrl', $coverUrl); - } - - public function getCoverCaption(): ?string - { - return $this->getData('coverCaption'); - } - - public function setCoverCaption(?string $coverCaption): void - { - $this->setData('coverCaption', $coverCaption); - } - - public function getFirstPage(): ?string - { - return $this->getData('firstPage'); - } - - public function setFirstPage(?string $firstPage): void - { - $this->setData('firstPage', $firstPage); - } - - public function getLastPage(): ?string - { - return $this->getData('lastPage'); - } - - public function setLastPage(?string $lastPage): void - { - $this->setData('lastPage', $lastPage); - } - - public function getPageInterval(): ?string - { - return $this->getData('pageInterval'); - } - - public function setPageInterval(?string $pageInterval): void - { - $this->setData('pageInterval', $pageInterval); - } -} diff --git a/src/GraphQL/Models/WorkFeaturedVideo.php b/src/GraphQL/Models/WorkFeaturedVideo.php deleted file mode 100644 index 5ca3436..0000000 --- a/src/GraphQL/Models/WorkFeaturedVideo.php +++ /dev/null @@ -1,7 +0,0 @@ -getData('workRelationId'); - } - - public function setWorkRelationId(?string $workRelationId): void - { - $this->setData('workRelationId', $workRelationId); - } - - public function getRelatorWorkId(): ?string - { - return $this->getData('relatorWorkId'); - } - - public function setRelatorWorkId(?string $relatorWorkId): void - { - $this->setData('relatorWorkId', $relatorWorkId); - } - - public function getRelatedWorkId(): ?string - { - return $this->getData('relatedWorkId'); - } - - public function setRelatedWorkId(?string $relatedWorkId): void - { - $this->setData('relatedWorkId', $relatedWorkId); - } - - public function getRelationType(): ?string - { - return $this->getData('relationType'); - } - - public function setRelationType(?string $relationType): void - { - $this->setData('relationType', $relationType); - } - - public function getRelationOrdinal(): ?int - { - return $this->getData('relationOrdinal'); - } - - public function setRelationOrdinal(?int $relationOrdinal): void - { - $this->setData('relationOrdinal', $relationOrdinal); - } -} diff --git a/src/GraphQL/MutationBuilder.php b/src/GraphQL/MutationBuilder.php deleted file mode 100644 index 4b9de38..0000000 --- a/src/GraphQL/MutationBuilder.php +++ /dev/null @@ -1,989 +0,0 @@ - $value !== ''); - $mutationStr = << true]; - $uploadFields = [ - 'declaredMimeType' => false, - 'declaredExtension' => false, - 'declaredSha256' => false, - ]; - - $mapping = [ - 'createAdditionalResource' => [ - 'fields' => [ - 'workId' => false, - 'title' => false, - 'description' => false, - 'attribution' => false, - 'resourceType' => true, - 'doi' => false, - 'handle' => false, - 'url' => false, - 'date' => false, - 'resourceOrdinal' => false, - ], - 'extraArgs' => $markupArg, - 'returnValue' => 'workResourceId', - ], - 'updateAdditionalResource' => [ - 'fields' => [ - 'additionalResourceId' => false, - 'workId' => false, - 'title' => false, - 'description' => false, - 'attribution' => false, - 'resourceType' => true, - 'doi' => false, - 'handle' => false, - 'url' => false, - 'date' => false, - 'resourceOrdinal' => false, - ], - 'extraArgs' => $markupArg, - 'returnValue' => 'workResourceId', - ], - 'deleteAdditionalResource' => [ - 'fields' => ['additionalResourceId' => false], - 'nested' => false, - 'returnValue' => 'workResourceId', - ], - 'createAffiliation' => [ - 'fields' => [ - 'contributionId' => false, - 'institutionId' => false, - 'affiliationOrdinal' => false, - 'position' => false, - ], - 'returnValue' => 'affiliationId', - ], - 'updateAffiliation' => [ - 'fields' => [ - 'affiliationId' => false, - 'contributionId' => false, - 'institutionId' => false, - 'affiliationOrdinal' => false, - 'position' => false, - ], - 'returnValue' => 'affiliationId', - ], - 'deleteAffiliation' => [ - 'fields' => ['affiliationId' => false], - 'nested' => false, - 'returnValue' => 'affiliationId', - ], - 'createAbstract' => [ - 'fields' => [ - 'workId' => false, - 'content' => false, - 'localeCode' => true, - 'abstractType' => true, - 'canonical' => false, - ], - 'extraArgs' => $markupArg, - 'returnValue' => 'abstractId', - ], - 'updateAbstract' => [ - 'fields' => [ - 'abstractId' => false, - 'workId' => false, - 'content' => false, - 'localeCode' => true, - 'abstractType' => true, - 'canonical' => false, - ], - 'extraArgs' => $markupArg, - 'returnValue' => 'abstractId', - ], - 'deleteAbstract' => [ - 'fields' => ['abstractId' => false], - 'nested' => false, - 'returnValue' => 'abstractId', - ], - 'createAward' => [ - 'fields' => [ - 'workId' => false, - 'title' => false, - 'url' => false, - 'category' => false, - 'year' => false, - 'jury' => false, - 'country' => true, - 'prizeStatement' => false, - 'role' => true, - 'awardOrdinal' => false, - ], - 'extraArgs' => $markupArg, - 'returnValue' => 'awardId', - ], - 'updateAward' => [ - 'fields' => [ - 'awardId' => false, - 'workId' => false, - 'title' => false, - 'url' => false, - 'category' => false, - 'year' => false, - 'jury' => false, - 'country' => true, - 'prizeStatement' => false, - 'role' => true, - 'awardOrdinal' => false, - ], - 'extraArgs' => $markupArg, - 'returnValue' => 'awardId', - ], - 'deleteAward' => [ - 'fields' => ['awardId' => false], - 'nested' => false, - 'returnValue' => 'awardId', - ], - 'createBiography' => [ - 'fields' => [ - 'contributionId' => false, - 'content' => false, - 'canonical' => false, - 'localeCode' => true, - ], - 'extraArgs' => $markupArg, - 'returnValue' => 'biographyId', - ], - 'updateBiography' => [ - 'fields' => [ - 'biographyId' => false, - 'contributionId' => false, - 'content' => false, - 'canonical' => false, - 'localeCode' => true, - ], - 'extraArgs' => $markupArg, - 'returnValue' => 'biographyId', - ], - 'deleteBiography' => [ - 'fields' => ['biographyId' => false], - 'nested' => false, - 'returnValue' => 'biographyId', - ], - 'createBookReview' => [ - 'fields' => [ - 'workId' => false, - 'title' => false, - 'authorName' => false, - 'reviewerOrcid' => false, - 'reviewerInstitutionId' => false, - 'url' => false, - 'doi' => false, - 'reviewDate' => false, - 'journalName' => false, - 'journalVolume' => false, - 'journalNumber' => false, - 'journalIssn' => false, - 'pageRange' => false, - 'text' => false, - 'reviewOrdinal' => false, - ], - 'extraArgs' => $markupArg, - 'returnValue' => 'bookReviewId', - ], - 'updateBookReview' => [ - 'fields' => [ - 'bookReviewId' => false, - 'workId' => false, - 'title' => false, - 'authorName' => false, - 'reviewerOrcid' => false, - 'reviewerInstitutionId' => false, - 'url' => false, - 'doi' => false, - 'reviewDate' => false, - 'journalName' => false, - 'journalVolume' => false, - 'journalNumber' => false, - 'journalIssn' => false, - 'pageRange' => false, - 'text' => false, - 'reviewOrdinal' => false, - ], - 'extraArgs' => $markupArg, - 'returnValue' => 'bookReviewId', - ], - 'deleteBookReview' => [ - 'fields' => ['bookReviewId' => false], - 'nested' => false, - 'returnValue' => 'bookReviewId', - ], - 'createContact' => [ - 'fields' => [ - 'publisherId' => false, - 'contactType' => true, - 'email' => false, - ], - 'returnValue' => 'contactId', - ], - 'updateContact' => [ - 'fields' => [ - 'contactId' => false, - 'publisherId' => false, - 'contactType' => true, - 'email' => false, - ], - 'returnValue' => 'contactId', - ], - 'deleteContact' => [ - 'fields' => ['contactId' => false], - 'nested' => false, - 'returnValue' => 'contactId', - ], - 'createContribution' => [ - 'fields' => [ - 'workId' => false, - 'contributorId' => false, - 'contributionType' => true, - 'mainContribution' => false, - 'contributionOrdinal' => false, - 'firstName' => false, - 'lastName' => false, - 'fullName' => false, - ], - 'returnValue' => 'contributionId', - ], - 'updateContribution' => [ - 'fields' => [ - 'contributionId' => false, - 'workId' => false, - 'contributorId' => false, - 'contributionType' => true, - 'mainContribution' => false, - 'contributionOrdinal' => false, - 'firstName' => false, - 'lastName' => false, - 'fullName' => false, - ], - 'returnValue' => 'contributionId', - ], - 'deleteContribution' => [ - 'fields' => ['contributionId' => false], - 'nested' => false, - 'returnValue' => 'contributionId', - ], - 'createContributor' => [ - 'fields' => [ - 'firstName' => false, - 'lastName' => false, - 'fullName' => false, - 'orcid' => false, - 'website' => false, - ], - 'returnValue' => 'contributorId', - ], - 'updateContributor' => [ - 'fields' => [ - 'contributorId' => false, - 'firstName' => false, - 'lastName' => false, - 'fullName' => false, - 'orcid' => false, - 'website' => false, - ], - 'returnValue' => 'contributorId', - ], - 'deleteContributor' => [ - 'fields' => ['contributorId' => false], - 'nested' => false, - 'returnValue' => 'contributorId', - ], - 'createEndorsement' => [ - 'fields' => [ - 'workId' => false, - 'authorName' => false, - 'authorRole' => false, - 'authorOrcid' => false, - 'authorInstitutionId' => false, - 'url' => false, - 'text' => false, - 'endorsementOrdinal' => false, - ], - 'extraArgs' => $markupArg, - 'returnValue' => 'endorsementId', - ], - 'updateEndorsement' => [ - 'fields' => [ - 'endorsementId' => false, - 'workId' => false, - 'authorName' => false, - 'authorRole' => false, - 'authorOrcid' => false, - 'authorInstitutionId' => false, - 'url' => false, - 'text' => false, - 'endorsementOrdinal' => false, - ], - 'extraArgs' => $markupArg, - 'returnValue' => 'endorsementId', - ], - 'deleteEndorsement' => [ - 'fields' => ['endorsementId' => false], - 'nested' => false, - 'returnValue' => 'endorsementId', - ], - 'createFunding' => [ - 'fields' => [ - 'workId' => false, - 'institutionId' => false, - 'program' => false, - 'projectName' => false, - 'projectShortname' => false, - 'grantNumber' => false, - ], - 'returnValue' => 'fundingId', - ], - 'updateFunding' => [ - 'fields' => [ - 'fundingId' => false, - 'workId' => false, - 'institutionId' => false, - 'program' => false, - 'projectName' => false, - 'projectShortname' => false, - 'grantNumber' => false, - ], - 'returnValue' => 'fundingId', - ], - 'deleteFunding' => [ - 'fields' => ['fundingId' => false], - 'nested' => false, - 'returnValue' => 'fundingId', - ], - 'createImprint' => [ - 'fields' => [ - 'publisherId' => false, - 'imprintName' => false, - 'imprintUrl' => false, - 'crossmarkDoi' => false, - 's3Bucket' => false, - 'cdnDomain' => false, - 'cloudfrontDistId' => false, - 'defaultCurrency' => true, - 'defaultPlace' => false, - 'defaultLocale' => true, - ], - 'returnValue' => 'imprintId', - ], - 'updateImprint' => [ - 'fields' => [ - 'imprintId' => false, - 'publisherId' => false, - 'imprintName' => false, - 'imprintUrl' => false, - 'crossmarkDoi' => false, - 's3Bucket' => false, - 'cdnDomain' => false, - 'cloudfrontDistId' => false, - 'defaultCurrency' => true, - 'defaultPlace' => false, - 'defaultLocale' => true, - ], - 'returnValue' => 'imprintId', - ], - 'deleteImprint' => [ - 'fields' => ['imprintId' => false], - 'nested' => false, - 'returnValue' => 'imprintId', - ], - 'createInstitution' => [ - 'fields' => [ - 'institutionName' => false, - 'institutionDoi' => false, - 'countryCode' => true, - 'ror' => false, - ], - 'returnValue' => 'institutionId', - ], - 'updateInstitution' => [ - 'fields' => [ - 'institutionId' => false, - 'institutionName' => false, - 'institutionDoi' => false, - 'countryCode' => true, - 'ror' => false, - ], - 'returnValue' => 'institutionId', - ], - 'deleteInstitution' => [ - 'fields' => ['institutionId' => false], - 'nested' => false, - 'returnValue' => 'institutionId', - ], - 'createIssue' => [ - 'fields' => [ - 'seriesId' => false, - 'workId' => false, - 'issueOrdinal' => false, - 'issueNumber' => false, - ], - 'returnValue' => 'issueId', - ], - 'updateIssue' => [ - 'fields' => [ - 'issueId' => false, - 'seriesId' => false, - 'workId' => false, - 'issueOrdinal' => false, - 'issueNumber' => false, - ], - 'returnValue' => 'issueId', - ], - 'deleteIssue' => [ - 'fields' => ['issueId' => false], - 'nested' => false, - 'returnValue' => 'issueId', - ], - 'createLanguage' => [ - 'fields' => [ - 'workId' => false, - 'languageCode' => true, - 'languageRelation' => true, - ], - 'returnValue' => 'languageId', - ], - 'updateLanguage' => [ - 'fields' => [ - 'languageId' => false, - 'workId' => false, - 'languageCode' => true, - 'languageRelation' => true, - ], - 'returnValue' => 'languageId', - ], - 'deleteLanguage' => [ - 'fields' => ['languageId' => false], - 'nested' => false, - 'returnValue' => 'languageId', - ], - 'createLocation' => [ - 'fields' => [ - 'publicationId' => false, - 'locationPlatform' => true, - 'canonical' => false, - 'landingPage' => false, - 'fullTextUrl' => false, - ], - 'returnValue' => 'locationId', - ], - 'updateLocation' => [ - 'fields' => [ - 'locationId' => false, - 'publicationId' => false, - 'locationPlatform' => true, - 'canonical' => false, - 'landingPage' => false, - 'fullTextUrl' => false, - ], - 'returnValue' => 'locationId', - ], - 'deleteLocation' => [ - 'fields' => ['locationId' => false], - 'nested' => false, - 'returnValue' => 'locationId', - ], - 'createPrice' => [ - 'fields' => [ - 'publicationId' => false, - 'currencyCode' => true, - 'unitPrice' => false, - ], - 'returnValue' => 'priceId', - ], - 'updatePrice' => [ - 'fields' => [ - 'priceId' => false, - 'publicationId' => false, - 'currencyCode' => true, - 'unitPrice' => false, - ], - 'returnValue' => 'priceId', - ], - 'deletePrice' => [ - 'fields' => ['priceId' => false], - 'nested' => false, - 'returnValue' => 'priceId', - ], - 'createPublication' => [ - 'fields' => [ - 'publicationType' => true, - 'workId' => false, - 'depthMm' => false, - 'depthIn' => false, - 'widthMm' => false, - 'widthIn' => false, - 'heightMm' => false, - 'heightIn' => false, - 'weightG' => false, - 'weightOz' => false, - 'isbn' => false, - 'accessibilityStandard' => true, - 'accessibilityAdditionalStandard' => true, - 'accessibilityException' => true, - 'accessibilityReportUrl' => false, - ], - 'returnValue' => 'publicationId', - ], - 'updatePublication' => [ - 'fields' => [ - 'publicationId' => false, - 'publicationType' => true, - 'workId' => false, - 'depthMm' => false, - 'depthIn' => false, - 'widthMm' => false, - 'widthIn' => false, - 'heightMm' => false, - 'heightIn' => false, - 'weightG' => false, - 'weightOz' => false, - 'isbn' => false, - 'accessibilityStandard' => true, - 'accessibilityAdditionalStandard' => true, - 'accessibilityException' => true, - 'accessibilityReportUrl' => false, - ], - 'returnValue' => 'publicationId', - ], - 'deletePublication' => [ - 'fields' => ['publicationId' => false], - 'nested' => false, - 'returnValue' => 'publicationId', - ], - 'createPublisher' => [ - 'fields' => [ - 'publisherName' => false, - 'publisherShortname' => false, - 'publisherUrl' => false, - 'accessibilityStatement' => false, - 'accessibilityReportUrl' => false, - ], - 'returnValue' => 'publisherId', - ], - 'updatePublisher' => [ - 'fields' => [ - 'publisherId' => false, - 'publisherName' => false, - 'publisherShortname' => false, - 'publisherUrl' => false, - 'accessibilityStatement' => false, - 'accessibilityReportUrl' => false, - ], - 'returnValue' => 'publisherId', - ], - 'deletePublisher' => [ - 'fields' => ['publisherId' => false], - 'nested' => false, - 'returnValue' => 'publisherId', - ], - 'createReference' => [ - 'fields' => [ - 'workId' => false, - 'referenceOrdinal' => false, - 'doi' => false, - 'unstructuredCitation' => false, - 'issn' => false, - 'isbn' => false, - 'journalTitle' => false, - 'articleTitle' => false, - 'seriesTitle' => false, - 'volumeTitle' => false, - 'edition' => false, - 'author' => false, - 'volume' => false, - 'issue' => false, - 'firstPage' => false, - 'componentNumber' => false, - 'standardDesignator' => false, - 'standardsBodyName' => false, - 'standardsBodyAcronym' => false, - 'url' => false, - 'publicationDate' => false, - 'retrievalDate' => false, - ], - 'returnValue' => 'referenceId', - ], - 'updateReference' => [ - 'fields' => [ - 'referenceId' => false, - 'workId' => false, - 'referenceOrdinal' => false, - 'doi' => false, - 'unstructuredCitation' => false, - 'issn' => false, - 'isbn' => false, - 'journalTitle' => false, - 'articleTitle' => false, - 'seriesTitle' => false, - 'volumeTitle' => false, - 'edition' => false, - 'author' => false, - 'volume' => false, - 'issue' => false, - 'firstPage' => false, - 'componentNumber' => false, - 'standardDesignator' => false, - 'standardsBodyName' => false, - 'standardsBodyAcronym' => false, - 'url' => false, - 'publicationDate' => false, - 'retrievalDate' => false, - ], - 'returnValue' => 'referenceId', - ], - 'deleteReference' => [ - 'fields' => ['referenceId' => false], - 'nested' => false, - 'returnValue' => 'referenceId', - ], - 'createSeries' => [ - 'fields' => [ - 'imprintId' => false, - 'seriesType' => true, - 'seriesName' => false, - 'issnPrint' => false, - 'issnDigital' => false, - 'seriesUrl' => false, - 'seriesDescription' => false, - 'seriesCfpUrl' => false, - ], - 'returnValue' => 'seriesId', - ], - 'updateSeries' => [ - 'fields' => [ - 'seriesId' => false, - 'imprintId' => false, - 'seriesType' => true, - 'seriesName' => false, - 'issnPrint' => false, - 'issnDigital' => false, - 'seriesUrl' => false, - 'seriesDescription' => false, - 'seriesCfpUrl' => false, - ], - 'returnValue' => 'seriesId', - ], - 'deleteSeries' => [ - 'fields' => ['seriesId' => false], - 'nested' => false, - 'returnValue' => 'seriesId', - ], - 'createSubject' => [ - 'fields' => [ - 'workId' => false, - 'subjectType' => true, - 'subjectCode' => false, - 'subjectOrdinal' => false, - ], - 'returnValue' => 'subjectId', - ], - 'updateSubject' => [ - 'fields' => [ - 'subjectId' => false, - 'workId' => false, - 'subjectType' => true, - 'subjectCode' => false, - 'subjectOrdinal' => false, - ], - 'returnValue' => 'subjectId', - ], - 'deleteSubject' => [ - 'fields' => ['subjectId' => false], - 'nested' => false, - 'returnValue' => 'subjectId', - ], - 'createTitle' => [ - 'fields' => [ - 'workId' => false, - 'localeCode' => true, - 'fullTitle' => false, - 'title' => false, - 'subtitle' => false, - 'canonical' => false, - ], - 'extraArgs' => $markupArg, - 'returnValue' => 'titleId', - ], - 'updateTitle' => [ - 'fields' => [ - 'titleId' => false, - 'workId' => false, - 'localeCode' => true, - 'fullTitle' => false, - 'title' => false, - 'subtitle' => false, - 'canonical' => false, - ], - 'extraArgs' => $markupArg, - 'returnValue' => 'titleId', - ], - 'deleteTitle' => [ - 'fields' => ['titleId' => false], - 'nested' => false, - 'returnValue' => 'titleId', - ], - 'createWork' => [ - 'fields' => [ - 'workType' => true, - 'workStatus' => true, - 'reference' => false, - 'edition' => false, - 'imprintId' => false, - 'doi' => false, - 'publicationDate' => false, - 'withdrawnDate' => false, - 'place' => false, - 'pageCount' => false, - 'pageBreakdown' => false, - 'imageCount' => false, - 'tableCount' => false, - 'audioCount' => false, - 'videoCount' => false, - 'license' => false, - 'copyrightHolder' => false, - 'landingPage' => false, - 'lccn' => false, - 'oclc' => false, - 'generalNote' => false, - 'bibliographyNote' => false, - 'toc' => false, - 'resourcesDescription' => false, - 'coverUrl' => false, - 'coverCaption' => false, - 'firstPage' => false, - 'lastPage' => false, - 'pageInterval' => false, - ], - 'returnValue' => 'workId', - ], - 'updateWork' => [ - 'fields' => [ - 'workId' => false, - 'workType' => true, - 'workStatus' => true, - 'reference' => false, - 'edition' => false, - 'imprintId' => false, - 'doi' => false, - 'publicationDate' => false, - 'withdrawnDate' => false, - 'place' => false, - 'pageCount' => false, - 'pageBreakdown' => false, - 'imageCount' => false, - 'tableCount' => false, - 'audioCount' => false, - 'videoCount' => false, - 'license' => false, - 'copyrightHolder' => false, - 'landingPage' => false, - 'lccn' => false, - 'oclc' => false, - 'generalNote' => false, - 'bibliographyNote' => false, - 'toc' => false, - 'resourcesDescription' => false, - 'coverUrl' => false, - 'coverCaption' => false, - 'firstPage' => false, - 'lastPage' => false, - 'pageInterval' => false, - ], - 'returnValue' => 'workId', - ], - 'deleteWork' => [ - 'fields' => ['workId' => false], - 'nested' => false, - 'returnValue' => 'workId', - ], - 'createWorkFeaturedVideo' => [ - 'fields' => [ - 'workId' => false, - 'title' => false, - 'url' => false, - 'width' => false, - 'height' => false, - ], - 'returnValue' => 'workFeaturedVideoId', - ], - 'updateWorkFeaturedVideo' => [ - 'fields' => [ - 'workFeaturedVideoId' => false, - 'workId' => false, - 'title' => false, - 'url' => false, - 'width' => false, - 'height' => false, - ], - 'returnValue' => 'workFeaturedVideoId', - ], - 'deleteWorkFeaturedVideo' => [ - 'fields' => ['workFeaturedVideoId' => false], - 'nested' => false, - 'returnValue' => 'workFeaturedVideoId', - ], - 'createWorkRelation' => [ - 'fields' => [ - 'relatorWorkId' => false, - 'relatedWorkId' => false, - 'relationType' => true, - 'relationOrdinal' => false, - ], - 'returnValue' => 'workRelationId', - ], - 'updateWorkRelation' => [ - 'fields' => [ - 'workRelationId' => false, - 'relatorWorkId' => false, - 'relatedWorkId' => false, - 'relationType' => true, - 'relationOrdinal' => false, - ], - 'returnValue' => 'workRelationId', - ], - 'deleteWorkRelation' => [ - 'fields' => ['workRelationId' => false], - 'nested' => false, - 'returnValue' => 'workRelationId', - ], - 'moveAffiliation' => [ - 'fields' => ['affiliationId' => false, 'newOrdinal' => false], - 'nested' => false, - 'returnValue' => 'affiliationId', - ], - 'moveContribution' => [ - 'fields' => ['contributionId' => false, 'newOrdinal' => false], - 'nested' => false, - 'returnValue' => 'contributionId', - ], - 'moveIssue' => [ - 'fields' => ['issueId' => false, 'newOrdinal' => false], - 'nested' => false, - 'returnValue' => 'issueId', - ], - 'moveReference' => [ - 'fields' => ['referenceId' => false, 'newOrdinal' => false], - 'nested' => false, - 'returnValue' => 'referenceId', - ], - 'moveAdditionalResource' => [ - 'fields' => ['additionalResourceId' => false, 'newOrdinal' => false], - 'nested' => false, - 'returnValue' => 'workResourceId', - ], - 'moveAward' => [ - 'fields' => ['awardId' => false, 'newOrdinal' => false], - 'nested' => false, - 'returnValue' => 'awardId', - ], - 'moveEndorsement' => [ - 'fields' => ['endorsementId' => false, 'newOrdinal' => false], - 'nested' => false, - 'returnValue' => 'endorsementId', - ], - 'moveBookReview' => [ - 'fields' => ['bookReviewId' => false, 'newOrdinal' => false], - 'nested' => false, - 'returnValue' => 'bookReviewId', - ], - 'moveSubject' => [ - 'fields' => ['subjectId' => false, 'newOrdinal' => false], - 'nested' => false, - 'returnValue' => 'subjectId', - ], - 'moveWorkRelation' => [ - 'fields' => ['workRelationId' => false, 'newOrdinal' => false], - 'nested' => false, - 'returnValue' => 'workRelationId', - ], - 'initPublicationFileUpload' => [ - 'fields' => ['publicationId' => false] + $uploadFields, - 'returnValue' => 'fileUploadId', - ], - 'initFrontcoverFileUpload' => [ - 'fields' => ['workId' => false] + $uploadFields, - 'returnValue' => 'fileUploadId', - ], - 'initAdditionalResourceFileUpload' => [ - 'fields' => ['additionalResourceId' => false] + $uploadFields, - 'returnValue' => 'fileUploadId', - ], - 'initWorkFeaturedVideoFileUpload' => [ - 'fields' => ['workFeaturedVideoId' => false] + $uploadFields, - 'returnValue' => 'fileUploadId', - ], - 'completeFileUpload' => [ - 'fields' => ['fileUploadId' => false], - 'returnValue' => 'fileId', - ], - ]; - - return $mapping[$mutationName] ?? null; - } - - private static function prepareData(array $mutationFields, array $fieldsData): string - { - $sanitizedFields = []; - foreach ($mutationFields as $key => $raw) { - $value = $fieldsData[$key] ?? null; - if ($value === null || $value === '') { - continue; - } - $sanitizedFields[] = $key . ': ' . ($raw ? $value : json_encode($value)); - } - - return implode(', ', $sanitizedFields); - } -} diff --git a/src/GraphQL/Mutations/CompleteFileUploadMutation.php b/src/GraphQL/Mutations/CompleteFileUploadMutation.php new file mode 100644 index 0000000..1df3bfb --- /dev/null +++ b/src/GraphQL/Mutations/CompleteFileUploadMutation.php @@ -0,0 +1,49 @@ + 'completeFileUpload', + 'description' => 'Complete a file upload, validate it, and promote it to its final DOI-based location.', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Input for completing a file upload', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'CompleteFileUpload', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'File', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateAbstractMutation.php b/src/GraphQL/Mutations/CreateAbstractMutation.php new file mode 100644 index 0000000..b6afa7d --- /dev/null +++ b/src/GraphQL/Mutations/CreateAbstractMutation.php @@ -0,0 +1,59 @@ + 'createAbstract', + 'description' => 'Create a new abstract with the specified values', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'The markup format of the abstract', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'data', + 'description' => 'Values for abstract to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewAbstract', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Abstract', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateAdditionalResourceMutation.php b/src/GraphQL/Mutations/CreateAdditionalResourceMutation.php new file mode 100644 index 0000000..a7d3623 --- /dev/null +++ b/src/GraphQL/Mutations/CreateAdditionalResourceMutation.php @@ -0,0 +1,59 @@ + 'createAdditionalResource', + 'description' => 'Create a new additional resource with the specified values', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'The markup format of the additional resource text fields', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'data', + 'description' => 'Values for additional resource to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewAdditionalResource', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'WorkResource', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateAffiliationMutation.php b/src/GraphQL/Mutations/CreateAffiliationMutation.php new file mode 100644 index 0000000..d4bb9ed --- /dev/null +++ b/src/GraphQL/Mutations/CreateAffiliationMutation.php @@ -0,0 +1,49 @@ + 'createAffiliation', + 'description' => 'Create a new affiliation with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values for affiliation to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewAffiliation', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Affiliation', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateAwardMutation.php b/src/GraphQL/Mutations/CreateAwardMutation.php new file mode 100644 index 0000000..b523d42 --- /dev/null +++ b/src/GraphQL/Mutations/CreateAwardMutation.php @@ -0,0 +1,59 @@ + 'createAward', + 'description' => 'Create a new award with the specified values', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'The markup format of the award text fields', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'data', + 'description' => 'Values for award to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewAward', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Award', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateBiographyMutation.php b/src/GraphQL/Mutations/CreateBiographyMutation.php new file mode 100644 index 0000000..bee6051 --- /dev/null +++ b/src/GraphQL/Mutations/CreateBiographyMutation.php @@ -0,0 +1,59 @@ + 'createBiography', + 'description' => 'Create a new biography with the specified values', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'The markup format of the biography', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'data', + 'description' => 'Values for biography to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewBiography', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Biography', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateBookReviewMutation.php b/src/GraphQL/Mutations/CreateBookReviewMutation.php new file mode 100644 index 0000000..ac13d2d --- /dev/null +++ b/src/GraphQL/Mutations/CreateBookReviewMutation.php @@ -0,0 +1,59 @@ + 'createBookReview', + 'description' => 'Create a new book review with the specified values', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'The markup format of the book review text field', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'data', + 'description' => 'Values for book review to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewBookReview', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'BookReview', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateContactMutation.php b/src/GraphQL/Mutations/CreateContactMutation.php new file mode 100644 index 0000000..f2c2cd8 --- /dev/null +++ b/src/GraphQL/Mutations/CreateContactMutation.php @@ -0,0 +1,49 @@ + 'createContact', + 'description' => 'Create a new contact with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values for contact to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewContact', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contact', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateContributionMutation.php b/src/GraphQL/Mutations/CreateContributionMutation.php new file mode 100644 index 0000000..03d7694 --- /dev/null +++ b/src/GraphQL/Mutations/CreateContributionMutation.php @@ -0,0 +1,49 @@ + 'createContribution', + 'description' => 'Create a new contribution with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values for contribution to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewContribution', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contribution', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateContributorMutation.php b/src/GraphQL/Mutations/CreateContributorMutation.php new file mode 100644 index 0000000..69f856b --- /dev/null +++ b/src/GraphQL/Mutations/CreateContributorMutation.php @@ -0,0 +1,49 @@ + 'createContributor', + 'description' => 'Create a new contributor with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values for contributor to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewContributor', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contributor', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateEndorsementMutation.php b/src/GraphQL/Mutations/CreateEndorsementMutation.php new file mode 100644 index 0000000..dc6b1a8 --- /dev/null +++ b/src/GraphQL/Mutations/CreateEndorsementMutation.php @@ -0,0 +1,59 @@ + 'createEndorsement', + 'description' => 'Create a new endorsement with the specified values', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'The markup format of the endorsement rich-text fields', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'data', + 'description' => 'Values for endorsement to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewEndorsement', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Endorsement', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateFundingMutation.php b/src/GraphQL/Mutations/CreateFundingMutation.php new file mode 100644 index 0000000..46caccc --- /dev/null +++ b/src/GraphQL/Mutations/CreateFundingMutation.php @@ -0,0 +1,49 @@ + 'createFunding', + 'description' => 'Create a new funding with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values for funding to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewFunding', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Funding', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateImprintMutation.php b/src/GraphQL/Mutations/CreateImprintMutation.php new file mode 100644 index 0000000..c0305a9 --- /dev/null +++ b/src/GraphQL/Mutations/CreateImprintMutation.php @@ -0,0 +1,49 @@ + 'createImprint', + 'description' => 'Create a new imprint with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values for imprint to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewImprint', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Imprint', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateInstitutionMutation.php b/src/GraphQL/Mutations/CreateInstitutionMutation.php new file mode 100644 index 0000000..1a6c43c --- /dev/null +++ b/src/GraphQL/Mutations/CreateInstitutionMutation.php @@ -0,0 +1,49 @@ + 'createInstitution', + 'description' => 'Create a new institution with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values for institution to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewInstitution', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Institution', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateIssueMutation.php b/src/GraphQL/Mutations/CreateIssueMutation.php new file mode 100644 index 0000000..8c91e46 --- /dev/null +++ b/src/GraphQL/Mutations/CreateIssueMutation.php @@ -0,0 +1,49 @@ + 'createIssue', + 'description' => 'Create a new issue with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values for issue to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewIssue', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Issue', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateLanguageMutation.php b/src/GraphQL/Mutations/CreateLanguageMutation.php new file mode 100644 index 0000000..79da9d1 --- /dev/null +++ b/src/GraphQL/Mutations/CreateLanguageMutation.php @@ -0,0 +1,49 @@ + 'createLanguage', + 'description' => 'Create a new language with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values for language to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewLanguage', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Language', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateLocationMutation.php b/src/GraphQL/Mutations/CreateLocationMutation.php new file mode 100644 index 0000000..c73749b --- /dev/null +++ b/src/GraphQL/Mutations/CreateLocationMutation.php @@ -0,0 +1,49 @@ + 'createLocation', + 'description' => 'Create a new location with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values for location to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewLocation', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Location', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreatePriceMutation.php b/src/GraphQL/Mutations/CreatePriceMutation.php new file mode 100644 index 0000000..7600067 --- /dev/null +++ b/src/GraphQL/Mutations/CreatePriceMutation.php @@ -0,0 +1,49 @@ + 'createPrice', + 'description' => 'Create a new price with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values for price to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewPrice', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Price', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreatePublicationMutation.php b/src/GraphQL/Mutations/CreatePublicationMutation.php new file mode 100644 index 0000000..b8969ad --- /dev/null +++ b/src/GraphQL/Mutations/CreatePublicationMutation.php @@ -0,0 +1,49 @@ + 'createPublication', + 'description' => 'Create a new publication with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values for publication to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewPublication', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Publication', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreatePublisherMutation.php b/src/GraphQL/Mutations/CreatePublisherMutation.php new file mode 100644 index 0000000..79e3846 --- /dev/null +++ b/src/GraphQL/Mutations/CreatePublisherMutation.php @@ -0,0 +1,49 @@ + 'createPublisher', + 'description' => 'Create a new publisher with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values for publisher to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewPublisher', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Publisher', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateReferenceMutation.php b/src/GraphQL/Mutations/CreateReferenceMutation.php new file mode 100644 index 0000000..92b19b8 --- /dev/null +++ b/src/GraphQL/Mutations/CreateReferenceMutation.php @@ -0,0 +1,49 @@ + 'createReference', + 'description' => 'Create a new reference with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values for reference to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewReference', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Reference', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateSeriesMutation.php b/src/GraphQL/Mutations/CreateSeriesMutation.php new file mode 100644 index 0000000..329b003 --- /dev/null +++ b/src/GraphQL/Mutations/CreateSeriesMutation.php @@ -0,0 +1,59 @@ + 'createSeries', + 'description' => 'Create a new series with the specified values', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'The markup format of the series description', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'data', + 'description' => 'Values for series to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewSeries', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Series', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateSubjectMutation.php b/src/GraphQL/Mutations/CreateSubjectMutation.php new file mode 100644 index 0000000..c9cc5e7 --- /dev/null +++ b/src/GraphQL/Mutations/CreateSubjectMutation.php @@ -0,0 +1,49 @@ + 'createSubject', + 'description' => 'Create a new subject with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values for subject to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewSubject', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Subject', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateTitleMutation.php b/src/GraphQL/Mutations/CreateTitleMutation.php new file mode 100644 index 0000000..0e086b9 --- /dev/null +++ b/src/GraphQL/Mutations/CreateTitleMutation.php @@ -0,0 +1,59 @@ + 'createTitle', + 'description' => 'Create a new title with the specified values', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'The markup format of the title', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'data', + 'description' => 'Values for title to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewTitle', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Title', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateWorkFeaturedVideoMutation.php b/src/GraphQL/Mutations/CreateWorkFeaturedVideoMutation.php new file mode 100644 index 0000000..c749ee8 --- /dev/null +++ b/src/GraphQL/Mutations/CreateWorkFeaturedVideoMutation.php @@ -0,0 +1,49 @@ + 'createWorkFeaturedVideo', + 'description' => 'Create a new featured video with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values for featured video to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewWorkFeaturedVideo', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'WorkFeaturedVideo', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateWorkMutation.php b/src/GraphQL/Mutations/CreateWorkMutation.php new file mode 100644 index 0000000..281570c --- /dev/null +++ b/src/GraphQL/Mutations/CreateWorkMutation.php @@ -0,0 +1,49 @@ + 'createWork', + 'description' => 'Create a new work with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values for work to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewWork', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/CreateWorkRelationMutation.php b/src/GraphQL/Mutations/CreateWorkRelationMutation.php new file mode 100644 index 0000000..9c0da84 --- /dev/null +++ b/src/GraphQL/Mutations/CreateWorkRelationMutation.php @@ -0,0 +1,49 @@ + 'createWorkRelation', + 'description' => 'Create a new work relation with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values for work relation to be created', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewWorkRelation', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'WorkRelation', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteAbstractMutation.php b/src/GraphQL/Mutations/DeleteAbstractMutation.php new file mode 100644 index 0000000..e63d8b3 --- /dev/null +++ b/src/GraphQL/Mutations/DeleteAbstractMutation.php @@ -0,0 +1,49 @@ + 'deleteAbstract', + 'description' => 'Delete a single abstract using its ID', + 'args' => [ + [ + 'name' => 'abstractId', + 'description' => 'Thoth ID of abstract to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Abstract', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteAdditionalResourceMutation.php b/src/GraphQL/Mutations/DeleteAdditionalResourceMutation.php new file mode 100644 index 0000000..e5136af --- /dev/null +++ b/src/GraphQL/Mutations/DeleteAdditionalResourceMutation.php @@ -0,0 +1,49 @@ + 'deleteAdditionalResource', + 'description' => 'Delete a single additional resource using its ID', + 'args' => [ + [ + 'name' => 'additionalResourceId', + 'description' => 'Thoth ID of additional resource to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'WorkResource', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteAffiliationMutation.php b/src/GraphQL/Mutations/DeleteAffiliationMutation.php new file mode 100644 index 0000000..7984e4d --- /dev/null +++ b/src/GraphQL/Mutations/DeleteAffiliationMutation.php @@ -0,0 +1,49 @@ + 'deleteAffiliation', + 'description' => 'Delete a single affiliation using its ID', + 'args' => [ + [ + 'name' => 'affiliationId', + 'description' => 'Thoth ID of affiliation to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Affiliation', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteAwardMutation.php b/src/GraphQL/Mutations/DeleteAwardMutation.php new file mode 100644 index 0000000..20bd814 --- /dev/null +++ b/src/GraphQL/Mutations/DeleteAwardMutation.php @@ -0,0 +1,49 @@ + 'deleteAward', + 'description' => 'Delete a single award using its ID', + 'args' => [ + [ + 'name' => 'awardId', + 'description' => 'Thoth ID of award to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Award', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteBiographyMutation.php b/src/GraphQL/Mutations/DeleteBiographyMutation.php new file mode 100644 index 0000000..4649aff --- /dev/null +++ b/src/GraphQL/Mutations/DeleteBiographyMutation.php @@ -0,0 +1,49 @@ + 'deleteBiography', + 'description' => 'Delete a single biography using its ID', + 'args' => [ + [ + 'name' => 'biographyId', + 'description' => 'Thoth ID of biography to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Biography', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteBookReviewMutation.php b/src/GraphQL/Mutations/DeleteBookReviewMutation.php new file mode 100644 index 0000000..ae8cc1f --- /dev/null +++ b/src/GraphQL/Mutations/DeleteBookReviewMutation.php @@ -0,0 +1,49 @@ + 'deleteBookReview', + 'description' => 'Delete a single book review using its ID', + 'args' => [ + [ + 'name' => 'bookReviewId', + 'description' => 'Thoth ID of book review to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'BookReview', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteContactMutation.php b/src/GraphQL/Mutations/DeleteContactMutation.php new file mode 100644 index 0000000..7836bbc --- /dev/null +++ b/src/GraphQL/Mutations/DeleteContactMutation.php @@ -0,0 +1,49 @@ + 'deleteContact', + 'description' => 'Delete a single contact using its ID', + 'args' => [ + [ + 'name' => 'contactId', + 'description' => 'Thoth ID of contact to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contact', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteContributionMutation.php b/src/GraphQL/Mutations/DeleteContributionMutation.php new file mode 100644 index 0000000..89b8f59 --- /dev/null +++ b/src/GraphQL/Mutations/DeleteContributionMutation.php @@ -0,0 +1,49 @@ + 'deleteContribution', + 'description' => 'Delete a single contribution using its ID', + 'args' => [ + [ + 'name' => 'contributionId', + 'description' => 'Thoth ID of contribution to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contribution', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteContributorMutation.php b/src/GraphQL/Mutations/DeleteContributorMutation.php new file mode 100644 index 0000000..59fc0b4 --- /dev/null +++ b/src/GraphQL/Mutations/DeleteContributorMutation.php @@ -0,0 +1,49 @@ + 'deleteContributor', + 'description' => 'Delete a single contributor using its ID', + 'args' => [ + [ + 'name' => 'contributorId', + 'description' => 'Thoth ID of contributor to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contributor', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteEndorsementMutation.php b/src/GraphQL/Mutations/DeleteEndorsementMutation.php new file mode 100644 index 0000000..2171ab5 --- /dev/null +++ b/src/GraphQL/Mutations/DeleteEndorsementMutation.php @@ -0,0 +1,49 @@ + 'deleteEndorsement', + 'description' => 'Delete a single endorsement using its ID', + 'args' => [ + [ + 'name' => 'endorsementId', + 'description' => 'Thoth ID of endorsement to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Endorsement', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteFundingMutation.php b/src/GraphQL/Mutations/DeleteFundingMutation.php new file mode 100644 index 0000000..1914b33 --- /dev/null +++ b/src/GraphQL/Mutations/DeleteFundingMutation.php @@ -0,0 +1,49 @@ + 'deleteFunding', + 'description' => 'Delete a single funding using its ID', + 'args' => [ + [ + 'name' => 'fundingId', + 'description' => 'Thoth ID of funding to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Funding', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteImprintMutation.php b/src/GraphQL/Mutations/DeleteImprintMutation.php new file mode 100644 index 0000000..1662ec0 --- /dev/null +++ b/src/GraphQL/Mutations/DeleteImprintMutation.php @@ -0,0 +1,49 @@ + 'deleteImprint', + 'description' => 'Delete a single imprint using its ID', + 'args' => [ + [ + 'name' => 'imprintId', + 'description' => 'Thoth ID of imprint to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Imprint', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteInstitutionMutation.php b/src/GraphQL/Mutations/DeleteInstitutionMutation.php new file mode 100644 index 0000000..c9b48bc --- /dev/null +++ b/src/GraphQL/Mutations/DeleteInstitutionMutation.php @@ -0,0 +1,49 @@ + 'deleteInstitution', + 'description' => 'Delete a single institution using its ID', + 'args' => [ + [ + 'name' => 'institutionId', + 'description' => 'Thoth ID of institution to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Institution', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteIssueMutation.php b/src/GraphQL/Mutations/DeleteIssueMutation.php new file mode 100644 index 0000000..a72c78d --- /dev/null +++ b/src/GraphQL/Mutations/DeleteIssueMutation.php @@ -0,0 +1,49 @@ + 'deleteIssue', + 'description' => 'Delete a single issue using its ID', + 'args' => [ + [ + 'name' => 'issueId', + 'description' => 'Thoth ID of issue to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Issue', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteLanguageMutation.php b/src/GraphQL/Mutations/DeleteLanguageMutation.php new file mode 100644 index 0000000..ce36964 --- /dev/null +++ b/src/GraphQL/Mutations/DeleteLanguageMutation.php @@ -0,0 +1,49 @@ + 'deleteLanguage', + 'description' => 'Delete a single language using its ID', + 'args' => [ + [ + 'name' => 'languageId', + 'description' => 'Thoth ID of language to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Language', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteLocationMutation.php b/src/GraphQL/Mutations/DeleteLocationMutation.php new file mode 100644 index 0000000..19c56bd --- /dev/null +++ b/src/GraphQL/Mutations/DeleteLocationMutation.php @@ -0,0 +1,49 @@ + 'deleteLocation', + 'description' => 'Delete a single location using its ID', + 'args' => [ + [ + 'name' => 'locationId', + 'description' => 'Thoth ID of location to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Location', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeletePriceMutation.php b/src/GraphQL/Mutations/DeletePriceMutation.php new file mode 100644 index 0000000..506e629 --- /dev/null +++ b/src/GraphQL/Mutations/DeletePriceMutation.php @@ -0,0 +1,49 @@ + 'deletePrice', + 'description' => 'Delete a single price using its ID', + 'args' => [ + [ + 'name' => 'priceId', + 'description' => 'Thoth ID of price to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Price', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeletePublicationMutation.php b/src/GraphQL/Mutations/DeletePublicationMutation.php new file mode 100644 index 0000000..47f3e7e --- /dev/null +++ b/src/GraphQL/Mutations/DeletePublicationMutation.php @@ -0,0 +1,49 @@ + 'deletePublication', + 'description' => 'Delete a single publication using its ID', + 'args' => [ + [ + 'name' => 'publicationId', + 'description' => 'Thoth ID of publication to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Publication', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeletePublisherMutation.php b/src/GraphQL/Mutations/DeletePublisherMutation.php new file mode 100644 index 0000000..63610ae --- /dev/null +++ b/src/GraphQL/Mutations/DeletePublisherMutation.php @@ -0,0 +1,49 @@ + 'deletePublisher', + 'description' => 'Delete a single publisher using its ID', + 'args' => [ + [ + 'name' => 'publisherId', + 'description' => 'Thoth ID of publisher to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Publisher', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteReferenceMutation.php b/src/GraphQL/Mutations/DeleteReferenceMutation.php new file mode 100644 index 0000000..6bb5ec7 --- /dev/null +++ b/src/GraphQL/Mutations/DeleteReferenceMutation.php @@ -0,0 +1,49 @@ + 'deleteReference', + 'description' => 'Delete a single reference using its ID', + 'args' => [ + [ + 'name' => 'referenceId', + 'description' => 'Thoth ID of reference to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Reference', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteSeriesMutation.php b/src/GraphQL/Mutations/DeleteSeriesMutation.php new file mode 100644 index 0000000..052928a --- /dev/null +++ b/src/GraphQL/Mutations/DeleteSeriesMutation.php @@ -0,0 +1,49 @@ + 'deleteSeries', + 'description' => 'Delete a single series using its ID', + 'args' => [ + [ + 'name' => 'seriesId', + 'description' => 'Thoth ID of series to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Series', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteSubjectMutation.php b/src/GraphQL/Mutations/DeleteSubjectMutation.php new file mode 100644 index 0000000..8c63b61 --- /dev/null +++ b/src/GraphQL/Mutations/DeleteSubjectMutation.php @@ -0,0 +1,49 @@ + 'deleteSubject', + 'description' => 'Delete a single subject using its ID', + 'args' => [ + [ + 'name' => 'subjectId', + 'description' => 'Thoth ID of subject to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Subject', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteTitleMutation.php b/src/GraphQL/Mutations/DeleteTitleMutation.php new file mode 100644 index 0000000..7975e8a --- /dev/null +++ b/src/GraphQL/Mutations/DeleteTitleMutation.php @@ -0,0 +1,49 @@ + 'deleteTitle', + 'description' => 'Delete a single title using its ID', + 'args' => [ + [ + 'name' => 'titleId', + 'description' => 'Thoth ID of title to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Title', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteWorkFeaturedVideoMutation.php b/src/GraphQL/Mutations/DeleteWorkFeaturedVideoMutation.php new file mode 100644 index 0000000..b106215 --- /dev/null +++ b/src/GraphQL/Mutations/DeleteWorkFeaturedVideoMutation.php @@ -0,0 +1,49 @@ + 'deleteWorkFeaturedVideo', + 'description' => 'Delete a single featured video using its ID', + 'args' => [ + [ + 'name' => 'workFeaturedVideoId', + 'description' => 'Thoth ID of featured video to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'WorkFeaturedVideo', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteWorkMutation.php b/src/GraphQL/Mutations/DeleteWorkMutation.php new file mode 100644 index 0000000..8db1d1c --- /dev/null +++ b/src/GraphQL/Mutations/DeleteWorkMutation.php @@ -0,0 +1,49 @@ + 'deleteWork', + 'description' => 'Delete a single work using its ID', + 'args' => [ + [ + 'name' => 'workId', + 'description' => 'Thoth ID of work to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/DeleteWorkRelationMutation.php b/src/GraphQL/Mutations/DeleteWorkRelationMutation.php new file mode 100644 index 0000000..a057ccd --- /dev/null +++ b/src/GraphQL/Mutations/DeleteWorkRelationMutation.php @@ -0,0 +1,49 @@ + 'deleteWorkRelation', + 'description' => 'Delete a single work relation using its ID', + 'args' => [ + [ + 'name' => 'workRelationId', + 'description' => 'Thoth ID of work relation to be deleted', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'WorkRelation', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/InitAdditionalResourceFileUploadMutation.php b/src/GraphQL/Mutations/InitAdditionalResourceFileUploadMutation.php new file mode 100644 index 0000000..94b09f4 --- /dev/null +++ b/src/GraphQL/Mutations/InitAdditionalResourceFileUploadMutation.php @@ -0,0 +1,49 @@ + 'initAdditionalResourceFileUpload', + 'description' => 'Start uploading a file for an additional resource. Supported resource types include AUDIO, VIDEO, IMAGE, DOCUMENT, DATASET, and SPREADSHEET.', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Input for starting an additional resource upload', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewAdditionalResourceFileUpload', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'FileUploadResponse', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/InitFrontcoverFileUploadMutation.php b/src/GraphQL/Mutations/InitFrontcoverFileUploadMutation.php new file mode 100644 index 0000000..448f38f --- /dev/null +++ b/src/GraphQL/Mutations/InitFrontcoverFileUploadMutation.php @@ -0,0 +1,49 @@ + 'initFrontcoverFileUpload', + 'description' => 'Start uploading a front cover image for a given work. Returns an upload session ID, a presigned S3 PUT URL, and required PUT headers.', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Input for starting a front cover upload', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewFrontcoverFileUpload', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'FileUploadResponse', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/InitPublicationFileUploadMutation.php b/src/GraphQL/Mutations/InitPublicationFileUploadMutation.php new file mode 100644 index 0000000..1da6a21 --- /dev/null +++ b/src/GraphQL/Mutations/InitPublicationFileUploadMutation.php @@ -0,0 +1,49 @@ + 'initPublicationFileUpload', + 'description' => 'Start uploading a publication file (e.g. PDF, EPUB, XML) for a given publication. Returns an upload session ID, a presigned S3 PUT URL, and required PUT headers.', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Input for starting a publication file upload', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewPublicationFileUpload', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'FileUploadResponse', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/InitWorkFeaturedVideoFileUploadMutation.php b/src/GraphQL/Mutations/InitWorkFeaturedVideoFileUploadMutation.php new file mode 100644 index 0000000..b105ddf --- /dev/null +++ b/src/GraphQL/Mutations/InitWorkFeaturedVideoFileUploadMutation.php @@ -0,0 +1,49 @@ + 'initWorkFeaturedVideoFileUpload', + 'description' => 'Start uploading a hosted featured video for a work. The uploaded file is promoted to a DOI-scoped resource path.', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Input for starting a featured video upload', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'NewWorkFeaturedVideoFileUpload', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'FileUploadResponse', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/MoveAdditionalResourceMutation.php b/src/GraphQL/Mutations/MoveAdditionalResourceMutation.php new file mode 100644 index 0000000..5b9dbb6 --- /dev/null +++ b/src/GraphQL/Mutations/MoveAdditionalResourceMutation.php @@ -0,0 +1,63 @@ + 'moveAdditionalResource', + 'description' => 'Change the ordering of an additional resource within a work', + 'args' => [ + [ + 'name' => 'additionalResourceId', + 'description' => 'Thoth ID of additional resource to be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + [ + 'name' => 'newOrdinal', + 'description' => 'Ordinal representing position to which additional resource should be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'WorkResource', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/MoveAffiliationMutation.php b/src/GraphQL/Mutations/MoveAffiliationMutation.php new file mode 100644 index 0000000..922a51e --- /dev/null +++ b/src/GraphQL/Mutations/MoveAffiliationMutation.php @@ -0,0 +1,63 @@ + 'moveAffiliation', + 'description' => 'Change the ordering of an affiliation within a contribution', + 'args' => [ + [ + 'name' => 'affiliationId', + 'description' => 'Thoth ID of affiliation to be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + [ + 'name' => 'newOrdinal', + 'description' => 'Ordinal representing position to which affiliation should be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Affiliation', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/MoveAwardMutation.php b/src/GraphQL/Mutations/MoveAwardMutation.php new file mode 100644 index 0000000..7176162 --- /dev/null +++ b/src/GraphQL/Mutations/MoveAwardMutation.php @@ -0,0 +1,63 @@ + 'moveAward', + 'description' => 'Change the ordering of an award within a work', + 'args' => [ + [ + 'name' => 'awardId', + 'description' => 'Thoth ID of award to be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + [ + 'name' => 'newOrdinal', + 'description' => 'Ordinal representing position to which award should be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Award', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/MoveBookReviewMutation.php b/src/GraphQL/Mutations/MoveBookReviewMutation.php new file mode 100644 index 0000000..9f58318 --- /dev/null +++ b/src/GraphQL/Mutations/MoveBookReviewMutation.php @@ -0,0 +1,63 @@ + 'moveBookReview', + 'description' => 'Change the ordering of a book review within a work', + 'args' => [ + [ + 'name' => 'bookReviewId', + 'description' => 'Thoth ID of book review to be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + [ + 'name' => 'newOrdinal', + 'description' => 'Ordinal representing position to which book review should be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'BookReview', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/MoveContributionMutation.php b/src/GraphQL/Mutations/MoveContributionMutation.php new file mode 100644 index 0000000..b30920c --- /dev/null +++ b/src/GraphQL/Mutations/MoveContributionMutation.php @@ -0,0 +1,63 @@ + 'moveContribution', + 'description' => 'Change the ordering of a contribution within a work', + 'args' => [ + [ + 'name' => 'contributionId', + 'description' => 'Thoth ID of contribution to be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + [ + 'name' => 'newOrdinal', + 'description' => 'Ordinal representing position to which contribution should be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contribution', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/MoveEndorsementMutation.php b/src/GraphQL/Mutations/MoveEndorsementMutation.php new file mode 100644 index 0000000..08028e1 --- /dev/null +++ b/src/GraphQL/Mutations/MoveEndorsementMutation.php @@ -0,0 +1,63 @@ + 'moveEndorsement', + 'description' => 'Change the ordering of an endorsement within a work', + 'args' => [ + [ + 'name' => 'endorsementId', + 'description' => 'Thoth ID of endorsement to be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + [ + 'name' => 'newOrdinal', + 'description' => 'Ordinal representing position to which endorsement should be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Endorsement', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/MoveIssueMutation.php b/src/GraphQL/Mutations/MoveIssueMutation.php new file mode 100644 index 0000000..3899136 --- /dev/null +++ b/src/GraphQL/Mutations/MoveIssueMutation.php @@ -0,0 +1,63 @@ + 'moveIssue', + 'description' => 'Change the ordering of an issue within a series', + 'args' => [ + [ + 'name' => 'issueId', + 'description' => 'Thoth ID of issue to be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + [ + 'name' => 'newOrdinal', + 'description' => 'Ordinal representing position to which issue should be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Issue', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/MoveReferenceMutation.php b/src/GraphQL/Mutations/MoveReferenceMutation.php new file mode 100644 index 0000000..7ea0061 --- /dev/null +++ b/src/GraphQL/Mutations/MoveReferenceMutation.php @@ -0,0 +1,63 @@ + 'moveReference', + 'description' => 'Change the ordering of a reference within a work', + 'args' => [ + [ + 'name' => 'referenceId', + 'description' => 'Thoth ID of reference to be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + [ + 'name' => 'newOrdinal', + 'description' => 'Ordinal representing position to which reference should be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Reference', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/MoveSubjectMutation.php b/src/GraphQL/Mutations/MoveSubjectMutation.php new file mode 100644 index 0000000..412ffa5 --- /dev/null +++ b/src/GraphQL/Mutations/MoveSubjectMutation.php @@ -0,0 +1,63 @@ + 'moveSubject', + 'description' => 'Change the ordering of a subject within a work', + 'args' => [ + [ + 'name' => 'subjectId', + 'description' => 'Thoth ID of subject to be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + [ + 'name' => 'newOrdinal', + 'description' => 'Ordinal representing position to which subject should be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Subject', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/MoveWorkRelationMutation.php b/src/GraphQL/Mutations/MoveWorkRelationMutation.php new file mode 100644 index 0000000..66b987f --- /dev/null +++ b/src/GraphQL/Mutations/MoveWorkRelationMutation.php @@ -0,0 +1,63 @@ + 'moveWorkRelation', + 'description' => 'Change the ordering of a work relation within a work', + 'args' => [ + [ + 'name' => 'workRelationId', + 'description' => 'Thoth ID of work relation to be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + [ + 'name' => 'newOrdinal', + 'description' => 'Ordinal representing position to which work relation should be moved', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'WorkRelation', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateAbstractMutation.php b/src/GraphQL/Mutations/UpdateAbstractMutation.php new file mode 100644 index 0000000..1180fac --- /dev/null +++ b/src/GraphQL/Mutations/UpdateAbstractMutation.php @@ -0,0 +1,59 @@ + 'updateAbstract', + 'description' => 'Update an existing abstract with the specified values', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'The markup format of the abstract', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'data', + 'description' => 'Values to apply to existing abstract', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchAbstract', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Abstract', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateAdditionalResourceMutation.php b/src/GraphQL/Mutations/UpdateAdditionalResourceMutation.php new file mode 100644 index 0000000..ca4b060 --- /dev/null +++ b/src/GraphQL/Mutations/UpdateAdditionalResourceMutation.php @@ -0,0 +1,59 @@ + 'updateAdditionalResource', + 'description' => 'Update an existing additional resource with the specified values', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'The markup format of the additional resource text fields', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'data', + 'description' => 'Values to apply to existing additional resource', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchAdditionalResource', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'WorkResource', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateAffiliationMutation.php b/src/GraphQL/Mutations/UpdateAffiliationMutation.php new file mode 100644 index 0000000..5634fbd --- /dev/null +++ b/src/GraphQL/Mutations/UpdateAffiliationMutation.php @@ -0,0 +1,49 @@ + 'updateAffiliation', + 'description' => 'Update an existing affiliation with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values to apply to existing affiliation', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchAffiliation', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Affiliation', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateAwardMutation.php b/src/GraphQL/Mutations/UpdateAwardMutation.php new file mode 100644 index 0000000..02c661b --- /dev/null +++ b/src/GraphQL/Mutations/UpdateAwardMutation.php @@ -0,0 +1,59 @@ + 'updateAward', + 'description' => 'Update an existing award with the specified values', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'The markup format of the award text fields', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'data', + 'description' => 'Values to apply to existing award', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchAward', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Award', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateBiographyMutation.php b/src/GraphQL/Mutations/UpdateBiographyMutation.php new file mode 100644 index 0000000..23569f1 --- /dev/null +++ b/src/GraphQL/Mutations/UpdateBiographyMutation.php @@ -0,0 +1,59 @@ + 'updateBiography', + 'description' => 'Update an existing biography with the specified values', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'The markup format of the biography', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'data', + 'description' => 'Values to apply to existing biography', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchBiography', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Biography', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateBookReviewMutation.php b/src/GraphQL/Mutations/UpdateBookReviewMutation.php new file mode 100644 index 0000000..de74a9e --- /dev/null +++ b/src/GraphQL/Mutations/UpdateBookReviewMutation.php @@ -0,0 +1,59 @@ + 'updateBookReview', + 'description' => 'Update an existing book review with the specified values', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'The markup format of the book review text field', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'data', + 'description' => 'Values to apply to existing book review', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchBookReview', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'BookReview', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateContactMutation.php b/src/GraphQL/Mutations/UpdateContactMutation.php new file mode 100644 index 0000000..a55c4a1 --- /dev/null +++ b/src/GraphQL/Mutations/UpdateContactMutation.php @@ -0,0 +1,49 @@ + 'updateContact', + 'description' => 'Update an existing contact with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values to apply to existing contact', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchContact', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contact', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateContributionMutation.php b/src/GraphQL/Mutations/UpdateContributionMutation.php new file mode 100644 index 0000000..1471025 --- /dev/null +++ b/src/GraphQL/Mutations/UpdateContributionMutation.php @@ -0,0 +1,49 @@ + 'updateContribution', + 'description' => 'Update an existing contribution with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values to apply to existing contribution', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchContribution', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contribution', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateContributorMutation.php b/src/GraphQL/Mutations/UpdateContributorMutation.php new file mode 100644 index 0000000..4380cae --- /dev/null +++ b/src/GraphQL/Mutations/UpdateContributorMutation.php @@ -0,0 +1,49 @@ + 'updateContributor', + 'description' => 'Update an existing contributor with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values to apply to existing contributor', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchContributor', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contributor', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateEndorsementMutation.php b/src/GraphQL/Mutations/UpdateEndorsementMutation.php new file mode 100644 index 0000000..fb48b67 --- /dev/null +++ b/src/GraphQL/Mutations/UpdateEndorsementMutation.php @@ -0,0 +1,59 @@ + 'updateEndorsement', + 'description' => 'Update an existing endorsement with the specified values', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'The markup format of the endorsement rich-text fields', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'data', + 'description' => 'Values to apply to existing endorsement', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchEndorsement', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Endorsement', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateFundingMutation.php b/src/GraphQL/Mutations/UpdateFundingMutation.php new file mode 100644 index 0000000..7122322 --- /dev/null +++ b/src/GraphQL/Mutations/UpdateFundingMutation.php @@ -0,0 +1,49 @@ + 'updateFunding', + 'description' => 'Update an existing funding with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values to apply to existing funding', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchFunding', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Funding', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateImprintMutation.php b/src/GraphQL/Mutations/UpdateImprintMutation.php new file mode 100644 index 0000000..87a5d0f --- /dev/null +++ b/src/GraphQL/Mutations/UpdateImprintMutation.php @@ -0,0 +1,49 @@ + 'updateImprint', + 'description' => 'Update an existing imprint with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values to apply to existing imprint', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchImprint', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Imprint', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateInstitutionMutation.php b/src/GraphQL/Mutations/UpdateInstitutionMutation.php new file mode 100644 index 0000000..b563848 --- /dev/null +++ b/src/GraphQL/Mutations/UpdateInstitutionMutation.php @@ -0,0 +1,49 @@ + 'updateInstitution', + 'description' => 'Update an existing institution with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values to apply to existing institution', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchInstitution', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Institution', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateIssueMutation.php b/src/GraphQL/Mutations/UpdateIssueMutation.php new file mode 100644 index 0000000..7e6eb93 --- /dev/null +++ b/src/GraphQL/Mutations/UpdateIssueMutation.php @@ -0,0 +1,49 @@ + 'updateIssue', + 'description' => 'Update an existing issue with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values to apply to existing issue', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchIssue', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Issue', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateLanguageMutation.php b/src/GraphQL/Mutations/UpdateLanguageMutation.php new file mode 100644 index 0000000..0cdcae5 --- /dev/null +++ b/src/GraphQL/Mutations/UpdateLanguageMutation.php @@ -0,0 +1,49 @@ + 'updateLanguage', + 'description' => 'Update an existing language with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values to apply to existing language', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchLanguage', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Language', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateLocationMutation.php b/src/GraphQL/Mutations/UpdateLocationMutation.php new file mode 100644 index 0000000..530f212 --- /dev/null +++ b/src/GraphQL/Mutations/UpdateLocationMutation.php @@ -0,0 +1,49 @@ + 'updateLocation', + 'description' => 'Update an existing location with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values to apply to existing location', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchLocation', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Location', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdatePriceMutation.php b/src/GraphQL/Mutations/UpdatePriceMutation.php new file mode 100644 index 0000000..9cee3f3 --- /dev/null +++ b/src/GraphQL/Mutations/UpdatePriceMutation.php @@ -0,0 +1,49 @@ + 'updatePrice', + 'description' => 'Update an existing price with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values to apply to existing price', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchPrice', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Price', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdatePublicationMutation.php b/src/GraphQL/Mutations/UpdatePublicationMutation.php new file mode 100644 index 0000000..642c718 --- /dev/null +++ b/src/GraphQL/Mutations/UpdatePublicationMutation.php @@ -0,0 +1,49 @@ + 'updatePublication', + 'description' => 'Update an existing publication with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values to apply to existing publication', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchPublication', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Publication', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdatePublisherMutation.php b/src/GraphQL/Mutations/UpdatePublisherMutation.php new file mode 100644 index 0000000..c2eb3b6 --- /dev/null +++ b/src/GraphQL/Mutations/UpdatePublisherMutation.php @@ -0,0 +1,49 @@ + 'updatePublisher', + 'description' => 'Update an existing publisher with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values to apply to existing publisher', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchPublisher', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Publisher', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateReferenceMutation.php b/src/GraphQL/Mutations/UpdateReferenceMutation.php new file mode 100644 index 0000000..475647a --- /dev/null +++ b/src/GraphQL/Mutations/UpdateReferenceMutation.php @@ -0,0 +1,49 @@ + 'updateReference', + 'description' => 'Update an existing reference with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values to apply to existing reference', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchReference', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Reference', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateSeriesMutation.php b/src/GraphQL/Mutations/UpdateSeriesMutation.php new file mode 100644 index 0000000..c8ffbdf --- /dev/null +++ b/src/GraphQL/Mutations/UpdateSeriesMutation.php @@ -0,0 +1,59 @@ + 'updateSeries', + 'description' => 'Update an existing series with the specified values', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'The markup format of the series description', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'data', + 'description' => 'Values to apply to existing series', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchSeries', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Series', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateSubjectMutation.php b/src/GraphQL/Mutations/UpdateSubjectMutation.php new file mode 100644 index 0000000..832ffd1 --- /dev/null +++ b/src/GraphQL/Mutations/UpdateSubjectMutation.php @@ -0,0 +1,49 @@ + 'updateSubject', + 'description' => 'Update an existing subject with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values to apply to existing subject', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchSubject', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Subject', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateTitleMutation.php b/src/GraphQL/Mutations/UpdateTitleMutation.php new file mode 100644 index 0000000..eab06c6 --- /dev/null +++ b/src/GraphQL/Mutations/UpdateTitleMutation.php @@ -0,0 +1,59 @@ + 'updateTitle', + 'description' => 'Update an existing title with the specified values', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'The markup format of the title', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'data', + 'description' => 'Values to apply to existing title', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchTitle', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Title', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateWorkFeaturedVideoMutation.php b/src/GraphQL/Mutations/UpdateWorkFeaturedVideoMutation.php new file mode 100644 index 0000000..6e03b21 --- /dev/null +++ b/src/GraphQL/Mutations/UpdateWorkFeaturedVideoMutation.php @@ -0,0 +1,49 @@ + 'updateWorkFeaturedVideo', + 'description' => 'Update an existing featured video with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values to apply to existing featured video', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchWorkFeaturedVideo', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'WorkFeaturedVideo', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateWorkMutation.php b/src/GraphQL/Mutations/UpdateWorkMutation.php new file mode 100644 index 0000000..2118c30 --- /dev/null +++ b/src/GraphQL/Mutations/UpdateWorkMutation.php @@ -0,0 +1,49 @@ + 'updateWork', + 'description' => 'Update an existing work with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values to apply to existing work', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchWork', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Mutations/UpdateWorkRelationMutation.php b/src/GraphQL/Mutations/UpdateWorkRelationMutation.php new file mode 100644 index 0000000..bb01312 --- /dev/null +++ b/src/GraphQL/Mutations/UpdateWorkRelationMutation.php @@ -0,0 +1,49 @@ + 'updateWorkRelation', + 'description' => 'Update an existing work relation with the specified values', + 'args' => [ + [ + 'name' => 'data', + 'description' => 'Values to apply to existing work relation', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PatchWorkRelation', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'WorkRelation', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('mutation', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/ObjectData.php b/src/GraphQL/ObjectData.php new file mode 100644 index 0000000..97a4a82 --- /dev/null +++ b/src/GraphQL/ObjectData.php @@ -0,0 +1,97 @@ +data = []; + + foreach ($data as $field => $value) { + $this->data[$field] = static::hydrateFieldValue((string) $field, $value); + } + } + + /** + * @return static + */ + public static function fromArray(array $data): self + { + return new static($data); + } + + public function toArray(): array + { + return $this->normalizeArray($this->data); + } + + protected function get(string $field) + { + return $this->data[$field] ?? null; + } + + protected function set(string $field, $value): self + { + $this->data[$field] = static::hydrateFieldValue($field, $value); + return $this; + } + + protected function has(string $field): bool + { + return array_key_exists($field, $this->data); + } + + protected function remove(string $field): self + { + unset($this->data[$field]); + return $this; + } + + abstract public static function definition(): ObjectTypeDefinition; + + protected static function hydrateFieldValue(string $fieldName, $value) + { + $field = static::getFieldDefinition($fieldName); + + if ($field === null) { + return $value; + } + + return (new ValueHydrator())->hydrate($value, $field->getType()); + } + + protected static function getFieldDefinition(string $fieldName): ?FieldDefinition + { + foreach (static::definition()->getFields() as $field) { + if ($field->getName() === $fieldName) { + return $field; + } + } + + return null; + } + + private function normalizeArray(array $data): array + { + return array_map( + function ($value) { + if ($value instanceof self) { + return $value->toArray(); + } + + if (is_array($value)) { + return $this->normalizeArray($value); + } + + return $value; + }, + $data + ); + } +} diff --git a/src/GraphQL/Operation/Identifier.php b/src/GraphQL/Operation/Identifier.php new file mode 100644 index 0000000..f42558f --- /dev/null +++ b/src/GraphQL/Operation/Identifier.php @@ -0,0 +1,13 @@ +getSelectionArgument($arguments, $schemaArguments); + + return [ + 'arguments' => $this->getOperationArguments($schemaArguments, $arguments), + 'selection' => $selection, + ]; + } + + private function getSelectionArgument(array &$arguments, array $schemaArguments): array + { + $lastArgument = count($arguments) - 1; + + if ($lastArgument < 0 || !is_array($arguments[$lastArgument])) { + return []; + } + + if (count($arguments) > count($schemaArguments) && $this->isSelectionArray($arguments[$lastArgument])) { + return array_pop($arguments); + } + + if ( + isset($schemaArguments[$lastArgument]) + && $this->isScalarType($schemaArguments[$lastArgument]->getType()) + && $this->isSelectionArray($arguments[$lastArgument]) + ) { + return array_pop($arguments); + } + + if ( + count($arguments) === 2 + && is_array($arguments[0]) + && $this->hasSchemaNamedArguments($arguments[0], $schemaArguments) + && $this->isSelectionArray($arguments[$lastArgument]) + ) { + return array_pop($arguments); + } + + return []; + } + + private function getOperationArguments(array $schemaArguments, array $arguments): array + { + if ($schemaArguments === []) { + return []; + } + + if (count($arguments) === 1 && is_array($arguments[0]) && $this->isAssociativeArray($arguments[0])) { + if (count($schemaArguments) !== 1 || array_key_exists($schemaArguments[0]->getName(), $arguments[0])) { + return $this->normalizeValue($arguments[0]); + } + } + + if (count($schemaArguments) === 1) { + return [$schemaArguments[0]->getName() => $this->normalizeValue($arguments[0] ?? null)]; + } + + $operationArguments = []; + + foreach ($schemaArguments as $index => $schemaArgument) { + if (array_key_exists($index, $arguments)) { + $operationArguments[$schemaArgument->getName()] = $this->normalizeValue($arguments[$index]); + } + } + + return $operationArguments; + } + + private function normalizeValue($value) + { + if ($value instanceof EnumValue) { + return $value; + } + + if (is_array($value)) { + return array_map([$this, 'normalizeValue'], $value); + } + + if (is_object($value)) { + if (method_exists($value, 'getAllData')) { + return $this->normalizeValue($value->getAllData()); + } + + if ($value instanceof \JsonSerializable) { + return $this->normalizeValue($value->jsonSerialize()); + } + + return $this->normalizeValue(get_object_vars($value)); + } + + return $value; + } + + private function isAssociativeArray(array $value): bool + { + return $value !== [] && array_keys($value) !== range(0, count($value) - 1); + } + + private function isSelectionArray(array $value): bool + { + foreach ($value as $field => $selection) { + if (is_array($selection)) { + if (!is_string($field) || !$this->isSelectionArray($selection)) { + return false; + } + + continue; + } + + if (!is_string($selection)) { + return false; + } + } + + return true; + } + + private function hasSchemaNamedArguments(array $arguments, array $schemaArguments): bool + { + if (!$this->isAssociativeArray($arguments)) { + return false; + } + + foreach ($schemaArguments as $schemaArgument) { + if (array_key_exists($schemaArgument->getName(), $arguments)) { + return true; + } + } + + return false; + } + + private function isScalarType($type): bool + { + if ($type->getKind() === 'NON_NULL' && $type->getOfType() !== null) { + return $this->isScalarType($type->getOfType()); + } + + if ($type->getKind() === 'LIST') { + return false; + } + + return in_array($type->baseName(), self::SCALAR_TYPES, true); + } +} diff --git a/src/GraphQL/Operation/SchemaDefinitionResolver.php b/src/GraphQL/Operation/SchemaDefinitionResolver.php new file mode 100644 index 0000000..dad1a78 --- /dev/null +++ b/src/GraphQL/Operation/SchemaDefinitionResolver.php @@ -0,0 +1,77 @@ +getSchemaClassName('Inputs', $type ? $type->baseName() : null); + + if (!class_exists($inputClass)) { + return null; + } + + return $this->getFieldDefinitions($inputClass); + } + + public function getObjectFieldDefinitions(?TypeReference $type): ?array + { + $schemaClass = $this->getSchemaClassName('Schemas', $type ? $type->baseName() : null); + + if (!class_exists($schemaClass)) { + return null; + } + + return $this->getFieldDefinitions($schemaClass); + } + + public function getInputFieldType(?TypeReference $type, string $fieldName): ?TypeReference + { + $inputFields = $this->getInputFieldDefinitions($type); + + if ($inputFields === null) { + return null; + } + + return $inputFields[$fieldName] ?? null; + } + + public function isEnumType(?TypeReference $type): bool + { + if ($type === null) { + return false; + } + + if ($type->getKind() === 'NON_NULL') { + return $this->isEnumType($type->getOfType()); + } + + return class_exists($this->getSchemaClassName('Enums', $type->baseName())); + } + + public function getEnumValues(TypeReference $type): array + { + $enumClass = $this->getSchemaClassName('Enums', $type->baseName()); + + return $enumClass::definition()->getValues(); + } + + private function getSchemaClassName(string $namespacePart, ?string $typeName): string + { + return '\\ThothApi\\GraphQL\\' . $namespacePart . '\\' . ($typeName === 'Abstract' ? 'GraphQLAbstract' : $typeName); + } + + private function getFieldDefinitions(string $className): array + { + $fields = []; + + foreach ($className::definition()->getFields() as $field) { + $fields[$field->getName()] = $field->getType(); + } + + return $fields; + } +} diff --git a/src/GraphQL/Operation/SelectionFormatter.php b/src/GraphQL/Operation/SelectionFormatter.php new file mode 100644 index 0000000..30b2584 --- /dev/null +++ b/src/GraphQL/Operation/SelectionFormatter.php @@ -0,0 +1,58 @@ +schemaDefinitions = $schemaDefinitions ?: new SchemaDefinitionResolver(); + } + + public function format(array $selection, ?TypeReference $type = null): string + { + $lines = []; + $objectFields = $this->schemaDefinitions->getObjectFieldDefinitions($type); + + foreach ($selection as $key => $value) { + if (is_array($value)) { + Identifier::assert((string) $key); + $fieldType = $this->getSelectionFieldType($objectFields, (string) $key, $type); + $lines[] = ' ' . $key . " {\n" + . $this->indent($this->format($value, $fieldType), 8) + . "\n }"; + continue; + } + + Identifier::assert((string) $value); + $this->getSelectionFieldType($objectFields, (string) $value, $type); + $lines[] = ' ' . $value; + } + + return implode("\n", $lines); + } + + private function getSelectionFieldType(?array $objectFields, string $fieldName, ?TypeReference $parentType): ?TypeReference + { + if ($objectFields === null) { + return null; + } + + if (!array_key_exists($fieldName, $objectFields)) { + throw new \InvalidArgumentException( + "Unknown GraphQL field '{$fieldName}' for '{$parentType->baseName()}'." + ); + } + + return $objectFields[$fieldName]; + } + + private function indent(string $value, int $spaces): string + { + return str_replace("\n", "\n" . str_repeat(' ', $spaces), $value); + } +} diff --git a/src/GraphQL/Operation/VariableFormatter.php b/src/GraphQL/Operation/VariableFormatter.php new file mode 100644 index 0000000..9fb0b9d --- /dev/null +++ b/src/GraphQL/Operation/VariableFormatter.php @@ -0,0 +1,40 @@ + $value) { + if ($value === null) { + continue; + } + + Identifier::assert((string) $name); + if (isset($schemaArguments[$name])) { + $formatted[] = '$' . $name . ': ' . $schemaArguments[$name]->toGraphQL(); + } + } + + return implode(', ', $formatted); + } + + public function formatArguments(array $arguments): string + { + $formatted = []; + + foreach ($arguments as $name => $value) { + if ($value === null) { + continue; + } + + Identifier::assert((string) $name); + $formatted[] = $name . ': $' . $name; + } + + return implode(', ', $formatted); + } +} diff --git a/src/GraphQL/Operation/VariableNormalizer.php b/src/GraphQL/Operation/VariableNormalizer.php new file mode 100644 index 0000000..ec8237e --- /dev/null +++ b/src/GraphQL/Operation/VariableNormalizer.php @@ -0,0 +1,218 @@ +field = $field; + $this->schemaDefinitions = $schemaDefinitions ?: new SchemaDefinitionResolver(); + } + + public function normalize(array $variables, array $schemaArguments): array + { + $normalized = []; + + foreach ($schemaArguments as $name => $type) { + if ($this->isNonNullType($type) && (!array_key_exists($name, $variables) || $variables[$name] === null)) { + throw new \InvalidArgumentException("Missing required GraphQL argument '{$name}'."); + } + } + + foreach ($variables as $name => $value) { + Identifier::assert((string) $name); + + if (!array_key_exists($name, $schemaArguments)) { + throw new \InvalidArgumentException( + "Unknown GraphQL argument '{$name}' for '{$this->field->getName()}'." + ); + } + + if ($value !== null) { + $normalized[$name] = $this->normalizeValue($value, $schemaArguments[$name] ?? null); + } + } + + return $normalized; + } + + private function normalizeValue($value, ?TypeReference $type = null) + { + if ($type !== null && $type->getKind() === 'NON_NULL' && $type->getOfType() !== null) { + return $this->normalizeValue($value, $type->getOfType()); + } + + if ($value instanceof EnumValue) { + Identifier::assert((string) $value); + $this->assertEnumValue((string) $value, $type); + return (string) $value; + } + + if ($type !== null && $type->getKind() === 'LIST' && !$this->isListValue($value)) { + throw new \InvalidArgumentException( + "Invalid GraphQL value for '{$type->toGraphQL()}'; expected list." + ); + } + + if (is_array($value)) { + return $this->normalizeArrayValue($value, $type); + } + + if ($this->schemaDefinitions->isEnumType($type)) { + Identifier::assert((string) $value); + $this->assertEnumValue((string) $value, $type); + } + + $this->assertScalarValue($value, $type); + + return $value; + } + + private function normalizeArrayValue(array $value, ?TypeReference $type): array + { + if ($this->isList($value)) { + $listType = $this->getListItemType($type); + + return array_map(function ($item) use ($listType) { + return $this->normalizeValue($item, $listType); + }, $value); + } + + $normalized = []; + $inputFields = $this->schemaDefinitions->getInputFieldDefinitions($type); + + foreach ($value as $field => $fieldValue) { + Identifier::assert((string) $field); + + if ($inputFields !== null && !array_key_exists($field, $inputFields)) { + throw new \InvalidArgumentException( + "Unknown GraphQL input field '{$field}' for '{$type->baseName()}'." + ); + } + + $normalized[$field] = $fieldValue === null + ? null + : $this->normalizeValue( + $fieldValue, + $inputFields[$field] ?? $this->schemaDefinitions->getInputFieldType($type, (string) $field) + ); + } + + if ($inputFields !== null) { + foreach ($inputFields as $fieldName => $fieldType) { + if ( + $this->isNonNullType($fieldType) + && (!array_key_exists($fieldName, $normalized) || $normalized[$fieldName] === null) + ) { + throw new \InvalidArgumentException( + "Missing required GraphQL input field '{$fieldName}' for '{$type->baseName()}'." + ); + } + } + } + + return $normalized; + } + + private function assertScalarValue($value, ?TypeReference $type): void + { + if ($type === null || $type->getKind() !== 'NAMED') { + return; + } + + switch ($type->baseName()) { + case 'Boolean': + if (!is_bool($value)) { + $this->throwInvalidScalarValue($type, 'bool'); + } + return; + case 'Float': + if (!is_float($value) && !is_int($value)) { + $this->throwInvalidScalarValue($type, 'float'); + } + return; + case 'Int': + if (!is_int($value)) { + $this->throwInvalidScalarValue($type, 'int'); + } + return; + case 'String': + case 'Date': + case 'Doi': + case 'Isbn': + case 'Orcid': + case 'Ror': + case 'Timestamp': + case 'Uuid': + if (!is_string($value)) { + $this->throwInvalidScalarValue($type, 'string'); + } + return; + } + } + + private function throwInvalidScalarValue(TypeReference $type, string $expectedType): void + { + throw new \InvalidArgumentException( + "Invalid GraphQL value for '{$type->toGraphQL()}'; expected {$expectedType}." + ); + } + + private function assertEnumValue(string $value, ?TypeReference $type): void + { + if (!$this->schemaDefinitions->isEnumType($type)) { + return; + } + + if (!in_array($value, $this->schemaDefinitions->getEnumValues($type), true)) { + throw new \InvalidArgumentException( + "Invalid GraphQL enum value '{$value}' for '{$type->baseName()}'." + ); + } + } + + private function getListItemType(?TypeReference $type): ?TypeReference + { + if ($type === null) { + return null; + } + + if ($type->getKind() === 'NON_NULL') { + return $this->getListItemType($type->getOfType()); + } + + if ($type->getKind() === 'LIST') { + return $type->getOfType(); + } + + return null; + } + + private function isNonNullType(TypeReference $type): bool + { + return $type->getKind() === 'NON_NULL'; + } + + private function isListValue($value): bool + { + return is_array($value) && $this->isList($value); + } + + private function isList(array $value): bool + { + if ($value === []) { + return true; + } + + return array_keys($value) === range(0, count($value) - 1); + } +} diff --git a/src/GraphQL/OperationRequest.php b/src/GraphQL/OperationRequest.php new file mode 100644 index 0000000..2c679de --- /dev/null +++ b/src/GraphQL/OperationRequest.php @@ -0,0 +1,81 @@ +operationType = $operationType; + $this->field = $field; + $this->arguments = $arguments; + $this->selection = $selection; + } + + public static function enum(string $value): EnumValue + { + return new EnumValue($value); + } + + public function getField(): FieldDefinition + { + return $this->field; + } + + public function getSelection(): array + { + return $this->selection; + } + + public function getVariables(): array + { + return (new VariableNormalizer($this->field))->normalize($this->arguments, $this->getSchemaArgumentsByName()); + } + + public function toGraphQL(): string + { + Identifier::assert($this->field->getName()); + $this->getVariables(); + $variableFormatter = new VariableFormatter(); + $variableDefinitions = $variableFormatter->formatDefinitions($this->arguments, $this->getSchemaArgumentsByName()); + $arguments = $variableFormatter->formatArguments($this->arguments); + $fieldLine = $this->field->getName() . ($arguments === '' ? '' : '(' . $arguments . ')'); + $selection = (new SelectionFormatter())->format($this->selection, $this->field->getType()); + + if ($selection !== '') { + $fieldLine .= " {\n" . $selection . "\n }"; + } + + return $this->operationType . ($variableDefinitions === '' ? '' : ' (' . $variableDefinitions . ')') + . " {\n " . $fieldLine . "\n}"; + } + + private function getSchemaArgumentsByName(): array + { + $arguments = []; + + foreach ($this->field->getArguments() as $argument) { + $arguments[$argument->getName()] = $argument->getType(); + } + + return $arguments; + } +} diff --git a/src/GraphQL/Queries/AbstractQuery.php b/src/GraphQL/Queries/AbstractQuery.php index 6f70567..77b88b8 100644 --- a/src/GraphQL/Queries/AbstractQuery.php +++ b/src/GraphQL/Queries/AbstractQuery.php @@ -2,16 +2,58 @@ namespace ThothApi\GraphQL\Queries; -abstract class AbstractQuery +use ThothApi\GraphQL\Definition\FieldDefinition; +use ThothApi\GraphQL\OperationRequest; + +final class AbstractQuery { - abstract protected function getFieldsFragment(): string; + public static function field(): FieldDefinition + { + return \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'abstract', + 'description' => 'Query an abstract by its ID', + 'args' => [ + [ + 'name' => 'abstractId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + [ + 'name' => 'markupFormat', + 'description' => 'If set shows results with this markup format', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => '"JATS_XML"', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Abstract', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } - protected function buildQuery(string $queryBody): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - $fragment = $this->getFieldsFragment(); - return <<buildQuery( - <<buildQuery( - << 'abstracts', + 'description' => 'Query the full list of abstracts', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on content fields', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'AbstractOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "CANONICAL", direction: "DESC"}', + ], + [ + 'name' => 'localeCodes', + 'description' => 'If set only shows results with these locale codes', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocaleCode', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'markupFormat', + 'description' => 'If set shows result with this markup format', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => '"JATS_XML"', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Abstract', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/AdditionalResourceCountQuery.php b/src/GraphQL/Queries/AdditionalResourceCountQuery.php new file mode 100644 index 0000000..6547e1d --- /dev/null +++ b/src/GraphQL/Queries/AdditionalResourceCountQuery.php @@ -0,0 +1,34 @@ + 'additionalResourceCount', + 'description' => 'Get the total number of additional resources', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/AdditionalResourceQuery.php b/src/GraphQL/Queries/AdditionalResourceQuery.php index 24d332e..be59866 100644 --- a/src/GraphQL/Queries/AdditionalResourceQuery.php +++ b/src/GraphQL/Queries/AdditionalResourceQuery.php @@ -2,73 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class AdditionalResourceQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'additionalResource', + 'description' => 'Query a single additional resource using its ID', + 'args' => [ + [ + 'name' => 'additionalResourceId', + 'description' => 'Thoth additional resource ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'WorkResource', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'additionalResources', + 'description' => 'Query the full list of additional resources', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'AdditionalResourceOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "RESOURCE_ORDINAL", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'WorkResource', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/AffiliationCountQuery.php b/src/GraphQL/Queries/AffiliationCountQuery.php new file mode 100644 index 0000000..95c4d7a --- /dev/null +++ b/src/GraphQL/Queries/AffiliationCountQuery.php @@ -0,0 +1,34 @@ + 'affiliationCount', + 'description' => 'Get the total number of affiliations', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/AffiliationQuery.php b/src/GraphQL/Queries/AffiliationQuery.php index 3c77ce6..5c02b40 100644 --- a/src/GraphQL/Queries/AffiliationQuery.php +++ b/src/GraphQL/Queries/AffiliationQuery.php @@ -2,67 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class AffiliationQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'affiliation', + 'description' => 'Query a single affiliation using its ID', + 'args' => [ + [ + 'name' => 'affiliationId', + 'description' => 'Thoth affiliation ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Affiliation', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'affiliations', + 'description' => 'Query the full list of affiliations', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'AffiliationOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "AFFILIATION_ORDINAL", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Affiliation', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/AwardCountQuery.php b/src/GraphQL/Queries/AwardCountQuery.php new file mode 100644 index 0000000..2d06a1a --- /dev/null +++ b/src/GraphQL/Queries/AwardCountQuery.php @@ -0,0 +1,34 @@ + 'awardCount', + 'description' => 'Get the total number of awards', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/AwardQuery.php b/src/GraphQL/Queries/AwardQuery.php index e26356a..00d1dd0 100644 --- a/src/GraphQL/Queries/AwardQuery.php +++ b/src/GraphQL/Queries/AwardQuery.php @@ -2,73 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class AwardQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'award', + 'description' => 'Query a single award using its ID', + 'args' => [ + [ + 'name' => 'awardId', + 'description' => 'Thoth award ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Award', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'awards', + 'description' => 'Query the full list of awards', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'AwardOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "AWARD_ORDINAL", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Award', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/BiographiesQuery.php b/src/GraphQL/Queries/BiographiesQuery.php new file mode 100644 index 0000000..58d87e5 --- /dev/null +++ b/src/GraphQL/Queries/BiographiesQuery.php @@ -0,0 +1,111 @@ + 'biographies', + 'description' => 'Query biographies by work ID', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on content fields', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'BiographyOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "CANONICAL", direction: "DESC"}', + ], + [ + 'name' => 'localeCodes', + 'description' => 'If set, only shows results with these locale codes', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocaleCode', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'markupFormat', + 'description' => 'If set shows result with this markup format', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => '"JATS_XML"', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Biography', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/BiographyQuery.php b/src/GraphQL/Queries/BiographyQuery.php index 1bc44b4..68b6be1 100644 --- a/src/GraphQL/Queries/BiographyQuery.php +++ b/src/GraphQL/Queries/BiographyQuery.php @@ -2,65 +2,58 @@ namespace ThothApi\GraphQL\Queries; -class BiographyQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'biography', + 'description' => 'Query an biography by it\'s ID', + 'args' => [ + [ + 'name' => 'biographyId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + [ + 'name' => 'markupFormat', + 'description' => 'If set shows result with this markup format', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => '"JATS_XML"', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Biography', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'bookByDoi', + 'description' => 'Query a single book using its DOI', + 'args' => [ + [ + 'name' => 'doi', + 'description' => 'Book DOI to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/BookCountQuery.php b/src/GraphQL/Queries/BookCountQuery.php new file mode 100644 index 0000000..6af9db2 --- /dev/null +++ b/src/GraphQL/Queries/BookCountQuery.php @@ -0,0 +1,111 @@ + 'bookCount', + 'description' => 'Get the total number of books (a subset of the total number of works)', + 'args' => [ + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on full_title, doi, reference, short_abstract, long_abstract, and landing_page', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'workStatus', + 'description' => '(deprecated) A specific status to filter by', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'WorkStatus', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'workStatuses', + 'description' => 'Specific statuses to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkStatus', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'publicationDate', + 'description' => 'Only show results with a publication date either before (less than) or after (greater than) the specified timestamp', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'TimeExpression', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'updatedAtWithRelations', + 'description' => 'Only show results updated either before (less than) or after (greater than) the specified timestamp', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'TimeExpression', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/BookReviewCountQuery.php b/src/GraphQL/Queries/BookReviewCountQuery.php new file mode 100644 index 0000000..693e1fc --- /dev/null +++ b/src/GraphQL/Queries/BookReviewCountQuery.php @@ -0,0 +1,34 @@ + 'bookReviewCount', + 'description' => 'Get the total number of book reviews', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/BookReviewQuery.php b/src/GraphQL/Queries/BookReviewQuery.php index 40ea366..c4148b8 100644 --- a/src/GraphQL/Queries/BookReviewQuery.php +++ b/src/GraphQL/Queries/BookReviewQuery.php @@ -2,78 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class BookReviewQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'bookReview', + 'description' => 'Query a single book review using its ID', + 'args' => [ + [ + 'name' => 'bookReviewId', + 'description' => 'Thoth book review ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'BookReview', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'bookReviews', + 'description' => 'Query the full list of book reviews', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'BookReviewOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "REVIEW_ORDINAL", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'BookReview', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/BooksQuery.php b/src/GraphQL/Queries/BooksQuery.php new file mode 100644 index 0000000..ebdce72 --- /dev/null +++ b/src/GraphQL/Queries/BooksQuery.php @@ -0,0 +1,149 @@ + 'books', + 'description' => 'Query the full list of books (a subset of the full list of works)', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on full_title, doi, reference, short_abstract, long_abstract, and landing_page', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'WorkOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "FULL_TITLE", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'workStatus', + 'description' => '(deprecated) A specific status to filter by', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'WorkStatus', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'workStatuses', + 'description' => 'Specific statuses to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkStatus', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'publicationDate', + 'description' => 'Only show results with a publication date either before (less than) or after (greater than) the specified timestamp', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'TimeExpression', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'updatedAtWithRelations', + 'description' => 'Only show results updated either before (less than) or after (greater than) the specified timestamp', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'TimeExpression', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/ChapterByDoiQuery.php b/src/GraphQL/Queries/ChapterByDoiQuery.php new file mode 100644 index 0000000..05fd649 --- /dev/null +++ b/src/GraphQL/Queries/ChapterByDoiQuery.php @@ -0,0 +1,49 @@ + 'chapterByDoi', + 'description' => 'Query a single chapter using its DOI', + 'args' => [ + [ + 'name' => 'doi', + 'description' => 'Chapter DOI to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/ChapterCountQuery.php b/src/GraphQL/Queries/ChapterCountQuery.php new file mode 100644 index 0000000..80380dd --- /dev/null +++ b/src/GraphQL/Queries/ChapterCountQuery.php @@ -0,0 +1,111 @@ + 'chapterCount', + 'description' => 'Get the total number of chapters (a subset of the total number of works)', + 'args' => [ + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on full_title, doi, reference, short_abstract, long_abstract, and landing_page', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'workStatus', + 'description' => '(deprecated) A specific status to filter by', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'WorkStatus', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'workStatuses', + 'description' => 'Specific statuses to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkStatus', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'publicationDate', + 'description' => 'Only show results with a publication date either before (less than) or after (greater than) the specified timestamp', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'TimeExpression', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'updatedAtWithRelations', + 'description' => 'Only show results updated either before (less than) or after (greater than) the specified timestamp', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'TimeExpression', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/ChaptersQuery.php b/src/GraphQL/Queries/ChaptersQuery.php new file mode 100644 index 0000000..2a00d72 --- /dev/null +++ b/src/GraphQL/Queries/ChaptersQuery.php @@ -0,0 +1,149 @@ + 'chapters', + 'description' => 'Query the full list of chapters (a subset of the full list of works)', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on full_title, doi, reference, short_abstract, long_abstract, and landing_page', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'WorkOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "FULL_TITLE", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'workStatus', + 'description' => '(deprecated) A specific status to filter by', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'WorkStatus', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'workStatuses', + 'description' => 'Specific statuses to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkStatus', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'publicationDate', + 'description' => 'Only show results with a publication date either before (less than) or after (greater than) the specified timestamp', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'TimeExpression', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'updatedAtWithRelations', + 'description' => 'Only show results updated either before (less than) or after (greater than) the specified timestamp', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'TimeExpression', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/ContactCountQuery.php b/src/GraphQL/Queries/ContactCountQuery.php new file mode 100644 index 0000000..da1a6c8 --- /dev/null +++ b/src/GraphQL/Queries/ContactCountQuery.php @@ -0,0 +1,53 @@ + 'contactCount', + 'description' => 'Get the total number of contacts', + 'args' => [ + [ + 'name' => 'contactTypes', + 'description' => 'Specific types to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ContactType', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/ContactQuery.php b/src/GraphQL/Queries/ContactQuery.php index 97fda2f..b3c8a10 100644 --- a/src/GraphQL/Queries/ContactQuery.php +++ b/src/GraphQL/Queries/ContactQuery.php @@ -2,68 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class ContactQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'contact', + 'description' => 'Query a single contact using its ID', + 'args' => [ + [ + 'name' => 'contactId', + 'description' => 'Thoth contact ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contact', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'contacts', + 'description' => 'Query the full list of contacts', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'ContactOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "EMAIL", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'contactTypes', + 'description' => 'Specific types to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ContactType', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contact', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/ContributionCountQuery.php b/src/GraphQL/Queries/ContributionCountQuery.php new file mode 100644 index 0000000..64c99f7 --- /dev/null +++ b/src/GraphQL/Queries/ContributionCountQuery.php @@ -0,0 +1,53 @@ + 'contributionCount', + 'description' => 'Get the total number of contributions', + 'args' => [ + [ + 'name' => 'contributionTypes', + 'description' => 'Specific types to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ContributionType', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/ContributionQuery.php b/src/GraphQL/Queries/ContributionQuery.php index def8d25..fee5cd5 100644 --- a/src/GraphQL/Queries/ContributionQuery.php +++ b/src/GraphQL/Queries/ContributionQuery.php @@ -2,79 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class ContributionQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'contribution', + 'description' => 'Query a single contribution using its ID', + 'args' => [ + [ + 'name' => 'contributionId', + 'description' => 'Thoth contribution ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contribution', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'contributions', + 'description' => 'Query the full list of contributions', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'ContributionOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "CONTRIBUTION_TYPE", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'contributionTypes', + 'description' => 'Specific types to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ContributionType', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contribution', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/ContributorCountQuery.php b/src/GraphQL/Queries/ContributorCountQuery.php new file mode 100644 index 0000000..f6a18a3 --- /dev/null +++ b/src/GraphQL/Queries/ContributorCountQuery.php @@ -0,0 +1,45 @@ + 'contributorCount', + 'description' => 'Get the total number of contributors', + 'args' => [ + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on full_name, last_name and orcid', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/ContributorQuery.php b/src/GraphQL/Queries/ContributorQuery.php index 1254e8f..c0a5d43 100644 --- a/src/GraphQL/Queries/ContributorQuery.php +++ b/src/GraphQL/Queries/ContributorQuery.php @@ -2,68 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class ContributorQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'contributor', + 'description' => 'Query a single contributor using its ID', + 'args' => [ + [ + 'name' => 'contributorId', + 'description' => 'Thoth contributor ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contributor', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'contributors', + 'description' => 'Query the full list of contributors', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on full_name, last_name and orcid', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'ContributorOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "FULL_NAME", direction: "ASC"}', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contributor', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/EndorsementCountQuery.php b/src/GraphQL/Queries/EndorsementCountQuery.php new file mode 100644 index 0000000..b3ae701 --- /dev/null +++ b/src/GraphQL/Queries/EndorsementCountQuery.php @@ -0,0 +1,34 @@ + 'endorsementCount', + 'description' => 'Get the total number of endorsements', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/EndorsementQuery.php b/src/GraphQL/Queries/EndorsementQuery.php index ccf17c0..9541db1 100644 --- a/src/GraphQL/Queries/EndorsementQuery.php +++ b/src/GraphQL/Queries/EndorsementQuery.php @@ -2,71 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class EndorsementQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'endorsement', + 'description' => 'Query a single endorsement using its ID', + 'args' => [ + [ + 'name' => 'endorsementId', + 'description' => 'Thoth endorsement ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Endorsement', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'endorsements', + 'description' => 'Query the full list of endorsements', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'EndorsementOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "ENDORSEMENT_ORDINAL", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Endorsement', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/FileQuery.php b/src/GraphQL/Queries/FileQuery.php index 71b2b69..2e2f171 100644 --- a/src/GraphQL/Queries/FileQuery.php +++ b/src/GraphQL/Queries/FileQuery.php @@ -2,37 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class FileQuery extends AbstractQuery +use ThothApi\GraphQL\Definition\FieldDefinition; +use ThothApi\GraphQL\OperationRequest; + +final class FileQuery { - public function getQuery(): string + public static function field(): FieldDefinition { - return $this->buildQuery( - << 'file', + 'description' => 'Query a single file using its ID', + 'args' => [ + [ + 'name' => 'fileId', + 'description' => 'Thoth file ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'File', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'fundingCount', + 'description' => 'Get the total number of funding instances associated to works', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/FundingQuery.php b/src/GraphQL/Queries/FundingQuery.php index e082dd3..c516229 100644 --- a/src/GraphQL/Queries/FundingQuery.php +++ b/src/GraphQL/Queries/FundingQuery.php @@ -2,69 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class FundingQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'funding', + 'description' => 'Query a single funding using its ID', + 'args' => [ + [ + 'name' => 'fundingId', + 'description' => 'Thoth funding ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Funding', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'fundings', + 'description' => 'Query the full list of fundings', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'FundingOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "PROGRAM", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Funding', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/ImprintCountQuery.php b/src/GraphQL/Queries/ImprintCountQuery.php new file mode 100644 index 0000000..42ee550 --- /dev/null +++ b/src/GraphQL/Queries/ImprintCountQuery.php @@ -0,0 +1,63 @@ + 'imprintCount', + 'description' => 'Get the total number of imprints', + 'args' => [ + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on imprint_name and imprint_url', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/ImprintQuery.php b/src/GraphQL/Queries/ImprintQuery.php index 6b1cf7f..0eede5a 100644 --- a/src/GraphQL/Queries/ImprintQuery.php +++ b/src/GraphQL/Queries/ImprintQuery.php @@ -2,106 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class ImprintQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQueryWithRestrictedFields( - <<<'GQL' - query($imprintId: Uuid!) { - imprint(imprintId: $imprintId) { - ...imprintFields - } - } - GQL, - true - ); - } - - public function getManyQuery(): string - { - return $this->getManyQueryWithRestrictedFields(false); - } - - public function getManyQueryWithRestrictedFields(bool $includeRestrictedFields = false): string - { - return $this->buildQueryWithRestrictedFields( - <<<'GQL' - query( - $limit: Int = 100 - $offset: Int = 0 - $filter: String = "" - $field: ImprintField = IMPRINT_NAME - $direction: Direction = ASC - $publishers: [Uuid!] = [] - ) { - imprints( - limit: $limit - offset: $offset - filter: $filter - order: { - field: $field - direction: $direction - } - publishers: $publishers - ) { - ...imprintFields - } - } - GQL, - $includeRestrictedFields - ); - } +use ThothApi\GraphQL\Definition\FieldDefinition; +use ThothApi\GraphQL\OperationRequest; - public function getCountQuery(): string - { - return <<getFieldsFragmentWithRestrictedFields(true); - } - - protected function getFieldsFragmentWithRestrictedFields(bool $includeRestrictedFields = false): string +final class ImprintQuery +{ + public static function field(): FieldDefinition { - $restrictedFields = $includeRestrictedFields ? << 'imprint', + 'description' => 'Query a single imprint using its ID', + 'args' => [ + [ + 'name' => 'imprintId', + 'description' => 'Thoth imprint ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Imprint', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - private function buildQueryWithRestrictedFields(string $queryBody, bool $includeRestrictedFields): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - $fragment = $this->getFieldsFragmentWithRestrictedFields($includeRestrictedFields); - return << 'imprints', + 'description' => 'Query the full list of imprints', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on imprint_name and imprint_url', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'ImprintOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "IMPRINT_NAME", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Imprint', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/InstitutionCountQuery.php b/src/GraphQL/Queries/InstitutionCountQuery.php new file mode 100644 index 0000000..b0cf2c7 --- /dev/null +++ b/src/GraphQL/Queries/InstitutionCountQuery.php @@ -0,0 +1,45 @@ + 'institutionCount', + 'description' => 'Get the total number of institutions', + 'args' => [ + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on institution_name, ror and institution_doi', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/InstitutionQuery.php b/src/GraphQL/Queries/InstitutionQuery.php index dbc061a..bebf1ad 100644 --- a/src/GraphQL/Queries/InstitutionQuery.php +++ b/src/GraphQL/Queries/InstitutionQuery.php @@ -2,69 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class InstitutionQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'institution', + 'description' => 'Query a single institution using its ID', + 'args' => [ + [ + 'name' => 'institutionId', + 'description' => 'Thoth institution ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Institution', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'institutions', + 'description' => 'Query the full list of institutions', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on institution_name, ror and institution_doi', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'InstitutionOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "INSTITUTION_NAME", direction: "ASC"}', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Institution', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/IssueCountQuery.php b/src/GraphQL/Queries/IssueCountQuery.php new file mode 100644 index 0000000..6b6d238 --- /dev/null +++ b/src/GraphQL/Queries/IssueCountQuery.php @@ -0,0 +1,34 @@ + 'issueCount', + 'description' => 'Get the total number of issues', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/IssueQuery.php b/src/GraphQL/Queries/IssueQuery.php index 244c197..45f8399 100644 --- a/src/GraphQL/Queries/IssueQuery.php +++ b/src/GraphQL/Queries/IssueQuery.php @@ -2,67 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class IssueQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'issue', + 'description' => 'Query a single issue using its ID', + 'args' => [ + [ + 'name' => 'issueId', + 'description' => 'Thoth issue ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Issue', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'issues', + 'description' => 'Query the full list of issues', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'IssueOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "ISSUE_ORDINAL", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Issue', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/LanguageCountQuery.php b/src/GraphQL/Queries/LanguageCountQuery.php new file mode 100644 index 0000000..cedc9f9 --- /dev/null +++ b/src/GraphQL/Queries/LanguageCountQuery.php @@ -0,0 +1,81 @@ + 'languageCount', + 'description' => 'Get the total number of languages associated to works', + 'args' => [ + [ + 'name' => 'languageCodes', + 'description' => 'Specific languages to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LanguageCode', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'languageRelation', + 'description' => '(deprecated) A specific relation to filter by', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'LanguageRelation', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'languageRelations', + 'description' => 'Specific relations to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LanguageRelation', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/LanguageQuery.php b/src/GraphQL/Queries/LanguageQuery.php index 009712d..1e2abfc 100644 --- a/src/GraphQL/Queries/LanguageQuery.php +++ b/src/GraphQL/Queries/LanguageQuery.php @@ -2,76 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class LanguageQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'language', + 'description' => 'Query a single language using its ID', + 'args' => [ + [ + 'name' => 'languageId', + 'description' => 'Thoth language ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Language', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'languages', + 'description' => 'Query the full list of languages', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'LanguageOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "LANGUAGE_CODE", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'languageCodes', + 'description' => 'Specific languages to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LanguageCode', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'languageRelation', + 'description' => '(deprecated) A specific relation to filter by', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'LanguageRelation', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'languageRelations', + 'description' => 'Specific relations to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LanguageRelation', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Language', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/LocationCountQuery.php b/src/GraphQL/Queries/LocationCountQuery.php new file mode 100644 index 0000000..9232bfd --- /dev/null +++ b/src/GraphQL/Queries/LocationCountQuery.php @@ -0,0 +1,53 @@ + 'locationCount', + 'description' => 'Get the total number of locations associated to works', + 'args' => [ + [ + 'name' => 'locationPlatforms', + 'description' => 'Specific platforms to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocationPlatform', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/LocationQuery.php b/src/GraphQL/Queries/LocationQuery.php index a8bdbfb..505c8b2 100644 --- a/src/GraphQL/Queries/LocationQuery.php +++ b/src/GraphQL/Queries/LocationQuery.php @@ -2,70 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class LocationQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'location', + 'description' => 'Query a single location using its ID', + 'args' => [ + [ + 'name' => 'locationId', + 'description' => 'Thoth location ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Location', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'locations', + 'description' => 'Query the full list of locations', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'LocationOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "LOCATION_PLATFORM", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'locationPlatforms', + 'description' => 'Specific platforms to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocationPlatform', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Location', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/MeQuery.php b/src/GraphQL/Queries/MeQuery.php index 4247f5d..0b82226 100644 --- a/src/GraphQL/Queries/MeQuery.php +++ b/src/GraphQL/Queries/MeQuery.php @@ -2,38 +2,33 @@ namespace ThothApi\GraphQL\Queries; -class MeQuery extends AbstractQuery +use ThothApi\GraphQL\Definition\FieldDefinition; +use ThothApi\GraphQL\OperationRequest; + +final class MeQuery { - public function getQuery(): string + public static function field(): FieldDefinition { - return $this->buildQuery( - << 'me', + 'description' => 'Get the total number of contacts', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Me', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'priceCount', + 'description' => 'Get the total number of prices associated to works', + 'args' => [ + [ + 'name' => 'currencyCodes', + 'description' => 'Specific currencies to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'CurrencyCode', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/PriceQuery.php b/src/GraphQL/Queries/PriceQuery.php index 3771a45..a9b65f3 100644 --- a/src/GraphQL/Queries/PriceQuery.php +++ b/src/GraphQL/Queries/PriceQuery.php @@ -2,68 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class PriceQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'price', + 'description' => 'Query a single price using its ID', + 'args' => [ + [ + 'name' => 'priceId', + 'description' => 'Thoth price ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Price', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'prices', + 'description' => 'Query the full list of prices', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PriceOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "CURRENCY_CODE", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'currencyCodes', + 'description' => 'Specific currencies to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'CurrencyCode', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Price', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/PublicationCountQuery.php b/src/GraphQL/Queries/PublicationCountQuery.php new file mode 100644 index 0000000..9971241 --- /dev/null +++ b/src/GraphQL/Queries/PublicationCountQuery.php @@ -0,0 +1,81 @@ + 'publicationCount', + 'description' => 'Get the total number of publications', + 'args' => [ + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on isbn', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'publicationTypes', + 'description' => 'Specific types to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'PublicationType', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/PublicationQuery.php b/src/GraphQL/Queries/PublicationQuery.php index c514539..31eaed3 100644 --- a/src/GraphQL/Queries/PublicationQuery.php +++ b/src/GraphQL/Queries/PublicationQuery.php @@ -2,92 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class PublicationQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'publication', + 'description' => 'Query a single publication using its ID', + 'args' => [ + [ + 'name' => 'publicationId', + 'description' => 'Thoth publication ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Publication', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'publications', + 'description' => 'Query the full list of publications', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on isbn', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PublicationOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "PUBLICATION_TYPE", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'publicationTypes', + 'description' => 'Specific types to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'PublicationType', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Publication', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/PublisherCountQuery.php b/src/GraphQL/Queries/PublisherCountQuery.php new file mode 100644 index 0000000..e5120a7 --- /dev/null +++ b/src/GraphQL/Queries/PublisherCountQuery.php @@ -0,0 +1,63 @@ + 'publisherCount', + 'description' => 'Get the total number of publishers', + 'args' => [ + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on publisher_name and publisher_shortname', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/PublisherQuery.php b/src/GraphQL/Queries/PublisherQuery.php index 5deedd5..ebf18c4 100644 --- a/src/GraphQL/Queries/PublisherQuery.php +++ b/src/GraphQL/Queries/PublisherQuery.php @@ -2,77 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class PublisherQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'publisher', + 'description' => 'Query a single publisher using its ID', + 'args' => [ + [ + 'name' => 'publisherId', + 'description' => 'Thoth publisher ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Publisher', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'publishers', + 'description' => 'Query the full list of publishers', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on publisher_name and publisher_shortname', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PublisherOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "PUBLISHER_NAME", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Publisher', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/ReferenceCountQuery.php b/src/GraphQL/Queries/ReferenceCountQuery.php new file mode 100644 index 0000000..a26785c --- /dev/null +++ b/src/GraphQL/Queries/ReferenceCountQuery.php @@ -0,0 +1,34 @@ + 'referenceCount', + 'description' => 'Get the total number of references', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/ReferenceQuery.php b/src/GraphQL/Queries/ReferenceQuery.php index a7d27d8..6714376 100644 --- a/src/GraphQL/Queries/ReferenceQuery.php +++ b/src/GraphQL/Queries/ReferenceQuery.php @@ -2,85 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class ReferenceQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'reference', + 'description' => 'Query a single reference using its ID', + 'args' => [ + [ + 'name' => 'referenceId', + 'description' => 'Thoth reference ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Reference', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'references', + 'description' => 'Query the full list of references', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'ReferenceOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "REFERENCE_ORDINAL", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Reference', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/SeriesCountQuery.php b/src/GraphQL/Queries/SeriesCountQuery.php new file mode 100644 index 0000000..699c9b0 --- /dev/null +++ b/src/GraphQL/Queries/SeriesCountQuery.php @@ -0,0 +1,81 @@ + 'seriesCount', + 'description' => 'Get the total number of series', + 'args' => [ + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on series_name, issn_print, issn_digital, series_url and series_description', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'seriesTypes', + 'description' => 'Specific types to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'SeriesType', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/SeriesQuery.php b/src/GraphQL/Queries/SeriesQuery.php index 72eed7a..260c0ab 100644 --- a/src/GraphQL/Queries/SeriesQuery.php +++ b/src/GraphQL/Queries/SeriesQuery.php @@ -2,83 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class SeriesQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'series', + 'description' => 'Query a single series using its ID', + 'args' => [ + [ + 'name' => 'seriesId', + 'description' => 'Thoth series ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Series', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'serieses', + 'description' => 'Query the full list of series', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on series_name, issn_print, issn_digital, series_url and series_description', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'SeriesOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "SERIES_NAME", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'seriesTypes', + 'description' => 'Specific types to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'SeriesType', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Series', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/SubjectCountQuery.php b/src/GraphQL/Queries/SubjectCountQuery.php new file mode 100644 index 0000000..f5b1f56 --- /dev/null +++ b/src/GraphQL/Queries/SubjectCountQuery.php @@ -0,0 +1,81 @@ + 'subjectCount', + 'description' => 'Get the total number of subjects associated to works', + 'args' => [ + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on subject_code', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'subjectTypes', + 'description' => 'Specific types to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'SubjectType', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'workStatuses', + 'description' => 'Specific statuses to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkStatus', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/SubjectQuery.php b/src/GraphQL/Queries/SubjectQuery.php index cb8ff8e..dbc859b 100644 --- a/src/GraphQL/Queries/SubjectQuery.php +++ b/src/GraphQL/Queries/SubjectQuery.php @@ -2,77 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class SubjectQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'subject', + 'description' => 'Query a single subject using its ID', + 'args' => [ + [ + 'name' => 'subjectId', + 'description' => 'Thoth subject ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Subject', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'subjects', + 'description' => 'Query the full list of subjects', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on subject_code', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'SubjectOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "SUBJECT_TYPE", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'subjectTypes', + 'description' => 'Specific types to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'SubjectType', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'workStatuses', + 'description' => 'Specific statuses to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkStatus', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Subject', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/TitleQuery.php b/src/GraphQL/Queries/TitleQuery.php index 9de3fe7..1868fba 100644 --- a/src/GraphQL/Queries/TitleQuery.php +++ b/src/GraphQL/Queries/TitleQuery.php @@ -2,67 +2,58 @@ namespace ThothApi\GraphQL\Queries; -class TitleQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'title', + 'description' => 'Query a title by its ID', + 'args' => [ + [ + 'name' => 'titleId', + 'description' => null, + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + [ + 'name' => 'markupFormat', + 'description' => null, + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Title', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'titles', + 'description' => 'Query the full list of titles', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on title_, subtitle, full_title fields', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'TitleOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "CANONICAL", direction: "DESC"}', + ], + [ + 'name' => 'localeCodes', + 'description' => 'If set, only shows results with these locale codes', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocaleCode', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'markupFormat', + 'description' => 'If set shows result with this markup format', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => '"JATS_XML"', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Title', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/WorkByDoiQuery.php b/src/GraphQL/Queries/WorkByDoiQuery.php new file mode 100644 index 0000000..ebdb39f --- /dev/null +++ b/src/GraphQL/Queries/WorkByDoiQuery.php @@ -0,0 +1,49 @@ + 'workByDoi', + 'description' => 'Query a single work using its DOI', + 'args' => [ + [ + 'name' => 'doi', + 'description' => 'Work DOI to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/WorkCountQuery.php b/src/GraphQL/Queries/WorkCountQuery.php new file mode 100644 index 0000000..dc8ecd8 --- /dev/null +++ b/src/GraphQL/Queries/WorkCountQuery.php @@ -0,0 +1,129 @@ + 'workCount', + 'description' => 'Get the total number of works', + 'args' => [ + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on full_title, doi, reference, short_abstract, long_abstract, and landing_page', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'workTypes', + 'description' => 'Specific types to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkType', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'workStatus', + 'description' => '(deprecated) A specific status to filter by', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'WorkStatus', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'workStatuses', + 'description' => 'Specific statuses to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkStatus', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'publicationDate', + 'description' => 'Only show results with a publication date either before (less than) or after (greater than) the specified timestamp', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'TimeExpression', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'updatedAtWithRelations', + 'description' => 'Only show results updated either before (less than) or after (greater than) the specified timestamp', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'TimeExpression', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/WorkFeaturedVideoCountQuery.php b/src/GraphQL/Queries/WorkFeaturedVideoCountQuery.php new file mode 100644 index 0000000..5799a2a --- /dev/null +++ b/src/GraphQL/Queries/WorkFeaturedVideoCountQuery.php @@ -0,0 +1,34 @@ + 'workFeaturedVideoCount', + 'description' => 'Get the total number of featured videos', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/WorkFeaturedVideoQuery.php b/src/GraphQL/Queries/WorkFeaturedVideoQuery.php index 53dc8bc..958620c 100644 --- a/src/GraphQL/Queries/WorkFeaturedVideoQuery.php +++ b/src/GraphQL/Queries/WorkFeaturedVideoQuery.php @@ -2,68 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class WorkFeaturedVideoQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - << 'workFeaturedVideo', + 'description' => 'Query a single featured video using its ID', + 'args' => [ + [ + 'name' => 'workFeaturedVideoId', + 'description' => 'Thoth featured video ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'WorkFeaturedVideo', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'workFeaturedVideos', + 'description' => 'Query the full list of featured videos', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'WorkFeaturedVideoOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "UPDATED_AT", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'WorkFeaturedVideo', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/Queries/WorkQuery.php b/src/GraphQL/Queries/WorkQuery.php index 38feb32..aefd94d 100644 --- a/src/GraphQL/Queries/WorkQuery.php +++ b/src/GraphQL/Queries/WorkQuery.php @@ -2,132 +2,48 @@ namespace ThothApi\GraphQL\Queries; -class WorkQuery extends AbstractQuery -{ - public function getQuery(): string - { - return $this->buildQuery( - <<buildQuery( - <<buildQuery( - << 'work', + 'description' => 'Query a single work using its ID', + 'args' => [ + [ + 'name' => 'workId', + 'description' => 'Thoth work ID to search on', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); } - protected function getFieldsFragment(): string + public static function operation(array $arguments = [], array $selection = []): OperationRequest { - return << 'works', + 'description' => 'Query the full list of works', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on full_title, doi, reference, short_abstract, long_abstract, and landing_page', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'WorkOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "FULL_TITLE", direction: "ASC"}', + ], + [ + 'name' => 'publishers', + 'description' => 'If set, only shows results connected to publishers with these IDs', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'workTypes', + 'description' => 'Specific types to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkType', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'workStatus', + 'description' => '(deprecated) A specific status to filter by', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'WorkStatus', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'workStatuses', + 'description' => 'Specific statuses to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkStatus', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'publicationDate', + 'description' => 'Only show results with a publication date either before (less than) or after (greater than) the specified timestamp', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'TimeExpression', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'updatedAtWithRelations', + 'description' => 'Only show results updated either before (less than) or after (greater than) the specified timestamp', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'TimeExpression', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]); + } + + public static function operation(array $arguments = [], array $selection = []): OperationRequest + { + return new OperationRequest('query', self::field(), $arguments, $selection); + } +} diff --git a/src/GraphQL/QueryProvider.php b/src/GraphQL/QueryProvider.php deleted file mode 100644 index 8094f4a..0000000 --- a/src/GraphQL/QueryProvider.php +++ /dev/null @@ -1,130 +0,0 @@ - (new FileQuery())->getQuery(), - 'me' => (new MeQuery())->getQuery(), - ] - ); - } - - private static function mapQuery(AbstractQuery $queryObject, string $name): array - { - return [ - $name => $queryObject->getQuery(), - self::getPluralQueryName($name) => $queryObject->getManyQuery(), - $name . 'Count' => $queryObject->getCountQuery(), - ]; - } - - private static function mapWorkQueries(WorkQuery $workQuery): array - { - return [ - 'books' => $workQuery->getManyQuery('book'), - 'bookByDoi' => $workQuery->getByDoiQuery('book'), - 'bookCount' => $workQuery->getCountQuery('book'), - 'chapters' => $workQuery->getManyQuery('chapter'), - 'chapterByDoi' => $workQuery->getByDoiQuery('chapter'), - 'chapterCount' => $workQuery->getCountQuery('chapter'), - 'work' => $workQuery->getQuery(), - 'works' => $workQuery->getManyQuery(), - 'workByDoi' => $workQuery->getByDoiQuery(), - 'workCount' => $workQuery->getCountQuery(), - ]; - } - - private static function mapMarkupQuery(AbstractQuery $queryObject, string $name): array - { - return [ - $name => $queryObject->getQuery(), - self::getPluralQueryName($name) => $queryObject->getManyQuery(), - ]; - } - - private static function getPluralQueryName(string $name): string - { - switch ($name) { - case 'biography': - return 'biographies'; - case 'series': - return 'serieses'; - default: - return $name . 's'; - } - } -} diff --git a/src/GraphQL/Request.php b/src/GraphQL/Request.php index 1952371..1e1297f 100644 --- a/src/GraphQL/Request.php +++ b/src/GraphQL/Request.php @@ -3,7 +3,9 @@ namespace ThothApi\GraphQL; use GuzzleHttp\Client; -use GuzzleHttp\Exception\ClientException; +use GuzzleHttp\Exception\RequestException; +use GuzzleHttp\Exception\TransferException; +use ThothApi\Exception\QueryException; class Request { @@ -33,17 +35,28 @@ public function runQuery(string $query, ?array $variables = null, ?string $token $options['headers']['Authorization'] = 'Bearer ' . $token; } - return $this->execute('POST', 'graphql', $options); + return $this->execute('POST', 'graphql', $options, $query, $variables); } - public function execute(string $method, string $endpoint, array $options = []): Response - { + public function execute( + string $method, + string $endpoint, + array $options = [], + ?string $query = null, + ?array $variables = null + ): Response { try { $httpResponse = $this->httpClient->request($method, $endpoint, $options); - } catch (ClientException $exception) { + } catch (RequestException $exception) { $httpResponse = $exception->getResponse(); + + if ($httpResponse === null) { + throw new QueryException(['message' => $exception->getMessage()], $query, $variables); + } + } catch (TransferException $exception) { + throw new QueryException(['message' => $exception->getMessage()], $query, $variables); } - return new Response($httpResponse); + return new Response($httpResponse, $query, $variables); } } diff --git a/src/GraphQL/Response.php b/src/GraphQL/Response.php index 3265b95..4630f52 100644 --- a/src/GraphQL/Response.php +++ b/src/GraphQL/Response.php @@ -2,7 +2,6 @@ namespace ThothApi\GraphQL; -use GuzzleHttp\Psr7\Response as GuzzleResponse; use Psr\Http\Message\ResponseInterface; use ThothApi\Exception\QueryException; @@ -10,28 +9,51 @@ class Response { private string $body; - private GuzzleResponse $previousResponse; + private ResponseInterface $previousResponse; - public function __construct(ResponseInterface $guzzleResponse) + private array $decodedBody; + + private ?string $query; + + private ?array $variables; + + public function __construct(ResponseInterface $guzzleResponse, ?string $query = null, ?array $variables = null) { $this->previousResponse = $guzzleResponse; $this->body = $guzzleResponse->getBody()->getContents(); + $this->query = $query; + $this->variables = $variables; + $this->decodedBody = $this->decodeBody(); if ($error = $this->getErrors()) { - throw new QueryException($error); + throw new QueryException( + $error, + $this->query, + $this->variables, + $this->decodedBody['errors'], + $this->previousResponse->getStatusCode() + ); + } + + if (!array_key_exists('data', $this->decodedBody) || !is_array($this->decodedBody['data'])) { + throw new QueryException( + ['message' => 'GraphQL response does not contain data.'], + $this->query, + $this->variables, + null, + $this->previousResponse->getStatusCode() + ); } } public function getErrors(): ?array { - $decodedBody = json_decode($this->body, true); - - if (isset($decodedBody['errors'])) { - return array_shift($decodedBody['errors']); - } - - if (!isset($decodedBody['data']) && $this->previousResponse->getStatusCode() != 200) { - return ['message' => $this->body]; + if ( + isset($this->decodedBody['errors']) + && is_array($this->decodedBody['errors']) + && isset($this->decodedBody['errors'][0]) + ) { + return $this->decodedBody['errors'][0]; } return null; @@ -43,8 +65,36 @@ public function getBody(): string } public function getData(): array + { + return $this->decodedBody['data']; + } + + private function decodeBody(): array { $decodedBody = json_decode($this->body, true); - return $decodedBody['data']; + + if (json_last_error() !== JSON_ERROR_NONE || !is_array($decodedBody)) { + throw new QueryException( + ['message' => 'Invalid JSON response from GraphQL API.'], + $this->query, + $this->variables, + null, + $this->previousResponse->getStatusCode() + ); + } + + if (!isset($decodedBody['errors']) && !array_key_exists('data', $decodedBody)) { + if ($this->previousResponse->getStatusCode() !== 200) { + throw new QueryException( + ['message' => $this->body], + $this->query, + $this->variables, + null, + $this->previousResponse->getStatusCode() + ); + } + } + + return $decodedBody; } } diff --git a/src/GraphQL/Scalars/BooleanScalar.php b/src/GraphQL/Scalars/BooleanScalar.php new file mode 100644 index 0000000..3fd8e90 --- /dev/null +++ b/src/GraphQL/Scalars/BooleanScalar.php @@ -0,0 +1,13 @@ ++\\[\\]]+$`'); + } +} diff --git a/src/GraphQL/Scalars/FloatScalar.php b/src/GraphQL/Scalars/FloatScalar.php new file mode 100644 index 0000000..2dd2e9f --- /dev/null +++ b/src/GraphQL/Scalars/FloatScalar.php @@ -0,0 +1,13 @@ +get('affiliationId'); + } + + /** + * @param string $value + */ + public function setAffiliationId($value): self + { + $this->set('affiliationId', $value); + return $this; + } + + public function hasAffiliationId(): bool + { + return $this->has('affiliationId'); + } + + public function unsetAffiliationId(): self + { + $this->remove('affiliationId'); + return $this; + } + + /** + * @return string + */ + public function getContributionId() + { + return $this->get('contributionId'); + } + + /** + * @param string $value + */ + public function setContributionId($value): self + { + $this->set('contributionId', $value); + return $this; + } + + public function hasContributionId(): bool + { + return $this->has('contributionId'); + } + + public function unsetContributionId(): self + { + $this->remove('contributionId'); + return $this; + } + + /** + * @return string + */ + public function getInstitutionId() + { + return $this->get('institutionId'); + } + + /** + * @param string $value + */ + public function setInstitutionId($value): self + { + $this->set('institutionId', $value); + return $this; + } + + public function hasInstitutionId(): bool + { + return $this->has('institutionId'); + } + + public function unsetInstitutionId(): self + { + $this->remove('institutionId'); + return $this; + } + + /** + * @return int + */ + public function getAffiliationOrdinal() + { + return $this->get('affiliationOrdinal'); + } + + /** + * @param int $value + */ + public function setAffiliationOrdinal($value): self + { + $this->set('affiliationOrdinal', $value); + return $this; + } + + public function hasAffiliationOrdinal(): bool + { + return $this->has('affiliationOrdinal'); + } + + public function unsetAffiliationOrdinal(): self + { + $this->remove('affiliationOrdinal'); + return $this; + } + + /** + * @return string|null + */ + public function getPosition() + { + return $this->get('position'); + } + + /** + * @param string|null $value + */ + public function setPosition($value): self + { + $this->set('position', $value); + return $this; + } + + public function hasPosition(): bool + { + return $this->has('position'); + } + + public function unsetPosition(): self + { + $this->remove('position'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Institution + */ + public function getInstitution() + { + return $this->get('institution'); + } + + /** + * @param Institution $value + */ + public function setInstitution($value): self + { + $this->set('institution', $value); + return $this; + } + + public function hasInstitution(): bool + { + return $this->has('institution'); + } + + public function unsetInstitution(): self + { + $this->remove('institution'); + return $this; + } + + /** + * @return Contribution + */ + public function getContribution() + { + return $this->get('contribution'); + } + + /** + * @param Contribution $value + */ + public function setContribution($value): self + { + $this->set('contribution', $value); + return $this; + } + + public function hasContribution(): bool + { + return $this->has('contribution'); + } + + public function unsetContribution(): self + { + $this->remove('contribution'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Affiliation', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'affiliationId', + 'description' => 'Thoth ID of the affiliation', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'contributionId', + 'description' => 'Thoth ID of the contribution linked to this affiliation', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'institutionId', + 'description' => 'Thoth ID of the institution linked to this affiliation', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'affiliationOrdinal', + 'description' => 'Number representing this affiliation\'s position in an ordered list of affiliations within the contribution', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'position', + 'description' => 'Position of the contributor at the institution at the time of contribution', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the affiliation record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the affiliation record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'institution', + 'description' => 'Get the institution linked to this affiliation', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Institution', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'contribution', + 'description' => 'Get the contribution linked to this affiliation', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contribution', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Award.php b/src/GraphQL/Schemas/Award.php new file mode 100644 index 0000000..89ff6ea --- /dev/null +++ b/src/GraphQL/Schemas/Award.php @@ -0,0 +1,625 @@ +get('awardId'); + } + + /** + * @param string $value + */ + public function setAwardId($value): self + { + $this->set('awardId', $value); + return $this; + } + + public function hasAwardId(): bool + { + return $this->has('awardId'); + } + + public function unsetAwardId(): self + { + $this->remove('awardId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getTitle() + { + return $this->get('title'); + } + + /** + * @param string $value + */ + public function setTitle($value): self + { + $this->set('title', $value); + return $this; + } + + public function hasTitle(): bool + { + return $this->has('title'); + } + + public function unsetTitle(): self + { + $this->remove('title'); + return $this; + } + + /** + * @return string|null + */ + public function getUrl() + { + return $this->get('url'); + } + + /** + * @param string|null $value + */ + public function setUrl($value): self + { + $this->set('url', $value); + return $this; + } + + public function hasUrl(): bool + { + return $this->has('url'); + } + + public function unsetUrl(): self + { + $this->remove('url'); + return $this; + } + + /** + * @return string|null + */ + public function getCategory() + { + return $this->get('category'); + } + + /** + * @param string|null $value + */ + public function setCategory($value): self + { + $this->set('category', $value); + return $this; + } + + public function hasCategory(): bool + { + return $this->has('category'); + } + + public function unsetCategory(): self + { + $this->remove('category'); + return $this; + } + + /** + * @return string|null + */ + public function getYear() + { + return $this->get('year'); + } + + /** + * @param string|null $value + */ + public function setYear($value): self + { + $this->set('year', $value); + return $this; + } + + public function hasYear(): bool + { + return $this->has('year'); + } + + public function unsetYear(): self + { + $this->remove('year'); + return $this; + } + + /** + * @return string|null + */ + public function getJury() + { + return $this->get('jury'); + } + + /** + * @param string|null $value + */ + public function setJury($value): self + { + $this->set('jury', $value); + return $this; + } + + public function hasJury(): bool + { + return $this->has('jury'); + } + + public function unsetJury(): self + { + $this->remove('jury'); + return $this; + } + + /** + * @return string|null + */ + public function getCountry() + { + return $this->get('country'); + } + + /** + * @param string|null $value + */ + public function setCountry($value): self + { + $this->set('country', $value); + return $this; + } + + public function hasCountry(): bool + { + return $this->has('country'); + } + + public function unsetCountry(): self + { + $this->remove('country'); + return $this; + } + + /** + * @return string|null + */ + public function getRole() + { + return $this->get('role'); + } + + /** + * @param string|null $value + */ + public function setRole($value): self + { + $this->set('role', $value); + return $this; + } + + public function hasRole(): bool + { + return $this->has('role'); + } + + public function unsetRole(): self + { + $this->remove('role'); + return $this; + } + + /** + * @return string|null + */ + public function getPrizeStatement() + { + return $this->get('prizeStatement'); + } + + /** + * @param string|null $value + */ + public function setPrizeStatement($value): self + { + $this->set('prizeStatement', $value); + return $this; + } + + public function hasPrizeStatement(): bool + { + return $this->has('prizeStatement'); + } + + public function unsetPrizeStatement(): self + { + $this->remove('prizeStatement'); + return $this; + } + + /** + * @return int + */ + public function getAwardOrdinal() + { + return $this->get('awardOrdinal'); + } + + /** + * @param int $value + */ + public function setAwardOrdinal($value): self + { + $this->set('awardOrdinal', $value); + return $this; + } + + public function hasAwardOrdinal(): bool + { + return $this->has('awardOrdinal'); + } + + public function unsetAwardOrdinal(): self + { + $this->remove('awardOrdinal'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Work + */ + public function getWork() + { + return $this->get('work'); + } + + /** + * @param Work $value + */ + public function setWork($value): self + { + $this->set('work', $value); + return $this; + } + + public function hasWork(): bool + { + return $this->has('work'); + } + + public function unsetWork(): self + { + $this->remove('work'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Award', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'awardId', + 'description' => 'Thoth ID of the award', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => 'Thoth ID of the work to which this award belongs', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'title', + 'description' => 'Title of the award', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'Markup format used for rendering title', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => '"JATS_XML"', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'url', + 'description' => 'URL of the award page', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'category', + 'description' => 'Category of the award', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'year', + 'description' => 'Year or year span associated with the award', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'jury', + 'description' => 'Jury associated with the award', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'country', + 'description' => 'Country associated with the award', + 'args' => [], + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'CountryCode', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'role', + 'description' => 'Role of the work in this award', + 'args' => [], + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'AwardRole', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'prizeStatement', + 'description' => 'Prize statement for this award', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'Markup format used for rendering prize statement', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => '"JATS_XML"', + ], + ], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'awardOrdinal', + 'description' => 'Number representing this award\'s position in an ordered list of awards within the work', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the award record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the award record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'work', + 'description' => 'Get the work linked to this award', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Biography.php b/src/GraphQL/Schemas/Biography.php new file mode 100644 index 0000000..b6564df --- /dev/null +++ b/src/GraphQL/Schemas/Biography.php @@ -0,0 +1,323 @@ +get('biographyId'); + } + + /** + * @param string $value + */ + public function setBiographyId($value): self + { + $this->set('biographyId', $value); + return $this; + } + + public function hasBiographyId(): bool + { + return $this->has('biographyId'); + } + + public function unsetBiographyId(): self + { + $this->remove('biographyId'); + return $this; + } + + /** + * @return string + */ + public function getContributionId() + { + return $this->get('contributionId'); + } + + /** + * @param string $value + */ + public function setContributionId($value): self + { + $this->set('contributionId', $value); + return $this; + } + + public function hasContributionId(): bool + { + return $this->has('contributionId'); + } + + public function unsetContributionId(): self + { + $this->remove('contributionId'); + return $this; + } + + /** + * @return string + */ + public function getLocaleCode() + { + return $this->get('localeCode'); + } + + /** + * @param string $value + */ + public function setLocaleCode($value): self + { + $this->set('localeCode', $value); + return $this; + } + + public function hasLocaleCode(): bool + { + return $this->has('localeCode'); + } + + public function unsetLocaleCode(): self + { + $this->remove('localeCode'); + return $this; + } + + /** + * @return string + */ + public function getContent() + { + return $this->get('content'); + } + + /** + * @param string $value + */ + public function setContent($value): self + { + $this->set('content', $value); + return $this; + } + + public function hasContent(): bool + { + return $this->has('content'); + } + + public function unsetContent(): self + { + $this->remove('content'); + return $this; + } + + /** + * @return bool + */ + public function getCanonical() + { + return $this->get('canonical'); + } + + /** + * @param bool $value + */ + public function setCanonical($value): self + { + $this->set('canonical', $value); + return $this; + } + + public function hasCanonical(): bool + { + return $this->has('canonical'); + } + + public function unsetCanonical(): self + { + $this->remove('canonical'); + return $this; + } + + /** + * @return Work + */ + public function getWork() + { + return $this->get('work'); + } + + /** + * @param Work $value + */ + public function setWork($value): self + { + $this->set('work', $value); + return $this; + } + + public function hasWork(): bool + { + return $this->has('work'); + } + + public function unsetWork(): self + { + $this->remove('work'); + return $this; + } + + /** + * @return Contribution + */ + public function getContribution() + { + return $this->get('contribution'); + } + + /** + * @param Contribution $value + */ + public function setContribution($value): self + { + $this->set('contribution', $value); + return $this; + } + + public function hasContribution(): bool + { + return $this->has('contribution'); + } + + public function unsetContribution(): self + { + $this->remove('contribution'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Biography', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'biographyId', + 'description' => 'Thoth ID of the biography', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'contributionId', + 'description' => 'Thoth ID of the contribution to which the biography is linked', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'localeCode', + 'description' => 'Locale code of the biography', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocaleCode', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'content', + 'description' => 'Content of the biography', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'canonical', + 'description' => 'Whether this is the canonical biography for the contribution/work', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Boolean', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'work', + 'description' => 'Get the work to which the biography is linked via contribution', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'contribution', + 'description' => 'Get the contribution to which the biography is linked', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contribution', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/BookReview.php b/src/GraphQL/Schemas/BookReview.php new file mode 100644 index 0000000..9865961 --- /dev/null +++ b/src/GraphQL/Schemas/BookReview.php @@ -0,0 +1,861 @@ +get('bookReviewId'); + } + + /** + * @param string $value + */ + public function setBookReviewId($value): self + { + $this->set('bookReviewId', $value); + return $this; + } + + public function hasBookReviewId(): bool + { + return $this->has('bookReviewId'); + } + + public function unsetBookReviewId(): self + { + $this->remove('bookReviewId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string|null + */ + public function getTitle() + { + return $this->get('title'); + } + + /** + * @param string|null $value + */ + public function setTitle($value): self + { + $this->set('title', $value); + return $this; + } + + public function hasTitle(): bool + { + return $this->has('title'); + } + + public function unsetTitle(): self + { + $this->remove('title'); + return $this; + } + + /** + * @return string|null + */ + public function getAuthorName() + { + return $this->get('authorName'); + } + + /** + * @param string|null $value + */ + public function setAuthorName($value): self + { + $this->set('authorName', $value); + return $this; + } + + public function hasAuthorName(): bool + { + return $this->has('authorName'); + } + + public function unsetAuthorName(): self + { + $this->remove('authorName'); + return $this; + } + + /** + * @return string|null + */ + public function getReviewerOrcid() + { + return $this->get('reviewerOrcid'); + } + + /** + * @param string|null $value + */ + public function setReviewerOrcid($value): self + { + $this->set('reviewerOrcid', $value); + return $this; + } + + public function hasReviewerOrcid(): bool + { + return $this->has('reviewerOrcid'); + } + + public function unsetReviewerOrcid(): self + { + $this->remove('reviewerOrcid'); + return $this; + } + + /** + * @return string|null + */ + public function getReviewerInstitutionId() + { + return $this->get('reviewerInstitutionId'); + } + + /** + * @param string|null $value + */ + public function setReviewerInstitutionId($value): self + { + $this->set('reviewerInstitutionId', $value); + return $this; + } + + public function hasReviewerInstitutionId(): bool + { + return $this->has('reviewerInstitutionId'); + } + + public function unsetReviewerInstitutionId(): self + { + $this->remove('reviewerInstitutionId'); + return $this; + } + + /** + * @return string|null + */ + public function getUrl() + { + return $this->get('url'); + } + + /** + * @param string|null $value + */ + public function setUrl($value): self + { + $this->set('url', $value); + return $this; + } + + public function hasUrl(): bool + { + return $this->has('url'); + } + + public function unsetUrl(): self + { + $this->remove('url'); + return $this; + } + + /** + * @return string|null + */ + public function getDoi() + { + return $this->get('doi'); + } + + /** + * @param string|null $value + */ + public function setDoi($value): self + { + $this->set('doi', $value); + return $this; + } + + public function hasDoi(): bool + { + return $this->has('doi'); + } + + public function unsetDoi(): self + { + $this->remove('doi'); + return $this; + } + + /** + * @return string|null + */ + public function getReviewDate() + { + return $this->get('reviewDate'); + } + + /** + * @param string|null $value + */ + public function setReviewDate($value): self + { + $this->set('reviewDate', $value); + return $this; + } + + public function hasReviewDate(): bool + { + return $this->has('reviewDate'); + } + + public function unsetReviewDate(): self + { + $this->remove('reviewDate'); + return $this; + } + + /** + * @return string|null + */ + public function getJournalName() + { + return $this->get('journalName'); + } + + /** + * @param string|null $value + */ + public function setJournalName($value): self + { + $this->set('journalName', $value); + return $this; + } + + public function hasJournalName(): bool + { + return $this->has('journalName'); + } + + public function unsetJournalName(): self + { + $this->remove('journalName'); + return $this; + } + + /** + * @return string|null + */ + public function getJournalVolume() + { + return $this->get('journalVolume'); + } + + /** + * @param string|null $value + */ + public function setJournalVolume($value): self + { + $this->set('journalVolume', $value); + return $this; + } + + public function hasJournalVolume(): bool + { + return $this->has('journalVolume'); + } + + public function unsetJournalVolume(): self + { + $this->remove('journalVolume'); + return $this; + } + + /** + * @return string|null + */ + public function getJournalNumber() + { + return $this->get('journalNumber'); + } + + /** + * @param string|null $value + */ + public function setJournalNumber($value): self + { + $this->set('journalNumber', $value); + return $this; + } + + public function hasJournalNumber(): bool + { + return $this->has('journalNumber'); + } + + public function unsetJournalNumber(): self + { + $this->remove('journalNumber'); + return $this; + } + + /** + * @return string|null + */ + public function getJournalIssn() + { + return $this->get('journalIssn'); + } + + /** + * @param string|null $value + */ + public function setJournalIssn($value): self + { + $this->set('journalIssn', $value); + return $this; + } + + public function hasJournalIssn(): bool + { + return $this->has('journalIssn'); + } + + public function unsetJournalIssn(): self + { + $this->remove('journalIssn'); + return $this; + } + + /** + * @return string|null + */ + public function getPageRange() + { + return $this->get('pageRange'); + } + + /** + * @param string|null $value + */ + public function setPageRange($value): self + { + $this->set('pageRange', $value); + return $this; + } + + public function hasPageRange(): bool + { + return $this->has('pageRange'); + } + + public function unsetPageRange(): self + { + $this->remove('pageRange'); + return $this; + } + + /** + * @return string|null + */ + public function getText() + { + return $this->get('text'); + } + + /** + * @param string|null $value + */ + public function setText($value): self + { + $this->set('text', $value); + return $this; + } + + public function hasText(): bool + { + return $this->has('text'); + } + + public function unsetText(): self + { + $this->remove('text'); + return $this; + } + + /** + * @return int + */ + public function getReviewOrdinal() + { + return $this->get('reviewOrdinal'); + } + + /** + * @param int $value + */ + public function setReviewOrdinal($value): self + { + $this->set('reviewOrdinal', $value); + return $this; + } + + public function hasReviewOrdinal(): bool + { + return $this->has('reviewOrdinal'); + } + + public function unsetReviewOrdinal(): self + { + $this->remove('reviewOrdinal'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Work + */ + public function getWork() + { + return $this->get('work'); + } + + /** + * @param Work $value + */ + public function setWork($value): self + { + $this->set('work', $value); + return $this; + } + + public function hasWork(): bool + { + return $this->has('work'); + } + + public function unsetWork(): self + { + $this->remove('work'); + return $this; + } + + /** + * @return Institution|null + */ + public function getReviewerInstitution() + { + return $this->get('reviewerInstitution'); + } + + /** + * @param Institution|null $value + */ + public function setReviewerInstitution($value): self + { + $this->set('reviewerInstitution', $value); + return $this; + } + + public function hasReviewerInstitution(): bool + { + return $this->has('reviewerInstitution'); + } + + public function unsetReviewerInstitution(): self + { + $this->remove('reviewerInstitution'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('BookReview', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'bookReviewId', + 'description' => 'Thoth ID of the book review', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => 'Thoth ID of the work to which this review belongs', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'title', + 'description' => 'Title of the review', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'Markup format used for rendering review title', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => '"JATS_XML"', + ], + ], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'authorName', + 'description' => 'Name of the review author', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'reviewerOrcid', + 'description' => 'ORCID (Open Researcher and Contributor ID) of the reviewer as full URL, using the HTTPS scheme and the orcid.org domain', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Orcid', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'reviewerInstitutionId', + 'description' => 'Thoth ID of the reviewer\'s institution', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'url', + 'description' => 'URL of the review publication', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'doi', + 'description' => 'DOI of the review as full URL, using the HTTPS scheme and the doi.org domain', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'reviewDate', + 'description' => 'Publication date of the review', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Date', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'journalName', + 'description' => 'Name of the journal where the review was published', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'journalVolume', + 'description' => 'Volume of the journal where the review was published', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'journalNumber', + 'description' => 'Number of the journal where the review was published', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'journalIssn', + 'description' => 'ISSN of the journal where the review was published', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'pageRange', + 'description' => 'Page range of the review', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'text', + 'description' => 'Text of the review', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'Markup format used for rendering review text', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => '"JATS_XML"', + ], + ], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'reviewOrdinal', + 'description' => 'Number representing this review\'s position in an ordered list of reviews within the work', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the review record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the review record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'work', + 'description' => 'Get the work linked to this review', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'reviewerInstitution', + 'description' => 'Get the reviewer\'s institution', + 'args' => [], + 'type' => [ + 'kind' => 'OBJECT', + 'name' => 'Institution', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Contact.php b/src/GraphQL/Schemas/Contact.php new file mode 100644 index 0000000..8acf04b --- /dev/null +++ b/src/GraphQL/Schemas/Contact.php @@ -0,0 +1,323 @@ +get('contactId'); + } + + /** + * @param string $value + */ + public function setContactId($value): self + { + $this->set('contactId', $value); + return $this; + } + + public function hasContactId(): bool + { + return $this->has('contactId'); + } + + public function unsetContactId(): self + { + $this->remove('contactId'); + return $this; + } + + /** + * @return string + */ + public function getPublisherId() + { + return $this->get('publisherId'); + } + + /** + * @param string $value + */ + public function setPublisherId($value): self + { + $this->set('publisherId', $value); + return $this; + } + + public function hasPublisherId(): bool + { + return $this->has('publisherId'); + } + + public function unsetPublisherId(): self + { + $this->remove('publisherId'); + return $this; + } + + /** + * @return string + */ + public function getContactType() + { + return $this->get('contactType'); + } + + /** + * @param string $value + */ + public function setContactType($value): self + { + $this->set('contactType', $value); + return $this; + } + + public function hasContactType(): bool + { + return $this->has('contactType'); + } + + public function unsetContactType(): self + { + $this->remove('contactType'); + return $this; + } + + /** + * @return string + */ + public function getEmail() + { + return $this->get('email'); + } + + /** + * @param string $value + */ + public function setEmail($value): self + { + $this->set('email', $value); + return $this; + } + + public function hasEmail(): bool + { + return $this->has('email'); + } + + public function unsetEmail(): self + { + $this->remove('email'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Publisher + */ + public function getPublisher() + { + return $this->get('publisher'); + } + + /** + * @param Publisher $value + */ + public function setPublisher($value): self + { + $this->set('publisher', $value); + return $this; + } + + public function hasPublisher(): bool + { + return $this->has('publisher'); + } + + public function unsetPublisher(): self + { + $this->remove('publisher'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Contact', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'contactId', + 'description' => 'Thoth ID of the contact', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publisherId', + 'description' => 'Thoth ID of the publisher to which this contact belongs', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'contactType', + 'description' => 'Type of the contact', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ContactType', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'email', + 'description' => 'Email address of the contact', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the contact record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the contact record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publisher', + 'description' => 'Get the publisher to which this contact belongs', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Publisher', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Contribution.php b/src/GraphQL/Schemas/Contribution.php new file mode 100644 index 0000000..c2e9324 --- /dev/null +++ b/src/GraphQL/Schemas/Contribution.php @@ -0,0 +1,827 @@ +get('contributionId'); + } + + /** + * @param string $value + */ + public function setContributionId($value): self + { + $this->set('contributionId', $value); + return $this; + } + + public function hasContributionId(): bool + { + return $this->has('contributionId'); + } + + public function unsetContributionId(): self + { + $this->remove('contributionId'); + return $this; + } + + /** + * @return string + */ + public function getContributorId() + { + return $this->get('contributorId'); + } + + /** + * @param string $value + */ + public function setContributorId($value): self + { + $this->set('contributorId', $value); + return $this; + } + + public function hasContributorId(): bool + { + return $this->has('contributorId'); + } + + public function unsetContributorId(): self + { + $this->remove('contributorId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getContributionType() + { + return $this->get('contributionType'); + } + + /** + * @param string $value + */ + public function setContributionType($value): self + { + $this->set('contributionType', $value); + return $this; + } + + public function hasContributionType(): bool + { + return $this->has('contributionType'); + } + + public function unsetContributionType(): self + { + $this->remove('contributionType'); + return $this; + } + + /** + * @return bool + */ + public function getMainContribution() + { + return $this->get('mainContribution'); + } + + /** + * @param bool $value + */ + public function setMainContribution($value): self + { + $this->set('mainContribution', $value); + return $this; + } + + public function hasMainContribution(): bool + { + return $this->has('mainContribution'); + } + + public function unsetMainContribution(): self + { + $this->remove('mainContribution'); + return $this; + } + + /** + * @return Biography[] + */ + public function getBiographies() + { + return $this->get('biographies'); + } + + /** + * @param Biography[] $value + */ + public function setBiographies($value): self + { + $this->set('biographies', $value); + return $this; + } + + public function hasBiographies(): bool + { + return $this->has('biographies'); + } + + public function unsetBiographies(): self + { + $this->remove('biographies'); + return $this; + } + + /** + * @return string|null + */ + public function getBiography() + { + return $this->get('biography'); + } + + /** + * @param string|null $value + */ + public function setBiography($value): self + { + $this->set('biography', $value); + return $this; + } + + public function hasBiography(): bool + { + return $this->has('biography'); + } + + public function unsetBiography(): self + { + $this->remove('biography'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return string|null + */ + public function getFirstName() + { + return $this->get('firstName'); + } + + /** + * @param string|null $value + */ + public function setFirstName($value): self + { + $this->set('firstName', $value); + return $this; + } + + public function hasFirstName(): bool + { + return $this->has('firstName'); + } + + public function unsetFirstName(): self + { + $this->remove('firstName'); + return $this; + } + + /** + * @return string + */ + public function getLastName() + { + return $this->get('lastName'); + } + + /** + * @param string $value + */ + public function setLastName($value): self + { + $this->set('lastName', $value); + return $this; + } + + public function hasLastName(): bool + { + return $this->has('lastName'); + } + + public function unsetLastName(): self + { + $this->remove('lastName'); + return $this; + } + + /** + * @return string + */ + public function getFullName() + { + return $this->get('fullName'); + } + + /** + * @param string $value + */ + public function setFullName($value): self + { + $this->set('fullName', $value); + return $this; + } + + public function hasFullName(): bool + { + return $this->has('fullName'); + } + + public function unsetFullName(): self + { + $this->remove('fullName'); + return $this; + } + + /** + * @return int + */ + public function getContributionOrdinal() + { + return $this->get('contributionOrdinal'); + } + + /** + * @param int $value + */ + public function setContributionOrdinal($value): self + { + $this->set('contributionOrdinal', $value); + return $this; + } + + public function hasContributionOrdinal(): bool + { + return $this->has('contributionOrdinal'); + } + + public function unsetContributionOrdinal(): self + { + $this->remove('contributionOrdinal'); + return $this; + } + + /** + * @return Work + */ + public function getWork() + { + return $this->get('work'); + } + + /** + * @param Work $value + */ + public function setWork($value): self + { + $this->set('work', $value); + return $this; + } + + public function hasWork(): bool + { + return $this->has('work'); + } + + public function unsetWork(): self + { + $this->remove('work'); + return $this; + } + + /** + * @return Contributor + */ + public function getContributor() + { + return $this->get('contributor'); + } + + /** + * @param Contributor $value + */ + public function setContributor($value): self + { + $this->set('contributor', $value); + return $this; + } + + public function hasContributor(): bool + { + return $this->has('contributor'); + } + + public function unsetContributor(): self + { + $this->remove('contributor'); + return $this; + } + + /** + * @return Affiliation[] + */ + public function getAffiliations() + { + return $this->get('affiliations'); + } + + /** + * @param Affiliation[] $value + */ + public function setAffiliations($value): self + { + $this->set('affiliations', $value); + return $this; + } + + public function hasAffiliations(): bool + { + return $this->has('affiliations'); + } + + public function unsetAffiliations(): self + { + $this->remove('affiliations'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Contribution', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'contributionId', + 'description' => 'Thoth ID of the contribution', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'contributorId', + 'description' => 'Thoth ID of the contributor who created the contribution', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => 'Thoth ID of the work in which the contribution appears', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'contributionType', + 'description' => 'Nature of the contribution', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ContributionType', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'mainContribution', + 'description' => 'Whether this is a main contribution to the work (e.g. contributor credited on title page)', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Boolean', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'biographies', + 'description' => 'Query the full list of biographies', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on title_, subtitle, full_title fields', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'BiographyOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "CANONICAL", direction: "DESC"}', + ], + [ + 'name' => 'localeCodes', + 'description' => 'If set, only shows results with these locale codes', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocaleCode', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'markupFormat', + 'description' => 'If set, only shows results with this markup format', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => '"JATS_XML"', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Biography', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'biography', + 'description' => 'Biography of the contributor at the time of contribution', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => true, + 'deprecationReason' => 'Please use Contribution `biographies` field instead to get the correct biography in a multilingual manner', + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the contribution record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the contribution record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'firstName', + 'description' => 'Given or first name(s) of the contributor, as credited in this contribution', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'lastName', + 'description' => 'Family or surname of the contributor, as credited in this contribution', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'fullName', + 'description' => 'Full, serialized name of the contributor, as credited in this contribution', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'contributionOrdinal', + 'description' => 'Number representing this contribution\'s position in an ordered list of contributions within the work', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'work', + 'description' => 'Get the work in which the contribution appears', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'contributor', + 'description' => 'Get the contributor who created the contribution', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contributor', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'affiliations', + 'description' => 'Get affiliations linked to this contribution', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'AffiliationOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "AFFILIATION_ORDINAL", direction: "ASC"}', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Affiliation', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Contributor.php b/src/GraphQL/Schemas/Contributor.php new file mode 100644 index 0000000..90b0d9a --- /dev/null +++ b/src/GraphQL/Schemas/Contributor.php @@ -0,0 +1,456 @@ +get('contributorId'); + } + + /** + * @param string $value + */ + public function setContributorId($value): self + { + $this->set('contributorId', $value); + return $this; + } + + public function hasContributorId(): bool + { + return $this->has('contributorId'); + } + + public function unsetContributorId(): self + { + $this->remove('contributorId'); + return $this; + } + + /** + * @return string|null + */ + public function getFirstName() + { + return $this->get('firstName'); + } + + /** + * @param string|null $value + */ + public function setFirstName($value): self + { + $this->set('firstName', $value); + return $this; + } + + public function hasFirstName(): bool + { + return $this->has('firstName'); + } + + public function unsetFirstName(): self + { + $this->remove('firstName'); + return $this; + } + + /** + * @return string + */ + public function getLastName() + { + return $this->get('lastName'); + } + + /** + * @param string $value + */ + public function setLastName($value): self + { + $this->set('lastName', $value); + return $this; + } + + public function hasLastName(): bool + { + return $this->has('lastName'); + } + + public function unsetLastName(): self + { + $this->remove('lastName'); + return $this; + } + + /** + * @return string + */ + public function getFullName() + { + return $this->get('fullName'); + } + + /** + * @param string $value + */ + public function setFullName($value): self + { + $this->set('fullName', $value); + return $this; + } + + public function hasFullName(): bool + { + return $this->has('fullName'); + } + + public function unsetFullName(): self + { + $this->remove('fullName'); + return $this; + } + + /** + * @return string|null + */ + public function getOrcid() + { + return $this->get('orcid'); + } + + /** + * @param string|null $value + */ + public function setOrcid($value): self + { + $this->set('orcid', $value); + return $this; + } + + public function hasOrcid(): bool + { + return $this->has('orcid'); + } + + public function unsetOrcid(): self + { + $this->remove('orcid'); + return $this; + } + + /** + * @return string|null + */ + public function getWebsite() + { + return $this->get('website'); + } + + /** + * @param string|null $value + */ + public function setWebsite($value): self + { + $this->set('website', $value); + return $this; + } + + public function hasWebsite(): bool + { + return $this->has('website'); + } + + public function unsetWebsite(): self + { + $this->remove('website'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Contribution[] + */ + public function getContributions() + { + return $this->get('contributions'); + } + + /** + * @param Contribution[] $value + */ + public function setContributions($value): self + { + $this->set('contributions', $value); + return $this; + } + + public function hasContributions(): bool + { + return $this->has('contributions'); + } + + public function unsetContributions(): self + { + $this->remove('contributions'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Contributor', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'contributorId', + 'description' => 'Thoth ID of the contributor', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'firstName', + 'description' => 'Given or first name(s) of the contributor', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'lastName', + 'description' => 'Family or surname of the contributor', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'fullName', + 'description' => 'Full, serialized name of the contributor. Serialization is often culturally determined.', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'orcid', + 'description' => 'ORCID (Open Researcher and Contributor ID) of the contributor as full URL, using the HTTPS scheme and the orcid.org domain (e.g. https://orcid.org/0000-0002-1825-0097)', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Orcid', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'website', + 'description' => 'URL of the contributor\'s website', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the contributor record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the contributor record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'contributions', + 'description' => 'Get contributions linked to this contributor', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'ContributionOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "CONTRIBUTION_TYPE", direction: "ASC"}', + ], + [ + 'name' => 'contributionTypes', + 'description' => 'Specific types to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ContributionType', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contribution', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Endorsement.php b/src/GraphQL/Schemas/Endorsement.php new file mode 100644 index 0000000..5e2bef3 --- /dev/null +++ b/src/GraphQL/Schemas/Endorsement.php @@ -0,0 +1,585 @@ +get('endorsementId'); + } + + /** + * @param string $value + */ + public function setEndorsementId($value): self + { + $this->set('endorsementId', $value); + return $this; + } + + public function hasEndorsementId(): bool + { + return $this->has('endorsementId'); + } + + public function unsetEndorsementId(): self + { + $this->remove('endorsementId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getAuthorName() + { + return $this->get('authorName'); + } + + /** + * @param string $value + */ + public function setAuthorName($value): self + { + $this->set('authorName', $value); + return $this; + } + + public function hasAuthorName(): bool + { + return $this->has('authorName'); + } + + public function unsetAuthorName(): self + { + $this->remove('authorName'); + return $this; + } + + /** + * @return string|null + */ + public function getAuthorRole() + { + return $this->get('authorRole'); + } + + /** + * @param string|null $value + */ + public function setAuthorRole($value): self + { + $this->set('authorRole', $value); + return $this; + } + + public function hasAuthorRole(): bool + { + return $this->has('authorRole'); + } + + public function unsetAuthorRole(): self + { + $this->remove('authorRole'); + return $this; + } + + /** + * @return string|null + */ + public function getAuthorOrcid() + { + return $this->get('authorOrcid'); + } + + /** + * @param string|null $value + */ + public function setAuthorOrcid($value): self + { + $this->set('authorOrcid', $value); + return $this; + } + + public function hasAuthorOrcid(): bool + { + return $this->has('authorOrcid'); + } + + public function unsetAuthorOrcid(): self + { + $this->remove('authorOrcid'); + return $this; + } + + /** + * @return string|null + */ + public function getAuthorInstitutionId() + { + return $this->get('authorInstitutionId'); + } + + /** + * @param string|null $value + */ + public function setAuthorInstitutionId($value): self + { + $this->set('authorInstitutionId', $value); + return $this; + } + + public function hasAuthorInstitutionId(): bool + { + return $this->has('authorInstitutionId'); + } + + public function unsetAuthorInstitutionId(): self + { + $this->remove('authorInstitutionId'); + return $this; + } + + /** + * @return string|null + */ + public function getUrl() + { + return $this->get('url'); + } + + /** + * @param string|null $value + */ + public function setUrl($value): self + { + $this->set('url', $value); + return $this; + } + + public function hasUrl(): bool + { + return $this->has('url'); + } + + public function unsetUrl(): self + { + $this->remove('url'); + return $this; + } + + /** + * @return string|null + */ + public function getText() + { + return $this->get('text'); + } + + /** + * @param string|null $value + */ + public function setText($value): self + { + $this->set('text', $value); + return $this; + } + + public function hasText(): bool + { + return $this->has('text'); + } + + public function unsetText(): self + { + $this->remove('text'); + return $this; + } + + /** + * @return int + */ + public function getEndorsementOrdinal() + { + return $this->get('endorsementOrdinal'); + } + + /** + * @param int $value + */ + public function setEndorsementOrdinal($value): self + { + $this->set('endorsementOrdinal', $value); + return $this; + } + + public function hasEndorsementOrdinal(): bool + { + return $this->has('endorsementOrdinal'); + } + + public function unsetEndorsementOrdinal(): self + { + $this->remove('endorsementOrdinal'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Work + */ + public function getWork() + { + return $this->get('work'); + } + + /** + * @param Work $value + */ + public function setWork($value): self + { + $this->set('work', $value); + return $this; + } + + public function hasWork(): bool + { + return $this->has('work'); + } + + public function unsetWork(): self + { + $this->remove('work'); + return $this; + } + + /** + * @return Institution|null + */ + public function getAuthorInstitution() + { + return $this->get('authorInstitution'); + } + + /** + * @param Institution|null $value + */ + public function setAuthorInstitution($value): self + { + $this->set('authorInstitution', $value); + return $this; + } + + public function hasAuthorInstitution(): bool + { + return $this->has('authorInstitution'); + } + + public function unsetAuthorInstitution(): self + { + $this->remove('authorInstitution'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Endorsement', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'endorsementId', + 'description' => 'Thoth ID of the endorsement', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => 'Thoth ID of the work to which this endorsement belongs', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'authorName', + 'description' => 'Name of the endorsement author', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'authorRole', + 'description' => 'Role of the endorsement author', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'Markup format used for rendering endorsement author role', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => '"JATS_XML"', + ], + ], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'authorOrcid', + 'description' => 'ORCID (Open Researcher and Contributor ID) of the endorsement author as full URL, using the HTTPS scheme and the orcid.org domain', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Orcid', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'authorInstitutionId', + 'description' => 'Thoth ID of the endorsement author\'s institution', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'url', + 'description' => 'URL associated with this endorsement', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'text', + 'description' => 'Text of the endorsement', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'Markup format used for rendering endorsement text', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => '"JATS_XML"', + ], + ], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'endorsementOrdinal', + 'description' => 'Number representing this endorsement\'s position in an ordered list of endorsements within the work', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the endorsement record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the endorsement record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'work', + 'description' => 'Get the work linked to this endorsement', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'authorInstitution', + 'description' => 'Get the endorsement author\'s institution', + 'args' => [], + 'type' => [ + 'kind' => 'OBJECT', + 'name' => 'Institution', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/File.php b/src/GraphQL/Schemas/File.php new file mode 100644 index 0000000..30c3f4c --- /dev/null +++ b/src/GraphQL/Schemas/File.php @@ -0,0 +1,571 @@ +get('fileId'); + } + + /** + * @param string $value + */ + public function setFileId($value): self + { + $this->set('fileId', $value); + return $this; + } + + public function hasFileId(): bool + { + return $this->has('fileId'); + } + + public function unsetFileId(): self + { + $this->remove('fileId'); + return $this; + } + + /** + * @return string + */ + public function getFileType() + { + return $this->get('fileType'); + } + + /** + * @param string $value + */ + public function setFileType($value): self + { + $this->set('fileType', $value); + return $this; + } + + public function hasFileType(): bool + { + return $this->has('fileType'); + } + + public function unsetFileType(): self + { + $this->remove('fileType'); + return $this; + } + + /** + * @return string|null + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string|null $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string|null + */ + public function getPublicationId() + { + return $this->get('publicationId'); + } + + /** + * @param string|null $value + */ + public function setPublicationId($value): self + { + $this->set('publicationId', $value); + return $this; + } + + public function hasPublicationId(): bool + { + return $this->has('publicationId'); + } + + public function unsetPublicationId(): self + { + $this->remove('publicationId'); + return $this; + } + + /** + * @return string|null + */ + public function getAdditionalResourceId() + { + return $this->get('additionalResourceId'); + } + + /** + * @param string|null $value + */ + public function setAdditionalResourceId($value): self + { + $this->set('additionalResourceId', $value); + return $this; + } + + public function hasAdditionalResourceId(): bool + { + return $this->has('additionalResourceId'); + } + + public function unsetAdditionalResourceId(): self + { + $this->remove('additionalResourceId'); + return $this; + } + + /** + * @return string|null + */ + public function getWorkFeaturedVideoId() + { + return $this->get('workFeaturedVideoId'); + } + + /** + * @param string|null $value + */ + public function setWorkFeaturedVideoId($value): self + { + $this->set('workFeaturedVideoId', $value); + return $this; + } + + public function hasWorkFeaturedVideoId(): bool + { + return $this->has('workFeaturedVideoId'); + } + + public function unsetWorkFeaturedVideoId(): self + { + $this->remove('workFeaturedVideoId'); + return $this; + } + + /** + * @return string + */ + public function getObjectKey() + { + return $this->get('objectKey'); + } + + /** + * @param string $value + */ + public function setObjectKey($value): self + { + $this->set('objectKey', $value); + return $this; + } + + public function hasObjectKey(): bool + { + return $this->has('objectKey'); + } + + public function unsetObjectKey(): self + { + $this->remove('objectKey'); + return $this; + } + + /** + * @return string + */ + public function getCdnUrl() + { + return $this->get('cdnUrl'); + } + + /** + * @param string $value + */ + public function setCdnUrl($value): self + { + $this->set('cdnUrl', $value); + return $this; + } + + public function hasCdnUrl(): bool + { + return $this->has('cdnUrl'); + } + + public function unsetCdnUrl(): self + { + $this->remove('cdnUrl'); + return $this; + } + + /** + * @return string + */ + public function getMimeType() + { + return $this->get('mimeType'); + } + + /** + * @param string $value + */ + public function setMimeType($value): self + { + $this->set('mimeType', $value); + return $this; + } + + public function hasMimeType(): bool + { + return $this->has('mimeType'); + } + + public function unsetMimeType(): self + { + $this->remove('mimeType'); + return $this; + } + + /** + * @return int + */ + public function getBytes() + { + return $this->get('bytes'); + } + + /** + * @param int $value + */ + public function setBytes($value): self + { + $this->set('bytes', $value); + return $this; + } + + public function hasBytes(): bool + { + return $this->has('bytes'); + } + + public function unsetBytes(): self + { + $this->remove('bytes'); + return $this; + } + + /** + * @return string + */ + public function getSha256() + { + return $this->get('sha256'); + } + + /** + * @param string $value + */ + public function setSha256($value): self + { + $this->set('sha256', $value); + return $this; + } + + public function hasSha256(): bool + { + return $this->has('sha256'); + } + + public function unsetSha256(): self + { + $this->remove('sha256'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('File', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'fileId', + 'description' => 'Thoth ID of the file', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'fileType', + 'description' => 'Type of file (publication, frontcover, additional_resource, or work_featured_video)', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'FileType', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => 'Thoth ID of the work (for frontcovers)', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publicationId', + 'description' => 'Thoth ID of the publication (for publication files)', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'additionalResourceId', + 'description' => 'Thoth ID of the additional resource (for additional resource files)', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workFeaturedVideoId', + 'description' => 'Thoth ID of the featured video (for featured video files)', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'objectKey', + 'description' => 'S3 object key (canonical DOI-based path)', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'cdnUrl', + 'description' => 'Public CDN URL', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'mimeType', + 'description' => 'MIME type used when serving the file', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'bytes', + 'description' => 'Size of the file in bytes', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'sha256', + 'description' => 'SHA-256 checksum of the stored file', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the file record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the file record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/FileUploadResponse.php b/src/GraphQL/Schemas/FileUploadResponse.php new file mode 100644 index 0000000..da63723 --- /dev/null +++ b/src/GraphQL/Schemas/FileUploadResponse.php @@ -0,0 +1,199 @@ +get('fileUploadId'); + } + + /** + * @param string $value + */ + public function setFileUploadId($value): self + { + $this->set('fileUploadId', $value); + return $this; + } + + public function hasFileUploadId(): bool + { + return $this->has('fileUploadId'); + } + + public function unsetFileUploadId(): self + { + $this->remove('fileUploadId'); + return $this; + } + + /** + * @return string + */ + public function getUploadUrl() + { + return $this->get('uploadUrl'); + } + + /** + * @param string $value + */ + public function setUploadUrl($value): self + { + $this->set('uploadUrl', $value); + return $this; + } + + public function hasUploadUrl(): bool + { + return $this->has('uploadUrl'); + } + + public function unsetUploadUrl(): self + { + $this->remove('uploadUrl'); + return $this; + } + + /** + * @return UploadRequestHeader[] + */ + public function getUploadHeaders() + { + return $this->get('uploadHeaders'); + } + + /** + * @param UploadRequestHeader[] $value + */ + public function setUploadHeaders($value): self + { + $this->set('uploadHeaders', $value); + return $this; + } + + public function hasUploadHeaders(): bool + { + return $this->has('uploadHeaders'); + } + + public function unsetUploadHeaders(): self + { + $this->remove('uploadHeaders'); + return $this; + } + + /** + * @return string + */ + public function getExpiresAt() + { + return $this->get('expiresAt'); + } + + /** + * @param string $value + */ + public function setExpiresAt($value): self + { + $this->set('expiresAt', $value); + return $this; + } + + public function hasExpiresAt(): bool + { + return $this->has('expiresAt'); + } + + public function unsetExpiresAt(): self + { + $this->remove('expiresAt'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('FileUploadResponse', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'fileUploadId', + 'description' => 'ID of the upload session.', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'uploadUrl', + 'description' => 'Presigned S3 PUT URL for uploading the file.', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'uploadHeaders', + 'description' => 'Headers that must be sent with the HTTP PUT request to uploadUrl.', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'UploadRequestHeader', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'expiresAt', + 'description' => 'Time when the upload URL expires.', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Funding.php b/src/GraphQL/Schemas/Funding.php new file mode 100644 index 0000000..15e4ed4 --- /dev/null +++ b/src/GraphQL/Schemas/Funding.php @@ -0,0 +1,483 @@ +get('fundingId'); + } + + /** + * @param string $value + */ + public function setFundingId($value): self + { + $this->set('fundingId', $value); + return $this; + } + + public function hasFundingId(): bool + { + return $this->has('fundingId'); + } + + public function unsetFundingId(): self + { + $this->remove('fundingId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getInstitutionId() + { + return $this->get('institutionId'); + } + + /** + * @param string $value + */ + public function setInstitutionId($value): self + { + $this->set('institutionId', $value); + return $this; + } + + public function hasInstitutionId(): bool + { + return $this->has('institutionId'); + } + + public function unsetInstitutionId(): self + { + $this->remove('institutionId'); + return $this; + } + + /** + * @return string|null + */ + public function getProgram() + { + return $this->get('program'); + } + + /** + * @param string|null $value + */ + public function setProgram($value): self + { + $this->set('program', $value); + return $this; + } + + public function hasProgram(): bool + { + return $this->has('program'); + } + + public function unsetProgram(): self + { + $this->remove('program'); + return $this; + } + + /** + * @return string|null + */ + public function getProjectName() + { + return $this->get('projectName'); + } + + /** + * @param string|null $value + */ + public function setProjectName($value): self + { + $this->set('projectName', $value); + return $this; + } + + public function hasProjectName(): bool + { + return $this->has('projectName'); + } + + public function unsetProjectName(): self + { + $this->remove('projectName'); + return $this; + } + + /** + * @return string|null + */ + public function getProjectShortname() + { + return $this->get('projectShortname'); + } + + /** + * @param string|null $value + */ + public function setProjectShortname($value): self + { + $this->set('projectShortname', $value); + return $this; + } + + public function hasProjectShortname(): bool + { + return $this->has('projectShortname'); + } + + public function unsetProjectShortname(): self + { + $this->remove('projectShortname'); + return $this; + } + + /** + * @return string|null + */ + public function getGrantNumber() + { + return $this->get('grantNumber'); + } + + /** + * @param string|null $value + */ + public function setGrantNumber($value): self + { + $this->set('grantNumber', $value); + return $this; + } + + public function hasGrantNumber(): bool + { + return $this->has('grantNumber'); + } + + public function unsetGrantNumber(): self + { + $this->remove('grantNumber'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Work + */ + public function getWork() + { + return $this->get('work'); + } + + /** + * @param Work $value + */ + public function setWork($value): self + { + $this->set('work', $value); + return $this; + } + + public function hasWork(): bool + { + return $this->has('work'); + } + + public function unsetWork(): self + { + $this->remove('work'); + return $this; + } + + /** + * @return Institution + */ + public function getInstitution() + { + return $this->get('institution'); + } + + /** + * @param Institution $value + */ + public function setInstitution($value): self + { + $this->set('institution', $value); + return $this; + } + + public function hasInstitution(): bool + { + return $this->has('institution'); + } + + public function unsetInstitution(): self + { + $this->remove('institution'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Funding', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'fundingId', + 'description' => 'Thoth ID of the funding', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => 'Thoth ID of the funded work', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'institutionId', + 'description' => 'Thoth ID of the funding institution', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'program', + 'description' => 'Name of the funding program', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'projectName', + 'description' => 'Name of the funding project', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'projectShortname', + 'description' => 'Short name of the funding project', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'grantNumber', + 'description' => 'Grant number of the award', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the funding record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the funding record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'work', + 'description' => 'Get the funded work', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'institution', + 'description' => 'Get the funding institution', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Institution', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/GraphQLAbstract.php b/src/GraphQL/Schemas/GraphQLAbstract.php new file mode 100644 index 0000000..a5b7f2a --- /dev/null +++ b/src/GraphQL/Schemas/GraphQLAbstract.php @@ -0,0 +1,323 @@ +get('abstractId'); + } + + /** + * @param string $value + */ + public function setAbstractId($value): self + { + $this->set('abstractId', $value); + return $this; + } + + public function hasAbstractId(): bool + { + return $this->has('abstractId'); + } + + public function unsetAbstractId(): self + { + $this->remove('abstractId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getLocaleCode() + { + return $this->get('localeCode'); + } + + /** + * @param string $value + */ + public function setLocaleCode($value): self + { + $this->set('localeCode', $value); + return $this; + } + + public function hasLocaleCode(): bool + { + return $this->has('localeCode'); + } + + public function unsetLocaleCode(): self + { + $this->remove('localeCode'); + return $this; + } + + /** + * @return string + */ + public function getContent() + { + return $this->get('content'); + } + + /** + * @param string $value + */ + public function setContent($value): self + { + $this->set('content', $value); + return $this; + } + + public function hasContent(): bool + { + return $this->has('content'); + } + + public function unsetContent(): self + { + $this->remove('content'); + return $this; + } + + /** + * @return bool + */ + public function getCanonical() + { + return $this->get('canonical'); + } + + /** + * @param bool $value + */ + public function setCanonical($value): self + { + $this->set('canonical', $value); + return $this; + } + + public function hasCanonical(): bool + { + return $this->has('canonical'); + } + + public function unsetCanonical(): self + { + $this->remove('canonical'); + return $this; + } + + /** + * @return string + */ + public function getAbstractType() + { + return $this->get('abstractType'); + } + + /** + * @param string $value + */ + public function setAbstractType($value): self + { + $this->set('abstractType', $value); + return $this; + } + + public function hasAbstractType(): bool + { + return $this->has('abstractType'); + } + + public function unsetAbstractType(): self + { + $this->remove('abstractType'); + return $this; + } + + /** + * @return Work + */ + public function getWork() + { + return $this->get('work'); + } + + /** + * @param Work $value + */ + public function setWork($value): self + { + $this->set('work', $value); + return $this; + } + + public function hasWork(): bool + { + return $this->has('work'); + } + + public function unsetWork(): self + { + $this->remove('work'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Abstract', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'abstractId', + 'description' => 'Thoth ID of the abstract', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => 'Thoth ID of the work to which the abstract is linked', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'localeCode', + 'description' => 'Locale code of the abstract', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocaleCode', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'content', + 'description' => 'Content of the abstract', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'canonical', + 'description' => 'Whether this is the canonical abstract for the work', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Boolean', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'abstractType', + 'description' => 'Type of the abstract', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'AbstractType', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'work', + 'description' => 'Get the work to which the abstract is linked', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Imprint.php b/src/GraphQL/Schemas/Imprint.php new file mode 100644 index 0000000..003bc67 --- /dev/null +++ b/src/GraphQL/Schemas/Imprint.php @@ -0,0 +1,759 @@ +get('imprintId'); + } + + /** + * @param string $value + */ + public function setImprintId($value): self + { + $this->set('imprintId', $value); + return $this; + } + + public function hasImprintId(): bool + { + return $this->has('imprintId'); + } + + public function unsetImprintId(): self + { + $this->remove('imprintId'); + return $this; + } + + /** + * @return string + */ + public function getPublisherId() + { + return $this->get('publisherId'); + } + + /** + * @param string $value + */ + public function setPublisherId($value): self + { + $this->set('publisherId', $value); + return $this; + } + + public function hasPublisherId(): bool + { + return $this->has('publisherId'); + } + + public function unsetPublisherId(): self + { + $this->remove('publisherId'); + return $this; + } + + /** + * @return string + */ + public function getImprintName() + { + return $this->get('imprintName'); + } + + /** + * @param string $value + */ + public function setImprintName($value): self + { + $this->set('imprintName', $value); + return $this; + } + + public function hasImprintName(): bool + { + return $this->has('imprintName'); + } + + public function unsetImprintName(): self + { + $this->remove('imprintName'); + return $this; + } + + /** + * @return string|null + */ + public function getImprintUrl() + { + return $this->get('imprintUrl'); + } + + /** + * @param string|null $value + */ + public function setImprintUrl($value): self + { + $this->set('imprintUrl', $value); + return $this; + } + + public function hasImprintUrl(): bool + { + return $this->has('imprintUrl'); + } + + public function unsetImprintUrl(): self + { + $this->remove('imprintUrl'); + return $this; + } + + /** + * @return string|null + */ + public function getCrossmarkDoi() + { + return $this->get('crossmarkDoi'); + } + + /** + * @param string|null $value + */ + public function setCrossmarkDoi($value): self + { + $this->set('crossmarkDoi', $value); + return $this; + } + + public function hasCrossmarkDoi(): bool + { + return $this->has('crossmarkDoi'); + } + + public function unsetCrossmarkDoi(): self + { + $this->remove('crossmarkDoi'); + return $this; + } + + /** + * @return string|null + */ + public function getS3Bucket() + { + return $this->get('s3Bucket'); + } + + /** + * @param string|null $value + */ + public function setS3Bucket($value): self + { + $this->set('s3Bucket', $value); + return $this; + } + + public function hasS3Bucket(): bool + { + return $this->has('s3Bucket'); + } + + public function unsetS3Bucket(): self + { + $this->remove('s3Bucket'); + return $this; + } + + /** + * @return string|null + */ + public function getCdnDomain() + { + return $this->get('cdnDomain'); + } + + /** + * @param string|null $value + */ + public function setCdnDomain($value): self + { + $this->set('cdnDomain', $value); + return $this; + } + + public function hasCdnDomain(): bool + { + return $this->has('cdnDomain'); + } + + public function unsetCdnDomain(): self + { + $this->remove('cdnDomain'); + return $this; + } + + /** + * @return string|null + */ + public function getCloudfrontDistId() + { + return $this->get('cloudfrontDistId'); + } + + /** + * @param string|null $value + */ + public function setCloudfrontDistId($value): self + { + $this->set('cloudfrontDistId', $value); + return $this; + } + + public function hasCloudfrontDistId(): bool + { + return $this->has('cloudfrontDistId'); + } + + public function unsetCloudfrontDistId(): self + { + $this->remove('cloudfrontDistId'); + return $this; + } + + /** + * @return string|null + */ + public function getDefaultCurrency() + { + return $this->get('defaultCurrency'); + } + + /** + * @param string|null $value + */ + public function setDefaultCurrency($value): self + { + $this->set('defaultCurrency', $value); + return $this; + } + + public function hasDefaultCurrency(): bool + { + return $this->has('defaultCurrency'); + } + + public function unsetDefaultCurrency(): self + { + $this->remove('defaultCurrency'); + return $this; + } + + /** + * @return string|null + */ + public function getDefaultPlace() + { + return $this->get('defaultPlace'); + } + + /** + * @param string|null $value + */ + public function setDefaultPlace($value): self + { + $this->set('defaultPlace', $value); + return $this; + } + + public function hasDefaultPlace(): bool + { + return $this->has('defaultPlace'); + } + + public function unsetDefaultPlace(): self + { + $this->remove('defaultPlace'); + return $this; + } + + /** + * @return string|null + */ + public function getDefaultLocale() + { + return $this->get('defaultLocale'); + } + + /** + * @param string|null $value + */ + public function setDefaultLocale($value): self + { + $this->set('defaultLocale', $value); + return $this; + } + + public function hasDefaultLocale(): bool + { + return $this->has('defaultLocale'); + } + + public function unsetDefaultLocale(): self + { + $this->remove('defaultLocale'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Publisher + */ + public function getPublisher() + { + return $this->get('publisher'); + } + + /** + * @param Publisher $value + */ + public function setPublisher($value): self + { + $this->set('publisher', $value); + return $this; + } + + public function hasPublisher(): bool + { + return $this->has('publisher'); + } + + public function unsetPublisher(): self + { + $this->remove('publisher'); + return $this; + } + + /** + * @return Work[] + */ + public function getWorks() + { + return $this->get('works'); + } + + /** + * @param Work[] $value + */ + public function setWorks($value): self + { + $this->set('works', $value); + return $this; + } + + public function hasWorks(): bool + { + return $this->has('works'); + } + + public function unsetWorks(): self + { + $this->remove('works'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Imprint', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'imprintId', + 'description' => 'Thoth ID of the imprint', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publisherId', + 'description' => 'Thoth ID of the publisher to which this imprint belongs', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'imprintName', + 'description' => 'Name of the imprint', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'imprintUrl', + 'description' => 'URL of the imprint\'s landing page', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'crossmarkDoi', + 'description' => 'DOI of the imprint\'s Crossmark policy page, if publisher participates. Crossmark \'gives readers quick and easy access to the + current status of an item of content, including any corrections, retractions, or updates\'. More: https://www.crossref.org/services/crossmark/', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 's3Bucket', + 'description' => 'S3 bucket used for files belonging to this imprint', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'cdnDomain', + 'description' => 'CDN domain used for files belonging to this imprint', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'cloudfrontDistId', + 'description' => 'CloudFront distribution ID used for files belonging to this imprint', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'defaultCurrency', + 'description' => 'Default currency code for works under this imprint', + 'args' => [], + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'CurrencyCode', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'defaultPlace', + 'description' => 'Default publication place for works under this imprint', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'defaultLocale', + 'description' => 'Default locale code for works under this imprint', + 'args' => [], + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'LocaleCode', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the imprint record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the imprint record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publisher', + 'description' => 'Get the publisher to which this imprint belongs', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Publisher', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'works', + 'description' => 'Get works linked to this imprint', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on full_title, doi, reference, short_abstract, long_abstract, and landing_page', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'WorkOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "FULL_TITLE", direction: "ASC"}', + ], + [ + 'name' => 'workTypes', + 'description' => 'Specific types to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkType', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'workStatus', + 'description' => '(deprecated) A specific status to filter by', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'WorkStatus', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'workStatuses', + 'description' => 'Specific statuses to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkStatus', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'publicationDate', + 'description' => 'Only show results updated either before (less than) or after (greater than) the specified timestamp', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'TimeExpression', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'updatedAtWithRelations', + 'description' => 'Only show results with a publication date either before (less than) or after (greater than) the specified timestamp', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'TimeExpression', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Institution.php b/src/GraphQL/Schemas/Institution.php new file mode 100644 index 0000000..518b6ec --- /dev/null +++ b/src/GraphQL/Schemas/Institution.php @@ -0,0 +1,477 @@ +get('institutionId'); + } + + /** + * @param string $value + */ + public function setInstitutionId($value): self + { + $this->set('institutionId', $value); + return $this; + } + + public function hasInstitutionId(): bool + { + return $this->has('institutionId'); + } + + public function unsetInstitutionId(): self + { + $this->remove('institutionId'); + return $this; + } + + /** + * @return string + */ + public function getInstitutionName() + { + return $this->get('institutionName'); + } + + /** + * @param string $value + */ + public function setInstitutionName($value): self + { + $this->set('institutionName', $value); + return $this; + } + + public function hasInstitutionName(): bool + { + return $this->has('institutionName'); + } + + public function unsetInstitutionName(): self + { + $this->remove('institutionName'); + return $this; + } + + /** + * @return string|null + */ + public function getInstitutionDoi() + { + return $this->get('institutionDoi'); + } + + /** + * @param string|null $value + */ + public function setInstitutionDoi($value): self + { + $this->set('institutionDoi', $value); + return $this; + } + + public function hasInstitutionDoi(): bool + { + return $this->has('institutionDoi'); + } + + public function unsetInstitutionDoi(): self + { + $this->remove('institutionDoi'); + return $this; + } + + /** + * @return string|null + */ + public function getCountryCode() + { + return $this->get('countryCode'); + } + + /** + * @param string|null $value + */ + public function setCountryCode($value): self + { + $this->set('countryCode', $value); + return $this; + } + + public function hasCountryCode(): bool + { + return $this->has('countryCode'); + } + + public function unsetCountryCode(): self + { + $this->remove('countryCode'); + return $this; + } + + /** + * @return string|null + */ + public function getRor() + { + return $this->get('ror'); + } + + /** + * @param string|null $value + */ + public function setRor($value): self + { + $this->set('ror', $value); + return $this; + } + + public function hasRor(): bool + { + return $this->has('ror'); + } + + public function unsetRor(): self + { + $this->remove('ror'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Funding[] + */ + public function getFundings() + { + return $this->get('fundings'); + } + + /** + * @param Funding[] $value + */ + public function setFundings($value): self + { + $this->set('fundings', $value); + return $this; + } + + public function hasFundings(): bool + { + return $this->has('fundings'); + } + + public function unsetFundings(): self + { + $this->remove('fundings'); + return $this; + } + + /** + * @return Affiliation[] + */ + public function getAffiliations() + { + return $this->get('affiliations'); + } + + /** + * @param Affiliation[] $value + */ + public function setAffiliations($value): self + { + $this->set('affiliations', $value); + return $this; + } + + public function hasAffiliations(): bool + { + return $this->has('affiliations'); + } + + public function unsetAffiliations(): self + { + $this->remove('affiliations'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Institution', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'institutionId', + 'description' => 'Thoth ID of the institution', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'institutionName', + 'description' => 'Name of the institution', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'institutionDoi', + 'description' => 'Digital Object Identifier of the organisation as full URL, using the HTTPS scheme and the doi.org domain (e.g. https://doi.org/10.13039/100014013)', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'countryCode', + 'description' => 'Three-letter ISO 3166-1 code representing the country where this institution is based', + 'args' => [], + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'CountryCode', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'ror', + 'description' => 'Research Organisation Registry identifier of the organisation as full URL, using the HTTPS scheme and the ror.org domain (e.g. https://ror.org/051z6e826)', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Ror', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the institution record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the institution record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'fundings', + 'description' => 'Get fundings linked to this institution', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'FundingOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "PROGRAM", direction: "ASC"}', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Funding', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'affiliations', + 'description' => 'Get affiliations linked to this institution', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'AffiliationOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "AFFILIATION_ORDINAL", direction: "ASC"}', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Affiliation', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Issue.php b/src/GraphQL/Schemas/Issue.php new file mode 100644 index 0000000..a65ccc6 --- /dev/null +++ b/src/GraphQL/Schemas/Issue.php @@ -0,0 +1,407 @@ +get('issueId'); + } + + /** + * @param string $value + */ + public function setIssueId($value): self + { + $this->set('issueId', $value); + return $this; + } + + public function hasIssueId(): bool + { + return $this->has('issueId'); + } + + public function unsetIssueId(): self + { + $this->remove('issueId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getSeriesId() + { + return $this->get('seriesId'); + } + + /** + * @param string $value + */ + public function setSeriesId($value): self + { + $this->set('seriesId', $value); + return $this; + } + + public function hasSeriesId(): bool + { + return $this->has('seriesId'); + } + + public function unsetSeriesId(): self + { + $this->remove('seriesId'); + return $this; + } + + /** + * @return int + */ + public function getIssueOrdinal() + { + return $this->get('issueOrdinal'); + } + + /** + * @param int $value + */ + public function setIssueOrdinal($value): self + { + $this->set('issueOrdinal', $value); + return $this; + } + + public function hasIssueOrdinal(): bool + { + return $this->has('issueOrdinal'); + } + + public function unsetIssueOrdinal(): self + { + $this->remove('issueOrdinal'); + return $this; + } + + /** + * @return int|null + */ + public function getIssueNumber() + { + return $this->get('issueNumber'); + } + + /** + * @param int|null $value + */ + public function setIssueNumber($value): self + { + $this->set('issueNumber', $value); + return $this; + } + + public function hasIssueNumber(): bool + { + return $this->has('issueNumber'); + } + + public function unsetIssueNumber(): self + { + $this->remove('issueNumber'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Series + */ + public function getSeries() + { + return $this->get('series'); + } + + /** + * @param Series $value + */ + public function setSeries($value): self + { + $this->set('series', $value); + return $this; + } + + public function hasSeries(): bool + { + return $this->has('series'); + } + + public function unsetSeries(): self + { + $this->remove('series'); + return $this; + } + + /** + * @return Work + */ + public function getWork() + { + return $this->get('work'); + } + + /** + * @param Work $value + */ + public function setWork($value): self + { + $this->set('work', $value); + return $this; + } + + public function hasWork(): bool + { + return $this->has('work'); + } + + public function unsetWork(): self + { + $this->remove('work'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Issue', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'issueId', + 'description' => 'Thoth ID of the issue', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => 'Thoth ID of the work represented by the issue', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'seriesId', + 'description' => 'Thoth ID of the series to which the issue belongs', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'issueOrdinal', + 'description' => 'Number representing this issue\'s position in an ordered list of issues within the series (does not have to correspond to published issue number)', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'issueNumber', + 'description' => 'Published issue number given to this issue within the series, if any', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the issue record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the issue record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'series', + 'description' => 'Get the series to which the issue belongs', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Series', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'work', + 'description' => 'Get the work represented by the issue', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Language.php b/src/GraphQL/Schemas/Language.php new file mode 100644 index 0000000..6f43f3b --- /dev/null +++ b/src/GraphQL/Schemas/Language.php @@ -0,0 +1,323 @@ +get('languageId'); + } + + /** + * @param string $value + */ + public function setLanguageId($value): self + { + $this->set('languageId', $value); + return $this; + } + + public function hasLanguageId(): bool + { + return $this->has('languageId'); + } + + public function unsetLanguageId(): self + { + $this->remove('languageId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getLanguageCode() + { + return $this->get('languageCode'); + } + + /** + * @param string $value + */ + public function setLanguageCode($value): self + { + $this->set('languageCode', $value); + return $this; + } + + public function hasLanguageCode(): bool + { + return $this->has('languageCode'); + } + + public function unsetLanguageCode(): self + { + $this->remove('languageCode'); + return $this; + } + + /** + * @return string + */ + public function getLanguageRelation() + { + return $this->get('languageRelation'); + } + + /** + * @param string $value + */ + public function setLanguageRelation($value): self + { + $this->set('languageRelation', $value); + return $this; + } + + public function hasLanguageRelation(): bool + { + return $this->has('languageRelation'); + } + + public function unsetLanguageRelation(): self + { + $this->remove('languageRelation'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Work + */ + public function getWork() + { + return $this->get('work'); + } + + /** + * @param Work $value + */ + public function setWork($value): self + { + $this->set('work', $value); + return $this; + } + + public function hasWork(): bool + { + return $this->has('work'); + } + + public function unsetWork(): self + { + $this->remove('work'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Language', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'languageId', + 'description' => 'Thoth ID of the language', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => 'Thoth ID of the work which has this language', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'languageCode', + 'description' => 'Three-letter ISO 639 code representing the language', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LanguageCode', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'languageRelation', + 'description' => 'Relation between this language and the original language of the text', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LanguageRelation', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the language record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the language record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'work', + 'description' => 'Get the work which has this language', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Location.php b/src/GraphQL/Schemas/Location.php new file mode 100644 index 0000000..94e88c7 --- /dev/null +++ b/src/GraphQL/Schemas/Location.php @@ -0,0 +1,483 @@ +get('locationId'); + } + + /** + * @param string $value + */ + public function setLocationId($value): self + { + $this->set('locationId', $value); + return $this; + } + + public function hasLocationId(): bool + { + return $this->has('locationId'); + } + + public function unsetLocationId(): self + { + $this->remove('locationId'); + return $this; + } + + /** + * @return string + */ + public function getPublicationId() + { + return $this->get('publicationId'); + } + + /** + * @param string $value + */ + public function setPublicationId($value): self + { + $this->set('publicationId', $value); + return $this; + } + + public function hasPublicationId(): bool + { + return $this->has('publicationId'); + } + + public function unsetPublicationId(): self + { + $this->remove('publicationId'); + return $this; + } + + /** + * @return string|null + */ + public function getLandingPage() + { + return $this->get('landingPage'); + } + + /** + * @param string|null $value + */ + public function setLandingPage($value): self + { + $this->set('landingPage', $value); + return $this; + } + + public function hasLandingPage(): bool + { + return $this->has('landingPage'); + } + + public function unsetLandingPage(): self + { + $this->remove('landingPage'); + return $this; + } + + /** + * @return string|null + */ + public function getFullTextUrl() + { + return $this->get('fullTextUrl'); + } + + /** + * @param string|null $value + */ + public function setFullTextUrl($value): self + { + $this->set('fullTextUrl', $value); + return $this; + } + + public function hasFullTextUrl(): bool + { + return $this->has('fullTextUrl'); + } + + public function unsetFullTextUrl(): self + { + $this->remove('fullTextUrl'); + return $this; + } + + /** + * @return string + */ + public function getLocationPlatform() + { + return $this->get('locationPlatform'); + } + + /** + * @param string $value + */ + public function setLocationPlatform($value): self + { + $this->set('locationPlatform', $value); + return $this; + } + + public function hasLocationPlatform(): bool + { + return $this->has('locationPlatform'); + } + + public function unsetLocationPlatform(): self + { + $this->remove('locationPlatform'); + return $this; + } + + /** + * @return bool + */ + public function getCanonical() + { + return $this->get('canonical'); + } + + /** + * @param bool $value + */ + public function setCanonical($value): self + { + $this->set('canonical', $value); + return $this; + } + + public function hasCanonical(): bool + { + return $this->has('canonical'); + } + + public function unsetCanonical(): self + { + $this->remove('canonical'); + return $this; + } + + /** + * @return string|null + */ + public function getChecksum() + { + return $this->get('checksum'); + } + + /** + * @param string|null $value + */ + public function setChecksum($value): self + { + $this->set('checksum', $value); + return $this; + } + + public function hasChecksum(): bool + { + return $this->has('checksum'); + } + + public function unsetChecksum(): self + { + $this->remove('checksum'); + return $this; + } + + /** + * @return string|null + */ + public function getChecksumAlgorithm() + { + return $this->get('checksumAlgorithm'); + } + + /** + * @param string|null $value + */ + public function setChecksumAlgorithm($value): self + { + $this->set('checksumAlgorithm', $value); + return $this; + } + + public function hasChecksumAlgorithm(): bool + { + return $this->has('checksumAlgorithm'); + } + + public function unsetChecksumAlgorithm(): self + { + $this->remove('checksumAlgorithm'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Publication + */ + public function getPublication() + { + return $this->get('publication'); + } + + /** + * @param Publication $value + */ + public function setPublication($value): self + { + $this->set('publication', $value); + return $this; + } + + public function hasPublication(): bool + { + return $this->has('publication'); + } + + public function unsetPublication(): self + { + $this->remove('publication'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Location', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'locationId', + 'description' => 'Thoth ID of the location', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publicationId', + 'description' => 'Thoth ID of the publication linked to this location', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'landingPage', + 'description' => 'Public-facing URL via which the publication can be accessed', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'fullTextUrl', + 'description' => 'Direct link to the full text file', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'locationPlatform', + 'description' => 'Platform where the publication is hosted or can be acquired', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocationPlatform', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'canonical', + 'description' => 'Whether this is the canonical location for this specific publication (e.g. the main platform on which the print version is sold, or the official version of record hosted on the publisher\'s own web server)', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Boolean', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'checksum', + 'description' => 'Checksum of the full text file as returned by the platform', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'checksumAlgorithm', + 'description' => 'Algorithm used to generate the checksum (MD5, SHA-256 or SHA-1)', + 'args' => [], + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'ChecksumAlgorithm', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the location record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the location record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publication', + 'description' => 'Get the publication linked to this location', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Publication', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Me.php b/src/GraphQL/Schemas/Me.php new file mode 100644 index 0000000..02affe4 --- /dev/null +++ b/src/GraphQL/Schemas/Me.php @@ -0,0 +1,275 @@ +get('userId'); + } + + /** + * @param string $value + */ + public function setUserId($value): self + { + $this->set('userId', $value); + return $this; + } + + public function hasUserId(): bool + { + return $this->has('userId'); + } + + public function unsetUserId(): self + { + $this->remove('userId'); + return $this; + } + + /** + * @return string|null + */ + public function getEmail() + { + return $this->get('email'); + } + + /** + * @param string|null $value + */ + public function setEmail($value): self + { + $this->set('email', $value); + return $this; + } + + public function hasEmail(): bool + { + return $this->has('email'); + } + + public function unsetEmail(): self + { + $this->remove('email'); + return $this; + } + + /** + * @return string|null + */ + public function getFirstName() + { + return $this->get('firstName'); + } + + /** + * @param string|null $value + */ + public function setFirstName($value): self + { + $this->set('firstName', $value); + return $this; + } + + public function hasFirstName(): bool + { + return $this->has('firstName'); + } + + public function unsetFirstName(): self + { + $this->remove('firstName'); + return $this; + } + + /** + * @return string|null + */ + public function getLastName() + { + return $this->get('lastName'); + } + + /** + * @param string|null $value + */ + public function setLastName($value): self + { + $this->set('lastName', $value); + return $this; + } + + public function hasLastName(): bool + { + return $this->has('lastName'); + } + + public function unsetLastName(): self + { + $this->remove('lastName'); + return $this; + } + + /** + * @return bool + */ + public function getIsSuperuser() + { + return $this->get('isSuperuser'); + } + + /** + * @param bool $value + */ + public function setIsSuperuser($value): self + { + $this->set('isSuperuser', $value); + return $this; + } + + public function hasIsSuperuser(): bool + { + return $this->has('isSuperuser'); + } + + public function unsetIsSuperuser(): self + { + $this->remove('isSuperuser'); + return $this; + } + + /** + * @return PublisherContext[] + */ + public function getPublisherContexts() + { + return $this->get('publisherContexts'); + } + + /** + * @param PublisherContext[] $value + */ + public function setPublisherContexts($value): self + { + $this->set('publisherContexts', $value); + return $this; + } + + public function hasPublisherContexts(): bool + { + return $this->has('publisherContexts'); + } + + public function unsetPublisherContexts(): self + { + $this->remove('publisherContexts'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Me', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'userId', + 'description' => null, + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'email', + 'description' => null, + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'firstName', + 'description' => null, + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'lastName', + 'description' => null, + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'isSuperuser', + 'description' => null, + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Boolean', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publisherContexts', + 'description' => null, + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'PublisherContext', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Price.php b/src/GraphQL/Schemas/Price.php new file mode 100644 index 0000000..c8096c9 --- /dev/null +++ b/src/GraphQL/Schemas/Price.php @@ -0,0 +1,323 @@ +get('priceId'); + } + + /** + * @param string $value + */ + public function setPriceId($value): self + { + $this->set('priceId', $value); + return $this; + } + + public function hasPriceId(): bool + { + return $this->has('priceId'); + } + + public function unsetPriceId(): self + { + $this->remove('priceId'); + return $this; + } + + /** + * @return string + */ + public function getPublicationId() + { + return $this->get('publicationId'); + } + + /** + * @param string $value + */ + public function setPublicationId($value): self + { + $this->set('publicationId', $value); + return $this; + } + + public function hasPublicationId(): bool + { + return $this->has('publicationId'); + } + + public function unsetPublicationId(): self + { + $this->remove('publicationId'); + return $this; + } + + /** + * @return string + */ + public function getCurrencyCode() + { + return $this->get('currencyCode'); + } + + /** + * @param string $value + */ + public function setCurrencyCode($value): self + { + $this->set('currencyCode', $value); + return $this; + } + + public function hasCurrencyCode(): bool + { + return $this->has('currencyCode'); + } + + public function unsetCurrencyCode(): self + { + $this->remove('currencyCode'); + return $this; + } + + /** + * @return float + */ + public function getUnitPrice() + { + return $this->get('unitPrice'); + } + + /** + * @param float $value + */ + public function setUnitPrice($value): self + { + $this->set('unitPrice', $value); + return $this; + } + + public function hasUnitPrice(): bool + { + return $this->has('unitPrice'); + } + + public function unsetUnitPrice(): self + { + $this->remove('unitPrice'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Publication + */ + public function getPublication() + { + return $this->get('publication'); + } + + /** + * @param Publication $value + */ + public function setPublication($value): self + { + $this->set('publication', $value); + return $this; + } + + public function hasPublication(): bool + { + return $this->has('publication'); + } + + public function unsetPublication(): self + { + $this->remove('publication'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Price', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'priceId', + 'description' => 'Thoth ID of the price', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publicationId', + 'description' => 'Thoth ID of the publication linked to this price', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'currencyCode', + 'description' => 'Three-letter ISO 4217 code representing the currency used in this price', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'CurrencyCode', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'unitPrice', + 'description' => 'Value of the publication in the specified currency', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the price record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the price record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publication', + 'description' => 'Get the publication linked to this price', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Publication', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Publication.php b/src/GraphQL/Schemas/Publication.php new file mode 100644 index 0000000..0362d69 --- /dev/null +++ b/src/GraphQL/Schemas/Publication.php @@ -0,0 +1,941 @@ +get('publicationId'); + } + + /** + * @param string $value + */ + public function setPublicationId($value): self + { + $this->set('publicationId', $value); + return $this; + } + + public function hasPublicationId(): bool + { + return $this->has('publicationId'); + } + + public function unsetPublicationId(): self + { + $this->remove('publicationId'); + return $this; + } + + /** + * @return string + */ + public function getPublicationType() + { + return $this->get('publicationType'); + } + + /** + * @param string $value + */ + public function setPublicationType($value): self + { + $this->set('publicationType', $value); + return $this; + } + + public function hasPublicationType(): bool + { + return $this->has('publicationType'); + } + + public function unsetPublicationType(): self + { + $this->remove('publicationType'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string|null + */ + public function getIsbn() + { + return $this->get('isbn'); + } + + /** + * @param string|null $value + */ + public function setIsbn($value): self + { + $this->set('isbn', $value); + return $this; + } + + public function hasIsbn(): bool + { + return $this->has('isbn'); + } + + public function unsetIsbn(): self + { + $this->remove('isbn'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return float|null + */ + public function getWidth() + { + return $this->get('width'); + } + + /** + * @param float|null $value + */ + public function setWidth($value): self + { + $this->set('width', $value); + return $this; + } + + public function hasWidth(): bool + { + return $this->has('width'); + } + + public function unsetWidth(): self + { + $this->remove('width'); + return $this; + } + + /** + * @return float|null + */ + public function getHeight() + { + return $this->get('height'); + } + + /** + * @param float|null $value + */ + public function setHeight($value): self + { + $this->set('height', $value); + return $this; + } + + public function hasHeight(): bool + { + return $this->has('height'); + } + + public function unsetHeight(): self + { + $this->remove('height'); + return $this; + } + + /** + * @return float|null + */ + public function getDepth() + { + return $this->get('depth'); + } + + /** + * @param float|null $value + */ + public function setDepth($value): self + { + $this->set('depth', $value); + return $this; + } + + public function hasDepth(): bool + { + return $this->has('depth'); + } + + public function unsetDepth(): self + { + $this->remove('depth'); + return $this; + } + + /** + * @return float|null + */ + public function getWeight() + { + return $this->get('weight'); + } + + /** + * @param float|null $value + */ + public function setWeight($value): self + { + $this->set('weight', $value); + return $this; + } + + public function hasWeight(): bool + { + return $this->has('weight'); + } + + public function unsetWeight(): self + { + $this->remove('weight'); + return $this; + } + + /** + * @return string|null + */ + public function getAccessibilityStandard() + { + return $this->get('accessibilityStandard'); + } + + /** + * @param string|null $value + */ + public function setAccessibilityStandard($value): self + { + $this->set('accessibilityStandard', $value); + return $this; + } + + public function hasAccessibilityStandard(): bool + { + return $this->has('accessibilityStandard'); + } + + public function unsetAccessibilityStandard(): self + { + $this->remove('accessibilityStandard'); + return $this; + } + + /** + * @return string|null + */ + public function getAccessibilityAdditionalStandard() + { + return $this->get('accessibilityAdditionalStandard'); + } + + /** + * @param string|null $value + */ + public function setAccessibilityAdditionalStandard($value): self + { + $this->set('accessibilityAdditionalStandard', $value); + return $this; + } + + public function hasAccessibilityAdditionalStandard(): bool + { + return $this->has('accessibilityAdditionalStandard'); + } + + public function unsetAccessibilityAdditionalStandard(): self + { + $this->remove('accessibilityAdditionalStandard'); + return $this; + } + + /** + * @return string|null + */ + public function getAccessibilityException() + { + return $this->get('accessibilityException'); + } + + /** + * @param string|null $value + */ + public function setAccessibilityException($value): self + { + $this->set('accessibilityException', $value); + return $this; + } + + public function hasAccessibilityException(): bool + { + return $this->has('accessibilityException'); + } + + public function unsetAccessibilityException(): self + { + $this->remove('accessibilityException'); + return $this; + } + + /** + * @return string|null + */ + public function getAccessibilityReportUrl() + { + return $this->get('accessibilityReportUrl'); + } + + /** + * @param string|null $value + */ + public function setAccessibilityReportUrl($value): self + { + $this->set('accessibilityReportUrl', $value); + return $this; + } + + public function hasAccessibilityReportUrl(): bool + { + return $this->has('accessibilityReportUrl'); + } + + public function unsetAccessibilityReportUrl(): self + { + $this->remove('accessibilityReportUrl'); + return $this; + } + + /** + * @return Price[] + */ + public function getPrices() + { + return $this->get('prices'); + } + + /** + * @param Price[] $value + */ + public function setPrices($value): self + { + $this->set('prices', $value); + return $this; + } + + public function hasPrices(): bool + { + return $this->has('prices'); + } + + public function unsetPrices(): self + { + $this->remove('prices'); + return $this; + } + + /** + * @return Location[] + */ + public function getLocations() + { + return $this->get('locations'); + } + + /** + * @param Location[] $value + */ + public function setLocations($value): self + { + $this->set('locations', $value); + return $this; + } + + public function hasLocations(): bool + { + return $this->has('locations'); + } + + public function unsetLocations(): self + { + $this->remove('locations'); + return $this; + } + + /** + * @return File|null + */ + public function getFile() + { + return $this->get('file'); + } + + /** + * @param File|null $value + */ + public function setFile($value): self + { + $this->set('file', $value); + return $this; + } + + public function hasFile(): bool + { + return $this->has('file'); + } + + public function unsetFile(): self + { + $this->remove('file'); + return $this; + } + + /** + * @return Work + */ + public function getWork() + { + return $this->get('work'); + } + + /** + * @param Work $value + */ + public function setWork($value): self + { + $this->set('work', $value); + return $this; + } + + public function hasWork(): bool + { + return $this->has('work'); + } + + public function unsetWork(): self + { + $this->remove('work'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Publication', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publicationId', + 'description' => 'Thoth ID of the publication', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publicationType', + 'description' => 'Format of this publication', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'PublicationType', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => 'Thoth ID of the work to which this publication belongs', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'isbn', + 'description' => 'International Standard Book Number of the publication, in ISBN-13 format', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Isbn', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the publication record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the publication record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'width', + 'description' => 'Width of the physical Publication (in mm, cm or in) (only applicable to non-Chapter Paperbacks and Hardbacks)', + 'args' => [ + [ + 'name' => 'units', + 'description' => 'Unit of measurement in which to represent the width (mm, cm or in)', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LengthUnit', + 'ofType' => null, + ], + ], + 'defaultValue' => '"MM"', + ], + ], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'height', + 'description' => 'Height of the physical Publication (in mm, cm or in) (only applicable to non-Chapter Paperbacks and Hardbacks)', + 'args' => [ + [ + 'name' => 'units', + 'description' => 'Unit of measurement in which to represent the height (mm, cm or in)', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LengthUnit', + 'ofType' => null, + ], + ], + 'defaultValue' => '"MM"', + ], + ], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'depth', + 'description' => 'Depth of the physical Publication (in mm, cm or in) (only applicable to non-Chapter Paperbacks and Hardbacks)', + 'args' => [ + [ + 'name' => 'units', + 'description' => 'Unit of measurement in which to represent the depth (mm, cm or in)', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LengthUnit', + 'ofType' => null, + ], + ], + 'defaultValue' => '"MM"', + ], + ], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'weight', + 'description' => 'Weight of the physical Publication (in g or oz) (only applicable to non-Chapter Paperbacks and Hardbacks)', + 'args' => [ + [ + 'name' => 'units', + 'description' => 'Unit of measurement in which to represent the weight (grams or ounces)', + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WeightUnit', + 'ofType' => null, + ], + ], + 'defaultValue' => '"G"', + ], + ], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Float', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'accessibilityStandard', + 'description' => 'WCAG standard accessibility level met by this publication (if any)', + 'args' => [], + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'AccessibilityStandard', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'accessibilityAdditionalStandard', + 'description' => 'EPUB- or PDF-specific standard accessibility level met by this publication, if applicable', + 'args' => [], + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'AccessibilityStandard', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'accessibilityException', + 'description' => 'Reason for this publication not being required to comply with accessibility standards (if any)', + 'args' => [], + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'AccessibilityException', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'accessibilityReportUrl', + 'description' => 'Link to a web page showing detailed accessibility information for this publication', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'prices', + 'description' => 'Get prices linked to this publication', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PriceOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "CURRENCY_CODE", direction: "ASC"}', + ], + [ + 'name' => 'currencyCodes', + 'description' => 'Specific currencies to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'CurrencyCode', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Price', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'locations', + 'description' => 'Get locations linked to this publication', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'LocationOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "LOCATION_PLATFORM", direction: "ASC"}', + ], + [ + 'name' => 'locationPlatforms', + 'description' => 'Specific platforms to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocationPlatform', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Location', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'file', + 'description' => 'Get the publication file for this publication', + 'args' => [], + 'type' => [ + 'kind' => 'OBJECT', + 'name' => 'File', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'work', + 'description' => 'Get the work to which this publication belongs', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Publisher.php b/src/GraphQL/Schemas/Publisher.php new file mode 100644 index 0000000..eb01951 --- /dev/null +++ b/src/GraphQL/Schemas/Publisher.php @@ -0,0 +1,585 @@ +get('publisherId'); + } + + /** + * @param string $value + */ + public function setPublisherId($value): self + { + $this->set('publisherId', $value); + return $this; + } + + public function hasPublisherId(): bool + { + return $this->has('publisherId'); + } + + public function unsetPublisherId(): self + { + $this->remove('publisherId'); + return $this; + } + + /** + * @return string + */ + public function getPublisherName() + { + return $this->get('publisherName'); + } + + /** + * @param string $value + */ + public function setPublisherName($value): self + { + $this->set('publisherName', $value); + return $this; + } + + public function hasPublisherName(): bool + { + return $this->has('publisherName'); + } + + public function unsetPublisherName(): self + { + $this->remove('publisherName'); + return $this; + } + + /** + * @return string|null + */ + public function getPublisherShortname() + { + return $this->get('publisherShortname'); + } + + /** + * @param string|null $value + */ + public function setPublisherShortname($value): self + { + $this->set('publisherShortname', $value); + return $this; + } + + public function hasPublisherShortname(): bool + { + return $this->has('publisherShortname'); + } + + public function unsetPublisherShortname(): self + { + $this->remove('publisherShortname'); + return $this; + } + + /** + * @return string|null + */ + public function getPublisherUrl() + { + return $this->get('publisherUrl'); + } + + /** + * @param string|null $value + */ + public function setPublisherUrl($value): self + { + $this->set('publisherUrl', $value); + return $this; + } + + public function hasPublisherUrl(): bool + { + return $this->has('publisherUrl'); + } + + public function unsetPublisherUrl(): self + { + $this->remove('publisherUrl'); + return $this; + } + + /** + * @return string|null + */ + public function getZitadelId() + { + return $this->get('zitadelId'); + } + + /** + * @param string|null $value + */ + public function setZitadelId($value): self + { + $this->set('zitadelId', $value); + return $this; + } + + public function hasZitadelId(): bool + { + return $this->has('zitadelId'); + } + + public function unsetZitadelId(): self + { + $this->remove('zitadelId'); + return $this; + } + + /** + * @return string|null + */ + public function getAccessibilityStatement() + { + return $this->get('accessibilityStatement'); + } + + /** + * @param string|null $value + */ + public function setAccessibilityStatement($value): self + { + $this->set('accessibilityStatement', $value); + return $this; + } + + public function hasAccessibilityStatement(): bool + { + return $this->has('accessibilityStatement'); + } + + public function unsetAccessibilityStatement(): self + { + $this->remove('accessibilityStatement'); + return $this; + } + + /** + * @return string|null + */ + public function getAccessibilityReportUrl() + { + return $this->get('accessibilityReportUrl'); + } + + /** + * @param string|null $value + */ + public function setAccessibilityReportUrl($value): self + { + $this->set('accessibilityReportUrl', $value); + return $this; + } + + public function hasAccessibilityReportUrl(): bool + { + return $this->has('accessibilityReportUrl'); + } + + public function unsetAccessibilityReportUrl(): self + { + $this->remove('accessibilityReportUrl'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Imprint[] + */ + public function getImprints() + { + return $this->get('imprints'); + } + + /** + * @param Imprint[] $value + */ + public function setImprints($value): self + { + $this->set('imprints', $value); + return $this; + } + + public function hasImprints(): bool + { + return $this->has('imprints'); + } + + public function unsetImprints(): self + { + $this->remove('imprints'); + return $this; + } + + /** + * @return Contact[] + */ + public function getContacts() + { + return $this->get('contacts'); + } + + /** + * @param Contact[] $value + */ + public function setContacts($value): self + { + $this->set('contacts', $value); + return $this; + } + + public function hasContacts(): bool + { + return $this->has('contacts'); + } + + public function unsetContacts(): self + { + $this->remove('contacts'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Publisher', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publisherId', + 'description' => 'Thoth ID of the publisher', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publisherName', + 'description' => 'Name of the publisher', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publisherShortname', + 'description' => 'Short name of the publisher, if any (e.g. an abbreviation)', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publisherUrl', + 'description' => 'URL of the publisher\'s website', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'zitadelId', + 'description' => 'Zitadel organisation ID associated with the publisher', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'accessibilityStatement', + 'description' => 'Statement from the publisher on the accessibility of its texts for readers with impairments', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'accessibilityReportUrl', + 'description' => 'URL of the publisher\'s report on the accessibility of its texts for readers with impairments', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the publisher record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the publisher record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'imprints', + 'description' => 'Get imprints linked to this publisher', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on imprint_name and imprint_url', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'ImprintOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "IMPRINT_NAME", direction: "ASC"}', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Imprint', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'contacts', + 'description' => 'Get contacts linked to this publisher', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'ContactOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "EMAIL", direction: "ASC"}', + ], + [ + 'name' => 'contactTypes', + 'description' => 'Specific types to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ContactType', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contact', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/PublisherContext.php b/src/GraphQL/Schemas/PublisherContext.php new file mode 100644 index 0000000..e2b1c02 --- /dev/null +++ b/src/GraphQL/Schemas/PublisherContext.php @@ -0,0 +1,103 @@ +get('publisher'); + } + + /** + * @param Publisher $value + */ + public function setPublisher($value): self + { + $this->set('publisher', $value); + return $this; + } + + public function hasPublisher(): bool + { + return $this->has('publisher'); + } + + public function unsetPublisher(): self + { + $this->remove('publisher'); + return $this; + } + + /** + * @return PublisherPermissions + */ + public function getPermissions() + { + return $this->get('permissions'); + } + + /** + * @param PublisherPermissions $value + */ + public function setPermissions($value): self + { + $this->set('permissions', $value); + return $this; + } + + public function hasPermissions(): bool + { + return $this->has('permissions'); + } + + public function unsetPermissions(): self + { + $this->remove('permissions'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('PublisherContext', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publisher', + 'description' => null, + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Publisher', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'permissions', + 'description' => null, + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'PublisherPermissions', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/PublisherPermissions.php b/src/GraphQL/Schemas/PublisherPermissions.php new file mode 100644 index 0000000..ea61cb5 --- /dev/null +++ b/src/GraphQL/Schemas/PublisherPermissions.php @@ -0,0 +1,147 @@ +get('publisherAdmin'); + } + + /** + * @param bool $value + */ + public function setPublisherAdmin($value): self + { + $this->set('publisherAdmin', $value); + return $this; + } + + public function hasPublisherAdmin(): bool + { + return $this->has('publisherAdmin'); + } + + public function unsetPublisherAdmin(): self + { + $this->remove('publisherAdmin'); + return $this; + } + + /** + * @return bool + */ + public function getWorkLifecycle() + { + return $this->get('workLifecycle'); + } + + /** + * @param bool $value + */ + public function setWorkLifecycle($value): self + { + $this->set('workLifecycle', $value); + return $this; + } + + public function hasWorkLifecycle(): bool + { + return $this->has('workLifecycle'); + } + + public function unsetWorkLifecycle(): self + { + $this->remove('workLifecycle'); + return $this; + } + + /** + * @return bool + */ + public function getCdnWrite() + { + return $this->get('cdnWrite'); + } + + /** + * @param bool $value + */ + public function setCdnWrite($value): self + { + $this->set('cdnWrite', $value); + return $this; + } + + public function hasCdnWrite(): bool + { + return $this->has('cdnWrite'); + } + + public function unsetCdnWrite(): self + { + $this->remove('cdnWrite'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('PublisherPermissions', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publisherAdmin', + 'description' => null, + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Boolean', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workLifecycle', + 'description' => null, + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Boolean', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'cdnWrite', + 'description' => null, + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Boolean', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Reference.php b/src/GraphQL/Schemas/Reference.php new file mode 100644 index 0000000..ef306e5 --- /dev/null +++ b/src/GraphQL/Schemas/Reference.php @@ -0,0 +1,1079 @@ +get('referenceId'); + } + + /** + * @param string $value + */ + public function setReferenceId($value): self + { + $this->set('referenceId', $value); + return $this; + } + + public function hasReferenceId(): bool + { + return $this->has('referenceId'); + } + + public function unsetReferenceId(): self + { + $this->remove('referenceId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return int + */ + public function getReferenceOrdinal() + { + return $this->get('referenceOrdinal'); + } + + /** + * @param int $value + */ + public function setReferenceOrdinal($value): self + { + $this->set('referenceOrdinal', $value); + return $this; + } + + public function hasReferenceOrdinal(): bool + { + return $this->has('referenceOrdinal'); + } + + public function unsetReferenceOrdinal(): self + { + $this->remove('referenceOrdinal'); + return $this; + } + + /** + * @return string|null + */ + public function getDoi() + { + return $this->get('doi'); + } + + /** + * @param string|null $value + */ + public function setDoi($value): self + { + $this->set('doi', $value); + return $this; + } + + public function hasDoi(): bool + { + return $this->has('doi'); + } + + public function unsetDoi(): self + { + $this->remove('doi'); + return $this; + } + + /** + * @return string|null + */ + public function getUnstructuredCitation() + { + return $this->get('unstructuredCitation'); + } + + /** + * @param string|null $value + */ + public function setUnstructuredCitation($value): self + { + $this->set('unstructuredCitation', $value); + return $this; + } + + public function hasUnstructuredCitation(): bool + { + return $this->has('unstructuredCitation'); + } + + public function unsetUnstructuredCitation(): self + { + $this->remove('unstructuredCitation'); + return $this; + } + + /** + * @return string|null + */ + public function getIssn() + { + return $this->get('issn'); + } + + /** + * @param string|null $value + */ + public function setIssn($value): self + { + $this->set('issn', $value); + return $this; + } + + public function hasIssn(): bool + { + return $this->has('issn'); + } + + public function unsetIssn(): self + { + $this->remove('issn'); + return $this; + } + + /** + * @return string|null + */ + public function getIsbn() + { + return $this->get('isbn'); + } + + /** + * @param string|null $value + */ + public function setIsbn($value): self + { + $this->set('isbn', $value); + return $this; + } + + public function hasIsbn(): bool + { + return $this->has('isbn'); + } + + public function unsetIsbn(): self + { + $this->remove('isbn'); + return $this; + } + + /** + * @return string|null + */ + public function getJournalTitle() + { + return $this->get('journalTitle'); + } + + /** + * @param string|null $value + */ + public function setJournalTitle($value): self + { + $this->set('journalTitle', $value); + return $this; + } + + public function hasJournalTitle(): bool + { + return $this->has('journalTitle'); + } + + public function unsetJournalTitle(): self + { + $this->remove('journalTitle'); + return $this; + } + + /** + * @return string|null + */ + public function getArticleTitle() + { + return $this->get('articleTitle'); + } + + /** + * @param string|null $value + */ + public function setArticleTitle($value): self + { + $this->set('articleTitle', $value); + return $this; + } + + public function hasArticleTitle(): bool + { + return $this->has('articleTitle'); + } + + public function unsetArticleTitle(): self + { + $this->remove('articleTitle'); + return $this; + } + + /** + * @return string|null + */ + public function getSeriesTitle() + { + return $this->get('seriesTitle'); + } + + /** + * @param string|null $value + */ + public function setSeriesTitle($value): self + { + $this->set('seriesTitle', $value); + return $this; + } + + public function hasSeriesTitle(): bool + { + return $this->has('seriesTitle'); + } + + public function unsetSeriesTitle(): self + { + $this->remove('seriesTitle'); + return $this; + } + + /** + * @return string|null + */ + public function getVolumeTitle() + { + return $this->get('volumeTitle'); + } + + /** + * @param string|null $value + */ + public function setVolumeTitle($value): self + { + $this->set('volumeTitle', $value); + return $this; + } + + public function hasVolumeTitle(): bool + { + return $this->has('volumeTitle'); + } + + public function unsetVolumeTitle(): self + { + $this->remove('volumeTitle'); + return $this; + } + + /** + * @return int|null + */ + public function getEdition() + { + return $this->get('edition'); + } + + /** + * @param int|null $value + */ + public function setEdition($value): self + { + $this->set('edition', $value); + return $this; + } + + public function hasEdition(): bool + { + return $this->has('edition'); + } + + public function unsetEdition(): self + { + $this->remove('edition'); + return $this; + } + + /** + * @return string|null + */ + public function getAuthor() + { + return $this->get('author'); + } + + /** + * @param string|null $value + */ + public function setAuthor($value): self + { + $this->set('author', $value); + return $this; + } + + public function hasAuthor(): bool + { + return $this->has('author'); + } + + public function unsetAuthor(): self + { + $this->remove('author'); + return $this; + } + + /** + * @return string|null + */ + public function getVolume() + { + return $this->get('volume'); + } + + /** + * @param string|null $value + */ + public function setVolume($value): self + { + $this->set('volume', $value); + return $this; + } + + public function hasVolume(): bool + { + return $this->has('volume'); + } + + public function unsetVolume(): self + { + $this->remove('volume'); + return $this; + } + + /** + * @return string|null + */ + public function getIssue() + { + return $this->get('issue'); + } + + /** + * @param string|null $value + */ + public function setIssue($value): self + { + $this->set('issue', $value); + return $this; + } + + public function hasIssue(): bool + { + return $this->has('issue'); + } + + public function unsetIssue(): self + { + $this->remove('issue'); + return $this; + } + + /** + * @return string|null + */ + public function getFirstPage() + { + return $this->get('firstPage'); + } + + /** + * @param string|null $value + */ + public function setFirstPage($value): self + { + $this->set('firstPage', $value); + return $this; + } + + public function hasFirstPage(): bool + { + return $this->has('firstPage'); + } + + public function unsetFirstPage(): self + { + $this->remove('firstPage'); + return $this; + } + + /** + * @return string|null + */ + public function getComponentNumber() + { + return $this->get('componentNumber'); + } + + /** + * @param string|null $value + */ + public function setComponentNumber($value): self + { + $this->set('componentNumber', $value); + return $this; + } + + public function hasComponentNumber(): bool + { + return $this->has('componentNumber'); + } + + public function unsetComponentNumber(): self + { + $this->remove('componentNumber'); + return $this; + } + + /** + * @return string|null + */ + public function getStandardDesignator() + { + return $this->get('standardDesignator'); + } + + /** + * @param string|null $value + */ + public function setStandardDesignator($value): self + { + $this->set('standardDesignator', $value); + return $this; + } + + public function hasStandardDesignator(): bool + { + return $this->has('standardDesignator'); + } + + public function unsetStandardDesignator(): self + { + $this->remove('standardDesignator'); + return $this; + } + + /** + * @return string|null + */ + public function getStandardsBodyName() + { + return $this->get('standardsBodyName'); + } + + /** + * @param string|null $value + */ + public function setStandardsBodyName($value): self + { + $this->set('standardsBodyName', $value); + return $this; + } + + public function hasStandardsBodyName(): bool + { + return $this->has('standardsBodyName'); + } + + public function unsetStandardsBodyName(): self + { + $this->remove('standardsBodyName'); + return $this; + } + + /** + * @return string|null + */ + public function getStandardsBodyAcronym() + { + return $this->get('standardsBodyAcronym'); + } + + /** + * @param string|null $value + */ + public function setStandardsBodyAcronym($value): self + { + $this->set('standardsBodyAcronym', $value); + return $this; + } + + public function hasStandardsBodyAcronym(): bool + { + return $this->has('standardsBodyAcronym'); + } + + public function unsetStandardsBodyAcronym(): self + { + $this->remove('standardsBodyAcronym'); + return $this; + } + + /** + * @return string|null + */ + public function getUrl() + { + return $this->get('url'); + } + + /** + * @param string|null $value + */ + public function setUrl($value): self + { + $this->set('url', $value); + return $this; + } + + public function hasUrl(): bool + { + return $this->has('url'); + } + + public function unsetUrl(): self + { + $this->remove('url'); + return $this; + } + + /** + * @return string|null + */ + public function getPublicationDate() + { + return $this->get('publicationDate'); + } + + /** + * @param string|null $value + */ + public function setPublicationDate($value): self + { + $this->set('publicationDate', $value); + return $this; + } + + public function hasPublicationDate(): bool + { + return $this->has('publicationDate'); + } + + public function unsetPublicationDate(): self + { + $this->remove('publicationDate'); + return $this; + } + + /** + * @return string|null + */ + public function getRetrievalDate() + { + return $this->get('retrievalDate'); + } + + /** + * @param string|null $value + */ + public function setRetrievalDate($value): self + { + $this->set('retrievalDate', $value); + return $this; + } + + public function hasRetrievalDate(): bool + { + return $this->has('retrievalDate'); + } + + public function unsetRetrievalDate(): self + { + $this->remove('retrievalDate'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Work + */ + public function getWork() + { + return $this->get('work'); + } + + /** + * @param Work $value + */ + public function setWork($value): self + { + $this->set('work', $value); + return $this; + } + + public function hasWork(): bool + { + return $this->has('work'); + } + + public function unsetWork(): self + { + $this->remove('work'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Reference', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'referenceId', + 'description' => 'UUID of the reference.', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => 'UUID of the citing work.', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'referenceOrdinal', + 'description' => 'Number used to order references within a work\'s bibliography.', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'doi', + 'description' => 'Digital Object Identifier of the cited work as full URL.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'unstructuredCitation', + 'description' => 'Full reference text. When the DOI of the cited work is not known this field is required, and may be used in conjunction with other structured data to help identify the cited work.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'issn', + 'description' => 'ISSN of a series.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'isbn', + 'description' => 'Book ISBN, when the cited work is a book or a chapter.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Isbn', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'journalTitle', + 'description' => 'Title of a journal, when the cited work is an article.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'articleTitle', + 'description' => 'Journal article, conference paper, or book chapter title.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'seriesTitle', + 'description' => 'Title of a book or conference series.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'volumeTitle', + 'description' => 'Title of a book or conference proceeding.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'edition', + 'description' => 'Book edition number.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'author', + 'description' => 'First author of the cited work.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'volume', + 'description' => 'Volume number of a journal or book set.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'issue', + 'description' => 'Journal issue, when the cited work is an article.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'firstPage', + 'description' => 'First page of the cited page range.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'componentNumber', + 'description' => 'The chapter, section or part number, when the cited work is a component of a book.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'standardDesignator', + 'description' => 'Standard identifier (e.g. "14064-1"), when the cited work is a standard.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'standardsBodyName', + 'description' => 'Full name of the standards organisation (e.g. "International Organization for Standardization"), when the cited work is a standard.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'standardsBodyAcronym', + 'description' => 'Acronym of the standards organisation (e.g. "ISO"), when the cited work is a standard.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'url', + 'description' => 'URL of the cited work.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publicationDate', + 'description' => 'Publication date of the cited work. Day and month should be set to "01" when only the publication year is known.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Date', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'retrievalDate', + 'description' => 'Date the cited work was accessed, when citing a website or online article.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Date', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Timestamp of the creation of this record within Thoth.', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Timestamp of the last update to this record within Thoth.', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'work', + 'description' => 'The citing work.', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Series.php b/src/GraphQL/Schemas/Series.php new file mode 100644 index 0000000..0769e35 --- /dev/null +++ b/src/GraphQL/Schemas/Series.php @@ -0,0 +1,617 @@ +get('seriesId'); + } + + /** + * @param string $value + */ + public function setSeriesId($value): self + { + $this->set('seriesId', $value); + return $this; + } + + public function hasSeriesId(): bool + { + return $this->has('seriesId'); + } + + public function unsetSeriesId(): self + { + $this->remove('seriesId'); + return $this; + } + + /** + * @return string + */ + public function getSeriesType() + { + return $this->get('seriesType'); + } + + /** + * @param string $value + */ + public function setSeriesType($value): self + { + $this->set('seriesType', $value); + return $this; + } + + public function hasSeriesType(): bool + { + return $this->has('seriesType'); + } + + public function unsetSeriesType(): self + { + $this->remove('seriesType'); + return $this; + } + + /** + * @return string + */ + public function getSeriesName() + { + return $this->get('seriesName'); + } + + /** + * @param string $value + */ + public function setSeriesName($value): self + { + $this->set('seriesName', $value); + return $this; + } + + public function hasSeriesName(): bool + { + return $this->has('seriesName'); + } + + public function unsetSeriesName(): self + { + $this->remove('seriesName'); + return $this; + } + + /** + * @return string|null + */ + public function getIssnPrint() + { + return $this->get('issnPrint'); + } + + /** + * @param string|null $value + */ + public function setIssnPrint($value): self + { + $this->set('issnPrint', $value); + return $this; + } + + public function hasIssnPrint(): bool + { + return $this->has('issnPrint'); + } + + public function unsetIssnPrint(): self + { + $this->remove('issnPrint'); + return $this; + } + + /** + * @return string|null + */ + public function getIssnDigital() + { + return $this->get('issnDigital'); + } + + /** + * @param string|null $value + */ + public function setIssnDigital($value): self + { + $this->set('issnDigital', $value); + return $this; + } + + public function hasIssnDigital(): bool + { + return $this->has('issnDigital'); + } + + public function unsetIssnDigital(): self + { + $this->remove('issnDigital'); + return $this; + } + + /** + * @return string|null + */ + public function getSeriesUrl() + { + return $this->get('seriesUrl'); + } + + /** + * @param string|null $value + */ + public function setSeriesUrl($value): self + { + $this->set('seriesUrl', $value); + return $this; + } + + public function hasSeriesUrl(): bool + { + return $this->has('seriesUrl'); + } + + public function unsetSeriesUrl(): self + { + $this->remove('seriesUrl'); + return $this; + } + + /** + * @return string|null + */ + public function getSeriesDescription() + { + return $this->get('seriesDescription'); + } + + /** + * @param string|null $value + */ + public function setSeriesDescription($value): self + { + $this->set('seriesDescription', $value); + return $this; + } + + public function hasSeriesDescription(): bool + { + return $this->has('seriesDescription'); + } + + public function unsetSeriesDescription(): self + { + $this->remove('seriesDescription'); + return $this; + } + + /** + * @return string|null + */ + public function getSeriesCfpUrl() + { + return $this->get('seriesCfpUrl'); + } + + /** + * @param string|null $value + */ + public function setSeriesCfpUrl($value): self + { + $this->set('seriesCfpUrl', $value); + return $this; + } + + public function hasSeriesCfpUrl(): bool + { + return $this->has('seriesCfpUrl'); + } + + public function unsetSeriesCfpUrl(): self + { + $this->remove('seriesCfpUrl'); + return $this; + } + + /** + * @return string + */ + public function getImprintId() + { + return $this->get('imprintId'); + } + + /** + * @param string $value + */ + public function setImprintId($value): self + { + $this->set('imprintId', $value); + return $this; + } + + public function hasImprintId(): bool + { + return $this->has('imprintId'); + } + + public function unsetImprintId(): self + { + $this->remove('imprintId'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Imprint + */ + public function getImprint() + { + return $this->get('imprint'); + } + + /** + * @param Imprint $value + */ + public function setImprint($value): self + { + $this->set('imprint', $value); + return $this; + } + + public function hasImprint(): bool + { + return $this->has('imprint'); + } + + public function unsetImprint(): self + { + $this->remove('imprint'); + return $this; + } + + /** + * @return Issue[] + */ + public function getIssues() + { + return $this->get('issues'); + } + + /** + * @param Issue[] $value + */ + public function setIssues($value): self + { + $this->set('issues', $value); + return $this; + } + + public function hasIssues(): bool + { + return $this->has('issues'); + } + + public function unsetIssues(): self + { + $this->remove('issues'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Series', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'seriesId', + 'description' => 'Thoth ID of the series', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'seriesType', + 'description' => 'Type of the series', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'SeriesType', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'seriesName', + 'description' => 'Name of the series', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'issnPrint', + 'description' => 'Print ISSN (International Standard Serial Number) of the series. This represents the print media version.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'issnDigital', + 'description' => 'Electronic ISSN (International Standard Serial Number) of the series. This represents the online version.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'seriesUrl', + 'description' => 'URL of the series\' landing page', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'seriesDescription', + 'description' => 'Description of the series', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'Markup format used for rendering series description', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => '"JATS_XML"', + ], + ], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'seriesCfpUrl', + 'description' => 'URL of the series\' call for proposals page', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'imprintId', + 'description' => 'Thoth ID of the imprint to which this series belongs', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the series record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the series record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'imprint', + 'description' => 'Get the imprint linked to this series', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Imprint', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'issues', + 'description' => 'Get issues linked to this series', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'IssueOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "ISSUE_ORDINAL", direction: "ASC"}', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Issue', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Subject.php b/src/GraphQL/Schemas/Subject.php new file mode 100644 index 0000000..1b72544 --- /dev/null +++ b/src/GraphQL/Schemas/Subject.php @@ -0,0 +1,367 @@ +get('subjectId'); + } + + /** + * @param string $value + */ + public function setSubjectId($value): self + { + $this->set('subjectId', $value); + return $this; + } + + public function hasSubjectId(): bool + { + return $this->has('subjectId'); + } + + public function unsetSubjectId(): self + { + $this->remove('subjectId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getSubjectType() + { + return $this->get('subjectType'); + } + + /** + * @param string $value + */ + public function setSubjectType($value): self + { + $this->set('subjectType', $value); + return $this; + } + + public function hasSubjectType(): bool + { + return $this->has('subjectType'); + } + + public function unsetSubjectType(): self + { + $this->remove('subjectType'); + return $this; + } + + /** + * @return string + */ + public function getSubjectCode() + { + return $this->get('subjectCode'); + } + + /** + * @param string $value + */ + public function setSubjectCode($value): self + { + $this->set('subjectCode', $value); + return $this; + } + + public function hasSubjectCode(): bool + { + return $this->has('subjectCode'); + } + + public function unsetSubjectCode(): self + { + $this->remove('subjectCode'); + return $this; + } + + /** + * @return int + */ + public function getSubjectOrdinal() + { + return $this->get('subjectOrdinal'); + } + + /** + * @param int $value + */ + public function setSubjectOrdinal($value): self + { + $this->set('subjectOrdinal', $value); + return $this; + } + + public function hasSubjectOrdinal(): bool + { + return $this->has('subjectOrdinal'); + } + + public function unsetSubjectOrdinal(): self + { + $this->remove('subjectOrdinal'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Work + */ + public function getWork() + { + return $this->get('work'); + } + + /** + * @param Work $value + */ + public function setWork($value): self + { + $this->set('work', $value); + return $this; + } + + public function hasWork(): bool + { + return $this->has('work'); + } + + public function unsetWork(): self + { + $this->remove('work'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Subject', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'subjectId', + 'description' => 'Thoth ID of the subject', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => 'Thoth ID of the work to which the subject is linked', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'subjectType', + 'description' => 'Type of the subject (e.g. the subject category scheme being used)', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'SubjectType', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'subjectCode', + 'description' => 'Code representing the subject within the specified type', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'subjectOrdinal', + 'description' => 'Number representing this subject\'s position in an ordered list of subjects of the same type within the work (subjects of equal prominence can have the same number)', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the subject record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the subject record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'work', + 'description' => 'Get the work to which the subject is linked', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Title.php b/src/GraphQL/Schemas/Title.php new file mode 100644 index 0000000..d7b85af --- /dev/null +++ b/src/GraphQL/Schemas/Title.php @@ -0,0 +1,363 @@ +get('titleId'); + } + + /** + * @param string $value + */ + public function setTitleId($value): self + { + $this->set('titleId', $value); + return $this; + } + + public function hasTitleId(): bool + { + return $this->has('titleId'); + } + + public function unsetTitleId(): self + { + $this->remove('titleId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getLocaleCode() + { + return $this->get('localeCode'); + } + + /** + * @param string $value + */ + public function setLocaleCode($value): self + { + $this->set('localeCode', $value); + return $this; + } + + public function hasLocaleCode(): bool + { + return $this->has('localeCode'); + } + + public function unsetLocaleCode(): self + { + $this->remove('localeCode'); + return $this; + } + + /** + * @return string + */ + public function getFullTitle() + { + return $this->get('fullTitle'); + } + + /** + * @param string $value + */ + public function setFullTitle($value): self + { + $this->set('fullTitle', $value); + return $this; + } + + public function hasFullTitle(): bool + { + return $this->has('fullTitle'); + } + + public function unsetFullTitle(): self + { + $this->remove('fullTitle'); + return $this; + } + + /** + * @return string + */ + public function getTitle() + { + return $this->get('title'); + } + + /** + * @param string $value + */ + public function setTitle($value): self + { + $this->set('title', $value); + return $this; + } + + public function hasTitle(): bool + { + return $this->has('title'); + } + + public function unsetTitle(): self + { + $this->remove('title'); + return $this; + } + + /** + * @return string|null + */ + public function getSubtitle() + { + return $this->get('subtitle'); + } + + /** + * @param string|null $value + */ + public function setSubtitle($value): self + { + $this->set('subtitle', $value); + return $this; + } + + public function hasSubtitle(): bool + { + return $this->has('subtitle'); + } + + public function unsetSubtitle(): self + { + $this->remove('subtitle'); + return $this; + } + + /** + * @return bool + */ + public function getCanonical() + { + return $this->get('canonical'); + } + + /** + * @param bool $value + */ + public function setCanonical($value): self + { + $this->set('canonical', $value); + return $this; + } + + public function hasCanonical(): bool + { + return $this->has('canonical'); + } + + public function unsetCanonical(): self + { + $this->remove('canonical'); + return $this; + } + + /** + * @return Work + */ + public function getWork() + { + return $this->get('work'); + } + + /** + * @param Work $value + */ + public function setWork($value): self + { + $this->set('work', $value); + return $this; + } + + public function hasWork(): bool + { + return $this->has('work'); + } + + public function unsetWork(): self + { + $this->remove('work'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Title', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'titleId', + 'description' => 'Thoth ID of the title', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => 'Thoth ID of the work to which the title is linked', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'localeCode', + 'description' => 'Locale code of the title', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocaleCode', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'fullTitle', + 'description' => 'Full title including subtitle', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'title', + 'description' => 'Main title (excluding subtitle)', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'subtitle', + 'description' => 'Subtitle of the work', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'canonical', + 'description' => 'Whether this is the canonical title for the work', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Boolean', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'work', + 'description' => 'Get the work to which the title is linked', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/UploadRequestHeader.php b/src/GraphQL/Schemas/UploadRequestHeader.php new file mode 100644 index 0000000..147d60e --- /dev/null +++ b/src/GraphQL/Schemas/UploadRequestHeader.php @@ -0,0 +1,103 @@ +get('name'); + } + + /** + * @param string $value + */ + public function setName($value): self + { + $this->set('name', $value); + return $this; + } + + public function hasName(): bool + { + return $this->has('name'); + } + + public function unsetName(): self + { + $this->remove('name'); + return $this; + } + + /** + * @return string + */ + public function getValue() + { + return $this->get('value'); + } + + /** + * @param string $value + */ + public function setValue($value): self + { + $this->set('value', $value); + return $this; + } + + public function hasValue(): bool + { + return $this->has('value'); + } + + public function unsetValue(): self + { + $this->remove('value'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('UploadRequestHeader', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'name', + 'description' => 'HTTP header name.', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'value', + 'description' => 'HTTP header value.', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/Work.php b/src/GraphQL/Schemas/Work.php new file mode 100644 index 0000000..250850d --- /dev/null +++ b/src/GraphQL/Schemas/Work.php @@ -0,0 +1,3062 @@ +get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getWorkType() + { + return $this->get('workType'); + } + + /** + * @param string $value + */ + public function setWorkType($value): self + { + $this->set('workType', $value); + return $this; + } + + public function hasWorkType(): bool + { + return $this->has('workType'); + } + + public function unsetWorkType(): self + { + $this->remove('workType'); + return $this; + } + + /** + * @return string + */ + public function getWorkStatus() + { + return $this->get('workStatus'); + } + + /** + * @param string $value + */ + public function setWorkStatus($value): self + { + $this->set('workStatus', $value); + return $this; + } + + public function hasWorkStatus(): bool + { + return $this->has('workStatus'); + } + + public function unsetWorkStatus(): self + { + $this->remove('workStatus'); + return $this; + } + + /** + * @return string + */ + public function getFullTitle() + { + return $this->get('fullTitle'); + } + + /** + * @param string $value + */ + public function setFullTitle($value): self + { + $this->set('fullTitle', $value); + return $this; + } + + public function hasFullTitle(): bool + { + return $this->has('fullTitle'); + } + + public function unsetFullTitle(): self + { + $this->remove('fullTitle'); + return $this; + } + + /** + * @return string + */ + public function getTitle() + { + return $this->get('title'); + } + + /** + * @param string $value + */ + public function setTitle($value): self + { + $this->set('title', $value); + return $this; + } + + public function hasTitle(): bool + { + return $this->has('title'); + } + + public function unsetTitle(): self + { + $this->remove('title'); + return $this; + } + + /** + * @return string|null + */ + public function getSubtitle() + { + return $this->get('subtitle'); + } + + /** + * @param string|null $value + */ + public function setSubtitle($value): self + { + $this->set('subtitle', $value); + return $this; + } + + public function hasSubtitle(): bool + { + return $this->has('subtitle'); + } + + public function unsetSubtitle(): self + { + $this->remove('subtitle'); + return $this; + } + + /** + * @return string|null + */ + public function getShortAbstract() + { + return $this->get('shortAbstract'); + } + + /** + * @param string|null $value + */ + public function setShortAbstract($value): self + { + $this->set('shortAbstract', $value); + return $this; + } + + public function hasShortAbstract(): bool + { + return $this->has('shortAbstract'); + } + + public function unsetShortAbstract(): self + { + $this->remove('shortAbstract'); + return $this; + } + + /** + * @return string|null + */ + public function getLongAbstract() + { + return $this->get('longAbstract'); + } + + /** + * @param string|null $value + */ + public function setLongAbstract($value): self + { + $this->set('longAbstract', $value); + return $this; + } + + public function hasLongAbstract(): bool + { + return $this->has('longAbstract'); + } + + public function unsetLongAbstract(): self + { + $this->remove('longAbstract'); + return $this; + } + + /** + * @return Title[] + */ + public function getTitles() + { + return $this->get('titles'); + } + + /** + * @param Title[] $value + */ + public function setTitles($value): self + { + $this->set('titles', $value); + return $this; + } + + public function hasTitles(): bool + { + return $this->has('titles'); + } + + public function unsetTitles(): self + { + $this->remove('titles'); + return $this; + } + + /** + * @return GraphQLAbstract[] + */ + public function getAbstracts() + { + return $this->get('abstracts'); + } + + /** + * @param GraphQLAbstract[] $value + */ + public function setAbstracts($value): self + { + $this->set('abstracts', $value); + return $this; + } + + public function hasAbstracts(): bool + { + return $this->has('abstracts'); + } + + public function unsetAbstracts(): self + { + $this->remove('abstracts'); + return $this; + } + + /** + * @return string|null + */ + public function getReference() + { + return $this->get('reference'); + } + + /** + * @param string|null $value + */ + public function setReference($value): self + { + $this->set('reference', $value); + return $this; + } + + public function hasReference(): bool + { + return $this->has('reference'); + } + + public function unsetReference(): self + { + $this->remove('reference'); + return $this; + } + + /** + * @return int|null + */ + public function getEdition() + { + return $this->get('edition'); + } + + /** + * @param int|null $value + */ + public function setEdition($value): self + { + $this->set('edition', $value); + return $this; + } + + public function hasEdition(): bool + { + return $this->has('edition'); + } + + public function unsetEdition(): self + { + $this->remove('edition'); + return $this; + } + + /** + * @return string + */ + public function getImprintId() + { + return $this->get('imprintId'); + } + + /** + * @param string $value + */ + public function setImprintId($value): self + { + $this->set('imprintId', $value); + return $this; + } + + public function hasImprintId(): bool + { + return $this->has('imprintId'); + } + + public function unsetImprintId(): self + { + $this->remove('imprintId'); + return $this; + } + + /** + * @return string|null + */ + public function getDoi() + { + return $this->get('doi'); + } + + /** + * @param string|null $value + */ + public function setDoi($value): self + { + $this->set('doi', $value); + return $this; + } + + public function hasDoi(): bool + { + return $this->has('doi'); + } + + public function unsetDoi(): self + { + $this->remove('doi'); + return $this; + } + + /** + * @return string|null + */ + public function getPublicationDate() + { + return $this->get('publicationDate'); + } + + /** + * @param string|null $value + */ + public function setPublicationDate($value): self + { + $this->set('publicationDate', $value); + return $this; + } + + public function hasPublicationDate(): bool + { + return $this->has('publicationDate'); + } + + public function unsetPublicationDate(): self + { + $this->remove('publicationDate'); + return $this; + } + + /** + * @return string|null + */ + public function getWithdrawnDate() + { + return $this->get('withdrawnDate'); + } + + /** + * @param string|null $value + */ + public function setWithdrawnDate($value): self + { + $this->set('withdrawnDate', $value); + return $this; + } + + public function hasWithdrawnDate(): bool + { + return $this->has('withdrawnDate'); + } + + public function unsetWithdrawnDate(): self + { + $this->remove('withdrawnDate'); + return $this; + } + + /** + * @return string|null + */ + public function getPlace() + { + return $this->get('place'); + } + + /** + * @param string|null $value + */ + public function setPlace($value): self + { + $this->set('place', $value); + return $this; + } + + public function hasPlace(): bool + { + return $this->has('place'); + } + + public function unsetPlace(): self + { + $this->remove('place'); + return $this; + } + + /** + * @return int|null + */ + public function getPageCount() + { + return $this->get('pageCount'); + } + + /** + * @param int|null $value + */ + public function setPageCount($value): self + { + $this->set('pageCount', $value); + return $this; + } + + public function hasPageCount(): bool + { + return $this->has('pageCount'); + } + + public function unsetPageCount(): self + { + $this->remove('pageCount'); + return $this; + } + + /** + * @return string|null + */ + public function getPageBreakdown() + { + return $this->get('pageBreakdown'); + } + + /** + * @param string|null $value + */ + public function setPageBreakdown($value): self + { + $this->set('pageBreakdown', $value); + return $this; + } + + public function hasPageBreakdown(): bool + { + return $this->has('pageBreakdown'); + } + + public function unsetPageBreakdown(): self + { + $this->remove('pageBreakdown'); + return $this; + } + + /** + * @return int|null + */ + public function getImageCount() + { + return $this->get('imageCount'); + } + + /** + * @param int|null $value + */ + public function setImageCount($value): self + { + $this->set('imageCount', $value); + return $this; + } + + public function hasImageCount(): bool + { + return $this->has('imageCount'); + } + + public function unsetImageCount(): self + { + $this->remove('imageCount'); + return $this; + } + + /** + * @return int|null + */ + public function getTableCount() + { + return $this->get('tableCount'); + } + + /** + * @param int|null $value + */ + public function setTableCount($value): self + { + $this->set('tableCount', $value); + return $this; + } + + public function hasTableCount(): bool + { + return $this->has('tableCount'); + } + + public function unsetTableCount(): self + { + $this->remove('tableCount'); + return $this; + } + + /** + * @return int|null + */ + public function getAudioCount() + { + return $this->get('audioCount'); + } + + /** + * @param int|null $value + */ + public function setAudioCount($value): self + { + $this->set('audioCount', $value); + return $this; + } + + public function hasAudioCount(): bool + { + return $this->has('audioCount'); + } + + public function unsetAudioCount(): self + { + $this->remove('audioCount'); + return $this; + } + + /** + * @return int|null + */ + public function getVideoCount() + { + return $this->get('videoCount'); + } + + /** + * @param int|null $value + */ + public function setVideoCount($value): self + { + $this->set('videoCount', $value); + return $this; + } + + public function hasVideoCount(): bool + { + return $this->has('videoCount'); + } + + public function unsetVideoCount(): self + { + $this->remove('videoCount'); + return $this; + } + + /** + * @return string|null + */ + public function getLicense() + { + return $this->get('license'); + } + + /** + * @param string|null $value + */ + public function setLicense($value): self + { + $this->set('license', $value); + return $this; + } + + public function hasLicense(): bool + { + return $this->has('license'); + } + + public function unsetLicense(): self + { + $this->remove('license'); + return $this; + } + + /** + * @return string|null + */ + public function getCopyrightHolder() + { + return $this->get('copyrightHolder'); + } + + /** + * @param string|null $value + */ + public function setCopyrightHolder($value): self + { + $this->set('copyrightHolder', $value); + return $this; + } + + public function hasCopyrightHolder(): bool + { + return $this->has('copyrightHolder'); + } + + public function unsetCopyrightHolder(): self + { + $this->remove('copyrightHolder'); + return $this; + } + + /** + * @return string|null + */ + public function getLandingPage() + { + return $this->get('landingPage'); + } + + /** + * @param string|null $value + */ + public function setLandingPage($value): self + { + $this->set('landingPage', $value); + return $this; + } + + public function hasLandingPage(): bool + { + return $this->has('landingPage'); + } + + public function unsetLandingPage(): self + { + $this->remove('landingPage'); + return $this; + } + + /** + * @return string|null + */ + public function getLccn() + { + return $this->get('lccn'); + } + + /** + * @param string|null $value + */ + public function setLccn($value): self + { + $this->set('lccn', $value); + return $this; + } + + public function hasLccn(): bool + { + return $this->has('lccn'); + } + + public function unsetLccn(): self + { + $this->remove('lccn'); + return $this; + } + + /** + * @return string|null + */ + public function getOclc() + { + return $this->get('oclc'); + } + + /** + * @param string|null $value + */ + public function setOclc($value): self + { + $this->set('oclc', $value); + return $this; + } + + public function hasOclc(): bool + { + return $this->has('oclc'); + } + + public function unsetOclc(): self + { + $this->remove('oclc'); + return $this; + } + + /** + * @return string|null + */ + public function getGeneralNote() + { + return $this->get('generalNote'); + } + + /** + * @param string|null $value + */ + public function setGeneralNote($value): self + { + $this->set('generalNote', $value); + return $this; + } + + public function hasGeneralNote(): bool + { + return $this->has('generalNote'); + } + + public function unsetGeneralNote(): self + { + $this->remove('generalNote'); + return $this; + } + + /** + * @return string|null + */ + public function getBibliographyNote() + { + return $this->get('bibliographyNote'); + } + + /** + * @param string|null $value + */ + public function setBibliographyNote($value): self + { + $this->set('bibliographyNote', $value); + return $this; + } + + public function hasBibliographyNote(): bool + { + return $this->has('bibliographyNote'); + } + + public function unsetBibliographyNote(): self + { + $this->remove('bibliographyNote'); + return $this; + } + + /** + * @return string|null + */ + public function getToc() + { + return $this->get('toc'); + } + + /** + * @param string|null $value + */ + public function setToc($value): self + { + $this->set('toc', $value); + return $this; + } + + public function hasToc(): bool + { + return $this->has('toc'); + } + + public function unsetToc(): self + { + $this->remove('toc'); + return $this; + } + + /** + * @return string|null + */ + public function getResourcesDescription() + { + return $this->get('resourcesDescription'); + } + + /** + * @param string|null $value + */ + public function setResourcesDescription($value): self + { + $this->set('resourcesDescription', $value); + return $this; + } + + public function hasResourcesDescription(): bool + { + return $this->has('resourcesDescription'); + } + + public function unsetResourcesDescription(): self + { + $this->remove('resourcesDescription'); + return $this; + } + + /** + * @return string|null + */ + public function getCoverUrl() + { + return $this->get('coverUrl'); + } + + /** + * @param string|null $value + */ + public function setCoverUrl($value): self + { + $this->set('coverUrl', $value); + return $this; + } + + public function hasCoverUrl(): bool + { + return $this->has('coverUrl'); + } + + public function unsetCoverUrl(): self + { + $this->remove('coverUrl'); + return $this; + } + + /** + * @return string|null + */ + public function getCoverCaption() + { + return $this->get('coverCaption'); + } + + /** + * @param string|null $value + */ + public function setCoverCaption($value): self + { + $this->set('coverCaption', $value); + return $this; + } + + public function hasCoverCaption(): bool + { + return $this->has('coverCaption'); + } + + public function unsetCoverCaption(): self + { + $this->remove('coverCaption'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return string|null + */ + public function getFirstPage() + { + return $this->get('firstPage'); + } + + /** + * @param string|null $value + */ + public function setFirstPage($value): self + { + $this->set('firstPage', $value); + return $this; + } + + public function hasFirstPage(): bool + { + return $this->has('firstPage'); + } + + public function unsetFirstPage(): self + { + $this->remove('firstPage'); + return $this; + } + + /** + * @return string|null + */ + public function getLastPage() + { + return $this->get('lastPage'); + } + + /** + * @param string|null $value + */ + public function setLastPage($value): self + { + $this->set('lastPage', $value); + return $this; + } + + public function hasLastPage(): bool + { + return $this->has('lastPage'); + } + + public function unsetLastPage(): self + { + $this->remove('lastPage'); + return $this; + } + + /** + * @return string|null + */ + public function getPageInterval() + { + return $this->get('pageInterval'); + } + + /** + * @param string|null $value + */ + public function setPageInterval($value): self + { + $this->set('pageInterval', $value); + return $this; + } + + public function hasPageInterval(): bool + { + return $this->has('pageInterval'); + } + + public function unsetPageInterval(): self + { + $this->remove('pageInterval'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAtWithRelations() + { + return $this->get('updatedAtWithRelations'); + } + + /** + * @param string $value + */ + public function setUpdatedAtWithRelations($value): self + { + $this->set('updatedAtWithRelations', $value); + return $this; + } + + public function hasUpdatedAtWithRelations(): bool + { + return $this->has('updatedAtWithRelations'); + } + + public function unsetUpdatedAtWithRelations(): self + { + $this->remove('updatedAtWithRelations'); + return $this; + } + + /** + * @return Imprint + */ + public function getImprint() + { + return $this->get('imprint'); + } + + /** + * @param Imprint $value + */ + public function setImprint($value): self + { + $this->set('imprint', $value); + return $this; + } + + public function hasImprint(): bool + { + return $this->has('imprint'); + } + + public function unsetImprint(): self + { + $this->remove('imprint'); + return $this; + } + + /** + * @return Contribution[] + */ + public function getContributions() + { + return $this->get('contributions'); + } + + /** + * @param Contribution[] $value + */ + public function setContributions($value): self + { + $this->set('contributions', $value); + return $this; + } + + public function hasContributions(): bool + { + return $this->has('contributions'); + } + + public function unsetContributions(): self + { + $this->remove('contributions'); + return $this; + } + + /** + * @return Language[] + */ + public function getLanguages() + { + return $this->get('languages'); + } + + /** + * @param Language[] $value + */ + public function setLanguages($value): self + { + $this->set('languages', $value); + return $this; + } + + public function hasLanguages(): bool + { + return $this->has('languages'); + } + + public function unsetLanguages(): self + { + $this->remove('languages'); + return $this; + } + + /** + * @return Publication[] + */ + public function getPublications() + { + return $this->get('publications'); + } + + /** + * @param Publication[] $value + */ + public function setPublications($value): self + { + $this->set('publications', $value); + return $this; + } + + public function hasPublications(): bool + { + return $this->has('publications'); + } + + public function unsetPublications(): self + { + $this->remove('publications'); + return $this; + } + + /** + * @return Subject[] + */ + public function getSubjects() + { + return $this->get('subjects'); + } + + /** + * @param Subject[] $value + */ + public function setSubjects($value): self + { + $this->set('subjects', $value); + return $this; + } + + public function hasSubjects(): bool + { + return $this->has('subjects'); + } + + public function unsetSubjects(): self + { + $this->remove('subjects'); + return $this; + } + + /** + * @return Funding[] + */ + public function getFundings() + { + return $this->get('fundings'); + } + + /** + * @param Funding[] $value + */ + public function setFundings($value): self + { + $this->set('fundings', $value); + return $this; + } + + public function hasFundings(): bool + { + return $this->has('fundings'); + } + + public function unsetFundings(): self + { + $this->remove('fundings'); + return $this; + } + + /** + * @return Issue[] + */ + public function getIssues() + { + return $this->get('issues'); + } + + /** + * @param Issue[] $value + */ + public function setIssues($value): self + { + $this->set('issues', $value); + return $this; + } + + public function hasIssues(): bool + { + return $this->has('issues'); + } + + public function unsetIssues(): self + { + $this->remove('issues'); + return $this; + } + + /** + * @return WorkRelation[] + */ + public function getRelations() + { + return $this->get('relations'); + } + + /** + * @param WorkRelation[] $value + */ + public function setRelations($value): self + { + $this->set('relations', $value); + return $this; + } + + public function hasRelations(): bool + { + return $this->has('relations'); + } + + public function unsetRelations(): self + { + $this->remove('relations'); + return $this; + } + + /** + * @return File|null + */ + public function getFrontcover() + { + return $this->get('frontcover'); + } + + /** + * @param File|null $value + */ + public function setFrontcover($value): self + { + $this->set('frontcover', $value); + return $this; + } + + public function hasFrontcover(): bool + { + return $this->has('frontcover'); + } + + public function unsetFrontcover(): self + { + $this->remove('frontcover'); + return $this; + } + + /** + * @return Reference[] + */ + public function getReferences() + { + return $this->get('references'); + } + + /** + * @param Reference[] $value + */ + public function setReferences($value): self + { + $this->set('references', $value); + return $this; + } + + public function hasReferences(): bool + { + return $this->has('references'); + } + + public function unsetReferences(): self + { + $this->remove('references'); + return $this; + } + + /** + * @return WorkResource[] + */ + public function getAdditionalResources() + { + return $this->get('additionalResources'); + } + + /** + * @param WorkResource[] $value + */ + public function setAdditionalResources($value): self + { + $this->set('additionalResources', $value); + return $this; + } + + public function hasAdditionalResources(): bool + { + return $this->has('additionalResources'); + } + + public function unsetAdditionalResources(): self + { + $this->remove('additionalResources'); + return $this; + } + + /** + * @return Award[] + */ + public function getAwards() + { + return $this->get('awards'); + } + + /** + * @param Award[] $value + */ + public function setAwards($value): self + { + $this->set('awards', $value); + return $this; + } + + public function hasAwards(): bool + { + return $this->has('awards'); + } + + public function unsetAwards(): self + { + $this->remove('awards'); + return $this; + } + + /** + * @return Endorsement[] + */ + public function getEndorsements() + { + return $this->get('endorsements'); + } + + /** + * @param Endorsement[] $value + */ + public function setEndorsements($value): self + { + $this->set('endorsements', $value); + return $this; + } + + public function hasEndorsements(): bool + { + return $this->has('endorsements'); + } + + public function unsetEndorsements(): self + { + $this->remove('endorsements'); + return $this; + } + + /** + * @return BookReview[] + */ + public function getBookReviews() + { + return $this->get('bookReviews'); + } + + /** + * @param BookReview[] $value + */ + public function setBookReviews($value): self + { + $this->set('bookReviews', $value); + return $this; + } + + public function hasBookReviews(): bool + { + return $this->has('bookReviews'); + } + + public function unsetBookReviews(): self + { + $this->remove('bookReviews'); + return $this; + } + + /** + * @return WorkFeaturedVideo|null + */ + public function getFeaturedVideo() + { + return $this->get('featuredVideo'); + } + + /** + * @param WorkFeaturedVideo|null $value + */ + public function setFeaturedVideo($value): self + { + $this->set('featuredVideo', $value); + return $this; + } + + public function hasFeaturedVideo(): bool + { + return $this->has('featuredVideo'); + } + + public function unsetFeaturedVideo(): self + { + $this->remove('featuredVideo'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('Work', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => 'Thoth ID of the work', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workType', + 'description' => 'Type of the work', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkType', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workStatus', + 'description' => 'Publication status of the work', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'WorkStatus', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'fullTitle', + 'description' => 'Concatenation of title and subtitle with punctuation mark', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => true, + 'deprecationReason' => 'Please use Work `titles` field instead to get the correct full title in a multilingual manner', + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'title', + 'description' => 'Main title of the work (excluding subtitle)', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => true, + 'deprecationReason' => 'Please use Work `titles` field instead to get the correct title in a multilingual manner', + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'subtitle', + 'description' => 'Secondary title of the work (excluding main title)', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => true, + 'deprecationReason' => 'Please use Work `titles` field instead to get the correct sub_title in a multilingual manner', + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'shortAbstract', + 'description' => 'Short abstract of the work. Where a work has two different versions of the abstract, the truncated version should be entered here. Otherwise, it can be left blank. This field is not output in metadata formats; where relevant, Long Abstract is used instead.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => true, + 'deprecationReason' => 'Please use Work `abstracts` field instead to get the correct short abstract in a multilingual manner', + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'longAbstract', + 'description' => 'Abstract of the work. Where a work has only one abstract, it should be entered here, and Short Abstract can be left blank. Long Abstract is output in metadata formats, and Short Abstract is not.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => true, + 'deprecationReason' => 'Please use Work `abstracts` field instead to get the correct long abstract in a multilingual manner', + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'titles', + 'description' => 'Query titles by work ID', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on title_, subtitle, full_title fields', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'TitleOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "CANONICAL", direction: "DESC"}', + ], + [ + 'name' => 'localeCodes', + 'description' => 'If set, only shows results with these locale codes', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocaleCode', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'markupFormat', + 'description' => 'If set, only shows results with this markup format', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => '"JATS_XML"', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Title', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'abstracts', + 'description' => 'Query abstracts by work ID', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on title_, subtitle, full_title fields', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'AbstractOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "CANONICAL", direction: "DESC"}', + ], + [ + 'name' => 'localeCodes', + 'description' => 'If set, only shows results with these locale codes', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LocaleCode', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'markupFormat', + 'description' => 'If set, only shows results with this markup format', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => '"JATS_XML"', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Abstract', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'reference', + 'description' => 'Internal reference code', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'edition', + 'description' => 'Edition number of the work (not applicable to chapters)', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'imprintId', + 'description' => 'Thoth ID of the work\'s imprint', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'doi', + 'description' => 'Digital Object Identifier of the work as full URL, using the HTTPS scheme and the doi.org domain (e.g. https://doi.org/10.11647/obp.0001)', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publicationDate', + 'description' => 'Date the work was published', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Date', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'withdrawnDate', + 'description' => 'Date the work was withdrawn from publication. Only applies to out of print and withdrawn works.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Date', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'place', + 'description' => 'Place of publication of the work', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'pageCount', + 'description' => 'Total number of pages in the work. In most cases, unnumbered pages (e.g. endpapers) should be omitted from this count.', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'pageBreakdown', + 'description' => 'Breakdown of work\'s page count into front matter, main content, and/or back matter (e.g. \'xi + 140\')', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'imageCount', + 'description' => 'Total number of images in the work', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'tableCount', + 'description' => 'Total number of tables in the work', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'audioCount', + 'description' => 'Total number of audio fragments in the work', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'videoCount', + 'description' => 'Total number of video fragments in the work', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'license', + 'description' => 'URL of the license which applies to this work (frequently a Creative Commons license for open-access works)', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'copyrightHolder', + 'description' => 'Copyright holder of the work', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'landingPage', + 'description' => 'URL of the web page of the work', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'lccn', + 'description' => 'Library of Congress Control Number of the work (not applicable to chapters)', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'oclc', + 'description' => 'OCLC (WorldCat) Control Number of the work (not applicable to chapters)', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'generalNote', + 'description' => 'A general-purpose field used to include information that does not have a specific designated field', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'bibliographyNote', + 'description' => 'Indicates that the work contains a bibliography or other similar information', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'toc', + 'description' => 'Table of contents of the work (not applicable to chapters)', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'resourcesDescription', + 'description' => 'Description of additional resources linked to this work', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'Markup format used for rendering resources description', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => '"JATS_XML"', + ], + ], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'coverUrl', + 'description' => 'URL of the work\'s cover image', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'coverCaption', + 'description' => 'Caption describing the work\'s cover image', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the work record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the work record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'firstPage', + 'description' => 'Page number on which the work begins (only applicable to chapters)', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'lastPage', + 'description' => 'Page number on which the work ends (only applicable to chapters)', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'pageInterval', + 'description' => 'Concatenation of first page and last page with dash (only applicable to chapters)', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAtWithRelations', + 'description' => 'Date and time at which the work record or any of its linked records was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'imprint', + 'description' => 'Get this work\'s imprint', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Imprint', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'contributions', + 'description' => 'Get contributions linked to this work', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'ContributionOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "CONTRIBUTION_TYPE", direction: "ASC"}', + ], + [ + 'name' => 'contributionTypes', + 'description' => 'Specific types to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'ContributionType', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Contribution', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'languages', + 'description' => 'Get languages linked to this work', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'LanguageOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "LANGUAGE_CODE", direction: "ASC"}', + ], + [ + 'name' => 'languageCodes', + 'description' => 'Specific languages to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LanguageCode', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + [ + 'name' => 'languageRelation', + 'description' => '(deprecated) A specific relation to filter by', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'LanguageRelation', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + [ + 'name' => 'languageRelations', + 'description' => 'Specific relations to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'LanguageRelation', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Language', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'publications', + 'description' => 'Get publications linked to this work', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on isbn', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'PublicationOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "PUBLICATION_TYPE", direction: "ASC"}', + ], + [ + 'name' => 'publicationTypes', + 'description' => 'Specific types to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'PublicationType', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Publication', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'subjects', + 'description' => 'Get subjects linked to this work', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on subject_code', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'SubjectOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "SUBJECT_TYPE", direction: "ASC"}', + ], + [ + 'name' => 'subjectTypes', + 'description' => 'Specific types to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'SubjectType', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Subject', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'fundings', + 'description' => 'Get fundings linked to this work', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'FundingOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "PROGRAM", direction: "ASC"}', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Funding', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'issues', + 'description' => 'Get issues linked to this work', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'IssueOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "ISSUE_ORDINAL", direction: "ASC"}', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Issue', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'relations', + 'description' => 'Get other works related to this work', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'WorkRelationOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "RELATION_TYPE", direction: "ASC"}', + ], + [ + 'name' => 'relationTypes', + 'description' => 'Specific types to filter by', + 'type' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'RelationType', + 'ofType' => null, + ], + ], + ], + 'defaultValue' => '[]', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'WorkRelation', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'frontcover', + 'description' => 'Get the front cover file for this work', + 'args' => [], + 'type' => [ + 'kind' => 'OBJECT', + 'name' => 'File', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'references', + 'description' => 'Get references cited by this work', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '100', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'filter', + 'description' => 'A query string to search. This argument is a test, do not rely on it. At present it simply searches for case insensitive literals on doi, unstructured_citation, issn, isbn, journal_title, article_title, series_title, volume_title, author, standard_designator, standards_body_name, and standards_body_acronym', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'defaultValue' => '""', + ], + [ + 'name' => 'order', + 'description' => 'The order in which to sort the results', + 'type' => [ + 'kind' => 'INPUT_OBJECT', + 'name' => 'ReferenceOrderBy', + 'ofType' => null, + ], + 'defaultValue' => '{field: "REFERENCE_ORDINAL", direction: "ASC"}', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Reference', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'additionalResources', + 'description' => 'Get additional resources linked to this work', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '50', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + [ + 'name' => 'markupFormat', + 'description' => 'Markup format used for rendering textual fields', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => '"JATS_XML"', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'WorkResource', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'awards', + 'description' => 'Get awards linked to this work', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '50', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Award', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'endorsements', + 'description' => 'Get endorsements linked to this work', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '50', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Endorsement', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'bookReviews', + 'description' => 'Get book reviews linked to this work', + 'args' => [ + [ + 'name' => 'limit', + 'description' => 'The number of items to return', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '50', + ], + [ + 'name' => 'offset', + 'description' => 'The number of items to skip', + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + 'defaultValue' => '0', + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'LIST', + 'name' => null, + 'ofType' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'BookReview', + 'ofType' => null, + ], + ], + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'featuredVideo', + 'description' => 'Get the featured video linked to this work', + 'args' => [], + 'type' => [ + 'kind' => 'OBJECT', + 'name' => 'WorkFeaturedVideo', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/WorkFeaturedVideo.php b/src/GraphQL/Schemas/WorkFeaturedVideo.php new file mode 100644 index 0000000..8708a2f --- /dev/null +++ b/src/GraphQL/Schemas/WorkFeaturedVideo.php @@ -0,0 +1,447 @@ +get('workFeaturedVideoId'); + } + + /** + * @param string $value + */ + public function setWorkFeaturedVideoId($value): self + { + $this->set('workFeaturedVideoId', $value); + return $this; + } + + public function hasWorkFeaturedVideoId(): bool + { + return $this->has('workFeaturedVideoId'); + } + + public function unsetWorkFeaturedVideoId(): self + { + $this->remove('workFeaturedVideoId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getTitle() + { + return $this->get('title'); + } + + /** + * @param string $value + */ + public function setTitle($value): self + { + $this->set('title', $value); + return $this; + } + + public function hasTitle(): bool + { + return $this->has('title'); + } + + public function unsetTitle(): self + { + $this->remove('title'); + return $this; + } + + /** + * @return string|null + */ + public function getUrl() + { + return $this->get('url'); + } + + /** + * @param string|null $value + */ + public function setUrl($value): self + { + $this->set('url', $value); + return $this; + } + + public function hasUrl(): bool + { + return $this->has('url'); + } + + public function unsetUrl(): self + { + $this->remove('url'); + return $this; + } + + /** + * @return int + */ + public function getWidth() + { + return $this->get('width'); + } + + /** + * @param int $value + */ + public function setWidth($value): self + { + $this->set('width', $value); + return $this; + } + + public function hasWidth(): bool + { + return $this->has('width'); + } + + public function unsetWidth(): self + { + $this->remove('width'); + return $this; + } + + /** + * @return int + */ + public function getHeight() + { + return $this->get('height'); + } + + /** + * @param int $value + */ + public function setHeight($value): self + { + $this->set('height', $value); + return $this; + } + + public function hasHeight(): bool + { + return $this->has('height'); + } + + public function unsetHeight(): self + { + $this->remove('height'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Work + */ + public function getWork() + { + return $this->get('work'); + } + + /** + * @param Work $value + */ + public function setWork($value): self + { + $this->set('work', $value); + return $this; + } + + public function hasWork(): bool + { + return $this->has('work'); + } + + public function unsetWork(): self + { + $this->remove('work'); + return $this; + } + + /** + * @return File|null + */ + public function getFile() + { + return $this->get('file'); + } + + /** + * @param File|null $value + */ + public function setFile($value): self + { + $this->set('file', $value); + return $this; + } + + public function hasFile(): bool + { + return $this->has('file'); + } + + public function unsetFile(): self + { + $this->remove('file'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('WorkFeaturedVideo', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workFeaturedVideoId', + 'description' => 'Thoth ID of the featured video', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => 'Thoth ID of the work to which this featured video belongs', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'title', + 'description' => 'Title or caption of the featured video', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'url', + 'description' => 'CDN URL of the featured video', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'width', + 'description' => 'Rendered width of the featured video embed', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'height', + 'description' => 'Rendered height of the featured video embed', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the featured video record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the featured video record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'work', + 'description' => 'Get the work linked to this featured video', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'file', + 'description' => 'Get the hosted file linked to this featured video', + 'args' => [], + 'type' => [ + 'kind' => 'OBJECT', + 'name' => 'File', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/WorkRelation.php b/src/GraphQL/Schemas/WorkRelation.php new file mode 100644 index 0000000..8f32dad --- /dev/null +++ b/src/GraphQL/Schemas/WorkRelation.php @@ -0,0 +1,367 @@ +get('workRelationId'); + } + + /** + * @param string $value + */ + public function setWorkRelationId($value): self + { + $this->set('workRelationId', $value); + return $this; + } + + public function hasWorkRelationId(): bool + { + return $this->has('workRelationId'); + } + + public function unsetWorkRelationId(): self + { + $this->remove('workRelationId'); + return $this; + } + + /** + * @return string + */ + public function getRelatorWorkId() + { + return $this->get('relatorWorkId'); + } + + /** + * @param string $value + */ + public function setRelatorWorkId($value): self + { + $this->set('relatorWorkId', $value); + return $this; + } + + public function hasRelatorWorkId(): bool + { + return $this->has('relatorWorkId'); + } + + public function unsetRelatorWorkId(): self + { + $this->remove('relatorWorkId'); + return $this; + } + + /** + * @return string + */ + public function getRelatedWorkId() + { + return $this->get('relatedWorkId'); + } + + /** + * @param string $value + */ + public function setRelatedWorkId($value): self + { + $this->set('relatedWorkId', $value); + return $this; + } + + public function hasRelatedWorkId(): bool + { + return $this->has('relatedWorkId'); + } + + public function unsetRelatedWorkId(): self + { + $this->remove('relatedWorkId'); + return $this; + } + + /** + * @return string + */ + public function getRelationType() + { + return $this->get('relationType'); + } + + /** + * @param string $value + */ + public function setRelationType($value): self + { + $this->set('relationType', $value); + return $this; + } + + public function hasRelationType(): bool + { + return $this->has('relationType'); + } + + public function unsetRelationType(): self + { + $this->remove('relationType'); + return $this; + } + + /** + * @return int + */ + public function getRelationOrdinal() + { + return $this->get('relationOrdinal'); + } + + /** + * @param int $value + */ + public function setRelationOrdinal($value): self + { + $this->set('relationOrdinal', $value); + return $this; + } + + public function hasRelationOrdinal(): bool + { + return $this->has('relationOrdinal'); + } + + public function unsetRelationOrdinal(): self + { + $this->remove('relationOrdinal'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Work + */ + public function getRelatedWork() + { + return $this->get('relatedWork'); + } + + /** + * @param Work $value + */ + public function setRelatedWork($value): self + { + $this->set('relatedWork', $value); + return $this; + } + + public function hasRelatedWork(): bool + { + return $this->has('relatedWork'); + } + + public function unsetRelatedWork(): self + { + $this->remove('relatedWork'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('WorkRelation', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workRelationId', + 'description' => 'Thoth ID of the work relation', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'relatorWorkId', + 'description' => 'Thoth ID of the work to which this work relation belongs', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'relatedWorkId', + 'description' => 'Thoth ID of the other work in the relationship', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'relationType', + 'description' => 'Nature of the relationship', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'ENUM', + 'name' => 'RelationType', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'relationOrdinal', + 'description' => 'Number representing this work relation\'s position in an ordered list of relations of the same type within the work', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the work relation record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the work relation record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'relatedWork', + 'description' => 'Get the other work in the relationship', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/Schemas/WorkResource.php b/src/GraphQL/Schemas/WorkResource.php new file mode 100644 index 0000000..bf3fa59 --- /dev/null +++ b/src/GraphQL/Schemas/WorkResource.php @@ -0,0 +1,669 @@ +get('workResourceId'); + } + + /** + * @param string $value + */ + public function setWorkResourceId($value): self + { + $this->set('workResourceId', $value); + return $this; + } + + public function hasWorkResourceId(): bool + { + return $this->has('workResourceId'); + } + + public function unsetWorkResourceId(): self + { + $this->remove('workResourceId'); + return $this; + } + + /** + * @return string + */ + public function getWorkId() + { + return $this->get('workId'); + } + + /** + * @param string $value + */ + public function setWorkId($value): self + { + $this->set('workId', $value); + return $this; + } + + public function hasWorkId(): bool + { + return $this->has('workId'); + } + + public function unsetWorkId(): self + { + $this->remove('workId'); + return $this; + } + + /** + * @return string + */ + public function getTitle() + { + return $this->get('title'); + } + + /** + * @param string $value + */ + public function setTitle($value): self + { + $this->set('title', $value); + return $this; + } + + public function hasTitle(): bool + { + return $this->has('title'); + } + + public function unsetTitle(): self + { + $this->remove('title'); + return $this; + } + + /** + * @return string|null + */ + public function getDescription() + { + return $this->get('description'); + } + + /** + * @param string|null $value + */ + public function setDescription($value): self + { + $this->set('description', $value); + return $this; + } + + public function hasDescription(): bool + { + return $this->has('description'); + } + + public function unsetDescription(): self + { + $this->remove('description'); + return $this; + } + + /** + * @return string|null + */ + public function getAttribution() + { + return $this->get('attribution'); + } + + /** + * @param string|null $value + */ + public function setAttribution($value): self + { + $this->set('attribution', $value); + return $this; + } + + public function hasAttribution(): bool + { + return $this->has('attribution'); + } + + public function unsetAttribution(): self + { + $this->remove('attribution'); + return $this; + } + + /** + * @return string + */ + public function getResourceType() + { + return $this->get('resourceType'); + } + + /** + * @param string $value + */ + public function setResourceType($value): self + { + $this->set('resourceType', $value); + return $this; + } + + public function hasResourceType(): bool + { + return $this->has('resourceType'); + } + + public function unsetResourceType(): self + { + $this->remove('resourceType'); + return $this; + } + + /** + * @return string|null + */ + public function getDoi() + { + return $this->get('doi'); + } + + /** + * @param string|null $value + */ + public function setDoi($value): self + { + $this->set('doi', $value); + return $this; + } + + public function hasDoi(): bool + { + return $this->has('doi'); + } + + public function unsetDoi(): self + { + $this->remove('doi'); + return $this; + } + + /** + * @return string|null + */ + public function getHandle() + { + return $this->get('handle'); + } + + /** + * @param string|null $value + */ + public function setHandle($value): self + { + $this->set('handle', $value); + return $this; + } + + public function hasHandle(): bool + { + return $this->has('handle'); + } + + public function unsetHandle(): self + { + $this->remove('handle'); + return $this; + } + + /** + * @return string|null + */ + public function getUrl() + { + return $this->get('url'); + } + + /** + * @param string|null $value + */ + public function setUrl($value): self + { + $this->set('url', $value); + return $this; + } + + public function hasUrl(): bool + { + return $this->has('url'); + } + + public function unsetUrl(): self + { + $this->remove('url'); + return $this; + } + + /** + * @return string|null + */ + public function getDate() + { + return $this->get('date'); + } + + /** + * @param string|null $value + */ + public function setDate($value): self + { + $this->set('date', $value); + return $this; + } + + public function hasDate(): bool + { + return $this->has('date'); + } + + public function unsetDate(): self + { + $this->remove('date'); + return $this; + } + + /** + * @return int + */ + public function getResourceOrdinal() + { + return $this->get('resourceOrdinal'); + } + + /** + * @param int $value + */ + public function setResourceOrdinal($value): self + { + $this->set('resourceOrdinal', $value); + return $this; + } + + public function hasResourceOrdinal(): bool + { + return $this->has('resourceOrdinal'); + } + + public function unsetResourceOrdinal(): self + { + $this->remove('resourceOrdinal'); + return $this; + } + + /** + * @return string + */ + public function getCreatedAt() + { + return $this->get('createdAt'); + } + + /** + * @param string $value + */ + public function setCreatedAt($value): self + { + $this->set('createdAt', $value); + return $this; + } + + public function hasCreatedAt(): bool + { + return $this->has('createdAt'); + } + + public function unsetCreatedAt(): self + { + $this->remove('createdAt'); + return $this; + } + + /** + * @return string + */ + public function getUpdatedAt() + { + return $this->get('updatedAt'); + } + + /** + * @param string $value + */ + public function setUpdatedAt($value): self + { + $this->set('updatedAt', $value); + return $this; + } + + public function hasUpdatedAt(): bool + { + return $this->has('updatedAt'); + } + + public function unsetUpdatedAt(): self + { + $this->remove('updatedAt'); + return $this; + } + + /** + * @return Work + */ + public function getWork() + { + return $this->get('work'); + } + + /** + * @param Work $value + */ + public function setWork($value): self + { + $this->set('work', $value); + return $this; + } + + public function hasWork(): bool + { + return $this->has('work'); + } + + public function unsetWork(): self + { + $this->remove('work'); + return $this; + } + + /** + * @return File|null + */ + public function getFile() + { + return $this->get('file'); + } + + /** + * @param File|null $value + */ + public function setFile($value): self + { + $this->set('file', $value); + return $this; + } + + public function hasFile(): bool + { + return $this->has('file'); + } + + public function unsetFile(): self + { + $this->remove('file'); + return $this; + } + + public static function definition(): ObjectTypeDefinition + { + return new ObjectTypeDefinition('WorkResource', [ + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workResourceId', + 'description' => 'Thoth ID of the work resource', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'workId', + 'description' => 'Thoth ID of the work to which this resource belongs', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Uuid', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'title', + 'description' => 'Title of the additional resource', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'Markup format used for rendering title', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'description', + 'description' => 'Description of the additional resource', + 'args' => [ + [ + 'name' => 'markupFormat', + 'description' => 'Markup format used for rendering description', + 'type' => [ + 'kind' => 'ENUM', + 'name' => 'MarkupFormat', + 'ofType' => null, + ], + 'defaultValue' => null, + ], + ], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'attribution', + 'description' => 'Attribution for the resource source/author', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'resourceType', + 'description' => 'Type of additional resource', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'doi', + 'description' => 'DOI of the resource as full URL, using the HTTPS scheme and the doi.org domain', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Doi', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'handle', + 'description' => 'Handle identifier of the resource', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'url', + 'description' => 'URL of the additional resource', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'String', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'date', + 'description' => 'Date associated with the additional resource', + 'args' => [], + 'type' => [ + 'kind' => 'SCALAR', + 'name' => 'Date', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'resourceOrdinal', + 'description' => 'Number representing this resource\'s position in an ordered list of resources within the work', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Int', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'createdAt', + 'description' => 'Date and time at which the resource record was created', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'updatedAt', + 'description' => 'Date and time at which the resource record was last updated', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'SCALAR', + 'name' => 'Timestamp', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'work', + 'description' => 'Get the work linked to this resource', + 'args' => [], + 'type' => [ + 'kind' => 'NON_NULL', + 'name' => null, + 'ofType' => [ + 'kind' => 'OBJECT', + 'name' => 'Work', + 'ofType' => null, + ], + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]), + \ThothApi\GraphQL\Definition\FieldDefinition::fromIntrospection([ + 'name' => 'file', + 'description' => 'Get the hosted file linked to this resource', + 'args' => [], + 'type' => [ + 'kind' => 'OBJECT', + 'name' => 'File', + 'ofType' => null, + ], + 'isDeprecated' => false, + 'deprecationReason' => null, + ]) + ]); + } +} diff --git a/src/GraphQL/ValueHydrator.php b/src/GraphQL/ValueHydrator.php new file mode 100644 index 0000000..6e893c0 --- /dev/null +++ b/src/GraphQL/ValueHydrator.php @@ -0,0 +1,45 @@ +getKind() === 'NON_NULL' && $type->getOfType() !== null) { + return $this->hydrate($value, $type->getOfType()); + } + + if ($type->getKind() === 'LIST' && $type->getOfType() !== null && is_array($value)) { + return array_map( + function ($item) use ($type) { + return $this->hydrate($item, $type->getOfType()); + }, + $value + ); + } + + if (!is_array($value)) { + return $value; + } + + $schemaClass = $this->schemaClassForType($type->baseName()); + + if (!class_exists($schemaClass)) { + return $value; + } + + return $schemaClass::fromArray($value); + } + + private function schemaClassForType(?string $typeName): string + { + return '\\ThothApi\\GraphQL\\Schemas\\' . ($typeName === 'Abstract' ? 'GraphQLAbstract' : $typeName); + } +} diff --git a/tests/Exception/QueryExceptionTest.php b/tests/Exception/QueryExceptionTest.php index 5a84925..6f911b0 100644 --- a/tests/Exception/QueryExceptionTest.php +++ b/tests/Exception/QueryExceptionTest.php @@ -23,4 +23,29 @@ public function testGetExceptionError(): void $this->assertSame($error, $queryException->getDetails()); $this->assertSame($error['message'], $queryException->getMessage()); } + + public function testGetQueryAndVariables(): void + { + $error = ['message' => 'some syntax error']; + $query = 'query { books { workId } }'; + $variables = ['limit' => 1]; + + $queryException = new QueryException($error, $query, $variables); + + $this->assertSame($query, $queryException->getQuery()); + $this->assertSame($variables, $queryException->getVariables()); + } + + public function testGetErrorsAndStatusCode(): void + { + $errors = [ + ['message' => 'first error'], + ['message' => 'second error'], + ]; + + $queryException = new QueryException($errors[0], null, null, $errors, 400); + + $this->assertSame($errors, $queryException->getErrors()); + $this->assertSame(400, $queryException->getStatusCode()); + } } diff --git a/tests/GraphQL/ClientTest.php b/tests/GraphQL/ClientTest.php index 0dd1951..b4d2b00 100644 --- a/tests/GraphQL/ClientTest.php +++ b/tests/GraphQL/ClientTest.php @@ -4,69 +4,54 @@ use GuzzleHttp\Handler\MockHandler; use GuzzleHttp\HandlerStack; +use GuzzleHttp\Middleware; use GuzzleHttp\Psr7\Response; use PHPUnit\Framework\TestCase; use ThothApi\GraphQL\Client; -use ThothApi\Tests\GraphQL\Concerns\HasClientMutationTests; -use ThothApi\Tests\GraphQL\Concerns\HasClientQueryTests; -use ThothApi\Tests\GraphQL\Concerns\HasClientSchemaSyncTests; +use ThothApi\GraphQL\Enums\Direction; +use ThothApi\GraphQL\Enums\WorkField; +use ThothApi\GraphQL\Queries\WorksQuery; final class ClientTest extends TestCase { - use HasClientMutationTests; - use HasClientQueryTests; - use HasClientSchemaSyncTests; - - private MockHandler $mockHandler; - - private Client $client; - - protected function setUp(): void + public function testExecuteSendsOperationArgumentsAsVariables(): void { - $this->mockHandler = new MockHandler(); - $handler = HandlerStack::create($this->mockHandler); - $this->client = new Client(['handler' => $handler]); - } + $mockHandler = new MockHandler(); + $container = []; + $handler = HandlerStack::create($mockHandler); + $handler->push(Middleware::history($container)); + $client = new Client(['handler' => $handler]); - public function testRunRawQuery(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ + $mockHandler->append(new Response(200, [], json_encode([ 'data' => [ - 'books' => [ - 'fullTitle' => 'My book title', - 'doi' => 'https://doi.org/10.123435/12345678', - 'publications' => [], - 'contributions' => [] - ] - ] + 'works' => [], + ], ]))); - $query = <<client->rawQuery($query, $args); - + $client->execute(WorksQuery::operation([ + 'limit' => 1, + 'order' => [ + 'field' => WorkField::PUBLICATION_DATE, + 'direction' => Direction::ASC, + ], + ], ['workId'])); + + $body = json_decode((string) $container[0]['request']->getBody(), true); + + $this->assertSame( + 'query ($limit: Int, $order: WorkOrderBy) {' . "\n" + . ' works(limit: $limit, order: $order) {' . "\n" + . ' workId' . "\n" + . ' }' . "\n" + . '}', + $body['query'] + ); $this->assertSame([ - 'books' => [ - 'fullTitle' => 'My book title', - 'doi' => 'https://doi.org/10.123435/12345678', - 'publications' => [], - 'contributions' => [] - ] - ], $result); + 'limit' => 1, + 'order' => [ + 'field' => 'PUBLICATION_DATE', + 'direction' => 'ASC', + ], + ], $body['variables']); } } diff --git a/tests/GraphQL/Concerns/HasClientMutationTests.php b/tests/GraphQL/Concerns/HasClientMutationTests.php deleted file mode 100644 index 5347bff..0000000 --- a/tests/GraphQL/Concerns/HasClientMutationTests.php +++ /dev/null @@ -1,773 +0,0 @@ -mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'createAffiliation' => [ - 'affiliationId' => 'e435b256-681c-4118-a3b5-bba22cb6fe7f' - ] - ] - ]))); - - $affiliation = new Affiliation(); - $result = $this->client->createAffiliation($affiliation); - $this->assertSame('e435b256-681c-4118-a3b5-bba22cb6fe7f', $result); - } - - public function testUpdateAffiliation(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'updateAffiliation' => [ - 'affiliationId' => 'e435b256-681c-4118-a3b5-bba22cb6fe7f' - ] - ] - ]))); - - $affiliation = new Affiliation(); - $result = $this->client->updateAffiliation($affiliation); - $this->assertSame('e435b256-681c-4118-a3b5-bba22cb6fe7f', $result); - } - - public function testDeleteAffiliation(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'deleteAffiliation' => [ - 'affiliationId' => 'e435b256-681c-4118-a3b5-bba22cb6fe7f' - ] - ] - ]))); - - $result = $this->client->deleteAffiliation('e435b256-681c-4118-a3b5-bba22cb6fe7f'); - $this->assertSame('e435b256-681c-4118-a3b5-bba22cb6fe7f', $result); - } - - public function testCreateContribution(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'createContribution' => [ - 'contributionId' => '5448ca99-ae7d-4347-9170-b8ffa067ebbf' - ] - ] - ]))); - - $contribution = new Contribution(); - $result = $this->client->createContribution($contribution); - $this->assertSame('5448ca99-ae7d-4347-9170-b8ffa067ebbf', $result); - } - - public function testUpdateContribution(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'updateContribution' => [ - 'contributionId' => '5448ca99-ae7d-4347-9170-b8ffa067ebbf' - ] - ] - ]))); - - $contribution = new Contribution(); - $result = $this->client->updateContribution($contribution); - $this->assertSame('5448ca99-ae7d-4347-9170-b8ffa067ebbf', $result); - } - - public function testDeleteContribution(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'deleteContribution' => [ - 'contributionId' => '5448ca99-ae7d-4347-9170-b8ffa067ebbf' - ] - ] - ]))); - - $result = $this->client->deleteContribution('5448ca99-ae7d-4347-9170-b8ffa067ebbf'); - $this->assertSame('5448ca99-ae7d-4347-9170-b8ffa067ebbf', $result); - } - - public function testCreateContributor(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'createContributor' => [ - 'contributorId' => '2724eca4-0d31-44ba-bbf4-19061a9637ce' - ] - ] - ]))); - - $contributor = new Contributor(); - $result = $this->client->createContributor($contributor); - $this->assertSame('2724eca4-0d31-44ba-bbf4-19061a9637ce', $result); - } - - public function testUpdateContributor(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'updateContributor' => [ - 'contributorId' => '2724eca4-0d31-44ba-bbf4-19061a9637ce' - ] - ] - ]))); - - $contributor = new Contributor(); - $result = $this->client->updateContributor($contributor); - $this->assertSame('2724eca4-0d31-44ba-bbf4-19061a9637ce', $result); - } - - public function testDeleteContributor(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'deleteContributor' => [ - 'contributorId' => '2724eca4-0d31-44ba-bbf4-19061a9637ce' - ] - ] - ]))); - - $result = $this->client->deleteContributor('2724eca4-0d31-44ba-bbf4-19061a9637ce'); - $this->assertSame('2724eca4-0d31-44ba-bbf4-19061a9637ce', $result); - } - - public function testCreateFunding(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'createFunding' => [ - 'fundingId' => 'bba5f263-3442-4a4e-8b2b-752a238b9c03' - ] - ] - ]))); - - $funding = new Funding(); - $result = $this->client->createFunding($funding); - $this->assertSame('bba5f263-3442-4a4e-8b2b-752a238b9c03', $result); - } - - public function testUpdateFunding(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'updateFunding' => [ - 'fundingId' => 'bba5f263-3442-4a4e-8b2b-752a238b9c03' - ] - ] - ]))); - - $funding = new Funding(); - $result = $this->client->updateFunding($funding); - $this->assertSame('bba5f263-3442-4a4e-8b2b-752a238b9c03', $result); - } - - public function testDeleteFunding(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'deleteFunding' => [ - 'fundingId' => 'bba5f263-3442-4a4e-8b2b-752a238b9c03' - ] - ] - ]))); - - $result = $this->client->deleteFunding('bba5f263-3442-4a4e-8b2b-752a238b9c03'); - $this->assertSame('bba5f263-3442-4a4e-8b2b-752a238b9c03', $result); - } - - public function testCreateImprint(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'createImprint' => [ - 'imprintId' => '7485750d-c8cf-4a7e-9a6c-c080b932dbd9' - ] - ] - ]))); - - $imprint = new Imprint(); - $result = $this->client->createImprint($imprint); - $this->assertSame('7485750d-c8cf-4a7e-9a6c-c080b932dbd9', $result); - } - - public function testUpdateImprint(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'updateImprint' => [ - 'imprintId' => '7485750d-c8cf-4a7e-9a6c-c080b932dbd9' - ] - ] - ]))); - - $imprint = new Imprint(); - $result = $this->client->updateImprint($imprint); - $this->assertSame('7485750d-c8cf-4a7e-9a6c-c080b932dbd9', $result); - } - - public function testDeleteImprint(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'deleteImprint' => [ - 'imprintId' => '7485750d-c8cf-4a7e-9a6c-c080b932dbd9' - ] - ] - ]))); - - $result = $this->client->deleteImprint('7485750d-c8cf-4a7e-9a6c-c080b932dbd9'); - $this->assertSame('7485750d-c8cf-4a7e-9a6c-c080b932dbd9', $result); - } - - public function testCreateInstitution(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'createInstitution' => [ - 'institutionId' => 'a71debc6-0172-4cf5-b4c4-f932915ffce3' - ] - ] - ]))); - - $institution = new Institution(); - $result = $this->client->createInstitution($institution); - $this->assertSame('a71debc6-0172-4cf5-b4c4-f932915ffce3', $result); - } - - public function testUpdateInstitution(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'updateInstitution' => [ - 'institutionId' => 'a71debc6-0172-4cf5-b4c4-f932915ffce3' - ] - ] - ]))); - - $institution = new Institution(); - $result = $this->client->updateInstitution($institution); - $this->assertSame('a71debc6-0172-4cf5-b4c4-f932915ffce3', $result); - } - - public function testDeleteInstitution(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'deleteInstitution' => [ - 'institutionId' => 'a71debc6-0172-4cf5-b4c4-f932915ffce3' - ] - ] - ]))); - - $result = $this->client->deleteInstitution('a71debc6-0172-4cf5-b4c4-f932915ffce3'); - $this->assertSame('a71debc6-0172-4cf5-b4c4-f932915ffce3', $result); - } - - public function testCreateIssue(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'createIssue' => [ - 'issueId' => 'df439ff0-a8ed-4972-aada-956fb0bb27ce' - ] - ] - ]))); - - $issue = new Issue(); - $result = $this->client->createIssue($issue); - $this->assertSame('df439ff0-a8ed-4972-aada-956fb0bb27ce', $result); - } - - public function testUpdateIssue(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'updateIssue' => [ - 'issueId' => 'df439ff0-a8ed-4972-aada-956fb0bb27ce' - ] - ] - ]))); - - $issue = new Issue(); - $result = $this->client->updateIssue($issue); - $this->assertSame('df439ff0-a8ed-4972-aada-956fb0bb27ce', $result); - } - - public function testDeleteIssue(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'deleteIssue' => [ - 'issueId' => 'df439ff0-a8ed-4972-aada-956fb0bb27ce' - ] - ] - ]))); - - $result = $this->client->deleteIssue('df439ff0-a8ed-4972-aada-956fb0bb27ce'); - $this->assertSame('df439ff0-a8ed-4972-aada-956fb0bb27ce', $result); - } - - public function testCreateLanguage(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'createLanguage' => [ - 'languageId' => '1584d8e2-b856-4519-a507-c2399af11af5' - ] - ] - ]))); - - $language = new Language(); - $result = $this->client->createLanguage($language); - $this->assertSame('1584d8e2-b856-4519-a507-c2399af11af5', $result); - } - - public function testUpdateLanguage(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'updateLanguage' => [ - 'languageId' => '1584d8e2-b856-4519-a507-c2399af11af5' - ] - ] - ]))); - - $language = new Language(); - $result = $this->client->updateLanguage($language); - $this->assertSame('1584d8e2-b856-4519-a507-c2399af11af5', $result); - } - - public function testDeleteLanguage(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'deleteLanguage' => [ - 'languageId' => '1584d8e2-b856-4519-a507-c2399af11af5' - ] - ] - ]))); - - $result = $this->client->deleteLanguage('1584d8e2-b856-4519-a507-c2399af11af5'); - $this->assertSame('1584d8e2-b856-4519-a507-c2399af11af5', $result); - } - - public function testCreateLocation(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'createLocation' => [ - 'locationId' => 'c45e9a4a-80e1-46c2-8845-61bf4263255e' - ] - ] - ]))); - - $location = new Location(); - $result = $this->client->createLocation($location); - $this->assertSame('c45e9a4a-80e1-46c2-8845-61bf4263255e', $result); - } - - public function testUpdateLocation(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'updateLocation' => [ - 'locationId' => 'c45e9a4a-80e1-46c2-8845-61bf4263255e' - ] - ] - ]))); - - $location = new Location(); - $result = $this->client->updateLocation($location); - $this->assertSame('c45e9a4a-80e1-46c2-8845-61bf4263255e', $result); - } - - public function testDeleteLocation(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'deleteLocation' => [ - 'locationId' => 'c45e9a4a-80e1-46c2-8845-61bf4263255e' - ] - ] - ]))); - - $result = $this->client->deleteLocation('c45e9a4a-80e1-46c2-8845-61bf4263255e'); - $this->assertSame('c45e9a4a-80e1-46c2-8845-61bf4263255e', $result); - } - - public function testCreatePrice(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'createPrice' => [ - 'priceId' => '38e96434-88a3-4f1c-9c39-b9160000c61a' - ] - ] - ]))); - - $price = new Price(); - $result = $this->client->createPrice($price); - $this->assertSame('38e96434-88a3-4f1c-9c39-b9160000c61a', $result); - } - - public function testUpdatePrice(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'updatePrice' => [ - 'priceId' => '38e96434-88a3-4f1c-9c39-b9160000c61a' - ] - ] - ]))); - - $price = new Price(); - $result = $this->client->updatePrice($price); - $this->assertSame('38e96434-88a3-4f1c-9c39-b9160000c61a', $result); - } - - public function testDeletePrice(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'deletePrice' => [ - 'priceId' => '38e96434-88a3-4f1c-9c39-b9160000c61a' - ] - ] - ]))); - - $result = $this->client->deletePrice('38e96434-88a3-4f1c-9c39-b9160000c61a'); - $this->assertSame('38e96434-88a3-4f1c-9c39-b9160000c61a', $result); - } - - public function testCreatePublication(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'createPublication' => [ - 'publicationId' => '01fec4e9-fbff-4c2e-9752-a0562a506e4d' - ] - ] - ]))); - - $publication = new Publication(); - $result = $this->client->createPublication($publication); - $this->assertSame('01fec4e9-fbff-4c2e-9752-a0562a506e4d', $result); - } - - public function testUpdatePublication(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'updatePublication' => [ - 'publicationId' => '01fec4e9-fbff-4c2e-9752-a0562a506e4d' - ] - ] - ]))); - - $publication = new Publication(); - $result = $this->client->updatePublication($publication); - $this->assertSame('01fec4e9-fbff-4c2e-9752-a0562a506e4d', $result); - } - - public function testDeletePublication(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'deletePublication' => [ - 'publicationId' => '01fec4e9-fbff-4c2e-9752-a0562a506e4d' - ] - ] - ]))); - - $result = $this->client->deletePublication('01fec4e9-fbff-4c2e-9752-a0562a506e4d'); - $this->assertSame('01fec4e9-fbff-4c2e-9752-a0562a506e4d', $result); - } - - public function testCreatePublisher(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'createPublisher' => [ - 'publisherId' => 'a77ef552-856c-4585-9d35-fd58d2190b1b' - ] - ] - ]))); - - $publisher = new Publisher(); - $result = $this->client->createPublisher($publisher); - $this->assertSame('a77ef552-856c-4585-9d35-fd58d2190b1b', $result); - } - - public function testUpdatePublisher(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'updatePublisher' => [ - 'publisherId' => 'a77ef552-856c-4585-9d35-fd58d2190b1b' - ] - ] - ]))); - - $publisher = new Publisher(); - $result = $this->client->updatePublisher($publisher); - $this->assertSame('a77ef552-856c-4585-9d35-fd58d2190b1b', $result); - } - - public function testDeletePublisher(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'deletePublisher' => [ - 'publisherId' => 'a77ef552-856c-4585-9d35-fd58d2190b1b' - ] - ] - ]))); - - $result = $this->client->deletePublisher('a77ef552-856c-4585-9d35-fd58d2190b1b'); - $this->assertSame('a77ef552-856c-4585-9d35-fd58d2190b1b', $result); - } - - public function testCreateReference(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'createReference' => [ - 'referenceId' => '6b4060ff-a89b-4bdc-b722-2b87ef9d057a' - ] - ] - ]))); - - $reference = new Reference(); - $result = $this->client->createReference($reference); - $this->assertSame('6b4060ff-a89b-4bdc-b722-2b87ef9d057a', $result); - } - - public function testUpdateReference(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'updateReference' => [ - 'referenceId' => '6b4060ff-a89b-4bdc-b722-2b87ef9d057a' - ] - ] - ]))); - - $reference = new Reference(); - $result = $this->client->updateReference($reference); - $this->assertSame('6b4060ff-a89b-4bdc-b722-2b87ef9d057a', $result); - } - - public function testDeleteReference(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'deleteReference' => [ - 'referenceId' => '6b4060ff-a89b-4bdc-b722-2b87ef9d057a' - ] - ] - ]))); - - $result = $this->client->deleteReference('6b4060ff-a89b-4bdc-b722-2b87ef9d057a'); - $this->assertSame('6b4060ff-a89b-4bdc-b722-2b87ef9d057a', $result); - } - - public function testCreateSeries(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'createSeries' => [ - 'seriesId' => 'dc4ed0f7-89a4-4760-aad3-adec7294706d' - ] - ] - ]))); - - $series = new Series(); - $result = $this->client->createSeries($series); - $this->assertSame('dc4ed0f7-89a4-4760-aad3-adec7294706d', $result); - } - - public function testUpdateSeries(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'updateSeries' => [ - 'seriesId' => 'dc4ed0f7-89a4-4760-aad3-adec7294706d' - ] - ] - ]))); - - $series = new Series(); - $result = $this->client->updateSeries($series); - $this->assertSame('dc4ed0f7-89a4-4760-aad3-adec7294706d', $result); - } - - public function testDeleteSeries(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'deleteSeries' => [ - 'seriesId' => 'dc4ed0f7-89a4-4760-aad3-adec7294706d' - ] - ] - ]))); - - $result = $this->client->deleteSeries('dc4ed0f7-89a4-4760-aad3-adec7294706d'); - $this->assertSame('dc4ed0f7-89a4-4760-aad3-adec7294706d', $result); - } - - public function testCreateSubject(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'createSubject' => [ - 'subjectId' => 'e7ab386e-186a-4b1c-aa6f-e974b8a1e3cd' - ] - ] - ]))); - - $subject = new Subject(); - $result = $this->client->createSubject($subject); - $this->assertSame('e7ab386e-186a-4b1c-aa6f-e974b8a1e3cd', $result); - } - - public function testUpdateSubject(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'updateSubject' => [ - 'subjectId' => 'e7ab386e-186a-4b1c-aa6f-e974b8a1e3cd' - ] - ] - ]))); - - $subject = new Subject(); - $result = $this->client->updateSubject($subject); - $this->assertSame('e7ab386e-186a-4b1c-aa6f-e974b8a1e3cd', $result); - } - - public function testDeleteSubject(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'deleteSubject' => [ - 'subjectId' => 'e7ab386e-186a-4b1c-aa6f-e974b8a1e3cd' - ] - ] - ]))); - - $result = $this->client->deleteSubject('e7ab386e-186a-4b1c-aa6f-e974b8a1e3cd'); - $this->assertSame('e7ab386e-186a-4b1c-aa6f-e974b8a1e3cd', $result); - } - - public function testCreateWork(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'createWork' => [ - 'workId' => 'd81bab71-d9fe-456b-9951-2308b91db2b4' - ] - ] - ]))); - - $work = new Work(); - $result = $this->client->createWork($work); - $this->assertSame('d81bab71-d9fe-456b-9951-2308b91db2b4', $result); - } - - public function testUpdateWork(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'updateWork' => [ - 'workId' => 'd81bab71-d9fe-456b-9951-2308b91db2b4' - ] - ] - ]))); - - $work = new Work(); - $result = $this->client->updateWork($work); - $this->assertSame('d81bab71-d9fe-456b-9951-2308b91db2b4', $result); - } - - public function testDeleteWork(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'deleteWork' => [ - 'workId' => 'd81bab71-d9fe-456b-9951-2308b91db2b4' - ] - ] - ]))); - - $result = $this->client->deleteWork('d81bab71-d9fe-456b-9951-2308b91db2b4'); - $this->assertSame('d81bab71-d9fe-456b-9951-2308b91db2b4', $result); - } - - public function testCreateWorkRelation(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'createWorkRelation' => [ - 'workRelationId' => '64019725-3e50-41de-a785-e4e5ddc4620a' - ] - ] - ]))); - - $workRelation = new WorkRelation(); - $result = $this->client->createWorkRelation($workRelation); - $this->assertSame('64019725-3e50-41de-a785-e4e5ddc4620a', $result); - } - - public function testUpdateWorkRelation(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'updateWorkRelation' => [ - 'workRelationId' => '64019725-3e50-41de-a785-e4e5ddc4620a' - ] - ] - ]))); - - $workRelation = new WorkRelation(); - $result = $this->client->updateWorkRelation($workRelation); - $this->assertSame('64019725-3e50-41de-a785-e4e5ddc4620a', $result); - } - - public function testDeleteWorkRelation(): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'deleteWorkRelation' => [ - 'workRelationId' => '64019725-3e50-41de-a785-e4e5ddc4620a' - ] - ] - ]))); - - $result = $this->client->deleteWorkRelation('64019725-3e50-41de-a785-e4e5ddc4620a'); - $this->assertSame('64019725-3e50-41de-a785-e4e5ddc4620a', $result); - } -} diff --git a/tests/GraphQL/Concerns/HasClientQueryTests.php b/tests/GraphQL/Concerns/HasClientQueryTests.php deleted file mode 100644 index a46b674..0000000 --- a/tests/GraphQL/Concerns/HasClientQueryTests.php +++ /dev/null @@ -1,1024 +0,0 @@ - '9afc6760-f556-46a1-a912-39ea5ebc921b']); - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'affiliation' => [ - 'affiliationId' => '9afc6760-f556-46a1-a912-39ea5ebc921b' - ] - ] - ]))); - - $result = $this->client->affiliation('9afc6760-f556-46a1-a912-39ea5ebc921b'); - $this->assertEquals($affiliation, $result); - } - - public function testAffiliations(): void - { - $affiliations = [ - new Affiliation(['affiliationId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2']), - new Affiliation(['affiliationId' => '0472b0af-acf6-4f27-bee3-d3414466ccec']), - ]; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'affiliations' => [ - [ - 'affiliationId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2' - ], - [ - 'affiliationId' => '0472b0af-acf6-4f27-bee3-d3414466ccec' - ] - ] - ] - ]))); - - $result = $this->client->affiliations(); - $this->assertEquals($affiliations, $result); - } - - public function testAffiliationCount(): void - { - $expectedCount = 710; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'affiliationCount' => 710 - ] - ]))); - - $result = $this->client->affiliationCount(); - $this->assertSame($expectedCount, $result); - } - - public function testContribution(): void - { - $contribution = new Contribution(['contributionId' => '9afc6760-f556-46a1-a912-39ea5ebc921b']); - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'contribution' => [ - 'contributionId' => '9afc6760-f556-46a1-a912-39ea5ebc921b' - ] - ] - ]))); - - $result = $this->client->contribution('9afc6760-f556-46a1-a912-39ea5ebc921b'); - $this->assertEquals($contribution, $result); - } - - public function testBooks(): void - { - $books = [ - new Work(['workId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2']), - new Work(['workId' => '0472b0af-acf6-4f27-bee3-d3414466ccec']), - ]; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'books' => [ - [ - 'workId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2' - ], - [ - 'workId' => '0472b0af-acf6-4f27-bee3-d3414466ccec' - ] - ] - ] - ]))); - - $result = $this->client->books(); - $this->assertEquals($books, $result); - } - - public function testBookByDoi(): void - { - $book = new Work([ - 'workId' => '9afc6760-f556-46a1-a912-39ea5ebc921b', - 'doi' => 'https://doi.org/10.00000/00000000' - ]); - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'bookByDoi' => [ - 'workId' => '9afc6760-f556-46a1-a912-39ea5ebc921b', - 'doi' => 'https://doi.org/10.00000/00000000' - ] - ] - ]))); - - $result = $this->client->bookByDoi('https://doi.org/10.00000/00000000'); - $this->assertEquals($book, $result); - } - - public function testBookCount(): void - { - $expectedCount = 710; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'bookCount' => 710 - ] - ]))); - - $result = $this->client->bookCount(); - $this->assertSame($expectedCount, $result); - } - - public function testChapters(): void - { - $chapters = [ - new Work(['workId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2']), - new Work(['workId' => '0472b0af-acf6-4f27-bee3-d3414466ccec']), - ]; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'chapters' => [ - [ - 'workId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2' - ], - [ - 'workId' => '0472b0af-acf6-4f27-bee3-d3414466ccec' - ] - ] - ] - ]))); - - $result = $this->client->chapters(); - $this->assertEquals($chapters, $result); - } - - public function testChapterByDoi(): void - { - $chapter = new Work([ - 'workId' => '9afc6760-f556-46a1-a912-39ea5ebc921b', - 'doi' => 'https://doi.org/10.00000/00000000' - ]); - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'chapterByDoi' => [ - 'workId' => '9afc6760-f556-46a1-a912-39ea5ebc921b', - 'doi' => 'https://doi.org/10.00000/00000000' - ] - ] - ]))); - - $result = $this->client->chapterByDoi('https://doi.org/10.00000/00000000'); - $this->assertEquals($chapter, $result); - } - - public function testChapterCount(): void - { - $expectedCount = 710; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'chapterCount' => 710 - ] - ]))); - - $result = $this->client->chapterCount(); - $this->assertSame($expectedCount, $result); - } - - public function testContributions(): void - { - $contributions = [ - new Contribution(['contributionId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2']), - new Contribution(['contributionId' => '0472b0af-acf6-4f27-bee3-d3414466ccec']), - ]; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'contributions' => [ - [ - 'contributionId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2' - ], - [ - 'contributionId' => '0472b0af-acf6-4f27-bee3-d3414466ccec' - ] - ] - ] - ]))); - - $result = $this->client->contributions(); - $this->assertEquals($contributions, $result); - } - - public function testContributionCount(): void - { - $expectedCount = 710; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'contributionCount' => 710 - ] - ]))); - - $result = $this->client->contributionCount(); - $this->assertSame($expectedCount, $result); - } - - public function testContributor(): void - { - $contributor = new Contributor(['contributorId' => '9afc6760-f556-46a1-a912-39ea5ebc921b']); - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'contributor' => [ - 'contributorId' => '9afc6760-f556-46a1-a912-39ea5ebc921b' - ] - ] - ]))); - - $result = $this->client->contributor('9afc6760-f556-46a1-a912-39ea5ebc921b'); - $this->assertEquals($contributor, $result); - } - - public function testContributors(): void - { - $contributors = [ - new Contributor(['contributorId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2']), - new Contributor(['contributorId' => '0472b0af-acf6-4f27-bee3-d3414466ccec']), - ]; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'contributors' => [ - [ - 'contributorId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2' - ], - [ - 'contributorId' => '0472b0af-acf6-4f27-bee3-d3414466ccec' - ] - ] - ] - ]))); - - $result = $this->client->contributors(); - $this->assertEquals($contributors, $result); - } - - public function testContributorCount(): void - { - $expectedCount = 710; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'contributorCount' => 710 - ] - ]))); - - $result = $this->client->contributorCount(); - $this->assertSame($expectedCount, $result); - } - - public function testFunding(): void - { - $funding = new Funding(['fundingId' => '9afc6760-f556-46a1-a912-39ea5ebc921b']); - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'funding' => [ - 'fundingId' => '9afc6760-f556-46a1-a912-39ea5ebc921b' - ] - ] - ]))); - - $result = $this->client->funding('9afc6760-f556-46a1-a912-39ea5ebc921b'); - $this->assertEquals($funding, $result); - } - - public function testFundings(): void - { - $fundings = [ - new Funding(['fundingId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2']), - new Funding(['fundingId' => '0472b0af-acf6-4f27-bee3-d3414466ccec']), - ]; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'fundings' => [ - [ - 'fundingId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2' - ], - [ - 'fundingId' => '0472b0af-acf6-4f27-bee3-d3414466ccec' - ] - ] - ] - ]))); - - $result = $this->client->fundings(); - $this->assertEquals($fundings, $result); - } - - public function testFundingCount(): void - { - $expectedCount = 710; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'fundingCount' => 710 - ] - ]))); - - $result = $this->client->fundingCount(); - $this->assertSame($expectedCount, $result); - } - - public function testImprint(): void - { - $imprint = new Imprint(['imprintId' => '9afc6760-f556-46a1-a912-39ea5ebc921b']); - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'imprint' => [ - 'imprintId' => '9afc6760-f556-46a1-a912-39ea5ebc921b' - ] - ] - ]))); - - $result = $this->client->imprint('9afc6760-f556-46a1-a912-39ea5ebc921b'); - $this->assertEquals($imprint, $result); - } - - public function testImprints(): void - { - $imprints = [ - new Imprint(['imprintId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2']), - new Imprint(['imprintId' => '0472b0af-acf6-4f27-bee3-d3414466ccec']), - ]; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'imprints' => [ - [ - 'imprintId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2' - ], - [ - 'imprintId' => '0472b0af-acf6-4f27-bee3-d3414466ccec' - ] - ] - ] - ]))); - - $result = $this->client->imprints(); - $this->assertEquals($imprints, $result); - } - - public function testImprintCount(): void - { - $expectedCount = 710; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'imprintCount' => 710 - ] - ]))); - - $result = $this->client->imprintCount(); - $this->assertSame($expectedCount, $result); - } - - public function testInstitution(): void - { - $institution = new Institution(['institutionId' => '9afc6760-f556-46a1-a912-39ea5ebc921b']); - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'institution' => [ - 'institutionId' => '9afc6760-f556-46a1-a912-39ea5ebc921b' - ] - ] - ]))); - - $result = $this->client->institution('9afc6760-f556-46a1-a912-39ea5ebc921b'); - $this->assertEquals($institution, $result); - } - - public function testInstitutions(): void - { - $institutions = [ - new Institution(['institutionId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2']), - new Institution(['institutionId' => '0472b0af-acf6-4f27-bee3-d3414466ccec']), - ]; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'institutions' => [ - [ - 'institutionId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2' - ], - [ - 'institutionId' => '0472b0af-acf6-4f27-bee3-d3414466ccec' - ] - ] - ] - ]))); - - $result = $this->client->institutions(); - $this->assertEquals($institutions, $result); - } - - public function testInstitutionCount(): void - { - $expectedCount = 710; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'institutionCount' => 710 - ] - ]))); - - $result = $this->client->institutionCount(); - $this->assertSame($expectedCount, $result); - } - - public function testIssue(): void - { - $issue = new Issue(['issueId' => '9afc6760-f556-46a1-a912-39ea5ebc921b']); - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'issue' => [ - 'issueId' => '9afc6760-f556-46a1-a912-39ea5ebc921b' - ] - ] - ]))); - - $result = $this->client->issue('9afc6760-f556-46a1-a912-39ea5ebc921b'); - $this->assertEquals($issue, $result); - } - - public function testIssues(): void - { - $issues = [ - new Issue(['issueId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2']), - new Issue(['issueId' => '0472b0af-acf6-4f27-bee3-d3414466ccec']), - ]; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'issues' => [ - [ - 'issueId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2' - ], - [ - 'issueId' => '0472b0af-acf6-4f27-bee3-d3414466ccec' - ] - ] - ] - ]))); - - $result = $this->client->issues(); - $this->assertEquals($issues, $result); - } - - public function testIssueCount(): void - { - $expectedCount = 710; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'issueCount' => 710 - ] - ]))); - - $result = $this->client->issueCount(); - $this->assertSame($expectedCount, $result); - } - - public function testLanguage(): void - { - $language = new Language(['languageId' => '9afc6760-f556-46a1-a912-39ea5ebc921b']); - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'language' => [ - 'languageId' => '9afc6760-f556-46a1-a912-39ea5ebc921b' - ] - ] - ]))); - - $result = $this->client->language('9afc6760-f556-46a1-a912-39ea5ebc921b'); - $this->assertEquals($language, $result); - } - - public function testLanguages(): void - { - $languages = [ - new Language(['languageId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2']), - new Language(['languageId' => '0472b0af-acf6-4f27-bee3-d3414466ccec']), - ]; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'languages' => [ - [ - 'languageId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2' - ], - [ - 'languageId' => '0472b0af-acf6-4f27-bee3-d3414466ccec' - ] - ] - ] - ]))); - - $result = $this->client->languages(); - $this->assertEquals($languages, $result); - } - - public function testLanguageCount(): void - { - $expectedCount = 710; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'languageCount' => 710 - ] - ]))); - - $result = $this->client->languageCount(); - $this->assertSame($expectedCount, $result); - } - - public function testLocation(): void - { - $location = new Location(['locationId' => '9afc6760-f556-46a1-a912-39ea5ebc921b']); - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'location' => [ - 'locationId' => '9afc6760-f556-46a1-a912-39ea5ebc921b' - ] - ] - ]))); - - $result = $this->client->location('9afc6760-f556-46a1-a912-39ea5ebc921b'); - $this->assertEquals($location, $result); - } - - public function testLocations(): void - { - $locations = [ - new Location(['locationId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2']), - new Location(['locationId' => '0472b0af-acf6-4f27-bee3-d3414466ccec']), - ]; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'locations' => [ - [ - 'locationId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2' - ], - [ - 'locationId' => '0472b0af-acf6-4f27-bee3-d3414466ccec' - ] - ] - ] - ]))); - - $result = $this->client->locations(); - $this->assertEquals($locations, $result); - } - - public function testLocationCount(): void - { - $expectedCount = 710; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'locationCount' => 710 - ] - ]))); - - $result = $this->client->locationCount(); - $this->assertSame($expectedCount, $result); - } - - public function testPrice(): void - { - $price = new Price(['priceId' => '9afc6760-f556-46a1-a912-39ea5ebc921b']); - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'price' => [ - 'priceId' => '9afc6760-f556-46a1-a912-39ea5ebc921b' - ] - ] - ]))); - - $result = $this->client->price('9afc6760-f556-46a1-a912-39ea5ebc921b'); - $this->assertEquals($price, $result); - } - - public function testPrices(): void - { - $prices = [ - new Price(['priceId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2']), - new Price(['priceId' => '0472b0af-acf6-4f27-bee3-d3414466ccec']), - ]; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'prices' => [ - [ - 'priceId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2' - ], - [ - 'priceId' => '0472b0af-acf6-4f27-bee3-d3414466ccec' - ] - ] - ] - ]))); - - $result = $this->client->prices(); - $this->assertEquals($prices, $result); - } - - public function testPriceCount(): void - { - $expectedCount = 710; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'priceCount' => 710 - ] - ]))); - - $result = $this->client->priceCount(); - $this->assertSame($expectedCount, $result); - } - - public function testPublication(): void - { - $publication = new Publication(['publicationId' => '9afc6760-f556-46a1-a912-39ea5ebc921b']); - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'publication' => [ - 'publicationId' => '9afc6760-f556-46a1-a912-39ea5ebc921b' - ] - ] - ]))); - - $result = $this->client->publication('9afc6760-f556-46a1-a912-39ea5ebc921b'); - $this->assertEquals($publication, $result); - } - - public function testPublications(): void - { - $publications = [ - new Publication(['publicationId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2']), - new Publication(['publicationId' => '0472b0af-acf6-4f27-bee3-d3414466ccec']), - ]; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'publications' => [ - [ - 'publicationId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2' - ], - [ - 'publicationId' => '0472b0af-acf6-4f27-bee3-d3414466ccec' - ] - ] - ] - ]))); - - $result = $this->client->publications(); - $this->assertEquals($publications, $result); - } - - public function testPublicationCount(): void - { - $expectedCount = 710; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'publicationCount' => 710 - ] - ]))); - - $result = $this->client->publicationCount(); - $this->assertSame($expectedCount, $result); - } - - public function testPublisher(): void - { - $publisher = new Publisher(['publisherId' => '9afc6760-f556-46a1-a912-39ea5ebc921b']); - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'publisher' => [ - 'publisherId' => '9afc6760-f556-46a1-a912-39ea5ebc921b' - ] - ] - ]))); - - $result = $this->client->publisher('9afc6760-f556-46a1-a912-39ea5ebc921b'); - $this->assertEquals($publisher, $result); - } - - public function testPublishers(): void - { - $publishers = [ - new Publisher(['publisherId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2']), - new Publisher(['publisherId' => '0472b0af-acf6-4f27-bee3-d3414466ccec']), - ]; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'publishers' => [ - [ - 'publisherId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2' - ], - [ - 'publisherId' => '0472b0af-acf6-4f27-bee3-d3414466ccec' - ] - ] - ] - ]))); - - $result = $this->client->publishers(); - $this->assertEquals($publishers, $result); - } - - public function testPublisherCount(): void - { - $expectedCount = 710; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'publisherCount' => 710 - ] - ]))); - - $result = $this->client->publisherCount(); - $this->assertSame($expectedCount, $result); - } - - public function testReference(): void - { - $reference = new Reference(['referenceId' => '9afc6760-f556-46a1-a912-39ea5ebc921b']); - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'reference' => [ - 'referenceId' => '9afc6760-f556-46a1-a912-39ea5ebc921b' - ] - ] - ]))); - - $result = $this->client->reference('9afc6760-f556-46a1-a912-39ea5ebc921b'); - $this->assertEquals($reference, $result); - } - - public function testReferences(): void - { - $references = [ - new Reference(['referenceId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2']), - new Reference(['referenceId' => '0472b0af-acf6-4f27-bee3-d3414466ccec']), - ]; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'references' => [ - [ - 'referenceId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2' - ], - [ - 'referenceId' => '0472b0af-acf6-4f27-bee3-d3414466ccec' - ] - ] - ] - ]))); - - $result = $this->client->references(); - $this->assertEquals($references, $result); - } - - public function testReferenceCount(): void - { - $expectedCount = 710; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'referenceCount' => 710 - ] - ]))); - - $result = $this->client->referenceCount(); - $this->assertSame($expectedCount, $result); - } - - public function testSeries(): void - { - $series = new Series(['seriesId' => '9afc6760-f556-46a1-a912-39ea5ebc921b']); - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'series' => [ - 'seriesId' => '9afc6760-f556-46a1-a912-39ea5ebc921b' - ] - ] - ]))); - - $result = $this->client->series('9afc6760-f556-46a1-a912-39ea5ebc921b'); - $this->assertEquals($series, $result); - } - - public function testSerieses(): void - { - $serieses = [ - new Series(['seriesId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2']), - new Series(['seriesId' => '0472b0af-acf6-4f27-bee3-d3414466ccec']), - ]; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'serieses' => [ - [ - 'seriesId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2' - ], - [ - 'seriesId' => '0472b0af-acf6-4f27-bee3-d3414466ccec' - ] - ] - ] - ]))); - - $result = $this->client->serieses(); - $this->assertEquals($serieses, $result); - } - - public function testSeriesCount(): void - { - $expectedCount = 710; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'seriesCount' => 710 - ] - ]))); - - $result = $this->client->seriesCount(); - $this->assertSame($expectedCount, $result); - } - - public function testSubject(): void - { - $subject = new Subject(['subjectId' => '9afc6760-f556-46a1-a912-39ea5ebc921b']); - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'subject' => [ - 'subjectId' => '9afc6760-f556-46a1-a912-39ea5ebc921b' - ] - ] - ]))); - - $result = $this->client->subject('9afc6760-f556-46a1-a912-39ea5ebc921b'); - $this->assertEquals($subject, $result); - } - - public function testSubjects(): void - { - $subjects = [ - new Subject(['subjectId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2']), - new Subject(['subjectId' => '0472b0af-acf6-4f27-bee3-d3414466ccec']), - ]; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'subjects' => [ - [ - 'subjectId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2' - ], - [ - 'subjectId' => '0472b0af-acf6-4f27-bee3-d3414466ccec' - ] - ] - ] - ]))); - - $result = $this->client->subjects(); - $this->assertEquals($subjects, $result); - } - - public function testSubjectCount(): void - { - $expectedCount = 710; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'subjectCount' => 710 - ] - ]))); - - $result = $this->client->subjectCount(); - $this->assertSame($expectedCount, $result); - } - - public function testWork(): void - { - $work = new Work(['workId' => '9afc6760-f556-46a1-a912-39ea5ebc921b']); - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'work' => [ - 'workId' => '9afc6760-f556-46a1-a912-39ea5ebc921b' - ] - ] - ]))); - - $result = $this->client->work('9afc6760-f556-46a1-a912-39ea5ebc921b'); - $this->assertEquals($work, $result); - } - - public function testWorks(): void - { - $works = [ - new Work(['workId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2']), - new Work(['workId' => '0472b0af-acf6-4f27-bee3-d3414466ccec']), - ]; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'works' => [ - [ - 'workId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2' - ], - [ - 'workId' => '0472b0af-acf6-4f27-bee3-d3414466ccec' - ] - ] - ] - ]))); - - $result = $this->client->works(); - $this->assertEquals($works, $result); - } - - public function testWorkByDoi(): void - { - $work = new Work([ - 'workId' => '9afc6760-f556-46a1-a912-39ea5ebc921b', - 'doi' => 'https://doi.org/10.00000/00000000' - ]); - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'workByDoi' => [ - 'workId' => '9afc6760-f556-46a1-a912-39ea5ebc921b', - 'doi' => 'https://doi.org/10.00000/00000000' - ] - ] - ]))); - - $result = $this->client->workByDoi('https://doi.org/10.00000/00000000'); - $this->assertEquals($work, $result); - } - - public function testWorkCount(): void - { - $expectedCount = 710; - - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - 'workCount' => 710 - ] - ]))); - - $result = $this->client->workCount(); - $this->assertSame($expectedCount, $result); - } -} diff --git a/tests/GraphQL/Concerns/HasClientSchemaSyncTests.php b/tests/GraphQL/Concerns/HasClientSchemaSyncTests.php deleted file mode 100644 index 7b22941..0000000 --- a/tests/GraphQL/Concerns/HasClientSchemaSyncTests.php +++ /dev/null @@ -1,402 +0,0 @@ - '9afc6760-f556-46a1-a912-39ea5ebc921b']); - $this->appendGraphQlResponse('additionalResource', ['workResourceId' => '9afc6760-f556-46a1-a912-39ea5ebc921b']); - - $result = $this->client->additionalResource('9afc6760-f556-46a1-a912-39ea5ebc921b'); - $this->assertEquals($expected, $result); - } - - public function testAdditionalResources(): void - { - $expected = [ - new AdditionalResource(['workResourceId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2']), - new AdditionalResource(['workResourceId' => '0472b0af-acf6-4f27-bee3-d3414466ccec']), - ]; - $this->appendGraphQlResponse('additionalResources', [ - ['workResourceId' => '7608e91a-7e51-467a-9bab-67d1eee68ab2'], - ['workResourceId' => '0472b0af-acf6-4f27-bee3-d3414466ccec'], - ]); - - $result = $this->client->additionalResources(); - $this->assertEquals($expected, $result); - } - - public function testAdditionalResourceCount(): void - { - $this->appendGraphQlResponse('additionalResourceCount', 12); - $this->assertSame(12, $this->client->additionalResourceCount()); - } - - public function testAbstract(): void - { - $expected = new AbstractText(['abstractId' => '7b256755-3546-49ad-8199-6e98d1a66792']); - $this->appendGraphQlResponse('abstract', ['abstractId' => '7b256755-3546-49ad-8199-6e98d1a66792']); - - $result = $this->client->abstract('7b256755-3546-49ad-8199-6e98d1a66792', 'HTML'); - $this->assertEquals($expected, $result); - } - - public function testAbstracts(): void - { - $expected = [ - new AbstractText(['abstractId' => 'c8cba422-728e-4e94-8f4d-b4c1ba8f7416']), - new AbstractText(['abstractId' => '0cf7d5c4-c8e0-4787-8130-f6b7133ec2f1']), - ]; - $this->appendGraphQlResponse('abstracts', [ - ['abstractId' => 'c8cba422-728e-4e94-8f4d-b4c1ba8f7416'], - ['abstractId' => '0cf7d5c4-c8e0-4787-8130-f6b7133ec2f1'], - ]); - - $result = $this->client->abstracts(); - $this->assertEquals($expected, $result); - } - - public function testAward(): void - { - $expected = new Award(['awardId' => '348f8f66-9bd5-43f5-beb7-f08a6656d1a2']); - $this->appendGraphQlResponse('award', ['awardId' => '348f8f66-9bd5-43f5-beb7-f08a6656d1a2']); - - $result = $this->client->award('348f8f66-9bd5-43f5-beb7-f08a6656d1a2'); - $this->assertEquals($expected, $result); - } - - public function testAwards(): void - { - $expected = [ - new Award(['awardId' => 'e9572168-7795-4a72-a139-ad1c0f1143af']), - new Award(['awardId' => '6b8b30aa-0ad8-4dab-b9f1-725cfaf2f804']), - ]; - $this->appendGraphQlResponse('awards', [ - ['awardId' => 'e9572168-7795-4a72-a139-ad1c0f1143af'], - ['awardId' => '6b8b30aa-0ad8-4dab-b9f1-725cfaf2f804'], - ]); - - $result = $this->client->awards(); - $this->assertEquals($expected, $result); - } - - public function testAwardCount(): void - { - $this->appendGraphQlResponse('awardCount', 5); - $this->assertSame(5, $this->client->awardCount()); - } - - public function testBiography(): void - { - $expected = new Biography(['biographyId' => '6d8ddf35-e112-48b2-87c6-3ef5888c03e7']); - $this->appendGraphQlResponse('biography', ['biographyId' => '6d8ddf35-e112-48b2-87c6-3ef5888c03e7']); - - $result = $this->client->biography('6d8ddf35-e112-48b2-87c6-3ef5888c03e7', 'HTML'); - $this->assertEquals($expected, $result); - } - - public function testBiographies(): void - { - $expected = [ - new Biography(['biographyId' => 'ed51ceb4-d77e-4f6e-bf1a-8277c1f5f0df']), - new Biography(['biographyId' => '2d8a97c3-6b6e-440f-9c6e-b8c5ee5bf1cb']), - ]; - $this->appendGraphQlResponse('biographies', [ - ['biographyId' => 'ed51ceb4-d77e-4f6e-bf1a-8277c1f5f0df'], - ['biographyId' => '2d8a97c3-6b6e-440f-9c6e-b8c5ee5bf1cb'], - ]); - - $result = $this->client->biographies(); - $this->assertEquals($expected, $result); - } - - public function testBookReview(): void - { - $expected = new BookReview(['bookReviewId' => 'a465c5d1-5ef0-493c-b2b3-a8084144f35c']); - $this->appendGraphQlResponse('bookReview', ['bookReviewId' => 'a465c5d1-5ef0-493c-b2b3-a8084144f35c']); - - $result = $this->client->bookReview('a465c5d1-5ef0-493c-b2b3-a8084144f35c'); - $this->assertEquals($expected, $result); - } - - public function testBookReviews(): void - { - $expected = [ - new BookReview(['bookReviewId' => '728d3048-b0db-444e-bd46-26ab6b66e7cf']), - new BookReview(['bookReviewId' => '83b8dfe7-8394-49f1-b5f0-c833e86d9d5b']), - ]; - $this->appendGraphQlResponse('bookReviews', [ - ['bookReviewId' => '728d3048-b0db-444e-bd46-26ab6b66e7cf'], - ['bookReviewId' => '83b8dfe7-8394-49f1-b5f0-c833e86d9d5b'], - ]); - - $result = $this->client->bookReviews(); - $this->assertEquals($expected, $result); - } - - public function testBookReviewCount(): void - { - $this->appendGraphQlResponse('bookReviewCount', 8); - $this->assertSame(8, $this->client->bookReviewCount()); - } - - public function testContact(): void - { - $expected = new Contact(['contactId' => 'd4122dc0-f3fc-45ce-81a4-fe45e8da837b']); - $this->appendGraphQlResponse('contact', ['contactId' => 'd4122dc0-f3fc-45ce-81a4-fe45e8da837b']); - - $result = $this->client->contact('d4122dc0-f3fc-45ce-81a4-fe45e8da837b'); - $this->assertEquals($expected, $result); - } - - public function testContacts(): void - { - $expected = [ - new Contact(['contactId' => 'f74cc2d0-4888-4629-a31b-ac8527d4f374']), - new Contact(['contactId' => '67c2ab2c-e1c5-452a-8bb4-7fd3bf7f2394']), - ]; - $this->appendGraphQlResponse('contacts', [ - ['contactId' => 'f74cc2d0-4888-4629-a31b-ac8527d4f374'], - ['contactId' => '67c2ab2c-e1c5-452a-8bb4-7fd3bf7f2394'], - ]); - - $result = $this->client->contacts(); - $this->assertEquals($expected, $result); - } - - public function testContactCount(): void - { - $this->appendGraphQlResponse('contactCount', 4); - $this->assertSame(4, $this->client->contactCount()); - } - - public function testEndorsement(): void - { - $expected = new Endorsement(['endorsementId' => '0b13c4ca-6db2-4f4a-ad98-784ec0f5f8f6']); - $this->appendGraphQlResponse('endorsement', ['endorsementId' => '0b13c4ca-6db2-4f4a-ad98-784ec0f5f8f6']); - - $result = $this->client->endorsement('0b13c4ca-6db2-4f4a-ad98-784ec0f5f8f6'); - $this->assertEquals($expected, $result); - } - - public function testEndorsements(): void - { - $expected = [ - new Endorsement(['endorsementId' => '1bb5729c-2fb1-4e0b-b9eb-d78c646c2048']), - new Endorsement(['endorsementId' => 'f2248af2-4650-4f4b-b5e7-b702a05629a7']), - ]; - $this->appendGraphQlResponse('endorsements', [ - ['endorsementId' => '1bb5729c-2fb1-4e0b-b9eb-d78c646c2048'], - ['endorsementId' => 'f2248af2-4650-4f4b-b5e7-b702a05629a7'], - ]); - - $result = $this->client->endorsements(); - $this->assertEquals($expected, $result); - } - - public function testEndorsementCount(): void - { - $this->appendGraphQlResponse('endorsementCount', 7); - $this->assertSame(7, $this->client->endorsementCount()); - } - - public function testFile(): void - { - $expected = new File(['fileId' => '0a2cde56-a535-4f7a-ac6b-3fc12942d1c9']); - $this->appendGraphQlResponse('file', ['fileId' => '0a2cde56-a535-4f7a-ac6b-3fc12942d1c9']); - - $result = $this->client->file('0a2cde56-a535-4f7a-ac6b-3fc12942d1c9'); - $this->assertEquals($expected, $result); - } - - public function testMe(): void - { - $expected = new Me(['userId' => '3a3d425f-35ed-49fd-a0f9-4b13d68ab71b']); - $this->appendGraphQlResponse('me', ['userId' => '3a3d425f-35ed-49fd-a0f9-4b13d68ab71b']); - - $result = $this->client->setToken('token')->me(); - $this->assertEquals($expected, $result); - } - - public function testTitle(): void - { - $expected = new Title(['titleId' => '11595f9d-536e-422a-8184-4b01df1158f5']); - $this->appendGraphQlResponse('title', ['titleId' => '11595f9d-536e-422a-8184-4b01df1158f5']); - - $result = $this->client->title('11595f9d-536e-422a-8184-4b01df1158f5', 'HTML'); - $this->assertEquals($expected, $result); - } - - public function testTitles(): void - { - $expected = [ - new Title(['titleId' => '194fb8a9-ec22-414d-a4ce-a2216755b5b0']), - new Title(['titleId' => '204291c6-6ecb-4b9b-b61d-c789336f281d']), - ]; - $this->appendGraphQlResponse('titles', [ - ['titleId' => '194fb8a9-ec22-414d-a4ce-a2216755b5b0'], - ['titleId' => '204291c6-6ecb-4b9b-b61d-c789336f281d'], - ]); - - $result = $this->client->titles(); - $this->assertEquals($expected, $result); - } - - public function testWorkFeaturedVideo(): void - { - $expected = new WorkFeaturedVideo(['workFeaturedVideoId' => 'ce185b34-0678-4332-b805-271db0feec4c']); - $this->appendGraphQlResponse('workFeaturedVideo', ['workFeaturedVideoId' => 'ce185b34-0678-4332-b805-271db0feec4c']); - - $result = $this->client->workFeaturedVideo('ce185b34-0678-4332-b805-271db0feec4c'); - $this->assertEquals($expected, $result); - } - - public function testWorkFeaturedVideos(): void - { - $expected = [ - new WorkFeaturedVideo(['workFeaturedVideoId' => 'b44e6137-bd54-46d3-a5de-d377ef205022']), - new WorkFeaturedVideo(['workFeaturedVideoId' => 'd865ba29-1f2c-42b8-b6c0-35f96a86091a']), - ]; - $this->appendGraphQlResponse('workFeaturedVideos', [ - ['workFeaturedVideoId' => 'b44e6137-bd54-46d3-a5de-d377ef205022'], - ['workFeaturedVideoId' => 'd865ba29-1f2c-42b8-b6c0-35f96a86091a'], - ]); - - $result = $this->client->workFeaturedVideos(); - $this->assertEquals($expected, $result); - } - - public function testWorkFeaturedVideoCount(): void - { - $this->appendGraphQlResponse('workFeaturedVideoCount', 2); - $this->assertSame(2, $this->client->workFeaturedVideoCount()); - } - - public function testAdditionalSchemaMutations(): void - { - $cases = [ - ['createAdditionalResource', new AdditionalResource(), 'createAdditionalResource', 'workResourceId'], - ['updateAdditionalResource', new AdditionalResource(), 'updateAdditionalResource', 'workResourceId'], - ['deleteAdditionalResource', '6df7310c-8d9e-4b25-afb9-3ef670051c5a', 'deleteAdditionalResource', 'workResourceId'], - ['createAbstract', new AbstractText(), 'createAbstract', 'abstractId'], - ['updateAbstract', new AbstractText(), 'updateAbstract', 'abstractId'], - ['deleteAbstract', 'c17f97cd-6c31-4e25-a870-9df7559c61ad', 'deleteAbstract', 'abstractId'], - ['createAward', new Award(), 'createAward', 'awardId'], - ['updateAward', new Award(), 'updateAward', 'awardId'], - ['deleteAward', '1da2c824-1cdd-4a20-8d18-979743f2576d', 'deleteAward', 'awardId'], - ['createBiography', new Biography(), 'createBiography', 'biographyId'], - ['updateBiography', new Biography(), 'updateBiography', 'biographyId'], - ['deleteBiography', '403d31d1-8e7a-4b36-a3d2-72cdc4f9d2a4', 'deleteBiography', 'biographyId'], - ['createBookReview', new BookReview(), 'createBookReview', 'bookReviewId'], - ['updateBookReview', new BookReview(), 'updateBookReview', 'bookReviewId'], - ['deleteBookReview', '5db50f30-9783-4ff6-9c85-521662fdd1d2', 'deleteBookReview', 'bookReviewId'], - ['createContact', new Contact(), 'createContact', 'contactId'], - ['updateContact', new Contact(), 'updateContact', 'contactId'], - ['deleteContact', '52e6f1dd-2811-497a-a0fd-7fdc439c0ab4', 'deleteContact', 'contactId'], - ['createEndorsement', new Endorsement(), 'createEndorsement', 'endorsementId'], - ['updateEndorsement', new Endorsement(), 'updateEndorsement', 'endorsementId'], - ['deleteEndorsement', 'a2d18be6-b877-4b68-b6e9-bf1c0b74d89c', 'deleteEndorsement', 'endorsementId'], - ['createTitle', new Title(), 'createTitle', 'titleId'], - ['updateTitle', new Title(), 'updateTitle', 'titleId'], - ['deleteTitle', '2581af59-2c28-4576-a823-cd90cacf9f7f', 'deleteTitle', 'titleId'], - ['createWorkFeaturedVideo', new WorkFeaturedVideo(), 'createWorkFeaturedVideo', 'workFeaturedVideoId'], - ['updateWorkFeaturedVideo', new WorkFeaturedVideo(), 'updateWorkFeaturedVideo', 'workFeaturedVideoId'], - ['deleteWorkFeaturedVideo', 'e3733ec2-2bc2-456b-af8c-43a83df87f5d', 'deleteWorkFeaturedVideo', 'workFeaturedVideoId'], - ]; - - foreach ($cases as $case) { - $this->appendGraphQlResponse($case[2], [$case[3] => '5d065ca7-e93d-4830-a94c-0b18cac0d738']); - $result = is_string($case[1]) - ? $this->client->{$case[0]}($case[1]) - : $this->client->{$case[0]}($case[1]); - - $this->assertSame('5d065ca7-e93d-4830-a94c-0b18cac0d738', $result); - } - } - - public function testMoveMutations(): void - { - $cases = [ - ['moveAffiliation', 'moveAffiliation', 'affiliationId'], - ['moveContribution', 'moveContribution', 'contributionId'], - ['moveIssue', 'moveIssue', 'issueId'], - ['moveReference', 'moveReference', 'referenceId'], - ['moveAdditionalResource', 'moveAdditionalResource', 'workResourceId'], - ['moveAward', 'moveAward', 'awardId'], - ['moveEndorsement', 'moveEndorsement', 'endorsementId'], - ['moveBookReview', 'moveBookReview', 'bookReviewId'], - ['moveSubject', 'moveSubject', 'subjectId'], - ['moveWorkRelation', 'moveWorkRelation', 'workRelationId'], - ]; - - foreach ($cases as $case) { - $this->appendGraphQlResponse($case[1], [$case[2] => 'a6ef3310-3f0a-4814-b66f-75c0a0850ed1']); - $result = $this->client->{$case[0]}('8ad22885-ea80-4bfc-b562-a4e3f8c9fe25', 2); - $this->assertSame('a6ef3310-3f0a-4814-b66f-75c0a0850ed1', $result); - } - } - - public function testFileUploadMutations(): void - { - $payload = [ - 'declaredMimeType' => 'application/pdf', - 'declaredExtension' => 'pdf', - 'declaredSha256' => 'abc123', - ]; - - $this->appendGraphQlResponse('initPublicationFileUpload', ['fileUploadId' => '805f6199-48e8-4c30-aeec-7c4bcc6cf515']); - $this->assertEquals( - new FileUploadResponse(['fileUploadId' => '805f6199-48e8-4c30-aeec-7c4bcc6cf515']), - $this->client->initPublicationFileUpload(['publicationId' => '22851a6f-b1b8-4631-90b4-fcf70dce8472'] + $payload) - ); - - $this->appendGraphQlResponse('initFrontcoverFileUpload', ['fileUploadId' => '33ea7c51-54e4-4e77-a9e2-666aeb277cfa']); - $this->assertEquals( - new FileUploadResponse(['fileUploadId' => '33ea7c51-54e4-4e77-a9e2-666aeb277cfa']), - $this->client->initFrontcoverFileUpload(['workId' => 'f3505088-fb35-4c64-9b64-0cdd4964d3db'] + $payload) - ); - - $this->appendGraphQlResponse('initAdditionalResourceFileUpload', ['fileUploadId' => '63f8edbf-3e4d-44fe-b83d-725fdb7152f4']); - $this->assertEquals( - new FileUploadResponse(['fileUploadId' => '63f8edbf-3e4d-44fe-b83d-725fdb7152f4']), - $this->client->initAdditionalResourceFileUpload(['additionalResourceId' => '4fadb13b-fda1-4ce1-aa17-cf1902652f66'] + $payload) - ); - - $this->appendGraphQlResponse('initWorkFeaturedVideoFileUpload', ['fileUploadId' => '2897df20-c90f-4a0e-a81d-7b0557d7fd07']); - $this->assertEquals( - new FileUploadResponse(['fileUploadId' => '2897df20-c90f-4a0e-a81d-7b0557d7fd07']), - $this->client->initWorkFeaturedVideoFileUpload(['workFeaturedVideoId' => '2b554c7f-0c1d-49c6-8a4f-d9638a115bea'] + $payload) - ); - - $this->appendGraphQlResponse('completeFileUpload', ['fileId' => 'c0b70667-9a9a-4829-9b29-f4792c53c702']); - $this->assertEquals( - new File(['fileId' => 'c0b70667-9a9a-4829-9b29-f4792c53c702']), - $this->client->completeFileUpload(['fileUploadId' => '2897df20-c90f-4a0e-a81d-7b0557d7fd07']) - ); - } - - private function appendGraphQlResponse(string $field, $data): void - { - $this->mockHandler->append(new Response(200, [], json_encode([ - 'data' => [ - $field => $data, - ], - ]))); - } -} diff --git a/tests/GraphQL/GeneratorTest.php b/tests/GraphQL/GeneratorTest.php new file mode 100644 index 0000000..1bddc39 --- /dev/null +++ b/tests/GraphQL/GeneratorTest.php @@ -0,0 +1,169 @@ +temporaryDirectory !== null) { + $this->removeDirectory($this->temporaryDirectory); + } + } + + public function testItGeneratesPhpDocForObjectAccessors(): void + { + $this->temporaryDirectory = sys_get_temp_dir() . '/thoth-graphql-generator-' . uniqid('', true); + $target = $this->temporaryDirectory . '/GraphQL'; + mkdir($target, 0777, true); + + $schema = __DIR__ . '/fixtures/minimal-introspection.json'; + $script = dirname(__DIR__, 2) . '/tools/generate-graphql-client.php'; + copy(dirname(__DIR__, 2) . '/src/GraphQL/Client.php', $target . '/Client.php'); + + $command = PHP_BINARY . ' ' . escapeshellarg($script) . ' ' . escapeshellarg($schema) . ' ' + . escapeshellarg($target); + + exec($command, $output, $exitCode); + + $this->assertSame(0, $exitCode, implode("\n", $output)); + + $workClass = file_get_contents($target . '/Schemas/Work.php'); + + $this->assertStringContainsString('@return string', $workClass); + $this->assertStringContainsString('@return string|null', $workClass); + $this->assertStringContainsString('@return Imprint|null', $workClass); + $this->assertStringContainsString('@return string[]|null', $workClass); + $this->assertStringContainsString('@param string $value', $workClass); + $this->assertStringContainsString('public function hasTitle(): bool', $workClass); + $this->assertStringContainsString('public function unsetTitle(): self', $workClass); + $this->assertFileExists($target . '/Queries/BooksQuery.php'); + $this->assertFileExists($target . '/Mutations/CreateWorkMutation.php'); + $this->assertFileDoesNotExist($target . '/Schemas/QueryRoot.php'); + $this->assertFileDoesNotExist($target . '/Schemas/MutationRoot.php'); + + $clientClass = file_get_contents($target . '/Client.php'); + + $this->assertStringContainsString('@method \\ThothApi\\GraphQL\\Schemas\\Work[]|null books(array $selection = [])', $clientClass); + $this->assertStringContainsString('@method \\ThothApi\\GraphQL\\Schemas\\Work createWork(array $selection = [])', $clientClass); + } + + public function testItRejectsUnsafeTargets(): void + { + $this->temporaryDirectory = sys_get_temp_dir() . '/thoth-graphql-generator-' . uniqid('', true); + $target = $this->temporaryDirectory . '/not-graphql'; + mkdir($target, 0777, true); + + $schema = __DIR__ . '/fixtures/minimal-introspection.json'; + $script = dirname(__DIR__, 2) . '/tools/generate-graphql-client.php'; + $command = PHP_BINARY . ' ' . escapeshellarg($script) . ' ' . escapeshellarg($schema) . ' ' + . escapeshellarg($target) . ' 2>&1'; + + exec($command, $output, $exitCode); + + $this->assertSame(1, $exitCode); + $this->assertSame('Refusing to generate GraphQL client outside a GraphQL target directory.', $output[0]); + $this->assertDirectoryDoesNotExist($target . '/Queries'); + } + + public function testItReportsMissingSchemaFile(): void + { + $this->temporaryDirectory = sys_get_temp_dir() . '/thoth-graphql-generator-' . uniqid('', true); + $target = $this->temporaryDirectory . '/GraphQL'; + mkdir($target, 0777, true); + + $schema = $this->temporaryDirectory . '/missing-schema.json'; + $script = dirname(__DIR__, 2) . '/tools/generate-graphql-client.php'; + $command = PHP_BINARY . ' ' . escapeshellarg($script) . ' ' . escapeshellarg($schema) . ' ' + . escapeshellarg($target) . ' 2>&1'; + + exec($command, $output, $exitCode); + + $this->assertSame(1, $exitCode); + $this->assertSame('Unable to read GraphQL introspection schema file: ' . $schema, $output[0]); + } + + public function testItReportsInvalidSchemaJson(): void + { + $this->temporaryDirectory = sys_get_temp_dir() . '/thoth-graphql-generator-' . uniqid('', true); + $target = $this->temporaryDirectory . '/GraphQL'; + mkdir($target, 0777, true); + + $schema = $this->temporaryDirectory . '/invalid-schema.json'; + file_put_contents($schema, '{invalid json'); + + $script = dirname(__DIR__, 2) . '/tools/generate-graphql-client.php'; + $command = PHP_BINARY . ' ' . escapeshellarg($script) . ' ' . escapeshellarg($schema) . ' ' + . escapeshellarg($target) . ' 2>&1'; + + exec($command, $output, $exitCode); + + $this->assertSame(1, $exitCode); + $this->assertSame('Invalid GraphQL introspection schema JSON: Syntax error', $output[0]); + } + + public function testGeneratorEntrypointLoadsSeparateComponents(): void + { + $projectRoot = dirname(__DIR__, 2); + $script = file_get_contents($projectRoot . '/tools/generate-graphql-client.php'); + + $this->assertFileExists($projectRoot . '/tools/GraphQLGenerator/GraphQLClientGenerator.php'); + $this->assertStringContainsString("require_once __DIR__ . '/GraphQLGenerator/bootstrap.php';", $script); + $this->assertStringNotContainsString('final class GraphQLClientGenerator', $script); + } + + public function testGeneratorEntrypointHandlesComponentExceptions(): void + { + $projectRoot = dirname(__DIR__, 2); + $script = file_get_contents($projectRoot . '/tools/generate-graphql-client.php'); + $guard = file_get_contents($projectRoot . '/tools/GraphQLGenerator/TargetDirectoryGuard.php'); + $loader = file_get_contents($projectRoot . '/tools/GraphQLGenerator/SchemaLoader.php'); + + $this->assertFileExists($projectRoot . '/tools/GraphQLGenerator/GeneratorException.php'); + $this->assertStringContainsString('catch (GeneratorException $exception)', $script); + $this->assertStringNotContainsString('exit(1)', $guard); + $this->assertStringNotContainsString('exit(1)', $loader); + } + + public function testSchemaTypeGenerationUsesDedicatedBuilders(): void + { + $projectRoot = dirname(__DIR__, 2); + $schemaTypeGenerator = file_get_contents($projectRoot . '/tools/GraphQLGenerator/SchemaTypeGenerator.php'); + $codeGeneration = file_get_contents($projectRoot . '/tools/GraphQLGenerator/CodeGeneration.php'); + + $this->assertFileExists($projectRoot . '/tools/GraphQLGenerator/ObjectTypeClassBuilder.php'); + $this->assertFileExists($projectRoot . '/tools/GraphQLGenerator/InputTypeClassBuilder.php'); + $this->assertFileExists($projectRoot . '/tools/GraphQLGenerator/EnumTypeClassBuilder.php'); + $this->assertFileExists($projectRoot . '/tools/GraphQLGenerator/ScalarTypeClassBuilder.php'); + $this->assertStringContainsString('private ObjectTypeClassBuilder $objectTypeBuilder;', $schemaTypeGenerator); + $this->assertStringNotContainsString('function generateObjectType', $codeGeneration); + $this->assertStringNotContainsString('function generateInputType', $codeGeneration); + } + + private function removeDirectory(string $directory): void + { + if (!is_dir($directory)) { + return; + } + + $iterator = new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS), + \RecursiveIteratorIterator::CHILD_FIRST + ); + + foreach ($iterator as $file) { + if ($file->isDir()) { + rmdir($file->getPathname()); + continue; + } + + unlink($file->getPathname()); + } + + rmdir($directory); + } +} diff --git a/tests/GraphQL/GenericClientTest.php b/tests/GraphQL/GenericClientTest.php new file mode 100644 index 0000000..dbb8cbd --- /dev/null +++ b/tests/GraphQL/GenericClientTest.php @@ -0,0 +1,433 @@ + [ + 'books' => [ + [ + 'workId' => 'work-1', + 'fullTitle' => 'Generated client', + ], + ], + ], + ])), + ]); + + $client = new Client(['handler' => HandlerStack::create($mockHandler)]); + $operation = new OperationRequest( + 'query', + new FieldDefinition('books', TypeReference::named('Work')), + [], + ['workId', 'fullTitle'] + ); + + $this->assertSame([ + [ + 'workId' => 'work-1', + 'fullTitle' => 'Generated client', + ], + ], $client->execute($operation)); + } + + public function testItExecutesGeneratedMutationByMethodName(): void + { + $mockHandler = new MockHandler([ + new Response(200, [], json_encode([ + 'data' => [ + 'createWork' => [ + 'workId' => 'work-1', + ], + ], + ])), + ]); + + $client = new Client(['handler' => HandlerStack::create($mockHandler)]); + + $this->assertSame('work-1', $client->createWork([ + 'workType' => OperationRequest::enum('MONOGRAPH'), + 'workStatus' => OperationRequest::enum('ACTIVE'), + 'imprintId' => '71faf1c3-900a-4b8c-bca7-4f927699fb90', + ])); + } + + public function testItAcceptsObjectsWithGetAllDataWhenExecutingGeneratedMutationByMethodName(): void + { + $mockHandler = new MockHandler([ + new Response(200, [], json_encode([ + 'data' => [ + 'createWork' => [ + 'workId' => 'work-1', + ], + ], + ])), + ]); + + $client = new Client(['handler' => HandlerStack::create($mockHandler)]); + $newWork = new class () { + public function getAllData(): array + { + return [ + 'workType' => OperationRequest::enum('MONOGRAPH'), + 'workStatus' => OperationRequest::enum('ACTIVE'), + 'imprintId' => '71faf1c3-900a-4b8c-bca7-4f927699fb90', + ]; + } + }; + + $this->assertSame('work-1', $client->createWork($newWork)); + } + + public function testItExecutesGeneratedMutationWithGeneratedInputClass(): void + { + $mockHandler = new MockHandler([ + new Response(200, [], json_encode([ + 'data' => [ + 'createWork' => [ + 'workId' => 'work-1', + ], + ], + ])), + ]); + + $client = new Client(['handler' => HandlerStack::create($mockHandler)]); + $newWork = new NewWork([ + 'workType' => WorkType::MONOGRAPH, + 'workStatus' => WorkStatus::ACTIVE, + 'imprintId' => '71faf1c3-900a-4b8c-bca7-4f927699fb90', + ]); + + $this->assertSame('work-1', $client->createWork($newWork)); + } + + public function testItHydratesGeneratedSchemaForExplicitObjectSelection(): void + { + $history = []; + $mockHandler = new MockHandler([ + new Response(200, [], json_encode([ + 'data' => [ + 'createWork' => [ + 'workId' => 'work-1', + 'fullTitle' => 'Generated client', + ], + ], + ])), + ]); + $handlerStack = HandlerStack::create($mockHandler); + $handlerStack->push(Middleware::history($history)); + $client = new Client(['handler' => $handlerStack]); + $newWork = new NewWork([ + 'workType' => WorkType::MONOGRAPH, + 'workStatus' => WorkStatus::ACTIVE, + 'imprintId' => '71faf1c3-900a-4b8c-bca7-4f927699fb90', + ]); + + $work = $client->createWork($newWork, ['workId', 'fullTitle']); + + $this->assertInstanceOf(Work::class, $work); + $this->assertSame('work-1', $work->getWorkId()); + $this->assertSame('Generated client', $work->getFullTitle()); + + $body = json_decode((string) $history[0]['request']->getBody(), true); + + $this->assertStringContainsString('workId', $body['query']); + $this->assertStringContainsString('fullTitle', $body['query']); + } + + public function testItHydratesNestedGeneratedSchemas(): void + { + $mockHandler = new MockHandler([ + new Response(200, [], json_encode([ + 'data' => [ + 'createWork' => [ + 'workId' => 'work-1', + 'imprint' => [ + 'imprintId' => 'imprint-1', + 'publisher' => [ + 'publisherId' => 'publisher-1', + 'publisherName' => 'ACME Press', + ], + ], + ], + ], + ])), + ]); + + $client = new Client(['handler' => HandlerStack::create($mockHandler)]); + $newWork = new NewWork([ + 'workType' => WorkType::MONOGRAPH, + 'workStatus' => WorkStatus::ACTIVE, + 'imprintId' => '71faf1c3-900a-4b8c-bca7-4f927699fb90', + ]); + $work = $client->createWork($newWork, [ + 'workId', + 'imprint' => [ + 'imprintId', + 'publisher' => [ + 'publisherId', + 'publisherName', + ], + ], + ]); + + $this->assertInstanceOf(Work::class, $work); + $this->assertInstanceOf(Imprint::class, $work->getImprint()); + $this->assertInstanceOf(Publisher::class, $work->getImprint()->getPublisher()); + $this->assertSame('ACME Press', $work->getImprint()->getPublisher()->getPublisherName()); + } + + public function testGeneratedSchemaObjectsExposeSettersAndArrayData(): void + { + $work = new Work(); + + $work->setWorkId('work-1')->setFullTitle('Generated client'); + + $this->assertSame('work-1', $work->getWorkId()); + $this->assertSame([ + 'workId' => 'work-1', + 'fullTitle' => 'Generated client', + ], $work->toArray()); + } + + public function testGeneratedSchemaObjectsDistinguishNullFromMissingFields(): void + { + $work = new Work(); + + $this->assertFalse($work->hasSubtitle()); + + $work->setSubtitle(null); + + $this->assertTrue($work->hasSubtitle()); + $this->assertNull($work->getSubtitle()); + $this->assertSame(['subtitle' => null], $work->toArray()); + + $work->unsetSubtitle(); + + $this->assertFalse($work->hasSubtitle()); + $this->assertSame([], $work->toArray()); + } + + public function testGeneratedInputObjectsExposeSettersAndPresenceMethods(): void + { + $newWork = (new NewWork()) + ->setWorkType(WorkType::MONOGRAPH) + ->setWorkStatus(WorkStatus::ACTIVE) + ->setImprintId('71faf1c3-900a-4b8c-bca7-4f927699fb90') + ->setReference(null); + + $this->assertTrue($newWork->hasReference()); + $this->assertNull($newWork->getReference()); + $this->assertSame([ + 'workType' => WorkType::MONOGRAPH, + 'workStatus' => WorkStatus::ACTIVE, + 'imprintId' => '71faf1c3-900a-4b8c-bca7-4f927699fb90', + 'reference' => null, + ], $newWork->getAllData()); + + $newWork->unsetReference(); + + $this->assertFalse($newWork->hasReference()); + $this->assertSame([ + 'workType' => WorkType::MONOGRAPH, + 'workStatus' => WorkStatus::ACTIVE, + 'imprintId' => '71faf1c3-900a-4b8c-bca7-4f927699fb90', + ], $newWork->getAllData()); + } + + public function testItUsesFirstIdFieldFromGeneratedSchemaAsDefaultSelection(): void + { + $mockHandler = new MockHandler([ + new Response(200, [], json_encode([ + 'data' => [ + 'initPublicationFileUpload' => [ + 'fileUploadId' => 'upload-1', + ], + ], + ])), + ]); + + $client = new Client(['handler' => HandlerStack::create($mockHandler)]); + $input = new NewPublicationFileUpload([ + 'publicationId' => 'publication-1', + 'declaredMimeType' => 'application/pdf', + 'declaredExtension' => 'pdf', + 'declaredSha256' => str_repeat('a', 64), + ]); + + $this->assertSame('upload-1', $client->initPublicationFileUpload($input)); + } + + public function testGeneratedInputObjectsPreserveExplicitNullVariables(): void + { + $history = []; + $mockHandler = new MockHandler([ + new Response(200, [], json_encode([ + 'data' => [ + 'createWork' => [ + 'workId' => 'work-1', + ], + ], + ])), + ]); + $handlerStack = HandlerStack::create($mockHandler); + $handlerStack->push(Middleware::history($history)); + $client = new Client(['handler' => $handlerStack]); + + $newWork = (new NewWork()) + ->setWorkType(WorkType::MONOGRAPH) + ->setWorkStatus(WorkStatus::ACTIVE) + ->setImprintId('71faf1c3-900a-4b8c-bca7-4f927699fb90') + ->setReference(null); + + $client->createWork($newWork); + + $body = json_decode((string) $history[0]['request']->getBody(), true); + + $this->assertArrayHasKey('reference', $body['variables']['data']); + $this->assertNull($body['variables']['data']['reference']); + } + + public function testItReturnsScalarOperationResults(): void + { + $mockHandler = new MockHandler([ + new Response(200, [], json_encode([ + 'data' => [ + 'workCount' => 3, + ], + ])), + ]); + + $client = new Client(['handler' => HandlerStack::create($mockHandler)]); + + $this->assertSame(3, $client->workCount()); + } + + public function testItUsesTokenWhenExecutingRawQueries(): void + { + $history = []; + $mockHandler = new MockHandler([ + new Response(200, [], json_encode([ + 'data' => [ + 'ping' => true, + ], + ])), + ]); + $handlerStack = HandlerStack::create($mockHandler); + $handlerStack->push(Middleware::history($history)); + $client = new Client(['handler' => $handlerStack]); + + $client->setToken('token-1')->rawQuery('query { ping }'); + + $this->assertSame('Bearer token-1', $history[0]['request']->getHeaderLine('Authorization')); + } + + public function testItKeepsArrayArgumentsWhenNoExplicitSelectionIsProvided(): void + { + $history = []; + $mockHandler = new MockHandler([ + new Response(200, [], json_encode([ + 'data' => [ + 'works' => [ + ['workId' => 'work-1'], + ], + ], + ])), + ]); + $handlerStack = HandlerStack::create($mockHandler); + $handlerStack->push(Middleware::history($history)); + $client = new Client(['handler' => $handlerStack]); + + $client->works(100, 0, '', [ + 'field' => WorkField::FULL_TITLE, + 'direction' => Direction::ASC, + ]); + + $body = json_decode((string) $history[0]['request']->getBody(), true); + + $this->assertStringContainsString('order: $order', $body['query']); + $this->assertStringContainsString('workId', $body['query']); + $this->assertSame([ + 'limit' => 100, + 'offset' => 0, + 'filter' => '', + 'order' => [ + 'field' => 'FULL_TITLE', + 'direction' => 'ASC', + ], + ], $body['variables']); + } + + public function testItAcceptsExplicitSelectionAfterOptionalPositionalArguments(): void + { + $history = []; + $mockHandler = new MockHandler([ + new Response(200, [], json_encode([ + 'data' => [ + 'works' => [ + [ + 'workId' => 'work-1', + 'fullTitle' => 'Generated client', + ], + ], + ], + ])), + ]); + $handlerStack = HandlerStack::create($mockHandler); + $handlerStack->push(Middleware::history($history)); + $client = new Client(['handler' => $handlerStack]); + + $client->works(5, ['workId', 'fullTitle']); + + $body = json_decode((string) $history[0]['request']->getBody(), true); + + $this->assertStringContainsString('works(limit: $limit)', $body['query']); + $this->assertStringContainsString('fullTitle', $body['query']); + $this->assertSame(['limit' => 5], $body['variables']); + } + + public function testItHydratesGeneratedSchemasInListResults(): void + { + $mockHandler = new MockHandler([ + new Response(200, [], json_encode([ + 'data' => [ + 'works' => [ + [ + 'workId' => 'work-1', + 'fullTitle' => 'Generated client', + ], + ], + ], + ])), + ]); + $client = new Client(['handler' => HandlerStack::create($mockHandler)]); + + $works = $client->works(5, ['workId', 'fullTitle']); + + $this->assertInstanceOf(Work::class, $works[0]); + $this->assertSame('Generated client', $works[0]->getFullTitle()); + } +} diff --git a/tests/GraphQL/Models/AbstractModelTest.php b/tests/GraphQL/Models/AbstractModelTest.php deleted file mode 100644 index 9b0060e..0000000 --- a/tests/GraphQL/Models/AbstractModelTest.php +++ /dev/null @@ -1,53 +0,0 @@ -getMockBuilder(AbstractModel::class) - ->setConstructorArgs([['foo' => 'bar']]) - ->getMockForAbstractClass(); - - $this->assertSame('bar', $model->getData('foo')); - } - - public function testSetData(): void - { - $model = $this->getMockBuilder(AbstractModel::class) - ->getMockForAbstractClass(); - - $model->setData('foo', 'bar'); - - $this->assertSame('bar', $model->getData('foo')); - } - - public function testSetDataToNull(): void - { - $model = $this->getMockBuilder(AbstractModel::class) - ->setConstructorArgs([['foo' => 'bar']]) - ->getMockForAbstractClass(); - - $model->setData('foo', null); - - $this->assertNull($model->getData('foo')); - } - - public function testGetAllData(): void - { - $data = [ - 'foo' => 'bar', - 'baz' => 'qux' - ]; - - $model = $this->getMockBuilder(AbstractModel::class) - ->setConstructorArgs([$data]) - ->getMockForAbstractClass(); - - $this->assertSame($data, $model->getAllData()); - } -} diff --git a/tests/GraphQL/Models/AffiliationTest.php b/tests/GraphQL/Models/AffiliationTest.php deleted file mode 100644 index a3e64cf..0000000 --- a/tests/GraphQL/Models/AffiliationTest.php +++ /dev/null @@ -1,25 +0,0 @@ -setAffiliationId('aef9abbd-5570-434e-af90-04ee447625dd'); - $affiliation->setContributionId('9dc580ba-8fd0-4e66-9165-cddbf500d4bd'); - $affiliation->setInstitutionId('d1c90c01-6a8b-4589-a8e2-27a9e8092b5d'); - $affiliation->setAffiliationOrdinal(1); - $affiliation->setPosition('Senior Professor'); - - $this->assertEquals('aef9abbd-5570-434e-af90-04ee447625dd', $affiliation->getAffiliationId()); - $this->assertEquals('9dc580ba-8fd0-4e66-9165-cddbf500d4bd', $affiliation->getContributionId()); - $this->assertEquals('d1c90c01-6a8b-4589-a8e2-27a9e8092b5d', $affiliation->getInstitutionId()); - $this->assertEquals(1, $affiliation->getAffiliationOrdinal()); - $this->assertEquals('Senior Professor', $affiliation->getPosition()); - } -} diff --git a/tests/GraphQL/Models/ContributionTest.php b/tests/GraphQL/Models/ContributionTest.php deleted file mode 100644 index 9fd716c..0000000 --- a/tests/GraphQL/Models/ContributionTest.php +++ /dev/null @@ -1,46 +0,0 @@ -setContributionId($contributionId); - $contribution->setContributorId($contributorId); - $contribution->setWorkId($workId); - $contribution->setContributionType($contributionType); - $contribution->setMainContribution($mainContribution); - $contribution->setBiography($biography); - $contribution->setFirstName($firstName); - $contribution->setLastName($lastName); - $contribution->setFullName($fullName); - $contribution->setContributionOrdinal($contributionOrdinal); - - $this->assertSame($contributionId, $contribution->getContributionId()); - $this->assertSame($contributorId, $contribution->getContributorId()); - $this->assertSame($workId, $contribution->getWorkId()); - $this->assertSame($contributionType, $contribution->getContributionType()); - $this->assertSame($mainContribution, $contribution->getMainContribution()); - $this->assertSame($biography, $contribution->getBiography()); - $this->assertSame($firstName, $contribution->getFirstName()); - $this->assertSame($lastName, $contribution->getLastName()); - $this->assertSame($fullName, $contribution->getFullName()); - $this->assertSame($contributionOrdinal, $contribution->getContributionOrdinal()); - } -} diff --git a/tests/GraphQL/Models/ContributorTest.php b/tests/GraphQL/Models/ContributorTest.php deleted file mode 100644 index 700ac5f..0000000 --- a/tests/GraphQL/Models/ContributorTest.php +++ /dev/null @@ -1,34 +0,0 @@ -setContributorId($contributorId); - $contributor->setFirstName($firstName); - $contributor->setLastName($lastName); - $contributor->setFullName($fullName); - $contributor->setOrcid($orcid); - $contributor->setWebsite($website); - - $this->assertSame($contributorId, $contributor->getContributorId()); - $this->assertSame($firstName, $contributor->getFirstName()); - $this->assertSame($lastName, $contributor->getLastName()); - $this->assertSame($fullName, $contributor->getFullName()); - $this->assertSame($orcid, $contributor->getOrcid()); - $this->assertSame($website, $contributor->getWebsite()); - } -} diff --git a/tests/GraphQL/Models/FundingTest.php b/tests/GraphQL/Models/FundingTest.php deleted file mode 100644 index eafb951..0000000 --- a/tests/GraphQL/Models/FundingTest.php +++ /dev/null @@ -1,40 +0,0 @@ -setFundingId($fundingId); - $funding->setWorkId($workId); - $funding->setInstitutionId($institutionId); - $funding->setProgram($program); - $funding->setProjectName($projectName); - $funding->setProjectShortName($projectShortName); - $funding->setGrantNumber($grantNumber); - $funding->setJurisdiction($jurisdiction); - - $this->assertSame($fundingId, $funding->getFundingId()); - $this->assertSame($workId, $funding->getWorkId()); - $this->assertSame($institutionId, $funding->getInstitutionId()); - $this->assertSame($program, $funding->getProgram()); - $this->assertSame($projectName, $funding->getProjectName()); - $this->assertSame($projectShortName, $funding->getProjectShortName()); - $this->assertSame($grantNumber, $funding->getGrantNumber()); - $this->assertSame($jurisdiction, $funding->getJurisdiction()); - } -} diff --git a/tests/GraphQL/Models/ImprintTest.php b/tests/GraphQL/Models/ImprintTest.php deleted file mode 100644 index 2ed1817..0000000 --- a/tests/GraphQL/Models/ImprintTest.php +++ /dev/null @@ -1,31 +0,0 @@ -setImprintId($imprintId); - $imprint->setPublisherId($publisherId); - $imprint->setImprintName($imprintName); - $imprint->setImprintUrl($imprintUrl); - $imprint->setCrossmarkDoi($crossmarkDoi); - - $this->assertSame($imprintId, $imprint->getImprintId()); - $this->assertSame($publisherId, $imprint->getPublisherId()); - $this->assertSame($imprintName, $imprint->getImprintName()); - $this->assertSame($imprintUrl, $imprint->getImprintUrl()); - $this->assertSame($crossmarkDoi, $imprint->getCrossmarkDoi()); - } -} diff --git a/tests/GraphQL/Models/InstitutionTest.php b/tests/GraphQL/Models/InstitutionTest.php deleted file mode 100644 index a0664e2..0000000 --- a/tests/GraphQL/Models/InstitutionTest.php +++ /dev/null @@ -1,31 +0,0 @@ -setInstitutionId($institutionId); - $institution->setInstitutionName($institutionName); - $institution->setInstitutionDoi($institutionDoi); - $institution->setCountryCode($countryCode); - $institution->setRor($ror); - - $this->assertSame($institutionId, $institution->getInstitutionId()); - $this->assertSame($institutionName, $institution->getInstitutionName()); - $this->assertSame($institutionDoi, $institution->getInstitutionDoi()); - $this->assertSame($countryCode, $institution->getCountryCode()); - $this->assertSame($ror, $institution->getRor()); - } -} diff --git a/tests/GraphQL/Models/IssueTest.php b/tests/GraphQL/Models/IssueTest.php deleted file mode 100644 index 7b9dbca..0000000 --- a/tests/GraphQL/Models/IssueTest.php +++ /dev/null @@ -1,28 +0,0 @@ -setIssueId($issueId); - $issue->setWorkId($workId); - $issue->setSeriesId($seriesId); - $issue->setIssueOrdinal($issueOrdinal); - - $this->assertSame($issueId, $issue->getIssueId()); - $this->assertSame($workId, $issue->getWorkId()); - $this->assertSame($seriesId, $issue->getSeriesId()); - $this->assertSame($issueOrdinal, $issue->getIssueOrdinal()); - } -} diff --git a/tests/GraphQL/Models/LanguageTest.php b/tests/GraphQL/Models/LanguageTest.php deleted file mode 100644 index 002bc19..0000000 --- a/tests/GraphQL/Models/LanguageTest.php +++ /dev/null @@ -1,31 +0,0 @@ -setLanguageId($languageId); - $language->setWorkId($workId); - $language->setLanguageCode($languageCode); - $language->setLanguageRelation($languageRelation); - $language->setMainLanguage($mainLanguage); - - $this->assertSame($languageId, $language->getLanguageId()); - $this->assertSame($workId, $language->getWorkId()); - $this->assertSame($languageCode, $language->getLanguageCode()); - $this->assertSame($languageRelation, $language->getLanguageRelation()); - $this->assertSame($mainLanguage, $language->getMainLanguage()); - } -} diff --git a/tests/GraphQL/Models/LocationTest.php b/tests/GraphQL/Models/LocationTest.php deleted file mode 100644 index 56c50d1..0000000 --- a/tests/GraphQL/Models/LocationTest.php +++ /dev/null @@ -1,34 +0,0 @@ -setLocationId($locationId); - $location->setPublicationId($publicationId); - $location->setLandingPage($landingPage); - $location->setFullTextUrl($fullTextUrl); - $location->setLocationPlatform($locationPlatform); - $location->setCanonical($canonical); - - $this->assertSame($locationId, $location->getLocationId()); - $this->assertSame($publicationId, $location->getPublicationId()); - $this->assertSame($landingPage, $location->getLandingPage()); - $this->assertSame($fullTextUrl, $location->getFullTextUrl()); - $this->assertSame($locationPlatform, $location->getLocationPlatform()); - $this->assertSame($canonical, $location->getCanonical()); - } -} diff --git a/tests/GraphQL/Models/PriceTest.php b/tests/GraphQL/Models/PriceTest.php deleted file mode 100644 index 54e4559..0000000 --- a/tests/GraphQL/Models/PriceTest.php +++ /dev/null @@ -1,28 +0,0 @@ -setPriceId($priceId); - $price->setPublicationId($publicationId); - $price->setCurrencyCode($currentCode); - $price->setUnitPrice($unitPrice); - - $this->assertSame($priceId, $price->getPriceId()); - $this->assertSame($publicationId, $price->getPublicationId()); - $this->assertSame($currentCode, $price->getCurrencyCode()); - $this->assertSame($unitPrice, $price->getUnitPrice()); - } -} diff --git a/tests/GraphQL/Models/PublicationTest.php b/tests/GraphQL/Models/PublicationTest.php deleted file mode 100644 index b068cd7..0000000 --- a/tests/GraphQL/Models/PublicationTest.php +++ /dev/null @@ -1,54 +0,0 @@ -setPublicationId($publicationId); - $publication->setWorkId($workId); - $publication->setPublicationType($publicationType); - $publication->setIsbn($isbn); - $publication->setWidthMm($widthMm); - $publication->setHeightMm($heightMm); - $publication->setDepthMm($depthMm); - $publication->setWeightG($weightG); - - $this->assertSame($publicationId, $publication->getPublicationId()); - $this->assertSame($workId, $publication->getWorkId()); - $this->assertSame($publicationType, $publication->getPublicationType()); - $this->assertSame($isbn, $publication->getIsbn()); - $this->assertSame($widthMm, $publication->getWidthMm()); - $this->assertSame($heightMm, $publication->getHeightMm()); - $this->assertSame($depthMm, $publication->getDepthMm()); - $this->assertSame($weightG, $publication->getWeightG()); - } - - public function testGettersAndSettersWithConvention(): void - { - $publication = new Publication(); - $publication->setWidthMm(156, true); - $publication->setHeightMm(234, true); - $publication->setDepthMm(5, true); - $publication->setWeightG(206, true); - - $this->assertSame(6.14, $publication->getWidthIn()); - $this->assertSame(9.21, $publication->getHeightIn()); - $this->assertSame(0.2, $publication->getDepthIn()); - $this->assertSame(7.2664, $publication->getWeightOz()); - } -} diff --git a/tests/GraphQL/Models/PublisherTest.php b/tests/GraphQL/Models/PublisherTest.php deleted file mode 100644 index f81cb2d..0000000 --- a/tests/GraphQL/Models/PublisherTest.php +++ /dev/null @@ -1,28 +0,0 @@ -setPublisherId($publisherId); - $publisher->setPublisherName($publisherName); - $publisher->setPublisherShortName($publisherShortName); - $publisher->setPublisherUrl($publisherUrl); - - $this->assertSame($publisherId, $publisher->getPublisherId()); - $this->assertSame($publisherName, $publisher->getPublisherName()); - $this->assertSame($publisherShortName, $publisher->getPublisherShortName()); - $this->assertSame($publisherUrl, $publisher->getPublisherUrl()); - } -} diff --git a/tests/GraphQL/Models/ReferenceTest.php b/tests/GraphQL/Models/ReferenceTest.php deleted file mode 100644 index c8660f3..0000000 --- a/tests/GraphQL/Models/ReferenceTest.php +++ /dev/null @@ -1,87 +0,0 @@ -setReferenceId($referenceId); - $reference->setWorkId($workId); - $reference->setReferenceOrdinal($referenceOrdinal); - $reference->setDoi($doi); - $reference->setUnstructuredCitation($unstructuredCitation); - $reference->setIssn($issn); - $reference->setIsbn($isbn); - $reference->setJournalTitle($journalTitle); - $reference->setArticleTitle($articleTitle); - $reference->setSeriesTitle($seriesTitle); - $reference->setVolumeTitle($volumeTitle); - $reference->setEdition($edition); - $reference->setAuthor($author); - $reference->setVolume($volume); - $reference->setIssue($issue); - $reference->setFirstPage($firstPage); - $reference->setComponentNumber($componentNumber); - $reference->setStandardDesignator($standardDesignator); - $reference->setStandardsBodyName($standardsBodyName); - $reference->setStandardsBodyAcronym($standardsBodyAcronym); - $reference->setUrl($url); - $reference->setPublicationDate($publicationDate); - $reference->setRetrievalDate($retrievalDate); - - $this->assertSame($referenceId, $reference->getReferenceId()); - $this->assertSame($workId, $reference->getWorkId()); - $this->assertSame($referenceOrdinal, $reference->getReferenceOrdinal()); - $this->assertSame($doi, $reference->getDoi()); - $this->assertSame($unstructuredCitation, $reference->getUnstructuredCitation()); - $this->assertSame($issn, $reference->getIssn()); - $this->assertSame($isbn, $reference->getIsbn()); - $this->assertSame($journalTitle, $reference->getJournalTitle()); - $this->assertSame($articleTitle, $reference->getArticleTitle()); - $this->assertSame($seriesTitle, $reference->getSeriesTitle()); - $this->assertSame($volumeTitle, $reference->getVolumeTitle()); - $this->assertSame($edition, $reference->getEdition()); - $this->assertSame($author, $reference->getAuthor()); - $this->assertSame($volume, $reference->getVolume()); - $this->assertSame($issue, $reference->getIssue()); - $this->assertSame($firstPage, $reference->getFirstPage()); - $this->assertSame($componentNumber, $reference->getComponentNumber()); - $this->assertSame($standardDesignator, $reference->getStandardDesignator()); - $this->assertSame($standardsBodyName, $reference->getStandardsBodyName()); - $this->assertSame($standardsBodyAcronym, $reference->getStandardsBodyAcronym()); - $this->assertSame($url, $reference->getUrl()); - $this->assertSame($publicationDate, $reference->getPublicationDate()); - $this->assertSame($retrievalDate, $reference->getRetrievalDate()); - } -} diff --git a/tests/GraphQL/Models/SeriesTest.php b/tests/GraphQL/Models/SeriesTest.php deleted file mode 100644 index a62d106..0000000 --- a/tests/GraphQL/Models/SeriesTest.php +++ /dev/null @@ -1,43 +0,0 @@ -setSeriesId($seriesId); - $series->setSeriesType($seriesType); - $series->setSeriesName($seriesName); - $series->setIssnPrint($issnPrint); - $series->setIssnDigital($issnDigital); - $series->setSeriesUrl($seriesUrl); - $series->setSeriesDescription($seriesDescription); - $series->setSeriesCfpUrl($seriesCfpUrl); - $series->setImprintId($imprintId); - - $this->assertSame($seriesId, $series->getSeriesId()); - $this->assertSame($seriesType, $series->getSeriesType()); - $this->assertSame($seriesName, $series->getSeriesName()); - $this->assertSame($issnPrint, $series->getIssnPrint()); - $this->assertSame($issnDigital, $series->getIssnDigital()); - $this->assertSame($seriesUrl, $series->getSeriesUrl()); - $this->assertSame($seriesDescription, $series->getSeriesDescription()); - $this->assertSame($seriesCfpUrl, $series->getSeriesCfpUrl()); - $this->assertSame($imprintId, $series->getImprintId()); - } -} diff --git a/tests/GraphQL/Models/SubjectTest.php b/tests/GraphQL/Models/SubjectTest.php deleted file mode 100644 index e0037b3..0000000 --- a/tests/GraphQL/Models/SubjectTest.php +++ /dev/null @@ -1,31 +0,0 @@ -setSubjectId($subjectId); - $subject->setWorkId($workId); - $subject->setSubjectType($subjectType); - $subject->setSubjectCode($subjectCode); - $subject->setSubjectOrdinal($subjectOrdinal); - - $this->assertSame($subjectId, $subject->getSubjectId()); - $this->assertSame($workId, $subject->getWorkId()); - $this->assertSame($subjectType, $subject->getSubjectType()); - $this->assertSame($subjectCode, $subject->getSubjectCode()); - $this->assertSame($subjectOrdinal, $subject->getSubjectOrdinal()); - } -} diff --git a/tests/GraphQL/Models/WorkRelationTest.php b/tests/GraphQL/Models/WorkRelationTest.php deleted file mode 100644 index 04cd5ce..0000000 --- a/tests/GraphQL/Models/WorkRelationTest.php +++ /dev/null @@ -1,31 +0,0 @@ -setWorkRelationId($workRelationId); - $workRelation->setRelatorWorkId($relatorWorkId); - $workRelation->setRelatedWorkId($relatedWorkId); - $workRelation->setRelationType($relationType); - $workRelation->setRelationOrdinal($relationOrdinal); - - $this->assertSame($workRelationId, $workRelation->getWorkRelationId()); - $this->assertSame($relatorWorkId, $workRelation->getRelatorWorkId()); - $this->assertSame($relatedWorkId, $workRelation->getRelatedWorkId()); - $this->assertSame($relationType, $workRelation->getRelationType()); - $this->assertSame($relationOrdinal, $workRelation->getRelationOrdinal()); - } -} diff --git a/tests/GraphQL/Models/WorkTest.php b/tests/GraphQL/Models/WorkTest.php deleted file mode 100644 index 88ee252..0000000 --- a/tests/GraphQL/Models/WorkTest.php +++ /dev/null @@ -1,122 +0,0 @@ -setWorkId($workId); - $work->setWorkType($workType); - $work->setWorkStatus($workStatus); - $work->setFullTitle($fullTitle); - $work->setTitle($title); - $work->setSubtitle($subtitle); - $work->setReference($reference); - $work->setEdition($edition); - $work->setImprintId($imprintId); - $work->setDoi($doi); - $work->setPublicationDate($publicationDate); - $work->setWithdrawnDate($withdrawnDate); - $work->setPlace($place); - $work->setPageCount($pageCount); - $work->setPageBreakdown($pageBreakdown); - $work->setImageCount($imageCount); - $work->setTableCount($tableCount); - $work->setAudioCount($audioCount); - $work->setVideoCount($videoCount); - $work->setLicense($license); - $work->setCopyrightHolder($copyrightHolder); - $work->setLandingPage($landingPage); - $work->setLccn($lccn); - $work->setOclc($oclc); - $work->setShortAbstract($shortAbstract); - $work->setLongAbstract($longAbstract); - $work->setGeneralNote($generalNote); - $work->setBibliographyNote($bibliographyNote); - $work->setToc($toc); - $work->setCoverUrl($coverUrl); - $work->setCoverCaption($coverCaption); - $work->setFirstPage($firstPage); - $work->setLastPage($lastPage); - $work->setPageInterval($pageInterval); - - $this->assertSame($workId, $work->getWorkId()); - $this->assertSame($workType, $work->getWorkType()); - $this->assertSame($workStatus, $work->getWorkStatus()); - $this->assertSame($fullTitle, $work->getFullTitle()); - $this->assertSame($title, $work->getTitle()); - $this->assertSame($subtitle, $work->getSubtitle()); - $this->assertSame($reference, $work->getReference()); - $this->assertSame($edition, $work->getEdition()); - $this->assertSame($imprintId, $work->getImprintId()); - $this->assertSame($doi, $work->getDoi()); - $this->assertSame($publicationDate, $work->getPublicationDate()); - $this->assertSame($withdrawnDate, $work->getWithdrawnDate()); - $this->assertSame($place, $work->getPlace()); - $this->assertSame($pageCount, $work->getPageCount()); - $this->assertSame($pageBreakdown, $work->getPageBreakdown()); - $this->assertSame($imageCount, $work->getImageCount()); - $this->assertSame($tableCount, $work->getTableCount()); - $this->assertSame($audioCount, $work->getAudioCount()); - $this->assertSame($videoCount, $work->getVideoCount()); - $this->assertSame($license, $work->getLicense()); - $this->assertSame($copyrightHolder, $work->getCopyrightHolder()); - $this->assertSame($landingPage, $work->getLandingPage()); - $this->assertSame($lccn, $work->getLccn()); - $this->assertSame($oclc, $work->getOclc()); - $this->assertSame($shortAbstract, $work->getShortAbstract()); - $this->assertSame($longAbstract, $work->getLongAbstract()); - $this->assertSame($generalNote, $work->getGeneralNote()); - $this->assertSame($bibliographyNote, $work->getBibliographyNote()); - $this->assertSame($toc, $work->getToc()); - $this->assertSame($coverUrl, $work->getCoverUrl()); - $this->assertSame($coverCaption, $work->getCoverCaption()); - $this->assertSame($firstPage, $work->getFirstPage()); - $this->assertSame($lastPage, $work->getLastPage()); - $this->assertSame($pageInterval, $work->getPageInterval()); - } -} diff --git a/tests/GraphQL/MutationBuilderSchemaSyncTest.php b/tests/GraphQL/MutationBuilderSchemaSyncTest.php deleted file mode 100644 index a3078ce..0000000 --- a/tests/GraphQL/MutationBuilderSchemaSyncTest.php +++ /dev/null @@ -1,333 +0,0 @@ -assertMutation( - 'createAdditionalResource', - 'workId: "c53fa7ab-0ae0-44fd-ad28-1d5b8a5e3859", title: "Resource title", description: "Resource description", attribution: "John Doe", resourceType: OTHER, doi: "https:\/\/doi.org\/10.00000\/00000000", handle: "https:\/\/hdl.handle.net\/123", url: "https:\/\/example.com", date: "2026-04-10", resourceOrdinal: 2', - 'workResourceId', - [ - 'workId' => 'c53fa7ab-0ae0-44fd-ad28-1d5b8a5e3859', - 'title' => 'Resource title', - 'description' => 'Resource description', - 'attribution' => 'John Doe', - 'resourceType' => 'OTHER', - 'doi' => 'https://doi.org/10.00000/00000000', - 'handle' => 'https://hdl.handle.net/123', - 'url' => 'https://example.com', - 'date' => '2026-04-10', - 'resourceOrdinal' => 2, - ], - 'markupFormat: HTML', - true, - ['markupFormat' => 'HTML'] - ); - - $this->assertMutation( - 'updateAdditionalResource', - 'additionalResourceId: "6f02b20c-e94e-46ff-a3f7-87f9e20bf9fd", workId: "c53fa7ab-0ae0-44fd-ad28-1d5b8a5e3859", title: "Resource title", description: "Resource description", attribution: "John Doe", resourceType: OTHER, doi: "https:\/\/doi.org\/10.00000\/00000000", handle: "https:\/\/hdl.handle.net\/123", url: "https:\/\/example.com", date: "2026-04-10", resourceOrdinal: 2', - 'workResourceId', - [ - 'additionalResourceId' => '6f02b20c-e94e-46ff-a3f7-87f9e20bf9fd', - 'workId' => 'c53fa7ab-0ae0-44fd-ad28-1d5b8a5e3859', - 'title' => 'Resource title', - 'description' => 'Resource description', - 'attribution' => 'John Doe', - 'resourceType' => 'OTHER', - 'doi' => 'https://doi.org/10.00000/00000000', - 'handle' => 'https://hdl.handle.net/123', - 'url' => 'https://example.com', - 'date' => '2026-04-10', - 'resourceOrdinal' => 2, - ], - 'markupFormat: HTML', - true, - ['markupFormat' => 'HTML'] - ); - - $this->assertMutation( - 'deleteAdditionalResource', - 'additionalResourceId: "6f02b20c-e94e-46ff-a3f7-87f9e20bf9fd"', - 'workResourceId', - ['additionalResourceId' => '6f02b20c-e94e-46ff-a3f7-87f9e20bf9fd'], - '', - false - ); - } - - public function testBuildMarkupMutations(): void - { - $this->assertMutation( - 'createAbstract', - 'workId: "b0a17dad-4ef0-4429-89e4-a3ddd9c4f72a", content: "Abstract text", localeCode: EN_GB, abstractType: LONG, canonical: true', - 'abstractId', - [ - 'workId' => 'b0a17dad-4ef0-4429-89e4-a3ddd9c4f72a', - 'content' => 'Abstract text', - 'localeCode' => 'EN_GB', - 'abstractType' => 'LONG', - 'canonical' => true, - ], - 'markupFormat: HTML', - true, - ['markupFormat' => 'HTML'] - ); - - $this->assertMutation( - 'createAward', - 'workId: "b0a17dad-4ef0-4429-89e4-a3ddd9c4f72a", title: "Award title", url: "https:\/\/example.com\/award", category: "Prize", year: 2026, jury: "Jury", country: GB, prizeStatement: "Winner", role: AUTHOR, awardOrdinal: 1', - 'awardId', - [ - 'workId' => 'b0a17dad-4ef0-4429-89e4-a3ddd9c4f72a', - 'title' => 'Award title', - 'url' => 'https://example.com/award', - 'category' => 'Prize', - 'year' => 2026, - 'jury' => 'Jury', - 'country' => 'GB', - 'prizeStatement' => 'Winner', - 'role' => 'AUTHOR', - 'awardOrdinal' => 1, - ], - 'markupFormat: HTML', - true, - ['markupFormat' => 'HTML'] - ); - - $this->assertMutation( - 'createBiography', - 'contributionId: "7b865707-f8ec-4c14-a580-f4a9767f2dd5", content: "Biography text", canonical: true, localeCode: EN_GB', - 'biographyId', - [ - 'contributionId' => '7b865707-f8ec-4c14-a580-f4a9767f2dd5', - 'content' => 'Biography text', - 'canonical' => true, - 'localeCode' => 'EN_GB', - ], - 'markupFormat: HTML', - true, - ['markupFormat' => 'HTML'] - ); - - $this->assertMutation( - 'createBookReview', - 'workId: "b0a17dad-4ef0-4429-89e4-a3ddd9c4f72a", title: "Review title", authorName: "John Doe", reviewerOrcid: "https:\/\/orcid.org\/0000-0000-0000-0000", reviewerInstitutionId: "77af8f4c-0ea0-44de-bbfa-c68cc2fc60fb", url: "https:\/\/example.com\/review", doi: "https:\/\/doi.org\/10.00000\/11111111", reviewDate: "2026-04-10", journalName: "Journal", journalVolume: "4", journalNumber: "2", journalIssn: "1234-5678", pageRange: "10-12", text: "Review text", reviewOrdinal: 3', - 'bookReviewId', - [ - 'workId' => 'b0a17dad-4ef0-4429-89e4-a3ddd9c4f72a', - 'title' => 'Review title', - 'authorName' => 'John Doe', - 'reviewerOrcid' => 'https://orcid.org/0000-0000-0000-0000', - 'reviewerInstitutionId' => '77af8f4c-0ea0-44de-bbfa-c68cc2fc60fb', - 'url' => 'https://example.com/review', - 'doi' => 'https://doi.org/10.00000/11111111', - 'reviewDate' => '2026-04-10', - 'journalName' => 'Journal', - 'journalVolume' => '4', - 'journalNumber' => '2', - 'journalIssn' => '1234-5678', - 'pageRange' => '10-12', - 'text' => 'Review text', - 'reviewOrdinal' => 3, - ], - 'markupFormat: HTML', - true, - ['markupFormat' => 'HTML'] - ); - - $this->assertMutation( - 'createEndorsement', - 'workId: "b0a17dad-4ef0-4429-89e4-a3ddd9c4f72a", authorName: "Jane Doe", authorRole: "Editor", authorOrcid: "https:\/\/orcid.org\/0000-0000-0000-0001", authorInstitutionId: "77af8f4c-0ea0-44de-bbfa-c68cc2fc60fb", url: "https:\/\/example.com\/endorsement", text: "Endorsement text", endorsementOrdinal: 1', - 'endorsementId', - [ - 'workId' => 'b0a17dad-4ef0-4429-89e4-a3ddd9c4f72a', - 'authorName' => 'Jane Doe', - 'authorRole' => 'Editor', - 'authorOrcid' => 'https://orcid.org/0000-0000-0000-0001', - 'authorInstitutionId' => '77af8f4c-0ea0-44de-bbfa-c68cc2fc60fb', - 'url' => 'https://example.com/endorsement', - 'text' => 'Endorsement text', - 'endorsementOrdinal' => 1, - ], - 'markupFormat: HTML', - true, - ['markupFormat' => 'HTML'] - ); - - $this->assertMutation( - 'createTitle', - 'workId: "b0a17dad-4ef0-4429-89e4-a3ddd9c4f72a", localeCode: EN_GB, fullTitle: "Full title", title: "Title", subtitle: "Subtitle", canonical: true', - 'titleId', - [ - 'workId' => 'b0a17dad-4ef0-4429-89e4-a3ddd9c4f72a', - 'localeCode' => 'EN_GB', - 'fullTitle' => 'Full title', - 'title' => 'Title', - 'subtitle' => 'Subtitle', - 'canonical' => true, - ], - 'markupFormat: HTML', - true, - ['markupFormat' => 'HTML'] - ); - } - - public function testBuildContactAndFeaturedVideoMutations(): void - { - $this->assertMutation( - 'createContact', - 'publisherId: "f70cac7c-b6c2-4af6-833b-910bb8bb1741", contactType: SUPPORT, email: "support@example.com"', - 'contactId', - [ - 'publisherId' => 'f70cac7c-b6c2-4af6-833b-910bb8bb1741', - 'contactType' => 'SUPPORT', - 'email' => 'support@example.com', - ] - ); - - $this->assertMutation( - 'updateContact', - 'contactId: "d83d440f-190f-4695-b752-3080c5d4ea40", publisherId: "f70cac7c-b6c2-4af6-833b-910bb8bb1741", contactType: SUPPORT, email: "support@example.com"', - 'contactId', - [ - 'contactId' => 'd83d440f-190f-4695-b752-3080c5d4ea40', - 'publisherId' => 'f70cac7c-b6c2-4af6-833b-910bb8bb1741', - 'contactType' => 'SUPPORT', - 'email' => 'support@example.com', - ] - ); - - $this->assertMutation( - 'deleteContact', - 'contactId: "d83d440f-190f-4695-b752-3080c5d4ea40"', - 'contactId', - ['contactId' => 'd83d440f-190f-4695-b752-3080c5d4ea40'], - '', - false - ); - - $this->assertMutation( - 'createWorkFeaturedVideo', - 'workId: "b0a17dad-4ef0-4429-89e4-a3ddd9c4f72a", title: "Featured video", url: "https:\/\/example.com\/video", width: 1920, height: 1080', - 'workFeaturedVideoId', - [ - 'workId' => 'b0a17dad-4ef0-4429-89e4-a3ddd9c4f72a', - 'title' => 'Featured video', - 'url' => 'https://example.com/video', - 'width' => 1920, - 'height' => 1080, - ] - ); - } - - public function testBuildMoveMutations(): void - { - $cases = [ - ['moveAffiliation', 'affiliationId', 'affiliationId'], - ['moveContribution', 'contributionId', 'contributionId'], - ['moveIssue', 'issueId', 'issueId'], - ['moveReference', 'referenceId', 'referenceId'], - ['moveAdditionalResource', 'additionalResourceId', 'workResourceId'], - ['moveAward', 'awardId', 'awardId'], - ['moveEndorsement', 'endorsementId', 'endorsementId'], - ['moveBookReview', 'bookReviewId', 'bookReviewId'], - ['moveSubject', 'subjectId', 'subjectId'], - ['moveWorkRelation', 'workRelationId', 'workRelationId'], - ]; - - foreach ($cases as $case) { - $this->assertMutation( - $case[0], - $case[1] . ': "6b4060ff-a89b-4bdc-b722-2b87ef9d057a", newOrdinal: 4', - $case[2], - [ - $case[1] => '6b4060ff-a89b-4bdc-b722-2b87ef9d057a', - 'newOrdinal' => 4, - ], - '', - false - ); - } - } - - public function testBuildUploadMutations(): void - { - $common = [ - 'declaredMimeType' => 'application/pdf', - 'declaredExtension' => 'pdf', - 'declaredSha256' => 'abc123', - ]; - - $this->assertMutation( - 'initPublicationFileUpload', - 'publicationId: "f70cac7c-b6c2-4af6-833b-910bb8bb1741", declaredMimeType: "application\/pdf", declaredExtension: "pdf", declaredSha256: "abc123"', - 'fileUploadId', - ['publicationId' => 'f70cac7c-b6c2-4af6-833b-910bb8bb1741'] + $common - ); - - $this->assertMutation( - 'initFrontcoverFileUpload', - 'workId: "f70cac7c-b6c2-4af6-833b-910bb8bb1741", declaredMimeType: "application\/pdf", declaredExtension: "pdf", declaredSha256: "abc123"', - 'fileUploadId', - ['workId' => 'f70cac7c-b6c2-4af6-833b-910bb8bb1741'] + $common - ); - - $this->assertMutation( - 'initAdditionalResourceFileUpload', - 'additionalResourceId: "f70cac7c-b6c2-4af6-833b-910bb8bb1741", declaredMimeType: "application\/pdf", declaredExtension: "pdf", declaredSha256: "abc123"', - 'fileUploadId', - ['additionalResourceId' => 'f70cac7c-b6c2-4af6-833b-910bb8bb1741'] + $common - ); - - $this->assertMutation( - 'initWorkFeaturedVideoFileUpload', - 'workFeaturedVideoId: "f70cac7c-b6c2-4af6-833b-910bb8bb1741", declaredMimeType: "application\/pdf", declaredExtension: "pdf", declaredSha256: "abc123"', - 'fileUploadId', - ['workFeaturedVideoId' => 'f70cac7c-b6c2-4af6-833b-910bb8bb1741'] + $common - ); - - $this->assertMutation( - 'completeFileUpload', - 'fileUploadId: "f70cac7c-b6c2-4af6-833b-910bb8bb1741"', - 'fileId', - ['fileUploadId' => 'f70cac7c-b6c2-4af6-833b-910bb8bb1741'] - ); - } - - private function assertMutation( - string $mutationName, - string $data, - string $returnValue, - array $input, - string $extraArgs = '', - bool $nested = true, - array $extraInput = [] - ): void { - $args = [$nested ? 'data: {' . $data . '}' : $data]; - if ($extraArgs !== '') { - $args[] = $extraArgs; - } - - $expectedMutation = <<assertSame($expectedMutation, $mutation); - } -} diff --git a/tests/GraphQL/MutationBuilderTest.php b/tests/GraphQL/MutationBuilderTest.php deleted file mode 100644 index 2b5faf0..0000000 --- a/tests/GraphQL/MutationBuilderTest.php +++ /dev/null @@ -1,1677 +0,0 @@ -expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Mutation \'foo\' not found.'); - - $mutation = MutationBuilder::build('foo', []); - } - - public function testBuildCreateAffiliationMutation(): void - { - $mutationName = 'createAffiliation'; - $data = 'contributionId: "c6f1380f-e4e5-4638-aab8-ee550cee449e", ' . - 'institutionId: "730095c4-99d3-4f4f-af3b-e189e2364bac", ' . - 'affiliationOrdinal: 1'; - $returnValue = 'affiliationId'; - - $expectedMutation = << 'c6f1380f-e4e5-4638-aab8-ee550cee449e', - 'institutionId' => '730095c4-99d3-4f4f-af3b-e189e2364bac', - 'affiliationOrdinal' => 1, - 'position' => null - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildUpdateAffiliationMutation(): void - { - $mutationName = 'updateAffiliation'; - $data = 'affiliationId: "c3f76bf8-bf27-447c-9934-97340e65ed12", ' . - 'contributionId: "c6f1380f-e4e5-4638-aab8-ee550cee449e", ' . - 'institutionId: "730095c4-99d3-4f4f-af3b-e189e2364bac", ' . - 'affiliationOrdinal: 1, ' . - 'position: "Foobar"'; - $returnValue = 'affiliationId'; - - $expectedMutation = << 'c3f76bf8-bf27-447c-9934-97340e65ed12', - 'contributionId' => 'c6f1380f-e4e5-4638-aab8-ee550cee449e', - 'institutionId' => '730095c4-99d3-4f4f-af3b-e189e2364bac', - 'affiliationOrdinal' => 1, - 'position' => 'Foobar' - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildDeleteAffiliationMutation(): void - { - $mutationName = 'deleteAffiliation'; - $data = 'affiliationId: "c3f76bf8-bf27-447c-9934-97340e65ed12"'; - $returnValue = 'affiliationId'; - - $expectedMutation = << 'c3f76bf8-bf27-447c-9934-97340e65ed12'], - false - ); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildCreateContributionMutation(): void - { - $mutationName = 'createContribution'; - $data = 'workId: "c53fa7ab-0ae0-44fd-ad28-1d5b8a5e3859", ' . - 'contributorId: "8b8e429d-a03c-42a7-a861-842841fae9e0", ' . - 'contributionType: AUTHOR, ' . - 'mainContribution: true, ' . - 'contributionOrdinal: 1, ' . - 'firstName: "John", ' . - 'lastName: "Doe", ' . - 'fullName: "John Doe"'; - $returnValue = 'contributionId'; - - $expectedMutation = << 'c53fa7ab-0ae0-44fd-ad28-1d5b8a5e3859', - 'contributorId' => '8b8e429d-a03c-42a7-a861-842841fae9e0', - 'contributionType' => 'AUTHOR', - 'mainContribution' => true, - 'contributionOrdinal' => 1, - 'firstName' => 'John', - 'lastName' => 'Doe', - 'fullName' => 'John Doe', - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildUpdateContributionMutation(): void - { - $mutationName = 'updateContribution'; - $data = 'contributionId: "f7645045-7424-4912-af34-13b915ec76bc", ' . - 'workId: "c53fa7ab-0ae0-44fd-ad28-1d5b8a5e3859", ' . - 'contributorId: "8b8e429d-a03c-42a7-a861-842841fae9e0", ' . - 'contributionType: AUTHOR, ' . - 'mainContribution: true, ' . - 'contributionOrdinal: 1, ' . - 'firstName: "John", ' . - 'lastName: "Doe", ' . - 'fullName: "John Doe"'; - $returnValue = 'contributionId'; - - $expectedMutation = << 'f7645045-7424-4912-af34-13b915ec76bc', - 'workId' => 'c53fa7ab-0ae0-44fd-ad28-1d5b8a5e3859', - 'contributorId' => '8b8e429d-a03c-42a7-a861-842841fae9e0', - 'contributionType' => 'AUTHOR', - 'mainContribution' => true, - 'contributionOrdinal' => 1, - 'firstName' => 'John', - 'lastName' => 'Doe', - 'fullName' => 'John Doe', - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildDeleteContributionMutation(): void - { - $mutationName = 'deleteContribution'; - $data = 'contributionId: "f7645045-7424-4912-af34-13b915ec76bc"'; - $returnValue = 'contributionId'; - - $expectedMutation = << 'f7645045-7424-4912-af34-13b915ec76bc'], - false - ); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildCreateContributorMutation(): void - { - $mutationName = 'createContributor'; - $data = 'firstName: "Mary", ' . - 'lastName: "Sue", ' . - 'fullName: "Mary Sue", ' . - 'orcid: "https:\/\/orcid.org\/0000-0000-0000-0000", ' . - 'website: "https:\/\/www.marysue.com\/"'; - $returnValue = 'contributorId'; - - $expectedMutation = << 'Mary', - 'lastName' => 'Sue', - 'fullName' => 'Mary Sue', - 'orcid' => 'https://orcid.org/0000-0000-0000-0000', - 'website' => 'https://www.marysue.com/' - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildUpdateContributorMutation(): void - { - $mutationName = 'updateContributor'; - $data = 'contributorId: "bcd08ad4-53bc-47a9-a780-b9f770cf38bf", ' . - 'firstName: "Mary", ' . - 'lastName: "Sue", ' . - 'fullName: "Mary Sue", ' . - 'orcid: "https:\/\/orcid.org\/0000-0000-0000-0000", ' . - 'website: "https:\/\/www.marysue.com\/"'; - $returnValue = 'contributorId'; - - $expectedMutation = << 'bcd08ad4-53bc-47a9-a780-b9f770cf38bf', - 'firstName' => 'Mary', - 'lastName' => 'Sue', - 'fullName' => 'Mary Sue', - 'orcid' => 'https://orcid.org/0000-0000-0000-0000', - 'website' => 'https://www.marysue.com/' - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildDeleteContributorMutation(): void - { - $mutationName = 'deleteContributor'; - $data = 'contributorId: "bcd08ad4-53bc-47a9-a780-b9f770cf38bf"'; - $returnValue = 'contributorId'; - - $expectedMutation = << 'bcd08ad4-53bc-47a9-a780-b9f770cf38bf'], - false - ); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildCreateFundingMutation(): void - { - $mutationName = 'createFunding'; - $data = 'workId: "1891ec7a-e9b3-4d77-b0cc-c17130d9c7d1", ' . - 'institutionId: "d322dbb8-1168-40fd-a111-70a0ac1bbaa8", ' . - 'program: "FSE", ' . - 'projectName: "Marine Renewable Energy as Alien", ' . - 'projectShortname: "Alien Energy", ' . - 'grantNumber: "0602-02551B"'; - $returnValue = 'fundingId'; - - $expectedMutation = << '1891ec7a-e9b3-4d77-b0cc-c17130d9c7d1', - 'institutionId' => 'd322dbb8-1168-40fd-a111-70a0ac1bbaa8', - 'program' => 'FSE', - 'projectName' => 'Marine Renewable Energy as Alien', - 'projectShortname' => 'Alien Energy', - 'grantNumber' => '0602-02551B', - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildUpdateFundingMutation(): void - { - $mutationName = 'updateFunding'; - $data = 'fundingId: "faa6e266-3b32-4465-b355-22c6721fe788", ' . - 'workId: "1891ec7a-e9b3-4d77-b0cc-c17130d9c7d1", ' . - 'institutionId: "d322dbb8-1168-40fd-a111-70a0ac1bbaa8", ' . - 'program: "FSE", ' . - 'projectName: "Marine Renewable Energy as Alien", ' . - 'projectShortname: "Alien Energy", ' . - 'grantNumber: "0602-02551B"'; - $returnValue = 'fundingId'; - - $expectedMutation = << 'faa6e266-3b32-4465-b355-22c6721fe788', - 'workId' => '1891ec7a-e9b3-4d77-b0cc-c17130d9c7d1', - 'institutionId' => 'd322dbb8-1168-40fd-a111-70a0ac1bbaa8', - 'program' => 'FSE', - 'projectName' => 'Marine Renewable Energy as Alien', - 'projectShortname' => 'Alien Energy', - 'grantNumber' => '0602-02551B', - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildDeleteFundingMutation(): void - { - $mutationName = 'deleteFunding'; - $data = 'fundingId: "bcd08ad4-53bc-47a9-a780-b9f770cf38bf"'; - $returnValue = 'fundingId'; - - $expectedMutation = << 'bcd08ad4-53bc-47a9-a780-b9f770cf38bf'], - false - ); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildCreateImprintMutation(): void - { - $mutationName = 'createImprint'; - $data = 'publisherId: "eac9c4ab-ed52-4482-8181-e03398904269", ' . - 'imprintName: "FooBar", ' . - 'imprintUrl: "https:\/\/foo.bar\/", ' . - 'crossmarkDoi: "https:\/\/doi.org\/10.5555\/12345678"'; - $returnValue = 'imprintId'; - - $expectedMutation = << 'eac9c4ab-ed52-4482-8181-e03398904269', - 'imprintName' => 'FooBar', - 'imprintUrl' => 'https://foo.bar/', - 'crossmarkDoi' => 'https://doi.org/10.5555/12345678' - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildUpdateImprintMutation(): void - { - $mutationName = 'updateImprint'; - $data = 'imprintId: "6791d262-ac0b-4518-9c93-9d5f63d270eb", ' . - 'publisherId: "eac9c4ab-ed52-4482-8181-e03398904269", ' . - 'imprintName: "FooBar", ' . - 'imprintUrl: "https:\/\/foo.bar\/", ' . - 'crossmarkDoi: "https:\/\/doi.org\/10.5555\/12345678"'; - $returnValue = 'imprintId'; - - $expectedMutation = << '6791d262-ac0b-4518-9c93-9d5f63d270eb', - 'publisherId' => 'eac9c4ab-ed52-4482-8181-e03398904269', - 'imprintName' => 'FooBar', - 'imprintUrl' => 'https://foo.bar/', - 'crossmarkDoi' => 'https://doi.org/10.5555/12345678' - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildDeleteImprintMutation(): void - { - $mutationName = 'deleteImprint'; - $data = 'imprintId: "6791d262-ac0b-4518-9c93-9d5f63d270eb"'; - $returnValue = 'imprintId'; - - $expectedMutation = << '6791d262-ac0b-4518-9c93-9d5f63d270eb'], - false - ); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildCreateInstitutionMutation(): void - { - $mutationName = 'createInstitution'; - $data = 'institutionName: "FooBar", ' . - 'institutionDoi: "https:\/\/doi.org\/10.55555\/100000001", ' . - 'countryCode: IOT, ' . - 'ror: "https:\/\/ror.org\/012x3z456"'; - $returnValue = 'institutionId'; - - $expectedMutation = << 'FooBar', - 'countryCode' => 'IOT', - 'institutionDoi' => 'https://doi.org/10.55555/100000001', - 'ror' => 'https://ror.org/012x3z456' - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildUpdateInstitutionMutation(): void - { - $mutationName = 'updateInstitution'; - $data = 'institutionId: "a89dc5c9-dc51-4a3e-860d-ba9285c3bd1d", ' . - 'institutionName: "FooBar", ' . - 'institutionDoi: "https:\/\/doi.org\/10.55555\/100000001", ' . - 'countryCode: IOT, ' . - 'ror: "https:\/\/ror.org\/012x3z456"'; - $returnValue = 'institutionId'; - - $expectedMutation = << 'a89dc5c9-dc51-4a3e-860d-ba9285c3bd1d', - 'institutionName' => 'FooBar', - 'countryCode' => 'IOT', - 'institutionDoi' => 'https://doi.org/10.55555/100000001', - 'ror' => 'https://ror.org/012x3z456' - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildDeleteInstitutionMutation(): void - { - $mutationName = 'deleteInstitution'; - $data = 'institutionId: "a89dc5c9-dc51-4a3e-860d-ba9285c3bd1d"'; - $returnValue = 'institutionId'; - - $expectedMutation = << 'a89dc5c9-dc51-4a3e-860d-ba9285c3bd1d'], - false - ); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildCreateIssueMutation(): void - { - $mutationName = 'createIssue'; - $data = 'seriesId: "d0818cf4-a22a-4d1d-845e-a6f46650a294", ' . - 'workId: "89b9e3f2-82d1-4c15-9a4f-f28332addabf", ' . - 'issueOrdinal: 10'; - $returnValue = 'issueId'; - - $expectedMutation = << 'd0818cf4-a22a-4d1d-845e-a6f46650a294', - 'workId' => '89b9e3f2-82d1-4c15-9a4f-f28332addabf', - 'issueOrdinal' => 10 - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildUpdateIssueMutation(): void - { - $mutationName = 'updateIssue'; - $data = 'issueId: "0c02c522-07a3-4c89-95c6-b5f4cdea31a3", ' . - 'seriesId: "d0818cf4-a22a-4d1d-845e-a6f46650a294", ' . - 'workId: "89b9e3f2-82d1-4c15-9a4f-f28332addabf", ' . - 'issueOrdinal: 10'; - $returnValue = 'issueId'; - - $expectedMutation = << '0c02c522-07a3-4c89-95c6-b5f4cdea31a3', - 'seriesId' => 'd0818cf4-a22a-4d1d-845e-a6f46650a294', - 'workId' => '89b9e3f2-82d1-4c15-9a4f-f28332addabf', - 'issueOrdinal' => 10 - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildDeleteIssueMutation(): void - { - $mutationName = 'deleteIssue'; - $data = 'issueId: "0c02c522-07a3-4c89-95c6-b5f4cdea31a3"'; - $returnValue = 'issueId'; - - $expectedMutation = << '0c02c522-07a3-4c89-95c6-b5f4cdea31a3'], - false - ); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildCreateLanguageMutation(): void - { - $mutationName = 'createLanguage'; - $data = 'workId: "dcff2c6a-a81d-4af5-a08b-cef22928911b", ' . - 'languageCode: AAR, ' . - 'languageRelation: ORIGINAL'; - $returnValue = 'languageId'; - - $expectedMutation = << 'dcff2c6a-a81d-4af5-a08b-cef22928911b', - 'languageCode' => 'AAR', - 'languageRelation' => 'ORIGINAL', - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildUpdateLanguageMutation(): void - { - $mutationName = 'updateLanguage'; - $data = 'languageId: "c5fe1926-d702-468b-b98e-984e1b49acf9", ' . - 'workId: "dcff2c6a-a81d-4af5-a08b-cef22928911b", ' . - 'languageCode: AAR, ' . - 'languageRelation: ORIGINAL'; - $returnValue = 'languageId'; - - $expectedMutation = << 'c5fe1926-d702-468b-b98e-984e1b49acf9', - 'workId' => 'dcff2c6a-a81d-4af5-a08b-cef22928911b', - 'languageCode' => 'AAR', - 'languageRelation' => 'ORIGINAL', - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildDeleteLanguageMutation(): void - { - $mutationName = 'deleteLanguage'; - $data = 'languageId: "c5fe1926-d702-468b-b98e-984e1b49acf9"'; - $returnValue = 'languageId'; - - $expectedMutation = << 'c5fe1926-d702-468b-b98e-984e1b49acf9'], - false - ); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildCreateLocationMutation(): void - { - $mutationName = 'createLocation'; - $data = 'publicationId: "7b27a854-7bc5-47aa-aa84-cacd8724b290", ' . - 'locationPlatform: PROJECT_MUSE, ' . - 'canonical: false, ' . - 'landingPage: "https:\/\/foo.bar", ' . - 'fullTextUrl: "https:\/\/foo.bar\/baz\/qux"'; - $returnValue = 'locationId'; - - $expectedMutation = << '7b27a854-7bc5-47aa-aa84-cacd8724b290', - 'locationPlatform' => 'PROJECT_MUSE', - 'canonical' => false, - 'fullTextUrl' => 'https://foo.bar/baz/qux', - 'landingPage' => 'https://foo.bar' - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildUpdateLocationMutation(): void - { - $mutationName = 'updateLocation'; - $data = 'locationId: "fd0b0ad5-b1ac-4340-bd8f-81c42b71921a", ' . - 'publicationId: "7b27a854-7bc5-47aa-aa84-cacd8724b290", ' . - 'locationPlatform: PROJECT_MUSE, ' . - 'canonical: false, ' . - 'landingPage: "https:\/\/foo.bar", ' . - 'fullTextUrl: "https:\/\/foo.bar\/baz\/qux"'; - $returnValue = 'locationId'; - - $expectedMutation = << 'fd0b0ad5-b1ac-4340-bd8f-81c42b71921a', - 'publicationId' => '7b27a854-7bc5-47aa-aa84-cacd8724b290', - 'locationPlatform' => 'PROJECT_MUSE', - 'canonical' => false, - 'fullTextUrl' => 'https://foo.bar/baz/qux', - 'landingPage' => 'https://foo.bar' - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildDeleteLocationMutation(): void - { - $mutationName = 'deleteLocation'; - $data = 'locationId: "fd0b0ad5-b1ac-4340-bd8f-81c42b71921a"'; - $returnValue = 'locationId'; - - $expectedMutation = << 'fd0b0ad5-b1ac-4340-bd8f-81c42b71921a'], - false - ); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildCreatePriceMutation(): void - { - $mutationName = 'createPrice'; - $data = 'publicationId: "a635e1b6-1994-4f05-b0eb-337612950205", ' . - 'currencyCode: BWP, ' . - 'unitPrice: 1.5'; - $returnValue = 'priceId'; - - $expectedMutation = << 'a635e1b6-1994-4f05-b0eb-337612950205', - 'currencyCode' => 'BWP', - 'unitPrice' => 1.5 - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildUpdatePriceMutation(): void - { - $mutationName = 'updatePrice'; - $data = 'priceId: "3a5bf0d0-adc7-4787-af24-3a4f3c49098c", ' . - 'publicationId: "a635e1b6-1994-4f05-b0eb-337612950205", ' . - 'currencyCode: BWP, ' . - 'unitPrice: 1.5'; - $returnValue = 'priceId'; - - $expectedMutation = << '3a5bf0d0-adc7-4787-af24-3a4f3c49098c', - 'publicationId' => 'a635e1b6-1994-4f05-b0eb-337612950205', - 'currencyCode' => 'BWP', - 'unitPrice' => 1.5 - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildDeletePriceMutation(): void - { - $mutationName = 'deletePrice'; - $data = 'priceId: "3a5bf0d0-adc7-4787-af24-3a4f3c49098c"'; - $returnValue = 'priceId'; - - $expectedMutation = << '3a5bf0d0-adc7-4787-af24-3a4f3c49098c'], - false - ); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildCreatePublicationMutation(): void - { - $mutationName = 'createPublication'; - $data = 'publicationType: PAPERBACK, ' . - 'workId: "c67656e3-7c36-4ef5-b3d9-decc76c7b215", ' . - 'depthMm: 1.5, ' . - 'depthIn: 1.5, ' . - 'widthMm: 1.5, ' . - 'widthIn: 1.5, ' . - 'heightMm: 1.5, ' . - 'heightIn: 1.5, ' . - 'weightG: 1.5, ' . - 'weightOz: 1.5, ' . - 'isbn: "987-6-54321-234-5"'; - $returnValue = 'publicationId'; - - $expectedMutation = << 'PAPERBACK', - 'workId' => 'c67656e3-7c36-4ef5-b3d9-decc76c7b215', - 'depthMm' => 1.5, - 'depthIn' => 1.5, - 'heightMm' => 1.5, - 'heightIn' => 1.5, - 'isbn' => '987-6-54321-234-5', - 'weightG' => 1.5, - 'weightOz' => 1.5, - 'widthMm' => 1.5, - 'widthIn' => 1.5 - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildUpdatePublicationMutation(): void - { - $mutationName = 'updatePublication'; - $data = 'publicationId: "3a5bf0d0-adc7-4787-af24-3a4f3c49098c", ' . - 'publicationType: PAPERBACK, ' . - 'workId: "c67656e3-7c36-4ef5-b3d9-decc76c7b215", ' . - 'depthMm: 1.5, ' . - 'depthIn: 1.5, ' . - 'widthMm: 1.5, ' . - 'widthIn: 1.5, ' . - 'heightMm: 1.5, ' . - 'heightIn: 1.5, ' . - 'weightG: 1.5, ' . - 'weightOz: 1.5, ' . - 'isbn: "987-6-54321-234-5"'; - $returnValue = 'publicationId'; - - $expectedMutation = << '3a5bf0d0-adc7-4787-af24-3a4f3c49098c', - 'publicationType' => 'PAPERBACK', - 'workId' => 'c67656e3-7c36-4ef5-b3d9-decc76c7b215', - 'depthIn' => 1.5, - 'depthMm' => 1.5, - 'heightIn' => 1.5, - 'heightMm' => 1.5, - 'isbn' => '987-6-54321-234-5', - 'weightG' => 1.5, - 'weightOz' => 1.5, - 'widthIn' => 1.5, - 'widthMm' => 1.5 - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildDeletePublicationMutation(): void - { - $mutationName = 'deletePublication'; - $data = 'publicationId: "3a5bf0d0-adc7-4787-af24-3a4f3c49098c"'; - $returnValue = 'publicationId'; - - $expectedMutation = << '3a5bf0d0-adc7-4787-af24-3a4f3c49098c'], - false - ); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildCreatePublisherMutation(): void - { - $mutationName = 'createPublisher'; - $data = 'publisherName: "FooBar", ' . - 'publisherShortname: "Foo", ' . - 'publisherUrl: "https:\/\/foo.bar\/"'; - $returnValue = 'publisherId'; - - $expectedMutation = << 'FooBar', - 'publisherShortname' => 'Foo', - 'publisherUrl' => 'https://foo.bar/' - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildUpdatePublisherMutation(): void - { - $mutationName = 'updatePublisher'; - $data = 'publisherId: "17b0b443-61cb-4ffa-9da7-9de4c2ae591e", ' . - 'publisherName: "FooBar", ' . - 'publisherShortname: "Foo", ' . - 'publisherUrl: "https:\/\/foo.bar\/"'; - $returnValue = 'publisherId'; - - $expectedMutation = << '17b0b443-61cb-4ffa-9da7-9de4c2ae591e', - 'publisherName' => 'FooBar', - 'publisherShortname' => 'Foo', - 'publisherUrl' => 'https://foo.bar/' - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildDeletePublisherMutation(): void - { - $mutationName = 'deletePublisher'; - $data = 'publisherId: "17b0b443-61cb-4ffa-9da7-9de4c2ae591e"'; - $returnValue = 'publisherId'; - - $expectedMutation = << '17b0b443-61cb-4ffa-9da7-9de4c2ae591e'], - false - ); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildCreateReferenceMutation(): void - { - $mutationName = 'createReference'; - $data = 'workId: "14f9c7e8-bebe-4e25-90f2-e2f77a2501aa", ' . - 'referenceOrdinal: 10, ' . - 'doi: "https:\/\/doi.org\/10.1016\/j.joule.2017.07.005", ' . - 'unstructuredCitation: "Jacobson, M., et al. 2017. 100% clean and renewable wind, water, ' . - 'and sunlight all-sector energy roadmaps for 139 countries of the world. ' . - 'Joule, 1, 1-14, http:\/\/dx.doi.org\/10.1016\/j.joule.2017.07.005", ' . - 'issn: "2542-4351", ' . - 'journalTitle: "Joule", ' . - 'articleTitle: "100% Clean and Renewable Wind, Water, and Sunlight All-Sector Energy ' . - 'Roadmaps for 139 Countries of the World", ' . - 'edition: 10, ' . - 'author: "Jacobson, Mark Z.; Delucchi, Mark A.; Bauer, Zack A.F.;", ' . - 'volume: "1", ' . - 'issue: "1", ' . - 'firstPage: "108", ' . - 'url: "https:\/\/linkinghub.elsevier.com\/retrieve\/pii\/S2542435117300120", ' . - 'publicationDate: "2017-09-01"'; - $returnValue = 'referenceId'; - - $expectedMutation = << '14f9c7e8-bebe-4e25-90f2-e2f77a2501aa', - 'referenceOrdinal' => 10, - 'articleTitle' => '100% Clean and Renewable Wind, Water, and Sunlight All-Sector Energy ' . - 'Roadmaps for 139 Countries of the World', - 'author' => 'Jacobson, Mark Z.; Delucchi, Mark A.; Bauer, Zack A.F.;', - 'componentNumber' => '', - 'doi' => 'https://doi.org/10.1016/j.joule.2017.07.005', - 'edition' => 10, - 'firstPage' => '108', - 'isbn' => '', - 'issn' => '2542-4351', - 'issue' => '1', - 'journalTitle' => 'Joule', - 'publicationDate' => '2017-09-01', - 'retrievalDate' => '', - 'seriesTitle' => '', - 'standardDesignator' => '', - 'standardsBodyAcronym' => '', - 'standardsBodyName' => '', - 'unstructuredCitation' => 'Jacobson, M., et al. 2017. 100% clean and renewable wind, water, ' . - 'and sunlight all-sector energy roadmaps for 139 countries of the world. ' . - 'Joule, 1, 1-14, http://dx.doi.org/10.1016/j.joule.2017.07.005', - 'url' => 'https://linkinghub.elsevier.com/retrieve/pii/S2542435117300120', - 'volume' => '1', - 'volumeTitle' => '' - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildUpdateReferenceMutation(): void - { - $mutationName = 'updateReference'; - $data = 'referenceId: "b09470b5-bc1f-4754-8ce5-016b37c50224", ' . - 'workId: "14f9c7e8-bebe-4e25-90f2-e2f77a2501aa", ' . - 'referenceOrdinal: 10, ' . - 'doi: "https:\/\/doi.org\/10.1016\/j.joule.2017.07.005", ' . - 'unstructuredCitation: "Jacobson, M., et al. 2017. 100% clean and renewable wind, water, ' . - 'and sunlight all-sector energy roadmaps for 139 countries of the world. ' . - 'Joule, 1, 1-14, http:\/\/dx.doi.org\/10.1016\/j.joule.2017.07.005", ' . - 'issn: "2542-4351", ' . - 'journalTitle: "Joule", ' . - 'articleTitle: "100% Clean and Renewable Wind, Water, and Sunlight All-Sector Energy ' . - 'Roadmaps for 139 Countries of the World", ' . - 'edition: 10, ' . - 'author: "Jacobson, Mark Z.; Delucchi, Mark A.; Bauer, Zack A.F.;", ' . - 'volume: "1", ' . - 'issue: "1", ' . - 'firstPage: "108", ' . - 'url: "https:\/\/linkinghub.elsevier.com\/retrieve\/pii\/S2542435117300120", ' . - 'publicationDate: "2017-09-01"'; - $returnValue = 'referenceId'; - - $expectedMutation = << 'b09470b5-bc1f-4754-8ce5-016b37c50224', - 'workId' => '14f9c7e8-bebe-4e25-90f2-e2f77a2501aa', - 'referenceOrdinal' => 10, - 'articleTitle' => '100% Clean and Renewable Wind, Water, and Sunlight All-Sector Energy ' . - 'Roadmaps for 139 Countries of the World', - 'author' => 'Jacobson, Mark Z.; Delucchi, Mark A.; Bauer, Zack A.F.;', - 'doi' => 'https://doi.org/10.1016/j.joule.2017.07.005', - 'edition' => 10, - 'firstPage' => '108', - 'issn' => '2542-4351', - 'issue' => '1', - 'journalTitle' => 'Joule', - 'publicationDate' => '2017-09-01', - 'unstructuredCitation' => 'Jacobson, M., et al. 2017. 100% clean and renewable wind, water, ' . - 'and sunlight all-sector energy roadmaps for 139 countries of the world. ' . - 'Joule, 1, 1-14, http://dx.doi.org/10.1016/j.joule.2017.07.005', - 'url' => 'https://linkinghub.elsevier.com/retrieve/pii/S2542435117300120', - 'volume' => '1', - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildDeleteReferenceMutation(): void - { - $mutationName = 'deleteReference'; - $data = 'referenceId: "b09470b5-bc1f-4754-8ce5-016b37c50224"'; - $returnValue = 'referenceId'; - - $expectedMutation = << 'b09470b5-bc1f-4754-8ce5-016b37c50224'], - false - ); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildCreateSeriesMutation(): void - { - $mutationName = 'createSeries'; - $data = 'imprintId: "c2a4eca1-9bb4-479f-98ad-09abc9756745", ' . - 'seriesType: JOURNAL, ' . - 'seriesName: "Foobar", ' . - 'issnPrint: "2515-0758", ' . - 'issnDigital: "2515-0766", ' . - 'seriesUrl: "http:\/\/foo.bar\/", ' . - 'seriesDescription: "Sed nunc dui, semper eu semper vel, bibendum in nulla.", ' . - 'seriesCfpUrl: "http:\/\/foo.bar\/baz\/cfp"'; - $returnValue = 'seriesId'; - - $expectedMutation = << 'JOURNAL', - 'seriesName' => 'Foobar', - 'imprintId' => 'c2a4eca1-9bb4-479f-98ad-09abc9756745', - 'seriesUrl' => 'http://foo.bar/', - 'seriesDescription' => 'Sed nunc dui, semper eu semper vel, bibendum in nulla.', - 'seriesCfpUrl' => 'http://foo.bar/baz/cfp', - 'issnPrint' => '2515-0758', - 'issnDigital' => '2515-0766' - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildUpdateSeriesMutation(): void - { - $mutationName = 'updateSeries'; - $data = 'seriesId: "1368d4f8-04c7-4a60-92b6-b2d14d31b6a6", ' . - 'imprintId: "c2a4eca1-9bb4-479f-98ad-09abc9756745", ' . - 'seriesType: JOURNAL, ' . - 'seriesName: "Foobar", ' . - 'issnPrint: "2515-0758", ' . - 'issnDigital: "2515-0766", ' . - 'seriesUrl: "http:\/\/foo.bar\/", ' . - 'seriesDescription: "Sed nunc dui, semper eu semper vel, bibendum in nulla.", ' . - 'seriesCfpUrl: "http:\/\/foo.bar\/baz\/cfp"'; - $returnValue = 'seriesId'; - - $expectedMutation = << '1368d4f8-04c7-4a60-92b6-b2d14d31b6a6', - 'seriesType' => 'JOURNAL', - 'seriesName' => 'Foobar', - 'imprintId' => 'c2a4eca1-9bb4-479f-98ad-09abc9756745', - 'seriesUrl' => 'http://foo.bar/', - 'seriesDescription' => 'Sed nunc dui, semper eu semper vel, bibendum in nulla.', - 'seriesCfpUrl' => 'http://foo.bar/baz/cfp', - 'issnPrint' => '2515-0758', - 'issnDigital' => '2515-0766' - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildDeleteSeriesMutation(): void - { - $mutationName = 'deleteSeries'; - $data = 'seriesId: "1368d4f8-04c7-4a60-92b6-b2d14d31b6a6"'; - $returnValue = 'seriesId'; - - $expectedMutation = << '1368d4f8-04c7-4a60-92b6-b2d14d31b6a6'], - false - ); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildCreateSubjectMutation(): void - { - $mutationName = 'createSubject'; - $data = 'workId: "885cb751-044d-48e8-93c8-cf3c549484ac", ' . - 'subjectType: BIC, ' . - 'subjectCode: "1D", ' . - 'subjectOrdinal: 10'; - $returnValue = 'subjectId'; - - $expectedMutation = << '885cb751-044d-48e8-93c8-cf3c549484ac', - 'subjectType' => 'BIC', - 'subjectCode' => '1D', - 'subjectOrdinal' => 10 - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildUpdateSubjectMutation(): void - { - $mutationName = 'updateSubject'; - $data = 'subjectId: "e4535b01-722a-46d8-b1e4-1687a33838d0", ' . - 'workId: "885cb751-044d-48e8-93c8-cf3c549484ac", ' . - 'subjectType: BIC, ' . - 'subjectCode: "1D", ' . - 'subjectOrdinal: 10'; - $returnValue = 'subjectId'; - - $expectedMutation = << 'e4535b01-722a-46d8-b1e4-1687a33838d0', - 'workId' => '885cb751-044d-48e8-93c8-cf3c549484ac', - 'subjectType' => 'BIC', - 'subjectCode' => '1D', - 'subjectOrdinal' => 10 - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildDeleteSubjectMutation(): void - { - $mutationName = 'deleteSubject'; - $data = 'subjectId: "e4535b01-722a-46d8-b1e4-1687a33838d0"'; - $returnValue = 'subjectId'; - - $expectedMutation = << 'e4535b01-722a-46d8-b1e4-1687a33838d0'], - false - ); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildCreateWorkMutation(): void - { - $mutationName = 'createWork'; - $data = 'workType: BOOK_CHAPTER, ' . - 'workStatus: FORTHCOMING, ' . - 'reference: "foo", ' . - 'edition: 10, ' . - 'imprintId: "dd0410c9-d5f9-43c9-8289-adfd9fc8bded", ' . - 'doi: "https:\/\/doi.org\/10.00000\/00000000", ' . - 'publicationDate: "2020-01-01", ' . - 'withdrawnDate: "2020-12-12", ' . - 'place: "Earth, Milky Way", ' . - 'pageCount: 10, ' . - 'pageBreakdown: "0", ' . - 'imageCount: 10, ' . - 'tableCount: 10, ' . - 'audioCount: 10, ' . - 'videoCount: 10, ' . - 'license: "https:\/\/creativecommons.org\/licenses\/by-nc\/4.0\/", ' . - 'copyrightHolder: "John Doe", ' . - 'landingPage: "https:\/\/foo.bar\/lorem-ipsum\/", ' . - 'lccn: "2014471418", ' . - 'oclc: "1086518639", ' . - 'generalNote: "Sed nunc dui, semper eu semper vel, bibendum in nulla.", ' . - 'bibliographyNote: "Phasellus ac gravida odio. Mauris nec sodales odio", ' . - 'toc: "0. Introduction\n1. Lorem ipsum dolor sit amet\n2. Nullam viverra ut finibus suscipit\n3. Etiam dictum cursus dolor\n4. Conclusions", ' . - 'coverUrl: "https:\/\/foo.bar\/baz\/qux", ' . - 'coverCaption: "foobar", ' . - 'firstPage: "1", ' . - 'lastPage: "326", ' . - 'pageInterval: "1-326"'; - $returnValue = 'workId'; - - $expectedMutation = << 'BOOK_CHAPTER', - 'workStatus' => 'FORTHCOMING', - 'imprintId' => 'dd0410c9-d5f9-43c9-8289-adfd9fc8bded', - 'withdrawnDate' => '2020-12-12', - 'videoCount' => 10, - 'toc' => "0. Introduction\n1. Lorem ipsum dolor sit amet\n2. Nullam viverra ut finibus suscipit\n3. Etiam dictum cursus dolor\n4. Conclusions", - 'tableCount' => 10, - 'reference' => 'foo', - 'publicationDate' => '2020-01-01', - 'place' => 'Earth, Milky Way', - 'pageInterval' => '1-326', - 'pageCount' => 10, - 'pageBreakdown' => '0', - 'oclc' => '1086518639', - 'license' => 'https://creativecommons.org/licenses/by-nc/4.0/', - 'lccn' => '2014471418', - 'lastPage' => '326', - 'landingPage' => 'https://foo.bar/lorem-ipsum/', - 'imageCount' => 10, - 'generalNote' => 'Sed nunc dui, semper eu semper vel, bibendum in nulla.', - 'firstPage' => '1', - 'edition' => 10, - 'doi' => 'https://doi.org/10.00000/00000000', - 'coverUrl' => 'https://foo.bar/baz/qux', - 'coverCaption' => 'foobar', - 'copyrightHolder' => 'John Doe', - 'bibliographyNote' => 'Phasellus ac gravida odio. Mauris nec sodales odio', - 'audioCount' => 10 - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildUpdateWorkMutation(): void - { - $mutationName = 'updateWork'; - $data = 'workId: "de7387a8-dd91-44ec-87c5-f8dba3f82b99", ' . - 'workType: BOOK_CHAPTER, ' . - 'workStatus: FORTHCOMING, ' . - 'reference: "foo", ' . - 'edition: 10, ' . - 'imprintId: "dd0410c9-d5f9-43c9-8289-adfd9fc8bded", ' . - 'doi: "https:\/\/doi.org\/10.00000\/00000000", ' . - 'publicationDate: "2020-01-01", ' . - 'withdrawnDate: "2020-12-12", ' . - 'place: "Earth, Milky Way", ' . - 'pageCount: 10, ' . - 'pageBreakdown: "0", ' . - 'imageCount: 10, ' . - 'tableCount: 10, ' . - 'audioCount: 10, ' . - 'videoCount: 10, ' . - 'license: "https:\/\/creativecommons.org\/licenses\/by-nc\/4.0\/", ' . - 'copyrightHolder: "John Doe", ' . - 'landingPage: "https:\/\/foo.bar\/lorem-ipsum\/", ' . - 'lccn: "2014471418", ' . - 'oclc: "1086518639", ' . - 'generalNote: "Sed nunc dui, semper eu semper vel, bibendum in nulla.", ' . - 'bibliographyNote: "Phasellus ac gravida odio. Mauris nec sodales odio", ' . - 'toc: "0. Introduction\n1. Lorem ipsum dolor sit amet\n2. Nullam viverra ut finibus suscipit\n3. Etiam dictum cursus dolor\n4. Conclusions", ' . - 'coverUrl: "https:\/\/foo.bar\/baz\/qux", ' . - 'coverCaption: "foobar", ' . - 'firstPage: "1", ' . - 'lastPage: "326", ' . - 'pageInterval: "1-326"'; - $returnValue = 'workId'; - - $expectedMutation = << 'de7387a8-dd91-44ec-87c5-f8dba3f82b99', - 'workType' => 'BOOK_CHAPTER', - 'workStatus' => 'FORTHCOMING', - 'imprintId' => 'dd0410c9-d5f9-43c9-8289-adfd9fc8bded', - 'withdrawnDate' => '2020-12-12', - 'videoCount' => 10, - 'toc' => "0. Introduction\n1. Lorem ipsum dolor sit amet\n2. Nullam viverra ut finibus suscipit\n3. Etiam dictum cursus dolor\n4. Conclusions", - 'tableCount' => 10, - 'reference' => 'foo', - 'publicationDate' => '2020-01-01', - 'place' => 'Earth, Milky Way', - 'pageInterval' => '1-326', - 'pageCount' => 10, - 'pageBreakdown' => '0', - 'oclc' => '1086518639', - 'license' => 'https://creativecommons.org/licenses/by-nc/4.0/', - 'lccn' => '2014471418', - 'lastPage' => '326', - 'landingPage' => 'https://foo.bar/lorem-ipsum/', - 'imageCount' => 10, - 'generalNote' => 'Sed nunc dui, semper eu semper vel, bibendum in nulla.', - 'firstPage' => '1', - 'edition' => 10, - 'doi' => 'https://doi.org/10.00000/00000000', - 'coverUrl' => 'https://foo.bar/baz/qux', - 'coverCaption' => 'foobar', - 'copyrightHolder' => 'John Doe', - 'bibliographyNote' => 'Phasellus ac gravida odio. Mauris nec sodales odio', - 'audioCount' => 10 - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildDeleteWorkMutation(): void - { - $mutationName = 'deleteWork'; - $data = 'workId: "de7387a8-dd91-44ec-87c5-f8dba3f82b99"'; - $returnValue = 'workId'; - - $expectedMutation = << 'de7387a8-dd91-44ec-87c5-f8dba3f82b99'], - false - ); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildCreateWorkRelationMutation(): void - { - $mutationName = 'createWorkRelation'; - $data = 'relatorWorkId: "2d4c0f2d-2618-4d29-b5e9-2a2ea0d57c06", ' . - 'relatedWorkId: "51caff7d-d70a-460f-b242-b3c8fd140abc", ' . - 'relationType: REPLACES, ' . - 'relationOrdinal: 10'; - $returnValue = 'workRelationId'; - - $expectedMutation = << '2d4c0f2d-2618-4d29-b5e9-2a2ea0d57c06', - 'relatedWorkId' => '51caff7d-d70a-460f-b242-b3c8fd140abc', - 'relationType' => 'REPLACES', - 'relationOrdinal' => 10 - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildUpdateWorkRelationMutation(): void - { - $mutationName = 'updateWorkRelation'; - $data = 'workRelationId: "ed68c8bd-db8c-48b1-ad6e-c3ffedc36055", ' . - 'relatorWorkId: "2d4c0f2d-2618-4d29-b5e9-2a2ea0d57c06", ' . - 'relatedWorkId: "51caff7d-d70a-460f-b242-b3c8fd140abc", ' . - 'relationType: REPLACES, ' . - 'relationOrdinal: 10'; - $returnValue = 'workRelationId'; - - $expectedMutation = << 'ed68c8bd-db8c-48b1-ad6e-c3ffedc36055', - 'relatorWorkId' => '2d4c0f2d-2618-4d29-b5e9-2a2ea0d57c06', - 'relatedWorkId' => '51caff7d-d70a-460f-b242-b3c8fd140abc', - 'relationType' => 'REPLACES', - 'relationOrdinal' => 10 - ]); - - $this->assertSame($expectedMutation, $mutation); - } - - public function testBuildDeleteWorkRelationMutation(): void - { - $mutationName = 'deleteWorkRelation'; - $data = 'workRelationId: "ed68c8bd-db8c-48b1-ad6e-c3ffedc36055"'; - $returnValue = 'workRelationId'; - - $expectedMutation = << 'ed68c8bd-db8c-48b1-ad6e-c3ffedc36055'], - false - ); - - $this->assertSame($expectedMutation, $mutation); - } -} diff --git a/tests/GraphQL/OperationClassTest.php b/tests/GraphQL/OperationClassTest.php new file mode 100644 index 0000000..4941800 --- /dev/null +++ b/tests/GraphQL/OperationClassTest.php @@ -0,0 +1,39 @@ + 1], ['workId']); + + $this->assertInstanceOf(OperationRequest::class, $operation); + $this->assertSame('books', BooksQuery::field()->getName()); + $this->assertStringContainsString('books(limit: $limit)', $operation->toGraphQL()); + $this->assertSame(['limit' => 1], $operation->getVariables()); + } + + public function testMutationClassCreatesOperationRequest(): void + { + $operation = CreatePublisherMutation::operation([ + 'data' => [ + 'publisherName' => 'ACME Press', + ], + ], ['publisherId']); + + $this->assertInstanceOf(OperationRequest::class, $operation); + $this->assertSame('createPublisher', CreatePublisherMutation::field()->getName()); + $this->assertStringContainsString('createPublisher(data: $data)', $operation->toGraphQL()); + $this->assertSame([ + 'data' => [ + 'publisherName' => 'ACME Press', + ], + ], $operation->getVariables()); + } +} diff --git a/tests/GraphQL/OperationRequestTest.php b/tests/GraphQL/OperationRequestTest.php new file mode 100644 index 0000000..f1fade6 --- /dev/null +++ b/tests/GraphQL/OperationRequestTest.php @@ -0,0 +1,469 @@ + 1, + 'order' => [ + 'field' => OperationRequest::enum('PUBLICATION_DATE'), + 'direction' => OperationRequest::enum('ASC'), + ], + ], + ['workId', 'fullTitle'] + ); + + $expected = <<assertSame($expected, $operation->toGraphQL()); + $this->assertSame([ + 'limit' => 1, + 'order' => [ + 'field' => 'PUBLICATION_DATE', + 'direction' => 'ASC', + ], + ], $operation->getVariables()); + } + + public function testItBuildsAMutationWithInputDataAndSelection(): void + { + $operation = new OperationRequest( + 'mutation', + new FieldDefinition( + 'createPublisher', + TypeReference::nonNull(TypeReference::named('Publisher')), + [ + new ArgumentDefinition('data', TypeReference::nonNull(TypeReference::named('NewPublisher'))), + ] + ), + [ + 'data' => [ + 'publisherName' => 'ACME Press', + 'publisherUrl' => 'https://example.test', + ], + ], + ['publisherId'] + ); + + $expected = <<assertSame($expected, $operation->toGraphQL()); + $this->assertSame([ + 'data' => [ + 'publisherName' => 'ACME Press', + 'publisherUrl' => 'https://example.test', + ], + ], $operation->getVariables()); + } + + public function testItRejectsInvalidSelectionFields(): void + { + $operation = new OperationRequest( + 'query', + new FieldDefinition('books', TypeReference::named('Work')), + [], + ['workId } malicious {'] + ); + + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid GraphQL identifier'); + + $operation->toGraphQL(); + } + + public function testItRejectsUnknownSelectionFields(): void + { + $operation = new OperationRequest( + 'query', + new FieldDefinition('books', TypeReference::named('Work')), + [], + ['workId', 'unknownField'] + ); + + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage("Unknown GraphQL field 'unknownField' for 'Work'."); + + $operation->toGraphQL(); + } + + public function testItRejectsUnknownNestedSelectionFields(): void + { + $operation = new OperationRequest( + 'query', + new FieldDefinition('books', TypeReference::named('Work')), + [], + [ + 'workId', + 'imprint' => [ + 'unknownField', + ], + ] + ); + + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage("Unknown GraphQL field 'unknownField' for 'Imprint'."); + + $operation->toGraphQL(); + } + + public function testItRejectsInvalidOperationFields(): void + { + $operation = new OperationRequest( + 'query', + new FieldDefinition('books } malicious {', TypeReference::named('Work')), + [], + ['workId'] + ); + + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid GraphQL identifier'); + + $operation->toGraphQL(); + } + + public function testItRejectsInvalidInputFields(): void + { + $operation = new OperationRequest( + 'mutation', + new FieldDefinition( + 'createPublisher', + TypeReference::named('Publisher'), + [ + new ArgumentDefinition('data', TypeReference::named('NewPublisher')), + ] + ), + [ + 'data' => [ + 'publisherName } malicious {' => 'ACME Press', + ], + ], + ['publisherId'] + ); + + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid GraphQL identifier'); + + $operation->toGraphQL(); + } + + public function testItRejectsUnknownInputFields(): void + { + $operation = new OperationRequest( + 'mutation', + new FieldDefinition( + 'createPublisher', + TypeReference::named('Publisher'), + [ + new ArgumentDefinition('data', TypeReference::named('NewPublisher')), + ] + ), + [ + 'data' => [ + 'publisherName' => 'ACME Press', + 'unknownField' => 'value', + ], + ], + ['publisherId'] + ); + + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage("Unknown GraphQL input field 'unknownField' for 'NewPublisher'."); + + $operation->toGraphQL(); + } + + public function testItRejectsMissingRequiredInputFields(): void + { + $operation = new OperationRequest( + 'mutation', + new FieldDefinition( + 'createPublisher', + TypeReference::named('Publisher'), + [ + new ArgumentDefinition('data', TypeReference::named('NewPublisher')), + ] + ), + [ + 'data' => [ + 'publisherUrl' => 'https://example.test', + ], + ], + ['publisherId'] + ); + + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage("Missing required GraphQL input field 'publisherName' for 'NewPublisher'."); + + $operation->toGraphQL(); + } + + public function testItRejectsMissingRequiredOperationArguments(): void + { + $operation = new OperationRequest( + 'mutation', + new FieldDefinition( + 'createPublisher', + TypeReference::named('Publisher'), + [ + new ArgumentDefinition('data', TypeReference::nonNull(TypeReference::named('NewPublisher'))), + ] + ), + [], + ['publisherId'] + ); + + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage("Missing required GraphQL argument 'data'."); + + $operation->toGraphQL(); + } + + public function testItRejectsUnknownOperationArguments(): void + { + $operation = new OperationRequest( + 'query', + new FieldDefinition( + 'books', + TypeReference::named('Work'), + [ + new ArgumentDefinition('limit', TypeReference::named('Int')), + ] + ), + ['unknownArgument' => 1], + ['workId'] + ); + + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage("Unknown GraphQL argument 'unknownArgument' for 'books'."); + + $operation->toGraphQL(); + } + + public function testItRejectsInvalidEnumValues(): void + { + $operation = new OperationRequest( + 'query', + new FieldDefinition( + 'books', + TypeReference::named('Work'), + [ + new ArgumentDefinition('order', TypeReference::named('WorkOrderBy')), + ] + ), + [ + 'order' => [ + 'field' => OperationRequest::enum('FULL_TITLE) malicious'), + ], + ], + ['workId'] + ); + + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('Invalid GraphQL identifier'); + + $operation->toGraphQL(); + } + + public function testItRejectsUnknownEnumValues(): void + { + $operation = new OperationRequest( + 'query', + new FieldDefinition( + 'books', + TypeReference::named('Work'), + [ + new ArgumentDefinition( + 'workTypes', + TypeReference::listOf(TypeReference::nonNull(TypeReference::named('WorkType'))) + ), + ] + ), + [ + 'workTypes' => [ + \ThothApi\GraphQL\Enums\WorkType::value('NOT_A_WORK_TYPE'), + ], + ], + ['workId'] + ); + + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage("Invalid GraphQL enum value 'NOT_A_WORK_TYPE' for 'WorkType'."); + + $operation->toGraphQL(); + } + + public function testItRejectsInvalidScalarVariableTypes(): void + { + $operation = new OperationRequest( + 'query', + new FieldDefinition( + 'books', + TypeReference::named('Work'), + [ + new ArgumentDefinition('limit', TypeReference::named('Int')), + ] + ), + ['limit' => '1'], + ['workId'] + ); + + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage("Invalid GraphQL value for 'Int'; expected int."); + + $operation->toGraphQL(); + } + + public function testItRejectsInvalidListVariableTypes(): void + { + $operation = new OperationRequest( + 'query', + new FieldDefinition( + 'books', + TypeReference::named('Work'), + [ + new ArgumentDefinition( + 'workTypes', + TypeReference::listOf(TypeReference::nonNull(TypeReference::named('WorkType'))) + ), + ] + ), + ['workTypes' => WorkType::MONOGRAPH], + ['workId'] + ); + + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage("Invalid GraphQL value for '[WorkType!]'; expected list."); + + $operation->toGraphQL(); + } + + public function testItFormatsGeneratedEnumConstantsFromInputSchema(): void + { + $operation = new OperationRequest( + 'query', + new FieldDefinition( + 'books', + TypeReference::named('Work'), + [ + new ArgumentDefinition('order', TypeReference::named('WorkOrderBy')), + ] + ), + [ + 'order' => [ + 'field' => WorkField::PUBLICATION_DATE, + 'direction' => Direction::DESC, + ], + ], + ['workId'] + ); + + $this->assertStringContainsString('books(order: $order)', $operation->toGraphQL()); + $this->assertSame([ + 'order' => [ + 'field' => 'PUBLICATION_DATE', + 'direction' => 'DESC', + ], + ], $operation->getVariables()); + } + + public function testItFormatsGeneratedEnumConstantsFromInputLists(): void + { + $operation = new OperationRequest( + 'query', + new FieldDefinition( + 'books', + TypeReference::named('Work'), + [ + new ArgumentDefinition( + 'workTypes', + TypeReference::listOf(TypeReference::nonNull(TypeReference::named('WorkType'))) + ), + ] + ), + [ + 'workTypes' => [ + WorkType::MONOGRAPH, + WorkType::EDITED_BOOK, + ], + ], + ['workId'] + ); + + $this->assertStringContainsString('books(workTypes: $workTypes)', $operation->toGraphQL()); + $this->assertSame([ + 'workTypes' => [ + 'MONOGRAPH', + 'EDITED_BOOK', + ], + ], $operation->getVariables()); + } + + public function testItKeepsStringValuesQuotedWhenSchemaTypeIsString(): void + { + $operation = new OperationRequest( + 'mutation', + new FieldDefinition( + 'createWork', + TypeReference::named('Work'), + [ + new ArgumentDefinition('data', TypeReference::named('NewWork')), + ] + ), + [ + 'data' => [ + 'workType' => WorkType::MONOGRAPH, + 'workStatus' => WorkStatus::ACTIVE, + 'imprintId' => '71faf1c3-900a-4b8c-bca7-4f927699fb90', + 'reference' => 'MONOGRAPH', + ], + ], + ['workId'] + ); + + $this->assertStringContainsString('createWork(data: $data)', $operation->toGraphQL()); + $this->assertSame([ + 'data' => [ + 'workType' => 'MONOGRAPH', + 'workStatus' => 'ACTIVE', + 'imprintId' => '71faf1c3-900a-4b8c-bca7-4f927699fb90', + 'reference' => 'MONOGRAPH', + ], + ], $operation->getVariables()); + } +} diff --git a/tests/GraphQL/Queries/AffiliationQueryTest.php b/tests/GraphQL/Queries/AffiliationQueryTest.php deleted file mode 100644 index 57b7632..0000000 --- a/tests/GraphQL/Queries/AffiliationQueryTest.php +++ /dev/null @@ -1,87 +0,0 @@ -affiliationQuery = new AffiliationQuery(); - } - - public function testGetAffiliationQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<affiliationQuery->getQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetAffiliationsQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<affiliationQuery->getManyQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetAffiliationCountQuery(): void - { - $expectedQuery = <<affiliationQuery->getCountQuery(); - $this->assertSame($expectedQuery, $query); - } - - private function getFieldsFragment(): string - { - return <<contributionQuery = new ContributionQuery(); - } - - public function testGetContributionQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<contributionQuery->getQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetContributionsQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<contributionQuery->getManyQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetContributionCountQuery(): void - { - $expectedQuery = <<contributionQuery->getCountQuery(); - $this->assertSame($expectedQuery, $query); - } - - private function getFieldsFragment(): string - { - return <<contributorQuery = new ContributorQuery(); - } - - public function testGetContributorQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<contributorQuery->getQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetContributorsQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<contributorQuery->getManyQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetContributorCountQuery(): void - { - $expectedQuery = <<contributorQuery->getCountQuery(); - $this->assertSame($expectedQuery, $query); - } - - private function getFieldsFragment(): string - { - return <<fundingQuery = new FundingQuery(); - } - - public function testGetFundingQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<fundingQuery->getQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetFundingsQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<fundingQuery->getManyQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetFundingCountQuery(): void - { - $expectedQuery = <<fundingQuery->getCountQuery(); - $this->assertSame($expectedQuery, $query); - } - - private function getFieldsFragment(): string - { - return <<imprintQuery = new ImprintQuery(); - } - - public function testGetImprintQuery(): void - { - $fragment = $this->getFieldsFragment(true); - $expectedQuery = <<imprintQuery->getQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetImprintsQuery(): void - { - $fragment = $this->getFieldsFragment(false); - $expectedQuery = <<imprintQuery->getManyQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetImprintsQueryWithRestrictedFields(): void - { - $fragment = $this->getFieldsFragment(true); - $expectedQuery = <<imprintQuery->getManyQueryWithRestrictedFields(true); - $this->assertSame($expectedQuery, $query); - } - - public function testGetImprintCountQuery(): void - { - $expectedQuery = <<imprintQuery->getCountQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function getFieldsFragment(bool $includeRestrictedFields): string - { - $restrictedFields = $includeRestrictedFields ? <<institutionQuery = new InstitutionQuery(); - } - - public function testGetInstitutionQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<institutionQuery->getQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetInstitutionsQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<institutionQuery->getManyQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetInstitutionCountQuery(): void - { - $expectedQuery = <<institutionQuery->getCountQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function getFieldsFragment(): string - { - return <<issueQuery = new IssueQuery(); - } - - public function testGetIssueQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<issueQuery->getQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetIssuesQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<issueQuery->getManyQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetIssueCountQuery(): void - { - $expectedQuery = <<issueQuery->getCountQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function getFieldsFragment(): string - { - return <<languageQuery = new LanguageQuery(); - } - - public function testGetLanguageQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<languageQuery->getQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetLanguagesQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<languageQuery->getManyQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetLanguageCountQuery(): void - { - $expectedQuery = <<languageQuery->getCountQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function getFieldsFragment(): string - { - return <<locationQuery = new LocationQuery(); - } - - public function testGetLocationQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<locationQuery->getQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetLocationsQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<locationQuery->getManyQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetLocationCountQuery(): void - { - $expectedQuery = <<locationQuery->getCountQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function getFieldsFragment(): string - { - return <<priceQuery = new PriceQuery(); - } - - public function testGetPriceQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<priceQuery->getQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetPricesQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<priceQuery->getManyQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetPriceCountQuery(): void - { - $expectedQuery = <<priceQuery->getCountQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function getFieldsFragment(): string - { - return <<publicationQuery = new PublicationQuery(); - } - - public function testGetPublicationQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<publicationQuery->getQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetPublicationsQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<publicationQuery->getManyQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetPublicationCountQuery(): void - { - $expectedQuery = <<publicationQuery->getCountQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function getFieldsFragment(): string - { - return <<publisherQuery = new PublisherQuery(); - } - - public function testGetPublisherQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<publisherQuery->getQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetPublishersQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<publisherQuery->getManyQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetPublisherCountQuery(): void - { - $expectedQuery = <<publisherQuery->getCountQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function getFieldsFragment(): string - { - return <<referenceQuery = new ReferenceQuery(); - } - - public function testGetReferenceQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<referenceQuery->getQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetReferencesQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<referenceQuery->getManyQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetReferenceCountQuery(): void - { - $expectedQuery = <<referenceQuery->getCountQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function getFieldsFragment(): string - { - return <<assertStringContainsString('additionalResource(additionalResourceId:', $query->getQuery()); - $this->assertStringContainsString('additionalResources(', $query->getManyQuery()); - $this->assertStringContainsString('additionalResourceCount', $query->getCountQuery()); - $this->assertStringContainsString('fragment additionalResourceFields on WorkResource', $query->getQuery()); - } - - public function testAbstractQueries(): void - { - $query = new AbstractTextQuery(); - $this->assertStringContainsString('abstract(abstractId:', $query->getQuery()); - $this->assertStringContainsString('markupFormat: $markupFormat', $query->getQuery()); - $this->assertStringContainsString('abstracts(', $query->getManyQuery()); - $this->assertStringContainsString('fragment abstractFields on Abstract', $query->getManyQuery()); - } - - public function testAwardQueries(): void - { - $query = new AwardQuery(); - $this->assertStringContainsString('award(awardId:', $query->getQuery()); - $this->assertStringContainsString('awards(', $query->getManyQuery()); - $this->assertStringContainsString('awardCount', $query->getCountQuery()); - $this->assertStringContainsString('fragment awardFields on Award', $query->getQuery()); - } - - public function testBiographyQueries(): void - { - $query = new BiographyQuery(); - $this->assertStringContainsString('biography(biographyId:', $query->getQuery()); - $this->assertStringContainsString('biographies(', $query->getManyQuery()); - $this->assertStringContainsString('fragment biographyFields on Biography', $query->getQuery()); - } - - public function testBookReviewQueries(): void - { - $query = new BookReviewQuery(); - $this->assertStringContainsString('bookReview(bookReviewId:', $query->getQuery()); - $this->assertStringContainsString('bookReviews(', $query->getManyQuery()); - $this->assertStringContainsString('bookReviewCount', $query->getCountQuery()); - $this->assertStringContainsString('fragment bookReviewFields on BookReview', $query->getQuery()); - } - - public function testContactQueries(): void - { - $query = new ContactQuery(); - $this->assertStringContainsString('contact(contactId:', $query->getQuery()); - $this->assertStringContainsString('contacts(', $query->getManyQuery()); - $this->assertStringContainsString('contactCount(contactTypes:', $query->getCountQuery()); - $this->assertStringContainsString('fragment contactFields on Contact', $query->getQuery()); - } - - public function testEndorsementQueries(): void - { - $query = new EndorsementQuery(); - $this->assertStringContainsString('endorsement(endorsementId:', $query->getQuery()); - $this->assertStringContainsString('endorsements(', $query->getManyQuery()); - $this->assertStringContainsString('endorsementCount', $query->getCountQuery()); - $this->assertStringContainsString('fragment endorsementFields on Endorsement', $query->getQuery()); - } - - public function testFileQuery(): void - { - $query = new FileQuery(); - $this->assertStringContainsString('file(fileId:', $query->getQuery()); - $this->assertStringContainsString('fragment fileFields on File', $query->getQuery()); - } - - public function testMeQuery(): void - { - $query = new MeQuery(); - $this->assertStringContainsString('me {', $query->getQuery()); - $this->assertStringContainsString('fragment meFields on Me', $query->getQuery()); - } - - public function testTitleQueries(): void - { - $query = new TitleQuery(); - $this->assertStringContainsString('title(titleId:', $query->getQuery()); - $this->assertStringContainsString('titles(', $query->getManyQuery()); - $this->assertStringContainsString('fragment titleFields on Title', $query->getQuery()); - } - - public function testWorkFeaturedVideoQueries(): void - { - $query = new WorkFeaturedVideoQuery(); - $this->assertStringContainsString('workFeaturedVideo(workFeaturedVideoId:', $query->getQuery()); - $this->assertStringContainsString('workFeaturedVideos(', $query->getManyQuery()); - $this->assertStringContainsString('workFeaturedVideoCount', $query->getCountQuery()); - $this->assertStringContainsString('fragment workFeaturedVideoFields on WorkFeaturedVideo', $query->getQuery()); - } -} diff --git a/tests/GraphQL/Queries/SeriesQueryTest.php b/tests/GraphQL/Queries/SeriesQueryTest.php deleted file mode 100644 index b0ba2a5..0000000 --- a/tests/GraphQL/Queries/SeriesQueryTest.php +++ /dev/null @@ -1,103 +0,0 @@ -seriesQuery = new SeriesQuery(); - } - - public function testGetSeriesQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<seriesQuery->getQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetSeriesesQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<seriesQuery->getManyQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetSeriesCountQuery(): void - { - $expectedQuery = <<seriesQuery->getCountQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function getFieldsFragment(): string - { - return <<subjectQuery = new SubjectQuery(); - } - - public function testGetSubjectQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<subjectQuery->getQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetSubjectsQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<subjectQuery->getManyQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetSubjectCountQuery(): void - { - $expectedQuery = <<subjectQuery->getCountQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function getFieldsFragment(): string - { - return <<workQuery = new WorkQuery(); - } - - public function testGetWorkQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<workQuery->getQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetWorksQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<workQuery->getManyQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetWorkByDoiQuery(): void - { - $fragment = $this->getFieldsFragment(); - $expectedQuery = <<workQuery->getByDoiQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function testGetWorkCountQuery(): void - { - $expectedQuery = <<workQuery->getCountQuery(); - $this->assertSame($expectedQuery, $query); - } - - public function getFieldsFragment(): string - { - return <<assertStringContainsString($queryName, $query); - } - } - - public function testGetAdditionalSchemaQueries(): void - { - foreach ([ - 'additionalResource', - 'additionalResources', - 'additionalResourceCount', - 'award', - 'awards', - 'awardCount', - 'bookReview', - 'bookReviews', - 'bookReviewCount', - 'contact', - 'contacts', - 'contactCount', - 'endorsement', - 'endorsements', - 'endorsementCount', - 'workFeaturedVideo', - 'workFeaturedVideos', - 'workFeaturedVideoCount', - ] as $queryName) { - $query = QueryProvider::get($queryName); - $this->assertStringContainsString($queryName, $query); - } - } - - public function testGetStandaloneQueries(): void - { - $query = QueryProvider::get('file'); - $this->assertStringContainsString('file(fileId:', $query); - - $query = QueryProvider::get('me'); - $this->assertStringContainsString('me {', $query); - } -} diff --git a/tests/GraphQL/QueryProviderTest.php b/tests/GraphQL/QueryProviderTest.php deleted file mode 100644 index 652dce8..0000000 --- a/tests/GraphQL/QueryProviderTest.php +++ /dev/null @@ -1,230 +0,0 @@ -expectException(\InvalidArgumentException::class); - $this->expectExceptionMessage('Query \'foo\' not found.'); - - $query = QueryProvider::get('foo'); - } - - public function testGetAffiliationQueries(): void - { - $query = QueryProvider::get('affiliation'); - $this->assertStringContainsString('affiliation', $query); - - $query = QueryProvider::get('affiliations'); - $this->assertStringContainsString('affiliations', $query); - - $query = QueryProvider::get('affiliationCount'); - $this->assertStringContainsString('affiliationCount', $query); - } - - public function testGetContributionQueries(): void - { - $query = QueryProvider::get('contribution'); - $this->assertStringContainsString('contribution', $query); - - $query = QueryProvider::get('contributions'); - $this->assertStringContainsString('contributions', $query); - - $query = QueryProvider::get('contributionCount'); - $this->assertStringContainsString('contributionCount', $query); - } - - public function testGetContributorQueries(): void - { - $query = QueryProvider::get('contributor'); - $this->assertStringContainsString('contributor', $query); - - $query = QueryProvider::get('contributors'); - $this->assertStringContainsString('contributors', $query); - - $query = QueryProvider::get('contributorCount'); - $this->assertStringContainsString('contributorCount', $query); - } - - public function testGetFundingQueries(): void - { - $query = QueryProvider::get('funding'); - $this->assertStringContainsString('funding', $query); - - $query = QueryProvider::get('fundings'); - $this->assertStringContainsString('fundings', $query); - - $query = QueryProvider::get('fundingCount'); - $this->assertStringContainsString('fundingCount', $query); - } - - public function testGetImprintQueries(): void - { - $query = QueryProvider::get('imprint'); - $this->assertStringContainsString('imprint', $query); - - $query = QueryProvider::get('imprints'); - $this->assertStringContainsString('imprints', $query); - - $query = QueryProvider::get('imprintCount'); - $this->assertStringContainsString('imprintCount', $query); - } - - public function testGetInstitutionQueries(): void - { - $query = QueryProvider::get('institution'); - $this->assertStringContainsString('institution', $query); - - $query = QueryProvider::get('institutions'); - $this->assertStringContainsString('institutions', $query); - - $query = QueryProvider::get('institutionCount'); - $this->assertStringContainsString('institutionCount', $query); - } - - public function testGetIssueQueries(): void - { - $query = QueryProvider::get('issue'); - $this->assertStringContainsString('issue', $query); - - $query = QueryProvider::get('issues'); - $this->assertStringContainsString('issues', $query); - - $query = QueryProvider::get('issueCount'); - $this->assertStringContainsString('issueCount', $query); - } - - public function testGetLanguageQueries(): void - { - $query = QueryProvider::get('language'); - $this->assertStringContainsString('language', $query); - - $query = QueryProvider::get('languages'); - $this->assertStringContainsString('languages', $query); - - $query = QueryProvider::get('languageCount'); - $this->assertStringContainsString('languageCount', $query); - } - - public function testGetLocationQueries(): void - { - $query = QueryProvider::get('location'); - $this->assertStringContainsString('location', $query); - - $query = QueryProvider::get('locations'); - $this->assertStringContainsString('locations', $query); - - $query = QueryProvider::get('locationCount'); - $this->assertStringContainsString('locationCount', $query); - } - - public function testGetPriceQueries(): void - { - $query = QueryProvider::get('price'); - $this->assertStringContainsString('price', $query); - - $query = QueryProvider::get('prices'); - $this->assertStringContainsString('prices', $query); - - $query = QueryProvider::get('priceCount'); - $this->assertStringContainsString('priceCount', $query); - } - - public function testGetPublicationQueries(): void - { - $query = QueryProvider::get('publication'); - $this->assertStringContainsString('publication', $query); - - $query = QueryProvider::get('publications'); - $this->assertStringContainsString('publications', $query); - - $query = QueryProvider::get('publicationCount'); - $this->assertStringContainsString('publicationCount', $query); - } - - public function testGetPublisherQueries(): void - { - $query = QueryProvider::get('publisher'); - $this->assertStringContainsString('publisher', $query); - - $query = QueryProvider::get('publishers'); - $this->assertStringContainsString('publishers', $query); - - $query = QueryProvider::get('publisherCount'); - $this->assertStringContainsString('publisherCount', $query); - } - - public function testGetReferenceQueries(): void - { - $query = QueryProvider::get('reference'); - $this->assertStringContainsString('reference', $query); - - $query = QueryProvider::get('references'); - $this->assertStringContainsString('references', $query); - - $query = QueryProvider::get('referenceCount'); - $this->assertStringContainsString('referenceCount', $query); - } - - public function testGetSeriesQueries(): void - { - $query = QueryProvider::get('series'); - $this->assertStringContainsString('series', $query); - - $query = QueryProvider::get('serieses'); - $this->assertStringContainsString('serieses', $query); - - $query = QueryProvider::get('seriesCount'); - $this->assertStringContainsString('seriesCount', $query); - } - - public function testGetSubjectQueries(): void - { - $query = QueryProvider::get('subject'); - $this->assertStringContainsString('subject', $query); - - $query = QueryProvider::get('subjects'); - $this->assertStringContainsString('subjects', $query); - - $query = QueryProvider::get('subjectCount'); - $this->assertStringContainsString('subjectCount', $query); - } - - public function testGetWorkQueries(): void - { - $query = QueryProvider::get('books'); - $this->assertStringContainsString('books', $query); - - $query = QueryProvider::get('bookByDoi'); - $this->assertStringContainsString('bookByDoi', $query); - - $query = QueryProvider::get('bookCount'); - $this->assertStringContainsString('bookCount', $query); - - $query = QueryProvider::get('chapters'); - $this->assertStringContainsString('chapters', $query); - - $query = QueryProvider::get('chapterByDoi'); - $this->assertStringContainsString('chapterByDoi', $query); - - $query = QueryProvider::get('chapterCount'); - $this->assertStringContainsString('chapterCount', $query); - - $query = QueryProvider::get('work'); - $this->assertStringContainsString('work', $query); - - $query = QueryProvider::get('works'); - $this->assertStringContainsString('works', $query); - - $query = QueryProvider::get('workByDoi'); - $this->assertStringContainsString('workByDoi', $query); - - $query = QueryProvider::get('workCount'); - $this->assertStringContainsString('workCount', $query); - } -} diff --git a/tests/GraphQL/RequestTest.php b/tests/GraphQL/RequestTest.php index b2b8b34..96fe16d 100644 --- a/tests/GraphQL/RequestTest.php +++ b/tests/GraphQL/RequestTest.php @@ -3,6 +3,8 @@ namespace ThothApi\Tests\GraphQL; use GuzzleHttp\Exception\ClientException; +use GuzzleHttp\Exception\ConnectException; +use GuzzleHttp\Exception\ServerException; use GuzzleHttp\Handler\MockHandler; use GuzzleHttp\HandlerStack; use GuzzleHttp\Psr7\Request as GuzzleRequest; @@ -52,6 +54,9 @@ public function testExecuteQuery(): void public function testInvalidQueryWithResponse200(): void { + $query = 'query { invalid }'; + $variables = ['limit' => 1]; + $this->mockHandler->append(new Response(200, [], json_encode([ 'errors' => [ [ @@ -66,8 +71,13 @@ public function testInvalidQueryWithResponse200(): void ] ]))); - $this->expectException(QueryException::class); - $this->request->runQuery(''); + try { + $this->request->runQuery($query, $variables); + $this->fail('Expected query exception.'); + } catch (QueryException $exception) { + $this->assertSame($query, $exception->getQuery()); + $this->assertSame($variables, $exception->getVariables()); + } } public function testInvalidQueryResponseWith400(): void @@ -93,4 +103,40 @@ public function testInvalidQueryResponseWith400(): void $this->expectException(QueryException::class); $this->request->runQuery(''); } + + public function testInvalidQueryResponseWith500(): void + { + $this->mockHandler->append(new ServerException( + '', + new GuzzleRequest('post', ''), + new Response(500, [], json_encode([ + 'errors' => [ + [ + 'message' => 'server error', + ], + ], + ])) + )); + + try { + $this->request->runQuery(''); + $this->fail('Expected query exception.'); + } catch (QueryException $exception) { + $this->assertSame('server error', $exception->getMessage()); + $this->assertSame(500, $exception->getStatusCode()); + } + } + + public function testConnectionFailureThrowsQueryException(): void + { + $this->mockHandler->append(new ConnectException( + 'Connection refused', + new GuzzleRequest('post', '') + )); + + $this->expectException(QueryException::class); + $this->expectExceptionMessage('Connection refused'); + + $this->request->runQuery(''); + } } diff --git a/tests/GraphQL/ResponseTest.php b/tests/GraphQL/ResponseTest.php index e7dfaef..edb6d9b 100644 --- a/tests/GraphQL/ResponseTest.php +++ b/tests/GraphQL/ResponseTest.php @@ -66,4 +66,43 @@ public function testThrowQueryException() $this->expectException(QueryException::class); new Response($httpResponse); } + + public function testThrowQueryExceptionWithAllErrorsAndStatusCode(): void + { + $errors = [ + ['message' => 'first syntax error'], + ['message' => 'second syntax error'], + ]; + $httpResponse = new HttpResponse(400, [], json_encode(['errors' => $errors])); + + try { + new Response($httpResponse); + $this->fail('Expected query exception.'); + } catch (QueryException $exception) { + $this->assertSame('first syntax error', $exception->getMessage()); + $this->assertSame($errors[0], $exception->getDetails()); + $this->assertSame($errors, $exception->getErrors()); + $this->assertSame(400, $exception->getStatusCode()); + } + } + + public function testThrowQueryExceptionForInvalidJsonResponse(): void + { + $httpResponse = new HttpResponse(200, [], '{invalid'); + + $this->expectException(QueryException::class); + $this->expectExceptionMessage('Invalid JSON response from GraphQL API.'); + + new Response($httpResponse); + } + + public function testThrowQueryExceptionWhenResponseHasNoData(): void + { + $httpResponse = new HttpResponse(200, [], json_encode(['status' => 'ok'])); + + $this->expectException(QueryException::class); + $this->expectExceptionMessage('GraphQL response does not contain data.'); + + new Response($httpResponse); + } } diff --git a/tests/GraphQL/fixtures/minimal-introspection.json b/tests/GraphQL/fixtures/minimal-introspection.json new file mode 100644 index 0000000..cc8ea1b --- /dev/null +++ b/tests/GraphQL/fixtures/minimal-introspection.json @@ -0,0 +1,170 @@ +{ + "data": { + "__schema": { + "queryType": { + "name": "QueryRoot" + }, + "mutationType": { + "name": "MutationRoot" + }, + "subscriptionType": null, + "types": [ + { + "kind": "OBJECT", + "name": "QueryRoot", + "description": null, + "fields": [ + { + "name": "books", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Work", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "MutationRoot", + "description": null, + "fields": [ + { + "name": "createWork", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Work", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Work", + "description": null, + "fields": [ + { + "name": "workId", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "title", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "imprint", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "Imprint", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "tags", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Imprint", + "description": null, + "fields": [ + { + "name": "imprintId", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "String", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + } + ], + "directives": [] + } + } +} diff --git a/tools/GraphQLGenerator/AccessorMethodsBuilder.php b/tools/GraphQLGenerator/AccessorMethodsBuilder.php new file mode 100644 index 0000000..c8b84a5 --- /dev/null +++ b/tools/GraphQLGenerator/AccessorMethodsBuilder.php @@ -0,0 +1,48 @@ +get({$fieldName}); + } + + /** + * @param {$phpDocType} \$value + */ + public function set{$methodName}(\$value): self + { + \$this->set({$fieldName}, \$value); + return \$this; + } + + public function has{$methodName}(): bool + { + return \$this->has({$fieldName}); + } + + public function unset{$methodName}(): self + { + \$this->remove({$fieldName}); + return \$this; + } +PHP; + } +} diff --git a/tools/GraphQLGenerator/ClassFileWriter.php b/tools/GraphQLGenerator/ClassFileWriter.php new file mode 100644 index 0000000..7260290 --- /dev/null +++ b/tools/GraphQLGenerator/ClassFileWriter.php @@ -0,0 +1,11 @@ +'; + private const END_MARKER = ''; + + public function generate(array $schema, array $types, string $target): void + { + $clientFile = $target . '/Client.php'; + + if (!is_file($clientFile)) { + return; + } + + $contents = file_get_contents($clientFile); + + if ($contents === false) { + throw new GeneratorException('Unable to read GraphQL client file: ' . $clientFile); + } + + $updatedContents = $this->replaceClassDocBlock($contents, $this->docBlock($schema, $types)); + + if (file_put_contents($clientFile, $updatedContents) === false) { + throw new GeneratorException('Unable to write GraphQL client file: ' . $clientFile); + } + } + + private function replaceClassDocBlock(string $contents, string $docBlock): string + { + $pattern = '/\/\*\*.*?' . preg_quote(self::START_MARKER, '/') . '.*?' + . preg_quote(self::END_MARKER, '/') . '.*?\*\/\nclass Client/s'; + + if (preg_match($pattern, $contents) === 1) { + return (string) preg_replace($pattern, $docBlock . "\nclass Client", $contents, 1); + } + + return (string) preg_replace('/\nclass Client\n/', "\n" . $docBlock . "\nclass Client\n", $contents, 1); + } + + private function docBlock(array $schema, array $types): string + { + $methods = array_merge( + $this->operationMethodTags($schema, $types, 'queryType'), + $this->operationMethodTags($schema, $types, 'mutationType') + ); + + return "/**\n" + . " * GraphQL API client.\n" + . " *\n" + . ' * ' . self::START_MARKER . "\n" + . implode("\n", $methods) . "\n" + . ' * ' . self::END_MARKER . "\n" + . ' */'; + } + + private function operationMethodTags(array $schema, array $types, string $rootKey): array + { + $rootTypeName = $schema[$rootKey]['name'] ?? null; + $rootType = is_string($rootTypeName) ? ($types[$rootTypeName] ?? []) : []; + $methods = []; + + foreach ($rootType['fields'] ?? [] as $field) { + $methods[] = ' * @method ' . $this->returnType($field['type'] ?? []) + . ' ' . $field['name'] . '(' . $this->parameterList($field['args'] ?? []) . ')'; + } + + return $methods; + } + + private function parameterList(array $arguments): string + { + $parameters = []; + + foreach ($arguments as $argument) { + $type = $argument['type'] ?? []; + $parameters[] = $this->argumentType($type) . ' $' + . $this->parameterName((string) ($argument['name'] ?? 'value')) . $this->defaultValue($type); + } + + $parameters[] = 'array $selection = []'; + return implode(', ', $parameters); + } + + private function defaultValue(array $type): string + { + return ($type['kind'] ?? null) === 'NON_NULL' ? '' : ' = null'; + } + + private function returnType(array $type): string + { + return $this->phpDocType($type, 'Schemas'); + } + + private function argumentType(array $type): string + { + return $this->phpDocType($type, 'Inputs'); + } + + private function phpDocType(array $type, string $objectNamespace): string + { + $nullable = ($type['kind'] ?? null) !== 'NON_NULL'; + $baseType = $this->phpDocBaseType($type, $objectNamespace); + + return $nullable ? $baseType . '|null' : $baseType; + } + + private function phpDocBaseType(array $type, string $objectNamespace): string + { + if (($type['kind'] ?? null) === 'NON_NULL') { + return $this->phpDocBaseType($type['ofType'] ?? [], $objectNamespace); + } + + if (($type['kind'] ?? null) === 'LIST') { + return $this->phpDocBaseType($type['ofType'] ?? [], $objectNamespace) . '[]'; + } + + if (($type['kind'] ?? null) === 'ENUM') { + return 'string'; + } + + if (($type['kind'] ?? null) === 'NAMED' && isset($type['name'])) { + return $this->namedPhpDocType((string) $type['name'], $objectNamespace); + } + + if (($type['kind'] ?? null) === 'INPUT_OBJECT' && isset($type['name'])) { + return $this->className('Inputs', (string) $type['name']) . '|array'; + } + + if (($type['kind'] ?? null) === 'OBJECT' && isset($type['name'])) { + return $this->className($objectNamespace, (string) $type['name']); + } + + if (($type['kind'] ?? null) === 'SCALAR') { + return phpDocScalarType((string) ($type['name'] ?? '')); + } + + return 'mixed'; + } + + private function namedPhpDocType(string $typeName, string $objectNamespace): string + { + $inputClass = $this->className('Inputs', $typeName); + + if ($objectNamespace === 'Inputs' && class_exists($inputClass)) { + return $inputClass . '|array'; + } + + $schemaClass = $this->className('Schemas', $typeName); + + if ($objectNamespace === 'Schemas' && class_exists($schemaClass)) { + return $schemaClass; + } + + $enumClass = $this->className('Enums', $typeName); + + if (class_exists($enumClass)) { + return 'string'; + } + + return phpDocScalarType($typeName); + } + + private function className(string $namespacePart, string $typeName): string + { + return '\\ThothApi\\GraphQL\\' . $namespacePart . '\\' . safeClassName(studly($typeName)); + } + + private function parameterName(string $name): string + { + $name = preg_replace('/[^A-Za-z0-9_]/', '_', $name); + $name = preg_replace('/^[^A-Za-z_]+/', '', (string) $name); + + return $name === '' ? 'value' : $name; + } +} diff --git a/tools/GraphQLGenerator/CodeGeneration.php b/tools/GraphQLGenerator/CodeGeneration.php new file mode 100644 index 0000000..6e52ab3 --- /dev/null +++ b/tools/GraphQLGenerator/CodeGeneration.php @@ -0,0 +1,229 @@ + $childValue) { + $prefix = $isList ? '' : exportPhpValue($key, 0) . ' => '; + $lines[] = $childIndent . $prefix . exportPhpValue($childValue, $level + 1) . ','; + } + + $lines[] = $indent . ']'; + return implode("\n", $lines); +} + +function isSequentialArray(array $value): bool +{ + $expected = 0; + + foreach ($value as $key => $_) { + if ($key !== $expected) { + return false; + } + + $expected++; + } + + return true; +} + +function studly(string $value): string +{ + $value = preg_replace('/[^A-Za-z0-9]+/', ' ', $value); + $value = preg_replace('/(?valueNames($type['enumValues'] ?? []); + + return $this->classCode( + $namespacePart, + $this->className($type), + $type['name'], + $this->constantsCode($values), + exportPhpValue($values, 2) + ); + } + + private function valueNames(array $enumValues): array + { + return array_map( + static function (array $value): string { + return $value['name']; + }, + $enumValues + ); + } + + private function constantsCode(array $values): string + { + return implode("\n", array_map( + static function (string $value): string { + return ' public const ' . sanitizeConstant($value) . ' = ' . exportPhpValue($value) . ';'; + }, + $values + )); + } + + private function classCode( + string $namespacePart, + string $className, + string $typeName, + string $constantsCode, + string $valuesCode + ): string { + return <<removeDirectory($target . '/' . $directory); + mkdir($target . '/' . $directory, 0777, true); + } + } + + private function removeDirectory(string $directory): void + { + if (!is_dir($directory)) { + return; + } + + $iterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($directory, FilesystemIterator::SKIP_DOTS), + RecursiveIteratorIterator::CHILD_FIRST + ); + + foreach ($iterator as $file) { + if ($file->isDir()) { + rmdir($file->getPathname()); + } else { + unlink($file->getPathname()); + } + } + + rmdir($directory); + } +} diff --git a/tools/GraphQLGenerator/GeneratorException.php b/tools/GraphQLGenerator/GeneratorException.php new file mode 100644 index 0000000..e267f87 --- /dev/null +++ b/tools/GraphQLGenerator/GeneratorException.php @@ -0,0 +1,7 @@ +schemaLoader = $schemaLoader ?: new SchemaLoader(); + $this->typeIndexer = $typeIndexer ?: new TypeIndexer(); + $this->targetDirectoryGuard = $targetDirectoryGuard ?: new TargetDirectoryGuard(); + $this->directoryPreparer = $directoryPreparer ?: new GeneratedDirectoryPreparer(); + $this->rootOperationGenerator = $rootOperationGenerator ?: new RootOperationGenerator(); + $this->schemaTypeGenerator = $schemaTypeGenerator ?: new SchemaTypeGenerator(); + $this->clientPhpDocGenerator = $clientPhpDocGenerator ?: new ClientPhpDocGenerator(); + } + + public function generate(?string $schemaSource, string $target): void + { + $this->targetDirectoryGuard->assertSafe($target); + + $schema = $this->schemaLoader->load($schemaSource); + $types = $this->typeIndexer->indexByName($schema['types'] ?? []); + + $this->directoryPreparer->prepare($target); + $this->rootOperationGenerator->generate($schema, $types, $target); + $this->schemaTypeGenerator->generate($types, $target, $this->rootTypeNames($schema)); + $this->clientPhpDocGenerator->generate($schema, $types, $target); + } + + private function rootTypeNames(array $schema): array + { + return array_values(array_filter([ + $schema['queryType']['name'] ?? null, + $schema['mutationType']['name'] ?? null, + $schema['subscriptionType']['name'] ?? null, + ])); + } +} diff --git a/tools/GraphQLGenerator/InputTypeClassBuilder.php b/tools/GraphQLGenerator/InputTypeClassBuilder.php new file mode 100644 index 0000000..09e0d7d --- /dev/null +++ b/tools/GraphQLGenerator/InputTypeClassBuilder.php @@ -0,0 +1,58 @@ +accessorMethodsBuilder = $accessorMethodsBuilder ?: new AccessorMethodsBuilder(); + } + + public function className(array $type): string + { + return safeClassName(studly($type['name'])); + } + + public function code(array $type, string $namespacePart): string + { + return $this->classCode( + $namespacePart, + $this->className($type), + $type['name'], + $this->accessorMethodsBuilder->code($type['inputFields'] ?? []), + argumentDefinitionListCode($type['inputFields'] ?? [], 3) + ); + } + + private function classCode( + string $namespacePart, + string $className, + string $typeName, + string $methodsCode, + string $fieldsCode + ): string { + return <<accessorMethodsBuilder = $accessorMethodsBuilder ?: new AccessorMethodsBuilder(); + } + + public function className(array $type): string + { + return safeClassName(studly($type['name'])); + } + + public function code(array $type, string $namespacePart): string + { + return $this->classCode( + $namespacePart, + $this->className($type), + $type['name'], + $this->accessorMethodsBuilder->code($type['fields'] ?? []), + fieldDefinitionListCode($type['fields'] ?? [], 3) + ); + } + + private function classCode( + string $namespacePart, + string $className, + string $typeName, + string $methodsCode, + string $fieldsCode + ): string { + return <<classFileWriter = $classFileWriter ?: new ClassFileWriter(); + } + + public function generate(array $schema, array $types, string $target): void + { + $this->generateOperations( + $types[$schema['queryType']['name']] ?? [], + 'query', + $target . '/Queries', + 'Queries' + ); + $this->generateOperations( + $types[$schema['mutationType']['name']] ?? [], + 'mutation', + $target . '/Mutations', + 'Mutations' + ); + } + + private function generateOperations(array $rootType, string $operationType, string $directory, string $namespacePart): void + { + foreach ($rootType['fields'] ?? [] as $field) { + $className = safeClassName(studly($field['name']) . operationClassSuffix($operationType)); + + $this->classFileWriter->write($directory, $className, operationClassCode( + $namespacePart, + $className, + $operationType, + fieldCode($field) + )); + } + } +} diff --git a/tools/GraphQLGenerator/ScalarTypeClassBuilder.php b/tools/GraphQLGenerator/ScalarTypeClassBuilder.php new file mode 100644 index 0000000..181fed4 --- /dev/null +++ b/tools/GraphQLGenerator/ScalarTypeClassBuilder.php @@ -0,0 +1,40 @@ +classCode( + $namespacePart, + $this->className($type), + $type['name'], + exportPhpValue($type['description'] ?? null, 2) + ); + } + + private function classCode(string $namespacePart, string $className, string $typeName, string $description): string + { + return <<loadFromFile($schemaSource) : $this->fetch(THOTH_GRAPHQL_ENDPOINT); + + if (!isset($response['data']['__schema']) || !is_array($response['data']['__schema'])) { + throw new GeneratorException('Invalid GraphQL introspection schema.'); + } + + return $response['data']['__schema']; + } + + private function loadFromFile(string $schemaPath): array + { + if (!is_file($schemaPath) || !is_readable($schemaPath)) { + throw new GeneratorException('Unable to read GraphQL introspection schema file: ' . $schemaPath); + } + + $contents = file_get_contents($schemaPath); + + if ($contents === false) { + throw new GeneratorException('Unable to read GraphQL introspection schema file: ' . $schemaPath); + } + + $schema = json_decode($contents, true); + + if (json_last_error() !== JSON_ERROR_NONE) { + throw new GeneratorException('Invalid GraphQL introspection schema JSON: ' . json_last_error_msg()); + } + + return is_array($schema) ? $schema : []; + } + + private function fetch(string $endpoint): array + { + $payload = json_encode(['query' => introspectionQuery()]); + $context = stream_context_create([ + 'http' => [ + 'method' => 'POST', + 'header' => "Content-Type: application/json\r\n", + 'content' => $payload, + ], + ]); + $schema = json_decode((string) file_get_contents($endpoint, false, $context), true); + + return is_array($schema) ? $schema : []; + } +} diff --git a/tools/GraphQLGenerator/SchemaTypeGenerator.php b/tools/GraphQLGenerator/SchemaTypeGenerator.php new file mode 100644 index 0000000..fa33940 --- /dev/null +++ b/tools/GraphQLGenerator/SchemaTypeGenerator.php @@ -0,0 +1,82 @@ +classFileWriter = $classFileWriter ?: new ClassFileWriter(); + $this->objectTypeBuilder = $objectTypeBuilder ?: new ObjectTypeClassBuilder(); + $this->inputTypeBuilder = $inputTypeBuilder ?: new InputTypeClassBuilder(); + $this->enumTypeBuilder = $enumTypeBuilder ?: new EnumTypeClassBuilder(); + $this->scalarTypeBuilder = $scalarTypeBuilder ?: new ScalarTypeClassBuilder(); + } + + public function generate(array $types, string $target, array $ignoredTypeNames = []): void + { + foreach ($types as $type) { + if ($this->shouldSkipType($type, $ignoredTypeNames)) { + continue; + } + + $this->generateType($type, $target); + } + } + + private function shouldSkipType(array $type, array $ignoredTypeNames): bool + { + if ($this->isInternalType($type)) { + return true; + } + + return isset($type['name']) && in_array($type['name'], $ignoredTypeNames, true); + } + + private function isInternalType(array $type): bool + { + return isset($type['name']) && strpos($type['name'], '__') === 0; + } + + private function generateType(array $type, string $target): void + { + switch ($type['kind'] ?? '') { + case 'OBJECT': + $this->writeClass($this->objectTypeBuilder, $type, $target . '/Schemas', 'Schemas'); + return; + case 'INPUT_OBJECT': + $this->writeClass($this->inputTypeBuilder, $type, $target . '/Inputs', 'Inputs'); + return; + case 'ENUM': + $this->writeClass($this->enumTypeBuilder, $type, $target . '/Enums', 'Enums'); + return; + case 'SCALAR': + $this->writeClass($this->scalarTypeBuilder, $type, $target . '/Scalars', 'Scalars'); + return; + } + } + + private function writeClass(TypeClassBuilder $builder, array $type, string $directory, string $namespacePart): void + { + $this->classFileWriter->write( + $directory, + $builder->className($type), + $builder->code($type, $namespacePart) + ); + } +} diff --git a/tools/GraphQLGenerator/TargetDirectoryGuard.php b/tools/GraphQLGenerator/TargetDirectoryGuard.php new file mode 100644 index 0000000..653921f --- /dev/null +++ b/tools/GraphQLGenerator/TargetDirectoryGuard.php @@ -0,0 +1,13 @@ +generate($argv[1] ?? null, $target); + } catch (GeneratorException $exception) { + fwrite(STDERR, $exception->getMessage() . "\n"); + exit(1); + } +}