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

package organizations

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

	garm_params "github.com/cloudbase/garm/params"
)

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

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

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

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

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

	for the install org webhook operation.

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

	/* Body.

	   Parameters used when creating the organization webhook.
	*/
	Body garm_params.InstallWebhookParams

	/* OrgID.

	   Organization ID.
	*/
	OrgID string

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

// WithDefaults hydrates default values in the install org webhook params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *InstallOrgWebhookParams) WithDefaults() *InstallOrgWebhookParams {
	o.SetDefaults()
	return o
}

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

// WithTimeout adds the timeout to the install org webhook params
func (o *InstallOrgWebhookParams) WithTimeout(timeout time.Duration) *InstallOrgWebhookParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the install org webhook params
func (o *InstallOrgWebhookParams) SetTimeout(timeout time.Duration) {
	o.timeout = timeout
}

// WithContext adds the context to the install org webhook params
func (o *InstallOrgWebhookParams) WithContext(ctx context.Context) *InstallOrgWebhookParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the install org webhook params
func (o *InstallOrgWebhookParams) SetContext(ctx context.Context) {
	o.Context = ctx
}

// WithHTTPClient adds the HTTPClient to the install org webhook params
func (o *InstallOrgWebhookParams) WithHTTPClient(client *http.Client) *InstallOrgWebhookParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the install org webhook params
func (o *InstallOrgWebhookParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithBody adds the body to the install org webhook params
func (o *InstallOrgWebhookParams) WithBody(body garm_params.InstallWebhookParams) *InstallOrgWebhookParams {
	o.SetBody(body)
	return o
}

// SetBody adds the body to the install org webhook params
func (o *InstallOrgWebhookParams) SetBody(body garm_params.InstallWebhookParams) {
	o.Body = body
}

// WithOrgID adds the orgID to the install org webhook params
func (o *InstallOrgWebhookParams) WithOrgID(orgID string) *InstallOrgWebhookParams {
	o.SetOrgID(orgID)
	return o
}

// SetOrgID adds the orgId to the install org webhook params
func (o *InstallOrgWebhookParams) SetOrgID(orgID string) {
	o.OrgID = orgID
}

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

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

	// path param orgID
	if err := r.SetPathParam("orgID", o.OrgID); err != nil {
		return err
	}

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