def get_stats_audience(resource, offer_id=None, app_id=None, fm=None, to=None): path = '{0}/audience/{1}'.format(resource_path, resource) ufm = convert.to_unixtime(fm, True) if fm else None uto = convert.to_unixtime(to, True) if to else None params = dict() dict_update_filled_params(params, **{ 'offerId' : offer_id, 'appId' : app_id, 'from' : ufm, 'to' : uto }) return map(stat_from_xml, get(path=path, params_dict=params))
def add_user(email, password_hash, first_name, last_name, organization=None, phone=None, source_url=None, messenger_type=None, messenger_uid=None, referrer_id=None): params = dict(email=email, passwordHash=password_hash, firstName=first_name, lastName=last_name) shortcuts.dict_update_filled_params(params, organization=organization, phone=phone, sourceUrl=source_url, messengerType=messenger_type, messengerUid=messenger_uid, referrer=referrer_id) post(path=resource_path, params_dict=params)
def get_stats_ctr_by_ids(offer_ids=None, app_ids=None, fm=None, to=None): path = '{0}/{1}'.format(resource_path, 'ctr-by-ids') ufm = convert.to_unixtime(fm, True) if fm else None uto = convert.to_unixtime(to, True) if to else None params = dict() dict_update_filled_params(params, **{ 'offer' : offer_ids, 'app' : app_ids, 'from' : ufm, 'to' : uto }) return map(stat_from_xml, get(path=path, params_dict=params))
def introduce_performer(app_id, uid, sex=None, year=None, city=None, secret=None): if secret is None: secret = get_app(app_id).secret params = dict(method='introducePerformer', app_id=app_id, uid=uid) dict_update_filled_params(params, sex=sex, year=year, city=city) return api_get(params, secret)
def data_attrs(self): return dict_update_filled_params(dict(), **{ 'data-integer-message': self.message })
def data_attrs(self): return dict_update_filled_params(dict(), **{ 'data-equal-message': self.message, 'data-equal-other': self.fieldname })
def data_attrs(self): return dict_update_filled_params(dict(), **{ 'data-length-message': self.message, 'data-length-min': self.min, 'data-length-max': self.max })
def data_attrs(self): return dict_update_filled_params(dict(), **{ 'data-url-message': self.message, })
def get_apps(with_deleted=False, user_id=None, max_d=None, **kwargs): kwargs.update(withDeleted=with_deleted) shortcuts.dict_update_filled_params(kwargs, userId=user_id, maxD=max_d) return map(app_from_xml, get(path=resource_path, params_dict=kwargs))
def get_account_transactions(account_id, offset=None, limit=None): path = '{0}/{1}/transactions'.format(resource_path, account_id) params = dict(accountId=account_id) dict_update_filled_params(params, offset=offset, limit=limit) return map(transaction_from_xml, get(path=path, params_dict=params))
def update_settings(c_min=None, q=None, m=None): params = dict() dict_update_filled_params(params, cmin=c_min, m=m, q=q) return put(path=resource_path, params_dict=params)