// AddContentTypes allows to specify specific content types to encode.
// Adds to previous content types.
177347
func AddContentTypes(types ...string) Option {
	return func(c *options) error {
		dst := make([]string, len(c.contentTypes)+len(types))
		copy(dst, c.contentTypes)
		copy(dst[len(c.contentTypes):], types)
		c.contentTypes = dst
		return nil
	}
}
896851
func (f *File) setContentTypePartImageExtensions() {
	var imageTypes = map[string]bool{"jpeg": false, "png": false, "gif": false}
	content := f.contentTypesReader()
	for _, v := range content.Defaults {
		_, ok := imageTypes[v.Extension]
		if ok {
			imageTypes[v.Extension] = true
		}
	}
	for k, v := range imageTypes {
		if !v {
			content.Defaults = append(content.Defaults, xlsxDefault{
				Extension:   k,
				ContentType: "image/" + k,
			})
		}
	}
}
129747
func (r *URIBuilder) ContentType(s string) *URIBuilder {
	r.cacheContentType = s
	return r
}
819513
func (s *UpdateUploadInput) SetContentType(v string) *UpdateUploadInput {
	s.ContentType = &v
	return s
}
1270934
func (ctx *context) ContentType(cType string) {
	if cType == "" {
		return
	}

	// 1. if it's path or a filename or an extension,
	// then take the content type from that
	if strings.Contains(cType, ".") {
		ext := filepath.Ext(cType)
		cType = mime.TypeByExtension(ext)
	}
	// if doesn't contain a charset already then append it
	if !strings.Contains(cType, "charset") {
		if cType != ContentBinaryHeaderValue {
			cType += "; charset=" + ctx.Application().ConfigurationReadOnly().GetCharset()
		}
	}

	ctx.writer.Header().Set(ContentTypeHeaderKey, cType)
}
528849
func (s *CreateModelOutput) SetContentType(v string) *CreateModelOutput {
	s.ContentType = &v
	return s
}
639242
func addKnownTypes(scheme *runtime.Scheme) error {
	scheme.AddKnownTypes(SchemeGroupVersion,
		&ValidatingWebhookConfiguration{},
		&ValidatingWebhookConfigurationList{},
		&MutatingWebhookConfiguration{},
		&MutatingWebhookConfigurationList{},
	)
	return nil
}
542904
func (s *Item) SetContentType(v string) *Item {
	s.ContentType = &v
	return s
}
1228805
func FormatFromContentType(v string) (Format, error) {
	if v == "" {
		return FormatBinary, nil
	}
	mediaType, mediaTypeParams, err := mime.ParseMediaType(v)
	if err != nil {
		return 0, err
	}
	return FormatFromMediaType(mediaType, mediaTypeParams)
}
828805
func (s *SGMailV3) AddContent(c ...*Content) *SGMailV3 {
	s.Content = append(s.Content, c...)
	return s
}
597905
func (s *DocumentVersionMetadata) SetContentType(v string) *DocumentVersionMetadata {
	s.ContentType = &v
	return s
}
891076
func ContentType(ctypes ...string) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		if contentMethod(r.Method) && !checkCT(r.Header.Get("Content-Type"), ctypes...) {
			w.WriteHeader(http.StatusUnsupportedMediaType)
		}
	}
}
960359
func (s *GetJobOutputOutput) SetContentType(v string) *GetJobOutputOutput {
	s.ContentType = &v
	return s
}
895747
func (s *ApplicationCodeConfigurationDescription) SetCodeContentType(v string) *ApplicationCodeConfigurationDescription {
	s.CodeContentType = &v
	return s
}
1180603
func matchesContentType(contentType, expectedType string) bool {
	mimetype, _, err := mime.ParseMediaType(contentType)
	if err != nil {
		logrus.Errorf("Error parsing media type: %s error: %v", contentType, err)
	}
	return err == nil && mimetype == expectedType
}
571349
func ContentTypeIs(typ string, types ...string) RespCondition {
	types = append(types, typ)
	return RespConditionFunc(func(resp *http.Response, ctx *ProxyCtx) bool {
		if resp == nil {
			return false
		}
		contentType := resp.Header.Get("Content-Type")
		for _, typ := range types {
			if contentType == typ || strings.HasPrefix(contentType, typ+";") {
				return true
			}
		}
		return false
	})
}
132423
func addKnownTypes(scheme *runtime.Scheme) error {
	scheme.AddKnownTypes(SchemeGroupVersion,
		&VolumeSnapshot{},
		&VolumeSnapshotList{},
		&VolumeSnapshotData{},
		&VolumeSnapshotDataList{},
	)
	metav1.AddToGroupVersion(scheme, SchemeGroupVersion)
	return nil
}