# Root resource


ezpublish_rest_loadRootResource:
    path: /
    defaults:
        _controller: ezpublish_rest.controller.root:loadRootResource
    methods: [GET]


# Sections


ezpublish_rest_listSections:
    path: /content/sections
    defaults:
        _controller: ezpublish_rest.controller.section:listSections
    methods: [GET]

ezpublish_rest_createSection:
    path: /content/sections
    defaults:
        _controller: ezpublish_rest.controller.section:createSection
    methods: [POST]

ezpublish_rest_loadSection:
    path: /content/sections/{sectionId}
    defaults:
        _controller: ezpublish_rest.controller.section:loadSection
    methods: [GET]
    requirements:
        sectionId: \d+

ezpublish_rest_updateSection:
    path: /content/sections/{sectionId}
    defaults:
        _controller: ezpublish_rest.controller.section:updateSection
    methods: [PATCH]
    requirements:
        sectionId: \d+

ezpublish_rest_deleteSection:
    path: /content/sections/{sectionId}
    defaults:
        _controller: ezpublish_rest.controller.section:deleteSection
    methods: [DELETE]
    requirements:
        sectionId: \d+


# Content


ezpublish_rest_redirectContent:
    path: /content/objects
    defaults:
        _controller: ezpublish_rest.controller.content:redirectContent
    methods: [GET]

ezpublish_rest_createContent:
    path: /content/objects
    defaults:
        _controller: ezpublish_rest.controller.content:createContent
    methods: [POST]

ezpublish_rest_updateContentMetadata:
    path: /content/objects/{contentId}
    defaults:
        _controller: ezpublish_rest.controller.content:updateContentMetadata
    methods: [PATCH]
    requirements:
        contentId: \d+

ezpublish_rest_loadContent:
    path: /content/objects/{contentId}
    defaults:
        _controller: ezpublish_rest.controller.content:loadContent
    methods: [GET]
    requirements:
        contentId: \d+

ezpublish_rest_deleteContent:
    path: /content/objects/{contentId}
    defaults:
        _controller: ezpublish_rest.controller.content:deleteContent
    methods: [DELETE]
    requirements:
        contentId: \d+

ezpublish_rest_copyContent:
    path: /content/objects/{contentId}
    defaults:
        _controller: ezpublish_rest.controller.content:copyContent
    methods: [COPY]
    requirements:
        contentId: \d+

ezpublish_rest_redirectCurrentVersionRelations:
    path: /content/objects/{contentId}/relations
    defaults:
        _controller: ezpublish_rest.controller.content:redirectCurrentVersionRelations
    methods: [GET]
    requirements:
        contentId: \d+

ezpublish_rest_loadContentVersions:
    path: /content/objects/{contentId}/versions
    defaults:
        _controller: ezpublish_rest.controller.content:loadContentVersions
    methods: [GET]
    requirements:
        contentId: \d+

ezpublish_rest_loadVersionRelations:
    path: /content/objects/{contentId}/versions/{versionNumber}/relations
    defaults:
        _controller: ezpublish_rest.controller.content:loadVersionRelations
    methods: [GET]
    requirements:
        contentId: \d+
        versionNumber: \d+

ezpublish_rest_createRelation:
    path: /content/objects/{contentId}/versions/{versionNumber}/relations
    defaults:
        _controller: ezpublish_rest.controller.content:createRelation
    methods: [POST]
    requirements:
        contentId: \d+
        versionNumber: \d+

ezpublish_rest_loadVersionRelation:
    path: /content/objects/{contentId}/versions/{versionNumber}/relations/{relationId}
    defaults:
        _controller: ezpublish_rest.controller.content:loadVersionRelation
    methods: [GET]
    requirements:
        contentId: \d+
        versionNumber: \d+
        relationId: \d+

ezpublish_rest_removeRelation:
    path: /content/objects/{contentId}/versions/{versionNumber}/relations/{relationId}
    defaults:
        _controller: ezpublish_rest.controller.content:removeRelation
    methods: [DELETE]
    requirements:
        contentId: \d+
        versionNumber: \d+
        relationId: \d+

