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

package gateway_service

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

	"git.huangwc.com/pig/pig-farm-controller/internal/infra/transport/lora/chirp_stack_proto/models"
)

// NewGatewayServiceCreateParams creates a new GatewayServiceCreateParams 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 NewGatewayServiceCreateParams() *GatewayServiceCreateParams {
	return &GatewayServiceCreateParams{
		timeout: cr.DefaultTimeout,
	}
}

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

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

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

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

	for the gateway service create operation.

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

	// Body.
	Body *models.APICreateGatewayRequest

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

// WithDefaults hydrates default values in the gateway service create params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *GatewayServiceCreateParams) WithDefaults() *GatewayServiceCreateParams {
	o.SetDefaults()
	return o
}

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

// WithTimeout adds the timeout to the gateway service create params
func (o *GatewayServiceCreateParams) WithTimeout(timeout time.Duration) *GatewayServiceCreateParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the gateway service create params
func (o *GatewayServiceCreateParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the gateway service create params
func (o *GatewayServiceCreateParams) WithContext(ctx context.Context) *GatewayServiceCreateParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the gateway service create params
func (o *GatewayServiceCreateParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the gateway service create params
func (o *GatewayServiceCreateParams) WithHTTPClient(client *http.Client) *GatewayServiceCreateParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the gateway service create params
func (o *GatewayServiceCreateParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithBody adds the body to the gateway service create params
func (o *GatewayServiceCreateParams) WithBody(body *models.APICreateGatewayRequest) *GatewayServiceCreateParams {
	o.SetBody(body)
	return o
}

// SetBody adds the body to the gateway service create params
func (o *GatewayServiceCreateParams) SetBody(body *models.APICreateGatewayRequest) {
	o.Body = body
}

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

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

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