// PatchUpdateEncoder handles creating request data to PATCH parent resource
// with list including updated object.
PatchUpdateEncoder handles creating request data to PATCH parent resource
with list including updated object.
// PatchUpdateEncoder handles creating request data to PATCH parent resource // with list including updated object .
func resourceComputeRouterBgpPeerPatchUpdateEncoder(d *schema.ResourceData, meta interface{}, obj map[string]interface{}) (map[string]interface{}, error) {
	items, err := resourceComputeRouterBgpPeerListForPatch(d, meta)
	if err != nil {
		return nil, err
	}
	idx, item, err := resourceComputeRouterBgpPeerFindNestedObjectInList(d, meta, items)
	if err != nil {
		return nil, err
	}
	if item == nil {
		return nil, fmt.Errorf("Unable to update RouterBgpPeer %q - not found in list", d.Id())
	}
	for k, v := range obj {
		item[k] = v
	}
	items[idx] = item
	res := map[string]interface{}{
		"bgpPeers": items,
	}
	return res, nil
}
func resourceComputeRouterBgpPeerPatchUpdateEncoder ( d * schema . ResourceData , meta interface { } , obj map [ string ] interface { } ) ( map [ string ] interface { } , error ) { items , err := resourceComputeRouterBgpPeerListForPatch ( d , meta ) if err != nil { return nil , err } idx , item , err := resourceComputeRouterBgpPeerFindNestedObjectInList ( d , meta , items ) if err != nil { return nil , err } if item == nil { return nil , fmt . Errorf ( " " , d . Id ( ) ) } for k , v := range obj { item [ k ] = v } items [ idx ] = item res := map [ string ] interface { } { " " : items , } return res , nil }
PatchUpdateEncoder handles creating request data to PATCH parent resource
with list including updated object.
PatchUpdateEncoder handles creating request data to PATCH parent resource with list including updated object .
// Return error if item to update does not exist. // Merge new object into old. // Return list with new item added