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

"""
    test_meraki

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

from test_meraki.api_helper import APIHelper
from test_meraki.configuration import Configuration
from test_meraki.controllers.base_controller import BaseController
from test_meraki.http.auth.custom_header_auth import CustomHeaderAuth

class SplashLoginAttemptsController(BaseController):

    """A Controller to access Endpoints in the test_meraki API."""


    def get_network_splash_login_attempts(self,
                                          network_id,
                                          ssid_number=None,
                                          login_identifier=None,
                                          timespan=None):
        """Does a GET request to /networks/{networkId}/splashLoginAttempts.

        List the splash login attempts for a network

        Args:
            network_id (string): TODO: type description here. Example: 
            ssid_number (SsidNumberEnum, optional): Only return the login
                attempts for the specified SSID
            login_identifier (string, optional): The username, email, or phone
                number used during login
            timespan (int, optional): The timespan, in seconds, for the login
                attempts. The period will be from [timespan] seconds ago until
                now. The maximum timespan is 3 months

        Returns:
            object: Response from the API. Successful operation

        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.

        """

        # Prepare query URL
        _url_path = '/networks/{networkId}/splashLoginAttempts'
        _url_path = APIHelper.append_url_with_template_parameters(_url_path, { 
            'networkId': network_id
        })
        _query_builder = Configuration.base_uri
        _query_builder += _url_path
        _query_parameters = {
            'ssidNumber': ssid_number,
            'loginIdentifier': login_identifier,
            'timespan': timespan
        }
        _query_builder = APIHelper.append_url_with_query_parameters(_query_builder,
            _query_parameters, Configuration.array_serialization)
        _query_url = APIHelper.clean_url(_query_builder)

        # Prepare and execute request
        _request = self.http_client.get(_query_url)
        CustomHeaderAuth.apply(_request)
        _context = self.execute_request(_request)
        self.validate_response(_context)

        # Return appropriate type
        return _context.response.raw_body
