@@ 866-916 (lines=51) @@ | ||
863 | * |
|
864 | * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-share-acl |
|
865 | */ |
|
866 | public function setShareAclAsync( |
|
867 | $share, |
|
868 | ShareACL $acl, |
|
869 | FileServiceOptions $options = null |
|
870 | ) { |
|
871 | Validate::isString($share, 'share'); |
|
872 | Validate::notNullOrEmpty($acl, 'acl'); |
|
873 | ||
874 | $method = Resources::HTTP_PUT; |
|
875 | $headers = array(); |
|
876 | $postParams = array(); |
|
877 | $queryParams = array(); |
|
878 | $path = $this->createPath($share); |
|
879 | $body = $acl->toXml($this->dataSerializer); |
|
880 | ||
881 | if (is_null($options)) { |
|
882 | $options = new FileServiceOptions(); |
|
883 | } |
|
884 | ||
885 | $this->addOptionalQueryParam( |
|
886 | $queryParams, |
|
887 | Resources::QP_REST_TYPE, |
|
888 | 'share' |
|
889 | ); |
|
890 | $this->addOptionalQueryParam( |
|
891 | $queryParams, |
|
892 | Resources::QP_COMP, |
|
893 | 'acl' |
|
894 | ); |
|
895 | $this->addOptionalQueryParam( |
|
896 | $queryParams, |
|
897 | Resources::QP_TIMEOUT, |
|
898 | $options->getTimeout() |
|
899 | ); |
|
900 | $this->addOptionalHeader( |
|
901 | $headers, |
|
902 | Resources::CONTENT_TYPE, |
|
903 | Resources::URL_ENCODED_CONTENT_TYPE |
|
904 | ); |
|
905 | ||
906 | return $this->sendAsync( |
|
907 | $method, |
|
908 | $headers, |
|
909 | $queryParams, |
|
910 | $postParams, |
|
911 | $path, |
|
912 | Resources::STATUS_OK, |
|
913 | $body, |
|
914 | $options |
|
915 | ); |
|
916 | } |
|
917 | ||
918 | /** |
|
919 | * Get the statistics related to the share. |
@@ 829-875 (lines=47) @@ | ||
826 | * |
|
827 | * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-table |
|
828 | */ |
|
829 | public function createTableAsync( |
|
830 | $table, |
|
831 | TableServiceCreateOptions $options = null |
|
832 | ) { |
|
833 | Validate::isString($table, 'table'); |
|
834 | Validate::notNullOrEmpty($table, 'table'); |
|
835 | ||
836 | $method = Resources::HTTP_POST; |
|
837 | $headers = array(); |
|
838 | $postParams = array(); |
|
839 | $queryParams = array(); |
|
840 | $path = 'Tables'; |
|
841 | $body = $this->odataSerializer->getTable($table); |
|
842 | ||
843 | if (is_null($options)) { |
|
844 | $options = new TableServiceCreateOptions(); |
|
845 | } |
|
846 | ||
847 | $this->addOptionalHeader( |
|
848 | $headers, |
|
849 | Resources::CONTENT_TYPE, |
|
850 | Resources::JSON_CONTENT_TYPE |
|
851 | ); |
|
852 | $this->addOptionalHeader( |
|
853 | $headers, |
|
854 | Resources::ACCEPT_HEADER, |
|
855 | $options->getAccept() |
|
856 | ); |
|
857 | ||
858 | $this->addOptionalHeader( |
|
859 | $headers, |
|
860 | Resources::PREFER, |
|
861 | $options->getDoesReturnContent() ? Resources::RETURN_CONTENT : null |
|
862 | ); |
|
863 | $options->setLocationMode(LocationMode::PRIMARY_ONLY); |
|
864 | ||
865 | return $this->sendAsync( |
|
866 | $method, |
|
867 | $headers, |
|
868 | $queryParams, |
|
869 | $postParams, |
|
870 | $path, |
|
871 | Resources::STATUS_CREATED, |
|
872 | $body, |
|
873 | $options |
|
874 | ); |
|
875 | } |
|
876 | ||
877 | /** |
|
878 | * Gets the table. |