Passed
Pull Request — master (#3)
by Timothy
06:14
created

Event   A

Complexity

Total Complexity 14

Size/Duplication

Total Lines 169
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
c 1
b 1
f 1
dl 0
loc 169
rs 10
wmc 14
1
<?php
2
# Generated by the protocol buffer compiler.  DO NOT EDIT!
3
# source: peer/events.proto
4
5
namespace Hyperledger\Fabric\Protos\Peer;
6
7
use Google\Protobuf\Internal\GPBType;
8
use Google\Protobuf\Internal\RepeatedField;
9
use Google\Protobuf\Internal\GPBUtil;
10
11
/**
12
 *Event is used by
13
 *  - consumers (adapters) to send Register
14
 *  - producer to advertise supported types and events
15
 *
16
 * Generated from protobuf message <code>protos.Event</code>
17
 */
18
class Event extends \Google\Protobuf\Internal\Message
19
{
20
    /**
21
     * Creator of the event, specified as a certificate chain
22
     *
23
     * Generated from protobuf field <code>bytes creator = 6;</code>
24
     */
25
    private $creator = '';
26
    protected $Event;
27
28
    public function __construct() {
29
        \GPBMetadata\Peer\Events::initOnce();
30
        parent::__construct();
31
    }
32
33
    /**
34
     *Register consumer sent event
35
     *
36
     * Generated from protobuf field <code>.protos.Register register = 1;</code>
37
     * @return \Hyperledger\Fabric\Protos\Peer\Register
38
     */
39
    public function getRegister()
40
    {
41
        return $this->readOneof(1);
42
    }
43
44
    /**
45
     *Register consumer sent event
46
     *
47
     * Generated from protobuf field <code>.protos.Register register = 1;</code>
48
     * @param \Hyperledger\Fabric\Protos\Peer\Register $var
49
     * @return $this
50
     */
51
    public function setRegister($var)
52
    {
53
        GPBUtil::checkMessage($var, \Hyperledger\Fabric\Protos\Peer\Register::class);
54
        $this->writeOneof(1, $var);
55
56
        return $this;
57
    }
58
59
    /**
60
     *producer events
61
     *
62
     * Generated from protobuf field <code>.common.Block block = 2;</code>
63
     * @return \Hyperledger\Fabric\Protos\Common\Block
64
     */
65
    public function getBlock()
66
    {
67
        return $this->readOneof(2);
68
    }
69
70
    /**
71
     *producer events
72
     *
73
     * Generated from protobuf field <code>.common.Block block = 2;</code>
74
     * @param \Hyperledger\Fabric\Protos\Common\Block $var
75
     * @return $this
76
     */
77
    public function setBlock($var)
78
    {
79
        GPBUtil::checkMessage($var, \Hyperledger\Fabric\Protos\Common\Block::class);
80
        $this->writeOneof(2, $var);
81
82
        return $this;
83
    }
84
85
    /**
86
     * Generated from protobuf field <code>.protos.ChaincodeEvent chaincode_event = 3;</code>
87
     * @return \Hyperledger\Fabric\Protos\Peer\ChaincodeEvent
88
     */
89
    public function getChaincodeEvent()
90
    {
91
        return $this->readOneof(3);
92
    }
93
94
    /**
95
     * Generated from protobuf field <code>.protos.ChaincodeEvent chaincode_event = 3;</code>
96
     * @param \Hyperledger\Fabric\Protos\Peer\ChaincodeEvent $var
97
     * @return $this
98
     */
99
    public function setChaincodeEvent($var)
100
    {
101
        GPBUtil::checkMessage($var, \Hyperledger\Fabric\Protos\Peer\ChaincodeEvent::class);
102
        $this->writeOneof(3, $var);
103
104
        return $this;
105
    }
106
107
    /**
108
     * Generated from protobuf field <code>.protos.Rejection rejection = 4;</code>
109
     * @return \Hyperledger\Fabric\Protos\Peer\Rejection
110
     */
111
    public function getRejection()
112
    {
113
        return $this->readOneof(4);
114
    }
115
116
    /**
117
     * Generated from protobuf field <code>.protos.Rejection rejection = 4;</code>
118
     * @param \Hyperledger\Fabric\Protos\Peer\Rejection $var
119
     * @return $this
120
     */
121
    public function setRejection($var)
122
    {
123
        GPBUtil::checkMessage($var, \Hyperledger\Fabric\Protos\Peer\Rejection::class);
124
        $this->writeOneof(4, $var);
125
126
        return $this;
127
    }
128
129
    /**
130
     *Unregister consumer sent events
131
     *
132
     * Generated from protobuf field <code>.protos.Unregister unregister = 5;</code>
133
     * @return \Hyperledger\Fabric\Protos\Peer\Unregister
134
     */
135
    public function getUnregister()
136
    {
137
        return $this->readOneof(5);
138
    }
139
140
    /**
141
     *Unregister consumer sent events
142
     *
143
     * Generated from protobuf field <code>.protos.Unregister unregister = 5;</code>
144
     * @param \Hyperledger\Fabric\Protos\Peer\Unregister $var
145
     * @return $this
146
     */
147
    public function setUnregister($var)
148
    {
149
        GPBUtil::checkMessage($var, \Hyperledger\Fabric\Protos\Peer\Unregister::class);
150
        $this->writeOneof(5, $var);
151
152
        return $this;
153
    }
154
155
    /**
156
     * Creator of the event, specified as a certificate chain
157
     *
158
     * Generated from protobuf field <code>bytes creator = 6;</code>
159
     * @return string
160
     */
161
    public function getCreator()
162
    {
163
        return $this->creator;
164
    }
165
166
    /**
167
     * Creator of the event, specified as a certificate chain
168
     *
169
     * Generated from protobuf field <code>bytes creator = 6;</code>
170
     * @param string $var
171
     * @return $this
172
     */
173
    public function setCreator($var)
174
    {
175
        GPBUtil::checkString($var, False);
176
        $this->creator = $var;
177
178
        return $this;
179
    }
180
181
    /**
182
     * @return string
183
     */
184
    public function getEvent()
185
    {
186
        return $this->whichOneof("Event");
187
    }
188
189
}
190
191