/* tslint:disable */
import { Injectable } from '@angular/core';
import { HttpClient, HttpRequest, HttpResponse, HttpHeaders } from '@angular/common/http';
import { BaseService as __BaseService } from '../base-service';
import { OmsConfiguration as __Configuration } from '../oms-configuration';
import { StrictHttpResponse as __StrictHttpResponse } from '../strict-http-response';
import { Observable as __Observable } from 'rxjs';
import { map as __map, filter as __filter } from 'rxjs/operators';

import { ResponseArgsOfOrderDTO } from '../models/response-args-of-order-dto';
import { OrderDTO } from '../models/order-dto';
import { ResponseArgsOfBoolean } from '../models/response-args-of-boolean';
import { ResponseArgsOfOrderItemDTO } from '../models/response-args-of-order-item-dto';
import { OrderItemSubsetDTO } from '../models/order-item-subset-dto';
import { ResponseArgsOfOrderItemSubsetDTO } from '../models/response-args-of-order-item-subset-dto';
import { ResponseArgsOfIEnumerableOfOrderDTO } from '../models/response-args-of-ienumerable-of-order-dto';
import { ListResponseArgsOfOrderListItemDTO } from '../models/list-response-args-of-order-list-item-dto';
import { QueryTokenDTO } from '../models/query-token-dto';
import { ListResponseArgsOfOrderItemListItemDTO } from '../models/list-response-args-of-order-item-list-item-dto';
import { ResponseArgsOfIEnumerableOfOrderItemDTO } from '../models/response-args-of-ienumerable-of-order-item-dto';
import { OrderItemDTO } from '../models/order-item-dto';
import { ResponseArgsOfHistoryDTO } from '../models/response-args-of-history-dto';
import { ResponseArgsOfValueTupleOfOrderItemSubsetDTOAndOrderItemSubsetDTO } from '../models/response-args-of-value-tuple-of-order-item-subset-dtoand-order-item-subset-dto';
import { StatusValues } from '../models/status-values';
import { ResponseArgsOfIEnumerableOfValueTupleOfOrderItemSubsetDTOAndOrderItemSubsetDTO } from '../models/response-args-of-ienumerable-of-value-tuple-of-order-item-subset-dtoand-order-item-subset-dto';
import { ChangeStockStatusCodeValues } from '../models/change-stock-status-code-values';
import { ResponseArgsOfIEnumerableOfEntityDTOContainerOfReceiptDTO } from '../models/response-args-of-ienumerable-of-entity-dtocontainer-of-receipt-dto';
import { ListResponseArgsOfOrderItemSubsetTaskListItemDTO } from '../models/list-response-args-of-order-item-subset-task-list-item-dto';
import { ResponseArgsOfInteger } from '../models/response-args-of-integer';
import { ResponseArgsOfPayerDTO } from '../models/response-args-of-payer-dto';
import { PayerDTO } from '../models/payer-dto';
import { ResponseArgsOfShippingAddressDTO } from '../models/response-args-of-shipping-address-dto';
import { ShippingAddressDTO } from '../models/shipping-address-dto';
import { ResponseArgsOfIEnumerableOfBranchDTO } from '../models/response-args-of-ienumerable-of-branch-dto';
import { ResponseArgsOfIEnumerableOfStockStatusCodeDTO } from '../models/response-args-of-ienumerable-of-stock-status-code-dto';
import { ListResponseArgsOfSupplierDTO } from '../models/list-response-args-of-supplier-dto';
import { ResponseArgsOfSupplierDTO } from '../models/response-args-of-supplier-dto';
import { ListResponseArgsOfVATDTO } from '../models/list-response-args-of-vatdto';
import { ResponseArgsOfVATDTO } from '../models/response-args-of-vatdto';
import { ListResponseArgsOfLogisticianDTO } from '../models/list-response-args-of-logistician-dto';
import { ResponseArgsOfLogisticianDTO } from '../models/response-args-of-logistician-dto';
@Injectable({
  providedIn: 'root',
})
class OrderService extends __BaseService {
  static readonly OrderGetOrderPath = '/order/{orderId}';
  static readonly OrderUpdateOrderPath = '/order/{orderId}';
  static readonly OrderPatchOrderPath = '/order/{orderId}';
  static readonly OrderDeleteOrderPath = '/order/{orderId}';
  static readonly OrderUpdateOrderItemSubsetPath = '/order/{orderId}/orderitem/{orderItemId}/orderitemsubset/{orderItemSubsetId}';
  static readonly OrderPatchOrderItemSubsetPath = '/order/{orderId}/orderitem/{orderItemId}/orderitemsubset/{orderItemSubsetId}';
  static readonly OrderGetOrdersByCompartmentPath = '/order/compartment';
  static readonly OrderGetOrdersByBuyerNumberPath = '/buyer/order';
  static readonly OrderQueryOrdersPath = '/order/s';
  static readonly OrderQueryOrderItemPath = '/order/item/s';
  static readonly OrderGetOrderItemPath = '/order/orderitem/{orderItemId}';
  static readonly OrderGetOrderItemsPath = '/order/orderitem';
  static readonly OrderUpdateOrderItemPath = '/order/{orderId}/orderitem/{orderItemId}';
  static readonly OrderPatchOrderItemPath = '/order/{orderId}/orderitem/{orderItemId}';
  static readonly OrderGetOrderItemHistoryPath = '/order/orderitem/{orderItemId}/history';
  static readonly OrderGetOrderItemSubsetPath = '/order/orderitem/orderitemsubset/{orderItemSubsetId}';
  static readonly OrderGetOrderItemStatusHistoryPath = '/order/orderitem/orderitemsubset/{orderItemSubsetId}/history';
  static readonly OrderChangeStatusPath = '/order/{orderId}/orderitem/{orderItemId}/orderitemsubset/{orderItemSubsetId}/changestatus';
  static readonly OrderChangeStockStatusCodePath = '/order/orderitem/orderitemsubset/changestockstatuscode';
  static readonly OrderCollectOnDeliveryNotePath = '/order/orderitem/orderitemsubset/collectondeliverynote';
  static readonly OrderQueryOrderItemSubsetTasksPath = '/order/item/subset/task/s';
  static readonly OrderGetOrderItemSubsetTasksPath = '/order/{orderId}/item/{orderItemId}/subset/{orderItemSubsetId}/task';
  static readonly OrderRegenerateOrderItemStatusTasksPath = '/order/{orderId}/orderItem/orderItemSubset/task/regenerate';
  static readonly OrderGetPayerPath = '/order/payer/{payerId}';
  static readonly OrderUpdatePayerPath = '/order/{orderId}/payer/{payerId}';
  static readonly OrderGetShippingAddressPath = '/order/shippingaddress/{shippingAddressId}';
  static readonly OrderUpdateShippingAddressPath = '/order/{orderId}/shippingaddress/{shippingAddressId}';
  static readonly OrderGetBranchesPath = '/order/branches';
  static readonly OrderGetStockStatusCodesPath = '/order/ssc/{supplierId}';
  static readonly OrderGetSuppilersPath = '/order/supplier';
  static readonly OrderGetSupplierPath = '/order/supplier/{supplierId}';
  static readonly OrderGetVATsPath = '/order/vat';
  static readonly OrderGetVATPath = '/order/vat/{vatId}';
  static readonly OrderGetLogisticiansPath = '/order/logistician';
  static readonly OrderGetLogisticianByIdPath = '/order/logistician/{logisticianId}';

