github.com/digitalocean/go-netbox@v0.0.2/netbox/client/dcim/dcim_console_server_ports_bulk_update_parameters.go (about)

     1  // Code generated by go-swagger; DO NOT EDIT.
     2  
     3  // Copyright 2020 The go-netbox Authors.
     4  //
     5  // Licensed under the Apache License, Version 2.0 (the "License");
     6  // you may not use this file except in compliance with the License.
     7  // You may obtain a copy of the License at
     8  //
     9  //   http://www.apache.org/licenses/LICENSE-2.0
    10  //
    11  // Unless required by applicable law or agreed to in writing, software
    12  // distributed under the License is distributed on an "AS IS" BASIS,
    13  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    14  // See the License for the specific language governing permissions and
    15  // limitations under the License.
    16  //
    17  
    18  package dcim
    19  
    20  // This file was generated by the swagger tool.
    21  // Editing this file might prove futile when you re-run the swagger generate command
    22  
    23  import (
    24  	"context"
    25  	"net/http"
    26  	"time"
    27  
    28  	"github.com/go-openapi/errors"
    29  	"github.com/go-openapi/runtime"
    30  	cr "github.com/go-openapi/runtime/client"
    31  	"github.com/go-openapi/strfmt"
    32  
    33  	"github.com/digitalocean/go-netbox/netbox/models"
    34  )
    35  
    36  // NewDcimConsoleServerPortsBulkUpdateParams creates a new DcimConsoleServerPortsBulkUpdateParams object,
    37  // with the default timeout for this client.
    38  //
    39  // Default values are not hydrated, since defaults are normally applied by the API server side.
    40  //
    41  // To enforce default values in parameter, use SetDefaults or WithDefaults.
    42  func NewDcimConsoleServerPortsBulkUpdateParams() *DcimConsoleServerPortsBulkUpdateParams {
    43  	return &DcimConsoleServerPortsBulkUpdateParams{
    44  		timeout: cr.DefaultTimeout,
    45  	}
    46  }
    47  
    48  // NewDcimConsoleServerPortsBulkUpdateParamsWithTimeout creates a new DcimConsoleServerPortsBulkUpdateParams object
    49  // with the ability to set a timeout on a request.
    50  func NewDcimConsoleServerPortsBulkUpdateParamsWithTimeout(timeout time.Duration) *DcimConsoleServerPortsBulkUpdateParams {
    51  	return &DcimConsoleServerPortsBulkUpdateParams{
    52  		timeout: timeout,
    53  	}
    54  }
    55  
    56  // NewDcimConsoleServerPortsBulkUpdateParamsWithContext creates a new DcimConsoleServerPortsBulkUpdateParams object
    57  // with the ability to set a context for a request.
    58  func NewDcimConsoleServerPortsBulkUpdateParamsWithContext(ctx context.Context) *DcimConsoleServerPortsBulkUpdateParams {
    59  	return &DcimConsoleServerPortsBulkUpdateParams{
    60  		Context: ctx,
    61  	}
    62  }
    63  
    64  // NewDcimConsoleServerPortsBulkUpdateParamsWithHTTPClient creates a new DcimConsoleServerPortsBulkUpdateParams object
    65  // with the ability to set a custom HTTPClient for a request.
    66  func NewDcimConsoleServerPortsBulkUpdateParamsWithHTTPClient(client *http.Client) *DcimConsoleServerPortsBulkUpdateParams {
    67  	return &DcimConsoleServerPortsBulkUpdateParams{
    68  		HTTPClient: client,
    69  	}
    70  }
    71  
    72  /* DcimConsoleServerPortsBulkUpdateParams contains all the parameters to send to the API endpoint
    73     for the dcim console server ports bulk update operation.
    74  
    75     Typically these are written to a http.Request.
    76  */
    77  type DcimConsoleServerPortsBulkUpdateParams struct {
    78  
    79  	// Data.
    80  	Data *models.WritableConsoleServerPort
    81  
    82  	timeout    time.Duration
    83  	Context    context.Context
    84  	HTTPClient *http.Client
    85  }
    86  
    87  // WithDefaults hydrates default values in the dcim console server ports bulk update params (not the query body).
    88  //
    89  // All values with no default are reset to their zero value.
    90  func (o *DcimConsoleServerPortsBulkUpdateParams) WithDefaults() *DcimConsoleServerPortsBulkUpdateParams {
    91  	o.SetDefaults()
    92  	return o
    93  }
    94  
    95  // SetDefaults hydrates default values in the dcim console server ports bulk update params (not the query body).
    96  //
    97  // All values with no default are reset to their zero value.
    98  func (o *DcimConsoleServerPortsBulkUpdateParams) SetDefaults() {
    99  	// no default values defined for this parameter
   100  }
   101  
   102  // WithTimeout adds the timeout to the dcim console server ports bulk update params
   103  func (o *DcimConsoleServerPortsBulkUpdateParams) WithTimeout(timeout time.Duration) *DcimConsoleServerPortsBulkUpdateParams {
   104  	o.SetTimeout(timeout)
   105  	return o
   106  }
   107  
   108  // SetTimeout adds the timeout to the dcim console server ports bulk update params
   109  func (o *DcimConsoleServerPortsBulkUpdateParams) SetTimeout(timeout time.Duration) {
   110  	o.timeout = timeout
   111  }
   112  
   113  // WithContext adds the context to the dcim console server ports bulk update params
   114  func (o *DcimConsoleServerPortsBulkUpdateParams) WithContext(ctx context.Context) *DcimConsoleServerPortsBulkUpdateParams {
   115  	o.SetContext(ctx)
   116  	return o
   117  }
   118  
   119  // SetContext adds the context to the dcim console server ports bulk update params
   120  func (o *DcimConsoleServerPortsBulkUpdateParams) SetContext(ctx context.Context) {
   121  	o.Context = ctx
   122  }
   123  
   124  // WithHTTPClient adds the HTTPClient to the dcim console server ports bulk update params
   125  func (o *DcimConsoleServerPortsBulkUpdateParams) WithHTTPClient(client *http.Client) *DcimConsoleServerPortsBulkUpdateParams {
   126  	o.SetHTTPClient(client)
   127  	return o
   128  }
   129  
   130  // SetHTTPClient adds the HTTPClient to the dcim console server ports bulk update params
   131  func (o *DcimConsoleServerPortsBulkUpdateParams) SetHTTPClient(client *http.Client) {
   132  	o.HTTPClient = client
   133  }
   134  
   135  // WithData adds the data to the dcim console server ports bulk update params
   136  func (o *DcimConsoleServerPortsBulkUpdateParams) WithData(data *models.WritableConsoleServerPort) *DcimConsoleServerPortsBulkUpdateParams {
   137  	o.SetData(data)
   138  	return o
   139  }
   140  
   141  // SetData adds the data to the dcim console server ports bulk update params
   142  func (o *DcimConsoleServerPortsBulkUpdateParams) SetData(data *models.WritableConsoleServerPort) {
   143  	o.Data = data
   144  }
   145  
   146  // WriteToRequest writes these params to a swagger request
   147  func (o *DcimConsoleServerPortsBulkUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
   148  
   149  	if err := r.SetTimeout(o.timeout); err != nil {
   150  		return err
   151  	}
   152  	var res []error
   153  	if o.Data != nil {
   154  		if err := r.SetBodyParam(o.Data); err != nil {
   155  			return err
   156  		}
   157  	}
   158  
   159  	if len(res) > 0 {
   160  		return errors.CompositeValidationError(res...)
   161  	}
   162  	return nil
   163  }