Disable/deactivate the user.

        :param username: User to be deactivated.
        :type username: str

        :rtype: Union[str, int]

def deactivate_user(self, username):
        """Disable/deactivate the user.

        :param username: User to be deactivated.
        :type username: str

        :rtype: Union[str, int]
        """
        if self.deploymentType == 'Cloud':
            # Disabling users now needs cookie auth in the Cloud - see https://jira.atlassian.com/browse/ID-6230
            if 'authCookie' not in vars(self):
                user = self.session()
                if user.raw is None:
                    raise JIRAError("Can not log in!")
                self.authCookie = '%s=%s' % (user.raw['session']['name'], user.raw['session']['value'])
            url = self._options['server'] + '/admin/rest/um/1/user/deactivate?username=%s' % (username)
            # We can't use our existing session here - this endpoint is fragile and objects to extra headers
            try:
                r = requests.post(url, headers={'Cookie': self.authCookie, 'Content-Type': 'application/json'},
                                  proxies=self._session.proxies, data={})
                if r.status_code == 200:
                    return True
                else:
                    logging.warning(
                        'Got response from deactivating %s: %s' % (username, r.status_code))
                    return r.status_code
            except Exception as e:
                logging.error(
                    "Error Deactivating %s: %s" % (username, e))
                raise JIRAError("Error Deactivating %s: %s" % (username, e))
        else:
            url = self._options['server'] + '/secure/admin/user/EditUser.jspa'
            self._options['headers']['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'
            user = self.user(username)
            userInfo = {
                'inline': 'true',
                'decorator': 'dialog',
                'username': user.name,
                'fullName': user.displayName,
                'email': user.emailAddress,
                'editName': user.name
            }
            try:
                r = self._session.post(url, headers=self._options['headers'], data=userInfo)
                if r.status_code == 200:
                    return True
                else:
                    logging.warning(
                        'Got response from deactivating %s: %s' % (username, r.status_code))
                    return r.status_code
            except Exception as e:
                logging.error(
                    "Error Deactivating %s: %s" % (username, e))
                raise JIRAError("Error Deactivating %s: %s" % (username, e))