// CreateDictionaryItems creates new Fastly dictionary items from a slice.
16062
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
}
385052
func (s *PutComplianceItemsInput) SetItems(v []*ComplianceItemEntry) *PutComplianceItemsInput {
	s.Items = v
	return s
}
1085161
func (s *GetDocumentationVersionsOutput) SetItems(v []*DocumentationVersion) *GetDocumentationVersionsOutput {
	s.Items = v
	return s
}
1116817
func (t *Type) createTypeFromPropItems(name string, apiDef *APIDefinition) {
	p := t.Properties[name]

	// propMap is this properties as map
	propMap, ok := p.(map[interface{}]interface{})
	if !ok {
		return
	}

	// only process the array
	tip, ok := propMap["type"]
	if !ok || tip != "array" {
		return
	}

	// only process if it has 'items' field
	itemsIf, ok := propMap["items"]
	if !ok {
		return
	}

	// check it's validity
	items, ok := itemsIf.(map[interface{}]interface{})
	if !ok {
		return
	}

	// to define new type, it needs to have 'properties' field
	props, ok := items["properties"].(map[interface{}]interface{})
	if !ok { // doesn't define new type, no problem, we can simply return
		return
	}
	newName := t.Name + name + "Item"
	created := apiDef.createType(newName, tip, props)

	delete(items, "properties")
	items["type"] = newName
	propMap["items"] = items

	t.Properties[name] = propMap

	if created {
		createdType := apiDef.Types[newName]
		createdType.postProcess(newName, apiDef)
	}
}
412677
func (s *Aliases) SetItems(v []*string) *Aliases {
	s.Items = v
	return s
}
696149
func (bk *Bucket) PrefixItems(pre []byte) (items []Item, err error) {
	err = bk.db.View(func(tx *bolt.Tx) error {
		c := tx.Bucket(bk.Name).Cursor()
		var key, value []byte
		for k, v := c.Seek(pre); bytes.HasPrefix(k, pre); k, v = c.Next() {
			if v != nil {
				key = make([]byte, len(k))
				copy(key, k)
				value = make([]byte, len(v))
				copy(value, v)
				items = append(items, Item{key, value})
			}
		}
		return nil
	})
	return items, err
}
1368193
func (s *QueryOutput) SetItems(v []map[string]*AttributeValue) *QueryOutput {
	s.Items = v
	return s
}
575211
func (s *GetApiKeysOutput) SetItems(v []*ApiKey) *GetApiKeysOutput {
	s.Items = v
	return s
}
344576
func (c *Client) UpdateDictionaryItem(i *UpdateDictionaryItemInput) (*DictionaryItem, error) {
	if i.Service == "" {
		return nil, ErrMissingService
	}

	if i.Dictionary == "" {
		return nil, ErrMissingDictionary
	}

	if i.ItemKey == "" {
		return nil, ErrMissingItemKey
	}

	path := fmt.Sprintf("/service/%s/dictionary/%s/item/%s", i.Service, i.Dictionary, i.ItemKey)
	resp, err := c.PutForm(path, i, nil)
	if err != nil {
		return nil, err
	}

	var b *DictionaryItem
	if err := decodeJSON(&b, resp.Body); err != nil {
		return nil, err
	}
	return b, nil
}
702382
func (s *StatusCodes) SetItems(v []*int64) *StatusCodes {
	s.Items = v
	return s
}
313369
func (s *TagKeys) SetItems(v []*string) *TagKeys {
	s.Items = v
	return s
}
833742
func (s *GetModelsOutput) SetItems(v []*Model) *GetModelsOutput {
	s.Items = v
	return s
}
987541
func newCacheItem(key string, value interface{}) *cacheItem {
	return &cacheItem{
		k: key,
		v: value,
	}

}
496506
func (c *Client) GetDictionaryItem(i *GetDictionaryItemInput) (*DictionaryItem, error) {
	if i.Service == "" {
		return nil, ErrMissingService
	}

	if i.Dictionary == "" {
		return nil, ErrMissingDictionary
	}

	if i.ItemKey == "" {
		return nil, ErrMissingItemKey
	}

	path := fmt.Sprintf("/service/%s/dictionary/%s/item/%s", i.Service, i.Dictionary, i.ItemKey)
	resp, err := c.Get(path, nil)
	if err != nil {
		return nil, err
	}

	var b *DictionaryItem
	if err := decodeJSON(&b, resp.Body); err != nil {
		return nil, err
	}
	return b, nil
}
1131024
func (s *GetVpcLinksOutput) SetItems(v []*UpdateVpcLinkOutput) *GetVpcLinksOutput {
	s.Items = v
	return s
}
842618
func (s *GetStagesOutput) SetItems(v []*Stage) *GetStagesOutput {
	s.Items = v
	return s
}
861926
func (s *GetApisOutput) SetItems(v []*Api) *GetApisOutput {
	s.Items = v
	return s
}