@distilled.cloud/twitch 0.0.0 → 1.0.0-rc.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +79 -4
  3. package/lib/.lazy.json +1 -0
  4. package/lib/_bundle/lazy.js +4 -0
  5. package/lib/_bundle/sdk.js +2 -0
  6. package/lib/_bundle/sdk.js.map +1 -0
  7. package/lib/credentials.d.ts +31 -0
  8. package/lib/credentials.d.ts.map +1 -0
  9. package/lib/credentials.js +1 -0
  10. package/lib/errors.d.ts +49 -0
  11. package/lib/errors.d.ts.map +1 -0
  12. package/lib/errors.js +1 -0
  13. package/lib/index.d.ts +46 -0
  14. package/lib/index.d.ts.map +1 -0
  15. package/lib/index.js +6 -0
  16. package/lib/pagination.d.ts +10 -0
  17. package/lib/pagination.d.ts.map +1 -0
  18. package/lib/pagination.js +1 -0
  19. package/lib/protocol.d.ts +19 -0
  20. package/lib/protocol.d.ts.map +1 -0
  21. package/lib/protocol.js +1 -0
  22. package/lib/retry.d.ts +50 -0
  23. package/lib/retry.d.ts.map +1 -0
  24. package/lib/retry.js +1 -0
  25. package/lib/services/ads.d.ts +75 -0
  26. package/lib/services/ads.d.ts.map +1 -0
  27. package/lib/services/ads.js +2 -0
  28. package/lib/services/ads.js.map +1 -0
  29. package/lib/services/analytics.d.ts +90 -0
  30. package/lib/services/analytics.d.ts.map +1 -0
  31. package/lib/services/analytics.js +2 -0
  32. package/lib/services/analytics.js.map +1 -0
  33. package/lib/services/bits.d.ts +284 -0
  34. package/lib/services/bits.d.ts.map +1 -0
  35. package/lib/services/bits.js +2 -0
  36. package/lib/services/bits.js.map +1 -0
  37. package/lib/services/ccls.d.ts +26 -0
  38. package/lib/services/ccls.d.ts.map +1 -0
  39. package/lib/services/ccls.js +2 -0
  40. package/lib/services/ccls.js.map +1 -0
  41. package/lib/services/channel_points.d.ts +416 -0
  42. package/lib/services/channel_points.d.ts.map +1 -0
  43. package/lib/services/channel_points.js +2 -0
  44. package/lib/services/channel_points.js.map +1 -0
  45. package/lib/services/channels.d.ts +173 -0
  46. package/lib/services/channels.d.ts.map +1 -0
  47. package/lib/services/channels.js +2 -0
  48. package/lib/services/channels.js.map +1 -0
  49. package/lib/services/charity.d.ts +97 -0
  50. package/lib/services/charity.d.ts.map +1 -0
  51. package/lib/services/charity.js +2 -0
  52. package/lib/services/charity.js.map +1 -0
  53. package/lib/services/chat.d.ts +638 -0
  54. package/lib/services/chat.d.ts.map +1 -0
  55. package/lib/services/chat.js +33 -0
  56. package/lib/services/chat.js.map +1 -0
  57. package/lib/services/clips.d.ts +153 -0
  58. package/lib/services/clips.d.ts.map +1 -0
  59. package/lib/services/clips.js +2 -0
  60. package/lib/services/clips.js.map +1 -0
  61. package/lib/services/conduits.d.ts +172 -0
  62. package/lib/services/conduits.d.ts.map +1 -0
  63. package/lib/services/conduits.js +2 -0
  64. package/lib/services/conduits.js.map +1 -0
  65. package/lib/services/entitlements.d.ts +76 -0
  66. package/lib/services/entitlements.d.ts.map +1 -0
  67. package/lib/services/entitlements.js +2 -0
  68. package/lib/services/entitlements.js.map +1 -0
  69. package/lib/services/eventsub.d.ts +158 -0
  70. package/lib/services/eventsub.d.ts.map +1 -0
  71. package/lib/services/eventsub.js +2 -0
  72. package/lib/services/eventsub.js.map +1 -0
  73. package/lib/services/extensions.d.ts +497 -0
  74. package/lib/services/extensions.d.ts.map +1 -0
  75. package/lib/services/extensions.js +2 -0
  76. package/lib/services/extensions.js.map +1 -0
  77. package/lib/services/games.d.ts +57 -0
  78. package/lib/services/games.d.ts.map +1 -0
  79. package/lib/services/games.js +2 -0
  80. package/lib/services/games.js.map +1 -0
  81. package/lib/services/goals.d.ts +37 -0
  82. package/lib/services/goals.d.ts.map +1 -0
  83. package/lib/services/goals.js +2 -0
  84. package/lib/services/goals.js.map +1 -0
  85. package/lib/services/guest_star.d.ts +314 -0
  86. package/lib/services/guest_star.d.ts.map +1 -0
  87. package/lib/services/guest_star.js +2 -0
  88. package/lib/services/guest_star.js.map +1 -0
  89. package/lib/services/hype_train.d.ts +91 -0
  90. package/lib/services/hype_train.d.ts.map +1 -0
  91. package/lib/services/hype_train.js +2 -0
  92. package/lib/services/hype_train.js.map +1 -0
  93. package/lib/services/index.d.ts +30 -0
  94. package/lib/services/index.d.ts.map +1 -0
  95. package/lib/services/index.js +29 -0
  96. package/lib/services/moderation.d.ts +731 -0
  97. package/lib/services/moderation.d.ts.map +1 -0
  98. package/lib/services/moderation.js +41 -0
  99. package/lib/services/moderation.js.map +1 -0
  100. package/lib/services/polls.d.ts +173 -0
  101. package/lib/services/polls.d.ts.map +1 -0
  102. package/lib/services/polls.js +2 -0
  103. package/lib/services/polls.js.map +1 -0
  104. package/lib/services/predictions.d.ts +221 -0
  105. package/lib/services/predictions.d.ts.map +1 -0
  106. package/lib/services/predictions.js +2 -0
  107. package/lib/services/predictions.js.map +1 -0
  108. package/lib/services/raids.d.ts +34 -0
  109. package/lib/services/raids.d.ts.map +1 -0
  110. package/lib/services/raids.js +2 -0
  111. package/lib/services/raids.js.map +1 -0
  112. package/lib/services/schedule.d.ts +223 -0
  113. package/lib/services/schedule.d.ts.map +1 -0
  114. package/lib/services/schedule.js +2 -0
  115. package/lib/services/schedule.js.map +1 -0
  116. package/lib/services/search.d.ts +89 -0
  117. package/lib/services/search.d.ts.map +1 -0
  118. package/lib/services/search.js +2 -0
  119. package/lib/services/search.js.map +1 -0
  120. package/lib/services/streams.d.ts +235 -0
  121. package/lib/services/streams.d.ts.map +1 -0
  122. package/lib/services/streams.js +2 -0
  123. package/lib/services/streams.js.map +1 -0
  124. package/lib/services/subscriptions.d.ts +96 -0
  125. package/lib/services/subscriptions.d.ts.map +1 -0
  126. package/lib/services/subscriptions.js +2 -0
  127. package/lib/services/subscriptions.js.map +1 -0
  128. package/lib/services/teams.d.ts +90 -0
  129. package/lib/services/teams.d.ts.map +1 -0
  130. package/lib/services/teams.js +2 -0
  131. package/lib/services/teams.js.map +1 -0
  132. package/lib/services/users.d.ts +324 -0
  133. package/lib/services/users.d.ts.map +1 -0
  134. package/lib/services/users.js +2 -0
  135. package/lib/services/users.js.map +1 -0
  136. package/lib/services/videos.d.ts +101 -0
  137. package/lib/services/videos.d.ts.map +1 -0
  138. package/lib/services/videos.js +2 -0
  139. package/lib/services/videos.js.map +1 -0
  140. package/lib/services/whispers.d.ts +17 -0
  141. package/lib/services/whispers.d.ts.map +1 -0
  142. package/lib/services/whispers.js +2 -0
  143. package/lib/services/whispers.js.map +1 -0
  144. package/lib/services.lazy/ads.js +1 -0
  145. package/lib/services.lazy/analytics.js +1 -0
  146. package/lib/services.lazy/bits.js +1 -0
  147. package/lib/services.lazy/ccls.js +1 -0
  148. package/lib/services.lazy/channel_points.js +1 -0
  149. package/lib/services.lazy/channels.js +1 -0
  150. package/lib/services.lazy/charity.js +1 -0
  151. package/lib/services.lazy/chat.js +3 -0
  152. package/lib/services.lazy/clips.js +1 -0
  153. package/lib/services.lazy/conduits.js +1 -0
  154. package/lib/services.lazy/entitlements.js +1 -0
  155. package/lib/services.lazy/eventsub.js +1 -0
  156. package/lib/services.lazy/extensions.js +1 -0
  157. package/lib/services.lazy/games.js +1 -0
  158. package/lib/services.lazy/goals.js +1 -0
  159. package/lib/services.lazy/guest_star.js +1 -0
  160. package/lib/services.lazy/hype_train.js +1 -0
  161. package/lib/services.lazy/index.js +3 -0
  162. package/lib/services.lazy/moderation.js +3 -0
  163. package/lib/services.lazy/polls.js +1 -0
  164. package/lib/services.lazy/predictions.js +1 -0
  165. package/lib/services.lazy/raids.js +1 -0
  166. package/lib/services.lazy/schedule.js +1 -0
  167. package/lib/services.lazy/search.js +1 -0
  168. package/lib/services.lazy/streams.js +1 -0
  169. package/lib/services.lazy/subscriptions.js +1 -0
  170. package/lib/services.lazy/teams.js +1 -0
  171. package/lib/services.lazy/users.js +1 -0
  172. package/lib/services.lazy/videos.js +1 -0
  173. package/lib/services.lazy/whispers.js +1 -0
  174. package/lib/traits.d.ts +10 -0
  175. package/lib/traits.d.ts.map +1 -0
  176. package/lib/traits.js +1 -0
  177. package/package.json +82 -2
  178. package/src/credentials.ts +79 -0
  179. package/src/errors.ts +78 -0
  180. package/src/index.ts +45 -0
  181. package/src/pagination.ts +9 -0
  182. package/src/protocol.ts +43 -0
  183. package/src/retry.ts +69 -0
  184. package/src/services/ads.ts +228 -0
  185. package/src/services/analytics.ts +253 -0
  186. package/src/services/bits.ts +631 -0
  187. package/src/services/ccls.ts +96 -0
  188. package/src/services/channel_points.ts +804 -0
  189. package/src/services/channels.ts +471 -0
  190. package/src/services/charity.ts +250 -0
  191. package/src/services/chat.ts +1547 -0
  192. package/src/services/clips.ts +385 -0
  193. package/src/services/conduits.ts +453 -0
  194. package/src/services/entitlements.ts +219 -0
  195. package/src/services/eventsub.ts +372 -0
  196. package/src/services/extensions.ts +1098 -0
  197. package/src/services/games.ts +184 -0
  198. package/src/services/goals.ts +110 -0
  199. package/src/services/guest_star.ts +762 -0
  200. package/src/services/hype_train.ts +214 -0
  201. package/src/services/index.ts +30 -0
  202. package/src/services/moderation.ts +1817 -0
  203. package/src/services/polls.ts +363 -0
  204. package/src/services/predictions.ts +432 -0
  205. package/src/services/raids.ts +127 -0
  206. package/src/services/schedule.ts +539 -0
  207. package/src/services/search.ts +248 -0
  208. package/src/services/streams.ts +579 -0
  209. package/src/services/subscriptions.ts +247 -0
  210. package/src/services/teams.ts +225 -0
  211. package/src/services/users.ts +729 -0
  212. package/src/services/videos.ts +257 -0
  213. package/src/services/whispers.ts +71 -0
  214. package/src/traits.ts +47 -0
