Adds supported subscriptions
507760
def create_subscriptions(config, profile_name):
    '''  '''
    if 'kinesis' in config.subscription.keys():
        data = config.subscription['kinesis']
        function_name = config.name
        stream_name = data['stream']
        batch_size = data['batch_size']
        starting_position = data['starting_position']
        starting_position_ts = None
        if starting_position == 'AT_TIMESTAMP':
            ts = data.get('starting_position_timestamp')
            starting_position_ts = datetime.strptime(ts, '%Y-%m-%dT%H:%M:%SZ')
        s = KinesisSubscriber(config, profile_name,
                              function_name, stream_name, batch_size,
                              starting_position,
                              starting_position_ts=starting_position_ts)
        s.subscribe()
457645
function subscribeBrowser (client, subscriptions, backlog, channel, callback, done_callback) {
    if ( addToBacklog(client, backlog, subscribeBrowser, [client, subscriptions, backlog, channel, callback, done_callback]) ) return;
    if (subscriptions[channel]===undefined) {
        subscriptions[channel] = [callback];
        client.subscribe(channel, {qos: 0, onSuccess: function() {
            // If there is a done_callback defined, execute it
            if (done_callback!==undefined) done_callback();
        }});
    } else {
        subscriptions[channel].push(callback);
        // If there is a done_callback defined, execute it
        if (done_callback!==undefined) done_callback();
    }
}
964823
public function addSubscription(\HarvestCloud\CoreBundle\Entity\ProductSubscription $subscription)
    {
        $this->subscriptions[] = $subscription;

        return $this;
    }
692309
def requestAccountUpdates(self, subscribe=True):
        
        if self.subscribeAccount != subscribe:
            self.subscribeAccount = subscribe
            self.ibConn.reqAccountUpdates(subscribe, 0)
589146
public void setSubscriptions(List<String> subscriptions) {
        this.subscriptions.clear();
        if(subscriptions == null) return;
        for(String currentSubscription: subscriptions) {
            if (this.getNotifierName().equals(AlertService.SupportedNotifier.GUS.getName())) {
                if (currentSubscription.isEmpty() || currentSubscription.length() < 10)
                    throw new IllegalArgumentException("GUS Subscription has to contain subjectId with more than 10 characters.");
            } else if (this.getNotifierName().equals(AlertService.SupportedNotifier.EMAIL.getName())) {

                if (currentSubscription.isEmpty() || !currentSubscription.contains("@")) {
                    String errorMessage = MessageFormat.format("Email Address {0} is not allowed as @ not present.",
                            currentSubscription);
                    throw new IllegalArgumentException(errorMessage);
                }
            } else if (this.getNotifierName().equals(AlertService.SupportedNotifier.CALLBACK.getName()) && currentSubscription.isEmpty()) {
                throw new IllegalArgumentException("Callback Notifier Subscription cannot be empty.");
            }
        }
        if (subscriptions != null && !subscriptions.isEmpty()) {
            this.subscriptions.addAll(subscriptions);
        }
    }
340696
def index
      @subscriptions = Subscription.all
  
      respond_to do |format|
        format.html # index.html.erb
        format.json { render json: @subscriptions }
      end
    end
1174608
public static void registerSubscription(Subscription subscription) {
        mSubscriptions.add(subscription);
        if (isConnected()) {
            executeQuery(subscription.getQuery());
        }
    }
618250
function subscribe(message) {
		reply(proto.writeSubscribe(message.id));
		subscritions[message.itemName] = message.id;
		if (!isSnapshotAvailable(message.itemName)) {
			notify(proto.writeEndOfSnapshot(message.id, message.itemName));
		}
		dequeueSubUnsubRequest(message.itemName);
		fireFirstSubUnsubEvent(message.itemName);
	}
425780
async def _subscribe(self, channels, is_mask):
        """"""
        news = []
        for channel in channels:
            key = channel, is_mask
            self._channels.append(key)
            if key in self._plugin._subscriptions:
                self._plugin._subscriptions[key].append(self._queue)
            else:
                self._plugin._subscriptions[key] = [self._queue]
                news.append(channel)
        if news:
            await getattr(self._sub, 'psubscribe' if is_mask else 'subscribe')(news)
660716
def list_subscriptions(self, service):
        """"""
        data = {
            'service': service,
        }
        return self._perform_post_request(self.list_subscriptions_endpoint, data, self.token_header)
941322
def subscribe(self, id, name, port):
		""""""
		sub = gntp.core.GNTPSubscribe()
		sub.add_header('Subscriber-ID', id)
		sub.add_header('Subscriber-Name', name)
		sub.add_header('Subscriber-Port', port)
		if self.password:
			sub.set_password(self.password, self.passwordHash)

		self.add_origin_info(sub)
		self.subscribe_hook(sub)

		return self._send('subscribe', sub)
1272657
def add_subscription(topic, klass, options=nil)
      options ||= {}
      raise WampRails::Error.new('"add_subscription" must be called BEFORE "open"') if self.thread
      self.subscriptions << WampRails::Command::Subscribe.new(topic, klass, options, self)
    end
55742
public void setSubscribe(boolean subscribe) {
        addField(ConfigureNodeFields.subscribe, FormField.Type.bool);
        setAnswer(ConfigureNodeFields.subscribe.getFieldName(), subscribe);
    }
497527
def push_subscription_update(self, follow_events=None, 
                              favourite_events=None, reblog_events=None, 
                              mention_events=None):
        
        params = {}
        
        if follow_events != None:
            params['data[alerts][follow]'] = follow_events
        
        if favourite_events != None:
            params['data[alerts][favourite]'] = favourite_events
            
        if reblog_events != None:
            params['data[alerts][reblog]'] = reblog_events
            
        if mention_events != None:
            params['data[alerts][mention]'] = mention_events
            
        return self.__api_request('PUT', '/api/v1/push/subscription', params)
74630
def update_subscription(netid, action, subscription_code, data_field=None):
    
    url = '/nws/v1/subscription.json'
    action = {
        'uwNetID': netid,
        'action': action,
        'subscriptionCode': str(subscription_code)
    }

    if isinstance(data_field, tuple) and len(data_field) == 2:
        action[data_field[0]] = str(data_field[1])

    body = {'actionList': [action]}
    response = post_resource(url, json.dumps(body))
    return _json_to_subscriptions(response)
1144035
def get_subscriptions(self, fetch=False):
        """"""
        return Subscriptions(
            self.resource.subscriptions, self.client, populate=fetch)
755460
public function createSubscription()
    {
        $data = [
            "customer" => request()->customer, //Customer email or code
            "plan" => request()->plan,
            "authorization" => request()->authorization_code
        ];

        $this->setRequestOptions();
        $this->setHttpResponse('/subscription', 'POST', $data);
    }