code: def declare(self, exchange='', exchange_type='direct', virtual_host='/',
                  passive=False, durable=False, auto_delete=False,
                  internal=False, arguments=None):
          
          if passive:
              return self.get(exchange, virtual_host=virtual_host)
          exchange_payload = json.dumps(
              {
                  'durable': durable,
                  'auto_delete': auto_delete,
                  'internal': internal,
                  'type': exchange_type,
                  'arguments': arguments or {},
                  'vhost': virtual_host
              }
          )
          return self.http_client.put(API_EXCHANGE %
                                      (
                                          quote(virtual_host, ''),
                                          exchange
                                      ),
                                      payload=exchange_payload)
docs: Declare an Exchange.
  
          :param str exchange: Exchange name
          :param str exchange_type: Exchange type
          :param str virtual_host: Virtual host name
          :param bool passive: Do not create
          :param bool durable: Durable exchange
          :param bool auto_delete: Automatically delete when not in use
          :param bool internal: Is the exchange for use by the broker only.
          :param dict|None arguments: Exchange key/value arguments
  
          :raises ApiError: Raises if the remote server encountered an error.
          :raises ApiConnectionError: Raises if there was a connectivity issue.
  
          :rtype: None