target:     the url to receive the payload.
        payload:    a python primitive data structure
        instance_id:   a possibly None "trigger" instance ID
        hook_id:       the ID of defining Hook object
188247
def run(self, target, payload, instance_id=None, hook_id=None, **kwargs):
        
        requests.post(
            url=target,
            data=json.dumps(payload),
            headers={
                'Content-Type': 'application/json',
                'Authorization': 'Token %s' % settings.HOOK_AUTH_TOKEN
            }
        )
593287
def get_instance(self, payload):
        
        return SipInstance(self._version, payload, account_sid=self._solution['account_sid'], )
549161
def send(self, request_id, payload):
        

        log.debug("About to send %d bytes to Kafka, request %d" % (len(payload), request_id))

        # Make sure we have a connection
        if not self._sock:
            self.reinit()

        try:
            self._sock.sendall(payload)
        except socket.error:
            log.exception('Unable to send payload to Kafka')
            self._raise_connection_error()
318341
def build_payload(cls, method, args):
        
        ref = str(uuid.uuid4())
        return (method, args, ref)
1197987
def get_instance(self, payload):
        
        return KeyInstance(self._version, payload, account_sid=self._solution['account_sid'], )
1176117
def webhook_to_object(self, webhook):
        
        if isinstance(webhook, string_type):
            # If still JSON, convert to a Python dict
            webhook = json.dumps(webhook)

        # if a flask.Request object, try to convert that to a webhook
        if not isinstance(webhook, dict):
            webhook = get_webhook_from_request(webhook)

        try:
            webhook['api_url']
        except KeyError:
            raise InvalidWebhook

        payload = self.get(webhook['api_url'])

        return payload
572263
def _handle_command(self, connection, sender, target, command, payload):
        
        try:
            # Find the handler
            handler = getattr(self, "cmd_{0}".format(command))
        except AttributeError:
            self.safe_send(connection, target, "Unknown command: %s",
                            command)
        else:
            try:
                logging.info("! Handling command: %s", command)
                handler(connection, sender, target, payload)
            except Exception as ex:
                logging.exception("Error calling command handler: %s", ex)
14809
function (context, payload) {
        var state = context.state;
        var entity = state.$name;
        // If the payload is an array, then the payload should be an array of
        // data so let's pass the whole payload as data.
        if (Array.isArray(payload)) {
            return context.dispatch(state.$connection + "/update", { entity: entity, data: payload }, { root: true });
        }
        // If the payload doesn't have `data` property, we'll assume that
        // the user has passed the object as the payload so let's define
        // the whole payload as a data.
        if (payload.data === undefined) {
            return context.dispatch(state.$connection + "/update", { entity: entity, data: payload }, { root: true });
        }
        // Else destructure the payload and let root action handle it.
        return context.dispatch(state.$connection + "/update", __assign({ entity: entity }, payload), { root: true });
    }
370614
def _hook_id(self, info):
        
        if isinstance(info, dict) and 'id' in info.keys():
            self.id = info['id']
411172
def generate_payload(self, config, context):
        
        request = current_request()

        payload = {
            'url': request.build_absolute_uri(),
            'component': request.resolver_match.app_name,
            'action': request.resolver_match.func.__name__,
            'params': {},
            'session': {},
            'cgi_data': dict(request.META),
            'context': context
        }

        if hasattr(request, 'session'):
            payload['session'] = filter_dict(dict(request.session), config.params_filters)

        payload['params'] = filter_dict(dict(getattr(request, request.method)), config.params_filters)

        return payload
750222
def get_instance(self, payload):
        
        return CallInstance(self._version, payload, account_sid=self._solution['account_sid'], )
412497
def get_incident(self, id, **kwargs):
        "
        resp = self._get_object_by_name(self._INCIDENT_ENDPOINT_SUFFIX, id,
                                        **kwargs)
        return resp
750271
function getIdsFromPayload(payload, conf, path) {
    return payload.map(function (payloadPiece) { return getId(payloadPiece, conf, path, payload); });
}
750863
def get_instance(self, payload):
        
        return MessageInstance(
            self._version,
            payload,
            service_sid=self._solution['service_sid'],
            channel_sid=self._solution['channel_sid'],
        )
63957
def trigger_update_by_id(self, id, data, **kwargs):
        ""
        api_path = "/api/v2/triggers/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, method="PUT", data=data, **kwargs)
148136
def get_instance(self, payload):
        
        return FeedbackInstance(
            self._version,
            payload,
            account_sid=self._solution['account_sid'],
            call_sid=self._solution['call_sid'],
        )
639249
def parse(cls, payload):
        
        try:
            method, args, ref = payload
        except Exception as exception:
            raise RequestParseError(exception)
        else:
            return method, args, ref