// setOSArch translates the given OS and architecture strings into
// the compatible with application container specification and sets
// the respective label entries.
//
// Returns an error if label translation fails.
355540
func setOSArch(labels map[appctypes.ACIdentifier]string, os, arch string) error {
	// Translate arch tuple into the appc arch tuple.
	appcOS, appcArch, err := appctypes.ToAppcOSArch(os, arch, "")
	if err != nil {
		return err
	}

	// Set translated labels.
	setLabel(labels, "os", appcOS)
	setLabel(labels, "arch", appcArch)
	return nil
}
237509
func (s *WafAction) SetType(v string) *WafAction {
	s.Type = &v
	return s
}
250992
func (s *EnvironmentTier) SetType(v string) *EnvironmentTier {
	s.Type = &v
	return s
}
1014995
func (s *UpdateAppInput) SetType(v string) *UpdateAppInput {
	s.Type = &v
	return s
}
589277
func (s *CertificateDetail) SetType(v string) *CertificateDetail {
	s.Type = &v
	return s
}
1327127
func (s *Blueprint) SetType(v string) *Blueprint {
	s.Type = &v
	return s
}
523608
func (s *Service) SetType(v string) *Service {
	s.Type = &v
	return s
}
584224
func (s *Operation) SetType(v string) *Operation {
	s.Type = &v
	return s
}
107252
func (s *SourceAuth) SetType(v string) *SourceAuth {
	s.Type = &v
	return s
}
1341614
func (s *EnvironmentVariable) SetType(v string) *EnvironmentVariable {
	s.Type = &v
	return s
}
19796
func (api *APIBase) SetCharm(args params.ApplicationSetCharm) error {
	if err := api.checkCanWrite(); err != nil {
		return err
	}
	// when forced units in error, don't block
	if !args.ForceUnits {
		if err := api.check.ChangeAllowed(); err != nil {
			return errors.Trace(err)
		}
	}
	application, err := api.backend.Application(args.ApplicationName)
	if err != nil {
		return errors.Trace(err)
	}
	channel := csparams.Channel(args.Channel)
	return api.setCharmWithAgentValidation(
		setCharmParams{
			AppName:               args.ApplicationName,
			Application:           application,
			Channel:               channel,
			ConfigSettingsStrings: args.ConfigSettings,
			ConfigSettingsYAML:    args.ConfigSettingsYAML,
			ResourceIDs:           args.ResourceIDs,
			StorageConstraints:    args.StorageConstraints,
			Force: forceParams{
				ForceSeries: args.ForceSeries,
				ForceUnits:  args.ForceUnits,
				Force:       args.Force,
			},
		},
		args.CharmURL,
	)
}
1246105
func (s *OrganizationNode) SetType(v string) *OrganizationNode {
	s.Type = &v
	return s
}
469304
func ToGoOSArch(appcOs string, appcArch string) (goOs string, goArch string, goArchFlavor string, e error) {
	tabularGoToAppc := map[appcArchTuple]goArchTuple{
		// {"linux", "aarch64_be"}: nil,
		// {"linux", "armv7b"}: nil,
		{"linux", "aarch64"}: {"linux", "arm64", ""},
		{"linux", "amd64"}:   {"linux", "amd64", ""},
		{"linux", "armv6l"}:  {"linux", "arm", "6"},
		{"linux", "armv7l"}:  {"linux", "arm", "7"},
		{"linux", "i386"}:    {"linux", "386", ""},
		{"linux", "ppc64"}:   {"linux", "ppc64", ""},
		{"linux", "ppc64le"}: {"linux", "ppc64le", ""},
		{"linux", "s390x"}:   {"linux", "s390x", ""},

		{"freebsd", "amd64"}: {"freebsd", "amd64", ""},
		{"freebsd", "arm"}:   {"freebsd", "arm", "6"},
		{"freebsd", "386"}:   {"freebsd", "i386", ""},

		{"darwin", "amd64"}: {"darwin", "x86_64", ""},
		{"darwin", "386"}:   {"darwin", "i386", ""},
	}

	archTuple, ok := tabularGoToAppc[appcArchTuple{appcOs, appcArch}]
	if !ok {
		return "", "", "", fmt.Errorf("unknown arch tuple: %q - %q", appcOs, appcArch)
	}
	return archTuple.goOs, archTuple.goArch, archTuple.goArchFlavor, nil
}
1283314
func (s *AssociationExecutionFilter) SetType(v string) *AssociationExecutionFilter {
	s.Type = &v
	return s
}
968740
func (s *SegmentGroup) SetType(v string) *SegmentGroup {
	s.Type = &v
	return s
}
57213
func (s *ActionConfigurationProperty) SetType(v string) *ActionConfigurationProperty {
	s.Type = &v
	return s
}
1103601
func (s *GeoMatchConstraint) SetType(v string) *GeoMatchConstraint {
	s.Type = &v
	return s
}