-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCreateCollectionData.php
More file actions
48 lines (42 loc) · 1.25 KB
/
Copy pathCreateCollectionData.php
File metadata and controls
48 lines (42 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
declare(strict_types=1);
namespace MoeMizrak\Rekognition\Data;
use MoeMizrak\Rekognition\Data\Contracts\RekognitionDataFormatInterface;
use Spatie\LaravelData\Data;
/**
* CreateCollectionData is for the data of the Rekognition API createCollection request.
* For more info: https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-rekognition-2016-06-27.html#createcollection
*
* @class CreateCollectionData
*/
final class CreateCollectionData extends Data implements RekognitionDataFormatInterface
{
public function __construct(
/*
* ID for the collection that you are creating.
*
* @param string
*/
public string $collectionId,
/*
* A set of tags (key-value pairs) that you want to attach to the collection.
* - Associative array of custom strings keys (TagKey) to strings
*
* @param array|null
*/
public ?array $tags = null,
) {}
/**
* @inheritDoc
*/
public function toRekognitionDataFormat(): array
{
return array_filter(
[
'CollectionId' => $this->collectionId,
'Tags' => $this->tags,
],
fn ($value) => $value !== null
);
}
}