Get Child Accounts
<p>
Returns information about a the child accounts of an account.

@param accountCode recurly account id
@return Accounts on success, null otherwise
171792
public Accounts getChildAccounts(final String accountCode) {
        return doGET(Account.ACCOUNT_RESOURCE + "/" + accountCode + "/child_accounts", Accounts.class, new QueryParams());
    }
982521
public List<T> getChildChoices()
	{
		final List<T> childChoices = getModelsMap().get(getSelectedRootOption());
		if (CollectionExtensions.isEmpty(childChoices))
		{
			return Collections.emptyList();
		}
		return childChoices;
	}
161790
public ShippingAddresses getAccountShippingAddresses(final String accountCode) {
        return doGET(Accounts.ACCOUNTS_RESOURCE + "/" + accountCode + ShippingAddresses.SHIPPING_ADDRESSES_RESOURCE,
                ShippingAddresses.class, new QueryParams());
    }
364429
def get_account(address)
      address = Utils.normalize_address address, allow_blank: true
      rlpdata = @state[address]

      if rlpdata == Trie::BLANK_NODE
        Account.build_blank db, config[:account_initial_nonce]
      else
        RLP.decode(rlpdata, sedes: Account, db: db).tap do |acct|
          acct.make_mutable!
          acct._cached_rlp = nil
        end
      end
    end
802391
def GetAccounts(alias=None):
		""""""
		if alias is not None:  payload = {'AccountAlias': alias}
		else:  payload = {}
		r = clc.v1.API.Call('post','Account/GetAccounts',payload)
		if int(r['StatusCode']) == 0:  
			# Assume first response is always the original account.  Not sure if this is reliable
			if not clc.ALIAS:  clc.ALIAS = r['Accounts'][0]['AccountAlias']
			if not clc.LOCATION:  clc.LOCATION = r['Accounts'][0]['Location']

			return(r['Accounts'])
304390
public Redemption getCouponRedemptionByAccount(final String accountCode) {
        return doGET(Accounts.ACCOUNTS_RESOURCE + "/" + accountCode + Redemption.REDEMPTION_RESOURCE,
                     Redemption.class);
    }
151634
private List<String> getChildrenList() {
        if (childrenList != null) return childrenList;

        SharedPreferences prefs = loadSharedPreferences("children");

        String list = prefs.getString(getId(), null);

        childrenList = (list == null) ? new ArrayList<String>() : new ArrayList<>(Arrays.asList(list.split(",")));
        return childrenList;
    }
1343634
public java.util.List<AccountAggregationSource> getAccountAggregationSources() {
        if (accountAggregationSources == null) {
            accountAggregationSources = new com.amazonaws.internal.SdkInternalList<AccountAggregationSource>();
        }
        return accountAggregationSources;
    }
1297102
public IModel<List<T>> getChildChoices()
	{
		final T selectedRootOption = TwoDropDownChoicesModel.this.selectedRootOption;
		final IModel<List<T>> childChoices = new AbstractReadOnlyModel<List<T>>()
		{

			/** The Constant serialVersionUID. */
			private static final long serialVersionUID = 1L;

			/**
			 * {@inheritDoc}
			 */
			@Override
			public List<T> getObject()
			{
				List<T> models = getModelsMap().get(selectedRootOption);
				if (models == null)
				{
					models = Collections.emptyList();
				}
				return models;
			}

		};
		return childChoices;
	}
