Delete a communication channel.

        Delete an existing communication channel.
346770
def delete_communication_channel_id(self, id, user_id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - user_id
        """ID"""
        path["user_id"] = user_id

        # REQUIRED - PATH - id
        """ID"""
        path["id"] = id

        self.logger.debug("DELETE /api/v1/users/{user_id}/communication_channels/{id} with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("DELETE", "/api/v1/users/{user_id}/communication_channels/{id}".format(**path), data=data, params=params, single_item=True)
357139
def disconnect_channel(self, destination_id):
        
        if destination_id in self._open_channels:
            try:
                self.send_message(
                    destination_id, NS_CONNECTION,
                    {MESSAGE_TYPE: TYPE_CLOSE, 'origin': {}},
                    no_add_request_id=True, force=True)
            except NotConnected:
                pass
            except Exception:  # pylint: disable=broad-except
                self.logger.exception("[%s:%s] Exception",
                                      self.fn or self.host, self.port)

            self._open_channels.remove(destination_id)

            self.handle_channel_disconnected()
472638
private void removeChannel(String name) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "CommsInboundChain removeChnanel", name);
        // Neither of the thrown exceptions are permanent failures: 
        // they usually indicate that we're the victim of a race.
        // If the CFW is also tearing down the chain at the same time 
        // (for example, the SSL feature was removed), then this could
        // fail.
        try {
            _cfw.removeChannel(name);
        } catch (ChannelException e) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                SibTr.debug(this, tc, "Error removing channel " + name, e);
            }
        } catch (ChainException e) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                SibTr.debug(this, tc, "Error removing channel " + name, e);
            }
        }
    }
1330933
function Session_delChannel(channel) {
  var index = this.channels.indexOf(channel)
  if (-1 == index) return

  this.channels.splice(index, 1)
}
249429
def delete_channel(self, chname):
        """"""
        name = chname.lower()

        if len(self.channel_names) < 1:
            self.logger.error('Delete channel={0} failed. '
                              'No channels left.'.format(chname))
            return

        with self.lock:
            channel = self.channel[name]

            # Close local plugins open on this channel
            self.close_plugins(channel)

            try:
                idx = self.channel_names.index(chname)
            except ValueError:
                idx = 0

            # Update the channels control
            self.channel_names.remove(channel.name)
            self.channel_names.sort()

            self.ds.remove_tab(chname)
            del self.channel[name]
            self.prefs.remove_settings('channel_' + chname)

            # pick new channel
            num_channels = len(self.channel_names)
            if num_channels > 0:
                if idx >= num_channels:
                    idx = num_channels - 1
                self.change_channel(self.channel_names[idx])
            else:
                self.cur_channel = None

        self.make_gui_callback('delete-channel', channel)
796447
def close_channel(self):
        
        self._logger.info('Closing the channel')
        if self._channel:
            self._channel.close()
586282
def part(self, channel):
        
        
        if channel in self.channels:
            channel.users.remove(self.nick)
            self.channels.remove(channel)
148341
@DELETE
    @Path("/{ccid: [A-Z,a-z,0-9,_,\\-,\\.]+}")
    public Response deleteChannel(@PathParam("ccid") String ccid) {
        try {
            log.info("DELETE channel for cluster controller: {}", ccid);

            if (channelService.deleteChannel(ccid)) {
                return Response.ok().build();
            }
            return Response.noContent().build();

        } catch (WebApplicationException e) {
            throw e;
        } catch (Exception e) {
            log.error("DELETE channel for cluster controller: error: {}", e.getMessage(), e);
            throw new WebApplicationException(Status.INTERNAL_SERVER_ERROR);
        }
    }
1239008
def delete(self, **kwargs):
        """"""
        self.method = 'delete'
        if len(kwargs) > 0:
            self.load(self.client.delete(self.url, params=kwargs))
        else:
            self.load(self.client.delete(self.url))
        self.parent.remove(self)
        return
1326107
private void removeOldChannels()
    {
        Iterator<AsteriskChannelImpl> i;

        synchronized (channels)
        {
            i = channels.values().iterator();
            while (i.hasNext())
            {
                final AsteriskChannel channel = i.next();
                final Date dateOfRemoval = channel.getDateOfRemoval();
                if (channel.getState() == ChannelState.HUNGUP && dateOfRemoval != null)
                {
                    final long diff = DateUtil.getDate().getTime() - dateOfRemoval.getTime();
                    if (diff >= REMOVAL_THRESHOLD)
                    {
                        i.remove();
                    }
                }
            }
        }
    }
493094
def quit(self):
        
        
        for c in self.channels:
            c.users.remove(self.nick)
        self.channels = []
1148364
def delete_channel_cb(self, viewer, channel):
        """"""
        chname = channel.name
        del self.name_dict[chname]

        # Unhighlight
        un_hilite_set = set([])
        for path in self._hl_path:
            if path[0] == chname:
                un_hilite_set.add(path)
        self._hl_path -= un_hilite_set

        if self.gui_up:
            self.recreate_toc()

        self._rebuild_channels()
1004466
def delete_connection(self, **kwargs):
        """"""
        conn = self.find_connection(**kwargs)
        if not conn:
            return False
        self.delete(conn)
        return True
503727
def channels_close(self, room_id, **kwargs):
        """"""
        return self.__call_api_post('channels.close', roomId=room_id, kwargs=kwargs)
323574
protected void closeIdleChannels ()
    {
        long now = System.currentTimeMillis();
        Iterator<Map.Entry<ChatChannel, ChannelInfo>> iter = _channels.entrySet().iterator();
        while (iter.hasNext()) {
            Map.Entry<ChatChannel, ChannelInfo> entry = iter.next();
            if (now - entry.getValue().lastMessage > IDLE_CHANNEL_CLOSE_TIME) {
                ((CrowdNodeObject)_peerMan.getNodeObject()).removeFromHostedChannels(
                    entry.getKey());
                iter.remove();
            }
        }
    }
1116883
@Deprecated
	public void delete(Collection<Channel.Builder> channels)
			throws ChannelFinderException {
		for (Channel.Builder channel : channels) {
			deleteChannel(channel.build().getName());
		}
	}
481851
def remove_dnc(self, obj_id, channel):
        
        response = self._client.session.post(
            '{url}/{id}/dnc/remove/{channel}'.format(
                url=self.endpoint_url, id=obj_id, channel=channel
            )
        )
        return self.process_response(response)