-
Notifications
You must be signed in to change notification settings - Fork 4
/
delete_index_doc_id.go
124 lines (98 loc) · 3.42 KB
/
delete_index_doc_id.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// Code generated by go-swagger; DO NOT EDIT.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"net/http"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// DeleteIndexDocIDHandlerFunc turns a function with the right signature into a delete index doc id handler
type DeleteIndexDocIDHandlerFunc func(DeleteIndexDocIDParams) middleware.Responder
// Handle executing the request and returning a response
func (fn DeleteIndexDocIDHandlerFunc) Handle(params DeleteIndexDocIDParams) middleware.Responder {
return fn(params)
}
// DeleteIndexDocIDHandler interface for that can handle valid delete index doc id params
type DeleteIndexDocIDHandler interface {
Handle(DeleteIndexDocIDParams) middleware.Responder
}
// NewDeleteIndexDocID creates a new http.Handler for the delete index doc id operation
func NewDeleteIndexDocID(ctx *middleware.Context, handler DeleteIndexDocIDHandler) *DeleteIndexDocID {
return &DeleteIndexDocID{Context: ctx, Handler: handler}
}
/*DeleteIndexDocID swagger:route DELETE /{index}/_doc/{_id} deleteIndexDocId
You use DELETE to remove a document from an index. You must specify the index name and document ID.
*/
type DeleteIndexDocID struct {
Context *middleware.Context
Handler DeleteIndexDocIDHandler
}
func (o *DeleteIndexDocID) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
r = rCtx
}
var Params = NewDeleteIndexDocIDParams()
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}
// DeleteIndexDocIDBadRequestBody delete index doc ID bad request body
//
// swagger:model DeleteIndexDocIDBadRequestBody
type DeleteIndexDocIDBadRequestBody struct {
// message
Message string `json:"message,omitempty"`
}
// Validate validates this delete index doc ID bad request body
func (o *DeleteIndexDocIDBadRequestBody) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *DeleteIndexDocIDBadRequestBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *DeleteIndexDocIDBadRequestBody) UnmarshalBinary(b []byte) error {
var res DeleteIndexDocIDBadRequestBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}
// DeleteIndexDocIDNotFoundBody delete index doc ID not found body
//
// swagger:model DeleteIndexDocIDNotFoundBody
type DeleteIndexDocIDNotFoundBody struct {
// message
Message string `json:"message,omitempty"`
}
// Validate validates this delete index doc ID not found body
func (o *DeleteIndexDocIDNotFoundBody) Validate(formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (o *DeleteIndexDocIDNotFoundBody) MarshalBinary() ([]byte, error) {
if o == nil {
return nil, nil
}
return swag.WriteJSON(o)
}
// UnmarshalBinary interface implementation
func (o *DeleteIndexDocIDNotFoundBody) UnmarshalBinary(b []byte) error {
var res DeleteIndexDocIDNotFoundBody
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*o = res
return nil
}