|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace BackblazeB2; |
|
4
|
|
|
|
|
5
|
|
|
class Key |
|
6
|
|
|
{ |
|
7
|
|
|
const PERMISSION_LIST_KEYS = 'listKeys'; |
|
8
|
|
|
const PERMISSION_WRITE_KEYS = 'writeKeys'; |
|
9
|
|
|
const PERMISSION_DELETE_KEYS = 'deleteKeys'; |
|
10
|
|
|
const PERMISSION_LIST_BUCKETS = 'listBuckets'; |
|
11
|
|
|
const PERMISSION_WRITE_BUCKETS = 'writeBuckets'; |
|
12
|
|
|
const PERMISSION_DELETE_BUCKETS = 'deleteBuckets'; |
|
13
|
|
|
const PERMISSION_LIST_FILES = 'listFiles'; |
|
14
|
|
|
const PERMISSION_READ_FILES = 'readFiles'; |
|
15
|
|
|
const PERMISSION_SHARE_FILES = 'shareFiles'; |
|
16
|
|
|
const PERMISSION_WRITE_FILES = 'writeFiles'; |
|
17
|
|
|
const PERMISSION_DELETE_FILES = 'deleteFiles'; |
|
18
|
|
|
|
|
19
|
|
|
protected $id; |
|
20
|
|
|
protected $name; |
|
21
|
|
|
protected $secret; |
|
22
|
|
|
protected $capabilities; |
|
23
|
|
|
protected $bucketId; |
|
24
|
|
|
protected $namePrefix; |
|
25
|
|
|
protected $expirationTimestamp; |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* Key constructor. |
|
29
|
|
|
* |
|
30
|
|
|
* @param $id |
|
31
|
|
|
* @param $name |
|
32
|
|
|
* @param $secret |
|
33
|
|
|
*/ |
|
34
|
|
|
public function __construct($id, $name, $secret, $capabilities, $bucketId, $namePrefix, $expirationTimestamp) |
|
35
|
|
|
{ |
|
36
|
|
|
$this->id = $id; |
|
37
|
|
|
$this->name = $name; |
|
38
|
|
|
$this->secret = $secret; |
|
39
|
|
|
$this->capabilities = $capabilities; |
|
40
|
|
|
$this->bucketId = $bucketId; |
|
41
|
|
|
$this->namePrefix = $namePrefix; |
|
42
|
|
|
$this->expirationTimestamp = $expirationTimestamp; |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
public function getId() |
|
46
|
|
|
{ |
|
47
|
|
|
return $this->id; |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
public function getName() |
|
51
|
|
|
{ |
|
52
|
|
|
return $this->name; |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
public function getSecret() |
|
56
|
|
|
{ |
|
57
|
|
|
return $this->secret; |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
public function getCapabilities() |
|
61
|
|
|
{ |
|
62
|
|
|
return $this->capabilities; |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
public function getBucketId() |
|
66
|
|
|
{ |
|
67
|
|
|
return $this->bucketId; |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
public function getNamePrefix() |
|
71
|
|
|
{ |
|
72
|
|
|
return $this->namePrefix; |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
public function getExpirationTimestamp() |
|
76
|
|
|
{ |
|
77
|
|
|
return $this->expirationTimestamp; |
|
78
|
|
|
} |
|
79
|
|
|
} |
|
80
|
|
|
|