# 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 ReportAttachmentsDeviceGroupsApi(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_device_groups_attachment(self, id, device_attachment, **kwargs):  # noqa: E501
        """Create device groups attachment  # noqa: E501

        Create a new device groups 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_device_groups_attachment(id, device_attachment, 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 DeviceGroupsRequestDto device_attachment: DeviceGroup report attachment object (required)
        :return: DeviceGroupsResponseDto
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.create_device_groups_attachment_with_http_info(id, device_attachment, **kwargs)  # noqa: E501
        else:
            (data) = self.create_device_groups_attachment_with_http_info(id, device_attachment, **kwargs)  # noqa: E501
            return data

    def create_device_groups_attachment_with_http_info(self, id, device_attachment, **kwargs):  # noqa: E501
        """Create device groups attachment  # noqa: E501

        Create a new device groups 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_device_groups_attachment_with_http_info(id, device_attachment, 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 DeviceGroupsRequestDto device_attachment: DeviceGroup report attachment object (required)
        :return: DeviceGroupsResponseDto
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'device_attachment']  # 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_device_groups_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_device_groups_attachment`")  # noqa: E501
        # verify the required parameter 'device_attachment' is set
        if ('device_attachment' not in params or
                params['device_attachment'] is None):
            raise ValueError("Missing the required parameter `device_attachment` when calling `create_device_groups_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 'device_attachment' in params:
            body_params = params['device_attachment']
        # 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/devicegroups', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeviceGroupsResponseDto',  # 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_device_groups_attachment1(self, id, device_attachment, **kwargs):  # noqa: E501
        """Create device groups attachment  # noqa: E501

        Create a new device groups 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_device_groups_attachment1(id, device_attachment, 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 DeviceGroupsRequestDtoV1 device_attachment: DeviceGroup report attachment object (required)
        :return: DeviceGroupsResponseDtoV1
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.create_device_groups_attachment1_with_http_info(id, device_attachment, **kwargs)  # noqa: E501
        else:
            (data) = self.create_device_groups_attachment1_with_http_info(id, device_attachment, **kwargs)  # noqa: E501
            return data

    def create_device_groups_attachment1_with_http_info(self, id, device_attachment, **kwargs):  # noqa: E501
        """Create device groups attachment  # noqa: E501

        Create a new device groups 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_device_groups_attachment1_with_http_info(id, device_attachment, 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 DeviceGroupsRequestDtoV1 device_attachment: DeviceGroup report attachment object (required)
        :return: DeviceGroupsResponseDtoV1
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'device_attachment']  # 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_device_groups_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_device_groups_attachment1`")  # noqa: E501
        # verify the required parameter 'device_attachment' is set
        if ('device_attachment' not in params or
                params['device_attachment'] is None):
            raise ValueError("Missing the required parameter `device_attachment` when calling `create_device_groups_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 'device_attachment' in params:
            body_params = params['device_attachment']
        # 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/devicegroups', 'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeviceGroupsResponseDtoV1',  # 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_device_group_attachment(self, id, **kwargs):  # noqa: E501
        """Get device group attachment  # noqa: E501

        Get an existing devicegroup 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_device_group_attachment(id, async_req=True)
        >>> result = thread.get()

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

    def get_device_group_attachment_with_http_info(self, id, **kwargs):  # noqa: E501
        """Get device group attachment  # noqa: E501

        Get an existing devicegroup 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_device_group_attachment_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: Device group attachment id (required)
        :return: DeviceGroupsResponseDto
                 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_device_group_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_device_group_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/devicegroups/{id}', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeviceGroupsResponseDto',  # 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_device_groups_attachment(self, id, **kwargs):  # noqa: E501
        """Get resources for device groups report attachment  # noqa: E501

        Get resources for device groups 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_device_groups_attachment(id, async_req=True)
        >>> result = thread.get()

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

    def get_device_groups_attachment_with_http_info(self, id, **kwargs):  # noqa: E501
        """Get resources for device groups report attachment  # noqa: E501

        Get resources for device groups 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_device_groups_attachment_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: DeviceGroupsResource
                 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_device_groups_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_device_groups_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/devicegroups/{id}/resources', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeviceGroupsResource',  # 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_device_groups_attachment1(self, id, **kwargs):  # noqa: E501
        """Get resources for device groups report attachment  # noqa: E501

        Get resources for device groups 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_device_groups_attachment1(id, async_req=True)
        >>> result = thread.get()

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

    def get_device_groups_attachment1_with_http_info(self, id, **kwargs):  # noqa: E501
        """Get resources for device groups report attachment  # noqa: E501

        Get resources for device groups 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_device_groups_attachment1_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: DeviceGroupsResourceV1
                 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_device_groups_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 `get_device_groups_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
        # 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/devicegroups/{id}/resources', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeviceGroupsResourceV1',  # 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_device_groups_attachment_visualization(self, id, **kwargs):  # noqa: E501
        """Get visualization  # noqa: E501

        Get visualization for device groups 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_device_groups_attachment_visualization(id, async_req=True)
        >>> result = thread.get()

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

    def get_device_groups_attachment_visualization_with_http_info(self, id, **kwargs):  # noqa: E501
        """Get visualization  # noqa: E501

        Get visualization for device groups 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_device_groups_attachment_visualization_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of device groups attachment (required)
        :return: DeviceGroupsVisualization
                 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_device_groups_attachment_visualization" % 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_device_groups_attachment_visualization`")  # 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/devicegroups/{id}/visualizations', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeviceGroupsVisualization',  # 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_device_groups_attachment_visualization1(self, id, **kwargs):  # noqa: E501
        """Get visualization  # noqa: E501

        Get visualization for device groups 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_device_groups_attachment_visualization1(id, async_req=True)
        >>> result = thread.get()

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

    def get_device_groups_attachment_visualization1_with_http_info(self, id, **kwargs):  # noqa: E501
        """Get visualization  # noqa: E501

        Get visualization for device groups 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_device_groups_attachment_visualization1_with_http_info(id, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of device groups attachment (required)
        :return: DeviceGroupsVisualizationV1
                 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_device_groups_attachment_visualization1" % 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_device_groups_attachment_visualization1`")  # 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/devicegroups/{id}/visualizations', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeviceGroupsVisualizationV1',  # 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_device_groups_attachment(self, id, resource, **kwargs):  # noqa: E501
        """Update resources  # noqa: E501

        Update resources of device groups 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.update_device_groups_attachment(id, resource, async_req=True)
        >>> result = thread.get()

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

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

        Update resources of device groups 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.update_device_groups_attachment_with_http_info(id, resource, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of device groups attachment (required)
        :param DeviceGroupsResource resource: DeviceGroup attachment resources (required)
        :return: DeviceGroupsResource
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'resource']  # 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_device_groups_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 `update_device_groups_attachment`")  # noqa: E501
        # verify the required parameter 'resource' is set
        if ('resource' not in params or
                params['resource'] is None):
            raise ValueError("Missing the required parameter `resource` when calling `update_device_groups_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 'resource' in params:
            body_params = params['resource']
        # 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/devicegroups/{id}/resources', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeviceGroupsResource',  # 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_device_groups_attachment1(self, id, resource, **kwargs):  # noqa: E501
        """Update resources  # noqa: E501

        Update resources of device groups 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.update_device_groups_attachment1(id, resource, async_req=True)
        >>> result = thread.get()

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

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

        Update resources of device groups 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.update_device_groups_attachment1_with_http_info(id, resource, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of device groups attachment (required)
        :param DeviceGroupsResourceV1 resource: DeviceGroup attachment resources (required)
        :return: DeviceGroupsResourceV1
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'resource']  # 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_device_groups_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 `update_device_groups_attachment1`")  # noqa: E501
        # verify the required parameter 'resource' is set
        if ('resource' not in params or
                params['resource'] is None):
            raise ValueError("Missing the required parameter `resource` when calling `update_device_groups_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 'resource' in params:
            body_params = params['resource']
        # 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/devicegroups/{id}/resources', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeviceGroupsResourceV1',  # 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_device_groups_attachment_visualization(self, id, visualization, **kwargs):  # noqa: E501
        """Update visualization  # noqa: E501

        Update visualization for device groups 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.update_device_groups_attachment_visualization(id, visualization, async_req=True)
        >>> result = thread.get()

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

    def update_device_groups_attachment_visualization_with_http_info(self, id, visualization, **kwargs):  # noqa: E501
        """Update visualization  # noqa: E501

        Update visualization for device groups 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.update_device_groups_attachment_visualization_with_http_info(id, visualization, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of device groups attachment (required)
        :param DeviceGroupsVisualization visualization: Visualization settings (required)
        :return: DeviceGroupsVisualization
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'visualization']  # 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_device_groups_attachment_visualization" % 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_device_groups_attachment_visualization`")  # noqa: E501
        # verify the required parameter 'visualization' is set
        if ('visualization' not in params or
                params['visualization'] is None):
            raise ValueError("Missing the required parameter `visualization` when calling `update_device_groups_attachment_visualization`")  # 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 'visualization' in params:
            body_params = params['visualization']
        # 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/devicegroups/{id}/visualizations', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeviceGroupsVisualization',  # 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_device_groups_attachment_visualization1(self, id, visualization, **kwargs):  # noqa: E501
        """Update visualization  # noqa: E501

        Update visualization for device groups 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.update_device_groups_attachment_visualization1(id, visualization, async_req=True)
        >>> result = thread.get()

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

    def update_device_groups_attachment_visualization1_with_http_info(self, id, visualization, **kwargs):  # noqa: E501
        """Update visualization  # noqa: E501

        Update visualization for device groups 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.update_device_groups_attachment_visualization1_with_http_info(id, visualization, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int id: The id of device groups attachment (required)
        :param DeviceGroupsVisualizationV1 visualization: Visualization settings (required)
        :return: DeviceGroupsVisualizationV1
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['id', 'visualization']  # 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_device_groups_attachment_visualization1" % 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_device_groups_attachment_visualization1`")  # noqa: E501
        # verify the required parameter 'visualization' is set
        if ('visualization' not in params or
                params['visualization'] is None):
            raise ValueError("Missing the required parameter `visualization` when calling `update_device_groups_attachment_visualization1`")  # 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 'visualization' in params:
            body_params = params['visualization']
        # 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/devicegroups/{id}/visualizations', 'PUT',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='DeviceGroupsVisualizationV1',  # 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)
