|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Bip70\Protobuf\Proto; |
|
6
|
|
|
|
|
7
|
|
|
use DrSlump\Protobuf\Message; |
|
8
|
|
|
|
|
9
|
|
|
class X509Certificates extends Message |
|
10
|
|
|
{ |
|
11
|
|
|
|
|
12
|
|
|
/** @var string[] */ |
|
13
|
|
|
public $certificate = array(); |
|
14
|
|
|
|
|
15
|
|
|
|
|
16
|
|
|
/** @var \Closure[] */ |
|
17
|
|
|
protected static $__extensions = array(); |
|
18
|
|
|
|
|
19
|
1 |
|
public static function descriptor() |
|
20
|
|
|
{ |
|
21
|
1 |
|
$descriptor = new \DrSlump\Protobuf\Descriptor(__CLASS__, 'payments.X509Certificates'); |
|
22
|
|
|
|
|
23
|
|
|
// REPEATED BYTES certificate = 1 |
|
24
|
1 |
|
$f = new \DrSlump\Protobuf\Field(); |
|
25
|
1 |
|
$f->number = 1; |
|
26
|
1 |
|
$f->name = 'certificate'; |
|
27
|
1 |
|
$f->type = \DrSlump\Protobuf::TYPE_BYTES; |
|
28
|
1 |
|
$f->rule = \DrSlump\Protobuf::RULE_REPEATED; |
|
29
|
1 |
|
$descriptor->addField($f); |
|
30
|
|
|
|
|
31
|
1 |
|
foreach (self::$__extensions as $cb) { |
|
32
|
|
|
$descriptor->addField($cb(), true); |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
1 |
|
return $descriptor; |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* Check if <certificate> has a value |
|
40
|
|
|
* |
|
41
|
|
|
* @return boolean |
|
42
|
|
|
*/ |
|
43
|
9 |
|
public function hasCertificate() |
|
44
|
|
|
{ |
|
45
|
9 |
|
return $this->_has(1); |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
* Clear <certificate> value |
|
50
|
|
|
* |
|
51
|
|
|
* @return \Bip70\Protobuf\Proto\X509Certificates |
|
52
|
|
|
*/ |
|
53
|
1 |
|
public function clearCertificate() |
|
54
|
|
|
{ |
|
55
|
1 |
|
return $this->_clear(1); |
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* Get <certificate> value |
|
60
|
|
|
* |
|
61
|
|
|
* @param int $idx |
|
62
|
|
|
* @return string |
|
63
|
|
|
*/ |
|
64
|
4 |
|
public function getCertificate($idx = null) |
|
65
|
|
|
{ |
|
66
|
4 |
|
return $this->_get(1, $idx); |
|
67
|
|
|
} |
|
68
|
|
|
|
|
69
|
|
|
/** |
|
70
|
|
|
* Set <certificate> value |
|
71
|
|
|
* |
|
72
|
|
|
* @param string $value |
|
73
|
|
|
* @param int $idx |
|
74
|
|
|
* @return \Bip70\Protobuf\Proto\X509Certificates |
|
75
|
|
|
*/ |
|
76
|
5 |
|
public function setCertificate($value, $idx = null) |
|
77
|
|
|
{ |
|
78
|
5 |
|
return $this->_set(1, $value, $idx); |
|
79
|
|
|
} |
|
80
|
|
|
|
|
81
|
|
|
/** |
|
82
|
|
|
* Get all elements of <certificate> |
|
83
|
|
|
* |
|
84
|
|
|
* @return string[] |
|
85
|
|
|
*/ |
|
86
|
8 |
|
public function getCertificateList() |
|
87
|
|
|
{ |
|
88
|
8 |
|
return $this->_get(1); |
|
89
|
|
|
} |
|
90
|
|
|
|
|
91
|
|
|
/** |
|
92
|
|
|
* Add a new element to <certificate> |
|
93
|
|
|
* |
|
94
|
|
|
* @param string $value |
|
95
|
|
|
* @return \Bip70\Protobuf\Proto\X509Certificates |
|
96
|
|
|
*/ |
|
97
|
6 |
|
public function addCertificate($value) |
|
98
|
|
|
{ |
|
99
|
6 |
|
return $this->_add(1, $value); |
|
100
|
|
|
} |
|
101
|
|
|
} |
|
102
|
|
|
|