示例#1
0
    def custom_params(self):
        params = {}

        if self._read is not None:
            params['r'] = '1' if self._read is True else '0'
        if self._write is not None:
            params['w'] = '1' if self._write is True else '0'
        if self._manage is not None:
            params['m'] = '1' if self._manage is True else '0'
        if self._delete is not None:
            params['d'] = '1' if self._delete is True else '0'

        if len(self._auth_keys) > 0:
            params['auth'] = utils.join_items_and_encode(self._auth_keys)

        if len(self._channels) > 0:
            params['channel'] = utils.join_items(self._channels)

        if len(self._groups) > 0:
            params['channel-group'] = utils.join_items(self._groups)

        if self._ttl is not None:
            params['ttl'] = str(int(self._ttl))

        return params
示例#2
0
    def custom_params(self):
        params = {}

        if self._read is not None:
            params['r'] = '1' if self._read is True else '0'
        if self._write is not None:
            params['w'] = '1' if self._write is True else '0'
        if self._manage is not None:
            params['m'] = '1' if self._manage is True else '0'
        if self._delete is not None:
            params['d'] = '1' if self._delete is True else '0'
        if self._get is not None:
            params['g'] = '1' if self._get is True else '0'
        if self._update is not None:
            params['u'] = '1' if self._update is True else '0'
        if self._join is not None:
            params['j'] = '1' if self._join is True else '0'

        if self._auth_keys:
            params['auth'] = utils.join_items(self._auth_keys)

        if self._channels:
            params['channel'] = utils.join_items(self._channels)

        if self._groups:
            params['channel-group'] = utils.join_items(self._groups)

        if self._uuids:
            params['target-uuid'] = utils.join_items(self._uuids)

        if self._ttl is not None:
            params['ttl'] = str(int(self._ttl))

        return params
示例#3
0
    def custom_params(self):
        params = {}

        params['add'] = utils.join_items(self._channels)
        params['type'] = utils.push_type_to_string(self._push_type)

        return params
示例#4
0
    def custom_params(self):
        params = {}

        if len(self._groups) > 0:
            params['channel-group'] = utils.join_items(self._groups)

        return params
示例#5
0
文件: leave.py 项目: vtpp/python
    def custom_params(self):
        params = {}

        if len(self._groups) > 0:
            params['channel-group'] = utils.join_items(self._groups)

        return params
示例#6
0
    def custom_params(self):
        params = {
            'remove': utils.join_items(self._channels),
            'type': utils.push_type_to_string(self._push_type)
        }

        return params
示例#7
0
    def custom_params(self):
        params = {}

        params['add'] = utils.join_items(self._channels)
        params['type'] = utils.push_type_to_string(self._push_type)

        return params
 def custom_params(self):
     params = {}
     if len(self._channels_timetoken) > 0:
         if len(self._channels_timetoken) > 1:
             params['channelsTimetoken'] = utils.join_items(self._channels_timetoken)
         else:
             params['timetoken'] = self._channels_timetoken[0]
     return params
示例#9
0
    def custom_params(self):
        params = {'heartbeat': str(self.pubnub.config.presence_timeout)}

        if len(self._groups) > 0:
            params['channel-group'] = utils.join_items(self._groups)

        if self._state is not None and len(self._state) > 0:
            params['state'] = utils.write_value_as_string(self._state)

        return params
示例#10
0
    def custom_params(self):
        params = {"heartbeat": str(self.pubnub.config.presence_timeout)}

        if len(self._groups) > 0:
            params["channel-group"] = utils.join_items(self._groups)

        if self._state is not None and len(self._state) > 0:
            params["state"] = utils.url_write(self._state)

        return params
示例#11
0
    def custom_params(self):
        params = {'remove': utils.join_items(self._channels)}

        if self._push_type != PNPushType.APNS2:
            params['type'] = utils.push_type_to_string(self._push_type)
        else:
            if self._environment is None:
                self._environment = PNPushEnvironment.DEVELOPMENT

            params['environment'] = self._environment
            params['topic'] = self._topic

        return params
示例#12
0
文件: grant.py 项目: pubnub/python
    def custom_params(self):
        params = {}

        if self._read is not None:
            params['r'] = '1' if self._read is True else '0'
        if self._write is not None:
            params['w'] = '1' if self._write is True else '0'
        if self._manage is not None:
            params['m'] = '1' if self._manage is True else '0'

        if len(self._auth_keys) > 0:
            params['auth'] = utils.join_items_and_encode(self._auth_keys)

        if len(self._channels) > 0:
            params['channel'] = utils.join_items(self._channels)

        if len(self._groups) > 0:
            params['channel-group'] = utils.join_items(self._groups)

        if self._ttl is not None:
            params['ttl'] = str(int(self._ttl))

        return params
    def custom_params(self):
        params = {}

        if self._start is not None:
            params['start'] = self._start

        if self._end is not None and self._start is None:
            params['end'] = self._end

        if self._count is True:
            params['count'] = True

        if self._limit != ManageMemberships.MAX_LIMIT:
            params['limit'] = self._limit

        if self._include:
            params['include'] = utils.join_items(self._include)

        return params
示例#14
0
    def custom_params(self):
        params = {}

        if self._start is not None:
            params['start'] = self._start

        if self._end is not None and self._start is None:
            params['end'] = self._end

        if self._count is True:
            params['count'] = True

        if self._limit != GetSpaceMemberships.MAX_LIMIT:
            params['limit'] = self._limit

        if self._include:
            params['include'] = utils.join_items(self._include)

        if self._filter:
            params['filter'] = utils.url_encode(self._filter)

        return params
示例#15
0
 def custom_params(self):
     return {'add': utils.join_items(self._channels)}
示例#16
0
 def custom_params(self):
     return {'add': utils.join_items(self._channels)}
示例#17
0
    def custom_params(self):
        params = {'remove': utils.join_items(self._channels), 'type': utils.push_type_to_string(self._push_type)}

        return params