//CopyType copies type declaration to the generated body
770954
func (g *Generator) CopyType(typeSpec *ast.TypeSpec) error {
	switch t := typeSpec.Type.(type) {
	case *ast.StructType, *ast.MapType, *ast.ChanType, *ast.FuncType, *ast.ArrayType:
		fmt.Fprintf(g, "type %s %s\n", typeSpec.Name.Name, g.TypeOf(typeSpec.Type))
	case *ast.Ident:
		fmt.Fprintf(g, "type %s %s\n", typeSpec.Name.Name, t.Name)
	default:
		return fmt.Errorf("can't copy item of type %T", t)
	}

	return nil
}
1098928
func (s *RollbackTrigger) SetType(v string) *RollbackTrigger {
	s.Type = &v
	return s
}
362384
func (q *QueryStringQuery) Type(typ string) *QueryStringQuery {
	q.typ = typ
	return q
}
774082
func (item *MultiGetItem) Type(typ string) *MultiGetItem {
	item.typ = typ
	return item
}
542160
func (s *GitHubCodeDestination) SetType(v string) *GitHubCodeDestination {
	s.Type = &v
	return s
}
107252
func (s *SourceAuth) SetType(v string) *SourceAuth {
	s.Type = &v
	return s
}
1251470
func CopyProperties(source, target interface{}) error {
	if source == nil || target == nil {
		return nil
	}

	return copier.Copy(target, source)

}
1256044
func (s *GetService) Type(typ string) *GetService {
	s.typ = typ
	return s
}
762988
func (s *CreateLayerInput) SetType(v string) *CreateLayerInput {
	s.Type = &v
	return s
}
840503
func (s *GetMappingService) Type(typ ...string) *GetMappingService {
	s.typ = append(s.typ, typ...)
	return s
}
853472
func (q MatchQuery) Type(matchQueryType string) MatchQuery {
	q.matchQueryType = matchQueryType
	return q
}
775869
func (g *genSet) GenerateType(c *generator.Context, t *types.Type, w io.Writer) error {
	sw := generator.NewSnippetWriter(w, c, "$", "$")
	sw.Do(setCode, g.args(t))
	sw.Do("func less$.type|public$(lhs, rhs $.type|raw$) bool {\n", g.args(t))
	g.lessBody(sw, t)
	sw.Do("}\n", g.args(t))
	return sw.Error()
}
815499
func (s *ComputeResource) SetType(v string) *ComputeResource {
	s.Type = &v
	return s
}
948098
func (c *CodecMsgpack) RegisterType(rt reflect.Type, code ExtCode) {
	c.h.(*codec.MsgpackHandle).SetExt(rt, uint64(code), ext{c.ExtCodec})
}
374899
func (r *RepositoryLicense) GetType() string {
	if r == nil || r.Type == nil {
		return ""
	}
	return *r.Type
}
1215466
func (s *Preset) SetType(v string) *Preset {
	s.Type = &v
	return s
}
632862
func Copy(src interface{}) interface{} {
	if src == nil {
		return nil
	}

	// Make the interface a reflect.Value
	original := reflect.ValueOf(src)

	// Make a copy of the same type as the original.
	cpy := reflect.New(original.Type()).Elem()

	// Recursively copy the original.
	copyRecursive(original, cpy)

	// Return the copy as an interface.
	return cpy.Interface()
}