// GetOperationIDAndTags returns a customize operation ID and a list of tags for kubernetes API server's OpenAPI spec to prevent duplicate IDs.
549015
func GetOperationIDAndTags(r *restful.Route) (string, []string, error) {
	op := r.Operation
	path := r.Path
	var tags []string
	prefix, exists := verbs.GetPrefix(op)
	if !exists {
		return op, tags, fmt.Errorf("operation names should start with a verb. Cannot determine operation verb from %v", op)
	}
	op = op[len(prefix):]
	parts := strings.Split(strings.Trim(path, "/"), "/")
	// Assume /api is /apis/core, remove this when we actually server /api/... on /apis/core/...
	if len(parts) >= 1 && parts[0] == "api" {
		parts = append([]string{"apis", "core"}, parts[1:]...)
	}
	if len(parts) >= 2 && parts[0] == "apis" {
		trimmed := strings.TrimSuffix(parts[1], ".k8s.io")
		prefix = prefix + ToValidOperationID(trimmed, prefix != "")
		tag := ToValidOperationID(trimmed, false)
		if len(parts) > 2 {
			prefix = prefix + ToValidOperationID(parts[2], prefix != "")
			tag = tag + "_" + ToValidOperationID(parts[2], false)
		}
		tags = append(tags, tag)
	} else if len(parts) >= 1 {
		tags = append(tags, ToValidOperationID(parts[0], false))
	}
	return prefix + ToValidOperationID(op, prefix != ""), tags, nil
}
382822
func getOperator(op configs.Operator) (libseccomp.ScmpCompareOp, error) {
	switch op {
	case configs.EqualTo:
		return libseccomp.CompareEqual, nil
	case configs.NotEqualTo:
		return libseccomp.CompareNotEqual, nil
	case configs.GreaterThan:
		return libseccomp.CompareGreater, nil
	case configs.GreaterThanOrEqualTo:
		return libseccomp.CompareGreaterEqual, nil
	case configs.LessThan:
		return libseccomp.CompareLess, nil
	case configs.LessThanOrEqualTo:
		return libseccomp.CompareLessOrEqual, nil
	case configs.MaskEqualTo:
		return libseccomp.CompareMaskedEqual, nil
	default:
		return libseccomp.CompareInvalid, fmt.Errorf("invalid operator, cannot use in rule")
	}
}
158361
func (c *Client) FindActionTagsByPrefix(arg params.FindTags) (params.FindTagsResults, error) {
	results := params.FindTagsResults{}
	err := c.facade.FacadeCall("FindActionTagsByPrefix", arg, &results)
	return results, err
}
351579
func (a *Client) GetNodesIdentifierWorkflows(params *GetNodesIdentifierWorkflowsParams, authInfo runtime.ClientAuthInfoWriter) (*GetNodesIdentifierWorkflowsOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetNodesIdentifierWorkflowsParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetNodesIdentifierWorkflows",
		Method:             "GET",
		PathPattern:        "/nodes/{identifier}/workflows",
		ProducesMediaTypes: []string{"application/json", "application/x-gzip"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &GetNodesIdentifierWorkflowsReader{formats: a.formats},
		AuthInfo:           authInfo,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetNodesIdentifierWorkflowsOK), nil
}
259672
func (r *apiHandler) GetAuthTag() names.Tag {
	if r.entity == nil {
		return nil
	}
	return r.entity.Tag()
}
269939
func validateClientGenTags(values map[string][]string) error {
	for _, k := range supportedTags {
		delete(values, k)
	}
	for key := range values {
		if strings.HasPrefix(key, strings.TrimSuffix(genClientPrefix, ":")) {
			return errors.New("unknown tag detected: " + key)
		}
	}
	return nil
}
1009535
func (e *AutoscalingGroup) getASGTagsToDelete(currentTags map[string]string) []*autoscaling.Tag {
	tagsToDelete := []*autoscaling.Tag{}

	for k, v := range currentTags {
		if _, ok := e.Tags[k]; !ok {
			tagsToDelete = append(tagsToDelete, &autoscaling.Tag{
				Key:          aws.String(k),
				Value:        aws.String(v),
				ResourceId:   e.Name,
				ResourceType: aws.String("auto-scaling-group"),
			})
		}
	}
	return tagsToDelete
}
854873
func (dao *ControlPlaneDao) GetSnapshotByServiceIDAndTag(request model.SnapshotByTagRequest, snapshot *model.SnapshotInfo) (err error) {
	ctx := datastore.Get()
	info, err := dao.facade.GetSnapshotByServiceIDAndTag(ctx, request.ServiceID, request.TagName)
	if err != nil {
		return
	}
	*snapshot = model.SnapshotInfo{
		SnapshotID:  info.Name,
		TenantID:    info.TenantID,
		Description: info.Message,
		Tags:        info.Tags,
		Created:     info.Created,
	}
	return nil
}
1207051
func (s *Spec) OperationIDs() []string {
	if len(s.operations) == 0 {
		return nil
	}
	result := make([]string, 0, len(s.operations))
	for method, v := range s.operations {
		for p, o := range v {
			if o.ID != "" {
				result = append(result, o.ID)
			} else {
				result = append(result, fmt.Sprintf("%s %s", strings.ToUpper(method), p))
			}
		}
	}
	return result
}
1003901
func GetBoolFlags(config interface{}) ([]string, error) {
	flagMap := make(map[string]reflect.StructField)
	if err := getTypesRecursive(reflect.ValueOf(config), flagMap, ""); err != nil {
		return []string{}, err
	}

	flags := make([]string, 0, len(flagMap))
	for f, structField := range flagMap {
		if structField.Type.Kind() == reflect.Bool {
			flags = append(flags, f)
		}
	}
	return flags, nil
}
97709
func (t *Template) GetAllAWSServiceCatalogTagOptionAssociationResources() map[string]*resources.AWSServiceCatalogTagOptionAssociation {
	results := map[string]*resources.AWSServiceCatalogTagOptionAssociation{}
	for name, untyped := range t.Resources {
		switch resource := untyped.(type) {
		case *resources.AWSServiceCatalogTagOptionAssociation:
			results[name] = resource
		}
	}
	return results
}
1106729
func (s *OrganizationOperationLogService) GetOrganizationOperationLog(ctx context.Context, id platform.ID, opts platform.FindOptions) ([]*platform.OperationLogEntry, int, error) {
	return s.GetOrganizationOperationLogFn(ctx, id, opts)
}
1281290
func MustParseClientGenTags(lines []string) Tags {
	tags, err := ParseClientGenTags(lines)
	if err != nil {
		panic(err.Error())
	}
	return tags
}
1264182
func (store *AEDatastoreStore) GetAEDatastoreAdminOperation(c context.Context, id int64) (*AEDatastoreAdminOperation, error) {
	if id == 0 {
		return nil, ErrInvalidID
	}

	g := goon.FromContext(c)

	entity := &AEDatastoreAdminOperation{ID: id}
	err := g.Get(entity)
	if err != nil {
		log.Infof(c, "on Get AEDatastoreAdminOperation: %s", err.Error())
		return nil, err
	}
	err = entity.FetchChildren(c)
	if err != nil {
		log.Infof(c, "on AEDatastoreAdminOperation.FetchChildren: %s", err.Error())
		return nil, err
	}

	return entity, nil
}
173810
func getActionTagByPrefix(api APIClient, prefix string) (names.ActionTag, error) {
	tag := names.ActionTag{}
	actiontags, err := getActionTagsByPrefix(api, prefix)
	if err != nil {
		return tag, err
	}

	if len(actiontags) < 1 {
		return tag, errors.Errorf("actions for identifier %q not found", prefix)
	}

	if len(actiontags) > 1 {
		return tag, errors.Errorf("identifier %q matched multiple actions %v", prefix, actiontags)
	}

	return actiontags[0], nil
}
1257031
func (r *CiliumNetworkPolicy) GetIdentityLabels() labels.LabelArray {
	namespace := k8sUtils.ExtractNamespace(&r.ObjectMeta)
	name := r.ObjectMeta.Name
	uid := r.ObjectMeta.UID
	return k8sCiliumUtils.GetPolicyLabels(namespace, name, uid,
		k8sCiliumUtils.ResourceTypeCiliumNetworkPolicy)
}
302184
func GetOperTenant(obj *TenantInspect) error {
	// Check if we handle this object
	if objCallbackHandler.TenantCb == nil {
		log.Errorf("No callback registered for tenant object")
		return errors.New("Invalid object type")
	}

	// Perform callback
	err := objCallbackHandler.TenantCb.TenantGetOper(obj)
	if err != nil {
		log.Errorf("TenantDelete retruned error for: %+v. Err: %v", obj, err)
		return err
	}

	return nil
}