ezpublish_rest_loadContentInVersion:
    path: /content/objects/{contentId}/versions/{versionNumber}
    defaults:
        _controller: ezpublish_rest.controller.content:loadContentInVersion
    methods: [GET]
    requirements:
        contentId: \d+
        versionNumber: \d+

ezpublish_rest_updateVersion:
    path: /content/objects/{contentId}/versions/{versionNumber}
    defaults:
        _controller: ezpublish_rest.controller.content:updateVersion
    methods: [PATCH]
    requirements:
        contentId: \d+
        versionNumber: \d+

ezpublish_rest_deleteContentVersion:
    path: /content/objects/{contentId}/versions/{versionNumber}
    defaults:
        _controller: ezpublish_rest.controller.content:deleteContentVersion
    methods: [DELETE]
    requirements:
        contentId: \d+
        versionNumber: \d+

ezpublish_rest_createDraftFromVersion:
    path: /content/objects/{contentId}/versions/{versionNumber}
    defaults:
        _controller: ezpublish_rest.controller.content:createDraftFromVersion
    methods: [COPY]
    requirements:
        contentId: \d+
        versionNumber: \d+

ezpublish_rest_publishVersion:
    path: /content/objects/{contentId}/versions/{versionNumber}
    defaults:
        _controller: ezpublish_rest.controller.content:publishVersion
    methods: [PUBLISH]
    requirements:
        contentId: \d+
        versionNumber: \d+

ezpublish_rest_redirectCurrentVersion:
    path: /content/objects/{contentId}/currentversion
    defaults:
        _controller: ezpublish_rest.controller.content:redirectCurrentVersion
    methods: [GET]
    requirements:
        contentId: \d+

ezpublish_rest_createDraftFromCurrentVersion:
    path: /content/objects/{contentId}/currentversion
    defaults:
        _controller: ezpublish_rest.controller.content:createDraftFromCurrentVersion
    methods: [COPY]
    requirements:
        contentId: \d+

# Binary content

ezpublish_rest_binaryContent_getImageVariation:
    path: /content/binary/images/{imageId}/variations/{variationIdentifier}
    defaults:
        _controller: ezpublish_rest.controller.binary_content:getImageVariation
    methods: [GET]
    requirements:
        imageId: \d+-\d+


# Views


ezpublish_rest_createView:
    path: /content/views
    defaults:
        _controller: ezpublish_rest.controller.content:createView
    methods: [POST]

ezpublish_rest_listView:
    path: /content/views
    defaults:
        _controller: ezpublish_rest.controller.content:listView
    methods: [GET]

ezpublish_rest_getView:
    path : /content/views/{viewId}
    defaults:
        _controller: ezpublish_rest.controller.content:getView
    methods: [GET]

ezpublish_rest_loadViewResults:
    path: /content/views/{viewId}/results
    defaults:
        _controller: ezpublish_rest.controller.content:loadViewResults
    methods: [GET]

# Object states


ezpublish_rest_loadObjectStateGroups:
    path: /content/objectstategroups
    defaults:
        _controller: ezpublish_rest.controller.object_state:loadObjectStateGroups
    methods: [GET]

ezpublish_rest_createObjectStateGroup:
    path: /content/objectstategroups
    defaults:
        _controller: ezpublish_rest.controller.object_state:createObjectStateGroup
    methods: [POST]

ezpublish_rest_loadObjectStateGroup:
    path: /content/objectstategroups/{objectStateGroupId}
    defaults:
        _controller: ezpublish_rest.controller.object_state:loadObjectStateGroup
    methods: [GET]
    requirements:
        objectStateGroupId: \d+

ezpublish_rest_updateObjectStateGroup:
    path: /content/objectstategroups/{objectStateGroupId}
    defaults:
        _controller: ezpublish_rest.controller.object_state:updateObjectStateGroup
    methods: [PATCH]
    requirements:
        objectStateGroupId: \d+

ezpublish_rest_deleteObjectStateGroup:
    path: /content/objectstategroups/{objectStateGroupId}
    defaults:
        _controller: ezpublish_rest.controller.object_state:deleteObjectStateGroup
    methods: [DELETE]
    requirements:
        objectStateGroupId: \d+

