1: <?php
2:
3: namespace Cloudflare\Organizations;
4:
5: use Cloudflare\Api;
6:
7: /**
8: * CloudFlare API wrapper
9: *
10: * Organizations
11: *
12: * @author James Bell <[email protected]>
13: *
14: * @version 1
15: */
16: class Organizations extends Api
17: {
18: /**
19: * Default permissions level
20: *
21: * @var array
22: */
23: protected $permission_level = ['read' => '#organization:read', 'edit' => '#organization:edit'];
24:
25: /**
26: * Organization details (permission needed: #organization:read)
27: * Get information about a specific organization that you are a member of
28: *
29: * @param string $identifier
30: */
31: public function organization($identifier)
32: {
33: return $this->get('/organizations/'.$identifier);
34: }
35:
36: /**
37: * Update organization (permission needed: #organization:edit)
38: * Update an existing Organization
39: *
40: * @param string|null $identifier
41: * @param string|null $name Organization Name
42: */
43: public function update($identifier = null, $name = null)
44: {
45: $data = [
46: 'name' => $name,
47: ];
48:
49: return $this->get('/organizations/'.$identifier, $data);
50: }
51: }
52: