// AddType adds a Type delcaration block with individual alias for each Spec handed in `decl`
179582
func (alias *AliasPackage) AddType(decl *ast.GenDecl) (err error) {
	if decl == nil {
		err = errUnexpectedNil
		return
	} else if decl.Tok != token.TYPE {
		err = ErrorUnexpectedToken{Expected: token.TYPE, Received: decl.Tok}
		return
	}

	targetFile := alias.ModelFile()

	for _, spec := range decl.Specs {
		cast := spec.(*ast.TypeSpec)
		cast.Assign = 1
		cast.Type = &ast.SelectorExpr{
			X: &ast.Ident{
				Name: origImportAlias,
			},
			Sel: &ast.Ident{
				Name: cast.Name.Name,
			},
		}
	}

	targetFile.Decls = append(targetFile.Decls, decl)
	return
}
942715
func addKnownTypes(scheme *runtime.Scheme) error {
	scheme.AddKnownTypes(SchemeGroupVersion,
		&Workflow{},
		&WorkflowList{},
	)
	metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
	return nil
}
41045
func (g *Generator) addType(t reflect.Type) {
	if g.typesSeen[t] {
		return
	}
	for _, t1 := range g.typesUnseen {
		if t1 == t {
			return
		}
	}
	g.typesUnseen = append(g.typesUnseen, t)
}
507990
func (s *Upload) SetType(v string) *Upload {
	s.Type = &v
	return s
}
434783
func (s *TermvectorsService) Type(typ string) *TermvectorsService {
	s.typ = typ
	return s
}
309258
func (dec *Decoder) RegisterCustomType(fn DecodeCustomTypeFunc, types []interface{}, fields []interface{}) *Decoder {
	if dec.customTypes == nil {
		dec.customTypes = make(map[reflect.Type]*DecodeCustomType)
	}
	for i := range types {
		typ := reflect.TypeOf(types[i])
		if dec.customTypes[typ] == nil {
			dec.customTypes[typ] = new(DecodeCustomType)
		}
		if len(fields) > 0 {
			for j := range fields {
				va := reflect.ValueOf(fields[j])
				f := DecodeCustomTypeField{field: va, fun: fn}
				dec.customTypes[typ].fields = append(dec.customTypes[typ].fields, f)
			}
		} else {
			dec.customTypes[typ].fun = fn
		}
	}
	return dec
}
679898
func (v retainKeysStrategy) MergeType(e apply.TypeElement) (apply.Result, error) {
	// No merge logic if adding or deleting a field
	if result, done := v.merge.doAddOrDelete(&e); done {
		return result, nil
	}

	elem := map[string]apply.Element{}
	for key := range e.GetLocalMap() {
		elem[key] = e.GetValues()[key]
	}
	return v.merge.doMergeMap(elem)
}
431388
func (b *Builder) AddPointerType(typename string, typ dwarf.Offset) dwarf.Offset {
	r := b.TagOpen(dwarf.TagPointerType, typename)
	b.Attr(dwarf.AttrType, typ)
	b.Attr(godwarf.AttrGoKind, uint8(22))
	b.TagClose()
	return r
}
473289
func (s *DeleteMappingService) Type(typ ...string) *DeleteMappingService {
	s.typ = append(s.typ, typ...)
	return s
}
158950
func (r *BulkDeleteRequest) Type(typ string) *BulkDeleteRequest {
	r.typ = typ
	r.source = nil
	return r
}
374690
func (s *Scheme) AddIgnoredConversionType(from, to interface{}) error {
	return s.converter.RegisterIgnoredConversion(from, to)
}
1067437
func addKnownTypes(scheme *runtime.Scheme) error {
	scheme.AddKnownTypes(SchemeGroupVersion,
		&TestType{},
		&TestTypeList{},
	)

	scheme.AddKnownTypes(SchemeGroupVersion)
	return nil
}
584553
func addModelType(models map[string]*ControllerModels) error {
	changes := false
	for _, cm := range models {
		for name, m := range cm.Models {
			if m.ModelType == "" {
				changes = true
				m.ModelType = model.IAAS
				cm.Models[name] = m
			}
		}
	}
	if changes {
		return WriteModelsFile(models)
	}
	return nil
}
700792
func (s *IndicesGetFieldMappingService) Type(types ...string) *IndicesGetFieldMappingService {
	s.typ = append(s.typ, types...)
	return s
}
916716
func (s *DeleteService) Type(typ string) *DeleteService {
	s.typ = typ
	return s
}
286302
func (s *BlockerDeclaration) SetType(v string) *BlockerDeclaration {
	s.Type = &v
	return s
}
977722
func (s *SearchService) Type(typ ...string) *SearchService {
	s.typ = append(s.typ, typ...)
	return s
}