Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

6304 řádky
208 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package vault provides access to the G Suite Vault API.
  6. //
  7. // For product documentation, see: https://developers.google.com/vault
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/vault/v1"
  14. // ...
  15. // ctx := context.Background()
  16. // vaultService, err := vault.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  25. //
  26. // vaultService, err := vault.NewService(ctx, option.WithScopes(vault.EdiscoveryReadonlyScope))
  27. //
  28. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  29. //
  30. // vaultService, err := vault.NewService(ctx, option.WithAPIKey("AIza..."))
  31. //
  32. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  33. //
  34. // config := &oauth2.Config{...}
  35. // // ...
  36. // token, err := config.Exchange(ctx, ...)
  37. // vaultService, err := vault.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  38. //
  39. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  40. package vault // import "google.golang.org/api/vault/v1"
  41. import (
  42. "bytes"
  43. "context"
  44. "encoding/json"
  45. "errors"
  46. "fmt"
  47. "io"
  48. "net/http"
  49. "net/url"
  50. "strconv"
  51. "strings"
  52. gensupport "google.golang.org/api/gensupport"
  53. googleapi "google.golang.org/api/googleapi"
  54. option "google.golang.org/api/option"
  55. htransport "google.golang.org/api/transport/http"
  56. )
  57. // Always reference these packages, just in case the auto-generated code
  58. // below doesn't.
  59. var _ = bytes.NewBuffer
  60. var _ = strconv.Itoa
  61. var _ = fmt.Sprintf
  62. var _ = json.NewDecoder
  63. var _ = io.Copy
  64. var _ = url.Parse
  65. var _ = gensupport.MarshalJSON
  66. var _ = googleapi.Version
  67. var _ = errors.New
  68. var _ = strings.Replace
  69. var _ = context.Canceled
  70. const apiId = "vault:v1"
  71. const apiName = "vault"
  72. const apiVersion = "v1"
  73. const basePath = "https://vault.googleapis.com/"
  74. // OAuth2 scopes used by this API.
  75. const (
  76. // Manage your eDiscovery data
  77. EdiscoveryScope = "https://www.googleapis.com/auth/ediscovery"
  78. // View your eDiscovery data
  79. EdiscoveryReadonlyScope = "https://www.googleapis.com/auth/ediscovery.readonly"
  80. )
  81. // NewService creates a new Service.
  82. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  83. scopesOption := option.WithScopes(
  84. "https://www.googleapis.com/auth/ediscovery",
  85. "https://www.googleapis.com/auth/ediscovery.readonly",
  86. )
  87. // NOTE: prepend, so we don't override user-specified scopes.
  88. opts = append([]option.ClientOption{scopesOption}, opts...)
  89. client, endpoint, err := htransport.NewClient(ctx, opts...)
  90. if err != nil {
  91. return nil, err
  92. }
  93. s, err := New(client)
  94. if err != nil {
  95. return nil, err
  96. }
  97. if endpoint != "" {
  98. s.BasePath = endpoint
  99. }
  100. return s, nil
  101. }
  102. // New creates a new Service. It uses the provided http.Client for requests.
  103. //
  104. // Deprecated: please use NewService instead.
  105. // To provide a custom HTTP client, use option.WithHTTPClient.
  106. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  107. func New(client *http.Client) (*Service, error) {
  108. if client == nil {
  109. return nil, errors.New("client is nil")
  110. }
  111. s := &Service{client: client, BasePath: basePath}
  112. s.Matters = NewMattersService(s)
  113. return s, nil
  114. }
  115. type Service struct {
  116. client *http.Client
  117. BasePath string // API endpoint base URL
  118. UserAgent string // optional additional User-Agent fragment
  119. Matters *MattersService
  120. }
  121. func (s *Service) userAgent() string {
  122. if s.UserAgent == "" {
  123. return googleapi.UserAgent
  124. }
  125. return googleapi.UserAgent + " " + s.UserAgent
  126. }
  127. func NewMattersService(s *Service) *MattersService {
  128. rs := &MattersService{s: s}
  129. rs.Exports = NewMattersExportsService(s)
  130. rs.Holds = NewMattersHoldsService(s)
  131. rs.SavedQueries = NewMattersSavedQueriesService(s)
  132. return rs
  133. }
  134. type MattersService struct {
  135. s *Service
  136. Exports *MattersExportsService
  137. Holds *MattersHoldsService
  138. SavedQueries *MattersSavedQueriesService
  139. }
  140. func NewMattersExportsService(s *Service) *MattersExportsService {
  141. rs := &MattersExportsService{s: s}
  142. return rs
  143. }
  144. type MattersExportsService struct {
  145. s *Service
  146. }
  147. func NewMattersHoldsService(s *Service) *MattersHoldsService {
  148. rs := &MattersHoldsService{s: s}
  149. rs.Accounts = NewMattersHoldsAccountsService(s)
  150. return rs
  151. }
  152. type MattersHoldsService struct {
  153. s *Service
  154. Accounts *MattersHoldsAccountsService
  155. }
  156. func NewMattersHoldsAccountsService(s *Service) *MattersHoldsAccountsService {
  157. rs := &MattersHoldsAccountsService{s: s}
  158. return rs
  159. }
  160. type MattersHoldsAccountsService struct {
  161. s *Service
  162. }
  163. func NewMattersSavedQueriesService(s *Service) *MattersSavedQueriesService {
  164. rs := &MattersSavedQueriesService{s: s}
  165. return rs
  166. }
  167. type MattersSavedQueriesService struct {
  168. s *Service
  169. }
  170. // AccountInfo: Accounts to search
  171. type AccountInfo struct {
  172. // Emails: A set of accounts to search.
  173. Emails []string `json:"emails,omitempty"`
  174. // ForceSendFields is a list of field names (e.g. "Emails") to
  175. // unconditionally include in API requests. By default, fields with
  176. // empty values are omitted from API requests. However, any non-pointer,
  177. // non-interface field appearing in ForceSendFields will be sent to the
  178. // server regardless of whether the field is empty or not. This may be
  179. // used to include empty fields in Patch requests.
  180. ForceSendFields []string `json:"-"`
  181. // NullFields is a list of field names (e.g. "Emails") to include in API
  182. // requests with the JSON null value. By default, fields with empty
  183. // values are omitted from API requests. However, any field with an
  184. // empty value appearing in NullFields will be sent to the server as
  185. // null. It is an error if a field in this list has a non-empty value.
  186. // This may be used to include null fields in Patch requests.
  187. NullFields []string `json:"-"`
  188. }
  189. func (s *AccountInfo) MarshalJSON() ([]byte, error) {
  190. type NoMethod AccountInfo
  191. raw := NoMethod(*s)
  192. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  193. }
  194. // AddHeldAccountResult: A status detailing the status of each account
  195. // creation, and the
  196. // HeldAccount, if successful.
  197. type AddHeldAccountResult struct {
  198. // Account: If present, this account was successfully created.
  199. Account *HeldAccount `json:"account,omitempty"`
  200. // Status: This represents the success status. If failed, check message.
  201. Status *Status `json:"status,omitempty"`
  202. // ForceSendFields is a list of field names (e.g. "Account") to
  203. // unconditionally include in API requests. By default, fields with
  204. // empty values are omitted from API requests. However, any non-pointer,
  205. // non-interface field appearing in ForceSendFields will be sent to the
  206. // server regardless of whether the field is empty or not. This may be
  207. // used to include empty fields in Patch requests.
  208. ForceSendFields []string `json:"-"`
  209. // NullFields is a list of field names (e.g. "Account") to include in
  210. // API requests with the JSON null value. By default, fields with empty
  211. // values are omitted from API requests. However, any field with an
  212. // empty value appearing in NullFields will be sent to the server as
  213. // null. It is an error if a field in this list has a non-empty value.
  214. // This may be used to include null fields in Patch requests.
  215. NullFields []string `json:"-"`
  216. }
  217. func (s *AddHeldAccountResult) MarshalJSON() ([]byte, error) {
  218. type NoMethod AddHeldAccountResult
  219. raw := NoMethod(*s)
  220. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  221. }
  222. // AddHeldAccountsRequest: Add a list of accounts to a hold.
  223. type AddHeldAccountsRequest struct {
  224. // AccountIds: Account ids to identify which accounts to add. Only
  225. // account_ids or only
  226. // emails should be specified, but not both.
  227. AccountIds []string `json:"accountIds,omitempty"`
  228. // Emails: Emails to identify which accounts to add. Only emails or only
  229. // account_ids
  230. // should be specified, but not both.
  231. Emails []string `json:"emails,omitempty"`
  232. // ForceSendFields is a list of field names (e.g. "AccountIds") to
  233. // unconditionally include in API requests. By default, fields with
  234. // empty values are omitted from API requests. However, any non-pointer,
  235. // non-interface field appearing in ForceSendFields will be sent to the
  236. // server regardless of whether the field is empty or not. This may be
  237. // used to include empty fields in Patch requests.
  238. ForceSendFields []string `json:"-"`
  239. // NullFields is a list of field names (e.g. "AccountIds") to include in
  240. // API requests with the JSON null value. By default, fields with empty
  241. // values are omitted from API requests. However, any field with an
  242. // empty value appearing in NullFields will be sent to the server as
  243. // null. It is an error if a field in this list has a non-empty value.
  244. // This may be used to include null fields in Patch requests.
  245. NullFields []string `json:"-"`
  246. }
  247. func (s *AddHeldAccountsRequest) MarshalJSON() ([]byte, error) {
  248. type NoMethod AddHeldAccountsRequest
  249. raw := NoMethod(*s)
  250. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  251. }
  252. // AddHeldAccountsResponse: Response for batch create held accounts.
  253. type AddHeldAccountsResponse struct {
  254. // Responses: The list of responses, in the same order as the batch
  255. // request.
  256. Responses []*AddHeldAccountResult `json:"responses,omitempty"`
  257. // ServerResponse contains the HTTP response code and headers from the
  258. // server.
  259. googleapi.ServerResponse `json:"-"`
  260. // ForceSendFields is a list of field names (e.g. "Responses") to
  261. // unconditionally include in API requests. By default, fields with
  262. // empty values are omitted from API requests. However, any non-pointer,
  263. // non-interface field appearing in ForceSendFields will be sent to the
  264. // server regardless of whether the field is empty or not. This may be
  265. // used to include empty fields in Patch requests.
  266. ForceSendFields []string `json:"-"`
  267. // NullFields is a list of field names (e.g. "Responses") to include in
  268. // API requests with the JSON null value. By default, fields with empty
  269. // values are omitted from API requests. However, any field with an
  270. // empty value appearing in NullFields will be sent to the server as
  271. // null. It is an error if a field in this list has a non-empty value.
  272. // This may be used to include null fields in Patch requests.
  273. NullFields []string `json:"-"`
  274. }
  275. func (s *AddHeldAccountsResponse) MarshalJSON() ([]byte, error) {
  276. type NoMethod AddHeldAccountsResponse
  277. raw := NoMethod(*s)
  278. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  279. }
  280. // AddMatterPermissionsRequest: Add an account with the permission
  281. // specified. The role cannot be owner.
  282. // If an account already has a role in the matter, it will
  283. // be
  284. // overwritten.
  285. type AddMatterPermissionsRequest struct {
  286. // CcMe: Only relevant if send_emails is true.
  287. // True to CC requestor in the email message.
  288. // False to not CC requestor.
  289. CcMe bool `json:"ccMe,omitempty"`
  290. // MatterPermission: The MatterPermission to add.
  291. MatterPermission *MatterPermission `json:"matterPermission,omitempty"`
  292. // SendEmails: True to send notification email to the added
  293. // account.
  294. // False to not send notification email.
  295. SendEmails bool `json:"sendEmails,omitempty"`
  296. // ForceSendFields is a list of field names (e.g. "CcMe") to
  297. // unconditionally include in API requests. By default, fields with
  298. // empty values are omitted from API requests. However, any non-pointer,
  299. // non-interface field appearing in ForceSendFields will be sent to the
  300. // server regardless of whether the field is empty or not. This may be
  301. // used to include empty fields in Patch requests.
  302. ForceSendFields []string `json:"-"`
  303. // NullFields is a list of field names (e.g. "CcMe") to include in API
  304. // requests with the JSON null value. By default, fields with empty
  305. // values are omitted from API requests. However, any field with an
  306. // empty value appearing in NullFields will be sent to the server as
  307. // null. It is an error if a field in this list has a non-empty value.
  308. // This may be used to include null fields in Patch requests.
  309. NullFields []string `json:"-"`
  310. }
  311. func (s *AddMatterPermissionsRequest) MarshalJSON() ([]byte, error) {
  312. type NoMethod AddMatterPermissionsRequest
  313. raw := NoMethod(*s)
  314. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  315. }
  316. // CloseMatterRequest: Close a matter by ID.
  317. type CloseMatterRequest struct {
  318. }
  319. // CloseMatterResponse: Response to a CloseMatterRequest.
  320. type CloseMatterResponse struct {
  321. // Matter: The updated matter, with state CLOSED.
  322. Matter *Matter `json:"matter,omitempty"`
  323. // ServerResponse contains the HTTP response code and headers from the
  324. // server.
  325. googleapi.ServerResponse `json:"-"`
  326. // ForceSendFields is a list of field names (e.g. "Matter") to
  327. // unconditionally include in API requests. By default, fields with
  328. // empty values are omitted from API requests. However, any non-pointer,
  329. // non-interface field appearing in ForceSendFields will be sent to the
  330. // server regardless of whether the field is empty or not. This may be
  331. // used to include empty fields in Patch requests.
  332. ForceSendFields []string `json:"-"`
  333. // NullFields is a list of field names (e.g. "Matter") to include in API
  334. // requests with the JSON null value. By default, fields with empty
  335. // values are omitted from API requests. However, any field with an
  336. // empty value appearing in NullFields will be sent to the server as
  337. // null. It is an error if a field in this list has a non-empty value.
  338. // This may be used to include null fields in Patch requests.
  339. NullFields []string `json:"-"`
  340. }
  341. func (s *CloseMatterResponse) MarshalJSON() ([]byte, error) {
  342. type NoMethod CloseMatterResponse
  343. raw := NoMethod(*s)
  344. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  345. }
  346. // CloudStorageFile: An export file on cloud storage
  347. type CloudStorageFile struct {
  348. // BucketName: The cloud storage bucket name of this export file.
  349. // Can be used in cloud storage JSON/XML API.
  350. BucketName string `json:"bucketName,omitempty"`
  351. // Md5Hash: The md5 hash of the file.
  352. Md5Hash string `json:"md5Hash,omitempty"`
  353. // ObjectName: The cloud storage object name of this export file.
  354. // Can be used in cloud storage JSON/XML API.
  355. ObjectName string `json:"objectName,omitempty"`
  356. // Size: The size of the export file.
  357. Size int64 `json:"size,omitempty,string"`
  358. // ForceSendFields is a list of field names (e.g. "BucketName") to
  359. // unconditionally include in API requests. By default, fields with
  360. // empty values are omitted from API requests. However, any non-pointer,
  361. // non-interface field appearing in ForceSendFields will be sent to the
  362. // server regardless of whether the field is empty or not. This may be
  363. // used to include empty fields in Patch requests.
  364. ForceSendFields []string `json:"-"`
  365. // NullFields is a list of field names (e.g. "BucketName") to include in
  366. // API requests with the JSON null value. By default, fields with empty
  367. // values are omitted from API requests. However, any field with an
  368. // empty value appearing in NullFields will be sent to the server as
  369. // null. It is an error if a field in this list has a non-empty value.
  370. // This may be used to include null fields in Patch requests.
  371. NullFields []string `json:"-"`
  372. }
  373. func (s *CloudStorageFile) MarshalJSON() ([]byte, error) {
  374. type NoMethod CloudStorageFile
  375. raw := NoMethod(*s)
  376. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  377. }
  378. // CloudStorageSink: Export sink for cloud storage files.
  379. type CloudStorageSink struct {
  380. // Files: Output only. The exported files on cloud storage.
  381. Files []*CloudStorageFile `json:"files,omitempty"`
  382. // ForceSendFields is a list of field names (e.g. "Files") to
  383. // unconditionally include in API requests. By default, fields with
  384. // empty values are omitted from API requests. However, any non-pointer,
  385. // non-interface field appearing in ForceSendFields will be sent to the
  386. // server regardless of whether the field is empty or not. This may be
  387. // used to include empty fields in Patch requests.
  388. ForceSendFields []string `json:"-"`
  389. // NullFields is a list of field names (e.g. "Files") to include in API
  390. // requests with the JSON null value. By default, fields with empty
  391. // values are omitted from API requests. However, any field with an
  392. // empty value appearing in NullFields will be sent to the server as
  393. // null. It is an error if a field in this list has a non-empty value.
  394. // This may be used to include null fields in Patch requests.
  395. NullFields []string `json:"-"`
  396. }
  397. func (s *CloudStorageSink) MarshalJSON() ([]byte, error) {
  398. type NoMethod CloudStorageSink
  399. raw := NoMethod(*s)
  400. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  401. }
  402. // CorpusQuery: Corpus specific queries.
  403. type CorpusQuery struct {
  404. // DriveQuery: Details pertaining to Drive holds. If set, corpus must be
  405. // Drive.
  406. DriveQuery *HeldDriveQuery `json:"driveQuery,omitempty"`
  407. // GroupsQuery: Details pertaining to Groups holds. If set, corpus must
  408. // be Groups.
  409. GroupsQuery *HeldGroupsQuery `json:"groupsQuery,omitempty"`
  410. // HangoutsChatQuery: Details pertaining to Hangouts Chat holds. If set,
  411. // corpus must be
  412. // Hangouts Chat.
  413. HangoutsChatQuery *HeldHangoutsChatQuery `json:"hangoutsChatQuery,omitempty"`
  414. // MailQuery: Details pertaining to mail holds. If set, corpus must be
  415. // mail.
  416. MailQuery *HeldMailQuery `json:"mailQuery,omitempty"`
  417. // ForceSendFields is a list of field names (e.g. "DriveQuery") to
  418. // unconditionally include in API requests. By default, fields with
  419. // empty values are omitted from API requests. However, any non-pointer,
  420. // non-interface field appearing in ForceSendFields will be sent to the
  421. // server regardless of whether the field is empty or not. This may be
  422. // used to include empty fields in Patch requests.
  423. ForceSendFields []string `json:"-"`
  424. // NullFields is a list of field names (e.g. "DriveQuery") to include in
  425. // API requests with the JSON null value. By default, fields with empty
  426. // values are omitted from API requests. However, any field with an
  427. // empty value appearing in NullFields will be sent to the server as
  428. // null. It is an error if a field in this list has a non-empty value.
  429. // This may be used to include null fields in Patch requests.
  430. NullFields []string `json:"-"`
  431. }
  432. func (s *CorpusQuery) MarshalJSON() ([]byte, error) {
  433. type NoMethod CorpusQuery
  434. raw := NoMethod(*s)
  435. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  436. }
  437. // DriveExportOptions: The options for Drive export.
  438. type DriveExportOptions struct {
  439. // IncludeAccessInfo: Set to true to include access level information
  440. // for users
  441. // with <a
  442. // href="https://support.google.com/vault/answer/6099459#metadata">indire
  443. // ct access</a>
  444. // to files.
  445. IncludeAccessInfo bool `json:"includeAccessInfo,omitempty"`
  446. // ForceSendFields is a list of field names (e.g. "IncludeAccessInfo")
  447. // to unconditionally include in API requests. By default, fields with
  448. // empty values are omitted from API requests. However, any non-pointer,
  449. // non-interface field appearing in ForceSendFields will be sent to the
  450. // server regardless of whether the field is empty or not. This may be
  451. // used to include empty fields in Patch requests.
  452. ForceSendFields []string `json:"-"`
  453. // NullFields is a list of field names (e.g. "IncludeAccessInfo") to
  454. // include in API requests with the JSON null value. By default, fields
  455. // with empty values are omitted from API requests. However, any field
  456. // with an empty value appearing in NullFields will be sent to the
  457. // server as null. It is an error if a field in this list has a
  458. // non-empty value. This may be used to include null fields in Patch
  459. // requests.
  460. NullFields []string `json:"-"`
  461. }
  462. func (s *DriveExportOptions) MarshalJSON() ([]byte, error) {
  463. type NoMethod DriveExportOptions
  464. raw := NoMethod(*s)
  465. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  466. }
  467. // DriveOptions: Drive search advanced options
  468. type DriveOptions struct {
  469. // IncludeTeamDrives: Set to true to include Team Drive.
  470. IncludeTeamDrives bool `json:"includeTeamDrives,omitempty"`
  471. // VersionDate: Search the versions of the Drive file
  472. // as of the reference date. These timestamps are in GMT and
  473. // rounded down to the given date.
  474. VersionDate string `json:"versionDate,omitempty"`
  475. // ForceSendFields is a list of field names (e.g. "IncludeTeamDrives")
  476. // to unconditionally include in API requests. By default, fields with
  477. // empty values are omitted from API requests. However, any non-pointer,
  478. // non-interface field appearing in ForceSendFields will be sent to the
  479. // server regardless of whether the field is empty or not. This may be
  480. // used to include empty fields in Patch requests.
  481. ForceSendFields []string `json:"-"`
  482. // NullFields is a list of field names (e.g. "IncludeTeamDrives") to
  483. // include in API requests with the JSON null value. By default, fields
  484. // with empty values are omitted from API requests. However, any field
  485. // with an empty value appearing in NullFields will be sent to the
  486. // server as null. It is an error if a field in this list has a
  487. // non-empty value. This may be used to include null fields in Patch
  488. // requests.
  489. NullFields []string `json:"-"`
  490. }
  491. func (s *DriveOptions) MarshalJSON() ([]byte, error) {
  492. type NoMethod DriveOptions
  493. raw := NoMethod(*s)
  494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  495. }
  496. // Empty: A generic empty message that you can re-use to avoid defining
  497. // duplicated
  498. // empty messages in your APIs. A typical example is to use it as the
  499. // request
  500. // or the response type of an API method. For instance:
  501. //
  502. // service Foo {
  503. // rpc Bar(google.protobuf.Empty) returns
  504. // (google.protobuf.Empty);
  505. // }
  506. //
  507. // The JSON representation for `Empty` is empty JSON object `{}`.
  508. type Empty struct {
  509. // ServerResponse contains the HTTP response code and headers from the
  510. // server.
  511. googleapi.ServerResponse `json:"-"`
  512. }
  513. // Export: An export
  514. type Export struct {
  515. // CloudStorageSink: Output only. Export sink for cloud storage files.
  516. CloudStorageSink *CloudStorageSink `json:"cloudStorageSink,omitempty"`
  517. // CreateTime: Output only. The time when the export was created.
  518. CreateTime string `json:"createTime,omitempty"`
  519. // ExportOptions: Advanced options of the export.
  520. ExportOptions *ExportOptions `json:"exportOptions,omitempty"`
  521. // Id: Output only. The generated export ID.
  522. Id string `json:"id,omitempty"`
  523. // MatterId: Output only. The matter ID.
  524. MatterId string `json:"matterId,omitempty"`
  525. // Name: The export name.
  526. Name string `json:"name,omitempty"`
  527. // Query: The search query being exported.
  528. Query *Query `json:"query,omitempty"`
  529. // Requester: Output only. The requester of the export.
  530. Requester *UserInfo `json:"requester,omitempty"`
  531. // Stats: Output only. Export statistics.
  532. Stats *ExportStats `json:"stats,omitempty"`
  533. // Status: Output only. The export status.
  534. //
  535. // Possible values:
  536. // "EXPORT_STATUS_UNSPECIFIED" - The status is unspecified.
  537. // "COMPLETED" - The export completed.
  538. // "FAILED" - The export failed.
  539. // "IN_PROGRESS" - The export is still being executed.
  540. Status string `json:"status,omitempty"`
  541. // ServerResponse contains the HTTP response code and headers from the
  542. // server.
  543. googleapi.ServerResponse `json:"-"`
  544. // ForceSendFields is a list of field names (e.g. "CloudStorageSink") to
  545. // unconditionally include in API requests. By default, fields with
  546. // empty values are omitted from API requests. However, any non-pointer,
  547. // non-interface field appearing in ForceSendFields will be sent to the
  548. // server regardless of whether the field is empty or not. This may be
  549. // used to include empty fields in Patch requests.
  550. ForceSendFields []string `json:"-"`
  551. // NullFields is a list of field names (e.g. "CloudStorageSink") to
  552. // include in API requests with the JSON null value. By default, fields
  553. // with empty values are omitted from API requests. However, any field
  554. // with an empty value appearing in NullFields will be sent to the
  555. // server as null. It is an error if a field in this list has a
  556. // non-empty value. This may be used to include null fields in Patch
  557. // requests.
  558. NullFields []string `json:"-"`
  559. }
  560. func (s *Export) MarshalJSON() ([]byte, error) {
  561. type NoMethod Export
  562. raw := NoMethod(*s)
  563. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  564. }
  565. // ExportOptions: Export advanced options
  566. type ExportOptions struct {
  567. // DriveOptions: Option available for Drive export.
  568. DriveOptions *DriveExportOptions `json:"driveOptions,omitempty"`
  569. // GroupsOptions: Option available for groups export.
  570. GroupsOptions *GroupsExportOptions `json:"groupsOptions,omitempty"`
  571. // HangoutsChatOptions: Option available for hangouts chat export.
  572. HangoutsChatOptions *HangoutsChatExportOptions `json:"hangoutsChatOptions,omitempty"`
  573. // MailOptions: Option available for mail export.
  574. MailOptions *MailExportOptions `json:"mailOptions,omitempty"`
  575. // Region: The requested export location.
  576. //
  577. // Possible values:
  578. // "EXPORT_REGION_UNSPECIFIED" - The region is unspecified. Will be
  579. // treated the same as ANY.
  580. // "ANY" - Any region.
  581. // "US" - US region.
  582. // "EUROPE" - Europe region.
  583. Region string `json:"region,omitempty"`
  584. // ForceSendFields is a list of field names (e.g. "DriveOptions") to
  585. // unconditionally include in API requests. By default, fields with
  586. // empty values are omitted from API requests. However, any non-pointer,
  587. // non-interface field appearing in ForceSendFields will be sent to the
  588. // server regardless of whether the field is empty or not. This may be
  589. // used to include empty fields in Patch requests.
  590. ForceSendFields []string `json:"-"`
  591. // NullFields is a list of field names (e.g. "DriveOptions") to include
  592. // in API requests with the JSON null value. By default, fields with
  593. // empty values are omitted from API requests. However, any field with
  594. // an empty value appearing in NullFields will be sent to the server as
  595. // null. It is an error if a field in this list has a non-empty value.
  596. // This may be used to include null fields in Patch requests.
  597. NullFields []string `json:"-"`
  598. }
  599. func (s *ExportOptions) MarshalJSON() ([]byte, error) {
  600. type NoMethod ExportOptions
  601. raw := NoMethod(*s)
  602. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  603. }
  604. // ExportStats: Stats of an export.
  605. type ExportStats struct {
  606. // ExportedArtifactCount: The number of documents already processed by
  607. // the export.
  608. ExportedArtifactCount int64 `json:"exportedArtifactCount,omitempty,string"`
  609. // SizeInBytes: The size of export in bytes.
  610. SizeInBytes int64 `json:"sizeInBytes,omitempty,string"`
  611. // TotalArtifactCount: The number of documents to be exported.
  612. TotalArtifactCount int64 `json:"totalArtifactCount,omitempty,string"`
  613. // ForceSendFields is a list of field names (e.g.
  614. // "ExportedArtifactCount") to unconditionally include in API requests.
  615. // By default, fields with empty values are omitted from API requests.
  616. // However, any non-pointer, non-interface field appearing in
  617. // ForceSendFields will be sent to the server regardless of whether the
  618. // field is empty or not. This may be used to include empty fields in
  619. // Patch requests.
  620. ForceSendFields []string `json:"-"`
  621. // NullFields is a list of field names (e.g. "ExportedArtifactCount") to
  622. // include in API requests with the JSON null value. By default, fields
  623. // with empty values are omitted from API requests. However, any field
  624. // with an empty value appearing in NullFields will be sent to the
  625. // server as null. It is an error if a field in this list has a
  626. // non-empty value. This may be used to include null fields in Patch
  627. // requests.
  628. NullFields []string `json:"-"`
  629. }
  630. func (s *ExportStats) MarshalJSON() ([]byte, error) {
  631. type NoMethod ExportStats
  632. raw := NoMethod(*s)
  633. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  634. }
  635. // GroupsExportOptions: The options for groups export.
  636. type GroupsExportOptions struct {
  637. // ExportFormat: The export format for groups export.
  638. //
  639. // Possible values:
  640. // "EXPORT_FORMAT_UNSPECIFIED" - No export format specified.
  641. // "MBOX" - MBOX as export format.
  642. // "PST" - PST as export format
  643. ExportFormat string `json:"exportFormat,omitempty"`
  644. // ForceSendFields is a list of field names (e.g. "ExportFormat") to
  645. // unconditionally include in API requests. By default, fields with
  646. // empty values are omitted from API requests. However, any non-pointer,
  647. // non-interface field appearing in ForceSendFields will be sent to the
  648. // server regardless of whether the field is empty or not. This may be
  649. // used to include empty fields in Patch requests.
  650. ForceSendFields []string `json:"-"`
  651. // NullFields is a list of field names (e.g. "ExportFormat") to include
  652. // in API requests with the JSON null value. By default, fields with
  653. // empty values are omitted from API requests. However, any field with
  654. // an empty value appearing in NullFields will be sent to the server as
  655. // null. It is an error if a field in this list has a non-empty value.
  656. // This may be used to include null fields in Patch requests.
  657. NullFields []string `json:"-"`
  658. }
  659. func (s *GroupsExportOptions) MarshalJSON() ([]byte, error) {
  660. type NoMethod GroupsExportOptions
  661. raw := NoMethod(*s)
  662. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  663. }
  664. // HangoutsChatExportOptions: The options for hangouts chat export.
  665. type HangoutsChatExportOptions struct {
  666. // ExportFormat: The export format for hangouts chat export.
  667. //
  668. // Possible values:
  669. // "EXPORT_FORMAT_UNSPECIFIED" - No export format specified.
  670. // "MBOX" - MBOX as export format.
  671. // "PST" - PST as export format
  672. ExportFormat string `json:"exportFormat,omitempty"`
  673. // ForceSendFields is a list of field names (e.g. "ExportFormat") to
  674. // unconditionally include in API requests. By default, fields with
  675. // empty values are omitted from API requests. However, any non-pointer,
  676. // non-interface field appearing in ForceSendFields will be sent to the
  677. // server regardless of whether the field is empty or not. This may be
  678. // used to include empty fields in Patch requests.
  679. ForceSendFields []string `json:"-"`
  680. // NullFields is a list of field names (e.g. "ExportFormat") to include
  681. // in API requests with the JSON null value. By default, fields with
  682. // empty values are omitted from API requests. However, any field with
  683. // an empty value appearing in NullFields will be sent to the server as
  684. // null. It is an error if a field in this list has a non-empty value.
  685. // This may be used to include null fields in Patch requests.
  686. NullFields []string `json:"-"`
  687. }
  688. func (s *HangoutsChatExportOptions) MarshalJSON() ([]byte, error) {
  689. type NoMethod HangoutsChatExportOptions
  690. raw := NoMethod(*s)
  691. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  692. }
  693. // HangoutsChatInfo: Accounts to search
  694. type HangoutsChatInfo struct {
  695. // RoomId: A set of rooms to search.
  696. RoomId []string `json:"roomId,omitempty"`
  697. // ForceSendFields is a list of field names (e.g. "RoomId") to
  698. // unconditionally include in API requests. By default, fields with
  699. // empty values are omitted from API requests. However, any non-pointer,
  700. // non-interface field appearing in ForceSendFields will be sent to the
  701. // server regardless of whether the field is empty or not. This may be
  702. // used to include empty fields in Patch requests.
  703. ForceSendFields []string `json:"-"`
  704. // NullFields is a list of field names (e.g. "RoomId") to include in API
  705. // requests with the JSON null value. By default, fields with empty
  706. // values are omitted from API requests. However, any field with an
  707. // empty value appearing in NullFields will be sent to the server as
  708. // null. It is an error if a field in this list has a non-empty value.
  709. // This may be used to include null fields in Patch requests.
  710. NullFields []string `json:"-"`
  711. }
  712. func (s *HangoutsChatInfo) MarshalJSON() ([]byte, error) {
  713. type NoMethod HangoutsChatInfo
  714. raw := NoMethod(*s)
  715. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  716. }
  717. // HangoutsChatOptions: Hangouts chat search advanced options
  718. type HangoutsChatOptions struct {
  719. // IncludeRooms: Set to true to include rooms.
  720. IncludeRooms bool `json:"includeRooms,omitempty"`
  721. // ForceSendFields is a list of field names (e.g. "IncludeRooms") to
  722. // unconditionally include in API requests. By default, fields with
  723. // empty values are omitted from API requests. However, any non-pointer,
  724. // non-interface field appearing in ForceSendFields will be sent to the
  725. // server regardless of whether the field is empty or not. This may be
  726. // used to include empty fields in Patch requests.
  727. ForceSendFields []string `json:"-"`
  728. // NullFields is a list of field names (e.g. "IncludeRooms") to include
  729. // in API requests with the JSON null value. By default, fields with
  730. // empty values are omitted from API requests. However, any field with
  731. // an empty value appearing in NullFields will be sent to the server as
  732. // null. It is an error if a field in this list has a non-empty value.
  733. // This may be used to include null fields in Patch requests.
  734. NullFields []string `json:"-"`
  735. }
  736. func (s *HangoutsChatOptions) MarshalJSON() ([]byte, error) {
  737. type NoMethod HangoutsChatOptions
  738. raw := NoMethod(*s)
  739. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  740. }
  741. // HeldAccount: An account being held in a particular hold. This
  742. // structure is immutable.
  743. // This can be either a single user or a google group, depending on the
  744. // corpus.
  745. type HeldAccount struct {
  746. // AccountId: The account's ID as provided by the
  747. // <a href="https://developers.google.com/admin-sdk/">Admin SDK</a>.
  748. AccountId string `json:"accountId,omitempty"`
  749. // HoldTime: When the account was put on hold.
  750. HoldTime string `json:"holdTime,omitempty"`
  751. // ServerResponse contains the HTTP response code and headers from the
  752. // server.
  753. googleapi.ServerResponse `json:"-"`
  754. // ForceSendFields is a list of field names (e.g. "AccountId") to
  755. // unconditionally include in API requests. By default, fields with
  756. // empty values are omitted from API requests. However, any non-pointer,
  757. // non-interface field appearing in ForceSendFields will be sent to the
  758. // server regardless of whether the field is empty or not. This may be
  759. // used to include empty fields in Patch requests.
  760. ForceSendFields []string `json:"-"`
  761. // NullFields is a list of field names (e.g. "AccountId") to include in
  762. // API requests with the JSON null value. By default, fields with empty
  763. // values are omitted from API requests. However, any field with an
  764. // empty value appearing in NullFields will be sent to the server as
  765. // null. It is an error if a field in this list has a non-empty value.
  766. // This may be used to include null fields in Patch requests.
  767. NullFields []string `json:"-"`
  768. }
  769. func (s *HeldAccount) MarshalJSON() ([]byte, error) {
  770. type NoMethod HeldAccount
  771. raw := NoMethod(*s)
  772. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  773. }
  774. // HeldDriveQuery: Query options for Drive holds.
  775. type HeldDriveQuery struct {
  776. // IncludeTeamDriveFiles: If true, include files in Team Drives in the
  777. // hold.
  778. IncludeTeamDriveFiles bool `json:"includeTeamDriveFiles,omitempty"`
  779. // ForceSendFields is a list of field names (e.g.
  780. // "IncludeTeamDriveFiles") to unconditionally include in API requests.
  781. // By default, fields with empty values are omitted from API requests.
  782. // However, any non-pointer, non-interface field appearing in
  783. // ForceSendFields will be sent to the server regardless of whether the
  784. // field is empty or not. This may be used to include empty fields in
  785. // Patch requests.
  786. ForceSendFields []string `json:"-"`
  787. // NullFields is a list of field names (e.g. "IncludeTeamDriveFiles") to
  788. // include in API requests with the JSON null value. By default, fields
  789. // with empty values are omitted from API requests. However, any field
  790. // with an empty value appearing in NullFields will be sent to the
  791. // server as null. It is an error if a field in this list has a
  792. // non-empty value. This may be used to include null fields in Patch
  793. // requests.
  794. NullFields []string `json:"-"`
  795. }
  796. func (s *HeldDriveQuery) MarshalJSON() ([]byte, error) {
  797. type NoMethod HeldDriveQuery
  798. raw := NoMethod(*s)
  799. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  800. }
  801. // HeldGroupsQuery: Query options for group holds.
  802. type HeldGroupsQuery struct {
  803. // EndTime: The end time range for the search query. These timestamps
  804. // are in GMT and
  805. // rounded down to the start of the given date.
  806. EndTime string `json:"endTime,omitempty"`
  807. // StartTime: The start time range for the search query. These
  808. // timestamps are in GMT and
  809. // rounded down to the start of the given date.
  810. StartTime string `json:"startTime,omitempty"`
  811. // Terms: The search terms for the hold.
  812. Terms string `json:"terms,omitempty"`
  813. // ForceSendFields is a list of field names (e.g. "EndTime") to
  814. // unconditionally include in API requests. By default, fields with
  815. // empty values are omitted from API requests. However, any non-pointer,
  816. // non-interface field appearing in ForceSendFields will be sent to the
  817. // server regardless of whether the field is empty or not. This may be
  818. // used to include empty fields in Patch requests.
  819. ForceSendFields []string `json:"-"`
  820. // NullFields is a list of field names (e.g. "EndTime") to include in
  821. // API requests with the JSON null value. By default, fields with empty
  822. // values are omitted from API requests. However, any field with an
  823. // empty value appearing in NullFields will be sent to the server as
  824. // null. It is an error if a field in this list has a non-empty value.
  825. // This may be used to include null fields in Patch requests.
  826. NullFields []string `json:"-"`
  827. }
  828. func (s *HeldGroupsQuery) MarshalJSON() ([]byte, error) {
  829. type NoMethod HeldGroupsQuery
  830. raw := NoMethod(*s)
  831. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  832. }
  833. // HeldHangoutsChatQuery: Query options for hangouts chat holds.
  834. type HeldHangoutsChatQuery struct {
  835. // IncludeRooms: If true, include rooms the user has participated in.
  836. IncludeRooms bool `json:"includeRooms,omitempty"`
  837. // ForceSendFields is a list of field names (e.g. "IncludeRooms") to
  838. // unconditionally include in API requests. By default, fields with
  839. // empty values are omitted from API requests. However, any non-pointer,
  840. // non-interface field appearing in ForceSendFields will be sent to the
  841. // server regardless of whether the field is empty or not. This may be
  842. // used to include empty fields in Patch requests.
  843. ForceSendFields []string `json:"-"`
  844. // NullFields is a list of field names (e.g. "IncludeRooms") to include
  845. // in API requests with the JSON null value. By default, fields with
  846. // empty values are omitted from API requests. However, any field with
  847. // an empty value appearing in NullFields will be sent to the server as
  848. // null. It is an error if a field in this list has a non-empty value.
  849. // This may be used to include null fields in Patch requests.
  850. NullFields []string `json:"-"`
  851. }
  852. func (s *HeldHangoutsChatQuery) MarshalJSON() ([]byte, error) {
  853. type NoMethod HeldHangoutsChatQuery
  854. raw := NoMethod(*s)
  855. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  856. }
  857. // HeldMailQuery: Query options for mail holds.
  858. type HeldMailQuery struct {
  859. // EndTime: The end time range for the search query. These timestamps
  860. // are in GMT and
  861. // rounded down to the start of the given date.
  862. EndTime string `json:"endTime,omitempty"`
  863. // StartTime: The start time range for the search query. These
  864. // timestamps are in GMT and
  865. // rounded down to the start of the given date.
  866. StartTime string `json:"startTime,omitempty"`
  867. // Terms: The search terms for the hold.
  868. Terms string `json:"terms,omitempty"`
  869. // ForceSendFields is a list of field names (e.g. "EndTime") to
  870. // unconditionally include in API requests. By default, fields with
  871. // empty values are omitted from API requests. However, any non-pointer,
  872. // non-interface field appearing in ForceSendFields will be sent to the
  873. // server regardless of whether the field is empty or not. This may be
  874. // used to include empty fields in Patch requests.
  875. ForceSendFields []string `json:"-"`
  876. // NullFields is a list of field names (e.g. "EndTime") to include in
  877. // API requests with the JSON null value. By default, fields with empty
  878. // values are omitted from API requests. However, any field with an
  879. // empty value appearing in NullFields will be sent to the server as
  880. // null. It is an error if a field in this list has a non-empty value.
  881. // This may be used to include null fields in Patch requests.
  882. NullFields []string `json:"-"`
  883. }
  884. func (s *HeldMailQuery) MarshalJSON() ([]byte, error) {
  885. type NoMethod HeldMailQuery
  886. raw := NoMethod(*s)
  887. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  888. }
  889. // HeldOrgUnit: A organizational unit being held in a particular
  890. // hold.
  891. // This structure is immutable.
  892. type HeldOrgUnit struct {
  893. // HoldTime: When the org unit was put on hold. This property is
  894. // immutable.
  895. HoldTime string `json:"holdTime,omitempty"`
  896. // OrgUnitId: The org unit's immutable ID as provided by the Admin SDK.
  897. OrgUnitId string `json:"orgUnitId,omitempty"`
  898. // ForceSendFields is a list of field names (e.g. "HoldTime") to
  899. // unconditionally include in API requests. By default, fields with
  900. // empty values are omitted from API requests. However, any non-pointer,
  901. // non-interface field appearing in ForceSendFields will be sent to the
  902. // server regardless of whether the field is empty or not. This may be
  903. // used to include empty fields in Patch requests.
  904. ForceSendFields []string `json:"-"`
  905. // NullFields is a list of field names (e.g. "HoldTime") to include in
  906. // API requests with the JSON null value. By default, fields with empty
  907. // values are omitted from API requests. However, any field with an
  908. // empty value appearing in NullFields will be sent to the server as
  909. // null. It is an error if a field in this list has a non-empty value.
  910. // This may be used to include null fields in Patch requests.
  911. NullFields []string `json:"-"`
  912. }
  913. func (s *HeldOrgUnit) MarshalJSON() ([]byte, error) {
  914. type NoMethod HeldOrgUnit
  915. raw := NoMethod(*s)
  916. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  917. }
  918. // Hold: Represents a hold within Vault. A hold restricts purging
  919. // of
  920. // artifacts based on the combination of the query and accounts
  921. // restrictions.
  922. // A hold can be configured to either apply to an explicitly configured
  923. // set
  924. // of accounts, or can be applied to all members of an organizational
  925. // unit.
  926. type Hold struct {
  927. // Accounts: If set, the hold applies to the enumerated accounts and
  928. // org_unit must be
  929. // empty.
  930. Accounts []*HeldAccount `json:"accounts,omitempty"`
  931. // Corpus: The corpus to be searched.
  932. //
  933. // Possible values:
  934. // "CORPUS_TYPE_UNSPECIFIED" - No corpus specified.
  935. // "DRIVE" - Drive.
  936. // "MAIL" - Mail.
  937. // "GROUPS" - Groups.
  938. // "HANGOUTS_CHAT" - Hangouts Chat.
  939. Corpus string `json:"corpus,omitempty"`
  940. // HoldId: The unique immutable ID of the hold. Assigned during
  941. // creation.
  942. HoldId string `json:"holdId,omitempty"`
  943. // Name: The name of the hold.
  944. Name string `json:"name,omitempty"`
  945. // OrgUnit: If set, the hold applies to all members of the
  946. // organizational unit and
  947. // accounts must be empty. This property is mutable. For groups
  948. // holds,
  949. // set the accounts field.
  950. OrgUnit *HeldOrgUnit `json:"orgUnit,omitempty"`
  951. // Query: The corpus-specific query. If set, the corpusQuery must match
  952. // corpus
  953. // type.
  954. Query *CorpusQuery `json:"query,omitempty"`
  955. // UpdateTime: The last time this hold was modified.
  956. UpdateTime string `json:"updateTime,omitempty"`
  957. // ServerResponse contains the HTTP response code and headers from the
  958. // server.
  959. googleapi.ServerResponse `json:"-"`
  960. // ForceSendFields is a list of field names (e.g. "Accounts") to
  961. // unconditionally include in API requests. By default, fields with
  962. // empty values are omitted from API requests. However, any non-pointer,
  963. // non-interface field appearing in ForceSendFields will be sent to the
  964. // server regardless of whether the field is empty or not. This may be
  965. // used to include empty fields in Patch requests.
  966. ForceSendFields []string `json:"-"`
  967. // NullFields is a list of field names (e.g. "Accounts") to include in
  968. // API requests with the JSON null value. By default, fields with empty
  969. // values are omitted from API requests. However, any field with an
  970. // empty value appearing in NullFields will be sent to the server as
  971. // null. It is an error if a field in this list has a non-empty value.
  972. // This may be used to include null fields in Patch requests.
  973. NullFields []string `json:"-"`
  974. }
  975. func (s *Hold) MarshalJSON() ([]byte, error) {
  976. type NoMethod Hold
  977. raw := NoMethod(*s)
  978. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  979. }
  980. // ListExportsResponse: The holds for a matter.
  981. type ListExportsResponse struct {
  982. // Exports: The list of exports.
  983. Exports []*Export `json:"exports,omitempty"`
  984. // NextPageToken: Page token to retrieve the next page of results in the
  985. // list.
  986. NextPageToken string `json:"nextPageToken,omitempty"`
  987. // ServerResponse contains the HTTP response code and headers from the
  988. // server.
  989. googleapi.ServerResponse `json:"-"`
  990. // ForceSendFields is a list of field names (e.g. "Exports") to
  991. // unconditionally include in API requests. By default, fields with
  992. // empty values are omitted from API requests. However, any non-pointer,
  993. // non-interface field appearing in ForceSendFields will be sent to the
  994. // server regardless of whether the field is empty or not. This may be
  995. // used to include empty fields in Patch requests.
  996. ForceSendFields []string `json:"-"`
  997. // NullFields is a list of field names (e.g. "Exports") to include in
  998. // API requests with the JSON null value. By default, fields with empty
  999. // values are omitted from API requests. However, any field with an
  1000. // empty value appearing in NullFields will be sent to the server as
  1001. // null. It is an error if a field in this list has a non-empty value.
  1002. // This may be used to include null fields in Patch requests.
  1003. NullFields []string `json:"-"`
  1004. }
  1005. func (s *ListExportsResponse) MarshalJSON() ([]byte, error) {
  1006. type NoMethod ListExportsResponse
  1007. raw := NoMethod(*s)
  1008. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1009. }
  1010. // ListHeldAccountsResponse: Returns a list of held accounts for a hold.
  1011. type ListHeldAccountsResponse struct {
  1012. // Accounts: The held accounts on a hold.
  1013. Accounts []*HeldAccount `json:"accounts,omitempty"`
  1014. // ServerResponse contains the HTTP response code and headers from the
  1015. // server.
  1016. googleapi.ServerResponse `json:"-"`
  1017. // ForceSendFields is a list of field names (e.g. "Accounts") to
  1018. // unconditionally include in API requests. By default, fields with
  1019. // empty values are omitted from API requests. However, any non-pointer,
  1020. // non-interface field appearing in ForceSendFields will be sent to the
  1021. // server regardless of whether the field is empty or not. This may be
  1022. // used to include empty fields in Patch requests.
  1023. ForceSendFields []string `json:"-"`
  1024. // NullFields is a list of field names (e.g. "Accounts") to include in
  1025. // API requests with the JSON null value. By default, fields with empty
  1026. // values are omitted from API requests. However, any field with an
  1027. // empty value appearing in NullFields will be sent to the server as
  1028. // null. It is an error if a field in this list has a non-empty value.
  1029. // This may be used to include null fields in Patch requests.
  1030. NullFields []string `json:"-"`
  1031. }
  1032. func (s *ListHeldAccountsResponse) MarshalJSON() ([]byte, error) {
  1033. type NoMethod ListHeldAccountsResponse
  1034. raw := NoMethod(*s)
  1035. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1036. }
  1037. // ListHoldsResponse: The holds for a matter.
  1038. type ListHoldsResponse struct {
  1039. // Holds: The list of holds.
  1040. Holds []*Hold `json:"holds,omitempty"`
  1041. // NextPageToken: Page token to retrieve the next page of results in the
  1042. // list.
  1043. // If this is empty, then there are no more holds to list.
  1044. NextPageToken string `json:"nextPageToken,omitempty"`
  1045. // ServerResponse contains the HTTP response code and headers from the
  1046. // server.
  1047. googleapi.ServerResponse `json:"-"`
  1048. // ForceSendFields is a list of field names (e.g. "Holds") to
  1049. // unconditionally include in API requests. By default, fields with
  1050. // empty values are omitted from API requests. However, any non-pointer,
  1051. // non-interface field appearing in ForceSendFields will be sent to the
  1052. // server regardless of whether the field is empty or not. This may be
  1053. // used to include empty fields in Patch requests.
  1054. ForceSendFields []string `json:"-"`
  1055. // NullFields is a list of field names (e.g. "Holds") to include in API
  1056. // requests with the JSON null value. By default, fields with empty
  1057. // values are omitted from API requests. However, any field with an
  1058. // empty value appearing in NullFields will be sent to the server as
  1059. // null. It is an error if a field in this list has a non-empty value.
  1060. // This may be used to include null fields in Patch requests.
  1061. NullFields []string `json:"-"`
  1062. }
  1063. func (s *ListHoldsResponse) MarshalJSON() ([]byte, error) {
  1064. type NoMethod ListHoldsResponse
  1065. raw := NoMethod(*s)
  1066. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1067. }
  1068. // ListMattersResponse: Provides the list of matters.
  1069. type ListMattersResponse struct {
  1070. // Matters: List of matters.
  1071. Matters []*Matter `json:"matters,omitempty"`
  1072. // NextPageToken: Page token to retrieve the next page of results in the
  1073. // list.
  1074. NextPageToken string `json:"nextPageToken,omitempty"`
  1075. // ServerResponse contains the HTTP response code and headers from the
  1076. // server.
  1077. googleapi.ServerResponse `json:"-"`
  1078. // ForceSendFields is a list of field names (e.g. "Matters") to
  1079. // unconditionally include in API requests. By default, fields with
  1080. // empty values are omitted from API requests. However, any non-pointer,
  1081. // non-interface field appearing in ForceSendFields will be sent to the
  1082. // server regardless of whether the field is empty or not. This may be
  1083. // used to include empty fields in Patch requests.
  1084. ForceSendFields []string `json:"-"`
  1085. // NullFields is a list of field names (e.g. "Matters") to include in
  1086. // API requests with the JSON null value. By default, fields with empty
  1087. // values are omitted from API requests. However, any field with an
  1088. // empty value appearing in NullFields will be sent to the server as
  1089. // null. It is an error if a field in this list has a non-empty value.
  1090. // This may be used to include null fields in Patch requests.
  1091. NullFields []string `json:"-"`
  1092. }
  1093. func (s *ListMattersResponse) MarshalJSON() ([]byte, error) {
  1094. type NoMethod ListMattersResponse
  1095. raw := NoMethod(*s)
  1096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1097. }
  1098. // ListSavedQueriesResponse: Definition of the response for method
  1099. // ListSaveQuery.
  1100. type ListSavedQueriesResponse struct {
  1101. // NextPageToken: Page token to retrieve the next page of results in the
  1102. // list.
  1103. // If this is empty, then there are no more saved queries to list.
  1104. NextPageToken string `json:"nextPageToken,omitempty"`
  1105. // SavedQueries: List of output saved queries.
  1106. SavedQueries []*SavedQuery `json:"savedQueries,omitempty"`
  1107. // ServerResponse contains the HTTP response code and headers from the
  1108. // server.
  1109. googleapi.ServerResponse `json:"-"`
  1110. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1111. // unconditionally include in API requests. By default, fields with
  1112. // empty values are omitted from API requests. However, any non-pointer,
  1113. // non-interface field appearing in ForceSendFields will be sent to the
  1114. // server regardless of whether the field is empty or not. This may be
  1115. // used to include empty fields in Patch requests.
  1116. ForceSendFields []string `json:"-"`
  1117. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1118. // in API requests with the JSON null value. By default, fields with
  1119. // empty values are omitted from API requests. However, any field with
  1120. // an empty value appearing in NullFields will be sent to the server as
  1121. // null. It is an error if a field in this list has a non-empty value.
  1122. // This may be used to include null fields in Patch requests.
  1123. NullFields []string `json:"-"`
  1124. }
  1125. func (s *ListSavedQueriesResponse) MarshalJSON() ([]byte, error) {
  1126. type NoMethod ListSavedQueriesResponse
  1127. raw := NoMethod(*s)
  1128. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1129. }
  1130. // MailExportOptions: The options for mail export.
  1131. type MailExportOptions struct {
  1132. // ExportFormat: The export file format.
  1133. //
  1134. // Possible values:
  1135. // "EXPORT_FORMAT_UNSPECIFIED" - No export format specified.
  1136. // "MBOX" - MBOX as export format.
  1137. // "PST" - PST as export format
  1138. ExportFormat string `json:"exportFormat,omitempty"`
  1139. // ShowConfidentialModeContent: Set to true to export confidential mode
  1140. // content.
  1141. ShowConfidentialModeContent bool `json:"showConfidentialModeContent,omitempty"`
  1142. // ForceSendFields is a list of field names (e.g. "ExportFormat") to
  1143. // unconditionally include in API requests. By default, fields with
  1144. // empty values are omitted from API requests. However, any non-pointer,
  1145. // non-interface field appearing in ForceSendFields will be sent to the
  1146. // server regardless of whether the field is empty or not. This may be
  1147. // used to include empty fields in Patch requests.
  1148. ForceSendFields []string `json:"-"`
  1149. // NullFields is a list of field names (e.g. "ExportFormat") to include
  1150. // in API requests with the JSON null value. By default, fields with
  1151. // empty values are omitted from API requests. However, any field with
  1152. // an empty value appearing in NullFields will be sent to the server as
  1153. // null. It is an error if a field in this list has a non-empty value.
  1154. // This may be used to include null fields in Patch requests.
  1155. NullFields []string `json:"-"`
  1156. }
  1157. func (s *MailExportOptions) MarshalJSON() ([]byte, error) {
  1158. type NoMethod MailExportOptions
  1159. raw := NoMethod(*s)
  1160. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1161. }
  1162. // MailOptions: Mail search advanced options
  1163. type MailOptions struct {
  1164. // ExcludeDrafts: Set to true to exclude drafts.
  1165. ExcludeDrafts bool `json:"excludeDrafts,omitempty"`
  1166. // ForceSendFields is a list of field names (e.g. "ExcludeDrafts") to
  1167. // unconditionally include in API requests. By default, fields with
  1168. // empty values are omitted from API requests. However, any non-pointer,
  1169. // non-interface field appearing in ForceSendFields will be sent to the
  1170. // server regardless of whether the field is empty or not. This may be
  1171. // used to include empty fields in Patch requests.
  1172. ForceSendFields []string `json:"-"`
  1173. // NullFields is a list of field names (e.g. "ExcludeDrafts") to include
  1174. // in API requests with the JSON null value. By default, fields with
  1175. // empty values are omitted from API requests. However, any field with
  1176. // an empty value appearing in NullFields will be sent to the server as
  1177. // null. It is an error if a field in this list has a non-empty value.
  1178. // This may be used to include null fields in Patch requests.
  1179. NullFields []string `json:"-"`
  1180. }
  1181. func (s *MailOptions) MarshalJSON() ([]byte, error) {
  1182. type NoMethod MailOptions
  1183. raw := NoMethod(*s)
  1184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1185. }
  1186. // Matter: Represents a matter.
  1187. type Matter struct {
  1188. // Description: The description of the matter.
  1189. Description string `json:"description,omitempty"`
  1190. // MatterId: The matter ID which is generated by the server.
  1191. // Should be blank when creating a new matter.
  1192. MatterId string `json:"matterId,omitempty"`
  1193. // MatterPermissions: List of users and access to the matter. Currently
  1194. // there is no programmer
  1195. // defined limit on the number of permissions a matter can have.
  1196. MatterPermissions []*MatterPermission `json:"matterPermissions,omitempty"`
  1197. // Name: The name of the matter.
  1198. Name string `json:"name,omitempty"`
  1199. // State: The state of the matter.
  1200. //
  1201. // Possible values:
  1202. // "STATE_UNSPECIFIED" - The matter has no specified state.
  1203. // "OPEN" - This matter is open.
  1204. // "CLOSED" - This matter is closed.
  1205. // "DELETED" - This matter is deleted.
  1206. State string `json:"state,omitempty"`
  1207. // ServerResponse contains the HTTP response code and headers from the
  1208. // server.
  1209. googleapi.ServerResponse `json:"-"`
  1210. // ForceSendFields is a list of field names (e.g. "Description") to
  1211. // unconditionally include in API requests. By default, fields with
  1212. // empty values are omitted from API requests. However, any non-pointer,
  1213. // non-interface field appearing in ForceSendFields will be sent to the
  1214. // server regardless of whether the field is empty or not. This may be
  1215. // used to include empty fields in Patch requests.
  1216. ForceSendFields []string `json:"-"`
  1217. // NullFields is a list of field names (e.g. "Description") to include
  1218. // in API requests with the JSON null value. By default, fields with
  1219. // empty values are omitted from API requests. However, any field with
  1220. // an empty value appearing in NullFields will be sent to the server as
  1221. // null. It is an error if a field in this list has a non-empty value.
  1222. // This may be used to include null fields in Patch requests.
  1223. NullFields []string `json:"-"`
  1224. }
  1225. func (s *Matter) MarshalJSON() ([]byte, error) {
  1226. type NoMethod Matter
  1227. raw := NoMethod(*s)
  1228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1229. }
  1230. // MatterPermission: Currently each matter only has one owner, and all
  1231. // others are collaborators.
  1232. // When an account is purged, its corresponding MatterPermission
  1233. // resources
  1234. // cease to exist.
  1235. type MatterPermission struct {
  1236. // AccountId: The account id, as provided by <a
  1237. // href="https://developers.google.com/admin-sdk/">Admin SDK</a>.
  1238. AccountId string `json:"accountId,omitempty"`
  1239. // Role: The user's role in this matter.
  1240. //
  1241. // Possible values:
  1242. // "ROLE_UNSPECIFIED" - No role assigned.
  1243. // "COLLABORATOR" - A collaborator to the matter.
  1244. // "OWNER" - The owner of the matter.
  1245. Role string `json:"role,omitempty"`
  1246. // ServerResponse contains the HTTP response code and headers from the
  1247. // server.
  1248. googleapi.ServerResponse `json:"-"`
  1249. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1250. // unconditionally include in API requests. By default, fields with
  1251. // empty values are omitted from API requests. However, any non-pointer,
  1252. // non-interface field appearing in ForceSendFields will be sent to the
  1253. // server regardless of whether the field is empty or not. This may be
  1254. // used to include empty fields in Patch requests.
  1255. ForceSendFields []string `json:"-"`
  1256. // NullFields is a list of field names (e.g. "AccountId") to include in
  1257. // API requests with the JSON null value. By default, fields with empty
  1258. // values are omitted from API requests. However, any field with an
  1259. // empty value appearing in NullFields will be sent to the server as
  1260. // null. It is an error if a field in this list has a non-empty value.
  1261. // This may be used to include null fields in Patch requests.
  1262. NullFields []string `json:"-"`
  1263. }
  1264. func (s *MatterPermission) MarshalJSON() ([]byte, error) {
  1265. type NoMethod MatterPermission
  1266. raw := NoMethod(*s)
  1267. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1268. }
  1269. // OrgUnitInfo: Org Unit to search
  1270. type OrgUnitInfo struct {
  1271. // OrgUnitId: Org unit to search, as provided by the
  1272. // <a href="https://developers.google.com/admin-sdk/directory/">Admin
  1273. // SDK Directory API</a>.
  1274. OrgUnitId string `json:"orgUnitId,omitempty"`
  1275. // ForceSendFields is a list of field names (e.g. "OrgUnitId") to
  1276. // unconditionally include in API requests. By default, fields with
  1277. // empty values are omitted from API requests. However, any non-pointer,
  1278. // non-interface field appearing in ForceSendFields will be sent to the
  1279. // server regardless of whether the field is empty or not. This may be
  1280. // used to include empty fields in Patch requests.
  1281. ForceSendFields []string `json:"-"`
  1282. // NullFields is a list of field names (e.g. "OrgUnitId") to include in
  1283. // API requests with the JSON null value. By default, fields with empty
  1284. // values are omitted from API requests. However, any field with an
  1285. // empty value appearing in NullFields will be sent to the server as
  1286. // null. It is an error if a field in this list has a non-empty value.
  1287. // This may be used to include null fields in Patch requests.
  1288. NullFields []string `json:"-"`
  1289. }
  1290. func (s *OrgUnitInfo) MarshalJSON() ([]byte, error) {
  1291. type NoMethod OrgUnitInfo
  1292. raw := NoMethod(*s)
  1293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1294. }
  1295. // Query: A query definition relevant for search & export.
  1296. type Query struct {
  1297. // AccountInfo: When 'ACCOUNT' is chosen as search method,
  1298. // account_info needs to be specified.
  1299. AccountInfo *AccountInfo `json:"accountInfo,omitempty"`
  1300. // Corpus: The corpus to search.
  1301. //
  1302. // Possible values:
  1303. // "CORPUS_TYPE_UNSPECIFIED" - No corpus specified.
  1304. // "DRIVE" - Drive.
  1305. // "MAIL" - Mail.
  1306. // "GROUPS" - Groups.
  1307. // "HANGOUTS_CHAT" - Hangouts Chat.
  1308. Corpus string `json:"corpus,omitempty"`
  1309. // DataScope: The data source to search from.
  1310. //
  1311. // Possible values:
  1312. // "DATA_SCOPE_UNSPECIFIED" - No data scope specified.
  1313. // "ALL_DATA" - All available data.
  1314. // "HELD_DATA" - Data on hold.
  1315. // "UNPROCESSED_DATA" - Data not processed.
  1316. DataScope string `json:"dataScope,omitempty"`
  1317. // DriveOptions: For Drive search, specify more options in this field.
  1318. DriveOptions *DriveOptions `json:"driveOptions,omitempty"`
  1319. // EndTime: The end time range for the search query. These timestamps
  1320. // are in GMT and
  1321. // rounded down to the start of the given date.
  1322. EndTime string `json:"endTime,omitempty"`
  1323. // HangoutsChatInfo: When 'ROOM' is chosen as search method,
  1324. // hangout_chats_info needs to be
  1325. // specified. (read-only)
  1326. HangoutsChatInfo *HangoutsChatInfo `json:"hangoutsChatInfo,omitempty"`
  1327. // HangoutsChatOptions: For hangouts chat search, specify more options
  1328. // in this field. (read-only)
  1329. HangoutsChatOptions *HangoutsChatOptions `json:"hangoutsChatOptions,omitempty"`
  1330. // MailOptions: For mail search, specify more options in this field.
  1331. MailOptions *MailOptions `json:"mailOptions,omitempty"`
  1332. // OrgUnitInfo: When 'ORG_UNIT' is chosen as as search method,
  1333. // org_unit_info needs
  1334. // to be specified.
  1335. OrgUnitInfo *OrgUnitInfo `json:"orgUnitInfo,omitempty"`
  1336. // SearchMethod: The search method to use.
  1337. //
  1338. // Possible values:
  1339. // "SEARCH_METHOD_UNSPECIFIED" - A search method must be specified. If
  1340. // a request does not specify a
  1341. // search method, it will be rejected.
  1342. // "ACCOUNT" - Will search all accounts provided in account_info.
  1343. // "ORG_UNIT" - Will search all accounts in the OU specified in
  1344. // org_unit_info.
  1345. // "TEAM_DRIVE" - Will search for all accounts in the Team Drive
  1346. // specified in
  1347. // team_drive_info.
  1348. // "ENTIRE_ORG" - Will search for all accounts in the organization.
  1349. // No need to set account_info or org_unit_info.
  1350. // "ROOM" - Will search in the Room specified in
  1351. // hangout_chats_info. (read-only)
  1352. SearchMethod string `json:"searchMethod,omitempty"`
  1353. // StartTime: The start time range for the search query. These
  1354. // timestamps are in GMT and
  1355. // rounded down to the start of the given date.
  1356. StartTime string `json:"startTime,omitempty"`
  1357. // TeamDriveInfo: When 'TEAM_DRIVE' is chosen as search method,
  1358. // team_drive_info needs to be
  1359. // specified.
  1360. TeamDriveInfo *TeamDriveInfo `json:"teamDriveInfo,omitempty"`
  1361. // Terms: The corpus-specific
  1362. // <a href="https://support.google.com/vault/answer/2474474">search
  1363. // operators</a>
  1364. // used to generate search results.
  1365. Terms string `json:"terms,omitempty"`
  1366. // TimeZone: The time zone name.
  1367. // It should be an IANA TZ name, such as "America/Los_Angeles".
  1368. // For more information, see
  1369. // <a
  1370. // href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">Ti
  1371. // me
  1372. // Zone</a>.
  1373. TimeZone string `json:"timeZone,omitempty"`
  1374. // ForceSendFields is a list of field names (e.g. "AccountInfo") to
  1375. // unconditionally include in API requests. By default, fields with
  1376. // empty values are omitted from API requests. However, any non-pointer,
  1377. // non-interface field appearing in ForceSendFields will be sent to the
  1378. // server regardless of whether the field is empty or not. This may be
  1379. // used to include empty fields in Patch requests.
  1380. ForceSendFields []string `json:"-"`
  1381. // NullFields is a list of field names (e.g. "AccountInfo") to include
  1382. // in API requests with the JSON null value. By default, fields with
  1383. // empty values are omitted from API requests. However, any field with
  1384. // an empty value appearing in NullFields will be sent to the server as
  1385. // null. It is an error if a field in this list has a non-empty value.
  1386. // This may be used to include null fields in Patch requests.
  1387. NullFields []string `json:"-"`
  1388. }
  1389. func (s *Query) MarshalJSON() ([]byte, error) {
  1390. type NoMethod Query
  1391. raw := NoMethod(*s)
  1392. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1393. }
  1394. // RemoveHeldAccountsRequest: Remove a list of accounts from a hold.
  1395. type RemoveHeldAccountsRequest struct {
  1396. // AccountIds: Account ids to identify HeldAccounts to remove.
  1397. AccountIds []string `json:"accountIds,omitempty"`
  1398. // ForceSendFields is a list of field names (e.g. "AccountIds") to
  1399. // unconditionally include in API requests. By default, fields with
  1400. // empty values are omitted from API requests. However, any non-pointer,
  1401. // non-interface field appearing in ForceSendFields will be sent to the
  1402. // server regardless of whether the field is empty or not. This may be
  1403. // used to include empty fields in Patch requests.
  1404. ForceSendFields []string `json:"-"`
  1405. // NullFields is a list of field names (e.g. "AccountIds") to include in
  1406. // API requests with the JSON null value. By default, fields with empty
  1407. // values are omitted from API requests. However, any field with an
  1408. // empty value appearing in NullFields will be sent to the server as
  1409. // null. It is an error if a field in this list has a non-empty value.
  1410. // This may be used to include null fields in Patch requests.
  1411. NullFields []string `json:"-"`
  1412. }
  1413. func (s *RemoveHeldAccountsRequest) MarshalJSON() ([]byte, error) {
  1414. type NoMethod RemoveHeldAccountsRequest
  1415. raw := NoMethod(*s)
  1416. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1417. }
  1418. // RemoveHeldAccountsResponse: Response for batch delete held accounts.
  1419. type RemoveHeldAccountsResponse struct {
  1420. // Statuses: A list of statuses for deleted accounts. Results have
  1421. // the
  1422. // same order as the request.
  1423. Statuses []*Status `json:"statuses,omitempty"`
  1424. // ServerResponse contains the HTTP response code and headers from the
  1425. // server.
  1426. googleapi.ServerResponse `json:"-"`
  1427. // ForceSendFields is a list of field names (e.g. "Statuses") to
  1428. // unconditionally include in API requests. By default, fields with
  1429. // empty values are omitted from API requests. However, any non-pointer,
  1430. // non-interface field appearing in ForceSendFields will be sent to the
  1431. // server regardless of whether the field is empty or not. This may be
  1432. // used to include empty fields in Patch requests.
  1433. ForceSendFields []string `json:"-"`
  1434. // NullFields is a list of field names (e.g. "Statuses") to include in
  1435. // API requests with the JSON null value. By default, fields with empty
  1436. // values are omitted from API requests. However, any field with an
  1437. // empty value appearing in NullFields will be sent to the server as
  1438. // null. It is an error if a field in this list has a non-empty value.
  1439. // This may be used to include null fields in Patch requests.
  1440. NullFields []string `json:"-"`
  1441. }
  1442. func (s *RemoveHeldAccountsResponse) MarshalJSON() ([]byte, error) {
  1443. type NoMethod RemoveHeldAccountsResponse
  1444. raw := NoMethod(*s)
  1445. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1446. }
  1447. // RemoveMatterPermissionsRequest: Remove an account as a matter
  1448. // collaborator.
  1449. type RemoveMatterPermissionsRequest struct {
  1450. // AccountId: The account ID.
  1451. AccountId string `json:"accountId,omitempty"`
  1452. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1453. // unconditionally include in API requests. By default, fields with
  1454. // empty values are omitted from API requests. However, any non-pointer,
  1455. // non-interface field appearing in ForceSendFields will be sent to the
  1456. // server regardless of whether the field is empty or not. This may be
  1457. // used to include empty fields in Patch requests.
  1458. ForceSendFields []string `json:"-"`
  1459. // NullFields is a list of field names (e.g. "AccountId") to include in
  1460. // API requests with the JSON null value. By default, fields with empty
  1461. // values are omitted from API requests. However, any field with an
  1462. // empty value appearing in NullFields will be sent to the server as
  1463. // null. It is an error if a field in this list has a non-empty value.
  1464. // This may be used to include null fields in Patch requests.
  1465. NullFields []string `json:"-"`
  1466. }
  1467. func (s *RemoveMatterPermissionsRequest) MarshalJSON() ([]byte, error) {
  1468. type NoMethod RemoveMatterPermissionsRequest
  1469. raw := NoMethod(*s)
  1470. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1471. }
  1472. // ReopenMatterRequest: Reopen a matter by ID.
  1473. type ReopenMatterRequest struct {
  1474. }
  1475. // ReopenMatterResponse: Response to a ReopenMatterRequest.
  1476. type ReopenMatterResponse struct {
  1477. // Matter: The updated matter, with state OPEN.
  1478. Matter *Matter `json:"matter,omitempty"`
  1479. // ServerResponse contains the HTTP response code and headers from the
  1480. // server.
  1481. googleapi.ServerResponse `json:"-"`
  1482. // ForceSendFields is a list of field names (e.g. "Matter") to
  1483. // unconditionally include in API requests. By default, fields with
  1484. // empty values are omitted from API requests. However, any non-pointer,
  1485. // non-interface field appearing in ForceSendFields will be sent to the
  1486. // server regardless of whether the field is empty or not. This may be
  1487. // used to include empty fields in Patch requests.
  1488. ForceSendFields []string `json:"-"`
  1489. // NullFields is a list of field names (e.g. "Matter") to include in API
  1490. // requests with the JSON null value. By default, fields with empty
  1491. // values are omitted from API requests. However, any field with an
  1492. // empty value appearing in NullFields will be sent to the server as
  1493. // null. It is an error if a field in this list has a non-empty value.
  1494. // This may be used to include null fields in Patch requests.
  1495. NullFields []string `json:"-"`
  1496. }
  1497. func (s *ReopenMatterResponse) MarshalJSON() ([]byte, error) {
  1498. type NoMethod ReopenMatterResponse
  1499. raw := NoMethod(*s)
  1500. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1501. }
  1502. // SavedQuery: Definition of the saved query.
  1503. type SavedQuery struct {
  1504. // CreateTime: Output only. The server generated timestamp at which
  1505. // saved query was
  1506. // created.
  1507. CreateTime string `json:"createTime,omitempty"`
  1508. // DisplayName: Name of the saved query.
  1509. DisplayName string `json:"displayName,omitempty"`
  1510. // MatterId: Output only. The matter id of the associated matter.
  1511. // The server does not look at this field during create and always uses
  1512. // matter
  1513. // id in the URL.
  1514. MatterId string `json:"matterId,omitempty"`
  1515. // Query: The underlying Query object which contains all the information
  1516. // of the saved
  1517. // query.
  1518. Query *Query `json:"query,omitempty"`
  1519. // SavedQueryId: A unique identifier for the saved query.
  1520. SavedQueryId string `json:"savedQueryId,omitempty"`
  1521. // ServerResponse contains the HTTP response code and headers from the
  1522. // server.
  1523. googleapi.ServerResponse `json:"-"`
  1524. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  1525. // unconditionally include in API requests. By default, fields with
  1526. // empty values are omitted from API requests. However, any non-pointer,
  1527. // non-interface field appearing in ForceSendFields will be sent to the
  1528. // server regardless of whether the field is empty or not. This may be
  1529. // used to include empty fields in Patch requests.
  1530. ForceSendFields []string `json:"-"`
  1531. // NullFields is a list of field names (e.g. "CreateTime") to include in
  1532. // API requests with the JSON null value. By default, fields with empty
  1533. // values are omitted from API requests. However, any field with an
  1534. // empty value appearing in NullFields will be sent to the server as
  1535. // null. It is an error if a field in this list has a non-empty value.
  1536. // This may be used to include null fields in Patch requests.
  1537. NullFields []string `json:"-"`
  1538. }
  1539. func (s *SavedQuery) MarshalJSON() ([]byte, error) {
  1540. type NoMethod SavedQuery
  1541. raw := NoMethod(*s)
  1542. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1543. }
  1544. // Status: The `Status` type defines a logical error model that is
  1545. // suitable for different
  1546. // programming environments, including REST APIs and RPC APIs. It is
  1547. // used by
  1548. // [gRPC](https://github.com/grpc). The error model is designed to
  1549. // be:
  1550. //
  1551. // - Simple to use and understand for most users
  1552. // - Flexible enough to meet unexpected needs
  1553. //
  1554. // # Overview
  1555. //
  1556. // The `Status` message contains three pieces of data: error code, error
  1557. // message,
  1558. // and error details. The error code should be an enum value
  1559. // of
  1560. // google.rpc.Code, but it may accept additional error codes if needed.
  1561. // The
  1562. // error message should be a developer-facing English message that
  1563. // helps
  1564. // developers *understand* and *resolve* the error. If a localized
  1565. // user-facing
  1566. // error message is needed, put the localized message in the error
  1567. // details or
  1568. // localize it in the client. The optional error details may contain
  1569. // arbitrary
  1570. // information about the error. There is a predefined set of error
  1571. // detail types
  1572. // in the package `google.rpc` that can be used for common error
  1573. // conditions.
  1574. //
  1575. // # Language mapping
  1576. //
  1577. // The `Status` message is the logical representation of the error
  1578. // model, but it
  1579. // is not necessarily the actual wire format. When the `Status` message
  1580. // is
  1581. // exposed in different client libraries and different wire protocols,
  1582. // it can be
  1583. // mapped differently. For example, it will likely be mapped to some
  1584. // exceptions
  1585. // in Java, but more likely mapped to some error codes in C.
  1586. //
  1587. // # Other uses
  1588. //
  1589. // The error model and the `Status` message can be used in a variety
  1590. // of
  1591. // environments, either with or without APIs, to provide a
  1592. // consistent developer experience across different
  1593. // environments.
  1594. //
  1595. // Example uses of this error model include:
  1596. //
  1597. // - Partial errors. If a service needs to return partial errors to the
  1598. // client,
  1599. // it may embed the `Status` in the normal response to indicate the
  1600. // partial
  1601. // errors.
  1602. //
  1603. // - Workflow errors. A typical workflow has multiple steps. Each step
  1604. // may
  1605. // have a `Status` message for error reporting.
  1606. //
  1607. // - Batch operations. If a client uses batch request and batch
  1608. // response, the
  1609. // `Status` message should be used directly inside batch response,
  1610. // one for
  1611. // each error sub-response.
  1612. //
  1613. // - Asynchronous operations. If an API call embeds asynchronous
  1614. // operation
  1615. // results in its response, the status of those operations should
  1616. // be
  1617. // represented directly using the `Status` message.
  1618. //
  1619. // - Logging. If some API errors are stored in logs, the message
  1620. // `Status` could
  1621. // be used directly after any stripping needed for security/privacy
  1622. // reasons.
  1623. type Status struct {
  1624. // Code: The status code, which should be an enum value of
  1625. // google.rpc.Code.
  1626. Code int64 `json:"code,omitempty"`
  1627. // Details: A list of messages that carry the error details. There is a
  1628. // common set of
  1629. // message types for APIs to use.
  1630. Details []googleapi.RawMessage `json:"details,omitempty"`
  1631. // Message: A developer-facing error message, which should be in
  1632. // English. Any
  1633. // user-facing error message should be localized and sent in
  1634. // the
  1635. // google.rpc.Status.details field, or localized by the client.
  1636. Message string `json:"message,omitempty"`
  1637. // ForceSendFields is a list of field names (e.g. "Code") to
  1638. // unconditionally include in API requests. By default, fields with
  1639. // empty values are omitted from API requests. However, any non-pointer,
  1640. // non-interface field appearing in ForceSendFields will be sent to the
  1641. // server regardless of whether the field is empty or not. This may be
  1642. // used to include empty fields in Patch requests.
  1643. ForceSendFields []string `json:"-"`
  1644. // NullFields is a list of field names (e.g. "Code") to include in API
  1645. // requests with the JSON null value. By default, fields with empty
  1646. // values are omitted from API requests. However, any field with an
  1647. // empty value appearing in NullFields will be sent to the server as
  1648. // null. It is an error if a field in this list has a non-empty value.
  1649. // This may be used to include null fields in Patch requests.
  1650. NullFields []string `json:"-"`
  1651. }
  1652. func (s *Status) MarshalJSON() ([]byte, error) {
  1653. type NoMethod Status
  1654. raw := NoMethod(*s)
  1655. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1656. }
  1657. // TeamDriveInfo: Team Drives to search
  1658. type TeamDriveInfo struct {
  1659. // TeamDriveIds: List of Team Drive ids, as provided by
  1660. // <a
  1661. // href="https://developers.google.com/drive">Drive API</a>.
  1662. TeamDriveIds []string `json:"teamDriveIds,omitempty"`
  1663. // ForceSendFields is a list of field names (e.g. "TeamDriveIds") to
  1664. // unconditionally include in API requests. By default, fields with
  1665. // empty values are omitted from API requests. However, any non-pointer,
  1666. // non-interface field appearing in ForceSendFields will be sent to the
  1667. // server regardless of whether the field is empty or not. This may be
  1668. // used to include empty fields in Patch requests.
  1669. ForceSendFields []string `json:"-"`
  1670. // NullFields is a list of field names (e.g. "TeamDriveIds") to include
  1671. // in API requests with the JSON null value. By default, fields with
  1672. // empty values are omitted from API requests. However, any field with
  1673. // an empty value appearing in NullFields will be sent to the server as
  1674. // null. It is an error if a field in this list has a non-empty value.
  1675. // This may be used to include null fields in Patch requests.
  1676. NullFields []string `json:"-"`
  1677. }
  1678. func (s *TeamDriveInfo) MarshalJSON() ([]byte, error) {
  1679. type NoMethod TeamDriveInfo
  1680. raw := NoMethod(*s)
  1681. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1682. }
  1683. // UndeleteMatterRequest: Undelete a matter by ID.
  1684. type UndeleteMatterRequest struct {
  1685. }
  1686. // UserInfo: User's information.
  1687. type UserInfo struct {
  1688. // DisplayName: The displayed name of the user.
  1689. DisplayName string `json:"displayName,omitempty"`
  1690. // Email: The email address of the user.
  1691. Email string `json:"email,omitempty"`
  1692. // ForceSendFields is a list of field names (e.g. "DisplayName") to
  1693. // unconditionally include in API requests. By default, fields with
  1694. // empty values are omitted from API requests. However, any non-pointer,
  1695. // non-interface field appearing in ForceSendFields will be sent to the
  1696. // server regardless of whether the field is empty or not. This may be
  1697. // used to include empty fields in Patch requests.
  1698. ForceSendFields []string `json:"-"`
  1699. // NullFields is a list of field names (e.g. "DisplayName") to include
  1700. // in API requests with the JSON null value. By default, fields with
  1701. // empty values are omitted from API requests. However, any field with
  1702. // an empty value appearing in NullFields will be sent to the server as
  1703. // null. It is an error if a field in this list has a non-empty value.
  1704. // This may be used to include null fields in Patch requests.
  1705. NullFields []string `json:"-"`
  1706. }
  1707. func (s *UserInfo) MarshalJSON() ([]byte, error) {
  1708. type NoMethod UserInfo
  1709. raw := NoMethod(*s)
  1710. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1711. }
  1712. // method id "vault.matters.addPermissions":
  1713. type MattersAddPermissionsCall struct {
  1714. s *Service
  1715. matterId string
  1716. addmatterpermissionsrequest *AddMatterPermissionsRequest
  1717. urlParams_ gensupport.URLParams
  1718. ctx_ context.Context
  1719. header_ http.Header
  1720. }
  1721. // AddPermissions: Adds an account as a matter collaborator.
  1722. func (r *MattersService) AddPermissions(matterId string, addmatterpermissionsrequest *AddMatterPermissionsRequest) *MattersAddPermissionsCall {
  1723. c := &MattersAddPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1724. c.matterId = matterId
  1725. c.addmatterpermissionsrequest = addmatterpermissionsrequest
  1726. return c
  1727. }
  1728. // Fields allows partial responses to be retrieved. See
  1729. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1730. // for more information.
  1731. func (c *MattersAddPermissionsCall) Fields(s ...googleapi.Field) *MattersAddPermissionsCall {
  1732. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1733. return c
  1734. }
  1735. // Context sets the context to be used in this call's Do method. Any
  1736. // pending HTTP request will be aborted if the provided context is
  1737. // canceled.
  1738. func (c *MattersAddPermissionsCall) Context(ctx context.Context) *MattersAddPermissionsCall {
  1739. c.ctx_ = ctx
  1740. return c
  1741. }
  1742. // Header returns an http.Header that can be modified by the caller to
  1743. // add HTTP headers to the request.
  1744. func (c *MattersAddPermissionsCall) Header() http.Header {
  1745. if c.header_ == nil {
  1746. c.header_ = make(http.Header)
  1747. }
  1748. return c.header_
  1749. }
  1750. func (c *MattersAddPermissionsCall) doRequest(alt string) (*http.Response, error) {
  1751. reqHeaders := make(http.Header)
  1752. for k, v := range c.header_ {
  1753. reqHeaders[k] = v
  1754. }
  1755. reqHeaders.Set("User-Agent", c.s.userAgent())
  1756. var body io.Reader = nil
  1757. body, err := googleapi.WithoutDataWrapper.JSONReader(c.addmatterpermissionsrequest)
  1758. if err != nil {
  1759. return nil, err
  1760. }
  1761. reqHeaders.Set("Content-Type", "application/json")
  1762. c.urlParams_.Set("alt", alt)
  1763. c.urlParams_.Set("prettyPrint", "false")
  1764. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}:addPermissions")
  1765. urls += "?" + c.urlParams_.Encode()
  1766. req, err := http.NewRequest("POST", urls, body)
  1767. if err != nil {
  1768. return nil, err
  1769. }
  1770. req.Header = reqHeaders
  1771. googleapi.Expand(req.URL, map[string]string{
  1772. "matterId": c.matterId,
  1773. })
  1774. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1775. }
  1776. // Do executes the "vault.matters.addPermissions" call.
  1777. // Exactly one of *MatterPermission or error will be non-nil. Any
  1778. // non-2xx status code is an error. Response headers are in either
  1779. // *MatterPermission.ServerResponse.Header or (if a response was
  1780. // returned at all) in error.(*googleapi.Error).Header. Use
  1781. // googleapi.IsNotModified to check whether the returned error was
  1782. // because http.StatusNotModified was returned.
  1783. func (c *MattersAddPermissionsCall) Do(opts ...googleapi.CallOption) (*MatterPermission, error) {
  1784. gensupport.SetOptions(c.urlParams_, opts...)
  1785. res, err := c.doRequest("json")
  1786. if res != nil && res.StatusCode == http.StatusNotModified {
  1787. if res.Body != nil {
  1788. res.Body.Close()
  1789. }
  1790. return nil, &googleapi.Error{
  1791. Code: res.StatusCode,
  1792. Header: res.Header,
  1793. }
  1794. }
  1795. if err != nil {
  1796. return nil, err
  1797. }
  1798. defer googleapi.CloseBody(res)
  1799. if err := googleapi.CheckResponse(res); err != nil {
  1800. return nil, err
  1801. }
  1802. ret := &MatterPermission{
  1803. ServerResponse: googleapi.ServerResponse{
  1804. Header: res.Header,
  1805. HTTPStatusCode: res.StatusCode,
  1806. },
  1807. }
  1808. target := &ret
  1809. if err := gensupport.DecodeResponse(target, res); err != nil {
  1810. return nil, err
  1811. }
  1812. return ret, nil
  1813. // {
  1814. // "description": "Adds an account as a matter collaborator.",
  1815. // "flatPath": "v1/matters/{matterId}:addPermissions",
  1816. // "httpMethod": "POST",
  1817. // "id": "vault.matters.addPermissions",
  1818. // "parameterOrder": [
  1819. // "matterId"
  1820. // ],
  1821. // "parameters": {
  1822. // "matterId": {
  1823. // "description": "The matter ID.",
  1824. // "location": "path",
  1825. // "required": true,
  1826. // "type": "string"
  1827. // }
  1828. // },
  1829. // "path": "v1/matters/{matterId}:addPermissions",
  1830. // "request": {
  1831. // "$ref": "AddMatterPermissionsRequest"
  1832. // },
  1833. // "response": {
  1834. // "$ref": "MatterPermission"
  1835. // },
  1836. // "scopes": [
  1837. // "https://www.googleapis.com/auth/ediscovery"
  1838. // ]
  1839. // }
  1840. }
  1841. // method id "vault.matters.close":
  1842. type MattersCloseCall struct {
  1843. s *Service
  1844. matterId string
  1845. closematterrequest *CloseMatterRequest
  1846. urlParams_ gensupport.URLParams
  1847. ctx_ context.Context
  1848. header_ http.Header
  1849. }
  1850. // Close: Closes the specified matter. Returns matter with updated
  1851. // state.
  1852. func (r *MattersService) Close(matterId string, closematterrequest *CloseMatterRequest) *MattersCloseCall {
  1853. c := &MattersCloseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1854. c.matterId = matterId
  1855. c.closematterrequest = closematterrequest
  1856. return c
  1857. }
  1858. // Fields allows partial responses to be retrieved. See
  1859. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1860. // for more information.
  1861. func (c *MattersCloseCall) Fields(s ...googleapi.Field) *MattersCloseCall {
  1862. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1863. return c
  1864. }
  1865. // Context sets the context to be used in this call's Do method. Any
  1866. // pending HTTP request will be aborted if the provided context is
  1867. // canceled.
  1868. func (c *MattersCloseCall) Context(ctx context.Context) *MattersCloseCall {
  1869. c.ctx_ = ctx
  1870. return c
  1871. }
  1872. // Header returns an http.Header that can be modified by the caller to
  1873. // add HTTP headers to the request.
  1874. func (c *MattersCloseCall) Header() http.Header {
  1875. if c.header_ == nil {
  1876. c.header_ = make(http.Header)
  1877. }
  1878. return c.header_
  1879. }
  1880. func (c *MattersCloseCall) doRequest(alt string) (*http.Response, error) {
  1881. reqHeaders := make(http.Header)
  1882. for k, v := range c.header_ {
  1883. reqHeaders[k] = v
  1884. }
  1885. reqHeaders.Set("User-Agent", c.s.userAgent())
  1886. var body io.Reader = nil
  1887. body, err := googleapi.WithoutDataWrapper.JSONReader(c.closematterrequest)
  1888. if err != nil {
  1889. return nil, err
  1890. }
  1891. reqHeaders.Set("Content-Type", "application/json")
  1892. c.urlParams_.Set("alt", alt)
  1893. c.urlParams_.Set("prettyPrint", "false")
  1894. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}:close")
  1895. urls += "?" + c.urlParams_.Encode()
  1896. req, err := http.NewRequest("POST", urls, body)
  1897. if err != nil {
  1898. return nil, err
  1899. }
  1900. req.Header = reqHeaders
  1901. googleapi.Expand(req.URL, map[string]string{
  1902. "matterId": c.matterId,
  1903. })
  1904. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1905. }
  1906. // Do executes the "vault.matters.close" call.
  1907. // Exactly one of *CloseMatterResponse or error will be non-nil. Any
  1908. // non-2xx status code is an error. Response headers are in either
  1909. // *CloseMatterResponse.ServerResponse.Header or (if a response was
  1910. // returned at all) in error.(*googleapi.Error).Header. Use
  1911. // googleapi.IsNotModified to check whether the returned error was
  1912. // because http.StatusNotModified was returned.
  1913. func (c *MattersCloseCall) Do(opts ...googleapi.CallOption) (*CloseMatterResponse, error) {
  1914. gensupport.SetOptions(c.urlParams_, opts...)
  1915. res, err := c.doRequest("json")
  1916. if res != nil && res.StatusCode == http.StatusNotModified {
  1917. if res.Body != nil {
  1918. res.Body.Close()
  1919. }
  1920. return nil, &googleapi.Error{
  1921. Code: res.StatusCode,
  1922. Header: res.Header,
  1923. }
  1924. }
  1925. if err != nil {
  1926. return nil, err
  1927. }
  1928. defer googleapi.CloseBody(res)
  1929. if err := googleapi.CheckResponse(res); err != nil {
  1930. return nil, err
  1931. }
  1932. ret := &CloseMatterResponse{
  1933. ServerResponse: googleapi.ServerResponse{
  1934. Header: res.Header,
  1935. HTTPStatusCode: res.StatusCode,
  1936. },
  1937. }
  1938. target := &ret
  1939. if err := gensupport.DecodeResponse(target, res); err != nil {
  1940. return nil, err
  1941. }
  1942. return ret, nil
  1943. // {
  1944. // "description": "Closes the specified matter. Returns matter with updated state.",
  1945. // "flatPath": "v1/matters/{matterId}:close",
  1946. // "httpMethod": "POST",
  1947. // "id": "vault.matters.close",
  1948. // "parameterOrder": [
  1949. // "matterId"
  1950. // ],
  1951. // "parameters": {
  1952. // "matterId": {
  1953. // "description": "The matter ID.",
  1954. // "location": "path",
  1955. // "required": true,
  1956. // "type": "string"
  1957. // }
  1958. // },
  1959. // "path": "v1/matters/{matterId}:close",
  1960. // "request": {
  1961. // "$ref": "CloseMatterRequest"
  1962. // },
  1963. // "response": {
  1964. // "$ref": "CloseMatterResponse"
  1965. // },
  1966. // "scopes": [
  1967. // "https://www.googleapis.com/auth/ediscovery"
  1968. // ]
  1969. // }
  1970. }
  1971. // method id "vault.matters.create":
  1972. type MattersCreateCall struct {
  1973. s *Service
  1974. matter *Matter
  1975. urlParams_ gensupport.URLParams
  1976. ctx_ context.Context
  1977. header_ http.Header
  1978. }
  1979. // Create: Creates a new matter with the given name and description. The
  1980. // initial state
  1981. // is open, and the owner is the method caller. Returns the created
  1982. // matter
  1983. // with default view.
  1984. func (r *MattersService) Create(matter *Matter) *MattersCreateCall {
  1985. c := &MattersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1986. c.matter = matter
  1987. return c
  1988. }
  1989. // Fields allows partial responses to be retrieved. See
  1990. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1991. // for more information.
  1992. func (c *MattersCreateCall) Fields(s ...googleapi.Field) *MattersCreateCall {
  1993. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1994. return c
  1995. }
  1996. // Context sets the context to be used in this call's Do method. Any
  1997. // pending HTTP request will be aborted if the provided context is
  1998. // canceled.
  1999. func (c *MattersCreateCall) Context(ctx context.Context) *MattersCreateCall {
  2000. c.ctx_ = ctx
  2001. return c
  2002. }
  2003. // Header returns an http.Header that can be modified by the caller to
  2004. // add HTTP headers to the request.
  2005. func (c *MattersCreateCall) Header() http.Header {
  2006. if c.header_ == nil {
  2007. c.header_ = make(http.Header)
  2008. }
  2009. return c.header_
  2010. }
  2011. func (c *MattersCreateCall) doRequest(alt string) (*http.Response, error) {
  2012. reqHeaders := make(http.Header)
  2013. for k, v := range c.header_ {
  2014. reqHeaders[k] = v
  2015. }
  2016. reqHeaders.Set("User-Agent", c.s.userAgent())
  2017. var body io.Reader = nil
  2018. body, err := googleapi.WithoutDataWrapper.JSONReader(c.matter)
  2019. if err != nil {
  2020. return nil, err
  2021. }
  2022. reqHeaders.Set("Content-Type", "application/json")
  2023. c.urlParams_.Set("alt", alt)
  2024. c.urlParams_.Set("prettyPrint", "false")
  2025. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters")
  2026. urls += "?" + c.urlParams_.Encode()
  2027. req, err := http.NewRequest("POST", urls, body)
  2028. if err != nil {
  2029. return nil, err
  2030. }
  2031. req.Header = reqHeaders
  2032. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2033. }
  2034. // Do executes the "vault.matters.create" call.
  2035. // Exactly one of *Matter or error will be non-nil. Any non-2xx status
  2036. // code is an error. Response headers are in either
  2037. // *Matter.ServerResponse.Header or (if a response was returned at all)
  2038. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2039. // check whether the returned error was because http.StatusNotModified
  2040. // was returned.
  2041. func (c *MattersCreateCall) Do(opts ...googleapi.CallOption) (*Matter, error) {
  2042. gensupport.SetOptions(c.urlParams_, opts...)
  2043. res, err := c.doRequest("json")
  2044. if res != nil && res.StatusCode == http.StatusNotModified {
  2045. if res.Body != nil {
  2046. res.Body.Close()
  2047. }
  2048. return nil, &googleapi.Error{
  2049. Code: res.StatusCode,
  2050. Header: res.Header,
  2051. }
  2052. }
  2053. if err != nil {
  2054. return nil, err
  2055. }
  2056. defer googleapi.CloseBody(res)
  2057. if err := googleapi.CheckResponse(res); err != nil {
  2058. return nil, err
  2059. }
  2060. ret := &Matter{
  2061. ServerResponse: googleapi.ServerResponse{
  2062. Header: res.Header,
  2063. HTTPStatusCode: res.StatusCode,
  2064. },
  2065. }
  2066. target := &ret
  2067. if err := gensupport.DecodeResponse(target, res); err != nil {
  2068. return nil, err
  2069. }
  2070. return ret, nil
  2071. // {
  2072. // "description": "Creates a new matter with the given name and description. The initial state\nis open, and the owner is the method caller. Returns the created matter\nwith default view.",
  2073. // "flatPath": "v1/matters",
  2074. // "httpMethod": "POST",
  2075. // "id": "vault.matters.create",
  2076. // "parameterOrder": [],
  2077. // "parameters": {},
  2078. // "path": "v1/matters",
  2079. // "request": {
  2080. // "$ref": "Matter"
  2081. // },
  2082. // "response": {
  2083. // "$ref": "Matter"
  2084. // },
  2085. // "scopes": [
  2086. // "https://www.googleapis.com/auth/ediscovery"
  2087. // ]
  2088. // }
  2089. }
  2090. // method id "vault.matters.delete":
  2091. type MattersDeleteCall struct {
  2092. s *Service
  2093. matterId string
  2094. urlParams_ gensupport.URLParams
  2095. ctx_ context.Context
  2096. header_ http.Header
  2097. }
  2098. // Delete: Deletes the specified matter. Returns matter with updated
  2099. // state.
  2100. func (r *MattersService) Delete(matterId string) *MattersDeleteCall {
  2101. c := &MattersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2102. c.matterId = matterId
  2103. return c
  2104. }
  2105. // Fields allows partial responses to be retrieved. See
  2106. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2107. // for more information.
  2108. func (c *MattersDeleteCall) Fields(s ...googleapi.Field) *MattersDeleteCall {
  2109. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2110. return c
  2111. }
  2112. // Context sets the context to be used in this call's Do method. Any
  2113. // pending HTTP request will be aborted if the provided context is
  2114. // canceled.
  2115. func (c *MattersDeleteCall) Context(ctx context.Context) *MattersDeleteCall {
  2116. c.ctx_ = ctx
  2117. return c
  2118. }
  2119. // Header returns an http.Header that can be modified by the caller to
  2120. // add HTTP headers to the request.
  2121. func (c *MattersDeleteCall) Header() http.Header {
  2122. if c.header_ == nil {
  2123. c.header_ = make(http.Header)
  2124. }
  2125. return c.header_
  2126. }
  2127. func (c *MattersDeleteCall) doRequest(alt string) (*http.Response, error) {
  2128. reqHeaders := make(http.Header)
  2129. for k, v := range c.header_ {
  2130. reqHeaders[k] = v
  2131. }
  2132. reqHeaders.Set("User-Agent", c.s.userAgent())
  2133. var body io.Reader = nil
  2134. c.urlParams_.Set("alt", alt)
  2135. c.urlParams_.Set("prettyPrint", "false")
  2136. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}")
  2137. urls += "?" + c.urlParams_.Encode()
  2138. req, err := http.NewRequest("DELETE", urls, body)
  2139. if err != nil {
  2140. return nil, err
  2141. }
  2142. req.Header = reqHeaders
  2143. googleapi.Expand(req.URL, map[string]string{
  2144. "matterId": c.matterId,
  2145. })
  2146. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2147. }
  2148. // Do executes the "vault.matters.delete" call.
  2149. // Exactly one of *Matter or error will be non-nil. Any non-2xx status
  2150. // code is an error. Response headers are in either
  2151. // *Matter.ServerResponse.Header or (if a response was returned at all)
  2152. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2153. // check whether the returned error was because http.StatusNotModified
  2154. // was returned.
  2155. func (c *MattersDeleteCall) Do(opts ...googleapi.CallOption) (*Matter, error) {
  2156. gensupport.SetOptions(c.urlParams_, opts...)
  2157. res, err := c.doRequest("json")
  2158. if res != nil && res.StatusCode == http.StatusNotModified {
  2159. if res.Body != nil {
  2160. res.Body.Close()
  2161. }
  2162. return nil, &googleapi.Error{
  2163. Code: res.StatusCode,
  2164. Header: res.Header,
  2165. }
  2166. }
  2167. if err != nil {
  2168. return nil, err
  2169. }
  2170. defer googleapi.CloseBody(res)
  2171. if err := googleapi.CheckResponse(res); err != nil {
  2172. return nil, err
  2173. }
  2174. ret := &Matter{
  2175. ServerResponse: googleapi.ServerResponse{
  2176. Header: res.Header,
  2177. HTTPStatusCode: res.StatusCode,
  2178. },
  2179. }
  2180. target := &ret
  2181. if err := gensupport.DecodeResponse(target, res); err != nil {
  2182. return nil, err
  2183. }
  2184. return ret, nil
  2185. // {
  2186. // "description": "Deletes the specified matter. Returns matter with updated state.",
  2187. // "flatPath": "v1/matters/{matterId}",
  2188. // "httpMethod": "DELETE",
  2189. // "id": "vault.matters.delete",
  2190. // "parameterOrder": [
  2191. // "matterId"
  2192. // ],
  2193. // "parameters": {
  2194. // "matterId": {
  2195. // "description": "The matter ID",
  2196. // "location": "path",
  2197. // "required": true,
  2198. // "type": "string"
  2199. // }
  2200. // },
  2201. // "path": "v1/matters/{matterId}",
  2202. // "response": {
  2203. // "$ref": "Matter"
  2204. // },
  2205. // "scopes": [
  2206. // "https://www.googleapis.com/auth/ediscovery"
  2207. // ]
  2208. // }
  2209. }
  2210. // method id "vault.matters.get":
  2211. type MattersGetCall struct {
  2212. s *Service
  2213. matterId string
  2214. urlParams_ gensupport.URLParams
  2215. ifNoneMatch_ string
  2216. ctx_ context.Context
  2217. header_ http.Header
  2218. }
  2219. // Get: Gets the specified matter.
  2220. func (r *MattersService) Get(matterId string) *MattersGetCall {
  2221. c := &MattersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2222. c.matterId = matterId
  2223. return c
  2224. }
  2225. // View sets the optional parameter "view": Specifies which parts of the
  2226. // Matter to return in the response.
  2227. //
  2228. // Possible values:
  2229. // "VIEW_UNSPECIFIED"
  2230. // "BASIC"
  2231. // "FULL"
  2232. func (c *MattersGetCall) View(view string) *MattersGetCall {
  2233. c.urlParams_.Set("view", view)
  2234. return c
  2235. }
  2236. // Fields allows partial responses to be retrieved. See
  2237. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2238. // for more information.
  2239. func (c *MattersGetCall) Fields(s ...googleapi.Field) *MattersGetCall {
  2240. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2241. return c
  2242. }
  2243. // IfNoneMatch sets the optional parameter which makes the operation
  2244. // fail if the object's ETag matches the given value. This is useful for
  2245. // getting updates only after the object has changed since the last
  2246. // request. Use googleapi.IsNotModified to check whether the response
  2247. // error from Do is the result of In-None-Match.
  2248. func (c *MattersGetCall) IfNoneMatch(entityTag string) *MattersGetCall {
  2249. c.ifNoneMatch_ = entityTag
  2250. return c
  2251. }
  2252. // Context sets the context to be used in this call's Do method. Any
  2253. // pending HTTP request will be aborted if the provided context is
  2254. // canceled.
  2255. func (c *MattersGetCall) Context(ctx context.Context) *MattersGetCall {
  2256. c.ctx_ = ctx
  2257. return c
  2258. }
  2259. // Header returns an http.Header that can be modified by the caller to
  2260. // add HTTP headers to the request.
  2261. func (c *MattersGetCall) Header() http.Header {
  2262. if c.header_ == nil {
  2263. c.header_ = make(http.Header)
  2264. }
  2265. return c.header_
  2266. }
  2267. func (c *MattersGetCall) doRequest(alt string) (*http.Response, error) {
  2268. reqHeaders := make(http.Header)
  2269. for k, v := range c.header_ {
  2270. reqHeaders[k] = v
  2271. }
  2272. reqHeaders.Set("User-Agent", c.s.userAgent())
  2273. if c.ifNoneMatch_ != "" {
  2274. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2275. }
  2276. var body io.Reader = nil
  2277. c.urlParams_.Set("alt", alt)
  2278. c.urlParams_.Set("prettyPrint", "false")
  2279. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}")
  2280. urls += "?" + c.urlParams_.Encode()
  2281. req, err := http.NewRequest("GET", urls, body)
  2282. if err != nil {
  2283. return nil, err
  2284. }
  2285. req.Header = reqHeaders
  2286. googleapi.Expand(req.URL, map[string]string{
  2287. "matterId": c.matterId,
  2288. })
  2289. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2290. }
  2291. // Do executes the "vault.matters.get" call.
  2292. // Exactly one of *Matter or error will be non-nil. Any non-2xx status
  2293. // code is an error. Response headers are in either
  2294. // *Matter.ServerResponse.Header or (if a response was returned at all)
  2295. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2296. // check whether the returned error was because http.StatusNotModified
  2297. // was returned.
  2298. func (c *MattersGetCall) Do(opts ...googleapi.CallOption) (*Matter, error) {
  2299. gensupport.SetOptions(c.urlParams_, opts...)
  2300. res, err := c.doRequest("json")
  2301. if res != nil && res.StatusCode == http.StatusNotModified {
  2302. if res.Body != nil {
  2303. res.Body.Close()
  2304. }
  2305. return nil, &googleapi.Error{
  2306. Code: res.StatusCode,
  2307. Header: res.Header,
  2308. }
  2309. }
  2310. if err != nil {
  2311. return nil, err
  2312. }
  2313. defer googleapi.CloseBody(res)
  2314. if err := googleapi.CheckResponse(res); err != nil {
  2315. return nil, err
  2316. }
  2317. ret := &Matter{
  2318. ServerResponse: googleapi.ServerResponse{
  2319. Header: res.Header,
  2320. HTTPStatusCode: res.StatusCode,
  2321. },
  2322. }
  2323. target := &ret
  2324. if err := gensupport.DecodeResponse(target, res); err != nil {
  2325. return nil, err
  2326. }
  2327. return ret, nil
  2328. // {
  2329. // "description": "Gets the specified matter.",
  2330. // "flatPath": "v1/matters/{matterId}",
  2331. // "httpMethod": "GET",
  2332. // "id": "vault.matters.get",
  2333. // "parameterOrder": [
  2334. // "matterId"
  2335. // ],
  2336. // "parameters": {
  2337. // "matterId": {
  2338. // "description": "The matter ID.",
  2339. // "location": "path",
  2340. // "required": true,
  2341. // "type": "string"
  2342. // },
  2343. // "view": {
  2344. // "description": "Specifies which parts of the Matter to return in the response.",
  2345. // "enum": [
  2346. // "VIEW_UNSPECIFIED",
  2347. // "BASIC",
  2348. // "FULL"
  2349. // ],
  2350. // "location": "query",
  2351. // "type": "string"
  2352. // }
  2353. // },
  2354. // "path": "v1/matters/{matterId}",
  2355. // "response": {
  2356. // "$ref": "Matter"
  2357. // },
  2358. // "scopes": [
  2359. // "https://www.googleapis.com/auth/ediscovery",
  2360. // "https://www.googleapis.com/auth/ediscovery.readonly"
  2361. // ]
  2362. // }
  2363. }
  2364. // method id "vault.matters.list":
  2365. type MattersListCall struct {
  2366. s *Service
  2367. urlParams_ gensupport.URLParams
  2368. ifNoneMatch_ string
  2369. ctx_ context.Context
  2370. header_ http.Header
  2371. }
  2372. // List: Lists matters the user has access to.
  2373. func (r *MattersService) List() *MattersListCall {
  2374. c := &MattersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2375. return c
  2376. }
  2377. // PageSize sets the optional parameter "pageSize": The number of
  2378. // matters to return in the response.
  2379. // Default and maximum are 100.
  2380. func (c *MattersListCall) PageSize(pageSize int64) *MattersListCall {
  2381. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2382. return c
  2383. }
  2384. // PageToken sets the optional parameter "pageToken": The pagination
  2385. // token as returned in the response.
  2386. func (c *MattersListCall) PageToken(pageToken string) *MattersListCall {
  2387. c.urlParams_.Set("pageToken", pageToken)
  2388. return c
  2389. }
  2390. // State sets the optional parameter "state": If set, list only matters
  2391. // with that specific state. The default is listing
  2392. // matters of all states.
  2393. //
  2394. // Possible values:
  2395. // "STATE_UNSPECIFIED"
  2396. // "OPEN"
  2397. // "CLOSED"
  2398. // "DELETED"
  2399. func (c *MattersListCall) State(state string) *MattersListCall {
  2400. c.urlParams_.Set("state", state)
  2401. return c
  2402. }
  2403. // View sets the optional parameter "view": Specifies which parts of the
  2404. // matter to return in response.
  2405. //
  2406. // Possible values:
  2407. // "VIEW_UNSPECIFIED"
  2408. // "BASIC"
  2409. // "FULL"
  2410. func (c *MattersListCall) View(view string) *MattersListCall {
  2411. c.urlParams_.Set("view", view)
  2412. return c
  2413. }
  2414. // Fields allows partial responses to be retrieved. See
  2415. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2416. // for more information.
  2417. func (c *MattersListCall) Fields(s ...googleapi.Field) *MattersListCall {
  2418. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2419. return c
  2420. }
  2421. // IfNoneMatch sets the optional parameter which makes the operation
  2422. // fail if the object's ETag matches the given value. This is useful for
  2423. // getting updates only after the object has changed since the last
  2424. // request. Use googleapi.IsNotModified to check whether the response
  2425. // error from Do is the result of In-None-Match.
  2426. func (c *MattersListCall) IfNoneMatch(entityTag string) *MattersListCall {
  2427. c.ifNoneMatch_ = entityTag
  2428. return c
  2429. }
  2430. // Context sets the context to be used in this call's Do method. Any
  2431. // pending HTTP request will be aborted if the provided context is
  2432. // canceled.
  2433. func (c *MattersListCall) Context(ctx context.Context) *MattersListCall {
  2434. c.ctx_ = ctx
  2435. return c
  2436. }
  2437. // Header returns an http.Header that can be modified by the caller to
  2438. // add HTTP headers to the request.
  2439. func (c *MattersListCall) Header() http.Header {
  2440. if c.header_ == nil {
  2441. c.header_ = make(http.Header)
  2442. }
  2443. return c.header_
  2444. }
  2445. func (c *MattersListCall) doRequest(alt string) (*http.Response, error) {
  2446. reqHeaders := make(http.Header)
  2447. for k, v := range c.header_ {
  2448. reqHeaders[k] = v
  2449. }
  2450. reqHeaders.Set("User-Agent", c.s.userAgent())
  2451. if c.ifNoneMatch_ != "" {
  2452. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2453. }
  2454. var body io.Reader = nil
  2455. c.urlParams_.Set("alt", alt)
  2456. c.urlParams_.Set("prettyPrint", "false")
  2457. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters")
  2458. urls += "?" + c.urlParams_.Encode()
  2459. req, err := http.NewRequest("GET", urls, body)
  2460. if err != nil {
  2461. return nil, err
  2462. }
  2463. req.Header = reqHeaders
  2464. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2465. }
  2466. // Do executes the "vault.matters.list" call.
  2467. // Exactly one of *ListMattersResponse or error will be non-nil. Any
  2468. // non-2xx status code is an error. Response headers are in either
  2469. // *ListMattersResponse.ServerResponse.Header or (if a response was
  2470. // returned at all) in error.(*googleapi.Error).Header. Use
  2471. // googleapi.IsNotModified to check whether the returned error was
  2472. // because http.StatusNotModified was returned.
  2473. func (c *MattersListCall) Do(opts ...googleapi.CallOption) (*ListMattersResponse, error) {
  2474. gensupport.SetOptions(c.urlParams_, opts...)
  2475. res, err := c.doRequest("json")
  2476. if res != nil && res.StatusCode == http.StatusNotModified {
  2477. if res.Body != nil {
  2478. res.Body.Close()
  2479. }
  2480. return nil, &googleapi.Error{
  2481. Code: res.StatusCode,
  2482. Header: res.Header,
  2483. }
  2484. }
  2485. if err != nil {
  2486. return nil, err
  2487. }
  2488. defer googleapi.CloseBody(res)
  2489. if err := googleapi.CheckResponse(res); err != nil {
  2490. return nil, err
  2491. }
  2492. ret := &ListMattersResponse{
  2493. ServerResponse: googleapi.ServerResponse{
  2494. Header: res.Header,
  2495. HTTPStatusCode: res.StatusCode,
  2496. },
  2497. }
  2498. target := &ret
  2499. if err := gensupport.DecodeResponse(target, res); err != nil {
  2500. return nil, err
  2501. }
  2502. return ret, nil
  2503. // {
  2504. // "description": "Lists matters the user has access to.",
  2505. // "flatPath": "v1/matters",
  2506. // "httpMethod": "GET",
  2507. // "id": "vault.matters.list",
  2508. // "parameterOrder": [],
  2509. // "parameters": {
  2510. // "pageSize": {
  2511. // "description": "The number of matters to return in the response.\nDefault and maximum are 100.",
  2512. // "format": "int32",
  2513. // "location": "query",
  2514. // "type": "integer"
  2515. // },
  2516. // "pageToken": {
  2517. // "description": "The pagination token as returned in the response.",
  2518. // "location": "query",
  2519. // "type": "string"
  2520. // },
  2521. // "state": {
  2522. // "description": "If set, list only matters with that specific state. The default is listing\nmatters of all states.",
  2523. // "enum": [
  2524. // "STATE_UNSPECIFIED",
  2525. // "OPEN",
  2526. // "CLOSED",
  2527. // "DELETED"
  2528. // ],
  2529. // "location": "query",
  2530. // "type": "string"
  2531. // },
  2532. // "view": {
  2533. // "description": "Specifies which parts of the matter to return in response.",
  2534. // "enum": [
  2535. // "VIEW_UNSPECIFIED",
  2536. // "BASIC",
  2537. // "FULL"
  2538. // ],
  2539. // "location": "query",
  2540. // "type": "string"
  2541. // }
  2542. // },
  2543. // "path": "v1/matters",
  2544. // "response": {
  2545. // "$ref": "ListMattersResponse"
  2546. // },
  2547. // "scopes": [
  2548. // "https://www.googleapis.com/auth/ediscovery",
  2549. // "https://www.googleapis.com/auth/ediscovery.readonly"
  2550. // ]
  2551. // }
  2552. }
  2553. // Pages invokes f for each page of results.
  2554. // A non-nil error returned from f will halt the iteration.
  2555. // The provided context supersedes any context provided to the Context method.
  2556. func (c *MattersListCall) Pages(ctx context.Context, f func(*ListMattersResponse) error) error {
  2557. c.ctx_ = ctx
  2558. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2559. for {
  2560. x, err := c.Do()
  2561. if err != nil {
  2562. return err
  2563. }
  2564. if err := f(x); err != nil {
  2565. return err
  2566. }
  2567. if x.NextPageToken == "" {
  2568. return nil
  2569. }
  2570. c.PageToken(x.NextPageToken)
  2571. }
  2572. }
  2573. // method id "vault.matters.removePermissions":
  2574. type MattersRemovePermissionsCall struct {
  2575. s *Service
  2576. matterId string
  2577. removematterpermissionsrequest *RemoveMatterPermissionsRequest
  2578. urlParams_ gensupport.URLParams
  2579. ctx_ context.Context
  2580. header_ http.Header
  2581. }
  2582. // RemovePermissions: Removes an account as a matter collaborator.
  2583. func (r *MattersService) RemovePermissions(matterId string, removematterpermissionsrequest *RemoveMatterPermissionsRequest) *MattersRemovePermissionsCall {
  2584. c := &MattersRemovePermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2585. c.matterId = matterId
  2586. c.removematterpermissionsrequest = removematterpermissionsrequest
  2587. return c
  2588. }
  2589. // Fields allows partial responses to be retrieved. See
  2590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2591. // for more information.
  2592. func (c *MattersRemovePermissionsCall) Fields(s ...googleapi.Field) *MattersRemovePermissionsCall {
  2593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2594. return c
  2595. }
  2596. // Context sets the context to be used in this call's Do method. Any
  2597. // pending HTTP request will be aborted if the provided context is
  2598. // canceled.
  2599. func (c *MattersRemovePermissionsCall) Context(ctx context.Context) *MattersRemovePermissionsCall {
  2600. c.ctx_ = ctx
  2601. return c
  2602. }
  2603. // Header returns an http.Header that can be modified by the caller to
  2604. // add HTTP headers to the request.
  2605. func (c *MattersRemovePermissionsCall) Header() http.Header {
  2606. if c.header_ == nil {
  2607. c.header_ = make(http.Header)
  2608. }
  2609. return c.header_
  2610. }
  2611. func (c *MattersRemovePermissionsCall) doRequest(alt string) (*http.Response, error) {
  2612. reqHeaders := make(http.Header)
  2613. for k, v := range c.header_ {
  2614. reqHeaders[k] = v
  2615. }
  2616. reqHeaders.Set("User-Agent", c.s.userAgent())
  2617. var body io.Reader = nil
  2618. body, err := googleapi.WithoutDataWrapper.JSONReader(c.removematterpermissionsrequest)
  2619. if err != nil {
  2620. return nil, err
  2621. }
  2622. reqHeaders.Set("Content-Type", "application/json")
  2623. c.urlParams_.Set("alt", alt)
  2624. c.urlParams_.Set("prettyPrint", "false")
  2625. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}:removePermissions")
  2626. urls += "?" + c.urlParams_.Encode()
  2627. req, err := http.NewRequest("POST", urls, body)
  2628. if err != nil {
  2629. return nil, err
  2630. }
  2631. req.Header = reqHeaders
  2632. googleapi.Expand(req.URL, map[string]string{
  2633. "matterId": c.matterId,
  2634. })
  2635. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2636. }
  2637. // Do executes the "vault.matters.removePermissions" call.
  2638. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2639. // code is an error. Response headers are in either
  2640. // *Empty.ServerResponse.Header or (if a response was returned at all)
  2641. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2642. // check whether the returned error was because http.StatusNotModified
  2643. // was returned.
  2644. func (c *MattersRemovePermissionsCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2645. gensupport.SetOptions(c.urlParams_, opts...)
  2646. res, err := c.doRequest("json")
  2647. if res != nil && res.StatusCode == http.StatusNotModified {
  2648. if res.Body != nil {
  2649. res.Body.Close()
  2650. }
  2651. return nil, &googleapi.Error{
  2652. Code: res.StatusCode,
  2653. Header: res.Header,
  2654. }
  2655. }
  2656. if err != nil {
  2657. return nil, err
  2658. }
  2659. defer googleapi.CloseBody(res)
  2660. if err := googleapi.CheckResponse(res); err != nil {
  2661. return nil, err
  2662. }
  2663. ret := &Empty{
  2664. ServerResponse: googleapi.ServerResponse{
  2665. Header: res.Header,
  2666. HTTPStatusCode: res.StatusCode,
  2667. },
  2668. }
  2669. target := &ret
  2670. if err := gensupport.DecodeResponse(target, res); err != nil {
  2671. return nil, err
  2672. }
  2673. return ret, nil
  2674. // {
  2675. // "description": "Removes an account as a matter collaborator.",
  2676. // "flatPath": "v1/matters/{matterId}:removePermissions",
  2677. // "httpMethod": "POST",
  2678. // "id": "vault.matters.removePermissions",
  2679. // "parameterOrder": [
  2680. // "matterId"
  2681. // ],
  2682. // "parameters": {
  2683. // "matterId": {
  2684. // "description": "The matter ID.",
  2685. // "location": "path",
  2686. // "required": true,
  2687. // "type": "string"
  2688. // }
  2689. // },
  2690. // "path": "v1/matters/{matterId}:removePermissions",
  2691. // "request": {
  2692. // "$ref": "RemoveMatterPermissionsRequest"
  2693. // },
  2694. // "response": {
  2695. // "$ref": "Empty"
  2696. // },
  2697. // "scopes": [
  2698. // "https://www.googleapis.com/auth/ediscovery"
  2699. // ]
  2700. // }
  2701. }
  2702. // method id "vault.matters.reopen":
  2703. type MattersReopenCall struct {
  2704. s *Service
  2705. matterId string
  2706. reopenmatterrequest *ReopenMatterRequest
  2707. urlParams_ gensupport.URLParams
  2708. ctx_ context.Context
  2709. header_ http.Header
  2710. }
  2711. // Reopen: Reopens the specified matter. Returns matter with updated
  2712. // state.
  2713. func (r *MattersService) Reopen(matterId string, reopenmatterrequest *ReopenMatterRequest) *MattersReopenCall {
  2714. c := &MattersReopenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2715. c.matterId = matterId
  2716. c.reopenmatterrequest = reopenmatterrequest
  2717. return c
  2718. }
  2719. // Fields allows partial responses to be retrieved. See
  2720. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2721. // for more information.
  2722. func (c *MattersReopenCall) Fields(s ...googleapi.Field) *MattersReopenCall {
  2723. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2724. return c
  2725. }
  2726. // Context sets the context to be used in this call's Do method. Any
  2727. // pending HTTP request will be aborted if the provided context is
  2728. // canceled.
  2729. func (c *MattersReopenCall) Context(ctx context.Context) *MattersReopenCall {
  2730. c.ctx_ = ctx
  2731. return c
  2732. }
  2733. // Header returns an http.Header that can be modified by the caller to
  2734. // add HTTP headers to the request.
  2735. func (c *MattersReopenCall) Header() http.Header {
  2736. if c.header_ == nil {
  2737. c.header_ = make(http.Header)
  2738. }
  2739. return c.header_
  2740. }
  2741. func (c *MattersReopenCall) doRequest(alt string) (*http.Response, error) {
  2742. reqHeaders := make(http.Header)
  2743. for k, v := range c.header_ {
  2744. reqHeaders[k] = v
  2745. }
  2746. reqHeaders.Set("User-Agent", c.s.userAgent())
  2747. var body io.Reader = nil
  2748. body, err := googleapi.WithoutDataWrapper.JSONReader(c.reopenmatterrequest)
  2749. if err != nil {
  2750. return nil, err
  2751. }
  2752. reqHeaders.Set("Content-Type", "application/json")
  2753. c.urlParams_.Set("alt", alt)
  2754. c.urlParams_.Set("prettyPrint", "false")
  2755. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}:reopen")
  2756. urls += "?" + c.urlParams_.Encode()
  2757. req, err := http.NewRequest("POST", urls, body)
  2758. if err != nil {
  2759. return nil, err
  2760. }
  2761. req.Header = reqHeaders
  2762. googleapi.Expand(req.URL, map[string]string{
  2763. "matterId": c.matterId,
  2764. })
  2765. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2766. }
  2767. // Do executes the "vault.matters.reopen" call.
  2768. // Exactly one of *ReopenMatterResponse or error will be non-nil. Any
  2769. // non-2xx status code is an error. Response headers are in either
  2770. // *ReopenMatterResponse.ServerResponse.Header or (if a response was
  2771. // returned at all) in error.(*googleapi.Error).Header. Use
  2772. // googleapi.IsNotModified to check whether the returned error was
  2773. // because http.StatusNotModified was returned.
  2774. func (c *MattersReopenCall) Do(opts ...googleapi.CallOption) (*ReopenMatterResponse, error) {
  2775. gensupport.SetOptions(c.urlParams_, opts...)
  2776. res, err := c.doRequest("json")
  2777. if res != nil && res.StatusCode == http.StatusNotModified {
  2778. if res.Body != nil {
  2779. res.Body.Close()
  2780. }
  2781. return nil, &googleapi.Error{
  2782. Code: res.StatusCode,
  2783. Header: res.Header,
  2784. }
  2785. }
  2786. if err != nil {
  2787. return nil, err
  2788. }
  2789. defer googleapi.CloseBody(res)
  2790. if err := googleapi.CheckResponse(res); err != nil {
  2791. return nil, err
  2792. }
  2793. ret := &ReopenMatterResponse{
  2794. ServerResponse: googleapi.ServerResponse{
  2795. Header: res.Header,
  2796. HTTPStatusCode: res.StatusCode,
  2797. },
  2798. }
  2799. target := &ret
  2800. if err := gensupport.DecodeResponse(target, res); err != nil {
  2801. return nil, err
  2802. }
  2803. return ret, nil
  2804. // {
  2805. // "description": "Reopens the specified matter. Returns matter with updated state.",
  2806. // "flatPath": "v1/matters/{matterId}:reopen",
  2807. // "httpMethod": "POST",
  2808. // "id": "vault.matters.reopen",
  2809. // "parameterOrder": [
  2810. // "matterId"
  2811. // ],
  2812. // "parameters": {
  2813. // "matterId": {
  2814. // "description": "The matter ID.",
  2815. // "location": "path",
  2816. // "required": true,
  2817. // "type": "string"
  2818. // }
  2819. // },
  2820. // "path": "v1/matters/{matterId}:reopen",
  2821. // "request": {
  2822. // "$ref": "ReopenMatterRequest"
  2823. // },
  2824. // "response": {
  2825. // "$ref": "ReopenMatterResponse"
  2826. // },
  2827. // "scopes": [
  2828. // "https://www.googleapis.com/auth/ediscovery"
  2829. // ]
  2830. // }
  2831. }
  2832. // method id "vault.matters.undelete":
  2833. type MattersUndeleteCall struct {
  2834. s *Service
  2835. matterId string
  2836. undeletematterrequest *UndeleteMatterRequest
  2837. urlParams_ gensupport.URLParams
  2838. ctx_ context.Context
  2839. header_ http.Header
  2840. }
  2841. // Undelete: Undeletes the specified matter. Returns matter with updated
  2842. // state.
  2843. func (r *MattersService) Undelete(matterId string, undeletematterrequest *UndeleteMatterRequest) *MattersUndeleteCall {
  2844. c := &MattersUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2845. c.matterId = matterId
  2846. c.undeletematterrequest = undeletematterrequest
  2847. return c
  2848. }
  2849. // Fields allows partial responses to be retrieved. See
  2850. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2851. // for more information.
  2852. func (c *MattersUndeleteCall) Fields(s ...googleapi.Field) *MattersUndeleteCall {
  2853. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2854. return c
  2855. }
  2856. // Context sets the context to be used in this call's Do method. Any
  2857. // pending HTTP request will be aborted if the provided context is
  2858. // canceled.
  2859. func (c *MattersUndeleteCall) Context(ctx context.Context) *MattersUndeleteCall {
  2860. c.ctx_ = ctx
  2861. return c
  2862. }
  2863. // Header returns an http.Header that can be modified by the caller to
  2864. // add HTTP headers to the request.
  2865. func (c *MattersUndeleteCall) Header() http.Header {
  2866. if c.header_ == nil {
  2867. c.header_ = make(http.Header)
  2868. }
  2869. return c.header_
  2870. }
  2871. func (c *MattersUndeleteCall) doRequest(alt string) (*http.Response, error) {
  2872. reqHeaders := make(http.Header)
  2873. for k, v := range c.header_ {
  2874. reqHeaders[k] = v
  2875. }
  2876. reqHeaders.Set("User-Agent", c.s.userAgent())
  2877. var body io.Reader = nil
  2878. body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletematterrequest)
  2879. if err != nil {
  2880. return nil, err
  2881. }
  2882. reqHeaders.Set("Content-Type", "application/json")
  2883. c.urlParams_.Set("alt", alt)
  2884. c.urlParams_.Set("prettyPrint", "false")
  2885. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}:undelete")
  2886. urls += "?" + c.urlParams_.Encode()
  2887. req, err := http.NewRequest("POST", urls, body)
  2888. if err != nil {
  2889. return nil, err
  2890. }
  2891. req.Header = reqHeaders
  2892. googleapi.Expand(req.URL, map[string]string{
  2893. "matterId": c.matterId,
  2894. })
  2895. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2896. }
  2897. // Do executes the "vault.matters.undelete" call.
  2898. // Exactly one of *Matter or error will be non-nil. Any non-2xx status
  2899. // code is an error. Response headers are in either
  2900. // *Matter.ServerResponse.Header or (if a response was returned at all)
  2901. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2902. // check whether the returned error was because http.StatusNotModified
  2903. // was returned.
  2904. func (c *MattersUndeleteCall) Do(opts ...googleapi.CallOption) (*Matter, error) {
  2905. gensupport.SetOptions(c.urlParams_, opts...)
  2906. res, err := c.doRequest("json")
  2907. if res != nil && res.StatusCode == http.StatusNotModified {
  2908. if res.Body != nil {
  2909. res.Body.Close()
  2910. }
  2911. return nil, &googleapi.Error{
  2912. Code: res.StatusCode,
  2913. Header: res.Header,
  2914. }
  2915. }
  2916. if err != nil {
  2917. return nil, err
  2918. }
  2919. defer googleapi.CloseBody(res)
  2920. if err := googleapi.CheckResponse(res); err != nil {
  2921. return nil, err
  2922. }
  2923. ret := &Matter{
  2924. ServerResponse: googleapi.ServerResponse{
  2925. Header: res.Header,
  2926. HTTPStatusCode: res.StatusCode,
  2927. },
  2928. }
  2929. target := &ret
  2930. if err := gensupport.DecodeResponse(target, res); err != nil {
  2931. return nil, err
  2932. }
  2933. return ret, nil
  2934. // {
  2935. // "description": "Undeletes the specified matter. Returns matter with updated state.",
  2936. // "flatPath": "v1/matters/{matterId}:undelete",
  2937. // "httpMethod": "POST",
  2938. // "id": "vault.matters.undelete",
  2939. // "parameterOrder": [
  2940. // "matterId"
  2941. // ],
  2942. // "parameters": {
  2943. // "matterId": {
  2944. // "description": "The matter ID.",
  2945. // "location": "path",
  2946. // "required": true,
  2947. // "type": "string"
  2948. // }
  2949. // },
  2950. // "path": "v1/matters/{matterId}:undelete",
  2951. // "request": {
  2952. // "$ref": "UndeleteMatterRequest"
  2953. // },
  2954. // "response": {
  2955. // "$ref": "Matter"
  2956. // },
  2957. // "scopes": [
  2958. // "https://www.googleapis.com/auth/ediscovery"
  2959. // ]
  2960. // }
  2961. }
  2962. // method id "vault.matters.update":
  2963. type MattersUpdateCall struct {
  2964. s *Service
  2965. matterId string
  2966. matter *Matter
  2967. urlParams_ gensupport.URLParams
  2968. ctx_ context.Context
  2969. header_ http.Header
  2970. }
  2971. // Update: Updates the specified matter.
  2972. // This updates only the name and description of the matter, identified
  2973. // by
  2974. // matter id. Changes to any other fields are ignored.
  2975. // Returns the default view of the matter.
  2976. func (r *MattersService) Update(matterId string, matter *Matter) *MattersUpdateCall {
  2977. c := &MattersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2978. c.matterId = matterId
  2979. c.matter = matter
  2980. return c
  2981. }
  2982. // Fields allows partial responses to be retrieved. See
  2983. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2984. // for more information.
  2985. func (c *MattersUpdateCall) Fields(s ...googleapi.Field) *MattersUpdateCall {
  2986. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2987. return c
  2988. }
  2989. // Context sets the context to be used in this call's Do method. Any
  2990. // pending HTTP request will be aborted if the provided context is
  2991. // canceled.
  2992. func (c *MattersUpdateCall) Context(ctx context.Context) *MattersUpdateCall {
  2993. c.ctx_ = ctx
  2994. return c
  2995. }
  2996. // Header returns an http.Header that can be modified by the caller to
  2997. // add HTTP headers to the request.
  2998. func (c *MattersUpdateCall) Header() http.Header {
  2999. if c.header_ == nil {
  3000. c.header_ = make(http.Header)
  3001. }
  3002. return c.header_
  3003. }
  3004. func (c *MattersUpdateCall) doRequest(alt string) (*http.Response, error) {
  3005. reqHeaders := make(http.Header)
  3006. for k, v := range c.header_ {
  3007. reqHeaders[k] = v
  3008. }
  3009. reqHeaders.Set("User-Agent", c.s.userAgent())
  3010. var body io.Reader = nil
  3011. body, err := googleapi.WithoutDataWrapper.JSONReader(c.matter)
  3012. if err != nil {
  3013. return nil, err
  3014. }
  3015. reqHeaders.Set("Content-Type", "application/json")
  3016. c.urlParams_.Set("alt", alt)
  3017. c.urlParams_.Set("prettyPrint", "false")
  3018. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}")
  3019. urls += "?" + c.urlParams_.Encode()
  3020. req, err := http.NewRequest("PUT", urls, body)
  3021. if err != nil {
  3022. return nil, err
  3023. }
  3024. req.Header = reqHeaders
  3025. googleapi.Expand(req.URL, map[string]string{
  3026. "matterId": c.matterId,
  3027. })
  3028. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3029. }
  3030. // Do executes the "vault.matters.update" call.
  3031. // Exactly one of *Matter or error will be non-nil. Any non-2xx status
  3032. // code is an error. Response headers are in either
  3033. // *Matter.ServerResponse.Header or (if a response was returned at all)
  3034. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3035. // check whether the returned error was because http.StatusNotModified
  3036. // was returned.
  3037. func (c *MattersUpdateCall) Do(opts ...googleapi.CallOption) (*Matter, error) {
  3038. gensupport.SetOptions(c.urlParams_, opts...)
  3039. res, err := c.doRequest("json")
  3040. if res != nil && res.StatusCode == http.StatusNotModified {
  3041. if res.Body != nil {
  3042. res.Body.Close()
  3043. }
  3044. return nil, &googleapi.Error{
  3045. Code: res.StatusCode,
  3046. Header: res.Header,
  3047. }
  3048. }
  3049. if err != nil {
  3050. return nil, err
  3051. }
  3052. defer googleapi.CloseBody(res)
  3053. if err := googleapi.CheckResponse(res); err != nil {
  3054. return nil, err
  3055. }
  3056. ret := &Matter{
  3057. ServerResponse: googleapi.ServerResponse{
  3058. Header: res.Header,
  3059. HTTPStatusCode: res.StatusCode,
  3060. },
  3061. }
  3062. target := &ret
  3063. if err := gensupport.DecodeResponse(target, res); err != nil {
  3064. return nil, err
  3065. }
  3066. return ret, nil
  3067. // {
  3068. // "description": "Updates the specified matter.\nThis updates only the name and description of the matter, identified by\nmatter id. Changes to any other fields are ignored.\nReturns the default view of the matter.",
  3069. // "flatPath": "v1/matters/{matterId}",
  3070. // "httpMethod": "PUT",
  3071. // "id": "vault.matters.update",
  3072. // "parameterOrder": [
  3073. // "matterId"
  3074. // ],
  3075. // "parameters": {
  3076. // "matterId": {
  3077. // "description": "The matter ID.",
  3078. // "location": "path",
  3079. // "required": true,
  3080. // "type": "string"
  3081. // }
  3082. // },
  3083. // "path": "v1/matters/{matterId}",
  3084. // "request": {
  3085. // "$ref": "Matter"
  3086. // },
  3087. // "response": {
  3088. // "$ref": "Matter"
  3089. // },
  3090. // "scopes": [
  3091. // "https://www.googleapis.com/auth/ediscovery"
  3092. // ]
  3093. // }
  3094. }
  3095. // method id "vault.matters.exports.create":
  3096. type MattersExportsCreateCall struct {
  3097. s *Service
  3098. matterId string
  3099. export *Export
  3100. urlParams_ gensupport.URLParams
  3101. ctx_ context.Context
  3102. header_ http.Header
  3103. }
  3104. // Create: Creates an Export.
  3105. func (r *MattersExportsService) Create(matterId string, export *Export) *MattersExportsCreateCall {
  3106. c := &MattersExportsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3107. c.matterId = matterId
  3108. c.export = export
  3109. return c
  3110. }
  3111. // Fields allows partial responses to be retrieved. See
  3112. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3113. // for more information.
  3114. func (c *MattersExportsCreateCall) Fields(s ...googleapi.Field) *MattersExportsCreateCall {
  3115. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3116. return c
  3117. }
  3118. // Context sets the context to be used in this call's Do method. Any
  3119. // pending HTTP request will be aborted if the provided context is
  3120. // canceled.
  3121. func (c *MattersExportsCreateCall) Context(ctx context.Context) *MattersExportsCreateCall {
  3122. c.ctx_ = ctx
  3123. return c
  3124. }
  3125. // Header returns an http.Header that can be modified by the caller to
  3126. // add HTTP headers to the request.
  3127. func (c *MattersExportsCreateCall) Header() http.Header {
  3128. if c.header_ == nil {
  3129. c.header_ = make(http.Header)
  3130. }
  3131. return c.header_
  3132. }
  3133. func (c *MattersExportsCreateCall) doRequest(alt string) (*http.Response, error) {
  3134. reqHeaders := make(http.Header)
  3135. for k, v := range c.header_ {
  3136. reqHeaders[k] = v
  3137. }
  3138. reqHeaders.Set("User-Agent", c.s.userAgent())
  3139. var body io.Reader = nil
  3140. body, err := googleapi.WithoutDataWrapper.JSONReader(c.export)
  3141. if err != nil {
  3142. return nil, err
  3143. }
  3144. reqHeaders.Set("Content-Type", "application/json")
  3145. c.urlParams_.Set("alt", alt)
  3146. c.urlParams_.Set("prettyPrint", "false")
  3147. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/exports")
  3148. urls += "?" + c.urlParams_.Encode()
  3149. req, err := http.NewRequest("POST", urls, body)
  3150. if err != nil {
  3151. return nil, err
  3152. }
  3153. req.Header = reqHeaders
  3154. googleapi.Expand(req.URL, map[string]string{
  3155. "matterId": c.matterId,
  3156. })
  3157. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3158. }
  3159. // Do executes the "vault.matters.exports.create" call.
  3160. // Exactly one of *Export or error will be non-nil. Any non-2xx status
  3161. // code is an error. Response headers are in either
  3162. // *Export.ServerResponse.Header or (if a response was returned at all)
  3163. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3164. // check whether the returned error was because http.StatusNotModified
  3165. // was returned.
  3166. func (c *MattersExportsCreateCall) Do(opts ...googleapi.CallOption) (*Export, error) {
  3167. gensupport.SetOptions(c.urlParams_, opts...)
  3168. res, err := c.doRequest("json")
  3169. if res != nil && res.StatusCode == http.StatusNotModified {
  3170. if res.Body != nil {
  3171. res.Body.Close()
  3172. }
  3173. return nil, &googleapi.Error{
  3174. Code: res.StatusCode,
  3175. Header: res.Header,
  3176. }
  3177. }
  3178. if err != nil {
  3179. return nil, err
  3180. }
  3181. defer googleapi.CloseBody(res)
  3182. if err := googleapi.CheckResponse(res); err != nil {
  3183. return nil, err
  3184. }
  3185. ret := &Export{
  3186. ServerResponse: googleapi.ServerResponse{
  3187. Header: res.Header,
  3188. HTTPStatusCode: res.StatusCode,
  3189. },
  3190. }
  3191. target := &ret
  3192. if err := gensupport.DecodeResponse(target, res); err != nil {
  3193. return nil, err
  3194. }
  3195. return ret, nil
  3196. // {
  3197. // "description": "Creates an Export.",
  3198. // "flatPath": "v1/matters/{matterId}/exports",
  3199. // "httpMethod": "POST",
  3200. // "id": "vault.matters.exports.create",
  3201. // "parameterOrder": [
  3202. // "matterId"
  3203. // ],
  3204. // "parameters": {
  3205. // "matterId": {
  3206. // "description": "The matter ID.",
  3207. // "location": "path",
  3208. // "required": true,
  3209. // "type": "string"
  3210. // }
  3211. // },
  3212. // "path": "v1/matters/{matterId}/exports",
  3213. // "request": {
  3214. // "$ref": "Export"
  3215. // },
  3216. // "response": {
  3217. // "$ref": "Export"
  3218. // },
  3219. // "scopes": [
  3220. // "https://www.googleapis.com/auth/ediscovery"
  3221. // ]
  3222. // }
  3223. }
  3224. // method id "vault.matters.exports.delete":
  3225. type MattersExportsDeleteCall struct {
  3226. s *Service
  3227. matterId string
  3228. exportId string
  3229. urlParams_ gensupport.URLParams
  3230. ctx_ context.Context
  3231. header_ http.Header
  3232. }
  3233. // Delete: Deletes an Export.
  3234. func (r *MattersExportsService) Delete(matterId string, exportId string) *MattersExportsDeleteCall {
  3235. c := &MattersExportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3236. c.matterId = matterId
  3237. c.exportId = exportId
  3238. return c
  3239. }
  3240. // Fields allows partial responses to be retrieved. See
  3241. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3242. // for more information.
  3243. func (c *MattersExportsDeleteCall) Fields(s ...googleapi.Field) *MattersExportsDeleteCall {
  3244. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3245. return c
  3246. }
  3247. // Context sets the context to be used in this call's Do method. Any
  3248. // pending HTTP request will be aborted if the provided context is
  3249. // canceled.
  3250. func (c *MattersExportsDeleteCall) Context(ctx context.Context) *MattersExportsDeleteCall {
  3251. c.ctx_ = ctx
  3252. return c
  3253. }
  3254. // Header returns an http.Header that can be modified by the caller to
  3255. // add HTTP headers to the request.
  3256. func (c *MattersExportsDeleteCall) Header() http.Header {
  3257. if c.header_ == nil {
  3258. c.header_ = make(http.Header)
  3259. }
  3260. return c.header_
  3261. }
  3262. func (c *MattersExportsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3263. reqHeaders := make(http.Header)
  3264. for k, v := range c.header_ {
  3265. reqHeaders[k] = v
  3266. }
  3267. reqHeaders.Set("User-Agent", c.s.userAgent())
  3268. var body io.Reader = nil
  3269. c.urlParams_.Set("alt", alt)
  3270. c.urlParams_.Set("prettyPrint", "false")
  3271. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/exports/{exportId}")
  3272. urls += "?" + c.urlParams_.Encode()
  3273. req, err := http.NewRequest("DELETE", urls, body)
  3274. if err != nil {
  3275. return nil, err
  3276. }
  3277. req.Header = reqHeaders
  3278. googleapi.Expand(req.URL, map[string]string{
  3279. "matterId": c.matterId,
  3280. "exportId": c.exportId,
  3281. })
  3282. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3283. }
  3284. // Do executes the "vault.matters.exports.delete" call.
  3285. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  3286. // code is an error. Response headers are in either
  3287. // *Empty.ServerResponse.Header or (if a response was returned at all)
  3288. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3289. // check whether the returned error was because http.StatusNotModified
  3290. // was returned.
  3291. func (c *MattersExportsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3292. gensupport.SetOptions(c.urlParams_, opts...)
  3293. res, err := c.doRequest("json")
  3294. if res != nil && res.StatusCode == http.StatusNotModified {
  3295. if res.Body != nil {
  3296. res.Body.Close()
  3297. }
  3298. return nil, &googleapi.Error{
  3299. Code: res.StatusCode,
  3300. Header: res.Header,
  3301. }
  3302. }
  3303. if err != nil {
  3304. return nil, err
  3305. }
  3306. defer googleapi.CloseBody(res)
  3307. if err := googleapi.CheckResponse(res); err != nil {
  3308. return nil, err
  3309. }
  3310. ret := &Empty{
  3311. ServerResponse: googleapi.ServerResponse{
  3312. Header: res.Header,
  3313. HTTPStatusCode: res.StatusCode,
  3314. },
  3315. }
  3316. target := &ret
  3317. if err := gensupport.DecodeResponse(target, res); err != nil {
  3318. return nil, err
  3319. }
  3320. return ret, nil
  3321. // {
  3322. // "description": "Deletes an Export.",
  3323. // "flatPath": "v1/matters/{matterId}/exports/{exportId}",
  3324. // "httpMethod": "DELETE",
  3325. // "id": "vault.matters.exports.delete",
  3326. // "parameterOrder": [
  3327. // "matterId",
  3328. // "exportId"
  3329. // ],
  3330. // "parameters": {
  3331. // "exportId": {
  3332. // "description": "The export ID.",
  3333. // "location": "path",
  3334. // "required": true,
  3335. // "type": "string"
  3336. // },
  3337. // "matterId": {
  3338. // "description": "The matter ID.",
  3339. // "location": "path",
  3340. // "required": true,
  3341. // "type": "string"
  3342. // }
  3343. // },
  3344. // "path": "v1/matters/{matterId}/exports/{exportId}",
  3345. // "response": {
  3346. // "$ref": "Empty"
  3347. // },
  3348. // "scopes": [
  3349. // "https://www.googleapis.com/auth/ediscovery"
  3350. // ]
  3351. // }
  3352. }
  3353. // method id "vault.matters.exports.get":
  3354. type MattersExportsGetCall struct {
  3355. s *Service
  3356. matterId string
  3357. exportId string
  3358. urlParams_ gensupport.URLParams
  3359. ifNoneMatch_ string
  3360. ctx_ context.Context
  3361. header_ http.Header
  3362. }
  3363. // Get: Gets an Export.
  3364. func (r *MattersExportsService) Get(matterId string, exportId string) *MattersExportsGetCall {
  3365. c := &MattersExportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3366. c.matterId = matterId
  3367. c.exportId = exportId
  3368. return c
  3369. }
  3370. // Fields allows partial responses to be retrieved. See
  3371. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3372. // for more information.
  3373. func (c *MattersExportsGetCall) Fields(s ...googleapi.Field) *MattersExportsGetCall {
  3374. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3375. return c
  3376. }
  3377. // IfNoneMatch sets the optional parameter which makes the operation
  3378. // fail if the object's ETag matches the given value. This is useful for
  3379. // getting updates only after the object has changed since the last
  3380. // request. Use googleapi.IsNotModified to check whether the response
  3381. // error from Do is the result of In-None-Match.
  3382. func (c *MattersExportsGetCall) IfNoneMatch(entityTag string) *MattersExportsGetCall {
  3383. c.ifNoneMatch_ = entityTag
  3384. return c
  3385. }
  3386. // Context sets the context to be used in this call's Do method. Any
  3387. // pending HTTP request will be aborted if the provided context is
  3388. // canceled.
  3389. func (c *MattersExportsGetCall) Context(ctx context.Context) *MattersExportsGetCall {
  3390. c.ctx_ = ctx
  3391. return c
  3392. }
  3393. // Header returns an http.Header that can be modified by the caller to
  3394. // add HTTP headers to the request.
  3395. func (c *MattersExportsGetCall) Header() http.Header {
  3396. if c.header_ == nil {
  3397. c.header_ = make(http.Header)
  3398. }
  3399. return c.header_
  3400. }
  3401. func (c *MattersExportsGetCall) doRequest(alt string) (*http.Response, error) {
  3402. reqHeaders := make(http.Header)
  3403. for k, v := range c.header_ {
  3404. reqHeaders[k] = v
  3405. }
  3406. reqHeaders.Set("User-Agent", c.s.userAgent())
  3407. if c.ifNoneMatch_ != "" {
  3408. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3409. }
  3410. var body io.Reader = nil
  3411. c.urlParams_.Set("alt", alt)
  3412. c.urlParams_.Set("prettyPrint", "false")
  3413. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/exports/{exportId}")
  3414. urls += "?" + c.urlParams_.Encode()
  3415. req, err := http.NewRequest("GET", urls, body)
  3416. if err != nil {
  3417. return nil, err
  3418. }
  3419. req.Header = reqHeaders
  3420. googleapi.Expand(req.URL, map[string]string{
  3421. "matterId": c.matterId,
  3422. "exportId": c.exportId,
  3423. })
  3424. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3425. }
  3426. // Do executes the "vault.matters.exports.get" call.
  3427. // Exactly one of *Export or error will be non-nil. Any non-2xx status
  3428. // code is an error. Response headers are in either
  3429. // *Export.ServerResponse.Header or (if a response was returned at all)
  3430. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3431. // check whether the returned error was because http.StatusNotModified
  3432. // was returned.
  3433. func (c *MattersExportsGetCall) Do(opts ...googleapi.CallOption) (*Export, error) {
  3434. gensupport.SetOptions(c.urlParams_, opts...)
  3435. res, err := c.doRequest("json")
  3436. if res != nil && res.StatusCode == http.StatusNotModified {
  3437. if res.Body != nil {
  3438. res.Body.Close()
  3439. }
  3440. return nil, &googleapi.Error{
  3441. Code: res.StatusCode,
  3442. Header: res.Header,
  3443. }
  3444. }
  3445. if err != nil {
  3446. return nil, err
  3447. }
  3448. defer googleapi.CloseBody(res)
  3449. if err := googleapi.CheckResponse(res); err != nil {
  3450. return nil, err
  3451. }
  3452. ret := &Export{
  3453. ServerResponse: googleapi.ServerResponse{
  3454. Header: res.Header,
  3455. HTTPStatusCode: res.StatusCode,
  3456. },
  3457. }
  3458. target := &ret
  3459. if err := gensupport.DecodeResponse(target, res); err != nil {
  3460. return nil, err
  3461. }
  3462. return ret, nil
  3463. // {
  3464. // "description": "Gets an Export.",
  3465. // "flatPath": "v1/matters/{matterId}/exports/{exportId}",
  3466. // "httpMethod": "GET",
  3467. // "id": "vault.matters.exports.get",
  3468. // "parameterOrder": [
  3469. // "matterId",
  3470. // "exportId"
  3471. // ],
  3472. // "parameters": {
  3473. // "exportId": {
  3474. // "description": "The export ID.",
  3475. // "location": "path",
  3476. // "required": true,
  3477. // "type": "string"
  3478. // },
  3479. // "matterId": {
  3480. // "description": "The matter ID.",
  3481. // "location": "path",
  3482. // "required": true,
  3483. // "type": "string"
  3484. // }
  3485. // },
  3486. // "path": "v1/matters/{matterId}/exports/{exportId}",
  3487. // "response": {
  3488. // "$ref": "Export"
  3489. // },
  3490. // "scopes": [
  3491. // "https://www.googleapis.com/auth/ediscovery",
  3492. // "https://www.googleapis.com/auth/ediscovery.readonly"
  3493. // ]
  3494. // }
  3495. }
  3496. // method id "vault.matters.exports.list":
  3497. type MattersExportsListCall struct {
  3498. s *Service
  3499. matterId string
  3500. urlParams_ gensupport.URLParams
  3501. ifNoneMatch_ string
  3502. ctx_ context.Context
  3503. header_ http.Header
  3504. }
  3505. // List: Lists Exports.
  3506. func (r *MattersExportsService) List(matterId string) *MattersExportsListCall {
  3507. c := &MattersExportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3508. c.matterId = matterId
  3509. return c
  3510. }
  3511. // PageSize sets the optional parameter "pageSize": The number of
  3512. // exports to return in the response.
  3513. func (c *MattersExportsListCall) PageSize(pageSize int64) *MattersExportsListCall {
  3514. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3515. return c
  3516. }
  3517. // PageToken sets the optional parameter "pageToken": The pagination
  3518. // token as returned in the response.
  3519. func (c *MattersExportsListCall) PageToken(pageToken string) *MattersExportsListCall {
  3520. c.urlParams_.Set("pageToken", pageToken)
  3521. return c
  3522. }
  3523. // Fields allows partial responses to be retrieved. See
  3524. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3525. // for more information.
  3526. func (c *MattersExportsListCall) Fields(s ...googleapi.Field) *MattersExportsListCall {
  3527. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3528. return c
  3529. }
  3530. // IfNoneMatch sets the optional parameter which makes the operation
  3531. // fail if the object's ETag matches the given value. This is useful for
  3532. // getting updates only after the object has changed since the last
  3533. // request. Use googleapi.IsNotModified to check whether the response
  3534. // error from Do is the result of In-None-Match.
  3535. func (c *MattersExportsListCall) IfNoneMatch(entityTag string) *MattersExportsListCall {
  3536. c.ifNoneMatch_ = entityTag
  3537. return c
  3538. }
  3539. // Context sets the context to be used in this call's Do method. Any
  3540. // pending HTTP request will be aborted if the provided context is
  3541. // canceled.
  3542. func (c *MattersExportsListCall) Context(ctx context.Context) *MattersExportsListCall {
  3543. c.ctx_ = ctx
  3544. return c
  3545. }
  3546. // Header returns an http.Header that can be modified by the caller to
  3547. // add HTTP headers to the request.
  3548. func (c *MattersExportsListCall) Header() http.Header {
  3549. if c.header_ == nil {
  3550. c.header_ = make(http.Header)
  3551. }
  3552. return c.header_
  3553. }
  3554. func (c *MattersExportsListCall) doRequest(alt string) (*http.Response, error) {
  3555. reqHeaders := make(http.Header)
  3556. for k, v := range c.header_ {
  3557. reqHeaders[k] = v
  3558. }
  3559. reqHeaders.Set("User-Agent", c.s.userAgent())
  3560. if c.ifNoneMatch_ != "" {
  3561. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3562. }
  3563. var body io.Reader = nil
  3564. c.urlParams_.Set("alt", alt)
  3565. c.urlParams_.Set("prettyPrint", "false")
  3566. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/exports")
  3567. urls += "?" + c.urlParams_.Encode()
  3568. req, err := http.NewRequest("GET", urls, body)
  3569. if err != nil {
  3570. return nil, err
  3571. }
  3572. req.Header = reqHeaders
  3573. googleapi.Expand(req.URL, map[string]string{
  3574. "matterId": c.matterId,
  3575. })
  3576. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3577. }
  3578. // Do executes the "vault.matters.exports.list" call.
  3579. // Exactly one of *ListExportsResponse or error will be non-nil. Any
  3580. // non-2xx status code is an error. Response headers are in either
  3581. // *ListExportsResponse.ServerResponse.Header or (if a response was
  3582. // returned at all) in error.(*googleapi.Error).Header. Use
  3583. // googleapi.IsNotModified to check whether the returned error was
  3584. // because http.StatusNotModified was returned.
  3585. func (c *MattersExportsListCall) Do(opts ...googleapi.CallOption) (*ListExportsResponse, error) {
  3586. gensupport.SetOptions(c.urlParams_, opts...)
  3587. res, err := c.doRequest("json")
  3588. if res != nil && res.StatusCode == http.StatusNotModified {
  3589. if res.Body != nil {
  3590. res.Body.Close()
  3591. }
  3592. return nil, &googleapi.Error{
  3593. Code: res.StatusCode,
  3594. Header: res.Header,
  3595. }
  3596. }
  3597. if err != nil {
  3598. return nil, err
  3599. }
  3600. defer googleapi.CloseBody(res)
  3601. if err := googleapi.CheckResponse(res); err != nil {
  3602. return nil, err
  3603. }
  3604. ret := &ListExportsResponse{
  3605. ServerResponse: googleapi.ServerResponse{
  3606. Header: res.Header,
  3607. HTTPStatusCode: res.StatusCode,
  3608. },
  3609. }
  3610. target := &ret
  3611. if err := gensupport.DecodeResponse(target, res); err != nil {
  3612. return nil, err
  3613. }
  3614. return ret, nil
  3615. // {
  3616. // "description": "Lists Exports.",
  3617. // "flatPath": "v1/matters/{matterId}/exports",
  3618. // "httpMethod": "GET",
  3619. // "id": "vault.matters.exports.list",
  3620. // "parameterOrder": [
  3621. // "matterId"
  3622. // ],
  3623. // "parameters": {
  3624. // "matterId": {
  3625. // "description": "The matter ID.",
  3626. // "location": "path",
  3627. // "required": true,
  3628. // "type": "string"
  3629. // },
  3630. // "pageSize": {
  3631. // "description": "The number of exports to return in the response.",
  3632. // "format": "int32",
  3633. // "location": "query",
  3634. // "type": "integer"
  3635. // },
  3636. // "pageToken": {
  3637. // "description": "The pagination token as returned in the response.",
  3638. // "location": "query",
  3639. // "type": "string"
  3640. // }
  3641. // },
  3642. // "path": "v1/matters/{matterId}/exports",
  3643. // "response": {
  3644. // "$ref": "ListExportsResponse"
  3645. // },
  3646. // "scopes": [
  3647. // "https://www.googleapis.com/auth/ediscovery",
  3648. // "https://www.googleapis.com/auth/ediscovery.readonly"
  3649. // ]
  3650. // }
  3651. }
  3652. // Pages invokes f for each page of results.
  3653. // A non-nil error returned from f will halt the iteration.
  3654. // The provided context supersedes any context provided to the Context method.
  3655. func (c *MattersExportsListCall) Pages(ctx context.Context, f func(*ListExportsResponse) error) error {
  3656. c.ctx_ = ctx
  3657. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3658. for {
  3659. x, err := c.Do()
  3660. if err != nil {
  3661. return err
  3662. }
  3663. if err := f(x); err != nil {
  3664. return err
  3665. }
  3666. if x.NextPageToken == "" {
  3667. return nil
  3668. }
  3669. c.PageToken(x.NextPageToken)
  3670. }
  3671. }
  3672. // method id "vault.matters.holds.addHeldAccounts":
  3673. type MattersHoldsAddHeldAccountsCall struct {
  3674. s *Service
  3675. matterId string
  3676. holdId string
  3677. addheldaccountsrequest *AddHeldAccountsRequest
  3678. urlParams_ gensupport.URLParams
  3679. ctx_ context.Context
  3680. header_ http.Header
  3681. }
  3682. // AddHeldAccounts: Adds HeldAccounts to a hold. Returns a list of
  3683. // accounts that have been
  3684. // successfully added. Accounts can only be added to an existing
  3685. // account-based
  3686. // hold.
  3687. func (r *MattersHoldsService) AddHeldAccounts(matterId string, holdId string, addheldaccountsrequest *AddHeldAccountsRequest) *MattersHoldsAddHeldAccountsCall {
  3688. c := &MattersHoldsAddHeldAccountsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3689. c.matterId = matterId
  3690. c.holdId = holdId
  3691. c.addheldaccountsrequest = addheldaccountsrequest
  3692. return c
  3693. }
  3694. // Fields allows partial responses to be retrieved. See
  3695. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3696. // for more information.
  3697. func (c *MattersHoldsAddHeldAccountsCall) Fields(s ...googleapi.Field) *MattersHoldsAddHeldAccountsCall {
  3698. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3699. return c
  3700. }
  3701. // Context sets the context to be used in this call's Do method. Any
  3702. // pending HTTP request will be aborted if the provided context is
  3703. // canceled.
  3704. func (c *MattersHoldsAddHeldAccountsCall) Context(ctx context.Context) *MattersHoldsAddHeldAccountsCall {
  3705. c.ctx_ = ctx
  3706. return c
  3707. }
  3708. // Header returns an http.Header that can be modified by the caller to
  3709. // add HTTP headers to the request.
  3710. func (c *MattersHoldsAddHeldAccountsCall) Header() http.Header {
  3711. if c.header_ == nil {
  3712. c.header_ = make(http.Header)
  3713. }
  3714. return c.header_
  3715. }
  3716. func (c *MattersHoldsAddHeldAccountsCall) doRequest(alt string) (*http.Response, error) {
  3717. reqHeaders := make(http.Header)
  3718. for k, v := range c.header_ {
  3719. reqHeaders[k] = v
  3720. }
  3721. reqHeaders.Set("User-Agent", c.s.userAgent())
  3722. var body io.Reader = nil
  3723. body, err := googleapi.WithoutDataWrapper.JSONReader(c.addheldaccountsrequest)
  3724. if err != nil {
  3725. return nil, err
  3726. }
  3727. reqHeaders.Set("Content-Type", "application/json")
  3728. c.urlParams_.Set("alt", alt)
  3729. c.urlParams_.Set("prettyPrint", "false")
  3730. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds/{holdId}:addHeldAccounts")
  3731. urls += "?" + c.urlParams_.Encode()
  3732. req, err := http.NewRequest("POST", urls, body)
  3733. if err != nil {
  3734. return nil, err
  3735. }
  3736. req.Header = reqHeaders
  3737. googleapi.Expand(req.URL, map[string]string{
  3738. "matterId": c.matterId,
  3739. "holdId": c.holdId,
  3740. })
  3741. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3742. }
  3743. // Do executes the "vault.matters.holds.addHeldAccounts" call.
  3744. // Exactly one of *AddHeldAccountsResponse or error will be non-nil. Any
  3745. // non-2xx status code is an error. Response headers are in either
  3746. // *AddHeldAccountsResponse.ServerResponse.Header or (if a response was
  3747. // returned at all) in error.(*googleapi.Error).Header. Use
  3748. // googleapi.IsNotModified to check whether the returned error was
  3749. // because http.StatusNotModified was returned.
  3750. func (c *MattersHoldsAddHeldAccountsCall) Do(opts ...googleapi.CallOption) (*AddHeldAccountsResponse, error) {
  3751. gensupport.SetOptions(c.urlParams_, opts...)
  3752. res, err := c.doRequest("json")
  3753. if res != nil && res.StatusCode == http.StatusNotModified {
  3754. if res.Body != nil {
  3755. res.Body.Close()
  3756. }
  3757. return nil, &googleapi.Error{
  3758. Code: res.StatusCode,
  3759. Header: res.Header,
  3760. }
  3761. }
  3762. if err != nil {
  3763. return nil, err
  3764. }
  3765. defer googleapi.CloseBody(res)
  3766. if err := googleapi.CheckResponse(res); err != nil {
  3767. return nil, err
  3768. }
  3769. ret := &AddHeldAccountsResponse{
  3770. ServerResponse: googleapi.ServerResponse{
  3771. Header: res.Header,
  3772. HTTPStatusCode: res.StatusCode,
  3773. },
  3774. }
  3775. target := &ret
  3776. if err := gensupport.DecodeResponse(target, res); err != nil {
  3777. return nil, err
  3778. }
  3779. return ret, nil
  3780. // {
  3781. // "description": "Adds HeldAccounts to a hold. Returns a list of accounts that have been\nsuccessfully added. Accounts can only be added to an existing account-based\nhold.",
  3782. // "flatPath": "v1/matters/{matterId}/holds/{holdId}:addHeldAccounts",
  3783. // "httpMethod": "POST",
  3784. // "id": "vault.matters.holds.addHeldAccounts",
  3785. // "parameterOrder": [
  3786. // "matterId",
  3787. // "holdId"
  3788. // ],
  3789. // "parameters": {
  3790. // "holdId": {
  3791. // "description": "The hold ID.",
  3792. // "location": "path",
  3793. // "required": true,
  3794. // "type": "string"
  3795. // },
  3796. // "matterId": {
  3797. // "description": "The matter ID.",
  3798. // "location": "path",
  3799. // "required": true,
  3800. // "type": "string"
  3801. // }
  3802. // },
  3803. // "path": "v1/matters/{matterId}/holds/{holdId}:addHeldAccounts",
  3804. // "request": {
  3805. // "$ref": "AddHeldAccountsRequest"
  3806. // },
  3807. // "response": {
  3808. // "$ref": "AddHeldAccountsResponse"
  3809. // },
  3810. // "scopes": [
  3811. // "https://www.googleapis.com/auth/ediscovery"
  3812. // ]
  3813. // }
  3814. }
  3815. // method id "vault.matters.holds.create":
  3816. type MattersHoldsCreateCall struct {
  3817. s *Service
  3818. matterId string
  3819. hold *Hold
  3820. urlParams_ gensupport.URLParams
  3821. ctx_ context.Context
  3822. header_ http.Header
  3823. }
  3824. // Create: Creates a hold in the given matter.
  3825. func (r *MattersHoldsService) Create(matterId string, hold *Hold) *MattersHoldsCreateCall {
  3826. c := &MattersHoldsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3827. c.matterId = matterId
  3828. c.hold = hold
  3829. return c
  3830. }
  3831. // Fields allows partial responses to be retrieved. See
  3832. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3833. // for more information.
  3834. func (c *MattersHoldsCreateCall) Fields(s ...googleapi.Field) *MattersHoldsCreateCall {
  3835. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3836. return c
  3837. }
  3838. // Context sets the context to be used in this call's Do method. Any
  3839. // pending HTTP request will be aborted if the provided context is
  3840. // canceled.
  3841. func (c *MattersHoldsCreateCall) Context(ctx context.Context) *MattersHoldsCreateCall {
  3842. c.ctx_ = ctx
  3843. return c
  3844. }
  3845. // Header returns an http.Header that can be modified by the caller to
  3846. // add HTTP headers to the request.
  3847. func (c *MattersHoldsCreateCall) Header() http.Header {
  3848. if c.header_ == nil {
  3849. c.header_ = make(http.Header)
  3850. }
  3851. return c.header_
  3852. }
  3853. func (c *MattersHoldsCreateCall) doRequest(alt string) (*http.Response, error) {
  3854. reqHeaders := make(http.Header)
  3855. for k, v := range c.header_ {
  3856. reqHeaders[k] = v
  3857. }
  3858. reqHeaders.Set("User-Agent", c.s.userAgent())
  3859. var body io.Reader = nil
  3860. body, err := googleapi.WithoutDataWrapper.JSONReader(c.hold)
  3861. if err != nil {
  3862. return nil, err
  3863. }
  3864. reqHeaders.Set("Content-Type", "application/json")
  3865. c.urlParams_.Set("alt", alt)
  3866. c.urlParams_.Set("prettyPrint", "false")
  3867. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds")
  3868. urls += "?" + c.urlParams_.Encode()
  3869. req, err := http.NewRequest("POST", urls, body)
  3870. if err != nil {
  3871. return nil, err
  3872. }
  3873. req.Header = reqHeaders
  3874. googleapi.Expand(req.URL, map[string]string{
  3875. "matterId": c.matterId,
  3876. })
  3877. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3878. }
  3879. // Do executes the "vault.matters.holds.create" call.
  3880. // Exactly one of *Hold or error will be non-nil. Any non-2xx status
  3881. // code is an error. Response headers are in either
  3882. // *Hold.ServerResponse.Header or (if a response was returned at all) in
  3883. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3884. // whether the returned error was because http.StatusNotModified was
  3885. // returned.
  3886. func (c *MattersHoldsCreateCall) Do(opts ...googleapi.CallOption) (*Hold, error) {
  3887. gensupport.SetOptions(c.urlParams_, opts...)
  3888. res, err := c.doRequest("json")
  3889. if res != nil && res.StatusCode == http.StatusNotModified {
  3890. if res.Body != nil {
  3891. res.Body.Close()
  3892. }
  3893. return nil, &googleapi.Error{
  3894. Code: res.StatusCode,
  3895. Header: res.Header,
  3896. }
  3897. }
  3898. if err != nil {
  3899. return nil, err
  3900. }
  3901. defer googleapi.CloseBody(res)
  3902. if err := googleapi.CheckResponse(res); err != nil {
  3903. return nil, err
  3904. }
  3905. ret := &Hold{
  3906. ServerResponse: googleapi.ServerResponse{
  3907. Header: res.Header,
  3908. HTTPStatusCode: res.StatusCode,
  3909. },
  3910. }
  3911. target := &ret
  3912. if err := gensupport.DecodeResponse(target, res); err != nil {
  3913. return nil, err
  3914. }
  3915. return ret, nil
  3916. // {
  3917. // "description": "Creates a hold in the given matter.",
  3918. // "flatPath": "v1/matters/{matterId}/holds",
  3919. // "httpMethod": "POST",
  3920. // "id": "vault.matters.holds.create",
  3921. // "parameterOrder": [
  3922. // "matterId"
  3923. // ],
  3924. // "parameters": {
  3925. // "matterId": {
  3926. // "description": "The matter ID.",
  3927. // "location": "path",
  3928. // "required": true,
  3929. // "type": "string"
  3930. // }
  3931. // },
  3932. // "path": "v1/matters/{matterId}/holds",
  3933. // "request": {
  3934. // "$ref": "Hold"
  3935. // },
  3936. // "response": {
  3937. // "$ref": "Hold"
  3938. // },
  3939. // "scopes": [
  3940. // "https://www.googleapis.com/auth/ediscovery"
  3941. // ]
  3942. // }
  3943. }
  3944. // method id "vault.matters.holds.delete":
  3945. type MattersHoldsDeleteCall struct {
  3946. s *Service
  3947. matterId string
  3948. holdId string
  3949. urlParams_ gensupport.URLParams
  3950. ctx_ context.Context
  3951. header_ http.Header
  3952. }
  3953. // Delete: Removes a hold by ID. This will release any HeldAccounts on
  3954. // this Hold.
  3955. func (r *MattersHoldsService) Delete(matterId string, holdId string) *MattersHoldsDeleteCall {
  3956. c := &MattersHoldsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3957. c.matterId = matterId
  3958. c.holdId = holdId
  3959. return c
  3960. }
  3961. // Fields allows partial responses to be retrieved. See
  3962. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3963. // for more information.
  3964. func (c *MattersHoldsDeleteCall) Fields(s ...googleapi.Field) *MattersHoldsDeleteCall {
  3965. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3966. return c
  3967. }
  3968. // Context sets the context to be used in this call's Do method. Any
  3969. // pending HTTP request will be aborted if the provided context is
  3970. // canceled.
  3971. func (c *MattersHoldsDeleteCall) Context(ctx context.Context) *MattersHoldsDeleteCall {
  3972. c.ctx_ = ctx
  3973. return c
  3974. }
  3975. // Header returns an http.Header that can be modified by the caller to
  3976. // add HTTP headers to the request.
  3977. func (c *MattersHoldsDeleteCall) Header() http.Header {
  3978. if c.header_ == nil {
  3979. c.header_ = make(http.Header)
  3980. }
  3981. return c.header_
  3982. }
  3983. func (c *MattersHoldsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3984. reqHeaders := make(http.Header)
  3985. for k, v := range c.header_ {
  3986. reqHeaders[k] = v
  3987. }
  3988. reqHeaders.Set("User-Agent", c.s.userAgent())
  3989. var body io.Reader = nil
  3990. c.urlParams_.Set("alt", alt)
  3991. c.urlParams_.Set("prettyPrint", "false")
  3992. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds/{holdId}")
  3993. urls += "?" + c.urlParams_.Encode()
  3994. req, err := http.NewRequest("DELETE", urls, body)
  3995. if err != nil {
  3996. return nil, err
  3997. }
  3998. req.Header = reqHeaders
  3999. googleapi.Expand(req.URL, map[string]string{
  4000. "matterId": c.matterId,
  4001. "holdId": c.holdId,
  4002. })
  4003. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4004. }
  4005. // Do executes the "vault.matters.holds.delete" call.
  4006. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  4007. // code is an error. Response headers are in either
  4008. // *Empty.ServerResponse.Header or (if a response was returned at all)
  4009. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4010. // check whether the returned error was because http.StatusNotModified
  4011. // was returned.
  4012. func (c *MattersHoldsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4013. gensupport.SetOptions(c.urlParams_, opts...)
  4014. res, err := c.doRequest("json")
  4015. if res != nil && res.StatusCode == http.StatusNotModified {
  4016. if res.Body != nil {
  4017. res.Body.Close()
  4018. }
  4019. return nil, &googleapi.Error{
  4020. Code: res.StatusCode,
  4021. Header: res.Header,
  4022. }
  4023. }
  4024. if err != nil {
  4025. return nil, err
  4026. }
  4027. defer googleapi.CloseBody(res)
  4028. if err := googleapi.CheckResponse(res); err != nil {
  4029. return nil, err
  4030. }
  4031. ret := &Empty{
  4032. ServerResponse: googleapi.ServerResponse{
  4033. Header: res.Header,
  4034. HTTPStatusCode: res.StatusCode,
  4035. },
  4036. }
  4037. target := &ret
  4038. if err := gensupport.DecodeResponse(target, res); err != nil {
  4039. return nil, err
  4040. }
  4041. return ret, nil
  4042. // {
  4043. // "description": "Removes a hold by ID. This will release any HeldAccounts on this Hold.",
  4044. // "flatPath": "v1/matters/{matterId}/holds/{holdId}",
  4045. // "httpMethod": "DELETE",
  4046. // "id": "vault.matters.holds.delete",
  4047. // "parameterOrder": [
  4048. // "matterId",
  4049. // "holdId"
  4050. // ],
  4051. // "parameters": {
  4052. // "holdId": {
  4053. // "description": "The hold ID.",
  4054. // "location": "path",
  4055. // "required": true,
  4056. // "type": "string"
  4057. // },
  4058. // "matterId": {
  4059. // "description": "The matter ID.",
  4060. // "location": "path",
  4061. // "required": true,
  4062. // "type": "string"
  4063. // }
  4064. // },
  4065. // "path": "v1/matters/{matterId}/holds/{holdId}",
  4066. // "response": {
  4067. // "$ref": "Empty"
  4068. // },
  4069. // "scopes": [
  4070. // "https://www.googleapis.com/auth/ediscovery"
  4071. // ]
  4072. // }
  4073. }
  4074. // method id "vault.matters.holds.get":
  4075. type MattersHoldsGetCall struct {
  4076. s *Service
  4077. matterId string
  4078. holdId string
  4079. urlParams_ gensupport.URLParams
  4080. ifNoneMatch_ string
  4081. ctx_ context.Context
  4082. header_ http.Header
  4083. }
  4084. // Get: Gets a hold by ID.
  4085. func (r *MattersHoldsService) Get(matterId string, holdId string) *MattersHoldsGetCall {
  4086. c := &MattersHoldsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4087. c.matterId = matterId
  4088. c.holdId = holdId
  4089. return c
  4090. }
  4091. // View sets the optional parameter "view": Specifies which parts of the
  4092. // Hold to return.
  4093. //
  4094. // Possible values:
  4095. // "HOLD_VIEW_UNSPECIFIED"
  4096. // "BASIC_HOLD"
  4097. // "FULL_HOLD"
  4098. func (c *MattersHoldsGetCall) View(view string) *MattersHoldsGetCall {
  4099. c.urlParams_.Set("view", view)
  4100. return c
  4101. }
  4102. // Fields allows partial responses to be retrieved. See
  4103. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4104. // for more information.
  4105. func (c *MattersHoldsGetCall) Fields(s ...googleapi.Field) *MattersHoldsGetCall {
  4106. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4107. return c
  4108. }
  4109. // IfNoneMatch sets the optional parameter which makes the operation
  4110. // fail if the object's ETag matches the given value. This is useful for
  4111. // getting updates only after the object has changed since the last
  4112. // request. Use googleapi.IsNotModified to check whether the response
  4113. // error from Do is the result of In-None-Match.
  4114. func (c *MattersHoldsGetCall) IfNoneMatch(entityTag string) *MattersHoldsGetCall {
  4115. c.ifNoneMatch_ = entityTag
  4116. return c
  4117. }
  4118. // Context sets the context to be used in this call's Do method. Any
  4119. // pending HTTP request will be aborted if the provided context is
  4120. // canceled.
  4121. func (c *MattersHoldsGetCall) Context(ctx context.Context) *MattersHoldsGetCall {
  4122. c.ctx_ = ctx
  4123. return c
  4124. }
  4125. // Header returns an http.Header that can be modified by the caller to
  4126. // add HTTP headers to the request.
  4127. func (c *MattersHoldsGetCall) Header() http.Header {
  4128. if c.header_ == nil {
  4129. c.header_ = make(http.Header)
  4130. }
  4131. return c.header_
  4132. }
  4133. func (c *MattersHoldsGetCall) doRequest(alt string) (*http.Response, error) {
  4134. reqHeaders := make(http.Header)
  4135. for k, v := range c.header_ {
  4136. reqHeaders[k] = v
  4137. }
  4138. reqHeaders.Set("User-Agent", c.s.userAgent())
  4139. if c.ifNoneMatch_ != "" {
  4140. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4141. }
  4142. var body io.Reader = nil
  4143. c.urlParams_.Set("alt", alt)
  4144. c.urlParams_.Set("prettyPrint", "false")
  4145. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds/{holdId}")
  4146. urls += "?" + c.urlParams_.Encode()
  4147. req, err := http.NewRequest("GET", urls, body)
  4148. if err != nil {
  4149. return nil, err
  4150. }
  4151. req.Header = reqHeaders
  4152. googleapi.Expand(req.URL, map[string]string{
  4153. "matterId": c.matterId,
  4154. "holdId": c.holdId,
  4155. })
  4156. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4157. }
  4158. // Do executes the "vault.matters.holds.get" call.
  4159. // Exactly one of *Hold or error will be non-nil. Any non-2xx status
  4160. // code is an error. Response headers are in either
  4161. // *Hold.ServerResponse.Header or (if a response was returned at all) in
  4162. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4163. // whether the returned error was because http.StatusNotModified was
  4164. // returned.
  4165. func (c *MattersHoldsGetCall) Do(opts ...googleapi.CallOption) (*Hold, error) {
  4166. gensupport.SetOptions(c.urlParams_, opts...)
  4167. res, err := c.doRequest("json")
  4168. if res != nil && res.StatusCode == http.StatusNotModified {
  4169. if res.Body != nil {
  4170. res.Body.Close()
  4171. }
  4172. return nil, &googleapi.Error{
  4173. Code: res.StatusCode,
  4174. Header: res.Header,
  4175. }
  4176. }
  4177. if err != nil {
  4178. return nil, err
  4179. }
  4180. defer googleapi.CloseBody(res)
  4181. if err := googleapi.CheckResponse(res); err != nil {
  4182. return nil, err
  4183. }
  4184. ret := &Hold{
  4185. ServerResponse: googleapi.ServerResponse{
  4186. Header: res.Header,
  4187. HTTPStatusCode: res.StatusCode,
  4188. },
  4189. }
  4190. target := &ret
  4191. if err := gensupport.DecodeResponse(target, res); err != nil {
  4192. return nil, err
  4193. }
  4194. return ret, nil
  4195. // {
  4196. // "description": "Gets a hold by ID.",
  4197. // "flatPath": "v1/matters/{matterId}/holds/{holdId}",
  4198. // "httpMethod": "GET",
  4199. // "id": "vault.matters.holds.get",
  4200. // "parameterOrder": [
  4201. // "matterId",
  4202. // "holdId"
  4203. // ],
  4204. // "parameters": {
  4205. // "holdId": {
  4206. // "description": "The hold ID.",
  4207. // "location": "path",
  4208. // "required": true,
  4209. // "type": "string"
  4210. // },
  4211. // "matterId": {
  4212. // "description": "The matter ID.",
  4213. // "location": "path",
  4214. // "required": true,
  4215. // "type": "string"
  4216. // },
  4217. // "view": {
  4218. // "description": "Specifies which parts of the Hold to return.",
  4219. // "enum": [
  4220. // "HOLD_VIEW_UNSPECIFIED",
  4221. // "BASIC_HOLD",
  4222. // "FULL_HOLD"
  4223. // ],
  4224. // "location": "query",
  4225. // "type": "string"
  4226. // }
  4227. // },
  4228. // "path": "v1/matters/{matterId}/holds/{holdId}",
  4229. // "response": {
  4230. // "$ref": "Hold"
  4231. // },
  4232. // "scopes": [
  4233. // "https://www.googleapis.com/auth/ediscovery",
  4234. // "https://www.googleapis.com/auth/ediscovery.readonly"
  4235. // ]
  4236. // }
  4237. }
  4238. // method id "vault.matters.holds.list":
  4239. type MattersHoldsListCall struct {
  4240. s *Service
  4241. matterId string
  4242. urlParams_ gensupport.URLParams
  4243. ifNoneMatch_ string
  4244. ctx_ context.Context
  4245. header_ http.Header
  4246. }
  4247. // List: Lists holds within a matter. An empty page token in
  4248. // ListHoldsResponse
  4249. // denotes no more holds to list.
  4250. func (r *MattersHoldsService) List(matterId string) *MattersHoldsListCall {
  4251. c := &MattersHoldsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4252. c.matterId = matterId
  4253. return c
  4254. }
  4255. // PageSize sets the optional parameter "pageSize": The number of holds
  4256. // to return in the response, between 0 and 100 inclusive.
  4257. // Leaving this empty, or as 0, is the same as page_size = 100.
  4258. func (c *MattersHoldsListCall) PageSize(pageSize int64) *MattersHoldsListCall {
  4259. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4260. return c
  4261. }
  4262. // PageToken sets the optional parameter "pageToken": The pagination
  4263. // token as returned in the response.
  4264. // An empty token means start from the beginning.
  4265. func (c *MattersHoldsListCall) PageToken(pageToken string) *MattersHoldsListCall {
  4266. c.urlParams_.Set("pageToken", pageToken)
  4267. return c
  4268. }
  4269. // View sets the optional parameter "view": Specifies which parts of the
  4270. // Hold to return.
  4271. //
  4272. // Possible values:
  4273. // "HOLD_VIEW_UNSPECIFIED"
  4274. // "BASIC_HOLD"
  4275. // "FULL_HOLD"
  4276. func (c *MattersHoldsListCall) View(view string) *MattersHoldsListCall {
  4277. c.urlParams_.Set("view", view)
  4278. return c
  4279. }
  4280. // Fields allows partial responses to be retrieved. See
  4281. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4282. // for more information.
  4283. func (c *MattersHoldsListCall) Fields(s ...googleapi.Field) *MattersHoldsListCall {
  4284. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4285. return c
  4286. }
  4287. // IfNoneMatch sets the optional parameter which makes the operation
  4288. // fail if the object's ETag matches the given value. This is useful for
  4289. // getting updates only after the object has changed since the last
  4290. // request. Use googleapi.IsNotModified to check whether the response
  4291. // error from Do is the result of In-None-Match.
  4292. func (c *MattersHoldsListCall) IfNoneMatch(entityTag string) *MattersHoldsListCall {
  4293. c.ifNoneMatch_ = entityTag
  4294. return c
  4295. }
  4296. // Context sets the context to be used in this call's Do method. Any
  4297. // pending HTTP request will be aborted if the provided context is
  4298. // canceled.
  4299. func (c *MattersHoldsListCall) Context(ctx context.Context) *MattersHoldsListCall {
  4300. c.ctx_ = ctx
  4301. return c
  4302. }
  4303. // Header returns an http.Header that can be modified by the caller to
  4304. // add HTTP headers to the request.
  4305. func (c *MattersHoldsListCall) Header() http.Header {
  4306. if c.header_ == nil {
  4307. c.header_ = make(http.Header)
  4308. }
  4309. return c.header_
  4310. }
  4311. func (c *MattersHoldsListCall) doRequest(alt string) (*http.Response, error) {
  4312. reqHeaders := make(http.Header)
  4313. for k, v := range c.header_ {
  4314. reqHeaders[k] = v
  4315. }
  4316. reqHeaders.Set("User-Agent", c.s.userAgent())
  4317. if c.ifNoneMatch_ != "" {
  4318. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4319. }
  4320. var body io.Reader = nil
  4321. c.urlParams_.Set("alt", alt)
  4322. c.urlParams_.Set("prettyPrint", "false")
  4323. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds")
  4324. urls += "?" + c.urlParams_.Encode()
  4325. req, err := http.NewRequest("GET", urls, body)
  4326. if err != nil {
  4327. return nil, err
  4328. }
  4329. req.Header = reqHeaders
  4330. googleapi.Expand(req.URL, map[string]string{
  4331. "matterId": c.matterId,
  4332. })
  4333. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4334. }
  4335. // Do executes the "vault.matters.holds.list" call.
  4336. // Exactly one of *ListHoldsResponse or error will be non-nil. Any
  4337. // non-2xx status code is an error. Response headers are in either
  4338. // *ListHoldsResponse.ServerResponse.Header or (if a response was
  4339. // returned at all) in error.(*googleapi.Error).Header. Use
  4340. // googleapi.IsNotModified to check whether the returned error was
  4341. // because http.StatusNotModified was returned.
  4342. func (c *MattersHoldsListCall) Do(opts ...googleapi.CallOption) (*ListHoldsResponse, error) {
  4343. gensupport.SetOptions(c.urlParams_, opts...)
  4344. res, err := c.doRequest("json")
  4345. if res != nil && res.StatusCode == http.StatusNotModified {
  4346. if res.Body != nil {
  4347. res.Body.Close()
  4348. }
  4349. return nil, &googleapi.Error{
  4350. Code: res.StatusCode,
  4351. Header: res.Header,
  4352. }
  4353. }
  4354. if err != nil {
  4355. return nil, err
  4356. }
  4357. defer googleapi.CloseBody(res)
  4358. if err := googleapi.CheckResponse(res); err != nil {
  4359. return nil, err
  4360. }
  4361. ret := &ListHoldsResponse{
  4362. ServerResponse: googleapi.ServerResponse{
  4363. Header: res.Header,
  4364. HTTPStatusCode: res.StatusCode,
  4365. },
  4366. }
  4367. target := &ret
  4368. if err := gensupport.DecodeResponse(target, res); err != nil {
  4369. return nil, err
  4370. }
  4371. return ret, nil
  4372. // {
  4373. // "description": "Lists holds within a matter. An empty page token in ListHoldsResponse\ndenotes no more holds to list.",
  4374. // "flatPath": "v1/matters/{matterId}/holds",
  4375. // "httpMethod": "GET",
  4376. // "id": "vault.matters.holds.list",
  4377. // "parameterOrder": [
  4378. // "matterId"
  4379. // ],
  4380. // "parameters": {
  4381. // "matterId": {
  4382. // "description": "The matter ID.",
  4383. // "location": "path",
  4384. // "required": true,
  4385. // "type": "string"
  4386. // },
  4387. // "pageSize": {
  4388. // "description": "The number of holds to return in the response, between 0 and 100 inclusive.\nLeaving this empty, or as 0, is the same as page_size = 100.",
  4389. // "format": "int32",
  4390. // "location": "query",
  4391. // "type": "integer"
  4392. // },
  4393. // "pageToken": {
  4394. // "description": "The pagination token as returned in the response.\nAn empty token means start from the beginning.",
  4395. // "location": "query",
  4396. // "type": "string"
  4397. // },
  4398. // "view": {
  4399. // "description": "Specifies which parts of the Hold to return.",
  4400. // "enum": [
  4401. // "HOLD_VIEW_UNSPECIFIED",
  4402. // "BASIC_HOLD",
  4403. // "FULL_HOLD"
  4404. // ],
  4405. // "location": "query",
  4406. // "type": "string"
  4407. // }
  4408. // },
  4409. // "path": "v1/matters/{matterId}/holds",
  4410. // "response": {
  4411. // "$ref": "ListHoldsResponse"
  4412. // },
  4413. // "scopes": [
  4414. // "https://www.googleapis.com/auth/ediscovery",
  4415. // "https://www.googleapis.com/auth/ediscovery.readonly"
  4416. // ]
  4417. // }
  4418. }
  4419. // Pages invokes f for each page of results.
  4420. // A non-nil error returned from f will halt the iteration.
  4421. // The provided context supersedes any context provided to the Context method.
  4422. func (c *MattersHoldsListCall) Pages(ctx context.Context, f func(*ListHoldsResponse) error) error {
  4423. c.ctx_ = ctx
  4424. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4425. for {
  4426. x, err := c.Do()
  4427. if err != nil {
  4428. return err
  4429. }
  4430. if err := f(x); err != nil {
  4431. return err
  4432. }
  4433. if x.NextPageToken == "" {
  4434. return nil
  4435. }
  4436. c.PageToken(x.NextPageToken)
  4437. }
  4438. }
  4439. // method id "vault.matters.holds.removeHeldAccounts":
  4440. type MattersHoldsRemoveHeldAccountsCall struct {
  4441. s *Service
  4442. matterId string
  4443. holdId string
  4444. removeheldaccountsrequest *RemoveHeldAccountsRequest
  4445. urlParams_ gensupport.URLParams
  4446. ctx_ context.Context
  4447. header_ http.Header
  4448. }
  4449. // RemoveHeldAccounts: Removes HeldAccounts from a hold. Returns a list
  4450. // of statuses in the same
  4451. // order as the request. If this request leaves the hold with no
  4452. // held
  4453. // accounts, the hold will not apply to any accounts.
  4454. func (r *MattersHoldsService) RemoveHeldAccounts(matterId string, holdId string, removeheldaccountsrequest *RemoveHeldAccountsRequest) *MattersHoldsRemoveHeldAccountsCall {
  4455. c := &MattersHoldsRemoveHeldAccountsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4456. c.matterId = matterId
  4457. c.holdId = holdId
  4458. c.removeheldaccountsrequest = removeheldaccountsrequest
  4459. return c
  4460. }
  4461. // Fields allows partial responses to be retrieved. See
  4462. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4463. // for more information.
  4464. func (c *MattersHoldsRemoveHeldAccountsCall) Fields(s ...googleapi.Field) *MattersHoldsRemoveHeldAccountsCall {
  4465. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4466. return c
  4467. }
  4468. // Context sets the context to be used in this call's Do method. Any
  4469. // pending HTTP request will be aborted if the provided context is
  4470. // canceled.
  4471. func (c *MattersHoldsRemoveHeldAccountsCall) Context(ctx context.Context) *MattersHoldsRemoveHeldAccountsCall {
  4472. c.ctx_ = ctx
  4473. return c
  4474. }
  4475. // Header returns an http.Header that can be modified by the caller to
  4476. // add HTTP headers to the request.
  4477. func (c *MattersHoldsRemoveHeldAccountsCall) Header() http.Header {
  4478. if c.header_ == nil {
  4479. c.header_ = make(http.Header)
  4480. }
  4481. return c.header_
  4482. }
  4483. func (c *MattersHoldsRemoveHeldAccountsCall) doRequest(alt string) (*http.Response, error) {
  4484. reqHeaders := make(http.Header)
  4485. for k, v := range c.header_ {
  4486. reqHeaders[k] = v
  4487. }
  4488. reqHeaders.Set("User-Agent", c.s.userAgent())
  4489. var body io.Reader = nil
  4490. body, err := googleapi.WithoutDataWrapper.JSONReader(c.removeheldaccountsrequest)
  4491. if err != nil {
  4492. return nil, err
  4493. }
  4494. reqHeaders.Set("Content-Type", "application/json")
  4495. c.urlParams_.Set("alt", alt)
  4496. c.urlParams_.Set("prettyPrint", "false")
  4497. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds/{holdId}:removeHeldAccounts")
  4498. urls += "?" + c.urlParams_.Encode()
  4499. req, err := http.NewRequest("POST", urls, body)
  4500. if err != nil {
  4501. return nil, err
  4502. }
  4503. req.Header = reqHeaders
  4504. googleapi.Expand(req.URL, map[string]string{
  4505. "matterId": c.matterId,
  4506. "holdId": c.holdId,
  4507. })
  4508. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4509. }
  4510. // Do executes the "vault.matters.holds.removeHeldAccounts" call.
  4511. // Exactly one of *RemoveHeldAccountsResponse or error will be non-nil.
  4512. // Any non-2xx status code is an error. Response headers are in either
  4513. // *RemoveHeldAccountsResponse.ServerResponse.Header or (if a response
  4514. // was returned at all) in error.(*googleapi.Error).Header. Use
  4515. // googleapi.IsNotModified to check whether the returned error was
  4516. // because http.StatusNotModified was returned.
  4517. func (c *MattersHoldsRemoveHeldAccountsCall) Do(opts ...googleapi.CallOption) (*RemoveHeldAccountsResponse, error) {
  4518. gensupport.SetOptions(c.urlParams_, opts...)
  4519. res, err := c.doRequest("json")
  4520. if res != nil && res.StatusCode == http.StatusNotModified {
  4521. if res.Body != nil {
  4522. res.Body.Close()
  4523. }
  4524. return nil, &googleapi.Error{
  4525. Code: res.StatusCode,
  4526. Header: res.Header,
  4527. }
  4528. }
  4529. if err != nil {
  4530. return nil, err
  4531. }
  4532. defer googleapi.CloseBody(res)
  4533. if err := googleapi.CheckResponse(res); err != nil {
  4534. return nil, err
  4535. }
  4536. ret := &RemoveHeldAccountsResponse{
  4537. ServerResponse: googleapi.ServerResponse{
  4538. Header: res.Header,
  4539. HTTPStatusCode: res.StatusCode,
  4540. },
  4541. }
  4542. target := &ret
  4543. if err := gensupport.DecodeResponse(target, res); err != nil {
  4544. return nil, err
  4545. }
  4546. return ret, nil
  4547. // {
  4548. // "description": "Removes HeldAccounts from a hold. Returns a list of statuses in the same\norder as the request. If this request leaves the hold with no held\naccounts, the hold will not apply to any accounts.",
  4549. // "flatPath": "v1/matters/{matterId}/holds/{holdId}:removeHeldAccounts",
  4550. // "httpMethod": "POST",
  4551. // "id": "vault.matters.holds.removeHeldAccounts",
  4552. // "parameterOrder": [
  4553. // "matterId",
  4554. // "holdId"
  4555. // ],
  4556. // "parameters": {
  4557. // "holdId": {
  4558. // "description": "The hold ID.",
  4559. // "location": "path",
  4560. // "required": true,
  4561. // "type": "string"
  4562. // },
  4563. // "matterId": {
  4564. // "description": "The matter ID.",
  4565. // "location": "path",
  4566. // "required": true,
  4567. // "type": "string"
  4568. // }
  4569. // },
  4570. // "path": "v1/matters/{matterId}/holds/{holdId}:removeHeldAccounts",
  4571. // "request": {
  4572. // "$ref": "RemoveHeldAccountsRequest"
  4573. // },
  4574. // "response": {
  4575. // "$ref": "RemoveHeldAccountsResponse"
  4576. // },
  4577. // "scopes": [
  4578. // "https://www.googleapis.com/auth/ediscovery"
  4579. // ]
  4580. // }
  4581. }
  4582. // method id "vault.matters.holds.update":
  4583. type MattersHoldsUpdateCall struct {
  4584. s *Service
  4585. matterId string
  4586. holdId string
  4587. hold *Hold
  4588. urlParams_ gensupport.URLParams
  4589. ctx_ context.Context
  4590. header_ http.Header
  4591. }
  4592. // Update: Updates the OU and/or query parameters of a hold. You cannot
  4593. // add accounts
  4594. // to a hold that covers an OU, nor can you add OUs to a hold that
  4595. // covers
  4596. // individual accounts. Accounts listed in the hold will be ignored.
  4597. func (r *MattersHoldsService) Update(matterId string, holdId string, hold *Hold) *MattersHoldsUpdateCall {
  4598. c := &MattersHoldsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4599. c.matterId = matterId
  4600. c.holdId = holdId
  4601. c.hold = hold
  4602. return c
  4603. }
  4604. // Fields allows partial responses to be retrieved. See
  4605. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4606. // for more information.
  4607. func (c *MattersHoldsUpdateCall) Fields(s ...googleapi.Field) *MattersHoldsUpdateCall {
  4608. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4609. return c
  4610. }
  4611. // Context sets the context to be used in this call's Do method. Any
  4612. // pending HTTP request will be aborted if the provided context is
  4613. // canceled.
  4614. func (c *MattersHoldsUpdateCall) Context(ctx context.Context) *MattersHoldsUpdateCall {
  4615. c.ctx_ = ctx
  4616. return c
  4617. }
  4618. // Header returns an http.Header that can be modified by the caller to
  4619. // add HTTP headers to the request.
  4620. func (c *MattersHoldsUpdateCall) Header() http.Header {
  4621. if c.header_ == nil {
  4622. c.header_ = make(http.Header)
  4623. }
  4624. return c.header_
  4625. }
  4626. func (c *MattersHoldsUpdateCall) doRequest(alt string) (*http.Response, error) {
  4627. reqHeaders := make(http.Header)
  4628. for k, v := range c.header_ {
  4629. reqHeaders[k] = v
  4630. }
  4631. reqHeaders.Set("User-Agent", c.s.userAgent())
  4632. var body io.Reader = nil
  4633. body, err := googleapi.WithoutDataWrapper.JSONReader(c.hold)
  4634. if err != nil {
  4635. return nil, err
  4636. }
  4637. reqHeaders.Set("Content-Type", "application/json")
  4638. c.urlParams_.Set("alt", alt)
  4639. c.urlParams_.Set("prettyPrint", "false")
  4640. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds/{holdId}")
  4641. urls += "?" + c.urlParams_.Encode()
  4642. req, err := http.NewRequest("PUT", urls, body)
  4643. if err != nil {
  4644. return nil, err
  4645. }
  4646. req.Header = reqHeaders
  4647. googleapi.Expand(req.URL, map[string]string{
  4648. "matterId": c.matterId,
  4649. "holdId": c.holdId,
  4650. })
  4651. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4652. }
  4653. // Do executes the "vault.matters.holds.update" call.
  4654. // Exactly one of *Hold or error will be non-nil. Any non-2xx status
  4655. // code is an error. Response headers are in either
  4656. // *Hold.ServerResponse.Header or (if a response was returned at all) in
  4657. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4658. // whether the returned error was because http.StatusNotModified was
  4659. // returned.
  4660. func (c *MattersHoldsUpdateCall) Do(opts ...googleapi.CallOption) (*Hold, error) {
  4661. gensupport.SetOptions(c.urlParams_, opts...)
  4662. res, err := c.doRequest("json")
  4663. if res != nil && res.StatusCode == http.StatusNotModified {
  4664. if res.Body != nil {
  4665. res.Body.Close()
  4666. }
  4667. return nil, &googleapi.Error{
  4668. Code: res.StatusCode,
  4669. Header: res.Header,
  4670. }
  4671. }
  4672. if err != nil {
  4673. return nil, err
  4674. }
  4675. defer googleapi.CloseBody(res)
  4676. if err := googleapi.CheckResponse(res); err != nil {
  4677. return nil, err
  4678. }
  4679. ret := &Hold{
  4680. ServerResponse: googleapi.ServerResponse{
  4681. Header: res.Header,
  4682. HTTPStatusCode: res.StatusCode,
  4683. },
  4684. }
  4685. target := &ret
  4686. if err := gensupport.DecodeResponse(target, res); err != nil {
  4687. return nil, err
  4688. }
  4689. return ret, nil
  4690. // {
  4691. // "description": "Updates the OU and/or query parameters of a hold. You cannot add accounts\nto a hold that covers an OU, nor can you add OUs to a hold that covers\nindividual accounts. Accounts listed in the hold will be ignored.",
  4692. // "flatPath": "v1/matters/{matterId}/holds/{holdId}",
  4693. // "httpMethod": "PUT",
  4694. // "id": "vault.matters.holds.update",
  4695. // "parameterOrder": [
  4696. // "matterId",
  4697. // "holdId"
  4698. // ],
  4699. // "parameters": {
  4700. // "holdId": {
  4701. // "description": "The ID of the hold.",
  4702. // "location": "path",
  4703. // "required": true,
  4704. // "type": "string"
  4705. // },
  4706. // "matterId": {
  4707. // "description": "The matter ID.",
  4708. // "location": "path",
  4709. // "required": true,
  4710. // "type": "string"
  4711. // }
  4712. // },
  4713. // "path": "v1/matters/{matterId}/holds/{holdId}",
  4714. // "request": {
  4715. // "$ref": "Hold"
  4716. // },
  4717. // "response": {
  4718. // "$ref": "Hold"
  4719. // },
  4720. // "scopes": [
  4721. // "https://www.googleapis.com/auth/ediscovery"
  4722. // ]
  4723. // }
  4724. }
  4725. // method id "vault.matters.holds.accounts.create":
  4726. type MattersHoldsAccountsCreateCall struct {
  4727. s *Service
  4728. matterId string
  4729. holdId string
  4730. heldaccount *HeldAccount
  4731. urlParams_ gensupport.URLParams
  4732. ctx_ context.Context
  4733. header_ http.Header
  4734. }
  4735. // Create: Adds a HeldAccount to a hold. Accounts can only be added to a
  4736. // hold that
  4737. // has no held_org_unit set. Attempting to add an account to an
  4738. // OU-based
  4739. // hold will result in an error.
  4740. func (r *MattersHoldsAccountsService) Create(matterId string, holdId string, heldaccount *HeldAccount) *MattersHoldsAccountsCreateCall {
  4741. c := &MattersHoldsAccountsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4742. c.matterId = matterId
  4743. c.holdId = holdId
  4744. c.heldaccount = heldaccount
  4745. return c
  4746. }
  4747. // Fields allows partial responses to be retrieved. See
  4748. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4749. // for more information.
  4750. func (c *MattersHoldsAccountsCreateCall) Fields(s ...googleapi.Field) *MattersHoldsAccountsCreateCall {
  4751. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4752. return c
  4753. }
  4754. // Context sets the context to be used in this call's Do method. Any
  4755. // pending HTTP request will be aborted if the provided context is
  4756. // canceled.
  4757. func (c *MattersHoldsAccountsCreateCall) Context(ctx context.Context) *MattersHoldsAccountsCreateCall {
  4758. c.ctx_ = ctx
  4759. return c
  4760. }
  4761. // Header returns an http.Header that can be modified by the caller to
  4762. // add HTTP headers to the request.
  4763. func (c *MattersHoldsAccountsCreateCall) Header() http.Header {
  4764. if c.header_ == nil {
  4765. c.header_ = make(http.Header)
  4766. }
  4767. return c.header_
  4768. }
  4769. func (c *MattersHoldsAccountsCreateCall) doRequest(alt string) (*http.Response, error) {
  4770. reqHeaders := make(http.Header)
  4771. for k, v := range c.header_ {
  4772. reqHeaders[k] = v
  4773. }
  4774. reqHeaders.Set("User-Agent", c.s.userAgent())
  4775. var body io.Reader = nil
  4776. body, err := googleapi.WithoutDataWrapper.JSONReader(c.heldaccount)
  4777. if err != nil {
  4778. return nil, err
  4779. }
  4780. reqHeaders.Set("Content-Type", "application/json")
  4781. c.urlParams_.Set("alt", alt)
  4782. c.urlParams_.Set("prettyPrint", "false")
  4783. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds/{holdId}/accounts")
  4784. urls += "?" + c.urlParams_.Encode()
  4785. req, err := http.NewRequest("POST", urls, body)
  4786. if err != nil {
  4787. return nil, err
  4788. }
  4789. req.Header = reqHeaders
  4790. googleapi.Expand(req.URL, map[string]string{
  4791. "matterId": c.matterId,
  4792. "holdId": c.holdId,
  4793. })
  4794. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4795. }
  4796. // Do executes the "vault.matters.holds.accounts.create" call.
  4797. // Exactly one of *HeldAccount or error will be non-nil. Any non-2xx
  4798. // status code is an error. Response headers are in either
  4799. // *HeldAccount.ServerResponse.Header or (if a response was returned at
  4800. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4801. // to check whether the returned error was because
  4802. // http.StatusNotModified was returned.
  4803. func (c *MattersHoldsAccountsCreateCall) Do(opts ...googleapi.CallOption) (*HeldAccount, error) {
  4804. gensupport.SetOptions(c.urlParams_, opts...)
  4805. res, err := c.doRequest("json")
  4806. if res != nil && res.StatusCode == http.StatusNotModified {
  4807. if res.Body != nil {
  4808. res.Body.Close()
  4809. }
  4810. return nil, &googleapi.Error{
  4811. Code: res.StatusCode,
  4812. Header: res.Header,
  4813. }
  4814. }
  4815. if err != nil {
  4816. return nil, err
  4817. }
  4818. defer googleapi.CloseBody(res)
  4819. if err := googleapi.CheckResponse(res); err != nil {
  4820. return nil, err
  4821. }
  4822. ret := &HeldAccount{
  4823. ServerResponse: googleapi.ServerResponse{
  4824. Header: res.Header,
  4825. HTTPStatusCode: res.StatusCode,
  4826. },
  4827. }
  4828. target := &ret
  4829. if err := gensupport.DecodeResponse(target, res); err != nil {
  4830. return nil, err
  4831. }
  4832. return ret, nil
  4833. // {
  4834. // "description": "Adds a HeldAccount to a hold. Accounts can only be added to a hold that\nhas no held_org_unit set. Attempting to add an account to an OU-based\nhold will result in an error.",
  4835. // "flatPath": "v1/matters/{matterId}/holds/{holdId}/accounts",
  4836. // "httpMethod": "POST",
  4837. // "id": "vault.matters.holds.accounts.create",
  4838. // "parameterOrder": [
  4839. // "matterId",
  4840. // "holdId"
  4841. // ],
  4842. // "parameters": {
  4843. // "holdId": {
  4844. // "description": "The hold ID.",
  4845. // "location": "path",
  4846. // "required": true,
  4847. // "type": "string"
  4848. // },
  4849. // "matterId": {
  4850. // "description": "The matter ID.",
  4851. // "location": "path",
  4852. // "required": true,
  4853. // "type": "string"
  4854. // }
  4855. // },
  4856. // "path": "v1/matters/{matterId}/holds/{holdId}/accounts",
  4857. // "request": {
  4858. // "$ref": "HeldAccount"
  4859. // },
  4860. // "response": {
  4861. // "$ref": "HeldAccount"
  4862. // },
  4863. // "scopes": [
  4864. // "https://www.googleapis.com/auth/ediscovery"
  4865. // ]
  4866. // }
  4867. }
  4868. // method id "vault.matters.holds.accounts.delete":
  4869. type MattersHoldsAccountsDeleteCall struct {
  4870. s *Service
  4871. matterId string
  4872. holdId string
  4873. accountId string
  4874. urlParams_ gensupport.URLParams
  4875. ctx_ context.Context
  4876. header_ http.Header
  4877. }
  4878. // Delete: Removes a HeldAccount from a hold. If this request leaves the
  4879. // hold with
  4880. // no held accounts, the hold will not apply to any accounts.
  4881. func (r *MattersHoldsAccountsService) Delete(matterId string, holdId string, accountId string) *MattersHoldsAccountsDeleteCall {
  4882. c := &MattersHoldsAccountsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4883. c.matterId = matterId
  4884. c.holdId = holdId
  4885. c.accountId = accountId
  4886. return c
  4887. }
  4888. // Fields allows partial responses to be retrieved. See
  4889. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4890. // for more information.
  4891. func (c *MattersHoldsAccountsDeleteCall) Fields(s ...googleapi.Field) *MattersHoldsAccountsDeleteCall {
  4892. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4893. return c
  4894. }
  4895. // Context sets the context to be used in this call's Do method. Any
  4896. // pending HTTP request will be aborted if the provided context is
  4897. // canceled.
  4898. func (c *MattersHoldsAccountsDeleteCall) Context(ctx context.Context) *MattersHoldsAccountsDeleteCall {
  4899. c.ctx_ = ctx
  4900. return c
  4901. }
  4902. // Header returns an http.Header that can be modified by the caller to
  4903. // add HTTP headers to the request.
  4904. func (c *MattersHoldsAccountsDeleteCall) Header() http.Header {
  4905. if c.header_ == nil {
  4906. c.header_ = make(http.Header)
  4907. }
  4908. return c.header_
  4909. }
  4910. func (c *MattersHoldsAccountsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4911. reqHeaders := make(http.Header)
  4912. for k, v := range c.header_ {
  4913. reqHeaders[k] = v
  4914. }
  4915. reqHeaders.Set("User-Agent", c.s.userAgent())
  4916. var body io.Reader = nil
  4917. c.urlParams_.Set("alt", alt)
  4918. c.urlParams_.Set("prettyPrint", "false")
  4919. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds/{holdId}/accounts/{accountId}")
  4920. urls += "?" + c.urlParams_.Encode()
  4921. req, err := http.NewRequest("DELETE", urls, body)
  4922. if err != nil {
  4923. return nil, err
  4924. }
  4925. req.Header = reqHeaders
  4926. googleapi.Expand(req.URL, map[string]string{
  4927. "matterId": c.matterId,
  4928. "holdId": c.holdId,
  4929. "accountId": c.accountId,
  4930. })
  4931. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4932. }
  4933. // Do executes the "vault.matters.holds.accounts.delete" call.
  4934. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  4935. // code is an error. Response headers are in either
  4936. // *Empty.ServerResponse.Header or (if a response was returned at all)
  4937. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4938. // check whether the returned error was because http.StatusNotModified
  4939. // was returned.
  4940. func (c *MattersHoldsAccountsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4941. gensupport.SetOptions(c.urlParams_, opts...)
  4942. res, err := c.doRequest("json")
  4943. if res != nil && res.StatusCode == http.StatusNotModified {
  4944. if res.Body != nil {
  4945. res.Body.Close()
  4946. }
  4947. return nil, &googleapi.Error{
  4948. Code: res.StatusCode,
  4949. Header: res.Header,
  4950. }
  4951. }
  4952. if err != nil {
  4953. return nil, err
  4954. }
  4955. defer googleapi.CloseBody(res)
  4956. if err := googleapi.CheckResponse(res); err != nil {
  4957. return nil, err
  4958. }
  4959. ret := &Empty{
  4960. ServerResponse: googleapi.ServerResponse{
  4961. Header: res.Header,
  4962. HTTPStatusCode: res.StatusCode,
  4963. },
  4964. }
  4965. target := &ret
  4966. if err := gensupport.DecodeResponse(target, res); err != nil {
  4967. return nil, err
  4968. }
  4969. return ret, nil
  4970. // {
  4971. // "description": "Removes a HeldAccount from a hold. If this request leaves the hold with\nno held accounts, the hold will not apply to any accounts.",
  4972. // "flatPath": "v1/matters/{matterId}/holds/{holdId}/accounts/{accountId}",
  4973. // "httpMethod": "DELETE",
  4974. // "id": "vault.matters.holds.accounts.delete",
  4975. // "parameterOrder": [
  4976. // "matterId",
  4977. // "holdId",
  4978. // "accountId"
  4979. // ],
  4980. // "parameters": {
  4981. // "accountId": {
  4982. // "description": "The ID of the account to remove from the hold.",
  4983. // "location": "path",
  4984. // "required": true,
  4985. // "type": "string"
  4986. // },
  4987. // "holdId": {
  4988. // "description": "The hold ID.",
  4989. // "location": "path",
  4990. // "required": true,
  4991. // "type": "string"
  4992. // },
  4993. // "matterId": {
  4994. // "description": "The matter ID.",
  4995. // "location": "path",
  4996. // "required": true,
  4997. // "type": "string"
  4998. // }
  4999. // },
  5000. // "path": "v1/matters/{matterId}/holds/{holdId}/accounts/{accountId}",
  5001. // "response": {
  5002. // "$ref": "Empty"
  5003. // },
  5004. // "scopes": [
  5005. // "https://www.googleapis.com/auth/ediscovery"
  5006. // ]
  5007. // }
  5008. }
  5009. // method id "vault.matters.holds.accounts.list":
  5010. type MattersHoldsAccountsListCall struct {
  5011. s *Service
  5012. matterId string
  5013. holdId string
  5014. urlParams_ gensupport.URLParams
  5015. ifNoneMatch_ string
  5016. ctx_ context.Context
  5017. header_ http.Header
  5018. }
  5019. // List: Lists HeldAccounts for a hold. This will only list individually
  5020. // specified
  5021. // held accounts. If the hold is on an OU, then use
  5022. // <a href="https://developers.google.com/admin-sdk/">Admin SDK</a>
  5023. // to enumerate its members.
  5024. func (r *MattersHoldsAccountsService) List(matterId string, holdId string) *MattersHoldsAccountsListCall {
  5025. c := &MattersHoldsAccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5026. c.matterId = matterId
  5027. c.holdId = holdId
  5028. return c
  5029. }
  5030. // Fields allows partial responses to be retrieved. See
  5031. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5032. // for more information.
  5033. func (c *MattersHoldsAccountsListCall) Fields(s ...googleapi.Field) *MattersHoldsAccountsListCall {
  5034. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5035. return c
  5036. }
  5037. // IfNoneMatch sets the optional parameter which makes the operation
  5038. // fail if the object's ETag matches the given value. This is useful for
  5039. // getting updates only after the object has changed since the last
  5040. // request. Use googleapi.IsNotModified to check whether the response
  5041. // error from Do is the result of In-None-Match.
  5042. func (c *MattersHoldsAccountsListCall) IfNoneMatch(entityTag string) *MattersHoldsAccountsListCall {
  5043. c.ifNoneMatch_ = entityTag
  5044. return c
  5045. }
  5046. // Context sets the context to be used in this call's Do method. Any
  5047. // pending HTTP request will be aborted if the provided context is
  5048. // canceled.
  5049. func (c *MattersHoldsAccountsListCall) Context(ctx context.Context) *MattersHoldsAccountsListCall {
  5050. c.ctx_ = ctx
  5051. return c
  5052. }
  5053. // Header returns an http.Header that can be modified by the caller to
  5054. // add HTTP headers to the request.
  5055. func (c *MattersHoldsAccountsListCall) Header() http.Header {
  5056. if c.header_ == nil {
  5057. c.header_ = make(http.Header)
  5058. }
  5059. return c.header_
  5060. }
  5061. func (c *MattersHoldsAccountsListCall) doRequest(alt string) (*http.Response, error) {
  5062. reqHeaders := make(http.Header)
  5063. for k, v := range c.header_ {
  5064. reqHeaders[k] = v
  5065. }
  5066. reqHeaders.Set("User-Agent", c.s.userAgent())
  5067. if c.ifNoneMatch_ != "" {
  5068. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5069. }
  5070. var body io.Reader = nil
  5071. c.urlParams_.Set("alt", alt)
  5072. c.urlParams_.Set("prettyPrint", "false")
  5073. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds/{holdId}/accounts")
  5074. urls += "?" + c.urlParams_.Encode()
  5075. req, err := http.NewRequest("GET", urls, body)
  5076. if err != nil {
  5077. return nil, err
  5078. }
  5079. req.Header = reqHeaders
  5080. googleapi.Expand(req.URL, map[string]string{
  5081. "matterId": c.matterId,
  5082. "holdId": c.holdId,
  5083. })
  5084. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5085. }
  5086. // Do executes the "vault.matters.holds.accounts.list" call.
  5087. // Exactly one of *ListHeldAccountsResponse or error will be non-nil.
  5088. // Any non-2xx status code is an error. Response headers are in either
  5089. // *ListHeldAccountsResponse.ServerResponse.Header or (if a response was
  5090. // returned at all) in error.(*googleapi.Error).Header. Use
  5091. // googleapi.IsNotModified to check whether the returned error was
  5092. // because http.StatusNotModified was returned.
  5093. func (c *MattersHoldsAccountsListCall) Do(opts ...googleapi.CallOption) (*ListHeldAccountsResponse, error) {
  5094. gensupport.SetOptions(c.urlParams_, opts...)
  5095. res, err := c.doRequest("json")
  5096. if res != nil && res.StatusCode == http.StatusNotModified {
  5097. if res.Body != nil {
  5098. res.Body.Close()
  5099. }
  5100. return nil, &googleapi.Error{
  5101. Code: res.StatusCode,
  5102. Header: res.Header,
  5103. }
  5104. }
  5105. if err != nil {
  5106. return nil, err
  5107. }
  5108. defer googleapi.CloseBody(res)
  5109. if err := googleapi.CheckResponse(res); err != nil {
  5110. return nil, err
  5111. }
  5112. ret := &ListHeldAccountsResponse{
  5113. ServerResponse: googleapi.ServerResponse{
  5114. Header: res.Header,
  5115. HTTPStatusCode: res.StatusCode,
  5116. },
  5117. }
  5118. target := &ret
  5119. if err := gensupport.DecodeResponse(target, res); err != nil {
  5120. return nil, err
  5121. }
  5122. return ret, nil
  5123. // {
  5124. // "description": "Lists HeldAccounts for a hold. This will only list individually specified\nheld accounts. If the hold is on an OU, then use\n\u003ca href=\"https://developers.google.com/admin-sdk/\"\u003eAdmin SDK\u003c/a\u003e\nto enumerate its members.",
  5125. // "flatPath": "v1/matters/{matterId}/holds/{holdId}/accounts",
  5126. // "httpMethod": "GET",
  5127. // "id": "vault.matters.holds.accounts.list",
  5128. // "parameterOrder": [
  5129. // "matterId",
  5130. // "holdId"
  5131. // ],
  5132. // "parameters": {
  5133. // "holdId": {
  5134. // "description": "The hold ID.",
  5135. // "location": "path",
  5136. // "required": true,
  5137. // "type": "string"
  5138. // },
  5139. // "matterId": {
  5140. // "description": "The matter ID.",
  5141. // "location": "path",
  5142. // "required": true,
  5143. // "type": "string"
  5144. // }
  5145. // },
  5146. // "path": "v1/matters/{matterId}/holds/{holdId}/accounts",
  5147. // "response": {
  5148. // "$ref": "ListHeldAccountsResponse"
  5149. // },
  5150. // "scopes": [
  5151. // "https://www.googleapis.com/auth/ediscovery",
  5152. // "https://www.googleapis.com/auth/ediscovery.readonly"
  5153. // ]
  5154. // }
  5155. }
  5156. // method id "vault.matters.savedQueries.create":
  5157. type MattersSavedQueriesCreateCall struct {
  5158. s *Service
  5159. matterId string
  5160. savedquery *SavedQuery
  5161. urlParams_ gensupport.URLParams
  5162. ctx_ context.Context
  5163. header_ http.Header
  5164. }
  5165. // Create: Creates a saved query.
  5166. func (r *MattersSavedQueriesService) Create(matterId string, savedquery *SavedQuery) *MattersSavedQueriesCreateCall {
  5167. c := &MattersSavedQueriesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5168. c.matterId = matterId
  5169. c.savedquery = savedquery
  5170. return c
  5171. }
  5172. // Fields allows partial responses to be retrieved. See
  5173. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5174. // for more information.
  5175. func (c *MattersSavedQueriesCreateCall) Fields(s ...googleapi.Field) *MattersSavedQueriesCreateCall {
  5176. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5177. return c
  5178. }
  5179. // Context sets the context to be used in this call's Do method. Any
  5180. // pending HTTP request will be aborted if the provided context is
  5181. // canceled.
  5182. func (c *MattersSavedQueriesCreateCall) Context(ctx context.Context) *MattersSavedQueriesCreateCall {
  5183. c.ctx_ = ctx
  5184. return c
  5185. }
  5186. // Header returns an http.Header that can be modified by the caller to
  5187. // add HTTP headers to the request.
  5188. func (c *MattersSavedQueriesCreateCall) Header() http.Header {
  5189. if c.header_ == nil {
  5190. c.header_ = make(http.Header)
  5191. }
  5192. return c.header_
  5193. }
  5194. func (c *MattersSavedQueriesCreateCall) doRequest(alt string) (*http.Response, error) {
  5195. reqHeaders := make(http.Header)
  5196. for k, v := range c.header_ {
  5197. reqHeaders[k] = v
  5198. }
  5199. reqHeaders.Set("User-Agent", c.s.userAgent())
  5200. var body io.Reader = nil
  5201. body, err := googleapi.WithoutDataWrapper.JSONReader(c.savedquery)
  5202. if err != nil {
  5203. return nil, err
  5204. }
  5205. reqHeaders.Set("Content-Type", "application/json")
  5206. c.urlParams_.Set("alt", alt)
  5207. c.urlParams_.Set("prettyPrint", "false")
  5208. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/savedQueries")
  5209. urls += "?" + c.urlParams_.Encode()
  5210. req, err := http.NewRequest("POST", urls, body)
  5211. if err != nil {
  5212. return nil, err
  5213. }
  5214. req.Header = reqHeaders
  5215. googleapi.Expand(req.URL, map[string]string{
  5216. "matterId": c.matterId,
  5217. })
  5218. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5219. }
  5220. // Do executes the "vault.matters.savedQueries.create" call.
  5221. // Exactly one of *SavedQuery or error will be non-nil. Any non-2xx
  5222. // status code is an error. Response headers are in either
  5223. // *SavedQuery.ServerResponse.Header or (if a response was returned at
  5224. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5225. // to check whether the returned error was because
  5226. // http.StatusNotModified was returned.
  5227. func (c *MattersSavedQueriesCreateCall) Do(opts ...googleapi.CallOption) (*SavedQuery, error) {
  5228. gensupport.SetOptions(c.urlParams_, opts...)
  5229. res, err := c.doRequest("json")
  5230. if res != nil && res.StatusCode == http.StatusNotModified {
  5231. if res.Body != nil {
  5232. res.Body.Close()
  5233. }
  5234. return nil, &googleapi.Error{
  5235. Code: res.StatusCode,
  5236. Header: res.Header,
  5237. }
  5238. }
  5239. if err != nil {
  5240. return nil, err
  5241. }
  5242. defer googleapi.CloseBody(res)
  5243. if err := googleapi.CheckResponse(res); err != nil {
  5244. return nil, err
  5245. }
  5246. ret := &SavedQuery{
  5247. ServerResponse: googleapi.ServerResponse{
  5248. Header: res.Header,
  5249. HTTPStatusCode: res.StatusCode,
  5250. },
  5251. }
  5252. target := &ret
  5253. if err := gensupport.DecodeResponse(target, res); err != nil {
  5254. return nil, err
  5255. }
  5256. return ret, nil
  5257. // {
  5258. // "description": "Creates a saved query.",
  5259. // "flatPath": "v1/matters/{matterId}/savedQueries",
  5260. // "httpMethod": "POST",
  5261. // "id": "vault.matters.savedQueries.create",
  5262. // "parameterOrder": [
  5263. // "matterId"
  5264. // ],
  5265. // "parameters": {
  5266. // "matterId": {
  5267. // "description": "The matter id of the parent matter for which the saved query is to be\ncreated.",
  5268. // "location": "path",
  5269. // "required": true,
  5270. // "type": "string"
  5271. // }
  5272. // },
  5273. // "path": "v1/matters/{matterId}/savedQueries",
  5274. // "request": {
  5275. // "$ref": "SavedQuery"
  5276. // },
  5277. // "response": {
  5278. // "$ref": "SavedQuery"
  5279. // },
  5280. // "scopes": [
  5281. // "https://www.googleapis.com/auth/ediscovery"
  5282. // ]
  5283. // }
  5284. }
  5285. // method id "vault.matters.savedQueries.delete":
  5286. type MattersSavedQueriesDeleteCall struct {
  5287. s *Service
  5288. matterId string
  5289. savedQueryId string
  5290. urlParams_ gensupport.URLParams
  5291. ctx_ context.Context
  5292. header_ http.Header
  5293. }
  5294. // Delete: Deletes a saved query by Id.
  5295. func (r *MattersSavedQueriesService) Delete(matterId string, savedQueryId string) *MattersSavedQueriesDeleteCall {
  5296. c := &MattersSavedQueriesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5297. c.matterId = matterId
  5298. c.savedQueryId = savedQueryId
  5299. return c
  5300. }
  5301. // Fields allows partial responses to be retrieved. See
  5302. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5303. // for more information.
  5304. func (c *MattersSavedQueriesDeleteCall) Fields(s ...googleapi.Field) *MattersSavedQueriesDeleteCall {
  5305. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5306. return c
  5307. }
  5308. // Context sets the context to be used in this call's Do method. Any
  5309. // pending HTTP request will be aborted if the provided context is
  5310. // canceled.
  5311. func (c *MattersSavedQueriesDeleteCall) Context(ctx context.Context) *MattersSavedQueriesDeleteCall {
  5312. c.ctx_ = ctx
  5313. return c
  5314. }
  5315. // Header returns an http.Header that can be modified by the caller to
  5316. // add HTTP headers to the request.
  5317. func (c *MattersSavedQueriesDeleteCall) Header() http.Header {
  5318. if c.header_ == nil {
  5319. c.header_ = make(http.Header)
  5320. }
  5321. return c.header_
  5322. }
  5323. func (c *MattersSavedQueriesDeleteCall) doRequest(alt string) (*http.Response, error) {
  5324. reqHeaders := make(http.Header)
  5325. for k, v := range c.header_ {
  5326. reqHeaders[k] = v
  5327. }
  5328. reqHeaders.Set("User-Agent", c.s.userAgent())
  5329. var body io.Reader = nil
  5330. c.urlParams_.Set("alt", alt)
  5331. c.urlParams_.Set("prettyPrint", "false")
  5332. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/savedQueries/{savedQueryId}")
  5333. urls += "?" + c.urlParams_.Encode()
  5334. req, err := http.NewRequest("DELETE", urls, body)
  5335. if err != nil {
  5336. return nil, err
  5337. }
  5338. req.Header = reqHeaders
  5339. googleapi.Expand(req.URL, map[string]string{
  5340. "matterId": c.matterId,
  5341. "savedQueryId": c.savedQueryId,
  5342. })
  5343. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5344. }
  5345. // Do executes the "vault.matters.savedQueries.delete" call.
  5346. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  5347. // code is an error. Response headers are in either
  5348. // *Empty.ServerResponse.Header or (if a response was returned at all)
  5349. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5350. // check whether the returned error was because http.StatusNotModified
  5351. // was returned.
  5352. func (c *MattersSavedQueriesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  5353. gensupport.SetOptions(c.urlParams_, opts...)
  5354. res, err := c.doRequest("json")
  5355. if res != nil && res.StatusCode == http.StatusNotModified {
  5356. if res.Body != nil {
  5357. res.Body.Close()
  5358. }
  5359. return nil, &googleapi.Error{
  5360. Code: res.StatusCode,
  5361. Header: res.Header,
  5362. }
  5363. }
  5364. if err != nil {
  5365. return nil, err
  5366. }
  5367. defer googleapi.CloseBody(res)
  5368. if err := googleapi.CheckResponse(res); err != nil {
  5369. return nil, err
  5370. }
  5371. ret := &Empty{
  5372. ServerResponse: googleapi.ServerResponse{
  5373. Header: res.Header,
  5374. HTTPStatusCode: res.StatusCode,
  5375. },
  5376. }
  5377. target := &ret
  5378. if err := gensupport.DecodeResponse(target, res); err != nil {
  5379. return nil, err
  5380. }
  5381. return ret, nil
  5382. // {
  5383. // "description": "Deletes a saved query by Id.",
  5384. // "flatPath": "v1/matters/{matterId}/savedQueries/{savedQueryId}",
  5385. // "httpMethod": "DELETE",
  5386. // "id": "vault.matters.savedQueries.delete",
  5387. // "parameterOrder": [
  5388. // "matterId",
  5389. // "savedQueryId"
  5390. // ],
  5391. // "parameters": {
  5392. // "matterId": {
  5393. // "description": "The matter id of the parent matter for which the saved query is to be\ndeleted.",
  5394. // "location": "path",
  5395. // "required": true,
  5396. // "type": "string"
  5397. // },
  5398. // "savedQueryId": {
  5399. // "description": "Id of the saved query to be deleted.",
  5400. // "location": "path",
  5401. // "required": true,
  5402. // "type": "string"
  5403. // }
  5404. // },
  5405. // "path": "v1/matters/{matterId}/savedQueries/{savedQueryId}",
  5406. // "response": {
  5407. // "$ref": "Empty"
  5408. // },
  5409. // "scopes": [
  5410. // "https://www.googleapis.com/auth/ediscovery"
  5411. // ]
  5412. // }
  5413. }
  5414. // method id "vault.matters.savedQueries.get":
  5415. type MattersSavedQueriesGetCall struct {
  5416. s *Service
  5417. matterId string
  5418. savedQueryId string
  5419. urlParams_ gensupport.URLParams
  5420. ifNoneMatch_ string
  5421. ctx_ context.Context
  5422. header_ http.Header
  5423. }
  5424. // Get: Retrieves a saved query by Id.
  5425. func (r *MattersSavedQueriesService) Get(matterId string, savedQueryId string) *MattersSavedQueriesGetCall {
  5426. c := &MattersSavedQueriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5427. c.matterId = matterId
  5428. c.savedQueryId = savedQueryId
  5429. return c
  5430. }
  5431. // Fields allows partial responses to be retrieved. See
  5432. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5433. // for more information.
  5434. func (c *MattersSavedQueriesGetCall) Fields(s ...googleapi.Field) *MattersSavedQueriesGetCall {
  5435. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5436. return c
  5437. }
  5438. // IfNoneMatch sets the optional parameter which makes the operation
  5439. // fail if the object's ETag matches the given value. This is useful for
  5440. // getting updates only after the object has changed since the last
  5441. // request. Use googleapi.IsNotModified to check whether the response
  5442. // error from Do is the result of In-None-Match.
  5443. func (c *MattersSavedQueriesGetCall) IfNoneMatch(entityTag string) *MattersSavedQueriesGetCall {
  5444. c.ifNoneMatch_ = entityTag
  5445. return c
  5446. }
  5447. // Context sets the context to be used in this call's Do method. Any
  5448. // pending HTTP request will be aborted if the provided context is
  5449. // canceled.
  5450. func (c *MattersSavedQueriesGetCall) Context(ctx context.Context) *MattersSavedQueriesGetCall {
  5451. c.ctx_ = ctx
  5452. return c
  5453. }
  5454. // Header returns an http.Header that can be modified by the caller to
  5455. // add HTTP headers to the request.
  5456. func (c *MattersSavedQueriesGetCall) Header() http.Header {
  5457. if c.header_ == nil {
  5458. c.header_ = make(http.Header)
  5459. }
  5460. return c.header_
  5461. }
  5462. func (c *MattersSavedQueriesGetCall) doRequest(alt string) (*http.Response, error) {
  5463. reqHeaders := make(http.Header)
  5464. for k, v := range c.header_ {
  5465. reqHeaders[k] = v
  5466. }
  5467. reqHeaders.Set("User-Agent", c.s.userAgent())
  5468. if c.ifNoneMatch_ != "" {
  5469. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5470. }
  5471. var body io.Reader = nil
  5472. c.urlParams_.Set("alt", alt)
  5473. c.urlParams_.Set("prettyPrint", "false")
  5474. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/savedQueries/{savedQueryId}")
  5475. urls += "?" + c.urlParams_.Encode()
  5476. req, err := http.NewRequest("GET", urls, body)
  5477. if err != nil {
  5478. return nil, err
  5479. }
  5480. req.Header = reqHeaders
  5481. googleapi.Expand(req.URL, map[string]string{
  5482. "matterId": c.matterId,
  5483. "savedQueryId": c.savedQueryId,
  5484. })
  5485. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5486. }
  5487. // Do executes the "vault.matters.savedQueries.get" call.
  5488. // Exactly one of *SavedQuery or error will be non-nil. Any non-2xx
  5489. // status code is an error. Response headers are in either
  5490. // *SavedQuery.ServerResponse.Header or (if a response was returned at
  5491. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5492. // to check whether the returned error was because
  5493. // http.StatusNotModified was returned.
  5494. func (c *MattersSavedQueriesGetCall) Do(opts ...googleapi.CallOption) (*SavedQuery, error) {
  5495. gensupport.SetOptions(c.urlParams_, opts...)
  5496. res, err := c.doRequest("json")
  5497. if res != nil && res.StatusCode == http.StatusNotModified {
  5498. if res.Body != nil {
  5499. res.Body.Close()
  5500. }
  5501. return nil, &googleapi.Error{
  5502. Code: res.StatusCode,
  5503. Header: res.Header,
  5504. }
  5505. }
  5506. if err != nil {
  5507. return nil, err
  5508. }
  5509. defer googleapi.CloseBody(res)
  5510. if err := googleapi.CheckResponse(res); err != nil {
  5511. return nil, err
  5512. }
  5513. ret := &SavedQuery{
  5514. ServerResponse: googleapi.ServerResponse{
  5515. Header: res.Header,
  5516. HTTPStatusCode: res.StatusCode,
  5517. },
  5518. }
  5519. target := &ret
  5520. if err := gensupport.DecodeResponse(target, res); err != nil {
  5521. return nil, err
  5522. }
  5523. return ret, nil
  5524. // {
  5525. // "description": "Retrieves a saved query by Id.",
  5526. // "flatPath": "v1/matters/{matterId}/savedQueries/{savedQueryId}",
  5527. // "httpMethod": "GET",
  5528. // "id": "vault.matters.savedQueries.get",
  5529. // "parameterOrder": [
  5530. // "matterId",
  5531. // "savedQueryId"
  5532. // ],
  5533. // "parameters": {
  5534. // "matterId": {
  5535. // "description": "The matter id of the parent matter for which the saved query is to be\nretrieved.",
  5536. // "location": "path",
  5537. // "required": true,
  5538. // "type": "string"
  5539. // },
  5540. // "savedQueryId": {
  5541. // "description": "Id of the saved query to be retrieved.",
  5542. // "location": "path",
  5543. // "required": true,
  5544. // "type": "string"
  5545. // }
  5546. // },
  5547. // "path": "v1/matters/{matterId}/savedQueries/{savedQueryId}",
  5548. // "response": {
  5549. // "$ref": "SavedQuery"
  5550. // },
  5551. // "scopes": [
  5552. // "https://www.googleapis.com/auth/ediscovery",
  5553. // "https://www.googleapis.com/auth/ediscovery.readonly"
  5554. // ]
  5555. // }
  5556. }
  5557. // method id "vault.matters.savedQueries.list":
  5558. type MattersSavedQueriesListCall struct {
  5559. s *Service
  5560. matterId string
  5561. urlParams_ gensupport.URLParams
  5562. ifNoneMatch_ string
  5563. ctx_ context.Context
  5564. header_ http.Header
  5565. }
  5566. // List: Lists saved queries within a matter. An empty page token
  5567. // in
  5568. // ListSavedQueriesResponse denotes no more saved queries to list.
  5569. func (r *MattersSavedQueriesService) List(matterId string) *MattersSavedQueriesListCall {
  5570. c := &MattersSavedQueriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5571. c.matterId = matterId
  5572. return c
  5573. }
  5574. // PageSize sets the optional parameter "pageSize": The maximum number
  5575. // of saved queries to return.
  5576. func (c *MattersSavedQueriesListCall) PageSize(pageSize int64) *MattersSavedQueriesListCall {
  5577. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5578. return c
  5579. }
  5580. // PageToken sets the optional parameter "pageToken": The pagination
  5581. // token as returned in the previous response.
  5582. // An empty token means start from the beginning.
  5583. func (c *MattersSavedQueriesListCall) PageToken(pageToken string) *MattersSavedQueriesListCall {
  5584. c.urlParams_.Set("pageToken", pageToken)
  5585. return c
  5586. }
  5587. // Fields allows partial responses to be retrieved. See
  5588. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5589. // for more information.
  5590. func (c *MattersSavedQueriesListCall) Fields(s ...googleapi.Field) *MattersSavedQueriesListCall {
  5591. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5592. return c
  5593. }
  5594. // IfNoneMatch sets the optional parameter which makes the operation
  5595. // fail if the object's ETag matches the given value. This is useful for
  5596. // getting updates only after the object has changed since the last
  5597. // request. Use googleapi.IsNotModified to check whether the response
  5598. // error from Do is the result of In-None-Match.
  5599. func (c *MattersSavedQueriesListCall) IfNoneMatch(entityTag string) *MattersSavedQueriesListCall {
  5600. c.ifNoneMatch_ = entityTag
  5601. return c
  5602. }
  5603. // Context sets the context to be used in this call's Do method. Any
  5604. // pending HTTP request will be aborted if the provided context is
  5605. // canceled.
  5606. func (c *MattersSavedQueriesListCall) Context(ctx context.Context) *MattersSavedQueriesListCall {
  5607. c.ctx_ = ctx
  5608. return c
  5609. }
  5610. // Header returns an http.Header that can be modified by the caller to
  5611. // add HTTP headers to the request.
  5612. func (c *MattersSavedQueriesListCall) Header() http.Header {
  5613. if c.header_ == nil {
  5614. c.header_ = make(http.Header)
  5615. }
  5616. return c.header_
  5617. }
  5618. func (c *MattersSavedQueriesListCall) doRequest(alt string) (*http.Response, error) {
  5619. reqHeaders := make(http.Header)
  5620. for k, v := range c.header_ {
  5621. reqHeaders[k] = v
  5622. }
  5623. reqHeaders.Set("User-Agent", c.s.userAgent())
  5624. if c.ifNoneMatch_ != "" {
  5625. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5626. }
  5627. var body io.Reader = nil
  5628. c.urlParams_.Set("alt", alt)
  5629. c.urlParams_.Set("prettyPrint", "false")
  5630. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/savedQueries")
  5631. urls += "?" + c.urlParams_.Encode()
  5632. req, err := http.NewRequest("GET", urls, body)
  5633. if err != nil {
  5634. return nil, err
  5635. }
  5636. req.Header = reqHeaders
  5637. googleapi.Expand(req.URL, map[string]string{
  5638. "matterId": c.matterId,
  5639. })
  5640. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5641. }
  5642. // Do executes the "vault.matters.savedQueries.list" call.
  5643. // Exactly one of *ListSavedQueriesResponse or error will be non-nil.
  5644. // Any non-2xx status code is an error. Response headers are in either
  5645. // *ListSavedQueriesResponse.ServerResponse.Header or (if a response was
  5646. // returned at all) in error.(*googleapi.Error).Header. Use
  5647. // googleapi.IsNotModified to check whether the returned error was
  5648. // because http.StatusNotModified was returned.
  5649. func (c *MattersSavedQueriesListCall) Do(opts ...googleapi.CallOption) (*ListSavedQueriesResponse, error) {
  5650. gensupport.SetOptions(c.urlParams_, opts...)
  5651. res, err := c.doRequest("json")
  5652. if res != nil && res.StatusCode == http.StatusNotModified {
  5653. if res.Body != nil {
  5654. res.Body.Close()
  5655. }
  5656. return nil, &googleapi.Error{
  5657. Code: res.StatusCode,
  5658. Header: res.Header,
  5659. }
  5660. }
  5661. if err != nil {
  5662. return nil, err
  5663. }
  5664. defer googleapi.CloseBody(res)
  5665. if err := googleapi.CheckResponse(res); err != nil {
  5666. return nil, err
  5667. }
  5668. ret := &ListSavedQueriesResponse{
  5669. ServerResponse: googleapi.ServerResponse{
  5670. Header: res.Header,
  5671. HTTPStatusCode: res.StatusCode,
  5672. },
  5673. }
  5674. target := &ret
  5675. if err := gensupport.DecodeResponse(target, res); err != nil {
  5676. return nil, err
  5677. }
  5678. return ret, nil
  5679. // {
  5680. // "description": "Lists saved queries within a matter. An empty page token in\nListSavedQueriesResponse denotes no more saved queries to list.",
  5681. // "flatPath": "v1/matters/{matterId}/savedQueries",
  5682. // "httpMethod": "GET",
  5683. // "id": "vault.matters.savedQueries.list",
  5684. // "parameterOrder": [
  5685. // "matterId"
  5686. // ],
  5687. // "parameters": {
  5688. // "matterId": {
  5689. // "description": "The matter id of the parent matter for which the saved queries are to be\nretrieved.",
  5690. // "location": "path",
  5691. // "required": true,
  5692. // "type": "string"
  5693. // },
  5694. // "pageSize": {
  5695. // "description": "The maximum number of saved queries to return.",
  5696. // "format": "int32",
  5697. // "location": "query",
  5698. // "type": "integer"
  5699. // },
  5700. // "pageToken": {
  5701. // "description": "The pagination token as returned in the previous response.\nAn empty token means start from the beginning.",
  5702. // "location": "query",
  5703. // "type": "string"
  5704. // }
  5705. // },
  5706. // "path": "v1/matters/{matterId}/savedQueries",
  5707. // "response": {
  5708. // "$ref": "ListSavedQueriesResponse"
  5709. // },
  5710. // "scopes": [
  5711. // "https://www.googleapis.com/auth/ediscovery",
  5712. // "https://www.googleapis.com/auth/ediscovery.readonly"
  5713. // ]
  5714. // }
  5715. }
  5716. // Pages invokes f for each page of results.
  5717. // A non-nil error returned from f will halt the iteration.
  5718. // The provided context supersedes any context provided to the Context method.
  5719. func (c *MattersSavedQueriesListCall) Pages(ctx context.Context, f func(*ListSavedQueriesResponse) error) error {
  5720. c.ctx_ = ctx
  5721. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5722. for {
  5723. x, err := c.Do()
  5724. if err != nil {
  5725. return err
  5726. }
  5727. if err := f(x); err != nil {
  5728. return err
  5729. }
  5730. if x.NextPageToken == "" {
  5731. return nil
  5732. }
  5733. c.PageToken(x.NextPageToken)
  5734. }
  5735. }