export function getSetMethodPolicy ( method ) { return { "set-method" : [ method ] } ; } export function getRewriteUrlPolicy ( triggerUrl ) { return { "rewrite-uri" : [ { _attr : { id : "apim-generated-policy" , template : triggerUrl } } ] } ; } export function getSetHeaderPolicy ( name , existsAction , headerValues ) { const setHeaderChildren = [ ] ; setHeaderChildren . push ( { _attr : { id : "apim-generated-policy" , name : name , "exists-action" : existsAction } } ) ; for ( const headerValue of headerValues ) { setHeaderChildren . push ( { value : headerValue } ) ; } return { "set-header" : setHeaderChildren } ; } export function getSetBackendPolicy ( backendId ) { return { "set-backend-service" : [ { _attr : { id : "apim-generated-policy" , "backend-id" : backendId } } ] } ; }