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

// (c) 2012-2020 by Taxnexus, Inc.
// All rights reserved worldwide.
// Proprietary product; unlicensed use is not allowed

package portal_memberships

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

// NewDeleteTenantMembershipParams creates a new DeleteTenantMembershipParams 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 NewDeleteTenantMembershipParams() *DeleteTenantMembershipParams {
	return NewDeleteTenantMembershipParamsWithTimeout(cr.DefaultTimeout)
}

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

// NewDeleteTenantMembershipParamsWithContext creates a new DeleteTenantMembershipParams object
// with the ability to set a context for a request.
//
// Deprecated: use the operation call with context to pass the context instead of [DeleteTenantMembershipParams].
func NewDeleteTenantMembershipParamsWithContext(ctx context.Context) *DeleteTenantMembershipParams {
	return &DeleteTenantMembershipParams{
		inner: innerParams{
			ctx: ctx,
		},
	}
}

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

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

	for the delete tenant membership operation.

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

	// XRequestID.
	//
	// Optional bounded correlation identifier stored with membership audit events.
	XRequestID *string

	// LastModifiedDate.
	//
	// Optimistic concurrency token from the latest representation.
	//
	// Format: date-time
	LastModifiedDate strfmt.DateTime

	// MembershipID.
	//
	// Format: uuid
	MembershipID strfmt.UUID

	HTTPClient *http.Client

	inner innerParams
}

// WithDefaults hydrates default values in the delete tenant membership params (not the query body).
//
// All values with no default are reset to their zero value.
func (o *DeleteTenantMembershipParams) WithDefaults() *DeleteTenantMembershipParams {
	o.SetDefaults()
	return o
}

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

// WithTimeout adds the timeout to the delete tenant membership params.
func (o *DeleteTenantMembershipParams) WithTimeout(timeout time.Duration) *DeleteTenantMembershipParams {
	o.SetTimeout(timeout)
	return o
}

// SetTimeout adds the timeout to the delete tenant membership params.
func (o *DeleteTenantMembershipParams) SetTimeout(timeout time.Duration) {
	o.inner.timeout = timeout
}

// WithContext adds the context to the delete tenant membership params.
//
// Deprecated: use the operation call with context to pass the context instead of [DeleteTenantMembershipParams].
func (o *DeleteTenantMembershipParams) WithContext(ctx context.Context) *DeleteTenantMembershipParams {
	o.SetContext(ctx)
	return o
}

// SetContext adds the context to the delete tenant membership params.
//
// Deprecated: use the operation call with context to pass the context instead of [DeleteTenantMembershipParams].
func (o *DeleteTenantMembershipParams) SetContext(ctx context.Context) {
	o.inner.ctx = ctx
}

// WithHTTPClient adds the HTTPClient to the delete tenant membership params.
func (o *DeleteTenantMembershipParams) WithHTTPClient(client *http.Client) *DeleteTenantMembershipParams {
	o.SetHTTPClient(client)
	return o
}

// SetHTTPClient adds the HTTPClient to the delete tenant membership params.
func (o *DeleteTenantMembershipParams) SetHTTPClient(client *http.Client) {
	o.HTTPClient = client
}

// WithXRequestID adds the xRequestID to the delete tenant membership params.
func (o *DeleteTenantMembershipParams) WithXRequestID(xRequestID *string) *DeleteTenantMembershipParams {
	o.SetXRequestID(xRequestID)
	return o
}

// SetXRequestID adds the xRequestId to the delete tenant membership params.
func (o *DeleteTenantMembershipParams) SetXRequestID(xRequestID *string) {
	o.XRequestID = xRequestID
}

// WithLastModifiedDate adds the lastModifiedDate to the delete tenant membership params.
func (o *DeleteTenantMembershipParams) WithLastModifiedDate(lastModifiedDate strfmt.DateTime) *DeleteTenantMembershipParams {
	o.SetLastModifiedDate(lastModifiedDate)
	return o
}

// SetLastModifiedDate adds the lastModifiedDate to the delete tenant membership params.
func (o *DeleteTenantMembershipParams) SetLastModifiedDate(lastModifiedDate strfmt.DateTime) {
	o.LastModifiedDate = lastModifiedDate
}

// WithMembershipID adds the membershipID to the delete tenant membership params.
func (o *DeleteTenantMembershipParams) WithMembershipID(membershipID strfmt.UUID) *DeleteTenantMembershipParams {
	o.SetMembershipID(membershipID)
	return o
}

// SetMembershipID adds the membershipId to the delete tenant membership params.
func (o *DeleteTenantMembershipParams) SetMembershipID(membershipID strfmt.UUID) {
	o.MembershipID = membershipID
}

// WriteToRequest writes these params to a [runtime.ClientRequest].
func (o *DeleteTenantMembershipParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
	if err := r.SetTimeout(o.inner.timeout); err != nil {
		return err
	}
	var res []error

	if o.XRequestID != nil {

		// header param X-Request-ID
		if err := r.SetHeaderParam("X-Request-ID", *o.XRequestID); err != nil {
			return err
		}
	}

	// query param lastModifiedDate
	qrLastModifiedDate := o.LastModifiedDate
	qLastModifiedDate := qrLastModifiedDate.String()
	if qLastModifiedDate != "" {

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

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

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