File

src/modules/http/builder/http-abstract-fetch-resource-request-builder.intf.ts

Description

This StarkHttpFetchResourceRequestBuilder interface describes the different operations supported by Http request builders for resource-fetching requests

Index

Methods

Methods

addAcceptedLanguage
addAcceptedLanguage(languages: StarkLanguage[])

Adds StarkLanguage codes to the "Accept-Language" header

Parameters :
Name Type Optional Description
languages StarkLanguage[] No
  • Language(s) in which the response should be returned
addFilterByInclude
addFilterByInclude(...fields: string[])

Adds the fields that should be included in the response

Parameters :
Name Type Optional Description
fields string[] No
  • Name of the fields to be included
addFilterByStyle
addFilterByStyle(style: string)

Adds the "style" (a label put on a set of fields) that should be included in the response

Parameters :
Name Type Optional Description
style string No
  • Name of the style to be included
addSortBy
addSortBy(sortItems: StarkSortItem[])

Adds StarkSortItem query parameter(s) to the request

Parameters :
Name Type Optional Description
sortItems StarkSortItem[] No
  • Sort parameters to define the order in which the items will be returned
import { StarkLanguage } from "../../../configuration/entities/language";
import { StarkSortItem } from "../entities";

/**
 * This StarkHttpFetchResourceRequestBuilder interface describes the different operations supported by Http request builders for resource-fetching requests
 */
export interface StarkHttpFetchResourceRequestBuilder {
	/**
	 * Adds {@link StarkLanguage} codes to the "Accept-Language" header
	 *
	 * @param languages - Language(s) in which the response should be returned
	 * @returns The current builder
	 */
	addAcceptedLanguage(...languages: StarkLanguage[]): this;

	/**
	 * Adds the fields that should be included in the response
	 * @param fields - Name of the fields to be included
	 * @returns The current builder
	 */
	addFilterByInclude(...fields: string[]): this;

	/**
	 * Adds the "style" (a label put on a set of fields) that should be included in the response
	 * @param style - Name of the style to be included
	 * @returns The current builder
	 */
	addFilterByStyle(style: string): this;

	/**
	 * Adds {@link StarkSortItem} query parameter(s) to the request
	 *
	 * @param sortItems - Sort parameters to define the order in which the items will be returned
	 * @returns The current builder
	 */
	addSortBy(...sortItems: StarkSortItem[]): this;
}

results matching ""

    No results matching ""