You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.
The problem with the generated client is it seems tightly coupled to the rest-api-id and stage-name specified so the generated code can’t be used if you want to communicate with a different stage-name or rest-api-id. It may be that i am not using it correctly but it is not clear how I can use the single generated gem for multiple environments. We would like to
generate a single gem and use this gem for each environment, e.g. stage names: devalopera, dev, int, prod.
The instance of this API object is defined in a module within the generated code called ClientApi. I have created a new class which includes this module so we can provide our own initialization of the Seahorse::Model::Api. This is a copy of what is defined in the generated module ClientApi but I swap out some key options like the stage-name and rest-api-id using environment variables.
Hopefully there is a simpler solution to using the generated gem for multiple stage names?
Hi, thanks for getting in touch. I'm sorry to hear that you've had problems with generated code. This repo is meant for feedback and collaboration on the documentation. If you're still looking for other solutions, I'd recommend posting on the API Gateway forum.
The problem with the generated client is it seems tightly coupled to the rest-api-id and stage-name specified so the generated code can’t be used if you want to communicate with a different stage-name or rest-api-id. It may be that i am not using it correctly but it is not clear how I can use the single generated gem for multiple environments. We would like to
generate a single gem and use this gem for each environment, e.g. stage names: devalopera, dev, int, prod.
I have had to do the following:
From the generated code I needed to override some behaviour in https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/APIGateway/Client.html
The method we needed to override is the set_api which sets the https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Seahorse/Model/Api.html.
The instance of this API object is defined in a module within the generated code called ClientApi. I have created a new class which includes this module so we can provide our own initialization of the Seahorse::Model::Api. This is a copy of what is defined in the generated module ClientApi but I swap out some key options like the stage-name and rest-api-id using environment variables.
Hopefully there is a simpler solution to using the generated gem for multiple stage names?
https://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-generate-sdk-cli.html
The text was updated successfully, but these errors were encountered: