mirror of
https://github.com/tribufu/tribufu-dotnet
synced 2026-02-04 02:36:55 +00:00
Update projects
This commit is contained in:
138
src/Tribufu/Model/TokenResponse.cs
Normal file
138
src/Tribufu/Model/TokenResponse.cs
Normal file
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* 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
|
||||
{
|
||||
/// <summary>
|
||||
/// TokenResponse
|
||||
/// </summary>
|
||||
[DataContract(Name = "TokenResponse")]
|
||||
public partial class TokenResponse : IValidatableObject
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets TokenType
|
||||
/// </summary>
|
||||
[DataMember(Name = "token_type", IsRequired = true, EmitDefaultValue = true)]
|
||||
public TokenType TokenType { get; set; }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TokenResponse" /> class.
|
||||
/// </summary>
|
||||
[JsonConstructorAttribute]
|
||||
protected TokenResponse() { }
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TokenResponse" /> class.
|
||||
/// </summary>
|
||||
/// <param name="tokenType">tokenType (required).</param>
|
||||
/// <param name="accessToken">accessToken (required).</param>
|
||||
/// <param name="refreshToken">refreshToken.</param>
|
||||
/// <param name="scope">scope.</param>
|
||||
/// <param name="state">state.</param>
|
||||
/// <param name="expiresIn">expiresIn.</param>
|
||||
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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets AccessToken
|
||||
/// </summary>
|
||||
[DataMember(Name = "access_token", IsRequired = true, EmitDefaultValue = true)]
|
||||
public string AccessToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets RefreshToken
|
||||
/// </summary>
|
||||
[DataMember(Name = "refresh_token", EmitDefaultValue = true)]
|
||||
public string RefreshToken { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Scope
|
||||
/// </summary>
|
||||
[DataMember(Name = "scope", EmitDefaultValue = true)]
|
||||
public string Scope { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets State
|
||||
/// </summary>
|
||||
[DataMember(Name = "state", EmitDefaultValue = true)]
|
||||
public string State { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets ExpiresIn
|
||||
/// </summary>
|
||||
[DataMember(Name = "expires_in", EmitDefaultValue = false)]
|
||||
public long ExpiresIn { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>String presentation of the object</returns>
|
||||
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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the JSON string presentation of the object
|
||||
/// </summary>
|
||||
/// <returns>JSON string presentation of the object</returns>
|
||||
public virtual string ToJson()
|
||||
{
|
||||
return Newtonsoft.Json.JsonConvert.SerializeObject(this, Newtonsoft.Json.Formatting.Indented);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// To validate all properties of the instance
|
||||
/// </summary>
|
||||
/// <param name="validationContext">Validation context</param>
|
||||
/// <returns>Validation Result</returns>
|
||||
IEnumerable<ValidationResult> IValidatableObject.Validate(ValidationContext validationContext)
|
||||
{
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user