18219
private void printDatabase(Account acc, int level, PrintStream stream) {
        String buf = "";

        for (int i = 0; i < level; i++)
            buf += " ";

        buf += "+";
        buf += acc.getName() + "[" + acc.getUrl() + "] (" + acc.getPatterns().size() + " patterns)";

        stream.println(buf);

        for (Account account : acc.getChildren())
            printDatabase(account, level + 2, stream);
    }

    public List<Account> findPathToAccountById(String id) {
        LinkedList<Account> result = getRootInLinkedList();
        findAccountById(result, id);
        // reverse the list, so that its,<root> -> parent -> ... -> Found Account
        List<Account> retValue = new ArrayList<Account>(result.size());
        Iterator<Account> iter = result.descendingIterator();
        while (iter.hasNext()) retValue.add(iter.next());
        return retValue;
    }

    public List<Account> getAllAccounts() {
        Set<Account> acc = new HashSet<Account>();
        getAllAccounts(getRootAccount(), acc);
        List<Account> sorted = new ArrayList<Account>(acc);
        Collections.sort(sorted, new Comparator<Account>() {
            @Override
            public int compare(Account o1, Account o2) {
                return o1.getName().compareToIgnoreCase(o2.getName());
            }
        });
        return sorted;
    }

    private void getAllAccounts(Account base, Collection<Account> into) {
        for (Account c : base.getChildren()) {
            if ( c.hasChildren() ) {
                getAllAccounts(c, into);
            } else {
                into.add(c);
            }
        }
    }


    /**
     * Locates an account, given an id.
     *
     * @param id The account id (unique hash).
     * @return The account if found, else null.
     */
    public Account findAccountById(String id) {
        return findAccountById(getRootInLinkedList(), id);
    }

    /**
     * Internal function to recurse through accounts looking for an id.
     *
     * @param stack  The path to the current parent
     * @param id     The id to look for.
     * @return The Account if found, else null.
     */
    private Account findAccountById(LinkedList<Account> stack, String id) {
        final Account parent = stack.peek();
        if (parent == null) {
            if ( ! stack.isEmpty() ) stack.pop();
            return null;
        }
        for (Account child : parent.getChildren()) {
            if (child.getId().equals(id)) {
                stack.push(child);
                return child;
            }
            if (child.getChildren().size() > 0) {
                stack.push(child);
                Account foundAccount = findAccountById(stack, id);
                if (foundAccount != null)
                    return foundAccount;
            }
        }
        stack.pop();
        return null;
    }

    private LinkedList<Account> getRootInLinkedList() {
        LinkedList<Account> stack = new LinkedList<Account>();
        stack.add(rootAccount);
        return stack;
    }

    /**
     * Searches the database for any account with a matching URL.
     *
     * @param url The regex to search with.
     * @return The account if found, else null.
     */
    public Account findAccountByUrl(String url) {
        return findAccountByUrl(rootAccount, url);
    }

    /**
     * Internal function to aid in searching.  This will find the first account in the tree starting at parent
     * that matches the url given.
     *
     * @param parent - The parent to start searching with.
     * @param url    - Url to search for
     * @return the matching account (maybe the parent), or Null if no matching account was found.
     */
    private Account findAccountByUrl(Account parent, String url) {
        // First search the parent
        if (AccountPatternMatcher.matchUrl(parent, url) && !parent.isRoot())
            return parent;
        for (Account child : parent.getChildren()) {
            Account foundAccount = findAccountByUrl(child, url);
            if (foundAccount != null)
                return foundAccount;
        }
        return null;
    }
246342
public CreditPayments getCreditPayments(final String accountCode, final QueryParams params) {
        final String path = Accounts.ACCOUNTS_RESOURCE + "/" + accountCode + CreditPayments.CREDIT_PAYMENTS_RESOURCE;
        return doGET(path, CreditPayments.class, params);
    }
598721
public GiftCard redeemGiftCard(final String redemptionCode, final String accountCode) {
        final GiftCard.Redemption redemptionData = GiftCard.createRedemption(accountCode);
        final String url = GiftCards.GIFT_CARDS_RESOURCE + "/" + redemptionCode + "/redeem";

        return doPOST(url, redemptionData, GiftCard.class);
    }
909470
public Invoices getAccountInvoices(final String accountCode) {
        return doGET(Accounts.ACCOUNTS_RESOURCE + "/" + accountCode + Invoices.INVOICES_RESOURCE,
                     Invoices.class, new QueryParams());
    }
835734
public static GiftCard.Redemption createRedemption(String accountCode) {
        Redemption redemption = new Redemption();
        redemption.setAccountCode(accountCode);
        return redemption;
    }
1191946
public Account getAccount(final String accountCode) {
        if (accountCode == null || accountCode.isEmpty())
            throw new RuntimeException("accountCode cannot be empty!");

        return doGET(Account.ACCOUNT_RESOURCE + "/" + accountCode, Account.class);
    }
668432
public InvoiceCollection postAccountInvoice(final String accountCode, final Invoice invoice) {
        return doPOST(Accounts.ACCOUNTS_RESOURCE + "/" + accountCode + Invoices.INVOICES_RESOURCE, invoice, InvoiceCollection.class);
    }
1096211
@Transactional(readOnly = true)
	@Profile
	public Entity[] getEntityChildrenById(String id, long firstResult, long maxResults) throws NotFoundException {
		return storageDao.getEntityChildrenById(id, firstResult, maxResults);
	}