<commit_before>package sizebay.catalog.client;

import java.util.*;
import lombok.NonNull;
import sizebay.catalog.client.http.*;
import sizebay.catalog.client.model.*;
import sizebay.catalog.client.model.filters.*;

/**
 * A Basic wrapper on generated Swagger client.
 * 
 * @author <NAME>
 */
public class CatalogAPI {

	final static String
		DEFAULT_BASE_URL = "https://catalogue.fitpeek.co/api/v1/",

		ENDPOINT_DASHBOARD = "/dashboard",
		ENDPOINT_BRAND = "/brands",
		ENDPOINT_MODELING = "/modelings",
		ENDPOINT_PRODUCT = "/products",
		ENDPOINT_CATEGORIES = "/categories",
		ENDPOINT_TENANTS = "/tenants",
		ENDPOINT_USER = "/user",
		ENDPOINT_SIZE_STYLE = "/style",
		ENDPOINT_DEVOLUTION = "/devolution",
		ENDPOINT_IMPORTATION_ERROR = "/importations",
		ENDPOINT_STRONG_CATEGORY = "/categories/strong",
		ENDPOINT_STRONG_SUBCATEGORY = "/categories/strong/sub",
		ENDPOINT_STRONG_MODEL = "models/strong",
		ENDPOINT_STRONG_MODELING = "/modelings/strong",

		SEARCH_BY_TEXT = "/search/all?text=";

	final RESTClient client;

	/**
	 * Constructs the Catalog API.
	 * 
	 * @param applicationToken
	 * @param securityToken
	 */
	public CatalogAPI(@NonNull String applicationToken, @NonNull String securityToken) {
		this(DEFAULT_BASE_URL, applicationToken, securityToken);
	}

	/**
	 * Constructs the Catalog API.
	 * 
	 * @param basePath
	 * @param applicationToken
	 * @param securityToken
	 */
	public CatalogAPI(@NonNull String basePath, @NonNull String applicationToken, @NonNull String securityToken) {
		final CatalogAuthentication authentication = new CatalogAuthentication( applicationToken, securityToken );
		final MimeType mimeType = new JSONMimeType();

		client = new RESTClient( basePath, mimeType, authentication );
	}


	/**
	 * Starting dashboard management
	 */

	public List<Dashboard> retrieveDashboard() {
		return client.getList(ENDPOINT_DASHBOARD, Dashboard.class);
	}

	/**
	 * End dashboard management
	 */

	public ProductBasicInformationToVFR retrieveProductBasicInformationToVFR(String permalink) {
		return client.getSingle(ENDPOINT_PRODUCT + "/basic-info-to-vfr?"
			+ "permalink=" + permalink, ProductBasicInformationToVFR.class);
	}



	/**<commit_msg>feat: create route to retrieve dashboard by tenant<commit_after>package sizebay.catalog.client;

import java.util.*;
import lombok.NonNull;
import sizebay.catalog.client.http.*;
import sizebay.catalog.client.model.*;
import sizebay.catalog.client.model.filters.*;

/**
 * A Basic wrapper on generated Swagger client.
 * 
 * @author <NAME>
 */
public class CatalogAPI {

	final static String
		DEFAULT_BASE_URL = "https://catalogue.fitpeek.co/api/v1/",

		ENDPOINT_DASHBOARD = "/dashboard",
		ENDPOINT_BRAND = "/brands",
		ENDPOINT_MODELING = "/modelings",
		ENDPOINT_PRODUCT = "/products",
		ENDPOINT_CATEGORIES = "/categories",
		ENDPOINT_TENANTS = "/tenants",
		ENDPOINT_USER = "/user",
		ENDPOINT_SIZE_STYLE = "/style",
		ENDPOINT_DEVOLUTION = "/devolution",
		ENDPOINT_IMPORTATION_ERROR = "/importations",
		ENDPOINT_STRONG_CATEGORY = "/categories/strong",
		ENDPOINT_STRONG_SUBCATEGORY = "/categories/strong/sub",
		ENDPOINT_STRONG_MODEL = "models/strong",
		ENDPOINT_STRONG_MODELING = "/modelings/strong",

		SEARCH_BY_TEXT = "/search/all?text=";

	final RESTClient client;

	/**
	 * Constructs the Catalog API.
	 * 
	 * @param applicationToken
	 * @param securityToken
	 */
	public CatalogAPI(@NonNull String applicationToken, @NonNull String securityToken) {
		this(DEFAULT_BASE_URL, applicationToken, securityToken);
	}

	/**
	 * Constructs the Catalog API.
	 * 
	 * @param basePath
	 * @param applicationToken
	 * @param securityToken
	 */
	public CatalogAPI(@NonNull String basePath, @NonNull String applicationToken, @NonNull String securityToken) {
		final CatalogAuthentication authentication = new CatalogAuthentication( applicationToken, securityToken );
		final MimeType mimeType = new JSONMimeType();

		client = new RESTClient( basePath, mimeType, authentication );
	}


	/**
	 * Starting dashboard management
	 */

	public List<Dashboard> retrieveDashboard() {
		return client.getList(ENDPOINT_DASHBOARD, Dashboard.class);
	}

	public Dashboard retrieveDashboardByTenant(Long tenantId) {
		return client.getSingle(ENDPOINT_DASHBOARD + "/single/" + tenantId, Dashboard.class);
	}

	/**
	 * End dashboard management
	 */

	public ProductBasicInformationToVFR retrieveProductBasicInformationToVFR(String permalink) {
		return client.getSingle(ENDPOINT_PRODUCT + "/basic-info-to-vfr?"
			+ "permalink=" + permalink, ProductBasicInformationToVFR.class);
	}



	/**
{'fraction_non_alphanumeric': 0.11361646234676007, 'fraction_numerical': 0.00043782837127845885, 'mean_word_length': 4.783544303797468, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2490617', 'n_tokens_mistral': 1526, 'n_tokens_neox': 1393, 'n_words': 296}