// PutKey returns an http.Handler that can set a value for the key registered by Gorilla
// mux as "key" in the path. It expects the value to be in the body of the PUT request
166159
func PutKey(db storage.DB) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		key := r.URL.Query().Get("key")
		if key == "" {
			http.Error(w, "missing key name in path", http.StatusBadRequest)
			return
		}
		defer r.Body.Close()
		val, err := ioutil.ReadAll(r.Body)
		if err != nil {
			http.Error(w, "error reading PUT body", http.StatusBadRequest)
			return
		}
		if err := db.Set(key, val); err != nil {
			http.Error(w, "error setting value in DB", http.StatusInternalServerError)
			return
		}
		w.WriteHeader(http.StatusOK)
	})
}
1172775
func (s *ObjectIdentifier) SetKey(v string) *ObjectIdentifier {
	s.Key = &v
	return s
}
99734
func (s *Field) SetKey(v string) *Field {
	s.Key = &v
	return s
}
746454
func (s *GetObjectInput) SetKey(v string) *GetObjectInput {
	s.Key = &v
	return s
}
137136
func (s *UploadPartInput) SetKey(v string) *UploadPartInput {
	s.Key = &v
	return s
}
738445
func (s *CopyObjectInput) SetKey(v string) *CopyObjectInput {
	s.Key = &v
	return s
}
246413
func (s *PutObjectRetentionInput) SetKey(v string) *PutObjectRetentionInput {
	s.Key = &v
	return s
}
1311673
func (s *ParametersFilter) SetKey(v string) *ParametersFilter {
	s.Key = &v
	return s
}
923290
func (s *PutObjectTaggingInput) SetKey(v string) *PutObjectTaggingInput {
	s.Key = &v
	return s
}
607435
func (s *HeadObjectInput) SetKey(v string) *HeadObjectInput {
	s.Key = &v
	return s
}
1109608
func (s *SessionFilter) SetKey(v string) *SessionFilter {
	s.Key = &v
	return s
}
59300
func (s *CompleteMultipartUploadInput) SetKey(v string) *CompleteMultipartUploadInput {
	s.Key = &v
	return s
}
1306254
func (s *CommandFilter) SetKey(v string) *CommandFilter {
	s.Key = &v
	return s
}
1257595
func (s *TagOptionDetail) SetKey(v string) *TagOptionDetail {
	s.Key = &v
	return s
}
51
func (s *GetObjectLegalHoldInput) SetKey(v string) *GetObjectLegalHoldInput {
	s.Key = &v
	return s
}
1277405
func (s *DocumentKeyValuesFilter) SetKey(v string) *DocumentKeyValuesFilter {
	s.Key = &v
	return s
}
222289
func (s *HlsContentProtection) SetKey(v string) *HlsContentProtection {
	s.Key = &v
	return s
}