// NewResponseWithBodyAndStatus instantiates a new response using the specified mock body,
// status and status code
490427
func NewResponseWithBodyAndStatus(body *Body, c int, s string) *http.Response {
	resp := NewResponse()
	resp.Body = body
	resp.ContentLength = body.Length()
	resp.Status = s
	resp.StatusCode = c
	return resp
}
348095
func ResponseBody(res *http.Response) ([]byte, error) {
	defer res.Body.Close()
	contents, err := ioutil.ReadAll(res.Body)
	if err != nil {
		return []byte{}, err
	}
	return contents, nil
}
1281567
func newStreamResponseBodyReader(body io.Reader) *streamResponseBodyReader {
	return &streamResponseBodyReader{reader: bufio.NewReader(body)}
}
503836
func NewResponse(r *Request) *Response {
	return &Response{
		Version: r.Version,
		ID:      r.ID,
	}
}
1096713
func NewBytesResponder(status int, body []byte) Responder {
	return ResponderFromResponse(NewBytesResponse(status, body))
}
1192775
func (q *StreamHealthQueryService) AddHealthResponseWithNotServing() {
	q.healthResponses <- &querypb.StreamHealthResponse{
		Target:  proto.Clone(&q.target).(*querypb.Target),
		Serving: false,
		RealtimeStats: &querypb.RealtimeStats{
			SecondsBehindMaster: DefaultSecondsBehindMaster,
		},
	}
}
646603
func (c *SCSICmd) RespondStatus(status byte) SCSIResponse {
	return SCSIResponse{
		id:     c.id,
		status: status,
	}
}
170042
func ReadResponseBody(response *http.Response) ([]byte, error) {
	defer response.Body.Close()
	return ioutil.ReadAll(response.Body)
}
223190
func NewGetResponse(
	key string,
	status ResponseStatus,
	flags uint32,
	value []byte,
	version uint64) GetResponse {

	resp := &genericResponse{
		status:        status,
		allowNotFound: true,
	}
	resp.item.Key = key
	if status == StatusNoError {
		if value == nil {
			resp.item.Value = []byte{}
		} else {
			resp.item.Value = value
		}
		resp.item.Flags = flags
		resp.item.DataVersionId = version
	}
	return resp
}
955137
func newResponse(r *http.Response) *Response {
	body, err := ioutil.ReadAll(r.Body)
	if err != nil {
		body = []byte(`Error reading body:` + err.Error())
	}

	return &Response{r, body}
}
306710
func (o *UpdateOAuth2ClientParams) WithBody(body *models.Client) *UpdateOAuth2ClientParams {
	o.SetBody(body)
	return o
}
8561
func (builder *UpdateMapCommandBuilder) WithReturnBody(returnBody bool) *UpdateMapCommandBuilder {
	builder.protobuf.ReturnBody = &returnBody
	return builder
}
21015
func (this *FcmResponseStatus) parseStatusBody(body []byte) error {

	if err := json.Unmarshal([]byte(body), &this); err != nil {
		return err
	}
	return nil

}
1293468
func (o *PetUpdateParams) WithBody(body *models.Pet) *PetUpdateParams {
	o.SetBody(body)
	return o
}
915257
func newResponse(r *http.Response) *Response {
	body, _ := ioutil.ReadAll(r.Body)
	response := &Response{
		Status: r.Status,
		StatusCode: r.StatusCode,
		Body: string(body),
		ContentLength: r.ContentLength,
		}
	return response
}
718962
func NewResponse(query, host string) *Response {
	return &Response{
		Query:     query,
		Host:      host,
		FetchedAt: time.Now().UTC(),
		MediaType: "text/plain",
		Charset:   "utf-8",
	}
}
445208
func (d *domainClient) SearchInResponseBody(ctx context.Context, args *SearchInResponseBodyArgs) (reply *SearchInResponseBodyReply, err error) {
	reply = new(SearchInResponseBodyReply)
	if args != nil {
		err = rpcc.Invoke(ctx, "Network.searchInResponseBody", args, reply, d.conn)
	} else {
		err = rpcc.Invoke(ctx, "Network.searchInResponseBody", nil, reply, d.conn)
	}
	if err != nil {
		err = &internal.OpError{Domain: "Network", Op: "SearchInResponseBody", Err: err}
	}
	return
}