Beispiel #1
0
        /// <summary>
        ///     コンストラクタ
        /// </summary>
        /// <param name="clientId">Client ID (ライブラリには含まれまていません)</param>
        /// <param name="clientSecret">Client Secret (ライブラリには含まれていません)</param>
        public PixivClient(string clientId, string clientSecret)
        {
            ClientId     = clientId;
            ClientSecret = clientSecret;

            // 2018/03/30
            _httpClient = new HttpClient();
            _httpClient.DefaultRequestHeaders.Add("App-OS-Version", OsVersion);
            _httpClient.DefaultRequestHeaders.Add("App-OS", "ios");
            _httpClient.DefaultRequestHeaders.Add("App-Version", AppVersion);
            _httpClient.DefaultRequestHeaders.Add("User-Agent", $"PixivIOSApp/{AppVersion} (iOS {OsVersion}; iPhone9,2)");

            // Initialize accesors
            Application    = new ApplicationInfoClient(this);
            Authentication = new AuthenticationClient(this);
            Illust         = new IllustClient(this);
            IllustSeries   = new IllustSeriesClient(this);
            Live           = new LiveClient(this);
            Manga          = new MangaClient(this);
            Mute           = new MuteClient(this);
            Notification   = new NotificationClient(this);
            Novel          = new NovelClient(this);
            Search         = new SearchClient(this);
            Spotlight      = new SpotlightClient(this);
            TrendingTags   = new TrendingTagsClient(this);
            User           = new UserClient(this);
            Walkthrough    = new WalkthroughClient(this);
            File           = new FileClient(this);
        }
Beispiel #2
0
        public MisskeyClient(Credential credential, HttpClientHandler innerHandler = null) : base(credential, new MisskeyAuthenticationHandler(innerHandler), RequestMode.Json)
        {
            BinaryParameters = new List <string> {
                "file"
            };

            Aggregation   = new AggregationClient(this);
            Ap            = new ApClient(this);
            Admin         = new AdminClient(this);
            App           = new MisskeyAppClient(this);
            Auth          = new AuthClient(this);
            Blocking      = new BlockingClient(this);
            Charts        = new ChartsClient(this);
            Drive         = new DriveClient(this);
            Federation    = new FederationClient(this);
            Following     = new FollowingClient(this);
            Hashtags      = new HashtagsClient(this);
            I             = new IClient(this);
            Messaging     = new MessagingClient(this);
            Mute          = new MuteClient(this);
            My            = new MyClient(this);
            Notes         = new NotesClient(this);
            Notifications = new NotificationsClient(this);
            Streaming     = new StreamingClient(this);
            Username      = new UsernameClient(this);
            Users         = new UsersClient(this);
        }
Beispiel #3
0
        public async Task Execute_MuteClientExecutableSuccessful_SendsCommands()
        {
            // arrange
            var server = SetupServer(out var executor, out var session);
            var exec   = new MuteClient {
                Nickname = "User 2"
            };

            server.Response = ""
                              + "TS3\r\n"
                              + "Welcome to the TeamSpeak 3 ServerQuery interface.\r\n"
                              + "clid=93 cid=1 client_database_id=1 client_nickname=serveradmin client_type=1|"
                              + "clid=90 cid=6 client_database_id=247 client_nickname=User\\s1 client_type=0|"
                              + "clid=88 cid=6 client_database_id=2 client_nickname=User\\s2 client_type=0\r\n"
                              + "error id=0 msg=ok\r\n"
                              + "error id=0 msg=ok\r\n";

            // act
            executor.Schedule(exec);
            executor.Stop();
            await session;

            // assert
            Assert.Equal(""
                         + "clientlist\n"
                         + "clientedit clid=88 client_is_talker=0\n"
                         + "", server.Receive);
        }