# coding: utf-8

"""
    WakaTime API

    REST API for accessing your WakaTime coding activity stats. - Uses GET for retrieval, POST/PUT/PATCH for modification. - All requests must use HTTPS. - Responses are JSON objects. Data is in the `data` key, errors in `error` or `errors`. - Refer to WakaTime usage guidelines when using the trademark or logo.   # noqa: E501

    OpenAPI spec version: v1
    
    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 wakatime_api.api_client import ApiClient


class OrganizationsApi(object):
    """NOTE: This class is auto generated by the swagger code generator program.

    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

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

    def get_current_user_org_dashboard_durations(self, org, dashboard, _date, **kwargs):  # noqa: E501
        """Get Current User's Org Dashboard Durations  # noqa: E501

        Retrieve coding durations for all members of an organization dashboard the current user has access to.  # 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_current_user_org_dashboard_durations(org, dashboard, _date, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param date _date: Date in YYYY-MM-DD format. (required)
        :param str project: Filter by project name.
        :param str branches: Filter by comma-separated list of branch names.
        :return: OrgDashboardDurationsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_current_user_org_dashboard_durations_with_http_info(org, dashboard, _date, **kwargs)  # noqa: E501
        else:
            (data) = self.get_current_user_org_dashboard_durations_with_http_info(org, dashboard, _date, **kwargs)  # noqa: E501
            return data

    def get_current_user_org_dashboard_durations_with_http_info(self, org, dashboard, _date, **kwargs):  # noqa: E501
        """Get Current User's Org Dashboard Durations  # noqa: E501

        Retrieve coding durations for all members of an organization dashboard the current user has access to.  # 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_current_user_org_dashboard_durations_with_http_info(org, dashboard, _date, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param date _date: Date in YYYY-MM-DD format. (required)
        :param str project: Filter by project name.
        :param str branches: Filter by comma-separated list of branch names.
        :return: OrgDashboardDurationsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['org', 'dashboard', '_date', 'project', 'branches']  # 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_current_user_org_dashboard_durations" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'org' is set
        if ('org' not in params or
                params['org'] is None):
            raise ValueError("Missing the required parameter `org` when calling `get_current_user_org_dashboard_durations`")  # noqa: E501
        # verify the required parameter 'dashboard' is set
        if ('dashboard' not in params or
                params['dashboard'] is None):
            raise ValueError("Missing the required parameter `dashboard` when calling `get_current_user_org_dashboard_durations`")  # noqa: E501
        # verify the required parameter '_date' is set
        if ('_date' not in params or
                params['_date'] is None):
            raise ValueError("Missing the required parameter `_date` when calling `get_current_user_org_dashboard_durations`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if '_date' in params:
            query_params.append(('date', params['_date']))  # noqa: E501
        if 'project' in params:
            query_params.append(('project', params['project']))  # noqa: E501
        if 'branches' in params:
            query_params.append(('branches', params['branches']))  # noqa: E501

        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

        # Authentication setting
        auth_settings = ['oauth2']  # noqa: E501

        return self.api_client.call_api(
            '/users/current/orgs/{org}/dashboards/{dashboard}/durations', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrgDashboardDurationsResponse',  # 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_current_user_org_dashboard_member_durations(self, org, dashboard, member, _date, **kwargs):  # noqa: E501
        """Get Current User's Org Dashboard Member Durations  # noqa: E501

        Retrieve coding durations for a specific member of an organization dashboard the current user has access to.  # 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_current_user_org_dashboard_member_durations(org, dashboard, member, _date, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param str member: Member User ID. (required)
        :param date _date: Date in YYYY-MM-DD format. (required)
        :param str project: Filter by project name.
        :param str branches: Filter by comma-separated list of branch names.
        :return: OrgDashboardMemberDurationsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_current_user_org_dashboard_member_durations_with_http_info(org, dashboard, member, _date, **kwargs)  # noqa: E501
        else:
            (data) = self.get_current_user_org_dashboard_member_durations_with_http_info(org, dashboard, member, _date, **kwargs)  # noqa: E501
            return data

    def get_current_user_org_dashboard_member_durations_with_http_info(self, org, dashboard, member, _date, **kwargs):  # noqa: E501
        """Get Current User's Org Dashboard Member Durations  # noqa: E501

        Retrieve coding durations for a specific member of an organization dashboard the current user has access to.  # 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_current_user_org_dashboard_member_durations_with_http_info(org, dashboard, member, _date, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param str member: Member User ID. (required)
        :param date _date: Date in YYYY-MM-DD format. (required)
        :param str project: Filter by project name.
        :param str branches: Filter by comma-separated list of branch names.
        :return: OrgDashboardMemberDurationsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['org', 'dashboard', 'member', '_date', 'project', 'branches']  # 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_current_user_org_dashboard_member_durations" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'org' is set
        if ('org' not in params or
                params['org'] is None):
            raise ValueError("Missing the required parameter `org` when calling `get_current_user_org_dashboard_member_durations`")  # noqa: E501
        # verify the required parameter 'dashboard' is set
        if ('dashboard' not in params or
                params['dashboard'] is None):
            raise ValueError("Missing the required parameter `dashboard` when calling `get_current_user_org_dashboard_member_durations`")  # noqa: E501
        # verify the required parameter 'member' is set
        if ('member' not in params or
                params['member'] is None):
            raise ValueError("Missing the required parameter `member` when calling `get_current_user_org_dashboard_member_durations`")  # noqa: E501
        # verify the required parameter '_date' is set
        if ('_date' not in params or
                params['_date'] is None):
            raise ValueError("Missing the required parameter `_date` when calling `get_current_user_org_dashboard_member_durations`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'org' in params:
            path_params['org'] = params['org']  # noqa: E501
        if 'dashboard' in params:
            path_params['dashboard'] = params['dashboard']  # noqa: E501
        if 'member' in params:
            path_params['member'] = params['member']  # noqa: E501

        query_params = []
        if '_date' in params:
            query_params.append(('date', params['_date']))  # noqa: E501
        if 'project' in params:
            query_params.append(('project', params['project']))  # noqa: E501
        if 'branches' in params:
            query_params.append(('branches', params['branches']))  # noqa: E501

        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

        # Authentication setting
        auth_settings = ['oauth2']  # noqa: E501

        return self.api_client.call_api(
            '/users/current/orgs/{org}/dashboards/{dashboard}/members/{member}/durations', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrgDashboardMemberDurationsResponse',  # 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_current_user_org_dashboard_member_summaries(self, org, dashboard, member, start, end, **kwargs):  # noqa: E501
        """Get Current User's Org Dashboard Member Summaries  # noqa: E501

        Retrieve daily summaries for a specific member of an organization dashboard the current user has access to.  # 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_current_user_org_dashboard_member_summaries(org, dashboard, member, start, end, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param str member: Member User ID. (required)
        :param date start: Start date of the time range (YYYY-MM-DD). (required)
        :param date end: End date of the time range (YYYY-MM-DD). (required)
        :param str project: Filter by project name.
        :param str branches: Filter by comma-separated list of branch names.
        :param str range: Alternative way to specify date range (e.g., 'Today', 'Last 7 Days'). Overrides start/end if provided.
        :return: OrgDashboardMemberSummaryResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_current_user_org_dashboard_member_summaries_with_http_info(org, dashboard, member, start, end, **kwargs)  # noqa: E501
        else:
            (data) = self.get_current_user_org_dashboard_member_summaries_with_http_info(org, dashboard, member, start, end, **kwargs)  # noqa: E501
            return data

    def get_current_user_org_dashboard_member_summaries_with_http_info(self, org, dashboard, member, start, end, **kwargs):  # noqa: E501
        """Get Current User's Org Dashboard Member Summaries  # noqa: E501

        Retrieve daily summaries for a specific member of an organization dashboard the current user has access to.  # 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_current_user_org_dashboard_member_summaries_with_http_info(org, dashboard, member, start, end, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param str member: Member User ID. (required)
        :param date start: Start date of the time range (YYYY-MM-DD). (required)
        :param date end: End date of the time range (YYYY-MM-DD). (required)
        :param str project: Filter by project name.
        :param str branches: Filter by comma-separated list of branch names.
        :param str range: Alternative way to specify date range (e.g., 'Today', 'Last 7 Days'). Overrides start/end if provided.
        :return: OrgDashboardMemberSummaryResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['org', 'dashboard', 'member', 'start', 'end', 'project', 'branches', 'range']  # 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_current_user_org_dashboard_member_summaries" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'org' is set
        if ('org' not in params or
                params['org'] is None):
            raise ValueError("Missing the required parameter `org` when calling `get_current_user_org_dashboard_member_summaries`")  # noqa: E501
        # verify the required parameter 'dashboard' is set
        if ('dashboard' not in params or
                params['dashboard'] is None):
            raise ValueError("Missing the required parameter `dashboard` when calling `get_current_user_org_dashboard_member_summaries`")  # noqa: E501
        # verify the required parameter 'member' is set
        if ('member' not in params or
                params['member'] is None):
            raise ValueError("Missing the required parameter `member` when calling `get_current_user_org_dashboard_member_summaries`")  # noqa: E501
        # verify the required parameter 'start' is set
        if ('start' not in params or
                params['start'] is None):
            raise ValueError("Missing the required parameter `start` when calling `get_current_user_org_dashboard_member_summaries`")  # noqa: E501
        # verify the required parameter 'end' is set
        if ('end' not in params or
                params['end'] is None):
            raise ValueError("Missing the required parameter `end` when calling `get_current_user_org_dashboard_member_summaries`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'org' in params:
            path_params['org'] = params['org']  # noqa: E501
        if 'dashboard' in params:
            path_params['dashboard'] = params['dashboard']  # noqa: E501
        if 'member' in params:
            path_params['member'] = params['member']  # noqa: E501

        query_params = []
        if 'start' in params:
            query_params.append(('start', params['start']))  # noqa: E501
        if 'end' in params:
            query_params.append(('end', params['end']))  # noqa: E501
        if 'project' in params:
            query_params.append(('project', params['project']))  # noqa: E501
        if 'branches' in params:
            query_params.append(('branches', params['branches']))  # noqa: E501
        if 'range' in params:
            query_params.append(('range', params['range']))  # noqa: E501

        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

        # Authentication setting
        auth_settings = ['oauth2']  # noqa: E501

        return self.api_client.call_api(
            '/users/current/orgs/{org}/dashboards/{dashboard}/members/{member}/summaries', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrgDashboardMemberSummaryResponse',  # 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_current_user_org_dashboard_summaries(self, org, dashboard, _date, **kwargs):  # noqa: E501
        """Get Current User's Org Dashboard Summaries  # noqa: E501

        Retrieve daily summaries for all members of an organization dashboard the current user has access to.  # 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_current_user_org_dashboard_summaries(org, dashboard, _date, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param date _date: Date in YYYY-MM-DD format. (required)
        :param str project: Filter by project name.
        :param str branches: Filter by comma-separated list of branch names.
        :return: OrgDashboardSummariesResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_current_user_org_dashboard_summaries_with_http_info(org, dashboard, _date, **kwargs)  # noqa: E501
        else:
            (data) = self.get_current_user_org_dashboard_summaries_with_http_info(org, dashboard, _date, **kwargs)  # noqa: E501
            return data

    def get_current_user_org_dashboard_summaries_with_http_info(self, org, dashboard, _date, **kwargs):  # noqa: E501
        """Get Current User's Org Dashboard Summaries  # noqa: E501

        Retrieve daily summaries for all members of an organization dashboard the current user has access to.  # 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_current_user_org_dashboard_summaries_with_http_info(org, dashboard, _date, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param date _date: Date in YYYY-MM-DD format. (required)
        :param str project: Filter by project name.
        :param str branches: Filter by comma-separated list of branch names.
        :return: OrgDashboardSummariesResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['org', 'dashboard', '_date', 'project', 'branches']  # 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_current_user_org_dashboard_summaries" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'org' is set
        if ('org' not in params or
                params['org'] is None):
            raise ValueError("Missing the required parameter `org` when calling `get_current_user_org_dashboard_summaries`")  # noqa: E501
        # verify the required parameter 'dashboard' is set
        if ('dashboard' not in params or
                params['dashboard'] is None):
            raise ValueError("Missing the required parameter `dashboard` when calling `get_current_user_org_dashboard_summaries`")  # noqa: E501
        # verify the required parameter '_date' is set
        if ('_date' not in params or
                params['_date'] is None):
            raise ValueError("Missing the required parameter `_date` when calling `get_current_user_org_dashboard_summaries`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if '_date' in params:
            query_params.append(('date', params['_date']))  # noqa: E501
        if 'project' in params:
            query_params.append(('project', params['project']))  # noqa: E501
        if 'branches' in params:
            query_params.append(('branches', params['branches']))  # noqa: E501

        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

        # Authentication setting
        auth_settings = ['oauth2']  # noqa: E501

        return self.api_client.call_api(
            '/users/current/orgs/{org}/dashboards/{dashboard}/summaries', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrgDashboardSummariesResponse',  # 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_org_dashboard_durations(self, user, org, dashboard, _date, **kwargs):  # noqa: E501
        """Get Org Dashboard Durations  # noqa: E501

        Retrieve coding durations for all members of an organization dashboard for a specific day.  # 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_org_dashboard_durations(user, org, dashboard, _date, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str user: User ID or 'current' for the authenticated user. (required)
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param date _date: Date in YYYY-MM-DD format. (required)
        :param str project: Filter by project name.
        :param str branches: Filter by comma-separated list of branch names.
        :return: OrgDashboardDurationsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_org_dashboard_durations_with_http_info(user, org, dashboard, _date, **kwargs)  # noqa: E501
        else:
            (data) = self.get_org_dashboard_durations_with_http_info(user, org, dashboard, _date, **kwargs)  # noqa: E501
            return data

    def get_org_dashboard_durations_with_http_info(self, user, org, dashboard, _date, **kwargs):  # noqa: E501
        """Get Org Dashboard Durations  # noqa: E501

        Retrieve coding durations for all members of an organization dashboard for a specific day.  # 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_org_dashboard_durations_with_http_info(user, org, dashboard, _date, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str user: User ID or 'current' for the authenticated user. (required)
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param date _date: Date in YYYY-MM-DD format. (required)
        :param str project: Filter by project name.
        :param str branches: Filter by comma-separated list of branch names.
        :return: OrgDashboardDurationsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user', 'org', 'dashboard', '_date', 'project', 'branches']  # 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_org_dashboard_durations" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'user' is set
        if ('user' not in params or
                params['user'] is None):
            raise ValueError("Missing the required parameter `user` when calling `get_org_dashboard_durations`")  # noqa: E501
        # verify the required parameter 'org' is set
        if ('org' not in params or
                params['org'] is None):
            raise ValueError("Missing the required parameter `org` when calling `get_org_dashboard_durations`")  # noqa: E501
        # verify the required parameter 'dashboard' is set
        if ('dashboard' not in params or
                params['dashboard'] is None):
            raise ValueError("Missing the required parameter `dashboard` when calling `get_org_dashboard_durations`")  # noqa: E501
        # verify the required parameter '_date' is set
        if ('_date' not in params or
                params['_date'] is None):
            raise ValueError("Missing the required parameter `_date` when calling `get_org_dashboard_durations`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'user' in params:
            path_params['user'] = params['user']  # noqa: E501
        if 'org' in params:
            path_params['org'] = params['org']  # noqa: E501
        if 'dashboard' in params:
            path_params['dashboard'] = params['dashboard']  # noqa: E501

        query_params = []
        if '_date' in params:
            query_params.append(('date', params['_date']))  # noqa: E501
        if 'project' in params:
            query_params.append(('project', params['project']))  # noqa: E501
        if 'branches' in params:
            query_params.append(('branches', params['branches']))  # noqa: E501

        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

        # Authentication setting
        auth_settings = ['oauth2']  # noqa: E501

        return self.api_client.call_api(
            '/users/{user}/orgs/{org}/dashboards/{dashboard}/durations', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrgDashboardDurationsResponse',  # 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_org_dashboard_member_durations(self, user, org, dashboard, member, _date, **kwargs):  # noqa: E501
        """Get Org Dashboard Member Durations  # noqa: E501

        Retrieve coding durations for a specific member of an organization dashboard for a given day.  # 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_org_dashboard_member_durations(user, org, dashboard, member, _date, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str user: User ID or 'current' for the authenticated user. (required)
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param str member: Member User ID. (required)
        :param date _date: Date in YYYY-MM-DD format. (required)
        :param str project: Filter by project name.
        :param str branches: Filter by comma-separated list of branch names.
        :return: OrgDashboardMemberDurationsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_org_dashboard_member_durations_with_http_info(user, org, dashboard, member, _date, **kwargs)  # noqa: E501
        else:
            (data) = self.get_org_dashboard_member_durations_with_http_info(user, org, dashboard, member, _date, **kwargs)  # noqa: E501
            return data

    def get_org_dashboard_member_durations_with_http_info(self, user, org, dashboard, member, _date, **kwargs):  # noqa: E501
        """Get Org Dashboard Member Durations  # noqa: E501

        Retrieve coding durations for a specific member of an organization dashboard for a given day.  # 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_org_dashboard_member_durations_with_http_info(user, org, dashboard, member, _date, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str user: User ID or 'current' for the authenticated user. (required)
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param str member: Member User ID. (required)
        :param date _date: Date in YYYY-MM-DD format. (required)
        :param str project: Filter by project name.
        :param str branches: Filter by comma-separated list of branch names.
        :return: OrgDashboardMemberDurationsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user', 'org', 'dashboard', 'member', '_date', 'project', 'branches']  # 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_org_dashboard_member_durations" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'user' is set
        if ('user' not in params or
                params['user'] is None):
            raise ValueError("Missing the required parameter `user` when calling `get_org_dashboard_member_durations`")  # noqa: E501
        # verify the required parameter 'org' is set
        if ('org' not in params or
                params['org'] is None):
            raise ValueError("Missing the required parameter `org` when calling `get_org_dashboard_member_durations`")  # noqa: E501
        # verify the required parameter 'dashboard' is set
        if ('dashboard' not in params or
                params['dashboard'] is None):
            raise ValueError("Missing the required parameter `dashboard` when calling `get_org_dashboard_member_durations`")  # noqa: E501
        # verify the required parameter 'member' is set
        if ('member' not in params or
                params['member'] is None):
            raise ValueError("Missing the required parameter `member` when calling `get_org_dashboard_member_durations`")  # noqa: E501
        # verify the required parameter '_date' is set
        if ('_date' not in params or
                params['_date'] is None):
            raise ValueError("Missing the required parameter `_date` when calling `get_org_dashboard_member_durations`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'user' in params:
            path_params['user'] = params['user']  # noqa: E501
        if 'org' in params:
            path_params['org'] = params['org']  # noqa: E501
        if 'dashboard' in params:
            path_params['dashboard'] = params['dashboard']  # noqa: E501
        if 'member' in params:
            path_params['member'] = params['member']  # noqa: E501

        query_params = []
        if '_date' in params:
            query_params.append(('date', params['_date']))  # noqa: E501
        if 'project' in params:
            query_params.append(('project', params['project']))  # noqa: E501
        if 'branches' in params:
            query_params.append(('branches', params['branches']))  # noqa: E501

        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

        # Authentication setting
        auth_settings = ['oauth2']  # noqa: E501

        return self.api_client.call_api(
            '/users/{user}/orgs/{org}/dashboards/{dashboard}/members/{member}/durations', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrgDashboardMemberDurationsResponse',  # 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_org_dashboard_member_summaries(self, user, org, dashboard, member, start, end, **kwargs):  # noqa: E501
        """Get Org Dashboard Member Summaries  # noqa: E501

        Retrieve daily summaries for a specific member of an organization dashboard over a given time range.  # 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_org_dashboard_member_summaries(user, org, dashboard, member, start, end, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str user: User ID or 'current' for the authenticated user. (required)
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param str member: Member User ID. (required)
        :param date start: Start date of the time range (YYYY-MM-DD). (required)
        :param date end: End date of the time range (YYYY-MM-DD). (required)
        :param str project: Filter by project name.
        :param str branches: Filter by comma-separated list of branch names.
        :param str range: Alternative way to specify date range (e.g., 'Today', 'Last 7 Days'). Overrides start/end if provided.
        :return: OrgDashboardMemberSummaryResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_org_dashboard_member_summaries_with_http_info(user, org, dashboard, member, start, end, **kwargs)  # noqa: E501
        else:
            (data) = self.get_org_dashboard_member_summaries_with_http_info(user, org, dashboard, member, start, end, **kwargs)  # noqa: E501
            return data

    def get_org_dashboard_member_summaries_with_http_info(self, user, org, dashboard, member, start, end, **kwargs):  # noqa: E501
        """Get Org Dashboard Member Summaries  # noqa: E501

        Retrieve daily summaries for a specific member of an organization dashboard over a given time range.  # 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_org_dashboard_member_summaries_with_http_info(user, org, dashboard, member, start, end, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str user: User ID or 'current' for the authenticated user. (required)
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param str member: Member User ID. (required)
        :param date start: Start date of the time range (YYYY-MM-DD). (required)
        :param date end: End date of the time range (YYYY-MM-DD). (required)
        :param str project: Filter by project name.
        :param str branches: Filter by comma-separated list of branch names.
        :param str range: Alternative way to specify date range (e.g., 'Today', 'Last 7 Days'). Overrides start/end if provided.
        :return: OrgDashboardMemberSummaryResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user', 'org', 'dashboard', 'member', 'start', 'end', 'project', 'branches', 'range']  # 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_org_dashboard_member_summaries" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'user' is set
        if ('user' not in params or
                params['user'] is None):
            raise ValueError("Missing the required parameter `user` when calling `get_org_dashboard_member_summaries`")  # noqa: E501
        # verify the required parameter 'org' is set
        if ('org' not in params or
                params['org'] is None):
            raise ValueError("Missing the required parameter `org` when calling `get_org_dashboard_member_summaries`")  # noqa: E501
        # verify the required parameter 'dashboard' is set
        if ('dashboard' not in params or
                params['dashboard'] is None):
            raise ValueError("Missing the required parameter `dashboard` when calling `get_org_dashboard_member_summaries`")  # noqa: E501
        # verify the required parameter 'member' is set
        if ('member' not in params or
                params['member'] is None):
            raise ValueError("Missing the required parameter `member` when calling `get_org_dashboard_member_summaries`")  # noqa: E501
        # verify the required parameter 'start' is set
        if ('start' not in params or
                params['start'] is None):
            raise ValueError("Missing the required parameter `start` when calling `get_org_dashboard_member_summaries`")  # noqa: E501
        # verify the required parameter 'end' is set
        if ('end' not in params or
                params['end'] is None):
            raise ValueError("Missing the required parameter `end` when calling `get_org_dashboard_member_summaries`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'user' in params:
            path_params['user'] = params['user']  # noqa: E501
        if 'org' in params:
            path_params['org'] = params['org']  # noqa: E501
        if 'dashboard' in params:
            path_params['dashboard'] = params['dashboard']  # noqa: E501
        if 'member' in params:
            path_params['member'] = params['member']  # noqa: E501

        query_params = []
        if 'start' in params:
            query_params.append(('start', params['start']))  # noqa: E501
        if 'end' in params:
            query_params.append(('end', params['end']))  # noqa: E501
        if 'project' in params:
            query_params.append(('project', params['project']))  # noqa: E501
        if 'branches' in params:
            query_params.append(('branches', params['branches']))  # noqa: E501
        if 'range' in params:
            query_params.append(('range', params['range']))  # noqa: E501

        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

        # Authentication setting
        auth_settings = ['oauth2']  # noqa: E501

        return self.api_client.call_api(
            '/users/{user}/orgs/{org}/dashboards/{dashboard}/members/{member}/summaries', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrgDashboardMemberSummaryResponse',  # 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_org_dashboard_summaries(self, user, org, dashboard, _date, **kwargs):  # noqa: E501
        """Get Org Dashboard Summaries  # noqa: E501

        Retrieve daily summaries for all members of an organization dashboard for a specific day.  # 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_org_dashboard_summaries(user, org, dashboard, _date, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str user: User ID or 'current' for the authenticated user. (required)
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param date _date: Date in YYYY-MM-DD format. (required)
        :param str project: Filter by project name.
        :param str branches: Filter by comma-separated list of branch names.
        :return: OrgDashboardSummariesResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.get_org_dashboard_summaries_with_http_info(user, org, dashboard, _date, **kwargs)  # noqa: E501
        else:
            (data) = self.get_org_dashboard_summaries_with_http_info(user, org, dashboard, _date, **kwargs)  # noqa: E501
            return data

    def get_org_dashboard_summaries_with_http_info(self, user, org, dashboard, _date, **kwargs):  # noqa: E501
        """Get Org Dashboard Summaries  # noqa: E501

        Retrieve daily summaries for all members of an organization dashboard for a specific day.  # 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_org_dashboard_summaries_with_http_info(user, org, dashboard, _date, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str user: User ID or 'current' for the authenticated user. (required)
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param date _date: Date in YYYY-MM-DD format. (required)
        :param str project: Filter by project name.
        :param str branches: Filter by comma-separated list of branch names.
        :return: OrgDashboardSummariesResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user', 'org', 'dashboard', '_date', 'project', 'branches']  # 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_org_dashboard_summaries" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'user' is set
        if ('user' not in params or
                params['user'] is None):
            raise ValueError("Missing the required parameter `user` when calling `get_org_dashboard_summaries`")  # noqa: E501
        # verify the required parameter 'org' is set
        if ('org' not in params or
                params['org'] is None):
            raise ValueError("Missing the required parameter `org` when calling `get_org_dashboard_summaries`")  # noqa: E501
        # verify the required parameter 'dashboard' is set
        if ('dashboard' not in params or
                params['dashboard'] is None):
            raise ValueError("Missing the required parameter `dashboard` when calling `get_org_dashboard_summaries`")  # noqa: E501
        # verify the required parameter '_date' is set
        if ('_date' not in params or
                params['_date'] is None):
            raise ValueError("Missing the required parameter `_date` when calling `get_org_dashboard_summaries`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'user' in params:
            path_params['user'] = params['user']  # noqa: E501
        if 'org' in params:
            path_params['org'] = params['org']  # noqa: E501
        if 'dashboard' in params:
            path_params['dashboard'] = params['dashboard']  # noqa: E501

        query_params = []
        if '_date' in params:
            query_params.append(('date', params['_date']))  # noqa: E501
        if 'project' in params:
            query_params.append(('project', params['project']))  # noqa: E501
        if 'branches' in params:
            query_params.append(('branches', params['branches']))  # noqa: E501

        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

        # Authentication setting
        auth_settings = ['oauth2']  # noqa: E501

        return self.api_client.call_api(
            '/users/{user}/orgs/{org}/dashboards/{dashboard}/summaries', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrgDashboardSummariesResponse',  # 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 list_current_user_org_dashboard_members(self, org, dashboard, **kwargs):  # noqa: E501
        """List Current User's Org Dashboard Members  # noqa: E501

        Retrieve a list of members for an organization dashboard the current user has access to.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_current_user_org_dashboard_members(org, dashboard, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param int page: Page number for paginated results.
        :return: OrgDashboardMembersListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_current_user_org_dashboard_members_with_http_info(org, dashboard, **kwargs)  # noqa: E501
        else:
            (data) = self.list_current_user_org_dashboard_members_with_http_info(org, dashboard, **kwargs)  # noqa: E501
            return data

    def list_current_user_org_dashboard_members_with_http_info(self, org, dashboard, **kwargs):  # noqa: E501
        """List Current User's Org Dashboard Members  # noqa: E501

        Retrieve a list of members for an organization dashboard the current user has access to.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_current_user_org_dashboard_members_with_http_info(org, dashboard, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param int page: Page number for paginated results.
        :return: OrgDashboardMembersListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['org', 'dashboard', 'page']  # 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 list_current_user_org_dashboard_members" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'org' is set
        if ('org' not in params or
                params['org'] is None):
            raise ValueError("Missing the required parameter `org` when calling `list_current_user_org_dashboard_members`")  # noqa: E501
        # verify the required parameter 'dashboard' is set
        if ('dashboard' not in params or
                params['dashboard'] is None):
            raise ValueError("Missing the required parameter `dashboard` when calling `list_current_user_org_dashboard_members`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'page' in params:
            query_params.append(('page', params['page']))  # noqa: E501

        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

        # Authentication setting
        auth_settings = ['oauth2']  # noqa: E501

        return self.api_client.call_api(
            '/users/current/orgs/{org}/dashboards/{dashboard}/members', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrgDashboardMembersListResponse',  # 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 list_current_user_org_dashboards(self, org, **kwargs):  # noqa: E501
        """List Current User's Org Dashboards  # noqa: E501

        Retrieve a list of dashboards for an organization the current user belongs to.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_current_user_org_dashboards(org, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org: Organization ID. (required)
        :param int page: Page number for paginated results.
        :return: OrgDashboardsListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_current_user_org_dashboards_with_http_info(org, **kwargs)  # noqa: E501
        else:
            (data) = self.list_current_user_org_dashboards_with_http_info(org, **kwargs)  # noqa: E501
            return data

    def list_current_user_org_dashboards_with_http_info(self, org, **kwargs):  # noqa: E501
        """List Current User's Org Dashboards  # noqa: E501

        Retrieve a list of dashboards for an organization the current user belongs to.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_current_user_org_dashboards_with_http_info(org, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str org: Organization ID. (required)
        :param int page: Page number for paginated results.
        :return: OrgDashboardsListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['org', 'page']  # 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 list_current_user_org_dashboards" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'org' is set
        if ('org' not in params or
                params['org'] is None):
            raise ValueError("Missing the required parameter `org` when calling `list_current_user_org_dashboards`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'page' in params:
            query_params.append(('page', params['page']))  # noqa: E501

        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

        # Authentication setting
        auth_settings = ['oauth2']  # noqa: E501

        return self.api_client.call_api(
            '/users/current/orgs/{org}/dashboards', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrgDashboardsListResponse',  # 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 list_current_user_orgs(self, **kwargs):  # noqa: E501
        """List Current User Organizations  # noqa: E501

        Retrieve a list of organizations the currently authenticated user belongs to.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_current_user_orgs(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int page: Page number for paginated results.
        :return: OrgsListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_current_user_orgs_with_http_info(**kwargs)  # noqa: E501
        else:
            (data) = self.list_current_user_orgs_with_http_info(**kwargs)  # noqa: E501
            return data

    def list_current_user_orgs_with_http_info(self, **kwargs):  # noqa: E501
        """List Current User Organizations  # noqa: E501

        Retrieve a list of organizations the currently authenticated user belongs to.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_current_user_orgs_with_http_info(async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param int page: Page number for paginated results.
        :return: OrgsListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['page']  # 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 list_current_user_orgs" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        path_params = {}

        query_params = []
        if 'page' in params:
            query_params.append(('page', params['page']))  # noqa: E501

        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

        # Authentication setting
        auth_settings = ['oauth2']  # noqa: E501

        return self.api_client.call_api(
            '/users/current/orgs', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrgsListResponse',  # 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 list_org_dashboard_members(self, user, org, dashboard, **kwargs):  # noqa: E501
        """List Org Dashboard Members  # noqa: E501

        Retrieve a list of members belonging to a specific organization dashboard.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_org_dashboard_members(user, org, dashboard, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str user: User ID or 'current' for the authenticated user. (required)
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param int page: Page number for paginated results.
        :return: OrgDashboardMembersListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_org_dashboard_members_with_http_info(user, org, dashboard, **kwargs)  # noqa: E501
        else:
            (data) = self.list_org_dashboard_members_with_http_info(user, org, dashboard, **kwargs)  # noqa: E501
            return data

    def list_org_dashboard_members_with_http_info(self, user, org, dashboard, **kwargs):  # noqa: E501
        """List Org Dashboard Members  # noqa: E501

        Retrieve a list of members belonging to a specific organization dashboard.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_org_dashboard_members_with_http_info(user, org, dashboard, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str user: User ID or 'current' for the authenticated user. (required)
        :param str org: Organization ID. (required)
        :param str dashboard: Dashboard ID. (required)
        :param int page: Page number for paginated results.
        :return: OrgDashboardMembersListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user', 'org', 'dashboard', 'page']  # 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 list_org_dashboard_members" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'user' is set
        if ('user' not in params or
                params['user'] is None):
            raise ValueError("Missing the required parameter `user` when calling `list_org_dashboard_members`")  # noqa: E501
        # verify the required parameter 'org' is set
        if ('org' not in params or
                params['org'] is None):
            raise ValueError("Missing the required parameter `org` when calling `list_org_dashboard_members`")  # noqa: E501
        # verify the required parameter 'dashboard' is set
        if ('dashboard' not in params or
                params['dashboard'] is None):
            raise ValueError("Missing the required parameter `dashboard` when calling `list_org_dashboard_members`")  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'user' in params:
            path_params['user'] = params['user']  # noqa: E501
        if 'org' in params:
            path_params['org'] = params['org']  # noqa: E501
        if 'dashboard' in params:
            path_params['dashboard'] = params['dashboard']  # noqa: E501

        query_params = []
        if 'page' in params:
            query_params.append(('page', params['page']))  # noqa: E501

        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

        # Authentication setting
        auth_settings = ['oauth2']  # noqa: E501

        return self.api_client.call_api(
            '/users/{user}/orgs/{org}/dashboards/{dashboard}/members', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrgDashboardMembersListResponse',  # 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 list_org_dashboards(self, user, org, **kwargs):  # noqa: E501
        """List Org Dashboards  # noqa: E501

        Retrieve a list of dashboards within a specific organization.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_org_dashboards(user, org, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str user: User ID or 'current' for the authenticated user. (required)
        :param str org: Organization ID. (required)
        :param int page: Page number for paginated results.
        :return: OrgDashboardsListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_org_dashboards_with_http_info(user, org, **kwargs)  # noqa: E501
        else:
            (data) = self.list_org_dashboards_with_http_info(user, org, **kwargs)  # noqa: E501
            return data

    def list_org_dashboards_with_http_info(self, user, org, **kwargs):  # noqa: E501
        """List Org Dashboards  # noqa: E501

        Retrieve a list of dashboards within a specific organization.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_org_dashboards_with_http_info(user, org, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str user: User ID or 'current' for the authenticated user. (required)
        :param str org: Organization ID. (required)
        :param int page: Page number for paginated results.
        :return: OrgDashboardsListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user', 'org', 'page']  # 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 list_org_dashboards" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'user' is set
        if ('user' not in params or
                params['user'] is None):
            raise ValueError("Missing the required parameter `user` when calling `list_org_dashboards`")  # noqa: E501
        # verify the required parameter 'org' is set
        if ('org' not in params or
                params['org'] is None):
            raise ValueError("Missing the required parameter `org` when calling `list_org_dashboards`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'page' in params:
            query_params.append(('page', params['page']))  # noqa: E501

        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

        # Authentication setting
        auth_settings = ['oauth2']  # noqa: E501

        return self.api_client.call_api(
            '/users/{user}/orgs/{org}/dashboards', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrgDashboardsListResponse',  # 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 list_orgs(self, user, **kwargs):  # noqa: E501
        """List User Organizations  # noqa: E501

        Retrieve a list of organizations the specified user belongs to.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_orgs(user, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str user: User ID or 'current' for the authenticated user. (required)
        :param int page: Page number for paginated results.
        :return: OrgsListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('async_req'):
            return self.list_orgs_with_http_info(user, **kwargs)  # noqa: E501
        else:
            (data) = self.list_orgs_with_http_info(user, **kwargs)  # noqa: E501
            return data

    def list_orgs_with_http_info(self, user, **kwargs):  # noqa: E501
        """List User Organizations  # noqa: E501

        Retrieve a list of organizations the specified user belongs to.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.list_orgs_with_http_info(user, async_req=True)
        >>> result = thread.get()

        :param async_req bool
        :param str user: User ID or 'current' for the authenticated user. (required)
        :param int page: Page number for paginated results.
        :return: OrgsListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['user', 'page']  # 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 list_orgs" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'user' is set
        if ('user' not in params or
                params['user'] is None):
            raise ValueError("Missing the required parameter `user` when calling `list_orgs`")  # noqa: E501

        collection_formats = {}

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

        query_params = []
        if 'page' in params:
            query_params.append(('page', params['page']))  # noqa: E501

        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

        # Authentication setting
        auth_settings = ['oauth2']  # noqa: E501

        return self.api_client.call_api(
            '/users/{user}/orgs', 'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='OrgsListResponse',  # 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)
