Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

3491 righe
111 KiB

  1. // Package vault provides access to the G Suite Vault API.
  2. //
  3. // See https://developers.google.com/vault
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/vault/v1"
  8. // ...
  9. // vaultService, err := vault.New(oauthHttpClient)
  10. package vault // import "google.golang.org/api/vault/v1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "vault:v1"
  41. const apiName = "vault"
  42. const apiVersion = "v1"
  43. const basePath = "https://vault.googleapis.com/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // Manage your eDiscovery data
  47. EdiscoveryScope = "https://www.googleapis.com/auth/ediscovery"
  48. // View your eDiscovery data
  49. EdiscoveryReadonlyScope = "https://www.googleapis.com/auth/ediscovery.readonly"
  50. )
  51. func New(client *http.Client) (*Service, error) {
  52. if client == nil {
  53. return nil, errors.New("client is nil")
  54. }
  55. s := &Service{client: client, BasePath: basePath}
  56. s.Matters = NewMattersService(s)
  57. return s, nil
  58. }
  59. type Service struct {
  60. client *http.Client
  61. BasePath string // API endpoint base URL
  62. UserAgent string // optional additional User-Agent fragment
  63. Matters *MattersService
  64. }
  65. func (s *Service) userAgent() string {
  66. if s.UserAgent == "" {
  67. return googleapi.UserAgent
  68. }
  69. return googleapi.UserAgent + " " + s.UserAgent
  70. }
  71. func NewMattersService(s *Service) *MattersService {
  72. rs := &MattersService{s: s}
  73. rs.Holds = NewMattersHoldsService(s)
  74. return rs
  75. }
  76. type MattersService struct {
  77. s *Service
  78. Holds *MattersHoldsService
  79. }
  80. func NewMattersHoldsService(s *Service) *MattersHoldsService {
  81. rs := &MattersHoldsService{s: s}
  82. rs.Accounts = NewMattersHoldsAccountsService(s)
  83. return rs
  84. }
  85. type MattersHoldsService struct {
  86. s *Service
  87. Accounts *MattersHoldsAccountsService
  88. }
  89. func NewMattersHoldsAccountsService(s *Service) *MattersHoldsAccountsService {
  90. rs := &MattersHoldsAccountsService{s: s}
  91. return rs
  92. }
  93. type MattersHoldsAccountsService struct {
  94. s *Service
  95. }
  96. // AddMatterPermissionsRequest: Add an account with the permission
  97. // specified. The role cannot be owner.
  98. // If an account already has a role in the matter, it will
  99. // be
  100. // overwritten.
  101. type AddMatterPermissionsRequest struct {
  102. // CcMe: Only relevant if send_emails is true.
  103. // True to CC requestor in the email message.
  104. // False to not CC requestor.
  105. CcMe bool `json:"ccMe,omitempty"`
  106. // MatterPermission: The MatterPermission to add.
  107. MatterPermission *MatterPermission `json:"matterPermission,omitempty"`
  108. // SendEmails: True to send notification email to the added
  109. // account.
  110. // False to not send notification email.
  111. SendEmails bool `json:"sendEmails,omitempty"`
  112. // ForceSendFields is a list of field names (e.g. "CcMe") to
  113. // unconditionally include in API requests. By default, fields with
  114. // empty values are omitted from API requests. However, any non-pointer,
  115. // non-interface field appearing in ForceSendFields will be sent to the
  116. // server regardless of whether the field is empty or not. This may be
  117. // used to include empty fields in Patch requests.
  118. ForceSendFields []string `json:"-"`
  119. // NullFields is a list of field names (e.g. "CcMe") to include in API
  120. // requests with the JSON null value. By default, fields with empty
  121. // values are omitted from API requests. However, any field with an
  122. // empty value appearing in NullFields will be sent to the server as
  123. // null. It is an error if a field in this list has a non-empty value.
  124. // This may be used to include null fields in Patch requests.
  125. NullFields []string `json:"-"`
  126. }
  127. func (s *AddMatterPermissionsRequest) MarshalJSON() ([]byte, error) {
  128. type NoMethod AddMatterPermissionsRequest
  129. raw := NoMethod(*s)
  130. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  131. }
  132. // CloseMatterRequest: Close a matter by ID.
  133. type CloseMatterRequest struct {
  134. }
  135. // CloseMatterResponse: Response to a CloseMatterRequest.
  136. type CloseMatterResponse struct {
  137. // Matter: The updated matter, with state CLOSED.
  138. Matter *Matter `json:"matter,omitempty"`
  139. // ServerResponse contains the HTTP response code and headers from the
  140. // server.
  141. googleapi.ServerResponse `json:"-"`
  142. // ForceSendFields is a list of field names (e.g. "Matter") to
  143. // unconditionally include in API requests. By default, fields with
  144. // empty values are omitted from API requests. However, any non-pointer,
  145. // non-interface field appearing in ForceSendFields will be sent to the
  146. // server regardless of whether the field is empty or not. This may be
  147. // used to include empty fields in Patch requests.
  148. ForceSendFields []string `json:"-"`
  149. // NullFields is a list of field names (e.g. "Matter") to include in API
  150. // requests with the JSON null value. By default, fields with empty
  151. // values are omitted from API requests. However, any field with an
  152. // empty value appearing in NullFields will be sent to the server as
  153. // null. It is an error if a field in this list has a non-empty value.
  154. // This may be used to include null fields in Patch requests.
  155. NullFields []string `json:"-"`
  156. }
  157. func (s *CloseMatterResponse) MarshalJSON() ([]byte, error) {
  158. type NoMethod CloseMatterResponse
  159. raw := NoMethod(*s)
  160. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  161. }
  162. // CorpusQuery: Corpus specific queries.
  163. type CorpusQuery struct {
  164. // DriveQuery: Details pertaining to Drive holds. If set, corpus must be
  165. // Drive.
  166. DriveQuery *HeldDriveQuery `json:"driveQuery,omitempty"`
  167. // GroupsQuery: Details pertaining to Groups holds. If set, corpus must
  168. // be Groups.
  169. GroupsQuery *HeldGroupsQuery `json:"groupsQuery,omitempty"`
  170. // HangoutsChatQuery: Details pertaining to Hangouts Chat holds. If set,
  171. // corpus must be
  172. // Hangouts Chat.
  173. HangoutsChatQuery *HeldHangoutsChatQuery `json:"hangoutsChatQuery,omitempty"`
  174. // MailQuery: Details pertaining to mail holds. If set, corpus must be
  175. // mail.
  176. MailQuery *HeldMailQuery `json:"mailQuery,omitempty"`
  177. // ForceSendFields is a list of field names (e.g. "DriveQuery") to
  178. // unconditionally include in API requests. By default, fields with
  179. // empty values are omitted from API requests. However, any non-pointer,
  180. // non-interface field appearing in ForceSendFields will be sent to the
  181. // server regardless of whether the field is empty or not. This may be
  182. // used to include empty fields in Patch requests.
  183. ForceSendFields []string `json:"-"`
  184. // NullFields is a list of field names (e.g. "DriveQuery") to include in
  185. // API requests with the JSON null value. By default, fields with empty
  186. // values are omitted from API requests. However, any field with an
  187. // empty value appearing in NullFields will be sent to the server as
  188. // null. It is an error if a field in this list has a non-empty value.
  189. // This may be used to include null fields in Patch requests.
  190. NullFields []string `json:"-"`
  191. }
  192. func (s *CorpusQuery) MarshalJSON() ([]byte, error) {
  193. type NoMethod CorpusQuery
  194. raw := NoMethod(*s)
  195. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  196. }
  197. // Empty: A generic empty message that you can re-use to avoid defining
  198. // duplicated
  199. // empty messages in your APIs. A typical example is to use it as the
  200. // request
  201. // or the response type of an API method. For instance:
  202. //
  203. // service Foo {
  204. // rpc Bar(google.protobuf.Empty) returns
  205. // (google.protobuf.Empty);
  206. // }
  207. //
  208. // The JSON representation for `Empty` is empty JSON object `{}`.
  209. type Empty struct {
  210. // ServerResponse contains the HTTP response code and headers from the
  211. // server.
  212. googleapi.ServerResponse `json:"-"`
  213. }
  214. // HeldAccount: An account being held in a particular hold. This
  215. // structure is immutable.
  216. // This can be either a single user or a google group, depending on the
  217. // corpus.
  218. type HeldAccount struct {
  219. // AccountId: The account's ID as provided by the
  220. // <a href="https://developers.google.com/admin-sdk/">Admin SDK</a>.
  221. AccountId string `json:"accountId,omitempty"`
  222. // HoldTime: When the account was put on hold.
  223. HoldTime string `json:"holdTime,omitempty"`
  224. // ServerResponse contains the HTTP response code and headers from the
  225. // server.
  226. googleapi.ServerResponse `json:"-"`
  227. // ForceSendFields is a list of field names (e.g. "AccountId") to
  228. // unconditionally include in API requests. By default, fields with
  229. // empty values are omitted from API requests. However, any non-pointer,
  230. // non-interface field appearing in ForceSendFields will be sent to the
  231. // server regardless of whether the field is empty or not. This may be
  232. // used to include empty fields in Patch requests.
  233. ForceSendFields []string `json:"-"`
  234. // NullFields is a list of field names (e.g. "AccountId") to include in
  235. // API requests with the JSON null value. By default, fields with empty
  236. // values are omitted from API requests. However, any field with an
  237. // empty value appearing in NullFields will be sent to the server as
  238. // null. It is an error if a field in this list has a non-empty value.
  239. // This may be used to include null fields in Patch requests.
  240. NullFields []string `json:"-"`
  241. }
  242. func (s *HeldAccount) MarshalJSON() ([]byte, error) {
  243. type NoMethod HeldAccount
  244. raw := NoMethod(*s)
  245. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  246. }
  247. // HeldDriveQuery: Query options for Drive holds.
  248. type HeldDriveQuery struct {
  249. // IncludeTeamDriveFiles: If true, include files in Team Drives in the
  250. // hold.
  251. IncludeTeamDriveFiles bool `json:"includeTeamDriveFiles,omitempty"`
  252. // ForceSendFields is a list of field names (e.g.
  253. // "IncludeTeamDriveFiles") to unconditionally include in API requests.
  254. // By default, fields with empty values are omitted from API requests.
  255. // However, any non-pointer, non-interface field appearing in
  256. // ForceSendFields will be sent to the server regardless of whether the
  257. // field is empty or not. This may be used to include empty fields in
  258. // Patch requests.
  259. ForceSendFields []string `json:"-"`
  260. // NullFields is a list of field names (e.g. "IncludeTeamDriveFiles") to
  261. // include in API requests with the JSON null value. By default, fields
  262. // with empty values are omitted from API requests. However, any field
  263. // with an empty value appearing in NullFields will be sent to the
  264. // server as null. It is an error if a field in this list has a
  265. // non-empty value. This may be used to include null fields in Patch
  266. // requests.
  267. NullFields []string `json:"-"`
  268. }
  269. func (s *HeldDriveQuery) MarshalJSON() ([]byte, error) {
  270. type NoMethod HeldDriveQuery
  271. raw := NoMethod(*s)
  272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  273. }
  274. // HeldGroupsQuery: Query options for group holds.
  275. type HeldGroupsQuery struct {
  276. // EndTime: The end time range for the search query. These timestamps
  277. // are in GMT and
  278. // rounded down to the start of the given date.
  279. EndTime string `json:"endTime,omitempty"`
  280. // StartTime: The start time range for the search query. These
  281. // timestamps are in GMT and
  282. // rounded down to the start of the given date.
  283. StartTime string `json:"startTime,omitempty"`
  284. // Terms: The search terms for the hold.
  285. Terms string `json:"terms,omitempty"`
  286. // ForceSendFields is a list of field names (e.g. "EndTime") to
  287. // unconditionally include in API requests. By default, fields with
  288. // empty values are omitted from API requests. However, any non-pointer,
  289. // non-interface field appearing in ForceSendFields will be sent to the
  290. // server regardless of whether the field is empty or not. This may be
  291. // used to include empty fields in Patch requests.
  292. ForceSendFields []string `json:"-"`
  293. // NullFields is a list of field names (e.g. "EndTime") to include in
  294. // API requests with the JSON null value. By default, fields with empty
  295. // values are omitted from API requests. However, any field with an
  296. // empty value appearing in NullFields will be sent to the server as
  297. // null. It is an error if a field in this list has a non-empty value.
  298. // This may be used to include null fields in Patch requests.
  299. NullFields []string `json:"-"`
  300. }
  301. func (s *HeldGroupsQuery) MarshalJSON() ([]byte, error) {
  302. type NoMethod HeldGroupsQuery
  303. raw := NoMethod(*s)
  304. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  305. }
  306. // HeldHangoutsChatQuery: Query options for hangouts chat holds.
  307. type HeldHangoutsChatQuery struct {
  308. // IncludeRooms: If true, include rooms the user has participated in.
  309. IncludeRooms bool `json:"includeRooms,omitempty"`
  310. // ForceSendFields is a list of field names (e.g. "IncludeRooms") to
  311. // unconditionally include in API requests. By default, fields with
  312. // empty values are omitted from API requests. However, any non-pointer,
  313. // non-interface field appearing in ForceSendFields will be sent to the
  314. // server regardless of whether the field is empty or not. This may be
  315. // used to include empty fields in Patch requests.
  316. ForceSendFields []string `json:"-"`
  317. // NullFields is a list of field names (e.g. "IncludeRooms") to include
  318. // in API requests with the JSON null value. By default, fields with
  319. // empty values are omitted from API requests. However, any field with
  320. // an empty value appearing in NullFields will be sent to the server as
  321. // null. It is an error if a field in this list has a non-empty value.
  322. // This may be used to include null fields in Patch requests.
  323. NullFields []string `json:"-"`
  324. }
  325. func (s *HeldHangoutsChatQuery) MarshalJSON() ([]byte, error) {
  326. type NoMethod HeldHangoutsChatQuery
  327. raw := NoMethod(*s)
  328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  329. }
  330. // HeldMailQuery: Query options for mail holds.
  331. type HeldMailQuery struct {
  332. // EndTime: The end time range for the search query. These timestamps
  333. // are in GMT and
  334. // rounded down to the start of the given date.
  335. EndTime string `json:"endTime,omitempty"`
  336. // StartTime: The start time range for the search query. These
  337. // timestamps are in GMT and
  338. // rounded down to the start of the given date.
  339. StartTime string `json:"startTime,omitempty"`
  340. // Terms: The search terms for the hold.
  341. Terms string `json:"terms,omitempty"`
  342. // ForceSendFields is a list of field names (e.g. "EndTime") to
  343. // unconditionally include in API requests. By default, fields with
  344. // empty values are omitted from API requests. However, any non-pointer,
  345. // non-interface field appearing in ForceSendFields will be sent to the
  346. // server regardless of whether the field is empty or not. This may be
  347. // used to include empty fields in Patch requests.
  348. ForceSendFields []string `json:"-"`
  349. // NullFields is a list of field names (e.g. "EndTime") to include in
  350. // API requests with the JSON null value. By default, fields with empty
  351. // values are omitted from API requests. However, any field with an
  352. // empty value appearing in NullFields will be sent to the server as
  353. // null. It is an error if a field in this list has a non-empty value.
  354. // This may be used to include null fields in Patch requests.
  355. NullFields []string `json:"-"`
  356. }
  357. func (s *HeldMailQuery) MarshalJSON() ([]byte, error) {
  358. type NoMethod HeldMailQuery
  359. raw := NoMethod(*s)
  360. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  361. }
  362. // HeldOrgUnit: A organizational unit being held in a particular
  363. // hold.
  364. // This structure is immutable.
  365. type HeldOrgUnit struct {
  366. // HoldTime: When the org unit was put on hold. This property is
  367. // immutable.
  368. HoldTime string `json:"holdTime,omitempty"`
  369. // OrgUnitId: The org unit's immutable ID as provided by the Admin SDK.
  370. OrgUnitId string `json:"orgUnitId,omitempty"`
  371. // ForceSendFields is a list of field names (e.g. "HoldTime") to
  372. // unconditionally include in API requests. By default, fields with
  373. // empty values are omitted from API requests. However, any non-pointer,
  374. // non-interface field appearing in ForceSendFields will be sent to the
  375. // server regardless of whether the field is empty or not. This may be
  376. // used to include empty fields in Patch requests.
  377. ForceSendFields []string `json:"-"`
  378. // NullFields is a list of field names (e.g. "HoldTime") to include in
  379. // API requests with the JSON null value. By default, fields with empty
  380. // values are omitted from API requests. However, any field with an
  381. // empty value appearing in NullFields will be sent to the server as
  382. // null. It is an error if a field in this list has a non-empty value.
  383. // This may be used to include null fields in Patch requests.
  384. NullFields []string `json:"-"`
  385. }
  386. func (s *HeldOrgUnit) MarshalJSON() ([]byte, error) {
  387. type NoMethod HeldOrgUnit
  388. raw := NoMethod(*s)
  389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  390. }
  391. // Hold: Represents a hold within Vault. A hold restricts purging
  392. // of
  393. // artifacts based on the combination of the query and accounts
  394. // restrictions.
  395. // A hold can be configured to either apply to an explicitly configured
  396. // set
  397. // of accounts, or can be applied to all members of an organizational
  398. // unit.
  399. type Hold struct {
  400. // Accounts: If set, the hold applies to the enumerated accounts and
  401. // org_unit must be
  402. // empty.
  403. Accounts []*HeldAccount `json:"accounts,omitempty"`
  404. // Corpus: The corpus to be searched.
  405. //
  406. // Possible values:
  407. // "CORPUS_TYPE_UNSPECIFIED" - No corpus specified.
  408. // "DRIVE" - Drive.
  409. // "MAIL" - Mail.
  410. // "GROUPS" - Groups.
  411. // "HANGOUTS_CHAT" - Hangouts Chat.
  412. Corpus string `json:"corpus,omitempty"`
  413. // HoldId: The unique immutable ID of the hold. Assigned during
  414. // creation.
  415. HoldId string `json:"holdId,omitempty"`
  416. // Name: The name of the hold.
  417. Name string `json:"name,omitempty"`
  418. // OrgUnit: If set, the hold applies to all members of the
  419. // organizational unit and
  420. // accounts must be empty. This property is mutable. For groups
  421. // holds,
  422. // set the accounts field.
  423. OrgUnit *HeldOrgUnit `json:"orgUnit,omitempty"`
  424. // Query: The corpus-specific query. If set, the corpusQuery must match
  425. // corpus
  426. // type.
  427. Query *CorpusQuery `json:"query,omitempty"`
  428. // UpdateTime: The last time this hold was modified.
  429. UpdateTime string `json:"updateTime,omitempty"`
  430. // ServerResponse contains the HTTP response code and headers from the
  431. // server.
  432. googleapi.ServerResponse `json:"-"`
  433. // ForceSendFields is a list of field names (e.g. "Accounts") to
  434. // unconditionally include in API requests. By default, fields with
  435. // empty values are omitted from API requests. However, any non-pointer,
  436. // non-interface field appearing in ForceSendFields will be sent to the
  437. // server regardless of whether the field is empty or not. This may be
  438. // used to include empty fields in Patch requests.
  439. ForceSendFields []string `json:"-"`
  440. // NullFields is a list of field names (e.g. "Accounts") to include in
  441. // API requests with the JSON null value. By default, fields with empty
  442. // values are omitted from API requests. However, any field with an
  443. // empty value appearing in NullFields will be sent to the server as
  444. // null. It is an error if a field in this list has a non-empty value.
  445. // This may be used to include null fields in Patch requests.
  446. NullFields []string `json:"-"`
  447. }
  448. func (s *Hold) MarshalJSON() ([]byte, error) {
  449. type NoMethod Hold
  450. raw := NoMethod(*s)
  451. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  452. }
  453. // ListHeldAccountsResponse: Returns a list of held accounts for a hold.
  454. type ListHeldAccountsResponse struct {
  455. // Accounts: The held accounts on a hold.
  456. Accounts []*HeldAccount `json:"accounts,omitempty"`
  457. // ServerResponse contains the HTTP response code and headers from the
  458. // server.
  459. googleapi.ServerResponse `json:"-"`
  460. // ForceSendFields is a list of field names (e.g. "Accounts") to
  461. // unconditionally include in API requests. By default, fields with
  462. // empty values are omitted from API requests. However, any non-pointer,
  463. // non-interface field appearing in ForceSendFields will be sent to the
  464. // server regardless of whether the field is empty or not. This may be
  465. // used to include empty fields in Patch requests.
  466. ForceSendFields []string `json:"-"`
  467. // NullFields is a list of field names (e.g. "Accounts") to include in
  468. // API requests with the JSON null value. By default, fields with empty
  469. // values are omitted from API requests. However, any field with an
  470. // empty value appearing in NullFields will be sent to the server as
  471. // null. It is an error if a field in this list has a non-empty value.
  472. // This may be used to include null fields in Patch requests.
  473. NullFields []string `json:"-"`
  474. }
  475. func (s *ListHeldAccountsResponse) MarshalJSON() ([]byte, error) {
  476. type NoMethod ListHeldAccountsResponse
  477. raw := NoMethod(*s)
  478. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  479. }
  480. // ListHoldsResponse: The holds for a matter.
  481. type ListHoldsResponse struct {
  482. // Holds: The list of holds.
  483. Holds []*Hold `json:"holds,omitempty"`
  484. // NextPageToken: Page token to retrieve the next page of results in the
  485. // list.
  486. // If this is empty, then there are no more holds to list.
  487. NextPageToken string `json:"nextPageToken,omitempty"`
  488. // ServerResponse contains the HTTP response code and headers from the
  489. // server.
  490. googleapi.ServerResponse `json:"-"`
  491. // ForceSendFields is a list of field names (e.g. "Holds") to
  492. // unconditionally include in API requests. By default, fields with
  493. // empty values are omitted from API requests. However, any non-pointer,
  494. // non-interface field appearing in ForceSendFields will be sent to the
  495. // server regardless of whether the field is empty or not. This may be
  496. // used to include empty fields in Patch requests.
  497. ForceSendFields []string `json:"-"`
  498. // NullFields is a list of field names (e.g. "Holds") to include in API
  499. // requests with the JSON null value. By default, fields with empty
  500. // values are omitted from API requests. However, any field with an
  501. // empty value appearing in NullFields will be sent to the server as
  502. // null. It is an error if a field in this list has a non-empty value.
  503. // This may be used to include null fields in Patch requests.
  504. NullFields []string `json:"-"`
  505. }
  506. func (s *ListHoldsResponse) MarshalJSON() ([]byte, error) {
  507. type NoMethod ListHoldsResponse
  508. raw := NoMethod(*s)
  509. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  510. }
  511. // ListMattersResponse: Provides the list of matters.
  512. type ListMattersResponse struct {
  513. // Matters: List of matters.
  514. Matters []*Matter `json:"matters,omitempty"`
  515. // NextPageToken: Page token to retrieve the next page of results in the
  516. // list.
  517. NextPageToken string `json:"nextPageToken,omitempty"`
  518. // ServerResponse contains the HTTP response code and headers from the
  519. // server.
  520. googleapi.ServerResponse `json:"-"`
  521. // ForceSendFields is a list of field names (e.g. "Matters") to
  522. // unconditionally include in API requests. By default, fields with
  523. // empty values are omitted from API requests. However, any non-pointer,
  524. // non-interface field appearing in ForceSendFields will be sent to the
  525. // server regardless of whether the field is empty or not. This may be
  526. // used to include empty fields in Patch requests.
  527. ForceSendFields []string `json:"-"`
  528. // NullFields is a list of field names (e.g. "Matters") to include in
  529. // API requests with the JSON null value. By default, fields with empty
  530. // values are omitted from API requests. However, any field with an
  531. // empty value appearing in NullFields will be sent to the server as
  532. // null. It is an error if a field in this list has a non-empty value.
  533. // This may be used to include null fields in Patch requests.
  534. NullFields []string `json:"-"`
  535. }
  536. func (s *ListMattersResponse) MarshalJSON() ([]byte, error) {
  537. type NoMethod ListMattersResponse
  538. raw := NoMethod(*s)
  539. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  540. }
  541. // Matter: Represents a matter.
  542. type Matter struct {
  543. // Description: The description of the matter.
  544. Description string `json:"description,omitempty"`
  545. // MatterId: The matter ID which is generated by the server.
  546. // Should be blank when creating a new matter.
  547. MatterId string `json:"matterId,omitempty"`
  548. // MatterPermissions: List of users and access to the matter. Currently
  549. // there is no programmer
  550. // defined limit on the number of permissions a matter can have.
  551. MatterPermissions []*MatterPermission `json:"matterPermissions,omitempty"`
  552. // Name: The name of the matter.
  553. Name string `json:"name,omitempty"`
  554. // State: The state of the matter.
  555. //
  556. // Possible values:
  557. // "STATE_UNSPECIFIED" - The matter has no specified state.
  558. // "OPEN" - This matter is open.
  559. // "CLOSED" - This matter is closed.
  560. // "DELETED" - This matter is deleted.
  561. State string `json:"state,omitempty"`
  562. // ServerResponse contains the HTTP response code and headers from the
  563. // server.
  564. googleapi.ServerResponse `json:"-"`
  565. // ForceSendFields is a list of field names (e.g. "Description") to
  566. // unconditionally include in API requests. By default, fields with
  567. // empty values are omitted from API requests. However, any non-pointer,
  568. // non-interface field appearing in ForceSendFields will be sent to the
  569. // server regardless of whether the field is empty or not. This may be
  570. // used to include empty fields in Patch requests.
  571. ForceSendFields []string `json:"-"`
  572. // NullFields is a list of field names (e.g. "Description") to include
  573. // in API requests with the JSON null value. By default, fields with
  574. // empty values are omitted from API requests. However, any field with
  575. // an empty value appearing in NullFields will be sent to the server as
  576. // null. It is an error if a field in this list has a non-empty value.
  577. // This may be used to include null fields in Patch requests.
  578. NullFields []string `json:"-"`
  579. }
  580. func (s *Matter) MarshalJSON() ([]byte, error) {
  581. type NoMethod Matter
  582. raw := NoMethod(*s)
  583. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  584. }
  585. // MatterPermission: Currently each matter only has one owner, and all
  586. // others are collaborators.
  587. // When an account is purged, its corresponding MatterPermission
  588. // resources
  589. // cease to exist.
  590. type MatterPermission struct {
  591. // AccountId: The account id, as provided by <a
  592. // href="https://developers.google.com/admin-sdk/">Admin SDK</a>.
  593. AccountId string `json:"accountId,omitempty"`
  594. // Role: The user's role in this matter.
  595. //
  596. // Possible values:
  597. // "ROLE_UNSPECIFIED" - No role assigned.
  598. // "COLLABORATOR" - A collaborator to the matter.
  599. // "OWNER" - The owner of the matter.
  600. Role string `json:"role,omitempty"`
  601. // ServerResponse contains the HTTP response code and headers from the
  602. // server.
  603. googleapi.ServerResponse `json:"-"`
  604. // ForceSendFields is a list of field names (e.g. "AccountId") to
  605. // unconditionally include in API requests. By default, fields with
  606. // empty values are omitted from API requests. However, any non-pointer,
  607. // non-interface field appearing in ForceSendFields will be sent to the
  608. // server regardless of whether the field is empty or not. This may be
  609. // used to include empty fields in Patch requests.
  610. ForceSendFields []string `json:"-"`
  611. // NullFields is a list of field names (e.g. "AccountId") to include in
  612. // API requests with the JSON null value. By default, fields with empty
  613. // values are omitted from API requests. However, any field with an
  614. // empty value appearing in NullFields will be sent to the server as
  615. // null. It is an error if a field in this list has a non-empty value.
  616. // This may be used to include null fields in Patch requests.
  617. NullFields []string `json:"-"`
  618. }
  619. func (s *MatterPermission) MarshalJSON() ([]byte, error) {
  620. type NoMethod MatterPermission
  621. raw := NoMethod(*s)
  622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  623. }
  624. // RemoveMatterPermissionsRequest: Remove an account as a matter
  625. // collaborator.
  626. type RemoveMatterPermissionsRequest struct {
  627. // AccountId: The account ID.
  628. AccountId string `json:"accountId,omitempty"`
  629. // ForceSendFields is a list of field names (e.g. "AccountId") to
  630. // unconditionally include in API requests. By default, fields with
  631. // empty values are omitted from API requests. However, any non-pointer,
  632. // non-interface field appearing in ForceSendFields will be sent to the
  633. // server regardless of whether the field is empty or not. This may be
  634. // used to include empty fields in Patch requests.
  635. ForceSendFields []string `json:"-"`
  636. // NullFields is a list of field names (e.g. "AccountId") to include in
  637. // API requests with the JSON null value. By default, fields with empty
  638. // values are omitted from API requests. However, any field with an
  639. // empty value appearing in NullFields will be sent to the server as
  640. // null. It is an error if a field in this list has a non-empty value.
  641. // This may be used to include null fields in Patch requests.
  642. NullFields []string `json:"-"`
  643. }
  644. func (s *RemoveMatterPermissionsRequest) MarshalJSON() ([]byte, error) {
  645. type NoMethod RemoveMatterPermissionsRequest
  646. raw := NoMethod(*s)
  647. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  648. }
  649. // ReopenMatterRequest: Reopen a matter by ID.
  650. type ReopenMatterRequest struct {
  651. }
  652. // ReopenMatterResponse: Response to a ReopenMatterRequest.
  653. type ReopenMatterResponse struct {
  654. // Matter: The updated matter, with state OPEN.
  655. Matter *Matter `json:"matter,omitempty"`
  656. // ServerResponse contains the HTTP response code and headers from the
  657. // server.
  658. googleapi.ServerResponse `json:"-"`
  659. // ForceSendFields is a list of field names (e.g. "Matter") to
  660. // unconditionally include in API requests. By default, fields with
  661. // empty values are omitted from API requests. However, any non-pointer,
  662. // non-interface field appearing in ForceSendFields will be sent to the
  663. // server regardless of whether the field is empty or not. This may be
  664. // used to include empty fields in Patch requests.
  665. ForceSendFields []string `json:"-"`
  666. // NullFields is a list of field names (e.g. "Matter") to include in API
  667. // requests with the JSON null value. By default, fields with empty
  668. // values are omitted from API requests. However, any field with an
  669. // empty value appearing in NullFields will be sent to the server as
  670. // null. It is an error if a field in this list has a non-empty value.
  671. // This may be used to include null fields in Patch requests.
  672. NullFields []string `json:"-"`
  673. }
  674. func (s *ReopenMatterResponse) MarshalJSON() ([]byte, error) {
  675. type NoMethod ReopenMatterResponse
  676. raw := NoMethod(*s)
  677. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  678. }
  679. // UndeleteMatterRequest: Undelete a matter by ID.
  680. type UndeleteMatterRequest struct {
  681. }
  682. // method id "vault.matters.addPermissions":
  683. type MattersAddPermissionsCall struct {
  684. s *Service
  685. matterId string
  686. addmatterpermissionsrequest *AddMatterPermissionsRequest
  687. urlParams_ gensupport.URLParams
  688. ctx_ context.Context
  689. header_ http.Header
  690. }
  691. // AddPermissions: Adds an account as a matter collaborator.
  692. func (r *MattersService) AddPermissions(matterId string, addmatterpermissionsrequest *AddMatterPermissionsRequest) *MattersAddPermissionsCall {
  693. c := &MattersAddPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  694. c.matterId = matterId
  695. c.addmatterpermissionsrequest = addmatterpermissionsrequest
  696. return c
  697. }
  698. // Fields allows partial responses to be retrieved. See
  699. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  700. // for more information.
  701. func (c *MattersAddPermissionsCall) Fields(s ...googleapi.Field) *MattersAddPermissionsCall {
  702. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  703. return c
  704. }
  705. // Context sets the context to be used in this call's Do method. Any
  706. // pending HTTP request will be aborted if the provided context is
  707. // canceled.
  708. func (c *MattersAddPermissionsCall) Context(ctx context.Context) *MattersAddPermissionsCall {
  709. c.ctx_ = ctx
  710. return c
  711. }
  712. // Header returns an http.Header that can be modified by the caller to
  713. // add HTTP headers to the request.
  714. func (c *MattersAddPermissionsCall) Header() http.Header {
  715. if c.header_ == nil {
  716. c.header_ = make(http.Header)
  717. }
  718. return c.header_
  719. }
  720. func (c *MattersAddPermissionsCall) doRequest(alt string) (*http.Response, error) {
  721. reqHeaders := make(http.Header)
  722. for k, v := range c.header_ {
  723. reqHeaders[k] = v
  724. }
  725. reqHeaders.Set("User-Agent", c.s.userAgent())
  726. var body io.Reader = nil
  727. body, err := googleapi.WithoutDataWrapper.JSONReader(c.addmatterpermissionsrequest)
  728. if err != nil {
  729. return nil, err
  730. }
  731. reqHeaders.Set("Content-Type", "application/json")
  732. c.urlParams_.Set("alt", alt)
  733. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}:addPermissions")
  734. urls += "?" + c.urlParams_.Encode()
  735. req, _ := http.NewRequest("POST", urls, body)
  736. req.Header = reqHeaders
  737. googleapi.Expand(req.URL, map[string]string{
  738. "matterId": c.matterId,
  739. })
  740. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  741. }
  742. // Do executes the "vault.matters.addPermissions" call.
  743. // Exactly one of *MatterPermission or error will be non-nil. Any
  744. // non-2xx status code is an error. Response headers are in either
  745. // *MatterPermission.ServerResponse.Header or (if a response was
  746. // returned at all) in error.(*googleapi.Error).Header. Use
  747. // googleapi.IsNotModified to check whether the returned error was
  748. // because http.StatusNotModified was returned.
  749. func (c *MattersAddPermissionsCall) Do(opts ...googleapi.CallOption) (*MatterPermission, error) {
  750. gensupport.SetOptions(c.urlParams_, opts...)
  751. res, err := c.doRequest("json")
  752. if res != nil && res.StatusCode == http.StatusNotModified {
  753. if res.Body != nil {
  754. res.Body.Close()
  755. }
  756. return nil, &googleapi.Error{
  757. Code: res.StatusCode,
  758. Header: res.Header,
  759. }
  760. }
  761. if err != nil {
  762. return nil, err
  763. }
  764. defer googleapi.CloseBody(res)
  765. if err := googleapi.CheckResponse(res); err != nil {
  766. return nil, err
  767. }
  768. ret := &MatterPermission{
  769. ServerResponse: googleapi.ServerResponse{
  770. Header: res.Header,
  771. HTTPStatusCode: res.StatusCode,
  772. },
  773. }
  774. target := &ret
  775. if err := gensupport.DecodeResponse(target, res); err != nil {
  776. return nil, err
  777. }
  778. return ret, nil
  779. // {
  780. // "description": "Adds an account as a matter collaborator.",
  781. // "flatPath": "v1/matters/{matterId}:addPermissions",
  782. // "httpMethod": "POST",
  783. // "id": "vault.matters.addPermissions",
  784. // "parameterOrder": [
  785. // "matterId"
  786. // ],
  787. // "parameters": {
  788. // "matterId": {
  789. // "description": "The matter ID.",
  790. // "location": "path",
  791. // "required": true,
  792. // "type": "string"
  793. // }
  794. // },
  795. // "path": "v1/matters/{matterId}:addPermissions",
  796. // "request": {
  797. // "$ref": "AddMatterPermissionsRequest"
  798. // },
  799. // "response": {
  800. // "$ref": "MatterPermission"
  801. // },
  802. // "scopes": [
  803. // "https://www.googleapis.com/auth/ediscovery"
  804. // ]
  805. // }
  806. }
  807. // method id "vault.matters.close":
  808. type MattersCloseCall struct {
  809. s *Service
  810. matterId string
  811. closematterrequest *CloseMatterRequest
  812. urlParams_ gensupport.URLParams
  813. ctx_ context.Context
  814. header_ http.Header
  815. }
  816. // Close: Closes the specified matter. Returns matter with updated
  817. // state.
  818. func (r *MattersService) Close(matterId string, closematterrequest *CloseMatterRequest) *MattersCloseCall {
  819. c := &MattersCloseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  820. c.matterId = matterId
  821. c.closematterrequest = closematterrequest
  822. return c
  823. }
  824. // Fields allows partial responses to be retrieved. See
  825. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  826. // for more information.
  827. func (c *MattersCloseCall) Fields(s ...googleapi.Field) *MattersCloseCall {
  828. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  829. return c
  830. }
  831. // Context sets the context to be used in this call's Do method. Any
  832. // pending HTTP request will be aborted if the provided context is
  833. // canceled.
  834. func (c *MattersCloseCall) Context(ctx context.Context) *MattersCloseCall {
  835. c.ctx_ = ctx
  836. return c
  837. }
  838. // Header returns an http.Header that can be modified by the caller to
  839. // add HTTP headers to the request.
  840. func (c *MattersCloseCall) Header() http.Header {
  841. if c.header_ == nil {
  842. c.header_ = make(http.Header)
  843. }
  844. return c.header_
  845. }
  846. func (c *MattersCloseCall) doRequest(alt string) (*http.Response, error) {
  847. reqHeaders := make(http.Header)
  848. for k, v := range c.header_ {
  849. reqHeaders[k] = v
  850. }
  851. reqHeaders.Set("User-Agent", c.s.userAgent())
  852. var body io.Reader = nil
  853. body, err := googleapi.WithoutDataWrapper.JSONReader(c.closematterrequest)
  854. if err != nil {
  855. return nil, err
  856. }
  857. reqHeaders.Set("Content-Type", "application/json")
  858. c.urlParams_.Set("alt", alt)
  859. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}:close")
  860. urls += "?" + c.urlParams_.Encode()
  861. req, _ := http.NewRequest("POST", urls, body)
  862. req.Header = reqHeaders
  863. googleapi.Expand(req.URL, map[string]string{
  864. "matterId": c.matterId,
  865. })
  866. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  867. }
  868. // Do executes the "vault.matters.close" call.
  869. // Exactly one of *CloseMatterResponse or error will be non-nil. Any
  870. // non-2xx status code is an error. Response headers are in either
  871. // *CloseMatterResponse.ServerResponse.Header or (if a response was
  872. // returned at all) in error.(*googleapi.Error).Header. Use
  873. // googleapi.IsNotModified to check whether the returned error was
  874. // because http.StatusNotModified was returned.
  875. func (c *MattersCloseCall) Do(opts ...googleapi.CallOption) (*CloseMatterResponse, error) {
  876. gensupport.SetOptions(c.urlParams_, opts...)
  877. res, err := c.doRequest("json")
  878. if res != nil && res.StatusCode == http.StatusNotModified {
  879. if res.Body != nil {
  880. res.Body.Close()
  881. }
  882. return nil, &googleapi.Error{
  883. Code: res.StatusCode,
  884. Header: res.Header,
  885. }
  886. }
  887. if err != nil {
  888. return nil, err
  889. }
  890. defer googleapi.CloseBody(res)
  891. if err := googleapi.CheckResponse(res); err != nil {
  892. return nil, err
  893. }
  894. ret := &CloseMatterResponse{
  895. ServerResponse: googleapi.ServerResponse{
  896. Header: res.Header,
  897. HTTPStatusCode: res.StatusCode,
  898. },
  899. }
  900. target := &ret
  901. if err := gensupport.DecodeResponse(target, res); err != nil {
  902. return nil, err
  903. }
  904. return ret, nil
  905. // {
  906. // "description": "Closes the specified matter. Returns matter with updated state.",
  907. // "flatPath": "v1/matters/{matterId}:close",
  908. // "httpMethod": "POST",
  909. // "id": "vault.matters.close",
  910. // "parameterOrder": [
  911. // "matterId"
  912. // ],
  913. // "parameters": {
  914. // "matterId": {
  915. // "description": "The matter ID.",
  916. // "location": "path",
  917. // "required": true,
  918. // "type": "string"
  919. // }
  920. // },
  921. // "path": "v1/matters/{matterId}:close",
  922. // "request": {
  923. // "$ref": "CloseMatterRequest"
  924. // },
  925. // "response": {
  926. // "$ref": "CloseMatterResponse"
  927. // },
  928. // "scopes": [
  929. // "https://www.googleapis.com/auth/ediscovery"
  930. // ]
  931. // }
  932. }
  933. // method id "vault.matters.create":
  934. type MattersCreateCall struct {
  935. s *Service
  936. matter *Matter
  937. urlParams_ gensupport.URLParams
  938. ctx_ context.Context
  939. header_ http.Header
  940. }
  941. // Create: Creates a new matter with the given name and description. The
  942. // initial state
  943. // is open, and the owner is the method caller. Returns the created
  944. // matter
  945. // with default view.
  946. func (r *MattersService) Create(matter *Matter) *MattersCreateCall {
  947. c := &MattersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  948. c.matter = matter
  949. return c
  950. }
  951. // Fields allows partial responses to be retrieved. See
  952. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  953. // for more information.
  954. func (c *MattersCreateCall) Fields(s ...googleapi.Field) *MattersCreateCall {
  955. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  956. return c
  957. }
  958. // Context sets the context to be used in this call's Do method. Any
  959. // pending HTTP request will be aborted if the provided context is
  960. // canceled.
  961. func (c *MattersCreateCall) Context(ctx context.Context) *MattersCreateCall {
  962. c.ctx_ = ctx
  963. return c
  964. }
  965. // Header returns an http.Header that can be modified by the caller to
  966. // add HTTP headers to the request.
  967. func (c *MattersCreateCall) Header() http.Header {
  968. if c.header_ == nil {
  969. c.header_ = make(http.Header)
  970. }
  971. return c.header_
  972. }
  973. func (c *MattersCreateCall) doRequest(alt string) (*http.Response, error) {
  974. reqHeaders := make(http.Header)
  975. for k, v := range c.header_ {
  976. reqHeaders[k] = v
  977. }
  978. reqHeaders.Set("User-Agent", c.s.userAgent())
  979. var body io.Reader = nil
  980. body, err := googleapi.WithoutDataWrapper.JSONReader(c.matter)
  981. if err != nil {
  982. return nil, err
  983. }
  984. reqHeaders.Set("Content-Type", "application/json")
  985. c.urlParams_.Set("alt", alt)
  986. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters")
  987. urls += "?" + c.urlParams_.Encode()
  988. req, _ := http.NewRequest("POST", urls, body)
  989. req.Header = reqHeaders
  990. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  991. }
  992. // Do executes the "vault.matters.create" call.
  993. // Exactly one of *Matter or error will be non-nil. Any non-2xx status
  994. // code is an error. Response headers are in either
  995. // *Matter.ServerResponse.Header or (if a response was returned at all)
  996. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  997. // check whether the returned error was because http.StatusNotModified
  998. // was returned.
  999. func (c *MattersCreateCall) Do(opts ...googleapi.CallOption) (*Matter, error) {
  1000. gensupport.SetOptions(c.urlParams_, opts...)
  1001. res, err := c.doRequest("json")
  1002. if res != nil && res.StatusCode == http.StatusNotModified {
  1003. if res.Body != nil {
  1004. res.Body.Close()
  1005. }
  1006. return nil, &googleapi.Error{
  1007. Code: res.StatusCode,
  1008. Header: res.Header,
  1009. }
  1010. }
  1011. if err != nil {
  1012. return nil, err
  1013. }
  1014. defer googleapi.CloseBody(res)
  1015. if err := googleapi.CheckResponse(res); err != nil {
  1016. return nil, err
  1017. }
  1018. ret := &Matter{
  1019. ServerResponse: googleapi.ServerResponse{
  1020. Header: res.Header,
  1021. HTTPStatusCode: res.StatusCode,
  1022. },
  1023. }
  1024. target := &ret
  1025. if err := gensupport.DecodeResponse(target, res); err != nil {
  1026. return nil, err
  1027. }
  1028. return ret, nil
  1029. // {
  1030. // "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.",
  1031. // "flatPath": "v1/matters",
  1032. // "httpMethod": "POST",
  1033. // "id": "vault.matters.create",
  1034. // "parameterOrder": [],
  1035. // "parameters": {},
  1036. // "path": "v1/matters",
  1037. // "request": {
  1038. // "$ref": "Matter"
  1039. // },
  1040. // "response": {
  1041. // "$ref": "Matter"
  1042. // },
  1043. // "scopes": [
  1044. // "https://www.googleapis.com/auth/ediscovery"
  1045. // ]
  1046. // }
  1047. }
  1048. // method id "vault.matters.delete":
  1049. type MattersDeleteCall struct {
  1050. s *Service
  1051. matterId string
  1052. urlParams_ gensupport.URLParams
  1053. ctx_ context.Context
  1054. header_ http.Header
  1055. }
  1056. // Delete: Deletes the specified matter. Returns matter with updated
  1057. // state.
  1058. func (r *MattersService) Delete(matterId string) *MattersDeleteCall {
  1059. c := &MattersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1060. c.matterId = matterId
  1061. return c
  1062. }
  1063. // Fields allows partial responses to be retrieved. See
  1064. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1065. // for more information.
  1066. func (c *MattersDeleteCall) Fields(s ...googleapi.Field) *MattersDeleteCall {
  1067. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1068. return c
  1069. }
  1070. // Context sets the context to be used in this call's Do method. Any
  1071. // pending HTTP request will be aborted if the provided context is
  1072. // canceled.
  1073. func (c *MattersDeleteCall) Context(ctx context.Context) *MattersDeleteCall {
  1074. c.ctx_ = ctx
  1075. return c
  1076. }
  1077. // Header returns an http.Header that can be modified by the caller to
  1078. // add HTTP headers to the request.
  1079. func (c *MattersDeleteCall) Header() http.Header {
  1080. if c.header_ == nil {
  1081. c.header_ = make(http.Header)
  1082. }
  1083. return c.header_
  1084. }
  1085. func (c *MattersDeleteCall) doRequest(alt string) (*http.Response, error) {
  1086. reqHeaders := make(http.Header)
  1087. for k, v := range c.header_ {
  1088. reqHeaders[k] = v
  1089. }
  1090. reqHeaders.Set("User-Agent", c.s.userAgent())
  1091. var body io.Reader = nil
  1092. c.urlParams_.Set("alt", alt)
  1093. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}")
  1094. urls += "?" + c.urlParams_.Encode()
  1095. req, _ := http.NewRequest("DELETE", urls, body)
  1096. req.Header = reqHeaders
  1097. googleapi.Expand(req.URL, map[string]string{
  1098. "matterId": c.matterId,
  1099. })
  1100. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1101. }
  1102. // Do executes the "vault.matters.delete" call.
  1103. // Exactly one of *Matter or error will be non-nil. Any non-2xx status
  1104. // code is an error. Response headers are in either
  1105. // *Matter.ServerResponse.Header or (if a response was returned at all)
  1106. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1107. // check whether the returned error was because http.StatusNotModified
  1108. // was returned.
  1109. func (c *MattersDeleteCall) Do(opts ...googleapi.CallOption) (*Matter, error) {
  1110. gensupport.SetOptions(c.urlParams_, opts...)
  1111. res, err := c.doRequest("json")
  1112. if res != nil && res.StatusCode == http.StatusNotModified {
  1113. if res.Body != nil {
  1114. res.Body.Close()
  1115. }
  1116. return nil, &googleapi.Error{
  1117. Code: res.StatusCode,
  1118. Header: res.Header,
  1119. }
  1120. }
  1121. if err != nil {
  1122. return nil, err
  1123. }
  1124. defer googleapi.CloseBody(res)
  1125. if err := googleapi.CheckResponse(res); err != nil {
  1126. return nil, err
  1127. }
  1128. ret := &Matter{
  1129. ServerResponse: googleapi.ServerResponse{
  1130. Header: res.Header,
  1131. HTTPStatusCode: res.StatusCode,
  1132. },
  1133. }
  1134. target := &ret
  1135. if err := gensupport.DecodeResponse(target, res); err != nil {
  1136. return nil, err
  1137. }
  1138. return ret, nil
  1139. // {
  1140. // "description": "Deletes the specified matter. Returns matter with updated state.",
  1141. // "flatPath": "v1/matters/{matterId}",
  1142. // "httpMethod": "DELETE",
  1143. // "id": "vault.matters.delete",
  1144. // "parameterOrder": [
  1145. // "matterId"
  1146. // ],
  1147. // "parameters": {
  1148. // "matterId": {
  1149. // "description": "The matter ID",
  1150. // "location": "path",
  1151. // "required": true,
  1152. // "type": "string"
  1153. // }
  1154. // },
  1155. // "path": "v1/matters/{matterId}",
  1156. // "response": {
  1157. // "$ref": "Matter"
  1158. // },
  1159. // "scopes": [
  1160. // "https://www.googleapis.com/auth/ediscovery"
  1161. // ]
  1162. // }
  1163. }
  1164. // method id "vault.matters.get":
  1165. type MattersGetCall struct {
  1166. s *Service
  1167. matterId string
  1168. urlParams_ gensupport.URLParams
  1169. ifNoneMatch_ string
  1170. ctx_ context.Context
  1171. header_ http.Header
  1172. }
  1173. // Get: Gets the specified matter.
  1174. func (r *MattersService) Get(matterId string) *MattersGetCall {
  1175. c := &MattersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1176. c.matterId = matterId
  1177. return c
  1178. }
  1179. // View sets the optional parameter "view": Specifies which parts of the
  1180. // Matter to return in the response.
  1181. //
  1182. // Possible values:
  1183. // "VIEW_UNSPECIFIED"
  1184. // "BASIC"
  1185. // "FULL"
  1186. func (c *MattersGetCall) View(view string) *MattersGetCall {
  1187. c.urlParams_.Set("view", view)
  1188. return c
  1189. }
  1190. // Fields allows partial responses to be retrieved. See
  1191. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1192. // for more information.
  1193. func (c *MattersGetCall) Fields(s ...googleapi.Field) *MattersGetCall {
  1194. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1195. return c
  1196. }
  1197. // IfNoneMatch sets the optional parameter which makes the operation
  1198. // fail if the object's ETag matches the given value. This is useful for
  1199. // getting updates only after the object has changed since the last
  1200. // request. Use googleapi.IsNotModified to check whether the response
  1201. // error from Do is the result of In-None-Match.
  1202. func (c *MattersGetCall) IfNoneMatch(entityTag string) *MattersGetCall {
  1203. c.ifNoneMatch_ = entityTag
  1204. return c
  1205. }
  1206. // Context sets the context to be used in this call's Do method. Any
  1207. // pending HTTP request will be aborted if the provided context is
  1208. // canceled.
  1209. func (c *MattersGetCall) Context(ctx context.Context) *MattersGetCall {
  1210. c.ctx_ = ctx
  1211. return c
  1212. }
  1213. // Header returns an http.Header that can be modified by the caller to
  1214. // add HTTP headers to the request.
  1215. func (c *MattersGetCall) Header() http.Header {
  1216. if c.header_ == nil {
  1217. c.header_ = make(http.Header)
  1218. }
  1219. return c.header_
  1220. }
  1221. func (c *MattersGetCall) doRequest(alt string) (*http.Response, error) {
  1222. reqHeaders := make(http.Header)
  1223. for k, v := range c.header_ {
  1224. reqHeaders[k] = v
  1225. }
  1226. reqHeaders.Set("User-Agent", c.s.userAgent())
  1227. if c.ifNoneMatch_ != "" {
  1228. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1229. }
  1230. var body io.Reader = nil
  1231. c.urlParams_.Set("alt", alt)
  1232. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}")
  1233. urls += "?" + c.urlParams_.Encode()
  1234. req, _ := http.NewRequest("GET", urls, body)
  1235. req.Header = reqHeaders
  1236. googleapi.Expand(req.URL, map[string]string{
  1237. "matterId": c.matterId,
  1238. })
  1239. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1240. }
  1241. // Do executes the "vault.matters.get" call.
  1242. // Exactly one of *Matter or error will be non-nil. Any non-2xx status
  1243. // code is an error. Response headers are in either
  1244. // *Matter.ServerResponse.Header or (if a response was returned at all)
  1245. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1246. // check whether the returned error was because http.StatusNotModified
  1247. // was returned.
  1248. func (c *MattersGetCall) Do(opts ...googleapi.CallOption) (*Matter, error) {
  1249. gensupport.SetOptions(c.urlParams_, opts...)
  1250. res, err := c.doRequest("json")
  1251. if res != nil && res.StatusCode == http.StatusNotModified {
  1252. if res.Body != nil {
  1253. res.Body.Close()
  1254. }
  1255. return nil, &googleapi.Error{
  1256. Code: res.StatusCode,
  1257. Header: res.Header,
  1258. }
  1259. }
  1260. if err != nil {
  1261. return nil, err
  1262. }
  1263. defer googleapi.CloseBody(res)
  1264. if err := googleapi.CheckResponse(res); err != nil {
  1265. return nil, err
  1266. }
  1267. ret := &Matter{
  1268. ServerResponse: googleapi.ServerResponse{
  1269. Header: res.Header,
  1270. HTTPStatusCode: res.StatusCode,
  1271. },
  1272. }
  1273. target := &ret
  1274. if err := gensupport.DecodeResponse(target, res); err != nil {
  1275. return nil, err
  1276. }
  1277. return ret, nil
  1278. // {
  1279. // "description": "Gets the specified matter.",
  1280. // "flatPath": "v1/matters/{matterId}",
  1281. // "httpMethod": "GET",
  1282. // "id": "vault.matters.get",
  1283. // "parameterOrder": [
  1284. // "matterId"
  1285. // ],
  1286. // "parameters": {
  1287. // "matterId": {
  1288. // "description": "The matter ID.",
  1289. // "location": "path",
  1290. // "required": true,
  1291. // "type": "string"
  1292. // },
  1293. // "view": {
  1294. // "description": "Specifies which parts of the Matter to return in the response.",
  1295. // "enum": [
  1296. // "VIEW_UNSPECIFIED",
  1297. // "BASIC",
  1298. // "FULL"
  1299. // ],
  1300. // "location": "query",
  1301. // "type": "string"
  1302. // }
  1303. // },
  1304. // "path": "v1/matters/{matterId}",
  1305. // "response": {
  1306. // "$ref": "Matter"
  1307. // },
  1308. // "scopes": [
  1309. // "https://www.googleapis.com/auth/ediscovery",
  1310. // "https://www.googleapis.com/auth/ediscovery.readonly"
  1311. // ]
  1312. // }
  1313. }
  1314. // method id "vault.matters.list":
  1315. type MattersListCall struct {
  1316. s *Service
  1317. urlParams_ gensupport.URLParams
  1318. ifNoneMatch_ string
  1319. ctx_ context.Context
  1320. header_ http.Header
  1321. }
  1322. // List: Lists matters the user has access to.
  1323. func (r *MattersService) List() *MattersListCall {
  1324. c := &MattersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1325. return c
  1326. }
  1327. // PageSize sets the optional parameter "pageSize": The number of
  1328. // matters to return in the response.
  1329. // Default and maximum are 100.
  1330. func (c *MattersListCall) PageSize(pageSize int64) *MattersListCall {
  1331. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  1332. return c
  1333. }
  1334. // PageToken sets the optional parameter "pageToken": The pagination
  1335. // token as returned in the response.
  1336. func (c *MattersListCall) PageToken(pageToken string) *MattersListCall {
  1337. c.urlParams_.Set("pageToken", pageToken)
  1338. return c
  1339. }
  1340. // State sets the optional parameter "state": If set, list only matters
  1341. // with that specific state. The default is listing
  1342. // matters of all states.
  1343. //
  1344. // Possible values:
  1345. // "STATE_UNSPECIFIED"
  1346. // "OPEN"
  1347. // "CLOSED"
  1348. // "DELETED"
  1349. func (c *MattersListCall) State(state string) *MattersListCall {
  1350. c.urlParams_.Set("state", state)
  1351. return c
  1352. }
  1353. // View sets the optional parameter "view": Specifies which parts of the
  1354. // matter to return in response.
  1355. //
  1356. // Possible values:
  1357. // "VIEW_UNSPECIFIED"
  1358. // "BASIC"
  1359. // "FULL"
  1360. func (c *MattersListCall) View(view string) *MattersListCall {
  1361. c.urlParams_.Set("view", view)
  1362. return c
  1363. }
  1364. // Fields allows partial responses to be retrieved. See
  1365. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1366. // for more information.
  1367. func (c *MattersListCall) Fields(s ...googleapi.Field) *MattersListCall {
  1368. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1369. return c
  1370. }
  1371. // IfNoneMatch sets the optional parameter which makes the operation
  1372. // fail if the object's ETag matches the given value. This is useful for
  1373. // getting updates only after the object has changed since the last
  1374. // request. Use googleapi.IsNotModified to check whether the response
  1375. // error from Do is the result of In-None-Match.
  1376. func (c *MattersListCall) IfNoneMatch(entityTag string) *MattersListCall {
  1377. c.ifNoneMatch_ = entityTag
  1378. return c
  1379. }
  1380. // Context sets the context to be used in this call's Do method. Any
  1381. // pending HTTP request will be aborted if the provided context is
  1382. // canceled.
  1383. func (c *MattersListCall) Context(ctx context.Context) *MattersListCall {
  1384. c.ctx_ = ctx
  1385. return c
  1386. }
  1387. // Header returns an http.Header that can be modified by the caller to
  1388. // add HTTP headers to the request.
  1389. func (c *MattersListCall) Header() http.Header {
  1390. if c.header_ == nil {
  1391. c.header_ = make(http.Header)
  1392. }
  1393. return c.header_
  1394. }
  1395. func (c *MattersListCall) doRequest(alt string) (*http.Response, error) {
  1396. reqHeaders := make(http.Header)
  1397. for k, v := range c.header_ {
  1398. reqHeaders[k] = v
  1399. }
  1400. reqHeaders.Set("User-Agent", c.s.userAgent())
  1401. if c.ifNoneMatch_ != "" {
  1402. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  1403. }
  1404. var body io.Reader = nil
  1405. c.urlParams_.Set("alt", alt)
  1406. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters")
  1407. urls += "?" + c.urlParams_.Encode()
  1408. req, _ := http.NewRequest("GET", urls, body)
  1409. req.Header = reqHeaders
  1410. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1411. }
  1412. // Do executes the "vault.matters.list" call.
  1413. // Exactly one of *ListMattersResponse or error will be non-nil. Any
  1414. // non-2xx status code is an error. Response headers are in either
  1415. // *ListMattersResponse.ServerResponse.Header or (if a response was
  1416. // returned at all) in error.(*googleapi.Error).Header. Use
  1417. // googleapi.IsNotModified to check whether the returned error was
  1418. // because http.StatusNotModified was returned.
  1419. func (c *MattersListCall) Do(opts ...googleapi.CallOption) (*ListMattersResponse, error) {
  1420. gensupport.SetOptions(c.urlParams_, opts...)
  1421. res, err := c.doRequest("json")
  1422. if res != nil && res.StatusCode == http.StatusNotModified {
  1423. if res.Body != nil {
  1424. res.Body.Close()
  1425. }
  1426. return nil, &googleapi.Error{
  1427. Code: res.StatusCode,
  1428. Header: res.Header,
  1429. }
  1430. }
  1431. if err != nil {
  1432. return nil, err
  1433. }
  1434. defer googleapi.CloseBody(res)
  1435. if err := googleapi.CheckResponse(res); err != nil {
  1436. return nil, err
  1437. }
  1438. ret := &ListMattersResponse{
  1439. ServerResponse: googleapi.ServerResponse{
  1440. Header: res.Header,
  1441. HTTPStatusCode: res.StatusCode,
  1442. },
  1443. }
  1444. target := &ret
  1445. if err := gensupport.DecodeResponse(target, res); err != nil {
  1446. return nil, err
  1447. }
  1448. return ret, nil
  1449. // {
  1450. // "description": "Lists matters the user has access to.",
  1451. // "flatPath": "v1/matters",
  1452. // "httpMethod": "GET",
  1453. // "id": "vault.matters.list",
  1454. // "parameterOrder": [],
  1455. // "parameters": {
  1456. // "pageSize": {
  1457. // "description": "The number of matters to return in the response.\nDefault and maximum are 100.",
  1458. // "format": "int32",
  1459. // "location": "query",
  1460. // "type": "integer"
  1461. // },
  1462. // "pageToken": {
  1463. // "description": "The pagination token as returned in the response.",
  1464. // "location": "query",
  1465. // "type": "string"
  1466. // },
  1467. // "state": {
  1468. // "description": "If set, list only matters with that specific state. The default is listing\nmatters of all states.",
  1469. // "enum": [
  1470. // "STATE_UNSPECIFIED",
  1471. // "OPEN",
  1472. // "CLOSED",
  1473. // "DELETED"
  1474. // ],
  1475. // "location": "query",
  1476. // "type": "string"
  1477. // },
  1478. // "view": {
  1479. // "description": "Specifies which parts of the matter to return in response.",
  1480. // "enum": [
  1481. // "VIEW_UNSPECIFIED",
  1482. // "BASIC",
  1483. // "FULL"
  1484. // ],
  1485. // "location": "query",
  1486. // "type": "string"
  1487. // }
  1488. // },
  1489. // "path": "v1/matters",
  1490. // "response": {
  1491. // "$ref": "ListMattersResponse"
  1492. // },
  1493. // "scopes": [
  1494. // "https://www.googleapis.com/auth/ediscovery",
  1495. // "https://www.googleapis.com/auth/ediscovery.readonly"
  1496. // ]
  1497. // }
  1498. }
  1499. // Pages invokes f for each page of results.
  1500. // A non-nil error returned from f will halt the iteration.
  1501. // The provided context supersedes any context provided to the Context method.
  1502. func (c *MattersListCall) Pages(ctx context.Context, f func(*ListMattersResponse) error) error {
  1503. c.ctx_ = ctx
  1504. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  1505. for {
  1506. x, err := c.Do()
  1507. if err != nil {
  1508. return err
  1509. }
  1510. if err := f(x); err != nil {
  1511. return err
  1512. }
  1513. if x.NextPageToken == "" {
  1514. return nil
  1515. }
  1516. c.PageToken(x.NextPageToken)
  1517. }
  1518. }
  1519. // method id "vault.matters.removePermissions":
  1520. type MattersRemovePermissionsCall struct {
  1521. s *Service
  1522. matterId string
  1523. removematterpermissionsrequest *RemoveMatterPermissionsRequest
  1524. urlParams_ gensupport.URLParams
  1525. ctx_ context.Context
  1526. header_ http.Header
  1527. }
  1528. // RemovePermissions: Removes an account as a matter collaborator.
  1529. func (r *MattersService) RemovePermissions(matterId string, removematterpermissionsrequest *RemoveMatterPermissionsRequest) *MattersRemovePermissionsCall {
  1530. c := &MattersRemovePermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1531. c.matterId = matterId
  1532. c.removematterpermissionsrequest = removematterpermissionsrequest
  1533. return c
  1534. }
  1535. // Fields allows partial responses to be retrieved. See
  1536. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1537. // for more information.
  1538. func (c *MattersRemovePermissionsCall) Fields(s ...googleapi.Field) *MattersRemovePermissionsCall {
  1539. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1540. return c
  1541. }
  1542. // Context sets the context to be used in this call's Do method. Any
  1543. // pending HTTP request will be aborted if the provided context is
  1544. // canceled.
  1545. func (c *MattersRemovePermissionsCall) Context(ctx context.Context) *MattersRemovePermissionsCall {
  1546. c.ctx_ = ctx
  1547. return c
  1548. }
  1549. // Header returns an http.Header that can be modified by the caller to
  1550. // add HTTP headers to the request.
  1551. func (c *MattersRemovePermissionsCall) Header() http.Header {
  1552. if c.header_ == nil {
  1553. c.header_ = make(http.Header)
  1554. }
  1555. return c.header_
  1556. }
  1557. func (c *MattersRemovePermissionsCall) doRequest(alt string) (*http.Response, error) {
  1558. reqHeaders := make(http.Header)
  1559. for k, v := range c.header_ {
  1560. reqHeaders[k] = v
  1561. }
  1562. reqHeaders.Set("User-Agent", c.s.userAgent())
  1563. var body io.Reader = nil
  1564. body, err := googleapi.WithoutDataWrapper.JSONReader(c.removematterpermissionsrequest)
  1565. if err != nil {
  1566. return nil, err
  1567. }
  1568. reqHeaders.Set("Content-Type", "application/json")
  1569. c.urlParams_.Set("alt", alt)
  1570. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}:removePermissions")
  1571. urls += "?" + c.urlParams_.Encode()
  1572. req, _ := http.NewRequest("POST", urls, body)
  1573. req.Header = reqHeaders
  1574. googleapi.Expand(req.URL, map[string]string{
  1575. "matterId": c.matterId,
  1576. })
  1577. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1578. }
  1579. // Do executes the "vault.matters.removePermissions" call.
  1580. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  1581. // code is an error. Response headers are in either
  1582. // *Empty.ServerResponse.Header or (if a response was returned at all)
  1583. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1584. // check whether the returned error was because http.StatusNotModified
  1585. // was returned.
  1586. func (c *MattersRemovePermissionsCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  1587. gensupport.SetOptions(c.urlParams_, opts...)
  1588. res, err := c.doRequest("json")
  1589. if res != nil && res.StatusCode == http.StatusNotModified {
  1590. if res.Body != nil {
  1591. res.Body.Close()
  1592. }
  1593. return nil, &googleapi.Error{
  1594. Code: res.StatusCode,
  1595. Header: res.Header,
  1596. }
  1597. }
  1598. if err != nil {
  1599. return nil, err
  1600. }
  1601. defer googleapi.CloseBody(res)
  1602. if err := googleapi.CheckResponse(res); err != nil {
  1603. return nil, err
  1604. }
  1605. ret := &Empty{
  1606. ServerResponse: googleapi.ServerResponse{
  1607. Header: res.Header,
  1608. HTTPStatusCode: res.StatusCode,
  1609. },
  1610. }
  1611. target := &ret
  1612. if err := gensupport.DecodeResponse(target, res); err != nil {
  1613. return nil, err
  1614. }
  1615. return ret, nil
  1616. // {
  1617. // "description": "Removes an account as a matter collaborator.",
  1618. // "flatPath": "v1/matters/{matterId}:removePermissions",
  1619. // "httpMethod": "POST",
  1620. // "id": "vault.matters.removePermissions",
  1621. // "parameterOrder": [
  1622. // "matterId"
  1623. // ],
  1624. // "parameters": {
  1625. // "matterId": {
  1626. // "description": "The matter ID.",
  1627. // "location": "path",
  1628. // "required": true,
  1629. // "type": "string"
  1630. // }
  1631. // },
  1632. // "path": "v1/matters/{matterId}:removePermissions",
  1633. // "request": {
  1634. // "$ref": "RemoveMatterPermissionsRequest"
  1635. // },
  1636. // "response": {
  1637. // "$ref": "Empty"
  1638. // },
  1639. // "scopes": [
  1640. // "https://www.googleapis.com/auth/ediscovery"
  1641. // ]
  1642. // }
  1643. }
  1644. // method id "vault.matters.reopen":
  1645. type MattersReopenCall struct {
  1646. s *Service
  1647. matterId string
  1648. reopenmatterrequest *ReopenMatterRequest
  1649. urlParams_ gensupport.URLParams
  1650. ctx_ context.Context
  1651. header_ http.Header
  1652. }
  1653. // Reopen: Reopens the specified matter. Returns matter with updated
  1654. // state.
  1655. func (r *MattersService) Reopen(matterId string, reopenmatterrequest *ReopenMatterRequest) *MattersReopenCall {
  1656. c := &MattersReopenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1657. c.matterId = matterId
  1658. c.reopenmatterrequest = reopenmatterrequest
  1659. return c
  1660. }
  1661. // Fields allows partial responses to be retrieved. See
  1662. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1663. // for more information.
  1664. func (c *MattersReopenCall) Fields(s ...googleapi.Field) *MattersReopenCall {
  1665. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1666. return c
  1667. }
  1668. // Context sets the context to be used in this call's Do method. Any
  1669. // pending HTTP request will be aborted if the provided context is
  1670. // canceled.
  1671. func (c *MattersReopenCall) Context(ctx context.Context) *MattersReopenCall {
  1672. c.ctx_ = ctx
  1673. return c
  1674. }
  1675. // Header returns an http.Header that can be modified by the caller to
  1676. // add HTTP headers to the request.
  1677. func (c *MattersReopenCall) Header() http.Header {
  1678. if c.header_ == nil {
  1679. c.header_ = make(http.Header)
  1680. }
  1681. return c.header_
  1682. }
  1683. func (c *MattersReopenCall) doRequest(alt string) (*http.Response, error) {
  1684. reqHeaders := make(http.Header)
  1685. for k, v := range c.header_ {
  1686. reqHeaders[k] = v
  1687. }
  1688. reqHeaders.Set("User-Agent", c.s.userAgent())
  1689. var body io.Reader = nil
  1690. body, err := googleapi.WithoutDataWrapper.JSONReader(c.reopenmatterrequest)
  1691. if err != nil {
  1692. return nil, err
  1693. }
  1694. reqHeaders.Set("Content-Type", "application/json")
  1695. c.urlParams_.Set("alt", alt)
  1696. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}:reopen")
  1697. urls += "?" + c.urlParams_.Encode()
  1698. req, _ := http.NewRequest("POST", urls, body)
  1699. req.Header = reqHeaders
  1700. googleapi.Expand(req.URL, map[string]string{
  1701. "matterId": c.matterId,
  1702. })
  1703. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1704. }
  1705. // Do executes the "vault.matters.reopen" call.
  1706. // Exactly one of *ReopenMatterResponse or error will be non-nil. Any
  1707. // non-2xx status code is an error. Response headers are in either
  1708. // *ReopenMatterResponse.ServerResponse.Header or (if a response was
  1709. // returned at all) in error.(*googleapi.Error).Header. Use
  1710. // googleapi.IsNotModified to check whether the returned error was
  1711. // because http.StatusNotModified was returned.
  1712. func (c *MattersReopenCall) Do(opts ...googleapi.CallOption) (*ReopenMatterResponse, error) {
  1713. gensupport.SetOptions(c.urlParams_, opts...)
  1714. res, err := c.doRequest("json")
  1715. if res != nil && res.StatusCode == http.StatusNotModified {
  1716. if res.Body != nil {
  1717. res.Body.Close()
  1718. }
  1719. return nil, &googleapi.Error{
  1720. Code: res.StatusCode,
  1721. Header: res.Header,
  1722. }
  1723. }
  1724. if err != nil {
  1725. return nil, err
  1726. }
  1727. defer googleapi.CloseBody(res)
  1728. if err := googleapi.CheckResponse(res); err != nil {
  1729. return nil, err
  1730. }
  1731. ret := &ReopenMatterResponse{
  1732. ServerResponse: googleapi.ServerResponse{
  1733. Header: res.Header,
  1734. HTTPStatusCode: res.StatusCode,
  1735. },
  1736. }
  1737. target := &ret
  1738. if err := gensupport.DecodeResponse(target, res); err != nil {
  1739. return nil, err
  1740. }
  1741. return ret, nil
  1742. // {
  1743. // "description": "Reopens the specified matter. Returns matter with updated state.",
  1744. // "flatPath": "v1/matters/{matterId}:reopen",
  1745. // "httpMethod": "POST",
  1746. // "id": "vault.matters.reopen",
  1747. // "parameterOrder": [
  1748. // "matterId"
  1749. // ],
  1750. // "parameters": {
  1751. // "matterId": {
  1752. // "description": "The matter ID.",
  1753. // "location": "path",
  1754. // "required": true,
  1755. // "type": "string"
  1756. // }
  1757. // },
  1758. // "path": "v1/matters/{matterId}:reopen",
  1759. // "request": {
  1760. // "$ref": "ReopenMatterRequest"
  1761. // },
  1762. // "response": {
  1763. // "$ref": "ReopenMatterResponse"
  1764. // },
  1765. // "scopes": [
  1766. // "https://www.googleapis.com/auth/ediscovery"
  1767. // ]
  1768. // }
  1769. }
  1770. // method id "vault.matters.undelete":
  1771. type MattersUndeleteCall struct {
  1772. s *Service
  1773. matterId string
  1774. undeletematterrequest *UndeleteMatterRequest
  1775. urlParams_ gensupport.URLParams
  1776. ctx_ context.Context
  1777. header_ http.Header
  1778. }
  1779. // Undelete: Undeletes the specified matter. Returns matter with updated
  1780. // state.
  1781. func (r *MattersService) Undelete(matterId string, undeletematterrequest *UndeleteMatterRequest) *MattersUndeleteCall {
  1782. c := &MattersUndeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1783. c.matterId = matterId
  1784. c.undeletematterrequest = undeletematterrequest
  1785. return c
  1786. }
  1787. // Fields allows partial responses to be retrieved. See
  1788. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1789. // for more information.
  1790. func (c *MattersUndeleteCall) Fields(s ...googleapi.Field) *MattersUndeleteCall {
  1791. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1792. return c
  1793. }
  1794. // Context sets the context to be used in this call's Do method. Any
  1795. // pending HTTP request will be aborted if the provided context is
  1796. // canceled.
  1797. func (c *MattersUndeleteCall) Context(ctx context.Context) *MattersUndeleteCall {
  1798. c.ctx_ = ctx
  1799. return c
  1800. }
  1801. // Header returns an http.Header that can be modified by the caller to
  1802. // add HTTP headers to the request.
  1803. func (c *MattersUndeleteCall) Header() http.Header {
  1804. if c.header_ == nil {
  1805. c.header_ = make(http.Header)
  1806. }
  1807. return c.header_
  1808. }
  1809. func (c *MattersUndeleteCall) doRequest(alt string) (*http.Response, error) {
  1810. reqHeaders := make(http.Header)
  1811. for k, v := range c.header_ {
  1812. reqHeaders[k] = v
  1813. }
  1814. reqHeaders.Set("User-Agent", c.s.userAgent())
  1815. var body io.Reader = nil
  1816. body, err := googleapi.WithoutDataWrapper.JSONReader(c.undeletematterrequest)
  1817. if err != nil {
  1818. return nil, err
  1819. }
  1820. reqHeaders.Set("Content-Type", "application/json")
  1821. c.urlParams_.Set("alt", alt)
  1822. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}:undelete")
  1823. urls += "?" + c.urlParams_.Encode()
  1824. req, _ := http.NewRequest("POST", urls, body)
  1825. req.Header = reqHeaders
  1826. googleapi.Expand(req.URL, map[string]string{
  1827. "matterId": c.matterId,
  1828. })
  1829. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1830. }
  1831. // Do executes the "vault.matters.undelete" call.
  1832. // Exactly one of *Matter or error will be non-nil. Any non-2xx status
  1833. // code is an error. Response headers are in either
  1834. // *Matter.ServerResponse.Header or (if a response was returned at all)
  1835. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1836. // check whether the returned error was because http.StatusNotModified
  1837. // was returned.
  1838. func (c *MattersUndeleteCall) Do(opts ...googleapi.CallOption) (*Matter, error) {
  1839. gensupport.SetOptions(c.urlParams_, opts...)
  1840. res, err := c.doRequest("json")
  1841. if res != nil && res.StatusCode == http.StatusNotModified {
  1842. if res.Body != nil {
  1843. res.Body.Close()
  1844. }
  1845. return nil, &googleapi.Error{
  1846. Code: res.StatusCode,
  1847. Header: res.Header,
  1848. }
  1849. }
  1850. if err != nil {
  1851. return nil, err
  1852. }
  1853. defer googleapi.CloseBody(res)
  1854. if err := googleapi.CheckResponse(res); err != nil {
  1855. return nil, err
  1856. }
  1857. ret := &Matter{
  1858. ServerResponse: googleapi.ServerResponse{
  1859. Header: res.Header,
  1860. HTTPStatusCode: res.StatusCode,
  1861. },
  1862. }
  1863. target := &ret
  1864. if err := gensupport.DecodeResponse(target, res); err != nil {
  1865. return nil, err
  1866. }
  1867. return ret, nil
  1868. // {
  1869. // "description": "Undeletes the specified matter. Returns matter with updated state.",
  1870. // "flatPath": "v1/matters/{matterId}:undelete",
  1871. // "httpMethod": "POST",
  1872. // "id": "vault.matters.undelete",
  1873. // "parameterOrder": [
  1874. // "matterId"
  1875. // ],
  1876. // "parameters": {
  1877. // "matterId": {
  1878. // "description": "The matter ID.",
  1879. // "location": "path",
  1880. // "required": true,
  1881. // "type": "string"
  1882. // }
  1883. // },
  1884. // "path": "v1/matters/{matterId}:undelete",
  1885. // "request": {
  1886. // "$ref": "UndeleteMatterRequest"
  1887. // },
  1888. // "response": {
  1889. // "$ref": "Matter"
  1890. // },
  1891. // "scopes": [
  1892. // "https://www.googleapis.com/auth/ediscovery"
  1893. // ]
  1894. // }
  1895. }
  1896. // method id "vault.matters.update":
  1897. type MattersUpdateCall struct {
  1898. s *Service
  1899. matterId string
  1900. matter *Matter
  1901. urlParams_ gensupport.URLParams
  1902. ctx_ context.Context
  1903. header_ http.Header
  1904. }
  1905. // Update: Updates the specified matter.
  1906. // This updates only the name and description of the matter, identified
  1907. // by
  1908. // matter id. Changes to any other fields are ignored.
  1909. // Returns the default view of the matter.
  1910. func (r *MattersService) Update(matterId string, matter *Matter) *MattersUpdateCall {
  1911. c := &MattersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1912. c.matterId = matterId
  1913. c.matter = matter
  1914. return c
  1915. }
  1916. // Fields allows partial responses to be retrieved. See
  1917. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1918. // for more information.
  1919. func (c *MattersUpdateCall) Fields(s ...googleapi.Field) *MattersUpdateCall {
  1920. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1921. return c
  1922. }
  1923. // Context sets the context to be used in this call's Do method. Any
  1924. // pending HTTP request will be aborted if the provided context is
  1925. // canceled.
  1926. func (c *MattersUpdateCall) Context(ctx context.Context) *MattersUpdateCall {
  1927. c.ctx_ = ctx
  1928. return c
  1929. }
  1930. // Header returns an http.Header that can be modified by the caller to
  1931. // add HTTP headers to the request.
  1932. func (c *MattersUpdateCall) Header() http.Header {
  1933. if c.header_ == nil {
  1934. c.header_ = make(http.Header)
  1935. }
  1936. return c.header_
  1937. }
  1938. func (c *MattersUpdateCall) doRequest(alt string) (*http.Response, error) {
  1939. reqHeaders := make(http.Header)
  1940. for k, v := range c.header_ {
  1941. reqHeaders[k] = v
  1942. }
  1943. reqHeaders.Set("User-Agent", c.s.userAgent())
  1944. var body io.Reader = nil
  1945. body, err := googleapi.WithoutDataWrapper.JSONReader(c.matter)
  1946. if err != nil {
  1947. return nil, err
  1948. }
  1949. reqHeaders.Set("Content-Type", "application/json")
  1950. c.urlParams_.Set("alt", alt)
  1951. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}")
  1952. urls += "?" + c.urlParams_.Encode()
  1953. req, _ := http.NewRequest("PUT", urls, body)
  1954. req.Header = reqHeaders
  1955. googleapi.Expand(req.URL, map[string]string{
  1956. "matterId": c.matterId,
  1957. })
  1958. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1959. }
  1960. // Do executes the "vault.matters.update" call.
  1961. // Exactly one of *Matter or error will be non-nil. Any non-2xx status
  1962. // code is an error. Response headers are in either
  1963. // *Matter.ServerResponse.Header or (if a response was returned at all)
  1964. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  1965. // check whether the returned error was because http.StatusNotModified
  1966. // was returned.
  1967. func (c *MattersUpdateCall) Do(opts ...googleapi.CallOption) (*Matter, error) {
  1968. gensupport.SetOptions(c.urlParams_, opts...)
  1969. res, err := c.doRequest("json")
  1970. if res != nil && res.StatusCode == http.StatusNotModified {
  1971. if res.Body != nil {
  1972. res.Body.Close()
  1973. }
  1974. return nil, &googleapi.Error{
  1975. Code: res.StatusCode,
  1976. Header: res.Header,
  1977. }
  1978. }
  1979. if err != nil {
  1980. return nil, err
  1981. }
  1982. defer googleapi.CloseBody(res)
  1983. if err := googleapi.CheckResponse(res); err != nil {
  1984. return nil, err
  1985. }
  1986. ret := &Matter{
  1987. ServerResponse: googleapi.ServerResponse{
  1988. Header: res.Header,
  1989. HTTPStatusCode: res.StatusCode,
  1990. },
  1991. }
  1992. target := &ret
  1993. if err := gensupport.DecodeResponse(target, res); err != nil {
  1994. return nil, err
  1995. }
  1996. return ret, nil
  1997. // {
  1998. // "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.",
  1999. // "flatPath": "v1/matters/{matterId}",
  2000. // "httpMethod": "PUT",
  2001. // "id": "vault.matters.update",
  2002. // "parameterOrder": [
  2003. // "matterId"
  2004. // ],
  2005. // "parameters": {
  2006. // "matterId": {
  2007. // "description": "The matter ID.",
  2008. // "location": "path",
  2009. // "required": true,
  2010. // "type": "string"
  2011. // }
  2012. // },
  2013. // "path": "v1/matters/{matterId}",
  2014. // "request": {
  2015. // "$ref": "Matter"
  2016. // },
  2017. // "response": {
  2018. // "$ref": "Matter"
  2019. // },
  2020. // "scopes": [
  2021. // "https://www.googleapis.com/auth/ediscovery"
  2022. // ]
  2023. // }
  2024. }
  2025. // method id "vault.matters.holds.create":
  2026. type MattersHoldsCreateCall struct {
  2027. s *Service
  2028. matterId string
  2029. hold *Hold
  2030. urlParams_ gensupport.URLParams
  2031. ctx_ context.Context
  2032. header_ http.Header
  2033. }
  2034. // Create: Creates a hold in the given matter.
  2035. func (r *MattersHoldsService) Create(matterId string, hold *Hold) *MattersHoldsCreateCall {
  2036. c := &MattersHoldsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2037. c.matterId = matterId
  2038. c.hold = hold
  2039. return c
  2040. }
  2041. // Fields allows partial responses to be retrieved. See
  2042. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2043. // for more information.
  2044. func (c *MattersHoldsCreateCall) Fields(s ...googleapi.Field) *MattersHoldsCreateCall {
  2045. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2046. return c
  2047. }
  2048. // Context sets the context to be used in this call's Do method. Any
  2049. // pending HTTP request will be aborted if the provided context is
  2050. // canceled.
  2051. func (c *MattersHoldsCreateCall) Context(ctx context.Context) *MattersHoldsCreateCall {
  2052. c.ctx_ = ctx
  2053. return c
  2054. }
  2055. // Header returns an http.Header that can be modified by the caller to
  2056. // add HTTP headers to the request.
  2057. func (c *MattersHoldsCreateCall) Header() http.Header {
  2058. if c.header_ == nil {
  2059. c.header_ = make(http.Header)
  2060. }
  2061. return c.header_
  2062. }
  2063. func (c *MattersHoldsCreateCall) doRequest(alt string) (*http.Response, error) {
  2064. reqHeaders := make(http.Header)
  2065. for k, v := range c.header_ {
  2066. reqHeaders[k] = v
  2067. }
  2068. reqHeaders.Set("User-Agent", c.s.userAgent())
  2069. var body io.Reader = nil
  2070. body, err := googleapi.WithoutDataWrapper.JSONReader(c.hold)
  2071. if err != nil {
  2072. return nil, err
  2073. }
  2074. reqHeaders.Set("Content-Type", "application/json")
  2075. c.urlParams_.Set("alt", alt)
  2076. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds")
  2077. urls += "?" + c.urlParams_.Encode()
  2078. req, _ := http.NewRequest("POST", urls, body)
  2079. req.Header = reqHeaders
  2080. googleapi.Expand(req.URL, map[string]string{
  2081. "matterId": c.matterId,
  2082. })
  2083. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2084. }
  2085. // Do executes the "vault.matters.holds.create" call.
  2086. // Exactly one of *Hold or error will be non-nil. Any non-2xx status
  2087. // code is an error. Response headers are in either
  2088. // *Hold.ServerResponse.Header or (if a response was returned at all) in
  2089. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2090. // whether the returned error was because http.StatusNotModified was
  2091. // returned.
  2092. func (c *MattersHoldsCreateCall) Do(opts ...googleapi.CallOption) (*Hold, error) {
  2093. gensupport.SetOptions(c.urlParams_, opts...)
  2094. res, err := c.doRequest("json")
  2095. if res != nil && res.StatusCode == http.StatusNotModified {
  2096. if res.Body != nil {
  2097. res.Body.Close()
  2098. }
  2099. return nil, &googleapi.Error{
  2100. Code: res.StatusCode,
  2101. Header: res.Header,
  2102. }
  2103. }
  2104. if err != nil {
  2105. return nil, err
  2106. }
  2107. defer googleapi.CloseBody(res)
  2108. if err := googleapi.CheckResponse(res); err != nil {
  2109. return nil, err
  2110. }
  2111. ret := &Hold{
  2112. ServerResponse: googleapi.ServerResponse{
  2113. Header: res.Header,
  2114. HTTPStatusCode: res.StatusCode,
  2115. },
  2116. }
  2117. target := &ret
  2118. if err := gensupport.DecodeResponse(target, res); err != nil {
  2119. return nil, err
  2120. }
  2121. return ret, nil
  2122. // {
  2123. // "description": "Creates a hold in the given matter.",
  2124. // "flatPath": "v1/matters/{matterId}/holds",
  2125. // "httpMethod": "POST",
  2126. // "id": "vault.matters.holds.create",
  2127. // "parameterOrder": [
  2128. // "matterId"
  2129. // ],
  2130. // "parameters": {
  2131. // "matterId": {
  2132. // "description": "The matter ID.",
  2133. // "location": "path",
  2134. // "required": true,
  2135. // "type": "string"
  2136. // }
  2137. // },
  2138. // "path": "v1/matters/{matterId}/holds",
  2139. // "request": {
  2140. // "$ref": "Hold"
  2141. // },
  2142. // "response": {
  2143. // "$ref": "Hold"
  2144. // },
  2145. // "scopes": [
  2146. // "https://www.googleapis.com/auth/ediscovery"
  2147. // ]
  2148. // }
  2149. }
  2150. // method id "vault.matters.holds.delete":
  2151. type MattersHoldsDeleteCall struct {
  2152. s *Service
  2153. matterId string
  2154. holdId string
  2155. urlParams_ gensupport.URLParams
  2156. ctx_ context.Context
  2157. header_ http.Header
  2158. }
  2159. // Delete: Removes a hold by ID. This will release any HeldAccounts on
  2160. // this Hold.
  2161. func (r *MattersHoldsService) Delete(matterId string, holdId string) *MattersHoldsDeleteCall {
  2162. c := &MattersHoldsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2163. c.matterId = matterId
  2164. c.holdId = holdId
  2165. return c
  2166. }
  2167. // Fields allows partial responses to be retrieved. See
  2168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2169. // for more information.
  2170. func (c *MattersHoldsDeleteCall) Fields(s ...googleapi.Field) *MattersHoldsDeleteCall {
  2171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2172. return c
  2173. }
  2174. // Context sets the context to be used in this call's Do method. Any
  2175. // pending HTTP request will be aborted if the provided context is
  2176. // canceled.
  2177. func (c *MattersHoldsDeleteCall) Context(ctx context.Context) *MattersHoldsDeleteCall {
  2178. c.ctx_ = ctx
  2179. return c
  2180. }
  2181. // Header returns an http.Header that can be modified by the caller to
  2182. // add HTTP headers to the request.
  2183. func (c *MattersHoldsDeleteCall) Header() http.Header {
  2184. if c.header_ == nil {
  2185. c.header_ = make(http.Header)
  2186. }
  2187. return c.header_
  2188. }
  2189. func (c *MattersHoldsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2190. reqHeaders := make(http.Header)
  2191. for k, v := range c.header_ {
  2192. reqHeaders[k] = v
  2193. }
  2194. reqHeaders.Set("User-Agent", c.s.userAgent())
  2195. var body io.Reader = nil
  2196. c.urlParams_.Set("alt", alt)
  2197. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds/{holdId}")
  2198. urls += "?" + c.urlParams_.Encode()
  2199. req, _ := http.NewRequest("DELETE", urls, body)
  2200. req.Header = reqHeaders
  2201. googleapi.Expand(req.URL, map[string]string{
  2202. "matterId": c.matterId,
  2203. "holdId": c.holdId,
  2204. })
  2205. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2206. }
  2207. // Do executes the "vault.matters.holds.delete" call.
  2208. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2209. // code is an error. Response headers are in either
  2210. // *Empty.ServerResponse.Header or (if a response was returned at all)
  2211. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2212. // check whether the returned error was because http.StatusNotModified
  2213. // was returned.
  2214. func (c *MattersHoldsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2215. gensupport.SetOptions(c.urlParams_, opts...)
  2216. res, err := c.doRequest("json")
  2217. if res != nil && res.StatusCode == http.StatusNotModified {
  2218. if res.Body != nil {
  2219. res.Body.Close()
  2220. }
  2221. return nil, &googleapi.Error{
  2222. Code: res.StatusCode,
  2223. Header: res.Header,
  2224. }
  2225. }
  2226. if err != nil {
  2227. return nil, err
  2228. }
  2229. defer googleapi.CloseBody(res)
  2230. if err := googleapi.CheckResponse(res); err != nil {
  2231. return nil, err
  2232. }
  2233. ret := &Empty{
  2234. ServerResponse: googleapi.ServerResponse{
  2235. Header: res.Header,
  2236. HTTPStatusCode: res.StatusCode,
  2237. },
  2238. }
  2239. target := &ret
  2240. if err := gensupport.DecodeResponse(target, res); err != nil {
  2241. return nil, err
  2242. }
  2243. return ret, nil
  2244. // {
  2245. // "description": "Removes a hold by ID. This will release any HeldAccounts on this Hold.",
  2246. // "flatPath": "v1/matters/{matterId}/holds/{holdId}",
  2247. // "httpMethod": "DELETE",
  2248. // "id": "vault.matters.holds.delete",
  2249. // "parameterOrder": [
  2250. // "matterId",
  2251. // "holdId"
  2252. // ],
  2253. // "parameters": {
  2254. // "holdId": {
  2255. // "description": "The hold ID.",
  2256. // "location": "path",
  2257. // "required": true,
  2258. // "type": "string"
  2259. // },
  2260. // "matterId": {
  2261. // "description": "The matter ID.",
  2262. // "location": "path",
  2263. // "required": true,
  2264. // "type": "string"
  2265. // }
  2266. // },
  2267. // "path": "v1/matters/{matterId}/holds/{holdId}",
  2268. // "response": {
  2269. // "$ref": "Empty"
  2270. // },
  2271. // "scopes": [
  2272. // "https://www.googleapis.com/auth/ediscovery"
  2273. // ]
  2274. // }
  2275. }
  2276. // method id "vault.matters.holds.get":
  2277. type MattersHoldsGetCall struct {
  2278. s *Service
  2279. matterId string
  2280. holdId string
  2281. urlParams_ gensupport.URLParams
  2282. ifNoneMatch_ string
  2283. ctx_ context.Context
  2284. header_ http.Header
  2285. }
  2286. // Get: Gets a hold by ID.
  2287. func (r *MattersHoldsService) Get(matterId string, holdId string) *MattersHoldsGetCall {
  2288. c := &MattersHoldsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2289. c.matterId = matterId
  2290. c.holdId = holdId
  2291. return c
  2292. }
  2293. // View sets the optional parameter "view": Specifies which parts of the
  2294. // Hold to return.
  2295. //
  2296. // Possible values:
  2297. // "HOLD_VIEW_UNSPECIFIED"
  2298. // "BASIC_HOLD"
  2299. // "FULL_HOLD"
  2300. func (c *MattersHoldsGetCall) View(view string) *MattersHoldsGetCall {
  2301. c.urlParams_.Set("view", view)
  2302. return c
  2303. }
  2304. // Fields allows partial responses to be retrieved. See
  2305. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2306. // for more information.
  2307. func (c *MattersHoldsGetCall) Fields(s ...googleapi.Field) *MattersHoldsGetCall {
  2308. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2309. return c
  2310. }
  2311. // IfNoneMatch sets the optional parameter which makes the operation
  2312. // fail if the object's ETag matches the given value. This is useful for
  2313. // getting updates only after the object has changed since the last
  2314. // request. Use googleapi.IsNotModified to check whether the response
  2315. // error from Do is the result of In-None-Match.
  2316. func (c *MattersHoldsGetCall) IfNoneMatch(entityTag string) *MattersHoldsGetCall {
  2317. c.ifNoneMatch_ = entityTag
  2318. return c
  2319. }
  2320. // Context sets the context to be used in this call's Do method. Any
  2321. // pending HTTP request will be aborted if the provided context is
  2322. // canceled.
  2323. func (c *MattersHoldsGetCall) Context(ctx context.Context) *MattersHoldsGetCall {
  2324. c.ctx_ = ctx
  2325. return c
  2326. }
  2327. // Header returns an http.Header that can be modified by the caller to
  2328. // add HTTP headers to the request.
  2329. func (c *MattersHoldsGetCall) Header() http.Header {
  2330. if c.header_ == nil {
  2331. c.header_ = make(http.Header)
  2332. }
  2333. return c.header_
  2334. }
  2335. func (c *MattersHoldsGetCall) doRequest(alt string) (*http.Response, error) {
  2336. reqHeaders := make(http.Header)
  2337. for k, v := range c.header_ {
  2338. reqHeaders[k] = v
  2339. }
  2340. reqHeaders.Set("User-Agent", c.s.userAgent())
  2341. if c.ifNoneMatch_ != "" {
  2342. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2343. }
  2344. var body io.Reader = nil
  2345. c.urlParams_.Set("alt", alt)
  2346. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds/{holdId}")
  2347. urls += "?" + c.urlParams_.Encode()
  2348. req, _ := http.NewRequest("GET", urls, body)
  2349. req.Header = reqHeaders
  2350. googleapi.Expand(req.URL, map[string]string{
  2351. "matterId": c.matterId,
  2352. "holdId": c.holdId,
  2353. })
  2354. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2355. }
  2356. // Do executes the "vault.matters.holds.get" call.
  2357. // Exactly one of *Hold or error will be non-nil. Any non-2xx status
  2358. // code is an error. Response headers are in either
  2359. // *Hold.ServerResponse.Header or (if a response was returned at all) in
  2360. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2361. // whether the returned error was because http.StatusNotModified was
  2362. // returned.
  2363. func (c *MattersHoldsGetCall) Do(opts ...googleapi.CallOption) (*Hold, error) {
  2364. gensupport.SetOptions(c.urlParams_, opts...)
  2365. res, err := c.doRequest("json")
  2366. if res != nil && res.StatusCode == http.StatusNotModified {
  2367. if res.Body != nil {
  2368. res.Body.Close()
  2369. }
  2370. return nil, &googleapi.Error{
  2371. Code: res.StatusCode,
  2372. Header: res.Header,
  2373. }
  2374. }
  2375. if err != nil {
  2376. return nil, err
  2377. }
  2378. defer googleapi.CloseBody(res)
  2379. if err := googleapi.CheckResponse(res); err != nil {
  2380. return nil, err
  2381. }
  2382. ret := &Hold{
  2383. ServerResponse: googleapi.ServerResponse{
  2384. Header: res.Header,
  2385. HTTPStatusCode: res.StatusCode,
  2386. },
  2387. }
  2388. target := &ret
  2389. if err := gensupport.DecodeResponse(target, res); err != nil {
  2390. return nil, err
  2391. }
  2392. return ret, nil
  2393. // {
  2394. // "description": "Gets a hold by ID.",
  2395. // "flatPath": "v1/matters/{matterId}/holds/{holdId}",
  2396. // "httpMethod": "GET",
  2397. // "id": "vault.matters.holds.get",
  2398. // "parameterOrder": [
  2399. // "matterId",
  2400. // "holdId"
  2401. // ],
  2402. // "parameters": {
  2403. // "holdId": {
  2404. // "description": "The hold ID.",
  2405. // "location": "path",
  2406. // "required": true,
  2407. // "type": "string"
  2408. // },
  2409. // "matterId": {
  2410. // "description": "The matter ID.",
  2411. // "location": "path",
  2412. // "required": true,
  2413. // "type": "string"
  2414. // },
  2415. // "view": {
  2416. // "description": "Specifies which parts of the Hold to return.",
  2417. // "enum": [
  2418. // "HOLD_VIEW_UNSPECIFIED",
  2419. // "BASIC_HOLD",
  2420. // "FULL_HOLD"
  2421. // ],
  2422. // "location": "query",
  2423. // "type": "string"
  2424. // }
  2425. // },
  2426. // "path": "v1/matters/{matterId}/holds/{holdId}",
  2427. // "response": {
  2428. // "$ref": "Hold"
  2429. // },
  2430. // "scopes": [
  2431. // "https://www.googleapis.com/auth/ediscovery",
  2432. // "https://www.googleapis.com/auth/ediscovery.readonly"
  2433. // ]
  2434. // }
  2435. }
  2436. // method id "vault.matters.holds.list":
  2437. type MattersHoldsListCall struct {
  2438. s *Service
  2439. matterId string
  2440. urlParams_ gensupport.URLParams
  2441. ifNoneMatch_ string
  2442. ctx_ context.Context
  2443. header_ http.Header
  2444. }
  2445. // List: Lists holds within a matter. An empty page token in
  2446. // ListHoldsResponse
  2447. // denotes no more holds to list.
  2448. func (r *MattersHoldsService) List(matterId string) *MattersHoldsListCall {
  2449. c := &MattersHoldsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2450. c.matterId = matterId
  2451. return c
  2452. }
  2453. // PageSize sets the optional parameter "pageSize": The number of holds
  2454. // to return in the response, between 0 and 100 inclusive.
  2455. // Leaving this empty, or as 0, is the same as page_size = 100.
  2456. func (c *MattersHoldsListCall) PageSize(pageSize int64) *MattersHoldsListCall {
  2457. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2458. return c
  2459. }
  2460. // PageToken sets the optional parameter "pageToken": The pagination
  2461. // token as returned in the response.
  2462. // An empty token means start from the beginning.
  2463. func (c *MattersHoldsListCall) PageToken(pageToken string) *MattersHoldsListCall {
  2464. c.urlParams_.Set("pageToken", pageToken)
  2465. return c
  2466. }
  2467. // View sets the optional parameter "view": Specifies which parts of the
  2468. // Hold to return.
  2469. //
  2470. // Possible values:
  2471. // "HOLD_VIEW_UNSPECIFIED"
  2472. // "BASIC_HOLD"
  2473. // "FULL_HOLD"
  2474. func (c *MattersHoldsListCall) View(view string) *MattersHoldsListCall {
  2475. c.urlParams_.Set("view", view)
  2476. return c
  2477. }
  2478. // Fields allows partial responses to be retrieved. See
  2479. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2480. // for more information.
  2481. func (c *MattersHoldsListCall) Fields(s ...googleapi.Field) *MattersHoldsListCall {
  2482. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2483. return c
  2484. }
  2485. // IfNoneMatch sets the optional parameter which makes the operation
  2486. // fail if the object's ETag matches the given value. This is useful for
  2487. // getting updates only after the object has changed since the last
  2488. // request. Use googleapi.IsNotModified to check whether the response
  2489. // error from Do is the result of In-None-Match.
  2490. func (c *MattersHoldsListCall) IfNoneMatch(entityTag string) *MattersHoldsListCall {
  2491. c.ifNoneMatch_ = entityTag
  2492. return c
  2493. }
  2494. // Context sets the context to be used in this call's Do method. Any
  2495. // pending HTTP request will be aborted if the provided context is
  2496. // canceled.
  2497. func (c *MattersHoldsListCall) Context(ctx context.Context) *MattersHoldsListCall {
  2498. c.ctx_ = ctx
  2499. return c
  2500. }
  2501. // Header returns an http.Header that can be modified by the caller to
  2502. // add HTTP headers to the request.
  2503. func (c *MattersHoldsListCall) Header() http.Header {
  2504. if c.header_ == nil {
  2505. c.header_ = make(http.Header)
  2506. }
  2507. return c.header_
  2508. }
  2509. func (c *MattersHoldsListCall) doRequest(alt string) (*http.Response, error) {
  2510. reqHeaders := make(http.Header)
  2511. for k, v := range c.header_ {
  2512. reqHeaders[k] = v
  2513. }
  2514. reqHeaders.Set("User-Agent", c.s.userAgent())
  2515. if c.ifNoneMatch_ != "" {
  2516. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2517. }
  2518. var body io.Reader = nil
  2519. c.urlParams_.Set("alt", alt)
  2520. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds")
  2521. urls += "?" + c.urlParams_.Encode()
  2522. req, _ := http.NewRequest("GET", urls, body)
  2523. req.Header = reqHeaders
  2524. googleapi.Expand(req.URL, map[string]string{
  2525. "matterId": c.matterId,
  2526. })
  2527. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2528. }
  2529. // Do executes the "vault.matters.holds.list" call.
  2530. // Exactly one of *ListHoldsResponse or error will be non-nil. Any
  2531. // non-2xx status code is an error. Response headers are in either
  2532. // *ListHoldsResponse.ServerResponse.Header or (if a response was
  2533. // returned at all) in error.(*googleapi.Error).Header. Use
  2534. // googleapi.IsNotModified to check whether the returned error was
  2535. // because http.StatusNotModified was returned.
  2536. func (c *MattersHoldsListCall) Do(opts ...googleapi.CallOption) (*ListHoldsResponse, error) {
  2537. gensupport.SetOptions(c.urlParams_, opts...)
  2538. res, err := c.doRequest("json")
  2539. if res != nil && res.StatusCode == http.StatusNotModified {
  2540. if res.Body != nil {
  2541. res.Body.Close()
  2542. }
  2543. return nil, &googleapi.Error{
  2544. Code: res.StatusCode,
  2545. Header: res.Header,
  2546. }
  2547. }
  2548. if err != nil {
  2549. return nil, err
  2550. }
  2551. defer googleapi.CloseBody(res)
  2552. if err := googleapi.CheckResponse(res); err != nil {
  2553. return nil, err
  2554. }
  2555. ret := &ListHoldsResponse{
  2556. ServerResponse: googleapi.ServerResponse{
  2557. Header: res.Header,
  2558. HTTPStatusCode: res.StatusCode,
  2559. },
  2560. }
  2561. target := &ret
  2562. if err := gensupport.DecodeResponse(target, res); err != nil {
  2563. return nil, err
  2564. }
  2565. return ret, nil
  2566. // {
  2567. // "description": "Lists holds within a matter. An empty page token in ListHoldsResponse\ndenotes no more holds to list.",
  2568. // "flatPath": "v1/matters/{matterId}/holds",
  2569. // "httpMethod": "GET",
  2570. // "id": "vault.matters.holds.list",
  2571. // "parameterOrder": [
  2572. // "matterId"
  2573. // ],
  2574. // "parameters": {
  2575. // "matterId": {
  2576. // "description": "The matter ID.",
  2577. // "location": "path",
  2578. // "required": true,
  2579. // "type": "string"
  2580. // },
  2581. // "pageSize": {
  2582. // "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.",
  2583. // "format": "int32",
  2584. // "location": "query",
  2585. // "type": "integer"
  2586. // },
  2587. // "pageToken": {
  2588. // "description": "The pagination token as returned in the response.\nAn empty token means start from the beginning.",
  2589. // "location": "query",
  2590. // "type": "string"
  2591. // },
  2592. // "view": {
  2593. // "description": "Specifies which parts of the Hold to return.",
  2594. // "enum": [
  2595. // "HOLD_VIEW_UNSPECIFIED",
  2596. // "BASIC_HOLD",
  2597. // "FULL_HOLD"
  2598. // ],
  2599. // "location": "query",
  2600. // "type": "string"
  2601. // }
  2602. // },
  2603. // "path": "v1/matters/{matterId}/holds",
  2604. // "response": {
  2605. // "$ref": "ListHoldsResponse"
  2606. // },
  2607. // "scopes": [
  2608. // "https://www.googleapis.com/auth/ediscovery",
  2609. // "https://www.googleapis.com/auth/ediscovery.readonly"
  2610. // ]
  2611. // }
  2612. }
  2613. // Pages invokes f for each page of results.
  2614. // A non-nil error returned from f will halt the iteration.
  2615. // The provided context supersedes any context provided to the Context method.
  2616. func (c *MattersHoldsListCall) Pages(ctx context.Context, f func(*ListHoldsResponse) error) error {
  2617. c.ctx_ = ctx
  2618. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2619. for {
  2620. x, err := c.Do()
  2621. if err != nil {
  2622. return err
  2623. }
  2624. if err := f(x); err != nil {
  2625. return err
  2626. }
  2627. if x.NextPageToken == "" {
  2628. return nil
  2629. }
  2630. c.PageToken(x.NextPageToken)
  2631. }
  2632. }
  2633. // method id "vault.matters.holds.update":
  2634. type MattersHoldsUpdateCall struct {
  2635. s *Service
  2636. matterId string
  2637. holdId string
  2638. hold *Hold
  2639. urlParams_ gensupport.URLParams
  2640. ctx_ context.Context
  2641. header_ http.Header
  2642. }
  2643. // Update: Updates the OU and/or query parameters of a hold. You cannot
  2644. // add accounts
  2645. // to a hold that covers an OU, nor can you add OUs to a hold that
  2646. // covers
  2647. // individual accounts. Accounts listed in the hold will be ignored.
  2648. func (r *MattersHoldsService) Update(matterId string, holdId string, hold *Hold) *MattersHoldsUpdateCall {
  2649. c := &MattersHoldsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2650. c.matterId = matterId
  2651. c.holdId = holdId
  2652. c.hold = hold
  2653. return c
  2654. }
  2655. // Fields allows partial responses to be retrieved. See
  2656. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2657. // for more information.
  2658. func (c *MattersHoldsUpdateCall) Fields(s ...googleapi.Field) *MattersHoldsUpdateCall {
  2659. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2660. return c
  2661. }
  2662. // Context sets the context to be used in this call's Do method. Any
  2663. // pending HTTP request will be aborted if the provided context is
  2664. // canceled.
  2665. func (c *MattersHoldsUpdateCall) Context(ctx context.Context) *MattersHoldsUpdateCall {
  2666. c.ctx_ = ctx
  2667. return c
  2668. }
  2669. // Header returns an http.Header that can be modified by the caller to
  2670. // add HTTP headers to the request.
  2671. func (c *MattersHoldsUpdateCall) Header() http.Header {
  2672. if c.header_ == nil {
  2673. c.header_ = make(http.Header)
  2674. }
  2675. return c.header_
  2676. }
  2677. func (c *MattersHoldsUpdateCall) doRequest(alt string) (*http.Response, error) {
  2678. reqHeaders := make(http.Header)
  2679. for k, v := range c.header_ {
  2680. reqHeaders[k] = v
  2681. }
  2682. reqHeaders.Set("User-Agent", c.s.userAgent())
  2683. var body io.Reader = nil
  2684. body, err := googleapi.WithoutDataWrapper.JSONReader(c.hold)
  2685. if err != nil {
  2686. return nil, err
  2687. }
  2688. reqHeaders.Set("Content-Type", "application/json")
  2689. c.urlParams_.Set("alt", alt)
  2690. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds/{holdId}")
  2691. urls += "?" + c.urlParams_.Encode()
  2692. req, _ := http.NewRequest("PUT", urls, body)
  2693. req.Header = reqHeaders
  2694. googleapi.Expand(req.URL, map[string]string{
  2695. "matterId": c.matterId,
  2696. "holdId": c.holdId,
  2697. })
  2698. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2699. }
  2700. // Do executes the "vault.matters.holds.update" call.
  2701. // Exactly one of *Hold or error will be non-nil. Any non-2xx status
  2702. // code is an error. Response headers are in either
  2703. // *Hold.ServerResponse.Header or (if a response was returned at all) in
  2704. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2705. // whether the returned error was because http.StatusNotModified was
  2706. // returned.
  2707. func (c *MattersHoldsUpdateCall) Do(opts ...googleapi.CallOption) (*Hold, error) {
  2708. gensupport.SetOptions(c.urlParams_, opts...)
  2709. res, err := c.doRequest("json")
  2710. if res != nil && res.StatusCode == http.StatusNotModified {
  2711. if res.Body != nil {
  2712. res.Body.Close()
  2713. }
  2714. return nil, &googleapi.Error{
  2715. Code: res.StatusCode,
  2716. Header: res.Header,
  2717. }
  2718. }
  2719. if err != nil {
  2720. return nil, err
  2721. }
  2722. defer googleapi.CloseBody(res)
  2723. if err := googleapi.CheckResponse(res); err != nil {
  2724. return nil, err
  2725. }
  2726. ret := &Hold{
  2727. ServerResponse: googleapi.ServerResponse{
  2728. Header: res.Header,
  2729. HTTPStatusCode: res.StatusCode,
  2730. },
  2731. }
  2732. target := &ret
  2733. if err := gensupport.DecodeResponse(target, res); err != nil {
  2734. return nil, err
  2735. }
  2736. return ret, nil
  2737. // {
  2738. // "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.",
  2739. // "flatPath": "v1/matters/{matterId}/holds/{holdId}",
  2740. // "httpMethod": "PUT",
  2741. // "id": "vault.matters.holds.update",
  2742. // "parameterOrder": [
  2743. // "matterId",
  2744. // "holdId"
  2745. // ],
  2746. // "parameters": {
  2747. // "holdId": {
  2748. // "description": "The ID of the hold.",
  2749. // "location": "path",
  2750. // "required": true,
  2751. // "type": "string"
  2752. // },
  2753. // "matterId": {
  2754. // "description": "The matter ID.",
  2755. // "location": "path",
  2756. // "required": true,
  2757. // "type": "string"
  2758. // }
  2759. // },
  2760. // "path": "v1/matters/{matterId}/holds/{holdId}",
  2761. // "request": {
  2762. // "$ref": "Hold"
  2763. // },
  2764. // "response": {
  2765. // "$ref": "Hold"
  2766. // },
  2767. // "scopes": [
  2768. // "https://www.googleapis.com/auth/ediscovery"
  2769. // ]
  2770. // }
  2771. }
  2772. // method id "vault.matters.holds.accounts.create":
  2773. type MattersHoldsAccountsCreateCall struct {
  2774. s *Service
  2775. matterId string
  2776. holdId string
  2777. heldaccount *HeldAccount
  2778. urlParams_ gensupport.URLParams
  2779. ctx_ context.Context
  2780. header_ http.Header
  2781. }
  2782. // Create: Adds a HeldAccount to a hold. Accounts can only be added to a
  2783. // hold that
  2784. // has no held_org_unit set. Attempting to add an account to an
  2785. // OU-based
  2786. // hold will result in an error.
  2787. func (r *MattersHoldsAccountsService) Create(matterId string, holdId string, heldaccount *HeldAccount) *MattersHoldsAccountsCreateCall {
  2788. c := &MattersHoldsAccountsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2789. c.matterId = matterId
  2790. c.holdId = holdId
  2791. c.heldaccount = heldaccount
  2792. return c
  2793. }
  2794. // Fields allows partial responses to be retrieved. See
  2795. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2796. // for more information.
  2797. func (c *MattersHoldsAccountsCreateCall) Fields(s ...googleapi.Field) *MattersHoldsAccountsCreateCall {
  2798. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2799. return c
  2800. }
  2801. // Context sets the context to be used in this call's Do method. Any
  2802. // pending HTTP request will be aborted if the provided context is
  2803. // canceled.
  2804. func (c *MattersHoldsAccountsCreateCall) Context(ctx context.Context) *MattersHoldsAccountsCreateCall {
  2805. c.ctx_ = ctx
  2806. return c
  2807. }
  2808. // Header returns an http.Header that can be modified by the caller to
  2809. // add HTTP headers to the request.
  2810. func (c *MattersHoldsAccountsCreateCall) Header() http.Header {
  2811. if c.header_ == nil {
  2812. c.header_ = make(http.Header)
  2813. }
  2814. return c.header_
  2815. }
  2816. func (c *MattersHoldsAccountsCreateCall) doRequest(alt string) (*http.Response, error) {
  2817. reqHeaders := make(http.Header)
  2818. for k, v := range c.header_ {
  2819. reqHeaders[k] = v
  2820. }
  2821. reqHeaders.Set("User-Agent", c.s.userAgent())
  2822. var body io.Reader = nil
  2823. body, err := googleapi.WithoutDataWrapper.JSONReader(c.heldaccount)
  2824. if err != nil {
  2825. return nil, err
  2826. }
  2827. reqHeaders.Set("Content-Type", "application/json")
  2828. c.urlParams_.Set("alt", alt)
  2829. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds/{holdId}/accounts")
  2830. urls += "?" + c.urlParams_.Encode()
  2831. req, _ := http.NewRequest("POST", urls, body)
  2832. req.Header = reqHeaders
  2833. googleapi.Expand(req.URL, map[string]string{
  2834. "matterId": c.matterId,
  2835. "holdId": c.holdId,
  2836. })
  2837. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2838. }
  2839. // Do executes the "vault.matters.holds.accounts.create" call.
  2840. // Exactly one of *HeldAccount or error will be non-nil. Any non-2xx
  2841. // status code is an error. Response headers are in either
  2842. // *HeldAccount.ServerResponse.Header or (if a response was returned at
  2843. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  2844. // to check whether the returned error was because
  2845. // http.StatusNotModified was returned.
  2846. func (c *MattersHoldsAccountsCreateCall) Do(opts ...googleapi.CallOption) (*HeldAccount, error) {
  2847. gensupport.SetOptions(c.urlParams_, opts...)
  2848. res, err := c.doRequest("json")
  2849. if res != nil && res.StatusCode == http.StatusNotModified {
  2850. if res.Body != nil {
  2851. res.Body.Close()
  2852. }
  2853. return nil, &googleapi.Error{
  2854. Code: res.StatusCode,
  2855. Header: res.Header,
  2856. }
  2857. }
  2858. if err != nil {
  2859. return nil, err
  2860. }
  2861. defer googleapi.CloseBody(res)
  2862. if err := googleapi.CheckResponse(res); err != nil {
  2863. return nil, err
  2864. }
  2865. ret := &HeldAccount{
  2866. ServerResponse: googleapi.ServerResponse{
  2867. Header: res.Header,
  2868. HTTPStatusCode: res.StatusCode,
  2869. },
  2870. }
  2871. target := &ret
  2872. if err := gensupport.DecodeResponse(target, res); err != nil {
  2873. return nil, err
  2874. }
  2875. return ret, nil
  2876. // {
  2877. // "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.",
  2878. // "flatPath": "v1/matters/{matterId}/holds/{holdId}/accounts",
  2879. // "httpMethod": "POST",
  2880. // "id": "vault.matters.holds.accounts.create",
  2881. // "parameterOrder": [
  2882. // "matterId",
  2883. // "holdId"
  2884. // ],
  2885. // "parameters": {
  2886. // "holdId": {
  2887. // "description": "The hold ID.",
  2888. // "location": "path",
  2889. // "required": true,
  2890. // "type": "string"
  2891. // },
  2892. // "matterId": {
  2893. // "description": "The matter ID.",
  2894. // "location": "path",
  2895. // "required": true,
  2896. // "type": "string"
  2897. // }
  2898. // },
  2899. // "path": "v1/matters/{matterId}/holds/{holdId}/accounts",
  2900. // "request": {
  2901. // "$ref": "HeldAccount"
  2902. // },
  2903. // "response": {
  2904. // "$ref": "HeldAccount"
  2905. // },
  2906. // "scopes": [
  2907. // "https://www.googleapis.com/auth/ediscovery"
  2908. // ]
  2909. // }
  2910. }
  2911. // method id "vault.matters.holds.accounts.delete":
  2912. type MattersHoldsAccountsDeleteCall struct {
  2913. s *Service
  2914. matterId string
  2915. holdId string
  2916. accountId string
  2917. urlParams_ gensupport.URLParams
  2918. ctx_ context.Context
  2919. header_ http.Header
  2920. }
  2921. // Delete: Removes a HeldAccount from a hold. If this request leaves the
  2922. // hold with
  2923. // no held accounts, the hold will not apply to any accounts.
  2924. func (r *MattersHoldsAccountsService) Delete(matterId string, holdId string, accountId string) *MattersHoldsAccountsDeleteCall {
  2925. c := &MattersHoldsAccountsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2926. c.matterId = matterId
  2927. c.holdId = holdId
  2928. c.accountId = accountId
  2929. return c
  2930. }
  2931. // Fields allows partial responses to be retrieved. See
  2932. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2933. // for more information.
  2934. func (c *MattersHoldsAccountsDeleteCall) Fields(s ...googleapi.Field) *MattersHoldsAccountsDeleteCall {
  2935. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2936. return c
  2937. }
  2938. // Context sets the context to be used in this call's Do method. Any
  2939. // pending HTTP request will be aborted if the provided context is
  2940. // canceled.
  2941. func (c *MattersHoldsAccountsDeleteCall) Context(ctx context.Context) *MattersHoldsAccountsDeleteCall {
  2942. c.ctx_ = ctx
  2943. return c
  2944. }
  2945. // Header returns an http.Header that can be modified by the caller to
  2946. // add HTTP headers to the request.
  2947. func (c *MattersHoldsAccountsDeleteCall) Header() http.Header {
  2948. if c.header_ == nil {
  2949. c.header_ = make(http.Header)
  2950. }
  2951. return c.header_
  2952. }
  2953. func (c *MattersHoldsAccountsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2954. reqHeaders := make(http.Header)
  2955. for k, v := range c.header_ {
  2956. reqHeaders[k] = v
  2957. }
  2958. reqHeaders.Set("User-Agent", c.s.userAgent())
  2959. var body io.Reader = nil
  2960. c.urlParams_.Set("alt", alt)
  2961. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds/{holdId}/accounts/{accountId}")
  2962. urls += "?" + c.urlParams_.Encode()
  2963. req, _ := http.NewRequest("DELETE", urls, body)
  2964. req.Header = reqHeaders
  2965. googleapi.Expand(req.URL, map[string]string{
  2966. "matterId": c.matterId,
  2967. "holdId": c.holdId,
  2968. "accountId": c.accountId,
  2969. })
  2970. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2971. }
  2972. // Do executes the "vault.matters.holds.accounts.delete" call.
  2973. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2974. // code is an error. Response headers are in either
  2975. // *Empty.ServerResponse.Header or (if a response was returned at all)
  2976. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2977. // check whether the returned error was because http.StatusNotModified
  2978. // was returned.
  2979. func (c *MattersHoldsAccountsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2980. gensupport.SetOptions(c.urlParams_, opts...)
  2981. res, err := c.doRequest("json")
  2982. if res != nil && res.StatusCode == http.StatusNotModified {
  2983. if res.Body != nil {
  2984. res.Body.Close()
  2985. }
  2986. return nil, &googleapi.Error{
  2987. Code: res.StatusCode,
  2988. Header: res.Header,
  2989. }
  2990. }
  2991. if err != nil {
  2992. return nil, err
  2993. }
  2994. defer googleapi.CloseBody(res)
  2995. if err := googleapi.CheckResponse(res); err != nil {
  2996. return nil, err
  2997. }
  2998. ret := &Empty{
  2999. ServerResponse: googleapi.ServerResponse{
  3000. Header: res.Header,
  3001. HTTPStatusCode: res.StatusCode,
  3002. },
  3003. }
  3004. target := &ret
  3005. if err := gensupport.DecodeResponse(target, res); err != nil {
  3006. return nil, err
  3007. }
  3008. return ret, nil
  3009. // {
  3010. // "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.",
  3011. // "flatPath": "v1/matters/{matterId}/holds/{holdId}/accounts/{accountId}",
  3012. // "httpMethod": "DELETE",
  3013. // "id": "vault.matters.holds.accounts.delete",
  3014. // "parameterOrder": [
  3015. // "matterId",
  3016. // "holdId",
  3017. // "accountId"
  3018. // ],
  3019. // "parameters": {
  3020. // "accountId": {
  3021. // "description": "The ID of the account to remove from the hold.",
  3022. // "location": "path",
  3023. // "required": true,
  3024. // "type": "string"
  3025. // },
  3026. // "holdId": {
  3027. // "description": "The hold ID.",
  3028. // "location": "path",
  3029. // "required": true,
  3030. // "type": "string"
  3031. // },
  3032. // "matterId": {
  3033. // "description": "The matter ID.",
  3034. // "location": "path",
  3035. // "required": true,
  3036. // "type": "string"
  3037. // }
  3038. // },
  3039. // "path": "v1/matters/{matterId}/holds/{holdId}/accounts/{accountId}",
  3040. // "response": {
  3041. // "$ref": "Empty"
  3042. // },
  3043. // "scopes": [
  3044. // "https://www.googleapis.com/auth/ediscovery"
  3045. // ]
  3046. // }
  3047. }
  3048. // method id "vault.matters.holds.accounts.list":
  3049. type MattersHoldsAccountsListCall struct {
  3050. s *Service
  3051. matterId string
  3052. holdId string
  3053. urlParams_ gensupport.URLParams
  3054. ifNoneMatch_ string
  3055. ctx_ context.Context
  3056. header_ http.Header
  3057. }
  3058. // List: Lists HeldAccounts for a hold. This will only list individually
  3059. // specified
  3060. // held accounts. If the hold is on an OU, then use
  3061. // <a href="https://developers.google.com/admin-sdk/">Admin SDK</a>
  3062. // to enumerate its members.
  3063. func (r *MattersHoldsAccountsService) List(matterId string, holdId string) *MattersHoldsAccountsListCall {
  3064. c := &MattersHoldsAccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3065. c.matterId = matterId
  3066. c.holdId = holdId
  3067. return c
  3068. }
  3069. // Fields allows partial responses to be retrieved. See
  3070. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3071. // for more information.
  3072. func (c *MattersHoldsAccountsListCall) Fields(s ...googleapi.Field) *MattersHoldsAccountsListCall {
  3073. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3074. return c
  3075. }
  3076. // IfNoneMatch sets the optional parameter which makes the operation
  3077. // fail if the object's ETag matches the given value. This is useful for
  3078. // getting updates only after the object has changed since the last
  3079. // request. Use googleapi.IsNotModified to check whether the response
  3080. // error from Do is the result of In-None-Match.
  3081. func (c *MattersHoldsAccountsListCall) IfNoneMatch(entityTag string) *MattersHoldsAccountsListCall {
  3082. c.ifNoneMatch_ = entityTag
  3083. return c
  3084. }
  3085. // Context sets the context to be used in this call's Do method. Any
  3086. // pending HTTP request will be aborted if the provided context is
  3087. // canceled.
  3088. func (c *MattersHoldsAccountsListCall) Context(ctx context.Context) *MattersHoldsAccountsListCall {
  3089. c.ctx_ = ctx
  3090. return c
  3091. }
  3092. // Header returns an http.Header that can be modified by the caller to
  3093. // add HTTP headers to the request.
  3094. func (c *MattersHoldsAccountsListCall) Header() http.Header {
  3095. if c.header_ == nil {
  3096. c.header_ = make(http.Header)
  3097. }
  3098. return c.header_
  3099. }
  3100. func (c *MattersHoldsAccountsListCall) doRequest(alt string) (*http.Response, error) {
  3101. reqHeaders := make(http.Header)
  3102. for k, v := range c.header_ {
  3103. reqHeaders[k] = v
  3104. }
  3105. reqHeaders.Set("User-Agent", c.s.userAgent())
  3106. if c.ifNoneMatch_ != "" {
  3107. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3108. }
  3109. var body io.Reader = nil
  3110. c.urlParams_.Set("alt", alt)
  3111. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/matters/{matterId}/holds/{holdId}/accounts")
  3112. urls += "?" + c.urlParams_.Encode()
  3113. req, _ := http.NewRequest("GET", urls, body)
  3114. req.Header = reqHeaders
  3115. googleapi.Expand(req.URL, map[string]string{
  3116. "matterId": c.matterId,
  3117. "holdId": c.holdId,
  3118. })
  3119. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3120. }
  3121. // Do executes the "vault.matters.holds.accounts.list" call.
  3122. // Exactly one of *ListHeldAccountsResponse or error will be non-nil.
  3123. // Any non-2xx status code is an error. Response headers are in either
  3124. // *ListHeldAccountsResponse.ServerResponse.Header or (if a response was
  3125. // returned at all) in error.(*googleapi.Error).Header. Use
  3126. // googleapi.IsNotModified to check whether the returned error was
  3127. // because http.StatusNotModified was returned.
  3128. func (c *MattersHoldsAccountsListCall) Do(opts ...googleapi.CallOption) (*ListHeldAccountsResponse, error) {
  3129. gensupport.SetOptions(c.urlParams_, opts...)
  3130. res, err := c.doRequest("json")
  3131. if res != nil && res.StatusCode == http.StatusNotModified {
  3132. if res.Body != nil {
  3133. res.Body.Close()
  3134. }
  3135. return nil, &googleapi.Error{
  3136. Code: res.StatusCode,
  3137. Header: res.Header,
  3138. }
  3139. }
  3140. if err != nil {
  3141. return nil, err
  3142. }
  3143. defer googleapi.CloseBody(res)
  3144. if err := googleapi.CheckResponse(res); err != nil {
  3145. return nil, err
  3146. }
  3147. ret := &ListHeldAccountsResponse{
  3148. ServerResponse: googleapi.ServerResponse{
  3149. Header: res.Header,
  3150. HTTPStatusCode: res.StatusCode,
  3151. },
  3152. }
  3153. target := &ret
  3154. if err := gensupport.DecodeResponse(target, res); err != nil {
  3155. return nil, err
  3156. }
  3157. return ret, nil
  3158. // {
  3159. // "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.",
  3160. // "flatPath": "v1/matters/{matterId}/holds/{holdId}/accounts",
  3161. // "httpMethod": "GET",
  3162. // "id": "vault.matters.holds.accounts.list",
  3163. // "parameterOrder": [
  3164. // "matterId",
  3165. // "holdId"
  3166. // ],
  3167. // "parameters": {
  3168. // "holdId": {
  3169. // "description": "The hold ID.",
  3170. // "location": "path",
  3171. // "required": true,
  3172. // "type": "string"
  3173. // },
  3174. // "matterId": {
  3175. // "description": "The matter ID.",
  3176. // "location": "path",
  3177. // "required": true,
  3178. // "type": "string"
  3179. // }
  3180. // },
  3181. // "path": "v1/matters/{matterId}/holds/{holdId}/accounts",
  3182. // "response": {
  3183. // "$ref": "ListHeldAccountsResponse"
  3184. // },
  3185. // "scopes": [
  3186. // "https://www.googleapis.com/auth/ediscovery",
  3187. // "https://www.googleapis.com/auth/ediscovery.readonly"
  3188. // ]
  3189. // }
  3190. }