C# Class HipChat.HipChatClient

Class used to encapsulate core HipChat API methods. This is the core class that is used to interact with the API.
https://www.hipchat.com/docs/api
Show file Open project: versionone/HipChat.net Class Usage Examples

Private Properties

Property Type Description
FormatMessageUri string
FormatRoomsHistoryUri string
FormatRoomsHistoryUri string
FormatRoomsListUri string

Public Methods

Method Description
HipChatClient ( ) : System
HipChatClient ( string token ) : System
HipChatClient ( string token, ApiResponseFormat format ) : System
HipChatClient ( string token, int room ) : System
HipChatClient ( string token, int room, ApiResponseFormat format ) : System
HipChatClient ( string token, int room, string from ) : System
ListHistoryAsNativeObjects ( ) : List
ListHistoryAsNativeObjects ( System.DateTime dt ) : List

Returns the history as native C# objects

ListRooms ( ) : string

Returns the list of available rooms as XML/JSON

ListRoomsAsNativeObjects ( ) : List

Returns the list of available rooms as native C# objects

RoomHistory ( ) : string
RoomHistory ( System.DateTime date ) : string

Returns the chat history of a single room on a single day.

SendMessage ( string message ) : void

Sends a message to a room.

SendMessage ( string message, BackgroundColor color ) : void

Sends a message to a chat room.

SendMessage ( string message, BackgroundColor color, bool notify ) : void

Sends a message to a chat room.

SendMessage ( string message, int room ) : void

Sends a message to a chat room.

SendMessage ( string message, int room, bool notify ) : void

Sends a message to a chat room.

SendMessage ( string message, int room, string from ) : void

Sends a message to a chat room.

SendMessage ( string message, int room, string from, bool notify ) : void

Sends a message to a chat room.

SendMessage ( string token, int room, string from, string message ) : void

Sends a message to a chat room.

SendMessage ( string token, int room, string from, string message, BackgroundColor color ) : void

Sends a message to a chat room.

SendMessage ( string token, int room, string from, string message, bool notify ) : void

Sends a message to a chat room.

SendMessage ( string token, int room, string from, string message, bool notify, BackgroundColor color ) : void

Sends a message to a chat room.

SendMessage ( string message, string from ) : void

Sends a message to a chat room.

SendMessage ( string message, string from, BackgroundColor color ) : void

Sends a message to a chat room.

SendMessage ( string message, string from, bool notify ) : void

Sends a message to a chat room.

SendMessage ( string message, string from, bool notify, BackgroundColor color ) : void

Sends a message to a chat room.

YieldRooms ( ) : IEnumerable

Yields each individual room as strongly-typed Entities.Room object

Private Methods

Method Description
FormatMessageUri ( string message ) : string

