• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

api-platform / core / 7582976395

19 Jan 2024 11:09AM UTC coverage: 61.988% (+0.03%) from 61.96%
7582976395

push

github

web-flow
feat(metadata): headers configuration (#6074)

27 of 40 new or added lines in 14 files covered. (67.5%)

46 existing lines in 8 files now uncovered.

17483 of 28204 relevant lines covered (61.99%)

32.43 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

58.39
/src/Metadata/ApiResource.php
1
<?php
2

3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <dunglas@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace ApiPlatform\Metadata;
15

16
use ApiPlatform\Metadata\GraphQl\Operation as GraphQlOperation;
17
use ApiPlatform\OpenApi\Model\Operation as OpenApiOperation;
18
use ApiPlatform\State\OptionsInterface;
19

20
/**
21
 * Resource metadata attribute.
22
 *
23
 * The API Resource attribute declares the behaviors attached to a Resource inside API Platform.
24
 * This class is immutable, and if you set a value yourself, API Platform will not override the value.
25
 * The API Resource helps sharing options with operations.
26
 *
27
 * Read more about how metadata works [here](/docs/in-depth/metadata).
28
 *
29
 * @author Antoine Bluchet <soyuka@gmail.com>
30
 */
31
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
32
class ApiResource extends Metadata
33
{
34
    use WithResourceTrait;
35

36
    protected ?Operations $operations;
37

38
    /**
39
     * @param array<int, HttpOperation>|array<string, HttpOperation>|Operations|null $operations   Operations is a list of HttpOperation
40
     * @param array<string, Link>|array<string, mixed[]>|string[]|string|null        $uriVariables
41
     * @param array<string, string>                                                  $headers
42
     * @param string|callable|null                                                   $provider
43
     * @param string|callable|null                                                   $processor
44
     * @param mixed|null                                                             $mercure
45
     * @param mixed|null                                                             $messenger
46
     * @param mixed|null                                                             $input
47
     * @param mixed|null                                                             $output
48
     */
49
    public function __construct(
50
        /**
51
         * The URI template represents your resource IRI with optional variables. It follows [RFC 6570](https://www.rfc-editor.org/rfc/rfc6570.html).
52
         * API Platform generates this URL for you if you leave this empty.
53
         */
54
        protected ?string $uriTemplate = null,
55

56
        /**
57
         * The short name of your resource is a unique name that identifies your resource.
58
         * It is used within the documentation and for url generation if the `uriTemplate` is not filled. By default, this will be the name of your PHP class.
59
         */
60
        protected ?string $shortName = null,
61

62
        /**
63
         * A description for this resource that will show on documentations.
64
         */
65
        protected ?string $description = null,
66

67
        /**
68
         * The RDF types of this resource.
69
         * An RDF type is usually a URI referencing how your resource is structured for the outside world. Values can be a string `https://schema.org/Book`
70
         * or an array of string `['https://schema.org/Flight', 'https://schema.org/BusTrip']`.
71
         */
72
        protected string|array|null $types = null,
73

74
        /**
75
         * Operations is a list of [HttpOperation](./HttpOperation).
76
         *
77
         * By default API Platform declares operations representing CRUD routes if you don't specify this parameter:
78
         *
79
         * ```php
80
         * #[ApiResource(
81
         *     operations: [
82
         *         new Get(uriTemplate: '/books/{id}'),
83
         *         // The GetCollection operation returns a list of Books.
84
         *         new GetCollection(uriTemplate: '/books'),
85
         *         new Post(uriTemplate: '/books'),
86
         *         new Patch(uriTemplate: '/books/{id}'),
87
         *         new Delete(uriTemplate: '/books/{id}'),
88
         *     ]
89
         * )]
90
         *
91
         * ```
92
         *
93
         * Try this live at [play.api-platform.com/api-resource](play.api-platform.com).
94
         */
95
        $operations = null,
96

97
        /**
98
         * The `formats` option allows you to customize content negotiation. By default API Platform supports JsonLd, Hal, JsonAPI.
99
         * For other formats we use the Symfony Serializer.
100
         *
101
         * ```php
102
         * #[ApiResource(
103
         *   formats: [
104
         *       'jsonld' => ['application/ld+json'],
105
         *       'jsonhal' => ['application/hal+json'],
106
         *       'jsonapi' => ['application/vnd.api+json'],
107
         *       'json' =>    ['application/json'],
108
         *       'xml' =>     ['application/xml', 'text/xml'],
109
         *       'yaml' =>    ['application/x-yaml'],
110
         *       'csv' =>     ['text/csv'],
111
         *       'html' =>    ['text/html'],
112
         *       'myformat' =>['application/vnd.myformat'],
113
         *   ]
114
         * )]
115
         * ```
116
         *
117
         * Learn more about custom formats in the [dedicated guide](/guides/custom-formats).
118
         */
119
        protected array|string|null $formats = null,
120
        /**
121
         * The `inputFormats` option allows you to customize content negotiation for HTTP bodies:.
122
         *
123
         * ```php
124
         *  #[ApiResource(formats: ['jsonld', 'csv' => ['text/csv']], operations: [
125
         *      new Patch(inputFormats: ['json' => ['application/merge-patch+json']]),
126
         *      new GetCollection(),
127
         *      new Post(),
128
         *  ])]
129
         * ```
130
         */
131
        protected array|string|null $inputFormats = null,
132
        /**
133
         * The `outputFormats` option allows you to customize content negotiation for HTTP responses.
134
         */
135
        protected array|string|null $outputFormats = null,
136
        /**
137
         * The `uriVariables` configuration allows to configure to what each URI Variable.
138
         * With [simple string expansion](https://www.rfc-editor.org/rfc/rfc6570.html#section-3.2.2), we read the input
139
         * value and match this to the given `Link`. Note that this setting is usually used on an operation directly:.
140
         *
141
         * ```php
142
         *   #[ApiResource(
143
         *       uriTemplate: '/companies/{companyId}/employees/{id}',
144
         *       uriVariables: [
145
         *           'companyId' => new Link(fromClass: Company::class, toProperty: 'company']),
146
         *           'id' => new Link(fromClass: Employee::class)
147
         *       ],
148
         *       operations: [new Get()]
149
         *   )]
150
         * ```
151
         *
152
         * For more examples, read our guide on [subresources](/guides/subresources).
153
         */
154
        protected $uriVariables = null,
155
        /**
156
         * The `routePrefix` allows you to configure a prefix that will apply to this resource.
157
         *
158
         * ```php
159
         *   #[ApiResource(
160
         *       routePrefix: '/books',
161
         *       operations: [new Get(uriTemplate: '/{id}')]
162
         *   )]
163
         * ```
164
         *
165
         * This resource will be accessible through `/books/{id}`.
166
         */
167
        protected ?string $routePrefix = null,
168
        /**
169
         * The `defaults` option adds up to [Symfony's route defaults](https://github.com/symfony/routing/blob/8f068b792e515b25e26855ac8dc7fe800399f3e5/Route.php#L41). You can override [API Platform's defaults](https://github.com/api-platform/core/blob/6abd0fe0a69d4842eb6d5c31ef2bd6dce0e1d372/src/Symfony/Routing/ApiLoader.php#L87) if needed.
170
         */
171
        protected ?array $defaults = null,
172
        /**
173
         * The `requirements` option configures the Symfony's Route requirements.
174
         */
175
        protected ?array $requirements = null,
176
        /**
177
         * The `options` option configures the Symfony's Route options.
178
         */
179
        protected ?array $options = null,
180
        /**
181
         * The `stateless` option configures the Symfony's Route stateless option.
182
         */
183
        protected ?bool $stateless = null,
184
        /**
185
         * The `sunset` option indicates when a deprecated operation will be removed.
186
         *
187
         * <div data-code-selector>
188
         *
189
         * ```php
190
         * <?php
191
         * // api/src/Entity/Parchment.php
192
         * use ApiPlatform\Metadata\ApiResource;
193
         *
194
         * #[ApiResource(deprecationReason: 'Create a Book instead', sunset: '01/01/2020')]
195
         * class Parchment
196
         * {
197
         *     // ...
198
         * }
199
         * ```
200
         *
201
         * ```yaml
202
         * # api/config/api_platform/resources.yaml
203
         * resources:
204
         *     App\Entity\Parchment:
205
         *         - deprecationReason: 'Create a Book instead'
206
         *           sunset: '01/01/2020'
207
         * ```
208
         *
209
         * ```xml
210
         * <?xml version="1.0" encoding="UTF-8" ?>
211
         * <!-- api/config/api_platform/resources.xml -->
212
         *
213
         * <resources
214
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
215
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
216
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
217
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
218
         *     <resource class="App\Entity\Parchment" deprecationReason="Create a Book instead" sunset="01/01/2020" />
219
         * </resources>
220
         * ```
221
         *
222
         * </div>
223
         */
224
        protected ?string $sunset = null,
225
        protected ?string $acceptPatch = null,
226
        protected ?int $status = null,
227
        protected ?string $host = null,
228
        protected ?array $schemes = null,
229
        protected ?string $condition = null,
230
        protected ?string $controller = null,
231
        protected ?string $class = null,
232
        /**
233
         * The `urlGenerationStrategy` option configures the url generation strategy.
234
         *
235
         * See: [UrlGeneratorInterface::class](/reference/Api/UrlGeneratorInterface)
236
         *
237
         * <div data-code-selector>
238
         *
239
         * ```php
240
         * <?php
241
         * // api/src/Entity/Book.php
242
         * use ApiPlatform\Metadata\ApiResource;
243
         * use ApiPlatform\Api\UrlGeneratorInterface;
244
         *
245
         * #[ApiResource(urlGenerationStrategy: UrlGeneratorInterface::ABS_URL)]
246
         * class Book
247
         * {
248
         *     // ...
249
         * }
250
         * ```
251
         *
252
         * ```yaml
253
         * # api/config/api_platform/resources.yaml
254
         * App\Entity\Book:
255
         *     urlGenerationStrategy: !php/const ApiPlatform\Api\UrlGeneratorInterface::ABS_URL
256
         * ```
257
         *
258
         * ```xml
259
         * <?xml version="1.0" encoding="UTF-8" ?>
260
         * <!-- api/config/api_platform/resources.xml -->
261
         *
262
         * <resources
263
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
264
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
265
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
266
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
267
         *     <resource class="App\Entity\Book" urlGenerationStrategy="0" />
268
         * </resources>
269
         * ```
270
         *
271
         * </div>
272
         */
273
        protected ?int $urlGenerationStrategy = null,
274
        /**
275
         * The `deprecationReason` option deprecates the current resource with a deprecation message.
276
         *
277
         * <div data-code-selector>
278
         *
279
         * ```php
280
         * <?php
281
         * // api/src/Entity/Parchment.php
282
         * use ApiPlatform\Metadata\ApiResource;
283
         *
284
         * #[ApiResource(deprecationReason: 'Create a Book instead')]
285
         * class Parchment
286
         * {
287
         *     // ...
288
         * }
289
         * ```
290
         *
291
         * ```yaml
292
         * # api/config/api_platform/resources.yaml
293
         * resources:
294
         *     App\Entity\Parchment:
295
         *         - deprecationReason: 'Create a Book instead'
296
         * ```
297
         *
298
         * ```xml
299
         * <?xml version="1.0" encoding="UTF-8" ?>
300
         * <!-- api/config/api_platform/resources.xml -->
301
         *
302
         * <resources
303
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
304
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
305
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
306
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
307
         *     <resource class="App\Entity\Parchment" deprecationReason="Create a Book instead" />
308
         * </resources>
309
         * ```
310
         *
311
         * </div>
312
         *
313
         * - With JSON-lD / Hydra, [an `owl:deprecated` annotation property](https://www.w3.org/TR/owl2-syntax/#Annotation_Properties) will be added to the appropriate data structure
314
         * - With Swagger / OpenAPI, [a `deprecated` property](https://swagger.io/docs/specification/2-0/paths-and-operations/) will be added
315
         * - With GraphQL, the [`isDeprecated` and `deprecationReason` properties](https://facebook.github.io/graphql/June2018/#sec-Deprecation) will be added to the schema
316
         */
317
        protected ?string $deprecationReason = null,
318
        protected ?array $headers = null,
319
        protected ?array $cacheHeaders = null,
320
        protected ?array $normalizationContext = null,
321
        protected ?array $denormalizationContext = null,
322
        protected ?bool $collectDenormalizationErrors = null,
323
        protected ?array $hydraContext = null,
324
        protected ?array $openapiContext = null, // TODO Remove in 4.0
325
        protected bool|OpenApiOperation|null $openapi = null,
326
        /**
327
         * The `validationContext` option configures the context of validation for the current ApiResource.
328
         * You can, for instance, describe the validation groups that will be used:.
329
         *
330
         * ```php
331
         * #[ApiResource(validationContext: ['groups' => ['a', 'b']])]
332
         * ```
333
         *
334
         * For more examples, read our guide on [validation](/guides/validation).
335
         */
336
        protected ?array $validationContext = null,
337
        /**
338
         * The `filters` option configures the filters (declared as services) available on the collection routes for the current resource.
339
         *
340
         * <div data-code-selector>
341
         *
342
         * ```php
343
         * <?php
344
         * // api/src/Entity/Book.php
345
         * use ApiPlatform\Metadata\ApiResource;
346
         *
347
         * #[ApiResource(filters: ['app.filters.book.search'])]
348
         * class Book
349
         * {
350
         *     // ...
351
         * }
352
         * ```
353
         *
354
         * ```yaml
355
         * # api/config/api_platform/resources.yaml
356
         * resources:
357
         *     App\Entity\Book:
358
         *         - filters: ['app.filters.book.search']
359
         * ```
360
         *
361
         * ```xml
362
         * <?xml version="1.0" encoding="UTF-8" ?>
363
         * <!-- api/config/api_platform/resources.xml -->
364
         * <resources
365
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
366
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
367
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
368
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
369
         *     <resource class="App\Entity\Book">
370
         *         <filters>
371
         *             <filter>app.filters.book.search</filter>
372
         *         </filters>
373
         *     </resource>
374
         * </resources>
375
         * ```
376
         *
377
         * </div>
378
         */
379
        protected ?array $filters = null,
380
        protected ?bool $elasticsearch = null,
381
        protected $mercure = null,
382
        /**
383
         * The `messenger` option dispatches the current resource through the Message Bus.
384
         *
385
         * <div data-code-selector>
386
         *
387
         * ```php
388
         * <?php
389
         * // api/src/Entity/Book.php
390
         * use ApiPlatform\Metadata\ApiResource;
391
         *
392
         * #[ApiResource(messenger: true)]
393
         * class Book
394
         * {
395
         *     // ...
396
         * }
397
         * ```
398
         *
399
         * ```yaml
400
         * # api/config/api_platform/resources.yaml
401
         * resources:
402
         *     App\Entity\Book:
403
         *         - messenger: true
404
         * ```
405
         *
406
         * ```xml
407
         * <?xml version="1.0" encoding="UTF-8" ?>
408
         * <!-- api/config/api_platform/resources.xml -->
409
         *
410
         * <resources
411
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
412
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
413
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
414
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
415
         *     <resource class="App\Entity\Book" messenger=true />
416
         * </resources>
417
         * ```
418
         *
419
         * </div>
420
         *
421
         * Note: when using `messenger=true` on a Doctrine entity, the Doctrine Processor is not called. If you want it
422
         * to be called, you should [decorate a built-in state processor](/docs/guide/hook-a-persistence-layer-with-a-processor)
423
         * and implement your own logic.
424
         *
425
         * Read [how to use Messenger with an Input object](/docs/guide/using-messenger-with-an-input-object).
426
         *
427
         * @var string|bool|null
428
         */
429
        protected $messenger = null,
430
        protected $input = null,
431
        protected $output = null,
432
        /**
433
         * Override the default order of items in your collection. Note that this is handled by our doctrine filters such as
434
         * the [OrderFilter](/docs/reference/Doctrine/Orm/Filter/OrderFilter).
435
         *
436
         * By default, items in the collection are ordered in ascending (ASC) order by their resource identifier(s). If you want to
437
         * customize this order, you must add an `order` attribute on your ApiResource annotation:
438
         *
439
         * <div data-code-selector>
440
         *
441
         * ```php
442
         * <?php
443
         * // api/src/Entity/Book.php
444
         * namespace App\Entity;
445
         *
446
         * use ApiPlatform\Metadata\ApiResource;
447
         *
448
         * #[ApiResource(order: ['foo' => 'ASC'])]
449
         * class Book
450
         * {
451
         * }
452
         * ```
453
         *
454
         * ```yaml
455
         * # api/config/api_platform/resources/Book.yaml
456
         * App\Entity\Book:
457
         *     order:
458
         *         foo: ASC
459
         * ```
460
         *
461
         * </div>
462
         *
463
         * This `order` attribute is used as an array: the key defines the order field, the values defines the direction.
464
         * If you only specify the key, `ASC` direction will be used as default.
465
         */
466
        protected ?array $order = null,
467
        protected ?bool $fetchPartial = null,
468
        protected ?bool $forceEager = null,
469
        /**
470
         * The `paginationClientEnabled` option allows (or disallows) the client to enable (or disable) the pagination for the current resource.
471
         *
472
         * <div data-code-selector>
473
         *
474
         * ```php
475
         * <?php
476
         * // api/src/Entity/Book.php
477
         * use ApiPlatform\Metadata\ApiResource;
478
         *
479
         * #[ApiResource(paginationClientEnabled: true)]
480
         * class Book
481
         * {
482
         *     // ...
483
         * }
484
         * ```
485
         *
486
         * ```yaml
487
         * # api/config/api_platform/resources.yaml
488
         * resources:
489
         *     App\Entity\Book:
490
         *         - paginationClientEnabled: true
491
         * ```
492
         *
493
         * ```xml
494
         * <?xml version="1.0" encoding="UTF-8" ?>
495
         * <!-- api/config/api_platform/resources.xml -->
496
         *
497
         * <resources
498
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
499
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
500
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
501
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
502
         *     <resource class="App\Entity\Book" paginationClientEnabled=true />
503
         * </resources>
504
         * ```
505
         *
506
         * </div>
507
         *
508
         * The pagination can now be enabled (or disabled) by adding a query parameter named `pagination`:
509
         * - `GET /books?pagination=false`: disabled
510
         * - `GET /books?pagination=true`: enabled
511
         */
512
        protected ?bool $paginationClientEnabled = null,
513
        /**
514
         * The `paginationClientItemsPerPage` option allows (or disallows) the client to set the number of items per page for the current resource.
515
         *
516
         * <div data-code-selector>
517
         *
518
         * ```php
519
         * <?php
520
         * // api/src/Entity/Book.php
521
         * use ApiPlatform\Metadata\ApiResource;
522
         *
523
         * #[ApiResource(paginationClientItemsPerPage: true)]
524
         * class Book
525
         * {
526
         *     // ...
527
         * }
528
         * ```
529
         *
530
         * ```yaml
531
         * # api/config/api_platform/resources.yaml
532
         * resources:
533
         *     App\Entity\Book:
534
         *         - paginationClientItemsPerPage: true
535
         * ```
536
         *
537
         * ```xml
538
         * <?xml version="1.0" encoding="UTF-8" ?>
539
         * <!-- api/config/api_platform/resources.xml -->
540
         *
541
         * <resources
542
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
543
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
544
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
545
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
546
         *     <resource class="App\Entity\Book" paginationClientItemsPerPage=true />
547
         * </resources>
548
         * ```
549
         *
550
         * </div>
551
         *
552
         * The number of items can now be set by adding a query parameter named `itemsPerPage`:
553
         * - `GET /books?itemsPerPage=50`
554
         */
555
        protected ?bool $paginationClientItemsPerPage = null,
556
        /**
557
         * The `paginationClientPartial` option allows (or disallows) the client to enable (or disable) the partial pagination for the current resource.
558
         *
559
         * <div data-code-selector>
560
         *
561
         * ```php
562
         * <?php
563
         * // api/src/Entity/Book.php
564
         * use ApiPlatform\Metadata\ApiResource;
565
         *
566
         * #[ApiResource(paginationClientPartial: true)]
567
         * class Book
568
         * {
569
         *     // ...
570
         * }
571
         * ```
572
         *
573
         * ```yaml
574
         * # api/config/api_platform/resources.yaml
575
         * resources:
576
         *     App\Entity\Book:
577
         *         - paginationClientPartial: true
578
         * ```
579
         *
580
         * ```xml
581
         * <?xml version="1.0" encoding="UTF-8" ?>
582
         * <!-- api/config/api_platform/resources.xml -->
583
         *
584
         * <resources
585
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
586
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
587
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
588
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
589
         *     <resource class="App\Entity\Book" paginationClientPartial=true />
590
         * </resources>
591
         * ```
592
         *
593
         * </div>
594
         *
595
         * The partial pagination can now be enabled (or disabled) by adding a query parameter named `partial`:
596
         * - `GET /books?partial=false`: disabled
597
         * - `GET /books?partial=true`: enabled
598
         */
599
        protected ?bool $paginationClientPartial = null,
600
        /**
601
         * The `paginationViaCursor` option configures the cursor-based pagination for the current resource.
602
         * Select your unique sorted field as well as the direction you'll like the pagination to go via filters.
603
         * Note that for now you have to declare a `RangeFilter` and an `OrderFilter` on the property used for the cursor-based pagination:.
604
         *
605
         * <div data-code-selector>
606
         *
607
         * ```php
608
         * <?php
609
         * // api/src/Entity/Book.php
610
         * use ApiPlatform\Metadata\ApiFilter;
611
         * use ApiPlatform\Metadata\ApiResource;
612
         * use ApiPlatform\Doctrine\Odm\Filter\OrderFilter;
613
         * use ApiPlatform\Doctrine\Odm\Filter\RangeFilter;
614
         *
615
         * #[ApiResource(paginationPartial: true, paginationViaCursor: [['field' => 'id', 'direction' => 'DESC']])]
616
         * #[ApiFilter(RangeFilter::class, properties: ["id"])]
617
         * #[ApiFilter(OrderFilter::class, properties: ["id" => "DESC"])]
618
         * class Book
619
         * {
620
         *     // ...
621
         * }
622
         * ```
623
         *
624
         * ```yaml
625
         * # api/config/api_platform/resources.yaml
626
         * resources:
627
         *     App\Entity\Book:
628
         *         - paginationPartial: true
629
         *           paginationViaCursor:
630
         *               - { field: 'id', direction: 'DESC' }
631
         *           filters: [ 'app.filters.book.range', 'app.filters.book.order' ]
632
         * ```
633
         *
634
         * ```xml
635
         * <?xml version="1.0" encoding="UTF-8" ?>
636
         * <!-- api/config/api_platform/resources.xml -->
637
         *
638
         * <resources
639
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
640
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
641
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
642
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
643
         *     <resource class="App\Entity\Book" paginationPartial=true>
644
         *         <filters>
645
         *             <filter>app.filters.book.range</filter>
646
         *             <filter>app.filters.book.order</filter>
647
         *         </filters>
648
         *         <paginationViaCursor>
649
         *             <paginationField field="id" direction="DESC" />
650
         *         </paginationViaCursor>
651
         *     </resource>
652
         * </resources>
653
         * ```
654
         *
655
         * </div>
656
         *
657
         * To know more about cursor-based pagination take a look at [this blog post on medium (draft)](https://medium.com/@sroze/74fd1d324723).
658
         */
659
        protected ?array $paginationViaCursor = null,
660
        /**
661
         * The `paginationEnabled` option enables (or disables) the pagination for the current resource.
662
         *
663
         * <div data-code-selector>
664
         *
665
         * ```php
666
         * <?php
667
         * // api/src/Entity/Book.php
668
         * use ApiPlatform\Metadata\ApiResource;
669
         *
670
         * #[ApiResource(paginationEnabled: true)]
671
         * class Book
672
         * {
673
         *     // ...
674
         * }
675
         * ```
676
         *
677
         * ```yaml
678
         * # api/config/api_platform/resources.yaml
679
         * resources:
680
         *     App\Entity\Book:
681
         *         - paginationEnabled: true
682
         * ```
683
         *
684
         * ```xml
685
         * <?xml version="1.0" encoding="UTF-8" ?>
686
         * <!-- api/config/api_platform/resources.xml -->
687
         *
688
         * <resources
689
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
690
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
691
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
692
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
693
         *     <resource class="App\Entity\Book" paginationEnabled=true />
694
         * </resources>
695
         * ```
696
         *
697
         * </div>
698
         */
699
        protected ?bool $paginationEnabled = null,
700
        /**
701
         * The PaginationExtension of API Platform performs some checks on the `QueryBuilder` to guess, in most common
702
         * cases, the correct values to use when configuring the Doctrine ORM Paginator: `$fetchJoinCollection`
703
         * argument, whether there is a join to a collection-valued association.
704
         *
705
         * When set to `true`, the Doctrine ORM Paginator will perform an additional query, in order to get the
706
         * correct number of results. You can configure this using the `paginationFetchJoinCollection` option:
707
         *
708
         * <div data-code-selector>
709
         *
710
         * ```php
711
         * <?php
712
         * // api/src/Entity/Book.php
713
         * use ApiPlatform\Metadata\ApiResource;
714
         *
715
         * #[ApiResource(paginationFetchJoinCollection: false)]
716
         * class Book
717
         * {
718
         *     // ...
719
         * }
720
         * ```
721
         *
722
         * ```yaml
723
         * # api/config/api_platform/resources.yaml
724
         * resources:
725
         *     App\Entity\Book:
726
         *         - paginationFetchJoinCollection: false
727
         * ```
728
         *
729
         * ```xml
730
         * <?xml version="1.0" encoding="UTF-8" ?>
731
         * <!-- api/config/api_platform/resources.xml -->
732
         *
733
         * <resources
734
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
735
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
736
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
737
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
738
         *     <resource class="App\Entity\Book" paginationFetchJoinCollection=false />
739
         * </resources>
740
         * ```
741
         *
742
         * </div>
743
         *
744
         * For more information, please see the [Pagination](https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/pagination.html) entry in the Doctrine ORM documentation.
745
         */
746
        protected ?bool $paginationFetchJoinCollection = null,
747
        /**
748
         * The PaginationExtension of API Platform performs some checks on the `QueryBuilder` to guess, in most common
749
         * cases, the correct values to use when configuring the Doctrine ORM Paginator: `$setUseOutputWalkers` setter,
750
         * whether to use output walkers.
751
         *
752
         * When set to `true`, the Doctrine ORM Paginator will use output walkers, which are compulsory for some types
753
         * of queries. You can configure this using the `paginationUseOutputWalkers` option:
754
         *
755
         * <div data-code-selector>
756
         *
757
         * ```php
758
         * <?php
759
         * // api/src/Entity/Book.php
760
         * use ApiPlatform\Metadata\ApiResource;
761
         *
762
         * #[ApiResource(paginationUseOutputWalkers: false)]
763
         * class Book
764
         * {
765
         *     // ...
766
         * }
767
         * ```
768
         *
769
         * ```yaml
770
         * # api/config/api_platform/resources.yaml
771
         * resources:
772
         *     App\Entity\Book:
773
         *         - paginationUseOutputWalkers: false
774
         * ```
775
         *
776
         * ```xml
777
         * <?xml version="1.0" encoding="UTF-8" ?>
778
         * <!-- api/config/api_platform/resources.xml -->
779
         * <resources
780
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
781
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
782
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
783
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
784
         *     <resource class="App\Entity\Book" paginationUseOutputWalkers=false />
785
         * </resources>
786
         * ```
787
         *
788
         * </div>
789
         *
790
         * For more information, please see the [Pagination](https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/pagination.html) entry in the Doctrine ORM documentation.
791
         */
792
        protected ?bool $paginationUseOutputWalkers = null,
793
        /**
794
         * The `paginationItemsPerPage` option defines the number of items per page for the current resource.
795
         *
796
         * <div data-code-selector>
797
         *
798
         * ```php
799
         * <?php
800
         * // api/src/Entity/Book.php
801
         * use ApiPlatform\Metadata\ApiResource;
802
         *
803
         * #[ApiResource(paginationItemsPerPage: 30)]
804
         * class Book
805
         * {
806
         *     // ...
807
         * }
808
         * ```
809
         *
810
         * ```yaml
811
         * # api/config/api_platform/resources.yaml
812
         * resources:
813
         *     App\Entity\Book:
814
         *         - paginationItemsPerPage: 30
815
         * ```
816
         *
817
         * ```xml
818
         * <?xml version="1.0" encoding="UTF-8" ?>
819
         * <!-- api/config/api_platform/resources.xml -->
820
         * <resources
821
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
822
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
823
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
824
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
825
         *     <resource class="App\Entity\Book" paginationItemsPerPage=30 />
826
         * </resources>
827
         * ```
828
         *
829
         * </div>
830
         */
831
        protected ?int $paginationItemsPerPage = null,
832
        /**
833
         * The `paginationMaximumItemsPerPage` option defines the maximum number of items per page for the current resource.
834
         *
835
         * <div data-code-selector>
836
         *
837
         * ```php
838
         * <?php
839
         * // api/src/Entity/Book.php
840
         * use ApiPlatform\Metadata\ApiResource;
841
         *
842
         * #[ApiResource(paginationMaximumItemsPerPage: 50)]
843
         * class Book
844
         * {
845
         *     // ...
846
         * }
847
         * ```
848
         *
849
         * ```yaml
850
         * # api/config/api_platform/resources.yaml
851
         * resources:
852
         *     App\Entity\Book:
853
         *         - paginationMaximumItemsPerPage: 50
854
         * ```
855
         *
856
         * ```xml
857
         * <?xml version="1.0" encoding="UTF-8" ?>
858
         * <!-- api/config/api_platform/resources.xml -->
859
         * <resources
860
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
861
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
862
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
863
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
864
         *     <resource class="App\Entity\Book" paginationMaximumItemsPerPage=50 />
865
         * </resources>
866
         * ```
867
         *
868
         * </div>
869
         */
870
        protected ?int $paginationMaximumItemsPerPage = null,
871
        /**
872
         * The `paginationPartial` option enables (or disables) the partial pagination for the current resource.
873
         *
874
         * <div data-code-selector>
875
         *
876
         * ```php
877
         * <?php
878
         * // api/src/Entity/Book.php
879
         * use ApiPlatform\Metadata\ApiResource;
880
         *
881
         * #[ApiResource(paginationPartial: true)]
882
         * class Book
883
         * {
884
         *     // ...
885
         * }
886
         * ```
887
         *
888
         * ```yaml
889
         * # api/config/api_platform/resources.yaml
890
         * resources:
891
         *     App\Entity\Book:
892
         *         - paginationPartial: true
893
         * ```
894
         *
895
         * ```xml
896
         * <?xml version="1.0" encoding="UTF-8" ?>
897
         * <!-- api/config/api_platform/resources.xml -->
898
         * <resources
899
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
900
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
901
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
902
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
903
         *     <resource class="App\Entity\Book" paginationPartial=true />
904
         * </resources>
905
         * ```
906
         *
907
         * </div>
908
         */
909
        protected ?bool $paginationPartial = null,
910
        /**
911
         * The `paginationType` option defines the type of pagination (`page` or `cursor`) to use for the current resource.
912
         *
913
         * <div data-code-selector>
914
         *
915
         * ```php
916
         * <?php
917
         * // api/src/Entity/Book.php
918
         * use ApiPlatform\Metadata\ApiResource;
919
         *
920
         * #[ApiResource(paginationType: 'page')]
921
         * class Book
922
         * {
923
         *     // ...
924
         * }
925
         * ```
926
         *
927
         * ```yaml
928
         * # api/config/api_platform/resources.yaml
929
         * resources:
930
         *     App\Entity\Book:
931
         *         - paginationType: page
932
         * ```
933
         *
934
         * ```xml
935
         * <?xml version="1.0" encoding="UTF-8" ?>
936
         * <!-- api/config/api_platform/resources.xml -->
937
         * <resources
938
         *         xmlns="https://api-platform.com/schema/metadata/resources-3.0"
939
         *         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
940
         *         xsi:schemaLocation="https://api-platform.com/schema/metadata/resources-3.0
941
         *         https://api-platform.com/schema/metadata/resources-3.0.xsd">
942
         *     <resource class="App\Entity\Book" paginationType="page" />
943
         * </resources>
944
         * ```
945
         *
946
         * </div>
947
         */
948
        protected ?string $paginationType = null,
949
        protected ?string $security = null,
950
        protected ?string $securityMessage = null,
951
        protected ?string $securityPostDenormalize = null,
952
        protected ?string $securityPostDenormalizeMessage = null,
953
        protected ?string $securityPostValidation = null,
954
        protected ?string $securityPostValidationMessage = null,
955
        protected ?bool $compositeIdentifier = null,
956
        protected ?array $exceptionToStatus = null,
957
        protected ?bool $queryParameterValidationEnabled = null,
958
        protected ?array $links = null,
959
        protected ?array $graphQlOperations = null,
960
        $provider = null,
961
        $processor = null,
962
        protected ?OptionsInterface $stateOptions = null,
963
        protected array $extraProperties = [],
964
    ) {
965
        parent::__construct(
696✔
966
            shortName: $shortName,
696✔
967
            class: $class,
696✔
968
            description: $description,
696✔
969
            urlGenerationStrategy: $urlGenerationStrategy,
696✔
970
            deprecationReason: $deprecationReason,
696✔
971
            normalizationContext: $normalizationContext,
696✔
972
            denormalizationContext: $denormalizationContext,
696✔
973
            collectDenormalizationErrors: $collectDenormalizationErrors,
696✔
974
            validationContext: $validationContext,
696✔
975
            filters: $filters,
696✔
976
            elasticsearch: $elasticsearch,
696✔
977
            mercure: $mercure,
696✔
978
            messenger: $messenger,
696✔
979
            input: $input,
696✔
980
            output: $output,
696✔
981
            order: $order,
696✔
982
            fetchPartial: $fetchPartial,
696✔
983
            forceEager: $forceEager,
696✔
984
            paginationEnabled: $paginationEnabled,
696✔
985
            paginationType: $paginationType,
696✔
986
            paginationItemsPerPage: $paginationItemsPerPage,
696✔
987
            paginationMaximumItemsPerPage: $paginationMaximumItemsPerPage,
696✔
988
            paginationPartial: $paginationPartial,
696✔
989
            paginationClientEnabled: $paginationClientEnabled,
696✔
990
            paginationClientItemsPerPage: $paginationClientItemsPerPage,
696✔
991
            paginationClientPartial: $paginationClientPartial,
696✔
992
            paginationFetchJoinCollection: $paginationFetchJoinCollection,
696✔
993
            paginationUseOutputWalkers: $paginationUseOutputWalkers,
696✔
994
            security: $security,
696✔
995
            securityMessage: $securityMessage,
696✔
996
            securityPostDenormalize: $securityPostDenormalize,
696✔
997
            securityPostDenormalizeMessage: $securityPostDenormalizeMessage,
696✔
998
            securityPostValidation: $securityPostValidation,
696✔
999
            securityPostValidationMessage: $securityPostValidationMessage,
696✔
1000
            provider: $provider,
696✔
1001
            processor: $processor,
696✔
1002
            stateOptions: $stateOptions,
696✔
1003
            extraProperties: $extraProperties
696✔
1004
        );
696✔
1005

1006
        $this->operations = null === $operations ? null : new Operations($operations);
696✔
1007
        $this->provider = $provider;
696✔
1008
        $this->processor = $processor;
696✔
1009
        if (\is_string($types)) {
696✔
1010
            $this->types = (array) $types;
×
1011
        }
1012
    }
1013

1014
    public function getOperations(): ?Operations
1015
    {
1016
        return $this->operations;
764✔
1017
    }
1018

1019
    public function withOperations(Operations $operations): self
1020
    {
1021
        $self = clone $this;
424✔
1022
        $self->operations = $operations;
424✔
1023

1024
        return $self;
424✔
1025
    }
1026

1027
    public function getUriTemplate(): ?string
1028
    {
1029
        return $this->uriTemplate;
44✔
1030
    }
1031

1032
    public function withUriTemplate(string $uriTemplate): self
1033
    {
1034
        $self = clone $this;
16✔
1035
        $self->uriTemplate = $uriTemplate;
16✔
1036

1037
        return $self;
16✔
1038
    }
1039

1040
    public function getTypes(): ?array
1041
    {
1042
        return $this->types;
52✔
1043
    }
1044

1045
    /**
1046
     * @param string[]|string $types
1047
     */
1048
    public function withTypes(array|string $types): self
1049
    {
1050
        $self = clone $this;
20✔
1051
        $self->types = (array) $types;
20✔
1052

1053
        return $self;
20✔
1054
    }
1055

1056
    /**
1057
     * @return array|mixed|string|null
1058
     */
1059
    public function getFormats()
1060
    {
1061
        return $this->formats;
44✔
1062
    }
1063

1064
    public function withFormats(mixed $formats): self
1065
    {
1066
        $self = clone $this;
×
1067
        $self->formats = $formats;
×
1068

1069
        return $self;
×
1070
    }
1071

1072
    /**
1073
     * @return array|mixed|string|null
1074
     */
1075
    public function getInputFormats()
1076
    {
1077
        return $this->inputFormats;
44✔
1078
    }
1079

1080
    /**
1081
     * @param mixed|null $inputFormats
1082
     */
1083
    public function withInputFormats($inputFormats): self
1084
    {
1085
        $self = clone $this;
×
1086
        $self->inputFormats = $inputFormats;
×
1087

1088
        return $self;
×
1089
    }
1090

1091
    /**
1092
     * @return array|mixed|string|null
1093
     */
1094
    public function getOutputFormats()
1095
    {
1096
        return $this->outputFormats;
44✔
1097
    }
1098

1099
    /**
1100
     * @param mixed|null $outputFormats
1101
     */
1102
    public function withOutputFormats($outputFormats): self
1103
    {
1104
        $self = clone $this;
×
1105
        $self->outputFormats = $outputFormats;
×
1106

1107
        return $self;
×
1108
    }
1109

1110
    /**
1111
     * @return array<string, Link>|array<string, array>|string[]|string|null
1112
     */
1113
    public function getUriVariables()
1114
    {
1115
        return $this->uriVariables;
44✔
1116
    }
1117

1118
    /**
1119
     * @param array<string, Link>|array<string, array>|string[]|string|null $uriVariables
1120
     */
1121
    public function withUriVariables($uriVariables): self
1122
    {
1123
        $self = clone $this;
32✔
1124
        $self->uriVariables = $uriVariables;
32✔
1125

1126
        return $self;
32✔
1127
    }
1128

1129
    public function getRoutePrefix(): ?string
1130
    {
1131
        return $this->routePrefix;
44✔
1132
    }
1133

1134
    public function withRoutePrefix(string $routePrefix): self
1135
    {
1136
        $self = clone $this;
×
1137
        $self->routePrefix = $routePrefix;
×
1138

1139
        return $self;
×
1140
    }
1141

1142
    public function getDefaults(): ?array
1143
    {
1144
        return $this->defaults;
44✔
1145
    }
1146

1147
    public function withDefaults(array $defaults): self
1148
    {
1149
        $self = clone $this;
×
1150
        $self->defaults = $defaults;
×
1151

1152
        return $self;
×
1153
    }
1154

1155
    public function getRequirements(): ?array
1156
    {
1157
        return $this->requirements;
44✔
1158
    }
1159

1160
    public function withRequirements(array $requirements): self
1161
    {
1162
        $self = clone $this;
×
1163
        $self->requirements = $requirements;
×
1164

1165
        return $self;
×
1166
    }
1167

1168
    public function getOptions(): ?array
1169
    {
1170
        return $this->options;
44✔
1171
    }
1172

1173
    public function withOptions(array $options): self
1174
    {
1175
        $self = clone $this;
×
1176
        $self->options = $options;
×
1177

1178
        return $self;
×
1179
    }
1180

1181
    public function getStateless(): ?bool
1182
    {
1183
        return $this->stateless;
44✔
1184
    }
1185

1186
    public function withStateless(bool $stateless): self
1187
    {
1188
        $self = clone $this;
×
1189
        $self->stateless = $stateless;
×
1190

1191
        return $self;
×
1192
    }
1193

1194
    public function getSunset(): ?string
1195
    {
1196
        return $this->sunset;
44✔
1197
    }
1198

1199
    public function withSunset(string $sunset): self
1200
    {
1201
        $self = clone $this;
×
1202
        $self->sunset = $sunset;
×
1203

1204
        return $self;
×
1205
    }
1206

1207
    public function getAcceptPatch(): ?string
1208
    {
1209
        return $this->acceptPatch;
44✔
1210
    }
1211

1212
    public function withAcceptPatch(string $acceptPatch): self
1213
    {
1214
        $self = clone $this;
×
1215
        $self->acceptPatch = $acceptPatch;
×
1216

1217
        return $self;
×
1218
    }
1219

1220
    public function getStatus(): ?int
1221
    {
1222
        return $this->status;
44✔
1223
    }
1224

1225
    public function withStatus($status): self
1226
    {
1227
        $self = clone $this;
×
1228
        $self->status = $status;
×
1229

1230
        return $self;
×
1231
    }
1232

1233
    public function getHost(): ?string
1234
    {
1235
        return $this->host;
44✔
1236
    }
1237

1238
    public function withHost(string $host): self
1239
    {
1240
        $self = clone $this;
×
1241
        $self->host = $host;
×
1242

1243
        return $self;
×
1244
    }
1245

1246
    public function getSchemes(): ?array
1247
    {
1248
        return $this->schemes;
44✔
1249
    }
1250

1251
    public function withSchemes(array $schemes): self
1252
    {
1253
        $self = clone $this;
×
1254
        $self->schemes = $schemes;
×
1255

1256
        return $self;
×
1257
    }
1258

1259
    public function getCondition(): ?string
1260
    {
1261
        return $this->condition;
44✔
1262
    }
1263

1264
    public function withCondition(string $condition): self
1265
    {
1266
        $self = clone $this;
×
1267
        $self->condition = $condition;
×
1268

1269
        return $self;
×
1270
    }
1271

1272
    public function getController(): ?string
1273
    {
1274
        return $this->controller;
44✔
1275
    }
1276

1277
    public function withController(string $controller): self
1278
    {
1279
        $self = clone $this;
×
1280
        $self->controller = $controller;
×
1281

1282
        return $self;
×
1283
    }
1284

1285
    public function getHeaders(): ?array
1286
    {
1287
        return $this->headers;
44✔
1288
    }
1289

1290
    public function withHeaders(array $headers): self
1291
    {
NEW
1292
        $self = clone $this;
×
NEW
1293
        $self->headers = $headers;
×
1294

NEW
1295
        return $self;
×
1296
    }
1297

1298
    public function getCacheHeaders(): ?array
1299
    {
1300
        return $this->cacheHeaders;
44✔
1301
    }
1302

1303
    public function withCacheHeaders(array $cacheHeaders): self
1304
    {
1305
        $self = clone $this;
32✔
1306
        $self->cacheHeaders = $cacheHeaders;
32✔
1307

1308
        return $self;
32✔
1309
    }
1310

1311
    /**
1312
     * @return string[]|null
1313
     */
1314
    public function getHydraContext(): ?array
1315
    {
1316
        return $this->hydraContext;
44✔
1317
    }
1318

1319
    public function withHydraContext(array $hydraContext): self
1320
    {
1321
        $self = clone $this;
×
1322
        $self->hydraContext = $hydraContext;
×
1323

1324
        return $self;
×
1325
    }
1326

1327
    /**
1328
     * TODO Remove in 4.0.
1329
     *
1330
     * @deprecated
1331
     */
1332
    public function getOpenapiContext(): ?array
1333
    {
1334
        return $this->openapiContext;
44✔
1335
    }
1336

1337
    /**
1338
     * TODO Remove in 4.0.
1339
     *
1340
     * @deprecated
1341
     */
1342
    public function withOpenapiContext(array $openapiContext): self
1343
    {
1344
        $self = clone $this;
×
1345
        $self->openapiContext = $openapiContext;
×
1346

1347
        return $self;
×
1348
    }
1349

1350
    public function getOpenapi(): bool|OpenApiOperation|null
1351
    {
1352
        return $this->openapi;
44✔
1353
    }
1354

1355
    public function withOpenapi(bool|OpenApiOperation $openapi): self
1356
    {
1357
        $self = clone $this;
×
1358
        $self->openapi = $openapi;
×
1359

1360
        return $self;
×
1361
    }
1362

1363
    public function getPaginationViaCursor(): ?array
1364
    {
1365
        return $this->paginationViaCursor;
44✔
1366
    }
1367

1368
    public function withPaginationViaCursor(array $paginationViaCursor): self
1369
    {
1370
        $self = clone $this;
×
1371
        $self->paginationViaCursor = $paginationViaCursor;
×
1372

1373
        return $self;
×
1374
    }
1375

1376
    public function getExceptionToStatus(): ?array
1377
    {
1378
        return $this->exceptionToStatus;
44✔
1379
    }
1380

1381
    public function withExceptionToStatus(array $exceptionToStatus): self
1382
    {
1383
        $self = clone $this;
24✔
1384
        $self->exceptionToStatus = $exceptionToStatus;
24✔
1385

1386
        return $self;
24✔
1387
    }
1388

1389
    public function getQueryParameterValidationEnabled(): ?bool
1390
    {
1391
        return $this->queryParameterValidationEnabled;
44✔
1392
    }
1393

1394
    public function withQueryParameterValidationEnabled(bool $queryParameterValidationEnabled): self
1395
    {
1396
        $self = clone $this;
×
1397
        $self->queryParameterValidationEnabled = $queryParameterValidationEnabled;
×
1398

1399
        return $self;
×
1400
    }
1401

1402
    /**
1403
     * @return GraphQlOperation[]
1404
     */
1405
    public function getGraphQlOperations(): ?array
1406
    {
1407
        return $this->graphQlOperations;
96✔
1408
    }
1409

1410
    public function withGraphQlOperations(array $graphQlOperations): self
1411
    {
1412
        $self = clone $this;
72✔
1413
        $self->graphQlOperations = $graphQlOperations;
72✔
1414

1415
        return $self;
72✔
1416
    }
1417

1418
    public function getLinks(): ?array
1419
    {
1420
        return $this->links;
44✔
1421
    }
1422

1423
    /**
1424
     * @param Link[] $links
1425
     */
1426
    public function withLinks(array $links): self
1427
    {
1428
        $self = clone $this;
×
1429
        $self->links = $links;
×
1430

1431
        return $self;
×
1432
    }
1433
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc