// SetConfig updates the FSRepo's config. The user must not modify the config
// object after calling this method.
332914
func (r *FSRepo) SetConfig(updated *config.Config) error {

	// packageLock is held to provide thread-safety.
	packageLock.Lock()
	defer packageLock.Unlock()

	return r.setConfigUnsynced(updated)
}
1008134
func (s *PutEncryptionConfigOutput) SetEncryptionConfig(v *EncryptionConfig) *PutEncryptionConfigOutput {
	s.EncryptionConfig = v
	return s
}
640906
func (s *FieldLevelEncryptionProfile) SetFieldLevelEncryptionProfileConfig(v *FieldLevelEncryptionProfileConfig) *FieldLevelEncryptionProfile {
	s.FieldLevelEncryptionProfileConfig = v
	return s
}
352806
func (s *TrainingJob) SetResourceConfig(v *ResourceConfig) *TrainingJob {
	s.ResourceConfig = v
	return s
}
1194771
func (s *DescribeCompilationJobOutput) SetInputConfig(v *InputConfig) *DescribeCompilationJobOutput {
	s.InputConfig = v
	return s
}
920576
func (d *NvidiaDevice) SetConfig(cfg *base.Config) error {
	var config Config
	if len(cfg.PluginConfig) != 0 {
		if err := base.MsgPackDecode(cfg.PluginConfig, &config); err != nil {
			return err
		}
	}

	for _, ignoredGPUId := range config.IgnoredGPUIDs {
		d.ignoredGPUIDs[ignoredGPUId] = struct{}{}
	}

	period, err := time.ParseDuration(config.FingerprintPeriod)
	if err != nil {
		return fmt.Errorf("failed to parse fingerprint period %q: %v", config.FingerprintPeriod, err)
	}
	d.fingerprintPeriod = period

	return nil
}
1089326
func (s *SyncDeploymentJobOutput) SetDeploymentConfig(v *DeploymentConfig) *SyncDeploymentJobOutput {
	s.DeploymentConfig = v
	return s
}
1094357
func (s *RegisterCACertificateInput) SetRegistrationConfig(v *RegistrationConfig) *RegisterCACertificateInput {
	s.RegistrationConfig = v
	return s
}
635373
func (s *ServiceChange) SetDnsConfig(v *DnsConfigChange) *ServiceChange {
	s.DnsConfig = v
	return s
}
1260007
func (s *StepDetail) SetStepConfig(v *StepConfig) *StepDetail {
	s.StepConfig = v
	return s
}
1065859
func (s *DescribeElasticsearchDomainConfigOutput) SetDomainConfig(v *ElasticsearchDomainConfig) *DescribeElasticsearchDomainConfigOutput {
	s.DomainConfig = v
	return s
}
620056
func (s *CreateLocationS3Input) SetS3Config(v *S3Config) *CreateLocationS3Input {
	s.S3Config = v
	return s
}
410744
func (k *kubernetesClient) SetConfig(cfg *config.Config) error {
	k.lock.Lock()
	defer k.lock.Unlock()
	newCfg, err := providerInstance.newConfig(cfg)
	if err != nil {
		return errors.Trace(err)
	}
	k.envCfgUnlocked = newCfg.Config
	return nil
}
296028
func (m *MockZonedEnviron) SetConfig(arg0 *config.Config) error {
	ret := m.ctrl.Call(m, "SetConfig", arg0)
	ret0, _ := ret[0].(error)
	return ret0
}
820315
func (s *GetDistributionConfigOutput) SetDistributionConfig(v *DistributionConfig) *GetDistributionConfigOutput {
	s.DistributionConfig = v
	return s
}
513648
func (c *configCommand) setConfig(client applicationAPI, ctx *cmd.Context) error {
	if c.useFile {
		return c.setConfigFromFile(client, ctx)
	}

	settings, err := c.validateValues(ctx)
	if err != nil {
		return errors.Trace(err)
	}

	result, err := client.Get(c.branchName, c.applicationName)
	if err != nil {
		return err
	}

	for k, v := range settings {
		configValue := result.CharmConfig[k]

		configValueMap, ok := configValue.(map[string]interface{})
		if ok {
			// convert the value to string and compare
			if fmt.Sprintf("%v", configValueMap["value"]) == v {
				logger.Warningf("the configuration setting %q already has the value %q", k, v)
			}
		}
	}

	if client.BestAPIVersion() < 6 {
		err = client.Set(c.applicationName, settings)
	} else {
		err = client.SetApplicationConfig(c.branchName, c.applicationName, settings)
	}
	return block.ProcessBlockedError(err, block.BlockChange)
}
223007
func (s *UpdateElasticsearchDomainConfigOutput) SetDomainConfig(v *ElasticsearchDomainConfig) *UpdateElasticsearchDomainConfigOutput {
	s.DomainConfig = v
	return s
}