Completed
Push — master ( c894bb...4464ce )
by Yassir
11s
created

DigitalOceanV2::loadBalancer()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the DigitalOceanV2 library.
5
 *
6
 * (c) Antoine Corcy <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace DigitalOceanV2;
13
14
use DigitalOceanV2\Adapter\AdapterInterface;
15
use DigitalOceanV2\Api\Account;
16
use DigitalOceanV2\Api\Action;
17
use DigitalOceanV2\Api\Certificate;
18
use DigitalOceanV2\Api\Domain;
19
use DigitalOceanV2\Api\DomainRecord;
20
use DigitalOceanV2\Api\Droplet;
21
use DigitalOceanV2\Api\FloatingIp;
22
use DigitalOceanV2\Api\Image;
23
use DigitalOceanV2\Api\Key;
24
use DigitalOceanV2\Api\LoadBalancer;
25
use DigitalOceanV2\Api\RateLimit;
26
use DigitalOceanV2\Api\Region;
27
use DigitalOceanV2\Api\Size;
28
use DigitalOceanV2\Api\Snapshot;
29
use DigitalOceanV2\Api\Volume;
30
31
/**
32
 * @author Antoine Corcy <[email protected]>
33
 * @author Graham Campbell <[email protected]>
34
 */
35
class DigitalOceanV2
36
{
37
    /**
38
     * @var AdapterInterface
39
     */
40
    protected $adapter;
41
42
    /**
43
     * @param AdapterInterface $adapter
44
     */
45
    public function __construct(AdapterInterface $adapter)
46
    {
47
        $this->adapter = $adapter;
48
    }
49
50
    /**
51
     * @return Account
52
     */
53
    public function account()
54
    {
55
        return new Account($this->adapter);
56
    }
57
58
    /**
59
     * @return Action
60
     */
61
    public function action()
62
    {
63
        return new Action($this->adapter);
64
    }
65
66
    /**
67
     * @return Certificate
68
     */
69
    public function certificate()
70
    {
71
        return new Certificate($this->adapter);
72
    }
73
74
    /**
75
     * @return Domain
76
     */
77
    public function domain()
78
    {
79
        return new Domain($this->adapter);
80
    }
81
82
    /**
83
     * @return DomainRecord
84
     */
85
    public function domainRecord()
86
    {
87
        return new DomainRecord($this->adapter);
88
    }
89
90
    /**
91
     * @return Droplet
92
     */
93
    public function droplet()
94
    {
95
        return new Droplet($this->adapter);
96
    }
97
98
    /**
99
     * @return FloatingIp
100
     */
101
    public function floatingIp()
102
    {
103
        return new FloatingIp($this->adapter);
104
    }
105
106
    /**
107
     * @return Image
108
     */
109
    public function image()
110
    {
111
        return new Image($this->adapter);
112
    }
113
114
    /**
115
     * @return Key
116
     */
117
    public function key()
118
    {
119
        return new Key($this->adapter);
120
    }
121
122
    /**
123
     * @return LoadBalancer
124
     */
125
    public function loadBalancer()
126
    {
127
        return new LoadBalancer($this->adapter);
128
    }
129
130
    /**
131
     * @return RateLimit
132
     */
133
    public function rateLimit()
134
    {
135
        return new RateLimit($this->adapter);
136
    }
137
138
    /**
139
     * @return Region
140
     */
141
    public function region()
142
    {
143
        return new Region($this->adapter);
144
    }
145
146
    /**
147
     * @return Size
148
     */
149
    public function size()
150
    {
151
        return new Size($this->adapter);
152
    }
153
154
    /**
155
     * @return Volume
156
     */
157
    public function volume()
158
    {
159
        return new Volume($this->adapter);
160
    }
161
162
    /**
163
     * @return Snapshot
164
     */
165
    public function snapshot()
166
    {
167
        return new Snapshot($this->adapter);
168
    }
169
}
170