Skip to content

Commit 5f45cce

Browse files
1 parent 463b8be commit 5f45cce

6 files changed

Lines changed: 459 additions & 4 deletions

File tree

src/Drive.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,19 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
778778
'required' => true,
779779
],
780780
],
781+
],'generateCseToken' => [
782+
'path' => 'files/generateCseToken',
783+
'httpMethod' => 'GET',
784+
'parameters' => [
785+
'fileId' => [
786+
'location' => 'query',
787+
'type' => 'string',
788+
],
789+
'parent' => [
790+
'location' => 'query',
791+
'type' => 'string',
792+
],
793+
],
781794
],'generateIds' => [
782795
'path' => 'files/generateIds',
783796
'httpMethod' => 'GET',
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\Drive;
19+
20+
class ClientEncryptionDetails extends \Google\Model
21+
{
22+
protected $decryptionMetadataType = DecryptionMetadata::class;
23+
protected $decryptionMetadataDataType = '';
24+
/**
25+
* The encryption state of the file. The values expected here are: - encrypted
26+
* - unencrypted
27+
*
28+
* @var string
29+
*/
30+
public $encryptionState;
31+
32+
/**
33+
* The metadata used for client-side operations.
34+
*
35+
* @param DecryptionMetadata $decryptionMetadata
36+
*/
37+
public function setDecryptionMetadata(DecryptionMetadata $decryptionMetadata)
38+
{
39+
$this->decryptionMetadata = $decryptionMetadata;
40+
}
41+
/**
42+
* @return DecryptionMetadata
43+
*/
44+
public function getDecryptionMetadata()
45+
{
46+
return $this->decryptionMetadata;
47+
}
48+
/**
49+
* The encryption state of the file. The values expected here are: - encrypted
50+
* - unencrypted
51+
*
52+
* @param string $encryptionState
53+
*/
54+
public function setEncryptionState($encryptionState)
55+
{
56+
$this->encryptionState = $encryptionState;
57+
}
58+
/**
59+
* @return string
60+
*/
61+
public function getEncryptionState()
62+
{
63+
return $this->encryptionState;
64+
}
65+
}
66+
67+
// Adding a class alias for backwards compatibility with the previous class name.
68+
class_alias(ClientEncryptionDetails::class, 'Google_Service_Drive_ClientEncryptionDetails');

src/Drive/DecryptionMetadata.php

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
<?php
2+
/*
3+
* Copyright 2014 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
6+
* use this file except in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
namespace Google\Service\Drive;
19+
20+
class DecryptionMetadata extends \Google\Model
21+
{
22+
/**
23+
* Chunk size used if content was encrypted with the AES 256 GCM Cipher.
24+
* Possible values are: - default - small
25+
*
26+
* @var string
27+
*/
28+
public $aes256GcmChunkSize;
29+
/**
30+
* The URL-safe Base64 encoded HMAC-SHA256 digest of the resource metadata
31+
* with its DEK (Data Encryption Key); see
32+
* https://developers.google.com/workspace/cse/reference
33+
*
34+
* @var string
35+
*/
36+
public $encryptionResourceKeyHash;
37+
/**
38+
* The signed JSON Web Token (JWT) which can be used to authorize the
39+
* requesting user with the Key ACL Service (KACLS). The JWT asserts that the
40+
* requesting user has at least read permissions on the file.
41+
*
42+
* @var string
43+
*/
44+
public $jwt;
45+
/**
46+
* The ID of the KACLS (Key ACL Service) used to encrypt the file.
47+
*
48+
* @var string
49+
*/
50+
public $kaclsId;
51+
/**
52+
* The name of the KACLS (Key ACL Service) used to encrypt the file.
53+
*
54+
* @var string
55+
*/
56+
public $kaclsName;
57+
/**
58+
* Key format for the unwrapped key. Must be `tinkAesGcmKey`.
59+
*
60+
* @var string
61+
*/
62+
public $keyFormat;
63+
/**
64+
* The URL-safe Base64 encoded wrapped key used to encrypt the contents of the
65+
* file.
66+
*
67+
* @var string
68+
*/
69+
public $wrappedKey;
70+
71+
/**
72+
* Chunk size used if content was encrypted with the AES 256 GCM Cipher.
73+
* Possible values are: - default - small
74+
*
75+
* @param string $aes256GcmChunkSize
76+
*/
77+
public function setAes256GcmChunkSize($aes256GcmChunkSize)
78+
{
79+
$this->aes256GcmChunkSize = $aes256GcmChunkSize;
80+
}
81+
/**
82+
* @return string
83+
*/
84+
public function getAes256GcmChunkSize()
85+
{
86+
return $this->aes256GcmChunkSize;
87+
}
88+
/**
89+
* The URL-safe Base64 encoded HMAC-SHA256 digest of the resource metadata
90+
* with its DEK (Data Encryption Key); see
91+
* https://developers.google.com/workspace/cse/reference
92+
*
93+
* @param string $encryptionResourceKeyHash
94+
*/
95+
public function setEncryptionResourceKeyHash($encryptionResourceKeyHash)
96+
{
97+
$this->encryptionResourceKeyHash = $encryptionResourceKeyHash;
98+
}
99+
/**
100+
* @return string
101+
*/
102+
public function getEncryptionResourceKeyHash()
103+
{
104+
return $this->encryptionResourceKeyHash;
105+
}
106+
/**
107+
* The signed JSON Web Token (JWT) which can be used to authorize the
108+
* requesting user with the Key ACL Service (KACLS). The JWT asserts that the
109+
* requesting user has at least read permissions on the file.
110+
*
111+
* @param string $jwt
112+
*/
113+
public function setJwt($jwt)
114+
{
115+
$this->jwt = $jwt;
116+
}
117+
/**
118+
* @return string
119+
*/
120+
public function getJwt()
121+
{
122+
return $this->jwt;
123+
}
124+
/**
125+
* The ID of the KACLS (Key ACL Service) used to encrypt the file.
126+
*
127+
* @param string $kaclsId
128+
*/
129+
public function setKaclsId($kaclsId)
130+
{
131+
$this->kaclsId = $kaclsId;
132+
}
133+
/**
134+
* @return string
135+
*/
136+
public function getKaclsId()
137+
{
138+
return $this->kaclsId;
139+
}
140+
/**
141+
* The name of the KACLS (Key ACL Service) used to encrypt the file.
142+
*
143+
* @param string $kaclsName
144+
*/
145+
public function setKaclsName($kaclsName)
146+
{
147+
$this->kaclsName = $kaclsName;
148+
}
149+
/**
150+
* @return string
151+
*/
152+
public function getKaclsName()
153+
{
154+
return $this->kaclsName;
155+
}
156+
/**
157+
* Key format for the unwrapped key. Must be `tinkAesGcmKey`.
158+
*
159+
* @param string $keyFormat
160+
*/
161+
public function setKeyFormat($keyFormat)
162+
{
163+
$this->keyFormat = $keyFormat;
164+
}
165+
/**
166+
* @return string
167+
*/
168+
public function getKeyFormat()
169+
{
170+
return $this->keyFormat;
171+
}
172+
/**
173+
* The URL-safe Base64 encoded wrapped key used to encrypt the contents of the
174+
* file.
175+
*
176+
* @param string $wrappedKey
177+
*/
178+
public function setWrappedKey($wrappedKey)
179+
{
180+
$this->wrappedKey = $wrappedKey;
181+
}
182+
/**
183+
* @return string
184+
*/
185+
public function getWrappedKey()
186+
{
187+
return $this->wrappedKey;
188+
}
189+
}
190+
191+
// Adding a class alias for backwards compatibility with the previous class name.
192+
class_alias(DecryptionMetadata::class, 'Google_Service_Drive_DecryptionMetadata');

