View Source
  
  An API controller used for dealing with content types
 
  
  
    Inheritance
      System.Object
      Microsoft.AspNetCore.Mvc.ControllerBase
      
      
      
      
      
      
      
   
  
  Assembly: Umbraco.Web.BackOffice.dll
  
  
    public class MediaTypeController : ContentTypeControllerBase<IMediaType>
   
  Constructors
  
  
    View Source
  
  MediaTypeController(ICultureDictionary, EditorValidatorCollection, IContentTypeService, IMediaTypeService, IMemberTypeService, IUmbracoMapper, ILocalizedTextService, IShortStringHelper, IEntityService, IMediaService, IBackOfficeSecurityAccessor)
  
  
  Declaration
  
    public MediaTypeController(ICultureDictionary cultureDictionary, EditorValidatorCollection editorValidatorCollection, IContentTypeService contentTypeService, IMediaTypeService mediaTypeService, IMemberTypeService memberTypeService, IUmbracoMapper umbracoMapper, ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper, IEntityService entityService, IMediaService mediaService, IBackOfficeSecurityAccessor backofficeSecurityAccessor)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | ICultureDictionary | 
        cultureDictionary | 
         | 
      
      
        | EditorValidatorCollection | 
        editorValidatorCollection | 
         | 
      
      
        | IContentTypeService | 
        contentTypeService | 
         | 
      
      
        | IMediaTypeService | 
        mediaTypeService | 
         | 
      
      
        | IMemberTypeService | 
        memberTypeService | 
         | 
      
      
        | IUmbracoMapper | 
        umbracoMapper | 
         | 
      
      
        | ILocalizedTextService | 
        localizedTextService | 
         | 
      
      
        | IShortStringHelper | 
        shortStringHelper | 
         | 
      
      
        | IEntityService | 
        entityService | 
         | 
      
      
        | IMediaService | 
        mediaService | 
         | 
      
      
        | IBackOfficeSecurityAccessor | 
        backofficeSecurityAccessor | 
         | 
      
    
  
  Methods
  
  
    View Source
  
  
  Deletes a media type with a given ID
 
  
  Declaration
  
    [HttpDelete]
[HttpPost]
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult DeleteById(int id)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Int32 | 
        id | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Microsoft.AspNetCore.Mvc.IActionResult | 
         | 
      
    
  
  
    View Source
  
  
  Deletes a media type container with a given ID
 
  
  Declaration
  
    [HttpDelete]
[HttpPost]
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult DeleteContainer(int id)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Int32 | 
        id | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Microsoft.AspNetCore.Mvc.IActionResult | 
         | 
      
    
  
  
    View Source
  
  
  
  
  Declaration
  
    [Authorize(Policy = "TreeAccessMediaTypes")]
