1 // OpenTween - Client of Twitter
2 // Copyright (c) 2007-2011 kiri_feather (@kiri_feather) <kiri.feather@gmail.com>
3 // (c) 2008-2011 Moz (@syo68k)
4 // (c) 2008-2011 takeshik (@takeshik) <http://www.takeshik.org/>
5 // (c) 2010-2011 anis774 (@anis774) <http://d.hatena.ne.jp/anis774/>
6 // (c) 2010-2011 fantasticswallow (@f_swallow) <http://twitter.com/f_swallow>
7 // (c) 2011 Egtra (@egtra) <http://dev.activebasic.com/egtra/>
8 // (c) 2013 kim_upsilon (@kim_upsilon) <https://upsilo.net/~upsilon/>
9 // All rights reserved.
11 // This file is part of OpenTween.
13 // This program is free software; you can redistribute it and/or modify it
14 // under the terms of the GNU General Public License as published by the Free
15 // Software Foundation; either version 3 of the License, or (at your option)
18 // This program is distributed in the hope that it will be useful, but
19 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 // or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 // You should have received a copy of the GNU General Public License along
24 // with this program. If not, see <http://www.gnu.org/licenses/>, or write to
25 // the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
26 // Boston, MA 02110-1301, USA.
28 #nullable enable annotations
31 using System.Collections.Generic;
33 using System.Runtime.Serialization;
35 using System.Threading.Tasks;
37 namespace OpenTween.Api.DataModel
40 public class TwitterConfiguration
42 [DataMember(Name = "characters_reserved_per_media")]
43 public int CharactersReservedPerMedia { get; set; }
45 [DataMember(Name = "photo_size_limit")]
46 public long PhotoSizeLimit { get; set; }
48 [DataMember(Name = "photo_sizes")]
49 public TwitterMediaSizes PhotoSizes { get; set; }
51 [DataMember(Name = "non_username_paths")]
52 public string[] NonUsernamePaths { get; set; }
54 [DataMember(Name = "short_url_length")]
55 public int ShortUrlLength { get; set; }
57 [DataMember(Name = "short_url_length_https")]
58 public int ShortUrlLengthHttps { get; set; }
60 [DataMember(Name = "max_media_per_upload")]
61 public int MaxMediaPerUpload { get; set; }
63 [DataMember(Name = "dm_text_character_limit")]
64 public int DmTextCharacterLimit { get; set; }
66 /// <exception cref="SerializationException"/>
67 public static TwitterConfiguration ParseJson(string json)
68 => MyCommon.CreateDataFromJson<TwitterConfiguration>(json);
71 /// 設定が取得できるまでの間に代わりに使用する適当な値を返します
73 public static TwitterConfiguration DefaultConfiguration()
75 return new TwitterConfiguration
77 CharactersReservedPerMedia = 24,
79 ShortUrlLengthHttps = 23,
80 PhotoSizeLimit = 3145728L,
81 DmTextCharacterLimit = 10000,