Show / Hide Table of Contents

Struct AuthorizationTokens

Represents a set of OAUTH 2.0 access and refresh authorization tokens.

Implements
System.IEquatable<AuthorizationTokens>
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.ReferenceEquals(System.Object, System.Object)
Namespace: UOL.SDK.Authorization
Assembly: UOL.SDK.dll
Syntax
public struct AuthorizationTokens : IEquatable<AuthorizationTokens>

Constructors

AuthorizationTokens(String)

Initializes a new instance of the AuthorizationTokens struct with only an access token.

Declaration
public AuthorizationTokens(string accessToken)
Parameters
Type Name Description
System.String accessToken

Specifies the access token retrieved from tan authorization server.

AuthorizationTokens(String, DateTime, String)

Initializes a new instance of the AuthorizationTokens struct.

Declaration
public AuthorizationTokens(string accessToken, DateTime accessTokenExpirationDate, string refreshToken)
Parameters
Type Name Description
System.String accessToken

Specifies the access token retrieved from an authorization server.

System.DateTime accessTokenExpirationDate

Specifies the expiration date time of the access token.

System.String refreshToken

Specifies the refresh token retrieved from an authorization server.

Fields

Empty

Initializes a new empty instance of AuthorizationTokens.

Declaration
public static readonly AuthorizationTokens Empty
Field Value
Type Description
AuthorizationTokens

Properties

AccessToken

Gets the access token.

Declaration
public string AccessToken { get; }
Property Value
Type Description
System.String

The access token.

AccessTokenExpirationDate

Gets the expiration date and time for the access token.

Declaration
public DateTime AccessTokenExpirationDate { get; }
Property Value
Type Description
System.DateTime

The access token expiration date and time.

RefreshToken

Gets the refresh token.

Declaration
public string RefreshToken { get; }
Property Value
Type Description
System.String

The refresh token.

Methods

Equals(Object)

Determines whether this instance and a specified object, which must also be a AuthorizationTokens object, have the same value, that is the same access and refresh tokens.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

The AuthorizationTokens to compare to this instance.

Returns
Type Description
System.Boolean

true if obj is a AuthorizationTokens and its value is the same as this instance, otherwise false.

Overrides
System.ValueType.Equals(System.Object)

Equals(AuthorizationTokens)

Determines whether this instance and a specified object, which is also a AuthorizationTokens object, have the same value, that is the same access and refresh tokens.

Declaration
public bool Equals(AuthorizationTokens other)
Parameters
Type Name Description
AuthorizationTokens other

The AuthorizationTokens to compare to this instance.

Returns
Type Description
System.Boolean

true if the value of obj is the same as this instance, otherwise false.

GetHashCode()

Returns the hash code for this AuthorizationTokens.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

A 32-bit signed integer hash code.

Overrides
System.ValueType.GetHashCode()

ToString()

Returns a string that represents the current object.

Declaration
public override string ToString()
Returns
Type Description
System.String

A string that represents the current object.

Overrides
System.ValueType.ToString()

Operators

Equality(AuthorizationTokens, AuthorizationTokens)

Determines whether two specified IAuthorizationService have the same value.

Declaration
public static bool operator ==(AuthorizationTokens left, AuthorizationTokens right)
Parameters
Type Name Description
AuthorizationTokens left

One set of tokens.

AuthorizationTokens right

Another set of tokens

Returns
Type Description
System.Boolean

true if the left equals right, otherwise false.

Inequality(AuthorizationTokens, AuthorizationTokens)

Determines whether two specified AuthorizationTokens have different values.

Declaration
public static bool operator !=(AuthorizationTokens left, AuthorizationTokens right)
Parameters
Type Name Description
AuthorizationTokens left

One set of tokens.

AuthorizationTokens right

Another set of tokens

Returns
Type Description
System.Boolean

true if the left not equals right, otherwise false.

Implements

System.IEquatable<T>