public async Task <TrustedCertificate> Create(TrustedCertificate request) { try { var bodyParams = new TrustedCertificate { Certificate = request.Certificate, Description = request.Description, EnrollmentMode = request.EnrollmentMode, Name = request.Name, Service = request.Service, Status = request.Status, }; return(await Client.CallApi <TrustedCertificate>(path : "/v3/trusted-certificates", bodyParams : bodyParams, objectToUnpack : request, method : HttpMethods.POST)); } catch (ApiException e) { throw new CloudApiException(e.ErrorCode, e.Message, e.ErrorContent); } }
public async Task <TrustedCertificate> Update(string id, TrustedCertificate request) { try { var pathParams = new Dictionary <string, object> { { "cert_id", id }, }; var bodyParams = new TrustedCertificate { Certificate = request.Certificate, Description = request.Description, EnrollmentMode = request.EnrollmentMode, Name = request.Name, Service = request.Service, Status = request.Status, }; return(await Client.CallApi <TrustedCertificate>(path : "/v3/trusted-certificates/{cert_id}", pathParams : pathParams, bodyParams : bodyParams, objectToUnpack : request, method : HttpMethods.PUT)); } catch (ApiException e) { throw new CloudApiException(e.ErrorCode, e.Message, e.ErrorContent); } }