ezpublish_rest_loadObjectStates:
    path: /content/objectstategroups/{objectStateGroupId}/objectstates
    defaults:
        _controller: ezpublish_rest.controller.object_state:loadObjectStates
    methods: [GET]
    requirements:
        objectStateGroupId: \d+

ezpublish_rest_createObjectState:
    path: /content/objectstategroups/{objectStateGroupId}/objectstates
    defaults:
        _controller: ezpublish_rest.controller.object_state:createObjectState
    methods: [POST]
    requirements:
        objectStateGroupId: \d+

ezpublish_rest_loadObjectState:
    path: /content/objectstategroups/{objectStateGroupId}/objectstates/{objectStateId}
    defaults:
        _controller: ezpublish_rest.controller.object_state:loadObjectState
    methods: [GET]
    requirements:
        objectStateGroupId: \d+
        objectStateId: \d+

ezpublish_rest_updateObjectState:
    path: /content/objectstategroups/{objectStateGroupId}/objectstates/{objectStateId}
    defaults:
        _controller: ezpublish_rest.controller.object_state:updateObjectState
    methods: [PATCH]
    requirements:
        objectStateGroupId: \d+
        objectStateId: \d+

ezpublish_rest_deleteObjectState:
    path: /content/objectstategroups/{objectStateGroupId}/objectstates/{objectStateId}
    defaults:
        _controller: ezpublish_rest.controller.object_state:deleteObjectState
    methods: [DELETE]
    requirements:
        objectStateGroupId: \d+
        objectStateId: \d+

ezpublish_rest_getObjectStatesForContent:
    path: /content/objects/{contentId}/objectstates
    defaults:
        _controller: ezpublish_rest.controller.object_state:getObjectStatesForContent
    methods: [GET]
    requirements:
        contentId: \d+

ezpublish_rest_setObjectStatesForContent:
    path: /content/objects/{contentId}/objectstates
    defaults:
        _controller: ezpublish_rest.controller.object_state:setObjectStatesForContent
    methods: [PATCH]
    requirements:
        contentId: \d+


# Locations


ezpublish_rest_redirectLocation:
    path: /content/locations
    defaults:
        _controller: ezpublish_rest.controller.location:redirectLocation
    methods: [GET]

ezpublish_rest_loadLocation:
    path: /content/locations/{locationPath}
    defaults:
        _controller: ezpublish_rest.controller.location:loadLocation
    methods: [GET]
    requirements:
        locationPath: "[0-9/]+"

ezpublish_rest_updateLocation:
    path: /content/locations/{locationPath}
    defaults:
        _controller: ezpublish_rest.controller.location:updateLocation
    methods: [PATCH]
    requirements:
        locationPath: "[0-9/]+"

ezpublish_rest_deleteSubtree:
    path: /content/locations/{locationPath}
    defaults:
        _controller: ezpublish_rest.controller.location:deleteSubtree
    methods: [DELETE]
    requirements:
        locationPath: "[0-9/]+"

ezpublish_rest_copySubtree:
    path: /content/locations/{locationPath}
    defaults:
        _controller: ezpublish_rest.controller.location:copySubtree
    methods: [COPY]
    requirements:
        locationPath: "[0-9/]+"

ezpublish_rest_moveSubtree:
    path: /content/locations/{locationPath}
    defaults:
        _controller: ezpublish_rest.controller.location:moveSubtree
    methods: [MOVE]
    requirements:
        locationPath: "[0-9/]+"

ezpublish_rest_swapLocation:
    path: /content/locations/{locationPath}
    defaults:
        _controller: ezpublish_rest.controller.location:swapLocation
    methods: [SWAP]
    requirements:
        locationPath: "[0-9/]+"

ezpublish_rest_loadLocationChildren:
    path: /content/locations/{locationPath}/children
    defaults:
        _controller: ezpublish_rest.controller.location:loadLocationChildren
    methods: [GET]
    requirements:
        locationPath: "[0-9/]+"

ezpublish_rest_loadLocationsForContent:
    path: /content/objects/{contentId}/locations
    defaults:
        _controller: ezpublish_rest.controller.location:loadLocationsForContent
    methods: [GET]
    requirements:
        contentId: \d+

ezpublish_rest_createLocation:
    path: /content/objects/{contentId}/locations
    defaults:
        _controller: ezpublish_rest.controller.location:createLocation
    methods: [POST]
    requirements:
        contentId: \d+


