MCPcopy Index your code
hub / github.com/apache/cloudstack-go / toURLValues

Method toURLValues

cloudstack/GuestOSService.go:1728–1754  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1726}
1727
1728func (p *UpdateGuestOsParams) toURLValues() url.Values {
1729 u := url.Values{}
1730 if p.p == nil {
1731 return u
1732 }
1733 if v, found := p.p["details"]; found {
1734 m := v.(map[string]string)
1735 for i, k := range getSortedKeysFromMap(m) {
1736 u.Set(fmt.Sprintf("details[%d].key", i), k)
1737 u.Set(fmt.Sprintf("details[%d].value", i), m[k])
1738 }
1739 }
1740 if v, found := p.p["forDisplay"]; found {
1741 vv := strconv.FormatBool(v.(bool))
1742 u.Set("forDisplay", vv)
1743 }
1744 if v, found := p.p["id"]; found {
1745 u.Set("id", v.(string))
1746 }
1747 if v, found := p.p["oscategoryid"]; found {
1748 u.Set("oscategoryid", v.(string))
1749 }
1750 if v, found := p.p["osdisplayname"]; found {
1751 u.Set("osdisplayname", v.(string))
1752 }
1753 return u
1754}
1755
1756func (p *UpdateGuestOsParams) SetDetails(v map[string]string) {
1757 if p.p == nil {

Callers

nothing calls this directly

Calls 1

getSortedKeysFromMapFunction · 0.85

Tested by

no test coverage detected