// ExtractType returns the first found TypeOption from the
// given variadic arguments or nil otherwise.
501144
func ExtractType(opts ...interface{}) *opt.TypeOption {
	for _, o := range opts {
		if v, ok := o.(*opt.TypeOption); ok {
			return v
		}
	}
	return nil
}
346132
func ExtractFilters(opts ...interface{}) *opt.FiltersOption {
	for _, o := range opts {
		if v, ok := o.(*opt.FiltersOption); ok {
			return v
		}
	}
	return nil
}
1229252
func ExtractSafe(opts ...interface{}) *opt.SafeOption {
	for _, o := range opts {
		if v, ok := o.(*opt.SafeOption); ok {
			return v
		}
	}
	return nil
}
1022297
func (mr *MockExtractorMockRecorder) Extract(arg0 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Extract", reflect.TypeOf((*MockExtractor)(nil).Extract), arg0)
}
294219
func ExtractAllowCompressionOfIntegerArray(opts ...interface{}) *opt.AllowCompressionOfIntegerArrayOption {
	for _, o := range opts {
		if v, ok := o.(*opt.AllowCompressionOfIntegerArrayOption); ok {
			return v
		}
	}
	return nil
}
1370449
func (r *BulkIndexRequest) Type(typ string) *BulkIndexRequest {
	r.typ = typ
	r.source = nil
	return r
}
869597
func (s *Script) Type(typ string) *Script {
	s.typ = typ
	return s
}
227716
func (e *extractor) Extract(tarballPath string) (ExtractedStemcell, error) {
	tmpDir, err := e.fs.TempDir("stemcell-manager")
	if err != nil {
		return nil, bosherr.WrapError(err, "creating temp dir for stemcell extraction")
	}

	stemcell, err := e.reader.Read(tarballPath, tmpDir)
	if err != nil {
		_ = e.fs.RemoveAll(tmpDir)
		return nil, bosherr.WrapErrorf(err, "reading extracted stemcell manifest in '%s'", tmpDir)
	}

	return stemcell, nil
}
833221
func extractFile(tarball *tar.Reader, header *tar.Header, dir string) error {
	switch header.Typeflag {
	case tar.TypeDir:
		return withDir(filepath.Join(dir, header.Name), nil)
	case tar.TypeBlock, tar.TypeChar, tar.TypeReg, tar.TypeRegA, tar.TypeFifo:
		return writeFile(filepath.Join(dir, header.Name), tarball, header.FileInfo().Mode())
	case tar.TypeLink:
		return writeHardLink(filepath.Join(dir, header.Name), filepath.Join(dir, header.Linkname))
	case tar.TypeSymlink:
		return writeSymbolicLink(filepath.Join(dir, header.Name), header.Linkname)
	default:
		log.Warnf("Unsupported type flag %v for %v.", header.Typeflag, header.Name)
	}
	return nil
}
295591
func (r *BulkUpdateRequest) Type(typ string) *BulkUpdateRequest {
	r.typ = typ
	r.source = nil
	return r
}
591066
func extractArray(intf interface{}) ([]interface{}, error) {
	if intf != nil {
		list, ok := intf.([]interface{})
		if ok {
			return list, nil
		}
		l, ok := intf.([]map[string]interface{})
		if !ok {
			return nil, fmt.Errorf("invalid configuration: neither []interface{} nor []map[string]interface{}")
		}
		list = make([]interface{}, 0, len(l))
		for _, m := range l {
			list = append(list, m)
		}
		return list, nil
	}
	return nil, nil
}
1339502
func (s *IndicesGetMappingService) Type(types ...string) *IndicesGetMappingService {
	s.typ = append(s.typ, types...)
	return s
}
173789
func (s *ValidateService) Type(typ ...string) *ValidateService {
	s.typ = append(s.typ, typ...)
	return s
}
1059053
func ExtractAllowTyposOnNumericTokens(opts ...interface{}) *opt.AllowTyposOnNumericTokensOption {
	for _, o := range opts {
		if v, ok := o.(*opt.AllowTyposOnNumericTokensOption); ok {
			return v
		}
	}
	return nil
}
682473
func extractTypeName(tip string) string {
	// trim all spaces
	tip = strings.TrimSpace(tip)

	// detect array
	if strings.Index(tip, "]") < 0 {
		return tip
	}

	// find type inside square bracket
	inBracket := reSquareBracket.FindString(tip)
	if inBracket == "" {
		return tip
	}
	last := strings.LastIndex(inBracket, "[")
	inBracket = inBracket[last+1:]
	return strings.TrimSuffix(inBracket, "]")
}
437230
func (s *ScriptSort) Type(typ string) *ScriptSort {
	s.typ = typ
	return s
}
374899
func (r *RepositoryLicense) GetType() string {
	if r == nil || r.Type == nil {
		return ""
	}
	return *r.Type
}