// resetDefaults resets the keys in resetKeys.
968586
func (c *defaultsCommand) resetDefaults(client defaultsCommandAPI, ctx *cmd.Context) error {
	// ctx unused in this method.
	if err := c.verifyKnownKeys(client, c.resetKeys); err != nil {
		return errors.Trace(err)
	}
	return block.ProcessBlockedError(
		client.UnsetModelDefaults(
			c.cloudName, c.regionName, c.resetKeys...), block.BlockChange)

}
1365972
func RegisterDefaults(scheme *runtime.Scheme) error {
	scheme.AddTypeDefaultingFunc(&v1.OAuthAuthorizeToken{}, func(obj interface{}) { SetObjectDefaults_OAuthAuthorizeToken(obj.(*v1.OAuthAuthorizeToken)) })
	scheme.AddTypeDefaultingFunc(&v1.OAuthAuthorizeTokenList{}, func(obj interface{}) { SetObjectDefaults_OAuthAuthorizeTokenList(obj.(*v1.OAuthAuthorizeTokenList)) })
	return nil
}
937806
func (m *ModelManagerAPIV5) ModelDefaults() (params.ModelDefaultsResult, error) {
	result := params.ModelDefaultsResult{}
	if !m.isAdmin {
		return result, common.ErrPerm
	}
	return m.modelDefaults(m.model.Cloud()), nil
}
597802
func maybeSetDefaults(vol *Volume) {
	if vol.Kind == "empty" {
		if vol.Mode == nil {
			m := emptyVolumeDefaultMode
			vol.Mode = &m
		}
		if vol.UID == nil {
			u := emptyVolumeDefaultUID
			vol.UID = &u
		}
		if vol.GID == nil {
			g := emptyVolumeDefaultGID
			vol.GID = &g
		}
	}
}
590608
func (self *Collection) FillDefaults(record *Record) {
	for _, field := range self.Fields {
		if field.DefaultValue != nil {
			if typeutil.IsZero(record.Get(field.Name)) {
				record.Set(field.Name, field.GetDefaultValue())
			}
		}
	}
}
159235
func RegisterDefaults(scheme *runtime.Scheme) error {
	scheme.AddTypeDefaultingFunc(&v1beta1.PodSecurityPolicy{}, func(obj interface{}) { SetObjectDefaults_PodSecurityPolicy(obj.(*v1beta1.PodSecurityPolicy)) })
	scheme.AddTypeDefaultingFunc(&v1beta1.PodSecurityPolicyList{}, func(obj interface{}) { SetObjectDefaults_PodSecurityPolicyList(obj.(*v1beta1.PodSecurityPolicyList)) })
	return nil
}
1176995
func (s *ObjectLockRule) SetDefaultRetention(v *DefaultRetention) *ObjectLockRule {
	s.DefaultRetention = v
	return s
}
1011016
func (r *Range) WithDefaults(d Range) Range {
	if r == nil {
		return d
	}

	// Make a copy.
	c := *r

	if c.Max == nil {
		c.Max = d.Max
	}

	if c.Sort == nil {
		c.Sort = d.Sort
	}

	if c.Order == nil {
		c.Order = d.Order
	}

	return c
}
613517
func (c *Config) SetDefaults() {
	if c.Rand == nil {
		c.Rand = rand.Reader
	}
	if c.Ciphers == nil {
		c.Ciphers = supportedCiphers
	}
	var ciphers []string
	for _, c := range c.Ciphers {
		if cipherModes[c] != nil {
			// reject the cipher if we have no cipherModes definition
			ciphers = append(ciphers, c)
		}
	}
	c.Ciphers = ciphers

	if c.KeyExchanges == nil {
		c.KeyExchanges = supportedKexAlgos
	}

	if c.MACs == nil {
		c.MACs = supportedMACs
	}

	if c.RekeyThreshold == 0 {
		// RFC 4253, section 9 suggests rekeying after 1G.
		c.RekeyThreshold = 1 << 30
	}
	if c.RekeyThreshold < minRekeyThreshold {
		c.RekeyThreshold = minRekeyThreshold
	}
}
682435
func RegisterDefaults(scheme *runtime.Scheme) error {
	scheme.AddTypeDefaultingFunc(&v1.StorageClass{}, func(obj interface{}) { SetObjectDefaults_StorageClass(obj.(*v1.StorageClass)) })
	scheme.AddTypeDefaultingFunc(&v1.StorageClassList{}, func(obj interface{}) { SetObjectDefaults_StorageClassList(obj.(*v1.StorageClassList)) })
	return nil
}
737307
func (c ConnStr) SetDefaults() ConnStr {
	c["user"] = getVar("PGUSER", getVar("USER", "postgres"))
	c["dbname"] = getVar("PGDATABASE", getVar("USER", "postgres"))
	c["host"] = getVar("PGHOST", "localhost")
	c["port"] = getVar("PGPORT", "5432")
	c["password"] = getVar("PGPASSWD", "")
	c["sslmode"] = getVar("PGSSLMODE", "disable")

	return c
}
78965
func (s *CreateJobInput) SetDefaultArguments(v map[string]*string) *CreateJobInput {
	s.DefaultArguments = v
	return s
}
489375
func (s *CloneStackInput) SetDefaultOs(v string) *CloneStackInput {
	s.DefaultOs = &v
	return s
}
1015207
func RegisterDefaults(scheme *runtime.Scheme) error {
	scheme.AddTypeDefaultingFunc(&v1beta1.CertificateSigningRequest{}, func(obj interface{}) {
		SetObjectDefaults_CertificateSigningRequest(obj.(*v1beta1.CertificateSigningRequest))
	})
	scheme.AddTypeDefaultingFunc(&v1beta1.CertificateSigningRequestList{}, func(obj interface{}) {
		SetObjectDefaults_CertificateSigningRequestList(obj.(*v1beta1.CertificateSigningRequestList))
	})
	return nil
}
556801
func (o *Options) applyDefaults() *Options {
	newOpts := *o
	if newOpts.Protocol == "" {
		newOpts.Protocol = "http"
	}
	if newOpts.APIVersion == 0 {
		newOpts.APIVersion = 1
	}
	if newOpts.HTTPClient == nil {
		transport := http.DefaultTransport
		if newOpts.Logger != nil {
			transport = httplogger.NewLoggedTransport(http.DefaultTransport, newOpts.Logger)
		}
		newOpts.HTTPClient = &http.Client{
			Transport: transport,
			Timeout:   60 * time.Second,
		}
	}
	return &newOpts
}
959683
func (s *Stage) SetDefaultRouteSettings(v *RouteSettings) *Stage {
	s.DefaultRouteSettings = v
	return s
}
495496
func setDefaults(p *CreateMachineParams) {
	if p.findPath == nil {
		p.findPath = paths.DataDir
	}
	if p.runCmd == nil {
		p.runCmd = runAsLibvirt
	}
	if p.runCmdAsRoot == nil {
		p.runCmdAsRoot = run
	}
}