@@ -10,68 +10,32 @@ rd /s /q ..\CyberSource\apis
10
10
rd /s /q ..\CyberSource\models
11
11
rd /s /q ..\test
12
12
13
+ setlocal enabledelayedexpansion
14
+ python replaceFieldNamesForPaths.py -i cybersource-rest-spec.json -o cybersource-rest-spec-python.json > replaceFieldLogs.log
15
+ del replaceFieldLogs.log
16
+ endlocal
17
+
13
18
REM Command to generate SDK
14
19
15
20
java -jar swagger-codegen-cli-2.4.38.jar generate -t cybersource-python-template -i cybersource-rest-spec-python.json -l python -o ../ -c cybersource-python-config.json
16
21
17
- REM Fixing file names
18
- powershell -Command " (Get-Content ..\CyberSource\__init__.py) | ForEach-Object { $_ -replace 'from .models.error__links import ErrorLinks', 'from .models.error_links import ErrorLinks'} | Set-Content ..\CyberSource\__init__.py"
19
-
20
- powershell -Command " (Get-Content ..\CyberSource\models\__init__.py) | ForEach-Object { $_ -replace 'from .error__links import ErrorLinks', 'from .error_links import ErrorLinks'} | Set-Content ..\CyberSource\models\__init__.py"
21
-
22
- powershell -Command " (Get-Content ..\CyberSource\api\secure_file_share_api.py) | ForEach-Object { $_ -replace 'select_header_content_type\(\[''\*_\/_\*;charset=utf-8', 'select_header_content_type([''*/*;charset=utf-8'} | Set-Content ..\CyberSource\api\secure_file_share_api.py"
23
-
24
- powershell -Command " (Get-Content ..\docs\SecureFileShareApi.md) | ForEach-Object { $_ -replace '\*\*Content-Type\*\*: \*_\/_\*;charset=utf-8', '**Content-Type**: */*;charset=utf-8'} | Set-Content ..\docs\SecureFileShareApi.md"
25
-
26
- REM powershell -Command "(Get-Content ..\CyberSource\api\__init__.py) | ForEach-Object { $_ -replace 'from .download_dtd_api import DownloadDTDApi', ''} | ForEach-Object { $_ -replace 'from .download_xsd_api import DownloadXSDApi', ''} | Set-Content ..\CyberSource\api\__init__.py"
27
-
28
- REM powershell -Command "(Get-Content ..\CyberSource\__init__.py) | ForEach-Object { $_ -replace 'from .apis.download_dtd_api import DownloadDTDApi', ''} | ForEach-Object { $_ -replace 'from .apis.download_xsd_api import DownloadXSDApi', ''} | Set-Content ..\CyberSource\__init__.py"
29
-
30
22
REM To Change the Long file names
31
23
REM Change filenames in models\__init__.py
32
24
powershell -Command " (Get-Content ..\CyberSource\models\__init__.py) | ForEach-Object { $_ -replace 'from .ptsv2payments_processing_information_authorization_options_initiator_merchant_initiated_transaction import Ptsv2paymentsProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction', 'from .ptsv2payments_merchant_initiated_transaction import Ptsv2paymentsProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction'} | Set-Content ..\CyberSource\models\__init__.py"
33
-
34
- powershell -Command " (Get-Content ..\CyberSource\models\__init__.py) | ForEach-Object { $_ -replace 'from .tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_processing_information_authorization_options_initiator_merchant_initiated_transaction import Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction', 'from .tmsv2customers__embedded_merchant_initiated_transaction import Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction'} | Set-Content ..\CyberSource\models\__init__.py"
35
-
36
- powershell -Command " (Get-Content ..\CyberSource\models\__init__.py) | ForEach-Object { $_ -replace 'from .tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_processing_information_authorization_options_initiator import Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformationAuthorizationOptionsInitiator', 'from .tmsv2customers__embedded_authorization_options_initiator import Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformationAuthorizationOptionsInitiator'} | Set-Content ..\CyberSource\models\__init__.py"
37
-
38
- REM powershell -Command "(Get-Content ..\CyberSource\models\__init__.py) | ForEach-Object { $_ -replace 'from .risk_v1_authentication_exemptions_post201_response_consumer_authentication_information_strong_authentication import RiskV1AuthenticationExemptionsPost201ResponseConsumerAuthenticationInformationStrongAuthentication', 'from .risk_v1_authentication_exemptions_post201_response_strong_authentication import RiskV1AuthenticationExemptionsPost201ResponseConsumerAuthenticationInformationStrongAuthentication'} | Set-Content ..\CyberSource\models\__init__.py"
39
-
40
25
REM Change filenames in __init__.py
41
26
powershell -Command " (Get-Content ..\CyberSource\__init__.py) | ForEach-Object { $_ -replace 'from .models.ptsv2payments_processing_information_authorization_options_initiator_merchant_initiated_transaction import Ptsv2paymentsProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction', 'from .models.ptsv2payments_merchant_initiated_transaction import Ptsv2paymentsProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction'} | Set-Content ..\CyberSource\__init__.py"
42
-
43
- powershell -Command " (Get-Content ..\CyberSource\__init__.py) | ForEach-Object { $_ -replace 'from .models.tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_processing_information_authorization_options_initiator_merchant_initiated_transaction import Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction', 'from .models.tmsv2customers__embedded_merchant_initiated_transaction import Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction'} | Set-Content ..\CyberSource\__init__.py"
44
-
45
- powershell -Command " (Get-Content ..\CyberSource\__init__.py) | ForEach-Object { $_ -replace 'from .models.tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_processing_information_authorization_options_initiator import Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformationAuthorizationOptionsInitiator', 'from .models.tmsv2customers__embedded_authorization_options_initiator import Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformationAuthorizationOptionsInitiator'} | Set-Content ..\CyberSource\__init__.py"
46
-
47
- REM powershell -Command "(Get-Content ..\CyberSource\__init__.py) | ForEach-Object { $_ -replace 'from .models.risk_v1_authentication_exemptions_post201_response_consumer_authentication_information_strong_authentication import RiskV1AuthenticationExemptionsPost201ResponseConsumerAuthenticationInformationStrongAuthentication', 'from .models.risk_v1_authentication_exemptions_post201_response_strong_authentication import RiskV1AuthenticationExemptionsPost201ResponseConsumerAuthenticationInformationStrongAuthentication'} | Set-Content ..\CyberSource\__init__.py"
48
-
49
27
REM Change filenames in models
50
28
powershell -Command " rename-item -Path ..\CyberSource\models\ptsv2payments_processing_information_authorization_options_initiator_merchant_initiated_transaction.py -newname ptsv2payments_merchant_initiated_transaction.py"
51
-
52
- powershell -Command " rename-item -Path ..\CyberSource\models\tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_processing_information_authorization_options_initiator_merchant_initiated_transaction.py -newname tmsv2customers__embedded_merchant_initiated_transaction.py"
53
-
54
- powershell -Command " rename-item -Path ..\CyberSource\models\tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_processing_information_authorization_options_initiator.py -newname tmsv2customers__embedded_authorization_options_initiator.py"
55
-
56
- REM powershell -Command " rename-item -Path ..\CyberSource\models\risk_v1_authentication_exemptions_post201_response_consumer_authentication_information_strong_authentication.py -newname risk_v1_authentication_exemptions_post201_response_strong_authentication.py"
57
-
58
29
REM Change filenames in test
59
30
powershell -Command " rename-item -Path ..\test\test_ptsv2payments_processing_information_authorization_options_initiator_merchant_initiated_transaction.py -newname test_ptsv2payments_merchant_initiated_transaction.py"
60
-
61
- powershell -Command " rename-item -Path ..\test\test_tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_processing_information_authorization_options_initiator_merchant_initiated_transaction.py -newname test_tmsv2customers__embedded_merchant_initiated_transaction.py"
62
-
63
- powershell -Command " rename-item -Path ..\test\test_tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_processing_information_authorization_options_initiator.py -newname test_tmsv2customers__embedded_authorization_options_initiator.py"
64
-
65
- REM powershell -Command " rename-item -Path ..\test\test_risk_v1_authentication_exemptions_post201_response_consumer_authentication_information_strong_authentication.py -newname test_risk_v1_authentication_exemptions_post201_response_strong_authentication.py"
66
-
67
31
REM Change filenames in docs
68
32
powershell -Command " rename-item -Path ..\docs\Ptsv2paymentsProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction.md -newname Ptsv2paymentsMerchantInitiatedTransaction.md"
69
33
70
- powershell -Command " rename-item -Path ..\docs\Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction.md -newname Tmsv2customersEmbeddedMerchantInitiatedTransaction.md"
71
-
72
- powershell -Command " rename-item -Path ..\docs\Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformationAuthorizationOptionsInitiator.md -newname Tmsv2customersEmbeddedAuthorizationOptionsInitiator.md"
73
34
74
- REM powershell -Command " rename-item -Path ..\docs\RiskV1AuthenticationExemptionsPost201ResponseConsumerAuthenticationInformationStrongAuthentication.md -newname RiskV1AuthenticationExemptionsPost201ResponseStrongAuthentication.md"
35
+ @ REM replace sdkLinks fieldName to links for supporting links field name in request/response body
36
+ echo " starting of replacing the links keyword in pbl_payment_links_all_get200_response.py model"
37
+ powershell -Command " Set-Content ..\CyberSource\models\pbl_payment_links_all_get200_response.py ((Get-Content ..\CyberSource\models\pbl_payment_links_all_get200_response.py -Raw) -replace '''sdk_links'': ''sdkLinks''', '''sdk_links'': ''links''')"
38
+ echo " completed the task of replacing the links keyword in pbl_payment_links_all_get200_response.py model"
75
39
76
40
git checkout ..\README.md
77
41
0 commit comments