elinuxhenrik | c727c84 | 2022-02-11 08:29:36 +0100 | [diff] [blame] | 1 | # - |
| 2 | # ========================LICENSE_START================================= |
| 3 | # O-RAN-SC |
| 4 | # %% |
| 5 | # Copyright (C) 2022: Nordix Foundation |
| 6 | # %% |
| 7 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | # you may not use this file except in compliance with the License. |
| 9 | # You may obtain a copy of the License at |
| 10 | # |
| 11 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | # |
| 13 | # Unless required by applicable law or agreed to in writing, software |
| 14 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | # See the License for the specific language governing permissions and |
| 17 | # limitations under the License. |
| 18 | # ========================LICENSE_END=================================== |
| 19 | # |
| 20 | |
| 21 | cwd=$(pwd) |
| 22 | |
| 23 | mkdir internal/readonly/api |
| 24 | |
| 25 | curl https://www.3gpp.org/ftp/Specs/archive/29_series/29.222/29222-g70.zip -o internal/readonly/api/apidef.zip |
| 26 | curl https://www.3gpp.org/ftp/Specs/archive/29_series/29.122/29122-g70.zip -o internal/readonly/api/commonapidef.zip |
| 27 | curl https://www.3gpp.org/ftp/Specs/archive/29_series/29.571/29571-g70.zip -o internal/readonly/api/common29571apidef.zip |
elinuxhenrik | c727c84 | 2022-02-11 08:29:36 +0100 | [diff] [blame] | 28 | |
| 29 | cd internal/readonly/api/ |
| 30 | |
| 31 | jar xvf apidef.zip |
| 32 | jar xvf commonapidef.zip |
| 33 | jar xvf common29571apidef.zip |
elinuxhenrik | c727c84 | 2022-02-11 08:29:36 +0100 | [diff] [blame] | 34 | |
| 35 | sed -e 'H;x;/^\( *\)\n\1/{s/\n.*//;x;d;}' -e 's/.*//;x;/\LocationArea/{s/^\( *\).*/ \1/;x;d;}' TS29122_CommonData.yaml >temp.yaml |
| 36 | mv temp.yaml TS29122_CommonData.yaml |
| 37 | sed -e 'H;x;/^\( *\)\n\1/{s/\n.*//;x;d;}' -e 's/.*//;x;/\DddTrafficDescriptor/{s/^\( *\).*/ \1/;x;d;}' TS29571_CommonData.yaml >temp.yaml |
| 38 | mv temp.yaml TS29571_CommonData.yaml |
| 39 | sed '/accessTokenError.*/,+3d' TS29571_CommonData.yaml >temp.yaml |
| 40 | mv temp.yaml TS29571_CommonData.yaml |
| 41 | sed '/accessTokenRequest.*/,+3d' TS29571_CommonData.yaml >temp.yaml |
| 42 | mv temp.yaml TS29571_CommonData.yaml |
elinuxhenrik | 667fbf3 | 2022-02-18 11:10:07 +0100 | [diff] [blame^] | 43 | sed '/oneOf.*/,+2d' TS29222_CAPIF_Publish_Service_API.yaml >temp.yaml |
| 44 | mv temp.yaml TS29222_CAPIF_Publish_Service_API.yaml |
elinuxhenrik | c727c84 | 2022-02-11 08:29:36 +0100 | [diff] [blame] | 45 | |
| 46 | cd $cwd |
| 47 | |
| 48 | oapi-codegen --config internal/readonly/common/generator_settings.yaml internal/readonly/api/TS29122_CommonData.yaml |
| 49 | oapi-codegen --config internal/readonly/common29571/generator_settings.yaml internal/readonly/api/TS29571_CommonData.yaml |
elinuxhenrik | d1cc571 | 2022-02-17 14:50:50 +0100 | [diff] [blame] | 50 | oapi-codegen --config internal/readonly/publishserviceapi/generator_settings_types.yaml internal/readonly/api/TS29222_CAPIF_Publish_Service_API.yaml |
| 51 | oapi-codegen --config internal/readonly/publishserviceapi/generator_settings_server.yaml internal/readonly/api/TS29222_CAPIF_Publish_Service_API.yaml |
| 52 | oapi-codegen --config internal/readonly/invokermanagementapi/generator_settings_types.yaml internal/readonly/api/TS29222_CAPIF_API_Invoker_Management_API.yaml |
| 53 | oapi-codegen --config internal/readonly/invokermanagementapi/generator_settings_server.yaml internal/readonly/api/TS29222_CAPIF_API_Invoker_Management_API.yaml |
| 54 | oapi-codegen --config internal/readonly/providermanagementapi/generator_settings_types.yaml internal/readonly/api/TS29222_CAPIF_API_Provider_Management_API.yaml |
| 55 | oapi-codegen --config internal/readonly/providermanagementapi/generator_settings_server.yaml internal/readonly/api/TS29222_CAPIF_API_Provider_Management_API.yaml |