168 lines
4.5 KiB
Go
168 lines
4.5 KiB
Go
// Code generated by go-swagger; DO NOT EDIT.
|
|
|
|
// (c) 2012-2023 by Vernon Keenan
|
|
// All rights reserved worldwide.
|
|
// Proprietary product; unlicensed use is not allowed
|
|
|
|
package contracts
|
|
|
|
// 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"
|
|
)
|
|
|
|
// NewDeleteContractParams creates a new DeleteContractParams 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 NewDeleteContractParams() *DeleteContractParams {
|
|
return &DeleteContractParams{
|
|
timeout: cr.DefaultTimeout,
|
|
}
|
|
}
|
|
|
|
// NewDeleteContractParamsWithTimeout creates a new DeleteContractParams object
|
|
// with the ability to set a timeout on a request.
|
|
func NewDeleteContractParamsWithTimeout(timeout time.Duration) *DeleteContractParams {
|
|
return &DeleteContractParams{
|
|
timeout: timeout,
|
|
}
|
|
}
|
|
|
|
// NewDeleteContractParamsWithContext creates a new DeleteContractParams object
|
|
// with the ability to set a context for a request.
|
|
func NewDeleteContractParamsWithContext(ctx context.Context) *DeleteContractParams {
|
|
return &DeleteContractParams{
|
|
Context: ctx,
|
|
}
|
|
}
|
|
|
|
// NewDeleteContractParamsWithHTTPClient creates a new DeleteContractParams object
|
|
// with the ability to set a custom HTTPClient for a request.
|
|
func NewDeleteContractParamsWithHTTPClient(client *http.Client) *DeleteContractParams {
|
|
return &DeleteContractParams{
|
|
HTTPClient: client,
|
|
}
|
|
}
|
|
|
|
/*
|
|
DeleteContractParams contains all the parameters to send to the API endpoint
|
|
|
|
for the delete contract operation.
|
|
|
|
Typically these are written to a http.Request.
|
|
*/
|
|
type DeleteContractParams struct {
|
|
|
|
/* ContractID.
|
|
|
|
Contact record ID
|
|
*/
|
|
ContractID *string
|
|
|
|
timeout time.Duration
|
|
Context context.Context
|
|
HTTPClient *http.Client
|
|
}
|
|
|
|
// WithDefaults hydrates default values in the delete contract params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *DeleteContractParams) WithDefaults() *DeleteContractParams {
|
|
o.SetDefaults()
|
|
return o
|
|
}
|
|
|
|
// SetDefaults hydrates default values in the delete contract params (not the query body).
|
|
//
|
|
// All values with no default are reset to their zero value.
|
|
func (o *DeleteContractParams) SetDefaults() {
|
|
// no default values defined for this parameter
|
|
}
|
|
|
|
// WithTimeout adds the timeout to the delete contract params
|
|
func (o *DeleteContractParams) WithTimeout(timeout time.Duration) *DeleteContractParams {
|
|
o.SetTimeout(timeout)
|
|
return o
|
|
}
|
|
|
|
// SetTimeout adds the timeout to the delete contract params
|
|
func (o *DeleteContractParams) SetTimeout(timeout time.Duration) {
|
|
o.timeout = timeout
|
|
}
|
|
|
|
// WithContext adds the context to the delete contract params
|
|
func (o *DeleteContractParams) WithContext(ctx context.Context) *DeleteContractParams {
|
|
o.SetContext(ctx)
|
|
return o
|
|
}
|
|
|
|
// SetContext adds the context to the delete contract params
|
|
func (o *DeleteContractParams) SetContext(ctx context.Context) {
|
|
o.Context = ctx
|
|
}
|
|
|
|
// WithHTTPClient adds the HTTPClient to the delete contract params
|
|
func (o *DeleteContractParams) WithHTTPClient(client *http.Client) *DeleteContractParams {
|
|
o.SetHTTPClient(client)
|
|
return o
|
|
}
|
|
|
|
// SetHTTPClient adds the HTTPClient to the delete contract params
|
|
func (o *DeleteContractParams) SetHTTPClient(client *http.Client) {
|
|
o.HTTPClient = client
|
|
}
|
|
|
|
// WithContractID adds the contractID to the delete contract params
|
|
func (o *DeleteContractParams) WithContractID(contractID *string) *DeleteContractParams {
|
|
o.SetContractID(contractID)
|
|
return o
|
|
}
|
|
|
|
// SetContractID adds the contractId to the delete contract params
|
|
func (o *DeleteContractParams) SetContractID(contractID *string) {
|
|
o.ContractID = contractID
|
|
}
|
|
|
|
// WriteToRequest writes these params to a swagger request
|
|
func (o *DeleteContractParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
|
|
|
|
if err := r.SetTimeout(o.timeout); err != nil {
|
|
return err
|
|
}
|
|
var res []error
|
|
|
|
if o.ContractID != nil {
|
|
|
|
// query param contractId
|
|
var qrContractID string
|
|
|
|
if o.ContractID != nil {
|
|
qrContractID = *o.ContractID
|
|
}
|
|
qContractID := qrContractID
|
|
if qContractID != "" {
|
|
|
|
if err := r.SetQueryParam("contractId", qContractID); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|