NONRTRIC-946: Add support for Kong routes
[nonrtric/plt/sme.git] / servicemanager / internal / publishserviceapi / publishserviceapi-client.gen.go
1 // Package publishserviceapi 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 publishserviceapi
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         // GetApfIdServiceApis request
94         GetApfIdServiceApis(ctx context.Context, apfId string, reqEditors ...RequestEditorFn) (*http.Response, error)
95
96         // PostApfIdServiceApis request with any body
97         PostApfIdServiceApisWithBody(ctx context.Context, apfId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
98
99         PostApfIdServiceApis(ctx context.Context, apfId string, body PostApfIdServiceApisJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
100
101         // DeleteApfIdServiceApisServiceApiId request
102         DeleteApfIdServiceApisServiceApiId(ctx context.Context, apfId string, serviceApiId string, reqEditors ...RequestEditorFn) (*http.Response, error)
103
104         // GetApfIdServiceApisServiceApiId request
105         GetApfIdServiceApisServiceApiId(ctx context.Context, apfId string, serviceApiId string, reqEditors ...RequestEditorFn) (*http.Response, error)
106
107         // ModifyIndAPFPubAPI request with any body
108         ModifyIndAPFPubAPIWithBody(ctx context.Context, apfId string, serviceApiId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
109
110         // PutApfIdServiceApisServiceApiId request with any body
111         PutApfIdServiceApisServiceApiIdWithBody(ctx context.Context, apfId string, serviceApiId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
112
113         PutApfIdServiceApisServiceApiId(ctx context.Context, apfId string, serviceApiId string, body PutApfIdServiceApisServiceApiIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
114 }
115
116 func (c *Client) GetApfIdServiceApis(ctx context.Context, apfId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
117         req, err := NewGetApfIdServiceApisRequest(c.Server, apfId)
118         if err != nil {
119                 return nil, err
120         }
121         req = req.WithContext(ctx)
122         if err := c.applyEditors(ctx, req, reqEditors); err != nil {
123                 return nil, err
124         }
125         return c.Client.Do(req)
126 }
127
128 func (c *Client) PostApfIdServiceApisWithBody(ctx context.Context, apfId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
129         req, err := NewPostApfIdServiceApisRequestWithBody(c.Server, apfId, contentType, body)
130         if err != nil {
131                 return nil, err
132         }
133         req = req.WithContext(ctx)
134         if err := c.applyEditors(ctx, req, reqEditors); err != nil {
135                 return nil, err
136         }
137         return c.Client.Do(req)
138 }
139
140 func (c *Client) PostApfIdServiceApis(ctx context.Context, apfId string, body PostApfIdServiceApisJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
141         req, err := NewPostApfIdServiceApisRequest(c.Server, apfId, body)
142         if err != nil {
143                 return nil, err
144         }
145         req = req.WithContext(ctx)
146         if err := c.applyEditors(ctx, req, reqEditors); err != nil {
147                 return nil, err
148         }
149         return c.Client.Do(req)
150 }
151
152 func (c *Client) DeleteApfIdServiceApisServiceApiId(ctx context.Context, apfId string, serviceApiId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
153         req, err := NewDeleteApfIdServiceApisServiceApiIdRequest(c.Server, apfId, serviceApiId)
154         if err != nil {
155                 return nil, err
156         }
157         req = req.WithContext(ctx)
158         if err := c.applyEditors(ctx, req, reqEditors); err != nil {
159                 return nil, err
160         }
161         return c.Client.Do(req)
162 }
163
164 func (c *Client) GetApfIdServiceApisServiceApiId(ctx context.Context, apfId string, serviceApiId string, reqEditors ...RequestEditorFn) (*http.Response, error) {
165         req, err := NewGetApfIdServiceApisServiceApiIdRequest(c.Server, apfId, serviceApiId)
166         if err != nil {
167                 return nil, err
168         }
169         req = req.WithContext(ctx)
170         if err := c.applyEditors(ctx, req, reqEditors); err != nil {
171                 return nil, err
172         }
173         return c.Client.Do(req)
174 }
175
176 func (c *Client) ModifyIndAPFPubAPIWithBody(ctx context.Context, apfId string, serviceApiId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
177         req, err := NewModifyIndAPFPubAPIRequestWithBody(c.Server, apfId, serviceApiId, contentType, body)
178         if err != nil {
179                 return nil, err
180         }
181         req = req.WithContext(ctx)
182         if err := c.applyEditors(ctx, req, reqEditors); err != nil {
183                 return nil, err
184         }
185         return c.Client.Do(req)
186 }
187
188 func (c *Client) PutApfIdServiceApisServiceApiIdWithBody(ctx context.Context, apfId string, serviceApiId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) {
189         req, err := NewPutApfIdServiceApisServiceApiIdRequestWithBody(c.Server, apfId, serviceApiId, contentType, body)
190         if err != nil {
191                 return nil, err
192         }
193         req = req.WithContext(ctx)
194         if err := c.applyEditors(ctx, req, reqEditors); err != nil {
195                 return nil, err
196         }
197         return c.Client.Do(req)
198 }
199
200 func (c *Client) PutApfIdServiceApisServiceApiId(ctx context.Context, apfId string, serviceApiId string, body PutApfIdServiceApisServiceApiIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) {
201         req, err := NewPutApfIdServiceApisServiceApiIdRequest(c.Server, apfId, serviceApiId, body)
202         if err != nil {
203                 return nil, err
204         }
205         req = req.WithContext(ctx)
206         if err := c.applyEditors(ctx, req, reqEditors); err != nil {
207                 return nil, err
208         }
209         return c.Client.Do(req)
210 }
211
212 // NewGetApfIdServiceApisRequest generates requests for GetApfIdServiceApis
213 func NewGetApfIdServiceApisRequest(server string, apfId string) (*http.Request, error) {
214         var err error
215
216         var pathParam0 string
217
218         pathParam0, err = runtime.StyleParamWithLocation("simple", false, "apfId", runtime.ParamLocationPath, apfId)
219         if err != nil {
220                 return nil, err
221         }
222
223         serverURL, err := url.Parse(server)
224         if err != nil {
225                 return nil, err
226         }
227
228         operationPath := fmt.Sprintf("/%s/service-apis", pathParam0)
229         if operationPath[0] == '/' {
230                 operationPath = "." + operationPath
231         }
232
233         queryURL, err := serverURL.Parse(operationPath)
234         if err != nil {
235                 return nil, err
236         }
237
238         req, err := http.NewRequest("GET", queryURL.String(), nil)
239         if err != nil {
240                 return nil, err
241         }
242
243         return req, nil
244 }
245
246 // NewPostApfIdServiceApisRequest calls the generic PostApfIdServiceApis builder with application/json body
247 func NewPostApfIdServiceApisRequest(server string, apfId string, body PostApfIdServiceApisJSONRequestBody) (*http.Request, error) {
248         var bodyReader io.Reader
249         buf, err := json.Marshal(body)
250         if err != nil {
251                 return nil, err
252         }
253         bodyReader = bytes.NewReader(buf)
254         return NewPostApfIdServiceApisRequestWithBody(server, apfId, "application/json", bodyReader)
255 }
256
257 // NewPostApfIdServiceApisRequestWithBody generates requests for PostApfIdServiceApis with any type of body
258 func NewPostApfIdServiceApisRequestWithBody(server string, apfId string, contentType string, body io.Reader) (*http.Request, error) {
259         var err error
260
261         var pathParam0 string
262
263         pathParam0, err = runtime.StyleParamWithLocation("simple", false, "apfId", runtime.ParamLocationPath, apfId)
264         if err != nil {
265                 return nil, err
266         }
267
268         serverURL, err := url.Parse(server)
269         if err != nil {
270                 return nil, err
271         }
272
273         operationPath := fmt.Sprintf("/%s/service-apis", pathParam0)
274         if operationPath[0] == '/' {
275                 operationPath = "." + operationPath
276         }
277
278         queryURL, err := serverURL.Parse(operationPath)
279         if err != nil {
280                 return nil, err
281         }
282
283         req, err := http.NewRequest("POST", queryURL.String(), body)
284         if err != nil {
285                 return nil, err
286         }
287
288         req.Header.Add("Content-Type", contentType)
289
290         return req, nil
291 }
292
293 // NewDeleteApfIdServiceApisServiceApiIdRequest generates requests for DeleteApfIdServiceApisServiceApiId
294 func NewDeleteApfIdServiceApisServiceApiIdRequest(server string, apfId string, serviceApiId string) (*http.Request, error) {
295         var err error
296
297         var pathParam0 string
298
299         pathParam0, err = runtime.StyleParamWithLocation("simple", false, "apfId", runtime.ParamLocationPath, apfId)
300         if err != nil {
301                 return nil, err
302         }
303
304         var pathParam1 string
305
306         pathParam1, err = runtime.StyleParamWithLocation("simple", false, "serviceApiId", runtime.ParamLocationPath, serviceApiId)
307         if err != nil {
308                 return nil, err
309         }
310
311         serverURL, err := url.Parse(server)
312         if err != nil {
313                 return nil, err
314         }
315
316         operationPath := fmt.Sprintf("/%s/service-apis/%s", pathParam0, pathParam1)
317         if operationPath[0] == '/' {
318                 operationPath = "." + operationPath
319         }
320
321         queryURL, err := serverURL.Parse(operationPath)
322         if err != nil {
323                 return nil, err
324         }
325
326         req, err := http.NewRequest("DELETE", queryURL.String(), nil)
327         if err != nil {
328                 return nil, err
329         }
330
331         return req, nil
332 }
333
334 // NewGetApfIdServiceApisServiceApiIdRequest generates requests for GetApfIdServiceApisServiceApiId
335 func NewGetApfIdServiceApisServiceApiIdRequest(server string, apfId string, serviceApiId string) (*http.Request, error) {
336         var err error
337
338         var pathParam0 string
339
340         pathParam0, err = runtime.StyleParamWithLocation("simple", false, "apfId", runtime.ParamLocationPath, apfId)
341         if err != nil {
342                 return nil, err
343         }
344
345         var pathParam1 string
346
347         pathParam1, err = runtime.StyleParamWithLocation("simple", false, "serviceApiId", runtime.ParamLocationPath, serviceApiId)
348         if err != nil {
349                 return nil, err
350         }
351
352         serverURL, err := url.Parse(server)
353         if err != nil {
354                 return nil, err
355         }
356
357         operationPath := fmt.Sprintf("/%s/service-apis/%s", pathParam0, pathParam1)
358         if operationPath[0] == '/' {
359                 operationPath = "." + operationPath
360         }
361
362         queryURL, err := serverURL.Parse(operationPath)
363         if err != nil {
364                 return nil, err
365         }
366
367         req, err := http.NewRequest("GET", queryURL.String(), nil)
368         if err != nil {
369                 return nil, err
370         }
371
372         return req, nil
373 }
374
375 // NewModifyIndAPFPubAPIRequestWithBody generates requests for ModifyIndAPFPubAPI with any type of body
376 func NewModifyIndAPFPubAPIRequestWithBody(server string, apfId string, serviceApiId string, contentType string, body io.Reader) (*http.Request, error) {
377         var err error
378
379         var pathParam0 string
380
381         pathParam0, err = runtime.StyleParamWithLocation("simple", false, "apfId", runtime.ParamLocationPath, apfId)
382         if err != nil {
383                 return nil, err
384         }
385
386         var pathParam1 string
387
388         pathParam1, err = runtime.StyleParamWithLocation("simple", false, "serviceApiId", runtime.ParamLocationPath, serviceApiId)
389         if err != nil {
390                 return nil, err
391         }
392
393         serverURL, err := url.Parse(server)
394         if err != nil {
395                 return nil, err
396         }
397
398         operationPath := fmt.Sprintf("/%s/service-apis/%s", pathParam0, pathParam1)
399         if operationPath[0] == '/' {
400                 operationPath = "." + operationPath
401         }
402
403         queryURL, err := serverURL.Parse(operationPath)
404         if err != nil {
405                 return nil, err
406         }
407
408         req, err := http.NewRequest("PATCH", queryURL.String(), body)
409         if err != nil {
410                 return nil, err
411         }
412
413         req.Header.Add("Content-Type", contentType)
414
415         return req, nil
416 }
417
418 // NewPutApfIdServiceApisServiceApiIdRequest calls the generic PutApfIdServiceApisServiceApiId builder with application/json body
419 func NewPutApfIdServiceApisServiceApiIdRequest(server string, apfId string, serviceApiId string, body PutApfIdServiceApisServiceApiIdJSONRequestBody) (*http.Request, error) {
420         var bodyReader io.Reader
421         buf, err := json.Marshal(body)
422         if err != nil {
423                 return nil, err
424         }
425         bodyReader = bytes.NewReader(buf)
426         return NewPutApfIdServiceApisServiceApiIdRequestWithBody(server, apfId, serviceApiId, "application/json", bodyReader)
427 }
428
429 // NewPutApfIdServiceApisServiceApiIdRequestWithBody generates requests for PutApfIdServiceApisServiceApiId with any type of body
430 func NewPutApfIdServiceApisServiceApiIdRequestWithBody(server string, apfId string, serviceApiId string, contentType string, body io.Reader) (*http.Request, error) {
431         var err error
432
433         var pathParam0 string
434
435         pathParam0, err = runtime.StyleParamWithLocation("simple", false, "apfId", runtime.ParamLocationPath, apfId)
436         if err != nil {
437                 return nil, err
438         }
439
440         var pathParam1 string
441
442         pathParam1, err = runtime.StyleParamWithLocation("simple", false, "serviceApiId", runtime.ParamLocationPath, serviceApiId)
443         if err != nil {
444                 return nil, err
445         }
446
447         serverURL, err := url.Parse(server)
448         if err != nil {
449                 return nil, err
450         }
451
452         operationPath := fmt.Sprintf("/%s/service-apis/%s", pathParam0, pathParam1)
453         if operationPath[0] == '/' {
454                 operationPath = "." + operationPath
455         }
456
457         queryURL, err := serverURL.Parse(operationPath)
458         if err != nil {
459                 return nil, err
460         }
461
462         req, err := http.NewRequest("PUT", queryURL.String(), body)
463         if err != nil {
464                 return nil, err
465         }
466
467         req.Header.Add("Content-Type", contentType)
468
469         return req, nil
470 }
471
472 func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error {
473         for _, r := range c.RequestEditors {
474                 if err := r(ctx, req); err != nil {
475                         return err
476                 }
477         }
478         for _, r := range additionalEditors {
479                 if err := r(ctx, req); err != nil {
480                         return err
481                 }
482         }
483         return nil
484 }
485
486 // ClientWithResponses builds on ClientInterface to offer response payloads
487 type ClientWithResponses struct {
488         ClientInterface
489 }
490
491 // NewClientWithResponses creates a new ClientWithResponses, which wraps
492 // Client with return type handling
493 func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) {
494         client, err := NewClient(server, opts...)
495         if err != nil {
496                 return nil, err
497         }
498         return &ClientWithResponses{client}, nil
499 }
500
501 // WithBaseURL overrides the baseURL.
502 func WithBaseURL(baseURL string) ClientOption {
503         return func(c *Client) error {
504                 newBaseURL, err := url.Parse(baseURL)
505                 if err != nil {
506                         return err
507                 }
508                 c.Server = newBaseURL.String()
509                 return nil
510         }
511 }
512
513 // ClientWithResponsesInterface is the interface specification for the client with responses above.
514 type ClientWithResponsesInterface interface {
515         // GetApfIdServiceApis request
516         GetApfIdServiceApisWithResponse(ctx context.Context, apfId string, reqEditors ...RequestEditorFn) (*GetApfIdServiceApisResponse, error)
517
518         // PostApfIdServiceApis request with any body
519         PostApfIdServiceApisWithBodyWithResponse(ctx context.Context, apfId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApfIdServiceApisResponse, error)
520
521         PostApfIdServiceApisWithResponse(ctx context.Context, apfId string, body PostApfIdServiceApisJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApfIdServiceApisResponse, error)
522
523         // DeleteApfIdServiceApisServiceApiId request
524         DeleteApfIdServiceApisServiceApiIdWithResponse(ctx context.Context, apfId string, serviceApiId string, reqEditors ...RequestEditorFn) (*DeleteApfIdServiceApisServiceApiIdResponse, error)
525
526         // GetApfIdServiceApisServiceApiId request
527         GetApfIdServiceApisServiceApiIdWithResponse(ctx context.Context, apfId string, serviceApiId string, reqEditors ...RequestEditorFn) (*GetApfIdServiceApisServiceApiIdResponse, error)
528
529         // ModifyIndAPFPubAPI request with any body
530         ModifyIndAPFPubAPIWithBodyWithResponse(ctx context.Context, apfId string, serviceApiId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ModifyIndAPFPubAPIResponse, error)
531
532         // PutApfIdServiceApisServiceApiId request with any body
533         PutApfIdServiceApisServiceApiIdWithBodyWithResponse(ctx context.Context, apfId string, serviceApiId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutApfIdServiceApisServiceApiIdResponse, error)
534
535         PutApfIdServiceApisServiceApiIdWithResponse(ctx context.Context, apfId string, serviceApiId string, body PutApfIdServiceApisServiceApiIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutApfIdServiceApisServiceApiIdResponse, error)
536 }
537
538 type GetApfIdServiceApisResponse struct {
539         Body         []byte
540         HTTPResponse *http.Response
541         JSON200      *[]ServiceAPIDescription
542 }
543
544 // Status returns HTTPResponse.Status
545 func (r GetApfIdServiceApisResponse) Status() string {
546         if r.HTTPResponse != nil {
547                 return r.HTTPResponse.Status
548         }
549         return http.StatusText(0)
550 }
551
552 // StatusCode returns HTTPResponse.StatusCode
553 func (r GetApfIdServiceApisResponse) StatusCode() int {
554         if r.HTTPResponse != nil {
555                 return r.HTTPResponse.StatusCode
556         }
557         return 0
558 }
559
560 type PostApfIdServiceApisResponse struct {
561         Body         []byte
562         HTTPResponse *http.Response
563         JSON201      *ServiceAPIDescription
564 }
565
566 // Status returns HTTPResponse.Status
567 func (r PostApfIdServiceApisResponse) Status() string {
568         if r.HTTPResponse != nil {
569                 return r.HTTPResponse.Status
570         }
571         return http.StatusText(0)
572 }
573
574 // StatusCode returns HTTPResponse.StatusCode
575 func (r PostApfIdServiceApisResponse) StatusCode() int {
576         if r.HTTPResponse != nil {
577                 return r.HTTPResponse.StatusCode
578         }
579         return 0
580 }
581
582 type DeleteApfIdServiceApisServiceApiIdResponse struct {
583         Body         []byte
584         HTTPResponse *http.Response
585 }
586
587 // Status returns HTTPResponse.Status
588 func (r DeleteApfIdServiceApisServiceApiIdResponse) Status() string {
589         if r.HTTPResponse != nil {
590                 return r.HTTPResponse.Status
591         }
592         return http.StatusText(0)
593 }
594
595 // StatusCode returns HTTPResponse.StatusCode
596 func (r DeleteApfIdServiceApisServiceApiIdResponse) StatusCode() int {
597         if r.HTTPResponse != nil {
598                 return r.HTTPResponse.StatusCode
599         }
600         return 0
601 }
602
603 type GetApfIdServiceApisServiceApiIdResponse struct {
604         Body         []byte
605         HTTPResponse *http.Response
606         JSON200      *ServiceAPIDescription
607 }
608
609 // Status returns HTTPResponse.Status
610 func (r GetApfIdServiceApisServiceApiIdResponse) Status() string {
611         if r.HTTPResponse != nil {
612                 return r.HTTPResponse.Status
613         }
614         return http.StatusText(0)
615 }
616
617 // StatusCode returns HTTPResponse.StatusCode
618 func (r GetApfIdServiceApisServiceApiIdResponse) StatusCode() int {
619         if r.HTTPResponse != nil {
620                 return r.HTTPResponse.StatusCode
621         }
622         return 0
623 }
624
625 type ModifyIndAPFPubAPIResponse struct {
626         Body         []byte
627         HTTPResponse *http.Response
628         JSON200      *ServiceAPIDescription
629 }
630
631 // Status returns HTTPResponse.Status
632 func (r ModifyIndAPFPubAPIResponse) Status() string {
633         if r.HTTPResponse != nil {
634                 return r.HTTPResponse.Status
635         }
636         return http.StatusText(0)
637 }
638
639 // StatusCode returns HTTPResponse.StatusCode
640 func (r ModifyIndAPFPubAPIResponse) StatusCode() int {
641         if r.HTTPResponse != nil {
642                 return r.HTTPResponse.StatusCode
643         }
644         return 0
645 }
646
647 type PutApfIdServiceApisServiceApiIdResponse struct {
648         Body         []byte
649         HTTPResponse *http.Response
650         JSON200      *ServiceAPIDescription
651 }
652
653 // Status returns HTTPResponse.Status
654 func (r PutApfIdServiceApisServiceApiIdResponse) Status() string {
655         if r.HTTPResponse != nil {
656                 return r.HTTPResponse.Status
657         }
658         return http.StatusText(0)
659 }
660
661 // StatusCode returns HTTPResponse.StatusCode
662 func (r PutApfIdServiceApisServiceApiIdResponse) StatusCode() int {
663         if r.HTTPResponse != nil {
664                 return r.HTTPResponse.StatusCode
665         }
666         return 0
667 }
668
669 // GetApfIdServiceApisWithResponse request returning *GetApfIdServiceApisResponse
670 func (c *ClientWithResponses) GetApfIdServiceApisWithResponse(ctx context.Context, apfId string, reqEditors ...RequestEditorFn) (*GetApfIdServiceApisResponse, error) {
671         rsp, err := c.GetApfIdServiceApis(ctx, apfId, reqEditors...)
672         if err != nil {
673                 return nil, err
674         }
675         return ParseGetApfIdServiceApisResponse(rsp)
676 }
677
678 // PostApfIdServiceApisWithBodyWithResponse request with arbitrary body returning *PostApfIdServiceApisResponse
679 func (c *ClientWithResponses) PostApfIdServiceApisWithBodyWithResponse(ctx context.Context, apfId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PostApfIdServiceApisResponse, error) {
680         rsp, err := c.PostApfIdServiceApisWithBody(ctx, apfId, contentType, body, reqEditors...)
681         if err != nil {
682                 return nil, err
683         }
684         return ParsePostApfIdServiceApisResponse(rsp)
685 }
686
687 func (c *ClientWithResponses) PostApfIdServiceApisWithResponse(ctx context.Context, apfId string, body PostApfIdServiceApisJSONRequestBody, reqEditors ...RequestEditorFn) (*PostApfIdServiceApisResponse, error) {
688         rsp, err := c.PostApfIdServiceApis(ctx, apfId, body, reqEditors...)
689         if err != nil {
690                 return nil, err
691         }
692         return ParsePostApfIdServiceApisResponse(rsp)
693 }
694
695 // DeleteApfIdServiceApisServiceApiIdWithResponse request returning *DeleteApfIdServiceApisServiceApiIdResponse
696 func (c *ClientWithResponses) DeleteApfIdServiceApisServiceApiIdWithResponse(ctx context.Context, apfId string, serviceApiId string, reqEditors ...RequestEditorFn) (*DeleteApfIdServiceApisServiceApiIdResponse, error) {
697         rsp, err := c.DeleteApfIdServiceApisServiceApiId(ctx, apfId, serviceApiId, reqEditors...)
698         if err != nil {
699                 return nil, err
700         }
701         return ParseDeleteApfIdServiceApisServiceApiIdResponse(rsp)
702 }
703
704 // GetApfIdServiceApisServiceApiIdWithResponse request returning *GetApfIdServiceApisServiceApiIdResponse
705 func (c *ClientWithResponses) GetApfIdServiceApisServiceApiIdWithResponse(ctx context.Context, apfId string, serviceApiId string, reqEditors ...RequestEditorFn) (*GetApfIdServiceApisServiceApiIdResponse, error) {
706         rsp, err := c.GetApfIdServiceApisServiceApiId(ctx, apfId, serviceApiId, reqEditors...)
707         if err != nil {
708                 return nil, err
709         }
710         return ParseGetApfIdServiceApisServiceApiIdResponse(rsp)
711 }
712
713 // ModifyIndAPFPubAPIWithBodyWithResponse request with arbitrary body returning *ModifyIndAPFPubAPIResponse
714 func (c *ClientWithResponses) ModifyIndAPFPubAPIWithBodyWithResponse(ctx context.Context, apfId string, serviceApiId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ModifyIndAPFPubAPIResponse, error) {
715         rsp, err := c.ModifyIndAPFPubAPIWithBody(ctx, apfId, serviceApiId, contentType, body, reqEditors...)
716         if err != nil {
717                 return nil, err
718         }
719         return ParseModifyIndAPFPubAPIResponse(rsp)
720 }
721
722 // PutApfIdServiceApisServiceApiIdWithBodyWithResponse request with arbitrary body returning *PutApfIdServiceApisServiceApiIdResponse
723 func (c *ClientWithResponses) PutApfIdServiceApisServiceApiIdWithBodyWithResponse(ctx context.Context, apfId string, serviceApiId string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutApfIdServiceApisServiceApiIdResponse, error) {
724         rsp, err := c.PutApfIdServiceApisServiceApiIdWithBody(ctx, apfId, serviceApiId, contentType, body, reqEditors...)
725         if err != nil {
726                 return nil, err
727         }
728         return ParsePutApfIdServiceApisServiceApiIdResponse(rsp)
729 }
730
731 func (c *ClientWithResponses) PutApfIdServiceApisServiceApiIdWithResponse(ctx context.Context, apfId string, serviceApiId string, body PutApfIdServiceApisServiceApiIdJSONRequestBody, reqEditors ...RequestEditorFn) (*PutApfIdServiceApisServiceApiIdResponse, error) {
732         rsp, err := c.PutApfIdServiceApisServiceApiId(ctx, apfId, serviceApiId, body, reqEditors...)
733         if err != nil {
734                 return nil, err
735         }
736         return ParsePutApfIdServiceApisServiceApiIdResponse(rsp)
737 }
738
739 // ParseGetApfIdServiceApisResponse parses an HTTP response from a GetApfIdServiceApisWithResponse call
740 func ParseGetApfIdServiceApisResponse(rsp *http.Response) (*GetApfIdServiceApisResponse, error) {
741         bodyBytes, err := ioutil.ReadAll(rsp.Body)
742         defer func() { _ = rsp.Body.Close() }()
743         if err != nil {
744                 return nil, err
745         }
746
747         response := &GetApfIdServiceApisResponse{
748                 Body:         bodyBytes,
749                 HTTPResponse: rsp,
750         }
751
752         switch {
753         case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
754                 var dest []ServiceAPIDescription
755                 if err := json.Unmarshal(bodyBytes, &dest); err != nil {
756                         return nil, err
757                 }
758                 response.JSON200 = &dest
759
760         }
761
762         return response, nil
763 }
764
765 // ParsePostApfIdServiceApisResponse parses an HTTP response from a PostApfIdServiceApisWithResponse call
766 func ParsePostApfIdServiceApisResponse(rsp *http.Response) (*PostApfIdServiceApisResponse, error) {
767         bodyBytes, err := ioutil.ReadAll(rsp.Body)
768         defer func() { _ = rsp.Body.Close() }()
769         if err != nil {
770                 return nil, err
771         }
772
773         response := &PostApfIdServiceApisResponse{
774                 Body:         bodyBytes,
775                 HTTPResponse: rsp,
776         }
777
778         switch {
779         case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 201:
780                 var dest ServiceAPIDescription
781                 if err := json.Unmarshal(bodyBytes, &dest); err != nil {
782                         return nil, err
783                 }
784                 response.JSON201 = &dest
785
786         }
787
788         return response, nil
789 }
790
791 // ParseDeleteApfIdServiceApisServiceApiIdResponse parses an HTTP response from a DeleteApfIdServiceApisServiceApiIdWithResponse call
792 func ParseDeleteApfIdServiceApisServiceApiIdResponse(rsp *http.Response) (*DeleteApfIdServiceApisServiceApiIdResponse, error) {
793         bodyBytes, err := ioutil.ReadAll(rsp.Body)
794         defer func() { _ = rsp.Body.Close() }()
795         if err != nil {
796                 return nil, err
797         }
798
799         response := &DeleteApfIdServiceApisServiceApiIdResponse{
800                 Body:         bodyBytes,
801                 HTTPResponse: rsp,
802         }
803
804         return response, nil
805 }
806
807 // ParseGetApfIdServiceApisServiceApiIdResponse parses an HTTP response from a GetApfIdServiceApisServiceApiIdWithResponse call
808 func ParseGetApfIdServiceApisServiceApiIdResponse(rsp *http.Response) (*GetApfIdServiceApisServiceApiIdResponse, error) {
809         bodyBytes, err := ioutil.ReadAll(rsp.Body)
810         defer func() { _ = rsp.Body.Close() }()
811         if err != nil {
812                 return nil, err
813         }
814
815         response := &GetApfIdServiceApisServiceApiIdResponse{
816                 Body:         bodyBytes,
817                 HTTPResponse: rsp,
818         }
819
820         switch {
821         case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
822                 var dest ServiceAPIDescription
823                 if err := json.Unmarshal(bodyBytes, &dest); err != nil {
824                         return nil, err
825                 }
826                 response.JSON200 = &dest
827
828         }
829
830         return response, nil
831 }
832
833 // ParseModifyIndAPFPubAPIResponse parses an HTTP response from a ModifyIndAPFPubAPIWithResponse call
834 func ParseModifyIndAPFPubAPIResponse(rsp *http.Response) (*ModifyIndAPFPubAPIResponse, error) {
835         bodyBytes, err := ioutil.ReadAll(rsp.Body)
836         defer func() { _ = rsp.Body.Close() }()
837         if err != nil {
838                 return nil, err
839         }
840
841         response := &ModifyIndAPFPubAPIResponse{
842                 Body:         bodyBytes,
843                 HTTPResponse: rsp,
844         }
845
846         switch {
847         case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
848                 var dest ServiceAPIDescription
849                 if err := json.Unmarshal(bodyBytes, &dest); err != nil {
850                         return nil, err
851                 }
852                 response.JSON200 = &dest
853
854         }
855
856         return response, nil
857 }
858
859 // ParsePutApfIdServiceApisServiceApiIdResponse parses an HTTP response from a PutApfIdServiceApisServiceApiIdWithResponse call
860 func ParsePutApfIdServiceApisServiceApiIdResponse(rsp *http.Response) (*PutApfIdServiceApisServiceApiIdResponse, error) {
861         bodyBytes, err := ioutil.ReadAll(rsp.Body)
862         defer func() { _ = rsp.Body.Close() }()
863         if err != nil {
864                 return nil, err
865         }
866
867         response := &PutApfIdServiceApisServiceApiIdResponse{
868                 Body:         bodyBytes,
869                 HTTPResponse: rsp,
870         }
871
872         switch {
873         case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200:
874                 var dest ServiceAPIDescription
875                 if err := json.Unmarshal(bodyBytes, &dest); err != nil {
876                         return nil, err
877                 }
878                 response.JSON200 = &dest
879
880         }
881
882         return response, nil
883 }