export type DrawingPoint = {x: number, y: number}; export type DrawingPrimitive = {color?: string | undefined, opacity?: number | undefined, points?: Array | undefined, text?: string | undefined, type: 'LINE' | 'RECTANGLE' | 'ARROW' | 'ELLIPSE' | 'PENCIL' | 'TEXT' | 'CROSS', width?: number | undefined}; export type Drawing = {primitives?: Array | undefined, version?: (number | null) | undefined}; export type FaceLandmark = {x: number, y: number}; export type FaceBoundingBox = {bounding_box?: Array | undefined, landmarks?: (Array | null) | undefined, person_version_face_id: string, timestamp_ms?: number | undefined}; export type SemanticTranscriptionEntity = {label?: (string | null) | undefined, text: string} | {[key: string]: unknown}; export type UnderstandingTag = {label: string, level?: (string | null) | undefined, score?: (number | null) | undefined} | {[key: string]: unknown}; export type SemanticTranscription = {cut_reasons?: (Array | null) | undefined, embedding?: (string | null) | undefined, embedding_dim?: (number | null) | undefined, embedding_encoding?: (string | null) | undefined, embedding_model?: (string | null) | undefined, embedding_model_version?: (string | null) | undefined, entities?: (Array | null) | undefined, language?: (string | null) | undefined, speaker_count?: (string | null) | undefined, tone?: (string | null) | undefined, topics?: (Array | null) | undefined, track_id?: (string | null) | undefined, valence?: (string | null) | undefined} | {[key: string]: unknown}; export type Shot = {actions?: (Array | null) | undefined, animal_species?: (Array | null) | undefined, brand_logo?: (Array | null) | undefined, camera_angle?: (UnderstandingTag | null) | undefined, caption?: (string | null) | undefined, color_palette?: (Array | null) | undefined, composition?: (string | null) | undefined, dog_breeds?: (Array | null) | undefined, dominant_hue?: (string | null) | undefined, embedding?: (string | null) | undefined, embedding_dim?: (number | null) | undefined, embedding_encoding?: (string | null) | undefined, embedding_model?: (string | null) | undefined, embedding_model_version?: (string | null) | undefined, facial_expression?: (Array | null) | undefined, keyframe_ts?: number | undefined, light_key?: (string | null) | undefined, light_side?: (string | null) | undefined, light_style?: (Array | null) | undefined, light_time?: (string | null) | undefined, mood?: (Array | null) | undefined, mood_valence?: (string | null) | undefined, movement?: (Array | null) | undefined, objects?: (Array | null) | undefined, ocr_text?: (string | null) | undefined, orientation?: (string | null) | undefined, people_age_range?: (Array | null) | undefined, people_bucket?: (string | null) | undefined, people_count?: (number | null) | undefined, people_features?: (Array | null) | undefined, people_gender?: (Array | null) | undefined, place?: (UnderstandingTag | null) | undefined, resolution?: (string | null) | undefined, scale_rank?: (number | null) | undefined, season?: (UnderstandingTag | null) | undefined, sensitive_content?: (Array | null) | undefined, setting?: (UnderstandingTag | null) | undefined, shot_scale?: (UnderstandingTag | null) | undefined, sport_type?: (UnderstandingTag | null) | undefined, subject_type?: (Array | null) | undefined, time_of_day?: (string | null) | undefined, track_id?: (string | null) | undefined, weather?: (UnderstandingTag | null) | undefined} | {[key: string]: unknown}; export type TranscriptionElementType = {end_ms: number, score?: number | undefined, start_ms: number, value: string}; export type TranscriptionType = {speaker?: (number | null) | undefined, words: Array}; export type User = {email?: string | undefined, first_name?: string | undefined, id?: string | undefined, last_name?: string | undefined, photo?: string | undefined, photo_big?: string | undefined, photo_small?: string | undefined}; export type EditAssetSegment = {asset_id?: string | undefined, date_created?: string | undefined, date_modified?: string | undefined, drawing?: (Drawing | null) | undefined, external_id?: (string | null) | undefined, face_bounding_boxes?: (Array | null) | undefined, id: string, is_internal?: (boolean | null) | undefined, keyframe_id?: (string | null) | undefined, metadata?: Record | undefined, metadata_view_id?: (string | null) | undefined, parent_id?: string | undefined, path?: string | undefined, person_id?: (string | null) | undefined, project_id?: (string | null) | undefined, segment_checked?: boolean | undefined, segment_color?: string | undefined, segment_text?: (string | null) | undefined, segment_track?: (string | null) | undefined, segment_type: 'MARKER' | 'QC' | 'GENERIC' | 'COMMENT' | 'TAG' | 'TRANSCRIPTION' | 'SCENE' | 'SHOT' | 'PERSON' | 'SEMANTIC_TRANSCRIPTION', semantic_transcription?: (SemanticTranscription | null) | undefined, share_id?: (string | null) | undefined, share_session_id?: (string | null) | undefined, share_user_email?: (string | null) | undefined, shot?: (Shot | null) | undefined, status?: ('ACTIVE' | 'DELETED' | 'AWAITED') | undefined, subclip_id?: string | undefined, time_end_milliseconds?: (number | null) | undefined, time_start_milliseconds?: (number | null) | undefined, top_level?: boolean | undefined, transcription?: TranscriptionType | undefined, transcription_id?: (string | null) | undefined, user_first_name?: string | undefined, user_id?: string | undefined, user_info?: User | undefined, user_last_name?: string | undefined, user_photo?: string | undefined, version_id?: string | undefined}; export type BulkEditAssetSegmentsSchema = {objects: Array}; export type UpdateApiV1AssetsAssetIdSegmentsBulkArgs = {'App-ID': string, 'Auth-Token': string, asset_id: string, generate_subclip_keyframes?: boolean | undefined, should_reindex_assets?: boolean | undefined, body: BulkEditAssetSegmentsSchema}; export type UpdateApiV1AssetsAssetIdSegmentsBulkOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Edit multiple asset segments * * PUT /v1/assets/{asset_id}/segments/bulk/ */ export const updateApiV1AssetsAssetIdSegmentsBulk = async (args: UpdateApiV1AssetsAssetIdSegmentsBulkArgs, options: UpdateApiV1AssetsAssetIdSegmentsBulkOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['App-ID'] != null) headers.set("App-ID", String(args['App-ID'])) if (args['Auth-Token'] != null) headers.set("Auth-Token", String(args['Auth-Token'])) if (args.generate_subclip_keyframes != null) query.append("generate_subclip_keyframes", String(args.generate_subclip_keyframes)) if (args.should_reindex_assets != null) query.append("should_reindex_assets", String(args.should_reindex_assets)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/assets/${encodeURIComponent(String(args.asset_id))}/segments/bulk/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };