/* * Tribufu API * * API to access Tribufu services. * * The version of the OpenAPI document: 1.2.6 * Contact: contact@tribufu.com * Generated by: https://github.com/openapitools/openapi-generator.git */ using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.IO; using System.Runtime.Serialization; using System.Text; using System.Text.RegularExpressions; using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Linq; using System.ComponentModel.DataAnnotations; using OpenAPIDateConverter = Tribufu.Client.OpenAPIDateConverter; namespace Tribufu.Model { /// /// TokenResponse /// [DataContract(Name = "TokenResponse")] public partial class TokenResponse : IValidatableObject { /// /// Gets or Sets TokenType /// [DataMember(Name = "token_type", IsRequired = true, EmitDefaultValue = true)] public TokenType TokenType { get; set; } /// /// Initializes a new instance of the class. /// [JsonConstructorAttribute] protected TokenResponse() { } /// /// Initializes a new instance of the class. /// /// tokenType (required). /// accessToken (required). /// refreshToken. /// scope. /// state. /// expiresIn. public TokenResponse(TokenType tokenType = default(TokenType), string accessToken = default(string), string refreshToken = default(string), string scope = default(string), string state = default(string), long expiresIn = default(long)) { this.TokenType = tokenType; // to ensure "accessToken" is required (not null) if (accessToken == null) { throw new ArgumentNullException("accessToken is a required property for TokenResponse and cannot be null"); } this.AccessToken = accessToken; this.RefreshToken = refreshToken; this.Scope = scope; this.State = state; this.ExpiresIn = expiresIn; } /// /// Gets or Sets AccessToken /// [DataMember(Name = "access_token", IsRequired = true, EmitDefaultValue = true)] public string AccessToken { get; set; } /// /// Gets or Sets RefreshToken /// [DataMember(Name = "refresh_token", EmitDefaultValue = true)] public string RefreshToken { get; set; } /// /// Gets or Sets Scope /// [DataMember(Name = "scope", EmitDefaultValue = true)] public string Scope { get; set; } /// /// Gets or Sets State /// [DataMember(Name = "state", EmitDefaultValue = true)] public string State { get; set; } /// /// Gets or Sets ExpiresIn /// [DataMember(Name = "expires_in", EmitDefaultValue = false)] public long ExpiresIn { get; set; } /// /// Returns the string presentation of the object /// /// String presentation of the object public override string ToString() { StringBuilder sb = new StringBuilder(); sb.Append("class TokenResponse {\n"); sb.Append(" TokenType: ").Append(TokenType).Append("\n"); sb.Append(" AccessToken: ").Append(AccessToken).Append("\n"); sb.Append(" RefreshToken: ").Append(RefreshToken).Append("\n"); sb.Append(" Scope: ").Append(Scope).Append("\n"); sb.Append(" State: ").Append(State).Append("\n"); sb.Append(" ExpiresIn: ").Append(ExpiresIn).Append("\n"); sb.Append("}\n"); return sb.ToString(); } /// /// Returns the JSON string presentation of the object /// /// JSON string presentation of the object public virtual string ToJson() { return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented); } /// /// To validate all properties of the instance /// /// Validation context /// Validation Result IEnumerable IValidatableObject.Validate(ValidationContext validationContext) { yield break; } } }