# coding: utf-8

"""
    SevOne API Documentation

    Supported endpoints by the new RESTful API  # noqa: E501

    OpenAPI spec version: 2.1.18, Hash: db562e6
    
    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""


from __future__ import absolute_import

import re  # noqa: F401

# python 2 and python 3 compatibility library
import six

from swagger_client.api_client import ApiClient


class ReportAttachmentsTopNApi(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 create_top_n_attachment(self, id, top_n_request_dto, **kwargs):  # noqa: E501
        """Create topN report attachment  # noqa: E501

        Creates a new topN report attachment  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_top_n_attachment(id, top_n_request_dto, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report where the report attachment will be created (required)
        :param TopNRequestDto top_n_request_dto: TopN attachment object (required)
        :return: TopNResponseDto
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.create_top_n_attachment_with_http_info(id, top_n_request_dto, **kwargs)  # noqa: E501
        else:
            (data) = self.create_top_n_attachment_with_http_info(id, top_n_request_dto, **kwargs)  # noqa: E501
            return data

    def create_top_n_attachment_with_http_info(self, id, top_n_request_dto, **kwargs):  # noqa: E501
        """Create topN report attachment  # noqa: E501

        Creates a new topN report attachment  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_top_n_attachment_with_http_info(id, top_n_request_dto, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report where the report attachment will be created (required)
        :param TopNRequestDto top_n_request_dto: TopN attachment object (required)
        :return: TopNResponseDto
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'top_n_request_dto']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'top_n_request_dto' in params:
            body_params = params['top_n_request_dto']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/reports/{id}/attachments/topn', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TopNResponseDto',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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 create_top_n_attachment1(self, id, top_n_request_dto, **kwargs):  # noqa: E501
        """Create topN report attachment  # noqa: E501

        Creates a new topN report attachment  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_top_n_attachment1(id, top_n_request_dto, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report where the report attachment will be created (required)
        :param TopNRequestDtoV1 top_n_request_dto: TopN attachment object (required)
        :return: TopNResponseDtoV1
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.create_top_n_attachment1_with_http_info(id, top_n_request_dto, **kwargs)  # noqa: E501
        else:
            (data) = self.create_top_n_attachment1_with_http_info(id, top_n_request_dto, **kwargs)  # noqa: E501
            return data

    def create_top_n_attachment1_with_http_info(self, id, top_n_request_dto, **kwargs):  # noqa: E501
        """Create topN report attachment  # noqa: E501

        Creates a new topN report attachment  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.create_top_n_attachment1_with_http_info(id, top_n_request_dto, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report where the report attachment will be created (required)
        :param TopNRequestDtoV1 top_n_request_dto: TopN attachment object (required)
        :return: TopNResponseDtoV1
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'top_n_request_dto']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'top_n_request_dto' in params:
            body_params = params['top_n_request_dto']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/reports/{id}/attachments/topn', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TopNResponseDtoV1',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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_top_n_attachment(self, id, **kwargs):  # noqa: E501
        """Get topn attachment  # noqa: E501

        Get an existing topn attachment  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_top_n_attachment(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: TopN attachment id (required)
        :return: TopNResponseDto
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_top_n_attachment_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_top_n_attachment_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def get_top_n_attachment_with_http_info(self, id, **kwargs):  # noqa: E501
        """Get topn attachment  # noqa: E501

        Get an existing topn attachment  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_top_n_attachment_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: TopN attachment id (required)
        :return: TopNResponseDto
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/reports/attachments/topn/{id}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TopNResponseDto',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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_top_n_attachment_resources(self, id, **kwargs):  # noqa: E501
        """Get resources  # noqa: E501

        Get topn resources  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_top_n_attachment_resources(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :return: TopNResource
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_top_n_attachment_resources_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_top_n_attachment_resources_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def get_top_n_attachment_resources_with_http_info(self, id, **kwargs):  # noqa: E501
        """Get resources  # noqa: E501

        Get topn resources  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_top_n_attachment_resources_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :return: TopNResource
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/reports/attachments/topn/{id}/resources', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TopNResource',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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_top_n_attachment_resources1(self, id, **kwargs):  # noqa: E501
        """Get resources  # noqa: E501

        Get topn resources  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_top_n_attachment_resources1(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :return: TopNResourceV1
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_top_n_attachment_resources1_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_top_n_attachment_resources1_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def get_top_n_attachment_resources1_with_http_info(self, id, **kwargs):  # noqa: E501
        """Get resources  # noqa: E501

        Get topn resources  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_top_n_attachment_resources1_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :return: TopNResourceV1
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/reports/attachments/topn/{id}/resources', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TopNResourceV1',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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_top_n_attachment_settings(self, id, **kwargs):  # noqa: E501
        """Get attachment settings  # noqa: E501

        Get topn attachment settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_top_n_attachment_settings(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :return: TopNSettings
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_top_n_attachment_settings_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_top_n_attachment_settings_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def get_top_n_attachment_settings_with_http_info(self, id, **kwargs):  # noqa: E501
        """Get attachment settings  # noqa: E501

        Get topn attachment settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_top_n_attachment_settings_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :return: TopNSettings
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/reports/attachments/topn/{id}/settings', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TopNSettings',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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_top_n_attachment_settings1(self, id, **kwargs):  # noqa: E501
        """Get attachment settings  # noqa: E501

        Get topn attachment settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_top_n_attachment_settings1(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :return: TopNSettingsV1
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_top_n_attachment_settings1_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_top_n_attachment_settings1_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def get_top_n_attachment_settings1_with_http_info(self, id, **kwargs):  # noqa: E501
        """Get attachment settings  # noqa: E501

        Get topn attachment settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_top_n_attachment_settings1_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :return: TopNSettingsV1
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/reports/attachments/topn/{id}/settings', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TopNSettingsV1',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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_top_n_attachment_time_settings(self, id, **kwargs):  # noqa: E501
        """Get topN report attachment  # noqa: E501

        Get topN report attachment time settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_top_n_attachment_time_settings(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :return: TimeSettings
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_top_n_attachment_time_settings_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_top_n_attachment_time_settings_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def get_top_n_attachment_time_settings_with_http_info(self, id, **kwargs):  # noqa: E501
        """Get topN report attachment  # noqa: E501

        Get topN report attachment time settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_top_n_attachment_time_settings_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :return: TimeSettings
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/reports/attachments/topn/{id}/time', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TimeSettings',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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_top_n_attachment_time_settings1(self, id, **kwargs):  # noqa: E501
        """Get topN report attachment  # noqa: E501

        Get topN report attachment time settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_top_n_attachment_time_settings1(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :return: TimeSettingV1
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_top_n_attachment_time_settings1_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_top_n_attachment_time_settings1_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def get_top_n_attachment_time_settings1_with_http_info(self, id, **kwargs):  # noqa: E501
        """Get topN report attachment  # noqa: E501

        Get topN report attachment time settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_top_n_attachment_time_settings1_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :return: TimeSettingV1
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/reports/attachments/topn/{id}/time', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TimeSettingV1',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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_top_n_attachment_visualization_settings(self, id, **kwargs):  # noqa: E501
        """Get attachment visualization settings  # noqa: E501

        Get topn attachment visualization settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_top_n_attachment_visualization_settings(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :return: TopNVisualization
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_top_n_attachment_visualization_settings_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_top_n_attachment_visualization_settings_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def get_top_n_attachment_visualization_settings_with_http_info(self, id, **kwargs):  # noqa: E501
        """Get attachment visualization settings  # noqa: E501

        Get topn attachment visualization settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_top_n_attachment_visualization_settings_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :return: TopNVisualization
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/reports/attachments/topn/{id}/visualizations', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TopNVisualization',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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_top_n_attachment_visualization_settings1(self, id, **kwargs):  # noqa: E501
        """Get attachment visualization settings  # noqa: E501

        Get topn attachment visualization settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_top_n_attachment_visualization_settings1(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :return: TopNVisualizationV1
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_top_n_attachment_visualization_settings1_with_http_info(id, **kwargs)  # noqa: E501
        else:
            (data) = self.get_top_n_attachment_visualization_settings1_with_http_info(id, **kwargs)  # noqa: E501
            return data

    def get_top_n_attachment_visualization_settings1_with_http_info(self, id, **kwargs):  # noqa: E501
        """Get attachment visualization settings  # noqa: E501

        Get topn attachment visualization settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_top_n_attachment_visualization_settings1_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :return: TopNVisualizationV1
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

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

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/reports/attachments/topn/{id}/visualizations', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TopNVisualizationV1',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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 partially_update_top_n_attachment_settings(self, id, settings, **kwargs):  # noqa: E501
        """Partially update attachment settings  # noqa: E501

        Partial update topn attachment settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.partially_update_top_n_attachment_settings(id, settings, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNSettings settings: TopN attachment settings (required)
        :return: TopNSettings
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.partially_update_top_n_attachment_settings_with_http_info(id, settings, **kwargs)  # noqa: E501
        else:
            (data) = self.partially_update_top_n_attachment_settings_with_http_info(id, settings, **kwargs)  # noqa: E501
            return data

    def partially_update_top_n_attachment_settings_with_http_info(self, id, settings, **kwargs):  # noqa: E501
        """Partially update attachment settings  # noqa: E501

        Partial update topn attachment settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.partially_update_top_n_attachment_settings_with_http_info(id, settings, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNSettings settings: TopN attachment settings (required)
        :return: TopNSettings
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'settings']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'settings' in params:
            body_params = params['settings']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/reports/attachments/topn/{id}/settings', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TopNSettings',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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 partially_update_top_n_attachment_settings1(self, id, settings, **kwargs):  # noqa: E501
        """Partially update attachment settings  # noqa: E501

        Partial update topn attachment settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.partially_update_top_n_attachment_settings1(id, settings, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNSettingsV1 settings: TopN attachment settings (required)
        :return: TopNSettingsV1
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.partially_update_top_n_attachment_settings1_with_http_info(id, settings, **kwargs)  # noqa: E501
        else:
            (data) = self.partially_update_top_n_attachment_settings1_with_http_info(id, settings, **kwargs)  # noqa: E501
            return data

    def partially_update_top_n_attachment_settings1_with_http_info(self, id, settings, **kwargs):  # noqa: E501
        """Partially update attachment settings  # noqa: E501

        Partial update topn attachment settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.partially_update_top_n_attachment_settings1_with_http_info(id, settings, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNSettingsV1 settings: TopN attachment settings (required)
        :return: TopNSettingsV1
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'settings']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'settings' in params:
            body_params = params['settings']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/reports/attachments/topn/{id}/settings', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TopNSettingsV1',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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 partially_update_top_n_attachment_visualization_settings(self, id, visualizations, **kwargs):  # noqa: E501
        """Partially update visualization settings  # noqa: E501

        Partial update topn visualization settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.partially_update_top_n_attachment_visualization_settings(id, visualizations, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNVisualization visualizations: TopN attachment visualization settings (required)
        :return: TopNVisualization
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.partially_update_top_n_attachment_visualization_settings_with_http_info(id, visualizations, **kwargs)  # noqa: E501
        else:
            (data) = self.partially_update_top_n_attachment_visualization_settings_with_http_info(id, visualizations, **kwargs)  # noqa: E501
            return data

    def partially_update_top_n_attachment_visualization_settings_with_http_info(self, id, visualizations, **kwargs):  # noqa: E501
        """Partially update visualization settings  # noqa: E501

        Partial update topn visualization settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.partially_update_top_n_attachment_visualization_settings_with_http_info(id, visualizations, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNVisualization visualizations: TopN attachment visualization settings (required)
        :return: TopNVisualization
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'visualizations']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'visualizations' in params:
            body_params = params['visualizations']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/reports/attachments/topn/{id}/visualizations', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TopNVisualization',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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 partially_update_top_n_attachment_visualization_settings1(self, id, visualizations, **kwargs):  # noqa: E501
        """Partially update visualization settings  # noqa: E501

        Partial update topn visualization settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.partially_update_top_n_attachment_visualization_settings1(id, visualizations, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNVisualizationV1 visualizations: TopN attachment visualization settings (required)
        :return: TopNVisualizationV1
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.partially_update_top_n_attachment_visualization_settings1_with_http_info(id, visualizations, **kwargs)  # noqa: E501
        else:
            (data) = self.partially_update_top_n_attachment_visualization_settings1_with_http_info(id, visualizations, **kwargs)  # noqa: E501
            return data

    def partially_update_top_n_attachment_visualization_settings1_with_http_info(self, id, visualizations, **kwargs):  # noqa: E501
        """Partially update visualization settings  # noqa: E501

        Partial update topn visualization settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.partially_update_top_n_attachment_visualization_settings1_with_http_info(id, visualizations, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNVisualizationV1 visualizations: TopN attachment visualization settings (required)
        :return: TopNVisualizationV1
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'visualizations']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'visualizations' in params:
            body_params = params['visualizations']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/reports/attachments/topn/{id}/visualizations', 'PATCH',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TopNVisualizationV1',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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 update_top_n_attachment_resources(self, id, resources, **kwargs):  # noqa: E501
        """Update resources  # noqa: E501

        Update topn resources  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_top_n_attachment_resources(id, resources, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNResource resources: TopN attachment resources (required)
        :return: TopNResource
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_top_n_attachment_resources_with_http_info(id, resources, **kwargs)  # noqa: E501
        else:
            (data) = self.update_top_n_attachment_resources_with_http_info(id, resources, **kwargs)  # noqa: E501
            return data

    def update_top_n_attachment_resources_with_http_info(self, id, resources, **kwargs):  # noqa: E501
        """Update resources  # noqa: E501

        Update topn resources  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_top_n_attachment_resources_with_http_info(id, resources, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNResource resources: TopN attachment resources (required)
        :return: TopNResource
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'resources']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'resources' in params:
            body_params = params['resources']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/reports/attachments/topn/{id}/resources', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TopNResource',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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 update_top_n_attachment_resources1(self, id, resources, **kwargs):  # noqa: E501
        """Update resources  # noqa: E501

        Update topn resources  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_top_n_attachment_resources1(id, resources, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNResourceV1 resources: TopN attachment resources (required)
        :return: TopNResourceV1
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_top_n_attachment_resources1_with_http_info(id, resources, **kwargs)  # noqa: E501
        else:
            (data) = self.update_top_n_attachment_resources1_with_http_info(id, resources, **kwargs)  # noqa: E501
            return data

    def update_top_n_attachment_resources1_with_http_info(self, id, resources, **kwargs):  # noqa: E501
        """Update resources  # noqa: E501

        Update topn resources  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_top_n_attachment_resources1_with_http_info(id, resources, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNResourceV1 resources: TopN attachment resources (required)
        :return: TopNResourceV1
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'resources']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'resources' in params:
            body_params = params['resources']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/reports/attachments/topn/{id}/resources', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TopNResourceV1',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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 update_top_n_attachment_settings(self, id, settings, **kwargs):  # noqa: E501
        """Update attachment settings  # noqa: E501

        Update topN attachment settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_top_n_attachment_settings(id, settings, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNSettings settings: TopN attachment settings (required)
        :return: TopNSettings
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_top_n_attachment_settings_with_http_info(id, settings, **kwargs)  # noqa: E501
        else:
            (data) = self.update_top_n_attachment_settings_with_http_info(id, settings, **kwargs)  # noqa: E501
            return data

    def update_top_n_attachment_settings_with_http_info(self, id, settings, **kwargs):  # noqa: E501
        """Update attachment settings  # noqa: E501

        Update topN attachment settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_top_n_attachment_settings_with_http_info(id, settings, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNSettings settings: TopN attachment settings (required)
        :return: TopNSettings
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'settings']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'settings' in params:
            body_params = params['settings']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/reports/attachments/topn/{id}/settings', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TopNSettings',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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 update_top_n_attachment_settings1(self, id, settings, **kwargs):  # noqa: E501
        """Update attachment settings  # noqa: E501

        Update topN attachment settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_top_n_attachment_settings1(id, settings, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNSettingsV1 settings: TopN attachment settings (required)
        :return: TopNSettingsV1
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_top_n_attachment_settings1_with_http_info(id, settings, **kwargs)  # noqa: E501
        else:
            (data) = self.update_top_n_attachment_settings1_with_http_info(id, settings, **kwargs)  # noqa: E501
            return data

    def update_top_n_attachment_settings1_with_http_info(self, id, settings, **kwargs):  # noqa: E501
        """Update attachment settings  # noqa: E501

        Update topN attachment settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_top_n_attachment_settings1_with_http_info(id, settings, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNSettingsV1 settings: TopN attachment settings (required)
        :return: TopNSettingsV1
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'settings']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'settings' in params:
            body_params = params['settings']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/reports/attachments/topn/{id}/settings', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TopNSettingsV1',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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 update_top_n_attachment_time_settings(self, id, time, **kwargs):  # noqa: E501
        """Update topN report attachment  # noqa: E501

        Update a new topN attachment time settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_top_n_attachment_time_settings(id, time, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TimeSettings time: TopN attachment time settings (required)
        :return: TimeSettings
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_top_n_attachment_time_settings_with_http_info(id, time, **kwargs)  # noqa: E501
        else:
            (data) = self.update_top_n_attachment_time_settings_with_http_info(id, time, **kwargs)  # noqa: E501
            return data

    def update_top_n_attachment_time_settings_with_http_info(self, id, time, **kwargs):  # noqa: E501
        """Update topN report attachment  # noqa: E501

        Update a new topN attachment time settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_top_n_attachment_time_settings_with_http_info(id, time, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TimeSettings time: TopN attachment time settings (required)
        :return: TimeSettings
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'time']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'time' in params:
            body_params = params['time']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/reports/attachments/topn/{id}/time', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TimeSettings',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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 update_top_n_attachment_time_settings1(self, id, time, **kwargs):  # noqa: E501
        """Update topN report attachment  # noqa: E501

        Update a new topN attachment time settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_top_n_attachment_time_settings1(id, time, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TimeSettingV1 time: TopN attachment time settings (required)
        :return: TimeSettingV1
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_top_n_attachment_time_settings1_with_http_info(id, time, **kwargs)  # noqa: E501
        else:
            (data) = self.update_top_n_attachment_time_settings1_with_http_info(id, time, **kwargs)  # noqa: E501
            return data

    def update_top_n_attachment_time_settings1_with_http_info(self, id, time, **kwargs):  # noqa: E501
        """Update topN report attachment  # noqa: E501

        Update a new topN attachment time settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_top_n_attachment_time_settings1_with_http_info(id, time, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TimeSettingV1 time: TopN attachment time settings (required)
        :return: TimeSettingV1
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'time']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'time' in params:
            body_params = params['time']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/reports/attachments/topn/{id}/time', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TimeSettingV1',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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 update_top_n_attachment_visualization_settings(self, id, visualizations, **kwargs):  # noqa: E501
        """Update visualization settings  # noqa: E501

        Update topn visualization settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_top_n_attachment_visualization_settings(id, visualizations, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNVisualization visualizations: TopN attachment visualization settings (required)
        :return: TopNVisualization
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_top_n_attachment_visualization_settings_with_http_info(id, visualizations, **kwargs)  # noqa: E501
        else:
            (data) = self.update_top_n_attachment_visualization_settings_with_http_info(id, visualizations, **kwargs)  # noqa: E501
            return data

    def update_top_n_attachment_visualization_settings_with_http_info(self, id, visualizations, **kwargs):  # noqa: E501
        """Update visualization settings  # noqa: E501

        Update topn visualization settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_top_n_attachment_visualization_settings_with_http_info(id, visualizations, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNVisualization visualizations: TopN attachment visualization settings (required)
        :return: TopNVisualization
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'visualizations']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'visualizations' in params:
            body_params = params['visualizations']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v2/reports/attachments/topn/{id}/visualizations', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TopNVisualization',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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 update_top_n_attachment_visualization_settings1(self, id, visualizations, **kwargs):  # noqa: E501
        """Update visualization settings  # noqa: E501

        Update topn visualization settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_top_n_attachment_visualization_settings1(id, visualizations, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNVisualizationV1 visualizations: TopN attachment visualization settings (required)
        :return: TopNVisualizationV1
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.update_top_n_attachment_visualization_settings1_with_http_info(id, visualizations, **kwargs)  # noqa: E501
        else:
            (data) = self.update_top_n_attachment_visualization_settings1_with_http_info(id, visualizations, **kwargs)  # noqa: E501
            return data

    def update_top_n_attachment_visualization_settings1_with_http_info(self, id, visualizations, **kwargs):  # noqa: E501
        """Update visualization settings  # noqa: E501

        Update topn visualization settings  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_top_n_attachment_visualization_settings1_with_http_info(id, visualizations, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of the report attachment (required)
        :param TopNVisualizationV1 visualizations: TopN attachment visualization settings (required)
        :return: TopNVisualizationV1
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'visualizations']  # noqa: E501
        all_params.append('async_req')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

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

        collection_formats = {}

        path_params = {}
        if 'id' in params:
            path_params['id'] = params['id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'visualizations' in params:
            body_params = params['visualizations']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params['Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
            ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = []  # noqa: E501

        return self.api_client.call_api(
            '/api/v1/reports/attachments/topn/{id}/visualizations', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='TopNVisualizationV1',  # noqa: E501
            auth_settings=auth_settings,
            async_req=params.get('async_req'),
            _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)
