Class: Zm::Client::AccountsCollection

Inherits:
Base::ObjectsCollection show all
Defined in:
lib/zm/client/account/accounts_collection.rb

Overview

Collection Accounts

Constant Summary

Constants inherited from Base::ObjectsCollection

Base::ObjectsCollection::METHODS_MISSING_LIST

Instance Attribute Summary

Attributes inherited from Base::ObjectsCollection

#parent

Instance Method Summary collapse

Methods inherited from Base::ObjectsCollection

#all, #all!, #attrs, #build_from_entry, #count, #find, #first, #method_missing, #new, #order, #page, #per_page, #respond_to_missing?, #where

Constructor Details

#initialize(parent) ⇒ AccountsCollection

Returns a new instance of AccountsCollection.



7
8
9
10
11
# File 'lib/zm/client/account/accounts_collection.rb', line 7

def initialize(parent)
  @child_class = 
  @parent = parent
  reset_query_params
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Zm::Client::Base::ObjectsCollection

Instance Method Details

#find_all_quotas(domain_name = nil, target_server_id = nil) ⇒ Object



26
27
28
29
30
# File 'lib/zm/client/account/accounts_collection.rb', line 26

def find_all_quotas(domain_name = nil, target_server_id = nil)
  json = sac.get_quota_usage(domain_name, @all_servers, @limit, @offset, @sort_by, @sort_ascending, @refresh, target_server_id)
  reset_query_params
  AccountsBuilder.new(@parent, json).make
end

#find_by(hash) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/zm/client/account/accounts_collection.rb', line 18

def find_by(hash)
  rep = sac.(hash.values.first, hash.keys.first, attrs_comma, @apply_cos)
  reset_query_params
  entry = rep[:Body][:GetAccountResponse][:account].first

  build_from_entry(entry)
end

#ldapObject



13
14
15
16
# File 'lib/zm/client/account/accounts_collection.rb', line 13

def ldap
  @apply_cos = 0
  self
end