class YfyShareLinkClient extends YfyBaseApiClient

Class YfyShareLinkClient

Constants

API_PREFIX

SHARE_LINK_INFO_URI

SHARE_CREATE_URI

SHARE_UPDATE_URI

SHARE_REVOKE_URI

Properties

protected YfyContext $yfyContext from YfyBaseApiClient
protected YfyHttpClient $httpClient from YfyBaseApiClient
protected OAuthClient $oauthClient from YfyBaseApiClient

Methods

__construct(YfyContext $yfyContext, YfyHttpClient $httpClient, OAuthClient $oauthClient)

YfyUserClient constructor.

execute(YfyRequest $yfyRequest)

执行请求, 调用realExecute, 封装了重试的逻辑

realExecute(YfyRequest $yfyRequest)

真正执行请求的函数 会进行所有错误处理

mixed
getInfo(string $uniqueName)

获取分享链接信息

mixed
create(string $type, int $id, string $access, string $dueTime, bool $disableDownload = false, bool $passwordProtected = false, string $password = null)

创建分享链接

mixed
update(string $uniqueName, string $access, string $dueTime, bool $disableDownload = false, bool $passwordProtected = false, string $password = null)

更新分享链接

mixed
revoke(string $uniqueName)

删除分享链接

Details

at line 33
__construct(YfyContext $yfyContext, YfyHttpClient $httpClient, OAuthClient $oauthClient)

YfyUserClient constructor.

Parameters

YfyContext $yfyContext
YfyHttpClient $httpClient
OAuthClient $oauthClient

in YfyBaseApiClient at line 61
protected YfyRawResponse execute(YfyRequest $yfyRequest)

执行请求, 调用realExecute, 封装了重试的逻辑

Parameters

YfyRequest $yfyRequest

Return Value

YfyRawResponse

Exceptions

YfySdkException

in YfyBaseApiClient at line 93
protected YfyRawResponse realExecute(YfyRequest $yfyRequest)

真正执行请求的函数 会进行所有错误处理

at line 45
mixed getInfo(string $uniqueName)

获取分享链接信息

Parameters

string $uniqueName 分享链接唯一标识

Return Value

mixed

Exceptions

YfySdkException

at line 73
mixed create(string $type, int $id, string $access, string $dueTime, bool $disableDownload = false, bool $passwordProtected = false, string $password = null)

创建分享链接

Parameters

string $type item类型, 只能是Fangcloud\Constant\YfyItemType::FILE 或者Fangcloud\Constant\YfyItemType::FOLDER
int $id item的id
string $access 分享链接的访问权限, 只能是Fangcloud\Constant\YfyShareLinkAccess中定义的常量
string $dueTime 到期时间(格式如:2017-05-30)
bool $disableDownload 是否不允许下载(默认false)
bool $passwordProtected 是否有密码(默认false)
string $password 密码

Return Value

mixed

Exceptions

YfySdkException
InvalidArgumentException

See also

YfyItemType
YfyShareLinkAccess

at line 111
mixed update(string $uniqueName, string $access, string $dueTime, bool $disableDownload = false, bool $passwordProtected = false, string $password = null)

更新分享链接

Parameters

string $uniqueName 分享链接唯一标识
string $access 分享链接的访问权限, 只能是Fangcloud\Constant\YfyShareLinkAccess中定义的常量
string $dueTime 到期时间(格式如:2017-05-30)
bool $disableDownload 是否不允许下载(默认false)
bool $passwordProtected 是否有密码(默认false)
string $password 密码

Return Value

mixed

Exceptions

YfySdkException
InvalidArgumentException

See also

YfyShareLinkAccess

at line 138
mixed revoke(string $uniqueName)

删除分享链接

Parameters

string $uniqueName 分享链接唯一标识

Return Value

mixed

Exceptions

YfySdkException