from .rest import RestClient


class Blacklists(object):
    def __init__(self, domain, jwt_token):
        url = 'https://%s/api/v2/blacklists/tokens' % domain

        self.client = RestClient(endpoint=url, jwt=jwt_token)

    def get(self, aud=None):
        params = {
            'aud': aud
        }

        return self.client.get(params=params)

    def create(self, jti, aud=''):
        return self.client.post(data={'jti': jti, 'aud': aud})

from .rest import RestClient


class Blacklists(object):
    def __init__(self, domain, jwt_token):
        self.url = 'https://%s/api/v2/blacklists/tokens' % domain
        self.client = RestClient(jwt=jwt_token)

    def get(self, aud=None):
        params = {
            'aud': aud
        }

        return self.client.get(self.url, params=params)

    def create(self, jti, aud=''):
        return self.client.post(self.url, data={'jti': jti, 'aud': aud})

Fix Blacklists usage of RestClient
Fix Blacklists usage of RestClient

  from .rest import RestClient
  
  
  class Blacklists(object):
      def __init__(self, domain, jwt_token):
-         url = 'https://%s/api/v2/blacklists/tokens' % domain
+         self.url = 'https://%s/api/v2/blacklists/tokens' % domain
- 
-         self.client = RestClient(endpoint=url, jwt=jwt_token)
+         self.client = RestClient(jwt=jwt_token)
  
      def get(self, aud=None):
          params = {
              'aud': aud
          }
  
-         return self.client.get(params=params)
+         return self.client.get(self.url, params=params)
  
      def create(self, jti, aud=''):
-         return self.client.post(data={'jti': jti, 'aud': aud})
+         return self.client.post(self.url, data={'jti': jti, 'aud': aud})
  
Fix Blacklists usage of RestClient
## Code Before:
from .rest import RestClient


class Blacklists(object):
    def __init__(self, domain, jwt_token):
        url = 'https://%s/api/v2/blacklists/tokens' % domain

        self.client = RestClient(endpoint=url, jwt=jwt_token)

    def get(self, aud=None):
        params = {
            'aud': aud
        }

        return self.client.get(params=params)

    def create(self, jti, aud=''):
        return self.client.post(data={'jti': jti, 'aud': aud})

## Instruction:
Fix Blacklists usage of RestClient
## Code After:
from .rest import RestClient


class Blacklists(object):
    def __init__(self, domain, jwt_token):
        self.url = 'https://%s/api/v2/blacklists/tokens' % domain
        self.client = RestClient(jwt=jwt_token)

    def get(self, aud=None):
        params = {
            'aud': aud
        }

        return self.client.get(self.url, params=params)

    def create(self, jti, aud=''):
        return self.client.post(self.url, data={'jti': jti, 'aud': aud})
