import { Inject, Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';

import { ApiMethodBase } from 'oapi3codegen-agent-angular/api-method.base';
import { ApiSchema } from 'oapi3codegen-agent-angular/api-schema';
import {
  SERVERS_DATA,
  ServersData
} from 'oapi3codegen-agent-angular/servers.data.provider';
import {
  API_ERROR_HANDLER,
  ApiErrorHandler
} from 'oapi3codegen-agent-angular/event-manager.provider';

// Typings for this API method
import { GetStockCarByIdParameters, GetStockCarByIdResponse } from '../typings';

import * as domainSchema from './stock-cars.json';

/**
 * Service for angular based on ApiAgent solution.
 * Provides assured request to API method with implicit
 * validation and common errors handling scheme.
 */
@Injectable()
export class GetStockCarByIdService extends ApiMethodBase<
  GetStockCarByIdResponse,
  null,
  GetStockCarByIdParameters
> {
  protected get method(): 'GET' {
    return 'GET';
  }

  /**
   * Path template, example: `/some/path/{id}`.
   * @returns {string}
   */
  protected get pathTemplate(): string {
    return '/stock-cars/{id}';
  }

  /**
   * Parameters in a query.
   * @returns {string[]}
   */
  protected get queryParams(): string[] {
    return ['resolveDictionaries', 'expand'];
  }

  /**
   * API servers.
   * @returns {string[]}
   */
  protected get servers(): string[] {
    return ['http://lk.cm.local/api/site/'];
  }

  /**
   * Complete domain API schema (OAS3) with library
   * of models.
   * @returns {SubSchema}
   */
  protected get domainSchema(): any {
    return domainSchema;
  }

  /**
   * JSON Schemas using for validations at requests.
   * @returns {Schema}
   */
  protected get schema(): ApiSchema {
    return {
      response: {
        type: 'object',
        properties: {
          stockCar: { $ref: 'stock-cars.json#/components/schemas/StockCar' },
          stock: { $ref: 'stock-cars.json#/components/schemas/Stock' },
          stockGoalsControl: {
            $ref: 'stock-cars.json#/components/schemas/StockGoalsControl'
          },
          stockAppraisal: {
            $ref: 'stock-cars.json#/components/schemas/StockAppraisal'
          },
          stockAppraisalCarSearch: {
            $ref: 'stock-cars.json#/components/schemas/StockAppraisalCarSearch'
          },
          similarCarSearch: {
            $ref: 'stock-cars.json#/components/schemas/SimilarCarSearch'
          },
          dictionaryValueMeta: {
            type: 'object',
            properties: {
              stockCar: {
                type: 'object',
                additionalProperties: {
                  type: 'array',
                  items: {
                    $ref:
                      'stock-cars.json#/components/schemas/DictionaryValueMeta'
                  }
                }
              },
              stock: {
                type: 'object',
                additionalProperties: {
                  type: 'array',
                  items: {
                    $ref:
                      'stock-cars.json#/components/schemas/DictionaryValueMeta'
                  }
                }
              },
              stockAppraisal: {
                type: 'object',
                additionalProperties: {
                  type: 'array',
                  items: {
                    $ref:
                      'stock-cars.json#/components/schemas/DictionaryValueMeta'
                  }
                }
              },
              stockAppraisalCarSearch: {
                type: 'object',
                additionalProperties: {
                  type: 'array',
                  items: {
                    $ref:
                      'stock-cars.json#/components/schemas/DictionaryValueMeta'
                  }
                }
              },
              similarCarSearch: {
                type: 'object',
                additionalProperties: {
                  type: 'array',
                  items: {
                    $ref:
                      'stock-cars.json#/components/schemas/DictionaryValueMeta'
                  }
                }
              }
            }
          }
        },
        example: {
          stockCar: {
            id: 8487,
            dealerId: 20,
            brand: 7,
            model: 727,
            vin: 'XWEPC811*B0****17',
            creationYear: 2010,
            generationType: 5014,
            bodyDoors: { body: 4, doors: 5 },
            wheelType: 1,
            gearType: 2,
            driveType: 1,
            engineType: 1,
            engineVolume: 2,
            enginePower: 150,
            mileage: 106036,
            color: 12,
            vehicleType: 1,
            photos: [
              'https://21.img.avito.st/video/640x480/4551882821.jpg',
              'https://79.img.avito.st/640x480/4260601779.jpg',
              'https://84.img.avito.st/640x480/4260601784.jpg',
              'https://88.img.avito.st/640x480/4260601788.jpg',
              'https://92.img.avito.st/640x480/4260601792.jpg',
              'https://94.img.avito.st/640x480/4260601794.jpg',
              'https://98.img.avito.st/640x480/4260601798.jpg',
              'https://01.img.avito.st/640x480/4260601801.jpg',
              'https://02.img.avito.st/640x480/4260601802.jpg',
              'https://03.img.avito.st/640x480/4260601803.jpg',
              'https://04.img.avito.st/640x480/4260601804.jpg',
              'https://05.img.avito.st/640x480/4260601805.jpg',
              'https://06.img.avito.st/640x480/4260601806.jpg',
              'https://07.img.avito.st/640x480/4260601807.jpg',
              'https://08.img.avito.st/640x480/4260601808.jpg',
              'https://09.img.avito.st/640x480/4260601809.jpg',
              'https://10.img.avito.st/640x480/4260601810.jpg',
              'https://11.img.avito.st/640x480/4260601811.jpg',
              'https://12.img.avito.st/640x480/4260601812.jpg'
            ],
            stockExternalSource: 'offer',
            stockExternalId: '00985545',
            objectVersion: 979
          },
          stock: {
            id: 8487,
            stockState: 2,
            arrivedAt: '2016-12-01T00:00:00+03:00',
            outAt: '2018-07-13T20:51:20+03:00',
            saleAt: null,
            returnToSaleAt: null,
            contractType: null,
            inStockPeriod: 589,
            salesTacticId: 69,
            publishedDays: 590,
            publishStartedAt: '2016-12-01T00:00:00+03:00',
            publishFinishedAt: '2018-07-13T20:51:20+03:00',
            publishStatus: 2,
            lastPriceChangedAt: '2018-06-22T20:37:29+03:00',
            lastPriceChangedDays: 31,
            exposition: null,
            inChannel: null,
            outReason: null,
            certificated: null,
            saleStatus: 1,
            objectVersion: 0
          },
          similarCarSearch: {
            id: null,
            brand: 7,
            model: 727,
            generation: [5014],
            creationYear: {
              from: 2010,
              to: 2011,
              isFromInclusive: true,
              isToInclusive: true
            },
            vehicleType: [1],
            enginePower: {
              from: 120,
              to: 180,
              isFromInclusive: true,
              isToInclusive: true
            },
            engineVolume: {
              from: 1.9,
              to: 2.1,
              isFromInclusive: true,
              isToInclusive: true
            },
            engineType: [1],
            wheelType: [1],
            bodyDoors: [{ body: 4, doors: 5 }, { body: 4, doors: 3 }],
            driveType: [1, 2],
            gearType: [2],
            ownerType: [1, 2],
            status: 1,
            source: [487, 488],
            region: {
              type: 'regions',
              regions: [
                {
                  id: 1960671,
                  type: {
                    id: 103,
                    type: 'city',
                    shortName: 'г',
                    fullName: 'Город'
                  },
                  name: 'Москва',
                  coordinates: [55.75396, 37.620393],
                  distance: null,
                  count: 140701
                }
              ],
              radius: { coordinates: [55.751244, 37.618423], radius: 100 }
            },
            color: null,
            isExtendedByTwinsModels: false,
            isExtendedByMixedModels: false,
            canExtendingByTwinsModels: null,
            canExtendingByMixedModels: null,
            manualExcludedIds: [
              '2f614e016c16cced35b59f365c42fbae',
              '3fda7e6892787b274d9967955b07fc7f'
            ],
            manualIncludedIds: [],
            autoExcludedIds: [],
            climateControl: null,
            ac: null,
            parktronic: null,
            cruiseControl: null,
            startStopEngine: null,
            powerWindows: null,
            navigationSystem: null,
            backCamera: null,
            powerSteering: null,
            abs: null,
            esp: null,
            tcs: null,
            eds: null,
            airbag: null,
            airbagFront: null,
            airbagSide: null,
            airbagWindow: null,
            airbagKnees: null,
            alarm: null,
            armored: null,
            diskSize: null,
            diskType: null,
            winterTires: null,
            headlightType: null,
            fogLights: null,
            airSuspension: null,
            aerography: null,
            upholstery: null,
            heatedSeats: null,
            thirdRowSeats: null,
            sunroof: null,
            panoramicRoof: null,
            objectVersion: 0
          },
          stockAppraisal: {
            id: null,
            complexEstimate: '3',
            complexMdsEstimate: '3',
            complexMdsDays: 34,
            complexSalesEstimate: '3+',
            complexAvailabilityEstimate: '3+',
            complexPublishedEstimate: '3',
            complexPublishedAmount: 34,
            complexOffersAmount: 11.109589041096,
            complexSalesAmount: 4.943023255814,
            complexSalesEstimatingPeriod: 60,
            complexPercent: 57,
            complexMdsPercent: 52,
            complexSalesPercent: 62,
            complexAvailabilityPercent: 63,
            sellingPrice: 620000,
            pendingPrice: null,
            pendingPriceSetAt: null,
            recommendedRetailPrice: null,
            buyoutPrice: null,
            repairCost: null,
            expenses: null,
            markup: null,
            markupPotential: 716000,
            profitPotentialDay: null,
            profitPotentialMonth: null,
            profitPotentialPercent: null,
            markupPercent: null,
            expensesPercent: null,
            marketPricesRating: 1,
            marketPricesMileageRating: 1,
            priceMileageCategory: 1,
            similarCarsTotal: 13,
            similarCarsAvgMillage: 105267,
            similarCarsMedianPrice: 716650,
            sellingPricePercent: 87,
            attentionPercent: null,
            salePeriod: 5,
            fullAttentionImpressionsPerDay: null,
            avgImpressionsPerDay: null,
            similarCarsAdjustedPrice: 715952,
            attentionRating: null,
            attentionCategory: null,
            priceCategory: 1,
            attentionSimilarCarsTotal: 1,
            geo: [1960671, 1573301],
            objectVersion: 0
          },
          stockAppraisalCarSearch: {
            region: {
              type: 'regions',
              regions: [
                {
                  id: 1960671,
                  type: {
                    id: 103,
                    type: 'city',
                    shortName: 'г',
                    fullName: 'Город'
                  },
                  name: 'Москва',
                  coordinates: [55.75396, 37.620393],
                  distance: null,
                  count: 140701
                },
                {
                  id: 1573301,
                  type: {
                    id: 105,
                    type: 'region',
                    shortName: 'обл',
                    fullName: 'Область'
                  },
                  name: 'Московская',
                  coordinates: [55.75496, 37.621393],
                  distance: null,
                  count: 46579
                }
              ],
              radius: { coordinates: [0, 0], radius: 0 }
            },
            creationYear: [2010, 2011, true, true],
            enginePower: [120, 180, true, true],
            engineVolume: [1.9, 2.1, true, true],
            bodyDoors: { body: 4, doors: 5 },
            brand: 7,
            model: 727,
            generation: [5014],
            vehicleType: null,
            engineType: 1,
            wheelType: 1,
            driveType: 1,
            gearType: 2,
            extendedModelsList: null,
            canExtendingByMixedModels: false,
            canExtendingByTwinsModels: false
          },
          dictionaryValueMeta: {
            stockCar: {
              brand: [{ value: 7, title: 'Kia' }],
              model: [{ value: 727, title: 'Sportage' }],
              generationType: [{ value: 5014, title: '3 поколение' }],
              bodyDoors: [
                { title: 'Внедорожник 5 дв.', value: { body: 4, doors: 5 } }
              ],
              wheelType: [{ value: 1, title: 'Левый' }],
              gearType: [{ value: 2, title: 'Механика' }],
              driveType: [{ value: 1, title: 'Передний' }],
              engineType: [{ value: 1, title: 'Бензиновый' }],
              color: [{ value: 12, title: 'серебряный' }],
              vehicleType: [{ value: 1, title: 'Легковой' }]
            },
            stock: {
              stockState: [{ value: 2, title: 'Выбыл' }],
              saleStatus: [{ value: 1, title: 'В продаже' }],
              publishStatus: [{ value: 2, title: 'Не опубликован' }]
            },
            stockAppraisal: {
              priceCategory: [{ value: 1, title: 'Очень низкая' }]
            },
            similarCarSearch: {
              brand: [{ value: 7, title: 'Kia' }],
              model: [{ value: 727, title: 'Sportage' }],
              generation: [{ value: 5014, title: '3 поколение' }],
              engineType: [{ value: 1, title: 'Бензиновый' }],
              wheelType: [{ value: 1, title: 'Левый' }],
              bodyDoors: [
                { title: 'Внедорожник 5 дв.', value: { body: 4, doors: 5 } },
                { title: 'Внедорожник 3 дв.', value: { body: 4, doors: 3 } }
              ],
              vehicleType: [{ value: 1, title: 'Легковой' }],
              driveType: [
                { value: 1, title: 'Передний' },
                { value: 2, title: 'Задний' }
              ],
              gearType: [{ value: 2, title: 'Механика' }],
              ownerType: [
                { value: 1, title: 'Физическое лицо' },
                { value: 2, title: 'Юридическое лицо' }
              ]
            },
            stockAppraisalCarSearch: {
              bodyDoors: {
                title: 'Внедорожник 5 дв.',
                value: { body: 4, doors: 5 }
              },
              brand: { value: 7, title: 'Kia' },
              model: { value: 727, title: 'Sportage' },
              generation: [{ value: 5014, title: '3 поколение' }],
              engineType: { value: 1, title: 'Бензиновый' },
              wheelType: { value: 1, title: 'Левый' },
              driveType: { value: 1, title: 'Передний' },
              gearType: { value: 2, title: 'Механика' }
            }
          }
        },
        description:
          'Объект `StockCar`, `Stock`, `StockGoalsControl`,\n `StockAppraisal`, `StockAppraisalCarSearch`, `SimilarCarSearch` и `DictionaryValueMeta`\n'
      },
      request: null,
      params: {
        type: 'object',
        required: ['id'],
        properties: {
          id: { type: 'integer' },
          resolveDictionaries: { type: 'boolean' },
          expand: {
            type: 'array',
            items: {
              type: 'string',
              enum: [
                'stock',
                'similarCarSearch',
                'stockAppraisal',
                'stockGoalsControl',
                'stockAppraisalCarSearch'
              ]
            }
          }
        },
        description: 'Model of parameters for API /stock-cars/{id}'
      }
    } as any;
  }

  /**
   * Mock data when servers is disabled (in DEV-mode).
   * @returns {any}
   */
  protected get mockData(): any {
    return {
      stockCar: {
        id: 8487,
        dealerId: 20,
        brand: 7,
        model: 727,
        vin: 'XWEPC811*B0****17',
        creationYear: 2010,
        generationType: 5014,
        bodyDoors: { body: 4, doors: 5 },
        wheelType: 1,
        gearType: 2,
        driveType: 1,
        engineType: 1,
        engineVolume: 2,
        enginePower: 150,
        mileage: 106036,
        color: 12,
        vehicleType: 1,
        photos: [
          'https://21.img.avito.st/video/640x480/4551882821.jpg',
          'https://79.img.avito.st/640x480/4260601779.jpg',
          'https://84.img.avito.st/640x480/4260601784.jpg',
          'https://88.img.avito.st/640x480/4260601788.jpg',
          'https://92.img.avito.st/640x480/4260601792.jpg',
          'https://94.img.avito.st/640x480/4260601794.jpg',
          'https://98.img.avito.st/640x480/4260601798.jpg',
          'https://01.img.avito.st/640x480/4260601801.jpg',
          'https://02.img.avito.st/640x480/4260601802.jpg',
          'https://03.img.avito.st/640x480/4260601803.jpg',
          'https://04.img.avito.st/640x480/4260601804.jpg',
          'https://05.img.avito.st/640x480/4260601805.jpg',
          'https://06.img.avito.st/640x480/4260601806.jpg',
          'https://07.img.avito.st/640x480/4260601807.jpg',
          'https://08.img.avito.st/640x480/4260601808.jpg',
          'https://09.img.avito.st/640x480/4260601809.jpg',
          'https://10.img.avito.st/640x480/4260601810.jpg',
          'https://11.img.avito.st/640x480/4260601811.jpg',
          'https://12.img.avito.st/640x480/4260601812.jpg'
        ],
        stockExternalSource: 'offer',
        stockExternalId: '00985545',
        objectVersion: 979
      },
      stock: {
        id: 8487,
        stockState: 2,
        arrivedAt: '2016-12-01T00:00:00+03:00',
        outAt: '2018-07-13T20:51:20+03:00',
        saleAt: null,
        returnToSaleAt: null,
        contractType: null,
        inStockPeriod: 589,
        salesTacticId: 69,
        publishedDays: 590,
        publishStartedAt: '2016-12-01T00:00:00+03:00',
        publishFinishedAt: '2018-07-13T20:51:20+03:00',
        publishStatus: 2,
        lastPriceChangedAt: '2018-06-22T20:37:29+03:00',
        lastPriceChangedDays: 31,
        exposition: null,
        inChannel: null,
        outReason: null,
        certificated: null,
        saleStatus: 1,
        objectVersion: 0
      },
      similarCarSearch: {
        id: null,
        brand: 7,
        model: 727,
        generation: [5014],
        creationYear: {
          from: 2010,
          to: 2011,
          isFromInclusive: true,
          isToInclusive: true
        },
        vehicleType: [1],
        enginePower: {
          from: 120,
          to: 180,
          isFromInclusive: true,
          isToInclusive: true
        },
        engineVolume: {
          from: 1.9,
          to: 2.1,
          isFromInclusive: true,
          isToInclusive: true
        },
        engineType: [1],
        wheelType: [1],
        bodyDoors: [{ body: 4, doors: 5 }, { body: 4, doors: 3 }],
        driveType: [1, 2],
        gearType: [2],
        ownerType: [1, 2],
        status: 1,
        source: [487, 488],
        region: {
          type: 'regions',
          regions: [
            {
              id: 1960671,
              type: {
                id: 103,
                type: 'city',
                shortName: 'г',
                fullName: 'Город'
              },
              name: 'Москва',
              coordinates: [55.75396, 37.620393],
              distance: null,
              count: 140701
            }
          ],
          radius: { coordinates: [55.751244, 37.618423], radius: 100 }
        },
        color: null,
        isExtendedByTwinsModels: false,
        isExtendedByMixedModels: false,
        canExtendingByTwinsModels: null,
        canExtendingByMixedModels: null,
        manualExcludedIds: [
          '2f614e016c16cced35b59f365c42fbae',
          '3fda7e6892787b274d9967955b07fc7f'
        ],
        manualIncludedIds: [],
        autoExcludedIds: [],
        climateControl: null,
        ac: null,
        parktronic: null,
        cruiseControl: null,
        startStopEngine: null,
        powerWindows: null,
        navigationSystem: null,
        backCamera: null,
        powerSteering: null,
        abs: null,
        esp: null,
        tcs: null,
        eds: null,
        airbag: null,
        airbagFront: null,
        airbagSide: null,
        airbagWindow: null,
        airbagKnees: null,
        alarm: null,
        armored: null,
        diskSize: null,
        diskType: null,
        winterTires: null,
        headlightType: null,
        fogLights: null,
        airSuspension: null,
        aerography: null,
        upholstery: null,
        heatedSeats: null,
        thirdRowSeats: null,
        sunroof: null,
        panoramicRoof: null,
        objectVersion: 0
      },
      stockAppraisal: {
        id: null,
        complexEstimate: '3',
        complexMdsEstimate: '3',
        complexMdsDays: 34,
        complexSalesEstimate: '3+',
        complexAvailabilityEstimate: '3+',
        complexPublishedEstimate: '3',
        complexPublishedAmount: 34,
        complexOffersAmount: 11.109589041096,
        complexSalesAmount: 4.943023255814,
        complexSalesEstimatingPeriod: 60,
        complexPercent: 57,
        complexMdsPercent: 52,
        complexSalesPercent: 62,
        complexAvailabilityPercent: 63,
        sellingPrice: 620000,
        pendingPrice: null,
        pendingPriceSetAt: null,
        recommendedRetailPrice: null,
        buyoutPrice: null,
        repairCost: null,
        expenses: null,
        markup: null,
        markupPotential: 716000,
        profitPotentialDay: null,
        profitPotentialMonth: null,
        profitPotentialPercent: null,
        markupPercent: null,
        expensesPercent: null,
        marketPricesRating: 1,
        marketPricesMileageRating: 1,
        priceMileageCategory: 1,
        similarCarsTotal: 13,
        similarCarsAvgMillage: 105267,
        similarCarsMedianPrice: 716650,
        sellingPricePercent: 87,
        attentionPercent: null,
        salePeriod: 5,
        fullAttentionImpressionsPerDay: null,
        avgImpressionsPerDay: null,
        similarCarsAdjustedPrice: 715952,
        attentionRating: null,
        attentionCategory: null,
        priceCategory: 1,
        attentionSimilarCarsTotal: 1,
        geo: [1960671, 1573301],
        objectVersion: 0
      },
      stockAppraisalCarSearch: {
        region: {
          type: 'regions',
          regions: [
            {
              id: 1960671,
              type: {
                id: 103,
                type: 'city',
                shortName: 'г',
                fullName: 'Город'
              },
              name: 'Москва',
              coordinates: [55.75396, 37.620393],
              distance: null,
              count: 140701
            },
            {
              id: 1573301,
              type: {
                id: 105,
                type: 'region',
                shortName: 'обл',
                fullName: 'Область'
              },
              name: 'Московская',
              coordinates: [55.75496, 37.621393],
              distance: null,
              count: 46579
            }
          ],
          radius: { coordinates: [0, 0], radius: 0 }
        },
        creationYear: [2010, 2011, true, true],
        enginePower: [120, 180, true, true],
        engineVolume: [1.9, 2.1, true, true],
        bodyDoors: { body: 4, doors: 5 },
        brand: 7,
        model: 727,
        generation: [5014],
        vehicleType: null,
        engineType: 1,
        wheelType: 1,
        driveType: 1,
        gearType: 2,
        extendedModelsList: null,
        canExtendingByMixedModels: false,
        canExtendingByTwinsModels: false
      },
      dictionaryValueMeta: {
        stockCar: {
          brand: [{ value: 7, title: 'Kia' }],
          model: [{ value: 727, title: 'Sportage' }],
          generationType: [{ value: 5014, title: '3 поколение' }],
          bodyDoors: [
            { title: 'Внедорожник 5 дв.', value: { body: 4, doors: 5 } }
          ],
          wheelType: [{ value: 1, title: 'Левый' }],
          gearType: [{ value: 2, title: 'Механика' }],
          driveType: [{ value: 1, title: 'Передний' }],
          engineType: [{ value: 1, title: 'Бензиновый' }],
          color: [{ value: 12, title: 'серебряный' }],
          vehicleType: [{ value: 1, title: 'Легковой' }]
        },
        stock: {
          stockState: [{ value: 2, title: 'Выбыл' }],
          saleStatus: [{ value: 1, title: 'В продаже' }],
          publishStatus: [{ value: 2, title: 'Не опубликован' }]
        },
        stockAppraisal: {
          priceCategory: [{ value: 1, title: 'Очень низкая' }]
        },
        similarCarSearch: {
          brand: [{ value: 7, title: 'Kia' }],
          model: [{ value: 727, title: 'Sportage' }],
          generation: [{ value: 5014, title: '3 поколение' }],
          engineType: [{ value: 1, title: 'Бензиновый' }],
          wheelType: [{ value: 1, title: 'Левый' }],
          bodyDoors: [
            { title: 'Внедорожник 5 дв.', value: { body: 4, doors: 5 } },
            { title: 'Внедорожник 3 дв.', value: { body: 4, doors: 3 } }
          ],
          vehicleType: [{ value: 1, title: 'Легковой' }],
          driveType: [
            { value: 1, title: 'Передний' },
            { value: 2, title: 'Задний' }
          ],
          gearType: [{ value: 2, title: 'Механика' }],
          ownerType: [
            { value: 1, title: 'Физическое лицо' },
            { value: 2, title: 'Юридическое лицо' }
          ]
        },
        stockAppraisalCarSearch: {
          bodyDoors: {
            title: 'Внедорожник 5 дв.',
            value: { body: 4, doors: 5 }
          },
          brand: { value: 7, title: 'Kia' },
          model: { value: 727, title: 'Sportage' },
          generation: [{ value: 5014, title: '3 поколение' }],
          engineType: { value: 1, title: 'Бензиновый' },
          wheelType: { value: 1, title: 'Левый' },
          driveType: { value: 1, title: 'Передний' },
          gearType: { value: 2, title: 'Механика' }
        }
      }
    } as any;
  }

  // *** Methods

  /**
   * @param {HttpClient} httpClient
   * @param {ApiErrorHandler} errorHandler
   * Обработчик ошибок HTTP-запросов и
   * @param {ServersData} serversData
   */
  constructor(
    protected httpClient: HttpClient,
    @Inject(API_ERROR_HANDLER) protected errorHandler: ApiErrorHandler,
    @Inject(SERVERS_DATA) protected serversData: ServersData
  ) {
    super(httpClient, errorHandler, serversData, domainSchema);
  }
}
