diff --git a/scripts/generate.ts b/scripts/generate.ts index 5860f89..b4ed265 100644 --- a/scripts/generate.ts +++ b/scripts/generate.ts @@ -2,15 +2,15 @@ // SPDX-License-Identifier: Apache-2.0 import type { - OpenAPI3, - OperationObject, - ParameterObject, - PathItemObject, - RequestBody, - ResponseObject, - SchemaObject, - // https://github.com/microsoft/TypeScript/issues/49721 - // @ts-expect-error + OpenAPI3, + OperationObject, + ParameterObject, + PathItemObject, + RequestBody, + ResponseObject, + SchemaObject, + // https://github.com/microsoft/TypeScript/issues/49721 + // @ts-expect-error } from "openapi-typescript"; import { promises as fs } from "fs"; import prettier from "prettier"; @@ -22,187 +22,187 @@ const LICENCE = `// Copyright 2021 Twitter, Inc. // SPDX-License-Identifier: Apache-2.0`; function exportTypes(operationIds: string[]) { - let output = ""; - operationIds.forEach((x) => { - output += `export type ${x} = operations['${x}']\n`; - }); - return output; + let output = ""; + operationIds.forEach((x) => { + output += `export type ${x} = operations['${x}']\n`; + }); + return output; } function importTypes(operationIds: string[]) { - let output = "import {"; - operationIds.forEach((x) => { - output += `${x},\n`; - }); - output += '} from "./openapi-types"'; - return output; + let output = "import {"; + operationIds.forEach((x) => { + output += `${x},\n`; + }); + output += '} from "./openapi-types"'; + return output; } function functionDocs( - summary?: string, - description?: string, - operationId?: string, - pathVariables?: ParameterObject[], - pathQueryVariables?: ParameterObject[], - requestBody?: RequestBody + summary?: string, + description?: string, + operationId?: string, + pathVariables?: ParameterObject[], + pathQueryVariables?: ParameterObject[], + requestBody?: RequestBody ) { - let output = ""; - output += `\n/**\n * ${summary}\n *\n\n * ${description}\n`; - pathVariables?.forEach((x) => { - output += ` * @param ${x.name} - ${x.description}\n`; - }); - if (pathQueryVariables?.length) - output += ` * @param params - The params for ${operationId}\n`; - if (requestBody) - output += ` * @param request_body - The request_body for ${operationId}\n`; - output += ` * @param request_options - Customize the options for this request\n`; - output += " */\n"; - return output; + let output = ""; + output += `\n/**\n * ${summary}\n *\n\n * ${description}\n`; + pathVariables?.forEach((x) => { + output += ` * @param ${x.name} - ${x.description}\n`; + }); + if (pathQueryVariables?.length) + output += ` * @param params - The params for ${operationId}\n`; + if (requestBody) + output += ` * @param request_body - The request_body for ${operationId}\n`; + output += ` * @param request_options - Customize the options for this request\n`; + output += " */\n"; + return output; } function functionParameters( - pathKey: string, - method: string, - pathQueryVariables: ParameterObject[], - pathVariables: ParameterObject[], - operationId: string, - requestBody: (RequestBody & Record) | undefined, - responseBody: SchemaObject | undefined, - isStreaming: boolean + pathKey: string, + method: string, + pathQueryVariables: ParameterObject[], + pathVariables: ParameterObject[], + operationId: string, + requestBody: (RequestBody & Record) | undefined, + responseBody: SchemaObject | undefined, + isStreaming: boolean ) { - let output = ""; - const args = pathVariables - ?.map((x) => `${x.name}${x.required === false ? "?" : ""}: string`) - .join(","); - const responseType = `TwitterResponse<${operationId}>`; - const needsPathQuery = pathQueryVariables && pathQueryVariables.length > 0; - const needsRequestBody = !!requestBody; - const pathQueryRequired = pathQueryVariables?.some( - (x) => x.required === true - ); - let requestBodyRequired = false; - if (requestBody?.content && requestBody.content["application/json"]?.schema) { - const schema = requestBody.content["application/json"] - .schema as SchemaObject; - requestBodyRequired = - !requestBody.required || - requestBody.required === true || - (!!schema.properties && - Object.keys(schema.properties).some((x) => - schema.required?.includes(x) - )); - } - const isPaginated = - pathQueryVariables?.some( - (x) => (x as ParameterObject).name === "pagination_token" - ) && - !!(responseBody?.properties?.meta as SchemaObject | undefined)?.properties - ?.next_token; - const type = isPaginated ? "paginate" : isStreaming ? "stream" : "rest"; - const optionalParams = needsPathQuery && !pathQueryRequired; - const optionalRequestBody = !requestBodyRequired; - output += `${operationId}: (`; - if (args) output += `${args}, `; - if (needsRequestBody && needsPathQuery) { - output += `request_body: TwitterBody<${operationId}>`; - if (optionalRequestBody) output += "= {}"; - output += ","; - // Add request body inline to stop generating inlined types - output += `params: TwitterParams<${operationId}>`; - if (optionalParams) output += "= {}"; - output += ","; - } else if (needsRequestBody && !needsPathQuery) { - output += `request_body: TwitterBody<${operationId}>`; - if (optionalRequestBody) output += "= {}"; - output += ","; - } else if (!needsRequestBody && needsPathQuery) { - output += `params: TwitterParams<${operationId}>`; - if (optionalParams) output += "= {}"; - output += ","; - } - output += "request_options?: Partial): "; - switch (type) { - case "paginate": - output += `TwitterPaginatedResponse>`; - break; - case "stream": - output += `AsyncGenerator>`; - break; - default: - output += `Promise> `; - } - output += ` => `; - output += `${type}<${responseType}>({ auth: this.#auth, ...this.#defaultRequestOptions, ...request_options, endpoint: \`${pathKey.replace( - /{/g, - "${" - )}\``; - if (needsPathQuery) output += ",params"; - if (needsRequestBody) output += ",request_body"; - output += `,method: '${method.toUpperCase()}'})\n`; - return output; + let output = ""; + const args = pathVariables + ?.map((x) => `${x.name}${x.required === false ? "?" : ""}: string`) + .join(","); + const responseType = `TwitterResponse<${operationId}>`; + const needsPathQuery = pathQueryVariables && pathQueryVariables.length > 0; + const needsRequestBody = !!requestBody; + const pathQueryRequired = pathQueryVariables?.some( + (x) => x.required === true + ); + let requestBodyRequired = false; + if (requestBody?.content && requestBody.content["application/json"]?.schema) { + const schema = requestBody.content["application/json"] + .schema as SchemaObject; + requestBodyRequired = + !requestBody.required || + requestBody.required === true || + (!!schema.properties && + Object.keys(schema.properties).some((x) => + schema.required?.includes(x) + )); + } + const isPaginated = + pathQueryVariables?.some( + (x) => (x as ParameterObject).name === "pagination_token" + ) && + !!(responseBody?.properties?.meta as SchemaObject | undefined)?.properties + ?.next_token; + const type = isPaginated ? "paginate" : isStreaming ? "stream" : "rest"; + const optionalParams = needsPathQuery && !pathQueryRequired; + const optionalRequestBody = !requestBodyRequired; + output += `${operationId}: (`; + if (args) output += `${args}, `; + if (needsRequestBody && needsPathQuery) { + output += `request_body: TwitterBody<${operationId}>`; + if (optionalRequestBody) output += "= {}"; + output += ","; + // Add request body inline to stop generating inlined types + output += `params: TwitterParams<${operationId}>`; + if (optionalParams) output += "= {}"; + output += ","; + } else if (needsRequestBody && !needsPathQuery) { + output += `request_body: TwitterBody<${operationId}>`; + if (optionalRequestBody) output += "= {}"; + output += ","; + } else if (!needsRequestBody && needsPathQuery) { + output += `params: TwitterParams<${operationId}>`; + if (optionalParams) output += "= {}"; + output += ","; + } + output += "request_options?: Partial): "; + switch (type) { + case "paginate": + output += `TwitterPaginatedResponse>`; + break; + case "stream": + output += `AsyncGenerator>`; + break; + default: + output += `Promise> `; + } + output += ` => `; + output += `${type}<${responseType}>({ auth: this.#auth, ...this.#defaultRequestOptions, ...request_options, endpoint: \`${pathKey.replace( + /{/g, + "${" + )}\``; + if (needsPathQuery) output += ",params"; + if (needsRequestBody) output += ",request_body"; + output += `,method: '${method.toUpperCase()}'})\n`; + return output; } function buildClasses(classes: { - [x: string]: { - name: string; - description: string; - externalDocs: { description: string; url: string }; - functions: string[]; - }; + [x: string]: { + name: string; + description: string; + externalDocs: { description: string; url: string }; + functions: string[]; + }; }) { - let output = ""; - Object.keys(classes).forEach((x) => { - const { name, description, externalDocs, functions } = classes[x]; - if (functions.length < 1) return; - if (name && description && externalDocs) { - output += `\n/**\n* ${name}\n*\n* ${description}\n*\n* ${externalDocs.description}\n* ${externalDocs.url}\n*/\n`; - } - output += `public readonly ${x} = { + let output = ""; + Object.keys(classes).forEach((x) => { + const { name, description, externalDocs, functions } = classes[x]; + if (functions.length < 1) return; + if (name && description && externalDocs) { + output += `\n/**\n* ${name}\n*\n* ${description}\n*\n* ${externalDocs.description}\n* ${externalDocs.url}\n*/\n`; + } + output += `public readonly ${x} = { ${functions.join("\n,")} };`; - }); - return output; + }); + return output; } export async function generate(): Promise { - const version = process.argv[2]; - const specFileIndex = process.argv.indexOf("--specFile"); - let specFilePath: string; - if (specFileIndex > -1) specFilePath = process.argv[specFileIndex + 1]; - let spec: OpenAPI3 & { - tags: Record; - components: Record; - info: Record; - }; - if (specFilePath) { - spec = await fs - .readFile(path.resolve(__dirname, specFilePath), "utf8") - .then(JSON.parse); - } else { - spec = await fetch("https://api.twitter.com/2/openapi.json").then((x) => - x.json() - ); - } - const openApiTs = (await import("openapi-typescript")).default; - let openApiTypes = await openApiTs(spec); + const version = process.argv[2]; + const specFileIndex = process.argv.indexOf("--specFile"); + let specFilePath: string; + if (specFileIndex > -1) specFilePath = process.argv[specFileIndex + 1]; + let spec: OpenAPI3 & { + tags: Record; + components: Record; + info: Record; + }; + if (specFilePath) { + spec = await fs + .readFile(path.resolve(__dirname, specFilePath), "utf8") + .then(JSON.parse); + } else { + spec = await fetch("https://api.twitter.com/2/openapi.json").then((x) => + x.json() + ); + } + const openApiTs = (await import("openapi-typescript")).default; + let openApiTypes = await openApiTs(spec); - openApiTypes = LICENCE + "\n\n" + openApiTypes; + openApiTypes = LICENCE + "\n\n" + openApiTypes; - await $RefParser.dereference(spec); + await $RefParser.dereference(spec); - const { paths, tags } = spec; + const { paths, tags } = spec; - const classes = tags.reduce((prev: any, next: { name: string }) => { - const name = next.name.toLowerCase(); - return { - ...prev, - [name]: { functions: [], ...next }, - }; - }, {}); + const classes = tags.reduce((prev: any, next: { name: string }) => { + const name = next.name.toLowerCase(); + return { + ...prev, + [name]: { functions: [], ...next }, + }; + }, {}); - const operationIds: string[] = []; + const operationIds: string[] = []; - let output = `${LICENCE} + let output = `${LICENCE} /* This file is auto-generated @@ -213,76 +213,76 @@ import { rest, stream, paginate, RequestOptions } from '../request' import { AuthClient, TwitterResponse, TwitterBody, TwitterParams, TwitterPaginatedResponse } from '../types' import { OAuth2Bearer } from "../auth";\n\n`; - if (!paths) return; + if (!paths) return; - Object.keys(paths).forEach((pathKey) => { - const endpointPath = paths[pathKey]; - Object.keys(endpointPath).forEach((methodKey) => { - const method = endpointPath[ - methodKey as keyof PathItemObject - ] as OperationObject & Record; - const { - description, - summary, - operationId, - parameters, - requestBody, - responses = {}, - tags, - } = method; + Object.keys(paths).forEach((pathKey) => { + const endpointPath = paths[pathKey]; + Object.keys(endpointPath).forEach((methodKey) => { + const method = endpointPath[ + methodKey as keyof PathItemObject + ] as OperationObject & Record; + const { + description, + summary, + operationId, + parameters, + requestBody, + responses = {}, + tags, + } = method; - if (!operationId) return new Error("No operation id"); + if (!operationId) return new Error("No operation id"); - const queryVariables = parameters?.filter( - (x) => "in" in x && x.in === "query" - ) as ParameterObject[]; + const queryVariables = parameters?.filter( + (x) => "in" in x && x.in === "query" + ) as ParameterObject[]; - const pathVariables = parameters?.filter( - (x) => "in" in x && x.in === "path" - ) as ParameterObject[]; + const pathVariables = parameters?.filter( + (x) => "in" in x && x.in === "path" + ) as ParameterObject[]; - const okResponse = responses["200"] as ResponseObject | undefined; - const responseBody = ( - responses - ? okResponse?.content - ? okResponse.content["application/json"].schema - : undefined - : undefined - ) as ResponseObject; - const isStreaming = method["x-twitter-streaming"] === true; + const okResponse = responses["200"] as ResponseObject | undefined; + const responseBody = ( + responses + ? okResponse?.content + ? okResponse.content["application/json"].schema + : undefined + : undefined + ) as ResponseObject; + const isStreaming = method["x-twitter-streaming"] === true; - operationIds.push(operationId); + operationIds.push(operationId); - if (!tags?.length) throw "No tags found"; - const tag = tags[0].toLowerCase(); - classes[tag].functions.push( - functionDocs( - summary, - description, - operationId, - pathVariables, - queryVariables, - requestBody as RequestBody - ) + - functionParameters( - pathKey, - methodKey, - queryVariables, - pathVariables, - operationId, - requestBody, - responseBody, - isStreaming - ) - ); - }); - }); + if (!tags?.length) throw "No tags found"; + const tag = tags[0].toLowerCase(); + classes[tag].functions.push( + functionDocs( + summary, + description, + operationId, + pathVariables, + queryVariables, + requestBody as RequestBody + ) + + functionParameters( + pathKey, + methodKey, + queryVariables, + pathVariables, + operationId, + requestBody, + responseBody, + isStreaming + ) + ); + }); + }); - openApiTypes += exportTypes(operationIds); + openApiTypes += exportTypes(operationIds); - output += importTypes(operationIds); + output += importTypes(operationIds); - output += ` + output += ` /** * Twitter API TypeScript Client * @@ -305,16 +305,16 @@ export class Client { ${buildClasses(classes)} }`; - await Promise.all([ - fs.writeFile( - path.resolve(__dirname, "../src/gen/", "openapi-types.ts"), - openApiTypes - ), - fs.writeFile( - path.resolve(__dirname, "../src/gen/", "Client.ts"), - prettier.format(output, { parser: "typescript" }) - ), - ]); + await Promise.all([ + fs.writeFile( + path.resolve(__dirname, "../src/gen/", "openapi-types.ts"), + openApiTypes + ), + fs.writeFile( + path.resolve(__dirname, "../src/gen/", "Client.ts"), + prettier.format(output, { parser: "typescript" }) + ), + ]); } generate(); diff --git a/src/OAuth2Bearer.ts b/src/OAuth2Bearer.ts index 6a01414..a1e6062 100644 --- a/src/OAuth2Bearer.ts +++ b/src/OAuth2Bearer.ts @@ -4,15 +4,15 @@ import { AuthClient, AuthHeader } from "./types"; export class OAuth2Bearer implements AuthClient { - private bearer_token: string; + private bearer_token: string; - constructor(bearer_token: string) { - this.bearer_token = bearer_token; - } + constructor(bearer_token: string) { + this.bearer_token = bearer_token; + } - getAuthHeader(): AuthHeader { - return { - Authorization: `Bearer ${this.bearer_token}`, - }; - } + getAuthHeader(): AuthHeader { + return { + Authorization: `Bearer ${this.bearer_token}`, + }; + } } diff --git a/src/OAuth2User.ts b/src/OAuth2User.ts index 64d2eb6..c7dc174 100644 --- a/src/OAuth2User.ts +++ b/src/OAuth2User.ts @@ -7,272 +7,272 @@ import { AuthClient, AuthHeader } from "./types"; import { RequestOptions, rest } from "./request"; export type OAuth2Scopes = - | "tweet.read" - | "tweet.write" - | "tweet.moderate.write" - | "users.read" - | "follows.read" - | "follows.write" - | "offline.access" - | "space.read" - | "mute.read" - | "mute.write" - | "like.read" - | "like.write" - | "list.read" - | "list.write" - | "block.read" - | "block.write" - | "bookmark.read" - | "bookmark.write"; + | "tweet.read" + | "tweet.write" + | "tweet.moderate.write" + | "users.read" + | "follows.read" + | "follows.write" + | "offline.access" + | "space.read" + | "mute.read" + | "mute.write" + | "like.read" + | "like.write" + | "list.read" + | "list.write" + | "block.read" + | "block.write" + | "bookmark.read" + | "bookmark.write"; export interface OAuth2UserOptions { - /** Can be found in the developer portal under the header "Client ID". */ - client_id: string; - /** If you have selected an App type that is a confidential client you will be provided with a “Client Secret” under “Client ID” in your App’s keys and tokens section. */ - client_secret?: string; - /**Your callback URL. This value must correspond to one of the Callback URLs defined in your App’s settings. For OAuth 2.0, you will need to have exact match validation for your callback URL. */ - callback: string; - /** Scopes allow you to set granular access for your App so that your App only has the permissions that it needs. To learn more about what scopes map to what endpoints, view our {@link https://developer.twitter.com/en/docs/authentication/guides/v2-authentication-mapping authentication mapping guide}. */ - scopes: OAuth2Scopes[]; - /** Overwrite request options for all endpoints */ - request_options?: Partial; - /** Set the auth token */ - token?: Token; + /** Can be found in the developer portal under the header "Client ID". */ + client_id: string; + /** If you have selected an App type that is a confidential client you will be provided with a “Client Secret” under “Client ID” in your App’s keys and tokens section. */ + client_secret?: string; + /**Your callback URL. This value must correspond to one of the Callback URLs defined in your App’s settings. For OAuth 2.0, you will need to have exact match validation for your callback URL. */ + callback: string; + /** Scopes allow you to set granular access for your App so that your App only has the permissions that it needs. To learn more about what scopes map to what endpoints, view our {@link https://developer.twitter.com/en/docs/authentication/guides/v2-authentication-mapping authentication mapping guide}. */ + scopes: OAuth2Scopes[]; + /** Overwrite request options for all endpoints */ + request_options?: Partial; + /** Set the auth token */ + token?: Token; } export type GenerateAuthUrlOptions = - | { - /** A random string you provide to verify against CSRF attacks. The length of this string can be up to 500 characters. */ - state: string; - /** Specifies the method you are using to make a request (S256 OR plain). */ - code_challenge_method: "s256"; - } - | { - /** A random string you provide to verify against CSRF attacks. The length of this string can be up to 500 characters. */ - state: string; - /** A PKCE parameter, a random secret for each request you make. */ - code_challenge: string; - /** Specifies the method you are using to make a request (S256 OR plain). */ - code_challenge_method?: "plain"; - }; + | { + /** A random string you provide to verify against CSRF attacks. The length of this string can be up to 500 characters. */ + state: string; + /** Specifies the method you are using to make a request (S256 OR plain). */ + code_challenge_method: "s256"; + } + | { + /** A random string you provide to verify against CSRF attacks. The length of this string can be up to 500 characters. */ + state: string; + /** A PKCE parameter, a random secret for each request you make. */ + code_challenge: string; + /** Specifies the method you are using to make a request (S256 OR plain). */ + code_challenge_method?: "plain"; + }; export interface RevokeAccessTokenParams { - token_type_hint: string; - token: string; - client_id: string; + token_type_hint: string; + token: string; + client_id: string; } function sha256(buffer: string) { - return crypto.createHash("sha256").update(buffer).digest(); + return crypto.createHash("sha256").update(buffer).digest(); } function base64URLEncode(str: Buffer) { - return str - .toString("base64") - .replace(/\+/g, "-") - .replace(/\//g, "_") - .replace(/=/g, ""); + return str + .toString("base64") + .replace(/\+/g, "-") + .replace(/\//g, "_") + .replace(/=/g, ""); } interface RevokeAccessTokenResponse { - revoked: boolean; + revoked: boolean; } interface GetTokenResponse { - /** Allows an application to obtain a new access token without prompting the user via the refresh token flow. */ - refresh_token?: string; - /** Access tokens are the token that applications use to make API requests on behalf of a user. */ - access_token?: string; - token_type?: string; - expires_in?: number; - /** Comma-separated list of scopes for the token */ - scope?: string; + /** Allows an application to obtain a new access token without prompting the user via the refresh token flow. */ + refresh_token?: string; + /** Access tokens are the token that applications use to make API requests on behalf of a user. */ + access_token?: string; + token_type?: string; + expires_in?: number; + /** Comma-separated list of scopes for the token */ + scope?: string; } interface Token extends Omit { - /** Date that the access_token will expire at. */ - expires_at?: number; + /** Date that the access_token will expire at. */ + expires_at?: number; } function processTokenResponse(token: GetTokenResponse): Token { - const { expires_in, ...rest } = token; - return { - ...rest, - ...(!!expires_in && { - expires_at: Date.now() + expires_in * 1000, - }), - }; + const { expires_in, ...rest } = token; + return { + ...rest, + ...(!!expires_in && { + expires_at: Date.now() + expires_in * 1000, + }), + }; } /** * Twitter OAuth2 Authentication Client */ export class OAuth2User implements AuthClient { - token?: Token; - #options: OAuth2UserOptions; - #code_verifier?: string; - #code_challenge?: string; - constructor(options: OAuth2UserOptions) { - const { token, ...defaultOptions } = options; - this.#options = defaultOptions; - this.token = token; - } + token?: Token; + #options: OAuth2UserOptions; + #code_verifier?: string; + #code_challenge?: string; + constructor(options: OAuth2UserOptions) { + const { token, ...defaultOptions } = options; + this.#options = defaultOptions; + this.token = token; + } - /** - * Refresh the access token - */ - async refreshAccessToken(): Promise<{ token: Token }> { - const refresh_token = this.token?.refresh_token; - const { client_id, client_secret, request_options } = this.#options; - if (!client_id) { - throw new Error("client_id is required"); - } - if (!refresh_token) { - throw new Error("refresh_token is required"); - } - const data = await rest({ - ...request_options, - endpoint: `/2/oauth2/token`, - params: { - client_id, - grant_type: "refresh_token", - refresh_token, - }, - method: "POST", - headers: { - ...request_options?.headers, - "Content-type": "application/x-www-form-urlencoded", - ...(!!client_secret && { - Authorization: basicAuthHeader(client_id, client_secret), - }), - }, - }); - const token = processTokenResponse(data); - this.token = token; - return { token }; - } + /** + * Refresh the access token + */ + async refreshAccessToken(): Promise<{ token: Token }> { + const refresh_token = this.token?.refresh_token; + const { client_id, client_secret, request_options } = this.#options; + if (!client_id) { + throw new Error("client_id is required"); + } + if (!refresh_token) { + throw new Error("refresh_token is required"); + } + const data = await rest({ + ...request_options, + endpoint: `/2/oauth2/token`, + params: { + client_id, + grant_type: "refresh_token", + refresh_token, + }, + method: "POST", + headers: { + ...request_options?.headers, + "Content-type": "application/x-www-form-urlencoded", + ...(!!client_secret && { + Authorization: basicAuthHeader(client_id, client_secret), + }), + }, + }); + const token = processTokenResponse(data); + this.token = token; + return { token }; + } - /** - * Check if an access token is expired - */ - isAccessTokenExpired(): boolean { - const refresh_token = this.token?.refresh_token; - const expires_at = this.token?.expires_at; - if (!expires_at) return true; - return !!refresh_token && expires_at <= Date.now() + 1000; - } + /** + * Check if an access token is expired + */ + isAccessTokenExpired(): boolean { + const refresh_token = this.token?.refresh_token; + const expires_at = this.token?.expires_at; + if (!expires_at) return true; + return !!refresh_token && expires_at <= Date.now() + 1000; + } - /** - * Request an access token - */ - async requestAccessToken(code?: string): Promise<{ token: Token }> { - const { client_id, client_secret, callback, request_options } = - this.#options; - const code_verifier = this.#code_verifier; - if (!client_id) { - throw new Error("client_id is required"); - } - if (!callback) { - throw new Error("callback is required"); - } - const params = { - code, - grant_type: "authorization_code", - code_verifier, - client_id, - redirect_uri: callback, - }; - const data = await rest({ - ...request_options, - endpoint: `/2/oauth2/token`, - params, - method: "POST", - headers: { - ...request_options?.headers, - "Content-type": "application/x-www-form-urlencoded", - ...(!!client_secret && { - Authorization: basicAuthHeader(client_id, client_secret), - }), - }, - }); - const token = processTokenResponse(data); - this.token = token; - return { token }; - } + /** + * Request an access token + */ + async requestAccessToken(code?: string): Promise<{ token: Token }> { + const { client_id, client_secret, callback, request_options } = + this.#options; + const code_verifier = this.#code_verifier; + if (!client_id) { + throw new Error("client_id is required"); + } + if (!callback) { + throw new Error("callback is required"); + } + const params = { + code, + grant_type: "authorization_code", + code_verifier, + client_id, + redirect_uri: callback, + }; + const data = await rest({ + ...request_options, + endpoint: `/2/oauth2/token`, + params, + method: "POST", + headers: { + ...request_options?.headers, + "Content-type": "application/x-www-form-urlencoded", + ...(!!client_secret && { + Authorization: basicAuthHeader(client_id, client_secret), + }), + }, + }); + const token = processTokenResponse(data); + this.token = token; + return { token }; + } - /** - * Revoke an access token - */ - async revokeAccessToken(): Promise { - const { client_id, client_secret, request_options } = this.#options; - const access_token = this.token?.access_token; - const refresh_token = this.token?.refresh_token; - if (!client_id) { - throw new Error("client_id is required"); - } - let params: RevokeAccessTokenParams; - if (!!access_token) { - params = { - token_type_hint: "access_token", - token: access_token, - client_id, - }; - } else if (!!refresh_token) { - params = { - token_type_hint: "refresh_token", - token: refresh_token, - client_id, - }; - } else { - throw new Error("access_token or refresh_token required"); - } - return rest({ - ...request_options, - endpoint: `/2/oauth2/revoke`, - params, - method: "POST", - headers: { - ...request_options?.headers, - "Content-Type": "application/x-www-form-urlencoded", - ...(!!client_secret && { - Authorization: basicAuthHeader(client_id, client_secret), - }), - }, - }); - } + /** + * Revoke an access token + */ + async revokeAccessToken(): Promise { + const { client_id, client_secret, request_options } = this.#options; + const access_token = this.token?.access_token; + const refresh_token = this.token?.refresh_token; + if (!client_id) { + throw new Error("client_id is required"); + } + let params: RevokeAccessTokenParams; + if (!!access_token) { + params = { + token_type_hint: "access_token", + token: access_token, + client_id, + }; + } else if (!!refresh_token) { + params = { + token_type_hint: "refresh_token", + token: refresh_token, + client_id, + }; + } else { + throw new Error("access_token or refresh_token required"); + } + return rest({ + ...request_options, + endpoint: `/2/oauth2/revoke`, + params, + method: "POST", + headers: { + ...request_options?.headers, + "Content-Type": "application/x-www-form-urlencoded", + ...(!!client_secret && { + Authorization: basicAuthHeader(client_id, client_secret), + }), + }, + }); + } - generateAuthURL(options: GenerateAuthUrlOptions): string { - const { client_id, callback, scopes } = this.#options; - if (!callback) throw new Error("callback required"); - if (!scopes) throw new Error("scopes required"); - if (options.code_challenge_method === "s256") { - const code_verifier = base64URLEncode(crypto.randomBytes(32)); - this.#code_verifier = code_verifier; - this.#code_challenge = base64URLEncode(sha256(code_verifier)); - } else { - this.#code_challenge = options.code_challenge; - this.#code_verifier = options.code_challenge; - } - const code_challenge = this.#code_challenge; - const url = new URL("https://twitter.com/i/oauth2/authorize"); - url.search = buildQueryString({ - ...options, - client_id, - scope: scopes.join(" "), - response_type: "code", - redirect_uri: callback, - code_challenge_method: options.code_challenge_method || "plain", - code_challenge, - }); - return url.toString(); - } + generateAuthURL(options: GenerateAuthUrlOptions): string { + const { client_id, callback, scopes } = this.#options; + if (!callback) throw new Error("callback required"); + if (!scopes) throw new Error("scopes required"); + if (options.code_challenge_method === "s256") { + const code_verifier = base64URLEncode(crypto.randomBytes(32)); + this.#code_verifier = code_verifier; + this.#code_challenge = base64URLEncode(sha256(code_verifier)); + } else { + this.#code_challenge = options.code_challenge; + this.#code_verifier = options.code_challenge; + } + const code_challenge = this.#code_challenge; + const url = new URL("https://twitter.com/i/oauth2/authorize"); + url.search = buildQueryString({ + ...options, + client_id, + scope: scopes.join(" "), + response_type: "code", + redirect_uri: callback, + code_challenge_method: options.code_challenge_method || "plain", + code_challenge, + }); + return url.toString(); + } - async getAuthHeader(): Promise { - if (!this.token?.access_token) throw new Error("access_token is required"); - if (this.isAccessTokenExpired()) await this.refreshAccessToken(); - return { - Authorization: `Bearer ${this.token.access_token}`, - }; - } + async getAuthHeader(): Promise { + if (!this.token?.access_token) throw new Error("access_token is required"); + if (this.isAccessTokenExpired()) await this.refreshAccessToken(); + return { + Authorization: `Bearer ${this.token.access_token}`, + }; + } } diff --git a/src/auth.ts b/src/auth.ts index 74625f3..73f9e2c 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -1,5 +1,5 @@ // Copyright 2021 Twitter, Inc. // SPDX-License-Identifier: Apache-2.0 -export * from './OAuth2User' +export * from "./OAuth2User"; export * from "./OAuth2Bearer"; diff --git a/src/gen/Client.ts b/src/gen/Client.ts index 7f9c98c..6129a65 100644 --- a/src/gen/Client.ts +++ b/src/gen/Client.ts @@ -8,89 +8,89 @@ Do not make direct changes to this file import { rest, stream, paginate, RequestOptions } from "../request"; import { - AuthClient, - TwitterResponse, - TwitterBody, - TwitterParams, - TwitterPaginatedResponse, + AuthClient, + TwitterResponse, + TwitterBody, + TwitterParams, + TwitterPaginatedResponse, } from "../types"; import { OAuth2Bearer } from "../auth"; import { - listBatchComplianceJobs, - createBatchComplianceJob, - getBatchComplianceJob, - listIdCreate, - listIdDelete, - listIdGet, - listIdUpdate, - listGetFollowers, - listGetMembers, - listAddMember, - listRemoveMember, - listsIdTweets, - getOpenApiSpec, - findSpacesByIds, - findSpacesByCreatorIds, - searchSpaces, - findSpaceById, - spaceBuyers, - spaceTweets, - findTweetsById, - createTweet, - getTweetsComplianceStream, - tweetCountsFullArchiveSearch, - tweetCountsRecentSearch, - getTweetsFirehoseStream, - getTweetsLabelStream, - sampleStream, - getTweetsSample10Stream, - tweetsFullarchiveSearch, - tweetsRecentSearch, - searchStream, - getRules, - addOrDeleteRules, - deleteTweetById, - findTweetById, - tweetsIdLikingUsers, - findTweetsThatQuoteATweet, - tweetsIdRetweetingUsers, - hideReplyById, - findUsersById, - findUsersByUsername, - findUserByUsername, - getUsersComplianceStream, - findMyUser, - findUserById, - usersIdBlocking, - usersIdBlock, - getUsersIdBookmarks, - postUsersIdBookmarks, - usersIdBookmarksDelete, - userFollowedLists, - listUserFollow, - listUserUnfollow, - usersIdFollowers, - usersIdFollowing, - usersIdFollow, - usersIdLikedTweets, - usersIdLike, - usersIdUnlike, - getUserListMemberships, - usersIdMentions, - usersIdMuting, - usersIdMute, - listUserOwnedLists, - listUserPinnedLists, - listUserPin, - listUserUnpin, - usersIdRetweets, - usersIdUnretweets, - usersIdTimeline, - usersIdTweets, - usersIdUnblock, - usersIdUnfollow, - usersIdUnmute, + listBatchComplianceJobs, + createBatchComplianceJob, + getBatchComplianceJob, + listIdCreate, + listIdDelete, + listIdGet, + listIdUpdate, + listGetFollowers, + listGetMembers, + listAddMember, + listRemoveMember, + listsIdTweets, + getOpenApiSpec, + findSpacesByIds, + findSpacesByCreatorIds, + searchSpaces, + findSpaceById, + spaceBuyers, + spaceTweets, + findTweetsById, + createTweet, + getTweetsComplianceStream, + tweetCountsFullArchiveSearch, + tweetCountsRecentSearch, + getTweetsFirehoseStream, + getTweetsLabelStream, + sampleStream, + getTweetsSample10Stream, + tweetsFullarchiveSearch, + tweetsRecentSearch, + searchStream, + getRules, + addOrDeleteRules, + deleteTweetById, + findTweetById, + tweetsIdLikingUsers, + findTweetsThatQuoteATweet, + tweetsIdRetweetingUsers, + hideReplyById, + findUsersById, + findUsersByUsername, + findUserByUsername, + getUsersComplianceStream, + findMyUser, + findUserById, + usersIdBlocking, + usersIdBlock, + getUsersIdBookmarks, + postUsersIdBookmarks, + usersIdBookmarksDelete, + userFollowedLists, + listUserFollow, + listUserUnfollow, + usersIdFollowers, + usersIdFollowing, + usersIdFollow, + usersIdLikedTweets, + usersIdLike, + usersIdUnlike, + getUserListMemberships, + usersIdMentions, + usersIdMuting, + usersIdMute, + listUserOwnedLists, + listUserPinnedLists, + listUserPin, + listUserUnpin, + usersIdRetweets, + usersIdUnretweets, + usersIdTimeline, + usersIdTweets, + usersIdUnblock, + usersIdUnfollow, + usersIdUnmute, } from "./openapi-types"; /** * Twitter API TypeScript Client @@ -99,37 +99,37 @@ import { * */ export class Client { - #auth: AuthClient; - #defaultRequestOptions?: Partial; - version: string; - twitterApiOpenApiVersion: string; - - constructor( - auth: string | AuthClient, - requestOptions?: Partial - ) { - this.version = "1.2.1"; - this.twitterApiOpenApiVersion = "2.54"; - this.#auth = typeof auth === "string" ? new OAuth2Bearer(auth) : auth; - this.#defaultRequestOptions = { - ...requestOptions, - headers: { - "User-Agent": "twitter-api-typescript-sdk/" + this.version, - ...requestOptions?.headers, - }, - }; - } - - /** - * Bookmarks - * - * Endpoints related to retrieving, managing bookmarks of a user - * - * Find out more - * https://developer.twitter.com/en/docs/twitter-api/bookmarks - */ - public readonly bookmarks = { - /** + #auth: AuthClient; + #defaultRequestOptions?: Partial; + version: string; + twitterApiOpenApiVersion: string; + + constructor( + auth: string | AuthClient, + requestOptions?: Partial + ) { + this.version = "1.2.1"; + this.twitterApiOpenApiVersion = "2.54"; + this.#auth = typeof auth === "string" ? new OAuth2Bearer(auth) : auth; + this.#defaultRequestOptions = { + ...requestOptions, + headers: { + "User-Agent": "twitter-api-typescript-sdk/" + this.version, + ...requestOptions?.headers, + }, + }; + } + + /** + * Bookmarks + * + * Endpoints related to retrieving, managing bookmarks of a user + * + * Find out more + * https://developer.twitter.com/en/docs/twitter-api/bookmarks + */ + public readonly bookmarks = { + /** * Bookmarks by User * @@ -138,21 +138,21 @@ export class Client { * @param params - The params for getUsersIdBookmarks * @param request_options - Customize the options for this request */ - getUsersIdBookmarks: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/bookmarks`, - params, - method: "GET", - }), - - /** + getUsersIdBookmarks: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/bookmarks`, + params, + method: "GET", + }), + + /** * Add Tweet to Bookmarks * @@ -161,21 +161,21 @@ export class Client { * @param request_body - The request_body for postUsersIdBookmarks * @param request_options - Customize the options for this request */ - postUsersIdBookmarks: ( - id: string, - request_body: TwitterBody, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/bookmarks`, - request_body, - method: "POST", - }), - - /** + postUsersIdBookmarks: ( + id: string, + request_body: TwitterBody, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/bookmarks`, + request_body, + method: "POST", + }), + + /** * Remove a bookmarked Tweet * @@ -184,29 +184,29 @@ export class Client { * @param tweet_id - The ID of the Tweet that the source User is removing from bookmarks. * @param request_options - Customize the options for this request */ - usersIdBookmarksDelete: ( - id: string, - tweet_id: string, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/bookmarks/${tweet_id}`, - method: "DELETE", - }), - }; - /** - * Compliance - * - * Endpoints related to keeping Twitter data in your systems compliant - * - * Find out more - * https://developer.twitter.com/en/docs/twitter-api/compliance/batch-tweet/introduction - */ - public readonly compliance = { - /** + usersIdBookmarksDelete: ( + id: string, + tweet_id: string, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/bookmarks/${tweet_id}`, + method: "DELETE", + }), + }; + /** + * Compliance + * + * Endpoints related to keeping Twitter data in your systems compliant + * + * Find out more + * https://developer.twitter.com/en/docs/twitter-api/compliance/batch-tweet/introduction + */ + public readonly compliance = { + /** * List Compliance Jobs * @@ -214,20 +214,20 @@ export class Client { * @param params - The params for listBatchComplianceJobs * @param request_options - Customize the options for this request */ - listBatchComplianceJobs: ( - params: TwitterParams, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/compliance/jobs`, - params, - method: "GET", - }), - - /** + listBatchComplianceJobs: ( + params: TwitterParams, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/compliance/jobs`, + params, + method: "GET", + }), + + /** * Create compliance job * @@ -235,20 +235,20 @@ export class Client { * @param request_body - The request_body for createBatchComplianceJob * @param request_options - Customize the options for this request */ - createBatchComplianceJob: ( - request_body: TwitterBody, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/compliance/jobs`, - request_body, - method: "POST", - }), - - /** + createBatchComplianceJob: ( + request_body: TwitterBody, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/compliance/jobs`, + request_body, + method: "POST", + }), + + /** * Get Compliance Job * @@ -257,21 +257,21 @@ export class Client { * @param params - The params for getBatchComplianceJob * @param request_options - Customize the options for this request */ - getBatchComplianceJob: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/compliance/jobs/${id}`, - params, - method: "GET", - }), - - /** + getBatchComplianceJob: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/compliance/jobs/${id}`, + params, + method: "GET", + }), + + /** * Tweets Compliance stream * @@ -279,20 +279,20 @@ export class Client { * @param params - The params for getTweetsComplianceStream * @param request_options - Customize the options for this request */ - getTweetsComplianceStream: ( - params: TwitterParams, - request_options?: Partial - ): AsyncGenerator> => - stream>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets/compliance/stream`, - params, - method: "GET", - }), - - /** + getTweetsComplianceStream: ( + params: TwitterParams, + request_options?: Partial + ): AsyncGenerator> => + stream>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets/compliance/stream`, + params, + method: "GET", + }), + + /** * Tweets Label stream * @@ -300,20 +300,20 @@ export class Client { * @param params - The params for getTweetsLabelStream * @param request_options - Customize the options for this request */ - getTweetsLabelStream: ( - params: TwitterParams = {}, - request_options?: Partial - ): AsyncGenerator> => - stream>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets/label/stream`, - params, - method: "GET", - }), - - /** + getTweetsLabelStream: ( + params: TwitterParams = {}, + request_options?: Partial + ): AsyncGenerator> => + stream>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets/label/stream`, + params, + method: "GET", + }), + + /** * Users Compliance stream * @@ -321,56 +321,56 @@ export class Client { * @param params - The params for getUsersComplianceStream * @param request_options - Customize the options for this request */ - getUsersComplianceStream: ( - params: TwitterParams, - request_options?: Partial - ): AsyncGenerator> => - stream>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/compliance/stream`, - params, - method: "GET", - }), - }; - /** - * General - * - * Miscellaneous endpoints for general API functionality - * - * Find out more - * https://developer.twitter.com/en/docs/twitter-api - */ - public readonly general = { - /** + getUsersComplianceStream: ( + params: TwitterParams, + request_options?: Partial + ): AsyncGenerator> => + stream>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/compliance/stream`, + params, + method: "GET", + }), + }; + /** + * General + * + * Miscellaneous endpoints for general API functionality + * + * Find out more + * https://developer.twitter.com/en/docs/twitter-api + */ + public readonly general = { + /** * Returns the OpenAPI Specification document. * * Full OpenAPI Specification in JSON format. (See https://github.com/OAI/OpenAPI-Specification/blob/master/README.md) * @param request_options - Customize the options for this request */ - getOpenApiSpec: ( - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/openapi.json`, - method: "GET", - }), - }; - /** - * Lists - * - * Endpoints related to retrieving, managing Lists - * - * Find out more - * https://developer.twitter.com/en/docs/twitter-api/lists - */ - public readonly lists = { - /** + getOpenApiSpec: ( + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/openapi.json`, + method: "GET", + }), + }; + /** + * Lists + * + * Endpoints related to retrieving, managing Lists + * + * Find out more + * https://developer.twitter.com/en/docs/twitter-api/lists + */ + public readonly lists = { + /** * Create List * @@ -378,20 +378,20 @@ export class Client { * @param request_body - The request_body for listIdCreate * @param request_options - Customize the options for this request */ - listIdCreate: ( - request_body: TwitterBody, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/lists`, - request_body, - method: "POST", - }), - - /** + listIdCreate: ( + request_body: TwitterBody, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/lists`, + request_body, + method: "POST", + }), + + /** * Delete List * @@ -399,19 +399,19 @@ export class Client { * @param id - The ID of the List to delete. * @param request_options - Customize the options for this request */ - listIdDelete: ( - id: string, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/lists/${id}`, - method: "DELETE", - }), + listIdDelete: ( + id: string, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/lists/${id}`, + method: "DELETE", + }), - /** + /** * List lookup by List ID. * @@ -420,21 +420,21 @@ export class Client { * @param params - The params for listIdGet * @param request_options - Customize the options for this request */ - listIdGet: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/lists/${id}`, - params, - method: "GET", - }), - - /** + listIdGet: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/lists/${id}`, + params, + method: "GET", + }), + + /** * Update List. * @@ -443,21 +443,21 @@ export class Client { * @param request_body - The request_body for listIdUpdate * @param request_options - Customize the options for this request */ - listIdUpdate: ( - id: string, - request_body: TwitterBody, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/lists/${id}`, - request_body, - method: "PUT", - }), - - /** + listIdUpdate: ( + id: string, + request_body: TwitterBody, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/lists/${id}`, + request_body, + method: "PUT", + }), + + /** * Add a List member * @@ -466,21 +466,21 @@ export class Client { * @param request_body - The request_body for listAddMember * @param request_options - Customize the options for this request */ - listAddMember: ( - id: string, - request_body: TwitterBody, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/lists/${id}/members`, - request_body, - method: "POST", - }), - - /** + listAddMember: ( + id: string, + request_body: TwitterBody, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/lists/${id}/members`, + request_body, + method: "POST", + }), + + /** * Remove a List member * @@ -489,20 +489,20 @@ export class Client { * @param user_id - The ID of User that will be removed from the List. * @param request_options - Customize the options for this request */ - listRemoveMember: ( - id: string, - user_id: string, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/lists/${id}/members/${user_id}`, - method: "DELETE", - }), - - /** + listRemoveMember: ( + id: string, + user_id: string, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/lists/${id}/members/${user_id}`, + method: "DELETE", + }), + + /** * Get User's Followed Lists * @@ -511,21 +511,21 @@ export class Client { * @param params - The params for userFollowedLists * @param request_options - Customize the options for this request */ - userFollowedLists: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/followed_lists`, - params, - method: "GET", - }), - - /** + userFollowedLists: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/followed_lists`, + params, + method: "GET", + }), + + /** * Follow a List * @@ -534,21 +534,21 @@ export class Client { * @param request_body - The request_body for listUserFollow * @param request_options - Customize the options for this request */ - listUserFollow: ( - id: string, - request_body: TwitterBody, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/followed_lists`, - request_body, - method: "POST", - }), - - /** + listUserFollow: ( + id: string, + request_body: TwitterBody, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/followed_lists`, + request_body, + method: "POST", + }), + + /** * Unfollow a List * @@ -557,20 +557,20 @@ export class Client { * @param list_id - The ID of the List to unfollow. * @param request_options - Customize the options for this request */ - listUserUnfollow: ( - id: string, - list_id: string, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/followed_lists/${list_id}`, - method: "DELETE", - }), - - /** + listUserUnfollow: ( + id: string, + list_id: string, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/followed_lists/${list_id}`, + method: "DELETE", + }), + + /** * Get a User's List Memberships * @@ -579,21 +579,21 @@ export class Client { * @param params - The params for getUserListMemberships * @param request_options - Customize the options for this request */ - getUserListMemberships: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/list_memberships`, - params, - method: "GET", - }), - - /** + getUserListMemberships: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/list_memberships`, + params, + method: "GET", + }), + + /** * Get a User's Owned Lists. * @@ -602,21 +602,21 @@ export class Client { * @param params - The params for listUserOwnedLists * @param request_options - Customize the options for this request */ - listUserOwnedLists: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/owned_lists`, - params, - method: "GET", - }), - - /** + listUserOwnedLists: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/owned_lists`, + params, + method: "GET", + }), + + /** * Get a User's Pinned Lists * @@ -625,21 +625,21 @@ export class Client { * @param params - The params for listUserPinnedLists * @param request_options - Customize the options for this request */ - listUserPinnedLists: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/pinned_lists`, - params, - method: "GET", - }), - - /** + listUserPinnedLists: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/pinned_lists`, + params, + method: "GET", + }), + + /** * Pin a List * @@ -648,21 +648,21 @@ export class Client { * @param request_body - The request_body for listUserPin * @param request_options - Customize the options for this request */ - listUserPin: ( - id: string, - request_body: TwitterBody, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/pinned_lists`, - request_body, - method: "POST", - }), - - /** + listUserPin: ( + id: string, + request_body: TwitterBody, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/pinned_lists`, + request_body, + method: "POST", + }), + + /** * Unpin a List * @@ -671,29 +671,29 @@ export class Client { * @param list_id - The ID of the List to unpin. * @param request_options - Customize the options for this request */ - listUserUnpin: ( - id: string, - list_id: string, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/pinned_lists/${list_id}`, - method: "DELETE", - }), - }; - /** - * Spaces - * - * Endpoints related to retrieving, managing Spaces - * - * Find out more - * https://developer.twitter.com/en/docs/twitter-api/spaces - */ - public readonly spaces = { - /** + listUserUnpin: ( + id: string, + list_id: string, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/pinned_lists/${list_id}`, + method: "DELETE", + }), + }; + /** + * Spaces + * + * Endpoints related to retrieving, managing Spaces + * + * Find out more + * https://developer.twitter.com/en/docs/twitter-api/spaces + */ + public readonly spaces = { + /** * Space lookup up Space IDs * @@ -701,20 +701,20 @@ export class Client { * @param params - The params for findSpacesByIds * @param request_options - Customize the options for this request */ - findSpacesByIds: ( - params: TwitterParams, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/spaces`, - params, - method: "GET", - }), - - /** + findSpacesByIds: ( + params: TwitterParams, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/spaces`, + params, + method: "GET", + }), + + /** * Space lookup by their creators * @@ -722,20 +722,20 @@ export class Client { * @param params - The params for findSpacesByCreatorIds * @param request_options - Customize the options for this request */ - findSpacesByCreatorIds: ( - params: TwitterParams, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/spaces/by/creator_ids`, - params, - method: "GET", - }), - - /** + findSpacesByCreatorIds: ( + params: TwitterParams, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/spaces/by/creator_ids`, + params, + method: "GET", + }), + + /** * Search for Spaces * @@ -743,20 +743,20 @@ export class Client { * @param params - The params for searchSpaces * @param request_options - Customize the options for this request */ - searchSpaces: ( - params: TwitterParams, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/spaces/search`, - params, - method: "GET", - }), - - /** + searchSpaces: ( + params: TwitterParams, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/spaces/search`, + params, + method: "GET", + }), + + /** * Space lookup by Space ID * @@ -765,21 +765,21 @@ export class Client { * @param params - The params for findSpaceById * @param request_options - Customize the options for this request */ - findSpaceById: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/spaces/${id}`, - params, - method: "GET", - }), - - /** + findSpaceById: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/spaces/${id}`, + params, + method: "GET", + }), + + /** * Retrieve the list of Users who purchased a ticket to the given space * @@ -788,21 +788,21 @@ export class Client { * @param params - The params for spaceBuyers * @param request_options - Customize the options for this request */ - spaceBuyers: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/spaces/${id}/buyers`, - params, - method: "GET", - }), - - /** + spaceBuyers: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/spaces/${id}/buyers`, + params, + method: "GET", + }), + + /** * Retrieve Tweets from a Space. * @@ -811,30 +811,30 @@ export class Client { * @param params - The params for spaceTweets * @param request_options - Customize the options for this request */ - spaceTweets: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/spaces/${id}/tweets`, - params, - method: "GET", - }), - }; - /** - * Tweets - * - * Endpoints related to retrieving, searching, and modifying Tweets - * - * Find out more - * https://developer.twitter.com/en/docs/twitter-api/tweets/lookup - */ - public readonly tweets = { - /** + spaceTweets: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/spaces/${id}/tweets`, + params, + method: "GET", + }), + }; + /** + * Tweets + * + * Endpoints related to retrieving, searching, and modifying Tweets + * + * Find out more + * https://developer.twitter.com/en/docs/twitter-api/tweets/lookup + */ + public readonly tweets = { + /** * List Tweets timeline by List ID. * @@ -843,21 +843,21 @@ export class Client { * @param params - The params for listsIdTweets * @param request_options - Customize the options for this request */ - listsIdTweets: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/lists/${id}/tweets`, - params, - method: "GET", - }), - - /** + listsIdTweets: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/lists/${id}/tweets`, + params, + method: "GET", + }), + + /** * Tweet lookup by Tweet IDs * @@ -865,20 +865,20 @@ export class Client { * @param params - The params for findTweetsById * @param request_options - Customize the options for this request */ - findTweetsById: ( - params: TwitterParams, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets`, - params, - method: "GET", - }), - - /** + findTweetsById: ( + params: TwitterParams, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets`, + params, + method: "GET", + }), + + /** * Creation of a Tweet * @@ -886,20 +886,20 @@ export class Client { * @param request_body - The request_body for createTweet * @param request_options - Customize the options for this request */ - createTweet: ( - request_body: TwitterBody, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets`, - request_body, - method: "POST", - }), - - /** + createTweet: ( + request_body: TwitterBody, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets`, + request_body, + method: "POST", + }), + + /** * Full archive search counts * @@ -907,22 +907,22 @@ export class Client { * @param params - The params for tweetCountsFullArchiveSearch * @param request_options - Customize the options for this request */ - tweetCountsFullArchiveSearch: ( - params: TwitterParams, - request_options?: Partial - ): TwitterPaginatedResponse< - TwitterResponse - > => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets/counts/all`, - params, - method: "GET", - }), - - /** + tweetCountsFullArchiveSearch: ( + params: TwitterParams, + request_options?: Partial + ): TwitterPaginatedResponse< + TwitterResponse + > => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets/counts/all`, + params, + method: "GET", + }), + + /** * Recent search counts * @@ -930,20 +930,20 @@ export class Client { * @param params - The params for tweetCountsRecentSearch * @param request_options - Customize the options for this request */ - tweetCountsRecentSearch: ( - params: TwitterParams, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets/counts/recent`, - params, - method: "GET", - }), - - /** + tweetCountsRecentSearch: ( + params: TwitterParams, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets/counts/recent`, + params, + method: "GET", + }), + + /** * Firehose stream * @@ -951,20 +951,20 @@ export class Client { * @param params - The params for getTweetsFirehoseStream * @param request_options - Customize the options for this request */ - getTweetsFirehoseStream: ( - params: TwitterParams, - request_options?: Partial - ): AsyncGenerator> => - stream>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets/firehose/stream`, - params, - method: "GET", - }), - - /** + getTweetsFirehoseStream: ( + params: TwitterParams, + request_options?: Partial + ): AsyncGenerator> => + stream>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets/firehose/stream`, + params, + method: "GET", + }), + + /** * Sample stream * @@ -972,20 +972,20 @@ export class Client { * @param params - The params for sampleStream * @param request_options - Customize the options for this request */ - sampleStream: ( - params: TwitterParams = {}, - request_options?: Partial - ): AsyncGenerator> => - stream>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets/sample/stream`, - params, - method: "GET", - }), - - /** + sampleStream: ( + params: TwitterParams = {}, + request_options?: Partial + ): AsyncGenerator> => + stream>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets/sample/stream`, + params, + method: "GET", + }), + + /** * Sample 10% stream * @@ -993,20 +993,20 @@ export class Client { * @param params - The params for getTweetsSample10Stream * @param request_options - Customize the options for this request */ - getTweetsSample10Stream: ( - params: TwitterParams, - request_options?: Partial - ): AsyncGenerator> => - stream>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets/sample10/stream`, - params, - method: "GET", - }), - - /** + getTweetsSample10Stream: ( + params: TwitterParams, + request_options?: Partial + ): AsyncGenerator> => + stream>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets/sample10/stream`, + params, + method: "GET", + }), + + /** * Full-archive search * @@ -1014,20 +1014,20 @@ export class Client { * @param params - The params for tweetsFullarchiveSearch * @param request_options - Customize the options for this request */ - tweetsFullarchiveSearch: ( - params: TwitterParams, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets/search/all`, - params, - method: "GET", - }), - - /** + tweetsFullarchiveSearch: ( + params: TwitterParams, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets/search/all`, + params, + method: "GET", + }), + + /** * Recent search * @@ -1035,20 +1035,20 @@ export class Client { * @param params - The params for tweetsRecentSearch * @param request_options - Customize the options for this request */ - tweetsRecentSearch: ( - params: TwitterParams, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets/search/recent`, - params, - method: "GET", - }), - - /** + tweetsRecentSearch: ( + params: TwitterParams, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets/search/recent`, + params, + method: "GET", + }), + + /** * Filtered stream * @@ -1056,20 +1056,20 @@ export class Client { * @param params - The params for searchStream * @param request_options - Customize the options for this request */ - searchStream: ( - params: TwitterParams = {}, - request_options?: Partial - ): AsyncGenerator> => - stream>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets/search/stream`, - params, - method: "GET", - }), - - /** + searchStream: ( + params: TwitterParams = {}, + request_options?: Partial + ): AsyncGenerator> => + stream>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets/search/stream`, + params, + method: "GET", + }), + + /** * Rules lookup * @@ -1077,20 +1077,20 @@ export class Client { * @param params - The params for getRules * @param request_options - Customize the options for this request */ - getRules: ( - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets/search/stream/rules`, - params, - method: "GET", - }), - - /** + getRules: ( + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets/search/stream/rules`, + params, + method: "GET", + }), + + /** * Add/Delete rules * @@ -1099,22 +1099,22 @@ export class Client { * @param request_body - The request_body for addOrDeleteRules * @param request_options - Customize the options for this request */ - addOrDeleteRules: ( - request_body: TwitterBody, - params: TwitterParams = {}, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets/search/stream/rules`, - params, - request_body, - method: "POST", - }), - - /** + addOrDeleteRules: ( + request_body: TwitterBody, + params: TwitterParams = {}, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets/search/stream/rules`, + params, + request_body, + method: "POST", + }), + + /** * Tweet delete by Tweet ID * @@ -1122,19 +1122,19 @@ export class Client { * @param id - The ID of the Tweet to be deleted. * @param request_options - Customize the options for this request */ - deleteTweetById: ( - id: string, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets/${id}`, - method: "DELETE", - }), + deleteTweetById: ( + id: string, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets/${id}`, + method: "DELETE", + }), - /** + /** * Tweet lookup by Tweet ID * @@ -1143,21 +1143,21 @@ export class Client { * @param params - The params for findTweetById * @param request_options - Customize the options for this request */ - findTweetById: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets/${id}`, - params, - method: "GET", - }), - - /** + findTweetById: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets/${id}`, + params, + method: "GET", + }), + + /** * Retrieve Tweets that quote a Tweet. * @@ -1166,21 +1166,21 @@ export class Client { * @param params - The params for findTweetsThatQuoteATweet * @param request_options - Customize the options for this request */ - findTweetsThatQuoteATweet: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets/${id}/quote_tweets`, - params, - method: "GET", - }), - - /** + findTweetsThatQuoteATweet: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets/${id}/quote_tweets`, + params, + method: "GET", + }), + + /** * Hide replies * @@ -1189,21 +1189,21 @@ export class Client { * @param request_body - The request_body for hideReplyById * @param request_options - Customize the options for this request */ - hideReplyById: ( - tweet_id: string, - request_body: TwitterBody, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets/${tweet_id}/hidden`, - request_body, - method: "PUT", - }), - - /** + hideReplyById: ( + tweet_id: string, + request_body: TwitterBody, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets/${tweet_id}/hidden`, + request_body, + method: "PUT", + }), + + /** * Returns Tweet objects liked by the provided User ID * @@ -1212,21 +1212,21 @@ export class Client { * @param params - The params for usersIdLikedTweets * @param request_options - Customize the options for this request */ - usersIdLikedTweets: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/liked_tweets`, - params, - method: "GET", - }), - - /** + usersIdLikedTweets: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/liked_tweets`, + params, + method: "GET", + }), + + /** * Causes the User (in the path) to like the specified Tweet * @@ -1235,21 +1235,21 @@ export class Client { * @param request_body - The request_body for usersIdLike * @param request_options - Customize the options for this request */ - usersIdLike: ( - id: string, - request_body: TwitterBody, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/likes`, - request_body, - method: "POST", - }), - - /** + usersIdLike: ( + id: string, + request_body: TwitterBody, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/likes`, + request_body, + method: "POST", + }), + + /** * Causes the User (in the path) to unlike the specified Tweet * @@ -1258,20 +1258,20 @@ export class Client { * @param tweet_id - The ID of the Tweet that the User is requesting to unlike. * @param request_options - Customize the options for this request */ - usersIdUnlike: ( - id: string, - tweet_id: string, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/likes/${tweet_id}`, - method: "DELETE", - }), - - /** + usersIdUnlike: ( + id: string, + tweet_id: string, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/likes/${tweet_id}`, + method: "DELETE", + }), + + /** * User mention timeline by User ID * @@ -1280,21 +1280,21 @@ export class Client { * @param params - The params for usersIdMentions * @param request_options - Customize the options for this request */ - usersIdMentions: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/mentions`, - params, - method: "GET", - }), - - /** + usersIdMentions: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/mentions`, + params, + method: "GET", + }), + + /** * Causes the User (in the path) to retweet the specified Tweet. * @@ -1303,21 +1303,21 @@ export class Client { * @param request_body - The request_body for usersIdRetweets * @param request_options - Customize the options for this request */ - usersIdRetweets: ( - id: string, - request_body: TwitterBody, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/retweets`, - request_body, - method: "POST", - }), - - /** + usersIdRetweets: ( + id: string, + request_body: TwitterBody, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/retweets`, + request_body, + method: "POST", + }), + + /** * Causes the User (in the path) to unretweet the specified Tweet * @@ -1326,20 +1326,20 @@ export class Client { * @param source_tweet_id - The ID of the Tweet that the User is requesting to unretweet. * @param request_options - Customize the options for this request */ - usersIdUnretweets: ( - id: string, - source_tweet_id: string, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/retweets/${source_tweet_id}`, - method: "DELETE", - }), - - /** + usersIdUnretweets: ( + id: string, + source_tweet_id: string, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/retweets/${source_tweet_id}`, + method: "DELETE", + }), + + /** * User home timeline by User ID * @@ -1348,21 +1348,21 @@ export class Client { * @param params - The params for usersIdTimeline * @param request_options - Customize the options for this request */ - usersIdTimeline: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/timelines/reverse_chronological`, - params, - method: "GET", - }), - - /** + usersIdTimeline: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/timelines/reverse_chronological`, + params, + method: "GET", + }), + + /** * User Tweets timeline by User ID * @@ -1371,30 +1371,30 @@ export class Client { * @param params - The params for usersIdTweets * @param request_options - Customize the options for this request */ - usersIdTweets: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/tweets`, - params, - method: "GET", - }), - }; - /** - * Users - * - * Endpoints related to retrieving, managing relationships of Users - * - * Find out more - * https://developer.twitter.com/en/docs/twitter-api/users/lookup - */ - public readonly users = { - /** + usersIdTweets: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/tweets`, + params, + method: "GET", + }), + }; + /** + * Users + * + * Endpoints related to retrieving, managing relationships of Users + * + * Find out more + * https://developer.twitter.com/en/docs/twitter-api/users/lookup + */ + public readonly users = { + /** * Returns User objects that follow a List by the provided List ID * @@ -1403,21 +1403,21 @@ export class Client { * @param params - The params for listGetFollowers * @param request_options - Customize the options for this request */ - listGetFollowers: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/lists/${id}/followers`, - params, - method: "GET", - }), - - /** + listGetFollowers: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/lists/${id}/followers`, + params, + method: "GET", + }), + + /** * Returns User objects that are members of a List by the provided List ID. * @@ -1426,21 +1426,21 @@ export class Client { * @param params - The params for listGetMembers * @param request_options - Customize the options for this request */ - listGetMembers: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/lists/${id}/members`, - params, - method: "GET", - }), - - /** + listGetMembers: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/lists/${id}/members`, + params, + method: "GET", + }), + + /** * Returns User objects that have liked the provided Tweet ID * @@ -1449,21 +1449,21 @@ export class Client { * @param params - The params for tweetsIdLikingUsers * @param request_options - Customize the options for this request */ - tweetsIdLikingUsers: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets/${id}/liking_users`, - params, - method: "GET", - }), - - /** + tweetsIdLikingUsers: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets/${id}/liking_users`, + params, + method: "GET", + }), + + /** * Returns User objects that have retweeted the provided Tweet ID * @@ -1472,21 +1472,21 @@ export class Client { * @param params - The params for tweetsIdRetweetingUsers * @param request_options - Customize the options for this request */ - tweetsIdRetweetingUsers: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/tweets/${id}/retweeted_by`, - params, - method: "GET", - }), - - /** + tweetsIdRetweetingUsers: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/tweets/${id}/retweeted_by`, + params, + method: "GET", + }), + + /** * User lookup by IDs * @@ -1494,20 +1494,20 @@ export class Client { * @param params - The params for findUsersById * @param request_options - Customize the options for this request */ - findUsersById: ( - params: TwitterParams, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users`, - params, - method: "GET", - }), - - /** + findUsersById: ( + params: TwitterParams, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users`, + params, + method: "GET", + }), + + /** * User lookup by usernames * @@ -1515,20 +1515,20 @@ export class Client { * @param params - The params for findUsersByUsername * @param request_options - Customize the options for this request */ - findUsersByUsername: ( - params: TwitterParams, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/by`, - params, - method: "GET", - }), - - /** + findUsersByUsername: ( + params: TwitterParams, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/by`, + params, + method: "GET", + }), + + /** * User lookup by username * @@ -1537,21 +1537,21 @@ export class Client { * @param params - The params for findUserByUsername * @param request_options - Customize the options for this request */ - findUserByUsername: ( - username: string, - params: TwitterParams = {}, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/by/username/${username}`, - params, - method: "GET", - }), - - /** + findUserByUsername: ( + username: string, + params: TwitterParams = {}, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/by/username/${username}`, + params, + method: "GET", + }), + + /** * User lookup me * @@ -1559,20 +1559,20 @@ export class Client { * @param params - The params for findMyUser * @param request_options - Customize the options for this request */ - findMyUser: ( - params: TwitterParams = {}, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/me`, - params, - method: "GET", - }), - - /** + findMyUser: ( + params: TwitterParams = {}, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/me`, + params, + method: "GET", + }), + + /** * User lookup by ID * @@ -1581,21 +1581,21 @@ export class Client { * @param params - The params for findUserById * @param request_options - Customize the options for this request */ - findUserById: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}`, - params, - method: "GET", - }), - - /** + findUserById: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}`, + params, + method: "GET", + }), + + /** * Returns User objects that are blocked by provided User ID * @@ -1604,21 +1604,21 @@ export class Client { * @param params - The params for usersIdBlocking * @param request_options - Customize the options for this request */ - usersIdBlocking: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/blocking`, - params, - method: "GET", - }), - - /** + usersIdBlocking: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/blocking`, + params, + method: "GET", + }), + + /** * Block User by User ID * @@ -1627,21 +1627,21 @@ export class Client { * @param request_body - The request_body for usersIdBlock * @param request_options - Customize the options for this request */ - usersIdBlock: ( - id: string, - request_body: TwitterBody, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/blocking`, - request_body, - method: "POST", - }), - - /** + usersIdBlock: ( + id: string, + request_body: TwitterBody, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/blocking`, + request_body, + method: "POST", + }), + + /** * Followers by User ID * @@ -1650,21 +1650,21 @@ export class Client { * @param params - The params for usersIdFollowers * @param request_options - Customize the options for this request */ - usersIdFollowers: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/followers`, - params, - method: "GET", - }), - - /** + usersIdFollowers: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/followers`, + params, + method: "GET", + }), + + /** * Following by User ID * @@ -1673,21 +1673,21 @@ export class Client { * @param params - The params for usersIdFollowing * @param request_options - Customize the options for this request */ - usersIdFollowing: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/following`, - params, - method: "GET", - }), - - /** + usersIdFollowing: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/following`, + params, + method: "GET", + }), + + /** * Follow User * @@ -1696,21 +1696,21 @@ export class Client { * @param request_body - The request_body for usersIdFollow * @param request_options - Customize the options for this request */ - usersIdFollow: ( - id: string, - request_body: TwitterBody, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/following`, - request_body, - method: "POST", - }), - - /** + usersIdFollow: ( + id: string, + request_body: TwitterBody, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/following`, + request_body, + method: "POST", + }), + + /** * Returns User objects that are muted by the provided User ID * @@ -1719,21 +1719,21 @@ export class Client { * @param params - The params for usersIdMuting * @param request_options - Customize the options for this request */ - usersIdMuting: ( - id: string, - params: TwitterParams = {}, - request_options?: Partial - ): TwitterPaginatedResponse> => - paginate>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/muting`, - params, - method: "GET", - }), - - /** + usersIdMuting: ( + id: string, + params: TwitterParams = {}, + request_options?: Partial + ): TwitterPaginatedResponse> => + paginate>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/muting`, + params, + method: "GET", + }), + + /** * Mute User by User ID. * @@ -1742,21 +1742,21 @@ export class Client { * @param request_body - The request_body for usersIdMute * @param request_options - Customize the options for this request */ - usersIdMute: ( - id: string, - request_body: TwitterBody, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${id}/muting`, - request_body, - method: "POST", - }), - - /** + usersIdMute: ( + id: string, + request_body: TwitterBody, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${id}/muting`, + request_body, + method: "POST", + }), + + /** * Unblock User by User ID * @@ -1765,20 +1765,20 @@ export class Client { * @param target_user_id - The ID of the User that the source User is requesting to unblock. * @param request_options - Customize the options for this request */ - usersIdUnblock: ( - source_user_id: string, - target_user_id: string, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${source_user_id}/blocking/${target_user_id}`, - method: "DELETE", - }), - - /** + usersIdUnblock: ( + source_user_id: string, + target_user_id: string, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${source_user_id}/blocking/${target_user_id}`, + method: "DELETE", + }), + + /** * Unfollow User * @@ -1787,20 +1787,20 @@ export class Client { * @param target_user_id - The ID of the User that the source User is requesting to unfollow. * @param request_options - Customize the options for this request */ - usersIdUnfollow: ( - source_user_id: string, - target_user_id: string, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${source_user_id}/following/${target_user_id}`, - method: "DELETE", - }), - - /** + usersIdUnfollow: ( + source_user_id: string, + target_user_id: string, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${source_user_id}/following/${target_user_id}`, + method: "DELETE", + }), + + /** * Unmute User by User ID * @@ -1809,17 +1809,17 @@ export class Client { * @param target_user_id - The ID of the User that the source User is requesting to unmute. * @param request_options - Customize the options for this request */ - usersIdUnmute: ( - source_user_id: string, - target_user_id: string, - request_options?: Partial - ): Promise> => - rest>({ - auth: this.#auth, - ...this.#defaultRequestOptions, - ...request_options, - endpoint: `/2/users/${source_user_id}/muting/${target_user_id}`, - method: "DELETE", - }), - }; + usersIdUnmute: ( + source_user_id: string, + target_user_id: string, + request_options?: Partial + ): Promise> => + rest>({ + auth: this.#auth, + ...this.#defaultRequestOptions, + ...request_options, + endpoint: `/2/users/${source_user_id}/muting/${target_user_id}`, + method: "DELETE", + }), + }; } diff --git a/src/gen/openapi-types.ts b/src/gen/openapi-types.ts index 808906a..34371d7 100644 --- a/src/gen/openapi-types.ts +++ b/src/gen/openapi-types.ts @@ -7,4858 +7,4859 @@ */ export interface paths { - "/2/compliance/jobs": { - /** Returns recent Compliance Jobs for a given job type and optional job status */ - get: operations["listBatchComplianceJobs"]; - /** Creates a compliance for the given job type */ - post: operations["createBatchComplianceJob"]; - }; - "/2/compliance/jobs/{id}": { - /** Returns a single Compliance Job by ID */ - get: operations["getBatchComplianceJob"]; - }; - "/2/lists": { - /** Creates a new List. */ - post: operations["listIdCreate"]; - }; - "/2/lists/{id}": { - /** Returns a List. */ - get: operations["listIdGet"]; - /** Update a List that you own. */ - put: operations["listIdUpdate"]; - /** Delete a List that you own. */ - delete: operations["listIdDelete"]; - }; - "/2/lists/{id}/followers": { - /** Returns a list of Users that follow a List by the provided List ID */ - get: operations["listGetFollowers"]; - }; - "/2/lists/{id}/members": { - /** Returns a list of Users that are members of a List by the provided List ID. */ - get: operations["listGetMembers"]; - /** Causes a User to become a member of a List. */ - post: operations["listAddMember"]; - }; - "/2/lists/{id}/members/{user_id}": { - /** Causes a User to be removed from the members of a List. */ - delete: operations["listRemoveMember"]; - }; - "/2/lists/{id}/tweets": { - /** Returns a list of Tweets associated with the provided List ID. */ - get: operations["listsIdTweets"]; - }; - "/2/openapi.json": { - /** Full OpenAPI Specification in JSON format. (See https://github.com/OAI/OpenAPI-Specification/blob/master/README.md) */ - get: operations["getOpenApiSpec"]; - }; - "/2/spaces": { - /** Returns a variety of information about the Spaces specified by the requested IDs */ - get: operations["findSpacesByIds"]; - }; - "/2/spaces/by/creator_ids": { - /** Returns a variety of information about the Spaces created by the provided User IDs */ - get: operations["findSpacesByCreatorIds"]; - }; - "/2/spaces/search": { - /** Returns Spaces that match the provided query. */ - get: operations["searchSpaces"]; - }; - "/2/spaces/{id}": { - /** Returns a variety of information about the Space specified by the requested ID */ - get: operations["findSpaceById"]; - }; - "/2/spaces/{id}/buyers": { - /** Retrieves the list of Users who purchased a ticket to the given space */ - get: operations["spaceBuyers"]; - }; - "/2/spaces/{id}/tweets": { - /** Retrieves Tweets shared in the specified Space. */ - get: operations["spaceTweets"]; - }; - "/2/tweets": { - /** Returns a variety of information about the Tweet specified by the requested ID. */ - get: operations["findTweetsById"]; - /** Causes the User to create a Tweet under the authorized account. */ - post: operations["createTweet"]; - }; - "/2/tweets/compliance/stream": { - /** Streams 100% of compliance data for Tweets */ - get: operations["getTweetsComplianceStream"]; - }; - "/2/tweets/counts/all": { - /** Returns Tweet Counts that match a search query. */ - get: operations["tweetCountsFullArchiveSearch"]; - }; - "/2/tweets/counts/recent": { - /** Returns Tweet Counts from the last 7 days that match a search query. */ - get: operations["tweetCountsRecentSearch"]; - }; - "/2/tweets/firehose/stream": { - /** Streams 100% of public Tweets. */ - get: operations["getTweetsFirehoseStream"]; - }; - "/2/tweets/label/stream": { - /** Streams 100% of labeling events applied to Tweets */ - get: operations["getTweetsLabelStream"]; - }; - "/2/tweets/sample/stream": { - /** Streams a deterministic 1% of public Tweets. */ - get: operations["sampleStream"]; - }; - "/2/tweets/sample10/stream": { - /** Streams a deterministic 10% of public Tweets. */ - get: operations["getTweetsSample10Stream"]; - }; - "/2/tweets/search/all": { - /** Returns Tweets that match a search query. */ - get: operations["tweetsFullarchiveSearch"]; - }; - "/2/tweets/search/recent": { - /** Returns Tweets from the last 7 days that match a search query. */ - get: operations["tweetsRecentSearch"]; - }; - "/2/tweets/search/stream": { - /** Streams Tweets matching the stream's active rule set. */ - get: operations["searchStream"]; - }; - "/2/tweets/search/stream/rules": { - /** Returns rules from a User's active rule set. Users can fetch all of their rules or a subset, specified by the provided rule ids. */ - get: operations["getRules"]; - /** Add or delete rules from a User's active rule set. Users can provide unique, optionally tagged rules to add. Users can delete their entire rule set or a subset specified by rule ids or values. */ - post: operations["addOrDeleteRules"]; - }; - "/2/tweets/{id}": { - /** Returns a variety of information about the Tweet specified by the requested ID. */ - get: operations["findTweetById"]; - /** Delete specified Tweet (in the path) by ID. */ - delete: operations["deleteTweetById"]; - }; - "/2/tweets/{id}/liking_users": { - /** Returns a list of Users that have liked the provided Tweet ID */ - get: operations["tweetsIdLikingUsers"]; - }; - "/2/tweets/{id}/quote_tweets": { - /** Returns a variety of information about each Tweet that quotes the Tweet specified by the requested ID. */ - get: operations["findTweetsThatQuoteATweet"]; - }; - "/2/tweets/{id}/retweeted_by": { - /** Returns a list of Users that have retweeted the provided Tweet ID */ - get: operations["tweetsIdRetweetingUsers"]; - }; - "/2/tweets/{tweet_id}/hidden": { - /** Hides or unhides a reply to an owned conversation. */ - put: operations["hideReplyById"]; - }; - "/2/users": { - /** This endpoint returns information about Users. Specify Users by their ID. */ - get: operations["findUsersById"]; - }; - "/2/users/by": { - /** This endpoint returns information about Users. Specify Users by their username. */ - get: operations["findUsersByUsername"]; - }; - "/2/users/by/username/{username}": { - /** This endpoint returns information about a User. Specify User by username. */ - get: operations["findUserByUsername"]; - }; - "/2/users/compliance/stream": { - /** Streams 100% of compliance data for Users */ - get: operations["getUsersComplianceStream"]; - }; - "/2/users/me": { - /** This endpoint returns information about the requesting User. */ - get: operations["findMyUser"]; - }; - "/2/users/{id}": { - /** This endpoint returns information about a User. Specify User by ID. */ - get: operations["findUserById"]; - }; - "/2/users/{id}/blocking": { - /** Returns a list of Users that are blocked by the provided User ID */ - get: operations["usersIdBlocking"]; - /** Causes the User (in the path) to block the target User. The User (in the path) must match the User context authorizing the request */ - post: operations["usersIdBlock"]; - }; - "/2/users/{id}/bookmarks": { - /** Returns Tweet objects that have been bookmarked by the requesting User */ - get: operations["getUsersIdBookmarks"]; - /** Adds a Tweet (ID in the body) to the requesting User's (in the path) bookmarks */ - post: operations["postUsersIdBookmarks"]; - }; - "/2/users/{id}/bookmarks/{tweet_id}": { - /** Removes a Tweet from the requesting User's bookmarked Tweets. */ - delete: operations["usersIdBookmarksDelete"]; - }; - "/2/users/{id}/followed_lists": { - /** Returns a User's followed Lists. */ - get: operations["userFollowedLists"]; - /** Causes a User to follow a List. */ - post: operations["listUserFollow"]; - }; - "/2/users/{id}/followed_lists/{list_id}": { - /** Causes a User to unfollow a List. */ - delete: operations["listUserUnfollow"]; - }; - "/2/users/{id}/followers": { - /** Returns a list of Users who are followers of the specified User ID. */ - get: operations["usersIdFollowers"]; - }; - "/2/users/{id}/following": { - /** Returns a list of Users that are being followed by the provided User ID */ - get: operations["usersIdFollowing"]; - /** Causes the User(in the path) to follow, or “request to follow” for protected Users, the target User. The User(in the path) must match the User context authorizing the request */ - post: operations["usersIdFollow"]; - }; - "/2/users/{id}/liked_tweets": { - /** Returns a list of Tweets liked by the provided User ID */ - get: operations["usersIdLikedTweets"]; - }; - "/2/users/{id}/likes": { - /** Causes the User (in the path) to like the specified Tweet. The User in the path must match the User context authorizing the request. */ - post: operations["usersIdLike"]; - }; - "/2/users/{id}/likes/{tweet_id}": { - /** Causes the User (in the path) to unlike the specified Tweet. The User must match the User context authorizing the request */ - delete: operations["usersIdUnlike"]; - }; - "/2/users/{id}/list_memberships": { - /** Get a User's List Memberships. */ - get: operations["getUserListMemberships"]; - }; - "/2/users/{id}/mentions": { - /** Returns Tweet objects that mention username associated to the provided User ID */ - get: operations["usersIdMentions"]; - }; - "/2/users/{id}/muting": { - /** Returns a list of Users that are muted by the provided User ID */ - get: operations["usersIdMuting"]; - /** Causes the User (in the path) to mute the target User. The User (in the path) must match the User context authorizing the request. */ - post: operations["usersIdMute"]; - }; - "/2/users/{id}/owned_lists": { - /** Get a User's Owned Lists. */ - get: operations["listUserOwnedLists"]; - }; - "/2/users/{id}/pinned_lists": { - /** Get a User's Pinned Lists. */ - get: operations["listUserPinnedLists"]; - /** Causes a User to pin a List. */ - post: operations["listUserPin"]; - }; - "/2/users/{id}/pinned_lists/{list_id}": { - /** Causes a User to remove a pinned List. */ - delete: operations["listUserUnpin"]; - }; - "/2/users/{id}/retweets": { - /** Causes the User (in the path) to retweet the specified Tweet. The User in the path must match the User context authorizing the request. */ - post: operations["usersIdRetweets"]; - }; - "/2/users/{id}/retweets/{source_tweet_id}": { - /** Causes the User (in the path) to unretweet the specified Tweet. The User must match the User context authorizing the request */ - delete: operations["usersIdUnretweets"]; - }; - "/2/users/{id}/timelines/reverse_chronological": { - /** Returns Tweet objects that appears in the provided User ID's home timeline */ - get: operations["usersIdTimeline"]; - }; - "/2/users/{id}/tweets": { - /** Returns a list of Tweets authored by the provided User ID */ - get: operations["usersIdTweets"]; - }; - "/2/users/{source_user_id}/blocking/{target_user_id}": { - /** Causes the source User to unblock the target User. The source User must match the User context authorizing the request */ - delete: operations["usersIdUnblock"]; - }; - "/2/users/{source_user_id}/following/{target_user_id}": { - /** Causes the source User to unfollow the target User. The source User must match the User context authorizing the request */ - delete: operations["usersIdUnfollow"]; - }; - "/2/users/{source_user_id}/muting/{target_user_id}": { - /** Causes the source User to unmute the target User. The source User must match the User context authorizing the request */ - delete: operations["usersIdUnmute"]; - }; + "/2/compliance/jobs": { + /** Returns recent Compliance Jobs for a given job type and optional job status */ + get: operations["listBatchComplianceJobs"]; + /** Creates a compliance for the given job type */ + post: operations["createBatchComplianceJob"]; + }; + "/2/compliance/jobs/{id}": { + /** Returns a single Compliance Job by ID */ + get: operations["getBatchComplianceJob"]; + }; + "/2/lists": { + /** Creates a new List. */ + post: operations["listIdCreate"]; + }; + "/2/lists/{id}": { + /** Returns a List. */ + get: operations["listIdGet"]; + /** Update a List that you own. */ + put: operations["listIdUpdate"]; + /** Delete a List that you own. */ + delete: operations["listIdDelete"]; + }; + "/2/lists/{id}/followers": { + /** Returns a list of Users that follow a List by the provided List ID */ + get: operations["listGetFollowers"]; + }; + "/2/lists/{id}/members": { + /** Returns a list of Users that are members of a List by the provided List ID. */ + get: operations["listGetMembers"]; + /** Causes a User to become a member of a List. */ + post: operations["listAddMember"]; + }; + "/2/lists/{id}/members/{user_id}": { + /** Causes a User to be removed from the members of a List. */ + delete: operations["listRemoveMember"]; + }; + "/2/lists/{id}/tweets": { + /** Returns a list of Tweets associated with the provided List ID. */ + get: operations["listsIdTweets"]; + }; + "/2/openapi.json": { + /** Full OpenAPI Specification in JSON format. (See https://github.com/OAI/OpenAPI-Specification/blob/master/README.md) */ + get: operations["getOpenApiSpec"]; + }; + "/2/spaces": { + /** Returns a variety of information about the Spaces specified by the requested IDs */ + get: operations["findSpacesByIds"]; + }; + "/2/spaces/by/creator_ids": { + /** Returns a variety of information about the Spaces created by the provided User IDs */ + get: operations["findSpacesByCreatorIds"]; + }; + "/2/spaces/search": { + /** Returns Spaces that match the provided query. */ + get: operations["searchSpaces"]; + }; + "/2/spaces/{id}": { + /** Returns a variety of information about the Space specified by the requested ID */ + get: operations["findSpaceById"]; + }; + "/2/spaces/{id}/buyers": { + /** Retrieves the list of Users who purchased a ticket to the given space */ + get: operations["spaceBuyers"]; + }; + "/2/spaces/{id}/tweets": { + /** Retrieves Tweets shared in the specified Space. */ + get: operations["spaceTweets"]; + }; + "/2/tweets": { + /** Returns a variety of information about the Tweet specified by the requested ID. */ + get: operations["findTweetsById"]; + /** Causes the User to create a Tweet under the authorized account. */ + post: operations["createTweet"]; + }; + "/2/tweets/compliance/stream": { + /** Streams 100% of compliance data for Tweets */ + get: operations["getTweetsComplianceStream"]; + }; + "/2/tweets/counts/all": { + /** Returns Tweet Counts that match a search query. */ + get: operations["tweetCountsFullArchiveSearch"]; + }; + "/2/tweets/counts/recent": { + /** Returns Tweet Counts from the last 7 days that match a search query. */ + get: operations["tweetCountsRecentSearch"]; + }; + "/2/tweets/firehose/stream": { + /** Streams 100% of public Tweets. */ + get: operations["getTweetsFirehoseStream"]; + }; + "/2/tweets/label/stream": { + /** Streams 100% of labeling events applied to Tweets */ + get: operations["getTweetsLabelStream"]; + }; + "/2/tweets/sample/stream": { + /** Streams a deterministic 1% of public Tweets. */ + get: operations["sampleStream"]; + }; + "/2/tweets/sample10/stream": { + /** Streams a deterministic 10% of public Tweets. */ + get: operations["getTweetsSample10Stream"]; + }; + "/2/tweets/search/all": { + /** Returns Tweets that match a search query. */ + get: operations["tweetsFullarchiveSearch"]; + }; + "/2/tweets/search/recent": { + /** Returns Tweets from the last 7 days that match a search query. */ + get: operations["tweetsRecentSearch"]; + }; + "/2/tweets/search/stream": { + /** Streams Tweets matching the stream's active rule set. */ + get: operations["searchStream"]; + }; + "/2/tweets/search/stream/rules": { + /** Returns rules from a User's active rule set. Users can fetch all of their rules or a subset, specified by the provided rule ids. */ + get: operations["getRules"]; + /** Add or delete rules from a User's active rule set. Users can provide unique, optionally tagged rules to add. Users can delete their entire rule set or a subset specified by rule ids or values. */ + post: operations["addOrDeleteRules"]; + }; + "/2/tweets/{id}": { + /** Returns a variety of information about the Tweet specified by the requested ID. */ + get: operations["findTweetById"]; + /** Delete specified Tweet (in the path) by ID. */ + delete: operations["deleteTweetById"]; + }; + "/2/tweets/{id}/liking_users": { + /** Returns a list of Users that have liked the provided Tweet ID */ + get: operations["tweetsIdLikingUsers"]; + }; + "/2/tweets/{id}/quote_tweets": { + /** Returns a variety of information about each Tweet that quotes the Tweet specified by the requested ID. */ + get: operations["findTweetsThatQuoteATweet"]; + }; + "/2/tweets/{id}/retweeted_by": { + /** Returns a list of Users that have retweeted the provided Tweet ID */ + get: operations["tweetsIdRetweetingUsers"]; + }; + "/2/tweets/{tweet_id}/hidden": { + /** Hides or unhides a reply to an owned conversation. */ + put: operations["hideReplyById"]; + }; + "/2/users": { + /** This endpoint returns information about Users. Specify Users by their ID. */ + get: operations["findUsersById"]; + }; + "/2/users/by": { + /** This endpoint returns information about Users. Specify Users by their username. */ + get: operations["findUsersByUsername"]; + }; + "/2/users/by/username/{username}": { + /** This endpoint returns information about a User. Specify User by username. */ + get: operations["findUserByUsername"]; + }; + "/2/users/compliance/stream": { + /** Streams 100% of compliance data for Users */ + get: operations["getUsersComplianceStream"]; + }; + "/2/users/me": { + /** This endpoint returns information about the requesting User. */ + get: operations["findMyUser"]; + }; + "/2/users/{id}": { + /** This endpoint returns information about a User. Specify User by ID. */ + get: operations["findUserById"]; + }; + "/2/users/{id}/blocking": { + /** Returns a list of Users that are blocked by the provided User ID */ + get: operations["usersIdBlocking"]; + /** Causes the User (in the path) to block the target User. The User (in the path) must match the User context authorizing the request */ + post: operations["usersIdBlock"]; + }; + "/2/users/{id}/bookmarks": { + /** Returns Tweet objects that have been bookmarked by the requesting User */ + get: operations["getUsersIdBookmarks"]; + /** Adds a Tweet (ID in the body) to the requesting User's (in the path) bookmarks */ + post: operations["postUsersIdBookmarks"]; + }; + "/2/users/{id}/bookmarks/{tweet_id}": { + /** Removes a Tweet from the requesting User's bookmarked Tweets. */ + delete: operations["usersIdBookmarksDelete"]; + }; + "/2/users/{id}/followed_lists": { + /** Returns a User's followed Lists. */ + get: operations["userFollowedLists"]; + /** Causes a User to follow a List. */ + post: operations["listUserFollow"]; + }; + "/2/users/{id}/followed_lists/{list_id}": { + /** Causes a User to unfollow a List. */ + delete: operations["listUserUnfollow"]; + }; + "/2/users/{id}/followers": { + /** Returns a list of Users who are followers of the specified User ID. */ + get: operations["usersIdFollowers"]; + }; + "/2/users/{id}/following": { + /** Returns a list of Users that are being followed by the provided User ID */ + get: operations["usersIdFollowing"]; + /** Causes the User(in the path) to follow, or “request to follow” for protected Users, the target User. The User(in the path) must match the User context authorizing the request */ + post: operations["usersIdFollow"]; + }; + "/2/users/{id}/liked_tweets": { + /** Returns a list of Tweets liked by the provided User ID */ + get: operations["usersIdLikedTweets"]; + }; + "/2/users/{id}/likes": { + /** Causes the User (in the path) to like the specified Tweet. The User in the path must match the User context authorizing the request. */ + post: operations["usersIdLike"]; + }; + "/2/users/{id}/likes/{tweet_id}": { + /** Causes the User (in the path) to unlike the specified Tweet. The User must match the User context authorizing the request */ + delete: operations["usersIdUnlike"]; + }; + "/2/users/{id}/list_memberships": { + /** Get a User's List Memberships. */ + get: operations["getUserListMemberships"]; + }; + "/2/users/{id}/mentions": { + /** Returns Tweet objects that mention username associated to the provided User ID */ + get: operations["usersIdMentions"]; + }; + "/2/users/{id}/muting": { + /** Returns a list of Users that are muted by the provided User ID */ + get: operations["usersIdMuting"]; + /** Causes the User (in the path) to mute the target User. The User (in the path) must match the User context authorizing the request. */ + post: operations["usersIdMute"]; + }; + "/2/users/{id}/owned_lists": { + /** Get a User's Owned Lists. */ + get: operations["listUserOwnedLists"]; + }; + "/2/users/{id}/pinned_lists": { + /** Get a User's Pinned Lists. */ + get: operations["listUserPinnedLists"]; + /** Causes a User to pin a List. */ + post: operations["listUserPin"]; + }; + "/2/users/{id}/pinned_lists/{list_id}": { + /** Causes a User to remove a pinned List. */ + delete: operations["listUserUnpin"]; + }; + "/2/users/{id}/retweets": { + /** Causes the User (in the path) to retweet the specified Tweet. The User in the path must match the User context authorizing the request. */ + post: operations["usersIdRetweets"]; + }; + "/2/users/{id}/retweets/{source_tweet_id}": { + /** Causes the User (in the path) to unretweet the specified Tweet. The User must match the User context authorizing the request */ + delete: operations["usersIdUnretweets"]; + }; + "/2/users/{id}/timelines/reverse_chronological": { + /** Returns Tweet objects that appears in the provided User ID's home timeline */ + get: operations["usersIdTimeline"]; + }; + "/2/users/{id}/tweets": { + /** Returns a list of Tweets authored by the provided User ID */ + get: operations["usersIdTweets"]; + }; + "/2/users/{source_user_id}/blocking/{target_user_id}": { + /** Causes the source User to unblock the target User. The source User must match the User context authorizing the request */ + delete: operations["usersIdUnblock"]; + }; + "/2/users/{source_user_id}/following/{target_user_id}": { + /** Causes the source User to unfollow the target User. The source User must match the User context authorizing the request */ + delete: operations["usersIdUnfollow"]; + }; + "/2/users/{source_user_id}/muting/{target_user_id}": { + /** Causes the source User to unmute the target User. The source User must match the User context authorizing the request */ + delete: operations["usersIdUnmute"]; + }; } export interface components { - schemas: { - AddOrDeleteRulesRequest: - | components["schemas"]["AddRulesRequest"] - | components["schemas"]["DeleteRulesRequest"]; - /** @description A response from modifying user-specified stream filtering rules. */ - AddOrDeleteRulesResponse: { - /** @description All user-specified stream filtering rules that were created. */ - data?: components["schemas"]["Rule"][]; - errors?: components["schemas"]["Problem"][]; - meta: components["schemas"]["RulesResponseMetadata"]; - }; - /** @description A request to add a user-specified stream filtering rule. */ - AddRulesRequest: { - add: components["schemas"]["RuleNoId"][]; - }; - /** - * Format: int32 - * @description The sum of results returned in this response. - */ - Aggregate: number; - AnimatedGif: components["schemas"]["Media"] & { - /** Format: uri */ - preview_image_url?: string; - variants?: components["schemas"]["Variants"]; - }; - BlockUserMutationResponse: { - data?: { - blocking?: boolean; - }; - errors?: components["schemas"]["Problem"][]; - }; - BlockUserRequest: { - target_user_id: components["schemas"]["UserId"]; - }; - BookmarkAddRequest: { - tweet_id: components["schemas"]["TweetId"]; - }; - BookmarkMutationResponse: { - data?: { - bookmarked?: boolean; - }; - errors?: components["schemas"]["Problem"][]; - }; - CashtagEntity: components["schemas"]["EntityIndicesInclusiveExclusive"] & - components["schemas"]["CashtagFields"]; - /** @description Represent the portion of text recognized as a Cashtag, and its start and end position within the text. */ - CashtagFields: { - /** @example TWTR */ - tag: string; - }; - /** @description Your client has gone away. */ - ClientDisconnectedProblem: components["schemas"]["Problem"]; - /** @description A problem that indicates your client is forbidden from making this request. */ - ClientForbiddenProblem: components["schemas"]["Problem"] & { - /** @enum {string} */ - reason?: "official-client-forbidden" | "client-not-enrolled"; - /** Format: uri */ - registration_url?: string; - }; - ComplianceJob: { - created_at: components["schemas"]["CreatedAt"]; - download_expires_at: components["schemas"]["DownloadExpiration"]; - download_url: components["schemas"]["DownloadUrl"]; - id: components["schemas"]["JobId"]; - name?: components["schemas"]["ComplianceJobName"]; - status: components["schemas"]["ComplianceJobStatus"]; - type: components["schemas"]["ComplianceJobType"]; - upload_expires_at: components["schemas"]["UploadExpiration"]; - upload_url: components["schemas"]["UploadUrl"]; - }; - /** - * @description User-provided name for a compliance job. - * @example my-job - */ - ComplianceJobName: string; - /** - * @description Status of a compliance job. - * @enum {string} - */ - ComplianceJobStatus: - | "created" - | "in_progress" - | "failed" - | "complete" - | "expired"; - /** - * @description Type of compliance job to list. - * @enum {string} - */ - ComplianceJobType: "tweets" | "users"; - /** @description You cannot create a new job if one is already in progress. */ - ConflictProblem: components["schemas"]["Problem"]; - /** @description A problem that indicates something is wrong with the connection. */ - ConnectionExceptionProblem: components["schemas"]["Problem"] & { - /** @enum {string} */ - connection_issue?: - | "TooManyConnections" - | "ProvisioningSubscription" - | "RuleConfigurationIssue" - | "RulesInvalidIssue"; - }; - /** @description Annotation inferred from the Tweet text. */ - ContextAnnotation: { - domain: components["schemas"]["ContextAnnotationDomainFields"]; - entity: components["schemas"]["ContextAnnotationEntityFields"]; - }; - /** @description Represents the data for the context annotation domain. */ - ContextAnnotationDomainFields: { - /** @description Description of the context annotation domain. */ - description?: string; - /** @description The unique id for a context annotation domain. */ - id: string; - /** @description Name of the context annotation domain. */ - name?: string; - }; - /** @description Represents the data for the context annotation entity. */ - ContextAnnotationEntityFields: { - /** @description Description of the context annotation entity. */ - description?: string; - /** @description The unique id for a context annotation entity. */ - id: string; - /** @description Name of the context annotation entity. */ - name?: string; - }; - /** - * @description A two-letter ISO 3166-1 alpha-2 country code. - * @example US - */ - CountryCode: string; - /** @description A request to create a new batch compliance job. */ - CreateComplianceJobRequest: { - name?: components["schemas"]["ComplianceJobName"]; - /** @description If true, this endpoint will return a pre-signed URL with resumable uploads enabled. */ - resumable?: boolean; - /** - * @description Type of compliance job to list. - * @enum {string} - */ - type: "tweets" | "users"; - }; - CreateComplianceJobResponse: { - data?: components["schemas"]["ComplianceJob"]; - errors?: components["schemas"]["Problem"][]; - }; - /** - * Format: date-time - * @description Creation time of the compliance job. - * @example 2021-01-06T18:40:40.000Z - */ - CreatedAt: string; - /** @description A response from deleting user-specified stream filtering rules. */ - DeleteRulesRequest: { - /** @description IDs and values of all deleted user-specified stream filtering rules. */ - delete: { - /** @description IDs of all deleted user-specified stream filtering rules. */ - ids?: components["schemas"]["RuleId"][]; - /** @description Values of all deleted user-specified stream filtering rules. */ - values?: components["schemas"]["RuleValue"][]; - }; - }; - /** @description A problem that indicates that the resource requested violates the precepts of this API. */ - DisallowedResourceProblem: components["schemas"]["Problem"] & { - resource_id: string; - /** @enum {string} */ - resource_type: "user" | "tweet" | "media" | "list" | "space"; - /** @enum {string} */ - section: "data" | "includes"; - }; - /** - * Format: date-time - * @description Expiration time of the download URL. - * @example 2021-01-06T18:40:40.000Z - */ - DownloadExpiration: string; - /** - * Format: uri - * @description URL from which the user will retrieve their compliance results. - */ - DownloadUrl: string; - /** @description The rule you have submitted is a duplicate. */ - DuplicateRuleProblem: components["schemas"]["Problem"] & { - id?: string; - value?: string; - }; - /** - * Format: date-time - * @description The end time of the bucket. - */ - End: string; - /** @description Represent a boundary range (start and end index) for a recognized entity (for example a hashtag or a mention). `start` must be smaller than `end`. The start index is inclusive, the end index is exclusive. */ - EntityIndicesInclusiveExclusive: { - /** - * @description Index (zero-based) at which position this entity ends. The index is exclusive. - * @example 61 - */ - end: number; - /** - * @description Index (zero-based) at which position this entity starts. The index is inclusive. - * @example 50 - */ - start: number; - }; - /** @description Represent a boundary range (start and end index) for a recognized entity (for example a hashtag or a mention). `start` must be smaller than `end`. The start index is inclusive, the end index is inclusive. */ - EntityIndicesInclusiveInclusive: { - /** - * @description Index (zero-based) at which position this entity ends. The index is inclusive. - * @example 61 - */ - end: number; - /** - * @description Index (zero-based) at which position this entity starts. The index is inclusive. - * @example 50 - */ - start: number; - }; - Error: { - /** Format: int32 */ - code: number; - message: string; - }; - Expansions: { - media?: components["schemas"]["Media"][]; - places?: components["schemas"]["Place"][]; - polls?: components["schemas"]["Poll"][]; - topics?: components["schemas"]["Topic"][]; - tweets?: components["schemas"]["Tweet"][]; - users?: components["schemas"]["User"][]; - }; - /** @description A problem that indicates that you are not allowed to see a particular field on a Tweet, User, etc. */ - FieldUnauthorizedProblem: components["schemas"]["Problem"] & { - field: string; - /** @enum {string} */ - resource_type: "user" | "tweet" | "media" | "list" | "space"; - /** @enum {string} */ - section: "data" | "includes"; - }; - /** @description A Tweet or error that can be returned by the streaming Tweet API. The values returned with a successful streamed Tweet includes the user provided rules that the Tweet matched. */ - FilteredStreamingTweetResponse: { - data?: components["schemas"]["Tweet"]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - /** @description The list of rules which matched the Tweet */ - matching_rules?: { - id: components["schemas"]["RuleId"]; - tag?: components["schemas"]["RuleTag"]; - }[]; - }; - FullTextEntities: { - annotations?: (components["schemas"]["EntityIndicesInclusiveInclusive"] & { - /** - * @description Text used to determine annotation. - * @example Barack Obama - */ - normalized_text?: string; - /** - * Format: double - * @description Confidence factor for annotation type. - */ - probability?: number; - /** - * @description Annotation type. - * @example Person - */ - type?: string; - })[]; - cashtags?: components["schemas"]["CashtagEntity"][]; - hashtags?: components["schemas"]["HashtagEntity"][]; - mentions?: components["schemas"]["MentionEntity"][]; - urls?: components["schemas"]["UrlEntity"][]; - }; - /** @description A generic problem with no additional information beyond that provided by the HTTP status code. */ - GenericProblem: components["schemas"]["Problem"]; - Geo: { - /** - * @example [ - * -105.193475, - * 39.60973, - * -105.053164, - * 39.761974 - * ] - */ - bbox: number[]; - geometry?: components["schemas"]["Point"]; - properties: { [key: string]: unknown }; - /** @enum {string} */ - type: "Feature"; - }; - Get2ComplianceJobsIdResponse: { - data?: components["schemas"]["ComplianceJob"]; - errors?: components["schemas"]["Problem"][]; - }; - Get2ComplianceJobsResponse: { - data?: components["schemas"]["ComplianceJob"][]; - errors?: components["schemas"]["Problem"][]; - meta?: { - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2ListsIdFollowersResponse: { - data?: components["schemas"]["User"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - next_token?: components["schemas"]["NextToken"]; - previous_token?: components["schemas"]["PreviousToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2ListsIdMembersResponse: { - data?: components["schemas"]["User"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - next_token?: components["schemas"]["NextToken"]; - previous_token?: components["schemas"]["PreviousToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2ListsIdResponse: { - data?: components["schemas"]["List"]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - }; - Get2ListsIdTweetsResponse: { - data?: components["schemas"]["Tweet"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - next_token?: components["schemas"]["NextToken"]; - previous_token?: components["schemas"]["PreviousToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2SpacesByCreatorIdsResponse: { - data?: components["schemas"]["Space"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2SpacesIdBuyersResponse: { - data?: components["schemas"]["User"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - next_token?: components["schemas"]["NextToken"]; - previous_token?: components["schemas"]["PreviousToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2SpacesIdResponse: { - data?: components["schemas"]["Space"]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - }; - Get2SpacesIdTweetsResponse: { - data?: components["schemas"]["Tweet"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - next_token?: components["schemas"]["NextToken"]; - previous_token?: components["schemas"]["PreviousToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2SpacesResponse: { - data?: components["schemas"]["Space"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - }; - Get2SpacesSearchResponse: { - data?: components["schemas"]["Space"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2TweetsCountsAllResponse: { - data?: components["schemas"]["SearchCount"][]; - errors?: components["schemas"]["Problem"][]; - meta?: { - newest_id?: components["schemas"]["NewestId"]; - next_token?: components["schemas"]["NextToken"]; - oldest_id?: components["schemas"]["OldestId"]; - total_tweet_count?: components["schemas"]["Aggregate"]; - }; - }; - Get2TweetsCountsRecentResponse: { - data?: components["schemas"]["SearchCount"][]; - errors?: components["schemas"]["Problem"][]; - meta?: { - newest_id?: components["schemas"]["NewestId"]; - next_token?: components["schemas"]["NextToken"]; - oldest_id?: components["schemas"]["OldestId"]; - total_tweet_count?: components["schemas"]["Aggregate"]; - }; - }; - Get2TweetsFirehoseStreamResponse: { - data?: components["schemas"]["Tweet"]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - }; - Get2TweetsIdLikingUsersResponse: { - data?: components["schemas"]["User"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - next_token?: components["schemas"]["NextToken"]; - previous_token?: components["schemas"]["PreviousToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2TweetsIdQuoteTweetsResponse: { - data?: components["schemas"]["Tweet"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - next_token?: components["schemas"]["NextToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2TweetsIdResponse: { - data?: components["schemas"]["Tweet"]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - }; - Get2TweetsIdRetweetedByResponse: { - data?: components["schemas"]["User"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - next_token?: components["schemas"]["NextToken"]; - previous_token?: components["schemas"]["PreviousToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2TweetsResponse: { - data?: components["schemas"]["Tweet"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - }; - Get2TweetsSample10StreamResponse: { - data?: components["schemas"]["Tweet"]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - }; - Get2TweetsSampleStreamResponse: { - data?: components["schemas"]["Tweet"]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - }; - Get2TweetsSearchAllResponse: { - data?: components["schemas"]["Tweet"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - newest_id?: components["schemas"]["NewestId"]; - next_token?: components["schemas"]["NextToken"]; - oldest_id?: components["schemas"]["OldestId"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2TweetsSearchRecentResponse: { - data?: components["schemas"]["Tweet"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - newest_id?: components["schemas"]["NewestId"]; - next_token?: components["schemas"]["NextToken"]; - oldest_id?: components["schemas"]["OldestId"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2TweetsSearchStreamResponse: { - data?: components["schemas"]["Tweet"]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - }; - Get2UsersByResponse: { - data?: components["schemas"]["User"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - }; - Get2UsersByUsernameUsernameResponse: { - data?: components["schemas"]["User"]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - }; - Get2UsersIdBlockingResponse: { - data?: components["schemas"]["User"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - next_token?: components["schemas"]["NextToken"]; - previous_token?: components["schemas"]["PreviousToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2UsersIdBookmarksResponse: { - data?: components["schemas"]["Tweet"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - next_token?: components["schemas"]["NextToken"]; - previous_token?: components["schemas"]["PreviousToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2UsersIdFollowedListsResponse: { - data?: components["schemas"]["List"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - next_token?: components["schemas"]["NextToken"]; - previous_token?: components["schemas"]["PreviousToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2UsersIdFollowersResponse: { - data?: components["schemas"]["User"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - next_token?: components["schemas"]["NextToken"]; - previous_token?: components["schemas"]["PreviousToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2UsersIdFollowingResponse: { - data?: components["schemas"]["User"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - next_token?: components["schemas"]["NextToken"]; - previous_token?: components["schemas"]["PreviousToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2UsersIdLikedTweetsResponse: { - data?: components["schemas"]["Tweet"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - next_token?: components["schemas"]["NextToken"]; - previous_token?: components["schemas"]["PreviousToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2UsersIdListMembershipsResponse: { - data?: components["schemas"]["List"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - next_token?: components["schemas"]["NextToken"]; - previous_token?: components["schemas"]["PreviousToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2UsersIdMentionsResponse: { - data?: components["schemas"]["Tweet"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - newest_id?: components["schemas"]["NewestId"]; - next_token?: components["schemas"]["NextToken"]; - oldest_id?: components["schemas"]["OldestId"]; - previous_token?: components["schemas"]["PreviousToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2UsersIdMutingResponse: { - data?: components["schemas"]["User"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - next_token?: components["schemas"]["NextToken"]; - previous_token?: components["schemas"]["PreviousToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2UsersIdOwnedListsResponse: { - data?: components["schemas"]["List"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - next_token?: components["schemas"]["NextToken"]; - previous_token?: components["schemas"]["PreviousToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2UsersIdPinnedListsResponse: { - data?: components["schemas"]["List"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2UsersIdResponse: { - data?: components["schemas"]["User"]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - }; - Get2UsersIdTimelinesReverseChronologicalResponse: { - data?: components["schemas"]["Tweet"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - newest_id?: components["schemas"]["NewestId"]; - next_token?: components["schemas"]["NextToken"]; - oldest_id?: components["schemas"]["OldestId"]; - previous_token?: components["schemas"]["PreviousToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2UsersIdTweetsResponse: { - data?: components["schemas"]["Tweet"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - meta?: { - newest_id?: components["schemas"]["NewestId"]; - next_token?: components["schemas"]["NextToken"]; - oldest_id?: components["schemas"]["OldestId"]; - previous_token?: components["schemas"]["PreviousToken"]; - result_count?: components["schemas"]["ResultCount"]; - }; - }; - Get2UsersMeResponse: { - data?: components["schemas"]["User"]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - }; - Get2UsersResponse: { - data?: components["schemas"]["User"][]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - }; - HashtagEntity: components["schemas"]["EntityIndicesInclusiveExclusive"] & - components["schemas"]["HashtagFields"]; - /** @description Represent the portion of text recognized as a Hashtag, and its start and end position within the text. */ - HashtagFields: { - /** - * @description The text of the Hashtag. - * @example MondayMotivation - */ - tag: string; - }; - /** @description HTTP Status Code. */ - HttpStatusCode: number; - /** @description A problem that indicates this request is invalid. */ - InvalidRequestProblem: components["schemas"]["Problem"] & { - errors?: { - message?: string; - parameters?: { [key: string]: string[] }; - }[]; - }; - /** @description The rule you have submitted is invalid. */ - InvalidRuleProblem: components["schemas"]["Problem"]; - /** - * @description Compliance Job ID. - * @example 1372966999991541762 - */ - JobId: string; - /** @description A Twitter List is a curated group of accounts. */ - List: { - /** Format: date-time */ - created_at?: string; - description?: string; - follower_count?: number; - id: components["schemas"]["ListId"]; - member_count?: number; - /** @description The name of this List. */ - name: string; - owner_id?: components["schemas"]["UserId"]; - private?: boolean; - }; - ListAddUserRequest: { - user_id: components["schemas"]["UserId"]; - }; - ListCreateRequest: { - description?: string; - name: string; - /** @default false */ - private?: boolean; - }; - ListCreateResponse: { - /** @description A Twitter List is a curated group of accounts. */ - data?: { - id: components["schemas"]["ListId"]; - /** @description The name of this List. */ - name: string; - }; - errors?: components["schemas"]["Problem"][]; - }; - ListDeleteResponse: { - data?: { - deleted?: boolean; - }; - errors?: components["schemas"]["Problem"][]; - }; - ListFollowedRequest: { - list_id: components["schemas"]["ListId"]; - }; - ListFollowedResponse: { - data?: { - following?: boolean; - }; - errors?: components["schemas"]["Problem"][]; - }; - /** - * @description The unique identifier of this List. - * @example 1146654567674912769 - */ - ListId: string; - ListMutateResponse: { - data?: { - is_member?: boolean; - }; - errors?: components["schemas"]["Problem"][]; - }; - ListPinnedRequest: { - list_id: components["schemas"]["ListId"]; - }; - ListPinnedResponse: { - data?: { - pinned?: boolean; - }; - errors?: components["schemas"]["Problem"][]; - }; - ListUnpinResponse: { - data?: { - pinned?: boolean; - }; - errors?: components["schemas"]["Problem"][]; - }; - ListUpdateRequest: { - description?: string; - name?: string; - private?: boolean; - }; - ListUpdateResponse: { - data?: { - updated?: boolean; - }; - errors?: components["schemas"]["Problem"][]; - }; - Media: { - height?: components["schemas"]["MediaHeight"]; - media_key?: components["schemas"]["MediaKey"]; - type: string; - width?: components["schemas"]["MediaWidth"]; - }; - /** @description The height of the media in pixels. */ - MediaHeight: number; - /** - * @description The unique identifier of this Media. - * @example 1146654567674912769 - */ - MediaId: string; - /** @description The Media Key identifier for this attachment. */ - MediaKey: string; - /** @description The width of the media in pixels. */ - MediaWidth: number; - MentionEntity: components["schemas"]["EntityIndicesInclusiveExclusive"] & - components["schemas"]["MentionFields"]; - /** @description Represent the portion of text recognized as a User mention, and its start and end position within the text. */ - MentionFields: { - id?: components["schemas"]["UserId"]; - username: components["schemas"]["UserName"]; - }; - MuteUserMutationResponse: { - data?: { - muting?: boolean; - }; - errors?: components["schemas"]["Problem"][]; - }; - MuteUserRequest: { - target_user_id: components["schemas"]["UserId"]; - }; - /** @description The newest id in this response. */ - NewestId: string; - /** @description The next token. */ - NextToken: string; - /** @description A problem that indicates the user's rule set is not compliant. */ - NonCompliantRulesProblem: components["schemas"]["Problem"]; - /** @description The oldest id in this response. */ - OldestId: string; - /** @description You have been disconnected for operational reasons. */ - OperationalDisconnectProblem: components["schemas"]["Problem"] & { - /** @enum {string} */ - disconnect_type?: - | "OperationalDisconnect" - | "UpstreamOperationalDisconnect" - | "ForceDisconnect" - | "UpstreamUncleanDisconnect" - | "SlowReader" - | "InternalError" - | "ClientApplicationStateDegraded" - | "InvalidRules"; - }; - /** @description A base32 pagination token. */ - PaginationToken32: string; - /** @description A base36 pagination token. */ - PaginationToken36: string; - /** @description A 'long' pagination token. */ - PaginationTokenLong: string; - Photo: components["schemas"]["Media"] & { - alt_text?: string; - /** Format: uri */ - url?: string; - }; - Place: { - contained_within?: components["schemas"]["PlaceId"][]; - /** - * @description The full name of the county in which this place exists. - * @example United States - */ - country?: string; - country_code?: components["schemas"]["CountryCode"]; - /** - * @description The full name of this place. - * @example Lakewood, CO - */ - full_name: string; - geo?: components["schemas"]["Geo"]; - id: components["schemas"]["PlaceId"]; - /** - * @description The human readable name of this place. - * @example Lakewood - */ - name?: string; - place_type?: components["schemas"]["PlaceType"]; - }; - /** - * @description The identifier for this place. - * @example f7eb2fa2fea288b1 - */ - PlaceId: string; - /** - * @example city - * @enum {string} - */ - PlaceType: - | "poi" - | "neighborhood" - | "city" - | "admin" - | "country" - | "unknown"; - /** @description A [GeoJson Point](https://tools.ietf.org/html/rfc7946#section-3.1.2) geometry object. */ - Point: { - coordinates: components["schemas"]["Position"]; - /** - * @example Point - * @enum {string} - */ - type: "Point"; - }; - /** @description Represent a Poll attached to a Tweet. */ - Poll: { - /** Format: int32 */ - duration_minutes?: number; - /** Format: date-time */ - end_datetime?: string; - id: components["schemas"]["PollId"]; - options: components["schemas"]["PollOption"][]; - /** @enum {string} */ - voting_status?: "open" | "closed"; - }; - /** - * @description Unique identifier of this poll. - * @example 1365059861688410112 - */ - PollId: string; - /** @description Describes a choice in a Poll object. */ - PollOption: { - label: components["schemas"]["PollOptionLabel"]; - /** @description Position of this choice in the poll. */ - position: number; - /** @description Number of users who voted for this choice. */ - votes: number; - }; - /** @description The text of a poll choice. */ - PollOptionLabel: string; - /** - * @description A [GeoJson Position](https://tools.ietf.org/html/rfc7946#section-3.1.1) in the format `[longitude,latitude]`. - * @example [ - * -105.18816086351444, - * 40.247749999999996 - * ] - */ - Position: number[]; - /** @description The previous token. */ - PreviousToken: string; - /** @description An HTTP Problem Details object, as defined in IETF RFC 7807 (https://tools.ietf.org/html/rfc7807). */ - Problem: { - detail?: string; - status?: number; - title: string; - type: string; - }; - /** - * @description Shows who can reply a Tweet. Fields returned are everyone, mentioned_users, and following. - * @enum {string} - */ - ReplySettings: "everyone" | "mentionedUsers" | "following" | "other"; - /** @description A problem that indicates that a given Tweet, User, etc. does not exist. */ - ResourceNotFoundProblem: components["schemas"]["Problem"] & { - parameter: string; - resource_id: string; - /** @enum {string} */ - resource_type: "user" | "tweet" | "media" | "list" | "space"; - /** @description Value will match the schema of the field. */ - value: string; - }; - /** @description A problem that indicates you are not allowed to see a particular Tweet, User, etc. */ - ResourceUnauthorizedProblem: components["schemas"]["Problem"] & { - parameter: string; - resource_id: string; - /** @enum {string} */ - resource_type: "user" | "tweet" | "media" | "list" | "space"; - /** @enum {string} */ - section: "data" | "includes"; - value: string; - }; - /** @description A problem that indicates a particular Tweet, User, etc. is not available to you. */ - ResourceUnavailableProblem: components["schemas"]["Problem"] & { - parameter: string; - resource_id: string; - /** @enum {string} */ - resource_type: "user" | "tweet" | "media" | "list" | "space"; - }; - /** - * Format: int32 - * @description The number of results returned in this response. - */ - ResultCount: number; - /** @description A user-provided stream filtering rule. */ - Rule: { - id?: components["schemas"]["RuleId"]; - tag?: components["schemas"]["RuleTag"]; - value: components["schemas"]["RuleValue"]; - }; - /** - * @description Unique identifier of this rule. - * @example 120897978112909812 - */ - RuleId: string; - /** @description A user-provided stream filtering rule. */ - RuleNoId: { - tag?: components["schemas"]["RuleTag"]; - value: components["schemas"]["RuleValue"]; - }; - /** - * @description A tag meant for the labeling of user provided rules. - * @example Non-retweeted coffee Tweets - */ - RuleTag: string; - /** - * @description The filterlang value of the rule. - * @example coffee -is:retweet - */ - RuleValue: string; - /** @description You have exceeded the maximum number of rules. */ - RulesCapProblem: components["schemas"]["Problem"]; - RulesLookupResponse: { - data?: components["schemas"]["Rule"][]; - meta: components["schemas"]["RulesResponseMetadata"]; - }; - RulesRequestSummary: - | { - /** - * Format: int32 - * @description Number of user-specified stream filtering rules that were created. - * @example 1 - */ - created: number; - /** - * Format: int32 - * @description Number of invalid user-specified stream filtering rules. - * @example 1 - */ - invalid: number; - /** - * Format: int32 - * @description Number of user-specified stream filtering rules that were not created. - * @example 1 - */ - not_created: number; - /** - * Format: int32 - * @description Number of valid user-specified stream filtering rules. - * @example 1 - */ - valid: number; - } - | { - /** - * Format: int32 - * @description Number of user-specified stream filtering rules that were deleted. - */ - deleted: number; - /** - * Format: int32 - * @description Number of user-specified stream filtering rules that were not deleted. - */ - not_deleted: number; - }; - RulesResponseMetadata: { - next_token?: components["schemas"]["NextToken"]; - /** - * Format: int32 - * @description Number of Rules in result set. - */ - result_count?: number; - sent: string; - summary?: components["schemas"]["RulesRequestSummary"]; - }; - /** @description Represent a Search Count Result. */ - SearchCount: { - end: components["schemas"]["End"]; - start: components["schemas"]["Start"]; - tweet_count: components["schemas"]["TweetCount"]; - }; - Space: { - /** - * Format: date-time - * @description Creation time of the Space. - * @example 2021-07-06T18:40:40.000Z - */ - created_at?: string; - creator_id?: components["schemas"]["UserId"]; - /** - * Format: date-time - * @description End time of the Space. - * @example 2021-07-06T18:40:40.000Z - */ - ended_at?: string; - /** @description The user ids for the hosts of the Space. */ - host_ids?: components["schemas"]["UserId"][]; - id: components["schemas"]["SpaceId"]; - /** @description An array of user ids for people who were invited to a Space. */ - invited_user_ids?: components["schemas"]["UserId"][]; - /** - * @description Denotes if the Space is a ticketed Space. - * @example false - */ - is_ticketed?: boolean; - /** - * @description The language of the Space. - * @example en - */ - lang?: string; - /** - * Format: int32 - * @description The number of participants in a Space. - * @example 10 - */ - participant_count?: number; - /** - * Format: date-time - * @description A date time stamp for when a Space is scheduled to begin. - * @example 2021-07-06T18:40:40.000Z - */ - scheduled_start?: string; - /** @description An array of user ids for people who were speakers in a Space. */ - speaker_ids?: components["schemas"]["UserId"][]; - /** - * Format: date-time - * @description When the Space was started as a date string. - * @example 2021-7-14T04:35:55Z - */ - started_at?: string; - /** - * @description The current state of the Space. - * @example live - * @enum {string} - */ - state: "live" | "scheduled" | "ended"; - /** - * Format: int32 - * @description The number of people who have either purchased a ticket or set a reminder for this Space. - * @example 10 - */ - subscriber_count?: number; - /** - * @description The title of the Space. - * @example Spaces are Awesome - */ - title?: string; - /** @description The topics of a Space, as selected by its creator. */ - topics?: { - /** @description The description of the given topic. */ - description?: string; - /** @description An ID suitable for use in the REST API. */ - id: string; - /** @description The name of the given topic. */ - name: string; - }[]; - /** - * Format: date-time - * @description When the Space was last updated. - * @example 2021-7-14T04:35:55Z - */ - updated_at?: string; - }; - /** - * @description The unique identifier of this Space. - * @example 1SLjjRYNejbKM - */ - SpaceId: string; - /** - * Format: date-time - * @description The start time of the bucket. - */ - Start: string; - StreamingTweetResponse: { - data?: components["schemas"]["Tweet"]; - errors?: components["schemas"]["Problem"][]; - includes?: components["schemas"]["Expansions"]; - }; - /** @description The topic of a Space, as selected by its creator. */ - Topic: { - /** - * @description The description of the given topic. - * @example All about technology - */ - description?: string; - id: components["schemas"]["TopicId"]; - /** - * @description The name of the given topic. - * @example Technology - */ - name: string; - }; - /** @description Unique identifier of this Topic. */ - TopicId: string; - /** - * @example { - * "author_id": "2244994945", - * "created_at": "Wed Jan 06 18:40:40 +0000 2021", - * "id": "1346889436626259968", - * "text": "Learn how to use the user Tweet timeline and user mention timeline endpoints in the Twitter API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i" - * } - */ - Tweet: { - /** @description Specifies the type of attachments (if any) present in this Tweet. */ - attachments?: { - /** @description A list of Media Keys for each one of the media attachments (if media are attached). */ - media_keys?: components["schemas"]["MediaKey"][]; - /** @description A list of poll IDs (if polls are attached). */ - poll_ids?: components["schemas"]["PollId"][]; - }; - author_id?: components["schemas"]["UserId"]; - context_annotations?: components["schemas"]["ContextAnnotation"][]; - conversation_id?: components["schemas"]["TweetId"]; - /** - * Format: date-time - * @description Creation time of the Tweet. - * @example 2021-01-06T18:40:40.000Z - */ - created_at?: string; - edit_controls?: { - /** - * Format: date-time - * @description Time when Tweet is no longer editable. - * @example 2021-01-06T18:40:40.000Z - */ - editable_until: string; - /** @description Number of times this Tweet can be edited. */ - edits_remaining: number; - /** - * @description Indicates if this Tweet is eligible to be edited. - * @example false - */ - is_edit_eligible: boolean; - }; - /** @description A list of Tweet Ids in this Tweet chain. */ - edit_history_tweet_ids: components["schemas"]["TweetId"][]; - entities?: components["schemas"]["FullTextEntities"]; - /** @description The location tagged on the Tweet, if the user provided one. */ - geo?: { - coordinates?: components["schemas"]["Point"]; - place_id?: components["schemas"]["PlaceId"]; - }; - id: components["schemas"]["TweetId"]; - in_reply_to_user_id?: components["schemas"]["UserId"]; - /** - * @description Language of the Tweet, if detected by Twitter. Returned as a BCP47 language tag. - * @example en - */ - lang?: string; - /** @description Nonpublic engagement metrics for the Tweet at the time of the request. */ - non_public_metrics?: { - /** - * Format: int32 - * @description Number of times this Tweet has been viewed. - */ - impression_count?: number; - }; - /** @description Organic nonpublic engagement metrics for the Tweet at the time of the request. */ - organic_metrics?: { - /** @description Number of times this Tweet has been viewed. */ - impression_count: number; - /** @description Number of times this Tweet has been liked. */ - like_count: number; - /** @description Number of times this Tweet has been replied to. */ - reply_count: number; - /** @description Number of times this Tweet has been Retweeted. */ - retweet_count: number; - }; - /** - * @description Indicates if this Tweet contains URLs marked as sensitive, for example content suitable for mature audiences. - * @example false - */ - possibly_sensitive?: boolean; - /** @description Promoted nonpublic engagement metrics for the Tweet at the time of the request. */ - promoted_metrics?: { - /** - * Format: int32 - * @description Number of times this Tweet has been viewed. - */ - impression_count?: number; - /** - * Format: int32 - * @description Number of times this Tweet has been liked. - */ - like_count?: number; - /** - * Format: int32 - * @description Number of times this Tweet has been replied to. - */ - reply_count?: number; - /** - * Format: int32 - * @description Number of times this Tweet has been Retweeted. - */ - retweet_count?: number; - }; - /** @description Engagement metrics for the Tweet at the time of the request. */ - public_metrics?: { - /** @description Number of times this Tweet has been liked. */ - like_count: number; - /** @description Number of times this Tweet has been quoted. */ - quote_count?: number; - /** @description Number of times this Tweet has been replied to. */ - reply_count: number; - /** @description Number of times this Tweet has been Retweeted. */ - retweet_count: number; - }; - /** @description A list of Tweets this Tweet refers to. For example, if the parent Tweet is a Retweet, a Quoted Tweet or a Reply, it will include the related Tweet referenced to by its parent. */ - referenced_tweets?: { - id: components["schemas"]["TweetId"]; - /** @enum {string} */ - type: "retweeted" | "quoted" | "replied_to"; - }[]; - reply_settings?: components["schemas"]["ReplySettings"]; - /** @description The name of the app the user Tweeted from. */ - source?: string; - text: components["schemas"]["TweetText"]; - withheld?: components["schemas"]["TweetWithheld"]; - }; - /** @description Tweet compliance data. */ - TweetComplianceData: - | components["schemas"]["TweetDeleteComplianceSchema"] - | components["schemas"]["TweetWithheldComplianceSchema"] - | components["schemas"]["TweetDropComplianceSchema"] - | components["schemas"]["TweetUndropComplianceSchema"] - | components["schemas"]["TweetEditComplianceSchema"]; - TweetComplianceSchema: { - /** - * Format: date-time - * @description Event time. - * @example 2021-07-06T18:40:40.000Z - */ - event_at: string; - quote_tweet_id?: components["schemas"]["TweetId"]; - tweet: { - author_id: components["schemas"]["UserId"]; - id: components["schemas"]["TweetId"]; - }; - }; - /** @description Tweet compliance stream events. */ - TweetComplianceStreamResponse: - | { - data: components["schemas"]["TweetComplianceData"]; - } - | { - errors: components["schemas"]["Problem"][]; - }; - /** @description The count for the bucket. */ - TweetCount: number; - TweetCreateRequest: { - /** @description Card Uri Parameter. This is mutually exclusive from Quote Tweet Id, Poll, Media, and Direct Message Deep Link. */ - card_uri?: string; - /** @description Link to take the conversation from the public timeline to a private Direct Message. */ - direct_message_deep_link?: string; - /** - * @description Exclusive Tweet for super followers. - * @default false - */ - for_super_followers_only?: boolean; - /** @description Place ID being attached to the Tweet for geo location. */ - geo?: { - place_id?: string; - }; - /** @description Media information being attached to created Tweet. This is mutually exclusive from Quote Tweet Id, Poll, and Card URI. */ - media?: { - /** @description A list of Media Ids to be attached to a created Tweet. */ - media_ids: components["schemas"]["MediaId"][]; - /** @description A list of User Ids to be tagged in the media for created Tweet. */ - tagged_user_ids?: components["schemas"]["UserId"][]; - }; - /** - * @description Nullcasted (promoted-only) Tweets do not appear in the public timeline and are not served to followers. - * @default false - */ - nullcast?: boolean; - /** @description Poll options for a Tweet with a poll. This is mutually exclusive from Media, Quote Tweet Id, and Card URI. */ - poll?: { - /** - * Format: int32 - * @description Duration of the poll in minutes. - */ - duration_minutes: number; - options: string[]; - /** - * @description Settings to indicate who can reply to the Tweet. - * @enum {string} - */ - reply_settings?: "following" | "mentionedUsers"; - }; - quote_tweet_id?: components["schemas"]["TweetId"]; - /** @description Tweet information of the Tweet being replied to. */ - reply?: { - /** @description A list of User Ids to be excluded from the reply Tweet. */ - exclude_reply_user_ids?: components["schemas"]["UserId"][]; - in_reply_to_tweet_id: components["schemas"]["TweetId"]; - }; - /** - * @description Settings to indicate who can reply to the Tweet. - * @enum {string} - */ - reply_settings?: "following" | "mentionedUsers"; - text?: components["schemas"]["TweetText"]; - }; - TweetCreateResponse: { - data?: { - id: components["schemas"]["TweetId"]; - text: components["schemas"]["TweetText"]; - }; - errors?: components["schemas"]["Problem"][]; - }; - TweetDeleteComplianceSchema: { - delete: components["schemas"]["TweetComplianceSchema"]; - }; - TweetDeleteResponse: { - data?: { - deleted: boolean; - }; - errors?: components["schemas"]["Problem"][]; - }; - TweetDropComplianceSchema: { - drop: components["schemas"]["TweetComplianceSchema"]; - }; - TweetEditComplianceObjectSchema: { - edit_tweet_ids: components["schemas"]["TweetId"][]; - /** - * Format: date-time - * @description Event time. - * @example 2021-07-06T18:40:40.000Z - */ - event_at: string; - initial_tweet_id: components["schemas"]["TweetId"]; - tweet: { - id: components["schemas"]["TweetId"]; - }; - }; - TweetEditComplianceSchema: { - tweet_edit: components["schemas"]["TweetEditComplianceObjectSchema"]; - }; - TweetHideRequest: { - hidden: boolean; - }; - TweetHideResponse: { - data?: { - hidden?: boolean; - }; - }; - /** - * @description Unique identifier of this Tweet. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers. - * @example 1346889436626259968 - */ - TweetId: string; - /** @description Tweet label data. */ - TweetLabelData: - | components["schemas"]["TweetNoticeSchema"] - | components["schemas"]["TweetUnviewableSchema"]; - /** @description Tweet label stream events. */ - TweetLabelStreamResponse: - | { - data: components["schemas"]["TweetLabelData"]; - } - | { - errors: components["schemas"]["Problem"][]; - }; - TweetNotice: { - /** - * @description If the label is being applied or removed. Possible values are ‘apply’ or ‘remove’. - * @example apply - */ - application: string; - /** @description Information shown on the Tweet label */ - details?: string; - /** - * Format: date-time - * @description Event time. - * @example 2021-07-06T18:40:40.000Z - */ - event_at: string; - /** - * @description The type of label on the Tweet - * @example misleading - */ - event_type: string; - /** @description Link to more information about this kind of label */ - extended_details_url?: string; - /** @description Title/header of the Tweet label */ - label_title?: string; - tweet: { - author_id: components["schemas"]["UserId"]; - id: components["schemas"]["TweetId"]; - }; - }; - TweetNoticeSchema: { - public_tweet_notice: components["schemas"]["TweetNotice"]; - }; - TweetTakedownComplianceSchema: { - /** - * Format: date-time - * @description Event time. - * @example 2021-07-06T18:40:40.000Z - */ - event_at: string; - quote_tweet_id?: components["schemas"]["TweetId"]; - tweet: { - author_id: components["schemas"]["UserId"]; - id: components["schemas"]["TweetId"]; - }; - withheld_in_countries: components["schemas"]["CountryCode"][]; - }; - /** - * @description The content of the Tweet. - * @example Learn how to use the user Tweet timeline and user mention timeline endpoints in the Twitter API v2 to explore Tweet\u2026 https:\/\/t.co\/56a0vZUx7i - */ - TweetText: string; - TweetUndropComplianceSchema: { - undrop: components["schemas"]["TweetComplianceSchema"]; - }; - TweetUnviewable: { - /** - * @description If the label is being applied or removed. Possible values are ‘apply’ or ‘remove’. - * @example apply - */ - application: string; - /** - * Format: date-time - * @description Event time. - * @example 2021-07-06T18:40:40.000Z - */ - event_at: string; - tweet: { - author_id: components["schemas"]["UserId"]; - id: components["schemas"]["TweetId"]; - }; - }; - TweetUnviewableSchema: { - public_tweet_unviewable: components["schemas"]["TweetUnviewable"]; - }; - /** @description Indicates withholding details for [withheld content](https://help.twitter.com/en/rules-and-policies/tweet-withheld-by-country). */ - TweetWithheld: { - /** @description Indicates if the content is being withheld for on the basis of copyright infringement. */ - copyright: boolean; - /** @description Provides a list of countries where this content is not available. */ - country_codes: components["schemas"]["CountryCode"][]; - /** - * @description Indicates whether the content being withheld is the `tweet` or a `user`. - * @enum {string} - */ - scope?: "tweet" | "user"; - }; - TweetWithheldComplianceSchema: { - withheld: components["schemas"]["TweetTakedownComplianceSchema"]; - }; - /** @description A problem that indicates that the authentication used is not supported. */ - UnsupportedAuthenticationProblem: components["schemas"]["Problem"]; - /** - * Format: date-time - * @description Expiration time of the upload URL. - * @example 2021-01-06T18:40:40.000Z - */ - UploadExpiration: string; - /** - * Format: uri - * @description URL to which the user will upload their Tweet or user IDs. - */ - UploadUrl: string; - /** - * Format: uri - * @description A validly formatted URL. - * @example https://developer.twitter.com/en/docs/twitter-api - */ - Url: string; - /** @description Represent the portion of text recognized as a URL, and its start and end position within the text. */ - UrlEntity: components["schemas"]["EntityIndicesInclusiveExclusive"] & - components["schemas"]["UrlFields"]; - /** @description Represent the portion of text recognized as a URL. */ - UrlFields: { - /** - * @description Description of the URL landing page. - * @example This is a description of the website. - */ - description?: string; - /** - * @description The URL as displayed in the Twitter client. - * @example twittercommunity.com/t/introducing-… - */ - display_url?: string; - expanded_url?: components["schemas"]["Url"]; - images?: components["schemas"]["UrlImage"][]; - media_key?: components["schemas"]["MediaKey"]; - status?: components["schemas"]["HttpStatusCode"]; - /** - * @description Title of the page the URL points to. - * @example Introducing the v2 follow lookup endpoints - */ - title?: string; - /** - * Format: uri - * @description Fully resolved url. - * @example https://twittercommunity.com/t/introducing-the-v2-follow-lookup-endpoints/147118 - */ - unwound_url?: string; - url: components["schemas"]["Url"]; - }; - /** @description Represent the information for the URL image. */ - UrlImage: { - height?: components["schemas"]["MediaHeight"]; - url?: components["schemas"]["Url"]; - width?: components["schemas"]["MediaWidth"]; - }; - /** @description A problem that indicates that a usage cap has been exceeded. */ - UsageCapExceededProblem: components["schemas"]["Problem"] & { - /** @enum {string} */ - period?: "Daily" | "Monthly"; - /** @enum {string} */ - scope?: "Account" | "Product"; - }; - /** - * @description The Twitter User object. - * @example { - * "created_at": "2013-12-14T04:35:55Z", - * "id": "2244994945", - * "name": "Twitter Dev", - * "protected": false, - * "username": "TwitterDev" - * } - */ - User: { - /** - * Format: date-time - * @description Creation time of this User. - */ - created_at?: string; - /** @description The text of this User's profile description (also known as bio), if the User provided one. */ - description?: string; - /** @description A list of metadata found in the User's profile description. */ - entities?: { - description?: components["schemas"]["FullTextEntities"]; - /** @description Expanded details for the URL specified in the User's profile, with start and end indices. */ - url?: { - urls?: components["schemas"]["UrlEntity"][]; - }; - }; - id: components["schemas"]["UserId"]; - /** @description The location specified in the User's profile, if the User provided one. As this is a freeform value, it may not indicate a valid location, but it may be fuzzily evaluated when performing searches with location queries. */ - location?: string; - /** @description The friendly name of this User, as shown on their profile. */ - name: string; - pinned_tweet_id?: components["schemas"]["TweetId"]; - /** - * Format: uri - * @description The URL to the profile image for this User. - */ - profile_image_url?: string; - /** @description Indicates if this User has chosen to protect their Tweets (in other words, if this User's Tweets are private). */ - protected?: boolean; - /** @description A list of metrics for this User. */ - public_metrics?: { - /** @description Number of Users who are following this User. */ - followers_count: number; - /** @description Number of Users this User is following. */ - following_count: number; - /** @description The number of lists that include this User. */ - listed_count: number; - /** @description The number of Tweets (including Retweets) posted by this User. */ - tweet_count: number; - }; - /** @description The URL specified in the User's profile. */ - url?: string; - username: components["schemas"]["UserName"]; - /** @description Indicate if this User is a verified Twitter User. */ - verified?: boolean; - withheld?: components["schemas"]["UserWithheld"]; - }; - /** @description User compliance data. */ - UserComplianceData: - | components["schemas"]["UserProtectComplianceSchema"] - | components["schemas"]["UserUnprotectComplianceSchema"] - | components["schemas"]["UserDeleteComplianceSchema"] - | components["schemas"]["UserUndeleteComplianceSchema"] - | components["schemas"]["UserSuspendComplianceSchema"] - | components["schemas"]["UserUnsuspendComplianceSchema"] - | components["schemas"]["UserWithheldComplianceSchema"] - | components["schemas"]["UserScrubGeoSchema"] - | components["schemas"]["UserProfileModificationComplianceSchema"]; - UserComplianceSchema: { - /** - * Format: date-time - * @description Event time. - * @example 2021-07-06T18:40:40.000Z - */ - event_at: string; - user: { - id: components["schemas"]["UserId"]; - }; - }; - /** @description User compliance stream events. */ - UserComplianceStreamResponse: - | { - data: components["schemas"]["UserComplianceData"]; - } - | { - errors: components["schemas"]["Problem"][]; - }; - UserDeleteComplianceSchema: { - user_delete: components["schemas"]["UserComplianceSchema"]; - }; - /** - * @description Unique identifier of this User. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers. - * @example 2244994945 - */ - UserId: string; - /** - * @description Unique identifier of this User. The value must be the same as the authenticated user. - * @example 2244994945 - */ - UserIdMatchesAuthenticatedUser: string; - /** @description The Twitter handle (screen name) of this user. */ - UserName: string; - UserProfileModificationComplianceSchema: { - user_profile_modification: components["schemas"]["UserProfileModificationObjectSchema"]; - }; - UserProfileModificationObjectSchema: { - /** - * Format: date-time - * @description Event time. - * @example 2021-07-06T18:40:40.000Z - */ - event_at: string; - new_value: string; - profile_field: string; - user: { - id: components["schemas"]["UserId"]; - }; - }; - UserProtectComplianceSchema: { - user_protect: components["schemas"]["UserComplianceSchema"]; - }; - UserScrubGeoObjectSchema: { - /** - * Format: date-time - * @description Event time. - * @example 2021-07-06T18:40:40.000Z - */ - event_at: string; - up_to_tweet_id: components["schemas"]["TweetId"]; - user: { - id: components["schemas"]["UserId"]; - }; - }; - UserScrubGeoSchema: { - scrub_geo: components["schemas"]["UserScrubGeoObjectSchema"]; - }; - UserSuspendComplianceSchema: { - user_suspend: components["schemas"]["UserComplianceSchema"]; - }; - UserTakedownComplianceSchema: { - /** - * Format: date-time - * @description Event time. - * @example 2021-07-06T18:40:40.000Z - */ - event_at: string; - user: { - id: components["schemas"]["UserId"]; - }; - withheld_in_countries: components["schemas"]["CountryCode"][]; - }; - UserUndeleteComplianceSchema: { - user_undelete: components["schemas"]["UserComplianceSchema"]; - }; - UserUnprotectComplianceSchema: { - user_unprotect: components["schemas"]["UserComplianceSchema"]; - }; - UserUnsuspendComplianceSchema: { - user_unsuspend: components["schemas"]["UserComplianceSchema"]; - }; - /** @description Indicates withholding details for [withheld content](https://help.twitter.com/en/rules-and-policies/tweet-withheld-by-country). */ - UserWithheld: { - /** @description Provides a list of countries where this content is not available. */ - country_codes: components["schemas"]["CountryCode"][]; - /** - * @description Indicates that the content being withheld is a `user`. - * @enum {string} - */ - scope?: "user"; - }; - UserWithheldComplianceSchema: { - user_withheld: components["schemas"]["UserTakedownComplianceSchema"]; - }; - UsersFollowingCreateRequest: { - target_user_id: components["schemas"]["UserId"]; - }; - UsersFollowingCreateResponse: { - data?: { - following?: boolean; - pending_follow?: boolean; - }; - errors?: components["schemas"]["Problem"][]; - }; - UsersFollowingDeleteResponse: { - data?: { - following?: boolean; - }; - errors?: components["schemas"]["Problem"][]; - }; - UsersLikesCreateRequest: { - tweet_id: components["schemas"]["TweetId"]; - }; - UsersLikesCreateResponse: { - data?: { - liked?: boolean; - }; - errors?: components["schemas"]["Problem"][]; - }; - UsersLikesDeleteResponse: { - data?: { - liked?: boolean; - }; - errors?: components["schemas"]["Problem"][]; - }; - UsersRetweetsCreateRequest: { - tweet_id: components["schemas"]["TweetId"]; - }; - UsersRetweetsCreateResponse: { - data?: { - retweeted?: boolean; - }; - errors?: components["schemas"]["Problem"][]; - }; - UsersRetweetsDeleteResponse: { - data?: { - retweeted?: boolean; - }; - errors?: components["schemas"]["Problem"][]; - }; - Variant: { - /** @description The bit rate of the media. */ - bit_rate?: number; - /** @description The content type of the media. */ - content_type?: string; - /** - * Format: uri - * @description The url to the media. - */ - url?: string; - }; - /** @description An array of all available variants of the media. */ - Variants: components["schemas"]["Variant"][]; - Video: components["schemas"]["Media"] & { - duration_ms?: number; - /** @description Nonpublic engagement metrics for the Media at the time of the request. */ - non_public_metrics?: { - /** - * Format: int32 - * @description Number of users who made it through 0% of the video. - */ - playback_0_count?: number; - /** - * Format: int32 - * @description Number of users who made it through 100% of the video. - */ - playback_100_count?: number; - /** - * Format: int32 - * @description Number of users who made it through 25% of the video. - */ - playback_25_count?: number; - /** - * Format: int32 - * @description Number of users who made it through 50% of the video. - */ - playback_50_count?: number; - /** - * Format: int32 - * @description Number of users who made it through 75% of the video. - */ - playback_75_count?: number; - }; - /** @description Organic nonpublic engagement metrics for the Media at the time of the request. */ - organic_metrics?: { - /** - * Format: int32 - * @description Number of users who made it through 0% of the video. - */ - playback_0_count?: number; - /** - * Format: int32 - * @description Number of users who made it through 100% of the video. - */ - playback_100_count?: number; - /** - * Format: int32 - * @description Number of users who made it through 25% of the video. - */ - playback_25_count?: number; - /** - * Format: int32 - * @description Number of users who made it through 50% of the video. - */ - playback_50_count?: number; - /** - * Format: int32 - * @description Number of users who made it through 75% of the video. - */ - playback_75_count?: number; - /** - * Format: int32 - * @description Number of times this video has been viewed. - */ - view_count?: number; - }; - /** Format: uri */ - preview_image_url?: string; - /** @description Promoted nonpublic engagement metrics for the Media at the time of the request. */ - promoted_metrics?: { - /** - * Format: int32 - * @description Number of users who made it through 0% of the video. - */ - playback_0_count?: number; - /** - * Format: int32 - * @description Number of users who made it through 100% of the video. - */ - playback_100_count?: number; - /** - * Format: int32 - * @description Number of users who made it through 25% of the video. - */ - playback_25_count?: number; - /** - * Format: int32 - * @description Number of users who made it through 50% of the video. - */ - playback_50_count?: number; - /** - * Format: int32 - * @description Number of users who made it through 75% of the video. - */ - playback_75_count?: number; - /** - * Format: int32 - * @description Number of times this video has been viewed. - */ - view_count?: number; - }; - /** @description Engagement metrics for the Media at the time of the request. */ - public_metrics?: { - /** - * Format: int32 - * @description Number of times this video has been viewed. - */ - view_count?: number; - }; - variants?: components["schemas"]["Variants"]; - }; - }; - parameters: { - /** @description A comma separated list of ComplianceJob fields to display. */ - ComplianceJobFieldsParameter: ( - | "created_at" - | "download_expires_at" - | "download_url" - | "id" - | "name" - | "resumable" - | "status" - | "type" - | "upload_expires_at" - | "upload_url" - )[]; - /** @description A comma separated list of fields to expand. */ - ListExpansionsParameter: "owner_id"[]; - /** @description A comma separated list of List fields to display. */ - ListFieldsParameter: ( - | "created_at" - | "description" - | "follower_count" - | "id" - | "member_count" - | "name" - | "owner_id" - | "private" - )[]; - /** @description A comma separated list of Media fields to display. */ - MediaFieldsParameter: ( - | "alt_text" - | "duration_ms" - | "height" - | "media_key" - | "non_public_metrics" - | "organic_metrics" - | "preview_image_url" - | "promoted_metrics" - | "public_metrics" - | "type" - | "url" - | "variants" - | "width" - )[]; - /** @description A comma separated list of Place fields to display. */ - PlaceFieldsParameter: ( - | "contained_within" - | "country" - | "country_code" - | "full_name" - | "geo" - | "id" - | "name" - | "place_type" - )[]; - /** @description A comma separated list of Poll fields to display. */ - PollFieldsParameter: ( - | "duration_minutes" - | "end_datetime" - | "id" - | "options" - | "voting_status" - )[]; - /** @description A comma separated list of SearchCount fields to display. */ - SearchCountFieldsParameter: ("end" | "start" | "tweet_count")[]; - /** @description A comma separated list of fields to expand. */ - SpaceExpansionsParameter: ( - | "creator_id" - | "host_ids" - | "invited_user_ids" - | "speaker_ids" - | "topic_ids" - )[]; - /** @description A comma separated list of Space fields to display. */ - SpaceFieldsParameter: ( - | "created_at" - | "creator_id" - | "ended_at" - | "host_ids" - | "id" - | "invited_user_ids" - | "is_ticketed" - | "lang" - | "participant_count" - | "scheduled_start" - | "speaker_ids" - | "started_at" - | "state" - | "subscriber_count" - | "title" - | "topic_ids" - | "updated_at" - )[]; - /** @description A comma separated list of Topic fields to display. */ - TopicFieldsParameter: ("description" | "id" | "name")[]; - /** @description A comma separated list of fields to expand. */ - TweetExpansionsParameter: ( - | "attachments.media_keys" - | "attachments.poll_ids" - | "author_id" - | "edit_history_tweet_ids" - | "entities.mentions.username" - | "geo.place_id" - | "in_reply_to_user_id" - | "referenced_tweets.id" - | "referenced_tweets.id.author_id" - )[]; - /** @description A comma separated list of Tweet fields to display. */ - TweetFieldsParameter: ( - | "attachments" - | "author_id" - | "context_annotations" - | "conversation_id" - | "created_at" - | "edit_controls" - | "edit_history_tweet_ids" - | "entities" - | "geo" - | "id" - | "in_reply_to_user_id" - | "lang" - | "non_public_metrics" - | "organic_metrics" - | "possibly_sensitive" - | "promoted_metrics" - | "public_metrics" - | "referenced_tweets" - | "reply_settings" - | "source" - | "text" - | "withheld" - )[]; - /** @description A comma separated list of fields to expand. */ - UserExpansionsParameter: "pinned_tweet_id"[]; - /** @description A comma separated list of User fields to display. */ - UserFieldsParameter: ( - | "created_at" - | "description" - | "entities" - | "id" - | "location" - | "name" - | "pinned_tweet_id" - | "profile_image_url" - | "protected" - | "public_metrics" - | "url" - | "username" - | "verified" - | "withheld" - )[]; - }; + schemas: { + AddOrDeleteRulesRequest: + | components["schemas"]["AddRulesRequest"] + | components["schemas"]["DeleteRulesRequest"]; + /** @description A response from modifying user-specified stream filtering rules. */ + AddOrDeleteRulesResponse: { + /** @description All user-specified stream filtering rules that were created. */ + data?: components["schemas"]["Rule"][]; + errors?: components["schemas"]["Problem"][]; + meta: components["schemas"]["RulesResponseMetadata"]; + }; + /** @description A request to add a user-specified stream filtering rule. */ + AddRulesRequest: { + add: components["schemas"]["RuleNoId"][]; + }; + /** + * Format: int32 + * @description The sum of results returned in this response. + */ + Aggregate: number; + AnimatedGif: components["schemas"]["Media"] & { + /** Format: uri */ + preview_image_url?: string; + variants?: components["schemas"]["Variants"]; + }; + BlockUserMutationResponse: { + data?: { + blocking?: boolean; + }; + errors?: components["schemas"]["Problem"][]; + }; + BlockUserRequest: { + target_user_id: components["schemas"]["UserId"]; + }; + BookmarkAddRequest: { + tweet_id: components["schemas"]["TweetId"]; + }; + BookmarkMutationResponse: { + data?: { + bookmarked?: boolean; + }; + errors?: components["schemas"]["Problem"][]; + }; + CashtagEntity: components["schemas"]["EntityIndicesInclusiveExclusive"] & + components["schemas"]["CashtagFields"]; + /** @description Represent the portion of text recognized as a Cashtag, and its start and end position within the text. */ + CashtagFields: { + /** @example TWTR */ + tag: string; + }; + /** @description Your client has gone away. */ + ClientDisconnectedProblem: components["schemas"]["Problem"]; + /** @description A problem that indicates your client is forbidden from making this request. */ + ClientForbiddenProblem: components["schemas"]["Problem"] & { + /** @enum {string} */ + reason?: "official-client-forbidden" | "client-not-enrolled"; + /** Format: uri */ + registration_url?: string; + }; + ComplianceJob: { + created_at: components["schemas"]["CreatedAt"]; + download_expires_at: components["schemas"]["DownloadExpiration"]; + download_url: components["schemas"]["DownloadUrl"]; + id: components["schemas"]["JobId"]; + name?: components["schemas"]["ComplianceJobName"]; + status: components["schemas"]["ComplianceJobStatus"]; + type: components["schemas"]["ComplianceJobType"]; + upload_expires_at: components["schemas"]["UploadExpiration"]; + upload_url: components["schemas"]["UploadUrl"]; + }; + /** + * @description User-provided name for a compliance job. + * @example my-job + */ + ComplianceJobName: string; + /** + * @description Status of a compliance job. + * @enum {string} + */ + ComplianceJobStatus: + | "created" + | "in_progress" + | "failed" + | "complete" + | "expired"; + /** + * @description Type of compliance job to list. + * @enum {string} + */ + ComplianceJobType: "tweets" | "users"; + /** @description You cannot create a new job if one is already in progress. */ + ConflictProblem: components["schemas"]["Problem"]; + /** @description A problem that indicates something is wrong with the connection. */ + ConnectionExceptionProblem: components["schemas"]["Problem"] & { + /** @enum {string} */ + connection_issue?: + | "TooManyConnections" + | "ProvisioningSubscription" + | "RuleConfigurationIssue" + | "RulesInvalidIssue"; + }; + /** @description Annotation inferred from the Tweet text. */ + ContextAnnotation: { + domain: components["schemas"]["ContextAnnotationDomainFields"]; + entity: components["schemas"]["ContextAnnotationEntityFields"]; + }; + /** @description Represents the data for the context annotation domain. */ + ContextAnnotationDomainFields: { + /** @description Description of the context annotation domain. */ + description?: string; + /** @description The unique id for a context annotation domain. */ + id: string; + /** @description Name of the context annotation domain. */ + name?: string; + }; + /** @description Represents the data for the context annotation entity. */ + ContextAnnotationEntityFields: { + /** @description Description of the context annotation entity. */ + description?: string; + /** @description The unique id for a context annotation entity. */ + id: string; + /** @description Name of the context annotation entity. */ + name?: string; + }; + /** + * @description A two-letter ISO 3166-1 alpha-2 country code. + * @example US + */ + CountryCode: string; + /** @description A request to create a new batch compliance job. */ + CreateComplianceJobRequest: { + name?: components["schemas"]["ComplianceJobName"]; + /** @description If true, this endpoint will return a pre-signed URL with resumable uploads enabled. */ + resumable?: boolean; + /** + * @description Type of compliance job to list. + * @enum {string} + */ + type: "tweets" | "users"; + }; + CreateComplianceJobResponse: { + data?: components["schemas"]["ComplianceJob"]; + errors?: components["schemas"]["Problem"][]; + }; + /** + * Format: date-time + * @description Creation time of the compliance job. + * @example 2021-01-06T18:40:40.000Z + */ + CreatedAt: string; + /** @description A response from deleting user-specified stream filtering rules. */ + DeleteRulesRequest: { + /** @description IDs and values of all deleted user-specified stream filtering rules. */ + delete: { + /** @description IDs of all deleted user-specified stream filtering rules. */ + ids?: components["schemas"]["RuleId"][]; + /** @description Values of all deleted user-specified stream filtering rules. */ + values?: components["schemas"]["RuleValue"][]; + }; + }; + /** @description A problem that indicates that the resource requested violates the precepts of this API. */ + DisallowedResourceProblem: components["schemas"]["Problem"] & { + resource_id: string; + /** @enum {string} */ + resource_type: "user" | "tweet" | "media" | "list" | "space"; + /** @enum {string} */ + section: "data" | "includes"; + }; + /** + * Format: date-time + * @description Expiration time of the download URL. + * @example 2021-01-06T18:40:40.000Z + */ + DownloadExpiration: string; + /** + * Format: uri + * @description URL from which the user will retrieve their compliance results. + */ + DownloadUrl: string; + /** @description The rule you have submitted is a duplicate. */ + DuplicateRuleProblem: components["schemas"]["Problem"] & { + id?: string; + value?: string; + }; + /** + * Format: date-time + * @description The end time of the bucket. + */ + End: string; + /** @description Represent a boundary range (start and end index) for a recognized entity (for example a hashtag or a mention). `start` must be smaller than `end`. The start index is inclusive, the end index is exclusive. */ + EntityIndicesInclusiveExclusive: { + /** + * @description Index (zero-based) at which position this entity ends. The index is exclusive. + * @example 61 + */ + end: number; + /** + * @description Index (zero-based) at which position this entity starts. The index is inclusive. + * @example 50 + */ + start: number; + }; + /** @description Represent a boundary range (start and end index) for a recognized entity (for example a hashtag or a mention). `start` must be smaller than `end`. The start index is inclusive, the end index is inclusive. */ + EntityIndicesInclusiveInclusive: { + /** + * @description Index (zero-based) at which position this entity ends. The index is inclusive. + * @example 61 + */ + end: number; + /** + * @description Index (zero-based) at which position this entity starts. The index is inclusive. + * @example 50 + */ + start: number; + }; + Error: { + /** Format: int32 */ + code: number; + message: string; + }; + Expansions: { + media?: components["schemas"]["Media"][]; + places?: components["schemas"]["Place"][]; + polls?: components["schemas"]["Poll"][]; + topics?: components["schemas"]["Topic"][]; + tweets?: components["schemas"]["Tweet"][]; + users?: components["schemas"]["User"][]; + }; + /** @description A problem that indicates that you are not allowed to see a particular field on a Tweet, User, etc. */ + FieldUnauthorizedProblem: components["schemas"]["Problem"] & { + field: string; + /** @enum {string} */ + resource_type: "user" | "tweet" | "media" | "list" | "space"; + /** @enum {string} */ + section: "data" | "includes"; + }; + /** @description A Tweet or error that can be returned by the streaming Tweet API. The values returned with a successful streamed Tweet includes the user provided rules that the Tweet matched. */ + FilteredStreamingTweetResponse: { + data?: components["schemas"]["Tweet"]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + /** @description The list of rules which matched the Tweet */ + matching_rules?: { + id: components["schemas"]["RuleId"]; + tag?: components["schemas"]["RuleTag"]; + }[]; + }; + FullTextEntities: { + annotations?: (components["schemas"]["EntityIndicesInclusiveInclusive"] & { + /** + * @description Text used to determine annotation. + * @example Barack Obama + */ + normalized_text?: string; + /** + * Format: double + * @description Confidence factor for annotation type. + */ + probability?: number; + /** + * @description Annotation type. + * @example Person + */ + type?: string; + })[]; + cashtags?: components["schemas"]["CashtagEntity"][]; + hashtags?: components["schemas"]["HashtagEntity"][]; + mentions?: components["schemas"]["MentionEntity"][]; + urls?: components["schemas"]["UrlEntity"][]; + }; + /** @description A generic problem with no additional information beyond that provided by the HTTP status code. */ + GenericProblem: components["schemas"]["Problem"]; + Geo: { + /** + * @example [ + * -105.193475, + * 39.60973, + * -105.053164, + * 39.761974 + * ] + */ + bbox: number[]; + geometry?: components["schemas"]["Point"]; + properties: { [key: string]: unknown }; + /** @enum {string} */ + type: "Feature"; + }; + Get2ComplianceJobsIdResponse: { + data?: components["schemas"]["ComplianceJob"]; + errors?: components["schemas"]["Problem"][]; + }; + Get2ComplianceJobsResponse: { + data?: components["schemas"]["ComplianceJob"][]; + errors?: components["schemas"]["Problem"][]; + meta?: { + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2ListsIdFollowersResponse: { + data?: components["schemas"]["User"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + next_token?: components["schemas"]["NextToken"]; + previous_token?: components["schemas"]["PreviousToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2ListsIdMembersResponse: { + data?: components["schemas"]["User"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + next_token?: components["schemas"]["NextToken"]; + previous_token?: components["schemas"]["PreviousToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2ListsIdResponse: { + data?: components["schemas"]["List"]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + }; + Get2ListsIdTweetsResponse: { + data?: components["schemas"]["Tweet"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + next_token?: components["schemas"]["NextToken"]; + previous_token?: components["schemas"]["PreviousToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2SpacesByCreatorIdsResponse: { + data?: components["schemas"]["Space"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2SpacesIdBuyersResponse: { + data?: components["schemas"]["User"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + next_token?: components["schemas"]["NextToken"]; + previous_token?: components["schemas"]["PreviousToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2SpacesIdResponse: { + data?: components["schemas"]["Space"]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + }; + Get2SpacesIdTweetsResponse: { + data?: components["schemas"]["Tweet"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + next_token?: components["schemas"]["NextToken"]; + previous_token?: components["schemas"]["PreviousToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2SpacesResponse: { + data?: components["schemas"]["Space"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + }; + Get2SpacesSearchResponse: { + data?: components["schemas"]["Space"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2TweetsCountsAllResponse: { + data?: components["schemas"]["SearchCount"][]; + errors?: components["schemas"]["Problem"][]; + meta?: { + newest_id?: components["schemas"]["NewestId"]; + next_token?: components["schemas"]["NextToken"]; + oldest_id?: components["schemas"]["OldestId"]; + total_tweet_count?: components["schemas"]["Aggregate"]; + }; + }; + Get2TweetsCountsRecentResponse: { + data?: components["schemas"]["SearchCount"][]; + errors?: components["schemas"]["Problem"][]; + meta?: { + newest_id?: components["schemas"]["NewestId"]; + next_token?: components["schemas"]["NextToken"]; + oldest_id?: components["schemas"]["OldestId"]; + total_tweet_count?: components["schemas"]["Aggregate"]; + }; + }; + Get2TweetsFirehoseStreamResponse: { + data?: components["schemas"]["Tweet"]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + }; + Get2TweetsIdLikingUsersResponse: { + data?: components["schemas"]["User"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + next_token?: components["schemas"]["NextToken"]; + previous_token?: components["schemas"]["PreviousToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2TweetsIdQuoteTweetsResponse: { + data?: components["schemas"]["Tweet"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + next_token?: components["schemas"]["NextToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2TweetsIdResponse: { + data?: components["schemas"]["Tweet"]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + }; + Get2TweetsIdRetweetedByResponse: { + data?: components["schemas"]["User"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + next_token?: components["schemas"]["NextToken"]; + previous_token?: components["schemas"]["PreviousToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2TweetsResponse: { + data?: components["schemas"]["Tweet"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + }; + Get2TweetsSample10StreamResponse: { + data?: components["schemas"]["Tweet"]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + }; + Get2TweetsSampleStreamResponse: { + data?: components["schemas"]["Tweet"]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + }; + Get2TweetsSearchAllResponse: { + data?: components["schemas"]["Tweet"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + newest_id?: components["schemas"]["NewestId"]; + next_token?: components["schemas"]["NextToken"]; + oldest_id?: components["schemas"]["OldestId"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2TweetsSearchRecentResponse: { + data?: components["schemas"]["Tweet"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + newest_id?: components["schemas"]["NewestId"]; + next_token?: components["schemas"]["NextToken"]; + oldest_id?: components["schemas"]["OldestId"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2TweetsSearchStreamResponse: { + data?: components["schemas"]["Tweet"]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + }; + Get2UsersByResponse: { + data?: components["schemas"]["User"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + }; + Get2UsersByUsernameUsernameResponse: { + data?: components["schemas"]["User"]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + }; + Get2UsersIdBlockingResponse: { + data?: components["schemas"]["User"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + next_token?: components["schemas"]["NextToken"]; + previous_token?: components["schemas"]["PreviousToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2UsersIdBookmarksResponse: { + data?: components["schemas"]["Tweet"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + next_token?: components["schemas"]["NextToken"]; + previous_token?: components["schemas"]["PreviousToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2UsersIdFollowedListsResponse: { + data?: components["schemas"]["List"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + next_token?: components["schemas"]["NextToken"]; + previous_token?: components["schemas"]["PreviousToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2UsersIdFollowersResponse: { + data?: components["schemas"]["User"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + next_token?: components["schemas"]["NextToken"]; + previous_token?: components["schemas"]["PreviousToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2UsersIdFollowingResponse: { + data?: components["schemas"]["User"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + next_token?: components["schemas"]["NextToken"]; + previous_token?: components["schemas"]["PreviousToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2UsersIdLikedTweetsResponse: { + data?: components["schemas"]["Tweet"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + next_token?: components["schemas"]["NextToken"]; + previous_token?: components["schemas"]["PreviousToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2UsersIdListMembershipsResponse: { + data?: components["schemas"]["List"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + next_token?: components["schemas"]["NextToken"]; + previous_token?: components["schemas"]["PreviousToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2UsersIdMentionsResponse: { + data?: components["schemas"]["Tweet"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + newest_id?: components["schemas"]["NewestId"]; + next_token?: components["schemas"]["NextToken"]; + oldest_id?: components["schemas"]["OldestId"]; + previous_token?: components["schemas"]["PreviousToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2UsersIdMutingResponse: { + data?: components["schemas"]["User"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + next_token?: components["schemas"]["NextToken"]; + previous_token?: components["schemas"]["PreviousToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2UsersIdOwnedListsResponse: { + data?: components["schemas"]["List"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + next_token?: components["schemas"]["NextToken"]; + previous_token?: components["schemas"]["PreviousToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2UsersIdPinnedListsResponse: { + data?: components["schemas"]["List"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2UsersIdResponse: { + data?: components["schemas"]["User"]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + }; + Get2UsersIdTimelinesReverseChronologicalResponse: { + data?: components["schemas"]["Tweet"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + newest_id?: components["schemas"]["NewestId"]; + next_token?: components["schemas"]["NextToken"]; + oldest_id?: components["schemas"]["OldestId"]; + previous_token?: components["schemas"]["PreviousToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2UsersIdTweetsResponse: { + data?: components["schemas"]["Tweet"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + meta?: { + newest_id?: components["schemas"]["NewestId"]; + next_token?: components["schemas"]["NextToken"]; + oldest_id?: components["schemas"]["OldestId"]; + previous_token?: components["schemas"]["PreviousToken"]; + result_count?: components["schemas"]["ResultCount"]; + }; + }; + Get2UsersMeResponse: { + data?: components["schemas"]["User"]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + }; + Get2UsersResponse: { + data?: components["schemas"]["User"][]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + }; + HashtagEntity: components["schemas"]["EntityIndicesInclusiveExclusive"] & + components["schemas"]["HashtagFields"]; + /** @description Represent the portion of text recognized as a Hashtag, and its start and end position within the text. */ + HashtagFields: { + /** + * @description The text of the Hashtag. + * @example MondayMotivation + */ + tag: string; + }; + /** @description HTTP Status Code. */ + HttpStatusCode: number; + /** @description A problem that indicates this request is invalid. */ + InvalidRequestProblem: components["schemas"]["Problem"] & { + errors?: { + message?: string; + parameters?: { [key: string]: string[] }; + }[]; + }; + /** @description The rule you have submitted is invalid. */ + InvalidRuleProblem: components["schemas"]["Problem"]; + /** + * @description Compliance Job ID. + * @example 1372966999991541762 + */ + JobId: string; + /** @description A Twitter List is a curated group of accounts. */ + List: { + /** Format: date-time */ + created_at?: string; + description?: string; + follower_count?: number; + id: components["schemas"]["ListId"]; + member_count?: number; + /** @description The name of this List. */ + name: string; + owner_id?: components["schemas"]["UserId"]; + private?: boolean; + }; + ListAddUserRequest: { + user_id: components["schemas"]["UserId"]; + }; + ListCreateRequest: { + description?: string; + name: string; + /** @default false */ + private?: boolean; + }; + ListCreateResponse: { + /** @description A Twitter List is a curated group of accounts. */ + data?: { + id: components["schemas"]["ListId"]; + /** @description The name of this List. */ + name: string; + }; + errors?: components["schemas"]["Problem"][]; + }; + ListDeleteResponse: { + data?: { + deleted?: boolean; + }; + errors?: components["schemas"]["Problem"][]; + }; + ListFollowedRequest: { + list_id: components["schemas"]["ListId"]; + }; + ListFollowedResponse: { + data?: { + following?: boolean; + }; + errors?: components["schemas"]["Problem"][]; + }; + /** + * @description The unique identifier of this List. + * @example 1146654567674912769 + */ + ListId: string; + ListMutateResponse: { + data?: { + is_member?: boolean; + }; + errors?: components["schemas"]["Problem"][]; + }; + ListPinnedRequest: { + list_id: components["schemas"]["ListId"]; + }; + ListPinnedResponse: { + data?: { + pinned?: boolean; + }; + errors?: components["schemas"]["Problem"][]; + }; + ListUnpinResponse: { + data?: { + pinned?: boolean; + }; + errors?: components["schemas"]["Problem"][]; + }; + ListUpdateRequest: { + description?: string; + name?: string; + private?: boolean; + }; + ListUpdateResponse: { + data?: { + updated?: boolean; + }; + errors?: components["schemas"]["Problem"][]; + }; + Media: { + height?: components["schemas"]["MediaHeight"]; + media_key?: components["schemas"]["MediaKey"]; + type: string; + width?: components["schemas"]["MediaWidth"]; + }; + /** @description The height of the media in pixels. */ + MediaHeight: number; + /** + * @description The unique identifier of this Media. + * @example 1146654567674912769 + */ + MediaId: string; + /** @description The Media Key identifier for this attachment. */ + MediaKey: string; + /** @description The width of the media in pixels. */ + MediaWidth: number; + MentionEntity: components["schemas"]["EntityIndicesInclusiveExclusive"] & + components["schemas"]["MentionFields"]; + /** @description Represent the portion of text recognized as a User mention, and its start and end position within the text. */ + MentionFields: { + id?: components["schemas"]["UserId"]; + username: components["schemas"]["UserName"]; + }; + MuteUserMutationResponse: { + data?: { + muting?: boolean; + }; + errors?: components["schemas"]["Problem"][]; + }; + MuteUserRequest: { + target_user_id: components["schemas"]["UserId"]; + }; + /** @description The newest id in this response. */ + NewestId: string; + /** @description The next token. */ + NextToken: string; + /** @description A problem that indicates the user's rule set is not compliant. */ + NonCompliantRulesProblem: components["schemas"]["Problem"]; + /** @description The oldest id in this response. */ + OldestId: string; + /** @description You have been disconnected for operational reasons. */ + OperationalDisconnectProblem: components["schemas"]["Problem"] & { + /** @enum {string} */ + disconnect_type?: + | "OperationalDisconnect" + | "UpstreamOperationalDisconnect" + | "ForceDisconnect" + | "UpstreamUncleanDisconnect" + | "SlowReader" + | "InternalError" + | "ClientApplicationStateDegraded" + | "InvalidRules"; + }; + /** @description A base32 pagination token. */ + PaginationToken32: string; + /** @description A base36 pagination token. */ + PaginationToken36: string; + /** @description A 'long' pagination token. */ + PaginationTokenLong: string; + Photo: components["schemas"]["Media"] & { + alt_text?: string; + /** Format: uri */ + url?: string; + }; + Place: { + contained_within?: components["schemas"]["PlaceId"][]; + /** + * @description The full name of the county in which this place exists. + * @example United States + */ + country?: string; + country_code?: components["schemas"]["CountryCode"]; + /** + * @description The full name of this place. + * @example Lakewood, CO + */ + full_name: string; + geo?: components["schemas"]["Geo"]; + id: components["schemas"]["PlaceId"]; + /** + * @description The human readable name of this place. + * @example Lakewood + */ + name?: string; + place_type?: components["schemas"]["PlaceType"]; + }; + /** + * @description The identifier for this place. + * @example f7eb2fa2fea288b1 + */ + PlaceId: string; + /** + * @example city + * @enum {string} + */ + PlaceType: + | "poi" + | "neighborhood" + | "city" + | "admin" + | "country" + | "unknown"; + /** @description A [GeoJson Point](https://tools.ietf.org/html/rfc7946#section-3.1.2) geometry object. */ + Point: { + coordinates: components["schemas"]["Position"]; + /** + * @example Point + * @enum {string} + */ + type: "Point"; + }; + /** @description Represent a Poll attached to a Tweet. */ + Poll: { + /** Format: int32 */ + duration_minutes?: number; + /** Format: date-time */ + end_datetime?: string; + id: components["schemas"]["PollId"]; + options: components["schemas"]["PollOption"][]; + /** @enum {string} */ + voting_status?: "open" | "closed"; + }; + /** + * @description Unique identifier of this poll. + * @example 1365059861688410112 + */ + PollId: string; + /** @description Describes a choice in a Poll object. */ + PollOption: { + label: components["schemas"]["PollOptionLabel"]; + /** @description Position of this choice in the poll. */ + position: number; + /** @description Number of users who voted for this choice. */ + votes: number; + }; + /** @description The text of a poll choice. */ + PollOptionLabel: string; + /** + * @description A [GeoJson Position](https://tools.ietf.org/html/rfc7946#section-3.1.1) in the format `[longitude,latitude]`. + * @example [ + * -105.18816086351444, + * 40.247749999999996 + * ] + */ + Position: number[]; + /** @description The previous token. */ + PreviousToken: string; + /** @description An HTTP Problem Details object, as defined in IETF RFC 7807 (https://tools.ietf.org/html/rfc7807). */ + Problem: { + detail?: string; + status?: number; + title: string; + type: string; + }; + /** + * @description Shows who can reply a Tweet. Fields returned are everyone, mentioned_users, and following. + * @enum {string} + */ + ReplySettings: "everyone" | "mentionedUsers" | "following" | "other"; + /** @description A problem that indicates that a given Tweet, User, etc. does not exist. */ + ResourceNotFoundProblem: components["schemas"]["Problem"] & { + parameter: string; + resource_id: string; + /** @enum {string} */ + resource_type: "user" | "tweet" | "media" | "list" | "space"; + /** @description Value will match the schema of the field. */ + value: string; + }; + /** @description A problem that indicates you are not allowed to see a particular Tweet, User, etc. */ + ResourceUnauthorizedProblem: components["schemas"]["Problem"] & { + parameter: string; + resource_id: string; + /** @enum {string} */ + resource_type: "user" | "tweet" | "media" | "list" | "space"; + /** @enum {string} */ + section: "data" | "includes"; + value: string; + }; + /** @description A problem that indicates a particular Tweet, User, etc. is not available to you. */ + ResourceUnavailableProblem: components["schemas"]["Problem"] & { + parameter: string; + resource_id: string; + /** @enum {string} */ + resource_type: "user" | "tweet" | "media" | "list" | "space"; + }; + /** + * Format: int32 + * @description The number of results returned in this response. + */ + ResultCount: number; + /** @description A user-provided stream filtering rule. */ + Rule: { + id?: components["schemas"]["RuleId"]; + tag?: components["schemas"]["RuleTag"]; + value: components["schemas"]["RuleValue"]; + }; + /** + * @description Unique identifier of this rule. + * @example 120897978112909812 + */ + RuleId: string; + /** @description A user-provided stream filtering rule. */ + RuleNoId: { + tag?: components["schemas"]["RuleTag"]; + value: components["schemas"]["RuleValue"]; + }; + /** + * @description A tag meant for the labeling of user provided rules. + * @example Non-retweeted coffee Tweets + */ + RuleTag: string; + /** + * @description The filterlang value of the rule. + * @example coffee -is:retweet + */ + RuleValue: string; + /** @description You have exceeded the maximum number of rules. */ + RulesCapProblem: components["schemas"]["Problem"]; + RulesLookupResponse: { + data?: components["schemas"]["Rule"][]; + meta: components["schemas"]["RulesResponseMetadata"]; + }; + RulesRequestSummary: + | { + /** + * Format: int32 + * @description Number of user-specified stream filtering rules that were created. + * @example 1 + */ + created: number; + /** + * Format: int32 + * @description Number of invalid user-specified stream filtering rules. + * @example 1 + */ + invalid: number; + /** + * Format: int32 + * @description Number of user-specified stream filtering rules that were not created. + * @example 1 + */ + not_created: number; + /** + * Format: int32 + * @description Number of valid user-specified stream filtering rules. + * @example 1 + */ + valid: number; + } + | { + /** + * Format: int32 + * @description Number of user-specified stream filtering rules that were deleted. + */ + deleted: number; + /** + * Format: int32 + * @description Number of user-specified stream filtering rules that were not deleted. + */ + not_deleted: number; + }; + RulesResponseMetadata: { + next_token?: components["schemas"]["NextToken"]; + /** + * Format: int32 + * @description Number of Rules in result set. + */ + result_count?: number; + sent: string; + summary?: components["schemas"]["RulesRequestSummary"]; + }; + /** @description Represent a Search Count Result. */ + SearchCount: { + end: components["schemas"]["End"]; + start: components["schemas"]["Start"]; + tweet_count: components["schemas"]["TweetCount"]; + }; + Space: { + /** + * Format: date-time + * @description Creation time of the Space. + * @example 2021-07-06T18:40:40.000Z + */ + created_at?: string; + creator_id?: components["schemas"]["UserId"]; + /** + * Format: date-time + * @description End time of the Space. + * @example 2021-07-06T18:40:40.000Z + */ + ended_at?: string; + /** @description The user ids for the hosts of the Space. */ + host_ids?: components["schemas"]["UserId"][]; + id: components["schemas"]["SpaceId"]; + /** @description An array of user ids for people who were invited to a Space. */ + invited_user_ids?: components["schemas"]["UserId"][]; + /** + * @description Denotes if the Space is a ticketed Space. + * @example false + */ + is_ticketed?: boolean; + /** + * @description The language of the Space. + * @example en + */ + lang?: string; + /** + * Format: int32 + * @description The number of participants in a Space. + * @example 10 + */ + participant_count?: number; + /** + * Format: date-time + * @description A date time stamp for when a Space is scheduled to begin. + * @example 2021-07-06T18:40:40.000Z + */ + scheduled_start?: string; + /** @description An array of user ids for people who were speakers in a Space. */ + speaker_ids?: components["schemas"]["UserId"][]; + /** + * Format: date-time + * @description When the Space was started as a date string. + * @example 2021-7-14T04:35:55Z + */ + started_at?: string; + /** + * @description The current state of the Space. + * @example live + * @enum {string} + */ + state: "live" | "scheduled" | "ended"; + /** + * Format: int32 + * @description The number of people who have either purchased a ticket or set a reminder for this Space. + * @example 10 + */ + subscriber_count?: number; + /** + * @description The title of the Space. + * @example Spaces are Awesome + */ + title?: string; + /** @description The topics of a Space, as selected by its creator. */ + topics?: { + /** @description The description of the given topic. */ + description?: string; + /** @description An ID suitable for use in the REST API. */ + id: string; + /** @description The name of the given topic. */ + name: string; + }[]; + /** + * Format: date-time + * @description When the Space was last updated. + * @example 2021-7-14T04:35:55Z + */ + updated_at?: string; + }; + /** + * @description The unique identifier of this Space. + * @example 1SLjjRYNejbKM + */ + SpaceId: string; + /** + * Format: date-time + * @description The start time of the bucket. + */ + Start: string; + StreamingTweetResponse: { + data?: components["schemas"]["Tweet"]; + errors?: components["schemas"]["Problem"][]; + includes?: components["schemas"]["Expansions"]; + }; + /** @description The topic of a Space, as selected by its creator. */ + Topic: { + /** + * @description The description of the given topic. + * @example All about technology + */ + description?: string; + id: components["schemas"]["TopicId"]; + /** + * @description The name of the given topic. + * @example Technology + */ + name: string; + }; + /** @description Unique identifier of this Topic. */ + TopicId: string; + /** + * @example { + * "author_id": "2244994945", + * "created_at": "Wed Jan 06 18:40:40 +0000 2021", + * "id": "1346889436626259968", + * "text": "Learn how to use the user Tweet timeline and user mention timeline endpoints in the Twitter API v2 to explore Tweet\\u2026 https:\\/\\/t.co\\/56a0vZUx7i" + * } + */ + Tweet: { + /** @description Specifies the type of attachments (if any) present in this Tweet. */ + attachments?: { + /** @description A list of Media Keys for each one of the media attachments (if media are attached). */ + media_keys?: components["schemas"]["MediaKey"][]; + /** @description A list of poll IDs (if polls are attached). */ + poll_ids?: components["schemas"]["PollId"][]; + }; + author_id?: components["schemas"]["UserId"]; + context_annotations?: components["schemas"]["ContextAnnotation"][]; + conversation_id?: components["schemas"]["TweetId"]; + /** + * Format: date-time + * @description Creation time of the Tweet. + * @example 2021-01-06T18:40:40.000Z + */ + created_at?: string; + edit_controls?: { + /** + * Format: date-time + * @description Time when Tweet is no longer editable. + * @example 2021-01-06T18:40:40.000Z + */ + editable_until: string; + /** @description Number of times this Tweet can be edited. */ + edits_remaining: number; + /** + * @description Indicates if this Tweet is eligible to be edited. + * @example false + */ + is_edit_eligible: boolean; + }; + /** @description A list of Tweet Ids in this Tweet chain. */ + edit_history_tweet_ids: components["schemas"]["TweetId"][]; + entities?: components["schemas"]["FullTextEntities"]; + /** @description The location tagged on the Tweet, if the user provided one. */ + geo?: { + coordinates?: components["schemas"]["Point"]; + place_id?: components["schemas"]["PlaceId"]; + }; + id: components["schemas"]["TweetId"]; + in_reply_to_user_id?: components["schemas"]["UserId"]; + /** + * @description Language of the Tweet, if detected by Twitter. Returned as a BCP47 language tag. + * @example en + */ + lang?: string; + /** @description Nonpublic engagement metrics for the Tweet at the time of the request. */ + non_public_metrics?: { + /** + * Format: int32 + * @description Number of times this Tweet has been viewed. + */ + impression_count?: number; + }; + /** @description Organic nonpublic engagement metrics for the Tweet at the time of the request. */ + organic_metrics?: { + /** @description Number of times this Tweet has been viewed. */ + impression_count: number; + /** @description Number of times this Tweet has been liked. */ + like_count: number; + /** @description Number of times this Tweet has been replied to. */ + reply_count: number; + /** @description Number of times this Tweet has been Retweeted. */ + retweet_count: number; + }; + /** + * @description Indicates if this Tweet contains URLs marked as sensitive, for example content suitable for mature audiences. + * @example false + */ + possibly_sensitive?: boolean; + /** @description Promoted nonpublic engagement metrics for the Tweet at the time of the request. */ + promoted_metrics?: { + /** + * Format: int32 + * @description Number of times this Tweet has been viewed. + */ + impression_count?: number; + /** + * Format: int32 + * @description Number of times this Tweet has been liked. + */ + like_count?: number; + /** + * Format: int32 + * @description Number of times this Tweet has been replied to. + */ + reply_count?: number; + /** + * Format: int32 + * @description Number of times this Tweet has been Retweeted. + */ + retweet_count?: number; + }; + /** @description Engagement metrics for the Tweet at the time of the request. */ + public_metrics?: { + /** @description Number of times this Tweet has been liked. */ + like_count: number; + /** @description Number of times this Tweet has been quoted. */ + quote_count?: number; + /** @description Number of times this Tweet has been replied to. */ + reply_count: number; + /** @description Number of times this Tweet has been Retweeted. */ + retweet_count: number; + }; + /** @description A list of Tweets this Tweet refers to. For example, if the parent Tweet is a Retweet, a Quoted Tweet or a Reply, it will include the related Tweet referenced to by its parent. */ + referenced_tweets?: { + id: components["schemas"]["TweetId"]; + /** @enum {string} */ + type: "retweeted" | "quoted" | "replied_to"; + }[]; + reply_settings?: components["schemas"]["ReplySettings"]; + /** @description The name of the app the user Tweeted from. */ + source?: string; + text: components["schemas"]["TweetText"]; + withheld?: components["schemas"]["TweetWithheld"]; + }; + /** @description Tweet compliance data. */ + TweetComplianceData: + | components["schemas"]["TweetDeleteComplianceSchema"] + | components["schemas"]["TweetWithheldComplianceSchema"] + | components["schemas"]["TweetDropComplianceSchema"] + | components["schemas"]["TweetUndropComplianceSchema"] + | components["schemas"]["TweetEditComplianceSchema"]; + TweetComplianceSchema: { + /** + * Format: date-time + * @description Event time. + * @example 2021-07-06T18:40:40.000Z + */ + event_at: string; + quote_tweet_id?: components["schemas"]["TweetId"]; + tweet: { + author_id: components["schemas"]["UserId"]; + id: components["schemas"]["TweetId"]; + }; + }; + /** @description Tweet compliance stream events. */ + TweetComplianceStreamResponse: + | { + data: components["schemas"]["TweetComplianceData"]; + } + | { + errors: components["schemas"]["Problem"][]; + }; + /** @description The count for the bucket. */ + TweetCount: number; + TweetCreateRequest: { + /** @description Card Uri Parameter. This is mutually exclusive from Quote Tweet Id, Poll, Media, and Direct Message Deep Link. */ + card_uri?: string; + /** @description Link to take the conversation from the public timeline to a private Direct Message. */ + direct_message_deep_link?: string; + /** + * @description Exclusive Tweet for super followers. + * @default false + */ + for_super_followers_only?: boolean; + /** @description Place ID being attached to the Tweet for geo location. */ + geo?: { + place_id?: string; + }; + /** @description Media information being attached to created Tweet. This is mutually exclusive from Quote Tweet Id, Poll, and Card URI. */ + media?: { + /** @description A list of Media Ids to be attached to a created Tweet. */ + media_ids: components["schemas"]["MediaId"][]; + /** @description A list of User Ids to be tagged in the media for created Tweet. */ + tagged_user_ids?: components["schemas"]["UserId"][]; + }; + /** + * @description Nullcasted (promoted-only) Tweets do not appear in the public timeline and are not served to followers. + * @default false + */ + nullcast?: boolean; + /** @description Poll options for a Tweet with a poll. This is mutually exclusive from Media, Quote Tweet Id, and Card URI. */ + poll?: { + /** + * Format: int32 + * @description Duration of the poll in minutes. + */ + duration_minutes: number; + options: string[]; + /** + * @description Settings to indicate who can reply to the Tweet. + * @enum {string} + */ + reply_settings?: "following" | "mentionedUsers"; + }; + quote_tweet_id?: components["schemas"]["TweetId"]; + /** @description Tweet information of the Tweet being replied to. */ + reply?: { + /** @description A list of User Ids to be excluded from the reply Tweet. */ + exclude_reply_user_ids?: components["schemas"]["UserId"][]; + in_reply_to_tweet_id: components["schemas"]["TweetId"]; + }; + /** + * @description Settings to indicate who can reply to the Tweet. + * @enum {string} + */ + reply_settings?: "following" | "mentionedUsers"; + text?: components["schemas"]["TweetText"]; + }; + TweetCreateResponse: { + data?: { + id: components["schemas"]["TweetId"]; + text: components["schemas"]["TweetText"]; + }; + errors?: components["schemas"]["Problem"][]; + }; + TweetDeleteComplianceSchema: { + delete: components["schemas"]["TweetComplianceSchema"]; + }; + TweetDeleteResponse: { + data?: { + deleted: boolean; + }; + errors?: components["schemas"]["Problem"][]; + }; + TweetDropComplianceSchema: { + drop: components["schemas"]["TweetComplianceSchema"]; + }; + TweetEditComplianceObjectSchema: { + edit_tweet_ids: components["schemas"]["TweetId"][]; + /** + * Format: date-time + * @description Event time. + * @example 2021-07-06T18:40:40.000Z + */ + event_at: string; + initial_tweet_id: components["schemas"]["TweetId"]; + tweet: { + id: components["schemas"]["TweetId"]; + }; + }; + TweetEditComplianceSchema: { + tweet_edit: components["schemas"]["TweetEditComplianceObjectSchema"]; + }; + TweetHideRequest: { + hidden: boolean; + }; + TweetHideResponse: { + data?: { + hidden?: boolean; + }; + }; + /** + * @description Unique identifier of this Tweet. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers. + * @example 1346889436626259968 + */ + TweetId: string; + /** @description Tweet label data. */ + TweetLabelData: + | components["schemas"]["TweetNoticeSchema"] + | components["schemas"]["TweetUnviewableSchema"]; + /** @description Tweet label stream events. */ + TweetLabelStreamResponse: + | { + data: components["schemas"]["TweetLabelData"]; + } + | { + errors: components["schemas"]["Problem"][]; + }; + TweetNotice: { + /** + * @description If the label is being applied or removed. Possible values are ‘apply’ or ‘remove’. + * @example apply + */ + application: string; + /** @description Information shown on the Tweet label */ + details?: string; + /** + * Format: date-time + * @description Event time. + * @example 2021-07-06T18:40:40.000Z + */ + event_at: string; + /** + * @description The type of label on the Tweet + * @example misleading + */ + event_type: string; + /** @description Link to more information about this kind of label */ + extended_details_url?: string; + /** @description Title/header of the Tweet label */ + label_title?: string; + tweet: { + author_id: components["schemas"]["UserId"]; + id: components["schemas"]["TweetId"]; + }; + }; + TweetNoticeSchema: { + public_tweet_notice: components["schemas"]["TweetNotice"]; + }; + TweetTakedownComplianceSchema: { + /** + * Format: date-time + * @description Event time. + * @example 2021-07-06T18:40:40.000Z + */ + event_at: string; + quote_tweet_id?: components["schemas"]["TweetId"]; + tweet: { + author_id: components["schemas"]["UserId"]; + id: components["schemas"]["TweetId"]; + }; + withheld_in_countries: components["schemas"]["CountryCode"][]; + }; + /** + * @description The content of the Tweet. + * @example Learn how to use the user Tweet timeline and user mention timeline endpoints in the Twitter API v2 to explore Tweet\u2026 https:\/\/t.co\/56a0vZUx7i + */ + TweetText: string; + TweetUndropComplianceSchema: { + undrop: components["schemas"]["TweetComplianceSchema"]; + }; + TweetUnviewable: { + /** + * @description If the label is being applied or removed. Possible values are ‘apply’ or ‘remove’. + * @example apply + */ + application: string; + /** + * Format: date-time + * @description Event time. + * @example 2021-07-06T18:40:40.000Z + */ + event_at: string; + tweet: { + author_id: components["schemas"]["UserId"]; + id: components["schemas"]["TweetId"]; + }; + }; + TweetUnviewableSchema: { + public_tweet_unviewable: components["schemas"]["TweetUnviewable"]; + }; + /** @description Indicates withholding details for [withheld content](https://help.twitter.com/en/rules-and-policies/tweet-withheld-by-country). */ + TweetWithheld: { + /** @description Indicates if the content is being withheld for on the basis of copyright infringement. */ + copyright: boolean; + /** @description Provides a list of countries where this content is not available. */ + country_codes: components["schemas"]["CountryCode"][]; + /** + * @description Indicates whether the content being withheld is the `tweet` or a `user`. + * @enum {string} + */ + scope?: "tweet" | "user"; + }; + TweetWithheldComplianceSchema: { + withheld: components["schemas"]["TweetTakedownComplianceSchema"]; + }; + /** @description A problem that indicates that the authentication used is not supported. */ + UnsupportedAuthenticationProblem: components["schemas"]["Problem"]; + /** + * Format: date-time + * @description Expiration time of the upload URL. + * @example 2021-01-06T18:40:40.000Z + */ + UploadExpiration: string; + /** + * Format: uri + * @description URL to which the user will upload their Tweet or user IDs. + */ + UploadUrl: string; + /** + * Format: uri + * @description A validly formatted URL. + * @example https://developer.twitter.com/en/docs/twitter-api + */ + Url: string; + /** @description Represent the portion of text recognized as a URL, and its start and end position within the text. */ + UrlEntity: components["schemas"]["EntityIndicesInclusiveExclusive"] & + components["schemas"]["UrlFields"]; + /** @description Represent the portion of text recognized as a URL. */ + UrlFields: { + /** + * @description Description of the URL landing page. + * @example This is a description of the website. + */ + description?: string; + /** + * @description The URL as displayed in the Twitter client. + * @example twittercommunity.com/t/introducing-… + */ + display_url?: string; + expanded_url?: components["schemas"]["Url"]; + images?: components["schemas"]["UrlImage"][]; + media_key?: components["schemas"]["MediaKey"]; + status?: components["schemas"]["HttpStatusCode"]; + /** + * @description Title of the page the URL points to. + * @example Introducing the v2 follow lookup endpoints + */ + title?: string; + /** + * Format: uri + * @description Fully resolved url. + * @example https://twittercommunity.com/t/introducing-the-v2-follow-lookup-endpoints/147118 + */ + unwound_url?: string; + url: components["schemas"]["Url"]; + }; + /** @description Represent the information for the URL image. */ + UrlImage: { + height?: components["schemas"]["MediaHeight"]; + url?: components["schemas"]["Url"]; + width?: components["schemas"]["MediaWidth"]; + }; + /** @description A problem that indicates that a usage cap has been exceeded. */ + UsageCapExceededProblem: components["schemas"]["Problem"] & { + /** @enum {string} */ + period?: "Daily" | "Monthly"; + /** @enum {string} */ + scope?: "Account" | "Product"; + }; + /** + * @description The Twitter User object. + * @example { + * "created_at": "2013-12-14T04:35:55Z", + * "id": "2244994945", + * "name": "Twitter Dev", + * "protected": false, + * "username": "TwitterDev" + * } + */ + User: { + /** + * Format: date-time + * @description Creation time of this User. + */ + created_at?: string; + /** @description The text of this User's profile description (also known as bio), if the User provided one. */ + description?: string; + /** @description A list of metadata found in the User's profile description. */ + entities?: { + description?: components["schemas"]["FullTextEntities"]; + /** @description Expanded details for the URL specified in the User's profile, with start and end indices. */ + url?: { + urls?: components["schemas"]["UrlEntity"][]; + }; + }; + id: components["schemas"]["UserId"]; + /** @description The location specified in the User's profile, if the User provided one. As this is a freeform value, it may not indicate a valid location, but it may be fuzzily evaluated when performing searches with location queries. */ + location?: string; + /** @description The friendly name of this User, as shown on their profile. */ + name: string; + pinned_tweet_id?: components["schemas"]["TweetId"]; + /** + * Format: uri + * @description The URL to the profile image for this User. + */ + profile_image_url?: string; + /** @description Indicates if this User has chosen to protect their Tweets (in other words, if this User's Tweets are private). */ + protected?: boolean; + /** @description A list of metrics for this User. */ + public_metrics?: { + /** @description Number of Users who are following this User. */ + followers_count: number; + /** @description Number of Users this User is following. */ + following_count: number; + /** @description The number of lists that include this User. */ + listed_count: number; + /** @description The number of Tweets (including Retweets) posted by this User. */ + tweet_count: number; + }; + /** @description The URL specified in the User's profile. */ + url?: string; + username: components["schemas"]["UserName"]; + /** @description Indicate if this User is a verified Twitter User. */ + verified?: boolean; + withheld?: components["schemas"]["UserWithheld"]; + }; + /** @description User compliance data. */ + UserComplianceData: + | components["schemas"]["UserProtectComplianceSchema"] + | components["schemas"]["UserUnprotectComplianceSchema"] + | components["schemas"]["UserDeleteComplianceSchema"] + | components["schemas"]["UserUndeleteComplianceSchema"] + | components["schemas"]["UserSuspendComplianceSchema"] + | components["schemas"]["UserUnsuspendComplianceSchema"] + | components["schemas"]["UserWithheldComplianceSchema"] + | components["schemas"]["UserScrubGeoSchema"] + | components["schemas"]["UserProfileModificationComplianceSchema"]; + UserComplianceSchema: { + /** + * Format: date-time + * @description Event time. + * @example 2021-07-06T18:40:40.000Z + */ + event_at: string; + user: { + id: components["schemas"]["UserId"]; + }; + }; + /** @description User compliance stream events. */ + UserComplianceStreamResponse: + | { + data: components["schemas"]["UserComplianceData"]; + } + | { + errors: components["schemas"]["Problem"][]; + }; + UserDeleteComplianceSchema: { + user_delete: components["schemas"]["UserComplianceSchema"]; + }; + /** + * @description Unique identifier of this User. This is returned as a string in order to avoid complications with languages and tools that cannot handle large integers. + * @example 2244994945 + */ + UserId: string; + /** + * @description Unique identifier of this User. The value must be the same as the authenticated user. + * @example 2244994945 + */ + UserIdMatchesAuthenticatedUser: string; + /** @description The Twitter handle (screen name) of this user. */ + UserName: string; + UserProfileModificationComplianceSchema: { + user_profile_modification: components["schemas"]["UserProfileModificationObjectSchema"]; + }; + UserProfileModificationObjectSchema: { + /** + * Format: date-time + * @description Event time. + * @example 2021-07-06T18:40:40.000Z + */ + event_at: string; + new_value: string; + profile_field: string; + user: { + id: components["schemas"]["UserId"]; + }; + }; + UserProtectComplianceSchema: { + user_protect: components["schemas"]["UserComplianceSchema"]; + }; + UserScrubGeoObjectSchema: { + /** + * Format: date-time + * @description Event time. + * @example 2021-07-06T18:40:40.000Z + */ + event_at: string; + up_to_tweet_id: components["schemas"]["TweetId"]; + user: { + id: components["schemas"]["UserId"]; + }; + }; + UserScrubGeoSchema: { + scrub_geo: components["schemas"]["UserScrubGeoObjectSchema"]; + }; + UserSuspendComplianceSchema: { + user_suspend: components["schemas"]["UserComplianceSchema"]; + }; + UserTakedownComplianceSchema: { + /** + * Format: date-time + * @description Event time. + * @example 2021-07-06T18:40:40.000Z + */ + event_at: string; + user: { + id: components["schemas"]["UserId"]; + }; + withheld_in_countries: components["schemas"]["CountryCode"][]; + }; + UserUndeleteComplianceSchema: { + user_undelete: components["schemas"]["UserComplianceSchema"]; + }; + UserUnprotectComplianceSchema: { + user_unprotect: components["schemas"]["UserComplianceSchema"]; + }; + UserUnsuspendComplianceSchema: { + user_unsuspend: components["schemas"]["UserComplianceSchema"]; + }; + /** @description Indicates withholding details for [withheld content](https://help.twitter.com/en/rules-and-policies/tweet-withheld-by-country). */ + UserWithheld: { + /** @description Provides a list of countries where this content is not available. */ + country_codes: components["schemas"]["CountryCode"][]; + /** + * @description Indicates that the content being withheld is a `user`. + * @enum {string} + */ + scope?: "user"; + }; + UserWithheldComplianceSchema: { + user_withheld: components["schemas"]["UserTakedownComplianceSchema"]; + }; + UsersFollowingCreateRequest: { + target_user_id: components["schemas"]["UserId"]; + }; + UsersFollowingCreateResponse: { + data?: { + following?: boolean; + pending_follow?: boolean; + }; + errors?: components["schemas"]["Problem"][]; + }; + UsersFollowingDeleteResponse: { + data?: { + following?: boolean; + }; + errors?: components["schemas"]["Problem"][]; + }; + UsersLikesCreateRequest: { + tweet_id: components["schemas"]["TweetId"]; + }; + UsersLikesCreateResponse: { + data?: { + liked?: boolean; + }; + errors?: components["schemas"]["Problem"][]; + }; + UsersLikesDeleteResponse: { + data?: { + liked?: boolean; + }; + errors?: components["schemas"]["Problem"][]; + }; + UsersRetweetsCreateRequest: { + tweet_id: components["schemas"]["TweetId"]; + }; + UsersRetweetsCreateResponse: { + data?: { + retweeted?: boolean; + }; + errors?: components["schemas"]["Problem"][]; + }; + UsersRetweetsDeleteResponse: { + data?: { + retweeted?: boolean; + }; + errors?: components["schemas"]["Problem"][]; + }; + Variant: { + /** @description The bit rate of the media. */ + bit_rate?: number; + /** @description The content type of the media. */ + content_type?: string; + /** + * Format: uri + * @description The url to the media. + */ + url?: string; + }; + /** @description An array of all available variants of the media. */ + Variants: components["schemas"]["Variant"][]; + Video: components["schemas"]["Media"] & { + duration_ms?: number; + /** @description Nonpublic engagement metrics for the Media at the time of the request. */ + non_public_metrics?: { + /** + * Format: int32 + * @description Number of users who made it through 0% of the video. + */ + playback_0_count?: number; + /** + * Format: int32 + * @description Number of users who made it through 100% of the video. + */ + playback_100_count?: number; + /** + * Format: int32 + * @description Number of users who made it through 25% of the video. + */ + playback_25_count?: number; + /** + * Format: int32 + * @description Number of users who made it through 50% of the video. + */ + playback_50_count?: number; + /** + * Format: int32 + * @description Number of users who made it through 75% of the video. + */ + playback_75_count?: number; + }; + /** @description Organic nonpublic engagement metrics for the Media at the time of the request. */ + organic_metrics?: { + /** + * Format: int32 + * @description Number of users who made it through 0% of the video. + */ + playback_0_count?: number; + /** + * Format: int32 + * @description Number of users who made it through 100% of the video. + */ + playback_100_count?: number; + /** + * Format: int32 + * @description Number of users who made it through 25% of the video. + */ + playback_25_count?: number; + /** + * Format: int32 + * @description Number of users who made it through 50% of the video. + */ + playback_50_count?: number; + /** + * Format: int32 + * @description Number of users who made it through 75% of the video. + */ + playback_75_count?: number; + /** + * Format: int32 + * @description Number of times this video has been viewed. + */ + view_count?: number; + }; + /** Format: uri */ + preview_image_url?: string; + /** @description Promoted nonpublic engagement metrics for the Media at the time of the request. */ + promoted_metrics?: { + /** + * Format: int32 + * @description Number of users who made it through 0% of the video. + */ + playback_0_count?: number; + /** + * Format: int32 + * @description Number of users who made it through 100% of the video. + */ + playback_100_count?: number; + /** + * Format: int32 + * @description Number of users who made it through 25% of the video. + */ + playback_25_count?: number; + /** + * Format: int32 + * @description Number of users who made it through 50% of the video. + */ + playback_50_count?: number; + /** + * Format: int32 + * @description Number of users who made it through 75% of the video. + */ + playback_75_count?: number; + /** + * Format: int32 + * @description Number of times this video has been viewed. + */ + view_count?: number; + }; + /** @description Engagement metrics for the Media at the time of the request. */ + public_metrics?: { + /** + * Format: int32 + * @description Number of times this video has been viewed. + */ + view_count?: number; + }; + variants?: components["schemas"]["Variants"]; + }; + }; + parameters: { + /** @description A comma separated list of ComplianceJob fields to display. */ + ComplianceJobFieldsParameter: ( + | "created_at" + | "download_expires_at" + | "download_url" + | "id" + | "name" + | "resumable" + | "status" + | "type" + | "upload_expires_at" + | "upload_url" + )[]; + /** @description A comma separated list of fields to expand. */ + ListExpansionsParameter: "owner_id"[]; + /** @description A comma separated list of List fields to display. */ + ListFieldsParameter: ( + | "created_at" + | "description" + | "follower_count" + | "id" + | "member_count" + | "name" + | "owner_id" + | "private" + )[]; + /** @description A comma separated list of Media fields to display. */ + MediaFieldsParameter: ( + | "alt_text" + | "duration_ms" + | "height" + | "media_key" + | "non_public_metrics" + | "organic_metrics" + | "preview_image_url" + | "promoted_metrics" + | "public_metrics" + | "type" + | "url" + | "variants" + | "width" + )[]; + /** @description A comma separated list of Place fields to display. */ + PlaceFieldsParameter: ( + | "contained_within" + | "country" + | "country_code" + | "full_name" + | "geo" + | "id" + | "name" + | "place_type" + )[]; + /** @description A comma separated list of Poll fields to display. */ + PollFieldsParameter: ( + | "duration_minutes" + | "end_datetime" + | "id" + | "options" + | "voting_status" + )[]; + /** @description A comma separated list of SearchCount fields to display. */ + SearchCountFieldsParameter: ("end" | "start" | "tweet_count")[]; + /** @description A comma separated list of fields to expand. */ + SpaceExpansionsParameter: ( + | "creator_id" + | "host_ids" + | "invited_user_ids" + | "speaker_ids" + | "topic_ids" + )[]; + /** @description A comma separated list of Space fields to display. */ + SpaceFieldsParameter: ( + | "created_at" + | "creator_id" + | "ended_at" + | "host_ids" + | "id" + | "invited_user_ids" + | "is_ticketed" + | "lang" + | "participant_count" + | "scheduled_start" + | "speaker_ids" + | "started_at" + | "state" + | "subscriber_count" + | "title" + | "topic_ids" + | "updated_at" + )[]; + /** @description A comma separated list of Topic fields to display. */ + TopicFieldsParameter: ("description" | "id" | "name")[]; + /** @description A comma separated list of fields to expand. */ + TweetExpansionsParameter: ( + | "attachments.media_keys" + | "attachments.poll_ids" + | "author_id" + | "edit_history_tweet_ids" + | "entities.mentions.username" + | "geo.place_id" + | "in_reply_to_user_id" + | "referenced_tweets.id" + | "referenced_tweets.id.author_id" + )[]; + /** @description A comma separated list of Tweet fields to display. */ + TweetFieldsParameter: ( + | "attachments" + | "author_id" + | "context_annotations" + | "conversation_id" + | "created_at" + | "edit_controls" + | "edit_history_tweet_ids" + | "entities" + | "geo" + | "id" + | "in_reply_to_user_id" + | "lang" + | "non_public_metrics" + | "organic_metrics" + | "possibly_sensitive" + | "promoted_metrics" + | "public_metrics" + | "referenced_tweets" + | "reply_settings" + | "source" + | "text" + | "withheld" + )[]; + /** @description A comma separated list of fields to expand. */ + UserExpansionsParameter: "pinned_tweet_id"[]; + /** @description A comma separated list of User fields to display. */ + UserFieldsParameter: ( + | "created_at" + | "description" + | "entities" + | "id" + | "location" + | "name" + | "pinned_tweet_id" + | "profile_image_url" + | "protected" + | "public_metrics" + | "url" + | "username" + | "verified" + | "withheld" + )[]; + }; } export interface operations { - /** Returns recent Compliance Jobs for a given job type and optional job status */ - listBatchComplianceJobs: { - parameters: { - query: { - /** Type of Compliance Job to list. */ - type: "tweets" | "users"; - /** Status of Compliance Job to list. */ - status?: "created" | "in_progress" | "failed" | "complete"; - /** A comma separated list of ComplianceJob fields to display. */ - "compliance_job.fields"?: components["parameters"]["ComplianceJobFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2ComplianceJobsResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Creates a compliance for the given job type */ - createBatchComplianceJob: { - parameters: {}; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["CreateComplianceJobResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["CreateComplianceJobRequest"]; - }; - }; - }; - /** Returns a single Compliance Job by ID */ - getBatchComplianceJob: { - parameters: { - path: { - /** The ID of the Compliance Job to retrieve. */ - id: components["schemas"]["JobId"]; - }; - query: { - /** A comma separated list of ComplianceJob fields to display. */ - "compliance_job.fields"?: components["parameters"]["ComplianceJobFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2ComplianceJobsIdResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Creates a new List. */ - listIdCreate: { - parameters: {}; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["ListCreateResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["ListCreateRequest"]; - }; - }; - }; - /** Returns a List. */ - listIdGet: { - parameters: { - path: { - /** The ID of the List. */ - id: components["schemas"]["ListId"]; - }; - query: { - /** A comma separated list of List fields to display. */ - "list.fields"?: components["parameters"]["ListFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["ListExpansionsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2ListsIdResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Update a List that you own. */ - listIdUpdate: { - parameters: { - path: { - /** The ID of the List to modify. */ - id: components["schemas"]["ListId"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["ListUpdateResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["ListUpdateRequest"]; - }; - }; - }; - /** Delete a List that you own. */ - listIdDelete: { - parameters: { - path: { - /** The ID of the List to delete. */ - id: components["schemas"]["ListId"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["ListDeleteResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns a list of Users that follow a List by the provided List ID */ - listGetFollowers: { - parameters: { - path: { - /** The ID of the List. */ - id: components["schemas"]["ListId"]; - }; - query: { - /** The maximum number of results. */ - max_results?: number; - /** This parameter is used to get a specified 'page' of results. */ - pagination_token?: components["schemas"]["PaginationTokenLong"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["UserExpansionsParameter"]; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2ListsIdFollowersResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns a list of Users that are members of a List by the provided List ID. */ - listGetMembers: { - parameters: { - path: { - /** The ID of the List. */ - id: components["schemas"]["ListId"]; - }; - query: { - /** The maximum number of results. */ - max_results?: number; - /** This parameter is used to get a specified 'page' of results. */ - pagination_token?: components["schemas"]["PaginationTokenLong"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["UserExpansionsParameter"]; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2ListsIdMembersResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Causes a User to become a member of a List. */ - listAddMember: { - parameters: { - path: { - /** The ID of the List for which to add a member. */ - id: components["schemas"]["ListId"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["ListMutateResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["ListAddUserRequest"]; - }; - }; - }; - /** Causes a User to be removed from the members of a List. */ - listRemoveMember: { - parameters: { - path: { - /** The ID of the List to remove a member. */ - id: components["schemas"]["ListId"]; - /** The ID of User that will be removed from the List. */ - user_id: components["schemas"]["UserId"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["ListMutateResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns a list of Tweets associated with the provided List ID. */ - listsIdTweets: { - parameters: { - path: { - /** The ID of the List. */ - id: components["schemas"]["ListId"]; - }; - query: { - /** The maximum number of results. */ - max_results?: number; - /** This parameter is used to get the next 'page' of results. */ - pagination_token?: components["schemas"]["PaginationToken36"]; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["TweetExpansionsParameter"]; - /** A comma separated list of Media fields to display. */ - "media.fields"?: components["parameters"]["MediaFieldsParameter"]; - /** A comma separated list of Poll fields to display. */ - "poll.fields"?: components["parameters"]["PollFieldsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Place fields to display. */ - "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2ListsIdTweetsResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Full OpenAPI Specification in JSON format. (See https://github.com/OAI/OpenAPI-Specification/blob/master/README.md) */ - getOpenApiSpec: { - parameters: {}; - responses: { - /** The request was successful */ - 200: { - content: { - "application/json": { [key: string]: unknown }; - }; - }; - }; - }; - /** Returns a variety of information about the Spaces specified by the requested IDs */ - findSpacesByIds: { - parameters: { - query: { - /** The list of Space IDs to return. */ - ids: string[]; - /** A comma separated list of Space fields to display. */ - "space.fields"?: components["parameters"]["SpaceFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["SpaceExpansionsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Topic fields to display. */ - "topic.fields"?: components["parameters"]["TopicFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2SpacesResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns a variety of information about the Spaces created by the provided User IDs */ - findSpacesByCreatorIds: { - parameters: { - query: { - /** The IDs of Users to search through. */ - user_ids: components["schemas"]["UserId"][]; - /** A comma separated list of Space fields to display. */ - "space.fields"?: components["parameters"]["SpaceFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["SpaceExpansionsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Topic fields to display. */ - "topic.fields"?: components["parameters"]["TopicFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2SpacesByCreatorIdsResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns Spaces that match the provided query. */ - searchSpaces: { - parameters: { - query: { - /** The search query. */ - query: string; - /** The state of Spaces to search for. */ - state?: "live" | "scheduled" | "all"; - /** The number of results to return. */ - max_results?: number; - /** A comma separated list of Space fields to display. */ - "space.fields"?: components["parameters"]["SpaceFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["SpaceExpansionsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Topic fields to display. */ - "topic.fields"?: components["parameters"]["TopicFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2SpacesSearchResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns a variety of information about the Space specified by the requested ID */ - findSpaceById: { - parameters: { - path: { - /** The ID of the Space to be retrieved. */ - id: string; - }; - query: { - /** A comma separated list of Space fields to display. */ - "space.fields"?: components["parameters"]["SpaceFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["SpaceExpansionsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Topic fields to display. */ - "topic.fields"?: components["parameters"]["TopicFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2SpacesIdResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Retrieves the list of Users who purchased a ticket to the given space */ - spaceBuyers: { - parameters: { - path: { - /** The ID of the Space to be retrieved. */ - id: string; - }; - query: { - /** This parameter is used to get a specified 'page' of results. */ - pagination_token?: components["schemas"]["PaginationToken32"]; - /** The maximum number of results. */ - max_results?: number; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["UserExpansionsParameter"]; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2SpacesIdBuyersResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Retrieves Tweets shared in the specified Space. */ - spaceTweets: { - parameters: { - path: { - /** The ID of the Space to be retrieved. */ - id: string; - }; - query: { - /** The number of Tweets to fetch from the provided space. If not provided, the value will default to the maximum of 100. */ - max_results?: number; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["TweetExpansionsParameter"]; - /** A comma separated list of Media fields to display. */ - "media.fields"?: components["parameters"]["MediaFieldsParameter"]; - /** A comma separated list of Poll fields to display. */ - "poll.fields"?: components["parameters"]["PollFieldsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Place fields to display. */ - "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2SpacesIdTweetsResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns a variety of information about the Tweet specified by the requested ID. */ - findTweetsById: { - parameters: { - query: { - /** A comma separated list of Tweet IDs. Up to 100 are allowed in a single request. */ - ids: components["schemas"]["TweetId"][]; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["TweetExpansionsParameter"]; - /** A comma separated list of Media fields to display. */ - "media.fields"?: components["parameters"]["MediaFieldsParameter"]; - /** A comma separated list of Poll fields to display. */ - "poll.fields"?: components["parameters"]["PollFieldsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Place fields to display. */ - "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2TweetsResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Causes the User to create a Tweet under the authorized account. */ - createTweet: { - parameters: {}; - responses: { - /** The request has succeeded. */ - 201: { - content: { - "application/json": components["schemas"]["TweetCreateResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["TweetCreateRequest"]; - }; - }; - }; - /** Streams 100% of compliance data for Tweets */ - getTweetsComplianceStream: { - parameters: { - query: { - /** The number of minutes of backfill requested. */ - backfill_minutes?: number; - /** The partition number. */ - partition: number; - /** YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweet Compliance events will be provided. */ - start_time?: string; - /** YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweet Compliance events will be provided. */ - end_time?: string; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["TweetComplianceStreamResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns Tweet Counts that match a search query. */ - tweetCountsFullArchiveSearch: { - parameters: { - query: { - /** One query/rule/filter for matching Tweets. Refer to https://t.co/rulelength to identify the max query length. */ - query: string; - /** YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp (from most recent 7 days) from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute). */ - start_time?: string; - /** YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute). */ - end_time?: string; - /** Returns results with a Tweet ID greater than (that is, more recent than) the specified ID. */ - since_id?: components["schemas"]["TweetId"]; - /** Returns results with a Tweet ID less than (that is, older than) the specified ID. */ - until_id?: components["schemas"]["TweetId"]; - /** This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified. */ - next_token?: components["schemas"]["PaginationToken36"]; - /** This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified. */ - pagination_token?: components["schemas"]["PaginationToken36"]; - /** The granularity for the search counts results. */ - granularity?: "minute" | "hour" | "day"; - /** A comma separated list of SearchCount fields to display. */ - "search_count.fields"?: components["parameters"]["SearchCountFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2TweetsCountsAllResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns Tweet Counts from the last 7 days that match a search query. */ - tweetCountsRecentSearch: { - parameters: { - query: { - /** One query/rule/filter for matching Tweets. Refer to https://t.co/rulelength to identify the max query length. */ - query: string; - /** YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp (from most recent 7 days) from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute). */ - start_time?: string; - /** YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute). */ - end_time?: string; - /** Returns results with a Tweet ID greater than (that is, more recent than) the specified ID. */ - since_id?: components["schemas"]["TweetId"]; - /** Returns results with a Tweet ID less than (that is, older than) the specified ID. */ - until_id?: components["schemas"]["TweetId"]; - /** This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified. */ - next_token?: components["schemas"]["PaginationToken36"]; - /** This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified. */ - pagination_token?: components["schemas"]["PaginationToken36"]; - /** The granularity for the search counts results. */ - granularity?: "minute" | "hour" | "day"; - /** A comma separated list of SearchCount fields to display. */ - "search_count.fields"?: components["parameters"]["SearchCountFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2TweetsCountsRecentResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Streams 100% of public Tweets. */ - getTweetsFirehoseStream: { - parameters: { - query: { - /** The number of minutes of backfill requested. */ - backfill_minutes?: number; - /** The partition number. */ - partition: number; - /** YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Tweets will be provided. */ - start_time?: string; - /** YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. */ - end_time?: string; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["TweetExpansionsParameter"]; - /** A comma separated list of Media fields to display. */ - "media.fields"?: components["parameters"]["MediaFieldsParameter"]; - /** A comma separated list of Poll fields to display. */ - "poll.fields"?: components["parameters"]["PollFieldsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Place fields to display. */ - "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["StreamingTweetResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Streams 100% of labeling events applied to Tweets */ - getTweetsLabelStream: { - parameters: { - query: { - /** The number of minutes of backfill requested. */ - backfill_minutes?: number; - /** YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweet labels will be provided. */ - start_time?: string; - /** YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp from which the Tweet labels will be provided. */ - end_time?: string; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["TweetLabelStreamResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Streams a deterministic 1% of public Tweets. */ - sampleStream: { - parameters: { - query: { - /** The number of minutes of backfill requested. */ - backfill_minutes?: number; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["TweetExpansionsParameter"]; - /** A comma separated list of Media fields to display. */ - "media.fields"?: components["parameters"]["MediaFieldsParameter"]; - /** A comma separated list of Poll fields to display. */ - "poll.fields"?: components["parameters"]["PollFieldsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Place fields to display. */ - "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["StreamingTweetResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Streams a deterministic 10% of public Tweets. */ - getTweetsSample10Stream: { - parameters: { - query: { - /** The number of minutes of backfill requested. */ - backfill_minutes?: number; - /** The partition number. */ - partition: number; - /** YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Tweets will be provided. */ - start_time?: string; - /** YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. */ - end_time?: string; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["TweetExpansionsParameter"]; - /** A comma separated list of Media fields to display. */ - "media.fields"?: components["parameters"]["MediaFieldsParameter"]; - /** A comma separated list of Poll fields to display. */ - "poll.fields"?: components["parameters"]["PollFieldsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Place fields to display. */ - "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2TweetsSample10StreamResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns Tweets that match a search query. */ - tweetsFullarchiveSearch: { - parameters: { - query: { - /** One query/rule/filter for matching Tweets. Refer to https://t.co/rulelength to identify the max query length. */ - query: string; - /** YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute). */ - start_time?: string; - /** YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute). */ - end_time?: string; - /** Returns results with a Tweet ID greater than (that is, more recent than) the specified ID. */ - since_id?: components["schemas"]["TweetId"]; - /** Returns results with a Tweet ID less than (that is, older than) the specified ID. */ - until_id?: components["schemas"]["TweetId"]; - /** The maximum number of search results to be returned by a request. */ - max_results?: number; - /** This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified. */ - next_token?: components["schemas"]["PaginationToken36"]; - /** This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified. */ - pagination_token?: components["schemas"]["PaginationToken36"]; - /** This order in which to return results. */ - sort_order?: "recency" | "relevancy"; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["TweetExpansionsParameter"]; - /** A comma separated list of Media fields to display. */ - "media.fields"?: components["parameters"]["MediaFieldsParameter"]; - /** A comma separated list of Poll fields to display. */ - "poll.fields"?: components["parameters"]["PollFieldsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Place fields to display. */ - "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2TweetsSearchAllResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns Tweets from the last 7 days that match a search query. */ - tweetsRecentSearch: { - parameters: { - query: { - /** One query/rule/filter for matching Tweets. Refer to https://t.co/rulelength to identify the max query length. */ - query: string; - /** YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute). */ - start_time?: string; - /** YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute). */ - end_time?: string; - /** Returns results with a Tweet ID greater than (that is, more recent than) the specified ID. */ - since_id?: components["schemas"]["TweetId"]; - /** Returns results with a Tweet ID less than (that is, older than) the specified ID. */ - until_id?: components["schemas"]["TweetId"]; - /** The maximum number of search results to be returned by a request. */ - max_results?: number; - /** This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified. */ - next_token?: components["schemas"]["PaginationToken36"]; - /** This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified. */ - pagination_token?: components["schemas"]["PaginationToken36"]; - /** This order in which to return results. */ - sort_order?: "recency" | "relevancy"; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["TweetExpansionsParameter"]; - /** A comma separated list of Media fields to display. */ - "media.fields"?: components["parameters"]["MediaFieldsParameter"]; - /** A comma separated list of Poll fields to display. */ - "poll.fields"?: components["parameters"]["PollFieldsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Place fields to display. */ - "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2TweetsSearchRecentResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Streams Tweets matching the stream's active rule set. */ - searchStream: { - parameters: { - query: { - /** The number of minutes of backfill requested. */ - backfill_minutes?: number; - /** YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. */ - start_time?: string; - /** YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. */ - end_time?: string; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["TweetExpansionsParameter"]; - /** A comma separated list of Media fields to display. */ - "media.fields"?: components["parameters"]["MediaFieldsParameter"]; - /** A comma separated list of Poll fields to display. */ - "poll.fields"?: components["parameters"]["PollFieldsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Place fields to display. */ - "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["FilteredStreamingTweetResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns rules from a User's active rule set. Users can fetch all of their rules or a subset, specified by the provided rule ids. */ - getRules: { - parameters: { - query: { - /** A comma-separated list of Rule IDs. */ - ids?: components["schemas"]["RuleId"][]; - /** The maximum number of results. */ - max_results?: number; - /** This value is populated by passing the 'next_token' returned in a request to paginate through results. */ - pagination_token?: string; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["RulesLookupResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Add or delete rules from a User's active rule set. Users can provide unique, optionally tagged rules to add. Users can delete their entire rule set or a subset specified by rule ids or values. */ - addOrDeleteRules: { - parameters: { - query: { - /** Dry Run can be used with both the add and delete action, with the expected result given, but without actually taking any action in the system (meaning the end state will always be as it was when the request was submitted). This is particularly useful to validate rule changes. */ - dry_run?: boolean; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["AddOrDeleteRulesResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["AddOrDeleteRulesRequest"]; - }; - }; - }; - /** Returns a variety of information about the Tweet specified by the requested ID. */ - findTweetById: { - parameters: { - path: { - /** A single Tweet ID. */ - id: components["schemas"]["TweetId"]; - }; - query: { - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["TweetExpansionsParameter"]; - /** A comma separated list of Media fields to display. */ - "media.fields"?: components["parameters"]["MediaFieldsParameter"]; - /** A comma separated list of Poll fields to display. */ - "poll.fields"?: components["parameters"]["PollFieldsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Place fields to display. */ - "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2TweetsIdResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Delete specified Tweet (in the path) by ID. */ - deleteTweetById: { - parameters: { - path: { - /** The ID of the Tweet to be deleted. */ - id: components["schemas"]["TweetId"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["TweetDeleteResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns a list of Users that have liked the provided Tweet ID */ - tweetsIdLikingUsers: { - parameters: { - path: { - /** A single Tweet ID. */ - id: components["schemas"]["TweetId"]; - }; - query: { - /** The maximum number of results. */ - max_results?: number; - /** This parameter is used to get the next 'page' of results. */ - pagination_token?: components["schemas"]["PaginationToken36"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["UserExpansionsParameter"]; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2TweetsIdLikingUsersResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns a variety of information about each Tweet that quotes the Tweet specified by the requested ID. */ - findTweetsThatQuoteATweet: { - parameters: { - path: { - /** A single Tweet ID. */ - id: components["schemas"]["TweetId"]; - }; - query: { - /** The maximum number of results to be returned. */ - max_results?: number; - /** This parameter is used to get a specified 'page' of results. */ - pagination_token?: components["schemas"]["PaginationToken36"]; - /** The set of entities to exclude (e.g. 'replies' or 'retweets'). */ - exclude?: ("replies" | "retweets")[]; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["TweetExpansionsParameter"]; - /** A comma separated list of Media fields to display. */ - "media.fields"?: components["parameters"]["MediaFieldsParameter"]; - /** A comma separated list of Poll fields to display. */ - "poll.fields"?: components["parameters"]["PollFieldsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Place fields to display. */ - "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2TweetsIdQuoteTweetsResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns a list of Users that have retweeted the provided Tweet ID */ - tweetsIdRetweetingUsers: { - parameters: { - path: { - /** A single Tweet ID. */ - id: components["schemas"]["TweetId"]; - }; - query: { - /** The maximum number of results. */ - max_results?: number; - /** This parameter is used to get the next 'page' of results. */ - pagination_token?: components["schemas"]["PaginationToken36"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["UserExpansionsParameter"]; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2TweetsIdRetweetedByResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Hides or unhides a reply to an owned conversation. */ - hideReplyById: { - parameters: { - path: { - /** The ID of the reply that you want to hide or unhide. */ - tweet_id: components["schemas"]["TweetId"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["TweetHideResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["TweetHideRequest"]; - }; - }; - }; - /** This endpoint returns information about Users. Specify Users by their ID. */ - findUsersById: { - parameters: { - query: { - /** A list of User IDs, comma-separated. You can specify up to 100 IDs. */ - ids: components["schemas"]["UserId"][]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["UserExpansionsParameter"]; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2UsersResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** This endpoint returns information about Users. Specify Users by their username. */ - findUsersByUsername: { - parameters: { - query: { - /** A list of usernames, comma-separated. */ - usernames: string[]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["UserExpansionsParameter"]; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2UsersByResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** This endpoint returns information about a User. Specify User by username. */ - findUserByUsername: { - parameters: { - path: { - /** A username. */ - username: string; - }; - query: { - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["UserExpansionsParameter"]; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2UsersByUsernameUsernameResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Streams 100% of compliance data for Users */ - getUsersComplianceStream: { - parameters: { - query: { - /** The number of minutes of backfill requested. */ - backfill_minutes?: number; - /** The partition number. */ - partition: number; - /** YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the User Compliance events will be provided. */ - start_time?: string; - /** YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp from which the User Compliance events will be provided. */ - end_time?: string; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["UserComplianceStreamResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** This endpoint returns information about the requesting User. */ - findMyUser: { - parameters: { - query: { - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["UserExpansionsParameter"]; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2UsersMeResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** This endpoint returns information about a User. Specify User by ID. */ - findUserById: { - parameters: { - path: { - /** The ID of the User to lookup. */ - id: components["schemas"]["UserId"]; - }; - query: { - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["UserExpansionsParameter"]; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2UsersIdResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns a list of Users that are blocked by the provided User ID */ - usersIdBlocking: { - parameters: { - path: { - /** The ID of the authenticated source User for whom to return results. */ - id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - }; - query: { - /** The maximum number of results. */ - max_results?: number; - /** This parameter is used to get a specified 'page' of results. */ - pagination_token?: components["schemas"]["PaginationToken32"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["UserExpansionsParameter"]; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2UsersIdBlockingResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Causes the User (in the path) to block the target User. The User (in the path) must match the User context authorizing the request */ - usersIdBlock: { - parameters: { - path: { - /** The ID of the authenticated source User that is requesting to block the target User. */ - id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["BlockUserMutationResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["BlockUserRequest"]; - }; - }; - }; - /** Returns Tweet objects that have been bookmarked by the requesting User */ - getUsersIdBookmarks: { - parameters: { - path: { - /** The ID of the authenticated source User for whom to return results. */ - id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - }; - query: { - /** The maximum number of results. */ - max_results?: number; - /** This parameter is used to get the next 'page' of results. */ - pagination_token?: components["schemas"]["PaginationToken36"]; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["TweetExpansionsParameter"]; - /** A comma separated list of Media fields to display. */ - "media.fields"?: components["parameters"]["MediaFieldsParameter"]; - /** A comma separated list of Poll fields to display. */ - "poll.fields"?: components["parameters"]["PollFieldsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Place fields to display. */ - "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2UsersIdBookmarksResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Adds a Tweet (ID in the body) to the requesting User's (in the path) bookmarks */ - postUsersIdBookmarks: { - parameters: { - path: { - /** The ID of the authenticated source User for whom to add bookmarks. */ - id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["BookmarkMutationResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["BookmarkAddRequest"]; - }; - }; - }; - /** Removes a Tweet from the requesting User's bookmarked Tweets. */ - usersIdBookmarksDelete: { - parameters: { - path: { - /** The ID of the authenticated source User whose bookmark is to be removed. */ - id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - /** The ID of the Tweet that the source User is removing from bookmarks. */ - tweet_id: components["schemas"]["TweetId"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["BookmarkMutationResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns a User's followed Lists. */ - userFollowedLists: { - parameters: { - path: { - /** The ID of the User to lookup. */ - id: components["schemas"]["UserId"]; - }; - query: { - /** The maximum number of results. */ - max_results?: number; - /** This parameter is used to get a specified 'page' of results. */ - pagination_token?: components["schemas"]["PaginationTokenLong"]; - /** A comma separated list of List fields to display. */ - "list.fields"?: components["parameters"]["ListFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["ListExpansionsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2UsersIdFollowedListsResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Causes a User to follow a List. */ - listUserFollow: { - parameters: { - path: { - /** The ID of the authenticated source User that will follow the List. */ - id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["ListFollowedResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["ListFollowedRequest"]; - }; - }; - }; - /** Causes a User to unfollow a List. */ - listUserUnfollow: { - parameters: { - path: { - /** The ID of the authenticated source User that will unfollow the List. */ - id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - /** The ID of the List to unfollow. */ - list_id: components["schemas"]["ListId"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["ListFollowedResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns a list of Users who are followers of the specified User ID. */ - usersIdFollowers: { - parameters: { - path: { - /** The ID of the User to lookup. */ - id: components["schemas"]["UserId"]; - }; - query: { - /** The maximum number of results. */ - max_results?: number; - /** This parameter is used to get a specified 'page' of results. */ - pagination_token?: components["schemas"]["PaginationToken32"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["UserExpansionsParameter"]; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2UsersIdFollowersResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns a list of Users that are being followed by the provided User ID */ - usersIdFollowing: { - parameters: { - path: { - /** The ID of the User to lookup. */ - id: components["schemas"]["UserId"]; - }; - query: { - /** The maximum number of results. */ - max_results?: number; - /** This parameter is used to get a specified 'page' of results. */ - pagination_token?: components["schemas"]["PaginationToken32"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["UserExpansionsParameter"]; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2UsersIdFollowingResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Causes the User(in the path) to follow, or “request to follow” for protected Users, the target User. The User(in the path) must match the User context authorizing the request */ - usersIdFollow: { - parameters: { - path: { - /** The ID of the authenticated source User that is requesting to follow the target User. */ - id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["UsersFollowingCreateResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UsersFollowingCreateRequest"]; - }; - }; - }; - /** Returns a list of Tweets liked by the provided User ID */ - usersIdLikedTweets: { - parameters: { - path: { - /** The ID of the User to lookup. */ - id: components["schemas"]["UserId"]; - }; - query: { - /** The maximum number of results. */ - max_results?: number; - /** This parameter is used to get the next 'page' of results. */ - pagination_token?: components["schemas"]["PaginationToken36"]; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["TweetExpansionsParameter"]; - /** A comma separated list of Media fields to display. */ - "media.fields"?: components["parameters"]["MediaFieldsParameter"]; - /** A comma separated list of Poll fields to display. */ - "poll.fields"?: components["parameters"]["PollFieldsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Place fields to display. */ - "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2UsersIdLikedTweetsResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Causes the User (in the path) to like the specified Tweet. The User in the path must match the User context authorizing the request. */ - usersIdLike: { - parameters: { - path: { - /** The ID of the authenticated source User that is requesting to like the Tweet. */ - id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["UsersLikesCreateResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UsersLikesCreateRequest"]; - }; - }; - }; - /** Causes the User (in the path) to unlike the specified Tweet. The User must match the User context authorizing the request */ - usersIdUnlike: { - parameters: { - path: { - /** The ID of the authenticated source User that is requesting to unlike the Tweet. */ - id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - /** The ID of the Tweet that the User is requesting to unlike. */ - tweet_id: components["schemas"]["TweetId"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["UsersLikesDeleteResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Get a User's List Memberships. */ - getUserListMemberships: { - parameters: { - path: { - /** The ID of the User to lookup. */ - id: components["schemas"]["UserId"]; - }; - query: { - /** The maximum number of results. */ - max_results?: number; - /** This parameter is used to get a specified 'page' of results. */ - pagination_token?: components["schemas"]["PaginationTokenLong"]; - /** A comma separated list of List fields to display. */ - "list.fields"?: components["parameters"]["ListFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["ListExpansionsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2UsersIdListMembershipsResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns Tweet objects that mention username associated to the provided User ID */ - usersIdMentions: { - parameters: { - path: { - /** The ID of the User to lookup. */ - id: components["schemas"]["UserId"]; - }; - query: { - /** The minimum Tweet ID to be included in the result set. This parameter takes precedence over start_time if both are specified. */ - since_id?: components["schemas"]["TweetId"]; - /** The maximum Tweet ID to be included in the result set. This parameter takes precedence over end_time if both are specified. */ - until_id?: components["schemas"]["TweetId"]; - /** The maximum number of results. */ - max_results?: number; - /** This parameter is used to get the next 'page' of results. */ - pagination_token?: components["schemas"]["PaginationToken36"]; - /** YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. The since_id parameter takes precedence if it is also specified. */ - start_time?: string; - /** YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. The until_id parameter takes precedence if it is also specified. */ - end_time?: string; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["TweetExpansionsParameter"]; - /** A comma separated list of Media fields to display. */ - "media.fields"?: components["parameters"]["MediaFieldsParameter"]; - /** A comma separated list of Poll fields to display. */ - "poll.fields"?: components["parameters"]["PollFieldsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Place fields to display. */ - "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2UsersIdMentionsResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns a list of Users that are muted by the provided User ID */ - usersIdMuting: { - parameters: { - path: { - /** The ID of the authenticated source User for whom to return results. */ - id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - }; - query: { - /** The maximum number of results. */ - max_results?: number; - /** This parameter is used to get the next 'page' of results. */ - pagination_token?: components["schemas"]["PaginationTokenLong"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["UserExpansionsParameter"]; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2UsersIdMutingResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Causes the User (in the path) to mute the target User. The User (in the path) must match the User context authorizing the request. */ - usersIdMute: { - parameters: { - path: { - /** The ID of the authenticated source User that is requesting to mute the target User. */ - id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["MuteUserMutationResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["MuteUserRequest"]; - }; - }; - }; - /** Get a User's Owned Lists. */ - listUserOwnedLists: { - parameters: { - path: { - /** The ID of the User to lookup. */ - id: components["schemas"]["UserId"]; - }; - query: { - /** The maximum number of results. */ - max_results?: number; - /** This parameter is used to get a specified 'page' of results. */ - pagination_token?: components["schemas"]["PaginationTokenLong"]; - /** A comma separated list of List fields to display. */ - "list.fields"?: components["parameters"]["ListFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["ListExpansionsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2UsersIdOwnedListsResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Get a User's Pinned Lists. */ - listUserPinnedLists: { - parameters: { - path: { - /** The ID of the authenticated source User for whom to return results. */ - id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - }; - query: { - /** A comma separated list of List fields to display. */ - "list.fields"?: components["parameters"]["ListFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["ListExpansionsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2UsersIdPinnedListsResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Causes a User to pin a List. */ - listUserPin: { - parameters: { - path: { - /** The ID of the authenticated source User that will pin the List. */ - id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["ListPinnedResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["ListPinnedRequest"]; - }; - }; - }; - /** Causes a User to remove a pinned List. */ - listUserUnpin: { - parameters: { - path: { - /** The ID of the authenticated source User for whom to return results. */ - id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - /** The ID of the List to unpin. */ - list_id: components["schemas"]["ListId"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["ListUnpinResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Causes the User (in the path) to retweet the specified Tweet. The User in the path must match the User context authorizing the request. */ - usersIdRetweets: { - parameters: { - path: { - /** The ID of the authenticated source User that is requesting to retweet the Tweet. */ - id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["UsersRetweetsCreateResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - requestBody: { - content: { - "application/json": components["schemas"]["UsersRetweetsCreateRequest"]; - }; - }; - }; - /** Causes the User (in the path) to unretweet the specified Tweet. The User must match the User context authorizing the request */ - usersIdUnretweets: { - parameters: { - path: { - /** The ID of the authenticated source User that is requesting to retweet the Tweet. */ - id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - /** The ID of the Tweet that the User is requesting to unretweet. */ - source_tweet_id: components["schemas"]["TweetId"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["UsersRetweetsDeleteResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns Tweet objects that appears in the provided User ID's home timeline */ - usersIdTimeline: { - parameters: { - path: { - /** The ID of the authenticated source User to list Reverse Chronological Timeline Tweets of. */ - id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - }; - query: { - /** The minimum Tweet ID to be included in the result set. This parameter takes precedence over start_time if both are specified. */ - since_id?: components["schemas"]["TweetId"]; - /** The maximum Tweet ID to be included in the result set. This parameter takes precedence over end_time if both are specified. */ - until_id?: components["schemas"]["TweetId"]; - /** The maximum number of results. */ - max_results?: number; - /** This parameter is used to get the next 'page' of results. */ - pagination_token?: components["schemas"]["PaginationToken36"]; - /** The set of entities to exclude (e.g. 'replies' or 'retweets'). */ - exclude?: ("replies" | "retweets")[]; - /** YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. The since_id parameter takes precedence if it is also specified. */ - start_time?: string; - /** YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. The until_id parameter takes precedence if it is also specified. */ - end_time?: string; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["TweetExpansionsParameter"]; - /** A comma separated list of Media fields to display. */ - "media.fields"?: components["parameters"]["MediaFieldsParameter"]; - /** A comma separated list of Poll fields to display. */ - "poll.fields"?: components["parameters"]["PollFieldsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Place fields to display. */ - "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2UsersIdTimelinesReverseChronologicalResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Returns a list of Tweets authored by the provided User ID */ - usersIdTweets: { - parameters: { - path: { - /** The ID of the User to lookup. */ - id: components["schemas"]["UserId"]; - }; - query: { - /** The minimum Tweet ID to be included in the result set. This parameter takes precedence over start_time if both are specified. */ - since_id?: components["schemas"]["TweetId"]; - /** The maximum Tweet ID to be included in the result set. This parameter takes precedence over end_time if both are specified. */ - until_id?: components["schemas"]["TweetId"]; - /** The maximum number of results. */ - max_results?: number; - /** This parameter is used to get the next 'page' of results. */ - pagination_token?: components["schemas"]["PaginationToken36"]; - /** The set of entities to exclude (e.g. 'replies' or 'retweets'). */ - exclude?: ("replies" | "retweets")[]; - /** YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. The since_id parameter takes precedence if it is also specified. */ - start_time?: string; - /** YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. The until_id parameter takes precedence if it is also specified. */ - end_time?: string; - /** A comma separated list of Tweet fields to display. */ - "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; - /** A comma separated list of fields to expand. */ - expansions?: components["parameters"]["TweetExpansionsParameter"]; - /** A comma separated list of Media fields to display. */ - "media.fields"?: components["parameters"]["MediaFieldsParameter"]; - /** A comma separated list of Poll fields to display. */ - "poll.fields"?: components["parameters"]["PollFieldsParameter"]; - /** A comma separated list of User fields to display. */ - "user.fields"?: components["parameters"]["UserFieldsParameter"]; - /** A comma separated list of Place fields to display. */ - "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["Get2UsersIdTweetsResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Causes the source User to unblock the target User. The source User must match the User context authorizing the request */ - usersIdUnblock: { - parameters: { - path: { - /** The ID of the authenticated source User that is requesting to unblock the target User. */ - source_user_id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - /** The ID of the User that the source User is requesting to unblock. */ - target_user_id: components["schemas"]["UserId"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["BlockUserMutationResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Causes the source User to unfollow the target User. The source User must match the User context authorizing the request */ - usersIdUnfollow: { - parameters: { - path: { - /** The ID of the authenticated source User that is requesting to unfollow the target User. */ - source_user_id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - /** The ID of the User that the source User is requesting to unfollow. */ - target_user_id: components["schemas"]["UserId"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["UsersFollowingDeleteResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; - /** Causes the source User to unmute the target User. The source User must match the User context authorizing the request */ - usersIdUnmute: { - parameters: { - path: { - /** The ID of the authenticated source User that is requesting to unmute the target User. */ - source_user_id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; - /** The ID of the User that the source User is requesting to unmute. */ - target_user_id: components["schemas"]["UserId"]; - }; - }; - responses: { - /** The request has succeeded. */ - 200: { - content: { - "application/json": components["schemas"]["MuteUserMutationResponse"]; - }; - }; - /** The request has failed. */ - default: { - content: { - "application/json": components["schemas"]["Error"]; - "application/problem+json": components["schemas"]["Problem"]; - }; - }; - }; - }; + /** Returns recent Compliance Jobs for a given job type and optional job status */ + listBatchComplianceJobs: { + parameters: { + query: { + /** Type of Compliance Job to list. */ + type: "tweets" | "users"; + /** Status of Compliance Job to list. */ + status?: "created" | "in_progress" | "failed" | "complete"; + /** A comma separated list of ComplianceJob fields to display. */ + "compliance_job.fields"?: components["parameters"]["ComplianceJobFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2ComplianceJobsResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Creates a compliance for the given job type */ + createBatchComplianceJob: { + parameters: {}; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["CreateComplianceJobResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["CreateComplianceJobRequest"]; + }; + }; + }; + /** Returns a single Compliance Job by ID */ + getBatchComplianceJob: { + parameters: { + path: { + /** The ID of the Compliance Job to retrieve. */ + id: components["schemas"]["JobId"]; + }; + query: { + /** A comma separated list of ComplianceJob fields to display. */ + "compliance_job.fields"?: components["parameters"]["ComplianceJobFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2ComplianceJobsIdResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Creates a new List. */ + listIdCreate: { + parameters: {}; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["ListCreateResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["ListCreateRequest"]; + }; + }; + }; + /** Returns a List. */ + listIdGet: { + parameters: { + path: { + /** The ID of the List. */ + id: components["schemas"]["ListId"]; + }; + query: { + /** A comma separated list of List fields to display. */ + "list.fields"?: components["parameters"]["ListFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["ListExpansionsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2ListsIdResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Update a List that you own. */ + listIdUpdate: { + parameters: { + path: { + /** The ID of the List to modify. */ + id: components["schemas"]["ListId"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["ListUpdateResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["ListUpdateRequest"]; + }; + }; + }; + /** Delete a List that you own. */ + listIdDelete: { + parameters: { + path: { + /** The ID of the List to delete. */ + id: components["schemas"]["ListId"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["ListDeleteResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns a list of Users that follow a List by the provided List ID */ + listGetFollowers: { + parameters: { + path: { + /** The ID of the List. */ + id: components["schemas"]["ListId"]; + }; + query: { + /** The maximum number of results. */ + max_results?: number; + /** This parameter is used to get a specified 'page' of results. */ + pagination_token?: components["schemas"]["PaginationTokenLong"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["UserExpansionsParameter"]; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2ListsIdFollowersResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns a list of Users that are members of a List by the provided List ID. */ + listGetMembers: { + parameters: { + path: { + /** The ID of the List. */ + id: components["schemas"]["ListId"]; + }; + query: { + /** The maximum number of results. */ + max_results?: number; + /** This parameter is used to get a specified 'page' of results. */ + pagination_token?: components["schemas"]["PaginationTokenLong"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["UserExpansionsParameter"]; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2ListsIdMembersResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Causes a User to become a member of a List. */ + listAddMember: { + parameters: { + path: { + /** The ID of the List for which to add a member. */ + id: components["schemas"]["ListId"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["ListMutateResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["ListAddUserRequest"]; + }; + }; + }; + /** Causes a User to be removed from the members of a List. */ + listRemoveMember: { + parameters: { + path: { + /** The ID of the List to remove a member. */ + id: components["schemas"]["ListId"]; + /** The ID of User that will be removed from the List. */ + user_id: components["schemas"]["UserId"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["ListMutateResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns a list of Tweets associated with the provided List ID. */ + listsIdTweets: { + parameters: { + path: { + /** The ID of the List. */ + id: components["schemas"]["ListId"]; + }; + query: { + /** The maximum number of results. */ + max_results?: number; + /** This parameter is used to get the next 'page' of results. */ + pagination_token?: components["schemas"]["PaginationToken36"]; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["TweetExpansionsParameter"]; + /** A comma separated list of Media fields to display. */ + "media.fields"?: components["parameters"]["MediaFieldsParameter"]; + /** A comma separated list of Poll fields to display. */ + "poll.fields"?: components["parameters"]["PollFieldsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Place fields to display. */ + "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2ListsIdTweetsResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Full OpenAPI Specification in JSON format. (See https://github.com/OAI/OpenAPI-Specification/blob/master/README.md) */ + getOpenApiSpec: { + parameters: {}; + responses: { + /** The request was successful */ + 200: { + content: { + "application/json": { [key: string]: unknown }; + }; + }; + }; + }; + /** Returns a variety of information about the Spaces specified by the requested IDs */ + findSpacesByIds: { + parameters: { + query: { + /** The list of Space IDs to return. */ + ids: string[]; + /** A comma separated list of Space fields to display. */ + "space.fields"?: components["parameters"]["SpaceFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["SpaceExpansionsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Topic fields to display. */ + "topic.fields"?: components["parameters"]["TopicFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2SpacesResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns a variety of information about the Spaces created by the provided User IDs */ + findSpacesByCreatorIds: { + parameters: { + query: { + /** The IDs of Users to search through. */ + user_ids: components["schemas"]["UserId"][]; + /** A comma separated list of Space fields to display. */ + "space.fields"?: components["parameters"]["SpaceFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["SpaceExpansionsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Topic fields to display. */ + "topic.fields"?: components["parameters"]["TopicFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2SpacesByCreatorIdsResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns Spaces that match the provided query. */ + searchSpaces: { + parameters: { + query: { + /** The search query. */ + query: string; + /** The state of Spaces to search for. */ + state?: "live" | "scheduled" | "all"; + /** The number of results to return. */ + max_results?: number; + /** A comma separated list of Space fields to display. */ + "space.fields"?: components["parameters"]["SpaceFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["SpaceExpansionsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Topic fields to display. */ + "topic.fields"?: components["parameters"]["TopicFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2SpacesSearchResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns a variety of information about the Space specified by the requested ID */ + findSpaceById: { + parameters: { + path: { + /** The ID of the Space to be retrieved. */ + id: string; + }; + query: { + /** A comma separated list of Space fields to display. */ + "space.fields"?: components["parameters"]["SpaceFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["SpaceExpansionsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Topic fields to display. */ + "topic.fields"?: components["parameters"]["TopicFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2SpacesIdResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Retrieves the list of Users who purchased a ticket to the given space */ + spaceBuyers: { + parameters: { + path: { + /** The ID of the Space to be retrieved. */ + id: string; + }; + query: { + /** This parameter is used to get a specified 'page' of results. */ + pagination_token?: components["schemas"]["PaginationToken32"]; + /** The maximum number of results. */ + max_results?: number; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["UserExpansionsParameter"]; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2SpacesIdBuyersResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Retrieves Tweets shared in the specified Space. */ + spaceTweets: { + parameters: { + path: { + /** The ID of the Space to be retrieved. */ + id: string; + }; + query: { + /** The number of Tweets to fetch from the provided space. If not provided, the value will default to the maximum of 100. */ + max_results?: number; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["TweetExpansionsParameter"]; + /** A comma separated list of Media fields to display. */ + "media.fields"?: components["parameters"]["MediaFieldsParameter"]; + /** A comma separated list of Poll fields to display. */ + "poll.fields"?: components["parameters"]["PollFieldsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Place fields to display. */ + "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2SpacesIdTweetsResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns a variety of information about the Tweet specified by the requested ID. */ + findTweetsById: { + parameters: { + query: { + /** A comma separated list of Tweet IDs. Up to 100 are allowed in a single request. */ + ids: components["schemas"]["TweetId"][]; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["TweetExpansionsParameter"]; + /** A comma separated list of Media fields to display. */ + "media.fields"?: components["parameters"]["MediaFieldsParameter"]; + /** A comma separated list of Poll fields to display. */ + "poll.fields"?: components["parameters"]["PollFieldsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Place fields to display. */ + "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2TweetsResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Causes the User to create a Tweet under the authorized account. */ + createTweet: { + parameters: {}; + responses: { + /** The request has succeeded. */ + 201: { + content: { + "application/json": components["schemas"]["TweetCreateResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["TweetCreateRequest"]; + }; + }; + }; + /** Streams 100% of compliance data for Tweets */ + getTweetsComplianceStream: { + parameters: { + query: { + /** The number of minutes of backfill requested. */ + backfill_minutes?: number; + /** The partition number. */ + partition: number; + /** YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweet Compliance events will be provided. */ + start_time?: string; + /** YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweet Compliance events will be provided. */ + end_time?: string; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["TweetComplianceStreamResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns Tweet Counts that match a search query. */ + tweetCountsFullArchiveSearch: { + parameters: { + query: { + /** One query/rule/filter for matching Tweets. Refer to https://t.co/rulelength to identify the max query length. */ + query: string; + /** YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp (from most recent 7 days) from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute). */ + start_time?: string; + /** YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute). */ + end_time?: string; + /** Returns results with a Tweet ID greater than (that is, more recent than) the specified ID. */ + since_id?: components["schemas"]["TweetId"]; + /** Returns results with a Tweet ID less than (that is, older than) the specified ID. */ + until_id?: components["schemas"]["TweetId"]; + /** This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified. */ + next_token?: components["schemas"]["PaginationToken36"]; + /** This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified. */ + pagination_token?: components["schemas"]["PaginationToken36"]; + /** The granularity for the search counts results. */ + granularity?: "minute" | "hour" | "day"; + /** A comma separated list of SearchCount fields to display. */ + "search_count.fields"?: components["parameters"]["SearchCountFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2TweetsCountsAllResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns Tweet Counts from the last 7 days that match a search query. */ + tweetCountsRecentSearch: { + parameters: { + query: { + /** One query/rule/filter for matching Tweets. Refer to https://t.co/rulelength to identify the max query length. */ + query: string; + /** YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp (from most recent 7 days) from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute). */ + start_time?: string; + /** YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute). */ + end_time?: string; + /** Returns results with a Tweet ID greater than (that is, more recent than) the specified ID. */ + since_id?: components["schemas"]["TweetId"]; + /** Returns results with a Tweet ID less than (that is, older than) the specified ID. */ + until_id?: components["schemas"]["TweetId"]; + /** This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified. */ + next_token?: components["schemas"]["PaginationToken36"]; + /** This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified. */ + pagination_token?: components["schemas"]["PaginationToken36"]; + /** The granularity for the search counts results. */ + granularity?: "minute" | "hour" | "day"; + /** A comma separated list of SearchCount fields to display. */ + "search_count.fields"?: components["parameters"]["SearchCountFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2TweetsCountsRecentResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Streams 100% of public Tweets. */ + getTweetsFirehoseStream: { + parameters: { + query: { + /** The number of minutes of backfill requested. */ + backfill_minutes?: number; + /** The partition number. */ + partition: number; + /** YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Tweets will be provided. */ + start_time?: string; + /** YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. */ + end_time?: string; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["TweetExpansionsParameter"]; + /** A comma separated list of Media fields to display. */ + "media.fields"?: components["parameters"]["MediaFieldsParameter"]; + /** A comma separated list of Poll fields to display. */ + "poll.fields"?: components["parameters"]["PollFieldsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Place fields to display. */ + "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["StreamingTweetResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Streams 100% of labeling events applied to Tweets */ + getTweetsLabelStream: { + parameters: { + query: { + /** The number of minutes of backfill requested. */ + backfill_minutes?: number; + /** YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweet labels will be provided. */ + start_time?: string; + /** YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp from which the Tweet labels will be provided. */ + end_time?: string; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["TweetLabelStreamResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Streams a deterministic 1% of public Tweets. */ + sampleStream: { + parameters: { + query: { + /** The number of minutes of backfill requested. */ + backfill_minutes?: number; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["TweetExpansionsParameter"]; + /** A comma separated list of Media fields to display. */ + "media.fields"?: components["parameters"]["MediaFieldsParameter"]; + /** A comma separated list of Poll fields to display. */ + "poll.fields"?: components["parameters"]["PollFieldsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Place fields to display. */ + "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["StreamingTweetResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Streams a deterministic 10% of public Tweets. */ + getTweetsSample10Stream: { + parameters: { + query: { + /** The number of minutes of backfill requested. */ + backfill_minutes?: number; + /** The partition number. */ + partition: number; + /** YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp to which the Tweets will be provided. */ + start_time?: string; + /** YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. */ + end_time?: string; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["TweetExpansionsParameter"]; + /** A comma separated list of Media fields to display. */ + "media.fields"?: components["parameters"]["MediaFieldsParameter"]; + /** A comma separated list of Poll fields to display. */ + "poll.fields"?: components["parameters"]["PollFieldsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Place fields to display. */ + "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2TweetsSample10StreamResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns Tweets that match a search query. */ + tweetsFullarchiveSearch: { + parameters: { + query: { + /** One query/rule/filter for matching Tweets. Refer to https://t.co/rulelength to identify the max query length. */ + query: string; + /** YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute). */ + start_time?: string; + /** YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute). */ + end_time?: string; + /** Returns results with a Tweet ID greater than (that is, more recent than) the specified ID. */ + since_id?: components["schemas"]["TweetId"]; + /** Returns results with a Tweet ID less than (that is, older than) the specified ID. */ + until_id?: components["schemas"]["TweetId"]; + /** The maximum number of search results to be returned by a request. */ + max_results?: number; + /** This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified. */ + next_token?: components["schemas"]["PaginationToken36"]; + /** This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified. */ + pagination_token?: components["schemas"]["PaginationToken36"]; + /** This order in which to return results. */ + sort_order?: "recency" | "relevancy"; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["TweetExpansionsParameter"]; + /** A comma separated list of Media fields to display. */ + "media.fields"?: components["parameters"]["MediaFieldsParameter"]; + /** A comma separated list of Poll fields to display. */ + "poll.fields"?: components["parameters"]["PollFieldsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Place fields to display. */ + "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2TweetsSearchAllResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns Tweets from the last 7 days that match a search query. */ + tweetsRecentSearch: { + parameters: { + query: { + /** One query/rule/filter for matching Tweets. Refer to https://t.co/rulelength to identify the max query length. */ + query: string; + /** YYYY-MM-DDTHH:mm:ssZ. The oldest UTC timestamp from which the Tweets will be provided. Timestamp is in second granularity and is inclusive (i.e. 12:00:01 includes the first second of the minute). */ + start_time?: string; + /** YYYY-MM-DDTHH:mm:ssZ. The newest, most recent UTC timestamp to which the Tweets will be provided. Timestamp is in second granularity and is exclusive (i.e. 12:00:01 excludes the first second of the minute). */ + end_time?: string; + /** Returns results with a Tweet ID greater than (that is, more recent than) the specified ID. */ + since_id?: components["schemas"]["TweetId"]; + /** Returns results with a Tweet ID less than (that is, older than) the specified ID. */ + until_id?: components["schemas"]["TweetId"]; + /** The maximum number of search results to be returned by a request. */ + max_results?: number; + /** This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified. */ + next_token?: components["schemas"]["PaginationToken36"]; + /** This parameter is used to get the next 'page' of results. The value used with the parameter is pulled directly from the response provided by the API, and should not be modified. */ + pagination_token?: components["schemas"]["PaginationToken36"]; + /** This order in which to return results. */ + sort_order?: "recency" | "relevancy"; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["TweetExpansionsParameter"]; + /** A comma separated list of Media fields to display. */ + "media.fields"?: components["parameters"]["MediaFieldsParameter"]; + /** A comma separated list of Poll fields to display. */ + "poll.fields"?: components["parameters"]["PollFieldsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Place fields to display. */ + "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2TweetsSearchRecentResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Streams Tweets matching the stream's active rule set. */ + searchStream: { + parameters: { + query: { + /** The number of minutes of backfill requested. */ + backfill_minutes?: number; + /** YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. */ + start_time?: string; + /** YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. */ + end_time?: string; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["TweetExpansionsParameter"]; + /** A comma separated list of Media fields to display. */ + "media.fields"?: components["parameters"]["MediaFieldsParameter"]; + /** A comma separated list of Poll fields to display. */ + "poll.fields"?: components["parameters"]["PollFieldsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Place fields to display. */ + "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["FilteredStreamingTweetResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns rules from a User's active rule set. Users can fetch all of their rules or a subset, specified by the provided rule ids. */ + getRules: { + parameters: { + query: { + /** A comma-separated list of Rule IDs. */ + ids?: components["schemas"]["RuleId"][]; + /** The maximum number of results. */ + max_results?: number; + /** This value is populated by passing the 'next_token' returned in a request to paginate through results. */ + pagination_token?: string; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["RulesLookupResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Add or delete rules from a User's active rule set. Users can provide unique, optionally tagged rules to add. Users can delete their entire rule set or a subset specified by rule ids or values. */ + addOrDeleteRules: { + parameters: { + query: { + /** Dry Run can be used with both the add and delete action, with the expected result given, but without actually taking any action in the system (meaning the end state will always be as it was when the request was submitted). This is particularly useful to validate rule changes. */ + dry_run?: boolean; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["AddOrDeleteRulesResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["AddOrDeleteRulesRequest"]; + }; + }; + }; + /** Returns a variety of information about the Tweet specified by the requested ID. */ + findTweetById: { + parameters: { + path: { + /** A single Tweet ID. */ + id: components["schemas"]["TweetId"]; + }; + query: { + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["TweetExpansionsParameter"]; + /** A comma separated list of Media fields to display. */ + "media.fields"?: components["parameters"]["MediaFieldsParameter"]; + /** A comma separated list of Poll fields to display. */ + "poll.fields"?: components["parameters"]["PollFieldsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Place fields to display. */ + "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2TweetsIdResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Delete specified Tweet (in the path) by ID. */ + deleteTweetById: { + parameters: { + path: { + /** The ID of the Tweet to be deleted. */ + id: components["schemas"]["TweetId"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["TweetDeleteResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns a list of Users that have liked the provided Tweet ID */ + tweetsIdLikingUsers: { + parameters: { + path: { + /** A single Tweet ID. */ + id: components["schemas"]["TweetId"]; + }; + query: { + /** The maximum number of results. */ + max_results?: number; + /** This parameter is used to get the next 'page' of results. */ + pagination_token?: components["schemas"]["PaginationToken36"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["UserExpansionsParameter"]; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2TweetsIdLikingUsersResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns a variety of information about each Tweet that quotes the Tweet specified by the requested ID. */ + findTweetsThatQuoteATweet: { + parameters: { + path: { + /** A single Tweet ID. */ + id: components["schemas"]["TweetId"]; + }; + query: { + /** The maximum number of results to be returned. */ + max_results?: number; + /** This parameter is used to get a specified 'page' of results. */ + pagination_token?: components["schemas"]["PaginationToken36"]; + /** The set of entities to exclude (e.g. 'replies' or 'retweets'). */ + exclude?: ("replies" | "retweets")[]; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["TweetExpansionsParameter"]; + /** A comma separated list of Media fields to display. */ + "media.fields"?: components["parameters"]["MediaFieldsParameter"]; + /** A comma separated list of Poll fields to display. */ + "poll.fields"?: components["parameters"]["PollFieldsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Place fields to display. */ + "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2TweetsIdQuoteTweetsResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns a list of Users that have retweeted the provided Tweet ID */ + tweetsIdRetweetingUsers: { + parameters: { + path: { + /** A single Tweet ID. */ + id: components["schemas"]["TweetId"]; + }; + query: { + /** The maximum number of results. */ + max_results?: number; + /** This parameter is used to get the next 'page' of results. */ + pagination_token?: components["schemas"]["PaginationToken36"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["UserExpansionsParameter"]; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2TweetsIdRetweetedByResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Hides or unhides a reply to an owned conversation. */ + hideReplyById: { + parameters: { + path: { + /** The ID of the reply that you want to hide or unhide. */ + tweet_id: components["schemas"]["TweetId"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["TweetHideResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["TweetHideRequest"]; + }; + }; + }; + /** This endpoint returns information about Users. Specify Users by their ID. */ + findUsersById: { + parameters: { + query: { + /** A list of User IDs, comma-separated. You can specify up to 100 IDs. */ + ids: components["schemas"]["UserId"][]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["UserExpansionsParameter"]; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2UsersResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** This endpoint returns information about Users. Specify Users by their username. */ + findUsersByUsername: { + parameters: { + query: { + /** A list of usernames, comma-separated. */ + usernames: string[]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["UserExpansionsParameter"]; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2UsersByResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** This endpoint returns information about a User. Specify User by username. */ + findUserByUsername: { + parameters: { + path: { + /** A username. */ + username: string; + }; + query: { + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["UserExpansionsParameter"]; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2UsersByUsernameUsernameResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Streams 100% of compliance data for Users */ + getUsersComplianceStream: { + parameters: { + query: { + /** The number of minutes of backfill requested. */ + backfill_minutes?: number; + /** The partition number. */ + partition: number; + /** YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the User Compliance events will be provided. */ + start_time?: string; + /** YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp from which the User Compliance events will be provided. */ + end_time?: string; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["UserComplianceStreamResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** This endpoint returns information about the requesting User. */ + findMyUser: { + parameters: { + query: { + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["UserExpansionsParameter"]; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2UsersMeResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** This endpoint returns information about a User. Specify User by ID. */ + findUserById: { + parameters: { + path: { + /** The ID of the User to lookup. */ + id: components["schemas"]["UserId"]; + }; + query: { + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["UserExpansionsParameter"]; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2UsersIdResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns a list of Users that are blocked by the provided User ID */ + usersIdBlocking: { + parameters: { + path: { + /** The ID of the authenticated source User for whom to return results. */ + id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + }; + query: { + /** The maximum number of results. */ + max_results?: number; + /** This parameter is used to get a specified 'page' of results. */ + pagination_token?: components["schemas"]["PaginationToken32"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["UserExpansionsParameter"]; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2UsersIdBlockingResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Causes the User (in the path) to block the target User. The User (in the path) must match the User context authorizing the request */ + usersIdBlock: { + parameters: { + path: { + /** The ID of the authenticated source User that is requesting to block the target User. */ + id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["BlockUserMutationResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["BlockUserRequest"]; + }; + }; + }; + /** Returns Tweet objects that have been bookmarked by the requesting User */ + getUsersIdBookmarks: { + parameters: { + path: { + /** The ID of the authenticated source User for whom to return results. */ + id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + }; + query: { + /** The maximum number of results. */ + max_results?: number; + /** This parameter is used to get the next 'page' of results. */ + pagination_token?: components["schemas"]["PaginationToken36"]; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["TweetExpansionsParameter"]; + /** A comma separated list of Media fields to display. */ + "media.fields"?: components["parameters"]["MediaFieldsParameter"]; + /** A comma separated list of Poll fields to display. */ + "poll.fields"?: components["parameters"]["PollFieldsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Place fields to display. */ + "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2UsersIdBookmarksResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Adds a Tweet (ID in the body) to the requesting User's (in the path) bookmarks */ + postUsersIdBookmarks: { + parameters: { + path: { + /** The ID of the authenticated source User for whom to add bookmarks. */ + id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["BookmarkMutationResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["BookmarkAddRequest"]; + }; + }; + }; + /** Removes a Tweet from the requesting User's bookmarked Tweets. */ + usersIdBookmarksDelete: { + parameters: { + path: { + /** The ID of the authenticated source User whose bookmark is to be removed. */ + id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + /** The ID of the Tweet that the source User is removing from bookmarks. */ + tweet_id: components["schemas"]["TweetId"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["BookmarkMutationResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns a User's followed Lists. */ + userFollowedLists: { + parameters: { + path: { + /** The ID of the User to lookup. */ + id: components["schemas"]["UserId"]; + }; + query: { + /** The maximum number of results. */ + max_results?: number; + /** This parameter is used to get a specified 'page' of results. */ + pagination_token?: components["schemas"]["PaginationTokenLong"]; + /** A comma separated list of List fields to display. */ + "list.fields"?: components["parameters"]["ListFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["ListExpansionsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2UsersIdFollowedListsResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Causes a User to follow a List. */ + listUserFollow: { + parameters: { + path: { + /** The ID of the authenticated source User that will follow the List. */ + id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["ListFollowedResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["ListFollowedRequest"]; + }; + }; + }; + /** Causes a User to unfollow a List. */ + listUserUnfollow: { + parameters: { + path: { + /** The ID of the authenticated source User that will unfollow the List. */ + id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + /** The ID of the List to unfollow. */ + list_id: components["schemas"]["ListId"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["ListFollowedResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns a list of Users who are followers of the specified User ID. */ + usersIdFollowers: { + parameters: { + path: { + /** The ID of the User to lookup. */ + id: components["schemas"]["UserId"]; + }; + query: { + /** The maximum number of results. */ + max_results?: number; + /** This parameter is used to get a specified 'page' of results. */ + pagination_token?: components["schemas"]["PaginationToken32"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["UserExpansionsParameter"]; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2UsersIdFollowersResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns a list of Users that are being followed by the provided User ID */ + usersIdFollowing: { + parameters: { + path: { + /** The ID of the User to lookup. */ + id: components["schemas"]["UserId"]; + }; + query: { + /** The maximum number of results. */ + max_results?: number; + /** This parameter is used to get a specified 'page' of results. */ + pagination_token?: components["schemas"]["PaginationToken32"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["UserExpansionsParameter"]; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2UsersIdFollowingResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Causes the User(in the path) to follow, or “request to follow” for protected Users, the target User. The User(in the path) must match the User context authorizing the request */ + usersIdFollow: { + parameters: { + path: { + /** The ID of the authenticated source User that is requesting to follow the target User. */ + id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["UsersFollowingCreateResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["UsersFollowingCreateRequest"]; + }; + }; + }; + /** Returns a list of Tweets liked by the provided User ID */ + usersIdLikedTweets: { + parameters: { + path: { + /** The ID of the User to lookup. */ + id: components["schemas"]["UserId"]; + }; + query: { + /** The maximum number of results. */ + max_results?: number; + /** This parameter is used to get the next 'page' of results. */ + pagination_token?: components["schemas"]["PaginationToken36"]; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["TweetExpansionsParameter"]; + /** A comma separated list of Media fields to display. */ + "media.fields"?: components["parameters"]["MediaFieldsParameter"]; + /** A comma separated list of Poll fields to display. */ + "poll.fields"?: components["parameters"]["PollFieldsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Place fields to display. */ + "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2UsersIdLikedTweetsResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Causes the User (in the path) to like the specified Tweet. The User in the path must match the User context authorizing the request. */ + usersIdLike: { + parameters: { + path: { + /** The ID of the authenticated source User that is requesting to like the Tweet. */ + id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["UsersLikesCreateResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["UsersLikesCreateRequest"]; + }; + }; + }; + /** Causes the User (in the path) to unlike the specified Tweet. The User must match the User context authorizing the request */ + usersIdUnlike: { + parameters: { + path: { + /** The ID of the authenticated source User that is requesting to unlike the Tweet. */ + id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + /** The ID of the Tweet that the User is requesting to unlike. */ + tweet_id: components["schemas"]["TweetId"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["UsersLikesDeleteResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Get a User's List Memberships. */ + getUserListMemberships: { + parameters: { + path: { + /** The ID of the User to lookup. */ + id: components["schemas"]["UserId"]; + }; + query: { + /** The maximum number of results. */ + max_results?: number; + /** This parameter is used to get a specified 'page' of results. */ + pagination_token?: components["schemas"]["PaginationTokenLong"]; + /** A comma separated list of List fields to display. */ + "list.fields"?: components["parameters"]["ListFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["ListExpansionsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2UsersIdListMembershipsResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns Tweet objects that mention username associated to the provided User ID */ + usersIdMentions: { + parameters: { + path: { + /** The ID of the User to lookup. */ + id: components["schemas"]["UserId"]; + }; + query: { + /** The minimum Tweet ID to be included in the result set. This parameter takes precedence over start_time if both are specified. */ + since_id?: components["schemas"]["TweetId"]; + /** The maximum Tweet ID to be included in the result set. This parameter takes precedence over end_time if both are specified. */ + until_id?: components["schemas"]["TweetId"]; + /** The maximum number of results. */ + max_results?: number; + /** This parameter is used to get the next 'page' of results. */ + pagination_token?: components["schemas"]["PaginationToken36"]; + /** YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. The since_id parameter takes precedence if it is also specified. */ + start_time?: string; + /** YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. The until_id parameter takes precedence if it is also specified. */ + end_time?: string; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["TweetExpansionsParameter"]; + /** A comma separated list of Media fields to display. */ + "media.fields"?: components["parameters"]["MediaFieldsParameter"]; + /** A comma separated list of Poll fields to display. */ + "poll.fields"?: components["parameters"]["PollFieldsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Place fields to display. */ + "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2UsersIdMentionsResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns a list of Users that are muted by the provided User ID */ + usersIdMuting: { + parameters: { + path: { + /** The ID of the authenticated source User for whom to return results. */ + id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + }; + query: { + /** The maximum number of results. */ + max_results?: number; + /** This parameter is used to get the next 'page' of results. */ + pagination_token?: components["schemas"]["PaginationTokenLong"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["UserExpansionsParameter"]; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2UsersIdMutingResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Causes the User (in the path) to mute the target User. The User (in the path) must match the User context authorizing the request. */ + usersIdMute: { + parameters: { + path: { + /** The ID of the authenticated source User that is requesting to mute the target User. */ + id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["MuteUserMutationResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["MuteUserRequest"]; + }; + }; + }; + /** Get a User's Owned Lists. */ + listUserOwnedLists: { + parameters: { + path: { + /** The ID of the User to lookup. */ + id: components["schemas"]["UserId"]; + }; + query: { + /** The maximum number of results. */ + max_results?: number; + /** This parameter is used to get a specified 'page' of results. */ + pagination_token?: components["schemas"]["PaginationTokenLong"]; + /** A comma separated list of List fields to display. */ + "list.fields"?: components["parameters"]["ListFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["ListExpansionsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2UsersIdOwnedListsResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Get a User's Pinned Lists. */ + listUserPinnedLists: { + parameters: { + path: { + /** The ID of the authenticated source User for whom to return results. */ + id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + }; + query: { + /** A comma separated list of List fields to display. */ + "list.fields"?: components["parameters"]["ListFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["ListExpansionsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2UsersIdPinnedListsResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Causes a User to pin a List. */ + listUserPin: { + parameters: { + path: { + /** The ID of the authenticated source User that will pin the List. */ + id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["ListPinnedResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["ListPinnedRequest"]; + }; + }; + }; + /** Causes a User to remove a pinned List. */ + listUserUnpin: { + parameters: { + path: { + /** The ID of the authenticated source User for whom to return results. */ + id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + /** The ID of the List to unpin. */ + list_id: components["schemas"]["ListId"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["ListUnpinResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Causes the User (in the path) to retweet the specified Tweet. The User in the path must match the User context authorizing the request. */ + usersIdRetweets: { + parameters: { + path: { + /** The ID of the authenticated source User that is requesting to retweet the Tweet. */ + id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["UsersRetweetsCreateResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["UsersRetweetsCreateRequest"]; + }; + }; + }; + /** Causes the User (in the path) to unretweet the specified Tweet. The User must match the User context authorizing the request */ + usersIdUnretweets: { + parameters: { + path: { + /** The ID of the authenticated source User that is requesting to retweet the Tweet. */ + id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + /** The ID of the Tweet that the User is requesting to unretweet. */ + source_tweet_id: components["schemas"]["TweetId"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["UsersRetweetsDeleteResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns Tweet objects that appears in the provided User ID's home timeline */ + usersIdTimeline: { + parameters: { + path: { + /** The ID of the authenticated source User to list Reverse Chronological Timeline Tweets of. */ + id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + }; + query: { + /** The minimum Tweet ID to be included in the result set. This parameter takes precedence over start_time if both are specified. */ + since_id?: components["schemas"]["TweetId"]; + /** The maximum Tweet ID to be included in the result set. This parameter takes precedence over end_time if both are specified. */ + until_id?: components["schemas"]["TweetId"]; + /** The maximum number of results. */ + max_results?: number; + /** This parameter is used to get the next 'page' of results. */ + pagination_token?: components["schemas"]["PaginationToken36"]; + /** The set of entities to exclude (e.g. 'replies' or 'retweets'). */ + exclude?: ("replies" | "retweets")[]; + /** YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. The since_id parameter takes precedence if it is also specified. */ + start_time?: string; + /** YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. The until_id parameter takes precedence if it is also specified. */ + end_time?: string; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["TweetExpansionsParameter"]; + /** A comma separated list of Media fields to display. */ + "media.fields"?: components["parameters"]["MediaFieldsParameter"]; + /** A comma separated list of Poll fields to display. */ + "poll.fields"?: components["parameters"]["PollFieldsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Place fields to display. */ + "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2UsersIdTimelinesReverseChronologicalResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Returns a list of Tweets authored by the provided User ID */ + usersIdTweets: { + parameters: { + path: { + /** The ID of the User to lookup. */ + id: components["schemas"]["UserId"]; + }; + query: { + /** The minimum Tweet ID to be included in the result set. This parameter takes precedence over start_time if both are specified. */ + since_id?: components["schemas"]["TweetId"]; + /** The maximum Tweet ID to be included in the result set. This parameter takes precedence over end_time if both are specified. */ + until_id?: components["schemas"]["TweetId"]; + /** The maximum number of results. */ + max_results?: number; + /** This parameter is used to get the next 'page' of results. */ + pagination_token?: components["schemas"]["PaginationToken36"]; + /** The set of entities to exclude (e.g. 'replies' or 'retweets'). */ + exclude?: ("replies" | "retweets")[]; + /** YYYY-MM-DDTHH:mm:ssZ. The earliest UTC timestamp from which the Tweets will be provided. The since_id parameter takes precedence if it is also specified. */ + start_time?: string; + /** YYYY-MM-DDTHH:mm:ssZ. The latest UTC timestamp to which the Tweets will be provided. The until_id parameter takes precedence if it is also specified. */ + end_time?: string; + /** A comma separated list of Tweet fields to display. */ + "tweet.fields"?: components["parameters"]["TweetFieldsParameter"]; + /** A comma separated list of fields to expand. */ + expansions?: components["parameters"]["TweetExpansionsParameter"]; + /** A comma separated list of Media fields to display. */ + "media.fields"?: components["parameters"]["MediaFieldsParameter"]; + /** A comma separated list of Poll fields to display. */ + "poll.fields"?: components["parameters"]["PollFieldsParameter"]; + /** A comma separated list of User fields to display. */ + "user.fields"?: components["parameters"]["UserFieldsParameter"]; + /** A comma separated list of Place fields to display. */ + "place.fields"?: components["parameters"]["PlaceFieldsParameter"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["Get2UsersIdTweetsResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Causes the source User to unblock the target User. The source User must match the User context authorizing the request */ + usersIdUnblock: { + parameters: { + path: { + /** The ID of the authenticated source User that is requesting to unblock the target User. */ + source_user_id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + /** The ID of the User that the source User is requesting to unblock. */ + target_user_id: components["schemas"]["UserId"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["BlockUserMutationResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Causes the source User to unfollow the target User. The source User must match the User context authorizing the request */ + usersIdUnfollow: { + parameters: { + path: { + /** The ID of the authenticated source User that is requesting to unfollow the target User. */ + source_user_id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + /** The ID of the User that the source User is requesting to unfollow. */ + target_user_id: components["schemas"]["UserId"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["UsersFollowingDeleteResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; + /** Causes the source User to unmute the target User. The source User must match the User context authorizing the request */ + usersIdUnmute: { + parameters: { + path: { + /** The ID of the authenticated source User that is requesting to unmute the target User. */ + source_user_id: components["schemas"]["UserIdMatchesAuthenticatedUser"]; + /** The ID of the User that the source User is requesting to unmute. */ + target_user_id: components["schemas"]["UserId"]; + }; + }; + responses: { + /** The request has succeeded. */ + 200: { + content: { + "application/json": components["schemas"]["MuteUserMutationResponse"]; + }; + }; + /** The request has failed. */ + default: { + content: { + "application/json": components["schemas"]["Error"]; + "application/problem+json": components["schemas"]["Problem"]; + }; + }; + }; + }; } export interface external {} -export type listBatchComplianceJobs = operations['listBatchComplianceJobs'] -export type createBatchComplianceJob = operations['createBatchComplianceJob'] -export type getBatchComplianceJob = operations['getBatchComplianceJob'] -export type listIdCreate = operations['listIdCreate'] -export type listIdDelete = operations['listIdDelete'] -export type listIdGet = operations['listIdGet'] -export type listIdUpdate = operations['listIdUpdate'] -export type listGetFollowers = operations['listGetFollowers'] -export type listGetMembers = operations['listGetMembers'] -export type listAddMember = operations['listAddMember'] -export type listRemoveMember = operations['listRemoveMember'] -export type listsIdTweets = operations['listsIdTweets'] -export type getOpenApiSpec = operations['getOpenApiSpec'] -export type findSpacesByIds = operations['findSpacesByIds'] -export type findSpacesByCreatorIds = operations['findSpacesByCreatorIds'] -export type searchSpaces = operations['searchSpaces'] -export type findSpaceById = operations['findSpaceById'] -export type spaceBuyers = operations['spaceBuyers'] -export type spaceTweets = operations['spaceTweets'] -export type findTweetsById = operations['findTweetsById'] -export type createTweet = operations['createTweet'] -export type getTweetsComplianceStream = operations['getTweetsComplianceStream'] -export type tweetCountsFullArchiveSearch = operations['tweetCountsFullArchiveSearch'] -export type tweetCountsRecentSearch = operations['tweetCountsRecentSearch'] -export type getTweetsFirehoseStream = operations['getTweetsFirehoseStream'] -export type getTweetsLabelStream = operations['getTweetsLabelStream'] -export type sampleStream = operations['sampleStream'] -export type getTweetsSample10Stream = operations['getTweetsSample10Stream'] -export type tweetsFullarchiveSearch = operations['tweetsFullarchiveSearch'] -export type tweetsRecentSearch = operations['tweetsRecentSearch'] -export type searchStream = operations['searchStream'] -export type getRules = operations['getRules'] -export type addOrDeleteRules = operations['addOrDeleteRules'] -export type deleteTweetById = operations['deleteTweetById'] -export type findTweetById = operations['findTweetById'] -export type tweetsIdLikingUsers = operations['tweetsIdLikingUsers'] -export type findTweetsThatQuoteATweet = operations['findTweetsThatQuoteATweet'] -export type tweetsIdRetweetingUsers = operations['tweetsIdRetweetingUsers'] -export type hideReplyById = operations['hideReplyById'] -export type findUsersById = operations['findUsersById'] -export type findUsersByUsername = operations['findUsersByUsername'] -export type findUserByUsername = operations['findUserByUsername'] -export type getUsersComplianceStream = operations['getUsersComplianceStream'] -export type findMyUser = operations['findMyUser'] -export type findUserById = operations['findUserById'] -export type usersIdBlocking = operations['usersIdBlocking'] -export type usersIdBlock = operations['usersIdBlock'] -export type getUsersIdBookmarks = operations['getUsersIdBookmarks'] -export type postUsersIdBookmarks = operations['postUsersIdBookmarks'] -export type usersIdBookmarksDelete = operations['usersIdBookmarksDelete'] -export type userFollowedLists = operations['userFollowedLists'] -export type listUserFollow = operations['listUserFollow'] -export type listUserUnfollow = operations['listUserUnfollow'] -export type usersIdFollowers = operations['usersIdFollowers'] -export type usersIdFollowing = operations['usersIdFollowing'] -export type usersIdFollow = operations['usersIdFollow'] -export type usersIdLikedTweets = operations['usersIdLikedTweets'] -export type usersIdLike = operations['usersIdLike'] -export type usersIdUnlike = operations['usersIdUnlike'] -export type getUserListMemberships = operations['getUserListMemberships'] -export type usersIdMentions = operations['usersIdMentions'] -export type usersIdMuting = operations['usersIdMuting'] -export type usersIdMute = operations['usersIdMute'] -export type listUserOwnedLists = operations['listUserOwnedLists'] -export type listUserPinnedLists = operations['listUserPinnedLists'] -export type listUserPin = operations['listUserPin'] -export type listUserUnpin = operations['listUserUnpin'] -export type usersIdRetweets = operations['usersIdRetweets'] -export type usersIdUnretweets = operations['usersIdUnretweets'] -export type usersIdTimeline = operations['usersIdTimeline'] -export type usersIdTweets = operations['usersIdTweets'] -export type usersIdUnblock = operations['usersIdUnblock'] -export type usersIdUnfollow = operations['usersIdUnfollow'] -export type usersIdUnmute = operations['usersIdUnmute'] +export type listBatchComplianceJobs = operations["listBatchComplianceJobs"]; +export type createBatchComplianceJob = operations["createBatchComplianceJob"]; +export type getBatchComplianceJob = operations["getBatchComplianceJob"]; +export type listIdCreate = operations["listIdCreate"]; +export type listIdDelete = operations["listIdDelete"]; +export type listIdGet = operations["listIdGet"]; +export type listIdUpdate = operations["listIdUpdate"]; +export type listGetFollowers = operations["listGetFollowers"]; +export type listGetMembers = operations["listGetMembers"]; +export type listAddMember = operations["listAddMember"]; +export type listRemoveMember = operations["listRemoveMember"]; +export type listsIdTweets = operations["listsIdTweets"]; +export type getOpenApiSpec = operations["getOpenApiSpec"]; +export type findSpacesByIds = operations["findSpacesByIds"]; +export type findSpacesByCreatorIds = operations["findSpacesByCreatorIds"]; +export type searchSpaces = operations["searchSpaces"]; +export type findSpaceById = operations["findSpaceById"]; +export type spaceBuyers = operations["spaceBuyers"]; +export type spaceTweets = operations["spaceTweets"]; +export type findTweetsById = operations["findTweetsById"]; +export type createTweet = operations["createTweet"]; +export type getTweetsComplianceStream = operations["getTweetsComplianceStream"]; +export type tweetCountsFullArchiveSearch = + operations["tweetCountsFullArchiveSearch"]; +export type tweetCountsRecentSearch = operations["tweetCountsRecentSearch"]; +export type getTweetsFirehoseStream = operations["getTweetsFirehoseStream"]; +export type getTweetsLabelStream = operations["getTweetsLabelStream"]; +export type sampleStream = operations["sampleStream"]; +export type getTweetsSample10Stream = operations["getTweetsSample10Stream"]; +export type tweetsFullarchiveSearch = operations["tweetsFullarchiveSearch"]; +export type tweetsRecentSearch = operations["tweetsRecentSearch"]; +export type searchStream = operations["searchStream"]; +export type getRules = operations["getRules"]; +export type addOrDeleteRules = operations["addOrDeleteRules"]; +export type deleteTweetById = operations["deleteTweetById"]; +export type findTweetById = operations["findTweetById"]; +export type tweetsIdLikingUsers = operations["tweetsIdLikingUsers"]; +export type findTweetsThatQuoteATweet = operations["findTweetsThatQuoteATweet"]; +export type tweetsIdRetweetingUsers = operations["tweetsIdRetweetingUsers"]; +export type hideReplyById = operations["hideReplyById"]; +export type findUsersById = operations["findUsersById"]; +export type findUsersByUsername = operations["findUsersByUsername"]; +export type findUserByUsername = operations["findUserByUsername"]; +export type getUsersComplianceStream = operations["getUsersComplianceStream"]; +export type findMyUser = operations["findMyUser"]; +export type findUserById = operations["findUserById"]; +export type usersIdBlocking = operations["usersIdBlocking"]; +export type usersIdBlock = operations["usersIdBlock"]; +export type getUsersIdBookmarks = operations["getUsersIdBookmarks"]; +export type postUsersIdBookmarks = operations["postUsersIdBookmarks"]; +export type usersIdBookmarksDelete = operations["usersIdBookmarksDelete"]; +export type userFollowedLists = operations["userFollowedLists"]; +export type listUserFollow = operations["listUserFollow"]; +export type listUserUnfollow = operations["listUserUnfollow"]; +export type usersIdFollowers = operations["usersIdFollowers"]; +export type usersIdFollowing = operations["usersIdFollowing"]; +export type usersIdFollow = operations["usersIdFollow"]; +export type usersIdLikedTweets = operations["usersIdLikedTweets"]; +export type usersIdLike = operations["usersIdLike"]; +export type usersIdUnlike = operations["usersIdUnlike"]; +export type getUserListMemberships = operations["getUserListMemberships"]; +export type usersIdMentions = operations["usersIdMentions"]; +export type usersIdMuting = operations["usersIdMuting"]; +export type usersIdMute = operations["usersIdMute"]; +export type listUserOwnedLists = operations["listUserOwnedLists"]; +export type listUserPinnedLists = operations["listUserPinnedLists"]; +export type listUserPin = operations["listUserPin"]; +export type listUserUnpin = operations["listUserUnpin"]; +export type usersIdRetweets = operations["usersIdRetweets"]; +export type usersIdUnretweets = operations["usersIdUnretweets"]; +export type usersIdTimeline = operations["usersIdTimeline"]; +export type usersIdTweets = operations["usersIdTweets"]; +export type usersIdUnblock = operations["usersIdUnblock"]; +export type usersIdUnfollow = operations["usersIdUnfollow"]; +export type usersIdUnmute = operations["usersIdUnmute"]; diff --git a/src/index.ts b/src/index.ts index 3a3473b..7403c3d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -2,6 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 export * as auth from "./auth"; -export * as types from './types' +export * as types from "./types"; export { Client } from "./gen/Client"; export { Client as default } from "./gen/Client"; diff --git a/src/request.ts b/src/request.ts index fd2c651..51ef63e 100644 --- a/src/request.ts +++ b/src/request.ts @@ -5,174 +5,175 @@ import fetch from "node-fetch"; import type { RequestInfo, RequestInit, Response, Headers } from "node-fetch"; import { buildQueryString } from "./utils"; import { - AuthClient, - TwitterNextToken, - TwitterPaginatedResponse, + AuthClient, + TwitterNextToken, + TwitterPaginatedResponse, } from "./types"; import type { AbortController as AbortControllerPolyfill } from "abort-controller"; let AbortController: - | typeof globalThis.AbortController - | typeof AbortControllerPolyfill; + | typeof globalThis.AbortController + | typeof AbortControllerPolyfill; if (!globalThis.AbortController) { - AbortController = require("abort-controller"); + AbortController = require("abort-controller"); } else { - // https://nodejs.org/api/globals.html#class-abortcontroller - // AbortController available in v14.17.0 as experimental - AbortController = globalThis.AbortController; + // https://nodejs.org/api/globals.html#class-abortcontroller + // AbortController available in v14.17.0 as experimental + AbortController = globalThis.AbortController; } export interface RequestOptions extends Omit { - auth?: AuthClient; - endpoint: string; - params?: Record; - request_body?: Record; - method?: string; - max_retries?: number; - base_url?: string; + auth?: AuthClient; + endpoint: string; + params?: Record; + request_body?: Record; + method?: string; + max_retries?: number; + base_url?: string; } async function fetchWithRetries( - url: RequestInfo, - init: RequestInit, - max_retries = 0 + url: RequestInfo, + init: RequestInit, + max_retries = 0 ): Promise { - const res = await fetch(url, init); - if (res.status === 429 && max_retries > 0) { - const rateLimitReset = Number(res.headers.get("x-rate-limit-reset")); - const rateLimitRemaining = Number(res.headers.get("x-rate-limit-remaining")); - const timeTillReset = rateLimitReset * 1000 - Date.now(); - let timeToWait = 1000; - if (rateLimitRemaining === 0) - timeToWait = timeTillReset; - await new Promise((resolve) => setTimeout(resolve, timeToWait)); - return fetchWithRetries(url, init, max_retries - 1); - } - return res; + const res = await fetch(url, init); + if (res.status === 429 && max_retries > 0) { + const rateLimitReset = Number(res.headers.get("x-rate-limit-reset")); + const rateLimitRemaining = Number( + res.headers.get("x-rate-limit-remaining") + ); + const timeTillReset = rateLimitReset * 1000 - Date.now(); + let timeToWait = 1000; + if (rateLimitRemaining === 0) timeToWait = timeTillReset; + await new Promise((resolve) => setTimeout(resolve, timeToWait)); + return fetchWithRetries(url, init, max_retries - 1); + } + return res; } class TwitterResponseError extends Error { - status: number; - statusText: string; - headers: Record; - error: Record; - constructor( - status: number, - statusText: string, - headers: Headers, - error: Record - ) { - super(); - this.status = status; - this.statusText = statusText; - this.headers = Object.fromEntries(headers); - this.error = error; - } + status: number; + statusText: string; + headers: Record; + error: Record; + constructor( + status: number, + statusText: string, + headers: Headers, + error: Record + ) { + super(); + this.status = status; + this.statusText = statusText; + this.headers = Object.fromEntries(headers); + this.error = error; + } } export async function request({ - auth, - endpoint, - params: query = {}, - request_body, - method, - max_retries, - base_url = "https://api.twitter.com", - headers, - ...options + auth, + endpoint, + params: query = {}, + request_body, + method, + max_retries, + base_url = "https://api.twitter.com", + headers, + ...options }: RequestOptions): Promise { - const url = new URL(base_url + endpoint); - url.search = buildQueryString(query); - const includeBody = (method === "POST" || method === "PUT") && !!request_body; - const authHeader = auth - ? await auth.getAuthHeader(url.href, method) - : undefined; - const response = await fetchWithRetries( - url.toString(), - { - headers: { - ...(includeBody - ? { "Content-Type": "application/json; charset=utf-8" } - : undefined), - ...authHeader, - ...headers, - }, - method, - body: includeBody ? JSON.stringify(request_body) : undefined, - // Timeout if you don't see any data for 60 seconds - // https://developer.twitter.com/en/docs/tutorials/consuming-streaming-data - timeout: 60000, - ...options, - }, - max_retries - ); - if (!response.ok) { - const error = await response.json(); - throw new TwitterResponseError( - response.status, - response.statusText, - response.headers, - error - ); - } - return response; + const url = new URL(base_url + endpoint); + url.search = buildQueryString(query); + const includeBody = (method === "POST" || method === "PUT") && !!request_body; + const authHeader = auth + ? await auth.getAuthHeader(url.href, method) + : undefined; + const response = await fetchWithRetries( + url.toString(), + { + headers: { + ...(includeBody + ? { "Content-Type": "application/json; charset=utf-8" } + : undefined), + ...authHeader, + ...headers, + }, + method, + body: includeBody ? JSON.stringify(request_body) : undefined, + // Timeout if you don't see any data for 60 seconds + // https://developer.twitter.com/en/docs/tutorials/consuming-streaming-data + timeout: 60000, + ...options, + }, + max_retries + ); + if (!response.ok) { + const error = await response.json(); + throw new TwitterResponseError( + response.status, + response.statusText, + response.headers, + error + ); + } + return response; } export async function* stream(args: RequestOptions): AsyncGenerator { - const controller = new AbortController(); - const { body } = await request({ - signal: controller.signal as RequestInit["signal"], - ...args, - }); - if (body === null) throw new Error("No response returned from stream"); - let buf = ""; - try { - for await (const chunk of body) { - buf += chunk.toString(); - const lines = buf.split("\r\n"); - for (const [i, line] of lines.entries()) { - if (i === lines.length - 1) { - buf = line; - } else if (line) yield JSON.parse(line); - } - } - } finally { - controller.abort(); - } + const controller = new AbortController(); + const { body } = await request({ + signal: controller.signal as RequestInit["signal"], + ...args, + }); + if (body === null) throw new Error("No response returned from stream"); + let buf = ""; + try { + for await (const chunk of body) { + buf += chunk.toString(); + const lines = buf.split("\r\n"); + for (const [i, line] of lines.entries()) { + if (i === lines.length - 1) { + buf = line; + } else if (line) yield JSON.parse(line); + } + } + } finally { + controller.abort(); + } } export async function rest>( - args: RequestOptions + args: RequestOptions ): Promise { - const response = await request(args); - return response.json(); + const response = await request(args); + return response.json(); } export function paginate( - args: RequestOptions + args: RequestOptions ): TwitterPaginatedResponse { - return { - then(resolve, reject) { - return rest(args).then(resolve, reject); - }, - async *[Symbol.asyncIterator](): AsyncIterator { - let ended = false; - let pagination_token: string | undefined; - while (!ended) { - const response = await rest({ - ...args, - params: { - ...args.params, - ...(pagination_token && { pagination_token }), - }, - }); - yield response; - pagination_token = response?.meta?.next_token; - if (!pagination_token) { - ended = true; - } - } - }, - }; + return { + then(resolve, reject) { + return rest(args).then(resolve, reject); + }, + async *[Symbol.asyncIterator](): AsyncIterator { + let ended = false; + let pagination_token: string | undefined; + while (!ended) { + const response = await rest({ + ...args, + params: { + ...args.params, + ...(pagination_token && { pagination_token }), + }, + }); + yield response; + pagination_token = response?.meta?.next_token; + if (!pagination_token) { + ended = true; + } + } + }, + }; } diff --git a/src/types.ts b/src/types.ts index af98f29..590605b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -5,68 +5,68 @@ export type SuccessStatus = 200 | 201; export type ResponseType = "application/json"; export interface AuthHeader { - Authorization: string; + Authorization: string; } export abstract class AuthClient { - abstract getAuthHeader( - url?: string, - method?: string - ): Promise | AuthHeader; + abstract getAuthHeader( + url?: string, + method?: string + ): Promise | AuthHeader; } export interface TwitterNextToken { - meta?: { next_token?: string }; + meta?: { next_token?: string }; } export interface TwitterPaginatedResponse - extends AsyncIterable { - then( - resolve: ((value: T) => T | PromiseLike) | null | undefined, - reject: ((reason: any) => T | PromiseLike) | null | undefined - ): Promise; + extends AsyncIterable { + then( + resolve: ((value: T) => T | PromiseLike) | null | undefined, + reject: ((reason: any) => T | PromiseLike) | null | undefined + ): Promise; } // https://stackoverflow.com/a/50375286 export type UnionToIntersection = ( - U extends any ? (k: U) => void : never + U extends any ? (k: U) => void : never ) extends (k: infer I) => void - ? I - : never; + ? I + : never; export type GetSuccess = { - [K in SuccessStatus & keyof T]: GetContent; + [K in SuccessStatus & keyof T]: GetContent; }[SuccessStatus & keyof T]; export type TwitterResponse = UnionToIntersection>; export type GetContent = "content" extends keyof T - ? ResponseType extends keyof T["content"] - ? T["content"][ResponseType] - : never - : never; + ? ResponseType extends keyof T["content"] + ? T["content"][ResponseType] + : never + : never; export type ExtractTwitterResponse = "responses" extends keyof T - ? GetSuccess - : never; + ? GetSuccess + : never; export type TwitterParams = "parameters" extends keyof T - ? "query" extends keyof T["parameters"] - ? T["parameters"]["query"] - : never - : never; + ? "query" extends keyof T["parameters"] + ? T["parameters"]["query"] + : never + : never; export type TwitterPath = "parameters" extends keyof T - ? "path" extends keyof T["parameters"] - ? T["parameters"]["path"] - : never - : never; + ? "path" extends keyof T["parameters"] + ? T["parameters"]["path"] + : never + : never; export type TwitterBody = "requestBody" extends keyof T - ? "content" extends keyof T["requestBody"] - ? ResponseType extends keyof T["requestBody"]["content"] - ? T["requestBody"]["content"][ResponseType] - : never - : never - : never; + ? "content" extends keyof T["requestBody"] + ? ResponseType extends keyof T["requestBody"]["content"] + ? T["requestBody"]["content"][ResponseType] + : never + : never + : never; export * from "./gen/openapi-types"; diff --git a/src/utils.ts b/src/utils.ts index aad4eea..ed12ed5 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -3,17 +3,17 @@ // https://stackoverflow.com/a/62969380 export function buildQueryString(query: Record): string { - return Object.entries(query) - .map(([key, value]) => - key && value - ? `${encodeURIComponent(key)}=${encodeURIComponent(value)}` - : "" - ) - .join("&"); + return Object.entries(query) + .map(([key, value]) => + key && value + ? `${encodeURIComponent(key)}=${encodeURIComponent(value)}` + : "" + ) + .join("&"); } export function basicAuthHeader(client_id: string, client_secret: string) { - return `Basic ${Buffer.from(`${client_id}:${client_secret}`).toString( - "base64" - )}`; + return `Basic ${Buffer.from(`${client_id}:${client_secret}`).toString( + "base64" + )}`; }