Package com.xebialabs.xlrelease.api.v1

## Interface FolderApi

- All Superinterfaces:
    `ApiService`

      @Path("/api/v1/folders")
      @Produces("application/json")
      @Consumes("application/json")
      public interface FolderApi
      extends ApiService

  Operations on folders.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static java.lang.String` | `EXPRESSION_FOLDER_ID` |

    - ### Fields inherited from interface com.xebialabs.xlrelease.api.ApiService

      `DEFAULT_RESULTS_PER_PAGE, DEFAULT_RESULTS_PER_PAGE_STRING, DEPTH, ORDER_BY, PAGE, PAGE_IS_OFFSET, RESULTS_PER_PAGE, ROLE_IDS_DATA`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Folder` | `addFolder​(java.lang.String parentId, Folder folder)` | Adds a new folder inside the specified folder.
    `Variable` | `createVariable​(java.lang.String folderId, Variable variable)` | Adds a folder variable.
    `void` | `delete​(java.lang.String folderId)` | Deletes the specified folder and all the contents inside.
    `void` | `deleteVariable​(java.lang.String folderId, java.lang.String variableId)` | Deletes a folder variable.
    `Folder` | `find​(java.lang.String path, java.lang.Integer depth)` | Finds a folder from a given path.
    `Folder` | `getFolder​(java.lang.String folderId)` | Returns the specified folder with default depth.
    `Folder` | `getFolder​(java.lang.String folderId, java.lang.Integer depth)` | Returns the specified folder.
    `java.util.List<java.lang.String>` | `getPermissions()` | Returns possible permissions.
    `java.util.List<TeamView>` | `getTeams​(java.lang.String folderId)` | Returns folder effective teams.
    `java.util.List<Release>` | `getTemplates​(java.lang.String folderId)` | Returns the templates for the given folder with default pagination and depth.
    `default java.util.List<Release>` | `getTemplates​(java.lang.String folderId, java.lang.Long page, java.lang.Long resultPerPage, java.lang.Integer depth)` | Returns the templates for the given folder.
    `java.util.List<Release>` | `getTemplates​(java.lang.String folderId, java.lang.String kind, java.lang.Long page, java.lang.Long resultPerPage, java.lang.Integer depth)` | Returns the list of release or workflow templates for the given folder.
    `Variable` | `getVariable​(java.lang.String folderId, java.lang.String variableId)` | Returns the folder variable for the given identifier.
    `boolean` | `isFolderOwner​(java.lang.String folderId)` |
    `java.util.List<Folder>` | `list​(java.lang.String parentId, java.lang.Long page, java.lang.Long resultPerPage, java.lang.Integer depth, java.lang.Boolean decorateWithPermissions)` | Lists the folders inside a given folder.
    `default java.util.List<Folder>` | `listRoot()` | Returns a list of all folders directly under the root directory.
    `java.util.List<Folder>` | `listRoot​(java.lang.Long page, java.lang.Long resultPerPage, java.lang.Integer depth, java.lang.Boolean decorateWithPermissions)` | Returns a list of folders from the root directory.
    `java.util.List<Variable>` | `listVariables​(java.lang.String folderId, boolean folderOnly)` | Returns folder variables list.
    `java.util.Map<java.lang.String,​java.lang.String>` | `listVariableValues​(java.lang.String folderId, boolean folderOnly)` | Returns folder variables list with replaced variable values.
    `void` | `move​(java.lang.String folderId, java.lang.String newParentId)` | Move a folder to another folder.
    `void` | `moveTemplate​(java.lang.String folderId, java.lang.String templateId)` | Move a template to another folder without merging permissions.
    `void` | `moveTemplate​(java.lang.String folderId, java.lang.String templateId, java.lang.Boolean mergeTeams)` | Move a template to another folder.
    `void` | `rename​(java.lang.String folderId, java.lang.String newName)` | Rename a folder.
    `java.util.List<Release>` | `searchReleases​(java.lang.String folderId, ReleasesFilters releasesFilters)` | Returns the releases started from this folder with default pagination and depth.
    `java.util.List<Release>` | `searchReleases​(java.lang.String folderId, java.lang.Long page, java.lang.Long resultPerPage, java.lang.Integer depth, ReleasesFilters releasesFilters)` | Returns the releases started from this folder.
    `default java.lang.String` | `serviceName()` |
    `java.util.List<TeamView>` | `setTeams​(java.lang.String folderId, java.util.List<TeamView> teamDtos)` | Set teams of the folder.
    `Variable` | `updateVariable​(java.lang.String folderId, Variable variable)` | Updates properties of a folder variable by its ID.
    `Variable` | `updateVariable​(java.lang.String folderId, java.lang.String variableId, Variable variable)` |

