github.com/go-swagger/go-swagger@v0.31.0/examples/oauth2/restapi/operations/get_auth_callback_responses.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package operations 4 5 // This file was generated by the swagger tool. 6 // Editing this file might prove futile when you re-run the swagger generate command 7 8 import ( 9 "net/http" 10 11 "github.com/go-openapi/runtime" 12 13 "github.com/go-swagger/go-swagger/examples/oauth2/models" 14 ) 15 16 // GetAuthCallbackOKCode is the HTTP code returned for type GetAuthCallbackOK 17 const GetAuthCallbackOKCode int = 200 18 19 /* 20 GetAuthCallbackOK login 21 22 swagger:response getAuthCallbackOK 23 */ 24 type GetAuthCallbackOK struct { 25 26 /* 27 In: Body 28 */ 29 Payload *GetAuthCallbackOKBody `json:"body,omitempty"` 30 } 31 32 // NewGetAuthCallbackOK creates GetAuthCallbackOK with default headers values 33 func NewGetAuthCallbackOK() *GetAuthCallbackOK { 34 35 return &GetAuthCallbackOK{} 36 } 37 38 // WithPayload adds the payload to the get auth callback o k response 39 func (o *GetAuthCallbackOK) WithPayload(payload *GetAuthCallbackOKBody) *GetAuthCallbackOK { 40 o.Payload = payload 41 return o 42 } 43 44 // SetPayload sets the payload to the get auth callback o k response 45 func (o *GetAuthCallbackOK) SetPayload(payload *GetAuthCallbackOKBody) { 46 o.Payload = payload 47 } 48 49 // WriteResponse to the client 50 func (o *GetAuthCallbackOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 51 52 rw.WriteHeader(200) 53 if o.Payload != nil { 54 payload := o.Payload 55 if err := producer.Produce(rw, payload); err != nil { 56 panic(err) // let the recovery middleware deal with this 57 } 58 } 59 } 60 61 /* 62 GetAuthCallbackDefault error 63 64 swagger:response getAuthCallbackDefault 65 */ 66 type GetAuthCallbackDefault struct { 67 _statusCode int 68 69 /* 70 In: Body 71 */ 72 Payload *models.Error `json:"body,omitempty"` 73 } 74 75 // NewGetAuthCallbackDefault creates GetAuthCallbackDefault with default headers values 76 func NewGetAuthCallbackDefault(code int) *GetAuthCallbackDefault { 77 if code <= 0 { 78 code = 500 79 } 80 81 return &GetAuthCallbackDefault{ 82 _statusCode: code, 83 } 84 } 85 86 // WithStatusCode adds the status to the get auth callback default response 87 func (o *GetAuthCallbackDefault) WithStatusCode(code int) *GetAuthCallbackDefault { 88 o._statusCode = code 89 return o 90 } 91 92 // SetStatusCode sets the status to the get auth callback default response 93 func (o *GetAuthCallbackDefault) SetStatusCode(code int) { 94 o._statusCode = code 95 } 96 97 // WithPayload adds the payload to the get auth callback default response 98 func (o *GetAuthCallbackDefault) WithPayload(payload *models.Error) *GetAuthCallbackDefault { 99 o.Payload = payload 100 return o 101 } 102 103 // SetPayload sets the payload to the get auth callback default response 104 func (o *GetAuthCallbackDefault) SetPayload(payload *models.Error) { 105 o.Payload = payload 106 } 107 108 // WriteResponse to the client 109 func (o *GetAuthCallbackDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { 110 111 rw.WriteHeader(o._statusCode) 112 if o.Payload != nil { 113 payload := o.Payload 114 if err := producer.Produce(rw, payload); err != nil { 115 panic(err) // let the recovery middleware deal with this 116 } 117 } 118 }