Exemplo n.º 1
0
    public BeamAPI(Uri basePath, String httpUsername, String httpPassword, String oauthToken)
    {
        if (basePath != null)
        {
            this.basePath = basePath;
        }
        else
        {
            this.basePath = DEFAULT_BASE_PATH;
        }

        //this.gson = new GsonBuilder()
        //        .registerTypeAdapter(InetSocketAddress.class, new IPEndPoint())
        //        .registerTypeAdapter(URI.class, new URIAdapter())     //UriAdapter(by beam) JSON type to convert
        //        .registerTypeAdapter(Date.class, DateAdapter.v1())    //DateTime JSON type to convert
        //.create();
        //string json = new JsonConvert.SerializeObject();

        //    this.executor = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(10));
        //ThreadPool.QueueUserWorkItem(f.ThreadPoolCallback, i);

        this.http     = new BeamHttpClient(this, httpUsername, httpPassword, oauthToken);
        this.services = new ServiceManager <AbstractBeamService>();

        //    this.register(new UsersService(this));
        //    this.register(new ChatService(this));
        //    this.register(new EmotesService(this));
        //    this.register(new ChannelsService(this));
        //    this.register(new TypesService(this));
        //    this.register(new TetrisService(this));
        //    this.register(new JWTService(this));
    }
Exemplo n.º 2
0
		static async Task DoStuff()
		{
			BeamHttpClient client = new BeamHttpClient();
			var channelTypesRequest = new ChannelTypesRequest()
			{
				Query = "Minecraft"
			};
			var channelTypesResponses = await client.Get<ChannelTypesRequest, ChannelTypesResponse>(channelTypesRequest);

			var loginRequest = new LoginRequest("AtomicBlom", "");
			var loginResponse = await client.Post<LoginRequest, LoginResponse>(loginRequest);

			Console.ReadKey();
		}
Exemplo n.º 3
0
		public BeamChatAPI(BeamHttpClient client)
		{
			_client = client;
		}