Beispiel #1
0
        public string GenerateSendOperationRequest()
        {
            TSBuilder builder = new TSBuilder();

            builder.Text("const operationArguments: msRest.OperationArguments = ");
            builder.FunctionCall("msRest.createOperationArguments", GenerateOperationArguments);
            builder.Line(";");
            builder.FunctionCall("operationRes = await client.sendOperationRequest", argumentList =>
            {
                argumentList.Text("httpRequest");
                argumentList.Text("operationArguments");
                argumentList.Object(GenerateOperationSpec);
            });
            return(builder.ToString());
        }
        public static string CreateSerializerExpression(this CodeModelTS codeModel)
        {
            TSBuilder builder = new TSBuilder();

            builder.FunctionCall("new msRest.Serializer", arguments =>
            {
                bool hasMappers = codeModel.HasMappers();
                if (hasMappers)
                {
                    arguments.Text("Mappers");
                }

                if (codeModel.ShouldGenerateXmlSerialization == true)
                {
                    if (!hasMappers)
                    {
                        arguments.Object();
                    }

                    arguments.Boolean(true);
                }
            });
            return(builder.ToString());
        }