Build an instance of ChannelInstance

        :param dict payload: Payload response from the API

        :returns: twilio.rest.chat.v1.service.channel.ChannelInstance
        :rtype: twilio.rest.chat.v1.service.channel.ChannelInstance
766570
def get_instance(self, payload):
        
        return ChannelInstance(self._version, payload, service_sid=self._solution['service_sid'], )
1197987
def get_instance(self, payload):
        
        return KeyInstance(self._version, payload, account_sid=self._solution['account_sid'], )
565844
def get_instance(self, payload):
        
        return KeyInstance(self._version, payload, fleet_sid=self._solution['fleet_sid'], )
1130012
def get_instance(self, payload):
        
        return SampleInstance(
            self._version,
            payload,
            assistant_sid=self._solution['assistant_sid'],
            task_sid=self._solution['task_sid'],
        )
316408
def get_instance(self, payload):
        
        return MessageInstance(self._version, payload, session_sid=self._solution['session_sid'], )
311876
def get_instance(self, payload):
        
        return MemberInstance(
            self._version,
            payload,
            account_sid=self._solution['account_sid'],
            queue_sid=self._solution['queue_sid'],
        )
1011493
def subscribe(self, channel_name):
        
        data = {'channel': channel_name}

        if channel_name.startswith('presence-'):
            data['auth'] = self._generate_presence_key(
                self.connection.socket_id,
                self.key,
                channel_name,
                self.secret,
                self.user_data
            )
            data['channel_data'] = json.dumps(self.user_data)
        elif channel_name.startswith('private-'):
            data['auth'] = self._generate_private_key(
                self.connection.socket_id,
                self.key,
                channel_name,
                self.secret
            )

        self.connection.send_event('pusher:subscribe', data)

        self.channels[channel_name] = Channel(channel_name, self.connection)

        return self.channels[channel_name]
192250
def get_instance(self, payload):
        
        return UsageInstance(self._version, payload, sim_sid=self._solution['sim_sid'], )
1085678
def byte_to_channels(self, byte):
        
        # pylint: disable-msg=R0201
        assert isinstance(byte, int)
        assert byte >= 0
        assert byte < 256
        result = []
        for offset in range(0, 8):
            if byte & (1 << offset):
                result.append(offset + 1)
        return result
115165
def get_instance(self, payload):
        
        return EngagementInstance(self._version, payload, flow_sid=self._solution['flow_sid'], )
184783
def createDataChannel(self, label, maxPacketLifeTime=None, maxRetransmits=None,
                          ordered=True, protocol='', negotiated=False, id=None):
        
        if maxPacketLifeTime is not None and maxRetransmits is not None:
            raise ValueError('Cannot specify both maxPacketLifeTime and maxRetransmits')

        if not self.__sctp:
            self.__createSctpTransport()

        parameters = RTCDataChannelParameters(
            id=id,
            label=label,
            maxPacketLifeTime=maxPacketLifeTime,
            maxRetransmits=maxRetransmits,
            negotiated=negotiated,
            ordered=ordered,
            protocol=protocol)
        return RTCDataChannel(self.__sctp, parameters)
148136
def get_instance(self, payload):
        
        return FeedbackInstance(
            self._version,
            payload,
            account_sid=self._solution['account_sid'],
            call_sid=self._solution['call_sid'],
        )
703288
def get_instance(self, payload):
        
        return UsageInstance(self._version, payload, account_sid=self._solution['account_sid'], )
757945
def get_instance(self, payload):
        
        return SessionInstance(self._version, payload, service_sid=self._solution['service_sid'], )
1212280
def get_instance(self, payload):
        
        return FunctionInstance(self._version, payload, service_sid=self._solution['service_sid'], )
37076
def get_instance(self, payload):
        
        return FaxMediaInstance(self._version, payload, fax_sid=self._solution['fax_sid'], )
475759
def get_instance(self, payload):
        
        return RecordInstance(self._version, payload, account_sid=self._solution['account_sid'], )