-
public class Auth.TokenRequest extends Auth.TokenParams
Contains the properties of a request for a token to Ably.Tokens are generated using requestToken.
-
-
Constructor Summary
Constructors Constructor Description Auth.TokenRequest()Auth.TokenRequest(Auth.TokenParams params)
-
Method Summary
Modifier and Type Method Description static Auth.TokenRequestfromJSON(JsonObject json)A static factory method to create a TokenRequest object from a deserialized TokenRequest-like objector a JSON stringified TokenRequest object.This method is provided to minimize bugs as a result of differing types by platform for fields such as timestamp or ttl.For example, in Ruby ttl in the TokenRequest object is exposed in seconds as that is idiomatic for the language,yet when serialized to JSON using to_json it is automatically converted to the Ably standard which is milliseconds.By using the fromJson() method when constructing a TokenRequest object,Ably ensures that all fields are consistently serialized and deserialized across platforms. static Auth.TokenRequestfromJsonElement(JsonObject json)A static factory method to create a TokenRequest object from a deserialized TokenRequest-like objector a JSON stringified TokenRequest object.This method is provided to minimize bugs as a result of differing types by platform for fields such as timestamp or ttl.For example, in Ruby ttl in the TokenRequest object is exposed in seconds as that is idiomatic for the language,yet when serialized to JSON using to_json it is automatically converted to the Ably standard which is milliseconds.By using the fromJson() method when constructing a TokenRequest object,Ably ensures that all fields are consistently serialized and deserialized across platforms. static Auth.TokenRequestfromJson(String json)A static factory method to create a TokenRequest object from a deserialized TokenRequest-like objector a JSON stringified TokenRequest object.This method is provided to minimize bugs as a result of differing types by platform for fields such as timestamp or ttl.For example, in Ruby ttl in the TokenRequest object is exposed in seconds as that is idiomatic for the language,yet when serialized to JSON using to_json it is automatically converted to the Ably standard which is milliseconds.By using the fromJson() method when constructing a TokenRequest object,Ably ensures that all fields are consistently serialized and deserialized across platforms. JsonObjectasJsonElement()Convert a TokenParams into a JSON object. StringasJson()Convert a TokenParams into a JSON string. booleanequals(Object obj)Check equality of a TokenRequest -
-
Constructor Detail
-
Auth.TokenRequest
Auth.TokenRequest()
-
Auth.TokenRequest
Auth.TokenRequest(Auth.TokenParams params)
-
-
Method Detail
-
fromJSON
@Deprecated() static Auth.TokenRequest fromJSON(JsonObject json)
A static factory method to create a TokenRequest object from a deserialized TokenRequest-like objector a JSON stringified TokenRequest object.This method is provided to minimize bugs as a result of differing types by platform for fields such as timestamp or ttl.For example, in Ruby ttl in the TokenRequest object is exposed in seconds as that is idiomatic for the language,yet when serialized to JSON using to_json it is automatically converted to the Ably standard which is milliseconds.By using the fromJson() method when constructing a TokenRequest object,Ably ensures that all fields are consistently serialized and deserialized across platforms.
Spec: TE6
- Parameters:
json- A deserialized TokenRequest-like object or a JSON stringified TokenRequest object to create a TokenRequest.
-
fromJsonElement
static Auth.TokenRequest fromJsonElement(JsonObject json)
A static factory method to create a TokenRequest object from a deserialized TokenRequest-like objector a JSON stringified TokenRequest object.This method is provided to minimize bugs as a result of differing types by platform for fields such as timestamp or ttl.For example, in Ruby ttl in the TokenRequest object is exposed in seconds as that is idiomatic for the language,yet when serialized to JSON using to_json it is automatically converted to the Ably standard which is milliseconds.By using the fromJson() method when constructing a TokenRequest object,Ably ensures that all fields are consistently serialized and deserialized across platforms.
Spec: TE6
- Parameters:
json- A deserialized TokenRequest-like object or a JSON stringified TokenRequest object to create a TokenRequest.
-
fromJson
static Auth.TokenRequest fromJson(String json)
A static factory method to create a TokenRequest object from a deserialized TokenRequest-like objector a JSON stringified TokenRequest object.This method is provided to minimize bugs as a result of differing types by platform for fields such as timestamp or ttl.For example, in Ruby ttl in the TokenRequest object is exposed in seconds as that is idiomatic for the language,yet when serialized to JSON using to_json it is automatically converted to the Ably standard which is milliseconds.By using the fromJson() method when constructing a TokenRequest object,Ably ensures that all fields are consistently serialized and deserialized across platforms.
Spec: TE6
- Parameters:
json- A deserialized TokenRequest-like object or a JSON stringified TokenRequest object to create a TokenRequest.
-
asJsonElement
JsonObject asJsonElement()
Convert a TokenParams into a JSON object.
-
-
-
-