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 ( "fmt" "io" "github.com/go-openapi/errors" "github.com/go-openapi/runtime" "github.com/go-openapi/validate" strfmt "github.com/go-openapi/strfmt" ) // PostUIOpenwindowNewmailReader is a Reader for the PostUIOpenwindowNewmail structure. type PostUIOpenwindowNewmailReader struct { formats strfmt.Registry } // ReadResponse reads a server response into the received o. func (o *PostUIOpenwindowNewmailReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { switch response.Code() { case 204: result := NewPostUIOpenwindowNewmailNoContent() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return result, nil case 403: result := NewPostUIOpenwindowNewmailForbidden() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 422: result := NewPostUIOpenwindowNewmailUnprocessableEntity() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result case 500: result := NewPostUIOpenwindowNewmailInternalServerError() if err := result.readResponse(response, consumer, o.formats); err != nil { return nil, err } return nil, result default: return nil, runtime.NewAPIError("unknown error", response, response.Code()) } } // NewPostUIOpenwindowNewmailNoContent creates a PostUIOpenwindowNewmailNoContent with default headers values func NewPostUIOpenwindowNewmailNoContent() *PostUIOpenwindowNewmailNoContent { return &PostUIOpenwindowNewmailNoContent{} } /*PostUIOpenwindowNewmailNoContent handles this case with default header values. Open window request received */ type PostUIOpenwindowNewmailNoContent struct { } func (o *PostUIOpenwindowNewmailNoContent) Error() string { return fmt.Sprintf("[POST /ui/openwindow/newmail/][%d] postUiOpenwindowNewmailNoContent ", 204) } func (o *PostUIOpenwindowNewmailNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { return nil } // NewPostUIOpenwindowNewmailForbidden creates a PostUIOpenwindowNewmailForbidden with default headers values func NewPostUIOpenwindowNewmailForbidden() *PostUIOpenwindowNewmailForbidden { return &PostUIOpenwindowNewmailForbidden{} } /*PostUIOpenwindowNewmailForbidden handles this case with default header values. Forbidden */ type PostUIOpenwindowNewmailForbidden struct { Payload PostUIOpenwindowNewmailForbiddenBody } func (o *PostUIOpenwindowNewmailForbidden) Error() string { return fmt.Sprintf("[POST /ui/openwindow/newmail/][%d] postUiOpenwindowNewmailForbidden %+v", 403, o.Payload) } func (o *PostUIOpenwindowNewmailForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { return err } return nil } // NewPostUIOpenwindowNewmailUnprocessableEntity creates a PostUIOpenwindowNewmailUnprocessableEntity with default headers values func NewPostUIOpenwindowNewmailUnprocessableEntity() *PostUIOpenwindowNewmailUnprocessableEntity { return &PostUIOpenwindowNewmailUnprocessableEntity{} } /*PostUIOpenwindowNewmailUnprocessableEntity handles this case with default header values. Invalid request */ type PostUIOpenwindowNewmailUnprocessableEntity struct { Payload PostUIOpenwindowNewmailUnprocessableEntityBody } func (o *PostUIOpenwindowNewmailUnprocessableEntity) Error() string { return fmt.Sprintf("[POST /ui/openwindow/newmail/][%d] postUiOpenwindowNewmailUnprocessableEntity %+v", 422, o.Payload) } func (o *PostUIOpenwindowNewmailUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { return err } return nil } // NewPostUIOpenwindowNewmailInternalServerError creates a PostUIOpenwindowNewmailInternalServerError with default headers values func NewPostUIOpenwindowNewmailInternalServerError() *PostUIOpenwindowNewmailInternalServerError { return &PostUIOpenwindowNewmailInternalServerError{} } /*PostUIOpenwindowNewmailInternalServerError handles this case with default header values. Internal server error */ type PostUIOpenwindowNewmailInternalServerError struct { Payload PostUIOpenwindowNewmailInternalServerErrorBody } func (o *PostUIOpenwindowNewmailInternalServerError) Error() string { return fmt.Sprintf("[POST /ui/openwindow/newmail/][%d] postUiOpenwindowNewmailInternalServerError %+v", 500, o.Payload) } func (o *PostUIOpenwindowNewmailInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { // response payload if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { return err } return nil } /*PostUIOpenwindowNewmailBody post_ui_openwindow_newmail_new_mail // // new_mail object swagger:model PostUIOpenwindowNewmailBody */ type PostUIOpenwindowNewmailBody struct { // post_ui_openwindow_newmail_body // // body string // Required: true // Max Length: 10000 Body *string `json:"body"` // post_ui_openwindow_newmail_recipients // // recipients array // Required: true // Max Items: 50 // Min Items: 1 Recipients []int32 `json:"recipients"` // post_ui_openwindow_newmail_subject // // subject string // Required: true // Max Length: 1000 Subject *string `json:"subject"` // post_ui_openwindow_newmail_to_corp_or_alliance_id // // to_corp_or_alliance_id integer // Required: true ToCorpOrAllianceID *int32 `json:"to_corp_or_alliance_id"` // post_ui_openwindow_newmail_to_mailing_list_id // // Corporations, alliances and mailing lists are all types of mailing groups. You may only send to one mailing group, at a time, so you may fill out either this field or the to_corp_or_alliance_ids field // Required: true ToMailingListID *int32 `json:"to_mailing_list_id"` } /*PostUIOpenwindowNewmailForbiddenBody post_ui_openwindow_newmail_forbidden // // Forbidden swagger:model PostUIOpenwindowNewmailForbiddenBody */ type PostUIOpenwindowNewmailForbiddenBody struct { // post_ui_openwindow_newmail_403_forbidden // // Forbidden message // Required: true Error *string `json:"error"` } // Validate validates this post UI openwindow newmail forbidden body func (o *PostUIOpenwindowNewmailForbiddenBody) Validate(formats strfmt.Registry) error { var res []error if err := o.validateError(formats); err != nil { // prop res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } func (o *PostUIOpenwindowNewmailForbiddenBody) validateError(formats strfmt.Registry) error { if err := validate.Required("postUiOpenwindowNewmailForbidden"+"."+"error", "body", o.Error); err != nil { return err } return nil } /*PostUIOpenwindowNewmailInternalServerErrorBody post_ui_openwindow_newmail_internal_server_error // // Internal server error swagger:model PostUIOpenwindowNewmailInternalServerErrorBody */ type PostUIOpenwindowNewmailInternalServerErrorBody struct { // post_ui_openwindow_newmail_500_internal_server_error // // Internal server error message // Required: true Error *string `json:"error"` } // Validate validates this post UI openwindow newmail internal server error body func (o *PostUIOpenwindowNewmailInternalServerErrorBody) Validate(formats strfmt.Registry) error { var res []error if err := o.validateError(formats); err != nil { // prop res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } func (o *PostUIOpenwindowNewmailInternalServerErrorBody) validateError(formats strfmt.Registry) error { if err := validate.Required("postUiOpenwindowNewmailInternalServerError"+"."+"error", "body", o.Error); err != nil { return err } return nil } /*PostUIOpenwindowNewmailUnprocessableEntityBody post_ui_openwindow_newmail_unprocessable_entity // // Unprocessable entity swagger:model PostUIOpenwindowNewmailUnprocessableEntityBody */ type PostUIOpenwindowNewmailUnprocessableEntityBody struct { // post_ui_openwindow_newmail_422_unprocessable_entity // // Unprocessable entity message // Required: true Error *string `json:"error"` } // Validate validates this post UI openwindow newmail unprocessable entity body func (o *PostUIOpenwindowNewmailUnprocessableEntityBody) Validate(formats strfmt.Registry) error { var res []error if err := o.validateError(formats); err != nil { // prop res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } func (o *PostUIOpenwindowNewmailUnprocessableEntityBody) validateError(formats strfmt.Registry) error { if err := validate.Required("postUiOpenwindowNewmailUnprocessableEntity"+"."+"error", "body", o.Error); err != nil { return err } return nil }