| @@ 3853-3875 (lines=23) @@ | ||
| 3850 | * |
|
| 3851 | * @see https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/lease-blob |
|
| 3852 | */ |
|
| 3853 | public function changeLeaseAsync( |
|
| 3854 | $container, |
|
| 3855 | $blob, |
|
| 3856 | $leaseId, |
|
| 3857 | $proposedLeaseId, |
|
| 3858 | Models\BlobServiceOptions $options = null |
|
| 3859 | ) { |
|
| 3860 | return $this->_putLeaseAsyncImpl( |
|
| 3861 | LeaseMode::CHANGE_ACTION, |
|
| 3862 | $container, |
|
| 3863 | $blob, |
|
| 3864 | $proposedLeaseId, |
|
| 3865 | null /* leaseDuration */, |
|
| 3866 | $leaseId, |
|
| 3867 | null /* breakPeriod */, |
|
| 3868 | self::getStatusCodeOfLeaseAction(LeaseMode::RENEW_ACTION), |
|
| 3869 | is_null($options) ? new BlobServiceOptions() : $options |
|
| 3870 | )->then(function ($response) { |
|
| 3871 | return LeaseResult::create( |
|
| 3872 | HttpFormatter::formatHeaders($response->getHeaders()) |
|
| 3873 | ); |
|
| 3874 | }, null); |
|
| 3875 | } |
|
| 3876 | ||
| 3877 | /** |
|
| 3878 | * Renews an existing lease |
|
| @@ 3915-3936 (lines=22) @@ | ||
| 3912 | * |
|
| 3913 | * @see https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/lease-blob |
|
| 3914 | */ |
|
| 3915 | public function renewLeaseAsync( |
|
| 3916 | $container, |
|
| 3917 | $blob, |
|
| 3918 | $leaseId, |
|
| 3919 | Models\BlobServiceOptions $options = null |
|
| 3920 | ) { |
|
| 3921 | return $this->_putLeaseAsyncImpl( |
|
| 3922 | LeaseMode::RENEW_ACTION, |
|
| 3923 | $container, |
|
| 3924 | $blob, |
|
| 3925 | null /* proposedLeaseId */, |
|
| 3926 | null /* leaseDuration */, |
|
| 3927 | $leaseId, |
|
| 3928 | null /* breakPeriod */, |
|
| 3929 | self::getStatusCodeOfLeaseAction(LeaseMode::RENEW_ACTION), |
|
| 3930 | is_null($options) ? new BlobServiceOptions() : $options |
|
| 3931 | )->then(function ($response) { |
|
| 3932 | return LeaseResult::create( |
|
| 3933 | HttpFormatter::formatHeaders($response->getHeaders()) |
|
| 3934 | ); |
|
| 3935 | }, null); |
|
| 3936 | } |
|
| 3937 | ||
| 3938 | /** |
|
| 3939 | * Frees the lease if it is no longer needed so that another client may |
|
| @@ 4032-4053 (lines=22) @@ | ||
| 4029 | * |
|
| 4030 | * @see https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/lease-blob |
|
| 4031 | */ |
|
| 4032 | public function breakLeaseAsync( |
|
| 4033 | $container, |
|
| 4034 | $blob, |
|
| 4035 | $breakPeriod = null, |
|
| 4036 | Models\BlobServiceOptions $options = null |
|
| 4037 | ) { |
|
| 4038 | return $this->_putLeaseAsyncImpl( |
|
| 4039 | LeaseMode::BREAK_ACTION, |
|
| 4040 | $container, |
|
| 4041 | $blob, |
|
| 4042 | null /* proposedLeaseId */, |
|
| 4043 | null /* leaseDuration */, |
|
| 4044 | null /* leaseId */, |
|
| 4045 | $breakPeriod, |
|
| 4046 | self::getStatusCodeOfLeaseAction(LeaseMode::BREAK_ACTION), |
|
| 4047 | is_null($options) ? new BlobServiceOptions() : $options |
|
| 4048 | )->then(function ($response) { |
|
| 4049 | return BreakLeaseResult::create( |
|
| 4050 | HttpFormatter::formatHeaders($response->getHeaders()) |
|
| 4051 | ); |
|
| 4052 | }, null); |
|
| 4053 | } |
|
| 4054 | ||
| 4055 | /** |
|
| 4056 | * Adds optional header to headers if set |
|