import { ClientOptions } from "../models/clientDetails" ; import { OperationGroupDetails } from "../models/operationDetails" ; import { KnownMediaType } from "@azure-tools/codegen" ; import { getAutorestOptions } from "../autorestSession" ; export async function transformOptions ( operationGroups ) { const mediaTypes = getMediaTypesStyles ( operationGroups ) ; const autorestOptions = getAutorestOptions ( ) ; return { ... autorestOptions , mediaTypes , hasPaging : hasPagingOperations ( operationGroups ) } ; } param operationGroups function getMediaTypesStyles ( operationGroups ) { return operationGroups . reduce ( ( mediaTypes , operationGroup ) => new Set < KnownMediaType > ( [ ... mediaTypes , ... operationGroup . mediaTypes ] ) , new Set < KnownMediaType > ( ) ) ; } function hasPagingOperations ( operationGroups ) { return operationGroups . some ( og => og . operations . some ( o => ! ! o . pagination ) ) ; }