Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="InTouch"/> class.
        /// </summary>
        /// <param name="throwExceptionOnResponseError">Whether the raw response string should be included in request response object.</param>
        /// <param name="includeRawResponse">Whether the raw response string should be included in request response object.</param>
        public InTouch(bool throwExceptionOnResponseError = false, bool includeRawResponse = false)
        {
            if (_apiClient == null)
            {
                _apiClient = new HttpClient
                {
                    BaseAddress = _baseApiUri
                };
            }

            _apiClient.DefaultRequestHeaders.Accept.Clear();
            _apiClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

            ThrowExceptionOnResponseError = throwExceptionOnResponseError;
            IncludeRawResponse            = includeRawResponse;

            Account       = new AccountMethods(this);
            Users         = new UsersMethods(this);
            Status        = new StatusMethods(this);
            Gifts         = new GiftsMethods(this);
            Storage       = new StorageMethods(this);
            Utils         = new UtilsMethods(this);
            Fave          = new FaveMethods(this);
            Docs          = new DocsMethods(this);
            Polls         = new PollsMethods(this);
            Likes         = new LikesMethods(this);
            Auth          = new AuthMethods(this);
            Wall          = new WallMethods(this);
            Photos        = new PhotosMethods(this);
            Friends       = new FriendsMethods(this);
            Videos        = new VideoMethods(this);
            Places        = new PlacesMethods(this);
            Messages      = new MessagesMethods(this);
            Notifications = new NotificationsMethods(this);
            Newsfeed      = new NewsfeedMethods(this);
            Database      = new DatabaseMethods(this);
            Audio         = new AudioMethods(this);
            Pages         = new PagesMethods(this);
            Groups        = new GroupsMethods(this);
            Board         = new BoardMethods(this);
            Notes         = new NotesMethods(this);
            Stats         = new StatsMethods(this);
            Search        = new SearchMethods(this);
            Market        = new MarketMethods(this);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="InTouch"/> class.
        /// </summary>
        /// <param name="throwExceptionOnResponseError">Whether the raw response string should be included in request response object.</param>
        /// <param name="includeRawResponse">Whether the raw response string should be included in request response object.</param>
        public InTouch(bool throwExceptionOnResponseError = false, bool includeRawResponse = false)
        {
            ThrowExceptionOnResponseError = throwExceptionOnResponseError;
            IncludeRawResponse            = includeRawResponse;

            Account       = new AccountMethods(this);
            Users         = new UsersMethods(this);
            Status        = new StatusMethods(this);
            Gifts         = new GiftsMethods(this);
            Storage       = new StorageMethods(this);
            Utils         = new UtilsMethods(this);
            Fave          = new FaveMethods(this);
            Docs          = new DocsMethods(this);
            Polls         = new PollsMethods(this);
            Likes         = new LikesMethods(this);
            Auth          = new AuthMethods(this);
            Wall          = new WallMethods(this);
            Photos        = new PhotosMethods(this);
            Friends       = new FriendsMethods(this);
            Videos        = new VideoMethods(this);
            Places        = new PlacesMethods(this);
            Messages      = new MessagesMethods(this);
            Notifications = new NotificationsMethods(this);
            Newsfeed      = new NewsfeedMethods(this);
            Database      = new DatabaseMethods(this);
            Audio         = new AudioMethods(this);
            Pages         = new PagesMethods(this);
            Groups        = new GroupsMethods(this);
            Board         = new BoardMethods(this);
            Notes         = new NotesMethods(this);
            Stats         = new StatsMethods(this);
            Search        = new SearchMethods(this);
            Market        = new MarketMethods(this);
            Secure        = new SecureMethods(this);

            JsonConvert.DefaultSettings = () => new JsonSerializerSettings
            {
                ContractResolver = new PrivateResolver()
            };
        }