// resourceName returns the string to use for a resource's Name tag,
// to help users identify Juju-managed resources in the AWS console.
325403
func resourceName(tag names.Tag, envName string) string {
	return fmt.Sprintf("juju-%s-%s", envName, tag)
}
1138347
func (s *AddTagsToResourceInput) SetResourceName(v string) *AddTagsToResourceInput {
	s.ResourceName = &v
	return s
}
698167
func (t *Template) GetAWSS3BucketWithName(name string) (*resources.AWSS3Bucket, error) {
	if untyped, ok := t.Resources[name]; ok {
		switch resource := untyped.(type) {
		case *resources.AWSS3Bucket:
			return resource, nil
		}
	}
	return nil, fmt.Errorf("resource %q of type AWSS3Bucket not found", name)
}
1338244
func IsNativeResource(name core.ResourceName) bool {
	return !strings.Contains(string(name), "/") ||
		strings.Contains(string(name), core.ResourceDefaultNamespacePrefix)
}
145062
func IsScalarResourceName(name v1.ResourceName) bool {
	return IsExtendedResourceName(name) || IsHugePageResourceName(name) ||
		IsPrefixedNativeResource(name) || IsAttachableVolumeResourceName(name)
}
882388
func IsHugePageResourceName(name core.ResourceName) bool {
	return strings.HasPrefix(string(name), core.ResourceHugePagesPrefix)
}
784496
func (s *ConfigurationOptionSetting) SetResourceName(v string) *ConfigurationOptionSetting {
	s.ResourceName = &v
	return s
}
395391
func (s *Resource) SetResourceName(v string) *Resource {
	s.ResourceName = &v
	return s
}
905892
func (s *ListTagsForResourceInput) SetResourceName(v string) *ListTagsForResourceInput {
	s.ResourceName = &v
	return s
}
1199540
func IsStandardQuotaResourceName(str string) bool {
	return standardQuotaResources.Has(str) || IsQuotaHugePageResourceName(core.ResourceName(str))
}
478972
func (s *GetOperationsForResourceInput) SetResourceName(v string) *GetOperationsForResourceInput {
	s.ResourceName = &v
	return s
}
493524
func GetResourceName(res Resource) string {
	switch v := res.(type) {
	case *v2.ClusterLoadAssignment:
		return v.GetClusterName()
	case *v2.Cluster:
		return v.GetName()
	case *v2.RouteConfiguration:
		return v.GetName()
	case *v2.Listener:
		return v.GetName()
	case *auth.Secret:
		return v.GetName()
	default:
		return ""
	}
}
196953
func (r *Request) Name(resourceName string) *Request {
	if r.err != nil {
		return r
	}
	if len(resourceName) == 0 {
		r.err = fmt.Errorf("resource name may not be empty")
		return r
	}
	if len(r.resourceName) != 0 {
		r.err = fmt.Errorf("resource name already set to %q, cannot change to %q", r.resourceName, resourceName)
		return r
	}
	if msgs := IsValidPathSegmentName(resourceName); len(msgs) != 0 {
		r.err = fmt.Errorf("invalid resource name %q: %v", resourceName, msgs)
		return r
	}
	r.resourceName = resourceName
	return r
}
282462
func validateResourceName(value string, fldPath *field.Path) field.ErrorList {
	allErrs := field.ErrorList{}
	if !validation.IsQualifiedName(value) {
		return append(allErrs, field.Invalid(fldPath, value, qualifiedNameErrorMsg))
	}

	if len(strings.Split(value, "/")) == 1 {
		if !api.IsStandardResourceName(value) {
			return append(allErrs, field.Invalid(fldPath, value, "must be a standard resource type or fully qualified"))
		}
	}

	return field.ErrorList{}
}
277626
func (f Firewall) newResourceName(appName string) string {
	return fmt.Sprintf("juju-%s-%s", f.environ.Config().UUID(), appName)
}
1229722
func (s *CreateTagsInput) SetResourceName(v string) *CreateTagsInput {
	s.ResourceName = &v
	return s
}
1020136
func (s *ListTagsInput) SetResourceName(v string) *ListTagsInput {
	s.ResourceName = &v
	return s
}