# -*- coding: utf-8 -*-

"""
uexcorpapi

This file was automatically generated by APIMATIC v3.0 (
 https://www.apimatic.io ).
"""

from uexcorpapi.api_helper import APIHelper
from uexcorpapi.configuration import Server
from uexcorpapi.http.api_response import ApiResponse
from uexcorpapi.controllers.base_controller import BaseController
from apimatic_core.request_builder import RequestBuilder
from apimatic_core.response_handler import ResponseHandler
from apimatic_core.types.parameter import Parameter
from uexcorpapi.http.http_method_enum import HttpMethodEnum
from apimatic_core.authentication.multiple.single_auth import Single
from uexcorpapi.models.ok_42 import Ok42


class GameVersionsController(BaseController):

    """A Controller to access Endpoints in the uexcorpapi API."""
    def __init__(self, config):
        super(GameVersionsController, self).__init__(config)

    def obtain_the_star_citizen_versions_currently_operated_by_uex_it_may_be_out_of_sync_with_star_citizen_releases_sometimes(self,
                                                                                                                              accept):
        """Does a GET request to /game_versions.

        Args:
            accept (str): The request header parameter.

        Returns:
            ApiResponse: An object with the response value as well as other
                useful information such as status codes and headers.

        Raises:
            ApiException: When an error occurs while fetching the data from
                the remote API. This exception includes the HTTP Response
                code, an error message, and the HTTP body that was received in
                the request.

        """

        return super().new_api_call_builder.request(
            RequestBuilder().server(Server.SERVER_1)
            .path('/game_versions')
            .http_method(HttpMethodEnum.GET)
            .header_param(Parameter()
                          .key('Accept')
                          .value(accept)
                          .is_required(True))
            .auth(Single('bearer'))
        ).response(
            ResponseHandler()
            .deserializer(APIHelper.json_deserialize)
            .deserialize_into(Ok42.from_dictionary)
            .is_api_response(True)
        ).execute()
