// NewUserTypesWriter returns a contexts code writer.
// User types contain custom data structured defined in the DSL with "Type".
773602
func NewUserTypesWriter(filename string) (*UserTypesWriter, error) {
	file, err := codegen.SourceFileFor(filename)
	if err != nil {
		return nil, err
	}
	return &UserTypesWriter{
		SourceFile: file,
		Finalizer:  codegen.NewFinalizer(),
		Validator:  codegen.NewValidator(),
	}, nil
}
21272
func NewWriter(w io.Writer) *Writer {
	if wr, ok := w.(*Writer); ok {
		return wr
	}
	return &Writer{
		w:   w,
		buf: make([]byte, 0, DefaultWriterSize),
	}
}
933195
func NewWriter(w io.Writer, h *sam.Header, wc int) (*Writer, error) {
	return NewWriterLevel(w, h, gzip.DefaultCompression, wc)
}
976993
func NewUserCustomQuotaResult(User *UserSelectorArg) *UserCustomQuotaResult {
	s := new(UserCustomQuotaResult)
	s.User = User
	return s
}
660984
func NewPaperFolderChangeSubscriptionType(Description string) *PaperFolderChangeSubscriptionType {
	s := new(PaperFolderChangeSubscriptionType)
	s.Description = Description
	return s
}
42586
func NewControllersWriter(filename string) (*ControllersWriter, error) {
	file, err := codegen.SourceFileFor(filename)
	if err != nil {
		return nil, err
	}
	return &ControllersWriter{
		SourceFile: file,
		Finalizer:  codegen.NewFinalizer(),
		Validator:  codegen.NewValidator(),
	}, nil
}
1182420
func NewWriter(w io.Writer, width int, flag uint) *Writer {
	return &Writer{
		w:     w,
		width: width,
		flag:  flag,
	}
}
543250
func (a *APIDefinition) IterateUserTypes(it UserTypeIterator) error {
	names := make([]string, len(a.Types))
	i := 0
	for n := range a.Types {
		names[i] = n
		i++
	}
	sort.Strings(names)
	for _, n := range names {
		if err := it(a.Types[n]); err != nil {
			return err
		}
	}
	return nil
}
54942
func NewWriter(w io.Writer) *Writer {
	enc := New()
	return &Writer{e: *enc, w: csv.NewWriter(w)}
}
1014640
func NewUsersController(service *goa.Service, db application.DB, config UsersControllerConfiguration) *UsersController {
	return &UsersController{
		Controller: service.NewController("UsersController"),
		db:         db,
		config:     config,
	}
}
680087
func NewAppUnlinkUserType(Description string) *AppUnlinkUserType {
	s := new(AppUnlinkUserType)
	s.Description = Description
	return s
}
977574
func NewWriter(w io.Writer, h *Header, flags int) (*Writer, error) {
	if flags < FlagDecimal || flags > FlagString {
		return nil, errors.New("bam: flag format option out of range")
	}
	sw := &Writer{w: w, flags: flags}
	text, _ := h.MarshalText()
	_, err := w.Write(text)
	if err != nil {
		return nil, err
	}
	return sw, nil
}
312469
func NewWriter(w io.Writer) *Writer {
	return &Writer{
		w:         multipart.NewWriter(w),
		firstPart: false,
		rootPart:  false,
	}
}
1248700
func NewUserProfileService(context servicecontext.ServiceContext) service.UserProfileService {
	return &userProfileService{
		client: http.DefaultClient,
	}
}
475781
func NewUserGenerator(seed int64) *UserGenerator {
	return &UserGenerator{
		g: gen.NewGenerator(seed),
		r: rand.New(rand.NewSource(seed)),
	}
}
291706
func NewLoginSuccessType(Description string) *LoginSuccessType {
	s := new(LoginSuccessType)
	s.Description = Description
	return s
}
94499
func NewTypesMigrator(client WorkflowClient, registerDomains []RegisterDomain, deprecateDomains []DeprecateDomain, registerWorkflows []RegisterWorkflowType, deprecateWorkflows []DeprecateWorkflowType, registerActivities []RegisterActivityType, deprecateActivities []DeprecateActivityType) *TypesMigrator {
	return &TypesMigrator{
		DomainMigrator: &DomainMigrator{
			RegisteredDomains: registerDomains, DeprecatedDomains: deprecateDomains, Client: client,
		},
		WorkflowTypeMigrator: &WorkflowTypeMigrator{
			RegisteredWorkflowTypes: registerWorkflows, DeprecatedWorkflowTypes: deprecateWorkflows, Client: client,
		},
		ActivityTypeMigrator: &ActivityTypeMigrator{
			RegisteredActivityTypes: registerActivities, DeprecatedActivityTypes: deprecateActivities, Client: client,
		},
	}
}