  constructor(
    config: __Configuration,
    http: HttpClient
  ) {
    super(config, http);
  }

  /**
   * @param orderId undefined
   */
  OrderGetOrderResponse(orderId: number): __Observable<__StrictHttpResponse<ResponseArgsOfOrderDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/order/${encodeURIComponent(orderId)}`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfOrderDTO>;
      })
    );
  }
  /**
   * @param orderId undefined
   */
  OrderGetOrder(orderId: number): __Observable<ResponseArgsOfOrderDTO> {
    return this.OrderGetOrderResponse(orderId).pipe(
      __map(_r => _r.body as ResponseArgsOfOrderDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderUpdateOrderParams` containing the following parameters:
   *
   * - `orderId`:
   *
   * - `order`:
   */
  OrderUpdateOrderResponse(params: OrderService.OrderUpdateOrderParams): __Observable<__StrictHttpResponse<ResponseArgsOfOrderDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    __body = params.order;
    let req = new HttpRequest<any>(
      'PUT',
      this.rootUrl + `/order/${encodeURIComponent(params.orderId)}`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfOrderDTO>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderUpdateOrderParams` containing the following parameters:
   *
   * - `orderId`:
   *
   * - `order`:
   */
  OrderUpdateOrder(params: OrderService.OrderUpdateOrderParams): __Observable<ResponseArgsOfOrderDTO> {
    return this.OrderUpdateOrderResponse(params).pipe(
      __map(_r => _r.body as ResponseArgsOfOrderDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderPatchOrderParams` containing the following parameters:
   *
   * - `orderId`:
   *
   * - `order`:
   *
   * - `eagerLoading`:
   */
  OrderPatchOrderResponse(params: OrderService.OrderPatchOrderParams): __Observable<__StrictHttpResponse<ResponseArgsOfOrderDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    __body = params.order;
    if (params.eagerLoading != null) __params = __params.set('eagerLoading', params.eagerLoading.toString());
    let req = new HttpRequest<any>(
      'PATCH',
      this.rootUrl + `/order/${encodeURIComponent(params.orderId)}`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfOrderDTO>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderPatchOrderParams` containing the following parameters:
   *
   * - `orderId`:
   *
   * - `order`:
   *
   * - `eagerLoading`:
   */
  OrderPatchOrder(params: OrderService.OrderPatchOrderParams): __Observable<ResponseArgsOfOrderDTO> {
    return this.OrderPatchOrderResponse(params).pipe(
      __map(_r => _r.body as ResponseArgsOfOrderDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderDeleteOrderParams` containing the following parameters:
   *
   * - `orderId`:
   *
   * - `deletionComment`:
   */
  OrderDeleteOrderResponse(params: OrderService.OrderDeleteOrderParams): __Observable<__StrictHttpResponse<ResponseArgsOfBoolean>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    if (params.deletionComment != null) __params = __params.set('deletionComment', params.deletionComment.toString());
    let req = new HttpRequest<any>(
      'DELETE',
      this.rootUrl + `/order/${encodeURIComponent(params.orderId)}`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfBoolean>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderDeleteOrderParams` containing the following parameters:
   *
   * - `orderId`:
   *
   * - `deletionComment`:
   */
  OrderDeleteOrder(params: OrderService.OrderDeleteOrderParams): __Observable<ResponseArgsOfBoolean> {
    return this.OrderDeleteOrderResponse(params).pipe(
      __map(_r => _r.body as ResponseArgsOfBoolean)
    );
  }

  /**
   * @param params The `OrderService.OrderUpdateOrderItemSubsetParams` containing the following parameters:
   *
   * - `orderItemSubsetId`:
   *
   * - `orderItemSubset`:
   *
   * - `orderItemId`:
   *
   * - `orderId`:
   */
  OrderUpdateOrderItemSubsetResponse(params: OrderService.OrderUpdateOrderItemSubsetParams): __Observable<__StrictHttpResponse<ResponseArgsOfOrderItemDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    __body = params.orderItemSubset;


    let req = new HttpRequest<any>(
      'PUT',
      this.rootUrl + `/order/${encodeURIComponent(params.orderId)}/orderitem/${encodeURIComponent(params.orderItemId)}/orderitemsubset/${encodeURIComponent(params.orderItemSubsetId)}`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfOrderItemDTO>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderUpdateOrderItemSubsetParams` containing the following parameters:
   *
   * - `orderItemSubsetId`:
   *
   * - `orderItemSubset`:
   *
   * - `orderItemId`:
   *
   * - `orderId`:
   */
  OrderUpdateOrderItemSubset(params: OrderService.OrderUpdateOrderItemSubsetParams): __Observable<ResponseArgsOfOrderItemDTO> {
    return this.OrderUpdateOrderItemSubsetResponse(params).pipe(
      __map(_r => _r.body as ResponseArgsOfOrderItemDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderPatchOrderItemSubsetParams` containing the following parameters:
   *
   * - `orderItemSubsetId`:
   *
   * - `orderItemSubset`:
   *
   * - `orderItemId`:
   *
   * - `orderId`:
   */
  OrderPatchOrderItemSubsetResponse(params: OrderService.OrderPatchOrderItemSubsetParams): __Observable<__StrictHttpResponse<ResponseArgsOfOrderItemSubsetDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    __body = params.orderItemSubset;


    let req = new HttpRequest<any>(
      'PATCH',
      this.rootUrl + `/order/${encodeURIComponent(params.orderId)}/orderitem/${encodeURIComponent(params.orderItemId)}/orderitemsubset/${encodeURIComponent(params.orderItemSubsetId)}`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfOrderItemSubsetDTO>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderPatchOrderItemSubsetParams` containing the following parameters:
   *
   * - `orderItemSubsetId`:
   *
   * - `orderItemSubset`:
   *
   * - `orderItemId`:
   *
   * - `orderId`:
   */
  OrderPatchOrderItemSubset(params: OrderService.OrderPatchOrderItemSubsetParams): __Observable<ResponseArgsOfOrderItemSubsetDTO> {
    return this.OrderPatchOrderItemSubsetResponse(params).pipe(
      __map(_r => _r.body as ResponseArgsOfOrderItemSubsetDTO)
    );
  }

  /**
   * @param compartmentCodes undefined
   */
  OrderGetOrdersByCompartmentResponse(compartmentCodes: Array<string>): __Observable<__StrictHttpResponse<ResponseArgsOfIEnumerableOfOrderDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;
    __body = compartmentCodes;
    let req = new HttpRequest<any>(
      'POST',
      this.rootUrl + `/order/compartment`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfOrderDTO>;
      })
    );
  }
  /**
   * @param compartmentCodes undefined
   */
  OrderGetOrdersByCompartment(compartmentCodes: Array<string>): __Observable<ResponseArgsOfIEnumerableOfOrderDTO> {
    return this.OrderGetOrdersByCompartmentResponse(compartmentCodes).pipe(
      __map(_r => _r.body as ResponseArgsOfIEnumerableOfOrderDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderGetOrdersByBuyerNumberParams` containing the following parameters:
   *
   * - `take`:
   *
   * - `skip`:
   *
   * - `buyerNumber`:
   */
  OrderGetOrdersByBuyerNumberResponse(params: OrderService.OrderGetOrdersByBuyerNumberParams): __Observable<__StrictHttpResponse<ListResponseArgsOfOrderListItemDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;
    if (params.take != null) __params = __params.set('take', params.take.toString());
    if (params.skip != null) __params = __params.set('skip', params.skip.toString());
    if (params.buyerNumber != null) __params = __params.set('buyerNumber', params.buyerNumber.toString());
    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/buyer/order`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ListResponseArgsOfOrderListItemDTO>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderGetOrdersByBuyerNumberParams` containing the following parameters:
   *
   * - `take`:
   *
   * - `skip`:
   *
   * - `buyerNumber`:
   */
  OrderGetOrdersByBuyerNumber(params: OrderService.OrderGetOrdersByBuyerNumberParams): __Observable<ListResponseArgsOfOrderListItemDTO> {
    return this.OrderGetOrdersByBuyerNumberResponse(params).pipe(
      __map(_r => _r.body as ListResponseArgsOfOrderListItemDTO)
    );
  }

  /**
   * @param queryToken undefined
   */
  OrderQueryOrdersResponse(queryToken: QueryTokenDTO): __Observable<__StrictHttpResponse<ListResponseArgsOfOrderListItemDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;
    __body = queryToken;
    let req = new HttpRequest<any>(
      'POST',
      this.rootUrl + `/order/s`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ListResponseArgsOfOrderListItemDTO>;
      })
    );
  }
  /**
   * @param queryToken undefined
   */
  OrderQueryOrders(queryToken: QueryTokenDTO): __Observable<ListResponseArgsOfOrderListItemDTO> {
    return this.OrderQueryOrdersResponse(queryToken).pipe(
      __map(_r => _r.body as ListResponseArgsOfOrderListItemDTO)
    );
  }

  /**
   * @param queryToken undefined
   */
  OrderQueryOrderItemResponse(queryToken: QueryTokenDTO): __Observable<__StrictHttpResponse<ListResponseArgsOfOrderItemListItemDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;
    __body = queryToken;
    let req = new HttpRequest<any>(
      'POST',
      this.rootUrl + `/order/item/s`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ListResponseArgsOfOrderItemListItemDTO>;
      })
    );
  }
  /**
   * @param queryToken undefined
   */
  OrderQueryOrderItem(queryToken: QueryTokenDTO): __Observable<ListResponseArgsOfOrderItemListItemDTO> {
    return this.OrderQueryOrderItemResponse(queryToken).pipe(
      __map(_r => _r.body as ListResponseArgsOfOrderItemListItemDTO)
    );
  }

  /**
   * @param orderItemId undefined
   */
  OrderGetOrderItemResponse(orderItemId: number): __Observable<__StrictHttpResponse<ResponseArgsOfOrderItemDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/order/orderitem/${encodeURIComponent(orderItemId)}`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfOrderItemDTO>;
      })
    );
  }
  /**
   * @param orderItemId undefined
   */
  OrderGetOrderItem(orderItemId: number): __Observable<ResponseArgsOfOrderItemDTO> {
    return this.OrderGetOrderItemResponse(orderItemId).pipe(
      __map(_r => _r.body as ResponseArgsOfOrderItemDTO)
    );
  }

  /**
   * @param orderItemIds undefined
   */
  OrderGetOrderItemsResponse(orderItemIds?: null | Array<number>): __Observable<__StrictHttpResponse<ResponseArgsOfIEnumerableOfOrderItemDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;
    (orderItemIds || []).forEach(val => {if (val != null) __params = __params.append('orderItemIds', val.toString())});
    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/order/orderitem`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfOrderItemDTO>;
      })
    );
  }
  /**
   * @param orderItemIds undefined
   */
  OrderGetOrderItems(orderItemIds?: null | Array<number>): __Observable<ResponseArgsOfIEnumerableOfOrderItemDTO> {
    return this.OrderGetOrderItemsResponse(orderItemIds).pipe(
      __map(_r => _r.body as ResponseArgsOfIEnumerableOfOrderItemDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderUpdateOrderItemParams` containing the following parameters:
   *
   * - `orderItemId`:
   *
   * - `orderItem`:
   *
   * - `orderId`:
   */
  OrderUpdateOrderItemResponse(params: OrderService.OrderUpdateOrderItemParams): __Observable<__StrictHttpResponse<ResponseArgsOfOrderItemDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    __body = params.orderItem;

    let req = new HttpRequest<any>(
      'PUT',
      this.rootUrl + `/order/${encodeURIComponent(params.orderId)}/orderitem/${encodeURIComponent(params.orderItemId)}`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfOrderItemDTO>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderUpdateOrderItemParams` containing the following parameters:
   *
   * - `orderItemId`:
   *
   * - `orderItem`:
   *
   * - `orderId`:
   */
  OrderUpdateOrderItem(params: OrderService.OrderUpdateOrderItemParams): __Observable<ResponseArgsOfOrderItemDTO> {
    return this.OrderUpdateOrderItemResponse(params).pipe(
      __map(_r => _r.body as ResponseArgsOfOrderItemDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderPatchOrderItemParams` containing the following parameters:
   *
   * - `orderItemId`:
   *
   * - `orderItem`:
   *
   * - `orderId`:
   */
  OrderPatchOrderItemResponse(params: OrderService.OrderPatchOrderItemParams): __Observable<__StrictHttpResponse<ResponseArgsOfOrderItemDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    __body = params.orderItem;

    let req = new HttpRequest<any>(
      'PATCH',
      this.rootUrl + `/order/${encodeURIComponent(params.orderId)}/orderitem/${encodeURIComponent(params.orderItemId)}`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfOrderItemDTO>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderPatchOrderItemParams` containing the following parameters:
   *
   * - `orderItemId`:
   *
   * - `orderItem`:
   *
   * - `orderId`:
   */
  OrderPatchOrderItem(params: OrderService.OrderPatchOrderItemParams): __Observable<ResponseArgsOfOrderItemDTO> {
    return this.OrderPatchOrderItemResponse(params).pipe(
      __map(_r => _r.body as ResponseArgsOfOrderItemDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderGetOrderItemHistoryParams` containing the following parameters:
   *
   * - `orderItemId`:
   *
   * - `locale`:
   */
  OrderGetOrderItemHistoryResponse(params: OrderService.OrderGetOrderItemHistoryParams): __Observable<__StrictHttpResponse<ResponseArgsOfHistoryDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    if (params.locale != null) __params = __params.set('locale', params.locale.toString());
    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/order/orderitem/${encodeURIComponent(params.orderItemId)}/history`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfHistoryDTO>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderGetOrderItemHistoryParams` containing the following parameters:
   *
   * - `orderItemId`:
   *
   * - `locale`:
   */
  OrderGetOrderItemHistory(params: OrderService.OrderGetOrderItemHistoryParams): __Observable<ResponseArgsOfHistoryDTO> {
    return this.OrderGetOrderItemHistoryResponse(params).pipe(
      __map(_r => _r.body as ResponseArgsOfHistoryDTO)
    );
  }

  /**
   * @param orderItemSubsetId undefined
   */
  OrderGetOrderItemSubsetResponse(orderItemSubsetId: number): __Observable<__StrictHttpResponse<ResponseArgsOfOrderItemSubsetDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/order/orderitem/orderitemsubset/${encodeURIComponent(orderItemSubsetId)}`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfOrderItemSubsetDTO>;
      })
    );
  }
  /**
   * @param orderItemSubsetId undefined
   */
  OrderGetOrderItemSubset(orderItemSubsetId: number): __Observable<ResponseArgsOfOrderItemSubsetDTO> {
    return this.OrderGetOrderItemSubsetResponse(orderItemSubsetId).pipe(
      __map(_r => _r.body as ResponseArgsOfOrderItemSubsetDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderGetOrderItemStatusHistoryParams` containing the following parameters:
   *
   * - `orderItemSubsetId`:
   *
   * - `locale`:
   */
  OrderGetOrderItemStatusHistoryResponse(params: OrderService.OrderGetOrderItemStatusHistoryParams): __Observable<__StrictHttpResponse<ResponseArgsOfHistoryDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    if (params.locale != null) __params = __params.set('locale', params.locale.toString());
    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/order/orderitem/orderitemsubset/${encodeURIComponent(params.orderItemSubsetId)}/history`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfHistoryDTO>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderGetOrderItemStatusHistoryParams` containing the following parameters:
   *
   * - `orderItemSubsetId`:
   *
   * - `locale`:
   */
  OrderGetOrderItemStatusHistory(params: OrderService.OrderGetOrderItemStatusHistoryParams): __Observable<ResponseArgsOfHistoryDTO> {
    return this.OrderGetOrderItemStatusHistoryResponse(params).pipe(
      __map(_r => _r.body as ResponseArgsOfHistoryDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderChangeStatusParams` containing the following parameters:
   *
   * - `orderItemSubsetId`:
   *
   * - `orderItemId`:
   *
   * - `orderId`:
   *
   * - `data`:
   */
  OrderChangeStatusResponse(params: OrderService.OrderChangeStatusParams): __Observable<__StrictHttpResponse<ResponseArgsOfValueTupleOfOrderItemSubsetDTOAndOrderItemSubsetDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;



    __body = params.data;
    let req = new HttpRequest<any>(
      'PATCH',
      this.rootUrl + `/order/${encodeURIComponent(params.orderId)}/orderitem/${encodeURIComponent(params.orderItemId)}/orderitemsubset/${encodeURIComponent(params.orderItemSubsetId)}/changestatus`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfValueTupleOfOrderItemSubsetDTOAndOrderItemSubsetDTO>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderChangeStatusParams` containing the following parameters:
   *
   * - `orderItemSubsetId`:
   *
   * - `orderItemId`:
   *
   * - `orderId`:
   *
   * - `data`:
   */
  OrderChangeStatus(params: OrderService.OrderChangeStatusParams): __Observable<ResponseArgsOfValueTupleOfOrderItemSubsetDTOAndOrderItemSubsetDTO> {
    return this.OrderChangeStatusResponse(params).pipe(
      __map(_r => _r.body as ResponseArgsOfValueTupleOfOrderItemSubsetDTOAndOrderItemSubsetDTO)
    );
  }

  /**
   * @param data undefined
   */
  OrderChangeStockStatusCodeResponse(data: Array<ChangeStockStatusCodeValues>): __Observable<__StrictHttpResponse<ResponseArgsOfIEnumerableOfValueTupleOfOrderItemSubsetDTOAndOrderItemSubsetDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;
    __body = data;
    let req = new HttpRequest<any>(
      'POST',
      this.rootUrl + `/order/orderitem/orderitemsubset/changestockstatuscode`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfValueTupleOfOrderItemSubsetDTOAndOrderItemSubsetDTO>;
      })
    );
  }
  /**
   * @param data undefined
   */
  OrderChangeStockStatusCode(data: Array<ChangeStockStatusCodeValues>): __Observable<ResponseArgsOfIEnumerableOfValueTupleOfOrderItemSubsetDTOAndOrderItemSubsetDTO> {
    return this.OrderChangeStockStatusCodeResponse(data).pipe(
      __map(_r => _r.body as ResponseArgsOfIEnumerableOfValueTupleOfOrderItemSubsetDTOAndOrderItemSubsetDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderCollectOnDeliveryNoteParams` containing the following parameters:
   *
   * - `data`:
   *
   * - `eagerLoading`:
   */
  OrderCollectOnDeliveryNoteResponse(params: OrderService.OrderCollectOnDeliveryNoteParams): __Observable<__StrictHttpResponse<ResponseArgsOfIEnumerableOfEntityDTOContainerOfReceiptDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;
    __body = params.data;
    if (params.eagerLoading != null) __params = __params.set('eagerLoading', params.eagerLoading.toString());
    let req = new HttpRequest<any>(
      'POST',
      this.rootUrl + `/order/orderitem/orderitemsubset/collectondeliverynote`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfEntityDTOContainerOfReceiptDTO>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderCollectOnDeliveryNoteParams` containing the following parameters:
   *
   * - `data`:
   *
   * - `eagerLoading`:
   */
  OrderCollectOnDeliveryNote(params: OrderService.OrderCollectOnDeliveryNoteParams): __Observable<ResponseArgsOfIEnumerableOfEntityDTOContainerOfReceiptDTO> {
    return this.OrderCollectOnDeliveryNoteResponse(params).pipe(
      __map(_r => _r.body as ResponseArgsOfIEnumerableOfEntityDTOContainerOfReceiptDTO)
    );
  }

  /**
   * @param queryToken undefined
   */
  OrderQueryOrderItemSubsetTasksResponse(queryToken: QueryTokenDTO): __Observable<__StrictHttpResponse<ListResponseArgsOfOrderItemSubsetTaskListItemDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;
    __body = queryToken;
    let req = new HttpRequest<any>(
      'POST',
      this.rootUrl + `/order/item/subset/task/s`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ListResponseArgsOfOrderItemSubsetTaskListItemDTO>;
      })
    );
  }
  /**
   * @param queryToken undefined
   */
  OrderQueryOrderItemSubsetTasks(queryToken: QueryTokenDTO): __Observable<ListResponseArgsOfOrderItemSubsetTaskListItemDTO> {
    return this.OrderQueryOrderItemSubsetTasksResponse(queryToken).pipe(
      __map(_r => _r.body as ListResponseArgsOfOrderItemSubsetTaskListItemDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderGetOrderItemSubsetTasksParams` containing the following parameters:
   *
   * - `orderItemSubsetId`:
   *
   * - `orderItemId`:
   *
   * - `orderId`:
   *
   * - `take`:
   *
   * - `skip`:
   *
   * - `completed`:
   */
  OrderGetOrderItemSubsetTasksResponse(params: OrderService.OrderGetOrderItemSubsetTasksParams): __Observable<__StrictHttpResponse<ListResponseArgsOfOrderItemSubsetTaskListItemDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;



    if (params.take != null) __params = __params.set('take', params.take.toString());
    if (params.skip != null) __params = __params.set('skip', params.skip.toString());
    if (params.completed != null) __params = __params.set('completed', params.completed.toString());
    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/order/${encodeURIComponent(params.orderId)}/item/${encodeURIComponent(params.orderItemId)}/subset/${encodeURIComponent(params.orderItemSubsetId)}/task`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ListResponseArgsOfOrderItemSubsetTaskListItemDTO>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderGetOrderItemSubsetTasksParams` containing the following parameters:
   *
   * - `orderItemSubsetId`:
   *
   * - `orderItemId`:
   *
   * - `orderId`:
   *
   * - `take`:
   *
   * - `skip`:
   *
   * - `completed`:
   */
  OrderGetOrderItemSubsetTasks(params: OrderService.OrderGetOrderItemSubsetTasksParams): __Observable<ListResponseArgsOfOrderItemSubsetTaskListItemDTO> {
    return this.OrderGetOrderItemSubsetTasksResponse(params).pipe(
      __map(_r => _r.body as ListResponseArgsOfOrderItemSubsetTaskListItemDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderRegenerateOrderItemStatusTasksParams` containing the following parameters:
   *
   * - `orderId`:
   *
   * - `taskTypes`:
   */
  OrderRegenerateOrderItemStatusTasksResponse(params: OrderService.OrderRegenerateOrderItemStatusTasksParams): __Observable<__StrictHttpResponse<ResponseArgsOfInteger>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    __body = params.taskTypes;
    let req = new HttpRequest<any>(
      'POST',
      this.rootUrl + `/order/${encodeURIComponent(params.orderId)}/orderItem/orderItemSubset/task/regenerate`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfInteger>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderRegenerateOrderItemStatusTasksParams` containing the following parameters:
   *
   * - `orderId`:
   *
   * - `taskTypes`:
   */
  OrderRegenerateOrderItemStatusTasks(params: OrderService.OrderRegenerateOrderItemStatusTasksParams): __Observable<ResponseArgsOfInteger> {
    return this.OrderRegenerateOrderItemStatusTasksResponse(params).pipe(
      __map(_r => _r.body as ResponseArgsOfInteger)
    );
  }

  /**
   * @param payerId undefined
   */
  OrderGetPayerResponse(payerId: number): __Observable<__StrictHttpResponse<ResponseArgsOfPayerDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/order/payer/${encodeURIComponent(payerId)}`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfPayerDTO>;
      })
    );
  }
  /**
   * @param payerId undefined
   */
  OrderGetPayer(payerId: number): __Observable<ResponseArgsOfPayerDTO> {
    return this.OrderGetPayerResponse(payerId).pipe(
      __map(_r => _r.body as ResponseArgsOfPayerDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderUpdatePayerParams` containing the following parameters:
   *
   * - `payerId`:
   *
   * - `payer`:
   *
   * - `orderId`:
   */
  OrderUpdatePayerResponse(params: OrderService.OrderUpdatePayerParams): __Observable<__StrictHttpResponse<ResponseArgsOfOrderDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    __body = params.payer;

    let req = new HttpRequest<any>(
      'PUT',
      this.rootUrl + `/order/${encodeURIComponent(params.orderId)}/payer/${encodeURIComponent(params.payerId)}`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfOrderDTO>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderUpdatePayerParams` containing the following parameters:
   *
   * - `payerId`:
   *
   * - `payer`:
   *
   * - `orderId`:
   */
  OrderUpdatePayer(params: OrderService.OrderUpdatePayerParams): __Observable<ResponseArgsOfOrderDTO> {
    return this.OrderUpdatePayerResponse(params).pipe(
      __map(_r => _r.body as ResponseArgsOfOrderDTO)
    );
  }

  /**
   * @param shippingAddressId undefined
   */
  OrderGetShippingAddressResponse(shippingAddressId: number): __Observable<__StrictHttpResponse<ResponseArgsOfShippingAddressDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/order/shippingaddress/${encodeURIComponent(shippingAddressId)}`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfShippingAddressDTO>;
      })
    );
  }
  /**
   * @param shippingAddressId undefined
   */
  OrderGetShippingAddress(shippingAddressId: number): __Observable<ResponseArgsOfShippingAddressDTO> {
    return this.OrderGetShippingAddressResponse(shippingAddressId).pipe(
      __map(_r => _r.body as ResponseArgsOfShippingAddressDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderUpdateShippingAddressParams` containing the following parameters:
   *
   * - `shippingAddressId`:
   *
   * - `shippingAddress`:
   *
   * - `orderId`:
   */
  OrderUpdateShippingAddressResponse(params: OrderService.OrderUpdateShippingAddressParams): __Observable<__StrictHttpResponse<ResponseArgsOfShippingAddressDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    __body = params.shippingAddress;

    let req = new HttpRequest<any>(
      'PUT',
      this.rootUrl + `/order/${encodeURIComponent(params.orderId)}/shippingaddress/${encodeURIComponent(params.shippingAddressId)}`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfShippingAddressDTO>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderUpdateShippingAddressParams` containing the following parameters:
   *
   * - `shippingAddressId`:
   *
   * - `shippingAddress`:
   *
   * - `orderId`:
   */
  OrderUpdateShippingAddress(params: OrderService.OrderUpdateShippingAddressParams): __Observable<ResponseArgsOfShippingAddressDTO> {
    return this.OrderUpdateShippingAddressResponse(params).pipe(
      __map(_r => _r.body as ResponseArgsOfShippingAddressDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderGetBranchesParams` containing the following parameters:
   *
   * - `take`:
   *
   * - `skip`:
   *
   * - `locale`:
   *
   * - `labelOnly`:
   */
  OrderGetBranchesResponse(params: OrderService.OrderGetBranchesParams): __Observable<__StrictHttpResponse<ResponseArgsOfIEnumerableOfBranchDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;
    if (params.take != null) __params = __params.set('take', params.take.toString());
    if (params.skip != null) __params = __params.set('skip', params.skip.toString());
    if (params.locale != null) __params = __params.set('locale', params.locale.toString());
    if (params.labelOnly != null) __params = __params.set('labelOnly', params.labelOnly.toString());
    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/order/branches`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfBranchDTO>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderGetBranchesParams` containing the following parameters:
   *
   * - `take`:
   *
   * - `skip`:
   *
   * - `locale`:
   *
   * - `labelOnly`:
   */
  OrderGetBranches(params: OrderService.OrderGetBranchesParams): __Observable<ResponseArgsOfIEnumerableOfBranchDTO> {
    return this.OrderGetBranchesResponse(params).pipe(
      __map(_r => _r.body as ResponseArgsOfIEnumerableOfBranchDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderGetStockStatusCodesParams` containing the following parameters:
   *
   * - `supplierId`:
   *
   * - `eagerLoading`:
   *
   * - `code`:
   */
  OrderGetStockStatusCodesResponse(params: OrderService.OrderGetStockStatusCodesParams): __Observable<__StrictHttpResponse<ResponseArgsOfIEnumerableOfStockStatusCodeDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    if (params.eagerLoading != null) __params = __params.set('eagerLoading', params.eagerLoading.toString());
    if (params.code != null) __params = __params.set('code', params.code.toString());
    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/order/ssc/${encodeURIComponent(params.supplierId)}`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfIEnumerableOfStockStatusCodeDTO>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderGetStockStatusCodesParams` containing the following parameters:
   *
   * - `supplierId`:
   *
   * - `eagerLoading`:
   *
   * - `code`:
   */
  OrderGetStockStatusCodes(params: OrderService.OrderGetStockStatusCodesParams): __Observable<ResponseArgsOfIEnumerableOfStockStatusCodeDTO> {
    return this.OrderGetStockStatusCodesResponse(params).pipe(
      __map(_r => _r.body as ResponseArgsOfIEnumerableOfStockStatusCodeDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderGetSuppilersParams` containing the following parameters:
   *
   * - `take`:
   *
   * - `skip`:
   */
  OrderGetSuppilersResponse(params: OrderService.OrderGetSuppilersParams): __Observable<__StrictHttpResponse<ListResponseArgsOfSupplierDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;
    if (params.take != null) __params = __params.set('take', params.take.toString());
    if (params.skip != null) __params = __params.set('skip', params.skip.toString());
    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/order/supplier`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ListResponseArgsOfSupplierDTO>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderGetSuppilersParams` containing the following parameters:
   *
   * - `take`:
   *
   * - `skip`:
   */
  OrderGetSuppilers(params: OrderService.OrderGetSuppilersParams): __Observable<ListResponseArgsOfSupplierDTO> {
    return this.OrderGetSuppilersResponse(params).pipe(
      __map(_r => _r.body as ListResponseArgsOfSupplierDTO)
    );
  }

  /**
   * @param supplierId undefined
   */
  OrderGetSupplierResponse(supplierId: number): __Observable<__StrictHttpResponse<ResponseArgsOfSupplierDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/order/supplier/${encodeURIComponent(supplierId)}`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfSupplierDTO>;
      })
    );
  }
  /**
   * @param supplierId undefined
   */
  OrderGetSupplier(supplierId: number): __Observable<ResponseArgsOfSupplierDTO> {
    return this.OrderGetSupplierResponse(supplierId).pipe(
      __map(_r => _r.body as ResponseArgsOfSupplierDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderGetVATsParams` containing the following parameters:
   *
   * - `take`:
   *
   * - `skip`:
   */
  OrderGetVATsResponse(params: OrderService.OrderGetVATsParams): __Observable<__StrictHttpResponse<ListResponseArgsOfVATDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;
    if (params.take != null) __params = __params.set('take', params.take.toString());
    if (params.skip != null) __params = __params.set('skip', params.skip.toString());
    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/order/vat`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ListResponseArgsOfVATDTO>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderGetVATsParams` containing the following parameters:
   *
   * - `take`:
   *
   * - `skip`:
   */
  OrderGetVATs(params: OrderService.OrderGetVATsParams): __Observable<ListResponseArgsOfVATDTO> {
    return this.OrderGetVATsResponse(params).pipe(
      __map(_r => _r.body as ListResponseArgsOfVATDTO)
    );
  }

  /**
   * @param vatId undefined
   */
  OrderGetVATResponse(vatId: number): __Observable<__StrictHttpResponse<ResponseArgsOfVATDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/order/vat/${encodeURIComponent(vatId)}`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfVATDTO>;
      })
    );
  }
  /**
   * @param vatId undefined
   */
  OrderGetVAT(vatId: number): __Observable<ResponseArgsOfVATDTO> {
    return this.OrderGetVATResponse(vatId).pipe(
      __map(_r => _r.body as ResponseArgsOfVATDTO)
    );
  }

  /**
   * @param params The `OrderService.OrderGetLogisticiansParams` containing the following parameters:
   *
   * - `take`:
   *
   * - `skip`:
   */
  OrderGetLogisticiansResponse(params: OrderService.OrderGetLogisticiansParams): __Observable<__StrictHttpResponse<ListResponseArgsOfLogisticianDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;
    if (params.take != null) __params = __params.set('take', params.take.toString());
    if (params.skip != null) __params = __params.set('skip', params.skip.toString());
    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/order/logistician`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ListResponseArgsOfLogisticianDTO>;
      })
    );
  }
  /**
   * @param params The `OrderService.OrderGetLogisticiansParams` containing the following parameters:
   *
   * - `take`:
   *
   * - `skip`:
   */
  OrderGetLogisticians(params: OrderService.OrderGetLogisticiansParams): __Observable<ListResponseArgsOfLogisticianDTO> {
    return this.OrderGetLogisticiansResponse(params).pipe(
      __map(_r => _r.body as ListResponseArgsOfLogisticianDTO)
    );
  }

  /**
   * @param logisticianId undefined
   */
  OrderGetLogisticianByIdResponse(logisticianId: number): __Observable<__StrictHttpResponse<ResponseArgsOfLogisticianDTO>> {
    let __params = this.newParams();
    let __headers = new HttpHeaders();
    let __body: any = null;

    let req = new HttpRequest<any>(
      'GET',
      this.rootUrl + `/order/logistician/${encodeURIComponent(logisticianId)}`,
      __body,
      {
        headers: __headers,
        params: __params,
        responseType: 'json'
      });

    return this.http.request<any>(req).pipe(
      __filter(_r => _r instanceof HttpResponse),
      __map((_r) => {
        return _r as __StrictHttpResponse<ResponseArgsOfLogisticianDTO>;
      })
    );
  }
  /**
   * @param logisticianId undefined
   */
  OrderGetLogisticianById(logisticianId: number): __Observable<ResponseArgsOfLogisticianDTO> {
    return this.OrderGetLogisticianByIdResponse(logisticianId).pipe(
      __map(_r => _r.body as ResponseArgsOfLogisticianDTO)
    );
  }
}

module OrderService {

  /**
   * Parameters for OrderUpdateOrder
   */
  export interface OrderUpdateOrderParams {
    orderId: number;
    order: OrderDTO;
  }

  /**
   * Parameters for OrderPatchOrder
   */
  export interface OrderPatchOrderParams {
    orderId: number;
    order: OrderDTO;
    eagerLoading?: number;
  }

  /**
   * Parameters for OrderDeleteOrder
   */
  export interface OrderDeleteOrderParams {
    orderId: number;
    deletionComment?: null | string;
  }

  /**
   * Parameters for OrderUpdateOrderItemSubset
   */
  export interface OrderUpdateOrderItemSubsetParams {
    orderItemSubsetId: number;
    orderItemSubset: OrderItemSubsetDTO;
    orderItemId: number;
    orderId: number;
  }

  /**
   * Parameters for OrderPatchOrderItemSubset
   */
  export interface OrderPatchOrderItemSubsetParams {
    orderItemSubsetId: number;
    orderItemSubset: OrderItemSubsetDTO;
    orderItemId: number;
    orderId: number;
  }

  /**
   * Parameters for OrderGetOrdersByBuyerNumber
   */
  export interface OrderGetOrdersByBuyerNumberParams {
    take?: null | number;
    skip?: null | number;
    buyerNumber?: null | string;
  }

  /**
   * Parameters for OrderUpdateOrderItem
   */
  export interface OrderUpdateOrderItemParams {
    orderItemId: number;
    orderItem: OrderItemDTO;
    orderId: number;
  }

  /**
   * Parameters for OrderPatchOrderItem
   */
  export interface OrderPatchOrderItemParams {
    orderItemId: number;
    orderItem: OrderItemDTO;
    orderId: number;
  }

  /**
   * Parameters for OrderGetOrderItemHistory
   */
  export interface OrderGetOrderItemHistoryParams {
    orderItemId: number;
    locale?: null | string;
  }

  /**
   * Parameters for OrderGetOrderItemStatusHistory
   */
  export interface OrderGetOrderItemStatusHistoryParams {
    orderItemSubsetId: number;
    locale?: null | string;
  }

  /**
   * Parameters for OrderChangeStatus
   */
  export interface OrderChangeStatusParams {
    orderItemSubsetId: number;
    orderItemId: number;
    orderId: number;
    data: StatusValues;
  }

  /**
   * Parameters for OrderCollectOnDeliveryNote
   */
  export interface OrderCollectOnDeliveryNoteParams {
    data: {[key: string]: number};
    eagerLoading?: number;
  }

  /**
   * Parameters for OrderGetOrderItemSubsetTasks
   */
  export interface OrderGetOrderItemSubsetTasksParams {
    orderItemSubsetId: number;
    orderItemId: number;
    orderId: number;
    take?: null | number;
    skip?: null | number;
    completed?: null | string;
  }

  /**
   * Parameters for OrderRegenerateOrderItemStatusTasks
   */
  export interface OrderRegenerateOrderItemStatusTasksParams {
    orderId: number;
    taskTypes?: Array<string>;
  }

  /**
   * Parameters for OrderUpdatePayer
   */
  export interface OrderUpdatePayerParams {
    payerId: number;
    payer: PayerDTO;
    orderId: number;
  }

  /**
   * Parameters for OrderUpdateShippingAddress
   */
  export interface OrderUpdateShippingAddressParams {
    shippingAddressId: number;
    shippingAddress: ShippingAddressDTO;
    orderId: number;
  }

  /**
   * Parameters for OrderGetBranches
   */
  export interface OrderGetBranchesParams {
    take?: null | number;
    skip?: null | number;
    locale?: null | string;
    labelOnly?: boolean;
  }

  /**
   * Parameters for OrderGetStockStatusCodes
   */
  export interface OrderGetStockStatusCodesParams {
    supplierId: number;
    eagerLoading?: number;
    code?: null | string;
  }

  /**
   * Parameters for OrderGetSuppilers
   */
  export interface OrderGetSuppilersParams {
    take?: null | number;
    skip?: null | number;
  }

  /**
   * Parameters for OrderGetVATs
   */
  export interface OrderGetVATsParams {
    take?: null | number;
    skip?: null | number;
  }

  /**
   * Parameters for OrderGetLogisticians
   */
  export interface OrderGetLogisticiansParams {
    take?: null | number;
    skip?: null | number;
  }
}

export { OrderService }
