code: func (client *Client) GetApplicationApplicationInstances(guid string) (map[int]ApplicationInstance, Warnings, error) {
  	request, err := client.newHTTPRequest(requestOptions{
  		RequestName: internal.GetAppInstancesRequest,
  		URIParams:   Params{"app_guid": guid},
  	})
  	if err != nil {
  		return nil, nil, err
  	}
  
  	var instances map[string]ApplicationInstance
  	response := cloudcontroller.Response{
  		DecodeJSONResponseInto: &instances,
  	}
  
  	err = client.connection.Make(request, &response)
  	if err != nil {
  		return nil, response.Warnings, err
  	}
  
  	returnedInstances := map[int]ApplicationInstance{}
  	for instanceID, instance := range instances {
  		id, convertErr := strconv.Atoi(instanceID)
  		if convertErr != nil {
  			return nil, response.Warnings, convertErr
  		}
  		instance.ID = id
  		returnedInstances[id] = instance
  	}
  
  	return returnedInstances, response.Warnings, nil
  }
docs: // GetApplicationApplicationInstances returns a list of ApplicationInstance for
  // a given application. Depending on the state of an application, it might skip
  // some application instances.