code: func BasicNetworkCreateToGRPC(create basictypes.NetworkCreateRequest) swarmapi.NetworkSpec {
  	ns := swarmapi.NetworkSpec{
  		Annotations: swarmapi.Annotations{
  			Name:   create.Name,
  			Labels: create.Labels,
  		},
  		DriverConfig: &swarmapi.Driver{
  			Name:    create.Driver,
  			Options: create.Options,
  		},
  		Ipv6Enabled: create.EnableIPv6,
  		Internal:    create.Internal,
  		Attachable:  create.Attachable,
  		Ingress:     create.Ingress,
  	}
  	if create.IPAM != nil {
  		driver := create.IPAM.Driver
  		if driver == "" {
  			driver = "default"
  		}
  		ns.IPAM = &swarmapi.IPAMOptions{
  			Driver: &swarmapi.Driver{
  				Name:    driver,
  				Options: create.IPAM.Options,
  			},
  		}
  		ipamSpec := make([]*swarmapi.IPAMConfig, 0, len(create.IPAM.Config))
  		for _, ipamConfig := range create.IPAM.Config {
  			ipamSpec = append(ipamSpec, &swarmapi.IPAMConfig{
  				Subnet:  ipamConfig.Subnet,
  				Range:   ipamConfig.IPRange,
  				Gateway: ipamConfig.Gateway,
  			})
  		}
  		ns.IPAM.Configs = ipamSpec
  	}
  	if create.ConfigFrom != nil {
  		ns.ConfigFrom = &swarmapi.NetworkSpec_Network{
  			Network: create.ConfigFrom.Network,
  		}
  	}
  	return ns
  }
docs: // BasicNetworkCreateToGRPC converts a NetworkCreateRequest to a grpc NetworkSpec.