Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Cronofy.OAuthToken"/>
        /// class.
        /// </summary>
        /// <param name="accessToken">
        /// The access token for the OAuth authorization, must not be empty.
        /// </param>
        /// <param name="refreshToken">
        /// The refresh token for the OAuth authorization, must not be empty.
        /// </param>
        /// <param name="expiresIn">
        /// The number of seconds until the <paramref name="accessToken"/>
        /// expires, must not be negative.
        /// </param>
        /// <param name="scope">
        /// The scope of the OAuth authorization, must not be null.
        /// </param>
        public OAuthToken(string accessToken, string refreshToken, int expiresIn, string[] scope)
        {
            Preconditions.NotEmpty("accessToken", accessToken);
            Preconditions.NotEmpty("refreshToken", refreshToken);
            Preconditions.NotNegative("expiresIn", expiresIn);
            Preconditions.NotNull("scope", scope);

            this.AccessToken  = accessToken;
            this.RefreshToken = refreshToken;
            this.ExpiresIn    = expiresIn;
            this.Scope        = scope;
        }