UNPKG

googleapis

Version:
1,398 lines 148 kB
/// <reference types="node" /> import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosPromise, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common'; import { Readable } from 'stream'; export declare namespace vault_v1 { export interface Options extends GlobalOptions { version: 'v1'; } interface StandardParameters { /** * Auth client or API Key for the request */ auth?: string | OAuth2Client | JWT | Compute | UserRefreshClient | BaseExternalAccountClient | GoogleAuth; /** * V1 error format. */ '$.xgafv'?: string; /** * OAuth access token. */ access_token?: string; /** * Data format for response. */ alt?: string; /** * JSONP */ callback?: string; /** * Selector specifying which fields to include in a partial response. */ fields?: string; /** * API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */ key?: string; /** * OAuth 2.0 token for the current user. */ oauth_token?: string; /** * Returns response with indentations and line breaks. */ prettyPrint?: boolean; /** * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. */ quotaUser?: string; /** * Legacy upload protocol for media (e.g. "media", "multipart"). */ uploadType?: string; /** * Upload protocol for media (e.g. "raw", "multipart"). */ upload_protocol?: string; } /** * G Suite Vault API * * Archiving and eDiscovery for G Suite. * * @example * ```js * const {google} = require('googleapis'); * const vault = google.vault('v1'); * ``` */ export class Vault { context: APIRequestContext; matters: Resource$Matters; operations: Resource$Operations; constructor(options: GlobalOptions, google?: GoogleConfigurable); } /** * Count number for each account. */ export interface Schema$AccountCount { /** * Account owner. */ account?: Schema$UserInfo; /** * The number of artifacts found for this account. */ count?: string | null; } /** * An error that occurred when querying a specific account */ export interface Schema$AccountCountError { /** * Account owner. */ account?: Schema$UserInfo; /** * Account query error. */ errorType?: string | null; } /** * Accounts to search */ export interface Schema$AccountInfo { /** * A set of accounts to search. */ emails?: string[] | null; } /** * A status detailing the status of each account creation, and the HeldAccount, if successful. */ export interface Schema$AddHeldAccountResult { /** * If present, this account was successfully created. */ account?: Schema$HeldAccount; /** * This represents the success status. If failed, check message. */ status?: Schema$Status; } /** * Add a list of accounts to a hold. */ export interface Schema$AddHeldAccountsRequest { /** * Account IDs to identify which accounts to add. Only account_ids or only emails should be specified, but not both. */ accountIds?: string[] | null; /** * Emails to identify which accounts to add. Only emails or only account_ids should be specified, but not both. */ emails?: string[] | null; } /** * Response for batch create held accounts. */ export interface Schema$AddHeldAccountsResponse { /** * The list of responses, in the same order as the batch request. */ responses?: Schema$AddHeldAccountResult[]; } /** * Add an account with the permission specified. The role cannot be owner. If an account already has a role in the matter, it will be overwritten. */ export interface Schema$AddMatterPermissionsRequest { /** * Only relevant if send_emails is true. True to CC requestor in the email message. False to not CC requestor. */ ccMe?: boolean | null; /** * The MatterPermission to add. */ matterPermission?: Schema$MatterPermission; /** * True to send notification email to the added account. False to not send notification email. */ sendEmails?: boolean | null; } /** * The request message for Operations.CancelOperation. */ export interface Schema$CancelOperationRequest { } /** * Close a matter by ID. */ export interface Schema$CloseMatterRequest { } /** * Response to a CloseMatterRequest. */ export interface Schema$CloseMatterResponse { /** * The updated matter, with state CLOSED. */ matter?: Schema$Matter; } /** * An export file on cloud storage */ export interface Schema$CloudStorageFile { /** * The cloud storage bucket name of this export file. Can be used in cloud storage JSON/XML API, but not to list the bucket contents. Instead, you can get individual export files by object name. */ bucketName?: string | null; /** * The md5 hash of the file. */ md5Hash?: string | null; /** * The cloud storage object name of this export file. Can be used in cloud storage JSON/XML API. */ objectName?: string | null; /** * The size of the export file. */ size?: string | null; } /** * Export sink for cloud storage files. */ export interface Schema$CloudStorageSink { /** * Output only. The exported files on cloud storage. */ files?: Schema$CloudStorageFile[]; } /** * Corpus specific queries. */ export interface Schema$CorpusQuery { /** * Details pertaining to Drive holds. If set, corpus must be Drive. */ driveQuery?: Schema$HeldDriveQuery; /** * Details pertaining to Groups holds. If set, corpus must be Groups. */ groupsQuery?: Schema$HeldGroupsQuery; /** * Details pertaining to Hangouts Chat holds. If set, corpus must be Hangouts Chat. */ hangoutsChatQuery?: Schema$HeldHangoutsChatQuery; /** * Details pertaining to mail holds. If set, corpus must be mail. */ mailQuery?: Schema$HeldMailQuery; /** * Details pertaining to Voice holds. If set, corpus must be Voice. */ voiceQuery?: Schema$HeldVoiceQuery; } /** * Long running operation metadata for CountArtifacts. */ export interface Schema$CountArtifactsMetadata { /** * End time of count operation. Available when operation is done. */ endTime?: string | null; /** * The matter ID of the associated matter. */ matterId?: string | null; /** * The search query from the request. */ query?: Schema$Query; /** * Creation time of count operation. */ startTime?: string | null; } /** * Count artifacts request. */ export interface Schema$CountArtifactsRequest { /** * The search query. */ query?: Schema$Query; /** * Specifies the granularity of the count result returned in response. */ view?: string | null; } /** * Definition of the response for method CountArtifacts. */ export interface Schema$CountArtifactsResponse { /** * Count metrics of Groups. */ groupsCountResult?: Schema$GroupsCountResult; /** * Count metrics of Mail. */ mailCountResult?: Schema$MailCountResult; /** * Total count of artifacts. For mail and groups, artifacts refers to messages. */ totalCount?: string | null; } /** * The options for Drive export. */ export interface Schema$DriveExportOptions { /** * Set to true to include access level information for users with indirect access to files. */ includeAccessInfo?: boolean | null; } /** * Drive search advanced options */ export interface Schema$DriveOptions { /** * Set to true to include shared drive. */ includeSharedDrives?: boolean | null; /** * Set to true to include Team Drive. */ includeTeamDrives?: boolean | null; /** * Search the versions of the Drive file as of the reference date. These timestamps are in GMT and rounded down to the given date. */ versionDate?: string | null; } /** * A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); \} The JSON representation for `Empty` is empty JSON object `{\}`. */ export interface Schema$Empty { } /** * An export */ export interface Schema$Export { /** * Output only. Export sink for cloud storage files. */ cloudStorageSink?: Schema$CloudStorageSink; /** * Output only. The time when the export was created. */ createTime?: string | null; /** * Advanced options of the export. */ exportOptions?: Schema$ExportOptions; /** * Output only. The generated export ID. */ id?: string | null; /** * Output only. The matter ID. */ matterId?: string | null; /** * The export name. */ name?: string | null; /** * The search query being exported. */ query?: Schema$Query; /** * Output only. The requester of the export. */ requester?: Schema$UserInfo; /** * Output only. Export statistics. */ stats?: Schema$ExportStats; /** * Output only. The export status. */ status?: string | null; } /** * Export advanced options */ export interface Schema$ExportOptions { /** * Option available for Drive export. */ driveOptions?: Schema$DriveExportOptions; /** * Option available for groups export. */ groupsOptions?: Schema$GroupsExportOptions; /** * Option available for hangouts chat export. */ hangoutsChatOptions?: Schema$HangoutsChatExportOptions; /** * Option available for mail export. */ mailOptions?: Schema$MailExportOptions; /** * The requested export location. */ region?: string | null; /** * Option available for voice export. */ voiceOptions?: Schema$VoiceExportOptions; } /** * Stats of an export. */ export interface Schema$ExportStats { /** * The number of documents already processed by the export. */ exportedArtifactCount?: string | null; /** * The size of export in bytes. */ sizeInBytes?: string | null; /** * The number of documents to be exported. */ totalArtifactCount?: string | null; } /** * Groups specific count metrics. */ export interface Schema$GroupsCountResult { /** * Error occurred when querying these accounts. */ accountCountErrors?: Schema$AccountCountError[]; /** * Subtotal count per matching account that have more than zero messages. */ accountCounts?: Schema$AccountCount[]; /** * Total number of accounts that can be queried and have more than zero messages. */ matchingAccountsCount?: string | null; /** * When data scope is HELD_DATA in the request Query, these accounts in the request are not queried because they are not on hold. For other data scope, this field is not set. */ nonQueryableAccounts?: string[] | null; /** * Total number of accounts involved in this count operation. */ queriedAccountsCount?: string | null; } /** * The options for groups export. */ export interface Schema$GroupsExportOptions { /** * The export format for groups export. */ exportFormat?: string | null; } /** * The options for hangouts chat export. */ export interface Schema$HangoutsChatExportOptions { /** * The export format for hangouts chat export. */ exportFormat?: string | null; } /** * Accounts to search */ export interface Schema$HangoutsChatInfo { /** * A set of rooms to search. */ roomId?: string[] | null; } /** * Hangouts chat search advanced options */ export interface Schema$HangoutsChatOptions { /** * Set to true to include rooms. */ includeRooms?: boolean | null; } /** * An account being held in a particular hold. This structure is immutable. This can be either a single user or a google group, depending on the corpus. */ export interface Schema$HeldAccount { /** * The account's ID as provided by the Admin SDK. */ accountId?: string | null; /** * The primary email address of the account. If used as an input, this takes precedence over account ID. */ email?: string | null; /** * Output only. The first name of the account holder. */ firstName?: string | null; /** * Output only. When the account was put on hold. */ holdTime?: string | null; /** * Output only. The last name of the account holder. */ lastName?: string | null; } /** * Query options for Drive holds. */ export interface Schema$HeldDriveQuery { /** * If true, include files in shared drives in the hold. */ includeSharedDriveFiles?: boolean | null; /** * If true, include files in Team Drives in the hold. */ includeTeamDriveFiles?: boolean | null; } /** * Query options for group holds. */ export interface Schema$HeldGroupsQuery { /** * The end time range for the search query. These timestamps are in GMT and rounded down to the start of the given date. */ endTime?: string | null; /** * The start time range for the search query. These timestamps are in GMT and rounded down to the start of the given date. */ startTime?: string | null; /** * The search terms for the hold. */ terms?: string | null; } /** * Query options for hangouts chat holds. */ export interface Schema$HeldHangoutsChatQuery { /** * If true, include rooms the user has participated in. */ includeRooms?: boolean | null; } /** * Query options for mail holds. */ export interface Schema$HeldMailQuery { /** * The end time range for the search query. These timestamps are in GMT and rounded down to the start of the given date. */ endTime?: string | null; /** * The start time range for the search query. These timestamps are in GMT and rounded down to the start of the given date. */ startTime?: string | null; /** * The search terms for the hold. */ terms?: string | null; } /** * A organizational unit being held in a particular hold. This structure is immutable. */ export interface Schema$HeldOrgUnit { /** * When the org unit was put on hold. This property is immutable. */ holdTime?: string | null; /** * The org unit's immutable ID as provided by the Admin SDK. */ orgUnitId?: string | null; } /** * Query options for Voice holds. */ export interface Schema$HeldVoiceQuery { /** * Data covered by this rule. Should be non-empty. Order does not matter and duplicates will be ignored. */ coveredData?: string[] | null; } /** * Represents a hold within Vault. A hold restricts purging of artifacts based on the combination of the query and accounts restrictions. A hold can be configured to either apply to an explicitly configured set of accounts, or can be applied to all members of an organizational unit. */ export interface Schema$Hold { /** * If set, the hold applies to the enumerated accounts and org_unit must be empty. */ accounts?: Schema$HeldAccount[]; /** * The corpus to be searched. */ corpus?: string | null; /** * The unique immutable ID of the hold. Assigned during creation. */ holdId?: string | null; /** * The name of the hold. */ name?: string | null; /** * If set, the hold applies to all members of the organizational unit and accounts must be empty. This property is mutable. For groups holds, set the accounts field. */ orgUnit?: Schema$HeldOrgUnit; /** * The corpus-specific query. If set, the corpusQuery must match corpus type. */ query?: Schema$CorpusQuery; /** * The last time this hold was modified. */ updateTime?: string | null; } /** * The holds for a matter. */ export interface Schema$ListExportsResponse { /** * The list of exports. */ exports?: Schema$Export[]; /** * Page token to retrieve the next page of results in the list. */ nextPageToken?: string | null; } /** * Returns a list of held accounts for a hold. */ export interface Schema$ListHeldAccountsResponse { /** * The held accounts on a hold. */ accounts?: Schema$HeldAccount[]; } /** * The holds for a matter. */ export interface Schema$ListHoldsResponse { /** * The list of holds. */ holds?: Schema$Hold[]; /** * Page token to retrieve the next page of results in the list. If this is empty, then there are no more holds to list. */ nextPageToken?: string | null; } /** * Provides the list of matters. */ export interface Schema$ListMattersResponse { /** * List of matters. */ matters?: Schema$Matter[]; /** * Page token to retrieve the next page of results in the list. */ nextPageToken?: string | null; } /** * The response message for Operations.ListOperations. */ export interface Schema$ListOperationsResponse { /** * The standard List next-page token. */ nextPageToken?: string | null; /** * A list of operations that matches the specified filter in the request. */ operations?: Schema$Operation[]; } /** * Definition of the response for method ListSaveQuery. */ export interface Schema$ListSavedQueriesResponse { /** * Page token to retrieve the next page of results in the list. If this is empty, then there are no more saved queries to list. */ nextPageToken?: string | null; /** * List of output saved queries. */ savedQueries?: Schema$SavedQuery[]; } /** * Mail specific count metrics. */ export interface Schema$MailCountResult { /** * Error occurred when querying these accounts. */ accountCountErrors?: Schema$AccountCountError[]; /** * Subtotal count per matching account that have more than zero messages. */ accountCounts?: Schema$AccountCount[]; /** * Total number of accounts that can be queried and have more than zero messages. */ matchingAccountsCount?: string | null; /** * When data scope is HELD_DATA in the request Query, these accounts in the request are not queried because they are not on hold. For other data scope, this field is not set. */ nonQueryableAccounts?: string[] | null; /** * Total number of accounts involved in this count operation. */ queriedAccountsCount?: string | null; } /** * The options for mail export. */ export interface Schema$MailExportOptions { /** * The export file format. */ exportFormat?: string | null; /** * Set to true to export confidential mode content. */ showConfidentialModeContent?: boolean | null; } /** * Mail search advanced options */ export interface Schema$MailOptions { /** * Set to true to exclude drafts. */ excludeDrafts?: boolean | null; } /** * Represents a matter. */ export interface Schema$Matter { /** * The description of the matter. */ description?: string | null; /** * The matter ID which is generated by the server. Should be blank when creating a new matter. */ matterId?: string | null; /** * List of users and access to the matter. Currently there is no programmer defined limit on the number of permissions a matter can have. */ matterPermissions?: Schema$MatterPermission[]; /** * The name of the matter. */ name?: string | null; /** * The state of the matter. */ state?: string | null; } /** * Currently each matter only has one owner, and all others are collaborators. When an account is purged, its corresponding MatterPermission resources cease to exist. */ export interface Schema$MatterPermission { /** * The account ID, as provided by Admin SDK. */ accountId?: string | null; /** * The user's role in this matter. */ role?: string | null; } /** * This resource represents a long-running operation that is the result of a network API call. */ export interface Schema$Operation { /** * If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */ done?: boolean | null; /** * The error result of the operation in case of failure or cancellation. */ error?: Schema$Status; /** * Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. */ metadata?: { [key: string]: any; } | null; /** * The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id\}`. */ name?: string | null; /** * The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`. */ response?: { [key: string]: any; } | null; } /** * Org Unit to search */ export interface Schema$OrgUnitInfo { /** * Org unit to search, as provided by the Admin SDK Directory API. */ orgUnitId?: string | null; } /** * A query definition relevant for search & export. */ export interface Schema$Query { /** * When 'ACCOUNT' is chosen as search method, account_info needs to be specified. */ accountInfo?: Schema$AccountInfo; /** * The corpus to search. */ corpus?: string | null; /** * The data source to search from. */ dataScope?: string | null; /** * For Drive search, specify more options in this field. */ driveOptions?: Schema$DriveOptions; /** * The end time range for the search query. These timestamps are in GMT and rounded down to the start of the given date. */ endTime?: string | null; /** * When 'ROOM' is chosen as search method, hangout_chats_info needs to be specified. (read-only) */ hangoutsChatInfo?: Schema$HangoutsChatInfo; /** * For hangouts chat search, specify more options in this field. (read-only) */ hangoutsChatOptions?: Schema$HangoutsChatOptions; /** * For mail search, specify more options in this field. */ mailOptions?: Schema$MailOptions; /** * The search method to use. This field is similar to the search_method field but is introduced to support shared drives. It supports all search method types. In case the search_method is TEAM_DRIVE the response of this field will be SHARED_DRIVE only. */ method?: string | null; /** * When 'ORG_UNIT' is chosen as as search method, org_unit_info needs to be specified. */ orgUnitInfo?: Schema$OrgUnitInfo; /** * The search method to use. */ searchMethod?: string | null; /** * When 'SHARED_DRIVE' is chosen as search method, shared_drive_info needs to be specified. */ sharedDriveInfo?: Schema$SharedDriveInfo; /** * The start time range for the search query. These timestamps are in GMT and rounded down to the start of the given date. */ startTime?: string | null; /** * When 'TEAM_DRIVE' is chosen as search method, team_drive_info needs to be specified. */ teamDriveInfo?: Schema$TeamDriveInfo; /** * The corpus-specific search operators used to generate search results. */ terms?: string | null; /** * The time zone name. It should be an IANA TZ name, such as "America/Los_Angeles". For more information, see Time Zone. */ timeZone?: string | null; /** * For voice search, specify more options in this field. */ voiceOptions?: Schema$VoiceOptions; } /** * Remove a list of accounts from a hold. */ export interface Schema$RemoveHeldAccountsRequest { /** * Account IDs to identify HeldAccounts to remove. */ accountIds?: string[] | null; } /** * Response for batch delete held accounts. */ export interface Schema$RemoveHeldAccountsResponse { /** * A list of statuses for deleted accounts. Results have the same order as the request. */ statuses?: Schema$Status[]; } /** * Remove an account as a matter collaborator. */ export interface Schema$RemoveMatterPermissionsRequest { /** * The account ID. */ accountId?: string | null; } /** * Reopen a matter by ID. */ export interface Schema$ReopenMatterRequest { } /** * Response to a ReopenMatterRequest. */ export interface Schema$ReopenMatterResponse { /** * The updated matter, with state OPEN. */ matter?: Schema$Matter; } /** * Definition of the saved query. */ export interface Schema$SavedQuery { /** * Output only. The server generated timestamp at which saved query was created. */ createTime?: string | null; /** * Name of the saved query. */ displayName?: string | null; /** * Output only. The matter ID of the associated matter. The server does not look at this field during create and always uses matter id in the URL. */ matterId?: string | null; /** * The underlying Query object which contains all the information of the saved query. */ query?: Schema$Query; /** * A unique identifier for the saved query. */ savedQueryId?: string | null; } /** * Shared drives to search */ export interface Schema$SharedDriveInfo { /** * List of Shared drive IDs, as provided by Drive API. */ sharedDriveIds?: string[] | null; } /** * The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). */ export interface Schema$Status { /** * The status code, which should be an enum value of google.rpc.Code. */ code?: number | null; /** * A list of messages that carry the error details. There is a common set of message types for APIs to use. */ details?: Array<{ [key: string]: any; }> | null; /** * A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client. */ message?: string | null; } /** * Team Drives to search */ export interface Schema$TeamDriveInfo { /** * List of Team Drive IDs, as provided by Drive API. */ teamDriveIds?: string[] | null; } /** * Undelete a matter by ID. */ export interface Schema$UndeleteMatterRequest { } /** * User's information. */ export interface Schema$UserInfo { /** * The displayed name of the user. */ displayName?: string | null; /** * The email address of the user. */ email?: string | null; } /** * The options for voice export. */ export interface Schema$VoiceExportOptions { /** * The export format for voice export. */ exportFormat?: string | null; } /** * Voice search options */ export interface Schema$VoiceOptions { /** * Datatypes to search */ coveredData?: string[] | null; } export class Resource$Matters { context: APIRequestContext; exports: Resource$Matters$Exports; holds: Resource$Matters$Holds; savedQueries: Resource$Matters$Savedqueries; constructor(context: APIRequestContext); /** * Adds an account as a matter collaborator. * @example * ```js * // Before running the sample: * // - Enable the API at: * // https://console.developers.google.com/apis/api/vault.googleapis.com * // - Login into gcloud by running: * // `$ gcloud auth application-default login` * // - Install the npm module by running: * // `$ npm install googleapis` * * const {google} = require('googleapis'); * const vault = google.vault('v1'); * * async function main() { * const auth = new google.auth.GoogleAuth({ * // Scopes can be specified either as an array or as a single, space-delimited string. * scopes: ['https://www.googleapis.com/auth/ediscovery'], * }); * * // Acquire an auth client, and bind it to all future calls * const authClient = await auth.getClient(); * google.options({auth: authClient}); * * // Do the magic * const res = await vault.matters.addPermissions({ * // The matter ID. * matterId: 'placeholder-value', * * // Request body metadata * requestBody: { * // request body parameters * // { * // "ccMe": false, * // "matterPermission": {}, * // "sendEmails": false * // } * }, * }); * console.log(res.data); * * // Example response * // { * // "accountId": "my_accountId", * // "role": "my_role" * // } * } * * main().catch(e => { * console.error(e); * throw e; * }); * * ``` * * @param params - Parameters for request * @param options - Optionally override request options, such as `url`, `method`, and `encoding`. * @param callback - Optional callback that handles the response. * @returns A promise if used with async/await, or void if used with a callback. */ addPermissions(params: Params$Resource$Matters$Addpermissions, options: StreamMethodOptions): GaxiosPromise<Readable>; addPermissions(params?: Params$Resource$Matters$Addpermissions, options?: MethodOptions): GaxiosPromise<Schema$MatterPermission>; addPermissions(params: Params$Resource$Matters$Addpermissions, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void; addPermissions(params: Params$Resource$Matters$Addpermissions, options: MethodOptions | BodyResponseCallback<Schema$MatterPermission>, callback: BodyResponseCallback<Schema$MatterPermission>): void; addPermissions(params: Params$Resource$Matters$Addpermissions, callback: BodyResponseCallback<Schema$MatterPermission>): void; addPermissions(callback: BodyResponseCallback<Schema$MatterPermission>): void; /** * Closes the specified matter. Returns matter with updated state. * @example * ```js * // Before running the sample: * // - Enable the API at: * // https://console.developers.google.com/apis/api/vault.googleapis.com * // - Login into gcloud by running: * // `$ gcloud auth application-default login` * // - Install the npm module by running: * // `$ npm install googleapis` * * const {google} = require('googleapis'); * const vault = google.vault('v1'); * * async function main() { * const auth = new google.auth.GoogleAuth({ * // Scopes can be specified either as an array or as a single, space-delimited string. * scopes: ['https://www.googleapis.com/auth/ediscovery'], * }); * * // Acquire an auth client, and bind it to all future calls * const authClient = await auth.getClient(); * google.options({auth: authClient}); * * // Do the magic * const res = await vault.matters.close({ * // The matter ID. * matterId: 'placeholder-value', * * // Request body metadata * requestBody: { * // request body parameters * // {} * }, * }); * console.log(res.data); * * // Example response * // { * // "matter": {} * // } * } * * main().catch(e => { * console.error(e); * throw e; * }); * * ``` * * @param params - Parameters for request * @param options - Optionally override request options, such as `url`, `method`, and `encoding`. * @param callback - Optional callback that handles the response. * @returns A promise if used with async/await, or void if used with a callback. */ close(params: Params$Resource$Matters$Close, options: StreamMethodOptions): GaxiosPromise<Readable>; close(params?: Params$Resource$Matters$Close, options?: MethodOptions): GaxiosPromise<Schema$CloseMatterResponse>; close(params: Params$Resource$Matters$Close, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void; close(params: Params$Resource$Matters$Close, options: MethodOptions | BodyResponseCallback<Schema$CloseMatterResponse>, callback: BodyResponseCallback<Schema$CloseMatterResponse>): void; close(params: Params$Resource$Matters$Close, callback: BodyResponseCallback<Schema$CloseMatterResponse>): void; close(callback: BodyResponseCallback<Schema$CloseMatterResponse>): void; /** * Counts the artifacts within the context of a matter and returns a detailed breakdown of metrics. * @example * ```js * // Before running the sample: * // - Enable the API at: * // https://console.developers.google.com/apis/api/vault.googleapis.com * // - Login into gcloud by running: * // `$ gcloud auth application-default login` * // - Install the npm module by running: * // `$ npm install googleapis` * * const {google} = require('googleapis'); * const vault = google.vault('v1'); * * async function main() { * const auth = new google.auth.GoogleAuth({ * // Scopes can be specified either as an array or as a single, space-delimited string. * scopes: ['https://www.googleapis.com/auth/ediscovery'], * }); * * // Acquire an auth client, and bind it to all future calls * const authClient = await auth.getClient(); * google.options({auth: authClient}); * * // Do the magic * const res = await vault.matters.count({ * // The matter ID. * matterId: 'placeholder-value', * * // Request body metadata * requestBody: { * // request body parameters * // { * // "query": {}, * // "view": "my_view" * // } * }, * }); * console.log(res.data); * * // Example response * // { * // "done": false, * // "error": {}, * // "metadata": {}, * // "name": "my_name", * // "response": {} * // } * } * * main().catch(e => { * console.error(e); * throw e; * }); * * ``` * * @param params - Parameters for request * @param options - Optionally override request options, such as `url`, `method`, and `encoding`. * @param callback - Optional callback that handles the response. * @returns A promise if used with async/await, or void if used with a callback. */ count(params: Params$Resource$Matters$Count, options: StreamMethodOptions): GaxiosPromise<Readable>; count(params?: Params$Resource$Matters$Count, options?: MethodOptions): GaxiosPromise<Schema$Operation>; count(params: Params$Resource$Matters$Count, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void; count(params: Params$Resource$Matters$Count, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void; count(params: Params$Resource$Matters$Count, callback: BodyResponseCallback<Schema$Operation>): void; count(callback: BodyResponseCallback<Schema$Operation>): void; /** * Creates a new matter with the given name and description. The initial state is open, and the owner is the method caller. Returns the created matter with default view. * @example * ```js * // Before running the sample: * // - Enable the API at: * // https://console.developers.google.com/apis/api/vault.googleapis.com * // - Login into gcloud by running: * // `$ gcloud auth application-default login` * // - Install the npm module by running: * // `$ npm install googleapis` * * const {google} = require('googleapis'); * const vault = google.vault('v1'); * * async function main() { * const auth = new google.auth.GoogleAuth({ * // Scopes can be specified either as an array or as a single, space-delimited string. * scopes: ['https://www.googleapis.com/auth/ediscovery'], * }); * * // Acquire an auth client, and bind it to all future calls * const authClient = await auth.getClient(); * google.options({auth: authClient}); * * // Do the magic * const res = await vault.matters.create({ * // Request body metadata * requestBody: { * // request body parameters * // { * // "description": "my_description", * // "matterId": "my_matterId", * // "matterPermissions": [], * // "name": "my_name", * // "state": "my_state" * // } * }, * }); * console.log(res.data); * * // Example response * // { * // "description": "my_description", * // "matterId": "my_matterId", * // "matterPermissions": [], * // "name": "my_name", * // "state": "my_state" * // } * } * * main().catch(e => { * console.error(e); * throw e; * }); * * ``` * * @param params - Parameters for request * @param options - Optionally override request options, such as `url`, `method`, and `encoding`. * @param callback - Optional callback that handles the response. * @returns A promise if used with async/await, or void if used with a callback. */ create(params: Params$Resource$Matters$Create, options: StreamMethodOptions): GaxiosPromise<Readable>; create(params?: Params$Resource$Matters$Create, options?: MethodOptions): GaxiosPromise<Schema$Matter>; create(params: Params$Resource$Matters$Create, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void; create(params: Params$Resource$Matters$Create, options: MethodOptions | BodyResponseCallback<Schema$Matter>, callback: BodyResponseCallback<Schema$Matter>): void; create(params: Params$Resource$Matters$Create, callback: BodyResponseCallback<Schema$Matter>): void; create(callback: BodyResponseCallback<Schema$Matter>): void; /** * Deletes the specified matter. Returns matter with updated state. * @example * ```js * // Before running the sample: * // - Enable the API at: * // https://console.developers.google.com/apis/api/vault.googleapis.com * // - Login into gcloud by running: * // `$ gcloud auth application-default login` * // - Install the npm module by running: * // `$ npm install googleapis` * * const {google} = require('googleapis'); * const vault = google.vault('v1'); * * async function main() { * const auth = new google.auth.GoogleAuth({ * // Scopes can be specified either as an array or as a single, space-delimited string. * scopes: ['https://www.googleapis.com/auth/ediscovery'], * }); * * // Acquire an auth client, and bind it to all future calls * const authClient = await auth.getClient(); * google.options({auth: authClient}); * * // Do the magic * const res = await vault.matters.delete({ * // The matter ID * matterId: 'placeholder-value', * }); * console.log(res.data); * * // Example response * // { * // "description": "my_description", * // "matterId": "my_matterId", * // "matterPermissions": [], * // "name": "my_name", * // "state": "my_state" * // } * } * * main().catch(e => { * console.error(e); * throw e; * }); * * ``` * * @param params - Parameters for request * @param options - Optionally override request options, such as `url`, `method`, and `encoding`. * @param callback - Optional callback that handles the response. * @returns A promise if used with async/await, or void if used with a callback. */ delete(params: Params$Resource$Matters$Delete, options: StreamMethodOptions): GaxiosPromise<Readable>; delete(params?: Params$Resource$Matters$Delete, options?: MethodOptions): GaxiosPromise<Schema$Matter>; delete(params: Params$Resource$Matters$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void; delete(params: Params$Resource$Matters$Delete, options: MethodOptions | BodyResponseCallback<Schema$Matter>, callback: BodyResponseCallback<Schema$Matter>): void; delete(params: Params$Resource$Matters$Delete, callback: BodyResponseCallback<Schema$Matter>): void; delete(callback: BodyResponseCallback<Schema$Matter>): void; /** * Gets the specified matter. * @example * ```js * // Before running the sample: * // - Enable the API at: * // https://console.developers.google.com/apis/api/vault.googleapis.com * // - Login into gcloud by running: * // `$ gcloud auth application-default login` * // - Install the npm module by running: * // `$ npm install googleapis` * * const {google} = require('googleapis'); * const vault = google.vault('v1'); * * async function main() { * const auth = new google.auth.GoogleAuth({ * // Scopes can be specified either as an array or as a single, space-delimited string. * scopes: [ * 'https://www.googleapis.com/auth/ediscovery', * 'https://www.googleapis.com/auth/ediscovery.readonly', * ], * }); * * // Acquire an auth client, and bind it to all future calls * const authClient = await auth.getClient(); * google.options({auth: authClient}); * * // Do the magic * const res = await vault.matters.get({ * // The matter ID. * matterId: 'placeholder-value', * // Specifies which parts of the Matter to return in the response. * view: 'placeholder-value', * }); * console.log(res.data); * * // Example response * // { * // "description": "my_description", * // "matterId": "my_matterId", * // "matterPermissions": [], * // "name": "my_name", * // "state": "my_state" * // } * } * * main().catch(e => { * console.error(e); * throw e; * });