// Get a version of the contract name to be used for an instance of the contract
970410
func (contract *solidityContract) InstanceName() string {
	// Hopefully the contract name is UpperCamelCase. If it's not, oh well, this
	// is meant to be illustrative rather than cast iron compilable
	instanceName := strings.ToLower(contract.Name[:1]) + contract.Name[1:]
	if instanceName == contract.Name {
		return "contractInstance"
	}
	return instanceName
}
305504
func (m *Metric) GetName() string {
	if m == nil || m.Name == nil {
		return ""
	}
	return *m.Name
}
185234
func (r *ReleaseAsset) GetName() string {
	if r == nil || r.Name == nil {
		return ""
	}
	return *r.Name
}
842824
func (e *Entry) GetName() string {
	if len(e.NameRaw) > 0 {
		return string(e.NameRaw)
	}
	return e.Name
}
1118844
func (r *RepositoryTag) GetName() string {
	if r == nil || r.Name == nil {
		return ""
	}
	return *r.Name
}
666966
func (i IndexFile) Get(name, version string) (*ChartVersion, error) {
	vs, ok := i.Entries[name]
	if !ok {
		return nil, ErrNoChartName
	}
	if len(vs) == 0 {
		return nil, ErrNoChartVersion
	}

	var constraint *semver.Constraints
	if len(version) == 0 {
		constraint, _ = semver.NewConstraint("*")
	} else {
		var err error
		constraint, err = semver.NewConstraint(version)
		if err != nil {
			return nil, err
		}
	}

	// when customer input exact version, check whether have exact match one first
	if len(version) != 0 {
		for _, ver := range vs {
			if version == ver.Version {
				return ver, nil
			}
		}
	}

	for _, ver := range vs {
		test, err := semver.NewVersion(ver.Version)
		if err != nil {
			continue
		}

		if constraint.Check(test) {
			return ver, nil
		}
	}
	return nil, fmt.Errorf("No chart version found for %s-%s", name, version)
}
380143
func GetName(n ast.Node) (name string, exists bool) {
	var ident_ interface{}
	if idt, exists := getStructField(n, "Name"); exists {
		ident_ = idt
	} else if idt, exists := getStructField(n, "Sel"); exists {
		ident_ = idt
	}
	if ident_ == nil {
		return "", false
	}

	nodeName, isIdent := ident_.(*ast.Ident)
	if !isIdent {
		return "", false
	}
	return nodeName.Name, true
}
98938
func (c *CodeOfConduct) GetName() string {
	if c == nil || c.Name == nil {
		return ""
	}
	return *c.Name
}
98538
func (s *StatusEvent) GetName() string {
	if s == nil || s.Name == nil {
		return ""
	}
	return *s.Name
}
809091
func (r *RepositoryLicense) GetName() string {
	if r == nil || r.Name == nil {
		return ""
	}
	return *r.Name
}
341008
func BuildNameForConfigVersion(name string, version int) string {
	return fmt.Sprintf("%s-%d", name, version)
}
445698
func (version *Version) GetVersion(property *Property, getVersion int) error {
	if getVersion == 0 {
		getVersion = property.LatestVersion
	}

	req, err := client.NewRequest(
		Config,
		"GET",
		fmt.Sprintf(
			"/papi/v1/properties/%s/versions/%d",
			property.PropertyID,
			getVersion,
		),
		nil,
	)
	if err != nil {
		return err
	}

	res, err := client.Do(Config, req)
	if err != nil {
		return err
	}

	if client.IsError(res) {
		return client.NewAPIError(res)
	}

	newVersions := NewVersions()
	if err := client.BodyJSON(res, newVersions); err != nil {
		return err
	}

	version.PropertyVersion = newVersions.Versions.Items[0].PropertyVersion
	version.UpdatedByUser = newVersions.Versions.Items[0].UpdatedByUser
	version.UpdatedDate = newVersions.Versions.Items[0].UpdatedDate
	version.ProductionStatus = newVersions.Versions.Items[0].ProductionStatus
	version.StagingStatus = newVersions.Versions.Items[0].StagingStatus
	version.Etag = newVersions.Versions.Items[0].Etag
	version.ProductID = newVersions.Versions.Items[0].ProductID
	version.Note = newVersions.Versions.Items[0].Note
	version.CreateFromVersion = newVersions.Versions.Items[0].CreateFromVersion
	version.CreateFromVersionEtag = newVersions.Versions.Items[0].CreateFromVersionEtag

	return nil
}
1239419
func GetFuncNameByPattern(
	pattern string,
	repl func(string) string,
) string {
	result := GetAPINameByPattern(pattern, repl)
	versionInfos := regexpAPIVersionPrefix.FindStringSubmatch(pattern)
	if len(versionInfos) > 1 {
		result += "V" + versionInfos[1]
	}
	return result
}
153017
func (p *Project) GetName() string {
	if p == nil || p.Name == nil {
		return ""
	}
	return *p.Name
}
240380
func (a *Client) GetVersions(params *GetVersionsParams, authInfo runtime.ClientAuthInfoWriter) (*GetVersionsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetVersionsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetVersions",
		Method:             "GET",
		PathPattern:        "/versions",
		ProducesMediaTypes: []string{"application/json", "application/x-gzip"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &GetVersionsReader{formats: a.formats},
		AuthInfo:           authInfo,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetVersionsOK), nil
}
126732
func (n *Network) GetName() (string, error) {
	var err C.virError
	name := C.virNetworkGetNameWrapper(n.ptr, &err)
	if name == nil {
		return "", makeError(&err)
	}
	return C.GoString(name), nil
}
504559
func GetPluginVersion(name string) (*ver.Version, error) {
	route, found, err := ReadPluginRoute(name)
	if err != nil {
		return nil, err
	}

	if !found {
		return nil, fmt.Errorf("plugin not installed with name (%s)", name)
	}

	if route.Version == "" {
		return nil, nil
	}

	pluginVersion, err := ver.NewVersion(route.Version)
	if err != nil {
		return nil, err
	}
	if pluginVersion == nil {
		return nil, fmt.Errorf("failed to parse version (%s)", route.Version)
	}

	return pluginVersion, nil
}