// List function to get Adgroups from campaign
List function to get Adgroups from campaign
// List function to get Adgroups from campaign
func (s *AdGroupTargetingKeywordService) List(ctx context.Context, campaignID, adGroupID int64, opt *ListOptions) ([]*TargetingKeyword, *Response, error) {
	if campaignID == 0 {
		return nil, nil, fmt.Errorf("campaignID can not be 0")
	}
	if adGroupID == 0 {
		return nil, nil, fmt.Errorf("adGroupID can not be 0")
	}
	u, err := addOptions(fmt.Sprintf("campaigns/%d/adgroups/%d/targetingkeywords", campaignID, adGroupID), opt)
	if err != nil {
		return nil, nil, err
	}
	req, err := s.client.NewRequest("GET", u, nil)
	if err != nil {
		return nil, nil, err
	}
	targetingkeywords := []*TargetingKeyword{}
	resp, err := s.client.Do(ctx, req, &targetingkeywords)
	if err != nil {
		return nil, resp, err
	}
	return targetingkeywords, resp, nil
}
func ( s * AdGroupTargetingKeywordService ) List ( ctx context . Context , campaignID , adGroupID int64 , opt * ListOptions ) ( [ ] * TargetingKeyword , * Response , error ) { if campaignID == 0 { return nil , nil , fmt . Errorf ( " " ) } if adGroupID == 0 { return nil , nil , fmt . Errorf ( " " ) } u , err := addOptions ( fmt . Sprintf ( " " , campaignID , adGroupID ) , opt ) if err != nil { return nil , nil , err } req , err := s . client . NewRequest ( " " , u , nil ) if err != nil { return nil , nil , err } targetingkeywords := [ ] * TargetingKeyword { } resp , err := s . client . Do ( ctx , req , & targetingkeywords ) if err != nil { return nil , resp , err } return targetingkeywords , resp , nil }
List function to get Adgroups from campaign
List function to get Adgroups from campaign