# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import SDKClient
from msrest import Configuration, Serializer, Deserializer
from .version import VERSION
from msrest.pipeline import ClientRawResponse
from msrest.exceptions import HttpOperationError
from . import models


class TeamCloudClientConfiguration(Configuration):
    """Configuration for TeamCloudClient
    Note that all parameters used to create this instance are saved as instance
    attributes.

    :param credentials: Subscription credentials which uniquely identify
     client subscription.
    :type credentials: None
    :param str base_url: Service URL
    """

    def __init__(
            self, credentials, base_url=None):

        if credentials is None:
            raise ValueError("Parameter 'credentials' must not be None.")
        if not base_url:
            base_url = 'http://localhost'

        super(TeamCloudClientConfiguration, self).__init__(base_url)

        self.add_user_agent('teamcloudclient/{}'.format(VERSION))

        self.credentials = credentials


class TeamCloudClient(SDKClient):
    """API for working with a TeamCloud instance.

    :ivar config: Configuration for client.
    :vartype config: TeamCloudClientConfiguration

    :param credentials: Subscription credentials which uniquely identify
     client subscription.
    :type credentials: None
    :param str base_url: Service URL
    """

    def __init__(
            self, credentials, base_url=None):

        self.config = TeamCloudClientConfiguration(credentials, base_url)
        super(TeamCloudClient, self).__init__(self.config.credentials, self.config)

        client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
        self.api_version = 'v1'
        self._serialize = Serializer(client_models)
        self._deserialize = Deserializer(client_models)


    def get_project_identity(
            self, project_id, custom_headers=None, raw=False, **operation_config):
        """Gets the ProjectIdentity for a Project.

        :param project_id:
        :type project_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_project_identity.metadata['url']
        path_format_arguments = {
            'projectId': self._serialize.url("project_id", project_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('ProjectIdentityDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_project_identity.metadata = {'url': '/api/projects/{projectId}/identity'}

    def get_project_provider_data(
            self, project_id, provider_id, include_shared=None, custom_headers=None, raw=False, **operation_config):
        """Gets the ProviderData items for a Project.

        :param project_id:
        :type project_id: str
        :param provider_id:
        :type provider_id: str
        :param include_shared:
        :type include_shared: bool
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_project_provider_data.metadata['url']
        path_format_arguments = {
            'projectId': self._serialize.url("project_id", project_id, 'str'),
            'providerId': self._serialize.url("provider_id", provider_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}
        if include_shared is not None:
            query_parameters['includeShared'] = self._serialize.query("include_shared", include_shared, 'bool')

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('ProviderDataDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_project_provider_data.metadata = {'url': '/api/projects/{projectId}/providers/{providerId}/data'}

    def create_project_provider_data(
            self, project_id, provider_id, body=None, custom_headers=None, raw=False, **operation_config):
        """Creates a new ProviderData.

        :param project_id:
        :type project_id: str
        :param provider_id:
        :type provider_id: str
        :param body:
        :type body: ~teamcloud.models.ProviderData
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.create_project_provider_data.metadata['url']
        path_format_arguments = {
            'projectId': self._serialize.url("project_id", project_id, 'str'),
            'providerId': self._serialize.url("provider_id", provider_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, 'ProviderData')
        else:
            body_content = None

        # Construct and send request
        request = self._client.post(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [201, 400, 401, 403, 404, 409]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 201:
            deserialized = self._deserialize('ProviderDataDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 409:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    create_project_provider_data.metadata = {'url': '/api/projects/{projectId}/providers/{providerId}/data'}

    def get_project_provider_data_by_id(
            self, provider_data_id, project_id, provider_id, custom_headers=None, raw=False, **operation_config):
        """Gets a ProviderData for a Project by ID.

        :param provider_data_id:
        :type provider_data_id: str
        :param project_id:
        :type project_id: str
        :param provider_id:
        :type provider_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_project_provider_data_by_id.metadata['url']
        path_format_arguments = {
            'providerDataId': self._serialize.url("provider_data_id", provider_data_id, 'str'),
            'projectId': self._serialize.url("project_id", project_id, 'str'),
            'providerId': self._serialize.url("provider_id", provider_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('ProviderDataDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_project_provider_data_by_id.metadata = {'url': '/api/projects/{projectId}/providers/{providerId}/data/{providerDataId}'}

    def update_project_provider_data(
            self, provider_data_id, project_id, provider_id, body=None, custom_headers=None, raw=False, **operation_config):
        """Updates an existing ProviderData.

        :param provider_data_id:
        :type provider_data_id: str
        :param project_id:
        :type project_id: str
        :param provider_id:
        :type provider_id: str
        :param body:
        :type body: ~teamcloud.models.ProviderData
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.update_project_provider_data.metadata['url']
        path_format_arguments = {
            'providerDataId': self._serialize.url("provider_data_id", provider_data_id, 'str'),
            'projectId': self._serialize.url("project_id", project_id, 'str'),
            'providerId': self._serialize.url("provider_id", provider_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, 'ProviderData')
        else:
            body_content = None

        # Construct and send request
        request = self._client.put(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('ProviderDataDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    update_project_provider_data.metadata = {'url': '/api/projects/{projectId}/providers/{providerId}/data/{providerDataId}'}

    def delete_project_provider_data(
            self, provider_data_id, project_id, provider_id, custom_headers=None, raw=False, **operation_config):
        """Deletes a ProviderData.

        :param provider_data_id:
        :type provider_data_id: str
        :param project_id:
        :type project_id: str
        :param provider_id:
        :type provider_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.delete_project_provider_data.metadata['url']
        path_format_arguments = {
            'providerDataId': self._serialize.url("provider_data_id", provider_data_id, 'str'),
            'projectId': self._serialize.url("project_id", project_id, 'str'),
            'providerId': self._serialize.url("provider_id", provider_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.delete(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [204, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 204:
            deserialized = self._deserialize('ProviderDataDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    delete_project_provider_data.metadata = {'url': '/api/projects/{projectId}/providers/{providerId}/data/{providerDataId}'}

    def get_projects(
            self, custom_headers=None, raw=False, **operation_config):
        """Gets all Projects.

        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_projects.metadata['url']

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('ProjectListDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_projects.metadata = {'url': '/api/projects'}

    def create_project(
            self, body=None, custom_headers=None, raw=False, **operation_config):
        """Creates a new Project.

        :param body:
        :type body: ~teamcloud.models.ProjectDefinition
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.create_project.metadata['url']

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, 'ProjectDefinition')
        else:
            body_content = None

        # Construct and send request
        request = self._client.post(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 400, 401, 403, 409]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 409:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    create_project.metadata = {'url': '/api/projects'}

    def get_project_by_name_or_id(
            self, project_name_or_id, custom_headers=None, raw=False, **operation_config):
        """Gets a Project by Name or ID.

        :param project_name_or_id:
        :type project_name_or_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_project_by_name_or_id.metadata['url']
        path_format_arguments = {
            'projectNameOrId': self._serialize.url("project_name_or_id", project_name_or_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('ProjectDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_project_by_name_or_id.metadata = {'url': '/api/projects/{projectNameOrId}'}

    def delete_project(
            self, project_name_or_id, custom_headers=None, raw=False, **operation_config):
        """Deletes a Project.

        :param project_name_or_id:
        :type project_name_or_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.delete_project.metadata['url']
        path_format_arguments = {
            'projectNameOrId': self._serialize.url("project_name_or_id", project_name_or_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.delete(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    delete_project.metadata = {'url': '/api/projects/{projectNameOrId}'}

    def get_project_tags(
            self, project_id, custom_headers=None, raw=False, **operation_config):
        """Gets all Tags for a Project.

        :param project_id:
        :type project_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_project_tags.metadata['url']
        path_format_arguments = {
            'projectId': self._serialize.url("project_id", project_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('StringStringDictionaryDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_project_tags.metadata = {'url': '/api/projects/{projectId}/tags'}

    def create_project_tag(
            self, project_id, body=None, custom_headers=None, raw=False, **operation_config):
        """Creates a new Project Tag.

        :param project_id:
        :type project_id: str
        :param body:
        :type body: dict[str, str]
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.create_project_tag.metadata['url']
        path_format_arguments = {
            'projectId': self._serialize.url("project_id", project_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, '{str}')
        else:
            body_content = None

        # Construct and send request
        request = self._client.post(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 400, 401, 403, 404, 409]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 409:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    create_project_tag.metadata = {'url': '/api/projects/{projectId}/tags'}

    def update_project_tag(
            self, project_id, body=None, custom_headers=None, raw=False, **operation_config):
        """Updates an existing Project Tag.

        :param project_id:
        :type project_id: str
        :param body:
        :type body: dict[str, str]
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.update_project_tag.metadata['url']
        path_format_arguments = {
            'projectId': self._serialize.url("project_id", project_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, '{str}')
        else:
            body_content = None

        # Construct and send request
        request = self._client.put(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    update_project_tag.metadata = {'url': '/api/projects/{projectId}/tags'}

    def get_project_tag_by_key(
            self, tag_key, project_id, custom_headers=None, raw=False, **operation_config):
        """Gets a Project Tag by Key.

        :param tag_key:
        :type tag_key: str
        :param project_id:
        :type project_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_project_tag_by_key.metadata['url']
        path_format_arguments = {
            'tagKey': self._serialize.url("tag_key", tag_key, 'str'),
            'projectId': self._serialize.url("project_id", project_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('StringStringDictionaryDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_project_tag_by_key.metadata = {'url': '/api/projects/{projectId}/tags/{tagKey}'}

    def delete_project_tag(
            self, tag_key, project_id, custom_headers=None, raw=False, **operation_config):
        """Deletes an existing Project Tag.

        :param tag_key:
        :type tag_key: str
        :param project_id:
        :type project_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.delete_project_tag.metadata['url']
        path_format_arguments = {
            'tagKey': self._serialize.url("tag_key", tag_key, 'str'),
            'projectId': self._serialize.url("project_id", project_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.delete(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    delete_project_tag.metadata = {'url': '/api/projects/{projectId}/tags/{tagKey}'}

    def get_project_types(
            self, custom_headers=None, raw=False, **operation_config):
        """Gets all Project Types.

        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_project_types.metadata['url']

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('ProjectTypeListDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_project_types.metadata = {'url': '/api/projectTypes'}

    def create_project_type(
            self, body=None, custom_headers=None, raw=False, **operation_config):
        """Creates a new Project Type.

        :param body:
        :type body: ~teamcloud.models.ProjectType
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.create_project_type.metadata['url']

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, 'ProjectType')
        else:
            body_content = None

        # Construct and send request
        request = self._client.post(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [201, 400, 401, 403, 409]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 201:
            deserialized = self._deserialize('ProjectTypeDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 409:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    create_project_type.metadata = {'url': '/api/projectTypes'}

    def get_project_type_by_id(
            self, project_type_id, custom_headers=None, raw=False, **operation_config):
        """Gets a Project Type by ID.

        :param project_type_id:
        :type project_type_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_project_type_by_id.metadata['url']
        path_format_arguments = {
            'projectTypeId': self._serialize.url("project_type_id", project_type_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('ProjectTypeDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_project_type_by_id.metadata = {'url': '/api/projectTypes/{projectTypeId}'}

    def update_project_type(
            self, project_type_id, body=None, custom_headers=None, raw=False, **operation_config):
        """Updates an existing Project Type.

        :param project_type_id:
        :type project_type_id: str
        :param body:
        :type body: ~teamcloud.models.ProjectType
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.update_project_type.metadata['url']
        path_format_arguments = {
            'projectTypeId': self._serialize.url("project_type_id", project_type_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, 'ProjectType')
        else:
            body_content = None

        # Construct and send request
        request = self._client.put(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('ProjectTypeDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    update_project_type.metadata = {'url': '/api/projectTypes/{projectTypeId}'}

    def delete_project_type(
            self, project_type_id, custom_headers=None, raw=False, **operation_config):
        """Deletes a Project Type.

        :param project_type_id:
        :type project_type_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.delete_project_type.metadata['url']
        path_format_arguments = {
            'projectTypeId': self._serialize.url("project_type_id", project_type_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.delete(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [204, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 204:
            deserialized = self._deserialize('ProjectTypeDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    delete_project_type.metadata = {'url': '/api/projectTypes/{projectTypeId}'}

    def get_project_users(
            self, project_id, custom_headers=None, raw=False, **operation_config):
        """Gets all Users for a Project.

        :param project_id:
        :type project_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_project_users.metadata['url']
        path_format_arguments = {
            'projectId': self._serialize.url("project_id", project_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('UserListDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_project_users.metadata = {'url': '/api/projects/{projectId}/users'}

    def create_project_user(
            self, project_id, body=None, custom_headers=None, raw=False, **operation_config):
        """Creates a new Project User.

        :param project_id:
        :type project_id: str
        :param body:
        :type body: ~teamcloud.models.UserDefinition
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.create_project_user.metadata['url']
        path_format_arguments = {
            'projectId': self._serialize.url("project_id", project_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, 'UserDefinition')
        else:
            body_content = None

        # Construct and send request
        request = self._client.post(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 400, 401, 403, 404, 409]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 409:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    create_project_user.metadata = {'url': '/api/projects/{projectId}/users'}

    def get_project_user_by_name_or_id(
            self, user_name_or_id, project_id, custom_headers=None, raw=False, **operation_config):
        """Gets a Project User by ID or email address.

        :param user_name_or_id:
        :type user_name_or_id: str
        :param project_id:
        :type project_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_project_user_by_name_or_id.metadata['url']
        path_format_arguments = {
            'userNameOrId': self._serialize.url("user_name_or_id", user_name_or_id, 'str'),
            'projectId': self._serialize.url("project_id", project_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('UserDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_project_user_by_name_or_id.metadata = {'url': '/api/projects/{projectId}/users/{userNameOrId}'}

    def update_project_user(
            self, user_name_or_id, project_id, body=None, custom_headers=None, raw=False, **operation_config):
        """Updates an existing Project User.

        :param user_name_or_id:
        :type user_name_or_id: str
        :param project_id:
        :type project_id: str
        :param body:
        :type body: ~teamcloud.models.User
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.update_project_user.metadata['url']
        path_format_arguments = {
            'userNameOrId': self._serialize.url("user_name_or_id", user_name_or_id, 'str'),
            'projectId': self._serialize.url("project_id", project_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, 'User')
        else:
            body_content = None

        # Construct and send request
        request = self._client.put(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    update_project_user.metadata = {'url': '/api/projects/{projectId}/users/{userNameOrId}'}

    def delete_project_user(
            self, user_name_or_id, project_id, custom_headers=None, raw=False, **operation_config):
        """Deletes an existing Project User.

        :param user_name_or_id:
        :type user_name_or_id: str
        :param project_id:
        :type project_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.delete_project_user.metadata['url']
        path_format_arguments = {
            'userNameOrId': self._serialize.url("user_name_or_id", user_name_or_id, 'str'),
            'projectId': self._serialize.url("project_id", project_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.delete(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    delete_project_user.metadata = {'url': '/api/projects/{projectId}/users/{userNameOrId}'}

    def get_project_user_me(
            self, project_id, custom_headers=None, raw=False, **operation_config):
        """Gets a Project User for the calling user.

        :param project_id:
        :type project_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_project_user_me.metadata['url']
        path_format_arguments = {
            'projectId': self._serialize.url("project_id", project_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('UserDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_project_user_me.metadata = {'url': '/api/projects/{projectId}/users/me'}

    def update_project_user_me(
            self, project_id, body=None, custom_headers=None, raw=False, **operation_config):
        """Updates an existing Project User.

        :param project_id:
        :type project_id: str
        :param body:
        :type body: ~teamcloud.models.User
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.update_project_user_me.metadata['url']
        path_format_arguments = {
            'projectId': self._serialize.url("project_id", project_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, 'User')
        else:
            body_content = None

        # Construct and send request
        request = self._client.put(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    update_project_user_me.metadata = {'url': '/api/projects/{projectId}/users/me'}

    def get_provider_data(
            self, provider_id, custom_headers=None, raw=False, **operation_config):
        """Gets all ProviderData for a Provider.

        :param provider_id:
        :type provider_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_provider_data.metadata['url']
        path_format_arguments = {
            'providerId': self._serialize.url("provider_id", provider_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('ProviderDataListDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_provider_data.metadata = {'url': '/api/providers/{providerId}/data'}

    def create_provider_data(
            self, provider_id, body=None, custom_headers=None, raw=False, **operation_config):
        """Creates a new ProviderData item.

        :param provider_id:
        :type provider_id: str
        :param body:
        :type body: ~teamcloud.models.ProviderData
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.create_provider_data.metadata['url']
        path_format_arguments = {
            'providerId': self._serialize.url("provider_id", provider_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, 'ProviderData')
        else:
            body_content = None

        # Construct and send request
        request = self._client.post(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [201, 400, 401, 403, 404, 409]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 201:
            deserialized = self._deserialize('ProviderDataDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 409:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    create_provider_data.metadata = {'url': '/api/providers/{providerId}/data'}

    def get_provider_data_by_id(
            self, provider_data_id, provider_id, custom_headers=None, raw=False, **operation_config):
        """Gets the ProviderData by ID.

        :param provider_data_id:
        :type provider_data_id: str
        :param provider_id:
        :type provider_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_provider_data_by_id.metadata['url']
        path_format_arguments = {
            'providerDataId': self._serialize.url("provider_data_id", provider_data_id, 'str'),
            'providerId': self._serialize.url("provider_id", provider_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('ProviderDataDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_provider_data_by_id.metadata = {'url': '/api/providers/{providerId}/data/{providerDataId}'}

    def update_provider_data(
            self, provider_data_id, provider_id, body=None, custom_headers=None, raw=False, **operation_config):
        """Updates an existing ProviderData.

        :param provider_data_id:
        :type provider_data_id: str
        :param provider_id:
        :type provider_id: str
        :param body:
        :type body: ~teamcloud.models.ProviderData
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.update_provider_data.metadata['url']
        path_format_arguments = {
            'providerDataId': self._serialize.url("provider_data_id", provider_data_id, 'str'),
            'providerId': self._serialize.url("provider_id", provider_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, 'ProviderData')
        else:
            body_content = None

        # Construct and send request
        request = self._client.put(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('ProviderDataDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    update_provider_data.metadata = {'url': '/api/providers/{providerId}/data/{providerDataId}'}

    def delete_provider_data(
            self, provider_data_id, provider_id, custom_headers=None, raw=False, **operation_config):
        """Deletes a ProviderData.

        :param provider_data_id:
        :type provider_data_id: str
        :param provider_id:
        :type provider_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.delete_provider_data.metadata['url']
        path_format_arguments = {
            'providerDataId': self._serialize.url("provider_data_id", provider_data_id, 'str'),
            'providerId': self._serialize.url("provider_id", provider_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.delete(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [204, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 204:
            deserialized = self._deserialize('ProviderDataDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    delete_provider_data.metadata = {'url': '/api/providers/{providerId}/data/{providerDataId}'}

    def get_providers(
            self, custom_headers=None, raw=False, **operation_config):
        """Gets all Providers.

        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_providers.metadata['url']

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('ProviderListDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_providers.metadata = {'url': '/api/providers'}

    def create_provider(
            self, body=None, custom_headers=None, raw=False, **operation_config):
        """Creates a new Provider.

        :param body:
        :type body: ~teamcloud.models.Provider
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.create_provider.metadata['url']

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, 'Provider')
        else:
            body_content = None

        # Construct and send request
        request = self._client.post(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 400, 401, 403, 409]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 409:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    create_provider.metadata = {'url': '/api/providers'}

    def get_provider_by_id(
            self, provider_id, custom_headers=None, raw=False, **operation_config):
        """Gets a Provider by ID.

        :param provider_id:
        :type provider_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_provider_by_id.metadata['url']
        path_format_arguments = {
            'providerId': self._serialize.url("provider_id", provider_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('ProviderDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_provider_by_id.metadata = {'url': '/api/providers/{providerId}'}

    def update_provider(
            self, provider_id, body=None, custom_headers=None, raw=False, **operation_config):
        """Updates an existing Provider.

        :param provider_id:
        :type provider_id: str
        :param body:
        :type body: ~teamcloud.models.Provider
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.update_provider.metadata['url']
        path_format_arguments = {
            'providerId': self._serialize.url("provider_id", provider_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, 'Provider')
        else:
            body_content = None

        # Construct and send request
        request = self._client.put(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    update_provider.metadata = {'url': '/api/providers/{providerId}'}

    def delete_provider(
            self, provider_id, custom_headers=None, raw=False, **operation_config):
        """Deletes an existing Provider.

        :param provider_id:
        :type provider_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.delete_provider.metadata['url']
        path_format_arguments = {
            'providerId': self._serialize.url("provider_id", provider_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.delete(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    delete_provider.metadata = {'url': '/api/providers/{providerId}'}

    def get_status(
            self, tracking_id, custom_headers=None, raw=False, **operation_config):
        """Gets the status of a long-running operation.

        :param tracking_id:
        :type tracking_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_status.metadata['url']
        path_format_arguments = {
            'trackingId': self._serialize.url("tracking_id", tracking_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 202, 302, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 302:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_status.metadata = {'url': '/api/status/{trackingId}'}

    def get_project_status(
            self, project_id, tracking_id, custom_headers=None, raw=False, **operation_config):
        """Gets the status of a long-running operation.

        :param project_id:
        :type project_id: str
        :param tracking_id:
        :type tracking_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_project_status.metadata['url']
        path_format_arguments = {
            'projectId': self._serialize.url("project_id", project_id, 'str'),
            'trackingId': self._serialize.url("tracking_id", tracking_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 202, 302, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 302:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_project_status.metadata = {'url': '/api/projects/{projectId}/status/{trackingId}'}

    def create_team_cloud_admin_user(
            self, body=None, custom_headers=None, raw=False, **operation_config):
        """Creates a new TeamCloud User as an Admin.

        :param body:
        :type body: ~teamcloud.models.UserDefinition
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.create_team_cloud_admin_user.metadata['url']

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, 'UserDefinition')
        else:
            body_content = None

        # Construct and send request
        request = self._client.post(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 400, 401, 403, 404, 409]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 409:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    create_team_cloud_admin_user.metadata = {'url': '/api/admin/users'}

    def get_team_cloud_instance(
            self, custom_headers=None, raw=False, **operation_config):
        """Gets the TeamCloud instance.

        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_team_cloud_instance.metadata['url']

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('TeamCloudInstanceDataResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_team_cloud_instance.metadata = {'url': '/api/admin/teamCloudInstance'}

    def create_team_cloud_instance(
            self, body=None, custom_headers=None, raw=False, **operation_config):
        """Updates the TeamCloud instance.

        :param body:
        :type body: ~teamcloud.models.TeamCloudInstance
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.create_team_cloud_instance.metadata['url']

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, 'TeamCloudInstance')
        else:
            body_content = None

        # Construct and send request
        request = self._client.post(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [201, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 201:
            deserialized = self._deserialize('TeamCloudInstanceDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    create_team_cloud_instance.metadata = {'url': '/api/admin/teamCloudInstance'}

    def update_team_cloud_instance(
            self, body=None, custom_headers=None, raw=False, **operation_config):
        """Updates the TeamCloud instance.

        :param body:
        :type body: ~teamcloud.models.TeamCloudInstance
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.update_team_cloud_instance.metadata['url']

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, 'TeamCloudInstance')
        else:
            body_content = None

        # Construct and send request
        request = self._client.put(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('TeamCloudInstanceDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    update_team_cloud_instance.metadata = {'url': '/api/admin/teamCloudInstance'}

    def get_team_cloud_tags(
            self, custom_headers=None, raw=False, **operation_config):
        """Gets all Tags for a TeamCloud Instance.

        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_team_cloud_tags.metadata['url']

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('StringStringDictionaryDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_team_cloud_tags.metadata = {'url': '/api/tags'}

    def create_team_cloud_tag(
            self, body=None, custom_headers=None, raw=False, **operation_config):
        """Creates a new TeamCloud Tag.

        :param body:
        :type body: dict[str, str]
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.create_team_cloud_tag.metadata['url']

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, '{str}')
        else:
            body_content = None

        # Construct and send request
        request = self._client.post(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 400, 401, 403, 404, 409]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 409:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    create_team_cloud_tag.metadata = {'url': '/api/tags'}

    def update_team_cloud_tag(
            self, body=None, custom_headers=None, raw=False, **operation_config):
        """Updates an existing TeamCloud Tag.

        :param body:
        :type body: dict[str, str]
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.update_team_cloud_tag.metadata['url']

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, '{str}')
        else:
            body_content = None

        # Construct and send request
        request = self._client.put(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    update_team_cloud_tag.metadata = {'url': '/api/tags'}

    def get_team_cloud_tag_by_key(
            self, tag_key, custom_headers=None, raw=False, **operation_config):
        """Gets a TeamCloud Tag by Key.

        :param tag_key:
        :type tag_key: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_team_cloud_tag_by_key.metadata['url']
        path_format_arguments = {
            'tagKey': self._serialize.url("tag_key", tag_key, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('StringStringDictionaryDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_team_cloud_tag_by_key.metadata = {'url': '/api/tags/{tagKey}'}

    def delete_team_cloud_tag(
            self, tag_key, custom_headers=None, raw=False, **operation_config):
        """Deletes an existing TeamCloud Tag.

        :param tag_key:
        :type tag_key: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.delete_team_cloud_tag.metadata['url']
        path_format_arguments = {
            'tagKey': self._serialize.url("tag_key", tag_key, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.delete(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    delete_team_cloud_tag.metadata = {'url': '/api/tags/{tagKey}'}

    def get_team_cloud_users(
            self, custom_headers=None, raw=False, **operation_config):
        """Gets all TeamCloud Users.

        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_team_cloud_users.metadata['url']

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('UserListDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_team_cloud_users.metadata = {'url': '/api/users'}

    def create_team_cloud_user(
            self, body=None, custom_headers=None, raw=False, **operation_config):
        """Creates a new TeamCloud User.

        :param body:
        :type body: ~teamcloud.models.UserDefinition
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.create_team_cloud_user.metadata['url']

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, 'UserDefinition')
        else:
            body_content = None

        # Construct and send request
        request = self._client.post(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 400, 401, 403, 404, 409]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 409:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    create_team_cloud_user.metadata = {'url': '/api/users'}

    def get_team_cloud_user_by_name_or_id(
            self, user_name_or_id, custom_headers=None, raw=False, **operation_config):
        """Gets a TeamCloud User by ID or email address.

        :param user_name_or_id:
        :type user_name_or_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_team_cloud_user_by_name_or_id.metadata['url']
        path_format_arguments = {
            'userNameOrId': self._serialize.url("user_name_or_id", user_name_or_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('UserDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_team_cloud_user_by_name_or_id.metadata = {'url': '/api/users/{userNameOrId}'}

    def update_team_cloud_user(
            self, user_name_or_id, body=None, custom_headers=None, raw=False, **operation_config):
        """Updates an existing TeamCloud User.

        :param user_name_or_id:
        :type user_name_or_id: str
        :param body:
        :type body: ~teamcloud.models.User
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.update_team_cloud_user.metadata['url']
        path_format_arguments = {
            'userNameOrId': self._serialize.url("user_name_or_id", user_name_or_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, 'User')
        else:
            body_content = None

        # Construct and send request
        request = self._client.put(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    update_team_cloud_user.metadata = {'url': '/api/users/{userNameOrId}'}

    def delete_team_cloud_user(
            self, user_name_or_id, custom_headers=None, raw=False, **operation_config):
        """Deletes an existing TeamCloud User.

        :param user_name_or_id:
        :type user_name_or_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.delete_team_cloud_user.metadata['url']
        path_format_arguments = {
            'userNameOrId': self._serialize.url("user_name_or_id", user_name_or_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.delete(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    delete_team_cloud_user.metadata = {'url': '/api/users/{userNameOrId}'}

    def get_team_cloud_user_me(
            self, custom_headers=None, raw=False, **operation_config):
        """Gets a TeamCloud User A User matching the current authenticated user.

        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_team_cloud_user_me.metadata['url']

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('UserDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_team_cloud_user_me.metadata = {'url': '/api/me'}

    def update_team_cloud_user_me(
            self, body=None, custom_headers=None, raw=False, **operation_config):
        """Updates an existing TeamCloud User.

        :param body:
        :type body: ~teamcloud.models.User
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.update_team_cloud_user_me.metadata['url']

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        header_parameters['Content-Type'] = 'application/json; charset=utf-8'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct body
        if body is not None:
            body_content = self._serialize.body(body, 'User')
        else:
            body_content = None

        # Construct and send request
        request = self._client.put(url, query_parameters, header_parameters, body_content)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [202, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 202:
            deserialized = self._deserialize('StatusResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    update_team_cloud_user_me.metadata = {'url': '/api/me'}

    def get_user_projects(
            self, user_id, custom_headers=None, raw=False, **operation_config):
        """Gets all Projects for a User.

        :param user_id:
        :type user_id: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_user_projects.metadata['url']
        path_format_arguments = {
            'userId': self._serialize.url("user_id", user_id, 'str')
        }
        url = self._client.format_url(url, **path_format_arguments)

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('ProjectListDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_user_projects.metadata = {'url': '/api/users/{userId}/projects'}

    def get_user_projects_me(
            self, custom_headers=None, raw=False, **operation_config):
        """Gets all Projects for a User.

        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: object or ClientRawResponse if raw=true
        :rtype: object or ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`HttpOperationError<msrest.exceptions.HttpOperationError>`
        """
        # Construct URL
        url = self.get_user_projects_me.metadata['url']

        # Construct parameters
        query_parameters = {}

        # Construct headers
        header_parameters = {}
        header_parameters['Accept'] = 'application/json'
        if custom_headers:
            header_parameters.update(custom_headers)

        # Construct and send request
        request = self._client.get(url, query_parameters, header_parameters)
        response = self._client.send(request, stream=False, **operation_config)

        if response.status_code not in [200, 400, 401, 403, 404]:
            raise HttpOperationError(self._deserialize, response)

        deserialized = None

        if response.status_code == 200:
            deserialized = self._deserialize('ProjectListDataResult', response)
        if response.status_code == 400:
            deserialized = self._deserialize('ErrorResult', response)
        if response.status_code == 404:
            deserialized = self._deserialize('ErrorResult', response)

        if raw:
            client_raw_response = ClientRawResponse(deserialized, response)
            return client_raw_response

        return deserialized
    get_user_projects_me.metadata = {'url': '/api/me/projects'}
