Generating a theme can easily be done. But, when you're ever in a position that it doesn't work anymore. You can activate the generation by executing the following code:
var themeId = 32146; var arguments = JObject.Parse("{entity_id: "+themeId+" }"); await mClient.Commands.ExecuteCommandAsync("m.portal.theme", "generate.theme", arguments);
The only thing that you need to do is change the themeId to your id and run the command.
How do you need which themes are in Content Hub? You should be able to query them with the following code:
var query = new Query { Filter = new CompositeQueryFilter { CombineMethod = CompositeFilterOperator.And, Children = new List<QueryFilter> { new DefinitionQueryFilter { Name = "M.Portal.Theme" } } } }; var index = 0; const int take = 50; bool continueLoop; query.Take = take; var themeEntities = new List<IEntity>(); do { query.Skip = index * take; var result = await mClient.Querying.QueryAsync(query, EntityLoadConfiguration.Full); index++; themeEntities.AddRange(result.Items); continueLoop = index * take < result.TotalNumberOfResults; } while (continueLoop); foreach (var entity in themeEntities) { Console.WriteLine($"Theme id: {entity.Id} - {entity.GetPropertyValue<string>("ThemeName")}"); }
The output should look something like this:
Until next time!