﻿

namespace MyNamespace
{
    using System = global::System;

    public interface ITestController
    {



        System.Threading.Tasks.Task<string> FooAsync(string test, bool? test2);



        System.Threading.Tasks.Task<string> FooRequiredAsync(string test, bool test2);


        System.Threading.Tasks.Task BarAsync();


        System.Threading.Tasks.Task HeaderParamAsync(string comesFromHeader);


        System.Threading.Tasks.Task HeaderParamRequiredAsync(string comes_from_header);


        System.Threading.Tasks.Task ComplexAsync(ComplexType complexType);


        System.Threading.Tasks.Task<ComplexTypeResponse> ComplexRequiredAsync(ComplexType complexType);

    }


    public partial class TestController : Microsoft.AspNetCore.Mvc.ControllerBase
    {
        private ITestController _implementation;

        public TestController(ITestController implementation)
        {
            _implementation = implementation;
        }

        [Microsoft.AspNetCore.Mvc.HttpGet, Microsoft.AspNetCore.Mvc.Route("Foo")]
        public System.Threading.Tasks.Task<string> Foo([Microsoft.AspNetCore.Mvc.FromQuery] string test, [Microsoft.AspNetCore.Mvc.FromQuery] bool? test2)
        {

            return _implementation.FooAsync(test, test2);
        }

        [Microsoft.AspNetCore.Mvc.HttpGet, Microsoft.AspNetCore.Mvc.Route("FooRequired")]
        public System.Threading.Tasks.Task<string> FooRequired([Microsoft.AspNetCore.Mvc.FromQuery] [Microsoft.AspNetCore.Mvc.ModelBinding.BindRequired] string test, [Microsoft.AspNetCore.Mvc.FromQuery] [Microsoft.AspNetCore.Mvc.ModelBinding.BindRequired] bool test2)
        {

            return _implementation.FooRequiredAsync(test, test2);
        }

        [Microsoft.AspNetCore.Mvc.HttpPost, Microsoft.AspNetCore.Mvc.Route("Bar")]
        public System.Threading.Tasks.Task Bar()
        {

            return _implementation.BarAsync();
        }

        [Microsoft.AspNetCore.Mvc.HttpPost, Microsoft.AspNetCore.Mvc.Route("HeaderParam")]
        public System.Threading.Tasks.Task HeaderParam([Microsoft.AspNetCore.Mvc.FromHeader] string comesFromHeader)
        {

            return _implementation.HeaderParamAsync(comesFromHeader);
        }

        [Microsoft.AspNetCore.Mvc.HttpPost, Microsoft.AspNetCore.Mvc.Route("HeaderParamRequired")]
        public System.Threading.Tasks.Task HeaderParamRequired([Microsoft.AspNetCore.Mvc.FromHeader(Name = "comes-from-header")] [Microsoft.AspNetCore.Mvc.ModelBinding.BindRequired] string comes_from_header)
        {

            return _implementation.HeaderParamRequiredAsync(comes_from_header);
        }

        [Microsoft.AspNetCore.Mvc.HttpPost, Microsoft.AspNetCore.Mvc.Route("Complex")]
        public System.Threading.Tasks.Task Complex([Microsoft.AspNetCore.Mvc.FromBody] ComplexType complexType)
        {

            return _implementation.ComplexAsync(complexType);
        }

        [Microsoft.AspNetCore.Mvc.HttpPost, Microsoft.AspNetCore.Mvc.Route("ComplexRequired")]
        public System.Threading.Tasks.Task<ComplexTypeResponse> ComplexRequired([Microsoft.AspNetCore.Mvc.FromBody] [Microsoft.AspNetCore.Mvc.ModelBinding.BindRequired] ComplexType complexType)
        {

            return _implementation.ComplexRequiredAsync(complexType);
        }

    }

    public partial class ComplexType
    {

        [Newtonsoft.Json.JsonProperty("Prop1", Required = Newtonsoft.Json.Required.Always)]
        [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
        public string Prop1 { get; set; }

        [Newtonsoft.Json.JsonProperty("Prop2", Required = Newtonsoft.Json.Required.Always)]
        public int Prop2 { get; set; }

        [Newtonsoft.Json.JsonProperty("Prop3", Required = Newtonsoft.Json.Required.Always)]
        public bool Prop3 { get; set; }

        [Newtonsoft.Json.JsonProperty("Prop4", Required = Newtonsoft.Json.Required.Always)]
        public ComplexType Prop4 { get; set; }

        private System.Collections.Generic.IDictionary<string, object> _additionalProperties;

        [Newtonsoft.Json.JsonExtensionData]
        public System.Collections.Generic.IDictionary<string, object> AdditionalProperties
        {
            get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); }
            set { _additionalProperties = value; }
        }

    }

    public partial class ComplexTypeResponse
    {

        [Newtonsoft.Json.JsonProperty("Prop1", Required = Newtonsoft.Json.Required.Always)]
        [System.ComponentModel.DataAnnotations.Required(AllowEmptyStrings = true)]
        public string Prop1 { get; set; }

        [Newtonsoft.Json.JsonProperty("Prop2", Required = Newtonsoft.Json.Required.Always)]
        public int Prop2 { get; set; }

        [Newtonsoft.Json.JsonProperty("Prop3", Required = Newtonsoft.Json.Required.Always)]
        public bool Prop3 { get; set; }

        [Newtonsoft.Json.JsonProperty("Prop4", Required = Newtonsoft.Json.Required.Always)]
        public ComplexType Prop4 { get; set; }

        private System.Collections.Generic.IDictionary<string, object> _additionalProperties;

        [Newtonsoft.Json.JsonExtensionData]
        public System.Collections.Generic.IDictionary<string, object> AdditionalProperties
        {
            get { return _additionalProperties ?? (_additionalProperties = new System.Collections.Generic.Dictionary<string, object>()); }
            set { _additionalProperties = value; }
        }

    }


}
