Skip to content

Commit f280bda

Browse files
committed
updating swagger cli version to 2.3.0
1 parent e9f6426 commit f280bda

3 files changed

Lines changed: 26 additions & 27 deletions

File tree

generator/cybersource-python-template/__init__package.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ from .models.resource_not_found_error import ResourceNotFoundError
1212
from .models.unauthorized_client_error import UnauthorizedClientError
1313
{{#models}}{{#model}}from .models.{{classFilename}} import {{classname}}
1414
{{/model}}{{/models}}
15-
# import apis into sdk package
16-
from .apis.o_auth_api import OAuthApi
17-
{{#apiInfo}}{{#apis}}from .apis.{{classVarName}} import {{classname}}
15+
# import api into sdk package
16+
from .api.o_auth_api import OAuthApi
17+
{{#apiInfo}}{{#apis}}from .api.{{classVarName}} import {{classname}}
1818
{{/apis}}{{/apiInfo}}
1919

2020
# import Utilities

generator/cybersource-python-template/api.mustache

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,12 @@ class {{classname}}(object):
226226
{{/bodyParam}}
227227
{{#hasProduces}}
228228
# HTTP header `Accept`
229-
header_params['Accept'] = self.api_client.\
230-
select_header_accept([{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}])
229+
header_params['Accept'] = self.api_client.select_header_accept([{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}])
231230

232231
{{/hasProduces}}
233232
{{#hasConsumes}}
234233
# HTTP header `Content-Type`
235-
header_params['Content-Type'] = self.api_client.\
236-
select_header_content_type([{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}])
234+
header_params['Content-Type'] = self.api_client.select_header_content_type([{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}])
237235

238236
{{/hasConsumes}}
239237
# Authentication setting

generator/cybersource_python_sdk_gen.bat

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,56 +5,57 @@ cd %~dp0
55
REM Delete the previously generated SDK code
66

77
rd /s /q ..\docs
8+
rd /s /q ..\CyberSource\api
89
rd /s /q ..\CyberSource\apis
910
rd /s /q ..\CyberSource\models
1011
rd /s /q ..\test
1112

1213
REM Command to generate SDK
1314

14-
java -jar swagger-codegen-cli-2.2.3.jar generate -t cybersource-python-template -i cybersource-rest-spec.json -l python -o ../ -c cybersource-python-config.json
15+
java -jar swagger-codegen-cli-2.3.0.jar generate -t cybersource-python-template -i cybersource-rest-spec.json -l python -o ../ -c cybersource-python-config.json
1516

1617
REM Fixing file names
1718
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"
1819

1920
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"
2021

21-
powershell -Command "(Get-Content ..\CyberSource\apis\report_subscriptions_api.py) | ForEach-Object { $_ -replace '''/reporting/v3/report-subscriptions/{reportName}''', '''/reporting/v3/report-subscriptions/{report_name}'''} | Set-Content ..\CyberSource\apis\report_subscriptions_api.py"
22+
powershell -Command "(Get-Content ..\CyberSource\api\report_subscriptions_api.py) | ForEach-Object { $_ -replace '''/reporting/v3/report-subscriptions/{reportName}''', '''/reporting/v3/report-subscriptions/{report_name}'''} | Set-Content ..\CyberSource\api\report_subscriptions_api.py"
2223

23-
powershell -Command "(Get-Content ..\CyberSource\apis\instrument_identifier_api.py) | ForEach-Object { $_ -replace '''/tms/v1/instrumentidentifiers/{instrumentIdentifierId}''', '''/tms/v1/instrumentidentifiers/{instrument_identifier_id}'''} | Set-Content ..\CyberSource\apis\instrument_identifier_api.py"
24+
powershell -Command "(Get-Content ..\CyberSource\api\instrument_identifier_api.py) | ForEach-Object { $_ -replace '''/tms/v1/instrumentidentifiers/{instrumentIdentifierId}''', '''/tms/v1/instrumentidentifiers/{instrument_identifier_id}'''} | Set-Content ..\CyberSource\api\instrument_identifier_api.py"
2425

25-
powershell -Command "(Get-Content ..\CyberSource\apis\instrument_identifier_api.py) | ForEach-Object { $_ -replace '''/tms/v1/instrumentidentifiers/{instrumentIdentifierId}/paymentinstruments''', '''/tms/v1/instrumentidentifiers/{instrument_identifier_id}/paymentinstruments'''} | Set-Content ..\CyberSource\apis\instrument_identifier_api.py"
26+
powershell -Command "(Get-Content ..\CyberSource\api\instrument_identifier_api.py) | ForEach-Object { $_ -replace '''/tms/v1/instrumentidentifiers/{instrumentIdentifierId}/paymentinstruments''', '''/tms/v1/instrumentidentifiers/{instrument_identifier_id}/paymentinstruments'''} | Set-Content ..\CyberSource\api\instrument_identifier_api.py"
2627

27-
powershell -Command "(Get-Content ..\CyberSource\apis\payment_instrument_api.py) | ForEach-Object { $_ -replace '''/tms/v1/paymentinstruments/{paymentInstrumentId}''', '''/tms/v1/paymentinstruments/{payment_instrument_id}'''} | Set-Content ..\CyberSource\apis\payment_instrument_api.py"
28+
powershell -Command "(Get-Content ..\CyberSource\api\payment_instrument_api.py) | ForEach-Object { $_ -replace '''/tms/v1/paymentinstruments/{paymentInstrumentId}''', '''/tms/v1/paymentinstruments/{payment_instrument_id}'''} | Set-Content ..\CyberSource\api\payment_instrument_api.py"
2829

29-
powershell -Command "(Get-Content ..\CyberSource\apis\reports_api.py) | ForEach-Object { $_ -replace '''/reporting/v3/reports/{reportId}''', '''/reporting/v3/reports/{report_id}'''} | Set-Content ..\CyberSource\apis\reports_api.py"
30+
powershell -Command "(Get-Content ..\CyberSource\api\reports_api.py) | ForEach-Object { $_ -replace '''/reporting/v3/reports/{reportId}''', '''/reporting/v3/reports/{report_id}'''} | Set-Content ..\CyberSource\api\reports_api.py"
3031

31-
powershell -Command "(Get-Content ..\CyberSource\apis\report_definitions_api.py) | ForEach-Object { $_ -replace '''/reporting/v3/report-definitions/{reportDefinitionName}''', '''/reporting/v3/report-definitions/{report_definition_name}'''} | Set-Content ..\CyberSource\apis\report_definitions_api.py"
32+
powershell -Command "(Get-Content ..\CyberSource\api\report_definitions_api.py) | ForEach-Object { $_ -replace '''/reporting/v3/report-definitions/{reportDefinitionName}''', '''/reporting/v3/report-definitions/{report_definition_name}'''} | Set-Content ..\CyberSource\api\report_definitions_api.py"
3233

33-
powershell -Command "(Get-Content ..\CyberSource\apis\secure_file_share_api.py) | ForEach-Object { $_ -replace '''/sfs/v1/files/{fileId}''', '''/sfs/v1/files/{file_id}'''} | Set-Content ..\CyberSource\apis\secure_file_share_api.py"
34+
powershell -Command "(Get-Content ..\CyberSource\api\secure_file_share_api.py) | ForEach-Object { $_ -replace '''/sfs/v1/files/{fileId}''', '''/sfs/v1/files/{file_id}'''} | Set-Content ..\CyberSource\api\secure_file_share_api.py"
3435

35-
powershell -Command "(Get-Content ..\CyberSource\apis\search_transactions_api.py) | ForEach-Object { $_ -replace '''/tss/v2/searches/{searchId}''', '''/tss/v2/searches/{search_id}'''} | Set-Content ..\CyberSource\apis\search_transactions_api.py"
36+
powershell -Command "(Get-Content ..\CyberSource\api\search_transactions_api.py) | ForEach-Object { $_ -replace '''/tss/v2/searches/{searchId}''', '''/tss/v2/searches/{search_id}'''} | Set-Content ..\CyberSource\api\search_transactions_api.py"
3637

37-
powershell -Command "(Get-Content ..\CyberSource\apis\customer_api.py) | ForEach-Object { $_ -replace '''/tms/v2/customers/{customerId}''', '''/tms/v2/customers/{customer_id}'''} | Set-Content ..\CyberSource\apis\customer_api.py"
38+
powershell -Command "(Get-Content ..\CyberSource\api\customer_api.py) | ForEach-Object { $_ -replace '''/tms/v2/customers/{customerId}''', '''/tms/v2/customers/{customer_id}'''} | Set-Content ..\CyberSource\api\customer_api.py"
3839

39-
powershell -Command "(Get-Content ..\CyberSource\apis\customer_shipping_address_api.py) | ForEach-Object { $_ -replace '''/tms/v2/customers/{customerId}/shipping-addresses''', '''/tms/v2/customers/{customer_id}/shipping-addresses'''} | Set-Content ..\CyberSource\apis\customer_shipping_address_api.py"
40+
powershell -Command "(Get-Content ..\CyberSource\api\customer_shipping_address_api.py) | ForEach-Object { $_ -replace '''/tms/v2/customers/{customerId}/shipping-addresses''', '''/tms/v2/customers/{customer_id}/shipping-addresses'''} | Set-Content ..\CyberSource\api\customer_shipping_address_api.py"
4041

41-
powershell -Command "(Get-Content ..\CyberSource\apis\customer_shipping_address_api.py) | ForEach-Object { $_ -replace '''/tms/v2/customers/{customerId}/shipping-addresses/{shippingAddressId}''', '''/tms/v2/customers/{customer_id}/shipping-addresses/{shipping_address_id}'''} | Set-Content ..\CyberSource\apis\customer_shipping_address_api.py"
42+
powershell -Command "(Get-Content ..\CyberSource\api\customer_shipping_address_api.py) | ForEach-Object { $_ -replace '''/tms/v2/customers/{customerId}/shipping-addresses/{shippingAddressId}''', '''/tms/v2/customers/{customer_id}/shipping-addresses/{shipping_address_id}'''} | Set-Content ..\CyberSource\api\customer_shipping_address_api.py"
4243

43-
powershell -Command "(Get-Content ..\CyberSource\apis\customer_payment_instrument_api.py) | ForEach-Object { $_ -replace '''/tms/v2/customers/{customerId}/payment-instruments''', '''/tms/v2/customers/{customer_id}/payment-instruments'''} | Set-Content ..\CyberSource\apis\customer_payment_instrument_api.py"
44+
powershell -Command "(Get-Content ..\CyberSource\api\customer_payment_instrument_api.py) | ForEach-Object { $_ -replace '''/tms/v2/customers/{customerId}/payment-instruments''', '''/tms/v2/customers/{customer_id}/payment-instruments'''} | Set-Content ..\CyberSource\api\customer_payment_instrument_api.py"
4445

45-
powershell -Command "(Get-Content ..\CyberSource\apis\customer_payment_instrument_api.py) | ForEach-Object { $_ -replace '''/tms/v2/customers/{customerId}/payment-instruments/{paymentInstrumentId}''', '''/tms/v2/customers/{customer_id}/payment-instruments/{payment_instrument_id}'''} | Set-Content ..\CyberSource\apis\customer_payment_instrument_api.py"
46+
powershell -Command "(Get-Content ..\CyberSource\api\customer_payment_instrument_api.py) | ForEach-Object { $_ -replace '''/tms/v2/customers/{customerId}/payment-instruments/{paymentInstrumentId}''', '''/tms/v2/customers/{customer_id}/payment-instruments/{payment_instrument_id}'''} | Set-Content ..\CyberSource\api\customer_payment_instrument_api.py"
4647

47-
powershell -Command "(Get-Content ..\CyberSource\apis\symmetric_key_management_api.py) | ForEach-Object { $_ -replace '''/kms/v2/keys-sym/{keyId}''', '''/kms/v2/keys-sym/{key_id}'''} | Set-Content ..\CyberSource\apis\symmetric_key_management_api.py"
48+
powershell -Command "(Get-Content ..\CyberSource\api\symmetric_key_management_api.py) | ForEach-Object { $_ -replace '''/kms/v2/keys-sym/{keyId}''', '''/kms/v2/keys-sym/{key_id}'''} | Set-Content ..\CyberSource\api\symmetric_key_management_api.py"
4849

49-
powershell -Command "(Get-Content ..\CyberSource\apis\asymmetric_key_management_api.py) | ForEach-Object { $_ -replace '''/kms/v2/keys-asym/{keyId}''', '''/kms/v2/keys-asym/{key_id}'''} | Set-Content ..\CyberSource\apis\asymmetric_key_management_api.py"
50+
powershell -Command "(Get-Content ..\CyberSource\api\asymmetric_key_management_api.py) | ForEach-Object { $_ -replace '''/kms/v2/keys-asym/{keyId}''', '''/kms/v2/keys-asym/{key_id}'''} | Set-Content ..\CyberSource\api\asymmetric_key_management_api.py"
5051

51-
powershell -Command "(Get-Content ..\CyberSource\apis\instrument_identifier_api.py) | ForEach-Object { $_ -replace '''/tms/v1/instrumentidentifiers/{instrumentIdentifierId}/enrollment''', '''/tms/v1/instrumentidentifiers/{instrument_identifier_id}/enrollment'''} | Set-Content ..\CyberSource\apis\instrument_identifier_api.py"
52+
powershell -Command "(Get-Content ..\CyberSource\api\instrument_identifier_api.py) | ForEach-Object { $_ -replace '''/tms/v1/instrumentidentifiers/{instrumentIdentifierId}/enrollment''', '''/tms/v1/instrumentidentifiers/{instrument_identifier_id}/enrollment'''} | Set-Content ..\CyberSource\api\instrument_identifier_api.py"
5253

53-
powershell -Command "(Get-Content ..\CyberSource\apis\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\apis\secure_file_share_api.py"
54+
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"
5455

5556
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"
5657

57-
REM powershell -Command "(Get-Content ..\CyberSource\apis\__init__.py) | ForEach-Object { $_ -replace 'from .download_dtd_api import DownloadDTDApi', ''} | ForEach-Object { $_ -replace 'from .download_xsd_api import DownloadXSDApi', ''} | Set-Content ..\CyberSource\apis\__init__.py"
58+
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"
5859

5960
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"
6061

@@ -108,7 +109,7 @@ git checkout ..\README.md
108109

109110
git checkout ..\setup.py
110111

111-
git checkout ..\CyberSource\apis\o_auth_api.py
112+
git checkout ..\CyberSource\api\o_auth_api.py
112113
git checkout ..\CyberSource\models\access_token_response.py
113114
git checkout ..\CyberSource\models\bad_request_error.py
114115
git checkout ..\CyberSource\models\create_access_token_request.py

0 commit comments

Comments
 (0)