/**
 * Copyright (c) 2015 Bosch Software Innovations GmbH and others.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */
package org.eclipse.hawkbit.rest.resource;

/**
 * Constants for RESTful API.
 *
 *
 *
 */
public final class RestConstants {

    /**
     * API version definition. We are using only major versions.
     */
    public static final String API_VERSION = "v1";

    /**
     * The base URL mapping for the spring acuator management context path.
     */
    public static final String BASE_SYSTEM_MAPPING = "/system";

    /**
     * URL mapping for system admin operations.
     */
    public static final String SYSTEM_ADMIN_MAPPING = BASE_SYSTEM_MAPPING + "/admin";

    /**
     * The base URL mapping of the SP rest resources.
     */
    public static final String BASE_V1_REQUEST_MAPPING = "/rest/v1";

    /**
     * The default limit parameter in case the limit parameter is not present in
     * the request.
     *
     * @see #REQUEST_PARAMETER_PAGING_LIMIT
     */
    public static final int REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT_VALUE = 50;

    /**
     * String representation of
     * {@link #REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT_VALUE}.
     */
    public static final String REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT = "50";

    /**
     * The default offset parameter in case the offset parameter is not present
     * in the request.
     *
     * @see #REQUEST_PARAMETER_PAGING_OFFSET
     */
    public static final String REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET = "0";

    /**
     * Limit http parameter for the limitation of returned values for a paged
     * request.
     */
    public static final String REQUEST_PARAMETER_PAGING_LIMIT = "limit";
    /**
     * The maximum limit of entities returned by rest resources.
     */
    public static final int REQUEST_PARAMETER_PAGING_MAX_LIMIT = 500;

    /**
     * Paging http parameter for the offset for a paged request.
     */
    public static final String REQUEST_PARAMETER_PAGING_OFFSET = "offset";

    /**
     * The request parameter for sorting. The value of the sort parameter must
     * be in the following pattern. Example:
     * http://www.bosch.com/iap/sp/rest/targets?sort=field_1:ASC,field_2:DESC,
     * field_3:ASC
     */
    public static final String REQUEST_PARAMETER_SORTING = "sort";

    /**
     * The request parameter for searching. The value of the search parameter
     * must be in the FIQL syntax.
     */
    public static final String REQUEST_PARAMETER_SEARCH = "q";

    /**
     * The target URL mapping, href link for assigned distribution set.
     */
    public static final String TARGET_V1_ASSIGNED_DISTRIBUTION_SET = "assignedDS";
    /**
     * The target URL mapping, href link for installed distribution set.
     */
    public static final String TARGET_V1_INSTALLED_DISTRIBUTION_SET = "installedDS";
    /**
     * The target URL mapping, href link for target attributes.
     */
    public static final String TARGET_V1_ATTRIBUTES = "attributes";
    /**
     * The target URL mapping, href link for target actions.
     */
    public static final String TARGET_V1_ACTIONS = "actions";
    /**
     * The target URL mapping, href link for canceled actions.
     */
    public static final String TARGET_V1_CANCELED_ACTION = "canceledaction";
    /**
     * The target URL mapping, href link for canceled actions.
     */
    public static final String TARGET_V1_ACTION_STATUS = "status";

    /**
     * The target URL mapping rest resource.
     */
    public static final String TARGET_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targets";

    public static final String SYSTEM_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/system";
    /**
     * The software module URL mapping rest resource.
     */
    public static final String SOFTWAREMODULE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/softwaremodules";

    /**
     * The tag URL mapping rest resource.
     */
    public static final String TARGET_TAG_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targettags";
    /**
     * The tag URL mapping rest resource.
     */
    public static final String TARGET_TAG_TAGERTS_REQUEST_MAPPING = "/{targetTagId}/targets";

    /**
     * The tag URL mapping rest resource.
     */
    public static final String DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING
            + "/distributionsettags";

    /**
     * The tag URL mapping rest resource.
     */
    public static final String DISTRIBUTIONSET_REQUEST_MAPPING = "/{distributionsetTagId}/distributionsets";

    /**
     * The software module type URL mapping rest resource.
     */
    public static final String SOFTWAREMODULETYPE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/softwaremoduletypes";

    public static final String DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING
            + "/distributionsettypes";

    /**
     * The software module URL mapping rest resource.
     */
    public static final String DISTRIBUTIONSET_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/distributionsets";

    /**
     * The rollout URL mapping rest resource.
     */
    public static final String ROLLOUT_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/rollouts";

    /**
     * Request parameter for async
     */
    public static final String REQUEST_PARAMETER_ASYNC = "async";

    /**
     * The target URL mapping, href link for artifact download.
     */
    public static final String SOFTWAREMODULE_V1_ARTIFACT = "artifacts";

    /**
     * The target URL mapping, href link for type information.
     */
    public static final String SOFTWAREMODULE_V1_TYPE = "type";

    public static final String DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULES = "optionalmodules";

    public static final String DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULES = "mandatorymodules";

    public static final String DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES = "optionalmoduletypes";

    public static final String DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES = "mandatorymoduletypes";

    public static final String DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE = "/api/" + API_VERSION + "/downloadserver/";
    public static final String DOWNLOAD_ID_V1_REQUEST_MAPPING = "downloadId/{downloadId}";

    // constant class, private constructor.
    private RestConstants() {

    }
}
