func (o *UploadSampleV2Params) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
	if err := r.SetTimeout(o.timeout); err != nil {
		return err
	}
	var res []error
	if o.Comment != nil {
		var frComment string
		if o.Comment != nil {
			frComment = *o.Comment
		}
		fComment := frComment
		if fComment != "" {
			if err := r.SetFormParam("comment", fComment); err != nil {
				return err
			}
		}
	}
	frFileName := o.FileName
	fFileName := frFileName
	if fFileName != "" {
		if err := r.SetFormParam("file_name", fFileName); err != nil {
			return err
		}
	}
	if o.IsConfidential != nil {
		var frIsConfidential bool
		if o.IsConfidential != nil {
			frIsConfidential = *o.IsConfidential
		}
		fIsConfidential := swag.FormatBool(frIsConfidential)
		if fIsConfidential != "" {
			if err := r.SetFormParam("is_confidential", fIsConfidential); err != nil {
				return err
			}
		}
	}
	if err := r.SetFileParam("sample", o.Sample); err != nil {
		return err
	}
	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
WriteToRequest writes these params to a swagger request
package falconx_sandbox
import (
	"context"
	"net/http"
	"time"
	"github.com/go-openapi/errors"
	"github.com/go-openapi/runtime"
	cr "github.com/go-openapi/runtime/client"
	"github.com/go-openapi/strfmt"
	"github.com/go-openapi/swag"
)
func NewUploadSampleV2Params() *UploadSampleV2Params {
	return &UploadSampleV2Params{
		timeout: cr.DefaultTimeout,
	}
}
func NewUploadSampleV2ParamsWithTimeout(timeout time.Duration) *UploadSampleV2Params {
	return &UploadSampleV2Params{
		timeout: timeout,
	}
}
func NewUploadSampleV2ParamsWithContext(ctx context.Context) *UploadSampleV2Params {
	return &UploadSampleV2Params{
		Context: ctx,
	}
}
func NewUploadSampleV2ParamsWithHTTPClient(client *http.Client) *UploadSampleV2Params {
	return &UploadSampleV2Params{
		HTTPClient: client,
	}
}
type UploadSampleV2Params struct {
	Comment *string
	FileName string
	IsConfidential *bool
	Sample runtime.NamedReadCloser
	timeout    time.Duration
	Context    context.Context
	HTTPClient *http.Client
}
func (o *UploadSampleV2Params) WithDefaults() *UploadSampleV2Params {
	o.SetDefaults()
	return o
}
func (o *UploadSampleV2Params) SetDefaults() {
	var (
		isConfidentialDefault = bool(true)
	)
	val := UploadSampleV2Params{
		IsConfidential: &isConfidentialDefault,
	}
	val.timeout = o.timeout
	val.Context = o.Context
	val.HTTPClient = o.HTTPClient
	*o = val
}
func (o *UploadSampleV2Params) WithTimeout(timeout time.Duration) *UploadSampleV2Params {
	o.SetTimeout(timeout)
	return o
}
func (o *UploadSampleV2Params) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}
func (o *UploadSampleV2Params) WithContext(ctx context.Context) *UploadSampleV2Params {
	o.SetContext(ctx)
	return o
}
func (o *UploadSampleV2Params) SetContext(ctx context.Context) {
	o.Context = ctx
}
func (o *UploadSampleV2Params) WithHTTPClient(client *http.Client) *UploadSampleV2Params {
	o.SetHTTPClient(client)
	return o
}
func (o *UploadSampleV2Params) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}
func (o *UploadSampleV2Params) WithComment(comment *string) *UploadSampleV2Params {
	o.SetComment(comment)
	return o
}
func (o *UploadSampleV2Params) SetComment(comment *string) {
	o.Comment = comment
}
func (o *UploadSampleV2Params) WithFileName(fileName string) *UploadSampleV2Params {
	o.SetFileName(fileName)
	return o
}
func (o *UploadSampleV2Params) SetFileName(fileName string) {
	o.FileName = fileName
}
func (o *UploadSampleV2Params) WithIsConfidential(isConfidential *bool) *UploadSampleV2Params {
	o.SetIsConfidential(isConfidential)
	return o
}
func (o *UploadSampleV2Params) SetIsConfidential(isConfidential *bool) {
	o.IsConfidential = isConfidential
}
func (o *UploadSampleV2Params) WithSample(sample runtime.NamedReadCloser) *UploadSampleV2Params {
	o.SetSample(sample)
	return o
}
func (o *UploadSampleV2Params) SetSample(sample runtime.NamedReadCloser) {
	o.Sample = sample
}