Passed
Push — master ( faa4ac...572ea2 )
by Vladislav
06:35 queued 04:06
created

ReedemResponse::getLtCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
namespace Carpenstar\ByBitAPI\Spot\LeverageToken\Redeem\Response;
3
4
use Carpenstar\ByBitAPI\Core\Helpers\DateTimeHelper;
5
use Carpenstar\ByBitAPI\Core\Objects\AbstractResponse;
6
use Carpenstar\ByBitAPI\Spot\LeverageToken\Redeem\Interfaces\IReedemResponseInterface;
7
8
class ReedemResponse extends AbstractResponse implements IReedemResponseInterface
9
{
10
    /**
11
     * Transaction ID
12
     * @var string $id
13
     */
14
    private string $id;
15
16
    /**
17
     * Abbreviation of the LT
18
     * @var string $ltCode
19
     */
20
    private string $ltCode;
21
22
    /**
23
     * Order value of the LT. Normally returns ""
24
     * @var float $orderAmount
25
     */
26
    private float $orderAmount;
27
28
    /**
29
     * Order quantity of the LT
30
     * @var float $orderQuantity
31
     */
32
    private float $orderQuantity;
33
34
    /**
35
     * Order status; 1. Completed; 2. In progress; 3. Failed
36
     * @var int $orderStatus
37
     */
38
    private int $orderStatus;
39
40
    /**
41
     * Quantity. Normally returns ""
42
     * @var float $quantity
43
     */
44
    private float $quantity;
45
46
    /**
47
     * Serial number
48
     * @var string $serialNo
49
     */
50
    private string $serialNo;
51
52
    /**
53
     * Timestamp
54
     * @var \DateTime $timestamp
55
     */
56
    private \DateTime $timestamp;
57
58
    /**
59
     * Quote asset
60
     * @var string $valueCoin
61
     */
62
    private string $valueCoin;
63
64
    public function __construct(array $data)
65
    {
66
        $this
67
            ->setId($data['id'])
68
            ->setLtCode($data['ltCode'])
69
            ->setOrderAmount((float) $data['orderAmount'])
70
            ->setOrderQuantity((float) $data['orderQuantity'])
71
            ->setOrderStatus((int) $data['orderStatus'])
72
            ->setQuantity((float) $data['quantity'])
73
            ->setSerialNo($data['serialNo'])
74
            ->setTimestamp($data['timestamp'])
75
            ->setValueCoin($data['valueCoin']);
76
    }
77
78
    /**
79
     * @return string
80
     */
81
    public function getId(): string
82
    {
83
        return $this->id;
84
    }
85
86
    /**
87
     * @param string $id
88
     * @return ReedemResponse
89
     */
90
    private function setId(string $id): self
91
    {
92
        $this->id = $id;
93
        return $this;
94
    }
95
96
    /**
97
     * @return string
98
     */
99
    public function getLtCode(): string
100
    {
101
        return $this->ltCode;
102
    }
103
104
    /**
105
     * @param string $ltCode
106
     * @return ReedemResponse
107
     */
108
    private function setLtCode(string $ltCode): self
109
    {
110
        $this->ltCode = $ltCode;
111
        return $this;
112
    }
113
114
    /**
115
     * @return float
116
     */
117
    public function getOrderAmount(): float
118
    {
119
        return $this->orderAmount;
120
    }
121
122
    /**
123
     * @param float $orderAmount
124
     * @return ReedemResponse
125
     */
126
    private function setOrderAmount(float $orderAmount): self
127
    {
128
        $this->orderAmount = $orderAmount;
129
        return $this;
130
    }
131
132
    /**
133
     * @return float
134
     */
135
    public function getOrderQuantity(): float
136
    {
137
        return $this->orderQuantity;
138
    }
139
140
    /**
141
     * @param float $orderQuantity
142
     * @return ReedemResponse
143
     */
144
    private function setOrderQuantity(float $orderQuantity): self
145
    {
146
        $this->orderQuantity = $orderQuantity;
147
        return $this;
148
    }
149
150
    /**
151
     * @return int
152
     */
153
    public function getOrderStatus(): int
154
    {
155
        return $this->orderStatus;
156
    }
157
158
    /**
159
     * @param int $orderStatus
160
     * @return ReedemResponse
161
     */
162
    private function setOrderStatus(int $orderStatus): self
163
    {
164
        $this->orderStatus = $orderStatus;
165
        return $this;
166
    }
167
168
    /**
169
     * @return float
170
     */
171
    public function getQuantity(): float
172
    {
173
        return $this->quantity;
174
    }
175
176
    /**
177
     * @param float $quantity
178
     * @return ReedemResponse
179
     */
180
    private function setQuantity(float $quantity): self
181
    {
182
        $this->quantity = $quantity;
183
        return $this;
184
    }
185
186
    /**
187
     * @return string
188
     */
189
    public function getSerialNo(): string
190
    {
191
        return $this->serialNo;
192
    }
193
194
    /**
195
     * @param string $serialNo
196
     * @return ReedemResponse
197
     */
198
    private function setSerialNo(string $serialNo): self
199
    {
200
        $this->serialNo = $serialNo;
201
        return $this;
202
    }
203
204
    /**
205
     * @return \DateTime
206
     */
207
    public function getTimestamp(): \DateTime
208
    {
209
        return $this->timestamp;
210
    }
211
212
    /**
213
     * @param int $timestamp
214
     * @return ReedemResponse
215
     */
216
    private function setTimestamp(int $timestamp): self
217
    {
218
        $this->timestamp = DateTimeHelper::makeFromTimestamp($timestamp);
219
        return $this;
220
    }
221
222
    /**
223
     * @return string
224
     */
225
    public function getValueCoin(): string
226
    {
227
        return $this->valueCoin;
228
    }
229
230
    /**
231
     * @param string $valueCoin
232
     * @return ReedemResponse
233
     */
234
    private function setValueCoin(string $valueCoin): self
235
    {
236
        $this->valueCoin = $valueCoin;
237
        return $this;
238
    }
239
}