This repository has been archived on 2025-02-01. You can view files and clone it, but cannot push or open issues or pull requests.
eve-goclient/client/user_interface/post_ui_openwindow_newmail_parameters.go

153 lines
4.3 KiB
Go

package user_interface
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"time"
"golang.org/x/net/context"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
strfmt "github.com/go-openapi/strfmt"
)
// NewPostUIOpenwindowNewmailParams creates a new PostUIOpenwindowNewmailParams object
// with the default values initialized.
func NewPostUIOpenwindowNewmailParams() *PostUIOpenwindowNewmailParams {
var (
datasourceDefault = string("tranquility")
)
return &PostUIOpenwindowNewmailParams{
Datasource: &datasourceDefault,
timeout: cr.DefaultTimeout,
}
}
// NewPostUIOpenwindowNewmailParamsWithTimeout creates a new PostUIOpenwindowNewmailParams object
// with the default values initialized, and the ability to set a timeout on a request
func NewPostUIOpenwindowNewmailParamsWithTimeout(timeout time.Duration) *PostUIOpenwindowNewmailParams {
var (
datasourceDefault = string("tranquility")
)
return &PostUIOpenwindowNewmailParams{
Datasource: &datasourceDefault,
timeout: timeout,
}
}
// NewPostUIOpenwindowNewmailParamsWithContext creates a new PostUIOpenwindowNewmailParams object
// with the default values initialized, and the ability to set a context for a request
func NewPostUIOpenwindowNewmailParamsWithContext(ctx context.Context) *PostUIOpenwindowNewmailParams {
var (
datasourceDefault = string("tranquility")
)
return &PostUIOpenwindowNewmailParams{
Datasource: &datasourceDefault,
Context: ctx,
}
}
/*PostUIOpenwindowNewmailParams contains all the parameters to send to the API endpoint
for the post ui openwindow newmail operation typically these are written to a http.Request
*/
type PostUIOpenwindowNewmailParams struct {
/*Datasource
The server name you would like data from
*/
Datasource *string
/*NewMail
The details of mail to create
*/
NewMail PostUIOpenwindowNewmailBody
timeout time.Duration
Context context.Context
HTTPClient *http.Client
}
// WithTimeout adds the timeout to the post ui openwindow newmail params
func (o *PostUIOpenwindowNewmailParams) WithTimeout(timeout time.Duration) *PostUIOpenwindowNewmailParams {
o.SetTimeout(timeout)
return o
}
// SetTimeout adds the timeout to the post ui openwindow newmail params
func (o *PostUIOpenwindowNewmailParams) SetTimeout(timeout time.Duration) {
o.timeout = timeout
}
// WithContext adds the context to the post ui openwindow newmail params
func (o *PostUIOpenwindowNewmailParams) WithContext(ctx context.Context) *PostUIOpenwindowNewmailParams {
o.SetContext(ctx)
return o
}
// SetContext adds the context to the post ui openwindow newmail params
func (o *PostUIOpenwindowNewmailParams) SetContext(ctx context.Context) {
o.Context = ctx
}
// WithDatasource adds the datasource to the post ui openwindow newmail params
func (o *PostUIOpenwindowNewmailParams) WithDatasource(datasource *string) *PostUIOpenwindowNewmailParams {
o.SetDatasource(datasource)
return o
}
// SetDatasource adds the datasource to the post ui openwindow newmail params
func (o *PostUIOpenwindowNewmailParams) SetDatasource(datasource *string) {
o.Datasource = datasource
}
// WithNewMail adds the newMail to the post ui openwindow newmail params
func (o *PostUIOpenwindowNewmailParams) WithNewMail(newMail PostUIOpenwindowNewmailBody) *PostUIOpenwindowNewmailParams {
o.SetNewMail(newMail)
return o
}
// SetNewMail adds the newMail to the post ui openwindow newmail params
func (o *PostUIOpenwindowNewmailParams) SetNewMail(newMail PostUIOpenwindowNewmailBody) {
o.NewMail = newMail
}
// WriteToRequest writes these params to a swagger request
func (o *PostUIOpenwindowNewmailParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
if o.Datasource != nil {
// query param datasource
var qrDatasource string
if o.Datasource != nil {
qrDatasource = *o.Datasource
}
qDatasource := qrDatasource
if qDatasource != "" {
if err := r.SetQueryParam("datasource", qDatasource); err != nil {
return err
}
}
}
if err := r.SetBodyParam(o.NewMail); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}