UserApi::csv()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

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
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
namespace CybozuHttp\Api;
4
5
use CybozuHttp\Api\User\Csv;
6
use CybozuHttp\Api\User\Groups;
7
use CybozuHttp\Api\User\Organizations;
8
use CybozuHttp\Api\User\OrganizationUsers;
9
use CybozuHttp\Api\User\Titles;
10
use CybozuHttp\Api\User\UserGroups;
11
use CybozuHttp\Api\User\UserOrganizations;
12
use CybozuHttp\Api\User\Users;
13
use CybozuHttp\Api\User\UserServices;
14
use CybozuHttp\Client;
15
16
/**
17
 * @author ochi51 <[email protected]>
18
 */
19
class UserApi
20
{
21
    public const API_PREFIX = '/v1/';
22
23
    /**
24
     * @var Client
25
     */
26
    private $client;
27
28
    /**
29
     * @var Csv
30
     */
31
    private $csv;
32
33
    /**
34
     * @var Users
35
     */
36
    private $users;
37
38
    /**
39
     * @var Organizations
40
     */
41
    private $organizations;
42
43
    /**
44
     * @var Titles
45
     */
46
    private $titles;
47
48
    /**
49
     * @var Groups
50
     */
51
    private $groups;
52
53
    /**
54
     * @var UserOrganizations
55
     */
56
    private $userOrganizations;
57
58
    /**
59
     * @var UserGroups
60
     */
61
    private $userGroups;
62
63
    /**
64
     * @var UserServices
65
     */
66
    private $userServices;
67
68
    /**
69
     * @var OrganizationUsers
70
     */
71
    private $organizationUsers;
72
73 1
    public function __construct(Client $client)
74
    {
75 1
        $this->client = $client;
76 1
        $this->csv = new Csv($client);
77 1
        $this->users = new Users($client, $this->csv);
78 1
        $this->organizations = new Organizations($this->csv);
79 1
        $this->titles = new Titles($this->csv);
80 1
        $this->groups = new Groups($this->csv);
81 1
        $this->userOrganizations = new UserOrganizations($client, $this->csv);
82 1
        $this->userGroups = new UserGroups($this->csv);
83 1
        $this->userServices = new UserServices($this->csv);
84 1
        $this->organizationUsers = new OrganizationUsers($client);
85
    }
86
87
    /**
88
     * @param string $api
89
     * @return string
90
     */
91 13
    public static function generateUrl($api): string
92
    {
93 13
        return self::API_PREFIX . $api;
94
    }
95
96
    /**
97
     * @return Client
98
     */
99 1
    public function getClient(): Client
100
    {
101 1
        return $this->client;
102
    }
103
104
    /**
105
     * @return Csv
106
     */
107 11
    public function csv(): Csv
108
    {
109 11
        return $this->csv;
110
    }
111
112
    /**
113
     * @return Users
114
     */
115 6
    public function users(): Users
116
    {
117 6
        return $this->users;
118
    }
119
120
    /**
121
     * @return Organizations
122
     */
123 3
    public function organizations(): Organizations
124
    {
125 3
        return $this->organizations;
126
    }
127
128
    /**
129
     * @return Titles
130
     */
131 3
    public function titles(): Titles
132
    {
133 3
        return $this->titles;
134
    }
135
136
    /**
137
     * @return Groups
138
     */
139 2
    public function groups(): Groups
140
    {
141 2
        return $this->groups;
142
    }
143
144
    /**
145
     * @return UserOrganizations
146
     */
147 2
    public function userOrganizations(): UserOrganizations
148
    {
149 2
        return $this->userOrganizations;
150
    }
151
152
    /**
153
     * @return UserGroups
154
     */
155 1
    public function userGroups(): UserGroups
156
    {
157 1
        return $this->userGroups;
158
    }
159
160
    /**
161
     * @return UserServices
162
     */
163 1
    public function userServices(): UserServices
164
    {
165 1
        return $this->userServices;
166
    }
167
168
    /**
169
     * @return OrganizationUsers
170
     */
171 1
    public function organizationUsers(): OrganizationUsers
172
    {
173 1
        return $this->organizationUsers;
174
    }
175
}
176