src/Drive/DriveFile.php

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class DriveFile extends \Google\Collection
3333
public $appProperties;
3434
protected $capabilitiesType = DriveFileCapabilities::class;
3535
protected $capabilitiesDataType = '';
36+
protected $clientEncryptionDetailsType = ClientEncryptionDetails::class;
37+
protected $clientEncryptionDetailsDataType = '';
3638
protected $contentHintsType = DriveFileContentHints::class;
3739
protected $contentHintsDataType = '';
3840
protected $contentRestrictionsType = ContentRestriction::class;
@@ -353,8 +355,8 @@ class DriveFile extends \Google\Collection
353355
public $thumbnailVersion;
354356
/**
355357
* Whether the file has been trashed, either explicitly or from a trashed
356-
* parent folder. Only the owner may trash a file, and other users cannot see
357-
* files in the owner's trash.
358+
* parent folder. Only the owner may trash a file, but other users can still
359+
* access the file in the owner's trash until it's permanently deleted.
358360
*
359361
* @var bool
360362
*/
@@ -459,6 +461,25 @@ public function getCapabilities()
459461
{
460462
return $this->capabilities;
461463
}
464+
/**
465+
* Client Side Encryption related details. Contains details about the
466+
* encryption state of the file and details regarding the encryption mechanism
467+
* that clients need to use when decrypting the contents of this item. This
468+
* will only be present on files and not on folders or shortcuts.
469+
*
470+
* @param ClientEncryptionDetails $clientEncryptionDetails
471+
*/
472+
public function setClientEncryptionDetails(ClientEncryptionDetails $clientEncryptionDetails)
473+
{
474+
$this->clientEncryptionDetails = $clientEncryptionDetails;
475+
}
476+
/**
477+
* @return ClientEncryptionDetails
478+
*/
479+
public function getClientEncryptionDetails()
480+
{
481+
return $this->clientEncryptionDetails;
482+
}
462483
/**
463484
* Additional information about the content of the file. These fields are
464485
* never populated in responses.
@@ -1344,8 +1365,8 @@ public function getThumbnailVersion()
13441365
}
13451366
/**
13461367
* Whether the file has been trashed, either explicitly or from a trashed
1347-
* parent folder. Only the owner may trash a file, and other users cannot see
1348-
* files in the owner's trash.
1368+
* parent folder. Only the owner may trash a file, but other users can still
1369+
* access the file in the owner's trash until it's permanently deleted.
13491370
*
13501371
* @param bool $trashed
13511372
*/

0 commit comments

Comments
 (0)