NONRTRIC-946: Add support for Kong routes
[nonrtric/plt/sme.git] / servicemanager / internal / invokermanagementapi / invokermanagementapi-client.gen.go
1 // Package invokermanagementapi provides primitives to interact with the openapi HTTP API.
2 //
3 // Code generated by github.com/deepmap/oapi-codegen version v1.10.1 DO NOT EDIT.
4 package invokermanagementapi
5
6 import (
7         "bytes"
8         "context"
9         "encoding/json"
10         "fmt"
11         "io"
12         "io/ioutil"
13         "net/http"
14         "net/url"
15         "strings"
16
17         "github.com/deepmap/oapi-codegen/pkg/runtime"
18 )
19
20 // RequestEditorFn  is the function signature for the RequestEditor callback function
21 type RequestEditorFn func(ctx context.Context, req *http.Request) error
22
23 // Doer performs HTTP requests.
24 //
25 // The standard http.Client implements this interface.
26 type HttpRequestDoer interface {
27         Do(req *http.Request) (*http.Response, error)
28 }
29
30 // Client which conforms to the OpenAPI3 specification for this service.
31 type Client struct {
32         // The endpoint of the server conforming to this interface, with scheme,
33         // https://api.deepmap.com for example. This can contain a path relative
34         // to the server, such as https://api.deepmap.com/dev-test, and all the
35         // paths in the swagger spec will be appended to the server.
36         Server string
37
38         // Doer for performing requests, typically a *http.Client with any
39         // customized settings, such as certificate chains.
40         Client HttpRequestDoer
41
42         // A list of callbacks for modifying requests which are generated before sending over
43         // the network.
44         RequestEditors []RequestEditorFn
45 }
46
47 // ClientOption allows setting custom parameters during construction
48 type ClientOption func(*Client) error
49
50 // Creates a new Client, with reasonable defaults
51 func NewClient(server string, opts ...ClientOption) (*Client, error) {
52         // create a client with sane default values
53         client := Client{
54                 Server: server,
55         }
56         // mutate client and add all optional params
57         for _, o := range opts {
58                 if err := o(&client); err != nil {
59                         return nil, err
60                 }
61         }
62         // ensure the server URL always has a trailing slash
63         if !strings.HasSuffix(client.Server, "/") {
64                 client.Server += "/"
65         }
66         // create httpClient, if not already present
67         if client.Client == nil {
68                 client.Client = &http.Client{}
69         }
70         return &client, nil
71 }
72
73 // WithHTTPClient allows overriding the default Doer, which is
74 // automatically created using http.Client. This is useful for tests.
75 func WithHTTPClient(doer HttpRequestDoer) ClientOption {
76         return func(c *Client) error {
77                 c.Client = doer
78                 return nil
79         }
80 }
81
82 // WithRequestEditorFn allows setting up a callback function, which will be
83 // called right before sending the request. This can be used to mutate the request.
84 func WithRequestEditorFn(fn RequestEditorFn) ClientOption {
85         return func(c *Client) error {
86                 c.RequestEditors = append(c.RequestEditors, fn)
87                 return nil
88         }
89 }
90
91 // The interface specification for the client above.
92 type ClientInterface interface {
93         // PostOnboardedInvokers request with any body
94         PostOnboardedInvokersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
95
96         PostOnboardedInvokers(ctx context.Context, body PostOnboardedInvokersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
97
98         // DeleteOnboardedInvokersOnboardingId request
99         DeleteOnboardedInvokersOnboardingId(ctx context.Context, onboardingId string, reqEditors ...RequestEditorFn) (*http.Response, error)
100
101         // ModifyIndApiInvokeEnrolment request with any body
102         ModifyIndApiInvokeEnrolmentWithBody(ctx context.Context, onboardingId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
103
104         // PutOnboardedInvokersOnboardingId request with any body
105         PutOnboardedInvokersOnboardingIdWithBody(ctx context.Context, onboardingId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
106
107         PutOnboardedInvokersOnboardingId(ctx context.Context, onboardingId string, body PutOnboardedInvokersOnboardingIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
108 }
109
110 func (c *Client) PostOnboardedInvokersWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
111         req, err := NewPostOnboardedInvokersRequestWithBody(c.Server, contentType, body)
112         if err != nil {
113                 return nil, err
114         }
115         req = req.WithContext(ctx)
116         if err := c.applyEditors(ctx, req, reqEditors); err != nil {
117                 return nil, err
118         }
119         return c.Client.Do(req)
120 }
121
122 func (c *Client) PostOnboardedInvokers(ctx context.Context, body PostOnboardedInvokersJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
123         req, err := NewPostOnboardedInvokersRequest(c.Server, body)
124         if err != nil {
125                 return nil, err
126         }
127         req = req.WithContext(ctx)
128         if err := c.applyEditors(ctx, req, reqEditors); err != nil {
129                 return nil, err
130         }
131         return c.Client.Do(req)
132 }
133
134 func (c *Client) DeleteOnboardedInvokersOnboardingId(ctx context.Context, onboardingId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
135         req, err := NewDeleteOnboardedInvokersOnboardingIdRequest(c.Server, onboardingId)
136         if err != nil {
137                 return nil, err
138         }
139         req = req.WithContext(ctx)
140         if err := c.applyEditors(ctx, req, reqEditors); err != nil {
141                 return nil, err
142         }
143         return c.Client.Do(req)
144 }
145
146 func (c *Client) ModifyIndApiInvokeEnrolmentWithBody(ctx context.Context, onboardingId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
147         req, err := NewModifyIndApiInvokeEnrolmentRequestWithBody(c.Server, onboardingId, contentType, body)
148         if err != nil {
149                 return nil, err
150         }
151         req = req.WithContext(ctx)
152         if err := c.applyEditors(ctx, req, reqEditors); err != nil {
153                 return nil, err
154         }
155         return c.Client.Do(req)
156 }
157
158 func (c *Client) PutOnboardedInvokersOnboardingIdWithBody(ctx context.Context, onboardingId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
159         req, err := NewPutOnboardedInvokersOnboardingIdRequestWithBody(c.Server, onboardingId, contentType, body)
160         if err != nil {
161                 return nil, err
162         }
163         req = req.WithContext(ctx)
164         if err := c.applyEditors(ctx, req, reqEditors); err != nil {
165                 return nil, err
166         }
167         return c.Client.Do(req)
168 }
169
170 func (c *Client) PutOnboardedInvokersOnboardingId(ctx context.Context, onboardingId string, body PutOnboardedInvokersOnboardingIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
171         req, err := NewPutOnboardedInvokersOnboardingIdRequest(c.Server, onboardingId, body)
172         if err != nil {
173                 return nil, err
174         }
175         req = req.WithContext(ctx)
176         if err := c.applyEditors(ctx, req, reqEditors); err != nil {
177                 return nil, err
178         }
179         return c.Client.Do(req)
180 }
181
182 // NewPostOnboardedInvokersRequest calls the generic PostOnboardedInvokers builder with application/json body
183 func NewPostOnboardedInvokersRequest(server string, body PostOnboardedInvokersJSONRequestBody) (*http.Request, error) {
184         var bodyReader io.Reader
185         buf, err := json.Marshal(body)
186         if err != nil {
187                 return nil, err
188         }
189         bodyReader = bytes.NewReader(buf)
190         return NewPostOnboardedInvokersRequestWithBody(server, "application/json", bodyReader)
191 }
192
193 // NewPostOnboardedInvokersRequestWithBody generates requests for PostOnboardedInvokers with any type of body
194 func NewPostOnboardedInvokersRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) {
195         var err error
196
197         serverURL, err := url.Parse(server)
198         if err != nil {
199                 return nil, err
200         }
201
202         operationPath := fmt.Sprintf("/onboardedInvokers")
203         if operationPath[0] == '/' {
204                 operationPath = "." + operationPath
205         }
206
207         queryURL, err := serverURL.Parse(operationPath)
208         if err != nil {
209                 return nil, err
210         }
211
212         req, err := http.NewRequest("POST", queryURL.String(), body)
213         if err != nil {
214                 return nil, err
215         }
216
217         req.Header.Add("Content-Type", contentType)
218
219         return req, nil
220 }
221
222 // NewDeleteOnboardedInvokersOnboardingIdRequest generates requests for DeleteOnboardedInvokersOnboardingId
223 func NewDeleteOnboardedInvokersOnboardingIdRequest(server string, onboardingId string) (*http.Request, error) {
224         var err error
225
226         var pathParam0 string
227
228         pathParam0, err = runtime.StyleParamWithLocation("simple", false, "onboardingId", runtime.ParamLocationPath, onboardingId)
229         if err != nil {
230                 return nil, err
231         }
232
233         serverURL, err := url.Parse(server)
234         if err != nil {
235                 return nil, err
236         }
237
238         operationPath := fmt.Sprintf("/onboardedInvokers/%s", pathParam0)
239         if operationPath[0] == '/' {
240                 operationPath = "." + operationPath
241         }
242
243         queryURL, err := serverURL.Parse(operationPath)
244         if err != nil {
245                 return nil, err
246         }
247
248         req, err := http.NewRequest("DELETE", queryURL.String(), nil)
249         if err != nil {
250                 return nil, err
251         }
252
253         return req, nil
254 }
255
256 // NewModifyIndApiInvokeEnrolmentRequestWithBody generates requests for ModifyIndApiInvokeEnrolment with any type of body
257 func NewModifyIndApiInvokeEnrolmentRequestWithBody(server string, onboardingId string, contentType string, body io.Reader) (*http.Request, error) {
258         var err error
259
260         var pathParam0 string
261
262         pathParam0, err = runtime.StyleParamWithLocation("simple", false, "onboardingId", runtime.ParamLocationPath, onboardingId)
263         if err != nil {
264                 return nil, err
265         }
266
267         serverURL, err := url.Parse(server)
268         if err != nil {
269                 return nil, err
270         }
271
272         operationPath := fmt.Sprintf("/onboardedInvokers/%s", pathParam0)
273         if operationPath[0] == '/' {
274                 operationPath = "." + operationPath
275         }
276
277         queryURL, err := serverURL.Parse(operationPath)
278         if err != nil {
279                 return nil, err
280         }
281
282         req, err := http.NewRequest("PATCH", queryURL.String(), body)
283         if err != nil {
284                 return nil, err
285         }
286
287         req.Header.Add("Content-Type", contentType)
288
289         return req, nil
290 }
291
292 // NewPutOnboardedInvokersOnboardingIdRequest calls the generic PutOnboardedInvokersOnboardingId builder with application/json body
293 func NewPutOnboardedInvokersOnboardingIdRequest(server string, onboardingId string, body PutOnboardedInvokersOnboardingIdJSONRequestBody) (*http.Request, error) {
294         var bodyReader io.Reader
295         buf, err := json.Marshal(body)
296         if err != nil {
297                 return nil, err
298         }
299         bodyReader = bytes.NewReader(buf)
300         return NewPutOnboardedInvokersOnboardingIdRequestWithBody(server, onboardingId, "application/json", bodyReader)
301 }
302
303 // NewPutOnboardedInvokersOnboardingIdRequestWithBody generates requests for PutOnboardedInvokersOnboardingId with any type of body
304 func NewPutOnboardedInvokersOnboardingIdRequestWithBody(server string, onboardingId string, contentType string, body io.Reader) (*http.Request, error) {
305         var err error
306
307         var pathParam0 string
308
309         pathParam0, err = runtime.StyleParamWithLocation("simple", false, "onboardingId", runtime.ParamLocationPath, onboardingId)
310         if err != nil {
311                 return nil, err
312         }
313
314         serverURL, err := url.Parse(server)
315         if err != nil {
316                 return nil, err
317         }
318
319         operationPath := fmt.Sprintf("/onboardedInvokers/%s", pathParam0)
320         if operationPath[0] == '/' {
321                 operationPath = "." + operationPath
322         }
323
324         queryURL, err := serverURL.Parse(operationPath)
325         if err != nil {
326                 return nil, err
327         }
328
329         req, err := http.NewRequest("PUT", queryURL.String(), body)
330         if err != nil {
331                 return nil, err
332         }
333
334         req.Header.Add("Content-Type", contentType)
335
336         return req, nil
337 }
338
339 func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error {
340         for _, r := range c.RequestEditors {
341                 if err := r(ctx, req); err != nil {
342                         return err
343                 }
344         }
345         for _, r := range additionalEditors {
346                 if err := r(ctx, req); err != nil {
347                         return err
348                 }
349         }
350         return nil
351 }
352
353 // ClientWithResponses builds on ClientInterface to offer response payloads
354 type ClientWithResponses struct {
355         ClientInterface
356 }
357
358 // NewClientWithResponses creates a new ClientWithResponses, which wraps
359 // Client with return type handling
360 func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) {
361         client, err := NewClient(server, opts...)
362         if err != nil {
363                 return nil, err
364         }
365         return &ClientWithResponses{client}, nil
366 }
367
368 // WithBaseURL overrides the baseURL.
369 func WithBaseURL(baseURL string) ClientOption {
370         return func(c *Client) error {
371                 newBaseURL, err := url.Parse(baseURL)
372                 if err != nil {
373                         return err
374                 }
375                 c.Server = newBaseURL.String()
376                 return nil
377         }
378 }
379
380 // ClientWithResponsesInterface is the interface specification for the client with responses above.
381 type ClientWithResponsesInterface interface {
382         // PostOnboardedInvokers request with any body
383         PostOnboardedInvokersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostOnboardedInvokersResponse, error)
384
385         PostOnboardedInvokersWithResponse(ctx context.Context, body PostOnboardedInvokersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostOnboardedInvokersResponse, error)
386
387         // DeleteOnboardedInvokersOnboardingId request
388         DeleteOnboardedInvokersOnboardingIdWithResponse(ctx context.Context, onboardingId string, reqEditors ...RequestEditorFn) (*DeleteOnboardedInvokersOnboardingIdResponse, error)
389
390         // ModifyIndApiInvokeEnrolment request with any body
391         ModifyIndApiInvokeEnrolmentWithBodyWithResponse(ctx context.Context, onboardingId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ModifyIndApiInvokeEnrolmentResponse, error)
392
393         // PutOnboardedInvokersOnboardingId request with any body
394         PutOnboardedInvokersOnboardingIdWithBodyWithResponse(ctx context.Context, onboardingId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutOnboardedInvokersOnboardingIdResponse, error)
395
396         PutOnboardedInvokersOnboardingIdWithResponse(ctx context.Context, onboardingId string, body PutOnboardedInvokersOnboardingIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutOnboardedInvokersOnboardingIdResponse, error)
397 }
398
399 type PostOnboardedInvokersResponse struct {
400         Body         []byte
401         HTTPResponse *http.Response
402         JSON201      *APIInvokerEnrolmentDetails
403 }
404
405 // Status returns HTTPResponse.Status
406 func (r PostOnboardedInvokersResponse) Status() string {
407         if r.HTTPResponse != nil {
408                 return r.HTTPResponse.Status
409         }
410         return http.StatusText(0)
411 }
412
413 // StatusCode returns HTTPResponse.StatusCode
414 func (r PostOnboardedInvokersResponse) StatusCode() int {
415         if r.HTTPResponse != nil {
416                 return r.HTTPResponse.StatusCode
417         }
418         return 0
419 }
420
421 type DeleteOnboardedInvokersOnboardingIdResponse struct {
422         Body         []byte
423         HTTPResponse *http.Response
424 }
425
426 // Status returns HTTPResponse.Status
427 func (r DeleteOnboardedInvokersOnboardingIdResponse) Status() string {
428         if r.HTTPResponse != nil {
429                 return r.HTTPResponse.Status
430         }
431         return http.StatusText(0)
432 }
433
434 // StatusCode returns HTTPResponse.StatusCode
435 func (r DeleteOnboardedInvokersOnboardingIdResponse) StatusCode() int {
436         if r.HTTPResponse != nil {
437                 return r.HTTPResponse.StatusCode
438         }
439         return 0
440 }
441
442 type ModifyIndApiInvokeEnrolmentResponse struct {
443         Body         []byte
444         HTTPResponse *http.Response
445         JSON200      *APIInvokerEnrolmentDetails
446 }
447
448 // Status returns HTTPResponse.Status
449 func (r ModifyIndApiInvokeEnrolmentResponse) Status() string {
450         if r.HTTPResponse != nil {
451                 return r.HTTPResponse.Status
452         }
453         return http.StatusText(0)
454 }
455
456 // StatusCode returns HTTPResponse.StatusCode
457 func (r ModifyIndApiInvokeEnrolmentResponse) StatusCode() int {
458         if r.HTTPResponse != nil {
459                 return r.HTTPResponse.StatusCode
460         }
461         return 0
462 }
463
464 type PutOnboardedInvokersOnboardingIdResponse struct {
465         Body         []byte
466         HTTPResponse *http.Response
467         JSON200      *APIInvokerEnrolmentDetails
468 }
469
470 // Status returns HTTPResponse.Status
471 func (r PutOnboardedInvokersOnboardingIdResponse) Status() string {
472         if r.HTTPResponse != nil {
473                 return r.HTTPResponse.Status
474         }
475         return http.StatusText(0)
476 }
477
478 // StatusCode returns HTTPResponse.StatusCode
479 func (r PutOnboardedInvokersOnboardingIdResponse) StatusCode() int {
480         if r.HTTPResponse != nil {
481                 return r.HTTPResponse.StatusCode
482         }
483         return 0
484 }
485
486 // PostOnboardedInvokersWithBodyWithResponse request with arbitrary body returning *PostOnboardedInvokersResponse
487 func (c *ClientWithResponses) PostOnboardedInvokersWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostOnboardedInvokersResponse, error) {
488         rsp, err := c.PostOnboardedInvokersWithBody(ctx, contentType, body, reqEditors...)
489         if err != nil {
490                 return nil, err
491         }
492         return ParsePostOnboardedInvokersResponse(rsp)
493 }
494
495 func (c *ClientWithResponses) PostOnboardedInvokersWithResponse(ctx context.Context, body PostOnboardedInvokersJSONRequestBody, reqEditors ...RequestEditorFn) (*PostOnboardedInvokersResponse, error) {
496         rsp, err := c.PostOnboardedInvokers(ctx, body, reqEditors...)
497         if err != nil {
498                 return nil, err
499         }
500         return ParsePostOnboardedInvokersResponse(rsp)
501 }
502
503 // DeleteOnboardedInvokersOnboardingIdWithResponse request returning *DeleteOnboardedInvokersOnboardingIdResponse
504 func (c *ClientWithResponses) DeleteOnboardedInvokersOnboardingIdWithResponse(ctx context.Context, onboardingId string, reqEditors ...RequestEditorFn) (*DeleteOnboardedInvokersOnboardingIdResponse, error) {
505         rsp, err := c.DeleteOnboardedInvokersOnboardingId(ctx, onboardingId, reqEditors...)
506         if err != nil {
507                 return nil, err
508         }
509         return ParseDeleteOnboardedInvokersOnboardingIdResponse(rsp)
510 }
511
512 // ModifyIndApiInvokeEnrolmentWithBodyWithResponse request with arbitrary body returning *ModifyIndApiInvokeEnrolmentResponse
513 func (c *ClientWithResponses) ModifyIndApiInvokeEnrolmentWithBodyWithResponse(ctx context.Context, onboardingId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ModifyIndApiInvokeEnrolmentResponse, error) {
514         rsp, err := c.ModifyIndApiInvokeEnrolmentWithBody(ctx, onboardingId, contentType, body, reqEditors...)
515         if err != nil {
516                 return nil, err
517         }
518         return ParseModifyIndApiInvokeEnrolmentResponse(rsp)
519 }
520
521 // PutOnboardedInvokersOnboardingIdWithBodyWithResponse request with arbitrary body returning *PutOnboardedInvokersOnboardingIdResponse
522 func (c *ClientWithResponses) PutOnboardedInvokersOnboardingIdWithBodyWithResponse(ctx context.Context, onboardingId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutOnboardedInvokersOnboardingIdResponse, error) {
523         rsp, err := c.PutOnboardedInvokersOnboardingIdWithBody(ctx, onboardingId, contentType, body, reqEditors...)
524         if err != nil {
525                 return nil, err
526         }
527         return ParsePutOnboardedInvokersOnboardingIdResponse(rsp)
528 }
529
530 func (c *ClientWithResponses) PutOnboardedInvokersOnboardingIdWithResponse(ctx context.Context, onboardingId string, body PutOnboardedInvokersOnboardingIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutOnboardedInvokersOnboardingIdResponse, error) {
531         rsp, err := c.PutOnboardedInvokersOnboardingId(ctx, onboardingId, body, reqEditors...)
532         if err != nil {
533                 return nil, err
534         }
535         return ParsePutOnboardedInvokersOnboardingIdResponse(rsp)
536 }
537
538 // ParsePostOnboardedInvokersResponse parses an HTTP response from a PostOnboardedInvokersWithResponse call
539 func ParsePostOnboardedInvokersResponse(rsp *http.Response) (*PostOnboardedInvokersResponse, error) {
540         bodyBytes, err := ioutil.ReadAll(rsp.Body)
541         defer func() { _ = rsp.Body.Close() }()
542         if err != nil {
543                 return nil, err
544         }
545
546         response := &PostOnboardedInvokersResponse{
547                 Body:         bodyBytes,
548                 HTTPResponse: rsp,
549         }
550
551         switch {
552         case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201:
553                 var dest APIInvokerEnrolmentDetails
554                 if err := json.Unmarshal(bodyBytes, &dest); err != nil {
555                         return nil, err
556                 }
557                 response.JSON201 = &dest
558
559         }
560
561         return response, nil
562 }
563
564 // ParseDeleteOnboardedInvokersOnboardingIdResponse parses an HTTP response from a DeleteOnboardedInvokersOnboardingIdWithResponse call
565 func ParseDeleteOnboardedInvokersOnboardingIdResponse(rsp *http.Response) (*DeleteOnboardedInvokersOnboardingIdResponse, error) {
566         bodyBytes, err := ioutil.ReadAll(rsp.Body)
567         defer func() { _ = rsp.Body.Close() }()
568         if err != nil {
569                 return nil, err
570         }
571
572         response := &DeleteOnboardedInvokersOnboardingIdResponse{
573                 Body:         bodyBytes,
574                 HTTPResponse: rsp,
575         }
576
577         return response, nil
578 }
579
580 // ParseModifyIndApiInvokeEnrolmentResponse parses an HTTP response from a ModifyIndApiInvokeEnrolmentWithResponse call
581 func ParseModifyIndApiInvokeEnrolmentResponse(rsp *http.Response) (*ModifyIndApiInvokeEnrolmentResponse, error) {
582         bodyBytes, err := ioutil.ReadAll(rsp.Body)
583         defer func() { _ = rsp.Body.Close() }()
584         if err != nil {
585                 return nil, err
586         }
587
588         response := &ModifyIndApiInvokeEnrolmentResponse{
589                 Body:         bodyBytes,
590                 HTTPResponse: rsp,
591         }
592
593         switch {
594         case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
595                 var dest APIInvokerEnrolmentDetails
596                 if err := json.Unmarshal(bodyBytes, &dest); err != nil {
597                         return nil, err
598                 }
599                 response.JSON200 = &dest
600
601         }
602
603         return response, nil
604 }
605
606 // ParsePutOnboardedInvokersOnboardingIdResponse parses an HTTP response from a PutOnboardedInvokersOnboardingIdWithResponse call
607 func ParsePutOnboardedInvokersOnboardingIdResponse(rsp *http.Response) (*PutOnboardedInvokersOnboardingIdResponse, error) {
608         bodyBytes, err := ioutil.ReadAll(rsp.Body)
609         defer func() { _ = rsp.Body.Close() }()
610         if err != nil {
611                 return nil, err
612         }
613
614         response := &PutOnboardedInvokersOnboardingIdResponse{
615                 Body:         bodyBytes,
616                 HTTPResponse: rsp,
617         }
618
619         switch {
620         case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
621                 var dest APIInvokerEnrolmentDetails
622                 if err := json.Unmarshal(bodyBytes, &dest); err != nil {
623                         return nil, err
624                 }
625                 response.JSON200 = &dest
626
627         }
628
629         return response, nil
630 }