# Content types


ezpublish_rest_loadContentTypeGroupList:
    path: /content/typegroups
    defaults:
        _controller: ezpublish_rest.controller.content_type:loadContentTypeGroupList
    methods: [GET]

ezpublish_rest_createContentTypeGroup:
    path: /content/typegroups
    defaults:
        _controller: ezpublish_rest.controller.content_type:createContentTypeGroup
    methods: [POST]

ezpublish_rest_loadContentTypeGroup:
    path: /content/typegroups/{contentTypeGroupId}
    defaults:
        _controller: ezpublish_rest.controller.content_type:loadContentTypeGroup
    methods: [GET]
    requirements:
        contentTypeGroupId: \d+

ezpublish_rest_updateContentTypeGroup:
    path: /content/typegroups/{contentTypeGroupId}
    defaults:
        _controller: ezpublish_rest.controller.content_type:updateContentTypeGroup
    methods: [PATCH]
    requirements:
        contentTypeGroupId: \d+

ezpublish_rest_deleteContentTypeGroup:
    path: /content/typegroups/{contentTypeGroupId}
    defaults:
        _controller: ezpublish_rest.controller.content_type:deleteContentTypeGroup
    methods: [DELETE]
    requirements:
        contentTypeGroupId: \d+

ezpublish_rest_listContentTypesForGroup:
    path: /content/typegroups/{contentTypeGroupId}/types
    defaults:
        _controller: ezpublish_rest.controller.content_type:listContentTypesForGroup
    methods: [GET]
    requirements:
        contentTypeGroupId: \d+

ezpublish_rest_createContentType:
    path: /content/typegroups/{contentTypeGroupId}/types
    defaults:
        _controller: ezpublish_rest.controller.content_type:createContentType
    methods: [POST]
    requirements:
        contentTypeGroupId: \d+

ezpublish_rest_listContentTypes:
    # @todo: Handle all GET parameters
    path: /content/types
    defaults:
        _controller: ezpublish_rest.controller.content_type:listContentTypes
    methods: [GET]

ezpublish_rest_copyContentType:
    path: /content/types/{contentTypeId}
    defaults:
        _controller: ezpublish_rest.controller.content_type:copyContentType
    methods: [COPY]
    requirements:
        contentTypeId: \d+

ezpublish_rest_loadContentType:
    path: /content/types/{contentTypeId}
    defaults:
        _controller: ezpublish_rest.controller.content_type:loadContentType
    methods: [GET]
    requirements:
        contentTypeId: \d+

ezpublish_rest_createContentTypeDraft:
    path: /content/types/{contentTypeId}
    defaults:
        _controller: ezpublish_rest.controller.content_type:createContentTypeDraft
    methods: [POST]
    requirements:
        contentTypeId: \d+

ezpublish_rest_deleteContentType:
    path: /content/types/{contentTypeId}
    defaults:
        _controller: ezpublish_rest.controller.content_type:deleteContentType
    methods: [DELETE]
    requirements:
        contentTypeId: \d+

ezpublish_rest_deleteContentTypeDraft:
    path: /content/types/{contentTypeId}/draft
    defaults:
        _controller: ezpublish_rest.controller.content_type:deleteContentTypeDraft
    methods: [DELETE]
    requirements:
        contentTypeId: \d+

ezpublish_rest_loadContentTypeFieldDefinitionList:
    path: /content/types/{contentTypeId}/fieldDefinitions
    defaults:
        _controller: ezpublish_rest.controller.content_type:loadContentTypeFieldDefinitionList
    methods: [GET]
    requirements:
        contentTypeId: \d+

ezpublish_rest_loadContentTypeFieldDefinition:
    path: /content/types/{contentTypeId}/fieldDefinitions/{fieldDefinitionId}
    defaults:
        _controller: ezpublish_rest.controller.content_type:loadContentTypeFieldDefinition
    methods: [GET]
    requirements:
        contentTypeId: \d+
        fieldDefinitionId: \d+

ezpublish_rest_loadContentTypeDraft:
    path: /content/types/{contentTypeId}/draft
    defaults:
        _controller: ezpublish_rest.controller.content_type:loadContentTypeDraft
    methods: [GET]
    requirements:
        contentTypeId: \d+

