// PatchDeleteEncoder handles creating request data to PATCH parent resource
// with list excluding object to delete.
PatchDeleteEncoder handles creating request data to PATCH parent resource
with list excluding object to delete.
// PatchDeleteEncoder handles creating request data to PATCH parent resource // with list excluding object to delete .
func resourceComputeRouterBgpPeerPatchDeleteEncoder(d *schema.ResourceData, meta interface{}, obj map[string]interface{}) (map[string]interface{}, error) {
	currItems, err := resourceComputeRouterBgpPeerListForPatch(d, meta)
	if err != nil {
		return nil, err
	}
	idx, item, err := resourceComputeRouterBgpPeerFindNestedObjectInList(d, meta, currItems)
	if err != nil {
		return nil, err
	}
	if item == nil {
		return nil, &googleapi.Error{
			Code:    404,
			Message: "RouterBgpPeer not found in list",
		}
	}
	updatedItems := append(currItems[:idx], currItems[idx+1:]...)
	res := map[string]interface{}{
		"bgpPeers": updatedItems,
	}
	return res, nil
}
func resourceComputeRouterBgpPeerPatchDeleteEncoder ( d * schema . ResourceData , meta interface { } , obj map [ string ] interface { } ) ( map [ string ] interface { } , error ) { currItems , err := resourceComputeRouterBgpPeerListForPatch ( d , meta ) if err != nil { return nil , err } idx , item , err := resourceComputeRouterBgpPeerFindNestedObjectInList ( d , meta , currItems ) if err != nil { return nil , err } if item == nil { return nil , & googleapi . Error { Code : 404 , Message : " " , } } updatedItems := append ( currItems [ : idx ] , currItems [ idx + 1 : ] ... ) res := map [ string ] interface { } { " " : updatedItems , } return res , nil }
PatchDeleteEncoder handles creating request data to PATCH parent resource
with list excluding object to delete.
PatchDeleteEncoder handles creating request data to PATCH parent resource with list excluding object to delete .
// Spoof 404 error for proper handling by Delete (i.e. no-op)