Class GetClientAccessTokenOptions
- java.lang.Object
-
- com.azure.messaging.webpubsub.models.GetClientAccessTokenOptions
-
public final class GetClientAccessTokenOptions extends Object
Options class for configuring theWebPubSubServiceAsyncClient.getClientAccessToken(GetClientAccessTokenOptions)andWebPubSubServiceClient.getClientAccessToken(GetClientAccessTokenOptions)methods.
-
-
Constructor Summary
Constructors Constructor Description GetClientAccessTokenOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GetClientAccessTokenOptionsaddRole(String role)Adds a role to the requested authentication token.DurationgetExpiresAfter()Returns the duration after which the requested authentication token will expire.List<String>getRoles()Returns the complete set of roles to be included when creating the authentication token.StringgetUserId()Returns the user ID to be used when creating the authentication token.GetClientAccessTokenOptionssetExpiresAfter(Duration expiresAfter)Specifies when the duration after which the requested authentication token will expire.GetClientAccessTokenOptionssetRoles(List<String> roles)Specifies the complete set of roles to be included when creating the authentication token, overwriting any other roles previously set on this instance.GetClientAccessTokenOptionssetUserId(String userId)Specifies the user ID to be used when creating the authentication token.
-
-
-
Method Detail
-
setExpiresAfter
public GetClientAccessTokenOptions setExpiresAfter(Duration expiresAfter)
Specifies when the duration after which the requested authentication token will expire.- Parameters:
expiresAfter- The duration after which the requested authentication token will expire.- Returns:
- The same instance of this type, modified based on the value provided in this set method.
-
getExpiresAfter
public Duration getExpiresAfter()
Returns the duration after which the requested authentication token will expire.- Returns:
- The duration after which the requested authentication token will expire.
-
addRole
public GetClientAccessTokenOptions addRole(String role)
Adds a role to the requested authentication token.- Parameters:
role- The role to be added to the requested authentication token.- Returns:
- The same instance of this type, modified based on the value provided in this add method.
-
setRoles
public GetClientAccessTokenOptions setRoles(List<String> roles)
Specifies the complete set of roles to be included when creating the authentication token, overwriting any other roles previously set on this instance.- Parameters:
roles- The complete set of roles to be included when creating the authentication token.- Returns:
- The same instance of this type, modified based on the value provided in this set method.
-
getRoles
public List<String> getRoles()
Returns the complete set of roles to be included when creating the authentication token.- Returns:
- The complete set of roles to be included when creating the authentication token
-
setUserId
public GetClientAccessTokenOptions setUserId(String userId)
Specifies the user ID to be used when creating the authentication token.- Parameters:
userId- The user ID to be used when creating the authentication token.- Returns:
- The same instance of this type, modified based on the value provided in this set method.
-
getUserId
public String getUserId()
Returns the user ID to be used when creating the authentication token.- Returns:
- The user ID to be used when creating the authentication token.
-
-