- - ### Field Detail

    - #### EXPRESSION_FOLDER_ID

          static final java.lang.String EXPRESSION_FOLDER_ID

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### serviceName

          default java.lang.String serviceName()

      Specified by:
        `serviceName` in interface `ApiService`

    - #### listRoot

          @GET
          @Path("/list")
          java.util.List<Folder> listRoot​(@QueryParam("page")
                                          java.lang.Long page,
                                          @QueryParam("resultsPerPage")
                                          java.lang.Long resultPerPage,
                                          @QueryParam("depth")
                                          java.lang.Integer depth,
                                          @QueryParam("permissions")
                                          java.lang.Boolean decorateWithPermissions)

      Returns a list of folders from the root directory.
      Parameters:
        `page` - the page of results to return. Defaults at 0 if page set to null
        `resultPerPage` - the number of results per page. Defaults at 50 if set to null
        `depth` - the depth to search for. Defaults at 1 if set to null
        `decorateWithPermissions` - the boolean to decorate the folders with the effective permissions. Defaults to false if set to null
      Returns:
        a list of the folders

    - #### listRoot

          default java.util.List<Folder> listRoot()

      Returns a list of all folders directly under the root directory.
      Returns:
        a list of the folders

    - #### list

          @GET
          @Path("/{folderId:.*(Folder[^/]*|Applications)}/list")
          java.util.List<Folder> list​(@PathParam("folderId")
                                      java.lang.String parentId,
                                      @QueryParam("page")
                                      java.lang.Long page,
                                      @QueryParam("resultsPerPage")
                                      java.lang.Long resultPerPage,
                                      @QueryParam("depth")
                                      java.lang.Integer depth,
                                      @QueryParam("permissions")
                                      java.lang.Boolean decorateWithPermissions)

      Lists the folders inside a given folder.
      Parameters:
        `parentId` - the parent folder to retrieve from
        `page` - the page of results to return. Defaults at 0
        `resultPerPage` - the number of results per page. Defaults at 50
        `depth` - the depth to search for. Defaults at 1
      Returns:
        the list of folders beneath a given folder

    - #### find

          @GET
          @Path("/find")
          Folder find​(@QueryParam("byPath")
                      java.lang.String path,
                      @QueryParam("depth")
                      java.lang.Integer depth)

      Finds a folder from a given path.
      Parameters:
        `path` - the path for the folder to search on
        `depth` - the depth to search for. Defaults at 1
      Returns:
        the folder found in the path

    - #### getFolder

          @GET
          @Path("/{folderId:.*(Folder[^/]*|Applications)}")
          Folder getFolder​(@PathParam("folderId")
                           java.lang.String folderId,
                           @QueryParam("depth")
                           java.lang.Integer depth)

      Returns the specified folder.
      Parameters:
        `folderId` - the id of the folder
        `depth` - the depth to search for. Defaults at 1
      Returns:
        the specified folder

    - #### getFolder

          Folder getFolder​(java.lang.String folderId)

      Returns the specified folder with default depth.
      Parameters:
        `folderId` - the folder id
      Returns:
        the given folder

    - #### getTemplates

          @GET
          @Path("/{folderId:.*(Folder[^/]*|Applications)}/templates")
          java.util.List<Release> getTemplates​(@PathParam("folderId")
                                               java.lang.String folderId,
                                               @DefaultValue("RELEASE") @QueryParam("kind")
                                               java.lang.String kind,
                                               @QueryParam("page")
                                               java.lang.Long page,
                                               @QueryParam("resultsPerPage")
                                               java.lang.Long resultPerPage,
                                               @QueryParam("depth")
                                               java.lang.Integer depth)

      Returns the list of release or workflow templates for the given folder.
      Parameters:
        `folderId` - the id of the folder
        `kind` - the kind of template. Default value is release.
        `page` - the page of results to return. Defaults at 0
        `resultPerPage` - the number of results per page. Defaults at 50
        `depth` - the (optional) depth to search for; defaults at 1
      Returns:
        the list of templates in the folder

    - #### getTemplates

          default java.util.List<Release> getTemplates​(java.lang.String folderId,
                                                       java.lang.Long page,
                                                       java.lang.Long resultPerPage,
                                                       java.lang.Integer depth)

      Returns the templates for the given folder.
      Parameters:
        `folderId` - the id of the folder
        `page` - the page of results to return. Defaults at 0
        `resultPerPage` - the number of results per page. Defaults at 50
        `depth` - the (optional) depth to search for; defaults at 1
      Returns:
        the list of templates in the folder

    - #### getTemplates

          java.util.List<Release> getTemplates​(java.lang.String folderId)

      Returns the templates for the given folder with default pagination and depth.
      Parameters:
        `folderId` - the folder id
      Returns:
        the list of templates in the folder

    - #### searchReleases

          @POST
          @Path("/{folderId:.*(Folder[^/]*|Applications)}/releases")
          java.util.List<Release> searchReleases​(@PathParam("folderId")
                                                 java.lang.String folderId,
                                                 @QueryParam("page")
                                                 java.lang.Long page,
                                                 @QueryParam("numberbypage")
                                                 java.lang.Long resultPerPage,
                                                 @QueryParam("depth")
                                                 java.lang.Integer depth,
                                                 ReleasesFilters releasesFilters)

      Returns the releases started from this folder.
      Parameters:
        `folderId` - the id of the folder
        `page` - the page of results to return. Defaults at 0
        `resultPerPage` - the number of results per page. Defaults at 50
        `depth` - the depth to search for
        `releasesFilters` - releaseFilter to filter the release search
      Returns:
        the list of releases

    - #### searchReleases

          java.util.List<Release> searchReleases​(java.lang.String folderId,
                                                 ReleasesFilters releasesFilters)

      Returns the releases started from this folder with default pagination and depth.
      Parameters:
        `folderId` - the folder id
        `releasesFilters` - the releaseFilters to filter the release search on
      Returns:
        the list of releases in a folder

    - #### moveTemplate

          @POST
          @Path("/{folderId:.*(Folder[^/]*|Applications)}/templates/{templateId:.*Release[^/]*}")
          void moveTemplate​(@PathParam("folderId")
                            java.lang.String folderId,
                            @PathParam("templateId")
                            java.lang.String templateId,
                            @QueryParam("mergePermissions")
                            java.lang.Boolean mergeTeams)

      Move a template to another folder.
      Parameters:
        `folderId` - the target folder the template will be moved to
        `templateId` - the id of the template to be moved

    - #### moveTemplate

          void moveTemplate​(java.lang.String folderId,
                            java.lang.String templateId)

      Move a template to another folder without merging permissions.
      Parameters:
        `folderId` - the id of the parent folder
        `templateId` - the id of the template to be moved

    - #### addFolder

          @POST
          @Path("/{folderId:.*(Folder[^/]*|Applications)}")
          Folder addFolder​(@PathParam("folderId")
                           java.lang.String parentId,
                           Folder folder)

      Adds a new folder inside the specified folder.
      Parameters:
        `parentId` - the id of the folder to create the folder in
        `folder` - the folder to create the new folder in
      Returns:
        the newly created folder

    - #### delete

          @DELETE
          @Path("/{folderId:.*(Folder[^/]*|Applications)}")
          void delete​(@PathParam("folderId")
                      java.lang.String folderId)

      Deletes the specified folder and all the contents inside.
      Parameters:
        `folderId` - the id of the folder to delete

    - #### move

          @POST
          @Path("/{folderId:.*(Folder[^/]*|Applications)}/move")
          void move​(@PathParam("folderId")
                    java.lang.String folderId,
                    @QueryParam("newParentId")
                    java.lang.String newParentId)

      Move a folder to another folder.
      Parameters:
        `folderId` - the id of the folder to move
        `newParentId` - the id of the parent folder the folder will be moved under

    - #### rename

          @POST
          @Path("/{folderId:.*(Folder[^/]*|Applications)}/rename")
          void rename​(@PathParam("folderId")
                      java.lang.String folderId,
                      @QueryParam("newName")
                      java.lang.String newName)

      Rename a folder.
      Parameters:
        `folderId` - the id of the folder to rename
        `newName` - the new name of the folder

    - #### getPermissions

          @GET
          @Path("/permissions")
          java.util.List<java.lang.String> getPermissions()

      Returns possible permissions.
      Returns:
        list of permissions for folders, templates and releases

    - #### getTeams

          @GET
          @Path("/{folderId:.*(Folder[^/]*|Applications)}/teams")
          java.util.List<TeamView> getTeams​(@PathParam("folderId")
                                            java.lang.String folderId)

      Returns folder effective teams.
      Parameters:
        `folderId` - the id of the folder
      Returns:
        list of effective teams

    - #### setTeams

          @POST
          @Path("/{folderId:.*(Folder[^/]*|Applications)}/teams")
          java.util.List<TeamView> setTeams​(@PathParam("folderId")
                                            java.lang.String folderId,
                                            java.util.List<TeamView> teamDtos)

      Set teams of the folder.

      If teams were previously inherited they will be detached after the update. To use inherited teams on a folder submit empty list of teams.

      Parameters:
        `folderId` - the identifier of the folder
      Returns:
        a list of updated teams

    - #### isFolderOwner

          @GET
          @Path("/{folderId:.*(Folder[^/]*|Applications)}/folderOwner")
          boolean isFolderOwner​(@PathParam("folderId")
                                java.lang.String folderId)

    - #### listVariables

          @GET
          @Path("/{folderId:.*(Folder[^/]*|Applications)}/variables")
          java.util.List<Variable> listVariables​(@PathParam("folderId")
                                                 java.lang.String folderId,
                                                 @QueryParam("folderOnly")
                                                 boolean folderOnly)

      Returns folder variables list.
      Parameters:
        `folderId` - the folder identifier.
        `folderOnly` - filter if you only want to get information from your parentId. (optional)
      Returns:
        variables list.

    - #### listVariableValues

          @GET
          @Path("/{folderId:.*(Folder[^/]*|Applications)}/variableValues")
          java.util.Map<java.lang.String,​java.lang.String> listVariableValues​(@PathParam("folderId")
                                                                                    java.lang.String folderId,
                                                                                    @QueryParam("folderOnly")
                                                                                    boolean folderOnly)

      Returns folder variables list with replaced variable values.
      Parameters:
        `folderId` - the folder identifier.
        `folderOnly` - filter if you only want to get information from your parentId. (optional)
      Returns:
        variables list.

    - #### createVariable

          @POST
          @Path("/{folderId:.*(Folder[^/]*|Applications)}/variables")
          Variable createVariable​(@PathParam("folderId")
                                  java.lang.String folderId,
                                  Variable variable)

      Adds a folder variable.
      Parameters:
        `folderId` - the folder identifier.
        `variable` - the folder variable to add.
      Returns:
        the added folder variable.

    - #### getVariable

          @GET
          @Path("/{folderId:.*(Folder[^/]*|Applications)}/{variableId:.*Variable[^/]*}")
          Variable getVariable​(@PathParam("folderId")
                               java.lang.String folderId,
                               @PathParam("variableId")
                               java.lang.String variableId)

      Returns the folder variable for the given identifier.
      Parameters:
        `folderId` - the folder identifier.
        `variableId` - the variable identifier.
      Returns:
        the variable.

    - #### updateVariable

          @PUT
          @Path("/{folderId:.*(Folder[^/]*|Applications)}/{variableId:.*Variable[^/]*}")
          Variable updateVariable​(@PathParam("folderId")
                                  java.lang.String folderId,
                                  @PathParam("variableId")
                                  java.lang.String variableId,
                                  Variable variable)

    - #### updateVariable

          Variable updateVariable​(java.lang.String folderId,
                                  Variable variable)

      Updates properties of a folder variable by its ID.
      Parameters:
        `folderId` - the folder identifier.
        `variable` - the variable to update.
      Returns:
        the updated variable.

    - #### deleteVariable

          @DELETE
          @Path("/{folderId:.*(Folder[^/]*|Applications)}/{variableId:.*Variable[^/]*}")
          void deleteVariable​(@PathParam("folderId")
                              java.lang.String folderId,
                              @PathParam("variableId")
                              java.lang.String variableId)

      Deletes a folder variable.
      Parameters:
        `folderId` - the folder identifier.
        `variableId` - the variable identifier.