using System.Collections.Immutable; using Connected.Annotations; using Connected.Notifications; using Connected.ServiceModel; namespace Connected.Globalization.Languages; [Service] [ServiceUrl(GlobalizationRoutes.Languages)] public interface ILanguageService : IServiceNotifications { /// /// Returns all valid languages from the environment. /// /// A list of available languages. [ServiceMethod(ServiceMethodVerbs.Get)] Task> Query(); /// /// Performs a query on entities for the specified list of ids. /// /// The List of the ids for which the perform query. /// An of entities that matches /// the passed ids. [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)] Task?> Query(PrimaryKeyListArgs e); /// /// Selects a language by its id. /// /// containing the language id for which an entity should be returned. /// entity if found, null otherwise. [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)] Task Select(PrimaryKeyArgs args); /// /// Selects a language by its name. /// /// containing a language name for which an entity should be returned. /// entity if found, null otherwise. [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)] Task Select(NameArgs args); /// /// Resolves a language by mapping criteria. /// /// containing mapping criteria. /// /// Mapping criteria is split into tokens, separated by ',' character. Each string (mapping) is then searched in the /// property of each supported and language. /// /// The first that has at least one mapping, null if no language meets /// the criteria. [ServiceMethod(ServiceMethodVerbs.Get | ServiceMethodVerbs.Post)] Task Resolve(LanguageResolveArgs args); /// /// Inserts a new language. /// /// arguments containing data about a new language. /// An of the newly added language. [ServiceMethod(ServiceMethodVerbs.Post)] Task Insert(LanguageInsertArgs args); /// /// Updates existing language. /// /// arguments with modified values. [ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Patch)] Task Update(LanguageUpdateArgs args); /// /// Deletes language from the environment. /// /// containing an id of the language to be deleted. [ServiceMethod(ServiceMethodVerbs.Post | ServiceMethodVerbs.Delete)] Task Delete(PrimaryKeyArgs args); }