public IEnumerable<ContentTypeBasic> GetAll()
   
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | IEnumerable<ContentTypeBasic> | 
         | 
      
    
  
  
    View Source
  
  
  Returns a media type by alias
 
  
  Declaration
  
    public IEnumerable<MediaTypeDisplay> GetAllFiltered([FromQuery] string[] aliases)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String[] | 
        aliases | 
        Alias of the media type 
 | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | IEnumerable<MediaTypeDisplay> | 
         | 
      
    
  
  
    View Source
  
  
  Returns the allowed child content type objects for the content item id passed in - based on a GUID id
 
  
  Declaration
  
    [Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
public ActionResult<IEnumerable<ContentTypeBasic>> GetAllowedChildren(Guid contentId)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Guid | 
        contentId | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Microsoft.AspNetCore.Mvc.ActionResult<IEnumerable<ContentTypeBasic>> | 
         | 
      
    
  
  
    View Source
  
  
  Returns the allowed child content type objects for the content item id passed in - based on an INT id
 
  
  Declaration
  
    [Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
public IEnumerable<ContentTypeBasic> GetAllowedChildren(int contentId)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Int32 | 
        contentId | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | IEnumerable<ContentTypeBasic> | 
         | 
      
    
  
  
    View Source
  
  
  Returns the allowed child content type objects for the content item id passed in - based on a UDI id
 
  
  Declaration
  
    [Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
public ActionResult<IEnumerable<ContentTypeBasic>> GetAllowedChildren(Udi contentId)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Udi | 
        contentId | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Microsoft.AspNetCore.Mvc.ActionResult<IEnumerable<ContentTypeBasic>> | 
         | 
      
    
  
  
    View Source
  
  
  Returns the available compositions for this content type
This has been wrapped in a dto instead of simple parameters to support having multiple parameters in post request
body
 
  
  Declaration
  
    [HttpPost]
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult GetAvailableCompositeMediaTypes(GetAvailableCompositionsFilter filter)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | GetAvailableCompositionsFilter | 
        filter | 
        Filter applied when resolving compositions 
 | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Microsoft.AspNetCore.Mvc.IActionResult | 
         | 
      
    
  
  
    View Source
  
  
  Gets the media type a given guid
 
  
  Declaration
  
    [Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
public ActionResult<MediaTypeDisplay?> GetById(Guid id)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Guid | 
        id | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<MediaTypeDisplay>> | 
         | 
      
    
  
  
    View Source
  
  
  Gets the media type a given id
 
  
  Declaration
  
    [Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
public ActionResult<MediaTypeDisplay?> GetById(int id)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Int32 | 
        id | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<MediaTypeDisplay>> | 
         | 
      
    
  
  
    View Source
  
  
  Gets the media type a given udi
 
  
  Declaration
  
    [Authorize(Policy = "TreeAccessMediaOrMediaTypes")]
public ActionResult<MediaTypeDisplay?> GetById(Udi id)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | Udi | 
        id | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<MediaTypeDisplay>> | 
         | 
      
    
  
  
    View Source
  
  
  
  
  Declaration
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Int32 | 
         | 
      
    
  
  
    View Source
  
  
  
  
  Declaration
  
    [Authorize(Policy = "TreeAccessMediaTypes")]
public MediaTypeDisplay? GetEmpty(int parentId)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Int32 | 
        parentId | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Nullable<MediaTypeDisplay> | 
         | 
      
    
  
  
    View Source
  
  GetWhereCompositionIsUsedInContentTypes(GetAvailableCompositionsFilter)
  Returns where a particular composition has been used
This has been wrapped in a dto instead of simple parameters to support having multiple parameters in post request
body
 
  
  Declaration
  
    [HttpPost]
[Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult GetWhereCompositionIsUsedInContentTypes(GetAvailableCompositionsFilter filter)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | GetAvailableCompositionsFilter | 
        filter | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Microsoft.AspNetCore.Mvc.IActionResult | 
         | 
      
    
  
  
    View Source
  
  PostCopy(MoveOrCopy)
  
  
  Declaration
  
    [Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult PostCopy(MoveOrCopy copy)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | MoveOrCopy | 
        copy | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Microsoft.AspNetCore.Mvc.IActionResult | 
         | 
      
    
  
  
    View Source
  
  PostCreateContainer(Int32, String)
  
  
  Declaration
  
    [Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult PostCreateContainer(int parentId, string name)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Int32 | 
        parentId | 
         | 
      
      
        | System.String | 
        name | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Microsoft.AspNetCore.Mvc.IActionResult | 
         | 
      
    
  
  
    View Source
  
  PostMove(MoveOrCopy)
  
  
  Declaration
  
    [Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult PostMove(MoveOrCopy move)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | MoveOrCopy | 
        move | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Microsoft.AspNetCore.Mvc.IActionResult | 
         | 
      
    
  
  
    View Source
  
  PostRenameContainer(Int32, String)
  
  
  Declaration
  
    [Authorize(Policy = "TreeAccessMediaTypes")]
public IActionResult PostRenameContainer(int id, string name)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.Int32 | 
        id | 
         | 
      
      
        | System.String | 
        name | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Microsoft.AspNetCore.Mvc.IActionResult | 
         | 
      
    
  
  
    View Source
  
  PostSave(MediaTypeSave)
  
  
  Declaration
  
    [Authorize(Policy = "TreeAccessMediaTypes")]
public ActionResult<MediaTypeDisplay?> PostSave(MediaTypeSave contentTypeSave)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | MediaTypeSave | 
        contentTypeSave | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | Microsoft.AspNetCore.Mvc.ActionResult<System.Nullable<MediaTypeDisplay>> | 
         |