provider/heroku: Prefer struct for required attrs

This commit is contained in:
Justin Campbell 2017-05-01 10:19:44 -04:00
parent ccb1b7ebec
commit 3a87ca4a43
2 changed files with 8 additions and 6 deletions

View File

@ -28,8 +28,9 @@ func resourceHerokuPipeline() *schema.Resource {
func resourceHerokuPipelineCreate(d *schema.ResourceData, meta interface{}) error { func resourceHerokuPipelineCreate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*heroku.Service) client := meta.(*heroku.Service)
opts := heroku.PipelineCreateOpts{} opts := heroku.PipelineCreateOpts{
opts.Name = d.Get("name").(string) Name: d.Get("name").(string),
}
log.Printf("[DEBUG] Pipeline create configuration: %#v", opts) log.Printf("[DEBUG] Pipeline create configuration: %#v", opts)

View File

@ -40,10 +40,11 @@ func resourceHerokuPipelineCoupling() *schema.Resource {
func resourceHerokuPipelineCouplingCreate(d *schema.ResourceData, meta interface{}) error { func resourceHerokuPipelineCouplingCreate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*heroku.Service) client := meta.(*heroku.Service)
opts := heroku.PipelineCouplingCreateOpts{} opts := heroku.PipelineCouplingCreateOpts{
opts.App = d.Get("app").(string) App: d.Get("app").(string),
opts.Pipeline = d.Get("pipeline").(string) Pipeline: d.Get("pipeline").(string),
opts.Stage = d.Get("stage").(string) Stage: d.Get("stage").(string),
}
log.Printf("[DEBUG] PipelineCoupling create configuration: %#v", opts) log.Printf("[DEBUG] PipelineCoupling create configuration: %#v", opts)