Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public AllCultureController(IUmbracoMapper umbracoMapper, ICultureService cultur
[HttpGet]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<CultureReponseModel>), StatusCodes.Status200OK)]
[EndpointSummary("Gets a paginated collection of cultures available for creating languages.")]
[EndpointDescription("Gets a paginated collection containing the English and localized names of all available cultures.")]
public Task<PagedViewModel<CultureReponseModel>> GetAll(CancellationToken cancellationToken, int skip = 0, int take = 100)
{
CultureInfo[] all = _cultureService.GetValidCultureInfos();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public ByKeyDataTypeController(IDataTypeService dataTypeService, IUmbracoMapper
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(DataTypeResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[EndpointSummary("Gets a datatype.")]
[EndpointDescription("Gets a datatype identified by the provided Id.")]
public async Task<IActionResult> ByKey(CancellationToken cancellationToken, Guid id)
{
IDataType? dataType = await _dataTypeService.GetAsync(id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public class ConfigurationDataTypeController : DataTypeControllerBase
[HttpGet("configuration")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(DatatypeConfigurationResponseModel), StatusCodes.Status200OK)]
[EndpointSummary("Gets the datatype configuration.")]
[EndpointDescription("Gets the configuration settings for datatypes.")]
public Task<IActionResult> Configuration(CancellationToken cancellationToken)
{
var responseModel = new DatatypeConfigurationResponseModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public CopyDataTypeController(IDataTypeService dataTypeService, IBackOfficeSecur
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status201Created)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[EndpointSummary("Copies a datatype.")]
[EndpointDescription("Creates a duplicate of an existing datatype identified by the provided Id.")]
public async Task<IActionResult> Copy(CancellationToken cancellationToken, Guid id, CopyDataTypeRequestModel copyDataTypeRequestModel)
{
IDataType? source = await _dataTypeService.GetAsync(id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public CreateDataTypeController(IDataTypeService dataTypeService, IDataTypePrese
[ProducesResponseType(StatusCodes.Status201Created)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[EndpointSummary("Creates a new data type.")]
[EndpointDescription("Creates a new data type with the configuration specified in the request model.")]
public async Task<IActionResult> Create(CancellationToken cancellationToken, CreateDataTypeRequestModel createDataTypeRequestModel)
{
var attempt = await _dataTypePresentationFactory.CreateAsync(createDataTypeRequestModel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public DeleteDataTypeController(IDataTypeService dataTypeService, IBackOfficeSec
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[EndpointSummary("Deletes a datatype.")]
[EndpointDescription("Deletes a datatype identified by the provided Id.")]
public async Task<IActionResult> Delete(CancellationToken cancellationToken, Guid id)
{
Attempt<IDataType?, DataTypeOperationStatus> result = await _dataTypeService.DeleteAsync(id, CurrentUserKey(_backOfficeSecurityAccessor));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public FilterDataTypeFilterController(IDataTypeService dataTypeService, IUmbraco
[HttpGet]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<DataTypeItemResponseModel>), StatusCodes.Status200OK)]
[EndpointSummary("Gets a filtered collection of data types.")]
[EndpointDescription("Filters data types based on the provided criteria with support for pagination.")]
public async Task<IActionResult> Filter(
CancellationToken cancellationToken,
int skip = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ public ByKeyDataTypeFolderController(
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(FolderResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[EndpointSummary("Gets a datatype folder.")]
[EndpointDescription("Gets a datatype folder identified by the provided Id.")]
public async Task<IActionResult> ByKey(CancellationToken cancellationToken, Guid id) => await GetFolderAsync(id);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public CreateDataTypeFolderController(
[ProducesResponseType(StatusCodes.Status201Created)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[EndpointSummary("Creates a data type folder.")]
[EndpointDescription("Creates a new data type folder with the provided name and parent location.")]
public async Task<IActionResult> Create(CancellationToken cancellationToken, CreateFolderRequestModel createFolderRequestModel)
=> await CreateFolderAsync<ByKeyDataTypeFolderController>(
createFolderRequestModel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ public DeleteDataTypeFolderController(
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[EndpointSummary("Deletes a datatype folder.")]
[EndpointDescription("Deletes a datatype folder identified by the provided Id.")]
public async Task<IActionResult> Delete(CancellationToken cancellationToken, Guid id) => await DeleteFolderAsync(id);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public UpdateDataTypeFolderController(
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[EndpointSummary("Updates a datatype folder.")]
[EndpointDescription("Updates a datatype folder identified by the provided Id with the details from the request model.")]
public async Task<IActionResult> Update(
CancellationToken cancellationToken,
Guid id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public IsUsedDataTypeController(IDataTypeUsageService dataTypeUsageService)
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(bool), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[EndpointSummary("Checks if a datatype is used.")]
[EndpointDescription("Checks if the datatype identified by the provided Id is used in any content, media, or members.")]
public async Task<IActionResult> IsUsed(CancellationToken cancellationToken, Guid id)
{
Attempt<bool, DataTypeOperationStatus> result = await _dataTypeUsageService.HasSavedValuesAsync(id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public ItemDatatypeItemController(IDataTypeService dataTypeService, IUmbracoMapp
[HttpGet]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<DataTypeItemResponseModel>), StatusCodes.Status200OK)]
[EndpointSummary("Gets a collection of data type items.")]
[EndpointDescription("Gets a collection of data type items identified by the provided Ids.")]
public async Task<IActionResult> Item(
CancellationToken cancellationToken,
[FromQuery(Name = "id")] HashSet<Guid> ids)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public SearchDataTypeItemController(IEntitySearchService entitySearchService, ID
[HttpGet("search")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedModel<DataTypeItemResponseModel>), StatusCodes.Status200OK)]
[EndpointSummary("Searches datatype items.")]
[EndpointDescription("Searches datatype items by the provided query with pagination support.")]
public async Task<IActionResult> Search(CancellationToken cancellationToken, string query, int skip = 0, int take = 100)
{
PagedModel<IEntitySlim> searchResult = _entitySearchService.Search(UmbracoObjectTypes.DataType, query, skip, take);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public MoveDataTypeController(IDataTypeService dataTypeService, IBackOfficeSecur
[MapToApiVersion("1.0")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[EndpointSummary("Moves a datatype.")]
[EndpointDescription("Moves a datatype identified by the provided Id to a different location.")]
public async Task<IActionResult> Move(CancellationToken cancellationToken, Guid id, MoveDataTypeRequestModel moveDataTypeRequestModel)
{
IDataType? source = await _dataTypeService.GetAsync(id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public ReferencedByDataTypeController(IDataTypeService dataTypeService, IRelatio
[HttpGet("{id:guid}/referenced-by")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<IReferenceResponseModel>), StatusCodes.Status200OK)]
[EndpointSummary("Gets a collection of items that reference datatypes.")]
[EndpointDescription("Gets a paginated collection of items that reference the datatypes identified by the provided Ids.")]
public async Task<ActionResult<PagedViewModel<IReferenceResponseModel>>> ReferencedBy(
CancellationToken cancellationToken,
Guid id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public AncestorsDataTypeTreeController(IEntityService entityService, FlagProvide
[HttpGet("ancestors")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<DataTypeTreeItemResponseModel>), StatusCodes.Status200OK)]
[EndpointSummary("Gets a collection of ancestor datatype items.")]
[EndpointDescription("Gets a collection of datatype items that are ancestors to the provided Id.")]
public async Task<ActionResult<IEnumerable<DataTypeTreeItemResponseModel>>> Ancestors(CancellationToken cancellationToken, Guid descendantId)
=> await GetAncestors(descendantId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public ChildrenDataTypeTreeController(IEntityService entityService, FlagProvider
[HttpGet("children")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<DataTypeTreeItemResponseModel>), StatusCodes.Status200OK)]
[EndpointSummary("Gets a collection of datatype tree child items.")]
[EndpointDescription("Gets a paginated collection of datatype tree items that are children of the provided parent Id.")]
public async Task<ActionResult<PagedViewModel<DataTypeTreeItemResponseModel>>> Children(CancellationToken cancellationToken, Guid parentId, int skip = 0, int take = 100, bool foldersOnly = false)
{
RenderFoldersOnly(foldersOnly);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public RootDataTypeTreeController(IEntityService entityService, FlagProviderColl
[HttpGet("root")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<DataTypeTreeItemResponseModel>), StatusCodes.Status200OK)]
[EndpointSummary("Gets a collection of datatype items from the root of the tree.")]
[EndpointDescription("Gets a paginated collection of datatype items from the root of the tree with optional filtering.")]
public async Task<ActionResult<PagedViewModel<DataTypeTreeItemResponseModel>>> Root(CancellationToken cancellationToken, int skip = 0, int take = 100, bool foldersOnly = false)
{
RenderFoldersOnly(foldersOnly);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public SiblingsDataTypeTreeController(IEntityService entityService, FlagProvider

[HttpGet("siblings")]
[ProducesResponseType(typeof(SubsetViewModel<DataTypeTreeItemResponseModel>), StatusCodes.Status200OK)]
[EndpointSummary("Gets a collection of datatype tree sibling items.")]
[EndpointDescription("Gets a collection of datatype tree items that are siblings of the provided Id.")]
public async Task<ActionResult<SubsetViewModel<DataTypeTreeItemResponseModel>>> Siblings(CancellationToken cancellationToken, Guid target, int before, int after, bool foldersOnly = false)
{
RenderFoldersOnly(foldersOnly);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public UpdateDataTypeController(IDataTypeService dataTypeService, IBackOfficeSec
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[EndpointSummary("Updates a datatype.")]
[EndpointDescription("Updates a datatype identified by the provided Id with the details from the request model.")]
public async Task<IActionResult> Update(CancellationToken cancellationToken, Guid id, UpdateDataTypeRequestModel updateDataTypeViewModel)
{
IDataType? current = await _dataTypeService.GetAsync(id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public AllDictionaryController(IDictionaryItemService dictionaryItemService, IUm
[HttpGet]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<DictionaryOverviewResponseModel>), StatusCodes.Status200OK)]
[EndpointSummary("Gets a paginated collection of dictionary items.")]
[EndpointDescription("Gets a paginated collection of dictionary items with optional filtering by name.")]
public async Task<ActionResult<PagedViewModel<DictionaryOverviewResponseModel>>> All(
CancellationToken cancellationToken,
string? filter = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public ByKeyDictionaryController(IDictionaryItemService dictionaryItemService, I
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(DictionaryItemResponseModel), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[EndpointSummary("Gets a dictionary.")]
[EndpointDescription("Gets a dictionary identified by the provided Id.")]
public async Task<IActionResult> ByKey(CancellationToken cancellationToken, Guid id)
{
IDictionaryItem? dictionary = await _dictionaryItemService.GetAsync(id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public CreateDictionaryController(
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status409Conflict)]
[EndpointSummary("Creates a new dictionary.")]
[EndpointDescription("Creates a new dictionary with the configuration specified in the request model.")]
public async Task<IActionResult> Create(
CancellationToken cancellationToken,
CreateDictionaryItemRequestModel createDictionaryItemRequestModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public DeleteDictionaryController(IDictionaryItemService dictionaryItemService,
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[EndpointSummary("Deletes a dictionary.")]
[EndpointDescription("Deletes a dictionary identified by the provided Id.")]
public async Task<IActionResult> Delete(CancellationToken cancellationToken, Guid id)
{
Attempt<IDictionaryItem?, DictionaryItemOperationStatus> result = await _dictionaryItemService.DeleteAsync(id, CurrentUserKey(_backOfficeSecurityAccessor));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public ExportDictionaryController(IDictionaryItemService dictionaryItemService,
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(FileContentResult), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[EndpointSummary("Exports a dictionary.")]
[EndpointDescription("Exports the dictionary identified by the provided Id to a downloadable format.")]
public async Task<IActionResult> Export(CancellationToken cancellationToken, Guid id, bool includeChildren = false)
{
IDictionaryItem? dictionaryItem = await _dictionaryItemService.GetAsync(id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public ImportDictionaryController(
[ProducesResponseType(StatusCodes.Status201Created)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[EndpointSummary("Imports a dictionary.")]
[EndpointDescription("Imports a dictionary from the provided file upload.")]
public async Task<IActionResult> Import(
CancellationToken cancellationToken,
ImportDictionaryRequestModel importDictionaryRequestModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public ItemDictionaryItemController(IDictionaryItemService dictionaryItemService
[HttpGet]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<DictionaryItemItemResponseModel>), StatusCodes.Status200OK)]
[EndpointSummary("Gets a collection of dictionary items.")]
[EndpointDescription("Gets a collection of dictionary items identified by the provided Ids.")]
public async Task<IActionResult> Item(
CancellationToken cancellationToken,
[FromQuery(Name = "id")] HashSet<Guid> ids)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public MoveDictionaryController(IDictionaryItemService dictionaryItemService, IB
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
[EndpointSummary("Moves a dictionary.")]
[EndpointDescription("Moves a dictionary identified by the provided Id to a different location.")]
public async Task<IActionResult> Move(
CancellationToken cancellationToken,
Guid id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ public AncestorsDictionaryTreeController(IEntityService entityService, FlagProvi
[HttpGet("ancestors")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(IEnumerable<NamedEntityTreeItemResponseModel>), StatusCodes.Status200OK)]
[EndpointSummary("Gets a collection of ancestor dictionary items.")]
[EndpointDescription("Gets a collection of dictionary items that are ancestors to the provided Id.")]
public async Task<ActionResult<IEnumerable<NamedEntityTreeItemResponseModel>>> Ancestors(CancellationToken cancellationToken, Guid descendantId)
=> await GetAncestors(descendantId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public ChildrenDictionaryTreeController(IEntityService entityService, FlagProvid
[HttpGet("children")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<NamedEntityTreeItemResponseModel>), StatusCodes.Status200OK)]
[EndpointSummary("Gets a collection of dictionary tree child items.")]
[EndpointDescription("Gets a paginated collection of dictionary tree items that are children of the provided parent Id.")]
public async Task<ActionResult<PagedViewModel<NamedEntityTreeItemResponseModel>>> Children(CancellationToken cancellationToken, Guid parentId, int skip = 0, int take = 100)
{
PagedModel<IDictionaryItem> paginatedItems = await DictionaryItemService.GetPagedAsync(parentId, skip, take);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public RootDictionaryTreeController(IEntityService entityService, FlagProviderCo
[HttpGet("root")]
[MapToApiVersion("1.0")]
[ProducesResponseType(typeof(PagedViewModel<NamedEntityTreeItemResponseModel>), StatusCodes.Status200OK)]
[EndpointSummary("Gets a collection of dictionary items from the root of the tree.")]
[EndpointDescription("Gets a paginated collection of dictionary items from the root of the tree with optional filtering.")]
public async Task<ActionResult<PagedViewModel<NamedEntityTreeItemResponseModel>>> Root(CancellationToken cancellationToken, int skip = 0, int take = 100)
{
PagedModel<IDictionaryItem> paginatedItems = await DictionaryItemService.GetPagedAsync(null, skip, take);
Expand Down
Loading