// NewFileRequestCloseType returns a new FileRequestCloseType instance
960307
func NewFileRequestCloseType(Description string) *FileRequestCloseType {
	s := new(FileRequestCloseType)
	s.Description = Description
	return s
}
299935
func (c *Codec) NewRequest(r *http.Request) rpc.CodecRequest {
	return newCodecRequest(r, c.encSel.Select(r), c.errorMapper)
}
1226712
func NewFileChangeCommentSubscriptionType(Description string) *FileChangeCommentSubscriptionType {
	s := new(FileChangeCommentSubscriptionType)
	s.Description = Description
	return s
}
536325
func NewFileRequestsEmailsRestrictedToTeamOnlyType(Description string) *FileRequestsEmailsRestrictedToTeamOnlyType {
	s := new(FileRequestsEmailsRestrictedToTeamOnlyType)
	s.Description = Description
	return s
}
1372882
func NewUpdateFileRequestArgs(Id string) *UpdateFileRequestArgs {
	s := new(UpdateFileRequestArgs)
	s.Id = Id
	s.Deadline = &UpdateFileRequestDeadline{Tagged: dropbox.Tagged{"no_update"}}
	return s
}
736418
func NewFilePermanentlyDeleteType(Description string) *FilePermanentlyDeleteType {
	s := new(FilePermanentlyDeleteType)
	s.Description = Description
	return s
}
79993
func (c *Client) NewRequest(urlStr string) (req *Request, err error) {
	req, err = newRequest(c, urlStr)
	if err != nil {
		return
	}

	c.applyRequestHeaders(req)

	return
}
320105
func NewUploadRequest(application, name, filename string, r io.ReadSeeker) (UploadRequest, error) {
	if !names.IsValidApplication(application) {
		return UploadRequest{}, errors.Errorf("invalid application %q", application)
	}

	content, err := resource.GenerateContent(r)
	if err != nil {
		return UploadRequest{}, errors.Trace(err)
	}

	ur := UploadRequest{
		Application: application,
		Name:        name,
		Filename:    filename,
		Size:        content.Size,
		Fingerprint: content.Fingerprint,
	}
	return ur, nil
}
72490
func NewFileDownloadType(Description string) *FileDownloadType {
	s := new(FileDownloadType)
	s.Description = Description
	return s
}
661476
func NewFileRequestDeadline(Deadline time.Time) *FileRequestDeadline {
	s := new(FileRequestDeadline)
	s.Deadline = Deadline
	return s
}
1043836
func (o *UploadTaskFileParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

	if err := r.SetTimeout(o.timeout); err != nil {
		return err
	}
	var res []error

	if o.Description != nil {

		// form param description
		var frDescription string
		if o.Description != nil {
			frDescription = *o.Description
		}
		fDescription := frDescription
		if fDescription != "" {
			if err := r.SetFormParam("description", fDescription); err != nil {
				return err
			}
		}

	}

	if o.File != nil {

		if o.File != nil {

			// form file param file
			if err := r.SetFileParam("file", o.File); err != nil {
				return err
			}

		}

	}

	// path param id
	if err := r.SetPathParam("id", swag.FormatInt64(o.ID)); err != nil {
		return err
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
465503
func NewFileCloser(path string) (*FileCloser, error) {
	ff, err := os.Open(path)

	if err != nil {
		return nil, err
	}

	return &FileCloser{ff, path}, nil
}
1344982
func NewFileRequestChangeDetails(NewDetails *FileRequestDetails) *FileRequestChangeDetails {
	s := new(FileRequestChangeDetails)
	s.NewDetails = NewDetails
	return s
}
873527
func (c *Client) newRequest(method Method, endpoint string) *Request {
	req := &Request{
		Method:  method,
		URL:     resourceURL(c.BaseURL(), endpoint),
		Headers: http.Header(make(map[string][]string)),
	}

	// Copy over the headers. Don't set them directly to ensure changing
	// them on the request doesn't change them on the client.
	for k, vv := range c.Headers {
		for _, v := range vv {
			req.Headers.Add(k, v)
		}
	}

	return req
}
300311
func NewRequest() *Request {
	r := &Request{
		invocationChainMapping: make(map[int][]InvocationChain),
		queryMapping:           make(map[discovery.QueryType]map[string]int),
		Request:                &discovery.Request{},
	}
	// pre-populate types
	for _, queryType := range configTypes {
		r.queryMapping[queryType] = make(map[string]int)
	}
	return r
}
1127822
func (c *Client) NewRequest(method Method, endpoint string, ctype string, body io.Reader) (req *Request) {
	req = c.newRequest(method, endpoint)
	if body == nil {
		return
	}

	req.prepare = func(hr *http.Request) error {
		rc, ok := body.(io.ReadCloser)
		if !ok {
			rc = ioutil.NopCloser(body)
		}
		hr.Body = rc
		hr.Header.Set("Content-Type", ctype)
		return nil
	}
	return
}
1006378
func NewPaperDocDownloadType(Description string) *PaperDocDownloadType {
	s := new(PaperDocDownloadType)
	s.Description = Description
	return s
}