1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Ipag\Sdk\Model; |
4
|
|
|
|
5
|
|
|
use Ipag\Sdk\Model\Schema\Schema; |
6
|
|
|
use Ipag\Sdk\Model\Schema\SchemaBuilder; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* AntifraudProvider Class |
10
|
|
|
* |
11
|
|
|
* Classe responsável por representar o recurso Antifraud Provider. |
12
|
|
|
*/ |
13
|
|
|
class AntifraudProvider extends Model |
14
|
|
|
{ |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* @param array $data |
18
|
|
|
* array de dados do recurso `AntifraudProvider` |
19
|
|
|
* |
20
|
|
|
* + [`'name'`] string (opcional). |
21
|
|
|
* + [`'credentials'`] array (opcional). |
22
|
|
|
*/ |
23
|
|
|
|
24
|
|
|
public function __construct(?array $data = []) |
25
|
|
|
{ |
26
|
|
|
parent::__construct($data); |
27
|
|
|
} |
28
|
|
|
|
29
|
|
|
protected function schema(SchemaBuilder $schema): Schema |
30
|
|
|
{ |
31
|
|
|
$schema->string('name')->nullable(); |
32
|
|
|
$schema->any('credentials')->nullable(); |
33
|
|
|
|
34
|
|
|
return $schema->build(); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* Retorna o valor da propriedade `name`. |
39
|
|
|
* |
40
|
|
|
* @return string|null |
41
|
|
|
*/ |
42
|
|
|
public function getName(): ?string |
43
|
|
|
{ |
44
|
|
|
return $this->get('name'); |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Seta o valor da propriedade `name`. |
49
|
|
|
* |
50
|
|
|
* @param string|null $name |
51
|
|
|
* @return self |
52
|
|
|
*/ |
53
|
|
|
public function setName(?string $name = null): self |
54
|
|
|
{ |
55
|
|
|
$this->set('name', $name); |
56
|
|
|
return $this; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* Retorna o valor da propriedade `credentials`. |
61
|
|
|
* |
62
|
|
|
* @return array|null |
63
|
|
|
*/ |
64
|
|
|
public function getCredentials(): ?array |
65
|
|
|
{ |
66
|
|
|
return $this->get('credentials'); |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* Seta o valor da propriedade `credentials`. |
71
|
|
|
* |
72
|
|
|
* @param array|null $credentials |
73
|
|
|
* @return self |
74
|
|
|
*/ |
75
|
|
|
public function setCredentials(?array $credentials = null): self |
76
|
|
|
{ |
77
|
|
|
$this->set('credentials', $credentials); |
78
|
|
|
return $this; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
} |