code: def list(gandi, fqdn, name, sort, type, rrset_type, text):
      
      domains = gandi.dns.list()
      domains = [domain['fqdn'] for domain in domains]
      if fqdn not in domains:
          gandi.echo('Sorry domain %s does not exist' % fqdn)
          gandi.echo('Please use one of the following: %s' % ', '.join(domains))
          return
  
      output_keys = ['name', 'ttl', 'type', 'values']
  
      result = gandi.dns.records(fqdn, sort_by=sort, text=text)
      if text:
          gandi.echo(result)
          return result
  
      for num, rec in enumerate(result):
          if type and rec['rrset_type'] != type:
              continue
          if rrset_type and rec['rrset_type'] != rrset_type:
              continue
          if name and rec['rrset_name'] != name:
              continue
          if num:
              gandi.separator_line()
          output_dns_records(gandi, rec, output_keys)
  
      return result
docs: Display records for a domain.