AdiqCredentials::schema()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 6
rs 10
1
<?php
2
3
namespace Ipag\Sdk\Support\Credentials\PaymentMethods;
4
5
use Ipag\Sdk\Model\Model;
6
use Ipag\Sdk\Model\Schema\Schema;
7
use Ipag\Sdk\Model\Schema\SchemaBuilder;
8
9
/**
10
 * AdiqCredentials Class
11
 *
12
 * Classe responsável pela credencial da identidade `Adiq`.
13
 */
14
final class AdiqCredentials extends Model
15
{
16
    /**
17
     *  @param array $data
18
     *  array de dados da credencial da Adiq.
19
     *
20
     *  + [`'client_id'`] string (opcional).
21
     *  + [`'client_secret'`] string (opcional).
22
     *
23
     */
24
    public function __construct(?array $data = [])
25
    {
26
        parent::__construct($data);
27
    }
28
    public function schema(SchemaBuilder $schema): Schema
29
    {
30
        $schema->string('client_id')->nullable();
31
        $schema->string('client_secret')->nullable();
32
33
        return $schema->build();
34
    }
35
36
    /**
37
     * Retorna o valor da propriedade `client_id`.
38
     *
39
     * @return string|null
40
     */
41
    public function getClientId(): ?string
42
    {
43
        return $this->get('client_id');
44
    }
45
46
    /**
47
     * Seta o valor da propriedade `client_id`.
48
     *
49
     * @param string|null $clientId
50
     * @return self
51
     */
52
    public function setClientId(?string $clientId = null): self
53
    {
54
        $this->set('client_id', $clientId);
55
        return $this;
56
    }
57
58
    /**
59
     * Retorna o valor da propriedade `client_secret`.
60
     *
61
     * @return string|null
62
     */
63
    public function getClientSecret(): ?string
64
    {
65
        return $this->get('client_secret');
66
    }
67
68
    /**
69
     * Seta o valor da propriedade `client_secret`.
70
     *
71
     * @param string|null $clientSecret
72
     * @return self
73
     */
74
    public function setClientSecret(?string $clientSecret = null): self
75
    {
76
        $this->set('client_secret', $clientSecret);
77
        return $this;
78
    }
79
80
}