// PatchCreateEncoder handles creating request data to PATCH parent resource
// with list including new object.
PatchCreateEncoder handles creating request data to PATCH parent resource
with list including new object.
// PatchCreateEncoder handles creating request data to PATCH parent resource // with list including new object .
func resourceComputeRouterBgpPeerPatchCreateEncoder(d *schema.ResourceData, meta interface{}, obj map[string]interface{}) (map[string]interface{}, error) {
	currItems, err := resourceComputeRouterBgpPeerListForPatch(d, meta)
	if err != nil {
		return nil, err
	}
	_, found, err := resourceComputeRouterBgpPeerFindNestedObjectInList(d, meta, currItems)
	if err != nil {
		return nil, err
	}
	if found != nil {
		return nil, fmt.Errorf("Unable to create RouterBgpPeer, existing object already found: %+v", found)
	}
	res := map[string]interface{}{
		"bgpPeers": append(currItems, obj),
	}
	return res, nil
}
func resourceComputeRouterBgpPeerPatchCreateEncoder ( d * schema . ResourceData , meta interface { } , obj map [ string ] interface { } ) ( map [ string ] interface { } , error ) { currItems , err := resourceComputeRouterBgpPeerListForPatch ( d , meta ) if err != nil { return nil , err } _ , found , err := resourceComputeRouterBgpPeerFindNestedObjectInList ( d , meta , currItems ) if err != nil { return nil , err } if found != nil { return nil , fmt . Errorf ( " " , found ) } res := map [ string ] interface { } { " " : append ( currItems , obj ) , } return res , nil }
PatchCreateEncoder handles creating request data to PATCH parent resource
with list including new object.
PatchCreateEncoder handles creating request data to PATCH parent resource with list including new object .
// Return error if item already created. // Return list with the resource to create appended