@@ -0,0 +1,539 @@
1
+ import * as API from "@distilled.cloud/core/api";
2
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-twitch/specs/api/reference). Do not edit.
3
+ import * as S from "@distilled.cloud/core/schema-lite";
4
+ import * as __L from "@distilled.cloud/core/schema-lite";
5
+ import { TwitchServiceErrors } from "../errors.ts";
6
+ import { paginateCursor } from "../pagination.ts";
7
+ import { TwitchProtocol, type TwitchOpError, type TwitchOpContext } from "../protocol.ts";
8
+ import * as Retry from "../retry.ts";
9
+ import * as T from "../traits.ts";
10
+ // Schema table, filled on first reach (see __S at the end).
11
+ const __s: any[] = [];
12
+
13
+ export type { TwitchOpError, TwitchOpContext };
14
+
15
+ /** Span facts shared by every operation (com.distilled.telemetry#service). */
16
+ const TELEMETRY = {
17
+ system: "twitch-api",
18
+ responseHeaders: [
19
+ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
20
+ { header: "request-id", name: "http.response.header.request-id", transform: "list" },
21
+ ],
22
+ prefix: "Twitch",
23
+ service: "Schedule",
24
+ propagate: "w3c",
25
+ } as const;
26
+
27
+ export interface CreateChannelStreamScheduleSegmentRequest {
28
+ /** The ID of the broadcaster that owns the schedule to add the broadcast segment to. This ID must match the user ID in the user access token. */
29
+ broadcaster_id: string;
30
+ /** The date and time that the broadcast segment starts. Specify the date and time in RFC3339 format (for example, 2021-07-01T18:00:00Z). */
31
+ start_time: string;
32
+ /** The time zone where the broadcast takes place. Specify the time zone using [IANA time zone database](https://www.iana.org/time-zones)format (for example, America/New_York). */
33
+ timezone: string;
34
+ /** The length of time, in minutes, that the broadcast is scheduled to run. The duration must be in the range 30 through 1380 (23 hours). */
35
+ duration: number;
36
+ /** A Boolean value that determines whether the broadcast recurs weekly. Is **true** if the broadcast recurs weekly. The default is **false**. Only partners and affiliates may add non-recurring broadcasts. */
37
+ is_recurring?: boolean | undefined;
38
+ /** The ID of the category that best represents the broadcast's content. To get the category ID, use the [Search Categories](https://dev.twitch.tv/docs/api/reference/search.md#search-categories) endpoint. */
39
+ category_id?: string | undefined;
40
+ /** The broadcast's title. The title may contain a maximum of 140 characters. */
41
+ title?: string | undefined;
42
+ }
43
+ /** The type of content that the broadcaster plans to stream or **null** if not specified. */
44
+ export interface CreateChannelStreamScheduleSegmentResponseDataSegmentsItemCategory {
45
+ /** An ID that identifies the category that best represents the content that the broadcaster plans to stream. For example, the game's ID if the broadcaster will play a game or the Just Chatting ID if the broadcaster will host a talk show. */
46
+ id?: string | undefined;
47
+ /** The name of the category. For example, the game's title if the broadcaster will play a game or Just Chatting if the broadcaster will host a talk show. */
48
+ name?: string | undefined;
49
+ }
50
+ export interface CreateChannelStreamScheduleSegmentResponseDataSegmentsItem {
51
+ /** An ID that identifies this broadcast segment. */
52
+ id?: string | undefined;
53
+ /** The UTC date and time (in RFC3339 format) of when the broadcast starts. */
54
+ start_time?: string | undefined;
55
+ /** The UTC date and time (in RFC3339 format) of when the broadcast ends. */
56
+ end_time?: string | undefined;
57
+ /** The broadcast segment's title. */
58
+ title?: string | undefined;
59
+ /** Indicates whether the broadcaster canceled this segment of a recurring broadcast. If the broadcaster canceled this segment, this field is set to the same value that's in the `end_time` field; otherwise, it's set to **null**. */
60
+ canceled_until?: string | undefined;
61
+ /** The type of content that the broadcaster plans to stream or **null** if not specified. */
62
+ category?: CreateChannelStreamScheduleSegmentResponseDataSegmentsItemCategory | undefined;
63
+ /** A Boolean value that determines whether the broadcast is part of a recurring series that streams at the same time each week or is a one-time broadcast. Is **true** if the broadcast is part of a recurring series. */
64
+ is_recurring?: boolean | undefined;
65
+ }
66
+ /** A list that contains the single broadcast segment that you added. */
67
+ export type CreateChannelStreamScheduleSegmentResponseDataSegmentsList =
68
+ Array<CreateChannelStreamScheduleSegmentResponseDataSegmentsItem>;
69
+ /** The dates when the broadcaster is on vacation and not streaming. Is set to **null** if vacation mode is not enabled. */
70
+ export interface CreateChannelStreamScheduleSegmentResponseDataVacation {
71
+ /** The UTC date and time (in RFC3339 format) of when the broadcaster's vacation starts. */
72
+ start_time?: string | undefined;
73
+ /** The UTC date and time (in RFC3339 format) of when the broadcaster's vacation ends. */
74
+ end_time?: string | undefined;
75
+ }
76
+ /** The broadcaster's streaming scheduled. */
77
+ export interface CreateChannelStreamScheduleSegmentResponseData {
78
+ /** A list that contains the single broadcast segment that you added. */
79
+ segments?: CreateChannelStreamScheduleSegmentResponseDataSegmentsList | undefined;
80
+ /** The ID of the broadcaster that owns the broadcast schedule. */
81
+ broadcaster_id?: string | undefined;
82
+ /** The broadcaster's display name. */
83
+ broadcaster_name?: string | undefined;
84
+ /** The broadcaster's login name. */
85
+ broadcaster_login?: string | undefined;
86
+ /** The dates when the broadcaster is on vacation and not streaming. Is set to **null** if vacation mode is not enabled. */
87
+ vacation?: CreateChannelStreamScheduleSegmentResponseDataVacation | undefined;
88
+ }
89
+ export interface CreateChannelStreamScheduleSegmentResponse {
90
+ /** The broadcaster's streaming scheduled. */
91
+ data?: CreateChannelStreamScheduleSegmentResponseData | undefined;
92
+ }
93
+ export interface DeleteChannelStreamScheduleSegmentRequest {
94
+ /** The ID of the broadcaster that owns the streaming schedule. This ID must match the user ID in the user access token. */
95
+ broadcaster_id: string;
96
+ /** The ID of the broadcast segment to remove. */
97
+ id: string;
98
+ }
99
+ export interface DeleteChannelStreamScheduleSegmentResponse {}
100
+ export interface GetChannelIcalendarRequest {
101
+ /** The ID of the broadcaster that owns the streaming schedule you want to get. */
102
+ broadcaster_id: string;
103
+ }
104
+ export interface GetChannelIcalendarResponse {}
105
+ export type GetChannelStreamScheduleRequestIdList = Array<string>;
106
+ export interface GetChannelStreamScheduleRequest {
107
+ /** The ID of the broadcaster that owns the streaming schedule you want to get. */
108
+ broadcaster_id: string;
109
+ /** The ID of the scheduled segment to return. To specify more than one segment, include the ID of each segment you want to get. For example, 'id=1234&id=5678'. You may specify a maximum of 100 IDs. The response omits IDs that don't match a segment. If you specify *id*, the request ignores the *first* and *after* query parameters, and the response doesn't include a cursor. */
110
+ id?: GetChannelStreamScheduleRequestIdList | undefined;
111
+ /** The UTC date and time that identifies when in the broadcaster's schedule to start returning segments. The response includes the segments that end after this time, including a segment that's in progress. If not specified, the request uses the current UTC date and time. Specify the date and time in RFC3339 format (for example, '2022-09-01T00:00:00Z'). */
112
+ start_time?: string | undefined;
113
+ /** Not supported. */
114
+ utc_offset?: number | undefined;
115
+ /** The maximum number of items to return per page in the response. The minimum page size is 1 item per page and the maximum is 25 items per page. The default is 20. */
116
+ first?: number | undefined;
117
+ /** The cursor used to get the next page of results. The **Pagination** object in the response contains the cursor's value. [Read More](https://dev.twitch.tv/docs/api/guide.md#pagination) */
118
+ after?: string | undefined;
119
+ }
120
+ /** The type of content that the broadcaster plans to stream or **null** if not specified. */
121
+ export interface GetChannelStreamScheduleResponseDataSegmentsItemCategory {
122
+ /** An ID that identifies the category that best represents the content that the broadcaster plans to stream. For example, the game's ID if the broadcaster will play a game or the Just Chatting ID if the broadcaster will host a talk show. */
123
+ id?: string | undefined;
124
+ /** The name of the category. For example, the game's title if the broadcaster will playing a game or Just Chatting if the broadcaster will host a talk show. */
125
+ name?: string | undefined;
126
+ }
127
+ export interface GetChannelStreamScheduleResponseDataSegmentsItem {
128
+ /** An ID that identifies this broadcast segment. */
129
+ id?: string | undefined;
130
+ /** The UTC date and time (in RFC3339 format) of when the broadcast starts. */
131
+ start_time?: string | undefined;
132
+ /** The UTC date and time (in RFC3339 format) of when the broadcast ends. Is **null** if the segment doesn't have a duration. */
133
+ end_time?: string | null | undefined;
134
+ /** The broadcast segment's title. */
135
+ title?: string | undefined;
136
+ /** Indicates whether the broadcaster canceled this segment of a recurring broadcast. If the broadcaster canceled this segment, this field is set to the same value that's in the `end_time` field; otherwise, it's set to **null**. */
137
+ canceled_until?: string | undefined;
138
+ /** The type of content that the broadcaster plans to stream or **null** if not specified. */
139
+ category?: GetChannelStreamScheduleResponseDataSegmentsItemCategory | undefined;
140
+ /** A Boolean value that determines whether the broadcast is part of a recurring series that streams at the same time each week or is a one-time broadcast. Is **true** if the broadcast is part of a recurring series. */
141
+ is_recurring?: boolean | undefined;
142
+ }
143
+ /** The list of broadcasts in the broadcaster's streaming schedule. */
144
+ export type GetChannelStreamScheduleResponseDataSegmentsList =
145
+ Array<GetChannelStreamScheduleResponseDataSegmentsItem>;
146
+ /** The dates when the broadcaster is on vacation and not streaming. Is set to **null** if vacation mode is not enabled. */
147
+ export type GetChannelStreamScheduleResponseDataVacation =
148
+ CreateChannelStreamScheduleSegmentResponseDataVacation;
149
+ /** The broadcaster's streaming schedule. */
150
+ export interface GetChannelStreamScheduleResponseData {
151
+ /** The list of broadcasts in the broadcaster's streaming schedule. */
152
+ segments?: GetChannelStreamScheduleResponseDataSegmentsList | undefined;
153
+ /** The ID of the broadcaster that owns the broadcast schedule. */
154
+ broadcaster_id?: string | undefined;
155
+ /** The broadcaster's display name. */
156
+ broadcaster_name?: string | undefined;
157
+ /** The broadcaster's login name. */
158
+ broadcaster_login?: string | undefined;
159
+ /** The dates when the broadcaster is on vacation and not streaming. Is set to **null** if vacation mode is not enabled. */
160
+ vacation?: CreateChannelStreamScheduleSegmentResponseDataVacation | undefined;
161
+ }
162
+ /** The information used to page through a list of results. The object is empty if there are no more pages left to page through. [Read more](https://dev.twitch.tv/docs/api/guide.md#pagination). */
163
+ export interface GetChannelStreamScheduleResponsePagination {
164
+ /** The cursor used to get the next page of results. Set the request's *after* query parameter to this value. */
165
+ cursor?: string | undefined;
166
+ }
167
+ export interface GetChannelStreamScheduleResponse {
168
+ /** The broadcaster's streaming schedule. */
169
+ data: GetChannelStreamScheduleResponseData;
170
+ /** The information used to page through a list of results. The object is empty if there are no more pages left to page through. [Read more](https://dev.twitch.tv/docs/api/guide.md#pagination). */
171
+ pagination?: GetChannelStreamScheduleResponsePagination | undefined;
172
+ }
173
+ export interface UpdateChannelStreamScheduleRequest {
174
+ /** The ID of the broadcaster whose schedule settings you want to update. The ID must match the user ID in the user access token. */
175
+ broadcaster_id: string;
176
+ /** A Boolean value that indicates whether the broadcaster has scheduled a vacation. Set to **true** to enable Vacation Mode and add vacation dates, or **false** to cancel a previously scheduled vacation. If you omit this parameter, the request ignores the other vacation parameters and doesn't change the schedule settings. */
177
+ is_vacation_enabled?: boolean | undefined;
178
+ /** The UTC date and time of when the broadcaster's vacation starts. Specify the date and time in RFC3339 format (for example, 2021-05-16T00:00:00Z). Required if *is_vacation_enabled* is **true**. */
179
+ vacation_start_time?: string | undefined;
180
+ /** The UTC date and time of when the broadcaster's vacation ends. Specify the date and time in RFC3339 format (for example, 2021-05-30T23:59:59Z). The vacation may end no more than 5 years in the future. Required if *is_vacation_enabled* is **true**. */
181
+ vacation_end_time?: string | undefined;
182
+ /** The time zone that the broadcaster broadcasts from. Specify the time zone using [IANA time zone database](https://www.iana.org/time-zones) format (for example, America/New_York). Required if *is_vacation_enabled* is **true**. */
183
+ timezone?: string | undefined;
184
+ }
185
+ export interface UpdateChannelStreamScheduleResponse {}
186
+ export interface UpdateChannelStreamScheduleSegmentRequest {
187
+ /** The ID of the broadcaster who owns the broadcast segment to update. This ID must match the user ID in the user access token. */
188
+ broadcaster_id: string;
189
+ /** The ID of the broadcast segment to update. */
190
+ id: string;
191
+ /** The date and time that the broadcast segment starts. Specify the date and time in RFC3339 format (for example, 2022-08-02T06:00:00Z). **NOTE**: Only partners and affiliates may update a broadcast's start time and only for non-recurring segments. */
192
+ start_time?: string | undefined;
193
+ /** The length of time, in minutes, that the broadcast is scheduled to run. The duration must be in the range 30 through 1380 (23 hours). */
194
+ duration?: number | undefined;
195
+ /** The ID of the category that best represents the broadcast's content. To get the category ID, use the [Search Categories](https://dev.twitch.tv/docs/api/reference/search.md#search-categories) endpoint. To remove the segment's category, set this field to an empty string. */
196
+ category_id?: string | undefined;
197
+ /** The broadcast's title. The title may contain a maximum of 140 characters. */
198
+ title?: string | undefined;
199
+ /** A Boolean value that indicates whether the broadcast is canceled. Set to **true** to cancel the segment. **NOTE**: For recurring segments, the API cancels the first segment after the current UTC date and time and not the specified segment (unless the specified segment is the next segment after the current UTC date and time). */
200
+ is_canceled?: boolean | undefined;
201
+ /** The time zone where the broadcast takes place. Specify the time zone using [IANA time zone database](https://www.iana.org/time-zones) format (for example, America/New_York). */
202
+ timezone?: string | undefined;
203
+ }
204
+ /** The type of content that the broadcaster plans to stream or **null** if not specified. */
205
+ export type UpdateChannelStreamScheduleSegmentResponseDataSegmentsItemCategory =
206
+ CreateChannelStreamScheduleSegmentResponseDataSegmentsItemCategory;
207
+ export type UpdateChannelStreamScheduleSegmentResponseDataSegmentsItem =
208
+ CreateChannelStreamScheduleSegmentResponseDataSegmentsItem;
209
+ /** A list that contains the single broadcast segment that you updated. */
210
+ export type UpdateChannelStreamScheduleSegmentResponseDataSegmentsList =
211
+ Array<CreateChannelStreamScheduleSegmentResponseDataSegmentsItem>;
212
+ /** The dates when the broadcaster is on vacation and not streaming. Is set to **null** if vacation mode is not enabled. */
213
+ export type UpdateChannelStreamScheduleSegmentResponseDataVacation =
214
+ CreateChannelStreamScheduleSegmentResponseDataVacation;
215
+ /** The broadcaster's streaming scheduled. */
216
+ export interface UpdateChannelStreamScheduleSegmentResponseData {
217
+ /** A list that contains the single broadcast segment that you updated. */
218
+ segments?: UpdateChannelStreamScheduleSegmentResponseDataSegmentsList | undefined;
219
+ /** The ID of the broadcaster that owns the broadcast schedule. */
220
+ broadcaster_id?: string | undefined;
221
+ /** The broadcaster's display name. */
222
+ broadcaster_name?: string | undefined;
223
+ /** The broadcaster's login name. */
224
+ broadcaster_login?: string | undefined;
225
+ /** The dates when the broadcaster is on vacation and not streaming. Is set to **null** if vacation mode is not enabled. */
226
+ vacation?: CreateChannelStreamScheduleSegmentResponseDataVacation | undefined;
227
+ }
228
+ export interface UpdateChannelStreamScheduleSegmentResponse {
229
+ /** The broadcaster's streaming scheduled. */
230
+ data?: UpdateChannelStreamScheduleSegmentResponseData | undefined;
231
+ }
232
+ export type CreateChannelStreamScheduleSegmentError = TwitchOpError;
233
+ /** Create Channel Stream Schedule Segment Adds a single or recurring broadcast to the broadcaster's streaming schedule. For information about scheduling broadcasts, see [Stream Schedule](https://help.twitch.tv/s/article/channel-page-setup#Schedule). Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens) that includes the **channel:manage:schedule** scope. Reference: https://dev.twitch.tv/docs/api/reference/schedule/#create-channel-stream-schedule-segment */
234
+ export const createChannelStreamScheduleSegment: API.OperationMethod<
235
+ CreateChannelStreamScheduleSegmentRequest,
236
+ CreateChannelStreamScheduleSegmentResponse,
237
+ CreateChannelStreamScheduleSegmentError,
238
+ TwitchOpContext
239
+ > = /*@__PURE__*/ API.make(() => ({
240
+ input: __S(0, __c0, 0) as any as S.Schema<CreateChannelStreamScheduleSegmentRequest>,
241
+ output: __S(19, __c2, 3) as any as S.Schema<CreateChannelStreamScheduleSegmentResponse>,
242
+ errors: [],
243
+ serviceErrors: TwitchServiceErrors,
244
+ protocol: TwitchProtocol,
245
+ retry: Retry.Retry,
246
+ telemetry: TELEMETRY,
247
+ span: "CreateChannelStreamScheduleSegment",
248
+ }));
249
+
250
+ export type DeleteChannelStreamScheduleSegmentError = TwitchOpError;
251
+ /** Delete Channel Stream Schedule Segment Removes a broadcast segment from the broadcaster's streaming schedule. > **Note** For recurring segments, removing a segment removes all segments in the recurring schedule. Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens) that includes the **channel:manage:schedule** scope. Reference: https://dev.twitch.tv/docs/api/reference/schedule/#delete-channel-stream-schedule-segment */
252
+ export const deleteChannelStreamScheduleSegment: API.OperationMethod<
253
+ DeleteChannelStreamScheduleSegmentRequest,
254
+ DeleteChannelStreamScheduleSegmentResponse,
255
+ DeleteChannelStreamScheduleSegmentError,
256
+ TwitchOpContext
257
+ > = /*@__PURE__*/ API.make(() => ({
258
+ input: __S(24, __c3, 0) as any as S.Schema<DeleteChannelStreamScheduleSegmentRequest>,
259
+ output: __S(32, __c4, 0) as any as S.Schema<DeleteChannelStreamScheduleSegmentResponse>,
260
+ errors: [],
261
+ serviceErrors: TwitchServiceErrors,
262
+ protocol: TwitchProtocol,
263
+ retry: Retry.Retry,
264
+ telemetry: TELEMETRY,
265
+ span: "DeleteChannelStreamScheduleSegment",
266
+ }));
267
+
268
+ export type GetChannelIcalendarError = TwitchOpError;
269
+ /** Get Channel iCalendar Gets the broadcaster's streaming schedule as an [iCalendar](https://datatracker.ietf.org/doc/html/rfc5545). > **Note** The Client-Id and Authorization headers are not required. Authorization: No authorization required. Reference: https://dev.twitch.tv/docs/api/reference/schedule/#get-channel-icalendar */
270
+ export const getChannelIcalendar: API.OperationMethod<
271
+ GetChannelIcalendarRequest,
272
+ GetChannelIcalendarResponse,
273
+ GetChannelIcalendarError,
274
+ TwitchOpContext
275
+ > = /*@__PURE__*/ API.make(() => ({
276
+ input: __S(40, __c5, 0) as any as S.Schema<GetChannelIcalendarRequest>,
277
+ output: __S(32, __c4, 0) as any as S.Schema<GetChannelIcalendarResponse>,
278
+ errors: [],
279
+ serviceErrors: TwitchServiceErrors,
280
+ protocol: TwitchProtocol,
281
+ retry: Retry.Retry,
282
+ telemetry: TELEMETRY,
283
+ span: "GetChannelIcalendar",
284
+ }));
285
+
286
+ export type GetChannelStreamScheduleError = TwitchOpError;
287
+ /** Get Channel Stream Schedule Gets the broadcaster's streaming schedule. You can get the entire schedule or specific segments of the schedule. [Learn More](https://help.twitch.tv/s/article/channel-page-setup#Schedule) Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens). - An [app access token](https://dev.twitch.tv/docs/authentication.md#app-access-tokens). Reference: https://dev.twitch.tv/docs/api/reference/schedule/#get-channel-stream-schedule */
288
+ export const getChannelStreamSchedule: API.PaginatedOperationMethod<
289
+ GetChannelStreamScheduleRequest,
290
+ GetChannelStreamScheduleResponse,
291
+ GetChannelStreamScheduleError,
292
+ TwitchOpContext,
293
+ GetChannelStreamScheduleResponseDataSegmentsItem
294
+ > = /*@__PURE__*/ API.makePaginated(
295
+ () => ({
296
+ input: __S(49, __c6, 1) as any as S.Schema<GetChannelStreamScheduleRequest>,
297
+ output: __S(54, __c6, 6) as any as S.Schema<GetChannelStreamScheduleResponse>,
298
+ errors: [],
299
+ serviceErrors: TwitchServiceErrors,
300
+ protocol: TwitchProtocol,
301
+ retry: Retry.Retry,
302
+ telemetry: TELEMETRY,
303
+ span: "GetChannelStreamSchedule",
304
+ pagination: {
305
+ mode: "cursor",
306
+ inputToken: "after",
307
+ outputToken: "pagination.cursor",
308
+ items: "data.segments",
309
+ pageSize: "first",
310
+ } as const,
311
+ }),
312
+ paginateCursor,
313
+ ) as any;
314
+
315
+ export type UpdateChannelStreamScheduleError = TwitchOpError;
316
+ /** Update Channel Stream Schedule Updates the broadcaster's schedule settings, such as scheduling a vacation. Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens) that includes the **channel:manage:schedule** scope. Reference: https://dev.twitch.tv/docs/api/reference/schedule/#update-channel-stream-schedule */
317
+ export const updateChannelStreamSchedule: API.OperationMethod<
318
+ UpdateChannelStreamScheduleRequest,
319
+ UpdateChannelStreamScheduleResponse,
320
+ UpdateChannelStreamScheduleError,
321
+ TwitchOpContext
322
+ > = /*@__PURE__*/ API.make(() => ({
323
+ input: __S(56, __c7, 0) as any as S.Schema<UpdateChannelStreamScheduleRequest>,
324
+ output: __S(32, __c4, 0) as any as S.Schema<UpdateChannelStreamScheduleResponse>,
325
+ errors: [],
326
+ serviceErrors: TwitchServiceErrors,
327
+ protocol: TwitchProtocol,
328
+ retry: Retry.Retry,
329
+ telemetry: TELEMETRY,
330
+ span: "UpdateChannelStreamSchedule",
331
+ }));
332
+
333
+ export type UpdateChannelStreamScheduleSegmentError = TwitchOpError;
334
+ /** Update Channel Stream Schedule Segment Updates a scheduled broadcast segment. For recurring segments, updating a segment's title, category, duration, and timezone, changes all segments in the recurring schedule, not just the specified segment. Authorization: Requires one of the following: - A [user access token](https://dev.twitch.tv/docs/authentication.md#user-access-tokens) that includes the **channel:manage:schedule** scope. Reference: https://dev.twitch.tv/docs/api/reference/schedule/#update-channel-stream-schedule-segment */
335
+ export const updateChannelStreamScheduleSegment: API.OperationMethod<
336
+ UpdateChannelStreamScheduleSegmentRequest,
337
+ UpdateChannelStreamScheduleSegmentResponse,
338
+ UpdateChannelStreamScheduleSegmentError,
339
+ TwitchOpContext
340
+ > = /*@__PURE__*/ API.make(() => ({
341
+ input: __S(64, __c8, 0) as any as S.Schema<UpdateChannelStreamScheduleSegmentRequest>,
342
+ output: __S(19, __c2, 3) as any as S.Schema<UpdateChannelStreamScheduleSegmentResponse>,
343
+ errors: [],
344
+ serviceErrors: TwitchServiceErrors,
345
+ protocol: TwitchProtocol,
346
+ retry: Retry.Retry,
347
+ telemetry: TELEMETRY,
348
+ span: "UpdateChannelStreamScheduleSegment",
349
+ }));
350
+
351
+ // Schema builders: each runs one schema initializer, on that schema's first use.
352
+ function __c0(j: number): any {
353
+ switch (j) {
354
+ case 0:
355
+ return S.suspend(() =>
356
+ S.Struct({
357
+ broadcaster_id: S.String.pipe(T.Query()),
358
+ start_time: S.String,
359
+ timezone: S.String,
360
+ duration: S.Number,
361
+ is_recurring: S.optional(S.Boolean),
362
+ category_id: S.optional(S.String),
363
+ title: S.optional(S.String),
364
+ }).pipe(T.Http({ method: "POST", uri: "/schedule/segment", code: 200 })),
365
+ ).annotate({ identifier: "CreateChannelStreamScheduleSegmentRequest" });
366
+ }
367
+ }
368
+ function __c1(j: number): any {
369
+ switch (j) {
370
+ case 0:
371
+ return S.suspend(() =>
372
+ S.Struct({
373
+ id: S.optional(S.String),
374
+ name: S.optional(S.String),
375
+ }),
376
+ ).annotate({
377
+ identifier: "CreateChannelStreamScheduleSegmentResponseDataSegmentsItemCategory",
378
+ });
379
+ case 1:
380
+ return S.suspend(() =>
381
+ S.Struct({
382
+ start_time: S.optional(S.String),
383
+ end_time: S.optional(S.String),
384
+ }),
385
+ ).annotate({ identifier: "CreateChannelStreamScheduleSegmentResponseDataVacation" });
386
+ }
387
+ }
388
+ function __c2(j: number): any {
389
+ switch (j) {
390
+ case 0:
391
+ return S.suspend(() =>
392
+ S.Struct({
393
+ id: S.optional(S.String),
394
+ start_time: S.optional(S.String),
395
+ end_time: S.optional(S.String),
396
+ title: S.optional(S.String),
397
+ canceled_until: S.optional(S.String),
398
+ category: S.optional(__S(8, __c1, 0)),
399
+ is_recurring: S.optional(S.Boolean),
400
+ }),
401
+ ).annotate({ identifier: "CreateChannelStreamScheduleSegmentResponseDataSegmentsItem" });
402
+ case 1:
403
+ return S.Array(__S(16, __c2, 0));
404
+ case 2:
405
+ return S.suspend(() =>
406
+ S.Struct({
407
+ segments: S.optional(__S(17, __c2, 1)),
408
+ broadcaster_id: S.optional(S.String),
409
+ broadcaster_name: S.optional(S.String),
410
+ broadcaster_login: S.optional(S.String),
411
+ vacation: S.optional(__S(9, __c1, 1)),
412
+ }),
413
+ ).annotate({ identifier: "CreateChannelStreamScheduleSegmentResponseData" });
414
+ case 3:
415
+ return S.suspend(() =>
416
+ S.Struct({
417
+ data: S.optional(__S(18, __c2, 2)),
418
+ }),
419
+ ).annotate({ identifier: "CreateChannelStreamScheduleSegmentResponse" });
420
+ }
421
+ }
422
+ function __c3(j: number): any {
423
+ switch (j) {
424
+ case 0:
425
+ return S.suspend(() =>
426
+ S.Struct({
427
+ broadcaster_id: S.String.pipe(T.Query()),
428
+ id: S.String.pipe(T.Query()),
429
+ }).pipe(T.Http({ method: "DELETE", uri: "/schedule/segment", code: 200 })),
430
+ ).annotate({ identifier: "DeleteChannelStreamScheduleSegmentRequest" });
431
+ }
432
+ }
433
+ function __c4(j: number): any {
434
+ switch (j) {
435
+ case 0:
436
+ return S.suspend(() => S.Struct({})).annotate({
437
+ identifier: "DeleteChannelStreamScheduleSegmentResponse",
438
+ });
439
+ }
440
+ }
441
+ function __c5(j: number): any {
442
+ switch (j) {
443
+ case 0:
444
+ return S.suspend(() =>
445
+ S.Struct({
446
+ broadcaster_id: S.String.pipe(T.Query()),
447
+ }).pipe(T.Http({ method: "GET", uri: "/schedule/icalendar", code: 200 })),
448
+ ).annotate({ identifier: "GetChannelIcalendarRequest" });
449
+ }
450
+ }
451
+ function __c6(j: number): any {
452
+ switch (j) {
453
+ case 0:
454
+ return S.Array(S.String);
455
+ case 1:
456
+ return S.suspend(() =>
457
+ S.Struct({
458
+ broadcaster_id: S.String.pipe(T.Query()),
459
+ id: S.optional(__S(48, __c6, 0).pipe(T.Query())),
460
+ start_time: S.optional(S.String.pipe(T.Query())),
461
+ utc_offset: S.optional(S.Number.pipe(T.Query())),
462
+ first: S.optional(S.Number.pipe(T.Query())),
463
+ after: S.optional(S.String.pipe(T.Query())),
464
+ }).pipe(T.Http({ method: "GET", uri: "/schedule", code: 200 })),
465
+ ).annotate({ identifier: "GetChannelStreamScheduleRequest" });
466
+ case 2:
467
+ return S.suspend(() =>
468
+ S.Struct({
469
+ id: S.optional(S.String),
470
+ start_time: S.optional(S.String),
471
+ end_time: S.optional(S.NullOr(S.String)),
472
+ title: S.optional(S.String),
473
+ canceled_until: S.optional(S.String),
474
+ category: S.optional(__S(8, __c1, 0)),
475
+ is_recurring: S.optional(S.Boolean),
476
+ }),
477
+ ).annotate({ identifier: "GetChannelStreamScheduleResponseDataSegmentsItem" });
478
+ case 3:
479
+ return S.Array(__S(50, __c6, 2));
480
+ case 4:
481
+ return S.suspend(() =>
482
+ S.Struct({
483
+ segments: S.optional(__S(51, __c6, 3)),
484
+ broadcaster_id: S.optional(S.String),
485
+ broadcaster_name: S.optional(S.String),
486
+ broadcaster_login: S.optional(S.String),
487
+ vacation: S.optional(__S(9, __c1, 1)),
488
+ }),
489
+ ).annotate({ identifier: "GetChannelStreamScheduleResponseData" });
490
+ case 5:
491
+ return S.suspend(() =>
492
+ S.Struct({
493
+ cursor: S.optional(S.String),
494
+ }),
495
+ ).annotate({ identifier: "GetChannelStreamScheduleResponsePagination" });
496
+ case 6:
497
+ return S.suspend(() =>
498
+ S.Struct({
499
+ data: __S(52, __c6, 4),
500
+ pagination: S.optional(__S(53, __c6, 5)),
501
+ }),
502
+ ).annotate({ identifier: "GetChannelStreamScheduleResponse" });
503
+ }
504
+ }
505
+ function __c7(j: number): any {
506
+ switch (j) {
507
+ case 0:
508
+ return S.suspend(() =>
509
+ S.Struct({
510
+ broadcaster_id: S.String.pipe(T.Query()),
511
+ is_vacation_enabled: S.optional(S.Boolean.pipe(T.Query())),
512
+ vacation_start_time: S.optional(S.String.pipe(T.Query())),
513
+ vacation_end_time: S.optional(S.String.pipe(T.Query())),
514
+ timezone: S.optional(S.String.pipe(T.Query())),
515
+ }).pipe(T.Http({ method: "PATCH", uri: "/schedule/settings", code: 200 })),
516
+ ).annotate({ identifier: "UpdateChannelStreamScheduleRequest" });
517
+ }
518
+ }
519
+ function __c8(j: number): any {
520
+ switch (j) {
521
+ case 0:
522
+ return S.suspend(() =>
523
+ S.Struct({
524
+ broadcaster_id: S.String.pipe(T.Query()),
525
+ id: S.String.pipe(T.Query()),
526
+ start_time: S.optional(S.String),
527
+ duration: S.optional(S.Number),
528
+ category_id: S.optional(S.String),
529
+ title: S.optional(S.String),
530
+ is_canceled: S.optional(S.Boolean),
531
+ timezone: S.optional(S.String),
532
+ }).pipe(T.Http({ method: "PATCH", uri: "/schedule/segment", code: 200 })),
533
+ ).annotate({ identifier: "UpdateChannelStreamScheduleSegmentRequest" });
534
+ }
535
+ }
536
+ // Schema table: entry i is schema j of builder f, made on first reach.
537
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
538
+ return (__s[i] ??= __L.at(f, j));
539
+ }