|string $pathParametersOrRawUrl Path parameters for the request or a String representing the raw URL. * @param RequestAdapter $requestAdapter The request adapter to use to execute the requests. */ public function __construct($pathParametersOrRawUrl, RequestAdapter $requestAdapter) { parent::__construct($requestAdapter, [], '{+baseurl}/inco-sheets/search?incoIdLike={incoIdLike}{&brands*,short*}'); if (is_array($pathParametersOrRawUrl)) { $this->pathParameters = $pathParametersOrRawUrl; } else { $this->pathParameters = ['request-raw-url' => $pathParametersOrRawUrl]; } } /** * Recherche des fiches INCO dont l'ID correspond à un motif (`incoIdLike`).Prend également en charge la projection au format court (`short=true`). * @param SearchRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. * @return Promise * @throws Exception */ public function get(?SearchRequestBuilderGetRequestConfiguration $requestConfiguration = null): Promise { $requestInfo = $this->toGetRequestInformation($requestConfiguration); $errorMappings = [ '400' => [ProblemDetails::class, 'createFromDiscriminatorValue'], '401' => [ProblemDetails::class, 'createFromDiscriminatorValue'], '403' => [ProblemDetails::class, 'createFromDiscriminatorValue'], '422' => [ValidationErrorProblemDetails::class, 'createFromDiscriminatorValue'], '429' => [ProblemDetails::class, 'createFromDiscriminatorValue'], '500' => [ProblemDetails::class, 'createFromDiscriminatorValue'], '503' => [ProblemDetails::class, 'createFromDiscriminatorValue'], ]; return $this->requestAdapter->sendAsync($requestInfo, [IncoListResponse::class, 'createFromDiscriminatorValue'], $errorMappings); } /** * Recherche des fiches INCO dont l'ID correspond à un motif (`incoIdLike`).Prend également en charge la projection au format court (`short=true`). * @param SearchRequestBuilderGetRequestConfiguration|null $requestConfiguration Configuration for the request such as headers, query parameters, and middleware options. * @return RequestInformation */ public function toGetRequestInformation(?SearchRequestBuilderGetRequestConfiguration $requestConfiguration = null): RequestInformation { $requestInfo = new RequestInformation(); $requestInfo->urlTemplate = $this->urlTemplate; $requestInfo->pathParameters = $this->pathParameters; $requestInfo->httpMethod = HttpMethod::GET; if ($requestConfiguration !== null) { $requestInfo->addHeaders($requestConfiguration->headers); if ($requestConfiguration->queryParameters !== null) { $requestInfo->setQueryParameters($requestConfiguration->queryParameters); } $requestInfo->addRequestOptions(...$requestConfiguration->options); } $requestInfo->tryAddHeader('Accept', "application/json"); return $requestInfo; } /** * Returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. * @param string $rawUrl The raw URL to use for the request builder. * @return SearchRequestBuilder */ public function withUrl(string $rawUrl): SearchRequestBuilder { return new SearchRequestBuilder($rawUrl, $this->requestAdapter); } }