func (n *Node) IsFile() bool {
	return n.Kind != nil && *n.Kind == "FILE"
}
IsFile returns whether the node represents a file.
package acd
import (
	"bytes"
	"encoding/json"
	"errors"
	"fmt"
	"io"
	"mime/multipart"
	"net/http"
	"net/url"
	"os"
	"path/filepath"
	"reflect"
	"github.com/google/go-querystring/query"
)
type NodesService struct {
	client *Client
}
func (s *NodesService) GetRoot() (*Folder, *http.Response, error) {
	opts := &NodeListOptions{Filters: "kind:FOLDER AND isRoot:true"}
	roots, resp, err := s.GetNodes(opts)
	if err != nil {
		return nil, resp, err
	}
	if len(roots) < 1 {
		return nil, resp, errors.New("No root found")
	}
	return &Folder{roots[0]}, resp, nil
}
func (s *NodesService) GetAllNodes(opts *NodeListOptions) ([]*Node, *http.Response, error) {
	return s.listAllNodes("nodes", opts)
}
func (s *NodesService) GetNodes(opts *NodeListOptions) ([]*Node, *http.Response, error) {
	return s.listNodes("nodes", opts)
}
func (s *NodesService) listAllNodes(url string, opts *NodeListOptions) ([]*Node, *http.Response, error) {
	if opts == nil {
		opts = &NodeListOptions{}
	}
	result := make([]*Node, 0, 200)
	for {
		nodes, resp, err := s.listNodes(url, opts)
		if err != nil {
			return result, resp, err
		}
		if nodes == nil {
			break
		}
		result = append(result, nodes...)
	}
	return result, nil, nil
}
func (s *NodesService) listNodes(url string, opts *NodeListOptions) ([]*Node, *http.Response, error) {
	if opts != nil && opts.reachedEnd {
		return nil, nil, nil
	}
	url, err := addOptions(url, opts)
	if err != nil {
		return nil, nil, err
	}
	req, err := s.client.NewMetadataRequest("GET", url, nil)
	if err != nil {
		return nil, nil, err
	}
	nodeList := &nodeListInternal{}
	resp, err := s.client.Do(req, nodeList)
	if err != nil {
		return nil, resp, err
	}
	if opts != nil {
		if nodeList.NextToken != nil {
			opts.StartToken = *nodeList.NextToken
		} else {
			opts.reachedEnd = true
		}
	}
	nodes := nodeList.Data
	for _, node := range nodes {
		node.service = s
	}
	return nodes, resp, nil
}
type nodeListInternal struct {
	Count     *uint64 `json:"count"`
	NextToken *string `json:"nextToken"`
	Data      []*Node `json:"data"`
}
type Node struct {
	Id                *string `json:"id"`
	Name              *string `json:"name"`
	Kind              *string `json:"kind"`
	ContentProperties *struct {
		Size *uint64 `json:"size"`
	} `json:"contentProperties"`
	service *NodesService
}