Skip to content

Commit

Permalink
add support to simplify posting multiple items to an edge dictionary
Browse files Browse the repository at this point in the history
  • Loading branch information
Terry Yanko authored and sethvargo committed Jul 25, 2018
1 parent 7d31c4a commit a162398
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions fastly/dictionary_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,20 @@ func (c *Client) CreateDictionaryItem(i *CreateDictionaryItemInput) (*Dictionary
return b, nil
}

// CreateDictionaryItems creates new Fastly dictionary items from a slice.
func (c *Client) CreateDictionaryItems(i []CreateDictionaryItemInput) ([]DictionaryItem, error) {

var b []DictionaryItem
for _, cdii := range i {
di, err := c.CreateDictionaryItem(&cdii)
if err != nil {
return nil, err
}
b = append(b, *di)
}
return b, nil
}

// GetDictionaryItemInput is used as input to the GetDictionaryItem function.
type GetDictionaryItemInput struct {
// Service is the ID of the service. Dictionary is the ID of the dictionary.
Expand Down

0 comments on commit a162398

Please sign in to comment.