func (p *dnsimpleProvider) Zones() (map[string]dnsimple.Zone, error) {
	zones := make(map[string]dnsimple.Zone)
	page := 1
	listOptions := &dnsimple.ZoneListOptions{}
	for {
		listOptions.Page = page
		zonesResponse, err := p.client.ListZones(p.accountID, listOptions)
		if err != nil {
			return nil, err
		}
		for _, zone := range zonesResponse.Data {
			if !p.domainFilter.Match(zone.Name) {
				continue
			}

			if !p.zoneIDFilter.Match(strconv.Itoa(zone.ID)) {
				continue
			}

			zones[strconv.Itoa(zone.ID)] = zone
		}

		page++
		if page > zonesResponse.Pagination.TotalPages {
			break
		}
	}
	return zones, nil
}
func (p *dnsimpleProvider) Zones() (map[string]dnsimple.Zone, error) {
	zones := make(map[string]dnsimple.Zone)
	page := 1
	listOptions := &dnsimple.ZoneListOptions{}
	for {
		listOptions.Page = page
		zonesResponse, err := p.client.ListZones(p.accountID, listOptions)
		if err != nil {
			return nil, err
		}
		for _, zone := range zonesResponse.Data {
			if !p.domainFilter.Match(zone.Name) {
				continue
			}

			if !p.zoneIDFilter.Match(strconv.Itoa(zone.ID)) {
				continue
			}

			zones[strconv.Itoa(zone.ID)] = zone
		}

		page++
		if page > zonesResponse.Pagination.TotalPages {
			break
		}
	}
	return zones, nil
}
func ( p * dnsimpleProvider ) Zones ( ) ( map [ string ] dnsimple . Zone , error ) { zones := make ( map [ string ] dnsimple . Zone ) page := 1 listOptions := & dnsimple . ZoneListOptions { } for { listOptions . Page = page zonesResponse , err := p . client . ListZones ( p . accountID , listOptions ) if err != nil { return nil , err } for _ , zone := range zonesResponse . Data { if ! p . domainFilter . Match ( zone . Name ) { continue } if ! p . zoneIDFilter . Match ( strconv . Itoa ( zone . ID ) ) { continue } zones [ strconv . Itoa ( zone . ID ) ] = zone } page ++ if page > zonesResponse . Pagination . TotalPages { break } } return zones , nil }
// Returns a list of filtered Zones
Returns a list of filtered Zones