// SetBody encodes and sets the proper headers for the request body from the
// given resource.  The resource is encoded in-memory, so be careful about
// passing a massive object.  You can set the ContentLength and Body properties
// manually.
331487
func (r *Request) SetBody(mtype *mediatype.MediaType, resource interface{}) error {
	r.MediaType = mtype
	r.Header.Set(ctypeHeader, mtype.String())

	if resource == nil {
		return nil
	}

	buf, err := mtype.Encode(resource)
	if err != nil {
		return err
	}

	r.ContentLength = int64(buf.Len())
	r.Body = ioutil.NopCloser(buf)
	return nil
}
872699
func (s *PutDashboardInput) SetDashboardBody(v string) *PutDashboardInput {
	s.DashboardBody = &v
	return s
}
1150137
func (s *UploadServerCertificateInput) SetCertificateBody(v string) *UploadServerCertificateInput {
	s.CertificateBody = &v
	return s
}
497360
func (s *PutObjectInput) SetBody(v io.ReadSeeker) *PutObjectInput {
	s.Body = v
	return s
}
96276
func (r *Request) SetReaderBody(reader io.ReadSeeker) {
	r.Body = reader
	r.BodyStart, _ = reader.Seek(0, sdkio.SeekCurrent) // Get the Bodies current offset.
	r.ResetBody()
}
1259058
func (s *UploadPartInput) SetBody(v io.ReadSeeker) *UploadPartInput {
	s.Body = v
	return s
}
623666
func (s *UpdateEndpointOutput) SetMessageBody(v *MessageBody) *UpdateEndpointOutput {
	s.MessageBody = v
	return s
}
11972
func (a *FulfillRequestArgs) SetBody(body string) *FulfillRequestArgs {
	a.Body = &body
	return a
}
368453
func (m *DummyMessage) SetBody(newBody string) Message {
	m.body = newBody
	return m
}
239669
func (s *CreateApplicationVersionRequest) SetTemplateBody(v string) *CreateApplicationVersionRequest {
	s.TemplateBody = &v
	return s
}
533730
func (s *GetObjectTorrentOutput) SetBody(v io.ReadCloser) *GetObjectTorrentOutput {
	s.Body = v
	return s
}
823357
func (s *Communication) SetBody(v string) *Communication {
	s.Body = &v
	return s
}
561443
func (r *Request) SetStringBody(s string) {
	r.SetReaderBody(strings.NewReader(s))
}
482354
func (s *MatchmakingRuleSet) SetRuleSetBody(v string) *MatchmakingRuleSet {
	s.RuleSetBody = &v
	return s
}
900421
func (s *RegisterThingInput) SetTemplateBody(v string) *RegisterThingInput {
	s.TemplateBody = &v
	return s
}
1361937
func (s *APNSMessage) SetBody(v string) *APNSMessage {
	s.Body = &v
	return s
}
222814
func (s *DefaultMessage) SetBody(v string) *DefaultMessage {
	s.Body = &v
	return s
}