├── .github
└── dependabot.yml
├── .gitmodules
├── .vscode
└── settings.json
├── LICENSE
├── LICENSE.AGPL
├── README-generated.md
├── README.md
├── example
├── .gitignore
├── .prettierrc
├── .vscode
│ ├── extensions.json
│ └── settings.json
├── package-lock.json
├── package.json
├── src
│ ├── login.ts
│ ├── proxy.ts
│ └── tweetMedia.ts
├── test.png
└── tsconfig.json
├── twitter-openapi-typescript-generated
├── .gitignore
├── .npmignore
├── .openapi-generator-ignore
├── .openapi-generator
│ ├── FILES
│ └── VERSION
├── LICENSE
├── LICENSE.AGPL
├── README.md
├── package-lock.json
├── package.json
├── src
│ ├── apis
│ │ ├── DefaultApi.ts
│ │ ├── OtherApi.ts
│ │ ├── PostApi.ts
│ │ ├── TweetApi.ts
│ │ ├── UserApi.ts
│ │ ├── UserListApi.ts
│ │ ├── UsersApi.ts
│ │ ├── V11GetApi.ts
│ │ ├── V11PostApi.ts
│ │ ├── V20GetApi.ts
│ │ └── index.ts
│ ├── index.ts
│ ├── models
│ │ ├── AboutCommunityResult.ts
│ │ ├── AboutCommunityResults.ts
│ │ ├── AboutCommunityTweetData.ts
│ │ ├── AdditionalMediaInfo.ts
│ │ ├── AdditionalMediaInfoCallToActions.ts
│ │ ├── AdditionalMediaInfoCallToActionsUrl.ts
│ │ ├── AllowDownloadStatus.ts
│ │ ├── AnalysisResults.ts
│ │ ├── Article.ts
│ │ ├── ArticleCoverMedia.ts
│ │ ├── ArticleCoverMediaColorInfo.ts
│ │ ├── ArticleCoverMediaColorInfoPalette.ts
│ │ ├── ArticleCoverMediaColorInfoPaletteRGB.ts
│ │ ├── ArticleCoverMediaInfo.ts
│ │ ├── ArticleLifecycleState.ts
│ │ ├── ArticleMetadata.ts
│ │ ├── ArticleResult.ts
│ │ ├── ArticleResults.ts
│ │ ├── AuthorCommunityRelationship.ts
│ │ ├── BirdwatchEntity.ts
│ │ ├── BirdwatchEntityRef.ts
│ │ ├── BirdwatchPivot.ts
│ │ ├── BirdwatchPivotCallToAction.ts
│ │ ├── BirdwatchPivotFooter.ts
│ │ ├── BirdwatchPivotNote.ts
│ │ ├── BirdwatchPivotSubtitle.ts
│ │ ├── BookmarksResponse.ts
│ │ ├── BookmarksResponseData.ts
│ │ ├── BookmarksTimeline.ts
│ │ ├── Callback.ts
│ │ ├── ClientEventInfo.ts
│ │ ├── CommunitiesActions.ts
│ │ ├── Community.ts
│ │ ├── CommunityAboutTimelineResponse.ts
│ │ ├── CommunityActions.ts
│ │ ├── CommunityData.ts
│ │ ├── CommunityDeleteActionResult.ts
│ │ ├── CommunityInvitesResult.ts
│ │ ├── CommunityJoinAction.ts
│ │ ├── CommunityJoinActionResultUnion.ts
│ │ ├── CommunityJoinActionUnavailable.ts
│ │ ├── CommunityJoinRequestsResult.ts
│ │ ├── CommunityLeaveActionResult.ts
│ │ ├── CommunityMediaTimelineResponse.ts
│ │ ├── CommunityPinActionResult.ts
│ │ ├── CommunityRelationship.ts
│ │ ├── CommunityRule.ts
│ │ ├── CommunityTweetsTimelineResponse.ts
│ │ ├── CommunityUnpinActionResult.ts
│ │ ├── CommunityUrls.ts
│ │ ├── CommunityUrlsPermalink.ts
│ │ ├── ContentEntryType.ts
│ │ ├── ContentItemType.ts
│ │ ├── ContentUnion.ts
│ │ ├── ConversationControl.ts
│ │ ├── CoverCta.ts
│ │ ├── CreateBookmarkResponse.ts
│ │ ├── CreateBookmarkResponseData.ts
│ │ ├── CreateRetweet.ts
│ │ ├── CreateRetweetResponse.ts
│ │ ├── CreateRetweetResponseData.ts
│ │ ├── CreateRetweetResponseResult.ts
│ │ ├── CreateTweet.ts
│ │ ├── CreateTweetResponse.ts
│ │ ├── CreateTweetResponseData.ts
│ │ ├── CreateTweetResponseResult.ts
│ │ ├── CtaClientEventInfo.ts
│ │ ├── CursorType.ts
│ │ ├── DeleteBookmarkResponse.ts
│ │ ├── DeleteBookmarkResponseData.ts
│ │ ├── DeleteRetweet.ts
│ │ ├── DeleteRetweetResponse.ts
│ │ ├── DeleteRetweetResponseData.ts
│ │ ├── DeleteRetweetResponseResult.ts
│ │ ├── DeleteTweetResponse.ts
│ │ ├── DeleteTweetResponseData.ts
│ │ ├── DeleteTweetResponseResult.ts
│ │ ├── DisplayTreatment.ts
│ │ ├── DisplayType.ts
│ │ ├── Entities.ts
│ │ ├── ErrorExtensions.ts
│ │ ├── ErrorResponse.ts
│ │ ├── ExtMediaAvailability.ts
│ │ ├── ExtendedEntities.ts
│ │ ├── FavoriteTweet.ts
│ │ ├── FavoriteTweetResponse.ts
│ │ ├── FeedbackInfo.ts
│ │ ├── FollowResponse.ts
│ │ ├── FollowResponseData.ts
│ │ ├── FollowResponseResult.ts
│ │ ├── FollowResponseUser.ts
│ │ ├── FollowTimeline.ts
│ │ ├── GrokImageAnnotation.ts
│ │ ├── GrokShareAttachment.ts
│ │ ├── GrokShareAttachmentItem.ts
│ │ ├── Highlight.ts
│ │ ├── HomeTimelineHome.ts
│ │ ├── HomeTimelineResponseData.ts
│ │ ├── InstructionType.ts
│ │ ├── InstructionUnion.ts
│ │ ├── ItemContentUnion.ts
│ │ ├── ItemResult.ts
│ │ ├── LimitedActionResultsData.ts
│ │ ├── ListLatestTweetsTimelineResponse.ts
│ │ ├── ListTweetsTimelineData.ts
│ │ ├── ListTweetsTimelineList.ts
│ │ ├── Location.ts
│ │ ├── Media.ts
│ │ ├── MediaCommunityResult.ts
│ │ ├── MediaCommunityResults.ts
│ │ ├── MediaCommunityTweetData.ts
│ │ ├── MediaExtended.ts
│ │ ├── MediaOriginalInfo.ts
│ │ ├── MediaOriginalInfoFocusRect.ts
│ │ ├── MediaResult.ts
│ │ ├── MediaResults.ts
│ │ ├── MediaSize.ts
│ │ ├── MediaSizes.ts
│ │ ├── MediaStats.ts
│ │ ├── MediaVideoInfo.ts
│ │ ├── MediaVideoInfoVariant.ts
│ │ ├── MediaVisibilityResults.ts
│ │ ├── MediaVisibilityResultsBlurredImageInterstitial.ts
│ │ ├── ModuleEntry.ts
│ │ ├── ModuleItem.ts
│ │ ├── NoteTweet.ts
│ │ ├── NoteTweetResult.ts
│ │ ├── NoteTweetResultData.ts
│ │ ├── NoteTweetResultMedia.ts
│ │ ├── NoteTweetResultMediaInlineMedia.ts
│ │ ├── NoteTweetResultRichText.ts
│ │ ├── NoteTweetResultRichTextTag.ts
│ │ ├── NotificationTemplate.ts
│ │ ├── NotificationsResult.ts
│ │ ├── NotificationsTimelineData.ts
│ │ ├── NotificationsTimelineResponse.ts
│ │ ├── NotificationsUserResults.ts
│ │ ├── NotificationsViewerV2.ts
│ │ ├── OneFactorLoginEligibility.ts
│ │ ├── OtherObjectAll.ts
│ │ ├── PostCreateBookmarkRequest.ts
│ │ ├── PostCreateBookmarkRequestVariables.ts
│ │ ├── PostCreateRetweetRequest.ts
│ │ ├── PostCreateRetweetRequestVariables.ts
│ │ ├── PostCreateTweetRequest.ts
│ │ ├── PostCreateTweetRequestFeatures.ts
│ │ ├── PostCreateTweetRequestVariables.ts
│ │ ├── PostCreateTweetRequestVariablesConversationControl.ts
│ │ ├── PostCreateTweetRequestVariablesMedia.ts
│ │ ├── PostCreateTweetRequestVariablesMediaMediaEntitiesInner.ts
│ │ ├── PostCreateTweetRequestVariablesReply.ts
│ │ ├── PostDeleteBookmarkRequest.ts
│ │ ├── PostDeleteRetweetRequest.ts
│ │ ├── PostDeleteRetweetRequestVariables.ts
│ │ ├── PostDeleteTweetRequest.ts
│ │ ├── PostFavoriteTweetRequest.ts
│ │ ├── PostUnfavoriteTweetRequest.ts
│ │ ├── PrimaryCommunityTopic.ts
│ │ ├── ProfileResponse.ts
│ │ ├── ProfileResponseData.ts
│ │ ├── QuotedRefResult.ts
│ │ ├── QuotedStatusPermalink.ts
│ │ ├── RankedCommunityResult.ts
│ │ ├── RankedCommunityResults.ts
│ │ ├── RankedCommunityTweetData.ts
│ │ ├── Retweet.ts
│ │ ├── RetweetLegacy.ts
│ │ ├── RichMessage.ts
│ │ ├── SearchByRawQuery.ts
│ │ ├── SearchTimeline.ts
│ │ ├── SearchTimelineData.ts
│ │ ├── SearchTimelineResponse.ts
│ │ ├── SelfThread.ts
│ │ ├── SensitiveMediaWarning.ts
│ │ ├── Session.ts
│ │ ├── SocialContextLandingUrl.ts
│ │ ├── SocialContextUnion.ts
│ │ ├── SocialContextUnionType.ts
│ │ ├── SuperFollowsReplyUserResult.ts
│ │ ├── SuperFollowsReplyUserResultData.ts
│ │ ├── SuperFollowsReplyUserResultLegacy.ts
│ │ ├── Text.ts
│ │ ├── TextEntity.ts
│ │ ├── TextEntityRef.ts
│ │ ├── TextHighlight.ts
│ │ ├── ThumbnailImage.ts
│ │ ├── Timeline.ts
│ │ ├── TimelineAddEntries.ts
│ │ ├── TimelineAddEntry.ts
│ │ ├── TimelineAddToModule.ts
│ │ ├── TimelineClearCache.ts
│ │ ├── TimelineClearEntriesUnreadState.ts
│ │ ├── TimelineCommunity.ts
│ │ ├── TimelineCoverBehavior.ts
│ │ ├── TimelineCoverBehaviorUrl.ts
│ │ ├── TimelineGeneralContext.ts
│ │ ├── TimelineHalfCover.ts
│ │ ├── TimelineMarkEntriesUnreadGreaterThanSortIndex.ts
│ │ ├── TimelineMessagePrompt.ts
│ │ ├── TimelineNotification.ts
│ │ ├── TimelinePinEntry.ts
│ │ ├── TimelinePrompt.ts
│ │ ├── TimelineReplaceEntry.ts
│ │ ├── TimelineResponse.ts
│ │ ├── TimelineResult.ts
│ │ ├── TimelineShowAlert.ts
│ │ ├── TimelineShowAlertRichText.ts
│ │ ├── TimelineShowCover.ts
│ │ ├── TimelineTerminateTimeline.ts
│ │ ├── TimelineTimelineCursor.ts
│ │ ├── TimelineTimelineItem.ts
│ │ ├── TimelineTimelineModule.ts
│ │ ├── TimelineTombstone.ts
│ │ ├── TimelineTopicContext.ts
│ │ ├── TimelineTrend.ts
│ │ ├── TimelineTweet.ts
│ │ ├── TimelineUser.ts
│ │ ├── Timestamp.ts
│ │ ├── TombstoneEntity.ts
│ │ ├── TombstoneInfo.ts
│ │ ├── TombstoneRef.ts
│ │ ├── TombstoneRichText.ts
│ │ ├── TopicContext.ts
│ │ ├── Tracing.ts
│ │ ├── TrendImage.ts
│ │ ├── TrendMetadata.ts
│ │ ├── TrendResults.ts
│ │ ├── Tweet.ts
│ │ ├── TweetCard.ts
│ │ ├── TweetCardLegacy.ts
│ │ ├── TweetCardLegacyBindingValue.ts
│ │ ├── TweetCardLegacyBindingValueData.ts
│ │ ├── TweetCardLegacyBindingValueDataImage.ts
│ │ ├── TweetCardPlatform.ts
│ │ ├── TweetCardPlatformAudience.ts
│ │ ├── TweetCardPlatformData.ts
│ │ ├── TweetCardPlatformDevice.ts
│ │ ├── TweetDetailResponse.ts
│ │ ├── TweetDetailResponseData.ts
│ │ ├── TweetEditControl.ts
│ │ ├── TweetEditControlInitial.ts
│ │ ├── TweetEditPrespective.ts
│ │ ├── TweetFavoritersResponse.ts
│ │ ├── TweetFavoritersResponseData.ts
│ │ ├── TweetInterstitial.ts
│ │ ├── TweetInterstitialRevealText.ts
│ │ ├── TweetInterstitialText.ts
│ │ ├── TweetInterstitialTextEntity.ts
│ │ ├── TweetInterstitialTextEntityRef.ts
│ │ ├── TweetLegacy.ts
│ │ ├── TweetLegacyScopes.ts
│ │ ├── TweetLimitedActionResults.ts
│ │ ├── TweetPreviewDisplay.ts
│ │ ├── TweetPreviewDisplayCta.ts
│ │ ├── TweetPreviewDisplayCtaUrl.ts
│ │ ├── TweetPreviewDisplayTweet.ts
│ │ ├── TweetPreviewDisplayTweetViewCount.ts
│ │ ├── TweetPreviousCounts.ts
│ │ ├── TweetResultByRestIdData.ts
│ │ ├── TweetResultByRestIdResponse.ts
│ │ ├── TweetRetweetersResponse.ts
│ │ ├── TweetRetweetersResponseData.ts
│ │ ├── TweetTombstone.ts
│ │ ├── TweetUnavailable.ts
│ │ ├── TweetUnion.ts
│ │ ├── TweetView.ts
│ │ ├── TweetWithVisibilityResults.ts
│ │ ├── TypeName.ts
│ │ ├── UnfavoriteTweet.ts
│ │ ├── UnfavoriteTweetResponse.ts
│ │ ├── UnifiedCard.ts
│ │ ├── Url.ts
│ │ ├── UrtEndpointOptions.ts
│ │ ├── UrtEndpointRequestParams.ts
│ │ ├── User.ts
│ │ ├── UserFeatures.ts
│ │ ├── UserHighlightsInfo.ts
│ │ ├── UserHighlightsTweetsData.ts
│ │ ├── UserHighlightsTweetsResponse.ts
│ │ ├── UserHighlightsTweetsResult.ts
│ │ ├── UserHighlightsTweetsTimeline.ts
│ │ ├── UserHighlightsTweetsUser.ts
│ │ ├── UserLegacy.ts
│ │ ├── UserLegacyExtendedProfile.ts
│ │ ├── UserLegacyExtendedProfileBirthdate.ts
│ │ ├── UserProfessional.ts
│ │ ├── UserProfessionalCategory.ts
│ │ ├── UserResponse.ts
│ │ ├── UserResponseData.ts
│ │ ├── UserResultByScreenName.ts
│ │ ├── UserResultByScreenNameLegacy.ts
│ │ ├── UserResultByScreenNameResult.ts
│ │ ├── UserResultCore.ts
│ │ ├── UserResults.ts
│ │ ├── UserTipJarSettings.ts
│ │ ├── UserTweetsData.ts
│ │ ├── UserTweetsResponse.ts
│ │ ├── UserTweetsResultV1.ts
│ │ ├── UserTweetsResultV2.ts
│ │ ├── UserTweetsUser.ts
│ │ ├── UserUnavailable.ts
│ │ ├── UserUnion.ts
│ │ ├── UserValue.ts
│ │ ├── UserVerificationInfo.ts
│ │ ├── UserVerificationInfoReason.ts
│ │ ├── UserVerificationInfoReasonDescription.ts
│ │ ├── UserVerificationInfoReasonDescriptionEntities.ts
│ │ ├── UserVerificationInfoReasonDescriptionEntitiesRef.ts
│ │ ├── UsersResponse.ts
│ │ ├── UsersResponseData.ts
│ │ └── index.ts
│ └── runtime.ts
├── tools
│ ├── .gitignore
│ ├── openapi-generator-config.yaml
│ └── win
│ │ ├── clean.ps1
│ │ ├── gen.ps1
│ │ ├── init.ps1
│ │ └── replace.py
└── tsconfig.json
└── twitter-openapi-typescript
├── .gitignore
├── .npmignore
├── .prettierrc
├── .vscode
├── extensions.json
└── settings.json
├── LICENSE
├── LICENSE.AGPL
├── README.md
├── biome.json
├── jest.config.js
├── package-lock.json
├── package.json
├── src
├── api.ts
├── apis
│ ├── defaultApi.ts
│ ├── index.ts
│ ├── initialStateApi.ts
│ ├── postApi.ts
│ ├── tweetApi.ts
│ ├── userApi.ts
│ ├── userListApi.ts
│ ├── usersApi.ts
│ ├── v11GetApi.ts
│ ├── v11PostApi.ts
│ └── v20GetApi.ts
├── index.ts
├── models
│ ├── flag.ts
│ ├── header.ts
│ ├── index.ts
│ ├── response.ts
│ ├── timeline.ts
│ └── utils.ts
└── utils
│ ├── api.ts
│ └── index.ts
├── test
├── api
│ ├── auth.test.ts
│ ├── defaultApi.test.ts
│ ├── guest.test.ts
│ ├── postApi.test.ts
│ ├── tweetApi.test.ts
│ ├── userApi.test.ts
│ ├── userListApi.test.ts
│ ├── usersApi.test.ts
│ └── v11PostApi.test.ts
├── init.ts
├── raw
│ └── tweet_api.test.ts
└── util.ts
├── tsconfig.build.json
└── tsconfig.json
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: npm
4 | directory: /twitter-openapi-typescript
5 | schedule:
6 | interval: weekly
7 |
8 | - package-ecosystem: npm
9 | directory: /twitter-openapi-typescript-generated
10 | schedule:
11 | interval: weekly
12 | ignore:
13 | - dependency-name: "*"
14 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "twitter-openapi-typescript-generated/twitter-openapi"]
2 | path = twitter-openapi-typescript-generated/twitter-openapi
3 | url = https://github.com/fa0311/twitter-openapi
4 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "markdownlint.ignore": ["twitter-openapi-typescript-generated/**/*.md"],
3 | "markdownlint.config": {
4 | "MD033": false,
5 | "MD024": false
6 | },
7 | "jest.runMode": "on-demand"
8 | }
9 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | twitter-openapi License
2 |
3 | Copyright (c) 2023 yuki
4 |
5 |
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in all
15 | copies or substantial portions of the Software.
16 |
17 | The Software shall not be used for any activity that involves the following types
18 | of behavior, commonly known as spam:
19 |
20 | 1. Sending unsolicited or excessive messages or posts.
21 | 2. Aggressively following, unfollowing, or liking tweets to artificially boost engagement.
22 | 3. Engaging in aggressive automated actions that disrupt or annoy other users.
23 | 4. Distributing false or misleading information.
24 |
25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 | SOFTWARE.
32 |
--------------------------------------------------------------------------------
/README-generated.md:
--------------------------------------------------------------------------------
1 | # twitter-openapi-typescript-generated
2 |
3 | > Note! twitter-openapi-typescript-generated is a package for advanced users who are familiar with Twitter's API. In general, [twitter-openapi-typescript](twitter-openapi-typescript/README.md) should be used!
4 |
5 | Build
6 |
7 | ```shell
8 | git clone https://github.com/fa0311/twitter-openapi-typescript.git
9 | cd twitter-openapi-typescript-generated
10 | ```
11 |
12 | ```shell
13 | openapi-generator-cli version # 6.5.0
14 | ```
15 |
16 | ```shell
17 | java -jar tools/openapi-generator-cli.jar generate -g typescript-fetch -c tools/openapi-generator-config.yaml
18 | npm run build
19 | ```
20 |
21 | Setup
22 |
23 | ```shell
24 | npm i twitter-openapi-typescript-generated
25 | ```
26 |
27 | Usage
28 |
29 | [twitter-openapi-typescript-generated/README.md](./twitter-openapi-typescript-generated/README.md)
30 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # twitter-openapi-typescript
2 |
3 | [issues](https://github.com/fa0311/twitter-openapi-typescript/issues) / [discussions](https://github.com/fa0311/twitter-openapi/discussions)
4 |
5 | ## Table of Contents
6 |
7 | This repository contains two packages.
8 |
9 | - [twitter-openapi-typescript](./twitter-openapi-typescript) Package for human-friendly TypeScript
10 | - [twitter-openapi-typescript-generated](./twitter-openapi-typescript-generated) TypeScript package automatically generated from [twitter-openapi](https://github.com/fa0311/twitter-openapi) by OpenAPI generator
11 |
12 | ```mermaid
13 | graph LR
14 | A[twitter-openapi]--Auto Generated-->B[twitter-openapi-typescript-generated]
15 | B--Simplified handling-->C[twitter-openapi-typescript]
16 | ```
17 |
18 | ---
19 |
20 | ## twitter-openapi-typescript
21 |
22 | Learn more about people-friendly TypeScript packages here.
23 |
24 | [twitter-openapi-typescript/README.md](./twitter-openapi-typescript/README.md)
25 |
26 | ## twitter-openapi-typescript-generated
27 |
28 | Learn more about the automatically generated TypeScript package here.
29 |
30 | [README-generated.md](./README-generated.md)
31 |
32 | ## Projects using twitter-openapi-typescript
33 |
34 | - [twitter-snap](https://github.com/fa0311/twitter-snap)
35 |
36 | ## License
37 |
38 | This project is dual licensed. You can choose one of the following licenses:
39 |
40 | - [Custom License](./LICENSE)
41 | - [GNU Affero General Public License v3.0](./LICENSE.AGPL)
42 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .env
--------------------------------------------------------------------------------
/example/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": true,
3 | "semi": true,
4 | "bracketSpacing": true,
5 | "arrowParens": "always",
6 | "printWidth": 120,
7 | "trailingComma": "all"
8 | }
--------------------------------------------------------------------------------
/example/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "orta.vscode-jest",
4 | "ms-vscode.vscode-typescript-next",
5 | "dbaeumer.vscode-eslint",
6 | "esbenp.prettier-vscode"
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/example/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "jest.autoRun": {
3 | "watch": false
4 | },
5 | "[typescript]": {
6 | "editor.defaultFormatter": "esbenp.prettier-vscode",
7 | "editor.codeActionsOnSave": {
8 | "source.fixAll": "explicit",
9 | "source.organizeImports": "explicit",
10 | },
11 | "editor.formatOnSave": true,
12 | },
13 | }
14 |
--------------------------------------------------------------------------------
/example/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example",
3 | "license": "MIT",
4 | "version": "1.0.0",
5 | "author": "",
6 | "description": "",
7 | "scripts": {
8 | "start": "npx ts-node -r tsconfig-paths/register src/main.ts"
9 | },
10 | "dependencies": {
11 | "https-proxy-agent": "^7.0.5",
12 | "twitter-api-v2": "^1.18.0",
13 | "twitter-openapi-typescript": "^0.0.40"
14 | },
15 | "devDependencies": {
16 | "@types/node": "*",
17 | "@types/node-fetch": "*",
18 | "@typescript-eslint/eslint-plugin": "*",
19 | "@typescript-eslint/parser": "*",
20 | "dotenv": "^16.3.0",
21 | "eslint": "^8.50.0",
22 | "eslint-config-standard-with-typescript": "*",
23 | "eslint-plugin-import": "*",
24 | "eslint-plugin-n": "*",
25 | "eslint-plugin-promise": "*",
26 | "log4js": "^6.9.0",
27 | "node-fetch": "^2.6.6",
28 | "typescript": "^5.2.0"
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/example/src/login.ts:
--------------------------------------------------------------------------------
1 | import { ITwitterApiClientPlugin, TwitterApi } from 'twitter-api-v2';
2 | import { TwitterOpenApi } from 'twitter-openapi-typescript';
3 |
4 | import * as dotenv from 'dotenv';
5 | dotenv.config();
6 |
7 | const authToken = process.env.AUTH_TOKEN as string;
8 | const CsrfToken = process.env.CSRF_TOKEN as string;
9 |
10 | export const login = async () => {
11 | const cookie = { auth_token: authToken, ct0: CsrfToken };
12 |
13 | const api = new TwitterOpenApi();
14 | const client = await api.getClientFromCookies(cookie);
15 |
16 | const plugin: ITwitterApiClientPlugin = {
17 | onBeforeRequest: async (params) => {
18 | params.computedParams.headers = {
19 | ...params.computedParams.headers,
20 | ...TwitterOpenApi.api_key,
21 | 'x-csrf-token': cookie.ct0,
22 | 'x-twitter-auth-type': 'OAuth2Session',
23 | authorization: `Bearer ${TwitterOpenApi.bearer}`,
24 | cookie: api.cookieEncode(cookie),
25 | };
26 | params.requestOptions.headers = {
27 | ...params.requestOptions.headers,
28 | ...TwitterOpenApi.api_key,
29 | 'x-csrf-token': cookie.ct0,
30 | 'x-twitter-auth-type': 'OAuth2Session',
31 | authorization: `Bearer ${TwitterOpenApi.bearer}`,
32 | cookie: api.cookieEncode(cookie),
33 | };
34 | },
35 | };
36 |
37 | const legacy = new TwitterApi('_', { plugins: [plugin] });
38 |
39 | return { client, legacy };
40 | };
41 |
42 | export default login;
43 |
--------------------------------------------------------------------------------
/example/src/proxy.ts:
--------------------------------------------------------------------------------
1 | import { HttpsProxyAgent } from 'https-proxy-agent';
2 | import fetch from 'node-fetch';
3 | import { TwitterOpenApi } from 'twitter-openapi-typescript';
4 |
5 | (async () => {
6 | TwitterOpenApi.fetchApi = fetch as any;
7 | const api = new TwitterOpenApi();
8 | const proxyAgent = new HttpsProxyAgent('http://0.0.0.0:8080');
9 | api.setInitOverrides({ agent: proxyAgent } as any);
10 |
11 | const client = await api.getGuestClient();
12 | const response = await client.getDefaultApi().getTweetResultByRestId({ tweetId: '1349129669258448897' });
13 |
14 | console.log(response);
15 | })();
16 |
--------------------------------------------------------------------------------
/example/src/tweetMedia.ts:
--------------------------------------------------------------------------------
1 | import login from '@/login';
2 |
3 | (async () => {
4 | const { client, legacy } = await login();
5 |
6 | const data = await legacy.v1.uploadMedia('test.png');
7 |
8 | client.getPostApi().postCreateTweet({
9 | tweetText: 'Hello World!!',
10 | mediaIds: [data],
11 | });
12 | })();
13 |
--------------------------------------------------------------------------------
/example/test.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/fa0311/twitter-openapi-typescript/e7b3c64adb34befb2c721d1e17351ec13faa7507/example/test.png
--------------------------------------------------------------------------------
/example/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "declaration": true,
4 | "target": "es5",
5 | "downlevelIteration": true,
6 | "module": "commonjs",
7 | "moduleResolution": "node",
8 | "outDir": "dist",
9 | "lib": ["es2020", "dom"],
10 | "typeRoots": ["node_modules/@types"],
11 | "allowSyntheticDefaultImports": true,
12 | "rootDir": "./",
13 | "baseUrl": "./",
14 | "paths": {
15 | "@/*": ["./src/*"]
16 | },
17 | "declarationMap": true,
18 | "sourceMap": true,
19 | "strict": true
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/.gitignore:
--------------------------------------------------------------------------------
1 | wwwroot/*.js
2 | node_modules
3 | typings
4 | dist
5 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/.npmignore:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | !/dist/*
4 | !/README.md
5 | !/LICENSE
6 | !/LICENSE.AGPL
7 | !/package.json
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/.openapi-generator-ignore:
--------------------------------------------------------------------------------
1 | tools/**
2 | twitter-openapi/**
3 | LICENSE.txt
4 | .npmignore
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/.openapi-generator/VERSION:
--------------------------------------------------------------------------------
1 | 7.12.0
2 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/LICENSE:
--------------------------------------------------------------------------------
1 | twitter-openapi License
2 |
3 | Copyright (c) 2023 yuki
4 |
5 |
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in all
15 | copies or substantial portions of the Software.
16 |
17 | The Software shall not be used for any activity that involves the following types
18 | of behavior, commonly known as spam:
19 |
20 | 1. Sending unsolicited or excessive messages or posts.
21 | 2. Aggressively following, unfollowing, or liking tweets to artificially boost engagement.
22 | 3. Engaging in aggressive automated actions that disrupt or annoy other users.
23 | 4. Distributing false or misleading information.
24 |
25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 | SOFTWARE.
32 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/README.md:
--------------------------------------------------------------------------------
1 | ## twitter-openapi-typescript-generated@0.0.37
2 |
3 | This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
4 |
5 | Environment
6 | * Node.js
7 | * Webpack
8 | * Browserify
9 |
10 | Language level
11 | * ES5 - you must have a Promises/A+ library installed
12 | * ES6
13 |
14 | Module system
15 | * CommonJS
16 | * ES6 module system
17 |
18 | It can be used in both TypeScript and JavaScript. In TypeScript, the definition will be automatically resolved via `package.json`. ([Reference](https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html))
19 |
20 | ### Building
21 |
22 | To build and compile the typescript sources to javascript use:
23 | ```
24 | npm install
25 | npm run build
26 | ```
27 |
28 | ### Publishing
29 |
30 | First build the package then run `npm publish`
31 |
32 | ### Consuming
33 |
34 | navigate to the folder of your consuming project and run one of the following commands.
35 |
36 | _published:_
37 |
38 | ```
39 | npm install twitter-openapi-typescript-generated@0.0.37 --save
40 | ```
41 |
42 | _unPublished (not recommended):_
43 |
44 | ```
45 | npm install PATH_TO_GENERATED_PACKAGE --save
46 | ```
47 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "twitter-openapi-typescript-generated",
3 | "version": "0.0.38",
4 | "lockfileVersion": 2,
5 | "requires": true,
6 | "packages": {
7 | "": {
8 | "name": "twitter-openapi-typescript-generated",
9 | "version": "0.0.38",
10 | "license": "custom license or AGPL-3.0-or-later",
11 | "devDependencies": {
12 | "typescript": "^4.0 || ^5.0"
13 | }
14 | },
15 | "node_modules/typescript": {
16 | "version": "5.8.3",
17 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
18 | "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
19 | "dev": true,
20 | "license": "Apache-2.0",
21 | "bin": {
22 | "tsc": "bin/tsc",
23 | "tsserver": "bin/tsserver"
24 | },
25 | "engines": {
26 | "node": ">=14.17"
27 | }
28 | }
29 | },
30 | "dependencies": {
31 | "typescript": {
32 | "version": "5.8.3",
33 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
34 | "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
35 | "dev": true
36 | }
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "twitter-openapi-typescript-generated",
3 | "version": "0.0.38",
4 | "description": "OpenAPI client for twitter-openapi-typescript-generated",
5 | "author": "fa0311",
6 | "repository": {
7 | "type": "git",
8 | "url": "https://github.com/fa0311/twitter-openapi-typescript.git"
9 | },
10 | "main": "./dist/index.js",
11 | "typings": "./dist/index.d.ts",
12 | "scripts": {
13 | "build": "tsc"
14 | },
15 | "devDependencies": {
16 | "typescript": "^4.0 || ^5.0"
17 | },
18 | "license": "custom license or AGPL-3.0-or-later",
19 | "keywords": [
20 | "twitter",
21 | "api",
22 | "typescript",
23 | "scraper"
24 | ]
25 | }
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/apis/index.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | export * from './DefaultApi';
4 | export * from './OtherApi';
5 | export * from './PostApi';
6 | export * from './TweetApi';
7 | export * from './UserApi';
8 | export * from './UserListApi';
9 | export * from './UsersApi';
10 | export * from './V11GetApi';
11 | export * from './V11PostApi';
12 | export * from './V20GetApi';
13 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/index.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | export * from './runtime';
4 | export * from './apis/index';
5 | export * from './models/index';
6 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/AdditionalMediaInfoCallToActionsUrl.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface AdditionalMediaInfoCallToActionsUrl
20 | */
21 | export interface AdditionalMediaInfoCallToActionsUrl {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof AdditionalMediaInfoCallToActionsUrl
26 | */
27 | url: string;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the AdditionalMediaInfoCallToActionsUrl interface.
32 | */
33 | export function instanceOfAdditionalMediaInfoCallToActionsUrl(value: object): value is AdditionalMediaInfoCallToActionsUrl {
34 | if (!('url' in value) || value['url'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function AdditionalMediaInfoCallToActionsUrlFromJSON(json: any): AdditionalMediaInfoCallToActionsUrl {
39 | return AdditionalMediaInfoCallToActionsUrlFromJSONTyped(json, false);
40 | }
41 |
42 | export function AdditionalMediaInfoCallToActionsUrlFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdditionalMediaInfoCallToActionsUrl {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'url': json['url'],
49 | };
50 | }
51 |
52 | export function AdditionalMediaInfoCallToActionsUrlToJSON(json: any): AdditionalMediaInfoCallToActionsUrl {
53 | return AdditionalMediaInfoCallToActionsUrlToJSONTyped(json, false);
54 | }
55 |
56 | export function AdditionalMediaInfoCallToActionsUrlToJSONTyped(value?: AdditionalMediaInfoCallToActionsUrl | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'url': value['url'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/AllowDownloadStatus.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface AllowDownloadStatus
20 | */
21 | export interface AllowDownloadStatus {
22 | /**
23 | *
24 | * @type {boolean}
25 | * @memberof AllowDownloadStatus
26 | */
27 | allowDownload?: boolean;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the AllowDownloadStatus interface.
32 | */
33 | export function instanceOfAllowDownloadStatus(value: object): value is AllowDownloadStatus {
34 | return true;
35 | }
36 |
37 | export function AllowDownloadStatusFromJSON(json: any): AllowDownloadStatus {
38 | return AllowDownloadStatusFromJSONTyped(json, false);
39 | }
40 |
41 | export function AllowDownloadStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): AllowDownloadStatus {
42 | if (json == null) {
43 | return json;
44 | }
45 | return {
46 |
47 | 'allowDownload': json['allow_download'] == null ? undefined : json['allow_download'],
48 | };
49 | }
50 |
51 | export function AllowDownloadStatusToJSON(json: any): AllowDownloadStatus {
52 | return AllowDownloadStatusToJSONTyped(json, false);
53 | }
54 |
55 | export function AllowDownloadStatusToJSONTyped(value?: AllowDownloadStatus | null, ignoreDiscriminator: boolean = false): any {
56 | if (value == null) {
57 | return value;
58 | }
59 |
60 | return {
61 |
62 | 'allow_download': value['allowDownload'],
63 | };
64 | }
65 |
66 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/AnalysisResults.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { Tweet } from './Tweet';
17 | import {
18 | TweetFromJSON,
19 | TweetFromJSONTyped,
20 | TweetToJSON,
21 | TweetToJSONTyped,
22 | } from './Tweet';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface AnalysisResults
28 | */
29 | export interface AnalysisResults {
30 | /**
31 | *
32 | * @type {Tweet}
33 | * @memberof AnalysisResults
34 | */
35 | result: Tweet;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the AnalysisResults interface.
40 | */
41 | export function instanceOfAnalysisResults(value: object): value is AnalysisResults {
42 | if (!('result' in value) || value['result'] === undefined) return false;
43 | return true;
44 | }
45 |
46 | export function AnalysisResultsFromJSON(json: any): AnalysisResults {
47 | return AnalysisResultsFromJSONTyped(json, false);
48 | }
49 |
50 | export function AnalysisResultsFromJSONTyped(json: any, ignoreDiscriminator: boolean): AnalysisResults {
51 | if (json == null) {
52 | return json;
53 | }
54 | return {
55 |
56 | 'result': TweetFromJSON(json['result']),
57 | };
58 | }
59 |
60 | export function AnalysisResultsToJSON(json: any): AnalysisResults {
61 | return AnalysisResultsToJSONTyped(json, false);
62 | }
63 |
64 | export function AnalysisResultsToJSONTyped(value?: AnalysisResults | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'result': TweetToJSON(value['result']),
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/Article.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { ArticleResults } from './ArticleResults';
17 | import {
18 | ArticleResultsFromJSON,
19 | ArticleResultsFromJSONTyped,
20 | ArticleResultsToJSON,
21 | ArticleResultsToJSONTyped,
22 | } from './ArticleResults';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface Article
28 | */
29 | export interface Article {
30 | /**
31 | *
32 | * @type {ArticleResults}
33 | * @memberof Article
34 | */
35 | articleResults: ArticleResults;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the Article interface.
40 | */
41 | export function instanceOfArticle(value: object): value is Article {
42 | if (!('articleResults' in value) || value['articleResults'] === undefined) return false;
43 | return true;
44 | }
45 |
46 | export function ArticleFromJSON(json: any): Article {
47 | return ArticleFromJSONTyped(json, false);
48 | }
49 |
50 | export function ArticleFromJSONTyped(json: any, ignoreDiscriminator: boolean): Article {
51 | if (json == null) {
52 | return json;
53 | }
54 | return {
55 |
56 | 'articleResults': ArticleResultsFromJSON(json['article_results']),
57 | };
58 | }
59 |
60 | export function ArticleToJSON(json: any): Article {
61 | return ArticleToJSONTyped(json, false);
62 | }
63 |
64 | export function ArticleToJSONTyped(value?: Article | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'article_results': ArticleResultsToJSON(value['articleResults']),
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/ArticleLifecycleState.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface ArticleLifecycleState
20 | */
21 | export interface ArticleLifecycleState {
22 | /**
23 | *
24 | * @type {number}
25 | * @memberof ArticleLifecycleState
26 | */
27 | modifiedAtSecs: number;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the ArticleLifecycleState interface.
32 | */
33 | export function instanceOfArticleLifecycleState(value: object): value is ArticleLifecycleState {
34 | if (!('modifiedAtSecs' in value) || value['modifiedAtSecs'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function ArticleLifecycleStateFromJSON(json: any): ArticleLifecycleState {
39 | return ArticleLifecycleStateFromJSONTyped(json, false);
40 | }
41 |
42 | export function ArticleLifecycleStateFromJSONTyped(json: any, ignoreDiscriminator: boolean): ArticleLifecycleState {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'modifiedAtSecs': json['modified_at_secs'],
49 | };
50 | }
51 |
52 | export function ArticleLifecycleStateToJSON(json: any): ArticleLifecycleState {
53 | return ArticleLifecycleStateToJSONTyped(json, false);
54 | }
55 |
56 | export function ArticleLifecycleStateToJSONTyped(value?: ArticleLifecycleState | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'modified_at_secs': value['modifiedAtSecs'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/ArticleMetadata.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface ArticleMetadata
20 | */
21 | export interface ArticleMetadata {
22 | /**
23 | *
24 | * @type {number}
25 | * @memberof ArticleMetadata
26 | */
27 | firstPublishedAtSecs: number;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the ArticleMetadata interface.
32 | */
33 | export function instanceOfArticleMetadata(value: object): value is ArticleMetadata {
34 | if (!('firstPublishedAtSecs' in value) || value['firstPublishedAtSecs'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function ArticleMetadataFromJSON(json: any): ArticleMetadata {
39 | return ArticleMetadataFromJSONTyped(json, false);
40 | }
41 |
42 | export function ArticleMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): ArticleMetadata {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'firstPublishedAtSecs': json['first_published_at_secs'],
49 | };
50 | }
51 |
52 | export function ArticleMetadataToJSON(json: any): ArticleMetadata {
53 | return ArticleMetadataToJSONTyped(json, false);
54 | }
55 |
56 | export function ArticleMetadataToJSONTyped(value?: ArticleMetadata | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'first_published_at_secs': value['firstPublishedAtSecs'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/ArticleResults.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { ArticleResult } from './ArticleResult';
17 | import {
18 | ArticleResultFromJSON,
19 | ArticleResultFromJSONTyped,
20 | ArticleResultToJSON,
21 | ArticleResultToJSONTyped,
22 | } from './ArticleResult';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface ArticleResults
28 | */
29 | export interface ArticleResults {
30 | /**
31 | *
32 | * @type {ArticleResult}
33 | * @memberof ArticleResults
34 | */
35 | result: ArticleResult;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the ArticleResults interface.
40 | */
41 | export function instanceOfArticleResults(value: object): value is ArticleResults {
42 | if (!('result' in value) || value['result'] === undefined) return false;
43 | return true;
44 | }
45 |
46 | export function ArticleResultsFromJSON(json: any): ArticleResults {
47 | return ArticleResultsFromJSONTyped(json, false);
48 | }
49 |
50 | export function ArticleResultsFromJSONTyped(json: any, ignoreDiscriminator: boolean): ArticleResults {
51 | if (json == null) {
52 | return json;
53 | }
54 | return {
55 |
56 | 'result': ArticleResultFromJSON(json['result']),
57 | };
58 | }
59 |
60 | export function ArticleResultsToJSON(json: any): ArticleResults {
61 | return ArticleResultsToJSONTyped(json, false);
62 | }
63 |
64 | export function ArticleResultsToJSONTyped(value?: ArticleResults | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'result': ArticleResultToJSON(value['result']),
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/BirdwatchPivotNote.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface BirdwatchPivotNote
20 | */
21 | export interface BirdwatchPivotNote {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof BirdwatchPivotNote
26 | */
27 | restId: string;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the BirdwatchPivotNote interface.
32 | */
33 | export function instanceOfBirdwatchPivotNote(value: object): value is BirdwatchPivotNote {
34 | if (!('restId' in value) || value['restId'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function BirdwatchPivotNoteFromJSON(json: any): BirdwatchPivotNote {
39 | return BirdwatchPivotNoteFromJSONTyped(json, false);
40 | }
41 |
42 | export function BirdwatchPivotNoteFromJSONTyped(json: any, ignoreDiscriminator: boolean): BirdwatchPivotNote {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'restId': json['rest_id'],
49 | };
50 | }
51 |
52 | export function BirdwatchPivotNoteToJSON(json: any): BirdwatchPivotNote {
53 | return BirdwatchPivotNoteToJSONTyped(json, false);
54 | }
55 |
56 | export function BirdwatchPivotNoteToJSONTyped(value?: BirdwatchPivotNote | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'rest_id': value['restId'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/BookmarksTimeline.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { Timeline } from './Timeline';
17 | import {
18 | TimelineFromJSON,
19 | TimelineFromJSONTyped,
20 | TimelineToJSON,
21 | TimelineToJSONTyped,
22 | } from './Timeline';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface BookmarksTimeline
28 | */
29 | export interface BookmarksTimeline {
30 | /**
31 | *
32 | * @type {Timeline}
33 | * @memberof BookmarksTimeline
34 | */
35 | timeline: Timeline;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the BookmarksTimeline interface.
40 | */
41 | export function instanceOfBookmarksTimeline(value: object): value is BookmarksTimeline {
42 | if (!('timeline' in value) || value['timeline'] === undefined) return false;
43 | return true;
44 | }
45 |
46 | export function BookmarksTimelineFromJSON(json: any): BookmarksTimeline {
47 | return BookmarksTimelineFromJSONTyped(json, false);
48 | }
49 |
50 | export function BookmarksTimelineFromJSONTyped(json: any, ignoreDiscriminator: boolean): BookmarksTimeline {
51 | if (json == null) {
52 | return json;
53 | }
54 | return {
55 |
56 | 'timeline': TimelineFromJSON(json['timeline']),
57 | };
58 | }
59 |
60 | export function BookmarksTimelineToJSON(json: any): BookmarksTimeline {
61 | return BookmarksTimelineToJSONTyped(json, false);
62 | }
63 |
64 | export function BookmarksTimelineToJSONTyped(value?: BookmarksTimeline | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'timeline': TimelineToJSON(value['timeline']),
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/Callback.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface Callback
20 | */
21 | export interface Callback {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof Callback
26 | */
27 | endpoint: string;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the Callback interface.
32 | */
33 | export function instanceOfCallback(value: object): value is Callback {
34 | if (!('endpoint' in value) || value['endpoint'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function CallbackFromJSON(json: any): Callback {
39 | return CallbackFromJSONTyped(json, false);
40 | }
41 |
42 | export function CallbackFromJSONTyped(json: any, ignoreDiscriminator: boolean): Callback {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'endpoint': json['endpoint'],
49 | };
50 | }
51 |
52 | export function CallbackToJSON(json: any): Callback {
53 | return CallbackToJSONTyped(json, false);
54 | }
55 |
56 | export function CallbackToJSONTyped(value?: Callback | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'endpoint': value['endpoint'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/CommunitiesActions.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface CommunitiesActions
20 | */
21 | export interface CommunitiesActions {
22 | /**
23 | *
24 | * @type {boolean}
25 | * @memberof CommunitiesActions
26 | */
27 | create: boolean;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the CommunitiesActions interface.
32 | */
33 | export function instanceOfCommunitiesActions(value: object): value is CommunitiesActions {
34 | if (!('create' in value) || value['create'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function CommunitiesActionsFromJSON(json: any): CommunitiesActions {
39 | return CommunitiesActionsFromJSONTyped(json, false);
40 | }
41 |
42 | export function CommunitiesActionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommunitiesActions {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'create': json['create'],
49 | };
50 | }
51 |
52 | export function CommunitiesActionsToJSON(json: any): CommunitiesActions {
53 | return CommunitiesActionsToJSONTyped(json, false);
54 | }
55 |
56 | export function CommunitiesActionsToJSONTyped(value?: CommunitiesActions | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'create': value['create'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/Community.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { CommunityData } from './CommunityData';
17 | import {
18 | CommunityDataFromJSON,
19 | CommunityDataFromJSONTyped,
20 | CommunityDataToJSON,
21 | CommunityDataToJSONTyped,
22 | } from './CommunityData';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface Community
28 | */
29 | export interface Community {
30 | /**
31 | *
32 | * @type {CommunityData}
33 | * @memberof Community
34 | */
35 | result: CommunityData;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the Community interface.
40 | */
41 | export function instanceOfCommunity(value: object): value is Community {
42 | if (!('result' in value) || value['result'] === undefined) return false;
43 | return true;
44 | }
45 |
46 | export function CommunityFromJSON(json: any): Community {
47 | return CommunityFromJSONTyped(json, false);
48 | }
49 |
50 | export function CommunityFromJSONTyped(json: any, ignoreDiscriminator: boolean): Community {
51 | if (json == null) {
52 | return json;
53 | }
54 | return {
55 |
56 | 'result': CommunityDataFromJSON(json['result']),
57 | };
58 | }
59 |
60 | export function CommunityToJSON(json: any): Community {
61 | return CommunityToJSONTyped(json, false);
62 | }
63 |
64 | export function CommunityToJSONTyped(value?: Community | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'result': CommunityDataToJSON(value['result']),
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/CommunityJoinAction.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { TypeName } from './TypeName';
17 | import {
18 | TypeNameFromJSON,
19 | TypeNameFromJSONTyped,
20 | TypeNameToJSON,
21 | TypeNameToJSONTyped,
22 | } from './TypeName';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface CommunityJoinAction
28 | */
29 | export interface CommunityJoinAction {
30 | /**
31 | *
32 | * @type {TypeName}
33 | * @memberof CommunityJoinAction
34 | */
35 | typename: TypeName;
36 | }
37 |
38 |
39 |
40 | /**
41 | * Check if a given object implements the CommunityJoinAction interface.
42 | */
43 | export function instanceOfCommunityJoinAction(value: object): value is CommunityJoinAction {
44 | if (!('typename' in value) || value['typename'] === undefined) return false;
45 | return true;
46 | }
47 |
48 | export function CommunityJoinActionFromJSON(json: any): CommunityJoinAction {
49 | return CommunityJoinActionFromJSONTyped(json, false);
50 | }
51 |
52 | export function CommunityJoinActionFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommunityJoinAction {
53 | if (json == null) {
54 | return json;
55 | }
56 | return {
57 |
58 | 'typename': TypeNameFromJSON(json['__typename']),
59 | };
60 | }
61 |
62 | export function CommunityJoinActionToJSON(json: any): CommunityJoinAction {
63 | return CommunityJoinActionToJSONTyped(json, false);
64 | }
65 |
66 | export function CommunityJoinActionToJSONTyped(value?: CommunityJoinAction | null, ignoreDiscriminator: boolean = false): any {
67 | if (value == null) {
68 | return value;
69 | }
70 |
71 | return {
72 |
73 | '__typename': TypeNameToJSON(value['typename']),
74 | };
75 | }
76 |
77 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/CommunityPinActionResult.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { TypeName } from './TypeName';
17 | import {
18 | TypeNameFromJSON,
19 | TypeNameFromJSONTyped,
20 | TypeNameToJSON,
21 | TypeNameToJSONTyped,
22 | } from './TypeName';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface CommunityPinActionResult
28 | */
29 | export interface CommunityPinActionResult {
30 | /**
31 | *
32 | * @type {TypeName}
33 | * @memberof CommunityPinActionResult
34 | */
35 | typename: TypeName;
36 | }
37 |
38 |
39 |
40 | /**
41 | * Check if a given object implements the CommunityPinActionResult interface.
42 | */
43 | export function instanceOfCommunityPinActionResult(value: object): value is CommunityPinActionResult {
44 | if (!('typename' in value) || value['typename'] === undefined) return false;
45 | return true;
46 | }
47 |
48 | export function CommunityPinActionResultFromJSON(json: any): CommunityPinActionResult {
49 | return CommunityPinActionResultFromJSONTyped(json, false);
50 | }
51 |
52 | export function CommunityPinActionResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommunityPinActionResult {
53 | if (json == null) {
54 | return json;
55 | }
56 | return {
57 |
58 | 'typename': TypeNameFromJSON(json['__typename']),
59 | };
60 | }
61 |
62 | export function CommunityPinActionResultToJSON(json: any): CommunityPinActionResult {
63 | return CommunityPinActionResultToJSONTyped(json, false);
64 | }
65 |
66 | export function CommunityPinActionResultToJSONTyped(value?: CommunityPinActionResult | null, ignoreDiscriminator: boolean = false): any {
67 | if (value == null) {
68 | return value;
69 | }
70 |
71 | return {
72 |
73 | '__typename': TypeNameToJSON(value['typename']),
74 | };
75 | }
76 |
77 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/CommunityUrls.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { CommunityUrlsPermalink } from './CommunityUrlsPermalink';
17 | import {
18 | CommunityUrlsPermalinkFromJSON,
19 | CommunityUrlsPermalinkFromJSONTyped,
20 | CommunityUrlsPermalinkToJSON,
21 | CommunityUrlsPermalinkToJSONTyped,
22 | } from './CommunityUrlsPermalink';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface CommunityUrls
28 | */
29 | export interface CommunityUrls {
30 | /**
31 | *
32 | * @type {CommunityUrlsPermalink}
33 | * @memberof CommunityUrls
34 | */
35 | permalink: CommunityUrlsPermalink;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the CommunityUrls interface.
40 | */
41 | export function instanceOfCommunityUrls(value: object): value is CommunityUrls {
42 | if (!('permalink' in value) || value['permalink'] === undefined) return false;
43 | return true;
44 | }
45 |
46 | export function CommunityUrlsFromJSON(json: any): CommunityUrls {
47 | return CommunityUrlsFromJSONTyped(json, false);
48 | }
49 |
50 | export function CommunityUrlsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommunityUrls {
51 | if (json == null) {
52 | return json;
53 | }
54 | return {
55 |
56 | 'permalink': CommunityUrlsPermalinkFromJSON(json['permalink']),
57 | };
58 | }
59 |
60 | export function CommunityUrlsToJSON(json: any): CommunityUrls {
61 | return CommunityUrlsToJSONTyped(json, false);
62 | }
63 |
64 | export function CommunityUrlsToJSONTyped(value?: CommunityUrls | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'permalink': CommunityUrlsPermalinkToJSON(value['permalink']),
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/CommunityUrlsPermalink.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface CommunityUrlsPermalink
20 | */
21 | export interface CommunityUrlsPermalink {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof CommunityUrlsPermalink
26 | */
27 | url: string;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the CommunityUrlsPermalink interface.
32 | */
33 | export function instanceOfCommunityUrlsPermalink(value: object): value is CommunityUrlsPermalink {
34 | if (!('url' in value) || value['url'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function CommunityUrlsPermalinkFromJSON(json: any): CommunityUrlsPermalink {
39 | return CommunityUrlsPermalinkFromJSONTyped(json, false);
40 | }
41 |
42 | export function CommunityUrlsPermalinkFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommunityUrlsPermalink {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'url': json['url'],
49 | };
50 | }
51 |
52 | export function CommunityUrlsPermalinkToJSON(json: any): CommunityUrlsPermalink {
53 | return CommunityUrlsPermalinkToJSONTyped(json, false);
54 | }
55 |
56 | export function CommunityUrlsPermalinkToJSONTyped(value?: CommunityUrlsPermalink | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'url': value['url'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/ContentEntryType.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 |
16 | /**
17 | *
18 | * @export
19 | */
20 | export const ContentEntryType = {
21 | TimelineTimelineItem: 'TimelineTimelineItem',
22 | TimelineTimelineCursor: 'TimelineTimelineCursor',
23 | TimelineTimelineModule: 'TimelineTimelineModule'
24 | } as const;
25 | export type ContentEntryType = typeof ContentEntryType[keyof typeof ContentEntryType];
26 |
27 |
28 | export function instanceOfContentEntryType(value: any): boolean {
29 | for (const key in ContentEntryType) {
30 | if (Object.prototype.hasOwnProperty.call(ContentEntryType, key)) {
31 | if (ContentEntryType[key as keyof typeof ContentEntryType] === value) {
32 | return true;
33 | }
34 | }
35 | }
36 | return false;
37 | }
38 |
39 | export function ContentEntryTypeFromJSON(json: any): ContentEntryType {
40 | return ContentEntryTypeFromJSONTyped(json, false);
41 | }
42 |
43 | export function ContentEntryTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): ContentEntryType {
44 | return json as ContentEntryType;
45 | }
46 |
47 | export function ContentEntryTypeToJSON(value?: ContentEntryType | null): any {
48 | return value as any;
49 | }
50 |
51 | export function ContentEntryTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): ContentEntryType {
52 | return value as ContentEntryType;
53 | }
54 |
55 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/ContentItemType.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 |
16 | /**
17 | *
18 | * @export
19 | */
20 | export const ContentItemType = {
21 | TimelineTweet: 'TimelineTweet',
22 | TimelineTimelineCursor: 'TimelineTimelineCursor',
23 | TimelineUser: 'TimelineUser',
24 | TimelinePrompt: 'TimelinePrompt',
25 | TimelineMessagePrompt: 'TimelineMessagePrompt',
26 | TimelineCommunity: 'TimelineCommunity',
27 | TimelineTombstone: 'TimelineTombstone',
28 | TimelineTrend: 'TimelineTrend',
29 | TimelineNotification: 'TimelineNotification'
30 | } as const;
31 | export type ContentItemType = typeof ContentItemType[keyof typeof ContentItemType];
32 |
33 |
34 | export function instanceOfContentItemType(value: any): boolean {
35 | for (const key in ContentItemType) {
36 | if (Object.prototype.hasOwnProperty.call(ContentItemType, key)) {
37 | if (ContentItemType[key as keyof typeof ContentItemType] === value) {
38 | return true;
39 | }
40 | }
41 | }
42 | return false;
43 | }
44 |
45 | export function ContentItemTypeFromJSON(json: any): ContentItemType {
46 | return ContentItemTypeFromJSONTyped(json, false);
47 | }
48 |
49 | export function ContentItemTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): ContentItemType {
50 | return json as ContentItemType;
51 | }
52 |
53 | export function ContentItemTypeToJSON(value?: ContentItemType | null): any {
54 | return value as any;
55 | }
56 |
57 | export function ContentItemTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): ContentItemType {
58 | return value as ContentItemType;
59 | }
60 |
61 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/ConversationControl.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface ConversationControl
20 | */
21 | export interface ConversationControl {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof ConversationControl
26 | */
27 | mode: ConversationControlModeEnum;
28 | }
29 |
30 |
31 | /**
32 | * @export
33 | */
34 | export const ConversationControlModeEnum = {
35 | Community: 'Community',
36 | Verified: 'Verified',
37 | ByInvitation: 'ByInvitation'
38 | } as const;
39 | export type ConversationControlModeEnum = typeof ConversationControlModeEnum[keyof typeof ConversationControlModeEnum];
40 |
41 |
42 | /**
43 | * Check if a given object implements the ConversationControl interface.
44 | */
45 | export function instanceOfConversationControl(value: object): value is ConversationControl {
46 | if (!('mode' in value) || value['mode'] === undefined) return false;
47 | return true;
48 | }
49 |
50 | export function ConversationControlFromJSON(json: any): ConversationControl {
51 | return ConversationControlFromJSONTyped(json, false);
52 | }
53 |
54 | export function ConversationControlFromJSONTyped(json: any, ignoreDiscriminator: boolean): ConversationControl {
55 | if (json == null) {
56 | return json;
57 | }
58 | return {
59 |
60 | 'mode': json['mode'],
61 | };
62 | }
63 |
64 | export function ConversationControlToJSON(json: any): ConversationControl {
65 | return ConversationControlToJSONTyped(json, false);
66 | }
67 |
68 | export function ConversationControlToJSONTyped(value?: ConversationControl | null, ignoreDiscriminator: boolean = false): any {
69 | if (value == null) {
70 | return value;
71 | }
72 |
73 | return {
74 |
75 | 'mode': value['mode'],
76 | };
77 | }
78 |
79 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/CreateBookmarkResponseData.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface CreateBookmarkResponseData
20 | */
21 | export interface CreateBookmarkResponseData {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof CreateBookmarkResponseData
26 | */
27 | tweetBookmarkPut?: string;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the CreateBookmarkResponseData interface.
32 | */
33 | export function instanceOfCreateBookmarkResponseData(value: object): value is CreateBookmarkResponseData {
34 | return true;
35 | }
36 |
37 | export function CreateBookmarkResponseDataFromJSON(json: any): CreateBookmarkResponseData {
38 | return CreateBookmarkResponseDataFromJSONTyped(json, false);
39 | }
40 |
41 | export function CreateBookmarkResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateBookmarkResponseData {
42 | if (json == null) {
43 | return json;
44 | }
45 | return {
46 |
47 | 'tweetBookmarkPut': json['tweet_bookmark_put'] == null ? undefined : json['tweet_bookmark_put'],
48 | };
49 | }
50 |
51 | export function CreateBookmarkResponseDataToJSON(json: any): CreateBookmarkResponseData {
52 | return CreateBookmarkResponseDataToJSONTyped(json, false);
53 | }
54 |
55 | export function CreateBookmarkResponseDataToJSONTyped(value?: CreateBookmarkResponseData | null, ignoreDiscriminator: boolean = false): any {
56 | if (value == null) {
57 | return value;
58 | }
59 |
60 | return {
61 |
62 | 'tweet_bookmark_put': value['tweetBookmarkPut'],
63 | };
64 | }
65 |
66 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/CreateRetweet.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { Retweet } from './Retweet';
17 | import {
18 | RetweetFromJSON,
19 | RetweetFromJSONTyped,
20 | RetweetToJSON,
21 | RetweetToJSONTyped,
22 | } from './Retweet';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface CreateRetweet
28 | */
29 | export interface CreateRetweet {
30 | /**
31 | *
32 | * @type {Retweet}
33 | * @memberof CreateRetweet
34 | */
35 | result: Retweet;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the CreateRetweet interface.
40 | */
41 | export function instanceOfCreateRetweet(value: object): value is CreateRetweet {
42 | if (!('result' in value) || value['result'] === undefined) return false;
43 | return true;
44 | }
45 |
46 | export function CreateRetweetFromJSON(json: any): CreateRetweet {
47 | return CreateRetweetFromJSONTyped(json, false);
48 | }
49 |
50 | export function CreateRetweetFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateRetweet {
51 | if (json == null) {
52 | return json;
53 | }
54 | return {
55 |
56 | 'result': RetweetFromJSON(json['result']),
57 | };
58 | }
59 |
60 | export function CreateRetweetToJSON(json: any): CreateRetweet {
61 | return CreateRetweetToJSONTyped(json, false);
62 | }
63 |
64 | export function CreateRetweetToJSONTyped(value?: CreateRetweet | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'result': RetweetToJSON(value['result']),
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/CreateTweet.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { Tweet } from './Tweet';
17 | import {
18 | TweetFromJSON,
19 | TweetFromJSONTyped,
20 | TweetToJSON,
21 | TweetToJSONTyped,
22 | } from './Tweet';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface CreateTweet
28 | */
29 | export interface CreateTweet {
30 | /**
31 | *
32 | * @type {Tweet}
33 | * @memberof CreateTweet
34 | */
35 | result: Tweet;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the CreateTweet interface.
40 | */
41 | export function instanceOfCreateTweet(value: object): value is CreateTweet {
42 | if (!('result' in value) || value['result'] === undefined) return false;
43 | return true;
44 | }
45 |
46 | export function CreateTweetFromJSON(json: any): CreateTweet {
47 | return CreateTweetFromJSONTyped(json, false);
48 | }
49 |
50 | export function CreateTweetFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTweet {
51 | if (json == null) {
52 | return json;
53 | }
54 | return {
55 |
56 | 'result': TweetFromJSON(json['result']),
57 | };
58 | }
59 |
60 | export function CreateTweetToJSON(json: any): CreateTweet {
61 | return CreateTweetToJSONTyped(json, false);
62 | }
63 |
64 | export function CreateTweetToJSONTyped(value?: CreateTweet | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'result': TweetToJSON(value['result']),
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/CtaClientEventInfo.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface CtaClientEventInfo
20 | */
21 | export interface CtaClientEventInfo {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof CtaClientEventInfo
26 | */
27 | action: CtaClientEventInfoActionEnum;
28 | }
29 |
30 |
31 | /**
32 | * @export
33 | */
34 | export const CtaClientEventInfoActionEnum = {
35 | PrimaryCta: 'primary_cta'
36 | } as const;
37 | export type CtaClientEventInfoActionEnum = typeof CtaClientEventInfoActionEnum[keyof typeof CtaClientEventInfoActionEnum];
38 |
39 |
40 | /**
41 | * Check if a given object implements the CtaClientEventInfo interface.
42 | */
43 | export function instanceOfCtaClientEventInfo(value: object): value is CtaClientEventInfo {
44 | if (!('action' in value) || value['action'] === undefined) return false;
45 | return true;
46 | }
47 |
48 | export function CtaClientEventInfoFromJSON(json: any): CtaClientEventInfo {
49 | return CtaClientEventInfoFromJSONTyped(json, false);
50 | }
51 |
52 | export function CtaClientEventInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): CtaClientEventInfo {
53 | if (json == null) {
54 | return json;
55 | }
56 | return {
57 |
58 | 'action': json['action'],
59 | };
60 | }
61 |
62 | export function CtaClientEventInfoToJSON(json: any): CtaClientEventInfo {
63 | return CtaClientEventInfoToJSONTyped(json, false);
64 | }
65 |
66 | export function CtaClientEventInfoToJSONTyped(value?: CtaClientEventInfo | null, ignoreDiscriminator: boolean = false): any {
67 | if (value == null) {
68 | return value;
69 | }
70 |
71 | return {
72 |
73 | 'action': value['action'],
74 | };
75 | }
76 |
77 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/CursorType.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 |
16 | /**
17 | *
18 | * @export
19 | */
20 | export const CursorType = {
21 | Top: 'Top',
22 | Bottom: 'Bottom',
23 | ShowMore: 'ShowMore',
24 | ShowMoreThreads: 'ShowMoreThreads',
25 | Gap: 'Gap',
26 | ShowMoreThreadsPrompt: 'ShowMoreThreadsPrompt'
27 | } as const;
28 | export type CursorType = typeof CursorType[keyof typeof CursorType];
29 |
30 |
31 | export function instanceOfCursorType(value: any): boolean {
32 | for (const key in CursorType) {
33 | if (Object.prototype.hasOwnProperty.call(CursorType, key)) {
34 | if (CursorType[key as keyof typeof CursorType] === value) {
35 | return true;
36 | }
37 | }
38 | }
39 | return false;
40 | }
41 |
42 | export function CursorTypeFromJSON(json: any): CursorType {
43 | return CursorTypeFromJSONTyped(json, false);
44 | }
45 |
46 | export function CursorTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): CursorType {
47 | return json as CursorType;
48 | }
49 |
50 | export function CursorTypeToJSON(value?: CursorType | null): any {
51 | return value as any;
52 | }
53 |
54 | export function CursorTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): CursorType {
55 | return value as CursorType;
56 | }
57 |
58 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/DeleteBookmarkResponseData.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface DeleteBookmarkResponseData
20 | */
21 | export interface DeleteBookmarkResponseData {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof DeleteBookmarkResponseData
26 | */
27 | tweetBookmarkDelete?: string;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the DeleteBookmarkResponseData interface.
32 | */
33 | export function instanceOfDeleteBookmarkResponseData(value: object): value is DeleteBookmarkResponseData {
34 | return true;
35 | }
36 |
37 | export function DeleteBookmarkResponseDataFromJSON(json: any): DeleteBookmarkResponseData {
38 | return DeleteBookmarkResponseDataFromJSONTyped(json, false);
39 | }
40 |
41 | export function DeleteBookmarkResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeleteBookmarkResponseData {
42 | if (json == null) {
43 | return json;
44 | }
45 | return {
46 |
47 | 'tweetBookmarkDelete': json['tweet_bookmark_delete'] == null ? undefined : json['tweet_bookmark_delete'],
48 | };
49 | }
50 |
51 | export function DeleteBookmarkResponseDataToJSON(json: any): DeleteBookmarkResponseData {
52 | return DeleteBookmarkResponseDataToJSONTyped(json, false);
53 | }
54 |
55 | export function DeleteBookmarkResponseDataToJSONTyped(value?: DeleteBookmarkResponseData | null, ignoreDiscriminator: boolean = false): any {
56 | if (value == null) {
57 | return value;
58 | }
59 |
60 | return {
61 |
62 | 'tweet_bookmark_delete': value['tweetBookmarkDelete'],
63 | };
64 | }
65 |
66 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/DeleteRetweet.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { Retweet } from './Retweet';
17 | import {
18 | RetweetFromJSON,
19 | RetweetFromJSONTyped,
20 | RetweetToJSON,
21 | RetweetToJSONTyped,
22 | } from './Retweet';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface DeleteRetweet
28 | */
29 | export interface DeleteRetweet {
30 | /**
31 | *
32 | * @type {Array}
33 | * @memberof DeleteRetweet
34 | */
35 | result: Array;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the DeleteRetweet interface.
40 | */
41 | export function instanceOfDeleteRetweet(value: object): value is DeleteRetweet {
42 | if (!('result' in value) || value['result'] === undefined) return false;
43 | return true;
44 | }
45 |
46 | export function DeleteRetweetFromJSON(json: any): DeleteRetweet {
47 | return DeleteRetweetFromJSONTyped(json, false);
48 | }
49 |
50 | export function DeleteRetweetFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeleteRetweet {
51 | if (json == null) {
52 | return json;
53 | }
54 | return {
55 |
56 | 'result': ((json['result'] as Array).map(RetweetFromJSON)),
57 | };
58 | }
59 |
60 | export function DeleteRetweetToJSON(json: any): DeleteRetweet {
61 | return DeleteRetweetToJSONTyped(json, false);
62 | }
63 |
64 | export function DeleteRetweetToJSONTyped(value?: DeleteRetweet | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'result': ((value['result'] as Array).map(RetweetToJSON)),
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/DeleteTweetResponseResult.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface DeleteTweetResponseResult
20 | */
21 | export interface DeleteTweetResponseResult {
22 | /**
23 | *
24 | * @type {object}
25 | * @memberof DeleteTweetResponseResult
26 | */
27 | tweetResults: object;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the DeleteTweetResponseResult interface.
32 | */
33 | export function instanceOfDeleteTweetResponseResult(value: object): value is DeleteTweetResponseResult {
34 | if (!('tweetResults' in value) || value['tweetResults'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function DeleteTweetResponseResultFromJSON(json: any): DeleteTweetResponseResult {
39 | return DeleteTweetResponseResultFromJSONTyped(json, false);
40 | }
41 |
42 | export function DeleteTweetResponseResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeleteTweetResponseResult {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'tweetResults': json['tweet_results'],
49 | };
50 | }
51 |
52 | export function DeleteTweetResponseResultToJSON(json: any): DeleteTweetResponseResult {
53 | return DeleteTweetResponseResultToJSONTyped(json, false);
54 | }
55 |
56 | export function DeleteTweetResponseResultToJSONTyped(value?: DeleteTweetResponseResult | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'tweet_results': value['tweetResults'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/DisplayTreatment.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface DisplayTreatment
20 | */
21 | export interface DisplayTreatment {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof DisplayTreatment
26 | */
27 | actionText: string;
28 | /**
29 | *
30 | * @type {string}
31 | * @memberof DisplayTreatment
32 | */
33 | labelText?: string;
34 | }
35 |
36 | /**
37 | * Check if a given object implements the DisplayTreatment interface.
38 | */
39 | export function instanceOfDisplayTreatment(value: object): value is DisplayTreatment {
40 | if (!('actionText' in value) || value['actionText'] === undefined) return false;
41 | return true;
42 | }
43 |
44 | export function DisplayTreatmentFromJSON(json: any): DisplayTreatment {
45 | return DisplayTreatmentFromJSONTyped(json, false);
46 | }
47 |
48 | export function DisplayTreatmentFromJSONTyped(json: any, ignoreDiscriminator: boolean): DisplayTreatment {
49 | if (json == null) {
50 | return json;
51 | }
52 | return {
53 |
54 | 'actionText': json['actionText'],
55 | 'labelText': json['labelText'] == null ? undefined : json['labelText'],
56 | };
57 | }
58 |
59 | export function DisplayTreatmentToJSON(json: any): DisplayTreatment {
60 | return DisplayTreatmentToJSONTyped(json, false);
61 | }
62 |
63 | export function DisplayTreatmentToJSONTyped(value?: DisplayTreatment | null, ignoreDiscriminator: boolean = false): any {
64 | if (value == null) {
65 | return value;
66 | }
67 |
68 | return {
69 |
70 | 'actionText': value['actionText'],
71 | 'labelText': value['labelText'],
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/DisplayType.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 |
16 | /**
17 | *
18 | * @export
19 | */
20 | export const DisplayType = {
21 | Vertical: 'Vertical',
22 | VerticalConversation: 'VerticalConversation',
23 | VerticalGrid: 'VerticalGrid',
24 | Carousel: 'Carousel'
25 | } as const;
26 | export type DisplayType = typeof DisplayType[keyof typeof DisplayType];
27 |
28 |
29 | export function instanceOfDisplayType(value: any): boolean {
30 | for (const key in DisplayType) {
31 | if (Object.prototype.hasOwnProperty.call(DisplayType, key)) {
32 | if (DisplayType[key as keyof typeof DisplayType] === value) {
33 | return true;
34 | }
35 | }
36 | }
37 | return false;
38 | }
39 |
40 | export function DisplayTypeFromJSON(json: any): DisplayType {
41 | return DisplayTypeFromJSONTyped(json, false);
42 | }
43 |
44 | export function DisplayTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): DisplayType {
45 | return json as DisplayType;
46 | }
47 |
48 | export function DisplayTypeToJSON(value?: DisplayType | null): any {
49 | return value as any;
50 | }
51 |
52 | export function DisplayTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): DisplayType {
53 | return value as DisplayType;
54 | }
55 |
56 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/ExtendedEntities.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { MediaExtended } from './MediaExtended';
17 | import {
18 | MediaExtendedFromJSON,
19 | MediaExtendedFromJSONTyped,
20 | MediaExtendedToJSON,
21 | MediaExtendedToJSONTyped,
22 | } from './MediaExtended';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface ExtendedEntities
28 | */
29 | export interface ExtendedEntities {
30 | /**
31 | *
32 | * @type {Array}
33 | * @memberof ExtendedEntities
34 | */
35 | media: Array;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the ExtendedEntities interface.
40 | */
41 | export function instanceOfExtendedEntities(value: object): value is ExtendedEntities {
42 | if (!('media' in value) || value['media'] === undefined) return false;
43 | return true;
44 | }
45 |
46 | export function ExtendedEntitiesFromJSON(json: any): ExtendedEntities {
47 | return ExtendedEntitiesFromJSONTyped(json, false);
48 | }
49 |
50 | export function ExtendedEntitiesFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExtendedEntities {
51 | if (json == null) {
52 | return json;
53 | }
54 | return {
55 |
56 | 'media': ((json['media'] as Array).map(MediaExtendedFromJSON)),
57 | };
58 | }
59 |
60 | export function ExtendedEntitiesToJSON(json: any): ExtendedEntities {
61 | return ExtendedEntitiesToJSONTyped(json, false);
62 | }
63 |
64 | export function ExtendedEntitiesToJSONTyped(value?: ExtendedEntities | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'media': ((value['media'] as Array).map(MediaExtendedToJSON)),
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/FavoriteTweet.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface FavoriteTweet
20 | */
21 | export interface FavoriteTweet {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof FavoriteTweet
26 | */
27 | favoriteTweet?: string;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the FavoriteTweet interface.
32 | */
33 | export function instanceOfFavoriteTweet(value: object): value is FavoriteTweet {
34 | return true;
35 | }
36 |
37 | export function FavoriteTweetFromJSON(json: any): FavoriteTweet {
38 | return FavoriteTweetFromJSONTyped(json, false);
39 | }
40 |
41 | export function FavoriteTweetFromJSONTyped(json: any, ignoreDiscriminator: boolean): FavoriteTweet {
42 | if (json == null) {
43 | return json;
44 | }
45 | return {
46 |
47 | 'favoriteTweet': json['favorite_tweet'] == null ? undefined : json['favorite_tweet'],
48 | };
49 | }
50 |
51 | export function FavoriteTweetToJSON(json: any): FavoriteTweet {
52 | return FavoriteTweetToJSONTyped(json, false);
53 | }
54 |
55 | export function FavoriteTweetToJSONTyped(value?: FavoriteTweet | null, ignoreDiscriminator: boolean = false): any {
56 | if (value == null) {
57 | return value;
58 | }
59 |
60 | return {
61 |
62 | 'favorite_tweet': value['favoriteTweet'],
63 | };
64 | }
65 |
66 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/FollowResponseData.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { FollowResponseUser } from './FollowResponseUser';
17 | import {
18 | FollowResponseUserFromJSON,
19 | FollowResponseUserFromJSONTyped,
20 | FollowResponseUserToJSON,
21 | FollowResponseUserToJSONTyped,
22 | } from './FollowResponseUser';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface FollowResponseData
28 | */
29 | export interface FollowResponseData {
30 | /**
31 | *
32 | * @type {FollowResponseUser}
33 | * @memberof FollowResponseData
34 | */
35 | user?: FollowResponseUser;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the FollowResponseData interface.
40 | */
41 | export function instanceOfFollowResponseData(value: object): value is FollowResponseData {
42 | return true;
43 | }
44 |
45 | export function FollowResponseDataFromJSON(json: any): FollowResponseData {
46 | return FollowResponseDataFromJSONTyped(json, false);
47 | }
48 |
49 | export function FollowResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): FollowResponseData {
50 | if (json == null) {
51 | return json;
52 | }
53 | return {
54 |
55 | 'user': json['user'] == null ? undefined : FollowResponseUserFromJSON(json['user']),
56 | };
57 | }
58 |
59 | export function FollowResponseDataToJSON(json: any): FollowResponseData {
60 | return FollowResponseDataToJSONTyped(json, false);
61 | }
62 |
63 | export function FollowResponseDataToJSONTyped(value?: FollowResponseData | null, ignoreDiscriminator: boolean = false): any {
64 | if (value == null) {
65 | return value;
66 | }
67 |
68 | return {
69 |
70 | 'user': FollowResponseUserToJSON(value['user']),
71 | };
72 | }
73 |
74 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/FollowTimeline.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { Timeline } from './Timeline';
17 | import {
18 | TimelineFromJSON,
19 | TimelineFromJSONTyped,
20 | TimelineToJSON,
21 | TimelineToJSONTyped,
22 | } from './Timeline';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface FollowTimeline
28 | */
29 | export interface FollowTimeline {
30 | /**
31 | *
32 | * @type {Timeline}
33 | * @memberof FollowTimeline
34 | */
35 | timeline: Timeline;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the FollowTimeline interface.
40 | */
41 | export function instanceOfFollowTimeline(value: object): value is FollowTimeline {
42 | if (!('timeline' in value) || value['timeline'] === undefined) return false;
43 | return true;
44 | }
45 |
46 | export function FollowTimelineFromJSON(json: any): FollowTimeline {
47 | return FollowTimelineFromJSONTyped(json, false);
48 | }
49 |
50 | export function FollowTimelineFromJSONTyped(json: any, ignoreDiscriminator: boolean): FollowTimeline {
51 | if (json == null) {
52 | return json;
53 | }
54 | return {
55 |
56 | 'timeline': TimelineFromJSON(json['timeline']),
57 | };
58 | }
59 |
60 | export function FollowTimelineToJSON(json: any): FollowTimeline {
61 | return FollowTimelineToJSONTyped(json, false);
62 | }
63 |
64 | export function FollowTimelineToJSONTyped(value?: FollowTimeline | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'timeline': TimelineToJSON(value['timeline']),
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/GrokImageAnnotation.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface GrokImageAnnotation
20 | */
21 | export interface GrokImageAnnotation {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof GrokImageAnnotation
26 | */
27 | prompt: string;
28 | /**
29 | *
30 | * @type {string}
31 | * @memberof GrokImageAnnotation
32 | */
33 | upsampledPrompt: string;
34 | }
35 |
36 | /**
37 | * Check if a given object implements the GrokImageAnnotation interface.
38 | */
39 | export function instanceOfGrokImageAnnotation(value: object): value is GrokImageAnnotation {
40 | if (!('prompt' in value) || value['prompt'] === undefined) return false;
41 | if (!('upsampledPrompt' in value) || value['upsampledPrompt'] === undefined) return false;
42 | return true;
43 | }
44 |
45 | export function GrokImageAnnotationFromJSON(json: any): GrokImageAnnotation {
46 | return GrokImageAnnotationFromJSONTyped(json, false);
47 | }
48 |
49 | export function GrokImageAnnotationFromJSONTyped(json: any, ignoreDiscriminator: boolean): GrokImageAnnotation {
50 | if (json == null) {
51 | return json;
52 | }
53 | return {
54 |
55 | 'prompt': json['prompt'],
56 | 'upsampledPrompt': json['upsampled_prompt'],
57 | };
58 | }
59 |
60 | export function GrokImageAnnotationToJSON(json: any): GrokImageAnnotation {
61 | return GrokImageAnnotationToJSONTyped(json, false);
62 | }
63 |
64 | export function GrokImageAnnotationToJSONTyped(value?: GrokImageAnnotation | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'prompt': value['prompt'],
72 | 'upsampled_prompt': value['upsampledPrompt'],
73 | };
74 | }
75 |
76 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/Highlight.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { TextHighlight } from './TextHighlight';
17 | import {
18 | TextHighlightFromJSON,
19 | TextHighlightFromJSONTyped,
20 | TextHighlightToJSON,
21 | TextHighlightToJSONTyped,
22 | } from './TextHighlight';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface Highlight
28 | */
29 | export interface Highlight {
30 | /**
31 | *
32 | * @type {Array}
33 | * @memberof Highlight
34 | */
35 | textHighlights: Array;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the Highlight interface.
40 | */
41 | export function instanceOfHighlight(value: object): value is Highlight {
42 | if (!('textHighlights' in value) || value['textHighlights'] === undefined) return false;
43 | return true;
44 | }
45 |
46 | export function HighlightFromJSON(json: any): Highlight {
47 | return HighlightFromJSONTyped(json, false);
48 | }
49 |
50 | export function HighlightFromJSONTyped(json: any, ignoreDiscriminator: boolean): Highlight {
51 | if (json == null) {
52 | return json;
53 | }
54 | return {
55 |
56 | 'textHighlights': ((json['textHighlights'] as Array).map(TextHighlightFromJSON)),
57 | };
58 | }
59 |
60 | export function HighlightToJSON(json: any): Highlight {
61 | return HighlightToJSONTyped(json, false);
62 | }
63 |
64 | export function HighlightToJSONTyped(value?: Highlight | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'textHighlights': ((value['textHighlights'] as Array).map(TextHighlightToJSON)),
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/HomeTimelineHome.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { Timeline } from './Timeline';
17 | import {
18 | TimelineFromJSON,
19 | TimelineFromJSONTyped,
20 | TimelineToJSON,
21 | TimelineToJSONTyped,
22 | } from './Timeline';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface HomeTimelineHome
28 | */
29 | export interface HomeTimelineHome {
30 | /**
31 | *
32 | * @type {Timeline}
33 | * @memberof HomeTimelineHome
34 | */
35 | homeTimelineUrt: Timeline;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the HomeTimelineHome interface.
40 | */
41 | export function instanceOfHomeTimelineHome(value: object): value is HomeTimelineHome {
42 | if (!('homeTimelineUrt' in value) || value['homeTimelineUrt'] === undefined) return false;
43 | return true;
44 | }
45 |
46 | export function HomeTimelineHomeFromJSON(json: any): HomeTimelineHome {
47 | return HomeTimelineHomeFromJSONTyped(json, false);
48 | }
49 |
50 | export function HomeTimelineHomeFromJSONTyped(json: any, ignoreDiscriminator: boolean): HomeTimelineHome {
51 | if (json == null) {
52 | return json;
53 | }
54 | return {
55 |
56 | 'homeTimelineUrt': TimelineFromJSON(json['home_timeline_urt']),
57 | };
58 | }
59 |
60 | export function HomeTimelineHomeToJSON(json: any): HomeTimelineHome {
61 | return HomeTimelineHomeToJSONTyped(json, false);
62 | }
63 |
64 | export function HomeTimelineHomeToJSONTyped(value?: HomeTimelineHome | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'home_timeline_urt': TimelineToJSON(value['homeTimelineUrt']),
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/InstructionType.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 |
16 | /**
17 | *
18 | * @export
19 | */
20 | export const InstructionType = {
21 | TimelineAddEntries: 'TimelineAddEntries',
22 | TimelineAddToModule: 'TimelineAddToModule',
23 | TimelineClearCache: 'TimelineClearCache',
24 | TimelinePinEntry: 'TimelinePinEntry',
25 | TimelineReplaceEntry: 'TimelineReplaceEntry',
26 | TimelineShowAlert: 'TimelineShowAlert',
27 | TimelineTerminateTimeline: 'TimelineTerminateTimeline',
28 | TimelineShowCover: 'TimelineShowCover',
29 | TimelineClearEntriesUnreadState: 'TimelineClearEntriesUnreadState',
30 | TimelineMarkEntriesUnreadGreaterThanSortIndex: 'TimelineMarkEntriesUnreadGreaterThanSortIndex'
31 | } as const;
32 | export type InstructionType = typeof InstructionType[keyof typeof InstructionType];
33 |
34 |
35 | export function instanceOfInstructionType(value: any): boolean {
36 | for (const key in InstructionType) {
37 | if (Object.prototype.hasOwnProperty.call(InstructionType, key)) {
38 | if (InstructionType[key as keyof typeof InstructionType] === value) {
39 | return true;
40 | }
41 | }
42 | }
43 | return false;
44 | }
45 |
46 | export function InstructionTypeFromJSON(json: any): InstructionType {
47 | return InstructionTypeFromJSONTyped(json, false);
48 | }
49 |
50 | export function InstructionTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): InstructionType {
51 | return json as InstructionType;
52 | }
53 |
54 | export function InstructionTypeToJSON(value?: InstructionType | null): any {
55 | return value as any;
56 | }
57 |
58 | export function InstructionTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): InstructionType {
59 | return value as InstructionType;
60 | }
61 |
62 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/Location.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface Location
20 | */
21 | export interface Location {
22 | /**
23 | *
24 | * @type {number}
25 | * @memberof Location
26 | */
27 | column: number;
28 | /**
29 | *
30 | * @type {number}
31 | * @memberof Location
32 | */
33 | line: number;
34 | }
35 |
36 | /**
37 | * Check if a given object implements the Location interface.
38 | */
39 | export function instanceOfLocation(value: object): value is Location {
40 | if (!('column' in value) || value['column'] === undefined) return false;
41 | if (!('line' in value) || value['line'] === undefined) return false;
42 | return true;
43 | }
44 |
45 | export function LocationFromJSON(json: any): Location {
46 | return LocationFromJSONTyped(json, false);
47 | }
48 |
49 | export function LocationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Location {
50 | if (json == null) {
51 | return json;
52 | }
53 | return {
54 |
55 | 'column': json['column'],
56 | 'line': json['line'],
57 | };
58 | }
59 |
60 | export function LocationToJSON(json: any): Location {
61 | return LocationToJSONTyped(json, false);
62 | }
63 |
64 | export function LocationToJSONTyped(value?: Location | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'column': value['column'],
72 | 'line': value['line'],
73 | };
74 | }
75 |
76 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/MediaResults.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { MediaResult } from './MediaResult';
17 | import {
18 | MediaResultFromJSON,
19 | MediaResultFromJSONTyped,
20 | MediaResultToJSON,
21 | MediaResultToJSONTyped,
22 | } from './MediaResult';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface MediaResults
28 | */
29 | export interface MediaResults {
30 | /**
31 | *
32 | * @type {MediaResult}
33 | * @memberof MediaResults
34 | */
35 | result: MediaResult;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the MediaResults interface.
40 | */
41 | export function instanceOfMediaResults(value: object): value is MediaResults {
42 | if (!('result' in value) || value['result'] === undefined) return false;
43 | return true;
44 | }
45 |
46 | export function MediaResultsFromJSON(json: any): MediaResults {
47 | return MediaResultsFromJSONTyped(json, false);
48 | }
49 |
50 | export function MediaResultsFromJSONTyped(json: any, ignoreDiscriminator: boolean): MediaResults {
51 | if (json == null) {
52 | return json;
53 | }
54 | return {
55 |
56 | 'result': MediaResultFromJSON(json['result']),
57 | };
58 | }
59 |
60 | export function MediaResultsToJSON(json: any): MediaResults {
61 | return MediaResultsToJSONTyped(json, false);
62 | }
63 |
64 | export function MediaResultsToJSONTyped(value?: MediaResults | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'result': MediaResultToJSON(value['result']),
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/MediaStats.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface MediaStats
20 | */
21 | export interface MediaStats {
22 | /**
23 | *
24 | * @type {number}
25 | * @memberof MediaStats
26 | */
27 | viewCount: number;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the MediaStats interface.
32 | */
33 | export function instanceOfMediaStats(value: object): value is MediaStats {
34 | if (!('viewCount' in value) || value['viewCount'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function MediaStatsFromJSON(json: any): MediaStats {
39 | return MediaStatsFromJSONTyped(json, false);
40 | }
41 |
42 | export function MediaStatsFromJSONTyped(json: any, ignoreDiscriminator: boolean): MediaStats {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'viewCount': json['viewCount'],
49 | };
50 | }
51 |
52 | export function MediaStatsToJSON(json: any): MediaStats {
53 | return MediaStatsToJSONTyped(json, false);
54 | }
55 |
56 | export function MediaStatsToJSONTyped(value?: MediaStats | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'viewCount': value['viewCount'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/NoteTweetResult.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { NoteTweetResultData } from './NoteTweetResultData';
17 | import {
18 | NoteTweetResultDataFromJSON,
19 | NoteTweetResultDataFromJSONTyped,
20 | NoteTweetResultDataToJSON,
21 | NoteTweetResultDataToJSONTyped,
22 | } from './NoteTweetResultData';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface NoteTweetResult
28 | */
29 | export interface NoteTweetResult {
30 | /**
31 | *
32 | * @type {NoteTweetResultData}
33 | * @memberof NoteTweetResult
34 | */
35 | result: NoteTweetResultData;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the NoteTweetResult interface.
40 | */
41 | export function instanceOfNoteTweetResult(value: object): value is NoteTweetResult {
42 | if (!('result' in value) || value['result'] === undefined) return false;
43 | return true;
44 | }
45 |
46 | export function NoteTweetResultFromJSON(json: any): NoteTweetResult {
47 | return NoteTweetResultFromJSONTyped(json, false);
48 | }
49 |
50 | export function NoteTweetResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): NoteTweetResult {
51 | if (json == null) {
52 | return json;
53 | }
54 | return {
55 |
56 | 'result': NoteTweetResultDataFromJSON(json['result']),
57 | };
58 | }
59 |
60 | export function NoteTweetResultToJSON(json: any): NoteTweetResult {
61 | return NoteTweetResultToJSONTyped(json, false);
62 | }
63 |
64 | export function NoteTweetResultToJSONTyped(value?: NoteTweetResult | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'result': NoteTweetResultDataToJSON(value['result']),
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/OneFactorLoginEligibility.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface OneFactorLoginEligibility
20 | */
21 | export interface OneFactorLoginEligibility {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof OneFactorLoginEligibility
26 | */
27 | fetchStatus: string;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the OneFactorLoginEligibility interface.
32 | */
33 | export function instanceOfOneFactorLoginEligibility(value: object): value is OneFactorLoginEligibility {
34 | if (!('fetchStatus' in value) || value['fetchStatus'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function OneFactorLoginEligibilityFromJSON(json: any): OneFactorLoginEligibility {
39 | return OneFactorLoginEligibilityFromJSONTyped(json, false);
40 | }
41 |
42 | export function OneFactorLoginEligibilityFromJSONTyped(json: any, ignoreDiscriminator: boolean): OneFactorLoginEligibility {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'fetchStatus': json['fetchStatus'],
49 | };
50 | }
51 |
52 | export function OneFactorLoginEligibilityToJSON(json: any): OneFactorLoginEligibility {
53 | return OneFactorLoginEligibilityToJSONTyped(json, false);
54 | }
55 |
56 | export function OneFactorLoginEligibilityToJSONTyped(value?: OneFactorLoginEligibility | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'fetchStatus': value['fetchStatus'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/OtherObjectAll.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { Session } from './Session';
17 | import {
18 | SessionFromJSON,
19 | SessionFromJSONTyped,
20 | SessionToJSON,
21 | SessionToJSONTyped,
22 | } from './Session';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface OtherObjectAll
28 | */
29 | export interface OtherObjectAll {
30 | /**
31 | *
32 | * @type {Session}
33 | * @memberof OtherObjectAll
34 | */
35 | session?: Session;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the OtherObjectAll interface.
40 | */
41 | export function instanceOfOtherObjectAll(value: object): value is OtherObjectAll {
42 | return true;
43 | }
44 |
45 | export function OtherObjectAllFromJSON(json: any): OtherObjectAll {
46 | return OtherObjectAllFromJSONTyped(json, false);
47 | }
48 |
49 | export function OtherObjectAllFromJSONTyped(json: any, ignoreDiscriminator: boolean): OtherObjectAll {
50 | if (json == null) {
51 | return json;
52 | }
53 | return {
54 |
55 | 'session': json['Session'] == null ? undefined : SessionFromJSON(json['Session']),
56 | };
57 | }
58 |
59 | export function OtherObjectAllToJSON(json: any): OtherObjectAll {
60 | return OtherObjectAllToJSONTyped(json, false);
61 | }
62 |
63 | export function OtherObjectAllToJSONTyped(value?: OtherObjectAll | null, ignoreDiscriminator: boolean = false): any {
64 | if (value == null) {
65 | return value;
66 | }
67 |
68 | return {
69 |
70 | 'Session': SessionToJSON(value['session']),
71 | };
72 | }
73 |
74 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/PostCreateBookmarkRequestVariables.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface PostCreateBookmarkRequestVariables
20 | */
21 | export interface PostCreateBookmarkRequestVariables {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof PostCreateBookmarkRequestVariables
26 | */
27 | tweetId: string;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the PostCreateBookmarkRequestVariables interface.
32 | */
33 | export function instanceOfPostCreateBookmarkRequestVariables(value: object): value is PostCreateBookmarkRequestVariables {
34 | if (!('tweetId' in value) || value['tweetId'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function PostCreateBookmarkRequestVariablesFromJSON(json: any): PostCreateBookmarkRequestVariables {
39 | return PostCreateBookmarkRequestVariablesFromJSONTyped(json, false);
40 | }
41 |
42 | export function PostCreateBookmarkRequestVariablesFromJSONTyped(json: any, ignoreDiscriminator: boolean): PostCreateBookmarkRequestVariables {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'tweetId': json['tweet_id'],
49 | };
50 | }
51 |
52 | export function PostCreateBookmarkRequestVariablesToJSON(json: any): PostCreateBookmarkRequestVariables {
53 | return PostCreateBookmarkRequestVariablesToJSONTyped(json, false);
54 | }
55 |
56 | export function PostCreateBookmarkRequestVariablesToJSONTyped(value?: PostCreateBookmarkRequestVariables | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'tweet_id': value['tweetId'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/QuotedRefResult.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { TweetUnion } from './TweetUnion';
17 | import {
18 | TweetUnionFromJSON,
19 | TweetUnionFromJSONTyped,
20 | TweetUnionToJSON,
21 | TweetUnionToJSONTyped,
22 | } from './TweetUnion';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface QuotedRefResult
28 | */
29 | export interface QuotedRefResult {
30 | /**
31 | *
32 | * @type {TweetUnion}
33 | * @memberof QuotedRefResult
34 | */
35 | result?: TweetUnion;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the QuotedRefResult interface.
40 | */
41 | export function instanceOfQuotedRefResult(value: object): value is QuotedRefResult {
42 | return true;
43 | }
44 |
45 | export function QuotedRefResultFromJSON(json: any): QuotedRefResult {
46 | return QuotedRefResultFromJSONTyped(json, false);
47 | }
48 |
49 | export function QuotedRefResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): QuotedRefResult {
50 | if (json == null) {
51 | return json;
52 | }
53 | return {
54 |
55 | 'result': json['result'] == null ? undefined : TweetUnionFromJSON(json['result']),
56 | };
57 | }
58 |
59 | export function QuotedRefResultToJSON(json: any): QuotedRefResult {
60 | return QuotedRefResultToJSONTyped(json, false);
61 | }
62 |
63 | export function QuotedRefResultToJSONTyped(value?: QuotedRefResult | null, ignoreDiscriminator: boolean = false): any {
64 | if (value == null) {
65 | return value;
66 | }
67 |
68 | return {
69 |
70 | 'result': TweetUnionToJSON(value['result']),
71 | };
72 | }
73 |
74 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/RetweetLegacy.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface RetweetLegacy
20 | */
21 | export interface RetweetLegacy {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof RetweetLegacy
26 | */
27 | fullText: string;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the RetweetLegacy interface.
32 | */
33 | export function instanceOfRetweetLegacy(value: object): value is RetweetLegacy {
34 | if (!('fullText' in value) || value['fullText'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function RetweetLegacyFromJSON(json: any): RetweetLegacy {
39 | return RetweetLegacyFromJSONTyped(json, false);
40 | }
41 |
42 | export function RetweetLegacyFromJSONTyped(json: any, ignoreDiscriminator: boolean): RetweetLegacy {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'fullText': json['full_text'],
49 | };
50 | }
51 |
52 | export function RetweetLegacyToJSON(json: any): RetweetLegacy {
53 | return RetweetLegacyToJSONTyped(json, false);
54 | }
55 |
56 | export function RetweetLegacyToJSONTyped(value?: RetweetLegacy | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'full_text': value['fullText'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/RichMessage.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface RichMessage
20 | */
21 | export interface RichMessage {
22 | /**
23 | *
24 | * @type {boolean}
25 | * @memberof RichMessage
26 | */
27 | rtl?: boolean;
28 | /**
29 | *
30 | * @type {string}
31 | * @memberof RichMessage
32 | */
33 | text?: string;
34 | }
35 |
36 | /**
37 | * Check if a given object implements the RichMessage interface.
38 | */
39 | export function instanceOfRichMessage(value: object): value is RichMessage {
40 | return true;
41 | }
42 |
43 | export function RichMessageFromJSON(json: any): RichMessage {
44 | return RichMessageFromJSONTyped(json, false);
45 | }
46 |
47 | export function RichMessageFromJSONTyped(json: any, ignoreDiscriminator: boolean): RichMessage {
48 | if (json == null) {
49 | return json;
50 | }
51 | return {
52 |
53 | 'rtl': json['rtl'] == null ? undefined : json['rtl'],
54 | 'text': json['text'] == null ? undefined : json['text'],
55 | };
56 | }
57 |
58 | export function RichMessageToJSON(json: any): RichMessage {
59 | return RichMessageToJSONTyped(json, false);
60 | }
61 |
62 | export function RichMessageToJSONTyped(value?: RichMessage | null, ignoreDiscriminator: boolean = false): any {
63 | if (value == null) {
64 | return value;
65 | }
66 |
67 | return {
68 |
69 | 'rtl': value['rtl'],
70 | 'text': value['text'],
71 | };
72 | }
73 |
74 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/SearchByRawQuery.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { SearchTimeline } from './SearchTimeline';
17 | import {
18 | SearchTimelineFromJSON,
19 | SearchTimelineFromJSONTyped,
20 | SearchTimelineToJSON,
21 | SearchTimelineToJSONTyped,
22 | } from './SearchTimeline';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface SearchByRawQuery
28 | */
29 | export interface SearchByRawQuery {
30 | /**
31 | *
32 | * @type {SearchTimeline}
33 | * @memberof SearchByRawQuery
34 | */
35 | searchTimeline: SearchTimeline;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the SearchByRawQuery interface.
40 | */
41 | export function instanceOfSearchByRawQuery(value: object): value is SearchByRawQuery {
42 | if (!('searchTimeline' in value) || value['searchTimeline'] === undefined) return false;
43 | return true;
44 | }
45 |
46 | export function SearchByRawQueryFromJSON(json: any): SearchByRawQuery {
47 | return SearchByRawQueryFromJSONTyped(json, false);
48 | }
49 |
50 | export function SearchByRawQueryFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchByRawQuery {
51 | if (json == null) {
52 | return json;
53 | }
54 | return {
55 |
56 | 'searchTimeline': SearchTimelineFromJSON(json['search_timeline']),
57 | };
58 | }
59 |
60 | export function SearchByRawQueryToJSON(json: any): SearchByRawQuery {
61 | return SearchByRawQueryToJSONTyped(json, false);
62 | }
63 |
64 | export function SearchByRawQueryToJSONTyped(value?: SearchByRawQuery | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'search_timeline': SearchTimelineToJSON(value['searchTimeline']),
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/SearchTimeline.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { Timeline } from './Timeline';
17 | import {
18 | TimelineFromJSON,
19 | TimelineFromJSONTyped,
20 | TimelineToJSON,
21 | TimelineToJSONTyped,
22 | } from './Timeline';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface SearchTimeline
28 | */
29 | export interface SearchTimeline {
30 | /**
31 | *
32 | * @type {Timeline}
33 | * @memberof SearchTimeline
34 | */
35 | timeline: Timeline;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the SearchTimeline interface.
40 | */
41 | export function instanceOfSearchTimeline(value: object): value is SearchTimeline {
42 | if (!('timeline' in value) || value['timeline'] === undefined) return false;
43 | return true;
44 | }
45 |
46 | export function SearchTimelineFromJSON(json: any): SearchTimeline {
47 | return SearchTimelineFromJSONTyped(json, false);
48 | }
49 |
50 | export function SearchTimelineFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchTimeline {
51 | if (json == null) {
52 | return json;
53 | }
54 | return {
55 |
56 | 'timeline': TimelineFromJSON(json['timeline']),
57 | };
58 | }
59 |
60 | export function SearchTimelineToJSON(json: any): SearchTimeline {
61 | return SearchTimelineToJSONTyped(json, false);
62 | }
63 |
64 | export function SearchTimelineToJSONTyped(value?: SearchTimeline | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'timeline': TimelineToJSON(value['timeline']),
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/SelfThread.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface SelfThread
20 | */
21 | export interface SelfThread {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof SelfThread
26 | */
27 | idStr: string;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the SelfThread interface.
32 | */
33 | export function instanceOfSelfThread(value: object): value is SelfThread {
34 | if (!('idStr' in value) || value['idStr'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function SelfThreadFromJSON(json: any): SelfThread {
39 | return SelfThreadFromJSONTyped(json, false);
40 | }
41 |
42 | export function SelfThreadFromJSONTyped(json: any, ignoreDiscriminator: boolean): SelfThread {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'idStr': json['id_str'],
49 | };
50 | }
51 |
52 | export function SelfThreadToJSON(json: any): SelfThread {
53 | return SelfThreadToJSONTyped(json, false);
54 | }
55 |
56 | export function SelfThreadToJSONTyped(value?: SelfThread | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'id_str': value['idStr'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/SocialContextUnionType.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 |
16 | /**
17 | *
18 | * @export
19 | */
20 | export const SocialContextUnionType = {
21 | TimelineGeneralContext: 'TimelineGeneralContext',
22 | TimelineTopicContext: 'TimelineTopicContext'
23 | } as const;
24 | export type SocialContextUnionType = typeof SocialContextUnionType[keyof typeof SocialContextUnionType];
25 |
26 |
27 | export function instanceOfSocialContextUnionType(value: any): boolean {
28 | for (const key in SocialContextUnionType) {
29 | if (Object.prototype.hasOwnProperty.call(SocialContextUnionType, key)) {
30 | if (SocialContextUnionType[key as keyof typeof SocialContextUnionType] === value) {
31 | return true;
32 | }
33 | }
34 | }
35 | return false;
36 | }
37 |
38 | export function SocialContextUnionTypeFromJSON(json: any): SocialContextUnionType {
39 | return SocialContextUnionTypeFromJSONTyped(json, false);
40 | }
41 |
42 | export function SocialContextUnionTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): SocialContextUnionType {
43 | return json as SocialContextUnionType;
44 | }
45 |
46 | export function SocialContextUnionTypeToJSON(value?: SocialContextUnionType | null): any {
47 | return value as any;
48 | }
49 |
50 | export function SocialContextUnionTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): SocialContextUnionType {
51 | return value as SocialContextUnionType;
52 | }
53 |
54 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/SuperFollowsReplyUserResultLegacy.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface SuperFollowsReplyUserResultLegacy
20 | */
21 | export interface SuperFollowsReplyUserResultLegacy {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof SuperFollowsReplyUserResultLegacy
26 | */
27 | screenName: string;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the SuperFollowsReplyUserResultLegacy interface.
32 | */
33 | export function instanceOfSuperFollowsReplyUserResultLegacy(value: object): value is SuperFollowsReplyUserResultLegacy {
34 | if (!('screenName' in value) || value['screenName'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function SuperFollowsReplyUserResultLegacyFromJSON(json: any): SuperFollowsReplyUserResultLegacy {
39 | return SuperFollowsReplyUserResultLegacyFromJSONTyped(json, false);
40 | }
41 |
42 | export function SuperFollowsReplyUserResultLegacyFromJSONTyped(json: any, ignoreDiscriminator: boolean): SuperFollowsReplyUserResultLegacy {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'screenName': json['screen_name'],
49 | };
50 | }
51 |
52 | export function SuperFollowsReplyUserResultLegacyToJSON(json: any): SuperFollowsReplyUserResultLegacy {
53 | return SuperFollowsReplyUserResultLegacyToJSONTyped(json, false);
54 | }
55 |
56 | export function SuperFollowsReplyUserResultLegacyToJSONTyped(value?: SuperFollowsReplyUserResultLegacy | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'screen_name': value['screenName'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/Text.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { TextEntity } from './TextEntity';
17 | import {
18 | TextEntityFromJSON,
19 | TextEntityFromJSONTyped,
20 | TextEntityToJSON,
21 | TextEntityToJSONTyped,
22 | } from './TextEntity';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface Text
28 | */
29 | export interface Text {
30 | /**
31 | *
32 | * @type {Array}
33 | * @memberof Text
34 | */
35 | entities: Array;
36 | /**
37 | *
38 | * @type {string}
39 | * @memberof Text
40 | */
41 | text: string;
42 | }
43 |
44 | /**
45 | * Check if a given object implements the Text interface.
46 | */
47 | export function instanceOfText(value: object): value is Text {
48 | if (!('entities' in value) || value['entities'] === undefined) return false;
49 | if (!('text' in value) || value['text'] === undefined) return false;
50 | return true;
51 | }
52 |
53 | export function TextFromJSON(json: any): Text {
54 | return TextFromJSONTyped(json, false);
55 | }
56 |
57 | export function TextFromJSONTyped(json: any, ignoreDiscriminator: boolean): Text {
58 | if (json == null) {
59 | return json;
60 | }
61 | return {
62 |
63 | 'entities': ((json['entities'] as Array).map(TextEntityFromJSON)),
64 | 'text': json['text'],
65 | };
66 | }
67 |
68 | export function TextToJSON(json: any): Text {
69 | return TextToJSONTyped(json, false);
70 | }
71 |
72 | export function TextToJSONTyped(value?: Text | null, ignoreDiscriminator: boolean = false): any {
73 | if (value == null) {
74 | return value;
75 | }
76 |
77 | return {
78 |
79 | 'entities': ((value['entities'] as Array).map(TextEntityToJSON)),
80 | 'text': value['text'],
81 | };
82 | }
83 |
84 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/TextHighlight.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface TextHighlight
20 | */
21 | export interface TextHighlight {
22 | /**
23 | *
24 | * @type {number}
25 | * @memberof TextHighlight
26 | */
27 | endIndex: number;
28 | /**
29 | *
30 | * @type {number}
31 | * @memberof TextHighlight
32 | */
33 | startIndex: number;
34 | }
35 |
36 | /**
37 | * Check if a given object implements the TextHighlight interface.
38 | */
39 | export function instanceOfTextHighlight(value: object): value is TextHighlight {
40 | if (!('endIndex' in value) || value['endIndex'] === undefined) return false;
41 | if (!('startIndex' in value) || value['startIndex'] === undefined) return false;
42 | return true;
43 | }
44 |
45 | export function TextHighlightFromJSON(json: any): TextHighlight {
46 | return TextHighlightFromJSONTyped(json, false);
47 | }
48 |
49 | export function TextHighlightFromJSONTyped(json: any, ignoreDiscriminator: boolean): TextHighlight {
50 | if (json == null) {
51 | return json;
52 | }
53 | return {
54 |
55 | 'endIndex': json['endIndex'],
56 | 'startIndex': json['startIndex'],
57 | };
58 | }
59 |
60 | export function TextHighlightToJSON(json: any): TextHighlight {
61 | return TextHighlightToJSONTyped(json, false);
62 | }
63 |
64 | export function TextHighlightToJSONTyped(value?: TextHighlight | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'endIndex': value['endIndex'],
72 | 'startIndex': value['startIndex'],
73 | };
74 | }
75 |
76 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/TimelineClearCache.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { InstructionType } from './InstructionType';
17 | import {
18 | InstructionTypeFromJSON,
19 | InstructionTypeFromJSONTyped,
20 | InstructionTypeToJSON,
21 | InstructionTypeToJSONTyped,
22 | } from './InstructionType';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface TimelineClearCache
28 | */
29 | export interface TimelineClearCache {
30 | /**
31 | *
32 | * @type {InstructionType}
33 | * @memberof TimelineClearCache
34 | */
35 | type: InstructionType;
36 | }
37 |
38 |
39 |
40 | /**
41 | * Check if a given object implements the TimelineClearCache interface.
42 | */
43 | export function instanceOfTimelineClearCache(value: object): value is TimelineClearCache {
44 | if (!('type' in value) || value['type'] === undefined) return false;
45 | return true;
46 | }
47 |
48 | export function TimelineClearCacheFromJSON(json: any): TimelineClearCache {
49 | return TimelineClearCacheFromJSONTyped(json, false);
50 | }
51 |
52 | export function TimelineClearCacheFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimelineClearCache {
53 | if (json == null) {
54 | return json;
55 | }
56 | return {
57 |
58 | 'type': InstructionTypeFromJSON(json['type']),
59 | };
60 | }
61 |
62 | export function TimelineClearCacheToJSON(json: any): TimelineClearCache {
63 | return TimelineClearCacheToJSONTyped(json, false);
64 | }
65 |
66 | export function TimelineClearCacheToJSONTyped(value?: TimelineClearCache | null, ignoreDiscriminator: boolean = false): any {
67 | if (value == null) {
68 | return value;
69 | }
70 |
71 | return {
72 |
73 | 'type': InstructionTypeToJSON(value['type']),
74 | };
75 | }
76 |
77 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/TimelineCommunity.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { TypeName } from './TypeName';
17 | import {
18 | TypeNameFromJSON,
19 | TypeNameFromJSONTyped,
20 | TypeNameToJSON,
21 | TypeNameToJSONTyped,
22 | } from './TypeName';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface TimelineCommunity
28 | */
29 | export interface TimelineCommunity {
30 | [key: string]: any | any;
31 | /**
32 | *
33 | * @type {TypeName}
34 | * @memberof TimelineCommunity
35 | */
36 | typename?: TypeName;
37 | }
38 |
39 |
40 |
41 | /**
42 | * Check if a given object implements the TimelineCommunity interface.
43 | */
44 | export function instanceOfTimelineCommunity(value: object): value is TimelineCommunity {
45 | return true;
46 | }
47 |
48 | export function TimelineCommunityFromJSON(json: any): TimelineCommunity {
49 | return TimelineCommunityFromJSONTyped(json, false);
50 | }
51 |
52 | export function TimelineCommunityFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimelineCommunity {
53 | if (json == null) {
54 | return json;
55 | }
56 | return {
57 |
58 | ...json,
59 | 'typename': json['__typename'] == null ? undefined : TypeNameFromJSON(json['__typename']),
60 | };
61 | }
62 |
63 | export function TimelineCommunityToJSON(json: any): TimelineCommunity {
64 | return TimelineCommunityToJSONTyped(json, false);
65 | }
66 |
67 | export function TimelineCommunityToJSONTyped(value?: TimelineCommunity | null, ignoreDiscriminator: boolean = false): any {
68 | if (value == null) {
69 | return value;
70 | }
71 |
72 | return {
73 |
74 | ...value,
75 | '__typename': TypeNameToJSON(value['typename']),
76 | };
77 | }
78 |
79 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/TimelineMessagePrompt.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { TypeName } from './TypeName';
17 | import {
18 | TypeNameFromJSON,
19 | TypeNameFromJSONTyped,
20 | TypeNameToJSON,
21 | TypeNameToJSONTyped,
22 | } from './TypeName';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface TimelineMessagePrompt
28 | */
29 | export interface TimelineMessagePrompt {
30 | [key: string]: any | any;
31 | /**
32 | *
33 | * @type {TypeName}
34 | * @memberof TimelineMessagePrompt
35 | */
36 | typename?: TypeName;
37 | }
38 |
39 |
40 |
41 | /**
42 | * Check if a given object implements the TimelineMessagePrompt interface.
43 | */
44 | export function instanceOfTimelineMessagePrompt(value: object): value is TimelineMessagePrompt {
45 | return true;
46 | }
47 |
48 | export function TimelineMessagePromptFromJSON(json: any): TimelineMessagePrompt {
49 | return TimelineMessagePromptFromJSONTyped(json, false);
50 | }
51 |
52 | export function TimelineMessagePromptFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimelineMessagePrompt {
53 | if (json == null) {
54 | return json;
55 | }
56 | return {
57 |
58 | ...json,
59 | 'typename': json['__typename'] == null ? undefined : TypeNameFromJSON(json['__typename']),
60 | };
61 | }
62 |
63 | export function TimelineMessagePromptToJSON(json: any): TimelineMessagePrompt {
64 | return TimelineMessagePromptToJSONTyped(json, false);
65 | }
66 |
67 | export function TimelineMessagePromptToJSONTyped(value?: TimelineMessagePrompt | null, ignoreDiscriminator: boolean = false): any {
68 | if (value == null) {
69 | return value;
70 | }
71 |
72 | return {
73 |
74 | ...value,
75 | '__typename': TypeNameToJSON(value['typename']),
76 | };
77 | }
78 |
79 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/TimelinePrompt.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { TypeName } from './TypeName';
17 | import {
18 | TypeNameFromJSON,
19 | TypeNameFromJSONTyped,
20 | TypeNameToJSON,
21 | TypeNameToJSONTyped,
22 | } from './TypeName';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface TimelinePrompt
28 | */
29 | export interface TimelinePrompt {
30 | [key: string]: any | any;
31 | /**
32 | *
33 | * @type {TypeName}
34 | * @memberof TimelinePrompt
35 | */
36 | typename?: TypeName;
37 | }
38 |
39 |
40 |
41 | /**
42 | * Check if a given object implements the TimelinePrompt interface.
43 | */
44 | export function instanceOfTimelinePrompt(value: object): value is TimelinePrompt {
45 | return true;
46 | }
47 |
48 | export function TimelinePromptFromJSON(json: any): TimelinePrompt {
49 | return TimelinePromptFromJSONTyped(json, false);
50 | }
51 |
52 | export function TimelinePromptFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimelinePrompt {
53 | if (json == null) {
54 | return json;
55 | }
56 | return {
57 |
58 | ...json,
59 | 'typename': json['__typename'] == null ? undefined : TypeNameFromJSON(json['__typename']),
60 | };
61 | }
62 |
63 | export function TimelinePromptToJSON(json: any): TimelinePrompt {
64 | return TimelinePromptToJSONTyped(json, false);
65 | }
66 |
67 | export function TimelinePromptToJSONTyped(value?: TimelinePrompt | null, ignoreDiscriminator: boolean = false): any {
68 | if (value == null) {
69 | return value;
70 | }
71 |
72 | return {
73 |
74 | ...value,
75 | '__typename': TypeNameToJSON(value['typename']),
76 | };
77 | }
78 |
79 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/TimelineResult.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { Timeline } from './Timeline';
17 | import {
18 | TimelineFromJSON,
19 | TimelineFromJSONTyped,
20 | TimelineToJSON,
21 | TimelineToJSONTyped,
22 | } from './Timeline';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface TimelineResult
28 | */
29 | export interface TimelineResult {
30 | /**
31 | *
32 | * @type {string}
33 | * @memberof TimelineResult
34 | */
35 | id?: string;
36 | /**
37 | *
38 | * @type {Timeline}
39 | * @memberof TimelineResult
40 | */
41 | timeline?: Timeline;
42 | }
43 |
44 | /**
45 | * Check if a given object implements the TimelineResult interface.
46 | */
47 | export function instanceOfTimelineResult(value: object): value is TimelineResult {
48 | return true;
49 | }
50 |
51 | export function TimelineResultFromJSON(json: any): TimelineResult {
52 | return TimelineResultFromJSONTyped(json, false);
53 | }
54 |
55 | export function TimelineResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimelineResult {
56 | if (json == null) {
57 | return json;
58 | }
59 | return {
60 |
61 | 'id': json['id'] == null ? undefined : json['id'],
62 | 'timeline': json['timeline'] == null ? undefined : TimelineFromJSON(json['timeline']),
63 | };
64 | }
65 |
66 | export function TimelineResultToJSON(json: any): TimelineResult {
67 | return TimelineResultToJSONTyped(json, false);
68 | }
69 |
70 | export function TimelineResultToJSONTyped(value?: TimelineResult | null, ignoreDiscriminator: boolean = false): any {
71 | if (value == null) {
72 | return value;
73 | }
74 |
75 | return {
76 |
77 | 'id': value['id'],
78 | 'timeline': TimelineToJSON(value['timeline']),
79 | };
80 | }
81 |
82 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/Tracing.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface Tracing
20 | */
21 | export interface Tracing {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof Tracing
26 | */
27 | traceId: string;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the Tracing interface.
32 | */
33 | export function instanceOfTracing(value: object): value is Tracing {
34 | if (!('traceId' in value) || value['traceId'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function TracingFromJSON(json: any): Tracing {
39 | return TracingFromJSONTyped(json, false);
40 | }
41 |
42 | export function TracingFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tracing {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'traceId': json['trace_id'],
49 | };
50 | }
51 |
52 | export function TracingToJSON(json: any): Tracing {
53 | return TracingToJSONTyped(json, false);
54 | }
55 |
56 | export function TracingToJSONTyped(value?: Tracing | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'trace_id': value['traceId'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/TrendImage.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface TrendImage
20 | */
21 | export interface TrendImage {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof TrendImage
26 | */
27 | url?: string;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the TrendImage interface.
32 | */
33 | export function instanceOfTrendImage(value: object): value is TrendImage {
34 | return true;
35 | }
36 |
37 | export function TrendImageFromJSON(json: any): TrendImage {
38 | return TrendImageFromJSONTyped(json, false);
39 | }
40 |
41 | export function TrendImageFromJSONTyped(json: any, ignoreDiscriminator: boolean): TrendImage {
42 | if (json == null) {
43 | return json;
44 | }
45 | return {
46 |
47 | 'url': json['url'] == null ? undefined : json['url'],
48 | };
49 | }
50 |
51 | export function TrendImageToJSON(json: any): TrendImage {
52 | return TrendImageToJSONTyped(json, false);
53 | }
54 |
55 | export function TrendImageToJSONTyped(value?: TrendImage | null, ignoreDiscriminator: boolean = false): any {
56 | if (value == null) {
57 | return value;
58 | }
59 |
60 | return {
61 |
62 | 'url': value['url'],
63 | };
64 | }
65 |
66 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/TrendMetadata.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { SocialContextLandingUrl } from './SocialContextLandingUrl';
17 | import {
18 | SocialContextLandingUrlFromJSON,
19 | SocialContextLandingUrlFromJSONTyped,
20 | SocialContextLandingUrlToJSON,
21 | SocialContextLandingUrlToJSONTyped,
22 | } from './SocialContextLandingUrl';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface TrendMetadata
28 | */
29 | export interface TrendMetadata {
30 | /**
31 | *
32 | * @type {SocialContextLandingUrl}
33 | * @memberof TrendMetadata
34 | */
35 | url?: SocialContextLandingUrl;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the TrendMetadata interface.
40 | */
41 | export function instanceOfTrendMetadata(value: object): value is TrendMetadata {
42 | return true;
43 | }
44 |
45 | export function TrendMetadataFromJSON(json: any): TrendMetadata {
46 | return TrendMetadataFromJSONTyped(json, false);
47 | }
48 |
49 | export function TrendMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): TrendMetadata {
50 | if (json == null) {
51 | return json;
52 | }
53 | return {
54 |
55 | 'url': json['url'] == null ? undefined : SocialContextLandingUrlFromJSON(json['url']),
56 | };
57 | }
58 |
59 | export function TrendMetadataToJSON(json: any): TrendMetadata {
60 | return TrendMetadataToJSONTyped(json, false);
61 | }
62 |
63 | export function TrendMetadataToJSONTyped(value?: TrendMetadata | null, ignoreDiscriminator: boolean = false): any {
64 | if (value == null) {
65 | return value;
66 | }
67 |
68 | return {
69 |
70 | 'url': SocialContextLandingUrlToJSON(value['url']),
71 | };
72 | }
73 |
74 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/TrendResults.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface TrendResults
20 | */
21 | export interface TrendResults {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof TrendResults
26 | */
27 | restId: string;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the TrendResults interface.
32 | */
33 | export function instanceOfTrendResults(value: object): value is TrendResults {
34 | if (!('restId' in value) || value['restId'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function TrendResultsFromJSON(json: any): TrendResults {
39 | return TrendResultsFromJSONTyped(json, false);
40 | }
41 |
42 | export function TrendResultsFromJSONTyped(json: any, ignoreDiscriminator: boolean): TrendResults {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'restId': json['rest_id'],
49 | };
50 | }
51 |
52 | export function TrendResultsToJSON(json: any): TrendResults {
53 | return TrendResultsToJSONTyped(json, false);
54 | }
55 |
56 | export function TrendResultsToJSONTyped(value?: TrendResults | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'rest_id': value['restId'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/TweetCard.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { TweetCardLegacy } from './TweetCardLegacy';
17 | import {
18 | TweetCardLegacyFromJSON,
19 | TweetCardLegacyFromJSONTyped,
20 | TweetCardLegacyToJSON,
21 | TweetCardLegacyToJSONTyped,
22 | } from './TweetCardLegacy';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface TweetCard
28 | */
29 | export interface TweetCard {
30 | /**
31 | *
32 | * @type {TweetCardLegacy}
33 | * @memberof TweetCard
34 | */
35 | legacy?: TweetCardLegacy;
36 | /**
37 | *
38 | * @type {string}
39 | * @memberof TweetCard
40 | */
41 | restId?: string;
42 | }
43 |
44 | /**
45 | * Check if a given object implements the TweetCard interface.
46 | */
47 | export function instanceOfTweetCard(value: object): value is TweetCard {
48 | return true;
49 | }
50 |
51 | export function TweetCardFromJSON(json: any): TweetCard {
52 | return TweetCardFromJSONTyped(json, false);
53 | }
54 |
55 | export function TweetCardFromJSONTyped(json: any, ignoreDiscriminator: boolean): TweetCard {
56 | if (json == null) {
57 | return json;
58 | }
59 | return {
60 |
61 | 'legacy': json['legacy'] == null ? undefined : TweetCardLegacyFromJSON(json['legacy']),
62 | 'restId': json['rest_id'] == null ? undefined : json['rest_id'],
63 | };
64 | }
65 |
66 | export function TweetCardToJSON(json: any): TweetCard {
67 | return TweetCardToJSONTyped(json, false);
68 | }
69 |
70 | export function TweetCardToJSONTyped(value?: TweetCard | null, ignoreDiscriminator: boolean = false): any {
71 | if (value == null) {
72 | return value;
73 | }
74 |
75 | return {
76 |
77 | 'legacy': TweetCardLegacyToJSON(value['legacy']),
78 | 'rest_id': value['restId'],
79 | };
80 | }
81 |
82 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/TweetCardPlatformDevice.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface TweetCardPlatformDevice
20 | */
21 | export interface TweetCardPlatformDevice {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof TweetCardPlatformDevice
26 | */
27 | name: string;
28 | /**
29 | *
30 | * @type {string}
31 | * @memberof TweetCardPlatformDevice
32 | */
33 | version: string;
34 | }
35 |
36 | /**
37 | * Check if a given object implements the TweetCardPlatformDevice interface.
38 | */
39 | export function instanceOfTweetCardPlatformDevice(value: object): value is TweetCardPlatformDevice {
40 | if (!('name' in value) || value['name'] === undefined) return false;
41 | if (!('version' in value) || value['version'] === undefined) return false;
42 | return true;
43 | }
44 |
45 | export function TweetCardPlatformDeviceFromJSON(json: any): TweetCardPlatformDevice {
46 | return TweetCardPlatformDeviceFromJSONTyped(json, false);
47 | }
48 |
49 | export function TweetCardPlatformDeviceFromJSONTyped(json: any, ignoreDiscriminator: boolean): TweetCardPlatformDevice {
50 | if (json == null) {
51 | return json;
52 | }
53 | return {
54 |
55 | 'name': json['name'],
56 | 'version': json['version'],
57 | };
58 | }
59 |
60 | export function TweetCardPlatformDeviceToJSON(json: any): TweetCardPlatformDevice {
61 | return TweetCardPlatformDeviceToJSONTyped(json, false);
62 | }
63 |
64 | export function TweetCardPlatformDeviceToJSONTyped(value?: TweetCardPlatformDevice | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'name': value['name'],
72 | 'version': value['version'],
73 | };
74 | }
75 |
76 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/TweetEditPrespective.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface TweetEditPrespective
20 | */
21 | export interface TweetEditPrespective {
22 | /**
23 | *
24 | * @type {boolean}
25 | * @memberof TweetEditPrespective
26 | */
27 | favorited?: boolean;
28 | /**
29 | *
30 | * @type {boolean}
31 | * @memberof TweetEditPrespective
32 | */
33 | retweeted?: boolean;
34 | }
35 |
36 | /**
37 | * Check if a given object implements the TweetEditPrespective interface.
38 | */
39 | export function instanceOfTweetEditPrespective(value: object): value is TweetEditPrespective {
40 | return true;
41 | }
42 |
43 | export function TweetEditPrespectiveFromJSON(json: any): TweetEditPrespective {
44 | return TweetEditPrespectiveFromJSONTyped(json, false);
45 | }
46 |
47 | export function TweetEditPrespectiveFromJSONTyped(json: any, ignoreDiscriminator: boolean): TweetEditPrespective {
48 | if (json == null) {
49 | return json;
50 | }
51 | return {
52 |
53 | 'favorited': json['favorited'] == null ? undefined : json['favorited'],
54 | 'retweeted': json['retweeted'] == null ? undefined : json['retweeted'],
55 | };
56 | }
57 |
58 | export function TweetEditPrespectiveToJSON(json: any): TweetEditPrespective {
59 | return TweetEditPrespectiveToJSONTyped(json, false);
60 | }
61 |
62 | export function TweetEditPrespectiveToJSONTyped(value?: TweetEditPrespective | null, ignoreDiscriminator: boolean = false): any {
63 | if (value == null) {
64 | return value;
65 | }
66 |
67 | return {
68 |
69 | 'favorited': value['favorited'],
70 | 'retweeted': value['retweeted'],
71 | };
72 | }
73 |
74 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/TweetLegacyScopes.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface TweetLegacyScopes
20 | */
21 | export interface TweetLegacyScopes {
22 | /**
23 | *
24 | * @type {boolean}
25 | * @memberof TweetLegacyScopes
26 | */
27 | followers: boolean;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the TweetLegacyScopes interface.
32 | */
33 | export function instanceOfTweetLegacyScopes(value: object): value is TweetLegacyScopes {
34 | if (!('followers' in value) || value['followers'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function TweetLegacyScopesFromJSON(json: any): TweetLegacyScopes {
39 | return TweetLegacyScopesFromJSONTyped(json, false);
40 | }
41 |
42 | export function TweetLegacyScopesFromJSONTyped(json: any, ignoreDiscriminator: boolean): TweetLegacyScopes {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'followers': json['followers'],
49 | };
50 | }
51 |
52 | export function TweetLegacyScopesToJSON(json: any): TweetLegacyScopes {
53 | return TweetLegacyScopesToJSONTyped(json, false);
54 | }
55 |
56 | export function TweetLegacyScopesToJSONTyped(value?: TweetLegacyScopes | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'followers': value['followers'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/TweetPreviewDisplayTweetViewCount.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface TweetPreviewDisplayTweetViewCount
20 | */
21 | export interface TweetPreviewDisplayTweetViewCount {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof TweetPreviewDisplayTweetViewCount
26 | */
27 | count: string;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the TweetPreviewDisplayTweetViewCount interface.
32 | */
33 | export function instanceOfTweetPreviewDisplayTweetViewCount(value: object): value is TweetPreviewDisplayTweetViewCount {
34 | if (!('count' in value) || value['count'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function TweetPreviewDisplayTweetViewCountFromJSON(json: any): TweetPreviewDisplayTweetViewCount {
39 | return TweetPreviewDisplayTweetViewCountFromJSONTyped(json, false);
40 | }
41 |
42 | export function TweetPreviewDisplayTweetViewCountFromJSONTyped(json: any, ignoreDiscriminator: boolean): TweetPreviewDisplayTweetViewCount {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'count': json['count'],
49 | };
50 | }
51 |
52 | export function TweetPreviewDisplayTweetViewCountToJSON(json: any): TweetPreviewDisplayTweetViewCount {
53 | return TweetPreviewDisplayTweetViewCountToJSONTyped(json, false);
54 | }
55 |
56 | export function TweetPreviewDisplayTweetViewCountToJSONTyped(value?: TweetPreviewDisplayTweetViewCount | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'count': value['count'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/TweetResultByRestIdData.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { ItemResult } from './ItemResult';
17 | import {
18 | ItemResultFromJSON,
19 | ItemResultFromJSONTyped,
20 | ItemResultToJSON,
21 | ItemResultToJSONTyped,
22 | } from './ItemResult';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface TweetResultByRestIdData
28 | */
29 | export interface TweetResultByRestIdData {
30 | /**
31 | *
32 | * @type {ItemResult}
33 | * @memberof TweetResultByRestIdData
34 | */
35 | tweetResult?: ItemResult;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the TweetResultByRestIdData interface.
40 | */
41 | export function instanceOfTweetResultByRestIdData(value: object): value is TweetResultByRestIdData {
42 | return true;
43 | }
44 |
45 | export function TweetResultByRestIdDataFromJSON(json: any): TweetResultByRestIdData {
46 | return TweetResultByRestIdDataFromJSONTyped(json, false);
47 | }
48 |
49 | export function TweetResultByRestIdDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): TweetResultByRestIdData {
50 | if (json == null) {
51 | return json;
52 | }
53 | return {
54 |
55 | 'tweetResult': json['tweetResult'] == null ? undefined : ItemResultFromJSON(json['tweetResult']),
56 | };
57 | }
58 |
59 | export function TweetResultByRestIdDataToJSON(json: any): TweetResultByRestIdData {
60 | return TweetResultByRestIdDataToJSONTyped(json, false);
61 | }
62 |
63 | export function TweetResultByRestIdDataToJSONTyped(value?: TweetResultByRestIdData | null, ignoreDiscriminator: boolean = false): any {
64 | if (value == null) {
65 | return value;
66 | }
67 |
68 | return {
69 |
70 | 'tweetResult': ItemResultToJSON(value['tweetResult']),
71 | };
72 | }
73 |
74 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/TweetTombstone.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { TypeName } from './TypeName';
17 | import {
18 | TypeNameFromJSON,
19 | TypeNameFromJSONTyped,
20 | TypeNameToJSON,
21 | TypeNameToJSONTyped,
22 | } from './TypeName';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface TweetTombstone
28 | */
29 | export interface TweetTombstone {
30 | [key: string]: any | any;
31 | /**
32 | *
33 | * @type {TypeName}
34 | * @memberof TweetTombstone
35 | */
36 | typename?: TypeName;
37 | }
38 |
39 |
40 |
41 | /**
42 | * Check if a given object implements the TweetTombstone interface.
43 | */
44 | export function instanceOfTweetTombstone(value: object): value is TweetTombstone {
45 | return true;
46 | }
47 |
48 | export function TweetTombstoneFromJSON(json: any): TweetTombstone {
49 | return TweetTombstoneFromJSONTyped(json, false);
50 | }
51 |
52 | export function TweetTombstoneFromJSONTyped(json: any, ignoreDiscriminator: boolean): TweetTombstone {
53 | if (json == null) {
54 | return json;
55 | }
56 | return {
57 |
58 | ...json,
59 | 'typename': json['__typename'] == null ? undefined : TypeNameFromJSON(json['__typename']),
60 | };
61 | }
62 |
63 | export function TweetTombstoneToJSON(json: any): TweetTombstone {
64 | return TweetTombstoneToJSONTyped(json, false);
65 | }
66 |
67 | export function TweetTombstoneToJSONTyped(value?: TweetTombstone | null, ignoreDiscriminator: boolean = false): any {
68 | if (value == null) {
69 | return value;
70 | }
71 |
72 | return {
73 |
74 | ...value,
75 | '__typename': TypeNameToJSON(value['typename']),
76 | };
77 | }
78 |
79 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/TweetView.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface TweetView
20 | */
21 | export interface TweetView {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof TweetView
26 | */
27 | count?: string;
28 | /**
29 | *
30 | * @type {string}
31 | * @memberof TweetView
32 | */
33 | state: TweetViewStateEnum;
34 | }
35 |
36 |
37 | /**
38 | * @export
39 | */
40 | export const TweetViewStateEnum = {
41 | Enabled: 'Enabled',
42 | EnabledWithCount: 'EnabledWithCount'
43 | } as const;
44 | export type TweetViewStateEnum = typeof TweetViewStateEnum[keyof typeof TweetViewStateEnum];
45 |
46 |
47 | /**
48 | * Check if a given object implements the TweetView interface.
49 | */
50 | export function instanceOfTweetView(value: object): value is TweetView {
51 | if (!('state' in value) || value['state'] === undefined) return false;
52 | return true;
53 | }
54 |
55 | export function TweetViewFromJSON(json: any): TweetView {
56 | return TweetViewFromJSONTyped(json, false);
57 | }
58 |
59 | export function TweetViewFromJSONTyped(json: any, ignoreDiscriminator: boolean): TweetView {
60 | if (json == null) {
61 | return json;
62 | }
63 | return {
64 |
65 | 'count': json['count'] == null ? undefined : json['count'],
66 | 'state': json['state'],
67 | };
68 | }
69 |
70 | export function TweetViewToJSON(json: any): TweetView {
71 | return TweetViewToJSONTyped(json, false);
72 | }
73 |
74 | export function TweetViewToJSONTyped(value?: TweetView | null, ignoreDiscriminator: boolean = false): any {
75 | if (value == null) {
76 | return value;
77 | }
78 |
79 | return {
80 |
81 | 'count': value['count'],
82 | 'state': value['state'],
83 | };
84 | }
85 |
86 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/UnfavoriteTweet.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface UnfavoriteTweet
20 | */
21 | export interface UnfavoriteTweet {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof UnfavoriteTweet
26 | */
27 | unfavoriteTweet?: string;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the UnfavoriteTweet interface.
32 | */
33 | export function instanceOfUnfavoriteTweet(value: object): value is UnfavoriteTweet {
34 | return true;
35 | }
36 |
37 | export function UnfavoriteTweetFromJSON(json: any): UnfavoriteTweet {
38 | return UnfavoriteTweetFromJSONTyped(json, false);
39 | }
40 |
41 | export function UnfavoriteTweetFromJSONTyped(json: any, ignoreDiscriminator: boolean): UnfavoriteTweet {
42 | if (json == null) {
43 | return json;
44 | }
45 | return {
46 |
47 | 'unfavoriteTweet': json['unfavorite_tweet'] == null ? undefined : json['unfavorite_tweet'],
48 | };
49 | }
50 |
51 | export function UnfavoriteTweetToJSON(json: any): UnfavoriteTweet {
52 | return UnfavoriteTweetToJSONTyped(json, false);
53 | }
54 |
55 | export function UnfavoriteTweetToJSONTyped(value?: UnfavoriteTweet | null, ignoreDiscriminator: boolean = false): any {
56 | if (value == null) {
57 | return value;
58 | }
59 |
60 | return {
61 |
62 | 'unfavorite_tweet': value['unfavoriteTweet'],
63 | };
64 | }
65 |
66 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/UnifiedCard.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface UnifiedCard
20 | */
21 | export interface UnifiedCard {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof UnifiedCard
26 | */
27 | cardFetchState: UnifiedCardCardFetchStateEnum;
28 | }
29 |
30 |
31 | /**
32 | * @export
33 | */
34 | export const UnifiedCardCardFetchStateEnum = {
35 | NoCard: 'NoCard'
36 | } as const;
37 | export type UnifiedCardCardFetchStateEnum = typeof UnifiedCardCardFetchStateEnum[keyof typeof UnifiedCardCardFetchStateEnum];
38 |
39 |
40 | /**
41 | * Check if a given object implements the UnifiedCard interface.
42 | */
43 | export function instanceOfUnifiedCard(value: object): value is UnifiedCard {
44 | if (!('cardFetchState' in value) || value['cardFetchState'] === undefined) return false;
45 | return true;
46 | }
47 |
48 | export function UnifiedCardFromJSON(json: any): UnifiedCard {
49 | return UnifiedCardFromJSONTyped(json, false);
50 | }
51 |
52 | export function UnifiedCardFromJSONTyped(json: any, ignoreDiscriminator: boolean): UnifiedCard {
53 | if (json == null) {
54 | return json;
55 | }
56 | return {
57 |
58 | 'cardFetchState': json['card_fetch_state'],
59 | };
60 | }
61 |
62 | export function UnifiedCardToJSON(json: any): UnifiedCard {
63 | return UnifiedCardToJSONTyped(json, false);
64 | }
65 |
66 | export function UnifiedCardToJSONTyped(value?: UnifiedCard | null, ignoreDiscriminator: boolean = false): any {
67 | if (value == null) {
68 | return value;
69 | }
70 |
71 | return {
72 |
73 | 'card_fetch_state': value['cardFetchState'],
74 | };
75 | }
76 |
77 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/UrtEndpointRequestParams.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface UrtEndpointRequestParams
20 | */
21 | export interface UrtEndpointRequestParams {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof UrtEndpointRequestParams
26 | */
27 | key: string;
28 | /**
29 | *
30 | * @type {string}
31 | * @memberof UrtEndpointRequestParams
32 | */
33 | value: string;
34 | }
35 |
36 | /**
37 | * Check if a given object implements the UrtEndpointRequestParams interface.
38 | */
39 | export function instanceOfUrtEndpointRequestParams(value: object): value is UrtEndpointRequestParams {
40 | if (!('key' in value) || value['key'] === undefined) return false;
41 | if (!('value' in value) || value['value'] === undefined) return false;
42 | return true;
43 | }
44 |
45 | export function UrtEndpointRequestParamsFromJSON(json: any): UrtEndpointRequestParams {
46 | return UrtEndpointRequestParamsFromJSONTyped(json, false);
47 | }
48 |
49 | export function UrtEndpointRequestParamsFromJSONTyped(json: any, ignoreDiscriminator: boolean): UrtEndpointRequestParams {
50 | if (json == null) {
51 | return json;
52 | }
53 | return {
54 |
55 | 'key': json['key'],
56 | 'value': json['value'],
57 | };
58 | }
59 |
60 | export function UrtEndpointRequestParamsToJSON(json: any): UrtEndpointRequestParams {
61 | return UrtEndpointRequestParamsToJSONTyped(json, false);
62 | }
63 |
64 | export function UrtEndpointRequestParamsToJSONTyped(value?: UrtEndpointRequestParams | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'key': value['key'],
72 | 'value': value['value'],
73 | };
74 | }
75 |
76 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/UserFeatures.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface UserFeatures
20 | */
21 | export interface UserFeatures {
22 | /**
23 | *
24 | * @type {boolean}
25 | * @memberof UserFeatures
26 | */
27 | mediatoolStudioLibrary: boolean;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the UserFeatures interface.
32 | */
33 | export function instanceOfUserFeatures(value: object): value is UserFeatures {
34 | if (!('mediatoolStudioLibrary' in value) || value['mediatoolStudioLibrary'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function UserFeaturesFromJSON(json: any): UserFeatures {
39 | return UserFeaturesFromJSONTyped(json, false);
40 | }
41 |
42 | export function UserFeaturesFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserFeatures {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'mediatoolStudioLibrary': json['mediatool_studio_library'],
49 | };
50 | }
51 |
52 | export function UserFeaturesToJSON(json: any): UserFeatures {
53 | return UserFeaturesToJSONTyped(json, false);
54 | }
55 |
56 | export function UserFeaturesToJSONTyped(value?: UserFeatures | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'mediatool_studio_library': value['mediatoolStudioLibrary'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/UserResponseData.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { UserResults } from './UserResults';
17 | import {
18 | UserResultsFromJSON,
19 | UserResultsFromJSONTyped,
20 | UserResultsToJSON,
21 | UserResultsToJSONTyped,
22 | } from './UserResults';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface UserResponseData
28 | */
29 | export interface UserResponseData {
30 | /**
31 | *
32 | * @type {UserResults}
33 | * @memberof UserResponseData
34 | */
35 | user?: UserResults;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the UserResponseData interface.
40 | */
41 | export function instanceOfUserResponseData(value: object): value is UserResponseData {
42 | return true;
43 | }
44 |
45 | export function UserResponseDataFromJSON(json: any): UserResponseData {
46 | return UserResponseDataFromJSONTyped(json, false);
47 | }
48 |
49 | export function UserResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserResponseData {
50 | if (json == null) {
51 | return json;
52 | }
53 | return {
54 |
55 | 'user': json['user'] == null ? undefined : UserResultsFromJSON(json['user']),
56 | };
57 | }
58 |
59 | export function UserResponseDataToJSON(json: any): UserResponseData {
60 | return UserResponseDataToJSONTyped(json, false);
61 | }
62 |
63 | export function UserResponseDataToJSONTyped(value?: UserResponseData | null, ignoreDiscriminator: boolean = false): any {
64 | if (value == null) {
65 | return value;
66 | }
67 |
68 | return {
69 |
70 | 'user': UserResultsToJSON(value['user']),
71 | };
72 | }
73 |
74 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/UserResultCore.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { UserResults } from './UserResults';
17 | import {
18 | UserResultsFromJSON,
19 | UserResultsFromJSONTyped,
20 | UserResultsToJSON,
21 | UserResultsToJSONTyped,
22 | } from './UserResults';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface UserResultCore
28 | */
29 | export interface UserResultCore {
30 | /**
31 | *
32 | * @type {UserResults}
33 | * @memberof UserResultCore
34 | */
35 | userResults: UserResults;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the UserResultCore interface.
40 | */
41 | export function instanceOfUserResultCore(value: object): value is UserResultCore {
42 | if (!('userResults' in value) || value['userResults'] === undefined) return false;
43 | return true;
44 | }
45 |
46 | export function UserResultCoreFromJSON(json: any): UserResultCore {
47 | return UserResultCoreFromJSONTyped(json, false);
48 | }
49 |
50 | export function UserResultCoreFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserResultCore {
51 | if (json == null) {
52 | return json;
53 | }
54 | return {
55 |
56 | 'userResults': UserResultsFromJSON(json['user_results']),
57 | };
58 | }
59 |
60 | export function UserResultCoreToJSON(json: any): UserResultCore {
61 | return UserResultCoreToJSONTyped(json, false);
62 | }
63 |
64 | export function UserResultCoreToJSONTyped(value?: UserResultCore | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'user_results': UserResultsToJSON(value['userResults']),
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/UserResults.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { UserUnion } from './UserUnion';
17 | import {
18 | UserUnionFromJSON,
19 | UserUnionFromJSONTyped,
20 | UserUnionToJSON,
21 | UserUnionToJSONTyped,
22 | } from './UserUnion';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface UserResults
28 | */
29 | export interface UserResults {
30 | /**
31 | *
32 | * @type {UserUnion}
33 | * @memberof UserResults
34 | */
35 | result?: UserUnion;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the UserResults interface.
40 | */
41 | export function instanceOfUserResults(value: object): value is UserResults {
42 | return true;
43 | }
44 |
45 | export function UserResultsFromJSON(json: any): UserResults {
46 | return UserResultsFromJSONTyped(json, false);
47 | }
48 |
49 | export function UserResultsFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserResults {
50 | if (json == null) {
51 | return json;
52 | }
53 | return {
54 |
55 | 'result': json['result'] == null ? undefined : UserUnionFromJSON(json['result']),
56 | };
57 | }
58 |
59 | export function UserResultsToJSON(json: any): UserResults {
60 | return UserResultsToJSONTyped(json, false);
61 | }
62 |
63 | export function UserResultsToJSONTyped(value?: UserResults | null, ignoreDiscriminator: boolean = false): any {
64 | if (value == null) {
65 | return value;
66 | }
67 |
68 | return {
69 |
70 | 'result': UserUnionToJSON(value['result']),
71 | };
72 | }
73 |
74 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/UserTweetsData.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { UserTweetsUser } from './UserTweetsUser';
17 | import {
18 | UserTweetsUserFromJSON,
19 | UserTweetsUserFromJSONTyped,
20 | UserTweetsUserToJSON,
21 | UserTweetsUserToJSONTyped,
22 | } from './UserTweetsUser';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface UserTweetsData
28 | */
29 | export interface UserTweetsData {
30 | /**
31 | *
32 | * @type {UserTweetsUser}
33 | * @memberof UserTweetsData
34 | */
35 | user?: UserTweetsUser;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the UserTweetsData interface.
40 | */
41 | export function instanceOfUserTweetsData(value: object): value is UserTweetsData {
42 | return true;
43 | }
44 |
45 | export function UserTweetsDataFromJSON(json: any): UserTweetsData {
46 | return UserTweetsDataFromJSONTyped(json, false);
47 | }
48 |
49 | export function UserTweetsDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserTweetsData {
50 | if (json == null) {
51 | return json;
52 | }
53 | return {
54 |
55 | 'user': json['user'] == null ? undefined : UserTweetsUserFromJSON(json['user']),
56 | };
57 | }
58 |
59 | export function UserTweetsDataToJSON(json: any): UserTweetsData {
60 | return UserTweetsDataToJSONTyped(json, false);
61 | }
62 |
63 | export function UserTweetsDataToJSONTyped(value?: UserTweetsData | null, ignoreDiscriminator: boolean = false): any {
64 | if (value == null) {
65 | return value;
66 | }
67 |
68 | return {
69 |
70 | 'user': UserTweetsUserToJSON(value['user']),
71 | };
72 | }
73 |
74 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/UserTweetsUser.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { UserTweetsResultV1 } from './UserTweetsResultV1';
17 | import {
18 | UserTweetsResultV1FromJSON,
19 | UserTweetsResultV1FromJSONTyped,
20 | UserTweetsResultV1ToJSON,
21 | UserTweetsResultV1ToJSONTyped,
22 | } from './UserTweetsResultV1';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface UserTweetsUser
28 | */
29 | export interface UserTweetsUser {
30 | /**
31 | *
32 | * @type {UserTweetsResultV1}
33 | * @memberof UserTweetsUser
34 | */
35 | result: UserTweetsResultV1;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the UserTweetsUser interface.
40 | */
41 | export function instanceOfUserTweetsUser(value: object): value is UserTweetsUser {
42 | if (!('result' in value) || value['result'] === undefined) return false;
43 | return true;
44 | }
45 |
46 | export function UserTweetsUserFromJSON(json: any): UserTweetsUser {
47 | return UserTweetsUserFromJSONTyped(json, false);
48 | }
49 |
50 | export function UserTweetsUserFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserTweetsUser {
51 | if (json == null) {
52 | return json;
53 | }
54 | return {
55 |
56 | 'result': UserTweetsResultV1FromJSON(json['result']),
57 | };
58 | }
59 |
60 | export function UserTweetsUserToJSON(json: any): UserTweetsUser {
61 | return UserTweetsUserToJSONTyped(json, false);
62 | }
63 |
64 | export function UserTweetsUserToJSONTyped(value?: UserTweetsUser | null, ignoreDiscriminator: boolean = false): any {
65 | if (value == null) {
66 | return value;
67 | }
68 |
69 | return {
70 |
71 | 'result': UserTweetsResultV1ToJSON(value['result']),
72 | };
73 | }
74 |
75 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/UserValue.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | /**
17 | *
18 | * @export
19 | * @interface UserValue
20 | */
21 | export interface UserValue {
22 | /**
23 | *
24 | * @type {string}
25 | * @memberof UserValue
26 | */
27 | idStr: string;
28 | }
29 |
30 | /**
31 | * Check if a given object implements the UserValue interface.
32 | */
33 | export function instanceOfUserValue(value: object): value is UserValue {
34 | if (!('idStr' in value) || value['idStr'] === undefined) return false;
35 | return true;
36 | }
37 |
38 | export function UserValueFromJSON(json: any): UserValue {
39 | return UserValueFromJSONTyped(json, false);
40 | }
41 |
42 | export function UserValueFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserValue {
43 | if (json == null) {
44 | return json;
45 | }
46 | return {
47 |
48 | 'idStr': json['id_str'],
49 | };
50 | }
51 |
52 | export function UserValueToJSON(json: any): UserValue {
53 | return UserValueToJSONTyped(json, false);
54 | }
55 |
56 | export function UserValueToJSONTyped(value?: UserValue | null, ignoreDiscriminator: boolean = false): any {
57 | if (value == null) {
58 | return value;
59 | }
60 |
61 | return {
62 |
63 | 'id_str': value['idStr'],
64 | };
65 | }
66 |
67 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/src/models/UsersResponseData.ts:
--------------------------------------------------------------------------------
1 | /* tslint:disable */
2 | /* eslint-disable */
3 | /**
4 | * Twitter OpenAPI
5 | * Twitter OpenAPI(Swagger) specification
6 | *
7 | * The version of the OpenAPI document: 0.0.1
8 | * Contact: yuki@yuki0311.com
9 | *
10 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11 | * https://openapi-generator.tech
12 | * Do not edit the class manually.
13 | */
14 |
15 | import { mapValues } from '../runtime';
16 | import type { UserResults } from './UserResults';
17 | import {
18 | UserResultsFromJSON,
19 | UserResultsFromJSONTyped,
20 | UserResultsToJSON,
21 | UserResultsToJSONTyped,
22 | } from './UserResults';
23 |
24 | /**
25 | *
26 | * @export
27 | * @interface UsersResponseData
28 | */
29 | export interface UsersResponseData {
30 | /**
31 | *
32 | * @type {Array}
33 | * @memberof UsersResponseData
34 | */
35 | users?: Array;
36 | }
37 |
38 | /**
39 | * Check if a given object implements the UsersResponseData interface.
40 | */
41 | export function instanceOfUsersResponseData(value: object): value is UsersResponseData {
42 | return true;
43 | }
44 |
45 | export function UsersResponseDataFromJSON(json: any): UsersResponseData {
46 | return UsersResponseDataFromJSONTyped(json, false);
47 | }
48 |
49 | export function UsersResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsersResponseData {
50 | if (json == null) {
51 | return json;
52 | }
53 | return {
54 |
55 | 'users': json['users'] == null ? undefined : ((json['users'] as Array).map(UserResultsFromJSON)),
56 | };
57 | }
58 |
59 | export function UsersResponseDataToJSON(json: any): UsersResponseData {
60 | return UsersResponseDataToJSONTyped(json, false);
61 | }
62 |
63 | export function UsersResponseDataToJSONTyped(value?: UsersResponseData | null, ignoreDiscriminator: boolean = false): any {
64 | if (value == null) {
65 | return value;
66 | }
67 |
68 | return {
69 |
70 | 'users': value['users'] == null ? undefined : ((value['users'] as Array).map(UserResultsToJSON)),
71 | };
72 | }
73 |
74 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/tools/.gitignore:
--------------------------------------------------------------------------------
1 | openapi-generator-cli.jar
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/tools/openapi-generator-config.yaml:
--------------------------------------------------------------------------------
1 | inputSpec: twitter-openapi/dist/compatible/openapi-3.0.yaml
2 | outputDir: .
3 | npmName: twitter-openapi-typescript-generated
4 | npmVersion: 0.0.37
5 |
6 | # withoutRuntimeChecks: false
7 | legacyDiscriminatorBehavior: false
8 | # modelPropertyNaming: original
9 | # stringEnums: true
10 | # paramNaming: original
11 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/tools/win/clean.ps1:
--------------------------------------------------------------------------------
1 | # Remove-Item -Recurse .openapi-generator
2 | # Remove-Item -Recurse .gitignore
3 | # Remove-Item -Recurse .npmignore
4 | # Remove-Item -Recurse api.ts
5 | # Remove-Item -Recurse base.ts
6 | # Remove-Item -Recurse common.ts
7 | # Remove-Item -Recurse configuration.ts
8 | # Remove-Item -Recurse git_push.sh
9 | # Remove-Item -Recurse index.ts
10 |
11 | Remove-Item -Recurse .openapi-generator
12 | Remove-Item -Recurse src
13 | Remove-Item -Recurse .gitignore
14 | Remove-Item -Recurse package.json
15 | Remove-Item -Recurse README.md
16 | Remove-Item -Recurse tsconfig.json
17 | Remove-Item -Recurse dist
18 |
19 | # Remove-Item -Recurse package-lock.json
20 | # Remove-Item -Recurse node_modules
21 | # Remove-Item -Recurse .npmignore
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/tools/win/gen.ps1:
--------------------------------------------------------------------------------
1 |
2 | # ./twitter-openapi/.venv/Scripts/Activate.ps1
3 | # Start-Process -FilePath "python" -ArgumentList "tools/build.py" -WorkingDirectory "twitter-openapi" -Wait -NoNewWindow
4 |
5 | tools/win/clean.ps1
6 | java -jar tools/openapi-generator-cli.jar generate -g typescript-fetch -c tools/openapi-generator-config.yaml --git-repo-id twitter-openapi-typescript --git-user-id fa0311
7 | python tools/win/replace.py
8 | npm run build
9 | npm install
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/tools/win/init.ps1:
--------------------------------------------------------------------------------
1 | Invoke-WebRequest -OutFile tools/openapi-generator-cli.jar https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.12.0/openapi-generator-cli-7.12.0.jar
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/tools/win/replace.py:
--------------------------------------------------------------------------------
1 | import json
2 |
3 |
4 | # for file in glob.glob("src/**/*.ts", recursive=True):
5 | # with open(file, mode="r", encoding="utf-8") as f:
6 | # text = f.read()
7 |
8 | # # https://github.com/OpenAPITools/openapi-generator/pull/15668
9 | # text = text.replace("json['typename']", "json['__typename']")
10 | # text = text.replace("json['typename']", "json['__typename']")
11 |
12 | # with open(file, mode="w", encoding="utf-8") as f:
13 | # f.write(text)
14 |
15 |
16 | with open("package.json", mode="r", encoding="utf-8") as f:
17 | package = json.load(f)
18 |
19 | package.update(
20 | {
21 | "author": "fa0311",
22 | "license": "custom license or AGPL-3.0-or-later",
23 | "repository": {
24 | "type": "git",
25 | "url": "https://github.com/fa0311/twitter-openapi-typescript.git",
26 | },
27 | "keywords": ["twitter", "api", "typescript", "scraper"],
28 | "scripts": {"build": "tsc"},
29 | }
30 | )
31 |
32 |
33 | with open("package.json", mode="w", encoding="utf-8") as f:
34 | json.dump(package, f, ensure_ascii=False, indent=2)
35 |
36 |
37 | with open("tsconfig.json", mode="r", encoding="utf-8") as f:
38 | package = json.load(f)
39 | package["compilerOptions"].update(
40 | {
41 | "declaration": True,
42 | "declarationMap": True,
43 | "sourceMap": True,
44 | }
45 | )
46 |
47 |
48 | with open("tsconfig.json", mode="w", encoding="utf-8") as f:
49 | json.dump(package, f, ensure_ascii=False, indent=2)
50 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript-generated/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "declaration": true,
4 | "target": "es5",
5 | "module": "commonjs",
6 | "moduleResolution": "node",
7 | "outDir": "dist",
8 | "lib": [
9 | "es6",
10 | "dom"
11 | ],
12 | "typeRoots": [
13 | "node_modules/@types"
14 | ],
15 | "declarationMap": true,
16 | "sourceMap": true
17 | },
18 | "exclude": [
19 | "dist",
20 | "node_modules"
21 | ]
22 | }
--------------------------------------------------------------------------------
/twitter-openapi-typescript/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | cookies.json
3 | dist
4 | logs
5 | coverage
--------------------------------------------------------------------------------
/twitter-openapi-typescript/.npmignore:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | !/dist/*
4 | !/README.md
5 | !/LICENSE
6 | !/LICENSE.AGPL
7 | !/package.json
--------------------------------------------------------------------------------
/twitter-openapi-typescript/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "singleQuote": true,
3 | "semi": true,
4 | "bracketSpacing": true,
5 | "arrowParens": "always",
6 | "printWidth": 120,
7 | "trailingComma": "all"
8 | }
--------------------------------------------------------------------------------
/twitter-openapi-typescript/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "orta.vscode-jest",
4 | "ms-vscode.vscode-typescript-next",
5 | "dbaeumer.vscode-eslint",
6 | "esbenp.prettier-vscode"
7 | ]
8 | }
9 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "jest.runMode": "on-demand",
3 | "[json][html]": {
4 | "editor.defaultFormatter": "esbenp.prettier-vscode"
5 | },
6 | "[jsonc]": {
7 | "editor.defaultFormatter": "esbenp.prettier-vscode"
8 | },
9 | "[yaml]": {
10 | "editor.defaultFormatter": "esbenp.prettier-vscode"
11 | },
12 | "[markdown]": {
13 | "editor.defaultFormatter": "esbenp.prettier-vscode"
14 | },
15 | "[typescript]": {
16 | "editor.defaultFormatter": "esbenp.prettier-vscode",
17 | "editor.formatOnSave": true
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/LICENSE:
--------------------------------------------------------------------------------
1 | twitter-openapi License
2 |
3 | Copyright (c) 2023 yuki
4 |
5 |
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in all
15 | copies or substantial portions of the Software.
16 |
17 | The Software shall not be used for any activity that involves the following types
18 | of behavior, commonly known as spam:
19 |
20 | 1. Sending unsolicited or excessive messages or posts.
21 | 2. Aggressively following, unfollowing, or liking tweets to artificially boost engagement.
22 | 3. Engaging in aggressive automated actions that disrupt or annoy other users.
23 | 4. Distributing false or misleading information.
24 |
25 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
31 | SOFTWARE.
32 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/biome.json:
--------------------------------------------------------------------------------
1 | {
2 | "linter": {
3 | "enabled": false
4 | },
5 | "formatter": {
6 | "enabled": false
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | preset: 'ts-jest',
3 | testEnvironment: 'node',
4 | transform: {
5 | "^.+\\.ts$": "ts-jest",
6 | },
7 | moduleNameMapper: {
8 | "^@/(.*)$": "/src/$1",
9 | "^@test/(.*)$": "/test/$1",
10 | },
11 | };
--------------------------------------------------------------------------------
/twitter-openapi-typescript/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "twitter-openapi-typescript",
3 | "version": "0.0.54",
4 | "description": "Implementation of Twitter internal API in TypeScript",
5 | "scripts": {
6 | "test": "jest",
7 | "build": "tsc -p tsconfig.build.json && npx tscpaths -p tsconfig.build.json -s . -o ./dist"
8 | },
9 | "keywords": [
10 | "twitter",
11 | "api",
12 | "typescript",
13 | "scraper"
14 | ],
15 | "author": "fa0311",
16 | "license": "custom license or AGPL-3.0-or-later",
17 | "repository": {
18 | "type": "git",
19 | "url": "https://github.com/fa0311/twitter-openapi-typescript.git"
20 | },
21 | "main": "./dist/src/index.js",
22 | "typings": "./dist/src/index.d.ts",
23 | "dependencies": {
24 | "twitter-openapi-typescript-generated": "^0.0.38",
25 | "x-client-transaction-id-generater": "^0.0.7"
26 | },
27 | "devDependencies": {
28 | "@types/jest": "*",
29 | "@types/node": "*",
30 | "@typescript-eslint/eslint-plugin": "*",
31 | "@typescript-eslint/parser": "*",
32 | "eslint": "^8.50.0",
33 | "eslint-config-standard-with-typescript": "*",
34 | "eslint-plugin-import": "*",
35 | "eslint-plugin-n": "*",
36 | "eslint-plugin-promise": "*",
37 | "jest": "^29.7.0",
38 | "log4js": "^6.9.0",
39 | "ts-jest": "*",
40 | "typescript": "^5.6.0"
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/src/apis/index.ts:
--------------------------------------------------------------------------------
1 | export { DefaultApiUtils } from './defaultApi';
2 | export { InitialStateApiUtils } from './initialStateApi';
3 | export { PostApiUtils } from './postApi';
4 | export { TweetApiUtils } from './tweetApi';
5 | export { UserApiUtils } from './userApi';
6 | export { UserListApiUtils } from './userListApi';
7 | export { UsersApiUtils } from './usersApi';
8 | export { V11GetApiUtils } from './v11GetApi';
9 | export { V11PostApiUtils } from './v11PostApi';
10 | export { V20GetApiUtils } from './v20GetApi';
11 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/src/apis/initialStateApi.ts:
--------------------------------------------------------------------------------
1 | export class InitialStateApiUtils {
2 | // todo
3 | }
4 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/src/apis/usersApi.ts:
--------------------------------------------------------------------------------
1 | import { DefaultFlag, RequestParam, TwitterApiUtilsResponse, UserApiUtilsData } from '@/models';
2 | import { buildHeader, errorCheck, getKwargs, InitOverridesType, userResultConverter } from '@/utils';
3 | import * as i from 'twitter-openapi-typescript-generated';
4 |
5 | type getUsersByRestIdsParam = {
6 | userIds: string[];
7 | extraParam?: { [key: string]: any };
8 | };
9 |
10 | type ResponseType = TwitterApiUtilsResponse;
11 |
12 | export class UsersApiUtils {
13 | api: i.UsersApi;
14 | flag: DefaultFlag;
15 | initOverrides: InitOverridesType;
16 |
17 | constructor(api: i.UsersApi, flag: DefaultFlag, initOverrides: InitOverridesType) {
18 | this.api = api;
19 | this.flag = flag;
20 | this.initOverrides = initOverrides;
21 | }
22 |
23 | async request(param: RequestParam): Promise {
24 | const apiFn: typeof param.apiFn = param.apiFn.bind(this.api);
25 | const args = getKwargs(this.flag[param.key], param.param);
26 | const response = await apiFn(args, this.initOverrides(this.flag[param.key]));
27 | const result = param.convertFn(await response.value());
28 | const user = userResultConverter(result);
29 |
30 | return {
31 | raw: { response: response.raw },
32 | header: buildHeader(response.raw.headers),
33 | data: user,
34 | };
35 | }
36 | async getUsersByRestIds(param: getUsersByRestIdsParam): Promise {
37 | const args = {
38 | userIds: param.userIds,
39 | ...param.extraParam,
40 | };
41 | const response = this.request({
42 | key: 'UsersByRestIds',
43 | apiFn: this.api.getUsersByRestIdsRaw,
44 | convertFn: (e) => errorCheck(e.data.users, e.errors),
45 | param: args,
46 | });
47 | return response;
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/src/apis/v11GetApi.ts:
--------------------------------------------------------------------------------
1 | import { DefaultFlag } from '@/models';
2 | import { InitOverridesType } from '@/utils';
3 | import * as i from 'twitter-openapi-typescript-generated';
4 |
5 | export class V11GetApiUtils {
6 | api: i.V11GetApi;
7 | flag: DefaultFlag;
8 | initOverrides: InitOverridesType;
9 |
10 | constructor(api: i.V11GetApi, flag: DefaultFlag, initOverrides: InitOverridesType) {
11 | this.api = api;
12 | this.flag = flag;
13 | this.initOverrides = initOverrides;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/src/apis/v20GetApi.ts:
--------------------------------------------------------------------------------
1 | import { DefaultFlag } from '@/models';
2 | import { InitOverridesType } from '@/utils';
3 | import * as i from 'twitter-openapi-typescript-generated';
4 |
5 | export class V20GetApiUtils {
6 | api: i.V20GetApi;
7 | flag: DefaultFlag;
8 | initOverrides: InitOverridesType;
9 |
10 | constructor(api: i.V20GetApi, flag: DefaultFlag, initOverrides: InitOverridesType) {
11 | this.api = api;
12 | this.flag = flag;
13 | this.initOverrides = initOverrides;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from '@/api';
2 | export * from '@/apis';
3 | export * from '@/models';
4 | export * from '@/utils';
5 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/src/models/flag.ts:
--------------------------------------------------------------------------------
1 | export type DefaultFlag = {
2 | [key: string]: {
3 | [key: string]: any;
4 | };
5 | };
6 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/src/models/header.ts:
--------------------------------------------------------------------------------
1 | export type ApiUtilsHeader = {
2 | raw: Headers;
3 | connectionHash: string;
4 | contentTypeOptions: string;
5 | frameOptions: string;
6 | rateLimitLimit: number;
7 | rateLimitRemaining: number;
8 | rateLimitReset: number;
9 | responseTime: number;
10 | tfePreserveBody: boolean;
11 | transactionId: string;
12 | twitterResponseTags: string;
13 | xssProtection: number;
14 | };
15 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/src/models/index.ts:
--------------------------------------------------------------------------------
1 | export * from './flag';
2 | export * from './header';
3 | export * from './response';
4 | export * from './timeline';
5 | export * from './utils';
6 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/src/models/response.ts:
--------------------------------------------------------------------------------
1 | import { ApiUtilsHeader } from '@/models';
2 |
3 | export type TwitterApiUtilsResponse = {
4 | raw: TwitterApiUtilsRaw;
5 | header: ApiUtilsHeader;
6 | data: T;
7 | };
8 |
9 | export type TwitterApiUtilsRaw = {
10 | response: Response;
11 | };
12 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/src/models/timeline.ts:
--------------------------------------------------------------------------------
1 | import * as i from 'twitter-openapi-typescript-generated';
2 |
3 | export type CursorApiUtilsResponse = {
4 | bottom?: i.TimelineTimelineCursor;
5 | top?: i.TimelineTimelineCursor;
6 | };
7 |
8 | export type ApiUtilsRaw = {
9 | instruction: i.InstructionUnion[];
10 | entry: i.TimelineAddEntry[];
11 | };
12 |
13 | export type TweetApiUtilsData = {
14 | raw: i.ItemResult;
15 | tweet: i.Tweet;
16 | user: i.User;
17 | replies: TweetApiUtilsData[];
18 | quoted?: TweetApiUtilsData;
19 | retweeted?: TweetApiUtilsData;
20 | promotedMetadata?: Record;
21 | };
22 |
23 | export type UserApiUtilsData = {
24 | raw: i.UserResults;
25 | user: i.User | undefined;
26 | };
27 |
28 | export type TimelineApiUtilsResponse = {
29 | raw: ApiUtilsRaw;
30 | cursor: CursorApiUtilsResponse;
31 | data: T[];
32 | };
33 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/src/models/utils.ts:
--------------------------------------------------------------------------------
1 | import * as i from 'twitter-openapi-typescript-generated';
2 | import { InitOverrideFunction } from 'twitter-openapi-typescript-generated';
3 | export type initOverrides = RequestInit | InitOverrideFunction;
4 | export type ApiFunction = (requestParameters: any, initOverrides?: initOverrides) => Promise>;
5 |
6 | export type RequestParam = {
7 | apiFn: ApiFunction;
8 | convertFn: (arg0: T2) => T1;
9 | key: string;
10 | param: { [key: string]: any };
11 | };
12 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/src/utils/index.ts:
--------------------------------------------------------------------------------
1 | export * from './api';
2 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/test/api/auth.test.ts:
--------------------------------------------------------------------------------
1 | import { getClient } from '@test/init';
2 | import { DefaultApi } from 'twitter-openapi-typescript-generated';
3 |
4 | test('test auth', async () => {
5 | const client = await getClient();
6 | const that = client.getDefaultApi();
7 | const fn = DefaultApi.prototype['request'].bind(that.api);
8 |
9 | DefaultApi.prototype['request'] = (...args) => {
10 | console.log('request', args);
11 | return fn(...args);
12 | };
13 | const response = await that.getProfileSpotlightsQuery({ screenName: 'elonmusk' });
14 | console.log(response);
15 | });
16 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/test/api/defaultApi.test.ts:
--------------------------------------------------------------------------------
1 | import { getClient, logger } from '@test/init';
2 | import { printTweet } from '@test/util';
3 |
4 | test('getProfileSpotlightsQuery', async () => {
5 | logger.log('getProfileSpotlightsQuery');
6 | const client = await getClient();
7 | const response = await client.getDefaultApi().getProfileSpotlightsQuery({ screenName: 'elonmusk' });
8 | const legacy = response.data.result.legacy;
9 | logger.log(legacy.screenName ?? 'undefined');
10 | logger.log(`followedBy: ${legacy.followedBy} following: ${legacy.following}`);
11 | logger.log('┄'.repeat(50));
12 | expect(response.raw.response.ok).toBe(true);
13 | });
14 |
15 | test('getTweetResultByRestId', async () => {
16 | logger.log('getTweetResultByRestId');
17 | const client = await getClient();
18 | const response = await client.getDefaultApi().getTweetResultByRestId({ tweetId: '1349129669258448897' });
19 | printTweet(response.data!);
20 | expect(response.raw.response.ok).toBe(true);
21 | });
22 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/test/api/guest.test.ts:
--------------------------------------------------------------------------------
1 | import { getGuestClient, logger } from '@test/init';
2 | import { printTweet, printUser } from '@test/util';
3 |
4 | test('getGuestTweetResultByRestId', async () => {
5 | logger.log('getGuestTweetResultByRestId');
6 | const client = await getGuestClient();
7 | const response = await client.getDefaultApi().getTweetResultByRestId({ tweetId: '1349129669258448897' });
8 | printTweet(response.data!);
9 | expect(response.raw.response.ok).toBe(true);
10 | });
11 |
12 | test('getGuestUserByScreenName', async () => {
13 | logger.log('getGuestUserByScreenName');
14 | const client = await getGuestClient();
15 | const response = await client.getUserApi().getUserByScreenName({ screenName: 'elonmusk' });
16 | printUser(response.data);
17 | expect(response.raw.response.ok).toBe(true);
18 | });
19 |
20 | test('getUserTweets', async () => {
21 | logger.log('getUserTweets');
22 | const client = await getGuestClient();
23 | const response = await client.getTweetApi().getUserTweets({ userId: '44196397' });
24 | response.data.data.filter((e) => !e.promotedMetadata).forEach((e) => printTweet(e));
25 | expect(response.raw.response.ok).toBe(true);
26 | });
27 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/test/api/userApi.test.ts:
--------------------------------------------------------------------------------
1 | import { getClient, logger } from '@test/init';
2 | import { printUser } from '@test/util';
3 |
4 | test('getUserByScreenName', async () => {
5 | logger.log('getUserByScreenName');
6 | const client = await getClient();
7 | const response = await client.getUserApi().getUserByScreenName({ screenName: 'elonmusk' });
8 | printUser(response.data);
9 | expect(response.raw.response.ok).toBe(true);
10 | });
11 |
12 | test('getUserByScreenNameNotFound', async () => {
13 | logger.log('getUserByScreenName');
14 | const client = await getClient();
15 | const response = client.getUserApi().getUserByScreenName({ screenName: 'Wendoleecs' });
16 | response.catch((e) => logger.log(e.message));
17 | expect(response).rejects.toThrow(Error);
18 | });
19 |
20 | test('getUserByScreenNameFreezed', async () => {
21 | logger.log('getUserByScreenName');
22 | const client = await getClient();
23 | const response = await client.getUserApi().getUserByScreenName({ screenName: 'anal' });
24 | printUser(response.data);
25 | expect(response.raw.response.ok).toBe(true);
26 | });
27 |
28 | test('getUserByRestId', async () => {
29 | logger.log('getUserByRestId');
30 | const client = await getClient();
31 | const response = await client.getUserApi().getUserByRestId({ userId: '44196397' });
32 | printUser(response.data);
33 | expect(response.raw.response.ok).toBe(true);
34 | });
35 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/test/api/userListApi.test.ts:
--------------------------------------------------------------------------------
1 | import { getClient, logger } from '@test/init';
2 | import { printUser } from '@test/util';
3 |
4 | test('getFollowers', async () => {
5 | logger.log('getFollowers');
6 | const client = await getClient();
7 | const response = await client.getUserListApi().getFollowers({ userId: '44196397' });
8 | response.data.data.forEach((e) => printUser(e));
9 | expect(response.raw.response.ok).toBe(true);
10 | });
11 |
12 | test('getFollowing', async () => {
13 | logger.log('getFollowing');
14 | const client = await getClient();
15 | const response = await client.getUserListApi().getFollowing({ userId: '44196397' });
16 | response.data.data.forEach((e) => printUser(e));
17 | expect(response.raw.response.ok).toBe(true);
18 | });
19 |
20 | test('getFollowersYouKnow', async () => {
21 | logger.log('getFollowersYouKnow');
22 | const client = await getClient();
23 | const response = await client.getUserListApi().getFollowersYouKnow({ userId: '44196397' });
24 | response.data.data.forEach((e) => printUser(e));
25 | expect(response.raw.response.ok).toBe(true);
26 | });
27 |
28 | test('getFavoriters', async () => {
29 | logger.log('getFavoriters');
30 | const client = await getClient();
31 | const response = await client.getUserListApi().getFavoriters({ tweetId: '1811571695544860784' });
32 | response.data.data.forEach((e) => printUser(e));
33 | expect(response.raw.response.ok).toBe(true);
34 | });
35 |
36 | test('getRetweeters', async () => {
37 | logger.log('getRetweeters');
38 | const client = await getClient();
39 | const response = await client.getUserListApi().getRetweeters({ tweetId: '1349129669258448897' });
40 | response.data.data.forEach((e) => printUser(e));
41 | expect(response.raw.response.ok).toBe(true);
42 | });
43 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/test/api/usersApi.test.ts:
--------------------------------------------------------------------------------
1 | import { getClient, logger } from '@test/init';
2 | import { printLegacyUser } from '@test/util';
3 |
4 | test('getUserByRestId', async () => {
5 | logger.log('getUserByRestId');
6 | const client = await getClient();
7 | const response = await client.getUsersApi().getUsersByRestIds({ userIds: ['44196397'] });
8 | response.data.forEach((e) => {
9 | e.user && printLegacyUser(e.user.legacy);
10 | });
11 | expect(response.raw.response.ok).toBe(true);
12 | });
13 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/test/api/v11PostApi.test.ts:
--------------------------------------------------------------------------------
1 | import { getClient } from '@test/init';
2 |
3 | test('postCreateFriendships', async () => {
4 | const client = await getClient();
5 | const response = await client.getV11PostApi().postCreateFriendships({ userId: '44196397' });
6 | expect(response.raw.response.ok).toBe(true);
7 | });
8 |
9 | test('postDestroyFriendships', async () => {
10 | const client = await getClient();
11 | const response = await client.getV11PostApi().postDestroyFriendships({ userId: '44196397' });
12 | expect(response.raw.response.ok).toBe(true);
13 | });
14 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/test/init.ts:
--------------------------------------------------------------------------------
1 | import { TwitterOpenApi } from '@/api';
2 | import { promises as fs } from 'fs';
3 | import * as log4js from 'log4js';
4 |
5 | export const logger = log4js
6 | .configure({
7 | appenders: {
8 | system: {
9 | type: 'file',
10 | filename: 'logs/test.log',
11 | layout: {
12 | type: 'pattern',
13 | pattern: '[%d{hh:mm:ss}] [%p] %m',
14 | },
15 | },
16 | },
17 | categories: {
18 | default: { appenders: ['system'], level: 'all' },
19 | },
20 | })
21 | .getLogger('Test');
22 |
23 | export type Cookie = {
24 | name: string;
25 | domain: string;
26 | value: string;
27 | };
28 |
29 | export const getClient = async () => {
30 | const api = new TwitterOpenApi();
31 | api.setAdditionalApiHeaders({
32 | 'sec-ch-ua-platform': '"Windows"',
33 | });
34 | api.setAdditionalApiHeaders({
35 | 'sec-ch-ua-platform': '"Windows"',
36 | });
37 | const data = await fs.readFile('cookies.json', 'utf-8');
38 | const parsed = JSON.parse(data);
39 | const cookies = parsed as Cookie[];
40 | const json = Object.fromEntries(
41 | cookies.filter((e) => ['.twitter.com', '.x.com'].includes(e.domain)).map((e) => [e.name, e.value]),
42 | );
43 | const client = await api.getClientFromCookies(json);
44 | return client;
45 | };
46 | export const getGuestClient = async () => {
47 | const api = new TwitterOpenApi();
48 | const client = await api.getGuestClient();
49 | return client;
50 | };
51 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/test/raw/tweet_api.test.ts:
--------------------------------------------------------------------------------
1 | import { getClient } from '@test/init';
2 |
3 | test('getHomeTimelineRaw', async () => {
4 | const client = await getClient();
5 | const response = await client.getTweetApi().api.getHomeTimelineRaw({
6 | pathQueryId: client.flag.HomeTimeline.queryId,
7 | variables: JSON.stringify(client.flag.HomeTimeline.variables),
8 | features: JSON.stringify(client.flag.HomeTimeline.features),
9 | });
10 | const value = await response.value();
11 | expect(response.raw.ok).toBe(true);
12 | });
13 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/test/util.ts:
--------------------------------------------------------------------------------
1 | import * as i from 'twitter-openapi-typescript-generated';
2 |
3 | import { TweetApiUtilsData, UserApiUtilsData } from '@/models';
4 | import { logger } from '@test/init';
5 |
6 | export const printTweet = (tweet: TweetApiUtilsData) => {
7 | logger.log(`${tweet.user.legacy.screenName}: ${tweet.tweet.legacy?.fullText}`.replace(/\n/g, ' '));
8 | tweet.replies.forEach((reply) => {
9 | reply.tweet.legacy && printLegacyTweet(reply.user.legacy, reply.tweet.legacy);
10 | });
11 | };
12 |
13 | export const printLegacyTweet = (user: i.UserLegacy, tweet: i.TweetLegacy) => {
14 | const text = `${user.screenName.padStart(20)}: ${tweet.fullText}`.replace(/\n/g, ' ');
15 | logger.log(text);
16 | };
17 |
18 | export const printUser = (user: UserApiUtilsData) => {
19 | user.user && printLegacyUser(user.user.legacy);
20 | };
21 |
22 | export const printLegacyUser = (user: i.UserLegacy) => {
23 | logger.log(user.screenName);
24 | logger.log(`listedCount: ${user.listedCount}`);
25 | logger.log(`followedBy: ${user.followedBy} following: ${user.following}`);
26 | const text = `friendsCount: ${user.friendsCount} followersCount: ${user.followersCount}`;
27 | logger.log(text);
28 | logger.log('┄'.repeat(50));
29 | };
30 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "declaration": true,
4 | "target": "es5",
5 | "downlevelIteration": true,
6 | "module": "commonjs",
7 | "moduleResolution": "node",
8 | "outDir": "dist",
9 | "lib": ["es2020", "dom"],
10 | "typeRoots": ["node_modules/@types"],
11 | "allowSyntheticDefaultImports": true,
12 | "rootDir": "./",
13 | "baseUrl": "./",
14 | "paths": {
15 | "@/*": ["./src/*"],
16 | "@test/*": ["./test/*"]
17 | },
18 | "declarationMap": true,
19 | "sourceMap": true,
20 | "strict": true
21 | },
22 | "exclude": ["dist", "node_modules", "test"],
23 | "exports": {
24 | ".": "./dist/src/index.js"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/twitter-openapi-typescript/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "declaration": true,
4 | "target": "es5",
5 | "downlevelIteration": true,
6 | "module": "commonjs",
7 | "moduleResolution": "node",
8 | "outDir": "dist",
9 | "lib": ["es2020", "dom"],
10 | "typeRoots": ["node_modules/@types"],
11 | "allowSyntheticDefaultImports": true,
12 | "rootDir": "./",
13 | "baseUrl": "./",
14 | "paths": {
15 | "@/*": ["./src/*"],
16 | "@test/*": ["./test/*"]
17 | },
18 | "declarationMap": true,
19 | "sourceMap": true,
20 | "strict": true
21 | },
22 | "exclude": ["dist", "node_modules"],
23 | "exports": {
24 | ".": "./dist/src/index.js"
25 | }
26 | }
27 |
--------------------------------------------------------------------------------