示例#1
0
        public override string GenerateMapperIndex()
        {
            TSBuilder builder = new TSBuilder();

            builder.Comment(AutoRest.Core.Settings.Instance.Header);
            builder.Line();

            CompositeTypeTS[] orderedMapperTemplateModels = OrderedMapperTemplateModels.ToArray();

            builder.Import(new[] { "CloudErrorMapper", "BaseResourceMapper" }, "@azure/ms-rest-azure-js");

            ImportMsRestForMappers(builder, orderedMapperTemplateModels);

            builder.Line();

            builder.ExportConst("CloudError", "CloudErrorMapper");
            builder.ExportConst("BaseResource", "BaseResourceMapper");

            ExportOrderedMapperModels(builder, orderedMapperTemplateModels);

            foreach (PageCompositeTypeTSa pageModel in PageTemplateModels)
            {
                builder.Line();
                pageModel.ConstructModelMapper(builder);
            }

            ExportPolymorphicDictionary(builder);

            return(builder.ToString());
        }