@@ 547-586 (lines=40) @@ | ||
544 | * |
|
545 | * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-share |
|
546 | */ |
|
547 | public function deleteShareAsync( |
|
548 | $share, |
|
549 | FileServiceOptions $options = null |
|
550 | ) { |
|
551 | Validate::isString($share, 'share'); |
|
552 | Validate::notNullOrEmpty($share, 'share'); |
|
553 | ||
554 | $method = Resources::HTTP_DELETE; |
|
555 | $headers = array(); |
|
556 | $postParams = array(); |
|
557 | $queryParams = array(); |
|
558 | $path = $this->createPath($share); |
|
559 | ||
560 | if (is_null($options)) { |
|
561 | $options = new FileServiceOptions(); |
|
562 | } |
|
563 | ||
564 | $this->addOptionalQueryParam( |
|
565 | $queryParams, |
|
566 | Resources::QP_TIMEOUT, |
|
567 | $options->getTimeout() |
|
568 | ); |
|
569 | ||
570 | $this->addOptionalQueryParam( |
|
571 | $queryParams, |
|
572 | Resources::QP_REST_TYPE, |
|
573 | 'share' |
|
574 | ); |
|
575 | ||
576 | return $this->sendAsync( |
|
577 | $method, |
|
578 | $headers, |
|
579 | $queryParams, |
|
580 | $postParams, |
|
581 | $path, |
|
582 | Resources::STATUS_ACCEPTED, |
|
583 | Resources::EMPTY_STRING, |
|
584 | $options |
|
585 | ); |
|
586 | } |
|
587 | ||
588 | /** |
|
589 | * Returns all properties and metadata on the share. |
|
@@ 1197-1231 (lines=35) @@ | ||
1194 | * |
|
1195 | * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-directory |
|
1196 | */ |
|
1197 | public function deleteDirectoryAsync( |
|
1198 | $share, |
|
1199 | $path, |
|
1200 | FileServiceOptions $options = null |
|
1201 | ) { |
|
1202 | Validate::isString($share, 'share'); |
|
1203 | Validate::isString($path, 'path'); |
|
1204 | ||
1205 | $method = Resources::HTTP_DELETE; |
|
1206 | $headers = array(); |
|
1207 | $postParams = array(); |
|
1208 | $queryParams = array(Resources::QP_REST_TYPE => 'directory'); |
|
1209 | $path = $this->createPath($share, $path); |
|
1210 | ||
1211 | if (is_null($options)) { |
|
1212 | $options = new FileServiceOptions(); |
|
1213 | } |
|
1214 | ||
1215 | $this->addOptionalQueryParam( |
|
1216 | $queryParams, |
|
1217 | Resources::QP_TIMEOUT, |
|
1218 | $options->getTimeout() |
|
1219 | ); |
|
1220 | ||
1221 | return $this->sendAsync( |
|
1222 | $method, |
|
1223 | $headers, |
|
1224 | $queryParams, |
|
1225 | $postParams, |
|
1226 | $path, |
|
1227 | Resources::STATUS_ACCEPTED, |
|
1228 | Resources::EMPTY_STRING, |
|
1229 | $options |
|
1230 | ); |
|
1231 | } |
|
1232 | ||
1233 | /** |
|
1234 | * Gets a directory's properties from the given share and path. |
|
@@ 1627-1661 (lines=35) @@ | ||
1624 | * |
|
1625 | * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-file2 |
|
1626 | */ |
|
1627 | public function deleteFileAsync( |
|
1628 | $share, |
|
1629 | $path, |
|
1630 | FileServiceOptions $options = null |
|
1631 | ) { |
|
1632 | Validate::isString($share, 'share'); |
|
1633 | Validate::isString($path, 'path'); |
|
1634 | ||
1635 | $method = Resources::HTTP_DELETE; |
|
1636 | $headers = array(); |
|
1637 | $postParams = array(); |
|
1638 | $queryParams = array(); |
|
1639 | $path = $this->createPath($share, $path); |
|
1640 | ||
1641 | if (is_null($options)) { |
|
1642 | $options = new FileServiceOptions(); |
|
1643 | } |
|
1644 | ||
1645 | $this->addOptionalQueryParam( |
|
1646 | $queryParams, |
|
1647 | Resources::QP_TIMEOUT, |
|
1648 | $options->getTimeout() |
|
1649 | ); |
|
1650 | ||
1651 | return $this->sendAsync( |
|
1652 | $method, |
|
1653 | $headers, |
|
1654 | $queryParams, |
|
1655 | $postParams, |
|
1656 | $path, |
|
1657 | Resources::STATUS_ACCEPTED, |
|
1658 | Resources::EMPTY_STRING, |
|
1659 | $options |
|
1660 | ); |
|
1661 | } |
|
1662 | ||
1663 | /** |
|
1664 | * Reads or downloads a file from the server, including its metadata and |
@@ 976-1013 (lines=38) @@ | ||
973 | * |
|
974 | * @see https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/set-queue-acl |
|
975 | */ |
|
976 | public function setQueueAclAsync( |
|
977 | $queue, |
|
978 | Models\QueueACL $acl, |
|
979 | Models\QueueServiceOptions $options = null |
|
980 | ) { |
|
981 | Validate::isString($queue, 'queue'); |
|
982 | Validate::notNullOrEmpty($acl, 'acl'); |
|
983 | ||
984 | $method = Resources::HTTP_PUT; |
|
985 | $headers = array(); |
|
986 | $postParams = array(); |
|
987 | $queryParams = array(); |
|
988 | $body = $acl->toXml($this->dataSerializer); |
|
989 | $path = $queue; |
|
990 | ||
991 | if (is_null($options)) { |
|
992 | $options = new QueueServiceOptions(); |
|
993 | } |
|
994 | ||
995 | $this->addOptionalQueryParam( |
|
996 | $queryParams, |
|
997 | Resources::QP_COMP, |
|
998 | 'acl' |
|
999 | ); |
|
1000 | ||
1001 | $options->setLocationMode(LocationMode::PRIMARY_ONLY); |
|
1002 | ||
1003 | return $this->sendAsync( |
|
1004 | $method, |
|
1005 | $headers, |
|
1006 | $queryParams, |
|
1007 | $postParams, |
|
1008 | $path, |
|
1009 | Resources::STATUS_NO_CONTENT, |
|
1010 | $body, |
|
1011 | $options |
|
1012 | ); |
|
1013 | } |
|
1014 | } |
|
1015 |
@@ 1670-1707 (lines=38) @@ | ||
1667 | * |
|
1668 | * @see https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/set-table-acl |
|
1669 | */ |
|
1670 | public function setTableAclAsync( |
|
1671 | $table, |
|
1672 | TableACL $acl, |
|
1673 | TableServiceOptions $options = null |
|
1674 | ) { |
|
1675 | Validate::isString($table, 'table'); |
|
1676 | Validate::notNullOrEmpty($acl, 'acl'); |
|
1677 | ||
1678 | $method = Resources::HTTP_PUT; |
|
1679 | $headers = array(); |
|
1680 | $postParams = array(); |
|
1681 | $queryParams = array(); |
|
1682 | $body = $acl->toXml($this->dataSerializer); |
|
1683 | $path = $table; |
|
1684 | ||
1685 | if (is_null($options)) { |
|
1686 | $options = new TableServiceOptions(); |
|
1687 | } |
|
1688 | ||
1689 | $this->addOptionalQueryParam( |
|
1690 | $queryParams, |
|
1691 | Resources::QP_COMP, |
|
1692 | 'acl' |
|
1693 | ); |
|
1694 | ||
1695 | $options->setLocationMode(LocationMode::PRIMARY_ONLY); |
|
1696 | ||
1697 | return $this->sendAsync( |
|
1698 | $method, |
|
1699 | $headers, |
|
1700 | $queryParams, |
|
1701 | $postParams, |
|
1702 | $path, |
|
1703 | Resources::STATUS_NO_CONTENT, |
|
1704 | $body, |
|
1705 | $options |
|
1706 | ); |
|
1707 | } |
|
1708 | } |
|
1709 |