NONRTRIC-946: Add support for Kong routes
[nonrtric/plt/sme.git] / servicemanager / internal / providermanagementapi / providermanagementapi-client.gen.go
1 // Package providermanagementapi 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 providermanagementapi
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         // PostRegistrations request with any body
94         PostRegistrationsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
95
96         PostRegistrations(ctx context.Context, body PostRegistrationsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
97
98         // DeleteRegistrationsRegistrationId request
99         DeleteRegistrationsRegistrationId(ctx context.Context, registrationId string, reqEditors ...RequestEditorFn) (*http.Response, error)
100
101         // ModifyIndApiProviderEnrolment request with any body
102         ModifyIndApiProviderEnrolmentWithBody(ctx context.Context, registrationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
103
104         // PutRegistrationsRegistrationId request with any body
105         PutRegistrationsRegistrationIdWithBody(ctx context.Context, registrationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
106
107         PutRegistrationsRegistrationId(ctx context.Context, registrationId string, body PutRegistrationsRegistrationIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
108 }
109
110 func (c *Client) PostRegistrationsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
111         req, err := NewPostRegistrationsRequestWithBody(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) PostRegistrations(ctx context.Context, body PostRegistrationsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
123         req, err := NewPostRegistrationsRequest(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) DeleteRegistrationsRegistrationId(ctx context.Context, registrationId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
135         req, err := NewDeleteRegistrationsRegistrationIdRequest(c.Server, registrationId)
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) ModifyIndApiProviderEnrolmentWithBody(ctx context.Context, registrationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
147         req, err := NewModifyIndApiProviderEnrolmentRequestWithBody(c.Server, registrationId, 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) PutRegistrationsRegistrationIdWithBody(ctx context.Context, registrationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
159         req, err := NewPutRegistrationsRegistrationIdRequestWithBody(c.Server, registrationId, 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) PutRegistrationsRegistrationId(ctx context.Context, registrationId string, body PutRegistrationsRegistrationIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
171         req, err := NewPutRegistrationsRegistrationIdRequest(c.Server, registrationId, 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 // NewPostRegistrationsRequest calls the generic PostRegistrations builder with application/json body
183 func NewPostRegistrationsRequest(server string, body PostRegistrationsJSONRequestBody) (*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 NewPostRegistrationsRequestWithBody(server, "application/json", bodyReader)
191 }
192
193 // NewPostRegistrationsRequestWithBody generates requests for PostRegistrations with any type of body
194 func NewPostRegistrationsRequestWithBody(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("/registrations")
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 // NewDeleteRegistrationsRegistrationIdRequest generates requests for DeleteRegistrationsRegistrationId
223 func NewDeleteRegistrationsRegistrationIdRequest(server string, registrationId string) (*http.Request, error) {
224         var err error
225
226         var pathParam0 string
227
228         pathParam0, err = runtime.StyleParamWithLocation("simple", false, "registrationId", runtime.ParamLocationPath, registrationId)
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("/registrations/%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 // NewModifyIndApiProviderEnrolmentRequestWithBody generates requests for ModifyIndApiProviderEnrolment with any type of body
257 func NewModifyIndApiProviderEnrolmentRequestWithBody(server string, registrationId 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, "registrationId", runtime.ParamLocationPath, registrationId)
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("/registrations/%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 // NewPutRegistrationsRegistrationIdRequest calls the generic PutRegistrationsRegistrationId builder with application/json body
293 func NewPutRegistrationsRegistrationIdRequest(server string, registrationId string, body PutRegistrationsRegistrationIdJSONRequestBody) (*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 NewPutRegistrationsRegistrationIdRequestWithBody(server, registrationId, "application/json", bodyReader)
301 }
302
303 // NewPutRegistrationsRegistrationIdRequestWithBody generates requests for PutRegistrationsRegistrationId with any type of body
304 func NewPutRegistrationsRegistrationIdRequestWithBody(server string, registrationId 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, "registrationId", runtime.ParamLocationPath, registrationId)
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("/registrations/%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         // PostRegistrations request with any body
383         PostRegistrationsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostRegistrationsResponse, error)
384
385         PostRegistrationsWithResponse(ctx context.Context, body PostRegistrationsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostRegistrationsResponse, error)
386
387         // DeleteRegistrationsRegistrationId request
388         DeleteRegistrationsRegistrationIdWithResponse(ctx context.Context, registrationId string, reqEditors ...RequestEditorFn) (*DeleteRegistrationsRegistrationIdResponse, error)
389
390         // ModifyIndApiProviderEnrolment request with any body
391         ModifyIndApiProviderEnrolmentWithBodyWithResponse(ctx context.Context, registrationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ModifyIndApiProviderEnrolmentResponse, error)
392
393         // PutRegistrationsRegistrationId request with any body
394         PutRegistrationsRegistrationIdWithBodyWithResponse(ctx context.Context, registrationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutRegistrationsRegistrationIdResponse, error)
395
396         PutRegistrationsRegistrationIdWithResponse(ctx context.Context, registrationId string, body PutRegistrationsRegistrationIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutRegistrationsRegistrationIdResponse, error)
397 }
398
399 type PostRegistrationsResponse struct {
400         Body         []byte
401         HTTPResponse *http.Response
402         JSON201      *APIProviderEnrolmentDetails
403 }
404
405 // Status returns HTTPResponse.Status
406 func (r PostRegistrationsResponse) 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 PostRegistrationsResponse) StatusCode() int {
415         if r.HTTPResponse != nil {
416                 return r.HTTPResponse.StatusCode
417         }
418         return 0
419 }
420
421 type DeleteRegistrationsRegistrationIdResponse struct {
422         Body         []byte
423         HTTPResponse *http.Response
424 }
425
426 // Status returns HTTPResponse.Status
427 func (r DeleteRegistrationsRegistrationIdResponse) 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 DeleteRegistrationsRegistrationIdResponse) StatusCode() int {
436         if r.HTTPResponse != nil {
437                 return r.HTTPResponse.StatusCode
438         }
439         return 0
440 }
441
442 type ModifyIndApiProviderEnrolmentResponse struct {
443         Body         []byte
444         HTTPResponse *http.Response
445         JSON200      *APIProviderEnrolmentDetails
446 }
447
448 // Status returns HTTPResponse.Status
449 func (r ModifyIndApiProviderEnrolmentResponse) 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 ModifyIndApiProviderEnrolmentResponse) StatusCode() int {
458         if r.HTTPResponse != nil {
459                 return r.HTTPResponse.StatusCode
460         }
461         return 0
462 }
463
464 type PutRegistrationsRegistrationIdResponse struct {
465         Body         []byte
466         HTTPResponse *http.Response
467         JSON200      *APIProviderEnrolmentDetails
468 }
469
470 // Status returns HTTPResponse.Status
471 func (r PutRegistrationsRegistrationIdResponse) 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 PutRegistrationsRegistrationIdResponse) StatusCode() int {
480         if r.HTTPResponse != nil {
481                 return r.HTTPResponse.StatusCode
482         }
483         return 0
484 }
485
486 // PostRegistrationsWithBodyWithResponse request with arbitrary body returning *PostRegistrationsResponse
487 func (c *ClientWithResponses) PostRegistrationsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostRegistrationsResponse, error) {
488         rsp, err := c.PostRegistrationsWithBody(ctx, contentType, body, reqEditors...)
489         if err != nil {
490                 return nil, err
491         }
492         return ParsePostRegistrationsResponse(rsp)
493 }
494
495 func (c *ClientWithResponses) PostRegistrationsWithResponse(ctx context.Context, body PostRegistrationsJSONRequestBody, reqEditors ...RequestEditorFn) (*PostRegistrationsResponse, error) {
496         rsp, err := c.PostRegistrations(ctx, body, reqEditors...)
497         if err != nil {
498                 return nil, err
499         }
500         return ParsePostRegistrationsResponse(rsp)
501 }
502
503 // DeleteRegistrationsRegistrationIdWithResponse request returning *DeleteRegistrationsRegistrationIdResponse
504 func (c *ClientWithResponses) DeleteRegistrationsRegistrationIdWithResponse(ctx context.Context, registrationId string, reqEditors ...RequestEditorFn) (*DeleteRegistrationsRegistrationIdResponse, error) {
505         rsp, err := c.DeleteRegistrationsRegistrationId(ctx, registrationId, reqEditors...)
506         if err != nil {
507                 return nil, err
508         }
509         return ParseDeleteRegistrationsRegistrationIdResponse(rsp)
510 }
511
512 // ModifyIndApiProviderEnrolmentWithBodyWithResponse request with arbitrary body returning *ModifyIndApiProviderEnrolmentResponse
513 func (c *ClientWithResponses) ModifyIndApiProviderEnrolmentWithBodyWithResponse(ctx context.Context, registrationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ModifyIndApiProviderEnrolmentResponse, error) {
514         rsp, err := c.ModifyIndApiProviderEnrolmentWithBody(ctx, registrationId, contentType, body, reqEditors...)
515         if err != nil {
516                 return nil, err
517         }
518         return ParseModifyIndApiProviderEnrolmentResponse(rsp)
519 }
520
521 // PutRegistrationsRegistrationIdWithBodyWithResponse request with arbitrary body returning *PutRegistrationsRegistrationIdResponse
522 func (c *ClientWithResponses) PutRegistrationsRegistrationIdWithBodyWithResponse(ctx context.Context, registrationId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutRegistrationsRegistrationIdResponse, error) {
523         rsp, err := c.PutRegistrationsRegistrationIdWithBody(ctx, registrationId, contentType, body, reqEditors...)
524         if err != nil {
525                 return nil, err
526         }
527         return ParsePutRegistrationsRegistrationIdResponse(rsp)
528 }
529
530 func (c *ClientWithResponses) PutRegistrationsRegistrationIdWithResponse(ctx context.Context, registrationId string, body PutRegistrationsRegistrationIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutRegistrationsRegistrationIdResponse, error) {
531         rsp, err := c.PutRegistrationsRegistrationId(ctx, registrationId, body, reqEditors...)
532         if err != nil {
533                 return nil, err
534         }
535         return ParsePutRegistrationsRegistrationIdResponse(rsp)
536 }
537
538 // ParsePostRegistrationsResponse parses an HTTP response from a PostRegistrationsWithResponse call
539 func ParsePostRegistrationsResponse(rsp *http.Response) (*PostRegistrationsResponse, 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 := &PostRegistrationsResponse{
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 APIProviderEnrolmentDetails
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 // ParseDeleteRegistrationsRegistrationIdResponse parses an HTTP response from a DeleteRegistrationsRegistrationIdWithResponse call
565 func ParseDeleteRegistrationsRegistrationIdResponse(rsp *http.Response) (*DeleteRegistrationsRegistrationIdResponse, 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 := &DeleteRegistrationsRegistrationIdResponse{
573                 Body:         bodyBytes,
574                 HTTPResponse: rsp,
575         }
576
577         return response, nil
578 }
579
580 // ParseModifyIndApiProviderEnrolmentResponse parses an HTTP response from a ModifyIndApiProviderEnrolmentWithResponse call
581 func ParseModifyIndApiProviderEnrolmentResponse(rsp *http.Response) (*ModifyIndApiProviderEnrolmentResponse, 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 := &ModifyIndApiProviderEnrolmentResponse{
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 APIProviderEnrolmentDetails
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 // ParsePutRegistrationsRegistrationIdResponse parses an HTTP response from a PutRegistrationsRegistrationIdWithResponse call
607 func ParsePutRegistrationsRegistrationIdResponse(rsp *http.Response) (*PutRegistrationsRegistrationIdResponse, 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 := &PutRegistrationsRegistrationIdResponse{
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 APIProviderEnrolmentDetails
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 }