From 6205e9a353e08cad6ea0609e3fd41b3522813cc3 Mon Sep 17 00:00:00 2001 From: Loewy Date: Tue, 16 Jul 2024 16:33:22 -0700 Subject: [PATCH] add operation for set segment duration --- src/index.tsx | 69 +++++++++++++++++++++++++++++++++ src/operations/video_upload.gql | 12 ++++++ 2 files changed, 81 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index eb3df3c..4cab2ef 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -1686,6 +1686,17 @@ export type GetHlsInitUploadLinkMutation = { }; }; +export type SetSegmentDurationMutationVariables = Exact<{ + videoId: Scalars["Int"]["input"]; + segmentId: Scalars["Int"]["input"]; + duration: Scalars["Float"]["input"]; +}>; + +export type SetSegmentDurationMutation = { + __typename?: "Mutation"; + setSegmentDuration: boolean; +}; + export type EditUploadStreamMutationVariables = Exact<{ videoId: Scalars["Int"]["input"]; videoMetadataInput: VideoMetadataInput; @@ -3505,6 +3516,64 @@ export type GetHlsInitUploadLinkMutationOptions = Apollo.BaseMutationOptions< GetHlsInitUploadLinkMutation, GetHlsInitUploadLinkMutationVariables >; +export const SetSegmentDurationDocument = gql` + mutation SetSegmentDuration( + $videoId: Int! + $segmentId: Int! + $duration: Float! + ) { + setSegmentDuration( + videoId: $videoId + segmentId: $segmentId + duration: $duration + ) + } +`; +export type SetSegmentDurationMutationFn = Apollo.MutationFunction< + SetSegmentDurationMutation, + SetSegmentDurationMutationVariables +>; + +/** + * __useSetSegmentDurationMutation__ + * + * To run a mutation, you first call `useSetSegmentDurationMutation` within a React component and pass it any options that fit your needs. + * When your component renders, `useSetSegmentDurationMutation` returns a tuple that includes: + * - A mutate function that you can call at any time to execute the mutation + * - An object with fields that represent the current status of the mutation's execution + * + * @param baseOptions options that will be passed into the mutation, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options-2; + * + * @example + * const [setSegmentDurationMutation, { data, loading, error }] = useSetSegmentDurationMutation({ + * variables: { + * videoId: // value for 'videoId' + * segmentId: // value for 'segmentId' + * duration: // value for 'duration' + * }, + * }); + */ +export function useSetSegmentDurationMutation( + baseOptions?: Apollo.MutationHookOptions< + SetSegmentDurationMutation, + SetSegmentDurationMutationVariables + >, +) { + const options = { ...defaultOptions, ...baseOptions }; + return Apollo.useMutation< + SetSegmentDurationMutation, + SetSegmentDurationMutationVariables + >(SetSegmentDurationDocument, options); +} +export type SetSegmentDurationMutationHookResult = ReturnType< + typeof useSetSegmentDurationMutation +>; +export type SetSegmentDurationMutationResult = + Apollo.MutationResult; +export type SetSegmentDurationMutationOptions = Apollo.BaseMutationOptions< + SetSegmentDurationMutation, + SetSegmentDurationMutationVariables +>; export const EditUploadStreamDocument = gql` mutation EditUploadStream( $videoId: Int! diff --git a/src/operations/video_upload.gql b/src/operations/video_upload.gql index 26940ac..1946ed5 100644 --- a/src/operations/video_upload.gql +++ b/src/operations/video_upload.gql @@ -24,6 +24,18 @@ mutation GetHlsInitUploadLink($videoId: Int!) { } } +mutation SetSegmentDuration( + $videoId: Int! + $segmentId: Int! + $duration: Float! +) { + setSegmentDuration( + videoId: $videoId + segmentId: $segmentId + duration: $duration + ) +} + mutation EditUploadStream( $videoId: Int! $videoMetadataInput: VideoMetadataInput! -- 2.46.1