options['clientSecret'] = $clientSecret; $this->options['code'] = $code; $this->options['redirectUri'] = $redirectUri; $this->options['audience'] = $audience; $this->options['refreshToken'] = $refreshToken; $this->options['scope'] = $scope; } /** * The credential for confidential OAuth App. * * @param string $clientSecret The credential for confidential OAuth App. * @return $this Fluent Builder */ public function setClientSecret(string $clientSecret): self { $this->options['clientSecret'] = $clientSecret; return $this; } /** * JWT token related to the authorization code grant type. * * @param string $code JWT token related to the authorization code grant type. * @return $this Fluent Builder */ public function setCode(string $code): self { $this->options['code'] = $code; return $this; } /** * The redirect uri * * @param string $redirectUri The redirect uri * @return $this Fluent Builder */ public function setRedirectUri(string $redirectUri): self { $this->options['redirectUri'] = $redirectUri; return $this; } /** * The targeted audience uri * * @param string $audience The targeted audience uri * @return $this Fluent Builder */ public function setAudience(string $audience): self { $this->options['audience'] = $audience; return $this; } /** * JWT token related to refresh access token. * * @param string $refreshToken JWT token related to refresh access token. * @return $this Fluent Builder */ public function setRefreshToken(string $refreshToken): self { $this->options['refreshToken'] = $refreshToken; return $this; } /** * The scope of token * * @param string $scope The scope of token * @return $this Fluent Builder */ public function setScope(string $scope): self { $this->options['scope'] = $scope; return $this; } /** * Provide a friendly representation * * @return string Machine friendly representation */ public function __toString(): string { $options = \http_build_query(Values::of($this->options), '', ' '); return '[Twilio.Oauth.V1.CreateTokenOptions ' . $options . ']'; } }