Formats the URI for the /rooms/message API (http://www.hipchat.com/docs/api/method/rooms/message)

FormatRoomsHistoryUri ( ) : string
FormatRoomsHistoryUri ( System.DateTime date ) : string

Formats the URI for the /rooms/history API (http://www.hipchat.com/docs/api/method/rooms/history)

FormatRoomsListUri ( ) : string

Formats the URI for the /rooms/list API (http://www.hipchat.com/docs/api/method/rooms/list)

Method Details

HipChatClient() public method

public HipChatClient ( ) : System
return System

HipChatClient() public method

public HipChatClient ( string token ) : System
token string
return System

HipChatClient() public method

public HipChatClient ( string token, ApiResponseFormat format ) : System
token string
format ApiResponseFormat
return System

HipChatClient() public method

public HipChatClient ( string token, int room ) : System
token string
room int
return System

HipChatClient() public method

public HipChatClient ( string token, int room, ApiResponseFormat format ) : System
token string
room int
format ApiResponseFormat
return System

HipChatClient() public method

public HipChatClient ( string token, int room, string from ) : System
token string
room int
from string
return System

ListHistoryAsNativeObjects() public method

public ListHistoryAsNativeObjects ( ) : List
return List

ListHistoryAsNativeObjects() public method

Returns the history as native C# objects
public ListHistoryAsNativeObjects ( System.DateTime dt ) : List
dt System.DateTime
return List

ListRooms() public method

Returns the list of available rooms as XML/JSON
public ListRooms ( ) : string
return string

ListRoomsAsNativeObjects() public method

Returns the list of available rooms as native C# objects
public ListRoomsAsNativeObjects ( ) : List
return List

RoomHistory() public method

public RoomHistory ( ) : string
return string

RoomHistory() public method

Returns the chat history of a single room on a single day.
public RoomHistory ( System.DateTime date ) : string
date System.DateTime
return string

SendMessage() public method

Sends a message to a room.
public SendMessage ( string message ) : void
message string The message to send - can contain some HTML and must be valid XHTML.
return void

SendMessage() public method

Sends a message to a chat room.
public SendMessage ( string message, BackgroundColor color ) : void
message string The message to send - can contain some HTML and must be valid XHTML.
color BackgroundColor Background color to use with the message
return void

SendMessage() public method

Sends a message to a chat room.
public SendMessage ( string message, BackgroundColor color, bool notify ) : void
message string The message to send - can contain some HTML and must be valid XHTML.
color BackgroundColor Background color to use with the message
notify bool If true, the message triggers a "ping" sound when it hits the room.
return void

SendMessage() public method

Sends a message to a chat room.
public SendMessage ( string message, int room ) : void
message string The message to send - can contain some HTML and must be valid XHTML.
room int The id of the room to send the message to - sets the RoomId property.
return void

SendMessage() public method

Sends a message to a chat room.
public SendMessage ( string message, int room, bool notify ) : void
message string The message to send - can contain some HTML and must be valid XHTML.
room int The id of the room to send the message to - sets the RoomId property.
notify bool If true, the message triggers a "ping" sound when it hits the room.
return void

SendMessage() public method

Sends a message to a chat room.
public SendMessage ( string message, int room, string from ) : void
message string The message to send - can contain some HTML and must be valid XHTML.
room int
from string
return void

SendMessage() public method

Sends a message to a chat room.
public SendMessage ( string message, int room, string from, bool notify ) : void
message string The message to send - can contain some HTML and must be valid XHTML.
room int
from string
notify bool If true, the message triggers a "ping" sound when it hits the room.
return void

SendMessage() public static method

Sends a message to a chat room.
public static SendMessage ( string token, int room, string from, string message ) : void
token string
room int
from string
message string
return void

SendMessage() public static method

Sends a message to a chat room.
public static SendMessage ( string token, int room, string from, string message, BackgroundColor color ) : void
token string
room int
from string
message string
color BackgroundColor
return void

SendMessage() public static method

Sends a message to a chat room.
public static SendMessage ( string token, int room, string from, string message, bool notify ) : void
token string
room int
from string
message string
notify bool
return void

SendMessage() public static method

Sends a message to a chat room.
public static SendMessage ( string token, int room, string from, string message, bool notify, BackgroundColor color ) : void
token string
room int
from string
message string
notify bool
color BackgroundColor
return void

SendMessage() public method

Sends a message to a chat room.
public SendMessage ( string message, string from ) : void
message string The message to send - can contain some HTML and must be valid XHTML.
from string The name of the sender - sets the From property.
return void

SendMessage() public method

Sends a message to a chat room.
public SendMessage ( string message, string from, BackgroundColor color ) : void
message string The message to send - can contain some HTML and must be valid XHTML.
from string The name of the sender - sets the From property.
color BackgroundColor Background color to use with the message
return void

SendMessage() public method

Sends a message to a chat room.
public SendMessage ( string message, string from, bool notify ) : void
message string The message to send - can contain some HTML and must be valid XHTML.
from string The name of the sender - sets the From property.
notify bool If true, the message triggers a "ping" sound when it hits the room.
return void

SendMessage() public method

Sends a message to a chat room.
public SendMessage ( string message, string from, bool notify, BackgroundColor color ) : void
message string The message to send - can contain some HTML and must be valid XHTML.
from string The name of the sender - sets the From property.
notify bool If true, the message triggers a "ping" sound when it hits the room.
color BackgroundColor Background color to use with the message
return void

YieldRooms() public method

Yields each individual room as strongly-typed Entities.Room object
public YieldRooms ( ) : IEnumerable
return IEnumerable