ezpublish_rest_updateContentTypeDraft:
    path: /content/types/{contentTypeId}/draft
    defaults:
        _controller: ezpublish_rest.controller.content_type:updateContentTypeDraft
    methods: [PATCH]
    requirements:
        contentTypeId: \d+

ezpublish_rest_publishContentTypeDraft:
    path: /content/types/{contentTypeId}/draft
    defaults:
        _controller: ezpublish_rest.controller.content_type:publishContentTypeDraft
    methods: [PUBLISH]
    requirements:
        contentTypeId: \d+

ezpublish_rest_loadContentTypeDraftFieldDefinitionList:
    path: /content/types/{contentTypeId}/draft/fieldDefinitions
    defaults:
        _controller: ezpublish_rest.controller.content_type:loadContentTypeDraftFieldDefinitionList
    methods: [GET]
    requirements:
        contentTypeId: \d+

ezpublish_rest_addContentTypeDraftFieldDefinition:
    path: /content/types/{contentTypeId}/draft/fieldDefinitions
    defaults:
        _controller: ezpublish_rest.controller.content_type:addContentTypeDraftFieldDefinition
    methods: [POST]
    requirements:
        contentTypeId: \d+

ezpublish_rest_loadContentTypeDraftFieldDefinition:
    path: /content/types/{contentTypeId}/draft/fieldDefinitions/{fieldDefinitionId}
    defaults:
        _controller: ezpublish_rest.controller.content_type:loadContentTypeDraftFieldDefinition
    methods: [GET]
    requirements:
        contentTypeId: \d+
        fieldDefinitionId: \d+

ezpublish_rest_updateContentTypeDraftFieldDefinition:
    path: /content/types/{contentTypeId}/draft/fieldDefinitions/{fieldDefinitionId}
    defaults:
        _controller: ezpublish_rest.controller.content_type:updateContentTypeDraftFieldDefinition
    methods: [PATCH]
    requirements:
        contentTypeId: \d+
        fieldDefinitionId: \d+

ezpublish_rest_removeContentTypeDraftFieldDefinition:
    path: /content/types/{contentTypeId}/draft/fieldDefinitions/{fieldDefinitionId}
    defaults:
        _controller: ezpublish_rest.controller.content_type:removeContentTypeDraftFieldDefinition
    methods: [DELETE]
    requirements:
        contentTypeId: \d+
        fieldDefinitionId: \d+

ezpublish_rest_loadGroupsOfContentType:
    path: /content/types/{contentTypeId}/groups
    defaults:
        _controller: ezpublish_rest.controller.content_type:loadGroupsOfContentType
    methods: [GET]
    requirements:
        contentTypeId: \d+

ezpublish_rest_linkContentTypeToGroup:
    # Handle GET parameter group in controller. Most likely already done
    path: /content/types/{contentTypeId}/groups
    defaults:
        _controller: ezpublish_rest.controller.content_type:linkContentTypeToGroup
    methods: [POST]
    requirements:
        contentTypeId: \d+

ezpublish_rest_unlinkContentTypeFromGroup:
    path: /content/types/{contentTypeId}/groups/{contentTypeGroupId}
    defaults:
        _controller: ezpublish_rest.controller.content_type:unlinkContentTypeFromGroup
    methods: [DELETE]
    requirements:
        contentTypeId: \d+
        contentTypeGroupId: \d+


# Trash


ezpublish_rest_loadTrashItems:
    path: /content/trash
    defaults:
        _controller: ezpublish_rest.controller.trash:loadTrashItems
    methods: [GET]

ezpublish_rest_emptyTrash:
    path: /content/trash
    defaults:
        _controller: ezpublish_rest.controller.trash:emptyTrash
    methods: [DELETE]

ezpublish_rest_loadTrashItem:
    path: /content/trash/{trashItemId}
    defaults:
        _controller: ezpublish_rest.controller.trash:loadTrashItem
    methods: [GET]
    requirements:
        trashItemId: \d+

