| 1 |
package dns |
| 2 |
|
| 3 |
import ( |
| 4 |
"log" |
| 5 |
|
| 6 |
"github.com/denverdino/aliyungo/common" |
| 7 |
) |
| 8 |
|
| 9 |
type DomainGroupType struct { |
| 10 |
GroupId string |
| 11 |
GroupName string |
| 12 |
} |
| 13 |
|
| 14 |
type DescribeDomainGroupsArgs struct { |
| 15 |
|
| 16 |
common.Pagination |
| 17 |
KeyWord string |
| 18 |
} |
| 19 |
|
| 20 |
type DescribeDomainGroupsResponse struct { |
| 21 |
response common.Response |
| 22 |
common.PaginationResult |
| 23 |
DomainGroups struct { |
| 24 |
DomainGroup []DomainGroupType |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
func (client *Client) DescribeDomainGroups(args *DescribeDomainGroupsArgs) (groups []DomainGroupType, err error) { |
| 32 |
action := "DescribeDomainGroups" |
| 33 |
response := &DescribeDomainGroupsResponse{} |
| 34 |
err = client.Invoke(action, args, response) |
| 35 |
|
| 36 |
if err != nil { |
| 37 |
log.Printf("%s error, %v", action, err) |
| 38 |
return nil, err |
| 39 |
} |
| 40 |
|
| 41 |
return response.DomainGroups.DomainGroup, nil |
| 42 |
} |