Skip to content
Permalink
Browse files
Fix/improve #66 (#68)
Fixing it this way makes it cleaner to use/set the `usersecuritygrouplist` in clients using this, and keeps it simular in use compared to working with `serviceproviderlist` and `tags`.

Fixes #67
  • Loading branch information
Sander van Harmelen committed Oct 24, 2016
1 parent 5e674b6 commit ff444b1afdd1961f8118bad30db9fa27cb989ced
Showing 2 changed files with 6 additions and 3 deletions.
@@ -333,7 +333,8 @@ func (p *AuthorizeSecurityGroupIngressParams) toURLValues() url.Values {
if v, found := p.p["usersecuritygrouplist"]; found {
i := 0
for k, vv := range v.(map[string]string) {
u.Set(fmt.Sprintf("usersecuritygrouplist[%d].%s", i, k), vv)
u.Set(fmt.Sprintf("usersecuritygrouplist[%d].account", i), k)
u.Set(fmt.Sprintf("usersecuritygrouplist[%d].group", i), vv)
i++
}
}
@@ -620,7 +621,8 @@ func (p *AuthorizeSecurityGroupEgressParams) toURLValues() url.Values {
if v, found := p.p["usersecuritygrouplist"]; found {
i := 0
for k, vv := range v.(map[string]string) {
u.Set(fmt.Sprintf("usersecuritygrouplist[%d].%s", i, k), vv)
u.Set(fmt.Sprintf("usersecuritygrouplist[%d].account", i), k)
u.Set(fmt.Sprintf("usersecuritygrouplist[%d].group", i), vv)
i++
}
}
@@ -690,7 +690,8 @@ func (s *service) generateConvertCode(name, typ string) {
pn(" u.Set(fmt.Sprintf(\"%s[%%d].service\", i), k)", name)
pn(" u.Set(fmt.Sprintf(\"%s[%%d].provider\", i), vv)", name)
case "usersecuritygrouplist":
pn(" u.Set(fmt.Sprintf(\"%s[%%d].%%s\", i, k), vv)", name)
pn(" u.Set(fmt.Sprintf(\"%s[%%d].account\", i), k)", name)
pn(" u.Set(fmt.Sprintf(\"%s[%%d].group\", i), vv)", name)
default:
pn(" u.Set(fmt.Sprintf(\"%s[%%d].key\", i), k)", name)
pn(" u.Set(fmt.Sprintf(\"%s[%%d].value\", i), vv)", name)

0 comments on commit ff444b1

Please sign in to comment.