ezpublish_rest_deleteTrashItem:
    path: /content/trash/{trashItemId}
    defaults:
        _controller: ezpublish_rest.controller.trash:deleteTrashItem
    methods: [DELETE]
    requirements:
        trashItemId: \d+

ezpublish_rest_restoreTrashItem:
    path: /content/trash/{trashItemId}
    defaults:
        _controller: ezpublish_rest.controller.trash:restoreTrashItem
    methods: [MOVE]
    requirements:
        trashItemId: \d+


# URL wildcards


ezpublish_rest_listURLWildcards:
    path: /content/urlwildcards
    defaults:
        _controller: ezpublish_rest.controller.url_wildcard:listURLWildcards
    methods: [GET]

ezpublish_rest_createURLWildcard:
    path: /content/urlwildcards
    defaults:
        _controller: ezpublish_rest.controller.url_wildcard:createURLWildcard
    methods: [POST]

ezpublish_rest_loadURLWildcard:
    path: /content/urlwildcards/{urlWildcardId}
    defaults:
        _controller: ezpublish_rest.controller.url_wildcard:loadURLWildcard
    methods: [GET]
    requirements:
        urlWildcardId: \d+

ezpublish_rest_deleteURLWildcard:
    path: /content/urlwildcards/{urlWildcardId}
    defaults:
        _controller: ezpublish_rest.controller.url_wildcard:deleteURLWildcard
    methods: [DELETE]
    requirements:
        urlWildcardId: \d+


# User policies


ezpublish_rest_listPoliciesForUser:
    path: /user/policies
    defaults:
        _controller: ezpublish_rest.controller.role:listPoliciesForUser
    methods: [GET]


# Roles


ezpublish_rest_listRoles:
    path: /user/roles
    defaults:
        _controller: ezpublish_rest.controller.role:listRoles
    methods: [GET]

ezpublish_rest_createRole:
    path: /user/roles
    defaults:
        _controller: ezpublish_rest.controller.role:createRole
    methods: [POST]
    requirements:

ezpublish_rest_loadRole:
    path: /user/roles/{roleId}
    defaults:
        _controller: ezpublish_rest.controller.role:loadRole
    methods: [GET]
    requirements:
        roleId: \d+

ezpublish_rest_updateRole:
    path: /user/roles/{roleId}
    defaults:
        _controller: ezpublish_rest.controller.role:updateRole
    methods: [PATCH]
    requirements:
        roleId: \d+

ezpublish_rest_deleteRole:
    path: /user/roles/{roleId}
    defaults:
        _controller: ezpublish_rest.controller.role:deleteRole
    methods: [DELETE]
    requirements:
        roleId: \d+

ezpublish_rest_loadPolicies:
    path: /user/roles/{roleId}/policies
    defaults:
        _controller: ezpublish_rest.controller.role:loadPolicies
    methods: [GET]
    requirements:
        roleId: \d+

ezpublish_rest_addPolicy:
    path: /user/roles/{roleId}/policies
    defaults:
        _controller: ezpublish_rest.controller.role:addPolicy
    methods: [POST]
    requirements:
        roleId: \d+

ezpublish_rest_deletePolicies:
    path: /user/roles/{roleId}/policies
    defaults:
        _controller: ezpublish_rest.controller.role:deletePolicies
    methods: [DELETE]
    requirements:
        roleId: \d+

ezpublish_rest_loadPolicy:
    path: /user/roles/{roleId}/policies/{policyId}
    defaults:
        _controller: ezpublish_rest.controller.role:loadPolicy
    methods: [GET]
    requirements:
        roleId: \d+
        policyId: \d+

ezpublish_rest_updatePolicy:
    path: /user/roles/{roleId}/policies/{policyId}
    defaults:
        _controller: ezpublish_rest.controller.role:updatePolicy
    methods: [PATCH]
    requirements:
        roleId: \d+
        policyId: \d+

ezpublish_rest_deletePolicy:
    path: /user/roles/{roleId}/policies/{policyId}
    defaults:
        _controller: ezpublish_rest.controller.role:deletePolicy
    methods: [DELETE]
    requirements:
        roleId: \d+
        policyId: \d+


# Users


ezpublish_rest_loadUsers:
    path: /user/users
    defaults:
        _controller: ezpublish_rest.controller.user:loadUsers
    methods: [GET]

