Class WebService.NewAction

  • Enclosing interface:
    WebService

    public static class WebService.NewAction
    extends java.lang.Object
    • Method Detail

      • setDescription

        public WebService.NewAction setDescription​(@Nullable
                                                   java.lang.String description)
        Used in Orchestrator
      • setDescription

        public WebService.NewAction setDescription​(@Nullable
                                                   java.lang.String description,
                                                   java.lang.Object... descriptionArgument)
        Since:
        5.6
      • setDeprecatedSince

        public WebService.NewAction setDeprecatedSince​(@Nullable
                                                       java.lang.String deprecatedSince)
        Since:
        5.3
      • setInternal

        public WebService.NewAction setInternal​(boolean b)
        Internal actions are not displayed by default in the web api documentation. They are displayed only when the check-box "Show Internal API" is selected. By default an action is not internal.
      • setResponseExample

        public WebService.NewAction setResponseExample​(@Nullable
                                                       java.net.URL url)
        Link to the document containing an example of response. Content must be UTF-8 encoded.
        Example:
           newAction.setResponseExample(getClass().getResource("/org/sonar/my-ws-response-example.json"));
         
        Since:
        4.4
      • setChangelog

        public WebService.NewAction setChangelog​(Change... changes)
        List of changes made to the contract or valuable insight. Example: changes to the response format.
        Since:
        6.4
      • addPagingParams

        public WebService.NewAction addPagingParams​(int defaultPageSize)
        Add predefined parameters related to pagination of results.
      • addPagingParams

        public WebService.NewAction addPagingParams​(int defaultPageSize,
                                                    int maxPageSize)
        Add predefined parameters related to pagination of results with a maximum page size. Note the maximum is a documentation only feature. It does not check anything.
      • createPageSize

        public WebService.NewParam createPageSize​(int defaultPageSize,
                                                  int maxPageSize)
      • addPagingParamsSince

        public WebService.NewAction addPagingParamsSince​(int defaultPageSize,
                                                         int maxPageSize,
                                                         java.lang.String version)
        Add predefined parameters related to pagination of results with a maximum page size.
        Since:
        7.1
      • addFieldsParam

        public WebService.NewAction addFieldsParam​(java.util.Collection<?> possibleValues)
        Creates the parameter WebService.Param.FIELDS, which is used to restrict the number of fields returned in JSON response.
      • createFieldsParam

        public WebService.NewParam createFieldsParam​(java.util.Collection<?> possibleValues)
      • addSearchQuery

        public WebService.NewAction addSearchQuery​(java.lang.String exampleValue,
                                                   java.lang.String... pluralFields)
        Creates the parameter WebService.Param.TEXT_QUERY, which is used to search for a subset of fields containing the supplied string.

        The fields must be in the plural form (ex: "names", "keys").

      • createSearchQuery

        public WebService.NewParam createSearchQuery​(java.lang.String exampleValue,
                                                     java.lang.String... pluralFields)
        Creates the parameter WebService.Param.TEXT_QUERY, which is used to search for a subset of fields containing the supplied string.

        The fields must be in the plural form (ex: "names", "keys").

      • addSortParams

        public <V> WebService.NewAction addSortParams​(java.util.Collection<V> possibleValues,
                                                      @Nullable
                                                      V defaultValue,
                                                      boolean defaultAscending)
        Add predefined parameters related to sorting of results.
      • createSortParams

        public <V> WebService.NewParam createSortParams​(java.util.Collection<V> possibleValues,
                                                        @Nullable
                                                        V defaultValue,
                                                        boolean defaultAscending)
        Add predefined parameters related to sorting of results.
      • addSelectionModeParam

        public WebService.NewAction addSelectionModeParam()
        Add 'selected=(selected|deselected|all)' for select-list oriented WS.