public GroupTransform(IHostEnvironment env, Arguments args, IDataView input) : base(env, RegistrationName, input) { Host.CheckValue(args, nameof(args)); Host.CheckUserArg(Utils.Size(args.GroupKey) > 0, nameof(args.GroupKey), "There must be at least one group key"); _groupSchema = new GroupSchema(Host, Source.Schema, args.GroupKey, args.Column ?? new string[0]); }
private GroupTransform(IHost host, ModelLoadContext ctx, IDataView input) : base(host, input) { Host.AssertValue(ctx); // *** Binary format *** // (schema) _groupSchema = new GroupSchema(input.Schema, host, ctx); }
public async Task TestGroupSchemaEndpoint() { string json = Helpers.ReadExternalJsonFile("GroupEndpoints", "GroupSchema.json"); IKudosApi kudos = new KudosApi(null, Helpers.PrepareHttpClient(json)); GroupSchema schema = await kudos.GetGroupSchemaAsync(); Assert.IsNotNull(schema); }
private static async Task GroupEndpoint(IKudosApi kudos) { GroupSchema schema = await kudos.GetGroupSchemaAsync(); Groups groups = await kudos.GetGroupsAsync(); foreach (Group group in groups.Resources) { Console.WriteLine(group.DisplayName); } }
public void GroupSchemaCanAcceptOnlyCertainNodeType(Type nodeType, int expectedCount) { var schema = new GroupSchema("X", Activator.CreateInstance(nodeType) as NodeSchema); Assert.AreEqual(expectedCount, schema.Count); }
public async Task <ActionResult <GroupSchema> > UpdateGroupAsync([FromRoute] int id, [FromBody] GroupSchema body) { try { var result = await this.SecurityService.EditGroupAsync(id, body, User.Identity.Name); return(Ok(result)); } catch (System.Exception ex) { if (ex.Message == "not-found") { return(NotFound()); } throw; } }