ezpublish_rest_loadUser:
    path: /user/users/{userId}
    defaults:
        _controller: ezpublish_rest.controller.user:loadUser
    methods: [GET]
    requirements:
        userId: \d+

ezpublish_rest_updateUser:
    path: /user/users/{userId}
    defaults:
        _controller: ezpublish_rest.controller.user:updateUser
    methods: [PATCH]
    requirements:
        userId: \d+

ezpublish_rest_deleteUser:
    path: /user/users/{userId}
    defaults:
        _controller: ezpublish_rest.controller.user:deleteUser
    methods: [DELETE]
    requirements:
        userId: \d+

ezpublish_rest_loadUserGroupsOfUser:
    path: /user/users/{userId}/groups
    defaults:
        _controller: ezpublish_rest.controller.user:loadUserGroupsOfUser
    methods: [GET]
    requirements:
        userId: \d+

ezpublish_rest_assignUserToUserGroup:
    path: /user/users/{userId}/groups
    defaults:
        _controller: ezpublish_rest.controller.user:assignUserToUserGroup
    methods: [POST]
    requirements:
        userId: \d+

ezpublish_rest_unassignUserFromUserGroup:
    path: /user/users/{userId}/groups/{groupPath}
    defaults:
        _controller: ezpublish_rest.controller.user:unassignUserFromUserGroup
    methods: [DELETE]
    requirements:
        userId: \d+
        groupPath: \d+

ezpublish_rest_loadUserDrafts:
    path: /user/users/{userId}/drafts
    defaults:
        _controller: ezpublish_rest.controller.user:loadUserDrafts
    methods: [GET]
    requirements:
        userId: \d+

ezpublish_rest_loadRoleAssignmentsForUser:
    path: /user/users/{userId}/roles
    defaults:
        _controller: ezpublish_rest.controller.role:loadRoleAssignmentsForUser
    methods: [GET]
    requirements:
        userId: \d+

ezpublish_rest_assignRoleToUser:
    path: /user/users/{userId}/roles
    defaults:
        _controller: ezpublish_rest.controller.role:assignRoleToUser
    methods: [POST]
    requirements:
        userId: \d+

ezpublish_rest_loadRoleAssignmentForUser:
    path: /user/users/{userId}/roles/{roleId}
    defaults:
        _controller: ezpublish_rest.controller.role:loadRoleAssignmentForUser
    methods: [GET]
    requirements:
        userId: \d+
        roleId: \d+

ezpublish_rest_unassignRoleFromUser:
    path: /user/users/{userId}/roles/{roleId}
    defaults:
        _controller: ezpublish_rest.controller.role:unassignRoleFromUser
    methods: [DELETE]
    requirements:
        userId: \d+
        roleId: \d+

ezpublish_rest_loadUserGroups:
    path: /user/groups
    defaults:
        _controller: ezpublish_rest.controller.user:loadUserGroups
    methods: [GET]

ezpublish_rest_loadRootUserGroup:
    path: /user/groups/root
    defaults:
        _controller: ezpublish_rest.controller.user:loadRootUserGroup
    methods: [GET]

ezpublish_rest_createRootUserGroup:
    path: /user/groups/subgroups
    defaults:
        _controller: ezpublish_rest.controller.user:createUserGroup
    methods: [POST]

ezpublish_rest_loadUserGroup:
    path: /user/groups/{groupPath}
    defaults:
        _controller: ezpublish_rest.controller.user:loadUserGroup
    methods: [GET]
    requirements:
        groupPath: "[0-9/]+"

ezpublish_rest_updateUserGroup:
    path: /user/groups/{groupPath}
    defaults:
        _controller: ezpublish_rest.controller.user:updateUserGroup
    methods: [PATCH]
    requirements:
        groupPath: "[0-9/]+"

ezpublish_rest_deleteUserGroup:
    path: /user/groups/{groupPath}
    defaults:
        _controller: ezpublish_rest.controller.user:deleteUserGroup
    methods: [DELETE]
    requirements:
        groupPath: "[0-9/]+"

ezpublish_rest_moveUserGroup:
    path: /user/groups/{groupPath}
    defaults:
        _controller: ezpublish_rest.controller.user:moveUserGroup
    methods: [MOVE]
    requirements:
        groupPath: "[0-9/]+"

