Ejemplo n.º 1
0
        public override JObject GetJObject()
        {
            JObject jo = new JObject();

            jo.Add("name", Name);
            jo.Add("description", Description);
            jo.AddObject("commands", Commands);
            jo.AddObject("events", Events);
            jo.AddObject("types", Types);
            jo.AddObject("topLevelObjects", TopLevelObjects);
            return(jo);
        }
Ejemplo n.º 2
0
        public override JObject GetJObject()
        {
            JObject jo = new JObject();


            if (MinimumBuild > 0)
            {
                jo.Add("minimumBuild", MinimumBuild);
            }

            if (!string.IsNullOrEmpty(Description))
            {
                jo.Add("description", Description);
            }

            if (Parameters != null && Parameters.Count > 0)
            {
                jo.Add("parameters", Parameters);
            }

            if (Examples != null)
            {
                jo.AddObject("examples", Examples);
            }
            return(jo);
        }
Ejemplo n.º 3
0
        public override JObject GetJObject()
        {
            JObject jo = new JObject();

            if (!string.IsNullOrEmpty(Constant))
            {
                jo.Add("constant", Constant);
            }

            if (!string.IsNullOrEmpty(Member))
            {
                jo.Add("member", Member);
            }

            if (!string.IsNullOrEmpty(Description))
            {
                jo.Add("description", Description);
            }

            if (Examples != null)
            {
                jo.AddObject("examples", Examples);
            }

            return(jo);
        }
Ejemplo n.º 4
0
        private JObject GetIndexTemplate()
        {
            var request = new JObject
            {
                { "template", IndexName }
            };

            var templates = request.AddObject("mappings").AddObject(TypeName).AddArray("dynamic_templates");

            var jobIdMapping = new JObject {
                { "match", "jobId" },
                { "match_mapping_type", "string" }
            };

            jobIdMapping.AddObject("mapping").Add("type", "keyword");

            var mapJobId = new JObject {
                { "mapJobId", jobIdMapping }
            };

            var runIdMapping = new JObject {
                { "match", "runId" },
                { "match_mapping_type", "string" }
            };

            runIdMapping.AddObject("mapping").Add("type", "keyword");

            var mapRunId = new JObject {
                { "mapRunId", runIdMapping }
            };

            var messageIdMapping = new JObject
            {
                { "path_match", "message.id" },
                { "match_mapping_type", "string" }
            };

            messageIdMapping.AddObject("mapping").Add("type", "keyword");

            var mapMessageId = new JObject {
                { "mapMessageId", messageIdMapping }
            };

            templates.Add(mapJobId);
            templates.Add(mapMessageId);
            templates.Add(mapRunId);

            return(request);
        }
Ejemplo n.º 5
0
        public override JObject GetJObject()
        {
            JObject jo = new JObject();

            jo.Add("name", Name);

            if (!string.IsNullOrEmpty(Description))
            {
                jo.Add("description", Description);
            }

            if (!string.IsNullOrEmpty(VariableType))
            {
                jo.Add("variableType", VariableType);
            }

            if (!string.IsNullOrEmpty(BaseType))
            {
                jo.Add("baseType", BaseType);
            }

            if (UsesSubType)
            {
                jo.Add("usesSubType", UsesSubType);
            }

            if (Members != null && Members.Count > 0)
            {
                jo.AddObject("members", Members);
            }

            if (Methods != null && Methods.Count > 0)
            {
                jo.AddObject("methods", Methods);
            }

            if (Index != null)
            {
                jo.Add("index", Index);
            }

            if (Initializer != null)
            {
                jo.Add("initializer", Initializer);
            }

            if (!Persistent)
            {
                jo.Add("persistent", Persistent);
            }

            if (Restricted)
            {
                jo.Add("restricted", Restricted);
            }

            if (MinimumBuild > 0)
            {
                jo.Add("minimumBuild", MinimumBuild);
            }

            if (!string.IsNullOrEmpty(Category))
            {
                jo.Add("category", Category);
            }

            if (AsString != null)
            {
                jo.Add("asString", AsString);
            }

            return(jo);
        }