import { DpsCertificate } from "../operationsInterfaces" ; import * as coreClient from "@azure/core-client" ; import * as Mappers from "../models/mappers" ; import * as Parameters from "../models/parameters" ; import { DeviceProvisioningClient } from "../deviceProvisioningClient" ; import { DpsCertificateGetOptionalParams , DpsCertificateGetResponse , CertificateBodyDescription , DpsCertificateCreateOrUpdateOptionalParams , DpsCertificateCreateOrUpdateResponse , DpsCertificateDeleteOptionalParams , DpsCertificateListOptionalParams , DpsCertificateListResponse , DpsCertificateGenerateVerificationCodeOptionalParams , DpsCertificateGenerateVerificationCodeResponse , VerificationCodeRequest , DpsCertificateVerifyCertificateOptionalParams , DpsCertificateVerifyCertificateResponse } from "../models" ; /** Class containing DpsCertificate operations. */ export class DpsCertificateImpl implements DpsCertificate { private readonly client : DeviceProvisioningClient ; param client constructor ( client ) { this . client = client ; } param certificateName param resourceGroupName param provisioningServiceName param options get ( certificateName , resourceGroupName , provisioningServiceName , options ? ) { return this . client . sendOperationRequest ( { certificateName , resourceGroupName , provisioningServiceName , options } , getOperationSpec ) ; } param resourceGroupName param provisioningServiceName param certificateName param certificateDescription param options createOrUpdate ( resourceGroupName , provisioningServiceName , certificateName , certificateDescription , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , provisioningServiceName , certificateName , certificateDescription , options } , createOrUpdateOperationSpec ) ; } param resourceGroupName param ifMatch param provisioningServiceName param certificateName param options delete ( resourceGroupName , ifMatch , provisioningServiceName , certificateName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , ifMatch , provisioningServiceName , certificateName , options } , deleteOperationSpec ) ; } param resourceGroupName param provisioningServiceName param options list ( resourceGroupName , provisioningServiceName , options ? ) { return this . client . sendOperationRequest ( { resourceGroupName , provisioningServiceName , options } , listOperationSpec ) ; } param certificateName param ifMatch param resourceGroupName param provisioningServiceName param options generateVerificationCode ( certificateName , ifMatch , resourceGroupName , provisioningServiceName , options ? ) { return this . client . sendOperationRequest ( { certificateName , ifMatch , resourceGroupName , provisioningServiceName , options } , generateVerificationCodeOperationSpec ) ; } param certificateName param ifMatch param resourceGroupName param provisioningServiceName param request param options verifyCertificate ( certificateName , ifMatch , resourceGroupName , provisioningServiceName , request , options ? ) { return this . client . sendOperationRequest ( { certificateName , ifMatch , resourceGroupName , provisioningServiceName , request , options } , verifyCertificateOperationSpec ) ; } } const serializer = coreClient . createSerializer ( Mappers , false ) ; const getOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . CertificateResponse } , default : { bodyMapper : Mappers . ErrorDetails } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . certificateName , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . provisioningServiceName ] , headerParameters : [ Parameters . accept , Parameters . ifMatch ] , serializer } ; const createOrUpdateOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}" , httpMethod : "PUT" , responses : { 200 : { bodyMapper : Mappers . CertificateResponse } , default : { bodyMapper : Mappers . ErrorDetails } } , requestBody : Parameters . certificateDescription , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . provisioningServiceName , Parameters . certificateName1 ] , headerParameters : [ Parameters . accept , Parameters . ifMatch , Parameters . contentType ] , mediaType : "json" , serializer } ; const deleteOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}" , httpMethod : "DELETE" , responses : { 200 : { } , 204 : { } , default : { bodyMapper : Mappers . ErrorDetails } } , queryParameters : [ Parameters . apiVersion , Parameters . certificateName11 , Parameters . certificateRawBytes , Parameters . certificateIsVerified , Parameters . certificatePurpose , Parameters . certificateCreated , Parameters . certificateLastUpdated , Parameters . certificateHasPrivateKey , Parameters . certificateNonce ] , urlParameters : [ Parameters . $host , Parameters . certificateName , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . provisioningServiceName ] , headerParameters : [ Parameters . accept , Parameters . ifMatch1 ] , serializer } ; const listOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates" , httpMethod : "GET" , responses : { 200 : { bodyMapper : Mappers . CertificateListDescription } , default : { bodyMapper : Mappers . ErrorDetails } } , queryParameters : [ Parameters . apiVersion ] , urlParameters : [ Parameters . $host , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . provisioningServiceName ] , headerParameters : [ Parameters . accept ] , serializer } ; const generateVerificationCodeOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}/generateVerificationCode" , httpMethod : "POST" , responses : { 200 : { bodyMapper : Mappers . VerificationCodeResponse } , default : { bodyMapper : Mappers . ErrorDetails } } , queryParameters : [ Parameters . apiVersion , Parameters . certificateName11 , Parameters . certificateRawBytes , Parameters . certificateIsVerified , Parameters . certificatePurpose , Parameters . certificateCreated , Parameters . certificateLastUpdated , Parameters . certificateHasPrivateKey , Parameters . certificateNonce ] , urlParameters : [ Parameters . $host , Parameters . certificateName , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . provisioningServiceName ] , headerParameters : [ Parameters . accept , Parameters . ifMatch1 ] , serializer } ; const verifyCertificateOperationSpec = { path : "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}/verify" , httpMethod : "POST" , responses : { 200 : { bodyMapper : Mappers . CertificateResponse } , default : { bodyMapper : Mappers . ErrorDetails } } , requestBody : Parameters . request , queryParameters : [ Parameters . apiVersion , Parameters . certificateName11 , Parameters . certificateRawBytes , Parameters . certificateIsVerified , Parameters . certificatePurpose , Parameters . certificateCreated , Parameters . certificateLastUpdated , Parameters . certificateHasPrivateKey , Parameters . certificateNonce ] , urlParameters : [ Parameters . $host , Parameters . certificateName , Parameters . subscriptionId , Parameters . resourceGroupName , Parameters . provisioningServiceName ] , headerParameters : [ Parameters . accept , Parameters . contentType , Parameters . ifMatch1 ] , mediaType : "json" , serializer } ;