ezpublish_rest_loadSubUserGroups:
    path: /user/groups/{groupPath}/subgroups
    defaults:
        _controller: ezpublish_rest.controller.user:loadSubUserGroups
    methods: [GET]
    requirements:
        groupPath: "[0-9/]+"

ezpublish_rest_createUserGroup:
    path: /user/groups/{groupPath}/subgroups
    defaults:
        _controller: ezpublish_rest.controller.user:createUserGroup
    methods: [POST]
    requirements:
        groupPath: "[0-9/]+"

ezpublish_rest_loadUsersFromGroup:
    path: /user/groups/{groupPath}/users
    defaults:
        _controller: ezpublish_rest.controller.user:loadUsersFromGroup
    methods: [GET]
    requirements:
        groupPath: "[0-9/]+"

ezpublish_rest_createUser:
    path: /user/groups/{groupPath}/users
    defaults:
        _controller: ezpublish_rest.controller.user:createUser
    methods: [POST]
    requirements:
        groupPath: "[0-9/]+"

ezpublish_rest_loadRoleAssignmentsForUserGroup:
    path: /user/groups/{groupPath}/roles
    defaults:
        _controller: ezpublish_rest.controller.role:loadRoleAssignmentsForUserGroup
    methods: [GET]
    requirements:
        groupPath: "[0-9/]+"

ezpublish_rest_assignRoleToUserGroup:
    path: /user/groups/{groupPath}/roles
    defaults:
        _controller: ezpublish_rest.controller.role:assignRoleToUserGroup
    methods: [POST]
    requirements:
        groupPath: "[0-9/]+"

ezpublish_rest_loadRoleAssignmentForUserGroup:
    path: /user/groups/{groupPath}/roles/{roleId}
    defaults:
        _controller: ezpublish_rest.controller.role:loadRoleAssignmentForUserGroup
    methods: [GET]
    requirements:
        groupPath: "[0-9/]+"
        roleId: \d+

ezpublish_rest_unassignRoleFromUserGroup:
    path: /user/groups/{groupPath}/roles/{roleId}
    defaults:
        _controller: ezpublish_rest.controller.role:unassignRoleFromUserGroup
    methods: [DELETE]
    requirements:
        groupPath: "[0-9/]+"
        roleId: \d+

ezpublish_rest_createSession:
    path: /user/sessions
    defaults:
        _controller: ezpublish_rest.controller.user:createSession
    methods: [POST]

ezpublish_rest_deleteSession:
    path: /user/sessions/{sessionId}
    defaults:
        _controller: ezpublish_rest.controller.user:deleteSession
    methods: [DELETE]

ezpublish_rest_refreshSession:
    path: /user/sessions/{sessionId}/refresh
    defaults:
        _controller: ezpublish_rest.controller.user:refreshSession
    methods: [POST]


# URL aliases


ezpublish_rest_listGlobalURLAliases:
    path: /content/urlaliases
    defaults:
        _controller: ezpublish_rest.controller.url_alias:listGlobalURLAliases
    methods: [GET]

ezpublish_rest_listLocationURLAliases:
    path: /content/locations/{locationPath}/urlaliases
    defaults:
        _controller: ezpublish_rest.controller.url_alias:listLocationURLAliases
    methods: [GET]
    requirements:
        locationPath: "[0-9/]+"

ezpublish_rest_createURLAlias:
    path: /content/urlaliases
    defaults:
        _controller: ezpublish_rest.controller.url_alias:createURLAlias
    methods: [POST]

ezpublish_rest_loadURLAlias:
    path: /content/urlaliases/{urlAliasId}
    defaults:
        _controller: ezpublish_rest.controller.url_alias:loadURLAlias
    methods: [GET]

ezpublish_rest_deleteURLAlias:
    path: /content/urlaliases/{urlAliasId}
    defaults:
        _controller: ezpublish_rest.controller.url_alias:deleteURLAlias
    methods: [DELETE]


# Services


ezpublish_rest_loadCountryList:
    path: /services/countries
    defaults:
        _controller: ezpublish_rest.controller.services:loadCountryList
    methods: [GET]
