import { Policy } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { GeneratedClient } from "../generatedClient" ; import { AttestationType , PolicyGetOptionalParams , PolicyGetResponse , PolicySetModelOptionalParams , PolicySetModelResponse , PolicyResetOptionalParams , PolicyResetResponse } from "../models" ; /** Class containing Policy operations. */ export class PolicyImpl implements Policy { private readonly client : GeneratedClient ; param client constructor ( client ) { this . client = client ; } param attestationType param options get ( attestationType , options ? ) { return this . client . sendOperationRequest ( { attestationType , options } , getOperationSpec ) ; } param attestationType param newAttestationPolicy param options set ( attestationType , newAttestationPolicy , options ? ) { return this . client . sendOperationRequest ( { attestationType , newAttestationPolicy , options } , setOperationSpec ) ; } param attestationType param policyJws param options reset ( attestationType , policyJws , options ? ) { return this . client . sendOperationRequest ( { attestationType , policyJws , options } , resetOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const getOperationSpec = { path : "/policies/{attestationType}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . PolicyResponse } , default : { bodyMapper : Mappers . CloudError } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . instanceUrl , Parameters . attestationType ] , headerParameters : [ Parameters . accept ] , serializer } ; const setOperationSpec = { path : "/policies/{attestationType}" , httpMethod : "PUT" , responses : { 200 : { bodyMapper : Mappers . PolicyResponse } , default : { bodyMapper : Mappers . CloudError } } , requestBody : Parameters . newAttestationPolicy , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . instanceUrl , Parameters . attestationType ] , headerParameters : [ Parameters . contentType , Parameters . accept1 ] , mediaType : "text" , serializer } ; const resetOperationSpec = { path : "/policies/{attestationType}:reset" , httpMethod : "POST" , responses : { 200 : { bodyMapper : Mappers . PolicyResponse } , default : { bodyMapper : Mappers . CloudError } } , requestBody : Parameters . policyJws , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . instanceUrl , Parameters . attestationType ] , headerParameters : [ Parameters . contentType , Parameters . accept1 ] , mediaType : "text" , serializer } ;