// Code generated by go-swagger; DO NOT EDIT.

package saml

// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command

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"
)

// NewPostSLOParams creates a new PostSLOParams object,
// with the default timeout for this client.
//
// Default values are not hydrated, since defaults are normally applied by the API server side.
//
// To enforce default values in parameter, use SetDefaults or WithDefaults.
func NewPostSLOParams() *PostSLOParams {
	return &PostSLOParams{
		timeout: cr.DefaultTimeout,
	}
}

// NewPostSLOParamsWithTimeout creates a new PostSLOParams object
// with the ability to set a timeout on a request.
func NewPostSLOParamsWithTimeout(timeout time.Duration) *PostSLOParams {
	return &PostSLOParams{
		timeout: timeout,
	}
}

// NewPostSLOParamsWithContext creates a new PostSLOParams object
// with the ability to set a context for a request.
func NewPostSLOParamsWithContext(ctx context.Context) *PostSLOParams {
	return &PostSLOParams{
		Context: ctx,
	}
}

// NewPostSLOParamsWithHTTPClient creates a new PostSLOParams object
// with the ability to set a custom HTTPClient for a request.
func NewPostSLOParamsWithHTTPClient(client *http.Client) *PostSLOParams {
	return &PostSLOParams{
		HTTPClient: client,
	}
}

/*
PostSLOParams contains all the parameters to send to the API endpoint

	for the post s l o operation.

	Typically these are written to a http.Request.
*/
type PostSLOParams struct {

	// SAMLRequest.
	SAMLRequest *string

	// SAMLResponse.
	SAMLResponse *string

	timeout    time.Duration
	Context    context.Context
	HTTPClient *http.Client
}

// WithDefaults hydrates default values in the post s l o params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostSLOParams) WithDefaults() *PostSLOParams {
	o.SetDefaults()
	return o
}

// SetDefaults hydrates default values in the post s l o params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *PostSLOParams) SetDefaults() {
	// no default values defined for this parameter
}

// WithTimeout adds the timeout to the post s l o params
func (o *PostSLOParams) WithTimeout(timeout time.Duration) *PostSLOParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the post s l o params
func (o *PostSLOParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the post s l o params
func (o *PostSLOParams) WithContext(ctx context.Context) *PostSLOParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the post s l o params
func (o *PostSLOParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the post s l o params
func (o *PostSLOParams) WithHTTPClient(client *http.Client) *PostSLOParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the post s l o params
func (o *PostSLOParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithSAMLRequest adds the sAMLRequest to the post s l o params
func (o *PostSLOParams) WithSAMLRequest(sAMLRequest *string) *PostSLOParams {
	o.SetSAMLRequest(sAMLRequest)
	return o
}

// SetSAMLRequest adds the sAMLRequest to the post s l o params
func (o *PostSLOParams) SetSAMLRequest(sAMLRequest *string) {
	o.SAMLRequest = sAMLRequest
}

// WithSAMLResponse adds the sAMLResponse to the post s l o params
func (o *PostSLOParams) WithSAMLResponse(sAMLResponse *string) *PostSLOParams {
	o.SetSAMLResponse(sAMLResponse)
	return o
}

// SetSAMLResponse adds the sAMLResponse to the post s l o params
func (o *PostSLOParams) SetSAMLResponse(sAMLResponse *string) {
	o.SAMLResponse = sAMLResponse
}

// WriteToRequest writes these params to a swagger request
func (o *PostSLOParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

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

	if o.SAMLRequest != nil {

		// query param SAMLRequest
		var qrSAMLRequest string

		if o.SAMLRequest != nil {
			qrSAMLRequest = *o.SAMLRequest
		}
		qSAMLRequest := qrSAMLRequest
		if qSAMLRequest != "" {

			if err := r.SetQueryParam("SAMLRequest", qSAMLRequest); err != nil {
				return err
			}
		}
	}

	if o.SAMLResponse != nil {

		// query param SAMLResponse
		var qrSAMLResponse string

		if o.SAMLResponse != nil {
			qrSAMLResponse = *o.SAMLResponse
		}
		qSAMLResponse := qrSAMLResponse
		if qSAMLResponse != "" {

			if err := r.SetQueryParam("SAMLResponse", qSAMLResponse); err != nil {
				return err
			}
		}
	}

	if len(res) > 0 {
		return errors.CompositeValidationError(res...)
	}
	return nil
}
