|
@@ 408-415 (lines=8) @@
|
| 405 |
|
* @throws UnauthorizedException |
| 406 |
|
* @throws UnavailableResourceException |
| 407 |
|
*/ |
| 408 |
|
public function createDatabase($databaseId = null, $context = null, $fields = []) |
| 409 |
|
{ |
| 410 |
|
$response = $this->sendRequest('PUT', $this->getDatabaseUrl($databaseId, $context, $fields)); |
| 411 |
|
$decodedResponseBody = $this->getDecodedBody($response->getBody()); |
| 412 |
|
$database = new Database($decodedResponseBody); |
| 413 |
|
$database->setContext($this->getContext()); |
| 414 |
|
return $database; |
| 415 |
|
} |
| 416 |
|
|
| 417 |
|
/** |
| 418 |
|
* @param null|string $databaseId |
|
@@ 433-440 (lines=8) @@
|
| 430 |
|
* @throws UnauthorizedException |
| 431 |
|
* @throws UnavailableResourceException |
| 432 |
|
*/ |
| 433 |
|
public function getDatabase($databaseId = null, $context = null, $fields = []) |
| 434 |
|
{ |
| 435 |
|
$response = $this->sendRequest('GET', $this->getDatabaseUrl($databaseId, $context, $fields)); |
| 436 |
|
$decodedResponseBody = $this->getDecodedBody($response->getBody()); |
| 437 |
|
$database = new Database($decodedResponseBody); |
| 438 |
|
$database->setContext($this->getContext()); |
| 439 |
|
return $database; |
| 440 |
|
} |
| 441 |
|
|
| 442 |
|
/** |
| 443 |
|
* @param null|string $databaseId |
|
@@ 513-522 (lines=10) @@
|
| 510 |
|
* @throws UnauthorizedException |
| 511 |
|
* @throws UnavailableResourceException |
| 512 |
|
*/ |
| 513 |
|
public function getDatabaseSnapshot($databaseId = null, $context = null, $collectionId = null, $fields = []) |
| 514 |
|
{ |
| 515 |
|
$response = $this->sendRequest( |
| 516 |
|
'GET', |
| 517 |
|
$this->getDatabaseSnapshotUrl($databaseId, $context, $collectionId, $fields) |
| 518 |
|
); |
| 519 |
|
$decodedResponseBody = $this->getDecodedBody($response->getBody()); |
| 520 |
|
$result = new DatabaseSnapshotResponse($decodedResponseBody); |
| 521 |
|
return $result; |
| 522 |
|
} |
| 523 |
|
|
| 524 |
|
/** |
| 525 |
|
* @param array $data |
|
@@ 592-601 (lines=10) @@
|
| 589 |
|
* @throws UnauthorizedException |
| 590 |
|
* @throws UnavailableResourceException |
| 591 |
|
*/ |
| 592 |
|
public function getDelta($baseRevision = 0, $databaseId = null, $context = null, $fields = [], $limit = null) |
| 593 |
|
{ |
| 594 |
|
$response = $this->sendRequest( |
| 595 |
|
'GET', |
| 596 |
|
$this->getDatabaseDeltasUrl($databaseId, $context, $fields, $baseRevision, $limit) |
| 597 |
|
); |
| 598 |
|
$decodedResponseBody = $this->getDecodedBody($response->getBody()); |
| 599 |
|
$result = new DatabaseDeltasResponse($decodedResponseBody); |
| 600 |
|
return $result; |
| 601 |
|
} |
| 602 |
|
} |
| 603 |
|
|