public void AddQueryParameter(QueryParameter parameter)
 {
     var added = queryParameters.Add(parameter);
     if (!added)
     {
         throw new Exception($"Duplicate query parameter detected: {parameter.Name} in {urlTemplate}");
     }
 }
        public Program()
        {
            var parser = new RamlParser();
            var raml = parser.LoadAsync(@"c:\temp\test.raml").Result;

            var apiName = Helpers.GetMethodOrClassName(raml.Title);
            var apiBaseUrl = new Uri(raml.BaseUri);
            var api = new Api(apiName, apiBaseUrl);

            foreach (var resource in raml.Resources)
            {
                foreach (var method in resource.Methods)
                {
                    if (string.IsNullOrEmpty(method.Description))
                    {
                        throw new Exception(string.Format("{0} method on {1} has no description", method, resource.RelativeUri));
                    }

                    var apiMethodName = Helpers.GetMethodOrClassName(method.Description);
                    var apiMethodHasBody = (method.Verb == "post" || method.Verb == "put" || method.Verb == "patch") && method.Body != null && method.Body.Any();
                    var apiMethod = new Method(apiMethodName, method.Verb, resource.RelativeUri, apiMethodHasBody);

                    if (method.QueryParameters != null)
                    {
                        foreach (var parameter in method.QueryParameters)
                        {
                            var apiMethodQueryParameterName = Helpers.ToCamelCase(parameter.Key);
                            var apiMethodQueryParameter = new QueryParameter(apiMethodQueryParameterName, parameter.Value.Required);
                            apiMethod.AddQueryParameter(apiMethodQueryParameter);
                        }
                    }

                    api.AddMethod(apiMethod);
                }
            }

            var ts = api.ToTypescript();
            ts += "";
        }