Adding comments to external ext
diff --git a/openstack/networking/v2/extensions/external/requests.go b/openstack/networking/v2/extensions/external/requests.go
index f195cfa..afdd428 100644
--- a/openstack/networking/v2/extensions/external/requests.go
+++ b/openstack/networking/v2/extensions/external/requests.go
@@ -2,6 +2,8 @@
import "github.com/rackspace/gophercloud/openstack/networking/v2/networks"
+// AdminState gives users a solid type to work with for create and update
+// operations. It is recommended that users use the `Up` and `Down` enums.
type AdminState *bool
// Convenience vars for AdminStateUp values.
@@ -9,16 +11,19 @@
iTrue = true
iFalse = false
- Nothing AdminState = nil
- Up AdminState = &iTrue
- Down AdminState = &iFalse
+ Up AdminState = &iTrue
+ Down AdminState = &iFalse
)
+// CreateOpts is the structure used when creating new external network
+// resources. It embeds networks.CreateOpts and so inherits all of its required
+// and optional fields, with the addition of the External field.
type CreateOpts struct {
Parent networks.CreateOpts
External bool
}
+// ToNetworkCreateMap casts a CreateOpts struct to a map.
func (o CreateOpts) ToNetworkCreateMap() map[string]map[string]interface{} {
outer := o.Parent.ToNetworkCreateMap()
@@ -27,11 +32,15 @@
return outer
}
+// UpdateOpts is the structure used when updating existing external network
+// resources. It embeds networks.UpdateOpts and so inherits all of its required
+// and optional fields, with the addition of the External field.
type UpdateOpts struct {
Parent networks.UpdateOpts
External bool
}
+// ToNetworkUpdateMap casts an UpdateOpts struct to a map.
func (o UpdateOpts) ToNetworkUpdateMap() map[string]map[string]interface{} {
outer := o.Parent.ToNetworkUpdateMap()