// Copy a configuration template and returns a newly created template copy
439954
func (r Configuration_Template) CopyTemplate(templateObject *datatypes.Configuration_Template) (resp datatypes.Configuration_Template, err error) {
	params := []interface{}{
		templateObject,
	}
	err = r.Session.DoRequest("SoftLayer_Configuration_Template", "copyTemplate", params, &r.Options, &resp)
	return
}
224325
func (c *Config) Copy() *Config {
	copy := *c

	if c.XHR != nil {
		xhr := *copy.XHR
		copy.XHR = &xhr
	}

	if c.Client != nil {
		client := *copy.Client
		copy.Client = &client
	}

	if c.Websocket != nil {
		ws := *copy.Websocket
		copy.Websocket = &ws
	}

	return &copy
}
905364
func CopyConfig(config *Config) *Config {
	return &Config{
		Host:            config.Host,
		APIPath:         config.APIPath,
		ContentConfig:   config.ContentConfig,
		Username:        config.Username,
		Password:        config.Password,
		BearerToken:     config.BearerToken,
		BearerTokenFile: config.BearerTokenFile,
		Impersonate: ImpersonationConfig{
			Groups:   config.Impersonate.Groups,
			Extra:    config.Impersonate.Extra,
			UserName: config.Impersonate.UserName,
		},
		AuthProvider:        config.AuthProvider,
		AuthConfigPersister: config.AuthConfigPersister,
		ExecProvider:        config.ExecProvider,
		TLSClientConfig: TLSClientConfig{
			Insecure:   config.TLSClientConfig.Insecure,
			ServerName: config.TLSClientConfig.ServerName,
			CertFile:   config.TLSClientConfig.CertFile,
			KeyFile:    config.TLSClientConfig.KeyFile,
			CAFile:     config.TLSClientConfig.CAFile,
			CertData:   config.TLSClientConfig.CertData,
			KeyData:    config.TLSClientConfig.KeyData,
			CAData:     config.TLSClientConfig.CAData,
		},
		UserAgent:     config.UserAgent,
		Transport:     config.Transport,
		WrapTransport: config.WrapTransport,
		QPS:           config.QPS,
		Burst:         config.Burst,
		RateLimiter:   config.RateLimiter,
		Timeout:       config.Timeout,
		Dial:          config.Dial,
	}
}
502091
func (in *TemplateInstanceObject) DeepCopy() *TemplateInstanceObject {
	if in == nil {
		return nil
	}
	out := new(TemplateInstanceObject)
	in.DeepCopyInto(out)
	return out
}
1362975
func (tpl *Template) Clone() *Template {
	result := newTemplate(tpl.source)

	result.program = tpl.program

	tpl.mutex.RLock()
	defer tpl.mutex.RUnlock()

	for name, helper := range tpl.helpers {
		result.RegisterHelper(name, helper.Interface())
	}

	for name, partial := range tpl.partials {
		result.addPartial(name, partial.source, partial.tpl)
	}

	return result
}
326521
func (d *EphemeralDisk) Copy() *EphemeralDisk {
	ld := new(EphemeralDisk)
	*ld = *d
	return ld
}
356565
func (e *Env) Copy() *Env {
	e.Lock()
	defer e.Unlock()
	copy := Env{
		name:     e.name,
		env:      make(map[string]reflect.Value),
		typ:      make(map[string]reflect.Type),
		parent:   e.parent,
		external: e.external,
	}
	for name, value := range e.env {
		copy.env[name] = value
	}
	for name, typ := range e.typ {
		copy.typ[name] = typ
	}
	return &copy
}
368786
func (in *TemplateInstanceStatus) DeepCopy() *TemplateInstanceStatus {
	if in == nil {
		return nil
	}
	out := new(TemplateInstanceStatus)
	in.DeepCopyInto(out)
	return out
}
703868
func (c *SyncCollector) Copy(m map[string]interface{}) {
	for v, k := range m {
		c.Set(v, k)
	}
}
81454
func (a Args) Copy() Args {
	cpy := Args{}
	for _, t := range a {
		cpy = append(cpy, t.Copy())
	}
	return cpy
}
154048
func (a *AutopilotConfig) Copy() *AutopilotConfig {
	if a == nil {
		return nil
	}

	nc := new(AutopilotConfig)
	*nc = *a

	// Copy the bools
	if a.CleanupDeadServers != nil {
		nc.CleanupDeadServers = helper.BoolToPtr(*a.CleanupDeadServers)
	}
	if a.EnableRedundancyZones != nil {
		nc.EnableRedundancyZones = helper.BoolToPtr(*a.EnableRedundancyZones)
	}
	if a.DisableUpgradeMigration != nil {
		nc.DisableUpgradeMigration = helper.BoolToPtr(*a.DisableUpgradeMigration)
	}
	if a.EnableCustomUpgrades != nil {
		nc.EnableCustomUpgrades = helper.BoolToPtr(*a.EnableCustomUpgrades)
	}

	return nc
}
153663
func (m *SecureMap) Copy(src map[interface{}]interface{}) {
	for k, v := range src {
		m.Set(k, v)
	}
}
984018
func (s *Node) Copy() *Node {
	localCopy := deepcopy.Copy(*s)
	nodeCopy := localCopy.(Node)
	return &nodeCopy
}
882878
func copyConfigFiles() error {
	log.Printf("Storing default config.toml at %s", constants.StoredContainerdConfigTomlPath)
	if err := mcnutils.CopyFile(filepath.Join(nodeDir, constants.ContainerdConfigTomlPath), filepath.Join(nodeDir, constants.StoredContainerdConfigTomlPath)); err != nil {
		return errors.Wrap(err, "copying default config.toml")
	}
	log.Print("Copying gvisor-containerd-shim.toml...")
	if err := copyAssetToDest(constants.GvisorContainerdShimTargetName, filepath.Join(nodeDir, constants.GvisorContainerdShimTomlPath)); err != nil {
		return errors.Wrap(err, "copying gvisor-containerd-shim.toml")
	}
	log.Print("Copying containerd config.toml with gvisor...")
	if err := copyAssetToDest(constants.GvisorConfigTomlTargetName, filepath.Join(nodeDir, constants.ContainerdConfigTomlPath)); err != nil {
		return errors.Wrap(err, "copying gvisor version of config.toml")
	}
	return nil
}
93526
func (s *TemplateService) CopyTemplate(p *CopyTemplateParams) (*CopyTemplateResponse, error) {
	resp, err := s.cs.newRequest("copyTemplate", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r CopyTemplateResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	// If we have a async client, we need to wait for the async result
	if s.cs.async {
		b, err := s.cs.GetAsyncJobResult(r.JobID, s.cs.timeout)
		if err != nil {
			if err == AsyncTimeoutErr {
				return &r, err
			}
			return nil, err
		}

		b, err = getRawValue(b)
		if err != nil {
			return nil, err
		}

		if err := json.Unmarshal(b, &r); err != nil {
			return nil, err
		}
	}

	return &r, nil
}
544521
func (in *TemplateInstanceSpec) DeepCopy() *TemplateInstanceSpec {
	if in == nil {
		return nil
	}
	out := new(TemplateInstanceSpec)
	in.DeepCopyInto(out)
	return out
}
516483
func (t *TaskServices) Copy() *TaskServices {
	newTS := new(TaskServices)
	*newTS = *t

	// Deep copy Services
	newTS.Services = make([]*structs.Service, len(t.Services))
	for i := range t.Services {
		newTS.Services[i] = t.Services[i].Copy()
	}
	return newTS
}