credential)) { case EcsRamRoleCredential::class: return (new EcsRamRoleProvider($this))->get(); case RamRoleArnCredential::class: return (new RamRoleArnProvider($this))->get($timeout, $connectTimeout); case RsaKeyPairCredential::class: return (new RsaKeyPairProvider($this))->get($timeout, $connectTimeout); default: return $this->credential; } } /** * @return static * @throws ClientException * @deprecated * @codeCoverageIgnore */ public function asGlobalClient() { return $this->asDefaultClient(); } /** * Set the current client as the default client. * * @return static * @throws ClientException */ public function asDefaultClient() { return $this->name(CredentialsProvider::getDefaultName()); } /** * Naming clients. * * @param string $name * * @return static * @throws ClientException */ public function name($name) { Filter::name($name); return AlibabaCloud::set($name, $this); } /** * @return bool */ public function isDebug() { if (isset($this->options['debug'])) { return $this->options['debug'] === true && PHP_SAPI === 'cli'; } return false; } }