/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. * @generated-id: 56c143102e2a */ import { clientGovernanceDataPoliciesCreate } from "../funcs/clientGovernanceDataPoliciesCreate.js"; import { clientGovernanceDataPoliciesDownload } from "../funcs/clientGovernanceDataPoliciesDownload.js"; import { clientGovernanceDataPoliciesList } from "../funcs/clientGovernanceDataPoliciesList.js"; import { clientGovernanceDataPoliciesRetrieve } from "../funcs/clientGovernanceDataPoliciesRetrieve.js"; import { clientGovernanceDataPoliciesUpdate } from "../funcs/clientGovernanceDataPoliciesUpdate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Policies extends ClientSDK { /** * Gets specified policy * * @remarks * Fetches the specified policy version, or the latest if no version is provided. */ async retrieve( id: string, version?: number | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientGovernanceDataPoliciesRetrieve( this, id, version, options, )); } /** * Updates an existing policy * * @remarks * Updates an existing policy. */ async update( updateDlpReportRequest: components.UpdateDlpReportRequest, id: string, options?: RequestOptions, ): Promise { return unwrapAsync(clientGovernanceDataPoliciesUpdate( this, updateDlpReportRequest, id, options, )); } /** * Lists policies * * @remarks * Lists policies with filtering. */ async list( autoHide?: boolean | undefined, frequency?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(clientGovernanceDataPoliciesList( this, autoHide, frequency, options, )); } /** * Creates new policy * * @remarks * Creates a new policy with specified specifications and returns its id. */ async create( request: components.CreateDlpReportRequest, options?: RequestOptions, ): Promise { return unwrapAsync(clientGovernanceDataPoliciesCreate( this, request, options, )); } /** * Downloads violations CSV for policy * * @remarks * Downloads CSV violations report for a specific policy id. This does not support continuous policies. */ async download( id: string, options?: RequestOptions, ): Promise { return unwrapAsync(clientGovernanceDataPoliciesDownload( this, id, options, )); } }