func (p *GoogleProvider) submitChange(change *dns.Change) error {
	if len(change.Additions) == 0 && len(change.Deletions) == 0 {
		log.Info("All records are already up to date")
		return nil
	}

	zones, err := p.Zones()
	if err != nil {
		return err
	}

	// separate into per-zone change sets to be passed to the API.
	changes := separateChange(zones, change)

	for z, c := range changes {
		log.Infof("Change zone: %v", z)
		for _, del := range c.Deletions {
			log.Infof("Del records: %s %s %s %d", del.Name, del.Type, del.Rrdatas, del.Ttl)
		}
		for _, add := range c.Additions {
			log.Infof("Add records: %s %s %s %d", add.Name, add.Type, add.Rrdatas, add.Ttl)
		}
	}

	if p.dryRun {
		return nil
	}

	for z, c := range changes {
		if _, err := p.changesClient.Create(p.project, z, c).Do(); err != nil {
			return err
		}
	}

	return nil
}
func (p *GoogleProvider) submitChange(change *dns.Change) error {
	if len(change.Additions) == 0 && len(change.Deletions) == 0 {
		log.Info("All records are already up to date")
		return nil
	}

	zones, err := p.Zones()
	if err != nil {
		return err
	}

	
	changes := separateChange(zones, change)

	for z, c := range changes {
		log.Infof("Change zone: %v", z)
		for _, del := range c.Deletions {
			log.Infof("Del records: %s %s %s %d", del.Name, del.Type, del.Rrdatas, del.Ttl)
		}
		for _, add := range c.Additions {
			log.Infof("Add records: %s %s %s %d", add.Name, add.Type, add.Rrdatas, add.Ttl)
		}
	}

	if p.dryRun {
		return nil
	}

	for z, c := range changes {
		if _, err := p.changesClient.Create(p.project, z, c).Do(); err != nil {
			return err
		}
	}

	return nil
}
func ( p * GoogleProvider ) submitChange ( change * dns . Change ) error { if len ( change . Additions ) == 0 && len ( change . Deletions ) == 0 { log . Info ( " " ) return nil } zones , err := p . Zones ( ) if err != nil { return err } // separate into per-zone change sets to be passed to the API. changes := separateChange ( zones , change ) for z , c := range changes { log . Infof ( " " , z ) for _ , del := range c . Deletions { log . Infof ( " " , del . Name , del . Type , del . Rrdatas , del . Ttl ) } for _ , add := range c . Additions { log . Infof ( " " , add . Name , add . Type , add . Rrdatas , add . Ttl ) } } if p . dryRun { return nil } for z , c := range changes { if _ , err := p . changesClient . Create ( p . project , z , c ) . Do ( ) ; err != nil { return err } } return nil }
// submitChange takes a zone and a Change and sends it to Google.
submitChange takes a zone and a Change and sends it to Google .