()
| 62 | } |
| 63 | |
| 64 | func (p *AddGuestOsParams) toURLValues() url.Values { |
| 65 | u := url.Values{} |
| 66 | if p.p == nil { |
| 67 | return u |
| 68 | } |
| 69 | if v, found := p.p["details"]; found { |
| 70 | m := v.(map[string]string) |
| 71 | for i, k := range getSortedKeysFromMap(m) { |
| 72 | u.Set(fmt.Sprintf("details[%d].key", i), k) |
| 73 | u.Set(fmt.Sprintf("details[%d].value", i), m[k]) |
| 74 | } |
| 75 | } |
| 76 | if v, found := p.p["forDisplay"]; found { |
| 77 | vv := strconv.FormatBool(v.(bool)) |
| 78 | u.Set("forDisplay", vv) |
| 79 | } |
| 80 | if v, found := p.p["name"]; found { |
| 81 | u.Set("name", v.(string)) |
| 82 | } |
| 83 | if v, found := p.p["oscategoryid"]; found { |
| 84 | u.Set("oscategoryid", v.(string)) |
| 85 | } |
| 86 | if v, found := p.p["osdisplayname"]; found { |
| 87 | u.Set("osdisplayname", v.(string)) |
| 88 | } |
| 89 | return u |
| 90 | } |
| 91 | |
| 92 | func (p *AddGuestOsParams) SetDetails(v map[string]string) { |
| 93 | if p.p == nil { |
no test coverage detected