// Fetches ad groups within a campaign.
Fetches ad groups within a campaign.
// Fetches ad groups within a campaign .
func (s *AdGroupService) Find(ctx context.Context, campaignID int64, sel *Selector) ([]*AdGroup, *Response, error) {
	if campaignID == 0 {
		return nil, nil, fmt.Errorf("campaignID can not be 0")
	}
	req, err := s.client.NewRequest("POST", fmt.Sprintf("campaigns/%d/adgroups/find", campaignID), sel)
	if err != nil {
		return nil, nil, err
	}
	adGroups := []*AdGroup{}
	resp, err := s.client.Do(ctx, req, &adGroups)
	if err != nil {
		return nil, resp, err
	}
	return adGroups, resp, nil
}
func ( s * AdGroupService ) Find ( ctx context . Context , campaignID int64 , sel * Selector ) ( [ ] * AdGroup , * Response , error ) { if campaignID == 0 { return nil , nil , fmt . Errorf ( " " ) } req , err := s . client . NewRequest ( " " , fmt . Sprintf ( " " , campaignID ) , sel ) if err != nil { return nil , nil , err } adGroups := [ ] * AdGroup { } resp , err := s . client . Do ( ctx , req , & adGroups ) if err != nil { return nil , resp , err } return adGroups , resp , nil }
Fetches ad groups within a campaign.
Fetches ad groups within a campaign .