/*
 * 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>
    /// AuthorizeRequest
    /// </summary>
    [DataContract(Name = "AuthorizeRequest")]
    public partial class AuthorizeRequest : IValidatableObject
    {

        /// <summary>
        /// Gets or Sets ResponseType
        /// </summary>
        [DataMember(Name = "response_type", EmitDefaultValue = false)]
        public ResponseType? ResponseType { get; set; }

        /// <summary>
        /// Gets or Sets CodeChallengeMethod
        /// </summary>
        [DataMember(Name = "code_challenge_method", EmitDefaultValue = false)]
        public CodeChallengeMethod? CodeChallengeMethod { get; set; }
        /// <summary>
        /// Initializes a new instance of the <see cref="AuthorizeRequest" /> class.
        /// </summary>
        [JsonConstructorAttribute]
        protected AuthorizeRequest() { }
        /// <summary>
        /// Initializes a new instance of the <see cref="AuthorizeRequest" /> class.
        /// </summary>
        /// <param name="responseType">responseType.</param>
        /// <param name="clientId">clientId (required).</param>
        /// <param name="codeChallenge">codeChallenge.</param>
        /// <param name="codeChallengeMethod">codeChallengeMethod.</param>
        /// <param name="redirectUri">redirectUri (required).</param>
        /// <param name="scope">scope.</param>
        /// <param name="state">state.</param>
        public AuthorizeRequest(ResponseType? responseType = default(ResponseType?), string clientId = default(string), string codeChallenge = default(string), CodeChallengeMethod? codeChallengeMethod = default(CodeChallengeMethod?), string redirectUri = default(string), string scope = default(string), string state = default(string))
        {
            // to ensure "clientId" is required (not null)
            if (clientId == null)
            {
                throw new ArgumentNullException("clientId is a required property for AuthorizeRequest and cannot be null");
            }
            this.ClientId = clientId;
            // to ensure "redirectUri" is required (not null)
            if (redirectUri == null)
            {
                throw new ArgumentNullException("redirectUri is a required property for AuthorizeRequest and cannot be null");
            }
            this.RedirectUri = redirectUri;
            this.ResponseType = responseType;
            this.CodeChallenge = codeChallenge;
            this.CodeChallengeMethod = codeChallengeMethod;
            this.Scope = scope;
            this.State = state;
        }

        /// <summary>
        /// Gets or Sets ClientId
        /// </summary>
        [DataMember(Name = "client_id", IsRequired = true, EmitDefaultValue = true)]
        public string ClientId { get; set; }

        /// <summary>
        /// Gets or Sets CodeChallenge
        /// </summary>
        [DataMember(Name = "code_challenge", EmitDefaultValue = true)]
        public string CodeChallenge { get; set; }

        /// <summary>
        /// Gets or Sets RedirectUri
        /// </summary>
        [DataMember(Name = "redirect_uri", IsRequired = true, EmitDefaultValue = true)]
        public string RedirectUri { 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>
        /// 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 AuthorizeRequest {\n");
            sb.Append("  ResponseType: ").Append(ResponseType).Append("\n");
            sb.Append("  ClientId: ").Append(ClientId).Append("\n");
            sb.Append("  CodeChallenge: ").Append(CodeChallenge).Append("\n");
            sb.Append("  CodeChallengeMethod: ").Append(CodeChallengeMethod).Append("\n");
            sb.Append("  RedirectUri: ").Append(RedirectUri).Append("\n");
            sb.Append("  Scope: ").Append(Scope).Append("\n");
            sb.Append("  State: ").Append(State).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;
        }
    }

}
