Moving RMR message reciver into go routine
[ric-plt/a1.git] / a1-go / pkg / restapi / operations / a1_mediator / a1_controller_delete_policy_instance_urlbuilder.go
1 /*
2 ==================================================================================
3   Copyright (c) 2021 Samsung
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16
17    This source code is part of the near-RT RIC (RAN Intelligent Controller)
18    platform project (RICP).
19 ==================================================================================
20 */
21 // Code generated by go-swagger; DO NOT EDIT.
22
23 package a1_mediator
24
25 // This file was generated by the swagger tool.
26 // Editing this file might prove futile when you re-run the generate command
27
28 import (
29         "errors"
30         "net/url"
31         golangswaggerpaths "path"
32         "strings"
33
34         "github.com/go-openapi/swag"
35 )
36
37 // A1ControllerDeletePolicyInstanceURL generates an URL for the a1 controller delete policy instance operation
38 type A1ControllerDeletePolicyInstanceURL struct {
39         PolicyInstanceID string
40         PolicyTypeID     int64
41
42         _basePath string
43         // avoid unkeyed usage
44         _ struct{}
45 }
46
47 // WithBasePath sets the base path for this url builder, only required when it's different from the
48 // base path specified in the swagger spec.
49 // When the value of the base path is an empty string
50 func (o *A1ControllerDeletePolicyInstanceURL) WithBasePath(bp string) *A1ControllerDeletePolicyInstanceURL {
51         o.SetBasePath(bp)
52         return o
53 }
54
55 // SetBasePath sets the base path for this url builder, only required when it's different from the
56 // base path specified in the swagger spec.
57 // When the value of the base path is an empty string
58 func (o *A1ControllerDeletePolicyInstanceURL) SetBasePath(bp string) {
59         o._basePath = bp
60 }
61
62 // Build a url path and query string
63 func (o *A1ControllerDeletePolicyInstanceURL) Build() (*url.URL, error) {
64         var _result url.URL
65
66         var _path = "/a1-p/policytypes/{policy_type_id}/policies/{policy_instance_id}"
67
68         policyInstanceID := o.PolicyInstanceID
69         if policyInstanceID != "" {
70                 _path = strings.Replace(_path, "{policy_instance_id}", policyInstanceID, -1)
71         } else {
72                 return nil, errors.New("policyInstanceId is required on A1ControllerDeletePolicyInstanceURL")
73         }
74
75         policyTypeID := swag.FormatInt64(o.PolicyTypeID)
76         if policyTypeID != "" {
77                 _path = strings.Replace(_path, "{policy_type_id}", policyTypeID, -1)
78         } else {
79                 return nil, errors.New("policyTypeId is required on A1ControllerDeletePolicyInstanceURL")
80         }
81
82         _basePath := o._basePath
83         _result.Path = golangswaggerpaths.Join(_basePath, _path)
84
85         return &_result, nil
86 }
87
88 // Must is a helper function to panic when the url builder returns an error
89 func (o *A1ControllerDeletePolicyInstanceURL) Must(u *url.URL, err error) *url.URL {
90         if err != nil {
91                 panic(err)
92         }
93         if u == nil {
94                 panic("url can't be nil")
95         }
96         return u
97 }
98
99 // String returns the string representation of the path with query string
100 func (o *A1ControllerDeletePolicyInstanceURL) String() string {
101         return o.Must(o.Build()).String()
102 }
103
104 // BuildFull builds a full url with scheme, host, path and query string
105 func (o *A1ControllerDeletePolicyInstanceURL) BuildFull(scheme, host string) (*url.URL, error) {
106         if scheme == "" {
107                 return nil, errors.New("scheme is required for a full url on A1ControllerDeletePolicyInstanceURL")
108         }
109         if host == "" {
110                 return nil, errors.New("host is required for a full url on A1ControllerDeletePolicyInstanceURL")
111         }
112
113         base, err := o.Build()
114         if err != nil {
115                 return nil, err
116         }
117
118         base.Scheme = scheme
119         base.Host = host
120         return base, nil
121 }
122
123 // StringFull returns the string representation of a complete url
124 func (o *A1ControllerDeletePolicyInstanceURL) StringFull(scheme, host string) string {
125         return o.Must(o.BuildFull(scheme, host)).String()
126 }