// NewRestoreArg returns a new RestoreArg instance
171948
func NewRestoreArg(Path string, Rev string) *RestoreArg {
	s := new(RestoreArg)
	s.Path = Path
	s.Rev = Rev
	return s
}
313237
func (p *parser) restore(pt savepoint) {
	// ==template== {{ if not .Optimize }}
	if p.debug {
		defer p.out(p.in("restore"))
	}
	// {{ end }} ==template==
	if pt.offset == p.pt.offset {
		return
	}
	p.pt = pt
}
899399
func NewArg(key string, val interface{}) *Arg {
	switch val {
	case false:
		val = "0"
	case true:
		val = "1"
	}
	return &Arg{key: key, val: fmt.Sprint(val)}
}
300279
func NewReleaseObjectGroupArgs(objectGroup string) *ReleaseObjectGroupArgs {
	args := new(ReleaseObjectGroupArgs)
	args.ObjectGroup = objectGroup
	return args
}
1015746
func (m *MockVolumeDriver) CloudBackupRestore(arg0 *api.CloudBackupRestoreRequest) (*api.CloudBackupRestoreResponse, error) {
	ret := m.ctrl.Call(m, "CloudBackupRestore", arg0)
	ret0, _ := ret[0].(*api.CloudBackupRestoreResponse)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
1218074
func (c *client) Restore(ctx context.Context, id string, attachStdio libcontainerdtypes.StdioCallback) (bool, int, libcontainerdtypes.Process, error) {
	c.logger.WithField("container", id).Debug("restore()")

	// TODO Windows: On RS1, a re-attach isn't possible.
	// However, there is a scenario in which there is an issue.
	// Consider a background container. The daemon dies unexpectedly.
	// HCS will still have the compute service alive and running.
	// For consistence, we call in to shoot it regardless if HCS knows about it
	// We explicitly just log a warning if the terminate fails.
	// Then we tell the backend the container exited.
	if hc, err := hcsshim.OpenContainer(id); err == nil {
		const terminateTimeout = time.Minute * 2
		err := hc.Terminate()

		if hcsshim.IsPending(err) {
			err = hc.WaitTimeout(terminateTimeout)
		} else if hcsshim.IsAlreadyStopped(err) {
			err = nil
		}

		if err != nil {
			c.logger.WithField("container", id).WithError(err).Debug("terminate failed on restore")
			return false, -1, nil, err
		}
	}
	return false, -1, &restoredProcess{
		c:  c,
		id: id,
	}, nil
}
955525
func NewResolveAnimationArgs(animationID string) *ResolveAnimationArgs {
	args := new(ResolveAnimationArgs)
	args.AnimationID = animationID
	return args
}
65207
func (s *VirtualMachineService) NewRestoreVirtualMachineParams(virtualmachineid string) *RestoreVirtualMachineParams {
	p := &RestoreVirtualMachineParams{}
	p.p = make(map[string]interface{})
	p.p["virtualmachineid"] = virtualmachineid
	return p
}
449528
func NewRelinquishFolderMembershipArg(SharedFolderId string) *RelinquishFolderMembershipArg {
	s := new(RelinquishFolderMembershipArg)
	s.SharedFolderId = SharedFolderId
	s.LeaveACopy = false
	return s
}
1070778
func NewPaperDocCreateArgs(ImportFormat *ImportFormat) *PaperDocCreateArgs {
	s := new(PaperDocCreateArgs)
	s.ImportFormat = ImportFormat
	return s
}
292391
func NewArgument(Expression Node, Variadic bool, IsReference bool) *Argument {
	return &Argument{
		FreeFloating: nil,
		Variadic:     Variadic,
		IsReference:  IsReference,
		Expr:         Expression,
	}
}
890003
func NewRevokeDesktopClientArg(SessionId string, TeamMemberId string) *RevokeDesktopClientArg {
	s := new(RevokeDesktopClientArg)
	s.SessionId = SessionId
	s.TeamMemberId = TeamMemberId
	s.DeleteOnUnlink = false
	return s
}
1109493
func NewRetryAPIArg(endpoint string) APIArg {
	return APIArg{
		Endpoint:        endpoint,
		InitialTimeout:  HTTPRetryInitialTimeout,
		RetryMultiplier: HTTPRetryMutliplier,
		RetryCount:      HTTPRetryCount,
	}
}
593128
func WithRestoreRW(ctx context.Context, id string, client *Client, checkpoint Image, index *imagespec.Index) NewContainerOpts {
	return func(ctx context.Context, client *Client, c *containers.Container) error {
		// apply rw layer
		rw, err := GetIndexByMediaType(index, imagespec.MediaTypeImageLayerGzip)
		if err != nil {
			return err
		}
		mounts, err := client.SnapshotService(c.Snapshotter).Mounts(ctx, c.SnapshotKey)
		if err != nil {
			return err
		}

		if _, err := client.DiffService().Apply(ctx, *rw, mounts); err != nil {
			return err
		}
		return nil
	}
}
1230728
func NewRevokeSharedLinkArg(Url string) *RevokeSharedLinkArg {
	s := new(RevokeSharedLinkArg)
	s.Url = Url
	return s
}
537945
func (r *StateRestore) AllocRestore(alloc *structs.Allocation) error {
	if err := r.txn.Insert("allocs", alloc); err != nil {
		return fmt.Errorf("alloc insert failed: %v", err)
	}
	return nil
}
211021
func NewMembersRecoverArg(User *UserSelectorArg) *MembersRecoverArg {
	s := new(MembersRecoverArg)
	s.User = User
	return s
}