func (c Client) Get(id string, params *stripe.FileUploadParams) (*stripe.FileUpload, error) { var body *stripe.RequestValues var commonParams *stripe.Params if params != nil { commonParams = ¶ms.Params body = &stripe.RequestValues{} params.AppendTo(body) } upload := &stripe.FileUpload{} err := c.B.Call("GET", "/files/"+id, c.Key, body, commonParams, upload) return upload, err }
func (c Client) New(params *stripe.FileUploadParams) (*stripe.FileUpload, error) { if params == nil { return nil, fmt.Errorf("params cannot be nil, and params.Purpose and params.File must be set") } body := &bytes.Buffer{} boundary, err := params.AppendDetails(body) if err != nil { return nil, err } upload := &stripe.FileUpload{} err = c.B.CallMultipart("POST", "/files", c.Key, boundary, body, ¶ms.Params, upload) return upload, err }