Passed
Pull Request — master (#10)
by Vladislav
03:04
created

SetAutoAddMarginRequest::setAutoAddMargin()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
1
<?php
2
namespace Carpenstar\ByBitAPI\Derivatives\Contract\Position\SetAutoAddMargin\Request;
3
4
use Carpenstar\ByBitAPI\Core\Objects\AbstractParameters;
5
use Carpenstar\ByBitAPI\Derivatives\Contract\Position\SetAutoAddMargin\Interfaces\ISetAutoAddMarginRequestInterface;
6
7
class SetAutoAddMarginRequest extends AbstractParameters implements ISetAutoAddMarginRequestInterface
8
{
9
10
    /**
11
     * Symbol name
12
     * @var string $symbol
13
     */
14
    protected string $symbol;
15
16
    /**
17
     * Side. Buy,Sell
18
     * @var string $side
19
     */
20
    protected string $side;
21
22
    /**
23
     * Turn on/off auto add margin. 0: off. 1: on
24
     * @var int $autoAddMargin
25
     */
26
    protected int $autoAddMargin;
27
28
    /**
29
     * Position index
30
     * @var int $positionIdx
31
     */
32
    protected int $positionIdx;
33
34
    public function __construct()
35
    {
36
        $this
37
            ->setRequiredField('symbol')
38
            ->setRequiredField('side')
39
            ->setRequiredField('autoAddMargin')
40
            ->setRequiredField('positionIdx');
41
    }
42
43
    /**
44
     * @return string
45
     */
46
    public function getSymbol(): string
47
    {
48
        return $this->symbol;
49
    }
50
51
    /**
52
     * @param string $symbol
53
     * @return SetAutoAddMarginRequest
54
     */
55
    public function setSymbol(string $symbol): self
56
    {
57
        $this->symbol = $symbol;
58
        return $this;
59
    }
60
61
    /**
62
     * @return string
63
     */
64
    public function getSide(): string
65
    {
66
        return $this->side;
67
    }
68
69
    /**
70
     * @param string $side
71
     * @return SetAutoAddMarginRequest
72
     */
73
    public function setSide(string $side): self
74
    {
75
        $this->side = $side;
76
        return $this;
77
    }
78
79
    /**
80
     * @return int
81
     */
82
    public function getAutoAddMargin(): int
83
    {
84
        return $this->autoAddMargin;
85
    }
86
87
    /**
88
     * @param int $autoAddMargin
89
     * @return SetAutoAddMarginRequest
90
     */
91
    public function setAutoAddMargin(int $autoAddMargin): self
92
    {
93
        $this->autoAddMargin = $autoAddMargin;
94
        return $this;
95
    }
96
97
    /**
98
     * @return int
99
     */
100
    public function getPositionIdx(): int
101
    {
102
        return $this->positionIdx;
103
    }
104
105
    /**
106
     * @param int $positionIdx
107
     * @return SetAutoAddMarginRequest
108
     */
109
    public function setPositionIdx(int $positionIdx): self
110
    {
111
        $this->positionIdx = $positionIdx;
112
        return $this;
113
    }
114
}
115