Beispiel #1
0
        public static MethodTS Method(
            HttpMethod httpMethod                = HttpMethod.Get,
            string requestContentType            = null,
            CodeModelTS codeModel                = null,
            MethodGroupTS methodGroup            = null,
            Response defaultResponse             = null,
            IEnumerable <ParameterTS> parameters = null,
            string deprecatedMessage             = null)
        {
            if (codeModel == null)
            {
                codeModel = CodeModel();
            }

            MethodTS method = DependencyInjection.New <MethodTS>();

            if (methodGroup == null)
            {
                methodGroup = MethodGroup(codeModel);
            }
            method.MethodGroup = methodGroup;

            codeModel.Add(method);

            method.HttpMethod         = httpMethod;
            method.RequestContentType = requestContentType;

            method.DefaultResponse = defaultResponse;

            if (parameters != null)
            {
                foreach (ParameterTS parameter in parameters)
                {
                    method.Add(parameter);
                }
            }

            method.DeprecationMessage = deprecatedMessage;

            return(method);
        }
 public static void ConstructParameterMapper(TSObject obj, ParameterTS parameter)
 {
     MethodTS.GenerateRequestParameter(obj, parameter, parameter.MethodTS.GetParameterTransformations());
 }