Skip to content

Commit ab94047

Browse files
committed
adding updated ruby gen sh file
1 parent c62a2aa commit ab94047

File tree

1 file changed

+167
-0
lines changed

1 file changed

+167
-0
lines changed
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
#!/bin/bash
2+
echo $0
3+
4+
# Delete the previously generated SDK code
5+
6+
rm -rf ../docs
7+
rm -rf ../lib/cybersource_rest_client/api
8+
rm -rf ../lib/cybersource_rest_client/models
9+
rm -rf ../spec
10+
rm ../lib/cybersource_rest_client.rb
11+
12+
# Command to generate SDK
13+
14+
java -jar swagger-codegen-cli-2.2.3.jar generate -t cybersource-ruby-template -i cybersource-rest-spec.json -l ruby -o ../ -c cybersource-ruby-config.json
15+
16+
sed -i "s|select_header_content_type(\["\'"application\/json;charset=utf-8|select_header_content_type(\["\'"\*\/\*|g" ../lib/cybersource_rest_client/api/secure_file_share_api.rb
17+
#sed -i 's/$/\r/' ../lib/cybersource_rest_client/api/secure_file_share_api.rb
18+
19+
# to rename error__links to error_links
20+
21+
sed -i "s|cybersource_rest_client/models/error__links|cybersource_rest_client/models/error_links|g" ../lib/cybersource_rest_client.rb
22+
23+
# to rename long file name
24+
25+
mv ../lib/cybersource_rest_client/models/ptsv2payments_processing_information_authorization_options_initiator_merchant_initiated_transaction.rb ../lib/cybersource_rest_client/models/ptsv2payments_merchant_initiated_transaction.rb
26+
27+
mv ../lib/cybersource_rest_client/models/reporting_v3_interchange_clearing_level_details_get200_response_interchange_clearing_level_details.rb ../lib/cybersource_rest_client/models/reporting_get200_response_interchange_clearing_level_details.rb
28+
29+
# mv ../lib/cybersource_rest_client/models/risk_v1_authentication_exemptions_post201_response_consumer_authentication_information_strong_authentication.rb ../lib/cybersource_rest_client/models/risk_v1_authentication_exemptions_consumer_authentication_information_strong_authentication.r
30+
31+
# mv ../lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded__embedded_instrument_identifier.rb ../lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_embedded_instrument_identifier.rb
32+
33+
mv ../lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_processing_information_authorization_options_initiator_merchant_initiated_transaction.rb ../lib/cybersource_rest_client/models/tmsv2customers__embedded_merchant_initiated_transaction.rb
34+
35+
# If this line fails, it is because of the long filepath. Either manually change the filename OR reduce the directory nesting on the repository.
36+
37+
mv ../lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_processing_information_authorization_options_initiator.rb ../lib/cybersource_rest_client/models/tmsv2customers__embedded_authorization_options_initiator.rb
38+
39+
# mv ../lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_buyer_information_personal_identification.rb ../lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_personal_identification.rb
40+
41+
# mv ../lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_processing_information_bank_transfer_options.rb ../lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_bank_transfer_options.rb
42+
43+
# mv ../lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_merchant_information_merchant_descriptor.rb ../lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_merchant_descriptor.rb
44+
45+
# mv ../lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_buyer_information_issued_by.rb ../lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_buyer_information_issued_by.rb
46+
47+
# mv ../lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_instrument_identifier.rb ../lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_instrument_identifier.rb
48+
49+
# mv ../lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_merchant_information.rb ../lib/cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_merchant_information.rb
50+
51+
mv ../lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier__links_payment_instruments.rb ../lib/cybersource_rest_client/models/tmsv2customers__embedded_payment_instruments.rb
52+
53+
mv ../lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_processing_information.rb ../lib/cybersource_rest_client/models/tmsv2customers__embedded_processing_information.rb
54+
55+
mv ../lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_processing_information_authorization_options.rb ../lib/cybersource_rest_client/models/tmsv2customers__embedded_authorization_options.rb
56+
57+
mv ../lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_tokenized_card.rb ../lib/cybersource_rest_client/models/tmsv2customers__embedded_tokenized_card.rb
58+
59+
mv ../lib/cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_tokenized_card_card.rb ../lib/cybersource_rest_client/models/tmsv2customers__embedded_tokenized_card_card.rb
60+
61+
mv ../lib/cybersource_rest_client/models/pts_v2_payments_post201_response_consumer_authentication_information_strong_authentication_issuer_information.rb ../lib/cybersource_rest_client/models/pts_v2_payments_post201_response_consumer_authentication_information_issuer_information.rb
62+
63+
mv ../docs/Ptsv2paymentsProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction.md ../docs/Ptsv2paymentsMerchantInitiatedTransaction.md
64+
65+
mv ../docs/Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction.md ../docs/Tmsv2customersEmbeddedMerchantInitiatedTransaction.md
66+
67+
mv ../spec/models/ptsv2payments_processing_information_authorization_options_initiator_merchant_initiated_transaction_spec.rb ../spec/models/ptsv2payments_merchant_initiated_transaction_spec.rb
68+
69+
mv ../spec/models/tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_processing_information_authorization_options_initiator_merchant_initiated_transaction_spec.rb ../spec/models/tmsv2customers__embedded_merchant_initiated_transaction_spec.rb
70+
71+
mv ../lib/cybersource_rest_client/models/risk_v1_address_verifications_post201_response_address_verification_information_standard_address_address1.rb ../lib/cybersource_rest_client/models/risk_v1_address_verifications_post201_response_address1.rb
72+
73+
mv ../lib/cybersource_rest_client/models/risk_v1_export_compliance_inquiries_post201_response_export_compliance_information_watch_list_matches.rb ../lib/cybersource_rest_client/models/risk_v1_export_compliance_inquiries_post201_response_watch_list_matches.rb
74+
75+
sed -i "s|cybersource_rest_client/models/ptsv2payments_processing_information_authorization_options_initiator_merchant_initiated_transaction|cybersource_rest_client/models/ptsv2payments_merchant_initiated_transaction|g" ../lib/cybersource_rest_client.rb
76+
77+
# sed -i "s|cybersource_rest_client/models/risk_v1_authentication_exemptions_post201_response_consumer_authentication_information_strong_authentication|cybersource_rest_client/models/risk_v1_authentication_exemptions_consumer_authentication_information_strong_authentication|g" ../lib/cybersource_rest_client.rb
78+
79+
# sed -i "s|cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded__embedded_instrument_identifier|cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_embedded_instrument_identifier|g" ../lib/cybersource_rest_client.rb
80+
81+
sed -i "s|cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_processing_information_authorization_options_initiator_merchant_initiated_transaction|cybersource_rest_client/models/tmsv2customers__embedded_merchant_initiated_transaction|g" ../lib/cybersource_rest_client.rb
82+
83+
sed -i "s|cybersource_rest_client/models/reporting_v3_interchange_clearing_level_details_get200_response_interchange_clearing_level_details|cybersource_rest_client/models/reporting_get200_response_interchange_clearing_level_details|g" ../lib/cybersource_rest_client.rb
84+
85+
# sed -i "s|cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_processing_information_bank_transfer_options|cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_bank_transfer_options|g" ../lib/cybersource_rest_client.rb
86+
87+
sed -i "s|cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_processing_information_authorization_options_initiator|cybersource_rest_client/models/tmsv2customers__embedded_authorization_options_initiator|g" ../lib/cybersource_rest_client.rb
88+
89+
# sed -i "s|cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_buyer_information_personal_identification|cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_personal_identification|g" ../lib/cybersource_rest_client.rb
90+
91+
# sed -i "s|cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_merchant_information_merchant_descriptor|cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_merchant_descriptor|g" ../lib/cybersource_rest_client.rb
92+
93+
# sed -i "s|cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_buyer_information_issued_by|cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_buyer_information_issued_by|g" ../lib/cybersource_rest_client.rb
94+
95+
# sed -i "s|cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_instrument_identifier|cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_instrument_identifier|g" ../lib/cybersource_rest_client.rb
96+
97+
# sed -i "s|cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response__embedded_merchant_information|cybersource_rest_client/models/tms_v1_instrument_identifiers_payment_instruments_get200_response_merchant_information|g" ../lib/cybersource_rest_client.rb
98+
99+
sed -i "s|cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier__links_payment_instruments|cybersource_rest_client/models/tmsv2customers__embedded_payment_instruments|g" ../lib/cybersource_rest_client.rb
100+
101+
sed -i "s|cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_processing_information_authorization_options|cybersource_rest_client/models/tmsv2customers__embedded_authorization_options|g" ../lib/cybersource_rest_client.rb
102+
103+
sed -i "s|cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_processing_information|cybersource_rest_client/models/tmsv2customers__embedded_processing_information|g" ../lib/cybersource_rest_client.rb
104+
105+
sed -i "s|cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_tokenized_card_card|cybersource_rest_client/models/tmsv2customers__embedded_tokenized_card_card|g" ../lib/cybersource_rest_client.rb
106+
107+
sed -i "s|cybersource_rest_client/models/pts_v2_payments_post201_response_consumer_authentication_information_strong_authentication_issuer_information|cybersource_rest_client/models/pts_v2_payments_post201_response_consumer_authentication_information_issuer_information|g" ../lib/cybersource_rest_client.rb
108+
109+
sed -i "s|cybersource_rest_client/models/tmsv2customers__embedded_default_payment_instrument__embedded_instrument_identifier_tokenized_card|cybersource_rest_client/models/tmsv2customers__embedded_tokenized_card|g" ../lib/cybersource_rest_client.rb
110+
111+
sed -i "s|cybersource_rest_client/models/risk_v1_address_verifications_post201_response_address_verification_information_standard_address_address1|cybersource_rest_client/models/risk_v1_address_verifications_post201_response_address1|g" ../lib/cybersource_rest_client.rb
112+
113+
sed -i "s|cybersource_rest_client/models/risk_v1_export_compliance_inquiries_post201_response_export_compliance_information_watch_list_matches|cybersource_rest_client/models/risk_v1_export_compliance_inquiries_post201_response_watch_list_matches|g" ../lib/cybersource_rest_client.rb
114+
sed -i 's/$/\r/' ../lib/cybersource_rest_client.rb
115+
116+
#set +v vecho off
117+
#set +v setlocal enableextensions enabledelayedexpansion
118+
119+
#for -f "tokens=1* delims=\" %%A in (
120+
#for files ../lib/AuthenticationSDK/*.rb "cmd . echo set +v relpath"
121+
# ) do for %%F in (^"%%B) do (
122+
# export original=%%~F
123+
# .export removed=%%original:spec=%%
124+
# if !removed=%%~F (
125+
# #echo NOT PROCESSED
126+
# ) else (
127+
# if "$testVar = \"!original!\"
128+
# then
129+
# sed -i "s+$fileContents[11]+$fileContents[11]+\"`r`nrequire 'AuthenticationSDK/\"+g;s+\"\\\"+\"/\"+g"; $fileContents ../lib/cybersource_rest_client.rb
130+
# )
131+
# )
132+
133+
# sed -i "s+require \'\'cybersource_rest_client/api/download_dtd_api\'\'++g;s+require \'\'cybersource_rest_client/api/download_xsd_api\'\'++g" ../lib/cybersource_rest_client.rb"
134+
135+
# to remove beginning / from loc_var_path in all the api files
136+
137+
cd ../lib/cybersource_rest_client/api
138+
for file in ./*.rb; do \
139+
sed -i "s|local_var_path = "\'"/|local_var_path = "\'"|g" "$file"
140+
sed -i 's/$/\r/' "$file"
141+
done
142+
143+
cd ../../../
144+
145+
git checkout README.md
146+
git checkout cybersource_rest_client.gemspec
147+
148+
git checkout lib/cybersource_rest_client/api/o_auth_api.rb
149+
git checkout lib/cybersource_rest_client/models/access_token_response.rb
150+
git checkout lib/cybersource_rest_client/models/bad_request_error.rb
151+
git checkout lib/cybersource_rest_client/models/create_access_token_request.rb
152+
git checkout lib/cybersource_rest_client/models/resource_not_found_error.rb
153+
git checkout lib/cybersource_rest_client/models/unauthorized_client_error.rb
154+
155+
git checkout docs/OAuthApi.md
156+
git checkout docs/AccessTokenResponse.md
157+
git checkout docs/BadRequestError.md
158+
git checkout docs/CreateAccessTokenRequest.md
159+
git checkout docs/ResourceNotFoundError.md
160+
git checkout docs/UnauthorizedClientError.md
161+
162+
git checkout spec/api/o_auth_api_spec.rb
163+
git checkout spec/models/access_token_response_spec.rb
164+
git checkout spec/models/bad_request_error_spec.rb
165+
git checkout spec/models/create_access_token_request_spec.rb
166+
git checkout spec/models/resource_not_found_error_spec.rb
167+
git checkout spec/models/unauthorized_client_error_spec.rb

0 commit comments

Comments
 (0)