# coding: utf-8

"""
    Knetik Platform API Documentation latest 

    This is the spec for the Knetik API.  Use this in conjunction with the documentation found at https://knetikcloud.com.

    OpenAPI spec version: latest 
    Contact: support@knetik.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import sys
import os
import re

# python 2 and python 3 compatibility library
from six import iteritems

from ..api_client import ApiClient


class ReportingUsageApi(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_client=None):
        if api_client is None:
            api_client = ApiClient()
        self.api_client = api_client

    def get_usage_by_day(self, start_date, end_date, **kwargs):
        """
        Returns aggregated endpoint usage information by day
        <b>Permissions Needed:</b> USAGE_ADMIN
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_usage_by_day(start_date, end_date, async=True)
        >>> result = thread.get()

        :param async bool
        :param int start_date: The beginning of the range being requested, unix timestamp in seconds (required)
        :param int end_date: The ending of the range being requested, unix timestamp in seconds (required)
        :param bool combine_endpoints: Whether to combine counts from different endpoint. Removes the url and method from the result object
        :param str method: Filter for a certain endpoint method.  Must include url as well to work
        :param str url: Filter for a certain endpoint.  Must include method as well to work
        :param int size: The number of objects returned per page
        :param int page: The number of the page returned, starting with 1
        :return: PageResourceUsageInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_usage_by_day_with_http_info(start_date, end_date, **kwargs)
        else:
            (data) = self.get_usage_by_day_with_http_info(start_date, end_date, **kwargs)
            return data

    def get_usage_by_day_with_http_info(self, start_date, end_date, **kwargs):
        """
        Returns aggregated endpoint usage information by day
        <b>Permissions Needed:</b> USAGE_ADMIN
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_usage_by_day_with_http_info(start_date, end_date, async=True)
        >>> result = thread.get()

        :param async bool
        :param int start_date: The beginning of the range being requested, unix timestamp in seconds (required)
        :param int end_date: The ending of the range being requested, unix timestamp in seconds (required)
        :param bool combine_endpoints: Whether to combine counts from different endpoint. Removes the url and method from the result object
        :param str method: Filter for a certain endpoint method.  Must include url as well to work
        :param str url: Filter for a certain endpoint.  Must include method as well to work
        :param int size: The number of objects returned per page
        :param int page: The number of the page returned, starting with 1
        :return: PageResourceUsageInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['start_date', 'end_date', 'combine_endpoints', 'method', 'url', 'size', 'page']
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_usage_by_day" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'start_date' is set
        if ('start_date' not in params) or (params['start_date'] is None):
            raise ValueError("Missing the required parameter `start_date` when calling `get_usage_by_day`")
        # verify the required parameter 'end_date' is set
        if ('end_date' not in params) or (params['end_date'] is None):
            raise ValueError("Missing the required parameter `end_date` when calling `get_usage_by_day`")


        collection_formats = {}

        path_params = {}

        query_params = []
        if 'start_date' in params:
            query_params.append(('start_date', params['start_date']))
        if 'end_date' in params:
            query_params.append(('end_date', params['end_date']))
        if 'combine_endpoints' in params:
            query_params.append(('combine_endpoints', params['combine_endpoints']))
        if 'method' in params:
            query_params.append(('method', params['method']))
        if 'url' in params:
            query_params.append(('url', params['url']))
        if 'size' in params:
            query_params.append(('size', params['size']))
        if 'page' in params:
            query_params.append(('page', params['page']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

        # Authentication setting
        auth_settings = ['oauth2_client_credentials_grant', 'oauth2_password_grant']

        return self.api_client.call_api('/reporting/usage/day', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='PageResourceUsageInfo',
                                        auth_settings=auth_settings,
                                        async=params.get('async'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def get_usage_by_hour(self, start_date, end_date, **kwargs):
        """
        Returns aggregated endpoint usage information by hour
        <b>Permissions Needed:</b> USAGE_ADMIN
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_usage_by_hour(start_date, end_date, async=True)
        >>> result = thread.get()

        :param async bool
        :param int start_date: The beginning of the range being requested, unix timestamp in seconds (required)
        :param int end_date: The ending of the range being requested, unix timestamp in seconds (required)
        :param bool combine_endpoints: Whether to combine counts from different endpoint. Removes the url and method from the result object
        :param str method: Filter for a certain endpoint method.  Must include url as well to work
        :param str url: Filter for a certain endpoint.  Must include method as well to work
        :param int size: The number of objects returned per page
        :param int page: The number of the page returned, starting with 1
        :return: PageResourceUsageInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_usage_by_hour_with_http_info(start_date, end_date, **kwargs)
        else:
            (data) = self.get_usage_by_hour_with_http_info(start_date, end_date, **kwargs)
            return data

    def get_usage_by_hour_with_http_info(self, start_date, end_date, **kwargs):
        """
        Returns aggregated endpoint usage information by hour
        <b>Permissions Needed:</b> USAGE_ADMIN
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_usage_by_hour_with_http_info(start_date, end_date, async=True)
        >>> result = thread.get()

        :param async bool
        :param int start_date: The beginning of the range being requested, unix timestamp in seconds (required)
        :param int end_date: The ending of the range being requested, unix timestamp in seconds (required)
        :param bool combine_endpoints: Whether to combine counts from different endpoint. Removes the url and method from the result object
        :param str method: Filter for a certain endpoint method.  Must include url as well to work
        :param str url: Filter for a certain endpoint.  Must include method as well to work
        :param int size: The number of objects returned per page
        :param int page: The number of the page returned, starting with 1
        :return: PageResourceUsageInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['start_date', 'end_date', 'combine_endpoints', 'method', 'url', 'size', 'page']
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_usage_by_hour" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'start_date' is set
        if ('start_date' not in params) or (params['start_date'] is None):
            raise ValueError("Missing the required parameter `start_date` when calling `get_usage_by_hour`")
        # verify the required parameter 'end_date' is set
        if ('end_date' not in params) or (params['end_date'] is None):
            raise ValueError("Missing the required parameter `end_date` when calling `get_usage_by_hour`")


        collection_formats = {}

        path_params = {}

        query_params = []
        if 'start_date' in params:
            query_params.append(('start_date', params['start_date']))
        if 'end_date' in params:
            query_params.append(('end_date', params['end_date']))
        if 'combine_endpoints' in params:
            query_params.append(('combine_endpoints', params['combine_endpoints']))
        if 'method' in params:
            query_params.append(('method', params['method']))
        if 'url' in params:
            query_params.append(('url', params['url']))
        if 'size' in params:
            query_params.append(('size', params['size']))
        if 'page' in params:
            query_params.append(('page', params['page']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

        # Authentication setting
        auth_settings = ['oauth2_client_credentials_grant', 'oauth2_password_grant']

        return self.api_client.call_api('/reporting/usage/hour', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='PageResourceUsageInfo',
                                        auth_settings=auth_settings,
                                        async=params.get('async'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def get_usage_by_minute(self, start_date, end_date, **kwargs):
        """
        Returns aggregated endpoint usage information by minute
        <b>Permissions Needed:</b> USAGE_ADMIN
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_usage_by_minute(start_date, end_date, async=True)
        >>> result = thread.get()

        :param async bool
        :param int start_date: The beginning of the range being requested, unix timestamp in seconds (required)
        :param int end_date: The ending of the range being requested, unix timestamp in seconds (required)
        :param bool combine_endpoints: Whether to combine counts from different endpoint. Removes the url and method from the result object
        :param str method: Filter for a certain endpoint method.  Must include url as well to work
        :param str url: Filter for a certain endpoint.  Must include method as well to work
        :param int size: The number of objects returned per page
        :param int page: The number of the page returned, starting with 1
        :return: PageResourceUsageInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_usage_by_minute_with_http_info(start_date, end_date, **kwargs)
        else:
            (data) = self.get_usage_by_minute_with_http_info(start_date, end_date, **kwargs)
            return data

    def get_usage_by_minute_with_http_info(self, start_date, end_date, **kwargs):
        """
        Returns aggregated endpoint usage information by minute
        <b>Permissions Needed:</b> USAGE_ADMIN
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_usage_by_minute_with_http_info(start_date, end_date, async=True)
        >>> result = thread.get()

        :param async bool
        :param int start_date: The beginning of the range being requested, unix timestamp in seconds (required)
        :param int end_date: The ending of the range being requested, unix timestamp in seconds (required)
        :param bool combine_endpoints: Whether to combine counts from different endpoint. Removes the url and method from the result object
        :param str method: Filter for a certain endpoint method.  Must include url as well to work
        :param str url: Filter for a certain endpoint.  Must include method as well to work
        :param int size: The number of objects returned per page
        :param int page: The number of the page returned, starting with 1
        :return: PageResourceUsageInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['start_date', 'end_date', 'combine_endpoints', 'method', 'url', 'size', 'page']
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_usage_by_minute" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'start_date' is set
        if ('start_date' not in params) or (params['start_date'] is None):
            raise ValueError("Missing the required parameter `start_date` when calling `get_usage_by_minute`")
        # verify the required parameter 'end_date' is set
        if ('end_date' not in params) or (params['end_date'] is None):
            raise ValueError("Missing the required parameter `end_date` when calling `get_usage_by_minute`")


        collection_formats = {}

        path_params = {}

        query_params = []
        if 'start_date' in params:
            query_params.append(('start_date', params['start_date']))
        if 'end_date' in params:
            query_params.append(('end_date', params['end_date']))
        if 'combine_endpoints' in params:
            query_params.append(('combine_endpoints', params['combine_endpoints']))
        if 'method' in params:
            query_params.append(('method', params['method']))
        if 'url' in params:
            query_params.append(('url', params['url']))
        if 'size' in params:
            query_params.append(('size', params['size']))
        if 'page' in params:
            query_params.append(('page', params['page']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

        # Authentication setting
        auth_settings = ['oauth2_client_credentials_grant', 'oauth2_password_grant']

        return self.api_client.call_api('/reporting/usage/minute', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='PageResourceUsageInfo',
                                        auth_settings=auth_settings,
                                        async=params.get('async'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def get_usage_by_month(self, start_date, end_date, **kwargs):
        """
        Returns aggregated endpoint usage information by month
        <b>Permissions Needed:</b> USAGE_ADMIN
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_usage_by_month(start_date, end_date, async=True)
        >>> result = thread.get()

        :param async bool
        :param int start_date: The beginning of the range being requested, unix timestamp in seconds (required)
        :param int end_date: The ending of the range being requested, unix timestamp in seconds (required)
        :param bool combine_endpoints: Whether to combine counts from different endpoint. Removes the url and method from the result object
        :param str method: Filter for a certain endpoint method.  Must include url as well to work
        :param str url: Filter for a certain endpoint.  Must include method as well to work
        :param int size: The number of objects returned per page
        :param int page: The number of the page returned, starting with 1
        :return: PageResourceUsageInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_usage_by_month_with_http_info(start_date, end_date, **kwargs)
        else:
            (data) = self.get_usage_by_month_with_http_info(start_date, end_date, **kwargs)
            return data

    def get_usage_by_month_with_http_info(self, start_date, end_date, **kwargs):
        """
        Returns aggregated endpoint usage information by month
        <b>Permissions Needed:</b> USAGE_ADMIN
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_usage_by_month_with_http_info(start_date, end_date, async=True)
        >>> result = thread.get()

        :param async bool
        :param int start_date: The beginning of the range being requested, unix timestamp in seconds (required)
        :param int end_date: The ending of the range being requested, unix timestamp in seconds (required)
        :param bool combine_endpoints: Whether to combine counts from different endpoint. Removes the url and method from the result object
        :param str method: Filter for a certain endpoint method.  Must include url as well to work
        :param str url: Filter for a certain endpoint.  Must include method as well to work
        :param int size: The number of objects returned per page
        :param int page: The number of the page returned, starting with 1
        :return: PageResourceUsageInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['start_date', 'end_date', 'combine_endpoints', 'method', 'url', 'size', 'page']
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_usage_by_month" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'start_date' is set
        if ('start_date' not in params) or (params['start_date'] is None):
            raise ValueError("Missing the required parameter `start_date` when calling `get_usage_by_month`")
        # verify the required parameter 'end_date' is set
        if ('end_date' not in params) or (params['end_date'] is None):
            raise ValueError("Missing the required parameter `end_date` when calling `get_usage_by_month`")


        collection_formats = {}

        path_params = {}

        query_params = []
        if 'start_date' in params:
            query_params.append(('start_date', params['start_date']))
        if 'end_date' in params:
            query_params.append(('end_date', params['end_date']))
        if 'combine_endpoints' in params:
            query_params.append(('combine_endpoints', params['combine_endpoints']))
        if 'method' in params:
            query_params.append(('method', params['method']))
        if 'url' in params:
            query_params.append(('url', params['url']))
        if 'size' in params:
            query_params.append(('size', params['size']))
        if 'page' in params:
            query_params.append(('page', params['page']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

        # Authentication setting
        auth_settings = ['oauth2_client_credentials_grant', 'oauth2_password_grant']

        return self.api_client.call_api('/reporting/usage/month', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='PageResourceUsageInfo',
                                        auth_settings=auth_settings,
                                        async=params.get('async'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def get_usage_by_year(self, start_date, end_date, **kwargs):
        """
        Returns aggregated endpoint usage information by year
        <b>Permissions Needed:</b> USAGE_ADMIN
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_usage_by_year(start_date, end_date, async=True)
        >>> result = thread.get()

        :param async bool
        :param int start_date: The beginning of the range being requested, unix timestamp in seconds (required)
        :param int end_date: The ending of the range being requested, unix timestamp in seconds (required)
        :param bool combine_endpoints: Whether to combine counts from different endpoints. Removes the url and method from the result object
        :param str method: Filter for a certain endpoint method.  Must include url as well to work
        :param str url: Filter for a certain endpoint.  Must include method as well to work
        :param int size: The number of objects returned per page
        :param int page: The number of the page returned, starting with 1
        :return: PageResourceUsageInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_usage_by_year_with_http_info(start_date, end_date, **kwargs)
        else:
            (data) = self.get_usage_by_year_with_http_info(start_date, end_date, **kwargs)
            return data

    def get_usage_by_year_with_http_info(self, start_date, end_date, **kwargs):
        """
        Returns aggregated endpoint usage information by year
        <b>Permissions Needed:</b> USAGE_ADMIN
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_usage_by_year_with_http_info(start_date, end_date, async=True)
        >>> result = thread.get()

        :param async bool
        :param int start_date: The beginning of the range being requested, unix timestamp in seconds (required)
        :param int end_date: The ending of the range being requested, unix timestamp in seconds (required)
        :param bool combine_endpoints: Whether to combine counts from different endpoints. Removes the url and method from the result object
        :param str method: Filter for a certain endpoint method.  Must include url as well to work
        :param str url: Filter for a certain endpoint.  Must include method as well to work
        :param int size: The number of objects returned per page
        :param int page: The number of the page returned, starting with 1
        :return: PageResourceUsageInfo
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['start_date', 'end_date', 'combine_endpoints', 'method', 'url', 'size', 'page']
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_usage_by_year" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'start_date' is set
        if ('start_date' not in params) or (params['start_date'] is None):
            raise ValueError("Missing the required parameter `start_date` when calling `get_usage_by_year`")
        # verify the required parameter 'end_date' is set
        if ('end_date' not in params) or (params['end_date'] is None):
            raise ValueError("Missing the required parameter `end_date` when calling `get_usage_by_year`")


        collection_formats = {}

        path_params = {}

        query_params = []
        if 'start_date' in params:
            query_params.append(('start_date', params['start_date']))
        if 'end_date' in params:
            query_params.append(('end_date', params['end_date']))
        if 'combine_endpoints' in params:
            query_params.append(('combine_endpoints', params['combine_endpoints']))
        if 'method' in params:
            query_params.append(('method', params['method']))
        if 'url' in params:
            query_params.append(('url', params['url']))
        if 'size' in params:
            query_params.append(('size', params['size']))
        if 'page' in params:
            query_params.append(('page', params['page']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

        # Authentication setting
        auth_settings = ['oauth2_client_credentials_grant', 'oauth2_password_grant']

        return self.api_client.call_api('/reporting/usage/year', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='PageResourceUsageInfo',
                                        auth_settings=auth_settings,
                                        async=params.get('async'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def get_usage_endpoints(self, start_date, end_date, **kwargs):
        """
        Returns list of endpoints called (method and url)
        <b>Permissions Needed:</b> USAGE_ADMIN
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_usage_endpoints(start_date, end_date, async=True)
        >>> result = thread.get()

        :param async bool
        :param int start_date: The beginning of the range being requested, unix timestamp in seconds (required)
        :param int end_date: The ending of the range being requested, unix timestamp in seconds (required)
        :return: list[str]
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async'):
            return self.get_usage_endpoints_with_http_info(start_date, end_date, **kwargs)
        else:
            (data) = self.get_usage_endpoints_with_http_info(start_date, end_date, **kwargs)
            return data

    def get_usage_endpoints_with_http_info(self, start_date, end_date, **kwargs):
        """
        Returns list of endpoints called (method and url)
        <b>Permissions Needed:</b> USAGE_ADMIN
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async=True
        >>> thread = api.get_usage_endpoints_with_http_info(start_date, end_date, async=True)
        >>> result = thread.get()

        :param async bool
        :param int start_date: The beginning of the range being requested, unix timestamp in seconds (required)
        :param int end_date: The ending of the range being requested, unix timestamp in seconds (required)
        :return: list[str]
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['start_date', 'end_date']
        all_params.append('async')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_usage_endpoints" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'start_date' is set
        if ('start_date' not in params) or (params['start_date'] is None):
            raise ValueError("Missing the required parameter `start_date` when calling `get_usage_endpoints`")
        # verify the required parameter 'end_date' is set
        if ('end_date' not in params) or (params['end_date'] is None):
            raise ValueError("Missing the required parameter `end_date` when calling `get_usage_endpoints`")


        collection_formats = {}

        path_params = {}

        query_params = []
        if 'start_date' in params:
            query_params.append(('start_date', params['start_date']))
        if 'end_date' in params:
            query_params.append(('end_date', params['end_date']))

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.\
            select_header_accept(['application/json'])

        # Authentication setting
        auth_settings = ['oauth2_client_credentials_grant', 'oauth2_password_grant']

        return self.api_client.call_api('/reporting/usage/endpoints', 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='list[str]',
                                        auth_settings=auth_settings,
                                        async=params.get('async'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)
