Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 

12551 rinda
463 KiB

  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package cloudsearch provides access to the Cloud Search API.
  6. //
  7. // For product documentation, see: https://gsuite.google.com/products/cloud-search/
  8. //
  9. // Creating a client
  10. //
  11. // Usage example:
  12. //
  13. // import "google.golang.org/api/cloudsearch/v1"
  14. // ...
  15. // ctx := context.Background()
  16. // cloudsearchService, err := cloudsearch.NewService(ctx)
  17. //
  18. // In this example, Google Application Default Credentials are used for authentication.
  19. //
  20. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  21. //
  22. // Other authentication options
  23. //
  24. // By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
  25. //
  26. // cloudsearchService, err := cloudsearch.NewService(ctx, option.WithScopes(cloudsearch.CloudSearchStatsIndexingScope))
  27. //
  28. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  29. //
  30. // cloudsearchService, err := cloudsearch.NewService(ctx, option.WithAPIKey("AIza..."))
  31. //
  32. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  33. //
  34. // config := &oauth2.Config{...}
  35. // // ...
  36. // token, err := config.Exchange(ctx, ...)
  37. // cloudsearchService, err := cloudsearch.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  38. //
  39. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  40. package cloudsearch // import "google.golang.org/api/cloudsearch/v1"
  41. import (
  42. "bytes"
  43. "context"
  44. "encoding/json"
  45. "errors"
  46. "fmt"
  47. "io"
  48. "net/http"
  49. "net/url"
  50. "strconv"
  51. "strings"
  52. gensupport "google.golang.org/api/gensupport"
  53. googleapi "google.golang.org/api/googleapi"
  54. option "google.golang.org/api/option"
  55. htransport "google.golang.org/api/transport/http"
  56. )
  57. // Always reference these packages, just in case the auto-generated code
  58. // below doesn't.
  59. var _ = bytes.NewBuffer
  60. var _ = strconv.Itoa
  61. var _ = fmt.Sprintf
  62. var _ = json.NewDecoder
  63. var _ = io.Copy
  64. var _ = url.Parse
  65. var _ = gensupport.MarshalJSON
  66. var _ = googleapi.Version
  67. var _ = errors.New
  68. var _ = strings.Replace
  69. var _ = context.Canceled
  70. const apiId = "cloudsearch:v1"
  71. const apiName = "cloudsearch"
  72. const apiVersion = "v1"
  73. const basePath = "https://cloudsearch.googleapis.com/"
  74. // OAuth2 scopes used by this API.
  75. const (
  76. // Index and serve your organization's data with Cloud Search
  77. CloudSearchScope = "https://www.googleapis.com/auth/cloud_search"
  78. // New Service: https://www.googleapis.com/auth/cloud_search.debug
  79. CloudSearchDebugScope = "https://www.googleapis.com/auth/cloud_search.debug"
  80. // New Service: https://www.googleapis.com/auth/cloud_search.indexing
  81. CloudSearchIndexingScope = "https://www.googleapis.com/auth/cloud_search.indexing"
  82. // Search your organization's data in the Cloud Search index
  83. CloudSearchQueryScope = "https://www.googleapis.com/auth/cloud_search.query"
  84. // New Service: https://www.googleapis.com/auth/cloud_search.settings
  85. CloudSearchSettingsScope = "https://www.googleapis.com/auth/cloud_search.settings"
  86. // New Service:
  87. // https://www.googleapis.com/auth/cloud_search.settings.indexing
  88. CloudSearchSettingsIndexingScope = "https://www.googleapis.com/auth/cloud_search.settings.indexing"
  89. // New Service:
  90. // https://www.googleapis.com/auth/cloud_search.settings.query
  91. CloudSearchSettingsQueryScope = "https://www.googleapis.com/auth/cloud_search.settings.query"
  92. // New Service: https://www.googleapis.com/auth/cloud_search.stats
  93. CloudSearchStatsScope = "https://www.googleapis.com/auth/cloud_search.stats"
  94. // New Service:
  95. // https://www.googleapis.com/auth/cloud_search.stats.indexing
  96. CloudSearchStatsIndexingScope = "https://www.googleapis.com/auth/cloud_search.stats.indexing"
  97. )
  98. // NewService creates a new Service.
  99. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  100. scopesOption := option.WithScopes(
  101. "https://www.googleapis.com/auth/cloud_search",
  102. "https://www.googleapis.com/auth/cloud_search.debug",
  103. "https://www.googleapis.com/auth/cloud_search.indexing",
  104. "https://www.googleapis.com/auth/cloud_search.query",
  105. "https://www.googleapis.com/auth/cloud_search.settings",
  106. "https://www.googleapis.com/auth/cloud_search.settings.indexing",
  107. "https://www.googleapis.com/auth/cloud_search.settings.query",
  108. "https://www.googleapis.com/auth/cloud_search.stats",
  109. "https://www.googleapis.com/auth/cloud_search.stats.indexing",
  110. )
  111. // NOTE: prepend, so we don't override user-specified scopes.
  112. opts = append([]option.ClientOption{scopesOption}, opts...)
  113. client, endpoint, err := htransport.NewClient(ctx, opts...)
  114. if err != nil {
  115. return nil, err
  116. }
  117. s, err := New(client)
  118. if err != nil {
  119. return nil, err
  120. }
  121. if endpoint != "" {
  122. s.BasePath = endpoint
  123. }
  124. return s, nil
  125. }
  126. // New creates a new Service. It uses the provided http.Client for requests.
  127. //
  128. // Deprecated: please use NewService instead.
  129. // To provide a custom HTTP client, use option.WithHTTPClient.
  130. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  131. func New(client *http.Client) (*Service, error) {
  132. if client == nil {
  133. return nil, errors.New("client is nil")
  134. }
  135. s := &Service{client: client, BasePath: basePath}
  136. s.Debug = NewDebugService(s)
  137. s.Indexing = NewIndexingService(s)
  138. s.Media = NewMediaService(s)
  139. s.Operations = NewOperationsService(s)
  140. s.Query = NewQueryService(s)
  141. s.Settings = NewSettingsService(s)
  142. s.Stats = NewStatsService(s)
  143. return s, nil
  144. }
  145. type Service struct {
  146. client *http.Client
  147. BasePath string // API endpoint base URL
  148. UserAgent string // optional additional User-Agent fragment
  149. Debug *DebugService
  150. Indexing *IndexingService
  151. Media *MediaService
  152. Operations *OperationsService
  153. Query *QueryService
  154. Settings *SettingsService
  155. Stats *StatsService
  156. }
  157. func (s *Service) userAgent() string {
  158. if s.UserAgent == "" {
  159. return googleapi.UserAgent
  160. }
  161. return googleapi.UserAgent + " " + s.UserAgent
  162. }
  163. func NewDebugService(s *Service) *DebugService {
  164. rs := &DebugService{s: s}
  165. rs.Datasources = NewDebugDatasourcesService(s)
  166. rs.Identitysources = NewDebugIdentitysourcesService(s)
  167. return rs
  168. }
  169. type DebugService struct {
  170. s *Service
  171. Datasources *DebugDatasourcesService
  172. Identitysources *DebugIdentitysourcesService
  173. }
  174. func NewDebugDatasourcesService(s *Service) *DebugDatasourcesService {
  175. rs := &DebugDatasourcesService{s: s}
  176. rs.Items = NewDebugDatasourcesItemsService(s)
  177. return rs
  178. }
  179. type DebugDatasourcesService struct {
  180. s *Service
  181. Items *DebugDatasourcesItemsService
  182. }
  183. func NewDebugDatasourcesItemsService(s *Service) *DebugDatasourcesItemsService {
  184. rs := &DebugDatasourcesItemsService{s: s}
  185. rs.Unmappedids = NewDebugDatasourcesItemsUnmappedidsService(s)
  186. return rs
  187. }
  188. type DebugDatasourcesItemsService struct {
  189. s *Service
  190. Unmappedids *DebugDatasourcesItemsUnmappedidsService
  191. }
  192. func NewDebugDatasourcesItemsUnmappedidsService(s *Service) *DebugDatasourcesItemsUnmappedidsService {
  193. rs := &DebugDatasourcesItemsUnmappedidsService{s: s}
  194. return rs
  195. }
  196. type DebugDatasourcesItemsUnmappedidsService struct {
  197. s *Service
  198. }
  199. func NewDebugIdentitysourcesService(s *Service) *DebugIdentitysourcesService {
  200. rs := &DebugIdentitysourcesService{s: s}
  201. rs.Items = NewDebugIdentitysourcesItemsService(s)
  202. rs.Unmappedids = NewDebugIdentitysourcesUnmappedidsService(s)
  203. return rs
  204. }
  205. type DebugIdentitysourcesService struct {
  206. s *Service
  207. Items *DebugIdentitysourcesItemsService
  208. Unmappedids *DebugIdentitysourcesUnmappedidsService
  209. }
  210. func NewDebugIdentitysourcesItemsService(s *Service) *DebugIdentitysourcesItemsService {
  211. rs := &DebugIdentitysourcesItemsService{s: s}
  212. return rs
  213. }
  214. type DebugIdentitysourcesItemsService struct {
  215. s *Service
  216. }
  217. func NewDebugIdentitysourcesUnmappedidsService(s *Service) *DebugIdentitysourcesUnmappedidsService {
  218. rs := &DebugIdentitysourcesUnmappedidsService{s: s}
  219. return rs
  220. }
  221. type DebugIdentitysourcesUnmappedidsService struct {
  222. s *Service
  223. }
  224. func NewIndexingService(s *Service) *IndexingService {
  225. rs := &IndexingService{s: s}
  226. rs.Datasources = NewIndexingDatasourcesService(s)
  227. return rs
  228. }
  229. type IndexingService struct {
  230. s *Service
  231. Datasources *IndexingDatasourcesService
  232. }
  233. func NewIndexingDatasourcesService(s *Service) *IndexingDatasourcesService {
  234. rs := &IndexingDatasourcesService{s: s}
  235. rs.Items = NewIndexingDatasourcesItemsService(s)
  236. return rs
  237. }
  238. type IndexingDatasourcesService struct {
  239. s *Service
  240. Items *IndexingDatasourcesItemsService
  241. }
  242. func NewIndexingDatasourcesItemsService(s *Service) *IndexingDatasourcesItemsService {
  243. rs := &IndexingDatasourcesItemsService{s: s}
  244. return rs
  245. }
  246. type IndexingDatasourcesItemsService struct {
  247. s *Service
  248. }
  249. func NewMediaService(s *Service) *MediaService {
  250. rs := &MediaService{s: s}
  251. return rs
  252. }
  253. type MediaService struct {
  254. s *Service
  255. }
  256. func NewOperationsService(s *Service) *OperationsService {
  257. rs := &OperationsService{s: s}
  258. return rs
  259. }
  260. type OperationsService struct {
  261. s *Service
  262. }
  263. func NewQueryService(s *Service) *QueryService {
  264. rs := &QueryService{s: s}
  265. rs.Sources = NewQuerySourcesService(s)
  266. return rs
  267. }
  268. type QueryService struct {
  269. s *Service
  270. Sources *QuerySourcesService
  271. }
  272. func NewQuerySourcesService(s *Service) *QuerySourcesService {
  273. rs := &QuerySourcesService{s: s}
  274. return rs
  275. }
  276. type QuerySourcesService struct {
  277. s *Service
  278. }
  279. func NewSettingsService(s *Service) *SettingsService {
  280. rs := &SettingsService{s: s}
  281. rs.Datasources = NewSettingsDatasourcesService(s)
  282. rs.Searchapplications = NewSettingsSearchapplicationsService(s)
  283. return rs
  284. }
  285. type SettingsService struct {
  286. s *Service
  287. Datasources *SettingsDatasourcesService
  288. Searchapplications *SettingsSearchapplicationsService
  289. }
  290. func NewSettingsDatasourcesService(s *Service) *SettingsDatasourcesService {
  291. rs := &SettingsDatasourcesService{s: s}
  292. return rs
  293. }
  294. type SettingsDatasourcesService struct {
  295. s *Service
  296. }
  297. func NewSettingsSearchapplicationsService(s *Service) *SettingsSearchapplicationsService {
  298. rs := &SettingsSearchapplicationsService{s: s}
  299. return rs
  300. }
  301. type SettingsSearchapplicationsService struct {
  302. s *Service
  303. }
  304. func NewStatsService(s *Service) *StatsService {
  305. rs := &StatsService{s: s}
  306. rs.Index = NewStatsIndexService(s)
  307. return rs
  308. }
  309. type StatsService struct {
  310. s *Service
  311. Index *StatsIndexService
  312. }
  313. func NewStatsIndexService(s *Service) *StatsIndexService {
  314. rs := &StatsIndexService{s: s}
  315. rs.Datasources = NewStatsIndexDatasourcesService(s)
  316. return rs
  317. }
  318. type StatsIndexService struct {
  319. s *Service
  320. Datasources *StatsIndexDatasourcesService
  321. }
  322. func NewStatsIndexDatasourcesService(s *Service) *StatsIndexDatasourcesService {
  323. rs := &StatsIndexDatasourcesService{s: s}
  324. return rs
  325. }
  326. type StatsIndexDatasourcesService struct {
  327. s *Service
  328. }
  329. // BooleanOperatorOptions: Used to provide a search operator for boolean
  330. // properties. This is
  331. // optional. Search operators let users restrict the query to specific
  332. // fields
  333. // relevant to the type of item being searched.
  334. type BooleanOperatorOptions struct {
  335. // OperatorName: Indicates the operator name required in the query in
  336. // order to isolate the
  337. // boolean property. For example, if operatorName is *closed* and
  338. // the
  339. // property's name is *isClosed*, then queries
  340. // like
  341. // *closed:<value>* will show results only where the value of
  342. // the
  343. // property named *isClosed* matches *<value>*. By contrast,
  344. // a
  345. // search that uses the same *<value>* without an operator will
  346. // return
  347. // all items where *<value>* matches the value of any
  348. // String properties or text within the content field for the item.
  349. // The operator name can only contain lowercase letters (a-z).
  350. // The maximum length is 32 characters.
  351. OperatorName string `json:"operatorName,omitempty"`
  352. // ForceSendFields is a list of field names (e.g. "OperatorName") to
  353. // unconditionally include in API requests. By default, fields with
  354. // empty values are omitted from API requests. However, any non-pointer,
  355. // non-interface field appearing in ForceSendFields will be sent to the
  356. // server regardless of whether the field is empty or not. This may be
  357. // used to include empty fields in Patch requests.
  358. ForceSendFields []string `json:"-"`
  359. // NullFields is a list of field names (e.g. "OperatorName") to include
  360. // in API requests with the JSON null value. By default, fields with
  361. // empty values are omitted from API requests. However, any field with
  362. // an empty value appearing in NullFields will be sent to the server as
  363. // null. It is an error if a field in this list has a non-empty value.
  364. // This may be used to include null fields in Patch requests.
  365. NullFields []string `json:"-"`
  366. }
  367. func (s *BooleanOperatorOptions) MarshalJSON() ([]byte, error) {
  368. type NoMethod BooleanOperatorOptions
  369. raw := NoMethod(*s)
  370. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  371. }
  372. // BooleanPropertyOptions: Options for boolean properties.
  373. type BooleanPropertyOptions struct {
  374. // OperatorOptions: If set, describes how the boolean should be used as
  375. // a search operator.
  376. OperatorOptions *BooleanOperatorOptions `json:"operatorOptions,omitempty"`
  377. // ForceSendFields is a list of field names (e.g. "OperatorOptions") to
  378. // unconditionally include in API requests. By default, fields with
  379. // empty values are omitted from API requests. However, any non-pointer,
  380. // non-interface field appearing in ForceSendFields will be sent to the
  381. // server regardless of whether the field is empty or not. This may be
  382. // used to include empty fields in Patch requests.
  383. ForceSendFields []string `json:"-"`
  384. // NullFields is a list of field names (e.g. "OperatorOptions") to
  385. // include in API requests with the JSON null value. By default, fields
  386. // with empty values are omitted from API requests. However, any field
  387. // with an empty value appearing in NullFields will be sent to the
  388. // server as null. It is an error if a field in this list has a
  389. // non-empty value. This may be used to include null fields in Patch
  390. // requests.
  391. NullFields []string `json:"-"`
  392. }
  393. func (s *BooleanPropertyOptions) MarshalJSON() ([]byte, error) {
  394. type NoMethod BooleanPropertyOptions
  395. raw := NoMethod(*s)
  396. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  397. }
  398. type CheckAccessResponse struct {
  399. // HasAccess: Returns true if principal has access. Returns false
  400. // otherwise.
  401. HasAccess bool `json:"hasAccess,omitempty"`
  402. // ServerResponse contains the HTTP response code and headers from the
  403. // server.
  404. googleapi.ServerResponse `json:"-"`
  405. // ForceSendFields is a list of field names (e.g. "HasAccess") to
  406. // unconditionally include in API requests. By default, fields with
  407. // empty values are omitted from API requests. However, any non-pointer,
  408. // non-interface field appearing in ForceSendFields will be sent to the
  409. // server regardless of whether the field is empty or not. This may be
  410. // used to include empty fields in Patch requests.
  411. ForceSendFields []string `json:"-"`
  412. // NullFields is a list of field names (e.g. "HasAccess") to include in
  413. // API requests with the JSON null value. By default, fields with empty
  414. // values are omitted from API requests. However, any field with an
  415. // empty value appearing in NullFields will be sent to the server as
  416. // null. It is an error if a field in this list has a non-empty value.
  417. // This may be used to include null fields in Patch requests.
  418. NullFields []string `json:"-"`
  419. }
  420. func (s *CheckAccessResponse) MarshalJSON() ([]byte, error) {
  421. type NoMethod CheckAccessResponse
  422. raw := NoMethod(*s)
  423. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  424. }
  425. type CompositeFilter struct {
  426. // LogicOperator: The logic operator of the sub filter.
  427. //
  428. // Possible values:
  429. // "AND" - Logical operators, which can only be applied to sub
  430. // filters.
  431. // "OR"
  432. // "NOT" - NOT can only be applied on a single sub filter.
  433. LogicOperator string `json:"logicOperator,omitempty"`
  434. // SubFilters: Sub filters.
  435. SubFilters []*Filter `json:"subFilters,omitempty"`
  436. // ForceSendFields is a list of field names (e.g. "LogicOperator") to
  437. // unconditionally include in API requests. By default, fields with
  438. // empty values are omitted from API requests. However, any non-pointer,
  439. // non-interface field appearing in ForceSendFields will be sent to the
  440. // server regardless of whether the field is empty or not. This may be
  441. // used to include empty fields in Patch requests.
  442. ForceSendFields []string `json:"-"`
  443. // NullFields is a list of field names (e.g. "LogicOperator") to include
  444. // in API requests with the JSON null value. By default, fields with
  445. // empty values are omitted from API requests. However, any field with
  446. // an empty value appearing in NullFields will be sent to the server as
  447. // null. It is an error if a field in this list has a non-empty value.
  448. // This may be used to include null fields in Patch requests.
  449. NullFields []string `json:"-"`
  450. }
  451. func (s *CompositeFilter) MarshalJSON() ([]byte, error) {
  452. type NoMethod CompositeFilter
  453. raw := NoMethod(*s)
  454. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  455. }
  456. // CustomerIndexStats: Aggregation of items by status code as of the
  457. // specified date.
  458. type CustomerIndexStats struct {
  459. // Date: Date for which statistics were calculated.
  460. Date *Date `json:"date,omitempty"`
  461. // ItemCountByStatus: Number of items aggregrated by status code.
  462. ItemCountByStatus []*ItemCountByStatus `json:"itemCountByStatus,omitempty"`
  463. // ForceSendFields is a list of field names (e.g. "Date") to
  464. // unconditionally include in API requests. By default, fields with
  465. // empty values are omitted from API requests. However, any non-pointer,
  466. // non-interface field appearing in ForceSendFields will be sent to the
  467. // server regardless of whether the field is empty or not. This may be
  468. // used to include empty fields in Patch requests.
  469. ForceSendFields []string `json:"-"`
  470. // NullFields is a list of field names (e.g. "Date") to include in API
  471. // requests with the JSON null value. By default, fields with empty
  472. // values are omitted from API requests. However, any field with an
  473. // empty value appearing in NullFields will be sent to the server as
  474. // null. It is an error if a field in this list has a non-empty value.
  475. // This may be used to include null fields in Patch requests.
  476. NullFields []string `json:"-"`
  477. }
  478. func (s *CustomerIndexStats) MarshalJSON() ([]byte, error) {
  479. type NoMethod CustomerIndexStats
  480. raw := NoMethod(*s)
  481. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  482. }
  483. // DataSource: Frontend protos implement autoconverters for this message
  484. // type. If you add
  485. // fields to this proto, please add corresponding fields to the frontend
  486. // proto
  487. // with the same names.
  488. // LINT.IfChange
  489. type DataSource struct {
  490. // DisableModifications: If true, Indexing API rejects any modification
  491. // calls to this datasource
  492. // such as create, update, and delete.
  493. // Disabling this does not imply halting process of previously
  494. // accepted data.
  495. DisableModifications bool `json:"disableModifications,omitempty"`
  496. // DisableServing: Disable serving any search or assist results.
  497. DisableServing bool `json:"disableServing,omitempty"`
  498. // DisplayName: Required. Display name of the datasource
  499. // The maximum length is 300 characters.
  500. DisplayName string `json:"displayName,omitempty"`
  501. // IndexingServiceAccounts: List of service accounts that have indexing
  502. // access.
  503. IndexingServiceAccounts []string `json:"indexingServiceAccounts,omitempty"`
  504. // ItemsVisibility: This field restricts visibility to items at the
  505. // datasource level. Items
  506. // within the datasource are restricted to the union of users and
  507. // groups
  508. // included in this field. Note that, this does not ensure access to
  509. // a
  510. // specific item, as users need to have ACL permissions on the
  511. // contained
  512. // items. This ensures a high level access on the entire datasource,
  513. // and
  514. // that the individual items are not shared outside this visibility.
  515. ItemsVisibility []*GSuitePrincipal `json:"itemsVisibility,omitempty"`
  516. // Name: Name of the datasource resource.
  517. // Format: datasources/{source_id}.
  518. // <br />The name is ignored when creating a datasource.
  519. Name string `json:"name,omitempty"`
  520. // OperationIds: IDs of the Long Running Operations (LROs) currently
  521. // running for this schema.
  522. OperationIds []string `json:"operationIds,omitempty"`
  523. // ShortName: A short name or alias for the source. This value will be
  524. // used to match the
  525. // 'source' operator. For example, if the short name is *&lt;value&gt;*
  526. // then
  527. // queries like *source:&lt;value&gt;* will only return results for
  528. // this
  529. // source. The value must be unique across all datasources. The value
  530. // must
  531. // only contain alphanumeric characters (a-zA-Z0-9). The value cannot
  532. // start
  533. // with 'google' and cannot be one of the following: mail, gmail, docs,
  534. // drive,
  535. // groups, sites, calendar, hangouts, gplus, keep, people, teams.
  536. // Its maximum length is 32 characters.
  537. ShortName string `json:"shortName,omitempty"`
  538. // ServerResponse contains the HTTP response code and headers from the
  539. // server.
  540. googleapi.ServerResponse `json:"-"`
  541. // ForceSendFields is a list of field names (e.g.
  542. // "DisableModifications") to unconditionally include in API requests.
  543. // By default, fields with empty values are omitted from API requests.
  544. // However, any non-pointer, non-interface field appearing in
  545. // ForceSendFields will be sent to the server regardless of whether the
  546. // field is empty or not. This may be used to include empty fields in
  547. // Patch requests.
  548. ForceSendFields []string `json:"-"`
  549. // NullFields is a list of field names (e.g. "DisableModifications") to
  550. // include in API requests with the JSON null value. By default, fields
  551. // with empty values are omitted from API requests. However, any field
  552. // with an empty value appearing in NullFields will be sent to the
  553. // server as null. It is an error if a field in this list has a
  554. // non-empty value. This may be used to include null fields in Patch
  555. // requests.
  556. NullFields []string `json:"-"`
  557. }
  558. func (s *DataSource) MarshalJSON() ([]byte, error) {
  559. type NoMethod DataSource
  560. raw := NoMethod(*s)
  561. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  562. }
  563. // DataSourceIndexStats: Aggregation of items by status code as of the
  564. // specified date.
  565. type DataSourceIndexStats struct {
  566. // Date: Date for which index stats were calculated. If the date of
  567. // request is not
  568. // the current date then stats calculated on the next day are returned.
  569. // Stats
  570. // are calculated close to mid night in this case. If date of request
  571. // is
  572. // current date, then real time stats are returned.
  573. Date *Date `json:"date,omitempty"`
  574. // ItemCountByStatus: Number of items aggregrated by status code.
  575. ItemCountByStatus []*ItemCountByStatus `json:"itemCountByStatus,omitempty"`
  576. // ForceSendFields is a list of field names (e.g. "Date") to
  577. // unconditionally include in API requests. By default, fields with
  578. // empty values are omitted from API requests. However, any non-pointer,
  579. // non-interface field appearing in ForceSendFields will be sent to the
  580. // server regardless of whether the field is empty or not. This may be
  581. // used to include empty fields in Patch requests.
  582. ForceSendFields []string `json:"-"`
  583. // NullFields is a list of field names (e.g. "Date") to include in API
  584. // requests with the JSON null value. By default, fields with empty
  585. // values are omitted from API requests. However, any field with an
  586. // empty value appearing in NullFields will be sent to the server as
  587. // null. It is an error if a field in this list has a non-empty value.
  588. // This may be used to include null fields in Patch requests.
  589. NullFields []string `json:"-"`
  590. }
  591. func (s *DataSourceIndexStats) MarshalJSON() ([]byte, error) {
  592. type NoMethod DataSourceIndexStats
  593. raw := NoMethod(*s)
  594. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  595. }
  596. // DataSourceRestriction: Restriction on Datasource.
  597. type DataSourceRestriction struct {
  598. // FilterOptions: Filter options restricting the results. If multiple
  599. // filters
  600. // are present, they are grouped by object type before joining.
  601. // Filters with the same object type are joined conjunctively, then
  602. // the resulting expressions are joined disjunctively.
  603. //
  604. // The maximum number of elements is 20.
  605. FilterOptions []*FilterOptions `json:"filterOptions,omitempty"`
  606. // Source: The source of restriction.
  607. Source *Source `json:"source,omitempty"`
  608. // ForceSendFields is a list of field names (e.g. "FilterOptions") to
  609. // unconditionally include in API requests. By default, fields with
  610. // empty values are omitted from API requests. However, any non-pointer,
  611. // non-interface field appearing in ForceSendFields will be sent to the
  612. // server regardless of whether the field is empty or not. This may be
  613. // used to include empty fields in Patch requests.
  614. ForceSendFields []string `json:"-"`
  615. // NullFields is a list of field names (e.g. "FilterOptions") to include
  616. // in API requests with the JSON null value. By default, fields with
  617. // empty values are omitted from API requests. However, any field with
  618. // an empty value appearing in NullFields will be sent to the server as
  619. // null. It is an error if a field in this list has a non-empty value.
  620. // This may be used to include null fields in Patch requests.
  621. NullFields []string `json:"-"`
  622. }
  623. func (s *DataSourceRestriction) MarshalJSON() ([]byte, error) {
  624. type NoMethod DataSourceRestriction
  625. raw := NoMethod(*s)
  626. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  627. }
  628. // Date: Represents a whole calendar date, for example a date of birth.
  629. // The time of day and time zone are either specified elsewhere or are
  630. // not significant. The date is relative to the [Proleptic Gregorian
  631. // Calendar](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar).
  632. // The date must be a valid calendar date between the year 1 and 9999.
  633. type Date struct {
  634. // Day: Day of month. Must be from 1 to 31 and valid for the year and
  635. // month.
  636. Day int64 `json:"day,omitempty"`
  637. // Month: Month of date. Must be from 1 to 12.
  638. Month int64 `json:"month,omitempty"`
  639. // Year: Year of date. Must be from 1 to 9999.
  640. Year int64 `json:"year,omitempty"`
  641. // ForceSendFields is a list of field names (e.g. "Day") to
  642. // unconditionally include in API requests. By default, fields with
  643. // empty values are omitted from API requests. However, any non-pointer,
  644. // non-interface field appearing in ForceSendFields will be sent to the
  645. // server regardless of whether the field is empty or not. This may be
  646. // used to include empty fields in Patch requests.
  647. ForceSendFields []string `json:"-"`
  648. // NullFields is a list of field names (e.g. "Day") to include in API
  649. // requests with the JSON null value. By default, fields with empty
  650. // values are omitted from API requests. However, any field with an
  651. // empty value appearing in NullFields will be sent to the server as
  652. // null. It is an error if a field in this list has a non-empty value.
  653. // This may be used to include null fields in Patch requests.
  654. NullFields []string `json:"-"`
  655. }
  656. func (s *Date) MarshalJSON() ([]byte, error) {
  657. type NoMethod Date
  658. raw := NoMethod(*s)
  659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  660. }
  661. // DateOperatorOptions: Optional. Provides a search operator for date
  662. // properties.
  663. // Search operators let users restrict the query to specific fields
  664. // relevant
  665. // to the type of item being searched.
  666. type DateOperatorOptions struct {
  667. // GreaterThanOperatorName: Indicates the operator name required in the
  668. // query in order to isolate the
  669. // date property using the greater-than operator. For example,
  670. // if
  671. // greaterThanOperatorName is *closedafter* and the property's name
  672. // is
  673. // *closeDate*, then queries like *closedafter:&lt;value&gt;* will
  674. // show results only where the value of the property named *closeDate*
  675. // is
  676. // later than *&lt;value&gt;*.
  677. // The operator name can only contain lowercase letters (a-z).
  678. // The maximum length is 32 characters.
  679. GreaterThanOperatorName string `json:"greaterThanOperatorName,omitempty"`
  680. // LessThanOperatorName: Indicates the operator name required in the
  681. // query in order to isolate the
  682. // date property using the less-than operator. For example,
  683. // if
  684. // lessThanOperatorName is *closedbefore* and the property's name
  685. // is
  686. // *closeDate*, then queries like *closedbefore:&lt;value&gt;* will
  687. // show results only where the value of the property named *closeDate*
  688. // is
  689. // earlier than *&lt;value&gt;*.
  690. // The operator name can only contain lowercase letters (a-z).
  691. // The maximum length is 32 characters.
  692. LessThanOperatorName string `json:"lessThanOperatorName,omitempty"`
  693. // OperatorName: Indicates the actual string required in the query in
  694. // order to isolate the
  695. // date property. For example, suppose an issue tracking schema
  696. // object
  697. // has a property named *closeDate* that specifies an operator with
  698. // an
  699. // operatorName of *closedon*. For searches on that data, queries
  700. // like
  701. // *closedon:&lt;value&gt;* will show results only where the value of
  702. // the
  703. // *closeDate* property matches *&lt;value&gt;*. By contrast, a
  704. // search that uses the same *&lt;value&gt;* without an operator will
  705. // return
  706. // all items where *&lt;value&gt;* matches the value of any
  707. // String
  708. // properties or text within the content field for the indexed
  709. // datasource.
  710. // The operator name can only contain lowercase letters (a-z).
  711. // The maximum length is 32 characters.
  712. OperatorName string `json:"operatorName,omitempty"`
  713. // ForceSendFields is a list of field names (e.g.
  714. // "GreaterThanOperatorName") to unconditionally include in API
  715. // requests. By default, fields with empty values are omitted from API
  716. // requests. However, any non-pointer, non-interface field appearing in
  717. // ForceSendFields will be sent to the server regardless of whether the
  718. // field is empty or not. This may be used to include empty fields in
  719. // Patch requests.
  720. ForceSendFields []string `json:"-"`
  721. // NullFields is a list of field names (e.g. "GreaterThanOperatorName")
  722. // to include in API requests with the JSON null value. By default,
  723. // fields with empty values are omitted from API requests. However, any
  724. // field with an empty value appearing in NullFields will be sent to the
  725. // server as null. It is an error if a field in this list has a
  726. // non-empty value. This may be used to include null fields in Patch
  727. // requests.
  728. NullFields []string `json:"-"`
  729. }
  730. func (s *DateOperatorOptions) MarshalJSON() ([]byte, error) {
  731. type NoMethod DateOperatorOptions
  732. raw := NoMethod(*s)
  733. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  734. }
  735. // DatePropertyOptions: Options for date properties.
  736. type DatePropertyOptions struct {
  737. // OperatorOptions: If set, describes how the date should be used as a
  738. // search operator.
  739. OperatorOptions *DateOperatorOptions `json:"operatorOptions,omitempty"`
  740. // ForceSendFields is a list of field names (e.g. "OperatorOptions") to
  741. // unconditionally include in API requests. By default, fields with
  742. // empty values are omitted from API requests. However, any non-pointer,
  743. // non-interface field appearing in ForceSendFields will be sent to the
  744. // server regardless of whether the field is empty or not. This may be
  745. // used to include empty fields in Patch requests.
  746. ForceSendFields []string `json:"-"`
  747. // NullFields is a list of field names (e.g. "OperatorOptions") to
  748. // include in API requests with the JSON null value. By default, fields
  749. // with empty values are omitted from API requests. However, any field
  750. // with an empty value appearing in NullFields will be sent to the
  751. // server as null. It is an error if a field in this list has a
  752. // non-empty value. This may be used to include null fields in Patch
  753. // requests.
  754. NullFields []string `json:"-"`
  755. }
  756. func (s *DatePropertyOptions) MarshalJSON() ([]byte, error) {
  757. type NoMethod DatePropertyOptions
  758. raw := NoMethod(*s)
  759. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  760. }
  761. // DateValues: List of date values.
  762. type DateValues struct {
  763. Values []*Date `json:"values,omitempty"`
  764. // ForceSendFields is a list of field names (e.g. "Values") to
  765. // unconditionally include in API requests. By default, fields with
  766. // empty values are omitted from API requests. However, any non-pointer,
  767. // non-interface field appearing in ForceSendFields will be sent to the
  768. // server regardless of whether the field is empty or not. This may be
  769. // used to include empty fields in Patch requests.
  770. ForceSendFields []string `json:"-"`
  771. // NullFields is a list of field names (e.g. "Values") to include in API
  772. // requests with the JSON null value. By default, fields with empty
  773. // values are omitted from API requests. However, any field with an
  774. // empty value appearing in NullFields will be sent to the server as
  775. // null. It is an error if a field in this list has a non-empty value.
  776. // This may be used to include null fields in Patch requests.
  777. NullFields []string `json:"-"`
  778. }
  779. func (s *DateValues) MarshalJSON() ([]byte, error) {
  780. type NoMethod DateValues
  781. raw := NoMethod(*s)
  782. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  783. }
  784. // DebugOptions: Shared request debug options for all cloudsearch RPC
  785. // methods.
  786. type DebugOptions struct {
  787. // EnableDebugging: If set, the request will enable debugging features
  788. // of Cloud Search.
  789. // Only turn on this field, if asked by Google to help with debugging.
  790. EnableDebugging bool `json:"enableDebugging,omitempty"`
  791. // ForceSendFields is a list of field names (e.g. "EnableDebugging") to
  792. // unconditionally include in API requests. By default, fields with
  793. // empty values are omitted from API requests. However, any non-pointer,
  794. // non-interface field appearing in ForceSendFields will be sent to the
  795. // server regardless of whether the field is empty or not. This may be
  796. // used to include empty fields in Patch requests.
  797. ForceSendFields []string `json:"-"`
  798. // NullFields is a list of field names (e.g. "EnableDebugging") to
  799. // include in API requests with the JSON null value. By default, fields
  800. // with empty values are omitted from API requests. However, any field
  801. // with an empty value appearing in NullFields will be sent to the
  802. // server as null. It is an error if a field in this list has a
  803. // non-empty value. This may be used to include null fields in Patch
  804. // requests.
  805. NullFields []string `json:"-"`
  806. }
  807. func (s *DebugOptions) MarshalJSON() ([]byte, error) {
  808. type NoMethod DebugOptions
  809. raw := NoMethod(*s)
  810. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  811. }
  812. type DeleteQueueItemsRequest struct {
  813. // ConnectorName: Name of connector making this call.
  814. // <br />Format: datasources/{source_id}/connectors/{ID}
  815. ConnectorName string `json:"connectorName,omitempty"`
  816. // DebugOptions: Common debug options.
  817. DebugOptions *DebugOptions `json:"debugOptions,omitempty"`
  818. // Queue: Name of a queue to delete items from.
  819. Queue string `json:"queue,omitempty"`
  820. // ForceSendFields is a list of field names (e.g. "ConnectorName") to
  821. // unconditionally include in API requests. By default, fields with
  822. // empty values are omitted from API requests. However, any non-pointer,
  823. // non-interface field appearing in ForceSendFields will be sent to the
  824. // server regardless of whether the field is empty or not. This may be
  825. // used to include empty fields in Patch requests.
  826. ForceSendFields []string `json:"-"`
  827. // NullFields is a list of field names (e.g. "ConnectorName") to include
  828. // in API requests with the JSON null value. By default, fields with
  829. // empty values are omitted from API requests. However, any field with
  830. // an empty value appearing in NullFields will be sent to the server as
  831. // null. It is an error if a field in this list has a non-empty value.
  832. // This may be used to include null fields in Patch requests.
  833. NullFields []string `json:"-"`
  834. }
  835. func (s *DeleteQueueItemsRequest) MarshalJSON() ([]byte, error) {
  836. type NoMethod DeleteQueueItemsRequest
  837. raw := NoMethod(*s)
  838. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  839. }
  840. // DisplayedProperty: A reference to a top-level property within the
  841. // object that should be
  842. // displayed in search results. The values of the chosen properties will
  843. // be
  844. // displayed in the search results along with the
  845. // dislpay label
  846. // for that property if one is specified. If a display label is not
  847. // specified,
  848. // only the values will be shown.
  849. type DisplayedProperty struct {
  850. // PropertyName: The name of the top-level property as defined in a
  851. // property definition
  852. // for the object. If the name is not a defined property in the schema,
  853. // an
  854. // error will be given when attempting to update the schema.
  855. PropertyName string `json:"propertyName,omitempty"`
  856. // ForceSendFields is a list of field names (e.g. "PropertyName") to
  857. // unconditionally include in API requests. By default, fields with
  858. // empty values are omitted from API requests. However, any non-pointer,
  859. // non-interface field appearing in ForceSendFields will be sent to the
  860. // server regardless of whether the field is empty or not. This may be
  861. // used to include empty fields in Patch requests.
  862. ForceSendFields []string `json:"-"`
  863. // NullFields is a list of field names (e.g. "PropertyName") to include
  864. // in API requests with the JSON null value. By default, fields with
  865. // empty values are omitted from API requests. However, any field with
  866. // an empty value appearing in NullFields will be sent to the server as
  867. // null. It is an error if a field in this list has a non-empty value.
  868. // This may be used to include null fields in Patch requests.
  869. NullFields []string `json:"-"`
  870. }
  871. func (s *DisplayedProperty) MarshalJSON() ([]byte, error) {
  872. type NoMethod DisplayedProperty
  873. raw := NoMethod(*s)
  874. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  875. }
  876. // DoubleOperatorOptions: Used to provide a search operator for double
  877. // properties. This is
  878. // optional. Search operators let users restrict the query to specific
  879. // fields
  880. // relevant to the type of item being searched.
  881. type DoubleOperatorOptions struct {
  882. // OperatorName: Indicates the operator name required in the query in
  883. // order to use the
  884. // double property in sorting or as a facet.
  885. // The operator name can only contain lowercase letters (a-z).
  886. // The maximum length is 32 characters.
  887. OperatorName string `json:"operatorName,omitempty"`
  888. // ForceSendFields is a list of field names (e.g. "OperatorName") to
  889. // unconditionally include in API requests. By default, fields with
  890. // empty values are omitted from API requests. However, any non-pointer,
  891. // non-interface field appearing in ForceSendFields will be sent to the
  892. // server regardless of whether the field is empty or not. This may be
  893. // used to include empty fields in Patch requests.
  894. ForceSendFields []string `json:"-"`
  895. // NullFields is a list of field names (e.g. "OperatorName") to include
  896. // in API requests with the JSON null value. By default, fields with
  897. // empty values are omitted from API requests. However, any field with
  898. // an empty value appearing in NullFields will be sent to the server as
  899. // null. It is an error if a field in this list has a non-empty value.
  900. // This may be used to include null fields in Patch requests.
  901. NullFields []string `json:"-"`
  902. }
  903. func (s *DoubleOperatorOptions) MarshalJSON() ([]byte, error) {
  904. type NoMethod DoubleOperatorOptions
  905. raw := NoMethod(*s)
  906. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  907. }
  908. // DoublePropertyOptions: Options for double properties.
  909. type DoublePropertyOptions struct {
  910. // OperatorOptions: If set, describes how the double should be used as a
  911. // search operator.
  912. OperatorOptions *DoubleOperatorOptions `json:"operatorOptions,omitempty"`
  913. // ForceSendFields is a list of field names (e.g. "OperatorOptions") to
  914. // unconditionally include in API requests. By default, fields with
  915. // empty values are omitted from API requests. However, any non-pointer,
  916. // non-interface field appearing in ForceSendFields will be sent to the
  917. // server regardless of whether the field is empty or not. This may be
  918. // used to include empty fields in Patch requests.
  919. ForceSendFields []string `json:"-"`
  920. // NullFields is a list of field names (e.g. "OperatorOptions") to
  921. // include in API requests with the JSON null value. By default, fields
  922. // with empty values are omitted from API requests. However, any field
  923. // with an empty value appearing in NullFields will be sent to the
  924. // server as null. It is an error if a field in this list has a
  925. // non-empty value. This may be used to include null fields in Patch
  926. // requests.
  927. NullFields []string `json:"-"`
  928. }
  929. func (s *DoublePropertyOptions) MarshalJSON() ([]byte, error) {
  930. type NoMethod DoublePropertyOptions
  931. raw := NoMethod(*s)
  932. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  933. }
  934. // DoubleValues: List of double values.
  935. type DoubleValues struct {
  936. Values []float64 `json:"values,omitempty"`
  937. // ForceSendFields is a list of field names (e.g. "Values") to
  938. // unconditionally include in API requests. By default, fields with
  939. // empty values are omitted from API requests. However, any non-pointer,
  940. // non-interface field appearing in ForceSendFields will be sent to the
  941. // server regardless of whether the field is empty or not. This may be
  942. // used to include empty fields in Patch requests.
  943. ForceSendFields []string `json:"-"`
  944. // NullFields is a list of field names (e.g. "Values") to include in API
  945. // requests with the JSON null value. By default, fields with empty
  946. // values are omitted from API requests. However, any field with an
  947. // empty value appearing in NullFields will be sent to the server as
  948. // null. It is an error if a field in this list has a non-empty value.
  949. // This may be used to include null fields in Patch requests.
  950. NullFields []string `json:"-"`
  951. }
  952. func (s *DoubleValues) MarshalJSON() ([]byte, error) {
  953. type NoMethod DoubleValues
  954. raw := NoMethod(*s)
  955. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  956. }
  957. // DriveFollowUpRestrict: Drive follow-up search restricts (e.g.
  958. // "followup:suggestions").
  959. type DriveFollowUpRestrict struct {
  960. // Possible values:
  961. // "UNSPECIFIED"
  962. // "FOLLOWUP_SUGGESTIONS"
  963. // "FOLLOWUP_ACTION_ITEMS"
  964. Type string `json:"type,omitempty"`
  965. // ForceSendFields is a list of field names (e.g. "Type") to
  966. // unconditionally include in API requests. By default, fields with
  967. // empty values are omitted from API requests. However, any non-pointer,
  968. // non-interface field appearing in ForceSendFields will be sent to the
  969. // server regardless of whether the field is empty or not. This may be
  970. // used to include empty fields in Patch requests.
  971. ForceSendFields []string `json:"-"`
  972. // NullFields is a list of field names (e.g. "Type") to include in API
  973. // requests with the JSON null value. By default, fields with empty
  974. // values are omitted from API requests. However, any field with an
  975. // empty value appearing in NullFields will be sent to the server as
  976. // null. It is an error if a field in this list has a non-empty value.
  977. // This may be used to include null fields in Patch requests.
  978. NullFields []string `json:"-"`
  979. }
  980. func (s *DriveFollowUpRestrict) MarshalJSON() ([]byte, error) {
  981. type NoMethod DriveFollowUpRestrict
  982. raw := NoMethod(*s)
  983. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  984. }
  985. // DriveLocationRestrict: Drive location search restricts (e.g.
  986. // "is:starred").
  987. type DriveLocationRestrict struct {
  988. // Possible values:
  989. // "UNSPECIFIED"
  990. // "TRASHED"
  991. // "STARRED"
  992. Type string `json:"type,omitempty"`
  993. // ForceSendFields is a list of field names (e.g. "Type") to
  994. // unconditionally include in API requests. By default, fields with
  995. // empty values are omitted from API requests. However, any non-pointer,
  996. // non-interface field appearing in ForceSendFields will be sent to the
  997. // server regardless of whether the field is empty or not. This may be
  998. // used to include empty fields in Patch requests.
  999. ForceSendFields []string `json:"-"`
  1000. // NullFields is a list of field names (e.g. "Type") to include in API
  1001. // requests with the JSON null value. By default, fields with empty
  1002. // values are omitted from API requests. However, any field with an
  1003. // empty value appearing in NullFields will be sent to the server as
  1004. // null. It is an error if a field in this list has a non-empty value.
  1005. // This may be used to include null fields in Patch requests.
  1006. NullFields []string `json:"-"`
  1007. }
  1008. func (s *DriveLocationRestrict) MarshalJSON() ([]byte, error) {
  1009. type NoMethod DriveLocationRestrict
  1010. raw := NoMethod(*s)
  1011. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1012. }
  1013. // DriveMimeTypeRestrict: Drive mime-type search restricts (e.g.
  1014. // "type:pdf").
  1015. type DriveMimeTypeRestrict struct {
  1016. // Possible values:
  1017. // "UNSPECIFIED"
  1018. // "PDF"
  1019. // "DOCUMENT"
  1020. // "PRESENTATION"
  1021. // "SPREADSHEET"
  1022. // "FORM"
  1023. // "DRAWING"
  1024. // "SCRIPT"
  1025. // "MAP"
  1026. // "IMAGE"
  1027. // "AUDIO"
  1028. // "VIDEO"
  1029. // "FOLDER"
  1030. // "ARCHIVE"
  1031. // "SITE"
  1032. Type string `json:"type,omitempty"`
  1033. // ForceSendFields is a list of field names (e.g. "Type") to
  1034. // unconditionally include in API requests. By default, fields with
  1035. // empty values are omitted from API requests. However, any non-pointer,
  1036. // non-interface field appearing in ForceSendFields will be sent to the
  1037. // server regardless of whether the field is empty or not. This may be
  1038. // used to include empty fields in Patch requests.
  1039. ForceSendFields []string `json:"-"`
  1040. // NullFields is a list of field names (e.g. "Type") to include in API
  1041. // requests with the JSON null value. By default, fields with empty
  1042. // values are omitted from API requests. However, any field with an
  1043. // empty value appearing in NullFields will be sent to the server as
  1044. // null. It is an error if a field in this list has a non-empty value.
  1045. // This may be used to include null fields in Patch requests.
  1046. NullFields []string `json:"-"`
  1047. }
  1048. func (s *DriveMimeTypeRestrict) MarshalJSON() ([]byte, error) {
  1049. type NoMethod DriveMimeTypeRestrict
  1050. raw := NoMethod(*s)
  1051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1052. }
  1053. // DriveTimeSpanRestrict: The time span search restrict (e.g.
  1054. // "after:2017-09-11 before:2017-09-12").
  1055. type DriveTimeSpanRestrict struct {
  1056. // Possible values:
  1057. // "UNSPECIFIED"
  1058. // "TODAY"
  1059. // "YESTERDAY"
  1060. // "LAST_7_DAYS"
  1061. // "LAST_30_DAYS" - Not Enabled
  1062. // "LAST_90_DAYS" - Not Enabled
  1063. Type string `json:"type,omitempty"`
  1064. // ForceSendFields is a list of field names (e.g. "Type") to
  1065. // unconditionally include in API requests. By default, fields with
  1066. // empty values are omitted from API requests. However, any non-pointer,
  1067. // non-interface field appearing in ForceSendFields will be sent to the
  1068. // server regardless of whether the field is empty or not. This may be
  1069. // used to include empty fields in Patch requests.
  1070. ForceSendFields []string `json:"-"`
  1071. // NullFields is a list of field names (e.g. "Type") to include in API
  1072. // requests with the JSON null value. By default, fields with empty
  1073. // values are omitted from API requests. However, any field with an
  1074. // empty value appearing in NullFields will be sent to the server as
  1075. // null. It is an error if a field in this list has a non-empty value.
  1076. // This may be used to include null fields in Patch requests.
  1077. NullFields []string `json:"-"`
  1078. }
  1079. func (s *DriveTimeSpanRestrict) MarshalJSON() ([]byte, error) {
  1080. type NoMethod DriveTimeSpanRestrict
  1081. raw := NoMethod(*s)
  1082. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1083. }
  1084. // EmailAddress: A person's email address.
  1085. type EmailAddress struct {
  1086. // EmailAddress: The email address.
  1087. EmailAddress string `json:"emailAddress,omitempty"`
  1088. // ForceSendFields is a list of field names (e.g. "EmailAddress") to
  1089. // unconditionally include in API requests. By default, fields with
  1090. // empty values are omitted from API requests. However, any non-pointer,
  1091. // non-interface field appearing in ForceSendFields will be sent to the
  1092. // server regardless of whether the field is empty or not. This may be
  1093. // used to include empty fields in Patch requests.
  1094. ForceSendFields []string `json:"-"`
  1095. // NullFields is a list of field names (e.g. "EmailAddress") to include
  1096. // in API requests with the JSON null value. By default, fields with
  1097. // empty values are omitted from API requests. However, any field with
  1098. // an empty value appearing in NullFields will be sent to the server as
  1099. // null. It is an error if a field in this list has a non-empty value.
  1100. // This may be used to include null fields in Patch requests.
  1101. NullFields []string `json:"-"`
  1102. }
  1103. func (s *EmailAddress) MarshalJSON() ([]byte, error) {
  1104. type NoMethod EmailAddress
  1105. raw := NoMethod(*s)
  1106. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1107. }
  1108. // EnumOperatorOptions: Used to provide a search operator for enum
  1109. // properties. This is
  1110. // optional. Search operators let users restrict the query to specific
  1111. // fields
  1112. // relevant to the type of item being searched. For example, if you
  1113. // provide no
  1114. // operator for a *priority* enum property with possible values *p0* and
  1115. // *p1*,
  1116. // a query that contains the term *p0* will return items that have *p0*
  1117. // as the
  1118. // value of the *priority* property, as well as any items that contain
  1119. // the
  1120. // string *p0* in other fields. If you provide an operator name for the
  1121. // enum,
  1122. // such as *priority*, then search users can use that operator to
  1123. // refine
  1124. // results to only items that have *p0* as this property's value, with
  1125. // the
  1126. // query *priority:p0*.
  1127. type EnumOperatorOptions struct {
  1128. // OperatorName: Indicates the operator name required in the query in
  1129. // order to isolate the
  1130. // enum property. For example, if operatorName is *priority* and
  1131. // the
  1132. // property's name is *priorityVal*, then queries
  1133. // like
  1134. // *priority:&lt;value&gt;* will show results only where the value of
  1135. // the
  1136. // property named *priorityVal* matches *&lt;value&gt;*. By contrast,
  1137. // a
  1138. // search that uses the same *&lt;value&gt;* without an operator will
  1139. // return
  1140. // all items where *&lt;value&gt;* matches the value of any
  1141. // String
  1142. // properties or text within the content field for the item.
  1143. // The operator name can only contain lowercase letters (a-z).
  1144. // The maximum length is 32 characters.
  1145. OperatorName string `json:"operatorName,omitempty"`
  1146. // ForceSendFields is a list of field names (e.g. "OperatorName") to
  1147. // unconditionally include in API requests. By default, fields with
  1148. // empty values are omitted from API requests. However, any non-pointer,
  1149. // non-interface field appearing in ForceSendFields will be sent to the
  1150. // server regardless of whether the field is empty or not. This may be
  1151. // used to include empty fields in Patch requests.
  1152. ForceSendFields []string `json:"-"`
  1153. // NullFields is a list of field names (e.g. "OperatorName") to include
  1154. // in API requests with the JSON null value. By default, fields with
  1155. // empty values are omitted from API requests. However, any field with
  1156. // an empty value appearing in NullFields will be sent to the server as
  1157. // null. It is an error if a field in this list has a non-empty value.
  1158. // This may be used to include null fields in Patch requests.
  1159. NullFields []string `json:"-"`
  1160. }
  1161. func (s *EnumOperatorOptions) MarshalJSON() ([]byte, error) {
  1162. type NoMethod EnumOperatorOptions
  1163. raw := NoMethod(*s)
  1164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1165. }
  1166. // EnumPropertyOptions: Options for enum properties, which allow you to
  1167. // define a restricted set of
  1168. // strings to match user queries, set rankings for those string values,
  1169. // and
  1170. // define an operator name to be paired with those strings so that users
  1171. // can
  1172. // narrow results to only items with a specific value. For example, for
  1173. // items in
  1174. // a request tracking system with priority information, you could define
  1175. // *p0* as
  1176. // an allowable enum value and tie this enum to the operator name
  1177. // *priority* so
  1178. // that search users could add *priority:p0* to their query to restrict
  1179. // the set
  1180. // of results to only those items indexed with the value *p0*.
  1181. type EnumPropertyOptions struct {
  1182. // OperatorOptions: If set, describes how the enum should be used as a
  1183. // search operator.
  1184. OperatorOptions *EnumOperatorOptions `json:"operatorOptions,omitempty"`
  1185. // OrderedRanking: Used to specify the ordered ranking for the
  1186. // enumeration that determines how
  1187. // the integer values provided in the possible EnumValuePairs are used
  1188. // to rank
  1189. // results. If specified, integer values must be provided for all
  1190. // possible
  1191. // EnumValuePair values given for this property. Can only be used
  1192. // if
  1193. // isRepeatable
  1194. // is false.
  1195. //
  1196. // Possible values:
  1197. // "NO_ORDER" - There is no ranking order for the property. Results
  1198. // will not be adjusted
  1199. // by this property's value.
  1200. // "ASCENDING" - This property is ranked in ascending order. Lower
  1201. // values indicate lower
  1202. // ranking.
  1203. // "DESCENDING" - This property is ranked in descending order. Lower
  1204. // values indicate
  1205. // higher ranking.
  1206. OrderedRanking string `json:"orderedRanking,omitempty"`
  1207. // PossibleValues: The list of possible values for the enumeration
  1208. // property. All
  1209. // EnumValuePairs must provide a string value. If you specify an integer
  1210. // value
  1211. // for one EnumValuePair, then all possible EnumValuePairs must provide
  1212. // an
  1213. // integer value. Both the string value and integer value must be unique
  1214. // over
  1215. // all possible values. Once set, possible values cannot be removed
  1216. // or
  1217. // modified. If you supply an ordered ranking and think you might
  1218. // insert
  1219. // additional enum values in the future, leave gaps in the initial
  1220. // integer
  1221. // values to allow adding a value in between previously registered
  1222. // values.
  1223. // The maximum number of elements is 100.
  1224. PossibleValues []*EnumValuePair `json:"possibleValues,omitempty"`
  1225. // ForceSendFields is a list of field names (e.g. "OperatorOptions") to
  1226. // unconditionally include in API requests. By default, fields with
  1227. // empty values are omitted from API requests. However, any non-pointer,
  1228. // non-interface field appearing in ForceSendFields will be sent to the
  1229. // server regardless of whether the field is empty or not. This may be
  1230. // used to include empty fields in Patch requests.
  1231. ForceSendFields []string `json:"-"`
  1232. // NullFields is a list of field names (e.g. "OperatorOptions") to
  1233. // include in API requests with the JSON null value. By default, fields
  1234. // with empty values are omitted from API requests. However, any field
  1235. // with an empty value appearing in NullFields will be sent to the
  1236. // server as null. It is an error if a field in this list has a
  1237. // non-empty value. This may be used to include null fields in Patch
  1238. // requests.
  1239. NullFields []string `json:"-"`
  1240. }
  1241. func (s *EnumPropertyOptions) MarshalJSON() ([]byte, error) {
  1242. type NoMethod EnumPropertyOptions
  1243. raw := NoMethod(*s)
  1244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1245. }
  1246. // EnumValuePair: The enumeration value pair defines two things: a
  1247. // required string value and
  1248. // an optional integer value. The string value defines the necessary
  1249. // query
  1250. // term required to retrieve that item, such as *p0* for a priority
  1251. // item.
  1252. // The integer value determines the ranking of that string value
  1253. // relative
  1254. // to other enumerated values for the same property. For example, you
  1255. // might
  1256. // associate *p0* with *0* and define another enum pair such as *p1* and
  1257. // *1*.
  1258. // You must use the integer value in combination with
  1259. // ordered
  1260. // ranking to
  1261. // set the ranking of a given value relative to other enumerated values
  1262. // for
  1263. // the same property name. Here, a ranking order of DESCENDING for
  1264. // *priority*
  1265. // properties results in a ranking boost for items indexed with a value
  1266. // of
  1267. // *p0* compared to items indexed with a value of *p1*. Without a
  1268. // specified
  1269. // ranking order, the integer value has no effect on item ranking.
  1270. type EnumValuePair struct {
  1271. // IntegerValue: The integer value of the EnumValuePair which must be
  1272. // non-negative.
  1273. // Optional.
  1274. IntegerValue int64 `json:"integerValue,omitempty"`
  1275. // StringValue: The string value of the EnumValuePair.
  1276. // The maximum length is 32 characters.
  1277. StringValue string `json:"stringValue,omitempty"`
  1278. // ForceSendFields is a list of field names (e.g. "IntegerValue") to
  1279. // unconditionally include in API requests. By default, fields with
  1280. // empty values are omitted from API requests. However, any non-pointer,
  1281. // non-interface field appearing in ForceSendFields will be sent to the
  1282. // server regardless of whether the field is empty or not. This may be
  1283. // used to include empty fields in Patch requests.
  1284. ForceSendFields []string `json:"-"`
  1285. // NullFields is a list of field names (e.g. "IntegerValue") to include
  1286. // in API requests with the JSON null value. By default, fields with
  1287. // empty values are omitted from API requests. However, any field with
  1288. // an empty value appearing in NullFields will be sent to the server as
  1289. // null. It is an error if a field in this list has a non-empty value.
  1290. // This may be used to include null fields in Patch requests.
  1291. NullFields []string `json:"-"`
  1292. }
  1293. func (s *EnumValuePair) MarshalJSON() ([]byte, error) {
  1294. type NoMethod EnumValuePair
  1295. raw := NoMethod(*s)
  1296. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1297. }
  1298. // EnumValues: List of enum values.
  1299. type EnumValues struct {
  1300. // Values: The maximum allowable length for string values is 32
  1301. // characters.
  1302. Values []string `json:"values,omitempty"`
  1303. // ForceSendFields is a list of field names (e.g. "Values") to
  1304. // unconditionally include in API requests. By default, fields with
  1305. // empty values are omitted from API requests. However, any non-pointer,
  1306. // non-interface field appearing in ForceSendFields will be sent to the
  1307. // server regardless of whether the field is empty or not. This may be
  1308. // used to include empty fields in Patch requests.
  1309. ForceSendFields []string `json:"-"`
  1310. // NullFields is a list of field names (e.g. "Values") to include in API
  1311. // requests with the JSON null value. By default, fields with empty
  1312. // values are omitted from API requests. However, any field with an
  1313. // empty value appearing in NullFields will be sent to the server as
  1314. // null. It is an error if a field in this list has a non-empty value.
  1315. // This may be used to include null fields in Patch requests.
  1316. NullFields []string `json:"-"`
  1317. }
  1318. func (s *EnumValues) MarshalJSON() ([]byte, error) {
  1319. type NoMethod EnumValues
  1320. raw := NoMethod(*s)
  1321. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1322. }
  1323. // ErrorInfo: Error information about the response.
  1324. type ErrorInfo struct {
  1325. ErrorMessages []*ErrorMessage `json:"errorMessages,omitempty"`
  1326. // ForceSendFields is a list of field names (e.g. "ErrorMessages") to
  1327. // unconditionally include in API requests. By default, fields with
  1328. // empty values are omitted from API requests. However, any non-pointer,
  1329. // non-interface field appearing in ForceSendFields will be sent to the
  1330. // server regardless of whether the field is empty or not. This may be
  1331. // used to include empty fields in Patch requests.
  1332. ForceSendFields []string `json:"-"`
  1333. // NullFields is a list of field names (e.g. "ErrorMessages") to include
  1334. // in API requests with the JSON null value. By default, fields with
  1335. // empty values are omitted from API requests. However, any field with
  1336. // an empty value appearing in NullFields will be sent to the server as
  1337. // null. It is an error if a field in this list has a non-empty value.
  1338. // This may be used to include null fields in Patch requests.
  1339. NullFields []string `json:"-"`
  1340. }
  1341. func (s *ErrorInfo) MarshalJSON() ([]byte, error) {
  1342. type NoMethod ErrorInfo
  1343. raw := NoMethod(*s)
  1344. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1345. }
  1346. // ErrorMessage: Error message per source response.
  1347. type ErrorMessage struct {
  1348. ErrorMessage string `json:"errorMessage,omitempty"`
  1349. Source *Source `json:"source,omitempty"`
  1350. // ForceSendFields is a list of field names (e.g. "ErrorMessage") to
  1351. // unconditionally include in API requests. By default, fields with
  1352. // empty values are omitted from API requests. However, any non-pointer,
  1353. // non-interface field appearing in ForceSendFields will be sent to the
  1354. // server regardless of whether the field is empty or not. This may be
  1355. // used to include empty fields in Patch requests.
  1356. ForceSendFields []string `json:"-"`
  1357. // NullFields is a list of field names (e.g. "ErrorMessage") to include
  1358. // in API requests with the JSON null value. By default, fields with
  1359. // empty values are omitted from API requests. However, any field with
  1360. // an empty value appearing in NullFields will be sent to the server as
  1361. // null. It is an error if a field in this list has a non-empty value.
  1362. // This may be used to include null fields in Patch requests.
  1363. NullFields []string `json:"-"`
  1364. }
  1365. func (s *ErrorMessage) MarshalJSON() ([]byte, error) {
  1366. type NoMethod ErrorMessage
  1367. raw := NoMethod(*s)
  1368. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1369. }
  1370. // FacetBucket: A bucket in a facet is the basic unit of operation. A
  1371. // bucket can comprise
  1372. // either a single value OR a contiguous range of values, depending on
  1373. // the
  1374. // type of the field bucketed.
  1375. // FacetBucket is currently used only for returning the response object.
  1376. type FacetBucket struct {
  1377. // Count: Number of results that match the bucket value.
  1378. Count int64 `json:"count,omitempty"`
  1379. // Percentage: Percent of results that match the bucket value. This
  1380. // value is between
  1381. // (0-100].
  1382. // This may not be accurate and is a best effort estimate.
  1383. Percentage int64 `json:"percentage,omitempty"`
  1384. Value *Value `json:"value,omitempty"`
  1385. // ForceSendFields is a list of field names (e.g. "Count") to
  1386. // unconditionally include in API requests. By default, fields with
  1387. // empty values are omitted from API requests. However, any non-pointer,
  1388. // non-interface field appearing in ForceSendFields will be sent to the
  1389. // server regardless of whether the field is empty or not. This may be
  1390. // used to include empty fields in Patch requests.
  1391. ForceSendFields []string `json:"-"`
  1392. // NullFields is a list of field names (e.g. "Count") to include in API
  1393. // requests with the JSON null value. By default, fields with empty
  1394. // values are omitted from API requests. However, any field with an
  1395. // empty value appearing in NullFields will be sent to the server as
  1396. // null. It is an error if a field in this list has a non-empty value.
  1397. // This may be used to include null fields in Patch requests.
  1398. NullFields []string `json:"-"`
  1399. }
  1400. func (s *FacetBucket) MarshalJSON() ([]byte, error) {
  1401. type NoMethod FacetBucket
  1402. raw := NoMethod(*s)
  1403. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1404. }
  1405. // FacetOptions: Specifies operators to return facet results for. There
  1406. // will be one
  1407. // FacetResult for every source_name/object_type/operator_name
  1408. // combination.
  1409. type FacetOptions struct {
  1410. // ObjectType: If object_type is set, only those objects of that type
  1411. // will be used to
  1412. // compute facets. If empty, then all objects will be used to compute
  1413. // facets.
  1414. ObjectType string `json:"objectType,omitempty"`
  1415. // OperatorName: Name of the operator chosen for faceting.
  1416. // @see
  1417. // cloudsearch.SchemaPropertyOptions
  1418. OperatorName string `json:"operatorName,omitempty"`
  1419. // SourceName: Source name to facet on. Format:
  1420. // datasources/{source_id}
  1421. // If empty, all data sources will be used.
  1422. SourceName string `json:"sourceName,omitempty"`
  1423. // ForceSendFields is a list of field names (e.g. "ObjectType") to
  1424. // unconditionally include in API requests. By default, fields with
  1425. // empty values are omitted from API requests. However, any non-pointer,
  1426. // non-interface field appearing in ForceSendFields will be sent to the
  1427. // server regardless of whether the field is empty or not. This may be
  1428. // used to include empty fields in Patch requests.
  1429. ForceSendFields []string `json:"-"`
  1430. // NullFields is a list of field names (e.g. "ObjectType") to include in
  1431. // API requests with the JSON null value. By default, fields with empty
  1432. // values are omitted from API requests. However, any field with an
  1433. // empty value appearing in NullFields will be sent to the server as
  1434. // null. It is an error if a field in this list has a non-empty value.
  1435. // This may be used to include null fields in Patch requests.
  1436. NullFields []string `json:"-"`
  1437. }
  1438. func (s *FacetOptions) MarshalJSON() ([]byte, error) {
  1439. type NoMethod FacetOptions
  1440. raw := NoMethod(*s)
  1441. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1442. }
  1443. // FacetResult: Source specific facet response
  1444. type FacetResult struct {
  1445. // Buckets: FacetBuckets for values in response containing atleast a
  1446. // single result.
  1447. Buckets []*FacetBucket `json:"buckets,omitempty"`
  1448. // ObjectType: Object type for which facet results are returned. Can be
  1449. // empty.
  1450. ObjectType string `json:"objectType,omitempty"`
  1451. // OperatorName: Name of the operator chosen for faceting.
  1452. // @see
  1453. // cloudsearch.SchemaPropertyOptions
  1454. OperatorName string `json:"operatorName,omitempty"`
  1455. // SourceName: Source name for which facet results are returned. Will
  1456. // not be empty.
  1457. SourceName string `json:"sourceName,omitempty"`
  1458. // ForceSendFields is a list of field names (e.g. "Buckets") to
  1459. // unconditionally include in API requests. By default, fields with
  1460. // empty values are omitted from API requests. However, any non-pointer,
  1461. // non-interface field appearing in ForceSendFields will be sent to the
  1462. // server regardless of whether the field is empty or not. This may be
  1463. // used to include empty fields in Patch requests.
  1464. ForceSendFields []string `json:"-"`
  1465. // NullFields is a list of field names (e.g. "Buckets") to include in
  1466. // API requests with the JSON null value. By default, fields with empty
  1467. // values are omitted from API requests. However, any field with an
  1468. // empty value appearing in NullFields will be sent to the server as
  1469. // null. It is an error if a field in this list has a non-empty value.
  1470. // This may be used to include null fields in Patch requests.
  1471. NullFields []string `json:"-"`
  1472. }
  1473. func (s *FacetResult) MarshalJSON() ([]byte, error) {
  1474. type NoMethod FacetResult
  1475. raw := NoMethod(*s)
  1476. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1477. }
  1478. type FieldViolation struct {
  1479. // Description: Description of the error.
  1480. Description string `json:"description,omitempty"`
  1481. // Field: Path of field with violation.
  1482. Field string `json:"field,omitempty"`
  1483. // ForceSendFields is a list of field names (e.g. "Description") to
  1484. // unconditionally include in API requests. By default, fields with
  1485. // empty values are omitted from API requests. However, any non-pointer,
  1486. // non-interface field appearing in ForceSendFields will be sent to the
  1487. // server regardless of whether the field is empty or not. This may be
  1488. // used to include empty fields in Patch requests.
  1489. ForceSendFields []string `json:"-"`
  1490. // NullFields is a list of field names (e.g. "Description") to include
  1491. // in API requests with the JSON null value. By default, fields with
  1492. // empty values are omitted from API requests. However, any field with
  1493. // an empty value appearing in NullFields will be sent to the server as
  1494. // null. It is an error if a field in this list has a non-empty value.
  1495. // This may be used to include null fields in Patch requests.
  1496. NullFields []string `json:"-"`
  1497. }
  1498. func (s *FieldViolation) MarshalJSON() ([]byte, error) {
  1499. type NoMethod FieldViolation
  1500. raw := NoMethod(*s)
  1501. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1502. }
  1503. // Filter: A generic way of expressing filters in a query, which
  1504. // supports two
  1505. // approaches: <br/><br/>
  1506. // **1. Setting a ValueFilter.** The name must match an operator_name
  1507. // defined in
  1508. // the schema for your data source.
  1509. // <br/>
  1510. // **2. Setting a CompositeFilter.** The filters are evaluated
  1511. // using the logical operator. The top-level operators can only be
  1512. // either an AND
  1513. // or a NOT. AND can appear only at the top-most level. OR can appear
  1514. // only under
  1515. // a top-level AND.
  1516. type Filter struct {
  1517. CompositeFilter *CompositeFilter `json:"compositeFilter,omitempty"`
  1518. ValueFilter *ValueFilter `json:"valueFilter,omitempty"`
  1519. // ForceSendFields is a list of field names (e.g. "CompositeFilter") to
  1520. // unconditionally include in API requests. By default, fields with
  1521. // empty values are omitted from API requests. However, any non-pointer,
  1522. // non-interface field appearing in ForceSendFields will be sent to the
  1523. // server regardless of whether the field is empty or not. This may be
  1524. // used to include empty fields in Patch requests.
  1525. ForceSendFields []string `json:"-"`
  1526. // NullFields is a list of field names (e.g. "CompositeFilter") to
  1527. // include in API requests with the JSON null value. By default, fields
  1528. // with empty values are omitted from API requests. However, any field
  1529. // with an empty value appearing in NullFields will be sent to the
  1530. // server as null. It is an error if a field in this list has a
  1531. // non-empty value. This may be used to include null fields in Patch
  1532. // requests.
  1533. NullFields []string `json:"-"`
  1534. }
  1535. func (s *Filter) MarshalJSON() ([]byte, error) {
  1536. type NoMethod Filter
  1537. raw := NoMethod(*s)
  1538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1539. }
  1540. // FilterOptions: Filter options to be applied on query.
  1541. type FilterOptions struct {
  1542. // Filter: Generic filter to restrict the search, such as `lang:en`,
  1543. // `site:xyz`.
  1544. Filter *Filter `json:"filter,omitempty"`
  1545. // ObjectType: If object_type is set, only objects of that type are
  1546. // returned. This should
  1547. // correspond to the name of the object that was registered within
  1548. // the
  1549. // definition of schema. The maximum length is 256 characters.
  1550. ObjectType string `json:"objectType,omitempty"`
  1551. // ForceSendFields is a list of field names (e.g. "Filter") to
  1552. // unconditionally include in API requests. By default, fields with
  1553. // empty values are omitted from API requests. However, any non-pointer,
  1554. // non-interface field appearing in ForceSendFields will be sent to the
  1555. // server regardless of whether the field is empty or not. This may be
  1556. // used to include empty fields in Patch requests.
  1557. ForceSendFields []string `json:"-"`
  1558. // NullFields is a list of field names (e.g. "Filter") to include in API
  1559. // requests with the JSON null value. By default, fields with empty
  1560. // values are omitted from API requests. However, any field with an
  1561. // empty value appearing in NullFields will be sent to the server as
  1562. // null. It is an error if a field in this list has a non-empty value.
  1563. // This may be used to include null fields in Patch requests.
  1564. NullFields []string `json:"-"`
  1565. }
  1566. func (s *FilterOptions) MarshalJSON() ([]byte, error) {
  1567. type NoMethod FilterOptions
  1568. raw := NoMethod(*s)
  1569. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1570. }
  1571. // FreshnessOptions: Indicates which freshness property to use when
  1572. // adjusting search ranking for
  1573. // an item. Fresher, more recent dates indicate higher quality. Use
  1574. // the
  1575. // freshness option property that best works with your data. For
  1576. // fileshare
  1577. // documents, last modified time is most relevant. For calendar event
  1578. // data,
  1579. // the time when the event occurs is a more relevant freshness
  1580. // indicator. In
  1581. // this way, calendar events that occur closer to the time of the search
  1582. // query
  1583. // are considered higher quality and ranked accordingly.
  1584. type FreshnessOptions struct {
  1585. // FreshnessDuration: The duration after which an object should be
  1586. // considered
  1587. // stale. The default value is 180 days (in seconds).
  1588. FreshnessDuration string `json:"freshnessDuration,omitempty"`
  1589. // FreshnessProperty: This property indicates the freshness level of the
  1590. // object in the index.
  1591. // If set, this property must be a top-level property within
  1592. // the
  1593. // property definitions
  1594. // and it must be a
  1595. // timestamp type
  1596. // or
  1597. // date type.
  1598. // Otherwise, the Indexing API uses
  1599. // updateTime
  1600. // as the freshness indicator.
  1601. // The maximum length is 256 characters.
  1602. //
  1603. // When a property is used to calculate fresheness, the value
  1604. // defaults
  1605. // to 2 years from the current time.
  1606. FreshnessProperty string `json:"freshnessProperty,omitempty"`
  1607. // ForceSendFields is a list of field names (e.g. "FreshnessDuration")
  1608. // to unconditionally include in API requests. By default, fields with
  1609. // empty values are omitted from API requests. However, any non-pointer,
  1610. // non-interface field appearing in ForceSendFields will be sent to the
  1611. // server regardless of whether the field is empty or not. This may be
  1612. // used to include empty fields in Patch requests.
  1613. ForceSendFields []string `json:"-"`
  1614. // NullFields is a list of field names (e.g. "FreshnessDuration") to
  1615. // include in API requests with the JSON null value. By default, fields
  1616. // with empty values are omitted from API requests. However, any field
  1617. // with an empty value appearing in NullFields will be sent to the
  1618. // server as null. It is an error if a field in this list has a
  1619. // non-empty value. This may be used to include null fields in Patch
  1620. // requests.
  1621. NullFields []string `json:"-"`
  1622. }
  1623. func (s *FreshnessOptions) MarshalJSON() ([]byte, error) {
  1624. type NoMethod FreshnessOptions
  1625. raw := NoMethod(*s)
  1626. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1627. }
  1628. type GSuitePrincipal struct {
  1629. // GsuiteDomain: This principal represents all users of the G Suite
  1630. // domain of the
  1631. // customer.
  1632. GsuiteDomain bool `json:"gsuiteDomain,omitempty"`
  1633. // GsuiteGroupEmail: This principal references a G Suite group account
  1634. GsuiteGroupEmail string `json:"gsuiteGroupEmail,omitempty"`
  1635. // GsuiteUserEmail: This principal references a G Suite user account
  1636. GsuiteUserEmail string `json:"gsuiteUserEmail,omitempty"`
  1637. // ForceSendFields is a list of field names (e.g. "GsuiteDomain") to
  1638. // unconditionally include in API requests. By default, fields with
  1639. // empty values are omitted from API requests. However, any non-pointer,
  1640. // non-interface field appearing in ForceSendFields will be sent to the
  1641. // server regardless of whether the field is empty or not. This may be
  1642. // used to include empty fields in Patch requests.
  1643. ForceSendFields []string `json:"-"`
  1644. // NullFields is a list of field names (e.g. "GsuiteDomain") to include
  1645. // in API requests with the JSON null value. By default, fields with
  1646. // empty values are omitted from API requests. However, any field with
  1647. // an empty value appearing in NullFields will be sent to the server as
  1648. // null. It is an error if a field in this list has a non-empty value.
  1649. // This may be used to include null fields in Patch requests.
  1650. NullFields []string `json:"-"`
  1651. }
  1652. func (s *GSuitePrincipal) MarshalJSON() ([]byte, error) {
  1653. type NoMethod GSuitePrincipal
  1654. raw := NoMethod(*s)
  1655. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1656. }
  1657. type GetCustomerIndexStatsResponse struct {
  1658. // Stats: Summary of indexed item counts, one for each day in the
  1659. // requested range.
  1660. Stats []*CustomerIndexStats `json:"stats,omitempty"`
  1661. // ServerResponse contains the HTTP response code and headers from the
  1662. // server.
  1663. googleapi.ServerResponse `json:"-"`
  1664. // ForceSendFields is a list of field names (e.g. "Stats") to
  1665. // unconditionally include in API requests. By default, fields with
  1666. // empty values are omitted from API requests. However, any non-pointer,
  1667. // non-interface field appearing in ForceSendFields will be sent to the
  1668. // server regardless of whether the field is empty or not. This may be
  1669. // used to include empty fields in Patch requests.
  1670. ForceSendFields []string `json:"-"`
  1671. // NullFields is a list of field names (e.g. "Stats") to include in API
  1672. // requests with the JSON null value. By default, fields with empty
  1673. // values are omitted from API requests. However, any field with an
  1674. // empty value appearing in NullFields will be sent to the server as
  1675. // null. It is an error if a field in this list has a non-empty value.
  1676. // This may be used to include null fields in Patch requests.
  1677. NullFields []string `json:"-"`
  1678. }
  1679. func (s *GetCustomerIndexStatsResponse) MarshalJSON() ([]byte, error) {
  1680. type NoMethod GetCustomerIndexStatsResponse
  1681. raw := NoMethod(*s)
  1682. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1683. }
  1684. type GetDataSourceIndexStatsResponse struct {
  1685. // Stats: Summary of indexed item counts, one for each day in the
  1686. // requested range.
  1687. Stats []*DataSourceIndexStats `json:"stats,omitempty"`
  1688. // ServerResponse contains the HTTP response code and headers from the
  1689. // server.
  1690. googleapi.ServerResponse `json:"-"`
  1691. // ForceSendFields is a list of field names (e.g. "Stats") to
  1692. // unconditionally include in API requests. By default, fields with
  1693. // empty values are omitted from API requests. However, any non-pointer,
  1694. // non-interface field appearing in ForceSendFields will be sent to the
  1695. // server regardless of whether the field is empty or not. This may be
  1696. // used to include empty fields in Patch requests.
  1697. ForceSendFields []string `json:"-"`
  1698. // NullFields is a list of field names (e.g. "Stats") to include in API
  1699. // requests with the JSON null value. By default, fields with empty
  1700. // values are omitted from API requests. However, any field with an
  1701. // empty value appearing in NullFields will be sent to the server as
  1702. // null. It is an error if a field in this list has a non-empty value.
  1703. // This may be used to include null fields in Patch requests.
  1704. NullFields []string `json:"-"`
  1705. }
  1706. func (s *GetDataSourceIndexStatsResponse) MarshalJSON() ([]byte, error) {
  1707. type NoMethod GetDataSourceIndexStatsResponse
  1708. raw := NoMethod(*s)
  1709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1710. }
  1711. // GmailActionRestrict: Gmail Action restricts (i.e.
  1712. // read/replied/snoozed).
  1713. type GmailActionRestrict struct {
  1714. // Possible values:
  1715. // "UNSPECIFIED"
  1716. // "UNREAD" - is:unread
  1717. // "READ" - is:read
  1718. // "REPLIED_TO" - label:^io_re
  1719. // "MUTED" - label:mute
  1720. Type string `json:"type,omitempty"`
  1721. // ForceSendFields is a list of field names (e.g. "Type") to
  1722. // unconditionally include in API requests. By default, fields with
  1723. // empty values are omitted from API requests. However, any non-pointer,
  1724. // non-interface field appearing in ForceSendFields will be sent to the
  1725. // server regardless of whether the field is empty or not. This may be
  1726. // used to include empty fields in Patch requests.
  1727. ForceSendFields []string `json:"-"`
  1728. // NullFields is a list of field names (e.g. "Type") to include in API
  1729. // requests with the JSON null value. By default, fields with empty
  1730. // values are omitted from API requests. However, any field with an
  1731. // empty value appearing in NullFields will be sent to the server as
  1732. // null. It is an error if a field in this list has a non-empty value.
  1733. // This may be used to include null fields in Patch requests.
  1734. NullFields []string `json:"-"`
  1735. }
  1736. func (s *GmailActionRestrict) MarshalJSON() ([]byte, error) {
  1737. type NoMethod GmailActionRestrict
  1738. raw := NoMethod(*s)
  1739. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1740. }
  1741. // GmailAttachmentRestrict: Gmail Attachment restricts (i.e.
  1742. // has:attachment, has:drive, filename:pdf).
  1743. type GmailAttachmentRestrict struct {
  1744. // Possible values:
  1745. // "UNSPECIFIED"
  1746. // "HAS_ATTACHMENT" - has:attachment
  1747. // "HAS_PHOTO" - has photos (changes to filename:(jpg OR jpeg OR png)
  1748. // when typed)
  1749. // "HAS_DRIVE" - has:drive
  1750. // "HAS_DOCUMENT" - has:document
  1751. // "HAS_SPREADSHEET" - has:spreadsheet
  1752. // "HAS_PRESENTATION" - has:presentation
  1753. // "HAS_YOUTUBE" - has:youtube
  1754. // "HAS_PDF" - filename:pdf
  1755. Type string `json:"type,omitempty"`
  1756. // ForceSendFields is a list of field names (e.g. "Type") to
  1757. // unconditionally include in API requests. By default, fields with
  1758. // empty values are omitted from API requests. However, any non-pointer,
  1759. // non-interface field appearing in ForceSendFields will be sent to the
  1760. // server regardless of whether the field is empty or not. This may be
  1761. // used to include empty fields in Patch requests.
  1762. ForceSendFields []string `json:"-"`
  1763. // NullFields is a list of field names (e.g. "Type") to include in API
  1764. // requests with the JSON null value. By default, fields with empty
  1765. // values are omitted from API requests. However, any field with an
  1766. // empty value appearing in NullFields will be sent to the server as
  1767. // null. It is an error if a field in this list has a non-empty value.
  1768. // This may be used to include null fields in Patch requests.
  1769. NullFields []string `json:"-"`
  1770. }
  1771. func (s *GmailAttachmentRestrict) MarshalJSON() ([]byte, error) {
  1772. type NoMethod GmailAttachmentRestrict
  1773. raw := NoMethod(*s)
  1774. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1775. }
  1776. // GmailFolderRestrict: Gmail Folder restricts (i.e. in
  1777. // Drafts/Sent/Chats/User Generated Labels).
  1778. type GmailFolderRestrict struct {
  1779. // Possible values:
  1780. // "UNSPECIFIED"
  1781. // "IN_SENT" - in:sent
  1782. // "IN_DRAFT" - in:draft
  1783. // "CHATS" - label:chats
  1784. // "IN_TRASH" - in:trash
  1785. // "USER_GENERATED_LABEL" - label:<user generated>
  1786. Type string `json:"type,omitempty"`
  1787. // ForceSendFields is a list of field names (e.g. "Type") to
  1788. // unconditionally include in API requests. By default, fields with
  1789. // empty values are omitted from API requests. However, any non-pointer,
  1790. // non-interface field appearing in ForceSendFields will be sent to the
  1791. // server regardless of whether the field is empty or not. This may be
  1792. // used to include empty fields in Patch requests.
  1793. ForceSendFields []string `json:"-"`
  1794. // NullFields is a list of field names (e.g. "Type") to include in API
  1795. // requests with the JSON null value. By default, fields with empty
  1796. // values are omitted from API requests. However, any field with an
  1797. // empty value appearing in NullFields will be sent to the server as
  1798. // null. It is an error if a field in this list has a non-empty value.
  1799. // This may be used to include null fields in Patch requests.
  1800. NullFields []string `json:"-"`
  1801. }
  1802. func (s *GmailFolderRestrict) MarshalJSON() ([]byte, error) {
  1803. type NoMethod GmailFolderRestrict
  1804. raw := NoMethod(*s)
  1805. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1806. }
  1807. // GmailIntelligentRestrict: Gmail Intelligent restricts (i.e.
  1808. // smartlabels, important).
  1809. type GmailIntelligentRestrict struct {
  1810. // Possible values:
  1811. // "UNSPECIFIED"
  1812. // "SOCIAL" - category:social
  1813. // "UPDATES" - category:updates
  1814. // "FORUMS" - category:forums
  1815. // "PROMOTIONS" - category:promotions
  1816. // "IMPORTANT" - is:important
  1817. // "FLIGHT_RESERVATION" - label:^cob_sm_flightreservation
  1818. // "LODGING_RESERVATION" - label:^cob_sm_lodgingreservation
  1819. // "CAR_RESERVATION" - label:^cob_sm_rentalcarreservation
  1820. // "BUS_RESERVATION" - label:^cob_sm_busreservation
  1821. Type string `json:"type,omitempty"`
  1822. // ForceSendFields is a list of field names (e.g. "Type") to
  1823. // unconditionally include in API requests. By default, fields with
  1824. // empty values are omitted from API requests. However, any non-pointer,
  1825. // non-interface field appearing in ForceSendFields will be sent to the
  1826. // server regardless of whether the field is empty or not. This may be
  1827. // used to include empty fields in Patch requests.
  1828. ForceSendFields []string `json:"-"`
  1829. // NullFields is a list of field names (e.g. "Type") to include in API
  1830. // requests with the JSON null value. By default, fields with empty
  1831. // values are omitted from API requests. However, any field with an
  1832. // empty value appearing in NullFields will be sent to the server as
  1833. // null. It is an error if a field in this list has a non-empty value.
  1834. // This may be used to include null fields in Patch requests.
  1835. NullFields []string `json:"-"`
  1836. }
  1837. func (s *GmailIntelligentRestrict) MarshalJSON() ([]byte, error) {
  1838. type NoMethod GmailIntelligentRestrict
  1839. raw := NoMethod(*s)
  1840. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1841. }
  1842. // GmailTimeRestrict: Gmail Time restricts (i.e. received today, this
  1843. // week).
  1844. type GmailTimeRestrict struct {
  1845. // Possible values:
  1846. // "UNSPECIFIED"
  1847. // "FROM_THIS_WEEK" - newer_than:7d
  1848. // "OLDER_THAN_ONE_YEAR" - older_than:1y
  1849. // "FROM_TODAY" - newer_than:1d
  1850. // "FROM_YESTERDAY" - newer_than:2d older_than:1d
  1851. // "FROM_THIS_MONTH" - newer_than:30d
  1852. // "FROM_CERTAIN_MONTH" - This will read as something like "From
  1853. // November" and will have operator
  1854. // before:X after:Y
  1855. // "OLDER_THAN_TODAY" - older_than:1d
  1856. // "OLDER_THAN_YESTERDAY" - older_than:2d
  1857. // "OLDER_THAN_A_WEEK" - older_than:7d
  1858. // "OLDER_THAN_A_MONTH" - older_than:30d
  1859. Type string `json:"type,omitempty"`
  1860. // ForceSendFields is a list of field names (e.g. "Type") to
  1861. // unconditionally include in API requests. By default, fields with
  1862. // empty values are omitted from API requests. However, any non-pointer,
  1863. // non-interface field appearing in ForceSendFields will be sent to the
  1864. // server regardless of whether the field is empty or not. This may be
  1865. // used to include empty fields in Patch requests.
  1866. ForceSendFields []string `json:"-"`
  1867. // NullFields is a list of field names (e.g. "Type") to include in API
  1868. // requests with the JSON null value. By default, fields with empty
  1869. // values are omitted from API requests. However, any field with an
  1870. // empty value appearing in NullFields will be sent to the server as
  1871. // null. It is an error if a field in this list has a non-empty value.
  1872. // This may be used to include null fields in Patch requests.
  1873. NullFields []string `json:"-"`
  1874. }
  1875. func (s *GmailTimeRestrict) MarshalJSON() ([]byte, error) {
  1876. type NoMethod GmailTimeRestrict
  1877. raw := NoMethod(*s)
  1878. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1879. }
  1880. // HtmlOperatorOptions: Used to provide a search operator for html
  1881. // properties. This is optional.
  1882. // Search operators let users restrict the query to specific fields
  1883. // relevant
  1884. // to the type of item being searched.
  1885. type HtmlOperatorOptions struct {
  1886. // OperatorName: Indicates the operator name required in the query in
  1887. // order to isolate the
  1888. // html property. For example, if operatorName is *subject* and
  1889. // the
  1890. // property's name is *subjectLine*, then queries
  1891. // like
  1892. // *subject:&lt;value&gt;* will show results only where the value of
  1893. // the
  1894. // property named *subjectLine* matches *&lt;value&gt;*. By contrast,
  1895. // a
  1896. // search that uses the same *&lt;value&gt;* without an operator will
  1897. // return
  1898. // all items where *&lt;value&gt;* matches the value of any
  1899. // html properties or text within the content field for the item.
  1900. // The operator name can only contain lowercase letters (a-z).
  1901. // The maximum length is 32 characters.
  1902. OperatorName string `json:"operatorName,omitempty"`
  1903. // ForceSendFields is a list of field names (e.g. "OperatorName") to
  1904. // unconditionally include in API requests. By default, fields with
  1905. // empty values are omitted from API requests. However, any non-pointer,
  1906. // non-interface field appearing in ForceSendFields will be sent to the
  1907. // server regardless of whether the field is empty or not. This may be
  1908. // used to include empty fields in Patch requests.
  1909. ForceSendFields []string `json:"-"`
  1910. // NullFields is a list of field names (e.g. "OperatorName") to include
  1911. // in API requests with the JSON null value. By default, fields with
  1912. // empty values are omitted from API requests. However, any field with
  1913. // an empty value appearing in NullFields will be sent to the server as
  1914. // null. It is an error if a field in this list has a non-empty value.
  1915. // This may be used to include null fields in Patch requests.
  1916. NullFields []string `json:"-"`
  1917. }
  1918. func (s *HtmlOperatorOptions) MarshalJSON() ([]byte, error) {
  1919. type NoMethod HtmlOperatorOptions
  1920. raw := NoMethod(*s)
  1921. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1922. }
  1923. // HtmlPropertyOptions: Options for html properties.
  1924. type HtmlPropertyOptions struct {
  1925. // OperatorOptions: If set, describes how the property should be used as
  1926. // a search operator.
  1927. OperatorOptions *HtmlOperatorOptions `json:"operatorOptions,omitempty"`
  1928. // RetrievalImportance: Indicates the search quality importance of the
  1929. // tokens within the
  1930. // field when used for retrieval. Can only be set to DEFAULT or NONE.
  1931. RetrievalImportance *RetrievalImportance `json:"retrievalImportance,omitempty"`
  1932. // ForceSendFields is a list of field names (e.g. "OperatorOptions") to
  1933. // unconditionally include in API requests. By default, fields with
  1934. // empty values are omitted from API requests. However, any non-pointer,
  1935. // non-interface field appearing in ForceSendFields will be sent to the
  1936. // server regardless of whether the field is empty or not. This may be
  1937. // used to include empty fields in Patch requests.
  1938. ForceSendFields []string `json:"-"`
  1939. // NullFields is a list of field names (e.g. "OperatorOptions") to
  1940. // include in API requests with the JSON null value. By default, fields
  1941. // with empty values are omitted from API requests. However, any field
  1942. // with an empty value appearing in NullFields will be sent to the
  1943. // server as null. It is an error if a field in this list has a
  1944. // non-empty value. This may be used to include null fields in Patch
  1945. // requests.
  1946. NullFields []string `json:"-"`
  1947. }
  1948. func (s *HtmlPropertyOptions) MarshalJSON() ([]byte, error) {
  1949. type NoMethod HtmlPropertyOptions
  1950. raw := NoMethod(*s)
  1951. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1952. }
  1953. // HtmlValues: List of html values.
  1954. type HtmlValues struct {
  1955. // Values: The maximum allowable length for html values is 2048
  1956. // characters.
  1957. Values []string `json:"values,omitempty"`
  1958. // ForceSendFields is a list of field names (e.g. "Values") to
  1959. // unconditionally include in API requests. By default, fields with
  1960. // empty values are omitted from API requests. However, any non-pointer,
  1961. // non-interface field appearing in ForceSendFields will be sent to the
  1962. // server regardless of whether the field is empty or not. This may be
  1963. // used to include empty fields in Patch requests.
  1964. ForceSendFields []string `json:"-"`
  1965. // NullFields is a list of field names (e.g. "Values") to include in API
  1966. // requests with the JSON null value. By default, fields with empty
  1967. // values are omitted from API requests. However, any field with an
  1968. // empty value appearing in NullFields will be sent to the server as
  1969. // null. It is an error if a field in this list has a non-empty value.
  1970. // This may be used to include null fields in Patch requests.
  1971. NullFields []string `json:"-"`
  1972. }
  1973. func (s *HtmlValues) MarshalJSON() ([]byte, error) {
  1974. type NoMethod HtmlValues
  1975. raw := NoMethod(*s)
  1976. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1977. }
  1978. type IndexItemOptions struct {
  1979. // AllowUnknownGsuitePrincipals: Specifies if the index request should
  1980. // allow gsuite principals that do not
  1981. // exist or are deleted in the index request.
  1982. AllowUnknownGsuitePrincipals bool `json:"allowUnknownGsuitePrincipals,omitempty"`
  1983. // ForceSendFields is a list of field names (e.g.
  1984. // "AllowUnknownGsuitePrincipals") to unconditionally include in API
  1985. // requests. By default, fields with empty values are omitted from API
  1986. // requests. However, any non-pointer, non-interface field appearing in
  1987. // ForceSendFields will be sent to the server regardless of whether the
  1988. // field is empty or not. This may be used to include empty fields in
  1989. // Patch requests.
  1990. ForceSendFields []string `json:"-"`
  1991. // NullFields is a list of field names (e.g.
  1992. // "AllowUnknownGsuitePrincipals") to include in API requests with the
  1993. // JSON null value. By default, fields with empty values are omitted
  1994. // from API requests. However, any field with an empty value appearing
  1995. // in NullFields will be sent to the server as null. It is an error if a
  1996. // field in this list has a non-empty value. This may be used to include
  1997. // null fields in Patch requests.
  1998. NullFields []string `json:"-"`
  1999. }
  2000. func (s *IndexItemOptions) MarshalJSON() ([]byte, error) {
  2001. type NoMethod IndexItemOptions
  2002. raw := NoMethod(*s)
  2003. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2004. }
  2005. type IndexItemRequest struct {
  2006. // ConnectorName: Name of connector making this call.
  2007. // <br />Format: datasources/{source_id}/connectors/{ID}
  2008. ConnectorName string `json:"connectorName,omitempty"`
  2009. // DebugOptions: Common debug options.
  2010. DebugOptions *DebugOptions `json:"debugOptions,omitempty"`
  2011. IndexItemOptions *IndexItemOptions `json:"indexItemOptions,omitempty"`
  2012. // Item: Name of the item.
  2013. // Format:
  2014. // datasources/{source_id}/items/{item_id}
  2015. Item *Item `json:"item,omitempty"`
  2016. // Mode: Required. The RequestMode for this request.
  2017. //
  2018. // Possible values:
  2019. // "UNSPECIFIED" - Priority is not specified in the update
  2020. // request.
  2021. // Leaving priority unspecified results in an update failure.
  2022. // "SYNCHRONOUS" - For real-time updates.
  2023. // "ASYNCHRONOUS" - For changes that are executed after the response
  2024. // is sent back to the
  2025. // caller.
  2026. Mode string `json:"mode,omitempty"`
  2027. // ForceSendFields is a list of field names (e.g. "ConnectorName") to
  2028. // unconditionally include in API requests. By default, fields with
  2029. // empty values are omitted from API requests. However, any non-pointer,
  2030. // non-interface field appearing in ForceSendFields will be sent to the
  2031. // server regardless of whether the field is empty or not. This may be
  2032. // used to include empty fields in Patch requests.
  2033. ForceSendFields []string `json:"-"`
  2034. // NullFields is a list of field names (e.g. "ConnectorName") to include
  2035. // in API requests with the JSON null value. By default, fields with
  2036. // empty values are omitted from API requests. However, any field with
  2037. // an empty value appearing in NullFields will be sent to the server as
  2038. // null. It is an error if a field in this list has a non-empty value.
  2039. // This may be used to include null fields in Patch requests.
  2040. NullFields []string `json:"-"`
  2041. }
  2042. func (s *IndexItemRequest) MarshalJSON() ([]byte, error) {
  2043. type NoMethod IndexItemRequest
  2044. raw := NoMethod(*s)
  2045. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2046. }
  2047. // IntegerOperatorOptions: Used to provide a search operator for integer
  2048. // properties. This is
  2049. // optional. Search operators let users restrict the query to specific
  2050. // fields
  2051. // relevant to the type of item being searched.
  2052. type IntegerOperatorOptions struct {
  2053. // GreaterThanOperatorName: Indicates the operator name required in the
  2054. // query in order to isolate the
  2055. // integer property using the greater-than operator. For example,
  2056. // if
  2057. // greaterThanOperatorName is *priorityabove* and the property's name
  2058. // is
  2059. // *priorityVal*, then queries like *priorityabove:&lt;value&gt;*
  2060. // will
  2061. // show results only where the value of the property named *priorityVal*
  2062. // is
  2063. // greater than *&lt;value&gt;*.
  2064. // The operator name can only contain lowercase letters (a-z).
  2065. // The maximum length is 32 characters.
  2066. GreaterThanOperatorName string `json:"greaterThanOperatorName,omitempty"`
  2067. // LessThanOperatorName: Indicates the operator name required in the
  2068. // query in order to isolate the
  2069. // integer property using the less-than operator. For example,
  2070. // if
  2071. // lessThanOperatorName is *prioritybelow* and the property's name
  2072. // is
  2073. // *priorityVal*, then queries like *prioritybelow:&lt;value&gt;*
  2074. // will
  2075. // show results only where the value of the property named *priorityVal*
  2076. // is
  2077. // less than *&lt;value&gt;*.
  2078. // The operator name can only contain lowercase letters (a-z).
  2079. // The maximum length is 32 characters.
  2080. LessThanOperatorName string `json:"lessThanOperatorName,omitempty"`
  2081. // OperatorName: Indicates the operator name required in the query in
  2082. // order to isolate the
  2083. // integer property. For example, if operatorName is *priority* and
  2084. // the
  2085. // property's name is *priorityVal*, then queries
  2086. // like
  2087. // *priority:&lt;value&gt;* will show results only where the value of
  2088. // the
  2089. // property named *priorityVal* matches *&lt;value&gt;*. By contrast,
  2090. // a
  2091. // search that uses the same *&lt;value&gt;* without an operator will
  2092. // return
  2093. // all items where *&lt;value&gt;* matches the value of any
  2094. // String
  2095. // properties or text within the content field for the item.
  2096. // The operator name can only contain lowercase letters (a-z).
  2097. // The maximum length is 32 characters.
  2098. OperatorName string `json:"operatorName,omitempty"`
  2099. // ForceSendFields is a list of field names (e.g.
  2100. // "GreaterThanOperatorName") to unconditionally include in API
  2101. // requests. By default, fields with empty values are omitted from API
  2102. // requests. However, any non-pointer, non-interface field appearing in
  2103. // ForceSendFields will be sent to the server regardless of whether the
  2104. // field is empty or not. This may be used to include empty fields in
  2105. // Patch requests.
  2106. ForceSendFields []string `json:"-"`
  2107. // NullFields is a list of field names (e.g. "GreaterThanOperatorName")
  2108. // to include in API requests with the JSON null value. By default,
  2109. // fields with empty values are omitted from API requests. However, any
  2110. // field with an empty value appearing in NullFields will be sent to the
  2111. // server as null. It is an error if a field in this list has a
  2112. // non-empty value. This may be used to include null fields in Patch
  2113. // requests.
  2114. NullFields []string `json:"-"`
  2115. }
  2116. func (s *IntegerOperatorOptions) MarshalJSON() ([]byte, error) {
  2117. type NoMethod IntegerOperatorOptions
  2118. raw := NoMethod(*s)
  2119. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2120. }
  2121. // IntegerPropertyOptions: Options for integer properties.
  2122. type IntegerPropertyOptions struct {
  2123. // MaximumValue: The maximum value of the property. The minimum and
  2124. // maximum values for the
  2125. // property are used to rank results according to the
  2126. // ordered ranking.
  2127. // Indexing requests with values greater than the maximum are accepted
  2128. // and
  2129. // ranked with the same weight as items indexed with the maximum value.
  2130. MaximumValue int64 `json:"maximumValue,omitempty,string"`
  2131. // MinimumValue: The minimum value of the property. The minimum and
  2132. // maximum values for the
  2133. // property are used to rank results according to the
  2134. // ordered ranking.
  2135. // Indexing requests with values less than the minimum are accepted
  2136. // and
  2137. // ranked with the same weight as items indexed with the minimum value.
  2138. MinimumValue int64 `json:"minimumValue,omitempty,string"`
  2139. // OperatorOptions: If set, describes how the integer should be used as
  2140. // a search operator.
  2141. OperatorOptions *IntegerOperatorOptions `json:"operatorOptions,omitempty"`
  2142. // OrderedRanking: Used to specify the ordered ranking for the integer.
  2143. // Can only be used if
  2144. // isRepeatable
  2145. // is false.
  2146. //
  2147. // Possible values:
  2148. // "NO_ORDER" - There is no ranking order for the property. Results
  2149. // will not be adjusted
  2150. // by this property's value.
  2151. // "ASCENDING" - This property is ranked in ascending order. Lower
  2152. // values indicate lower
  2153. // ranking.
  2154. // "DESCENDING" - This property is ranked in descending order. Lower
  2155. // values indicate
  2156. // higher ranking.
  2157. OrderedRanking string `json:"orderedRanking,omitempty"`
  2158. // ForceSendFields is a list of field names (e.g. "MaximumValue") to
  2159. // unconditionally include in API requests. By default, fields with
  2160. // empty values are omitted from API requests. However, any non-pointer,
  2161. // non-interface field appearing in ForceSendFields will be sent to the
  2162. // server regardless of whether the field is empty or not. This may be
  2163. // used to include empty fields in Patch requests.
  2164. ForceSendFields []string `json:"-"`
  2165. // NullFields is a list of field names (e.g. "MaximumValue") to include
  2166. // in API requests with the JSON null value. By default, fields with
  2167. // empty values are omitted from API requests. However, any field with
  2168. // an empty value appearing in NullFields will be sent to the server as
  2169. // null. It is an error if a field in this list has a non-empty value.
  2170. // This may be used to include null fields in Patch requests.
  2171. NullFields []string `json:"-"`
  2172. }
  2173. func (s *IntegerPropertyOptions) MarshalJSON() ([]byte, error) {
  2174. type NoMethod IntegerPropertyOptions
  2175. raw := NoMethod(*s)
  2176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2177. }
  2178. // IntegerValues: List of integer values.
  2179. type IntegerValues struct {
  2180. Values googleapi.Int64s `json:"values,omitempty"`
  2181. // ForceSendFields is a list of field names (e.g. "Values") to
  2182. // unconditionally include in API requests. By default, fields with
  2183. // empty values are omitted from API requests. However, any non-pointer,
  2184. // non-interface field appearing in ForceSendFields will be sent to the
  2185. // server regardless of whether the field is empty or not. This may be
  2186. // used to include empty fields in Patch requests.
  2187. ForceSendFields []string `json:"-"`
  2188. // NullFields is a list of field names (e.g. "Values") to include in API
  2189. // requests with the JSON null value. By default, fields with empty
  2190. // values are omitted from API requests. However, any field with an
  2191. // empty value appearing in NullFields will be sent to the server as
  2192. // null. It is an error if a field in this list has a non-empty value.
  2193. // This may be used to include null fields in Patch requests.
  2194. NullFields []string `json:"-"`
  2195. }
  2196. func (s *IntegerValues) MarshalJSON() ([]byte, error) {
  2197. type NoMethod IntegerValues
  2198. raw := NoMethod(*s)
  2199. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2200. }
  2201. // Interaction: Represents an interaction between a user and an item.
  2202. type Interaction struct {
  2203. // InteractionTime: The time when the user acted on the item. If
  2204. // multiple actions of the same
  2205. // type exist for a single user, only the most recent action is
  2206. // recorded.
  2207. InteractionTime string `json:"interactionTime,omitempty"`
  2208. // Principal: The user that acted on the item.
  2209. Principal *Principal `json:"principal,omitempty"`
  2210. // Possible values:
  2211. // "UNSPECIFIED" - Invalid value.
  2212. // "VIEW" - This interaction indicates the user viewed the item.
  2213. // "EDIT" - This interaction indicates the user edited the item.
  2214. Type string `json:"type,omitempty"`
  2215. // ForceSendFields is a list of field names (e.g. "InteractionTime") to
  2216. // unconditionally include in API requests. By default, fields with
  2217. // empty values are omitted from API requests. However, any non-pointer,
  2218. // non-interface field appearing in ForceSendFields will be sent to the
  2219. // server regardless of whether the field is empty or not. This may be
  2220. // used to include empty fields in Patch requests.
  2221. ForceSendFields []string `json:"-"`
  2222. // NullFields is a list of field names (e.g. "InteractionTime") to
  2223. // include in API requests with the JSON null value. By default, fields
  2224. // with empty values are omitted from API requests. However, any field
  2225. // with an empty value appearing in NullFields will be sent to the
  2226. // server as null. It is an error if a field in this list has a
  2227. // non-empty value. This may be used to include null fields in Patch
  2228. // requests.
  2229. NullFields []string `json:"-"`
  2230. }
  2231. func (s *Interaction) MarshalJSON() ([]byte, error) {
  2232. type NoMethod Interaction
  2233. raw := NoMethod(*s)
  2234. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2235. }
  2236. // Item: Represents a single object that is an item in the search index,
  2237. // such as a
  2238. // file, folder, or a database record.
  2239. type Item struct {
  2240. // Acl: Access control list for this item.
  2241. Acl *ItemAcl `json:"acl,omitempty"`
  2242. // Content: Item content to be indexed and made text searchable.
  2243. Content *ItemContent `json:"content,omitempty"`
  2244. // ItemType: Type for this item.
  2245. //
  2246. // Possible values:
  2247. // "UNSPECIFIED"
  2248. // "CONTENT_ITEM" - An item that is indexed for the only purpose of
  2249. // serving information.
  2250. // These items cannot be referred in
  2251. // containerName
  2252. // or inheritAclFrom
  2253. // fields.
  2254. // "CONTAINER_ITEM" - An item that gets indexed and whose purpose is
  2255. // to supply other items
  2256. // with ACLs and/or contain other items.
  2257. // "VIRTUAL_CONTAINER_ITEM" - An item that does not get indexed, but
  2258. // otherwise has the same purpose
  2259. // as CONTAINER_ITEM.
  2260. ItemType string `json:"itemType,omitempty"`
  2261. // Metadata: Metadata information.
  2262. Metadata *ItemMetadata `json:"metadata,omitempty"`
  2263. // Name: Name of the Item.
  2264. // Format:
  2265. // datasources/{source_id}/items/{item_id}
  2266. // <br />This is a required field.
  2267. // The maximum length is 1536 characters.
  2268. Name string `json:"name,omitempty"`
  2269. // Payload: Additional state connector can store for this item.
  2270. // The maximum length is 10000 bytes.
  2271. Payload string `json:"payload,omitempty"`
  2272. // Queue: Queue this item belongs to.
  2273. // The maximum length is 100 characters.
  2274. Queue string `json:"queue,omitempty"`
  2275. // Status: Status of the item.
  2276. // Output only field.
  2277. Status *ItemStatus `json:"status,omitempty"`
  2278. // StructuredData: The structured data for the item that should conform
  2279. // to a registered
  2280. // object definition in the schema for the data source.
  2281. StructuredData *ItemStructuredData `json:"structuredData,omitempty"`
  2282. // Version: Required. The indexing system stores the version from the
  2283. // datasource as a
  2284. // byte string and compares the Item version in the index
  2285. // to the version of the queued Item using lexical ordering.
  2286. // <br /><br />
  2287. // Cloud Search Indexing won't index or delete any queued item with
  2288. // a version value that is less than or equal to the version of
  2289. // the
  2290. // currently indexed item.
  2291. // The maximum length for this field is 1024 bytes.
  2292. Version string `json:"version,omitempty"`
  2293. // ServerResponse contains the HTTP response code and headers from the
  2294. // server.
  2295. googleapi.ServerResponse `json:"-"`
  2296. // ForceSendFields is a list of field names (e.g. "Acl") to
  2297. // unconditionally include in API requests. By default, fields with
  2298. // empty values are omitted from API requests. However, any non-pointer,
  2299. // non-interface field appearing in ForceSendFields will be sent to the
  2300. // server regardless of whether the field is empty or not. This may be
  2301. // used to include empty fields in Patch requests.
  2302. ForceSendFields []string `json:"-"`
  2303. // NullFields is a list of field names (e.g. "Acl") to include in API
  2304. // requests with the JSON null value. By default, fields with empty
  2305. // values are omitted from API requests. However, any field with an
  2306. // empty value appearing in NullFields will be sent to the server as
  2307. // null. It is an error if a field in this list has a non-empty value.
  2308. // This may be used to include null fields in Patch requests.
  2309. NullFields []string `json:"-"`
  2310. }
  2311. func (s *Item) MarshalJSON() ([]byte, error) {
  2312. type NoMethod Item
  2313. raw := NoMethod(*s)
  2314. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2315. }
  2316. // ItemAcl: Access control list information for the item. For more
  2317. // information
  2318. // see
  2319. // https://developers.google.com/cloud-search/docs/guides/index-your-
  2320. // data#acls
  2321. type ItemAcl struct {
  2322. // AclInheritanceType: Sets the type of access rules to apply when an
  2323. // item inherits its ACL from a
  2324. // parent. This should always be set in tandem with
  2325. // the
  2326. // inheritAclFrom
  2327. // field. Also, when the
  2328. // inheritAclFrom field
  2329. // is set, this field should be set to a valid AclInheritanceType.
  2330. //
  2331. // Possible values:
  2332. // "NOT_APPLICABLE" - The default value when this item does not
  2333. // inherit an ACL.
  2334. // Use NOT_APPLICABLE when
  2335. // inheritAclFrom
  2336. // is empty. An item without ACL inheritance can still have ACLs
  2337. // supplied
  2338. // by its own readers and
  2339. // deniedReaders fields.
  2340. // "CHILD_OVERRIDE" - During an authorization conflict, the ACL of the
  2341. // child item determines
  2342. // its read access.
  2343. // "PARENT_OVERRIDE" - During an authorization conflict, the ACL of
  2344. // the parent item
  2345. // specified in the
  2346. // inheritAclFrom
  2347. // field determines read access.
  2348. // "BOTH_PERMIT" - Access is granted only if this item and the parent
  2349. // item specified in
  2350. // the inheritAclFrom
  2351. // field both permit read access.
  2352. AclInheritanceType string `json:"aclInheritanceType,omitempty"`
  2353. // DeniedReaders: List of principals who are explicitly denied access to
  2354. // the item in search
  2355. // results. While principals are denied access by default, use denied
  2356. // readers
  2357. // to handle exceptions and override the list allowed readers.
  2358. // The maximum number of elements is 100.
  2359. DeniedReaders []*Principal `json:"deniedReaders,omitempty"`
  2360. // InheritAclFrom: Name of the item to inherit the Access Permission
  2361. // List (ACL) from.
  2362. // Note: ACL inheritance *only* provides access permissions
  2363. // to child items and does not define structural relationships, nor does
  2364. // it
  2365. // provide convenient ways to delete large groups of items.
  2366. // Deleting an ACL parent from the index only alters the access
  2367. // permissions of
  2368. // child items that reference the parent in the
  2369. // inheritAclFrom
  2370. // field. The item is still in the index, but may not
  2371. // visible in search results. By contrast, deletion of a container
  2372. // item
  2373. // also deletes all items that reference the container via
  2374. // the
  2375. // containerName
  2376. // field.
  2377. // The maximum length for this field is 1536 characters.
  2378. InheritAclFrom string `json:"inheritAclFrom,omitempty"`
  2379. // Owners: Optional. List of owners for the item. This field has no
  2380. // bearing on
  2381. // document access permissions. It does, however, offer
  2382. // a slight ranking boosts items where the querying user is an
  2383. // owner.
  2384. // The maximum number of elements is 5.
  2385. Owners []*Principal `json:"owners,omitempty"`
  2386. // Readers: List of principals who are allowed to see the item in search
  2387. // results.
  2388. // Optional if inheriting permissions from another item or if the
  2389. // item
  2390. // is not intended to be visible, such as
  2391. // virtual
  2392. // containers.
  2393. // The maximum number of elements is 1000.
  2394. Readers []*Principal `json:"readers,omitempty"`
  2395. // ForceSendFields is a list of field names (e.g. "AclInheritanceType")
  2396. // to unconditionally include in API requests. By default, fields with
  2397. // empty values are omitted from API requests. However, any non-pointer,
  2398. // non-interface field appearing in ForceSendFields will be sent to the
  2399. // server regardless of whether the field is empty or not. This may be
  2400. // used to include empty fields in Patch requests.
  2401. ForceSendFields []string `json:"-"`
  2402. // NullFields is a list of field names (e.g. "AclInheritanceType") to
  2403. // include in API requests with the JSON null value. By default, fields
  2404. // with empty values are omitted from API requests. However, any field
  2405. // with an empty value appearing in NullFields will be sent to the
  2406. // server as null. It is an error if a field in this list has a
  2407. // non-empty value. This may be used to include null fields in Patch
  2408. // requests.
  2409. NullFields []string `json:"-"`
  2410. }
  2411. func (s *ItemAcl) MarshalJSON() ([]byte, error) {
  2412. type NoMethod ItemAcl
  2413. raw := NoMethod(*s)
  2414. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2415. }
  2416. // ItemContent: Content of an item to be indexed and surfaced by Cloud
  2417. // Search.
  2418. type ItemContent struct {
  2419. // ContentDataRef: Upload reference ID of a previously uploaded content
  2420. // via write method.
  2421. ContentDataRef *UploadItemRef `json:"contentDataRef,omitempty"`
  2422. // Possible values:
  2423. // "UNSPECIFIED" - Invalid value.
  2424. // "HTML" - contentFormat is HTML.
  2425. // "TEXT" - contentFormat is free text.
  2426. // "RAW" - contentFormat is raw bytes.
  2427. ContentFormat string `json:"contentFormat,omitempty"`
  2428. // Hash: Hashing info calculated and provided by the API client for
  2429. // content.
  2430. // Can be used with the items.push method to calculate modified
  2431. // state.
  2432. // The maximum length is 2048 characters.
  2433. Hash string `json:"hash,omitempty"`
  2434. // InlineContent: Content that is supplied inlined within the update
  2435. // method.
  2436. // The maximum length is 102400 bytes (100 KiB).
  2437. InlineContent string `json:"inlineContent,omitempty"`
  2438. // ForceSendFields is a list of field names (e.g. "ContentDataRef") to
  2439. // unconditionally include in API requests. By default, fields with
  2440. // empty values are omitted from API requests. However, any non-pointer,
  2441. // non-interface field appearing in ForceSendFields will be sent to the
  2442. // server regardless of whether the field is empty or not. This may be
  2443. // used to include empty fields in Patch requests.
  2444. ForceSendFields []string `json:"-"`
  2445. // NullFields is a list of field names (e.g. "ContentDataRef") to
  2446. // include in API requests with the JSON null value. By default, fields
  2447. // with empty values are omitted from API requests. However, any field
  2448. // with an empty value appearing in NullFields will be sent to the
  2449. // server as null. It is an error if a field in this list has a
  2450. // non-empty value. This may be used to include null fields in Patch
  2451. // requests.
  2452. NullFields []string `json:"-"`
  2453. }
  2454. func (s *ItemContent) MarshalJSON() ([]byte, error) {
  2455. type NoMethod ItemContent
  2456. raw := NoMethod(*s)
  2457. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2458. }
  2459. type ItemCountByStatus struct {
  2460. // Count: Number of items matching the status code.
  2461. Count int64 `json:"count,omitempty,string"`
  2462. // StatusCode: Status of the items.
  2463. //
  2464. // Possible values:
  2465. // "CODE_UNSPECIFIED" - Input-only value. Used with
  2466. // Items.list
  2467. // to list all items in the queue, regardless of status.
  2468. // "ERROR" - Error encountered by Cloud Search while processing this
  2469. // item.
  2470. // Details of the error are in
  2471. // repositoryError.
  2472. // "MODIFIED" - Item has been modified in the repository, and is out
  2473. // of date with
  2474. // the version previously accepted into Cloud Search.
  2475. // "NEW_ITEM" - Item is known to exist in the repository, but is not
  2476. // yet accepted by
  2477. // Cloud Search.
  2478. // An item can be in this state when
  2479. // Items.push
  2480. // has been called for
  2481. // an item of this name that did not exist previously.
  2482. // "ACCEPTED" - API has accepted the up-to-date data of this item.
  2483. StatusCode string `json:"statusCode,omitempty"`
  2484. // ForceSendFields is a list of field names (e.g. "Count") to
  2485. // unconditionally include in API requests. By default, fields with
  2486. // empty values are omitted from API requests. However, any non-pointer,
  2487. // non-interface field appearing in ForceSendFields will be sent to the
  2488. // server regardless of whether the field is empty or not. This may be
  2489. // used to include empty fields in Patch requests.
  2490. ForceSendFields []string `json:"-"`
  2491. // NullFields is a list of field names (e.g. "Count") to include in API
  2492. // requests with the JSON null value. By default, fields with empty
  2493. // values are omitted from API requests. However, any field with an
  2494. // empty value appearing in NullFields will be sent to the server as
  2495. // null. It is an error if a field in this list has a non-empty value.
  2496. // This may be used to include null fields in Patch requests.
  2497. NullFields []string `json:"-"`
  2498. }
  2499. func (s *ItemCountByStatus) MarshalJSON() ([]byte, error) {
  2500. type NoMethod ItemCountByStatus
  2501. raw := NoMethod(*s)
  2502. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2503. }
  2504. // ItemMetadata: Available metadata fields for the item.
  2505. type ItemMetadata struct {
  2506. // ContainerName: The name of the container for this item.
  2507. // Deletion of the container item leads to automatic deletion of
  2508. // this
  2509. // item. Note: ACLs are not inherited from a container item.
  2510. // To provide ACL inheritance for an item, use the
  2511. // inheritAclFrom
  2512. // field. The maximum length is 1536 characters.
  2513. ContainerName string `json:"containerName,omitempty"`
  2514. // ContentLanguage: The BCP-47 language code for the item, such as
  2515. // "en-US" or "sr-Latn". For
  2516. // more information,
  2517. // see
  2518. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  2519. // Th
  2520. // e maximum length is 32 characters.
  2521. ContentLanguage string `json:"contentLanguage,omitempty"`
  2522. // CreateTime: The time when the item was created in the source
  2523. // repository.
  2524. CreateTime string `json:"createTime,omitempty"`
  2525. // Hash: Hashing value provided by the API caller.
  2526. // This can be used with the
  2527. // items.push
  2528. // method to calculate modified state.
  2529. // The maximum length is 2048 characters.
  2530. Hash string `json:"hash,omitempty"`
  2531. // Interactions: A list of interactions for the item. Interactions are
  2532. // used to improve
  2533. // Search quality, but are not exposed to end users.
  2534. // The maximum number of elements is 1000.
  2535. Interactions []*Interaction `json:"interactions,omitempty"`
  2536. // Keywords: Additional keywords or phrases that should match the
  2537. // item.
  2538. // Used internally for user generated content.
  2539. // The maximum number of elements is 100.
  2540. // The maximum length is 8192 characters.
  2541. Keywords []string `json:"keywords,omitempty"`
  2542. // MimeType: The original mime-type of
  2543. // ItemContent.content
  2544. // in the source repository.
  2545. // The maximum length is 256 characters.
  2546. MimeType string `json:"mimeType,omitempty"`
  2547. // ObjectType: The type of the item. This should correspond to the name
  2548. // of an object
  2549. // definition in the schema registered for the data source. For
  2550. // example, if
  2551. // the schema for the data source contains an object definition with
  2552. // name
  2553. // 'document', then item indexing requests for objects of that type
  2554. // should set
  2555. // objectType to 'document'.
  2556. // The maximum length is 256 characters.
  2557. ObjectType string `json:"objectType,omitempty"`
  2558. // SearchQualityMetadata: Additional search quality metadata of the item
  2559. SearchQualityMetadata *SearchQualityMetadata `json:"searchQualityMetadata,omitempty"`
  2560. // SourceRepositoryUrl: Link to the source repository serving the data.
  2561. // &#83;earch results apply
  2562. // this link to the title.
  2563. // The maximum length is 2048 characters.
  2564. SourceRepositoryUrl string `json:"sourceRepositoryUrl,omitempty"`
  2565. // Title: The title of the item. If given, this will be the displayed
  2566. // title of the
  2567. // Search result.
  2568. // The maximum length is 2048 characters.
  2569. Title string `json:"title,omitempty"`
  2570. // UpdateTime: The time when the item was last modified in the source
  2571. // repository.
  2572. UpdateTime string `json:"updateTime,omitempty"`
  2573. // ForceSendFields is a list of field names (e.g. "ContainerName") to
  2574. // unconditionally include in API requests. By default, fields with
  2575. // empty values are omitted from API requests. However, any non-pointer,
  2576. // non-interface field appearing in ForceSendFields will be sent to the
  2577. // server regardless of whether the field is empty or not. This may be
  2578. // used to include empty fields in Patch requests.
  2579. ForceSendFields []string `json:"-"`
  2580. // NullFields is a list of field names (e.g. "ContainerName") to include
  2581. // in API requests with the JSON null value. By default, fields with
  2582. // empty values are omitted from API requests. However, any field with
  2583. // an empty value appearing in NullFields will be sent to the server as
  2584. // null. It is an error if a field in this list has a non-empty value.
  2585. // This may be used to include null fields in Patch requests.
  2586. NullFields []string `json:"-"`
  2587. }
  2588. func (s *ItemMetadata) MarshalJSON() ([]byte, error) {
  2589. type NoMethod ItemMetadata
  2590. raw := NoMethod(*s)
  2591. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2592. }
  2593. // ItemStatus: This contains item's status and any errors.
  2594. type ItemStatus struct {
  2595. // Code: Status code.
  2596. //
  2597. // Possible values:
  2598. // "CODE_UNSPECIFIED" - Input-only value. Used with
  2599. // Items.list
  2600. // to list all items in the queue, regardless of status.
  2601. // "ERROR" - Error encountered by Cloud Search while processing this
  2602. // item.
  2603. // Details of the error are in
  2604. // repositoryError.
  2605. // "MODIFIED" - Item has been modified in the repository, and is out
  2606. // of date with
  2607. // the version previously accepted into Cloud Search.
  2608. // "NEW_ITEM" - Item is known to exist in the repository, but is not
  2609. // yet accepted by
  2610. // Cloud Search.
  2611. // An item can be in this state when
  2612. // Items.push
  2613. // has been called for
  2614. // an item of this name that did not exist previously.
  2615. // "ACCEPTED" - API has accepted the up-to-date data of this item.
  2616. Code string `json:"code,omitempty"`
  2617. // ProcessingErrors: Error details in case the item is in ERROR state.
  2618. ProcessingErrors []*ProcessingError `json:"processingErrors,omitempty"`
  2619. // RepositoryErrors: Repository error reported by connector.
  2620. RepositoryErrors []*RepositoryError `json:"repositoryErrors,omitempty"`
  2621. // ForceSendFields is a list of field names (e.g. "Code") to
  2622. // unconditionally include in API requests. By default, fields with
  2623. // empty values are omitted from API requests. However, any non-pointer,
  2624. // non-interface field appearing in ForceSendFields will be sent to the
  2625. // server regardless of whether the field is empty or not. This may be
  2626. // used to include empty fields in Patch requests.
  2627. ForceSendFields []string `json:"-"`
  2628. // NullFields is a list of field names (e.g. "Code") to include in API
  2629. // requests with the JSON null value. By default, fields with empty
  2630. // values are omitted from API requests. However, any field with an
  2631. // empty value appearing in NullFields will be sent to the server as
  2632. // null. It is an error if a field in this list has a non-empty value.
  2633. // This may be used to include null fields in Patch requests.
  2634. NullFields []string `json:"-"`
  2635. }
  2636. func (s *ItemStatus) MarshalJSON() ([]byte, error) {
  2637. type NoMethod ItemStatus
  2638. raw := NoMethod(*s)
  2639. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2640. }
  2641. // ItemStructuredData: Available structured data fields for the item.
  2642. type ItemStructuredData struct {
  2643. // Hash: Hashing value provided by the API caller.
  2644. // This can be used with the
  2645. // items.push
  2646. // method to calculate modified state.
  2647. // The maximum length is 2048 characters.
  2648. Hash string `json:"hash,omitempty"`
  2649. // Object: The structured data object that should conform to a
  2650. // registered object
  2651. // definition in the schema for the data source.
  2652. Object *StructuredDataObject `json:"object,omitempty"`
  2653. // ForceSendFields is a list of field names (e.g. "Hash") to
  2654. // unconditionally include in API requests. By default, fields with
  2655. // empty values are omitted from API requests. However, any non-pointer,
  2656. // non-interface field appearing in ForceSendFields will be sent to the
  2657. // server regardless of whether the field is empty or not. This may be
  2658. // used to include empty fields in Patch requests.
  2659. ForceSendFields []string `json:"-"`
  2660. // NullFields is a list of field names (e.g. "Hash") to include in API
  2661. // requests with the JSON null value. By default, fields with empty
  2662. // values are omitted from API requests. However, any field with an
  2663. // empty value appearing in NullFields will be sent to the server as
  2664. // null. It is an error if a field in this list has a non-empty value.
  2665. // This may be used to include null fields in Patch requests.
  2666. NullFields []string `json:"-"`
  2667. }
  2668. func (s *ItemStructuredData) MarshalJSON() ([]byte, error) {
  2669. type NoMethod ItemStructuredData
  2670. raw := NoMethod(*s)
  2671. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2672. }
  2673. type ListDataSourceResponse struct {
  2674. // NextPageToken: Token to retrieve the next page of results, or empty
  2675. // if there are no
  2676. // more results in the list.
  2677. NextPageToken string `json:"nextPageToken,omitempty"`
  2678. Sources []*DataSource `json:"sources,omitempty"`
  2679. // ServerResponse contains the HTTP response code and headers from the
  2680. // server.
  2681. googleapi.ServerResponse `json:"-"`
  2682. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2683. // unconditionally include in API requests. By default, fields with
  2684. // empty values are omitted from API requests. However, any non-pointer,
  2685. // non-interface field appearing in ForceSendFields will be sent to the
  2686. // server regardless of whether the field is empty or not. This may be
  2687. // used to include empty fields in Patch requests.
  2688. ForceSendFields []string `json:"-"`
  2689. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2690. // in API requests with the JSON null value. By default, fields with
  2691. // empty values are omitted from API requests. However, any field with
  2692. // an empty value appearing in NullFields will be sent to the server as
  2693. // null. It is an error if a field in this list has a non-empty value.
  2694. // This may be used to include null fields in Patch requests.
  2695. NullFields []string `json:"-"`
  2696. }
  2697. func (s *ListDataSourceResponse) MarshalJSON() ([]byte, error) {
  2698. type NoMethod ListDataSourceResponse
  2699. raw := NoMethod(*s)
  2700. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2701. }
  2702. type ListItemNamesForUnmappedIdentityResponse struct {
  2703. ItemNames []string `json:"itemNames,omitempty"`
  2704. // NextPageToken: Token to retrieve the next page of results, or empty
  2705. // if there are no
  2706. // more results in the list.
  2707. NextPageToken string `json:"nextPageToken,omitempty"`
  2708. // ServerResponse contains the HTTP response code and headers from the
  2709. // server.
  2710. googleapi.ServerResponse `json:"-"`
  2711. // ForceSendFields is a list of field names (e.g. "ItemNames") to
  2712. // unconditionally include in API requests. By default, fields with
  2713. // empty values are omitted from API requests. However, any non-pointer,
  2714. // non-interface field appearing in ForceSendFields will be sent to the
  2715. // server regardless of whether the field is empty or not. This may be
  2716. // used to include empty fields in Patch requests.
  2717. ForceSendFields []string `json:"-"`
  2718. // NullFields is a list of field names (e.g. "ItemNames") to include in
  2719. // API requests with the JSON null value. By default, fields with empty
  2720. // values are omitted from API requests. However, any field with an
  2721. // empty value appearing in NullFields will be sent to the server as
  2722. // null. It is an error if a field in this list has a non-empty value.
  2723. // This may be used to include null fields in Patch requests.
  2724. NullFields []string `json:"-"`
  2725. }
  2726. func (s *ListItemNamesForUnmappedIdentityResponse) MarshalJSON() ([]byte, error) {
  2727. type NoMethod ListItemNamesForUnmappedIdentityResponse
  2728. raw := NoMethod(*s)
  2729. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2730. }
  2731. type ListItemsResponse struct {
  2732. Items []*Item `json:"items,omitempty"`
  2733. // NextPageToken: Token to retrieve the next page of results, or empty
  2734. // if there are no
  2735. // more results in the list.
  2736. NextPageToken string `json:"nextPageToken,omitempty"`
  2737. // ServerResponse contains the HTTP response code and headers from the
  2738. // server.
  2739. googleapi.ServerResponse `json:"-"`
  2740. // ForceSendFields is a list of field names (e.g. "Items") to
  2741. // unconditionally include in API requests. By default, fields with
  2742. // empty values are omitted from API requests. However, any non-pointer,
  2743. // non-interface field appearing in ForceSendFields will be sent to the
  2744. // server regardless of whether the field is empty or not. This may be
  2745. // used to include empty fields in Patch requests.
  2746. ForceSendFields []string `json:"-"`
  2747. // NullFields is a list of field names (e.g. "Items") to include in API
  2748. // requests with the JSON null value. By default, fields with empty
  2749. // values are omitted from API requests. However, any field with an
  2750. // empty value appearing in NullFields will be sent to the server as
  2751. // null. It is an error if a field in this list has a non-empty value.
  2752. // This may be used to include null fields in Patch requests.
  2753. NullFields []string `json:"-"`
  2754. }
  2755. func (s *ListItemsResponse) MarshalJSON() ([]byte, error) {
  2756. type NoMethod ListItemsResponse
  2757. raw := NoMethod(*s)
  2758. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2759. }
  2760. // ListQuerySourcesResponse: List sources response.
  2761. type ListQuerySourcesResponse struct {
  2762. NextPageToken string `json:"nextPageToken,omitempty"`
  2763. Sources []*QuerySource `json:"sources,omitempty"`
  2764. // ServerResponse contains the HTTP response code and headers from the
  2765. // server.
  2766. googleapi.ServerResponse `json:"-"`
  2767. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2768. // unconditionally include in API requests. By default, fields with
  2769. // empty values are omitted from API requests. However, any non-pointer,
  2770. // non-interface field appearing in ForceSendFields will be sent to the
  2771. // server regardless of whether the field is empty or not. This may be
  2772. // used to include empty fields in Patch requests.
  2773. ForceSendFields []string `json:"-"`
  2774. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2775. // in API requests with the JSON null value. By default, fields with
  2776. // empty values are omitted from API requests. However, any field with
  2777. // an empty value appearing in NullFields will be sent to the server as
  2778. // null. It is an error if a field in this list has a non-empty value.
  2779. // This may be used to include null fields in Patch requests.
  2780. NullFields []string `json:"-"`
  2781. }
  2782. func (s *ListQuerySourcesResponse) MarshalJSON() ([]byte, error) {
  2783. type NoMethod ListQuerySourcesResponse
  2784. raw := NoMethod(*s)
  2785. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2786. }
  2787. type ListSearchApplicationsResponse struct {
  2788. // NextPageToken: Token to retrieve the next page of results, or empty
  2789. // if there are no
  2790. // more results in the list.
  2791. NextPageToken string `json:"nextPageToken,omitempty"`
  2792. SearchApplications []*SearchApplication `json:"searchApplications,omitempty"`
  2793. // ServerResponse contains the HTTP response code and headers from the
  2794. // server.
  2795. googleapi.ServerResponse `json:"-"`
  2796. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2797. // unconditionally include in API requests. By default, fields with
  2798. // empty values are omitted from API requests. However, any non-pointer,
  2799. // non-interface field appearing in ForceSendFields will be sent to the
  2800. // server regardless of whether the field is empty or not. This may be
  2801. // used to include empty fields in Patch requests.
  2802. ForceSendFields []string `json:"-"`
  2803. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2804. // in API requests with the JSON null value. By default, fields with
  2805. // empty values are omitted from API requests. However, any field with
  2806. // an empty value appearing in NullFields will be sent to the server as
  2807. // null. It is an error if a field in this list has a non-empty value.
  2808. // This may be used to include null fields in Patch requests.
  2809. NullFields []string `json:"-"`
  2810. }
  2811. func (s *ListSearchApplicationsResponse) MarshalJSON() ([]byte, error) {
  2812. type NoMethod ListSearchApplicationsResponse
  2813. raw := NoMethod(*s)
  2814. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2815. }
  2816. type ListUnmappedIdentitiesResponse struct {
  2817. // NextPageToken: Token to retrieve the next page of results, or empty
  2818. // if there are no
  2819. // more results in the list.
  2820. NextPageToken string `json:"nextPageToken,omitempty"`
  2821. UnmappedIdentities []*UnmappedIdentity `json:"unmappedIdentities,omitempty"`
  2822. // ServerResponse contains the HTTP response code and headers from the
  2823. // server.
  2824. googleapi.ServerResponse `json:"-"`
  2825. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  2826. // unconditionally include in API requests. By default, fields with
  2827. // empty values are omitted from API requests. However, any non-pointer,
  2828. // non-interface field appearing in ForceSendFields will be sent to the
  2829. // server regardless of whether the field is empty or not. This may be
  2830. // used to include empty fields in Patch requests.
  2831. ForceSendFields []string `json:"-"`
  2832. // NullFields is a list of field names (e.g. "NextPageToken") to include
  2833. // in API requests with the JSON null value. By default, fields with
  2834. // empty values are omitted from API requests. However, any field with
  2835. // an empty value appearing in NullFields will be sent to the server as
  2836. // null. It is an error if a field in this list has a non-empty value.
  2837. // This may be used to include null fields in Patch requests.
  2838. NullFields []string `json:"-"`
  2839. }
  2840. func (s *ListUnmappedIdentitiesResponse) MarshalJSON() ([]byte, error) {
  2841. type NoMethod ListUnmappedIdentitiesResponse
  2842. raw := NoMethod(*s)
  2843. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2844. }
  2845. // MatchRange: Matched range of a snippet [start, end).
  2846. type MatchRange struct {
  2847. // End: End of the match in the snippet.
  2848. End int64 `json:"end,omitempty"`
  2849. // Start: Starting position of the match in the snippet.
  2850. Start int64 `json:"start,omitempty"`
  2851. // ForceSendFields is a list of field names (e.g. "End") to
  2852. // unconditionally include in API requests. By default, fields with
  2853. // empty values are omitted from API requests. However, any non-pointer,
  2854. // non-interface field appearing in ForceSendFields will be sent to the
  2855. // server regardless of whether the field is empty or not. This may be
  2856. // used to include empty fields in Patch requests.
  2857. ForceSendFields []string `json:"-"`
  2858. // NullFields is a list of field names (e.g. "End") to include in API
  2859. // requests with the JSON null value. By default, fields with empty
  2860. // values are omitted from API requests. However, any field with an
  2861. // empty value appearing in NullFields will be sent to the server as
  2862. // null. It is an error if a field in this list has a non-empty value.
  2863. // This may be used to include null fields in Patch requests.
  2864. NullFields []string `json:"-"`
  2865. }
  2866. func (s *MatchRange) MarshalJSON() ([]byte, error) {
  2867. type NoMethod MatchRange
  2868. raw := NoMethod(*s)
  2869. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2870. }
  2871. // Media: Media resource.
  2872. type Media struct {
  2873. // ResourceName: Name of the media resource.
  2874. ResourceName string `json:"resourceName,omitempty"`
  2875. // ServerResponse contains the HTTP response code and headers from the
  2876. // server.
  2877. googleapi.ServerResponse `json:"-"`
  2878. // ForceSendFields is a list of field names (e.g. "ResourceName") to
  2879. // unconditionally include in API requests. By default, fields with
  2880. // empty values are omitted from API requests. However, any non-pointer,
  2881. // non-interface field appearing in ForceSendFields will be sent to the
  2882. // server regardless of whether the field is empty or not. This may be
  2883. // used to include empty fields in Patch requests.
  2884. ForceSendFields []string `json:"-"`
  2885. // NullFields is a list of field names (e.g. "ResourceName") to include
  2886. // in API requests with the JSON null value. By default, fields with
  2887. // empty values are omitted from API requests. However, any field with
  2888. // an empty value appearing in NullFields will be sent to the server as
  2889. // null. It is an error if a field in this list has a non-empty value.
  2890. // This may be used to include null fields in Patch requests.
  2891. NullFields []string `json:"-"`
  2892. }
  2893. func (s *Media) MarshalJSON() ([]byte, error) {
  2894. type NoMethod Media
  2895. raw := NoMethod(*s)
  2896. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2897. }
  2898. // Metadata: Metadata of a matched search result.
  2899. type Metadata struct {
  2900. // CreateTime: The creation time for this document or object in the
  2901. // search result.
  2902. CreateTime string `json:"createTime,omitempty"`
  2903. // DisplayOptions: Options that specify how to display a structured data
  2904. // search result.
  2905. DisplayOptions *ResultDisplayMetadata `json:"displayOptions,omitempty"`
  2906. // Fields: Indexed fields in structured data, returned as a generic
  2907. // named property.
  2908. Fields []*NamedProperty `json:"fields,omitempty"`
  2909. // MimeType: Mime type of the search result.
  2910. MimeType string `json:"mimeType,omitempty"`
  2911. // ObjectType: Object type of the search result.
  2912. ObjectType string `json:"objectType,omitempty"`
  2913. // Owner: Owner (usually creator) of the document or object of the
  2914. // search result.
  2915. Owner *Person `json:"owner,omitempty"`
  2916. // Source: The named source for the result, such as Gmail.
  2917. Source *Source `json:"source,omitempty"`
  2918. // UpdateTime: The last modified date for the object in the search
  2919. // result. If not
  2920. // set in the item, the value returned here is empty. When
  2921. // `updateTime` is used for calculating freshness and is not set,
  2922. // this
  2923. // value defaults to 2 years from the current time.
  2924. UpdateTime string `json:"updateTime,omitempty"`
  2925. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  2926. // unconditionally include in API requests. By default, fields with
  2927. // empty values are omitted from API requests. However, any non-pointer,
  2928. // non-interface field appearing in ForceSendFields will be sent to the
  2929. // server regardless of whether the field is empty or not. This may be
  2930. // used to include empty fields in Patch requests.
  2931. ForceSendFields []string `json:"-"`
  2932. // NullFields is a list of field names (e.g. "CreateTime") to include in
  2933. // API requests with the JSON null value. By default, fields with empty
  2934. // values are omitted from API requests. However, any field with an
  2935. // empty value appearing in NullFields will be sent to the server as
  2936. // null. It is an error if a field in this list has a non-empty value.
  2937. // This may be used to include null fields in Patch requests.
  2938. NullFields []string `json:"-"`
  2939. }
  2940. func (s *Metadata) MarshalJSON() ([]byte, error) {
  2941. type NoMethod Metadata
  2942. raw := NoMethod(*s)
  2943. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2944. }
  2945. // Metaline: A metaline is a list of properties that are displayed along
  2946. // with the search
  2947. // result to provide context.
  2948. type Metaline struct {
  2949. // Properties: The list of displayed properties for the metaline.
  2950. Properties []*DisplayedProperty `json:"properties,omitempty"`
  2951. // ForceSendFields is a list of field names (e.g. "Properties") to
  2952. // unconditionally include in API requests. By default, fields with
  2953. // empty values are omitted from API requests. However, any non-pointer,
  2954. // non-interface field appearing in ForceSendFields will be sent to the
  2955. // server regardless of whether the field is empty or not. This may be
  2956. // used to include empty fields in Patch requests.
  2957. ForceSendFields []string `json:"-"`
  2958. // NullFields is a list of field names (e.g. "Properties") to include in
  2959. // API requests with the JSON null value. By default, fields with empty
  2960. // values are omitted from API requests. However, any field with an
  2961. // empty value appearing in NullFields will be sent to the server as
  2962. // null. It is an error if a field in this list has a non-empty value.
  2963. // This may be used to include null fields in Patch requests.
  2964. NullFields []string `json:"-"`
  2965. }
  2966. func (s *Metaline) MarshalJSON() ([]byte, error) {
  2967. type NoMethod Metaline
  2968. raw := NoMethod(*s)
  2969. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2970. }
  2971. // Name: A person's name.
  2972. type Name struct {
  2973. // DisplayName: The read-only display name formatted according to the
  2974. // locale specified by
  2975. // the viewer's account or the <code>Accept-Language</code> HTTP header.
  2976. DisplayName string `json:"displayName,omitempty"`
  2977. // ForceSendFields is a list of field names (e.g. "DisplayName") to
  2978. // unconditionally include in API requests. By default, fields with
  2979. // empty values are omitted from API requests. However, any non-pointer,
  2980. // non-interface field appearing in ForceSendFields will be sent to the
  2981. // server regardless of whether the field is empty or not. This may be
  2982. // used to include empty fields in Patch requests.
  2983. ForceSendFields []string `json:"-"`
  2984. // NullFields is a list of field names (e.g. "DisplayName") to include
  2985. // in API requests with the JSON null value. By default, fields with
  2986. // empty values are omitted from API requests. However, any field with
  2987. // an empty value appearing in NullFields will be sent to the server as
  2988. // null. It is an error if a field in this list has a non-empty value.
  2989. // This may be used to include null fields in Patch requests.
  2990. NullFields []string `json:"-"`
  2991. }
  2992. func (s *Name) MarshalJSON() ([]byte, error) {
  2993. type NoMethod Name
  2994. raw := NoMethod(*s)
  2995. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2996. }
  2997. // NamedProperty: A typed name-value pair for structured data. The type
  2998. // of the value should
  2999. // be the same as the registered type for the `name` property in the
  3000. // object
  3001. // definition of `objectType`.
  3002. type NamedProperty struct {
  3003. BooleanValue bool `json:"booleanValue,omitempty"`
  3004. DateValues *DateValues `json:"dateValues,omitempty"`
  3005. DoubleValues *DoubleValues `json:"doubleValues,omitempty"`
  3006. EnumValues *EnumValues `json:"enumValues,omitempty"`
  3007. HtmlValues *HtmlValues `json:"htmlValues,omitempty"`
  3008. IntegerValues *IntegerValues `json:"integerValues,omitempty"`
  3009. // Name: The name of the property. This name should correspond to the
  3010. // name of the
  3011. // property that was registered for object definition in the schema.
  3012. // The maximum allowable length for this property is 256 characters.
  3013. Name string `json:"name,omitempty"`
  3014. ObjectValues *ObjectValues `json:"objectValues,omitempty"`
  3015. TextValues *TextValues `json:"textValues,omitempty"`
  3016. TimestampValues *TimestampValues `json:"timestampValues,omitempty"`
  3017. // ForceSendFields is a list of field names (e.g. "BooleanValue") to
  3018. // unconditionally include in API requests. By default, fields with
  3019. // empty values are omitted from API requests. However, any non-pointer,
  3020. // non-interface field appearing in ForceSendFields will be sent to the
  3021. // server regardless of whether the field is empty or not. This may be
  3022. // used to include empty fields in Patch requests.
  3023. ForceSendFields []string `json:"-"`
  3024. // NullFields is a list of field names (e.g. "BooleanValue") to include
  3025. // in API requests with the JSON null value. By default, fields with
  3026. // empty values are omitted from API requests. However, any field with
  3027. // an empty value appearing in NullFields will be sent to the server as
  3028. // null. It is an error if a field in this list has a non-empty value.
  3029. // This may be used to include null fields in Patch requests.
  3030. NullFields []string `json:"-"`
  3031. }
  3032. func (s *NamedProperty) MarshalJSON() ([]byte, error) {
  3033. type NoMethod NamedProperty
  3034. raw := NoMethod(*s)
  3035. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3036. }
  3037. // ObjectDefinition: The definition for an object within a data source.
  3038. type ObjectDefinition struct {
  3039. // Name: Name for the object, which then defines its type. Item indexing
  3040. // requests
  3041. // should set the
  3042. // objectType field
  3043. // equal to this value. For example, if *name* is *Document*, then
  3044. // indexing
  3045. // requests for items of type Document should set
  3046. // objectType equal to
  3047. // *Document*. Each object definition must be uniquely named within a
  3048. // schema.
  3049. // The name must start with a letter and can only contain letters (A-Z,
  3050. // a-z)
  3051. // or numbers (0-9).
  3052. // The maximum length is 256 characters.
  3053. Name string `json:"name,omitempty"`
  3054. // Options: The optional object-specific options.
  3055. Options *ObjectOptions `json:"options,omitempty"`
  3056. // PropertyDefinitions: The property definitions for the object.
  3057. // The maximum number of elements is 1000.
  3058. PropertyDefinitions []*PropertyDefinition `json:"propertyDefinitions,omitempty"`
  3059. // ForceSendFields is a list of field names (e.g. "Name") to
  3060. // unconditionally include in API requests. By default, fields with
  3061. // empty values are omitted from API requests. However, any non-pointer,
  3062. // non-interface field appearing in ForceSendFields will be sent to the
  3063. // server regardless of whether the field is empty or not. This may be
  3064. // used to include empty fields in Patch requests.
  3065. ForceSendFields []string `json:"-"`
  3066. // NullFields is a list of field names (e.g. "Name") to include in API
  3067. // requests with the JSON null value. By default, fields with empty
  3068. // values are omitted from API requests. However, any field with an
  3069. // empty value appearing in NullFields will be sent to the server as
  3070. // null. It is an error if a field in this list has a non-empty value.
  3071. // This may be used to include null fields in Patch requests.
  3072. NullFields []string `json:"-"`
  3073. }
  3074. func (s *ObjectDefinition) MarshalJSON() ([]byte, error) {
  3075. type NoMethod ObjectDefinition
  3076. raw := NoMethod(*s)
  3077. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3078. }
  3079. // ObjectDisplayOptions: The display options for an object.
  3080. type ObjectDisplayOptions struct {
  3081. // Metalines: Defines the properties that will be displayed in the
  3082. // metalines of the
  3083. // search results. The property values will be displayed in the order
  3084. // given
  3085. // here. If a property holds multiple values, all of the values will
  3086. // be
  3087. // diplayed before the next properties. For this reason, it is a good
  3088. // practice
  3089. // to specify singular properties before repeated properties in this
  3090. // list. All
  3091. // of the properties must set
  3092. // is_returnable
  3093. // to true. The maximum number of elements is 3.
  3094. Metalines []*Metaline `json:"metalines,omitempty"`
  3095. // ObjectDisplayLabel: The user friendly label to display in the search
  3096. // result to inidicate the
  3097. // type of the item. This is OPTIONAL; if not given, an object label
  3098. // will not
  3099. // be displayed on the context line of the search results. The maximum
  3100. // length
  3101. // is 32 characters.
  3102. ObjectDisplayLabel string `json:"objectDisplayLabel,omitempty"`
  3103. // ForceSendFields is a list of field names (e.g. "Metalines") to
  3104. // unconditionally include in API requests. By default, fields with
  3105. // empty values are omitted from API requests. However, any non-pointer,
  3106. // non-interface field appearing in ForceSendFields will be sent to the
  3107. // server regardless of whether the field is empty or not. This may be
  3108. // used to include empty fields in Patch requests.
  3109. ForceSendFields []string `json:"-"`
  3110. // NullFields is a list of field names (e.g. "Metalines") to include in
  3111. // API requests with the JSON null value. By default, fields with empty
  3112. // values are omitted from API requests. However, any field with an
  3113. // empty value appearing in NullFields will be sent to the server as
  3114. // null. It is an error if a field in this list has a non-empty value.
  3115. // This may be used to include null fields in Patch requests.
  3116. NullFields []string `json:"-"`
  3117. }
  3118. func (s *ObjectDisplayOptions) MarshalJSON() ([]byte, error) {
  3119. type NoMethod ObjectDisplayOptions
  3120. raw := NoMethod(*s)
  3121. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3122. }
  3123. // ObjectOptions: The options for an object.
  3124. type ObjectOptions struct {
  3125. // DisplayOptions: Options that determine how the object is displayed in
  3126. // the Cloud Search
  3127. // results page.
  3128. DisplayOptions *ObjectDisplayOptions `json:"displayOptions,omitempty"`
  3129. // FreshnessOptions: The freshness options for an object.
  3130. FreshnessOptions *FreshnessOptions `json:"freshnessOptions,omitempty"`
  3131. // ForceSendFields is a list of field names (e.g. "DisplayOptions") to
  3132. // unconditionally include in API requests. By default, fields with
  3133. // empty values are omitted from API requests. However, any non-pointer,
  3134. // non-interface field appearing in ForceSendFields will be sent to the
  3135. // server regardless of whether the field is empty or not. This may be
  3136. // used to include empty fields in Patch requests.
  3137. ForceSendFields []string `json:"-"`
  3138. // NullFields is a list of field names (e.g. "DisplayOptions") to
  3139. // include in API requests with the JSON null value. By default, fields
  3140. // with empty values are omitted from API requests. However, any field
  3141. // with an empty value appearing in NullFields will be sent to the
  3142. // server as null. It is an error if a field in this list has a
  3143. // non-empty value. This may be used to include null fields in Patch
  3144. // requests.
  3145. NullFields []string `json:"-"`
  3146. }
  3147. func (s *ObjectOptions) MarshalJSON() ([]byte, error) {
  3148. type NoMethod ObjectOptions
  3149. raw := NoMethod(*s)
  3150. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3151. }
  3152. // ObjectPropertyOptions: Options for object properties.
  3153. type ObjectPropertyOptions struct {
  3154. // SubobjectProperties: The properties of the sub-object. These
  3155. // properties represent a nested
  3156. // object. For example, if this property represents a postal address,
  3157. // the
  3158. // subobjectProperties might be named *street*, *city*, and *state*.
  3159. // The maximum number of elements is 1000.
  3160. SubobjectProperties []*PropertyDefinition `json:"subobjectProperties,omitempty"`
  3161. // ForceSendFields is a list of field names (e.g. "SubobjectProperties")
  3162. // to unconditionally include in API requests. By default, fields with
  3163. // empty values are omitted from API requests. However, any non-pointer,
  3164. // non-interface field appearing in ForceSendFields will be sent to the
  3165. // server regardless of whether the field is empty or not. This may be
  3166. // used to include empty fields in Patch requests.
  3167. ForceSendFields []string `json:"-"`
  3168. // NullFields is a list of field names (e.g. "SubobjectProperties") to
  3169. // include in API requests with the JSON null value. By default, fields
  3170. // with empty values are omitted from API requests. However, any field
  3171. // with an empty value appearing in NullFields will be sent to the
  3172. // server as null. It is an error if a field in this list has a
  3173. // non-empty value. This may be used to include null fields in Patch
  3174. // requests.
  3175. NullFields []string `json:"-"`
  3176. }
  3177. func (s *ObjectPropertyOptions) MarshalJSON() ([]byte, error) {
  3178. type NoMethod ObjectPropertyOptions
  3179. raw := NoMethod(*s)
  3180. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3181. }
  3182. // ObjectValues: List of object values.
  3183. type ObjectValues struct {
  3184. Values []*StructuredDataObject `json:"values,omitempty"`
  3185. // ForceSendFields is a list of field names (e.g. "Values") to
  3186. // unconditionally include in API requests. By default, fields with
  3187. // empty values are omitted from API requests. However, any non-pointer,
  3188. // non-interface field appearing in ForceSendFields will be sent to the
  3189. // server regardless of whether the field is empty or not. This may be
  3190. // used to include empty fields in Patch requests.
  3191. ForceSendFields []string `json:"-"`
  3192. // NullFields is a list of field names (e.g. "Values") to include in API
  3193. // requests with the JSON null value. By default, fields with empty
  3194. // values are omitted from API requests. However, any field with an
  3195. // empty value appearing in NullFields will be sent to the server as
  3196. // null. It is an error if a field in this list has a non-empty value.
  3197. // This may be used to include null fields in Patch requests.
  3198. NullFields []string `json:"-"`
  3199. }
  3200. func (s *ObjectValues) MarshalJSON() ([]byte, error) {
  3201. type NoMethod ObjectValues
  3202. raw := NoMethod(*s)
  3203. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3204. }
  3205. // Operation: This resource represents a long-running operation that is
  3206. // the result of a
  3207. // network API call.
  3208. type Operation struct {
  3209. // Done: If the value is `false`, it means the operation is still in
  3210. // progress.
  3211. // If `true`, the operation is completed, and either `error` or
  3212. // `response` is
  3213. // available.
  3214. Done bool `json:"done,omitempty"`
  3215. // Error: The error result of the operation in case of failure or
  3216. // cancellation.
  3217. Error *Status `json:"error,omitempty"`
  3218. // Metadata: Service-specific metadata associated with the operation.
  3219. // It typically
  3220. // contains progress information and common metadata such as create
  3221. // time.
  3222. // Some services might not provide such metadata. Any method that
  3223. // returns a
  3224. // long-running operation should document the metadata type, if any.
  3225. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  3226. // Name: The server-assigned name, which is only unique within the same
  3227. // service that
  3228. // originally returns it. If you use the default HTTP mapping,
  3229. // the
  3230. // `name` should have the format of `operations/some/unique/name`.
  3231. Name string `json:"name,omitempty"`
  3232. // Response: The normal response of the operation in case of success.
  3233. // If the original
  3234. // method returns no data on success, such as `Delete`, the response
  3235. // is
  3236. // `google.protobuf.Empty`. If the original method is
  3237. // standard
  3238. // `Get`/`Create`/`Update`, the response should be the resource. For
  3239. // other
  3240. // methods, the response should have the type `XxxResponse`, where
  3241. // `Xxx`
  3242. // is the original method name. For example, if the original method
  3243. // name
  3244. // is `TakeSnapshot()`, the inferred response type
  3245. // is
  3246. // `TakeSnapshotResponse`.
  3247. Response googleapi.RawMessage `json:"response,omitempty"`
  3248. // ServerResponse contains the HTTP response code and headers from the
  3249. // server.
  3250. googleapi.ServerResponse `json:"-"`
  3251. // ForceSendFields is a list of field names (e.g. "Done") to
  3252. // unconditionally include in API requests. By default, fields with
  3253. // empty values are omitted from API requests. However, any non-pointer,
  3254. // non-interface field appearing in ForceSendFields will be sent to the
  3255. // server regardless of whether the field is empty or not. This may be
  3256. // used to include empty fields in Patch requests.
  3257. ForceSendFields []string `json:"-"`
  3258. // NullFields is a list of field names (e.g. "Done") to include in API
  3259. // requests with the JSON null value. By default, fields with empty
  3260. // values are omitted from API requests. However, any field with an
  3261. // empty value appearing in NullFields will be sent to the server as
  3262. // null. It is an error if a field in this list has a non-empty value.
  3263. // This may be used to include null fields in Patch requests.
  3264. NullFields []string `json:"-"`
  3265. }
  3266. func (s *Operation) MarshalJSON() ([]byte, error) {
  3267. type NoMethod Operation
  3268. raw := NoMethod(*s)
  3269. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3270. }
  3271. // PeopleSuggestion: A people suggestion.
  3272. type PeopleSuggestion struct {
  3273. // Person: Suggested person. All fields of the person object might not
  3274. // be populated.
  3275. Person *Person `json:"person,omitempty"`
  3276. // ForceSendFields is a list of field names (e.g. "Person") to
  3277. // unconditionally include in API requests. By default, fields with
  3278. // empty values are omitted from API requests. However, any non-pointer,
  3279. // non-interface field appearing in ForceSendFields will be sent to the
  3280. // server regardless of whether the field is empty or not. This may be
  3281. // used to include empty fields in Patch requests.
  3282. ForceSendFields []string `json:"-"`
  3283. // NullFields is a list of field names (e.g. "Person") to include in API
  3284. // requests with the JSON null value. By default, fields with empty
  3285. // values are omitted from API requests. However, any field with an
  3286. // empty value appearing in NullFields will be sent to the server as
  3287. // null. It is an error if a field in this list has a non-empty value.
  3288. // This may be used to include null fields in Patch requests.
  3289. NullFields []string `json:"-"`
  3290. }
  3291. func (s *PeopleSuggestion) MarshalJSON() ([]byte, error) {
  3292. type NoMethod PeopleSuggestion
  3293. raw := NoMethod(*s)
  3294. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3295. }
  3296. // Person: Object to represent a person.
  3297. type Person struct {
  3298. // EmailAddresses: The person's email addresses
  3299. EmailAddresses []*EmailAddress `json:"emailAddresses,omitempty"`
  3300. // Name: The resource name of the person to provide information
  3301. // about.
  3302. // See <a
  3303. // href="https://developers.google.com/people/api/rest/v1/people/get">
  3304. // Pe
  3305. // ople.get</a> from Google People API.
  3306. Name string `json:"name,omitempty"`
  3307. // ObfuscatedId: Obfuscated ID of a person.
  3308. ObfuscatedId string `json:"obfuscatedId,omitempty"`
  3309. // PersonNames: The person's name
  3310. PersonNames []*Name `json:"personNames,omitempty"`
  3311. // Photos: A person's read-only photo. A picture shown next to the
  3312. // person's name to
  3313. // help others recognize the person in search results.
  3314. Photos []*Photo `json:"photos,omitempty"`
  3315. // ForceSendFields is a list of field names (e.g. "EmailAddresses") to
  3316. // unconditionally include in API requests. By default, fields with
  3317. // empty values are omitted from API requests. However, any non-pointer,
  3318. // non-interface field appearing in ForceSendFields will be sent to the
  3319. // server regardless of whether the field is empty or not. This may be
  3320. // used to include empty fields in Patch requests.
  3321. ForceSendFields []string `json:"-"`
  3322. // NullFields is a list of field names (e.g. "EmailAddresses") to
  3323. // include in API requests with the JSON null value. By default, fields
  3324. // with empty values are omitted from API requests. However, any field
  3325. // with an empty value appearing in NullFields will be sent to the
  3326. // server as null. It is an error if a field in this list has a
  3327. // non-empty value. This may be used to include null fields in Patch
  3328. // requests.
  3329. NullFields []string `json:"-"`
  3330. }
  3331. func (s *Person) MarshalJSON() ([]byte, error) {
  3332. type NoMethod Person
  3333. raw := NoMethod(*s)
  3334. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3335. }
  3336. // Photo: A person's photo.
  3337. type Photo struct {
  3338. // Url: The URL of the photo.
  3339. Url string `json:"url,omitempty"`
  3340. // ForceSendFields is a list of field names (e.g. "Url") to
  3341. // unconditionally include in API requests. By default, fields with
  3342. // empty values are omitted from API requests. However, any non-pointer,
  3343. // non-interface field appearing in ForceSendFields will be sent to the
  3344. // server regardless of whether the field is empty or not. This may be
  3345. // used to include empty fields in Patch requests.
  3346. ForceSendFields []string `json:"-"`
  3347. // NullFields is a list of field names (e.g. "Url") to include in API
  3348. // requests with the JSON null value. By default, fields with empty
  3349. // values are omitted from API requests. However, any field with an
  3350. // empty value appearing in NullFields will be sent to the server as
  3351. // null. It is an error if a field in this list has a non-empty value.
  3352. // This may be used to include null fields in Patch requests.
  3353. NullFields []string `json:"-"`
  3354. }
  3355. func (s *Photo) MarshalJSON() ([]byte, error) {
  3356. type NoMethod Photo
  3357. raw := NoMethod(*s)
  3358. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3359. }
  3360. type PollItemsRequest struct {
  3361. // ConnectorName: Name of connector making this call.
  3362. // <br />Format: datasources/{source_id}/connectors/{ID}
  3363. ConnectorName string `json:"connectorName,omitempty"`
  3364. // DebugOptions: Common debug options.
  3365. DebugOptions *DebugOptions `json:"debugOptions,omitempty"`
  3366. // Limit: Maximum number of items to return.
  3367. // <br />The maximum and the default value is 1000
  3368. Limit int64 `json:"limit,omitempty"`
  3369. // Queue: Queue name to fetch items from. If unspecified, PollItems
  3370. // will
  3371. // fetch from 'default' queue.
  3372. // The maximum length is 100 characters.
  3373. Queue string `json:"queue,omitempty"`
  3374. // StatusCodes: Limit the items polled to the ones with these statuses.
  3375. //
  3376. // Possible values:
  3377. // "CODE_UNSPECIFIED" - Input-only value. Used with
  3378. // Items.list
  3379. // to list all items in the queue, regardless of status.
  3380. // "ERROR" - Error encountered by Cloud Search while processing this
  3381. // item.
  3382. // Details of the error are in
  3383. // repositoryError.
  3384. // "MODIFIED" - Item has been modified in the repository, and is out
  3385. // of date with
  3386. // the version previously accepted into Cloud Search.
  3387. // "NEW_ITEM" - Item is known to exist in the repository, but is not
  3388. // yet accepted by
  3389. // Cloud Search.
  3390. // An item can be in this state when
  3391. // Items.push
  3392. // has been called for
  3393. // an item of this name that did not exist previously.
  3394. // "ACCEPTED" - API has accepted the up-to-date data of this item.
  3395. StatusCodes []string `json:"statusCodes,omitempty"`
  3396. // ForceSendFields is a list of field names (e.g. "ConnectorName") to
  3397. // unconditionally include in API requests. By default, fields with
  3398. // empty values are omitted from API requests. However, any non-pointer,
  3399. // non-interface field appearing in ForceSendFields will be sent to the
  3400. // server regardless of whether the field is empty or not. This may be
  3401. // used to include empty fields in Patch requests.
  3402. ForceSendFields []string `json:"-"`
  3403. // NullFields is a list of field names (e.g. "ConnectorName") to include
  3404. // in API requests with the JSON null value. By default, fields with
  3405. // empty values are omitted from API requests. However, any field with
  3406. // an empty value appearing in NullFields will be sent to the server as
  3407. // null. It is an error if a field in this list has a non-empty value.
  3408. // This may be used to include null fields in Patch requests.
  3409. NullFields []string `json:"-"`
  3410. }
  3411. func (s *PollItemsRequest) MarshalJSON() ([]byte, error) {
  3412. type NoMethod PollItemsRequest
  3413. raw := NoMethod(*s)
  3414. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3415. }
  3416. type PollItemsResponse struct {
  3417. // Items: Set of items from the queue available for connector to
  3418. // process.
  3419. // <br />These items have the following subset of fields populated: <br
  3420. // />
  3421. // <br />version
  3422. // <br />metadata.hash
  3423. // <br />structured_data.hash
  3424. // <br />content.hash
  3425. // <br />payload
  3426. // <br />status
  3427. // <br />queue
  3428. Items []*Item `json:"items,omitempty"`
  3429. // ServerResponse contains the HTTP response code and headers from the
  3430. // server.
  3431. googleapi.ServerResponse `json:"-"`
  3432. // ForceSendFields is a list of field names (e.g. "Items") to
  3433. // unconditionally include in API requests. By default, fields with
  3434. // empty values are omitted from API requests. However, any non-pointer,
  3435. // non-interface field appearing in ForceSendFields will be sent to the
  3436. // server regardless of whether the field is empty or not. This may be
  3437. // used to include empty fields in Patch requests.
  3438. ForceSendFields []string `json:"-"`
  3439. // NullFields is a list of field names (e.g. "Items") to include in API
  3440. // requests with the JSON null value. By default, fields with empty
  3441. // values are omitted from API requests. However, any field with an
  3442. // empty value appearing in NullFields will be sent to the server as
  3443. // null. It is an error if a field in this list has a non-empty value.
  3444. // This may be used to include null fields in Patch requests.
  3445. NullFields []string `json:"-"`
  3446. }
  3447. func (s *PollItemsResponse) MarshalJSON() ([]byte, error) {
  3448. type NoMethod PollItemsResponse
  3449. raw := NoMethod(*s)
  3450. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3451. }
  3452. // Principal: Reference to a user, group, or domain.
  3453. type Principal struct {
  3454. // GroupResourceName: This principal is a group identified using an
  3455. // external identity.
  3456. // The name field must specify the group resource name with this
  3457. // format:
  3458. // identitysources/{source_id}/groups/{ID}
  3459. GroupResourceName string `json:"groupResourceName,omitempty"`
  3460. // GsuitePrincipal: This principal is a GSuite user, group or domain.
  3461. GsuitePrincipal *GSuitePrincipal `json:"gsuitePrincipal,omitempty"`
  3462. // UserResourceName: This principal is a user identified using an
  3463. // external identity.
  3464. // The name field must specify the user resource name with this
  3465. // format:
  3466. // identitysources/{source_id}/users/{ID}
  3467. UserResourceName string `json:"userResourceName,omitempty"`
  3468. // ForceSendFields is a list of field names (e.g. "GroupResourceName")
  3469. // to unconditionally include in API requests. By default, fields with
  3470. // empty values are omitted from API requests. However, any non-pointer,
  3471. // non-interface field appearing in ForceSendFields will be sent to the
  3472. // server regardless of whether the field is empty or not. This may be
  3473. // used to include empty fields in Patch requests.
  3474. ForceSendFields []string `json:"-"`
  3475. // NullFields is a list of field names (e.g. "GroupResourceName") to
  3476. // include in API requests with the JSON null value. By default, fields
  3477. // with empty values are omitted from API requests. However, any field
  3478. // with an empty value appearing in NullFields will be sent to the
  3479. // server as null. It is an error if a field in this list has a
  3480. // non-empty value. This may be used to include null fields in Patch
  3481. // requests.
  3482. NullFields []string `json:"-"`
  3483. }
  3484. func (s *Principal) MarshalJSON() ([]byte, error) {
  3485. type NoMethod Principal
  3486. raw := NoMethod(*s)
  3487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3488. }
  3489. type ProcessingError struct {
  3490. // Code: Error code indicating the nature of the error.
  3491. //
  3492. // Possible values:
  3493. // "PROCESSING_ERROR_CODE_UNSPECIFIED" - Input only value. Use this
  3494. // value in Items.
  3495. // "MALFORMED_REQUEST" - Item's ACL, metadata, or content is malformed
  3496. // or in invalid state.
  3497. // FieldViolations contains more details on where the problem is.
  3498. // "UNSUPPORTED_CONTENT_FORMAT" - Countent format is unsupported.
  3499. // "INDIRECT_BROKEN_ACL" - Items with incomplete ACL information due
  3500. // to inheriting other
  3501. // items with broken ACL or having groups with unmapped descendants.
  3502. // "ACL_CYCLE" - ACL inheritance graph formed a cycle.
  3503. Code string `json:"code,omitempty"`
  3504. // ErrorMessage: Description of the error.
  3505. ErrorMessage string `json:"errorMessage,omitempty"`
  3506. // FieldViolations: In case the item fields are invalid, this field
  3507. // contains the details
  3508. // about the validation errors.
  3509. FieldViolations []*FieldViolation `json:"fieldViolations,omitempty"`
  3510. // ForceSendFields is a list of field names (e.g. "Code") to
  3511. // unconditionally include in API requests. By default, fields with
  3512. // empty values are omitted from API requests. However, any non-pointer,
  3513. // non-interface field appearing in ForceSendFields will be sent to the
  3514. // server regardless of whether the field is empty or not. This may be
  3515. // used to include empty fields in Patch requests.
  3516. ForceSendFields []string `json:"-"`
  3517. // NullFields is a list of field names (e.g. "Code") to include in API
  3518. // requests with the JSON null value. By default, fields with empty
  3519. // values are omitted from API requests. However, any field with an
  3520. // empty value appearing in NullFields will be sent to the server as
  3521. // null. It is an error if a field in this list has a non-empty value.
  3522. // This may be used to include null fields in Patch requests.
  3523. NullFields []string `json:"-"`
  3524. }
  3525. func (s *ProcessingError) MarshalJSON() ([]byte, error) {
  3526. type NoMethod ProcessingError
  3527. raw := NoMethod(*s)
  3528. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3529. }
  3530. // PropertyDefinition: The definition of a property within an object.
  3531. type PropertyDefinition struct {
  3532. BooleanPropertyOptions *BooleanPropertyOptions `json:"booleanPropertyOptions,omitempty"`
  3533. DatePropertyOptions *DatePropertyOptions `json:"datePropertyOptions,omitempty"`
  3534. // DisplayOptions: Options that determine how the property is displayed
  3535. // in the Cloud Search
  3536. // results page if it is specified to be displayed in the
  3537. // object's
  3538. // display options
  3539. // .
  3540. DisplayOptions *PropertyDisplayOptions `json:"displayOptions,omitempty"`
  3541. DoublePropertyOptions *DoublePropertyOptions `json:"doublePropertyOptions,omitempty"`
  3542. EnumPropertyOptions *EnumPropertyOptions `json:"enumPropertyOptions,omitempty"`
  3543. HtmlPropertyOptions *HtmlPropertyOptions `json:"htmlPropertyOptions,omitempty"`
  3544. IntegerPropertyOptions *IntegerPropertyOptions `json:"integerPropertyOptions,omitempty"`
  3545. // IsFacetable: Indicates that the property can be used for generating
  3546. // facets. Cannot be
  3547. // true for properties whose type is object. IsReturnable must be true
  3548. // to set
  3549. // this option.
  3550. // Only supported for Boolean, Enum, and Text properties.
  3551. IsFacetable bool `json:"isFacetable,omitempty"`
  3552. // IsRepeatable: Indicates that multiple values are allowed for the
  3553. // property. For example, a
  3554. // document only has one description but can have multiple comments.
  3555. // Cannot be
  3556. // true for properties whose type is a boolean.
  3557. // If set to false, properties that contain more than one value will
  3558. // cause the
  3559. // indexing request for that item to be rejected.
  3560. IsRepeatable bool `json:"isRepeatable,omitempty"`
  3561. // IsReturnable: Indicates that the property identifies data that should
  3562. // be returned in
  3563. // search results via the Query API. If set to *true*, indicates that
  3564. // Query
  3565. // API users can use matching property fields in results. However,
  3566. // storing
  3567. // fields requires more space allocation and uses more bandwidth for
  3568. // search
  3569. // queries, which impacts performance over large datasets. Set to *true*
  3570. // here
  3571. // only if the field is needed for search results. Cannot be true
  3572. // for
  3573. // properties whose type is an object.
  3574. IsReturnable bool `json:"isReturnable,omitempty"`
  3575. // IsSortable: Indicates that the property can be used for sorting.
  3576. // Cannot be true for
  3577. // properties that are repeatable. Cannot be true for properties whose
  3578. // type
  3579. // is object or user identifier. IsReturnable must be true to set this
  3580. // option.
  3581. // Only supported for Boolean, Date, Double, Integer, and
  3582. // Timestamp
  3583. // properties.
  3584. IsSortable bool `json:"isSortable,omitempty"`
  3585. // Name: The name of the property. Item indexing requests sent to the
  3586. // Indexing API
  3587. // should set the property name
  3588. // equal to this value. For example, if name is *subject_line*, then
  3589. // indexing
  3590. // requests for document items with subject fields should set the
  3591. // name for that field equal to
  3592. // *subject_line*. Use the name as the identifier for the object
  3593. // property.
  3594. // Once registered as a property for an object, you cannot re-use this
  3595. // name
  3596. // for another property within that object.
  3597. // The name must start with a letter and can only contain letters (A-Z,
  3598. // a-z)
  3599. // or numbers (0-9).
  3600. // The maximum length is 256 characters.
  3601. Name string `json:"name,omitempty"`
  3602. ObjectPropertyOptions *ObjectPropertyOptions `json:"objectPropertyOptions,omitempty"`
  3603. TextPropertyOptions *TextPropertyOptions `json:"textPropertyOptions,omitempty"`
  3604. TimestampPropertyOptions *TimestampPropertyOptions `json:"timestampPropertyOptions,omitempty"`
  3605. // ForceSendFields is a list of field names (e.g.
  3606. // "BooleanPropertyOptions") to unconditionally include in API requests.
  3607. // By default, fields with empty values are omitted from API requests.
  3608. // However, any non-pointer, non-interface field appearing in
  3609. // ForceSendFields will be sent to the server regardless of whether the
  3610. // field is empty or not. This may be used to include empty fields in
  3611. // Patch requests.
  3612. ForceSendFields []string `json:"-"`
  3613. // NullFields is a list of field names (e.g. "BooleanPropertyOptions")
  3614. // to include in API requests with the JSON null value. By default,
  3615. // fields with empty values are omitted from API requests. However, any
  3616. // field with an empty value appearing in NullFields will be sent to the
  3617. // server as null. It is an error if a field in this list has a
  3618. // non-empty value. This may be used to include null fields in Patch
  3619. // requests.
  3620. NullFields []string `json:"-"`
  3621. }
  3622. func (s *PropertyDefinition) MarshalJSON() ([]byte, error) {
  3623. type NoMethod PropertyDefinition
  3624. raw := NoMethod(*s)
  3625. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3626. }
  3627. // PropertyDisplayOptions: The display options for a property.
  3628. type PropertyDisplayOptions struct {
  3629. // DisplayLabel: The user friendly label for the property that will be
  3630. // used if the property
  3631. // is specified to be displayed in ObjectDisplayOptions. If given, the
  3632. // display
  3633. // label will be shown in front of the property values when the property
  3634. // is
  3635. // part of the object display options. For example, if the property
  3636. // value is
  3637. // '1', the value by itself may not be useful context for the user. If
  3638. // the
  3639. // display name given was 'priority', then the user will see 'priority :
  3640. // 1' in
  3641. // the search results which provides clear conext to search users. This
  3642. // is
  3643. // OPTIONAL; if not given, only the property values will be
  3644. // displayed.
  3645. // The maximum length is 32 characters.
  3646. DisplayLabel string `json:"displayLabel,omitempty"`
  3647. // ForceSendFields is a list of field names (e.g. "DisplayLabel") to
  3648. // unconditionally include in API requests. By default, fields with
  3649. // empty values are omitted from API requests. However, any non-pointer,
  3650. // non-interface field appearing in ForceSendFields will be sent to the
  3651. // server regardless of whether the field is empty or not. This may be
  3652. // used to include empty fields in Patch requests.
  3653. ForceSendFields []string `json:"-"`
  3654. // NullFields is a list of field names (e.g. "DisplayLabel") to include
  3655. // in API requests with the JSON null value. By default, fields with
  3656. // empty values are omitted from API requests. However, any field with
  3657. // an empty value appearing in NullFields will be sent to the server as
  3658. // null. It is an error if a field in this list has a non-empty value.
  3659. // This may be used to include null fields in Patch requests.
  3660. NullFields []string `json:"-"`
  3661. }
  3662. func (s *PropertyDisplayOptions) MarshalJSON() ([]byte, error) {
  3663. type NoMethod PropertyDisplayOptions
  3664. raw := NoMethod(*s)
  3665. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3666. }
  3667. // PushItem: Represents an item to be pushed to the indexing queue.
  3668. type PushItem struct {
  3669. // ContentHash: Content hash of the item according to the repository. If
  3670. // specified, this is
  3671. // used to determine how to modify this
  3672. // item's status. Setting this field and the
  3673. // type field results in argument
  3674. // error.
  3675. // The maximum length is 2048 characters.
  3676. ContentHash string `json:"contentHash,omitempty"`
  3677. // MetadataHash: Metadata hash of the item according to the repository.
  3678. // If specified, this
  3679. // is used to determine how to modify this
  3680. // item's status. Setting this field and the
  3681. // type field results in argument
  3682. // error.
  3683. // The maximum length is 2048 characters.
  3684. MetadataHash string `json:"metadataHash,omitempty"`
  3685. // Payload: Provides additional document state information for the
  3686. // connector,
  3687. // such as an alternate repository ID and other metadata.
  3688. // The maximum length is 8192 bytes.
  3689. Payload string `json:"payload,omitempty"`
  3690. // Queue: Queue to which this item belongs to. The <code>default</code>
  3691. // queue is
  3692. // chosen if this field is not specified. The maximum length is
  3693. // 512 characters.
  3694. Queue string `json:"queue,omitempty"`
  3695. // RepositoryError: Populate this field to store Connector or repository
  3696. // error details.
  3697. // This information is displayed in the Admin Console.
  3698. // This field may only be populated when the
  3699. // Type is
  3700. // REPOSITORY_ERROR.
  3701. RepositoryError *RepositoryError `json:"repositoryError,omitempty"`
  3702. // StructuredDataHash: Structured data hash of the item according to the
  3703. // repository. If specified,
  3704. // this is used to determine how to modify this item's status. Setting
  3705. // this
  3706. // field and the type field
  3707. // results in argument error.
  3708. // The maximum length is 2048 characters.
  3709. StructuredDataHash string `json:"structuredDataHash,omitempty"`
  3710. // Type: The type of the push operation that defines the push behavior.
  3711. //
  3712. // Possible values:
  3713. // "UNSPECIFIED" - Default UNSPECIFIED. Specifies that the push
  3714. // operation should not modify
  3715. // ItemStatus
  3716. // "MODIFIED" - Indicates that the repository document has been
  3717. // modified or updated since
  3718. // the previous
  3719. // update
  3720. // call. This changes status to
  3721. // MODIFIED state for
  3722. // an existing item. If this is called on a non existing item, the
  3723. // status is
  3724. // changed to
  3725. // NEW_ITEM.
  3726. // "NOT_MODIFIED" - Item in the repository has not been modified since
  3727. // the last update
  3728. // call. This push operation will set status to
  3729. // ACCEPTED state.
  3730. // "REPOSITORY_ERROR" - Connector is facing a repository error
  3731. // regarding this item. Change
  3732. // status to
  3733. // REPOSITORY_ERROR
  3734. // state. Item is unreserved and rescheduled at a future time determined
  3735. // by
  3736. // exponential backoff.
  3737. // "REQUEUE" - Call push with REQUEUE only for items that have been
  3738. // reserved.
  3739. // This action unreserves the item and resets its available time to
  3740. // the
  3741. // wall clock time.
  3742. Type string `json:"type,omitempty"`
  3743. // ForceSendFields is a list of field names (e.g. "ContentHash") to
  3744. // unconditionally include in API requests. By default, fields with
  3745. // empty values are omitted from API requests. However, any non-pointer,
  3746. // non-interface field appearing in ForceSendFields will be sent to the
  3747. // server regardless of whether the field is empty or not. This may be
  3748. // used to include empty fields in Patch requests.
  3749. ForceSendFields []string `json:"-"`
  3750. // NullFields is a list of field names (e.g. "ContentHash") to include
  3751. // in API requests with the JSON null value. By default, fields with
  3752. // empty values are omitted from API requests. However, any field with
  3753. // an empty value appearing in NullFields will be sent to the server as
  3754. // null. It is an error if a field in this list has a non-empty value.
  3755. // This may be used to include null fields in Patch requests.
  3756. NullFields []string `json:"-"`
  3757. }
  3758. func (s *PushItem) MarshalJSON() ([]byte, error) {
  3759. type NoMethod PushItem
  3760. raw := NoMethod(*s)
  3761. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3762. }
  3763. type PushItemRequest struct {
  3764. // ConnectorName: Name of connector making this call.
  3765. // <br />Format: datasources/{source_id}/connectors/{ID}
  3766. ConnectorName string `json:"connectorName,omitempty"`
  3767. // DebugOptions: Common debug options.
  3768. DebugOptions *DebugOptions `json:"debugOptions,omitempty"`
  3769. // Item: Item to push onto the queue.
  3770. Item *PushItem `json:"item,omitempty"`
  3771. // ForceSendFields is a list of field names (e.g. "ConnectorName") to
  3772. // unconditionally include in API requests. By default, fields with
  3773. // empty values are omitted from API requests. However, any non-pointer,
  3774. // non-interface field appearing in ForceSendFields will be sent to the
  3775. // server regardless of whether the field is empty or not. This may be
  3776. // used to include empty fields in Patch requests.
  3777. ForceSendFields []string `json:"-"`
  3778. // NullFields is a list of field names (e.g. "ConnectorName") to include
  3779. // in API requests with the JSON null value. By default, fields with
  3780. // empty values are omitted from API requests. However, any field with
  3781. // an empty value appearing in NullFields will be sent to the server as
  3782. // null. It is an error if a field in this list has a non-empty value.
  3783. // This may be used to include null fields in Patch requests.
  3784. NullFields []string `json:"-"`
  3785. }
  3786. func (s *PushItemRequest) MarshalJSON() ([]byte, error) {
  3787. type NoMethod PushItemRequest
  3788. raw := NoMethod(*s)
  3789. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3790. }
  3791. type QueryInterpretation struct {
  3792. // Possible values:
  3793. // "NONE" - No natural language interpretation or the natural language
  3794. // interpretation
  3795. // is not used to fetch the search results.
  3796. // "BLEND" - The natural language results is mixed with results from
  3797. // original query.
  3798. // "REPLACE" - The results only contain natural language results.
  3799. InterpretationType string `json:"interpretationType,omitempty"`
  3800. // InterpretedQuery: The interpretation of the query used in search. For
  3801. // example, query "email
  3802. // from john" will be interpreted as "from:john source:mail"
  3803. InterpretedQuery string `json:"interpretedQuery,omitempty"`
  3804. // ForceSendFields is a list of field names (e.g. "InterpretationType")
  3805. // to unconditionally include in API requests. By default, fields with
  3806. // empty values are omitted from API requests. However, any non-pointer,
  3807. // non-interface field appearing in ForceSendFields will be sent to the
  3808. // server regardless of whether the field is empty or not. This may be
  3809. // used to include empty fields in Patch requests.
  3810. ForceSendFields []string `json:"-"`
  3811. // NullFields is a list of field names (e.g. "InterpretationType") to
  3812. // include in API requests with the JSON null value. By default, fields
  3813. // with empty values are omitted from API requests. However, any field
  3814. // with an empty value appearing in NullFields will be sent to the
  3815. // server as null. It is an error if a field in this list has a
  3816. // non-empty value. This may be used to include null fields in Patch
  3817. // requests.
  3818. NullFields []string `json:"-"`
  3819. }
  3820. func (s *QueryInterpretation) MarshalJSON() ([]byte, error) {
  3821. type NoMethod QueryInterpretation
  3822. raw := NoMethod(*s)
  3823. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3824. }
  3825. // QueryInterpretationOptions: Options to interpret user query.
  3826. type QueryInterpretationOptions struct {
  3827. // DisableNlInterpretation: Flag to disable natural language (NL)
  3828. // interpretation of queries. Default is
  3829. // false, Set to true to disable natural language interpretation.
  3830. // NL
  3831. // interpretation only applies to predefined datasources.
  3832. DisableNlInterpretation bool `json:"disableNlInterpretation,omitempty"`
  3833. // ForceSendFields is a list of field names (e.g.
  3834. // "DisableNlInterpretation") to unconditionally include in API
  3835. // requests. By default, fields with empty values are omitted from API
  3836. // requests. However, any non-pointer, non-interface field appearing in
  3837. // ForceSendFields will be sent to the server regardless of whether the
  3838. // field is empty or not. This may be used to include empty fields in
  3839. // Patch requests.
  3840. ForceSendFields []string `json:"-"`
  3841. // NullFields is a list of field names (e.g. "DisableNlInterpretation")
  3842. // to include in API requests with the JSON null value. By default,
  3843. // fields with empty values are omitted from API requests. However, any
  3844. // field with an empty value appearing in NullFields will be sent to the
  3845. // server as null. It is an error if a field in this list has a
  3846. // non-empty value. This may be used to include null fields in Patch
  3847. // requests.
  3848. NullFields []string `json:"-"`
  3849. }
  3850. func (s *QueryInterpretationOptions) MarshalJSON() ([]byte, error) {
  3851. type NoMethod QueryInterpretationOptions
  3852. raw := NoMethod(*s)
  3853. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3854. }
  3855. // QueryItem: Information relevant only to a query entry.
  3856. type QueryItem struct {
  3857. // IsSynthetic: True if the text was generated by means other than a
  3858. // previous user search.
  3859. IsSynthetic bool `json:"isSynthetic,omitempty"`
  3860. // ForceSendFields is a list of field names (e.g. "IsSynthetic") to
  3861. // unconditionally include in API requests. By default, fields with
  3862. // empty values are omitted from API requests. However, any non-pointer,
  3863. // non-interface field appearing in ForceSendFields will be sent to the
  3864. // server regardless of whether the field is empty or not. This may be
  3865. // used to include empty fields in Patch requests.
  3866. ForceSendFields []string `json:"-"`
  3867. // NullFields is a list of field names (e.g. "IsSynthetic") to include
  3868. // in API requests with the JSON null value. By default, fields with
  3869. // empty values are omitted from API requests. However, any field with
  3870. // an empty value appearing in NullFields will be sent to the server as
  3871. // null. It is an error if a field in this list has a non-empty value.
  3872. // This may be used to include null fields in Patch requests.
  3873. NullFields []string `json:"-"`
  3874. }
  3875. func (s *QueryItem) MarshalJSON() ([]byte, error) {
  3876. type NoMethod QueryItem
  3877. raw := NoMethod(*s)
  3878. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3879. }
  3880. // QueryOperator: The definition of a operator that can be used in a
  3881. // Search/Suggest request.
  3882. type QueryOperator struct {
  3883. // DisplayName: Display name of the operator
  3884. DisplayName string `json:"displayName,omitempty"`
  3885. // EnumValues: Potential list of values for the opeatror field. This
  3886. // field is only filled
  3887. // when we can safely enumerate all the possible values of this
  3888. // operator.
  3889. EnumValues []string `json:"enumValues,omitempty"`
  3890. // GreaterThanOperatorName: Indicates the operator name that can be used
  3891. // to isolate the property using
  3892. // the greater-than operator.
  3893. GreaterThanOperatorName string `json:"greaterThanOperatorName,omitempty"`
  3894. // IsFacetable: Can this operator be used to get facets.
  3895. IsFacetable bool `json:"isFacetable,omitempty"`
  3896. // IsRepeatable: Indicates if multiple values can be set for this
  3897. // property.
  3898. IsRepeatable bool `json:"isRepeatable,omitempty"`
  3899. // IsReturnable: Will the property associated with this facet be
  3900. // returned as part of search
  3901. // results.
  3902. IsReturnable bool `json:"isReturnable,omitempty"`
  3903. // IsSortable: Can this operator be used to sort results.
  3904. IsSortable bool `json:"isSortable,omitempty"`
  3905. // IsSuggestable: Can get suggestions for this field.
  3906. IsSuggestable bool `json:"isSuggestable,omitempty"`
  3907. // LessThanOperatorName: Indicates the operator name that can be used to
  3908. // isolate the property using
  3909. // the less-than operator.
  3910. LessThanOperatorName string `json:"lessThanOperatorName,omitempty"`
  3911. // OperatorName: The name of the operator.
  3912. OperatorName string `json:"operatorName,omitempty"`
  3913. // Type: Type of the operator.
  3914. //
  3915. // Possible values:
  3916. // "UNKNOWN" - Invalid value.
  3917. // "INTEGER"
  3918. // "DOUBLE"
  3919. // "TIMESTAMP"
  3920. // "BOOLEAN"
  3921. // "ENUM"
  3922. // "DATE"
  3923. // "TEXT"
  3924. // "HTML"
  3925. Type string `json:"type,omitempty"`
  3926. // ForceSendFields is a list of field names (e.g. "DisplayName") to
  3927. // unconditionally include in API requests. By default, fields with
  3928. // empty values are omitted from API requests. However, any non-pointer,
  3929. // non-interface field appearing in ForceSendFields will be sent to the
  3930. // server regardless of whether the field is empty or not. This may be
  3931. // used to include empty fields in Patch requests.
  3932. ForceSendFields []string `json:"-"`
  3933. // NullFields is a list of field names (e.g. "DisplayName") to include
  3934. // in API requests with the JSON null value. By default, fields with
  3935. // empty values are omitted from API requests. However, any field with
  3936. // an empty value appearing in NullFields will be sent to the server as
  3937. // null. It is an error if a field in this list has a non-empty value.
  3938. // This may be used to include null fields in Patch requests.
  3939. NullFields []string `json:"-"`
  3940. }
  3941. func (s *QueryOperator) MarshalJSON() ([]byte, error) {
  3942. type NoMethod QueryOperator
  3943. raw := NoMethod(*s)
  3944. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3945. }
  3946. // QuerySource: List of sources that the user can search using the query
  3947. // API.
  3948. type QuerySource struct {
  3949. // DisplayName: Display name of the data source.
  3950. DisplayName string `json:"displayName,omitempty"`
  3951. // Operators: List of all operators applicable for this source.
  3952. Operators []*QueryOperator `json:"operators,omitempty"`
  3953. // ShortName: A short name or alias for the source. This value can be
  3954. // used with the
  3955. // 'source' operator.
  3956. ShortName string `json:"shortName,omitempty"`
  3957. // Source: Name of the source
  3958. Source *Source `json:"source,omitempty"`
  3959. // ForceSendFields is a list of field names (e.g. "DisplayName") to
  3960. // unconditionally include in API requests. By default, fields with
  3961. // empty values are omitted from API requests. However, any non-pointer,
  3962. // non-interface field appearing in ForceSendFields will be sent to the
  3963. // server regardless of whether the field is empty or not. This may be
  3964. // used to include empty fields in Patch requests.
  3965. ForceSendFields []string `json:"-"`
  3966. // NullFields is a list of field names (e.g. "DisplayName") to include
  3967. // in API requests with the JSON null value. By default, fields with
  3968. // empty values are omitted from API requests. However, any field with
  3969. // an empty value appearing in NullFields will be sent to the server as
  3970. // null. It is an error if a field in this list has a non-empty value.
  3971. // This may be used to include null fields in Patch requests.
  3972. NullFields []string `json:"-"`
  3973. }
  3974. func (s *QuerySource) MarshalJSON() ([]byte, error) {
  3975. type NoMethod QuerySource
  3976. raw := NoMethod(*s)
  3977. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3978. }
  3979. // QuerySuggestion: A completed query suggestion.
  3980. type QuerySuggestion struct {
  3981. }
  3982. // RepositoryError: Errors when the connector is communicating to the
  3983. // source repository.
  3984. type RepositoryError struct {
  3985. // ErrorMessage: Message that describes the error. The maximum allowable
  3986. // length
  3987. // of the message is 8192 characters.
  3988. ErrorMessage string `json:"errorMessage,omitempty"`
  3989. // HttpStatusCode: Error codes. Matches the definition of HTTP status
  3990. // codes.
  3991. HttpStatusCode int64 `json:"httpStatusCode,omitempty"`
  3992. // Type: Type of error.
  3993. //
  3994. // Possible values:
  3995. // "UNKNOWN" - Unknown error.
  3996. // "NETWORK_ERROR" - Unknown or unreachable host.
  3997. // "DNS_ERROR" - DNS problem, such as the DNS server is not
  3998. // responding.
  3999. // "CONNECTION_ERROR" - Cannot connect to the repository server.
  4000. // "AUTHENTICATION_ERROR" - Failed authentication due to incorrect
  4001. // credentials.
  4002. // "AUTHORIZATION_ERROR" - Service account is not authorized for the
  4003. // repository.
  4004. // "SERVER_ERROR" - Repository server error.
  4005. // "QUOTA_EXCEEDED" - Quota exceeded.
  4006. // "SERVICE_UNAVAILABLE" - Server temporarily unavailable.
  4007. // "CLIENT_ERROR" - Client-related error, such as an invalid request
  4008. // from the connector to
  4009. // the repository server.
  4010. Type string `json:"type,omitempty"`
  4011. // ForceSendFields is a list of field names (e.g. "ErrorMessage") to
  4012. // unconditionally include in API requests. By default, fields with
  4013. // empty values are omitted from API requests. However, any non-pointer,
  4014. // non-interface field appearing in ForceSendFields will be sent to the
  4015. // server regardless of whether the field is empty or not. This may be
  4016. // used to include empty fields in Patch requests.
  4017. ForceSendFields []string `json:"-"`
  4018. // NullFields is a list of field names (e.g. "ErrorMessage") to include
  4019. // in API requests with the JSON null value. By default, fields with
  4020. // empty values are omitted from API requests. However, any field with
  4021. // an empty value appearing in NullFields will be sent to the server as
  4022. // null. It is an error if a field in this list has a non-empty value.
  4023. // This may be used to include null fields in Patch requests.
  4024. NullFields []string `json:"-"`
  4025. }
  4026. func (s *RepositoryError) MarshalJSON() ([]byte, error) {
  4027. type NoMethod RepositoryError
  4028. raw := NoMethod(*s)
  4029. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4030. }
  4031. // RequestOptions: Shared request options for all RPC methods.
  4032. type RequestOptions struct {
  4033. // DebugOptions: Debug options of the request
  4034. DebugOptions *DebugOptions `json:"debugOptions,omitempty"`
  4035. // LanguageCode: The BCP-47 language code, such as "en-US" or
  4036. // "sr-Latn".
  4037. // For more information,
  4038. // see
  4039. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  4040. // Fo
  4041. // r translations.
  4042. LanguageCode string `json:"languageCode,omitempty"`
  4043. // SearchApplicationId: Id of the application created using
  4044. // SearchApplicationsService.
  4045. SearchApplicationId string `json:"searchApplicationId,omitempty"`
  4046. // TimeZone: Current user's time zone id, such as "America/Los_Angeles"
  4047. // or
  4048. // "Australia/Sydney". These IDs are defined by
  4049. // [Unicode Common Locale Data Repository
  4050. // (CLDR)](http://cldr.unicode.org/)
  4051. // project, and currently available in the
  4052. // file
  4053. // [timezone.xml](http://unicode.org/repos/cldr/trunk/common/bcp47/t
  4054. // imezone.xml)
  4055. TimeZone string `json:"timeZone,omitempty"`
  4056. // ForceSendFields is a list of field names (e.g. "DebugOptions") to
  4057. // unconditionally include in API requests. By default, fields with
  4058. // empty values are omitted from API requests. However, any non-pointer,
  4059. // non-interface field appearing in ForceSendFields will be sent to the
  4060. // server regardless of whether the field is empty or not. This may be
  4061. // used to include empty fields in Patch requests.
  4062. ForceSendFields []string `json:"-"`
  4063. // NullFields is a list of field names (e.g. "DebugOptions") to include
  4064. // in API requests with the JSON null value. By default, fields with
  4065. // empty values are omitted from API requests. However, any field with
  4066. // an empty value appearing in NullFields will be sent to the server as
  4067. // null. It is an error if a field in this list has a non-empty value.
  4068. // This may be used to include null fields in Patch requests.
  4069. NullFields []string `json:"-"`
  4070. }
  4071. func (s *RequestOptions) MarshalJSON() ([]byte, error) {
  4072. type NoMethod RequestOptions
  4073. raw := NoMethod(*s)
  4074. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4075. }
  4076. type ResetSearchApplicationRequest struct {
  4077. // DebugOptions: Common debug options.
  4078. DebugOptions *DebugOptions `json:"debugOptions,omitempty"`
  4079. // ForceSendFields is a list of field names (e.g. "DebugOptions") to
  4080. // unconditionally include in API requests. By default, fields with
  4081. // empty values are omitted from API requests. However, any non-pointer,
  4082. // non-interface field appearing in ForceSendFields will be sent to the
  4083. // server regardless of whether the field is empty or not. This may be
  4084. // used to include empty fields in Patch requests.
  4085. ForceSendFields []string `json:"-"`
  4086. // NullFields is a list of field names (e.g. "DebugOptions") to include
  4087. // in API requests with the JSON null value. By default, fields with
  4088. // empty values are omitted from API requests. However, any field with
  4089. // an empty value appearing in NullFields will be sent to the server as
  4090. // null. It is an error if a field in this list has a non-empty value.
  4091. // This may be used to include null fields in Patch requests.
  4092. NullFields []string `json:"-"`
  4093. }
  4094. func (s *ResetSearchApplicationRequest) MarshalJSON() ([]byte, error) {
  4095. type NoMethod ResetSearchApplicationRequest
  4096. raw := NoMethod(*s)
  4097. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4098. }
  4099. // ResponseDebugInfo: Debugging information about the response.
  4100. type ResponseDebugInfo struct {
  4101. // FormattedDebugInfo: General debug info formatted for display.
  4102. FormattedDebugInfo string `json:"formattedDebugInfo,omitempty"`
  4103. // ForceSendFields is a list of field names (e.g. "FormattedDebugInfo")
  4104. // to unconditionally include in API requests. By default, fields with
  4105. // empty values are omitted from API requests. However, any non-pointer,
  4106. // non-interface field appearing in ForceSendFields will be sent to the
  4107. // server regardless of whether the field is empty or not. This may be
  4108. // used to include empty fields in Patch requests.
  4109. ForceSendFields []string `json:"-"`
  4110. // NullFields is a list of field names (e.g. "FormattedDebugInfo") to
  4111. // include in API requests with the JSON null value. By default, fields
  4112. // with empty values are omitted from API requests. However, any field
  4113. // with an empty value appearing in NullFields will be sent to the
  4114. // server as null. It is an error if a field in this list has a
  4115. // non-empty value. This may be used to include null fields in Patch
  4116. // requests.
  4117. NullFields []string `json:"-"`
  4118. }
  4119. func (s *ResponseDebugInfo) MarshalJSON() ([]byte, error) {
  4120. type NoMethod ResponseDebugInfo
  4121. raw := NoMethod(*s)
  4122. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4123. }
  4124. // RestrictItem: Information relevant only to a restrict entry.
  4125. // NextId: 12
  4126. type RestrictItem struct {
  4127. // DriveFollowUpRestrict:
  4128. // LINT.ThenChange(//depot/google3/java/com/google/apps/search/quality/it
  4129. // emsuggest/utils/SubtypeRerankingUtils.java)
  4130. DriveFollowUpRestrict *DriveFollowUpRestrict `json:"driveFollowUpRestrict,omitempty"`
  4131. DriveLocationRestrict *DriveLocationRestrict `json:"driveLocationRestrict,omitempty"`
  4132. // DriveMimeTypeRestrict: LINT.IfChange
  4133. // Drive Types.
  4134. DriveMimeTypeRestrict *DriveMimeTypeRestrict `json:"driveMimeTypeRestrict,omitempty"`
  4135. DriveTimeSpanRestrict *DriveTimeSpanRestrict `json:"driveTimeSpanRestrict,omitempty"`
  4136. GmailActionRestrict *GmailActionRestrict `json:"gmailActionRestrict,omitempty"`
  4137. GmailAttachmentRestrict *GmailAttachmentRestrict `json:"gmailAttachmentRestrict,omitempty"`
  4138. // GmailFolderRestrict: Gmail Types.
  4139. GmailFolderRestrict *GmailFolderRestrict `json:"gmailFolderRestrict,omitempty"`
  4140. GmailIntelligentRestrict *GmailIntelligentRestrict `json:"gmailIntelligentRestrict,omitempty"`
  4141. GmailTimeRestrict *GmailTimeRestrict `json:"gmailTimeRestrict,omitempty"`
  4142. // SearchOperator: The search restrict (e.g. "after:2017-09-11
  4143. // before:2017-09-12").
  4144. SearchOperator string `json:"searchOperator,omitempty"`
  4145. // ForceSendFields is a list of field names (e.g.
  4146. // "DriveFollowUpRestrict") to unconditionally include in API requests.
  4147. // By default, fields with empty values are omitted from API requests.
  4148. // However, any non-pointer, non-interface field appearing in
  4149. // ForceSendFields will be sent to the server regardless of whether the
  4150. // field is empty or not. This may be used to include empty fields in
  4151. // Patch requests.
  4152. ForceSendFields []string `json:"-"`
  4153. // NullFields is a list of field names (e.g. "DriveFollowUpRestrict") to
  4154. // include in API requests with the JSON null value. By default, fields
  4155. // with empty values are omitted from API requests. However, any field
  4156. // with an empty value appearing in NullFields will be sent to the
  4157. // server as null. It is an error if a field in this list has a
  4158. // non-empty value. This may be used to include null fields in Patch
  4159. // requests.
  4160. NullFields []string `json:"-"`
  4161. }
  4162. func (s *RestrictItem) MarshalJSON() ([]byte, error) {
  4163. type NoMethod RestrictItem
  4164. raw := NoMethod(*s)
  4165. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4166. }
  4167. // ResultCounts: Result count information
  4168. type ResultCounts struct {
  4169. // SourceResultCounts: Result count information for each source with
  4170. // results.
  4171. SourceResultCounts []*SourceResultCount `json:"sourceResultCounts,omitempty"`
  4172. // ForceSendFields is a list of field names (e.g. "SourceResultCounts")
  4173. // to unconditionally include in API requests. By default, fields with
  4174. // empty values are omitted from API requests. However, any non-pointer,
  4175. // non-interface field appearing in ForceSendFields will be sent to the
  4176. // server regardless of whether the field is empty or not. This may be
  4177. // used to include empty fields in Patch requests.
  4178. ForceSendFields []string `json:"-"`
  4179. // NullFields is a list of field names (e.g. "SourceResultCounts") to
  4180. // include in API requests with the JSON null value. By default, fields
  4181. // with empty values are omitted from API requests. However, any field
  4182. // with an empty value appearing in NullFields will be sent to the
  4183. // server as null. It is an error if a field in this list has a
  4184. // non-empty value. This may be used to include null fields in Patch
  4185. // requests.
  4186. NullFields []string `json:"-"`
  4187. }
  4188. func (s *ResultCounts) MarshalJSON() ([]byte, error) {
  4189. type NoMethod ResultCounts
  4190. raw := NoMethod(*s)
  4191. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4192. }
  4193. // ResultDebugInfo: Debugging information about the result.
  4194. type ResultDebugInfo struct {
  4195. // FormattedDebugInfo: General debug info formatted for display.
  4196. FormattedDebugInfo string `json:"formattedDebugInfo,omitempty"`
  4197. // ForceSendFields is a list of field names (e.g. "FormattedDebugInfo")
  4198. // to unconditionally include in API requests. By default, fields with
  4199. // empty values are omitted from API requests. However, any non-pointer,
  4200. // non-interface field appearing in ForceSendFields will be sent to the
  4201. // server regardless of whether the field is empty or not. This may be
  4202. // used to include empty fields in Patch requests.
  4203. ForceSendFields []string `json:"-"`
  4204. // NullFields is a list of field names (e.g. "FormattedDebugInfo") to
  4205. // include in API requests with the JSON null value. By default, fields
  4206. // with empty values are omitted from API requests. However, any field
  4207. // with an empty value appearing in NullFields will be sent to the
  4208. // server as null. It is an error if a field in this list has a
  4209. // non-empty value. This may be used to include null fields in Patch
  4210. // requests.
  4211. NullFields []string `json:"-"`
  4212. }
  4213. func (s *ResultDebugInfo) MarshalJSON() ([]byte, error) {
  4214. type NoMethod ResultDebugInfo
  4215. raw := NoMethod(*s)
  4216. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4217. }
  4218. // ResultDisplayField: Display Fields for Search Results
  4219. type ResultDisplayField struct {
  4220. // Label: The display label for the property.
  4221. Label string `json:"label,omitempty"`
  4222. // OperatorName: The operator name of the property.
  4223. OperatorName string `json:"operatorName,omitempty"`
  4224. // Property: The name value pair for the property.
  4225. Property *NamedProperty `json:"property,omitempty"`
  4226. // ForceSendFields is a list of field names (e.g. "Label") to
  4227. // unconditionally include in API requests. By default, fields with
  4228. // empty values are omitted from API requests. However, any non-pointer,
  4229. // non-interface field appearing in ForceSendFields will be sent to the
  4230. // server regardless of whether the field is empty or not. This may be
  4231. // used to include empty fields in Patch requests.
  4232. ForceSendFields []string `json:"-"`
  4233. // NullFields is a list of field names (e.g. "Label") to include in API
  4234. // requests with the JSON null value. By default, fields with empty
  4235. // values are omitted from API requests. However, any field with an
  4236. // empty value appearing in NullFields will be sent to the server as
  4237. // null. It is an error if a field in this list has a non-empty value.
  4238. // This may be used to include null fields in Patch requests.
  4239. NullFields []string `json:"-"`
  4240. }
  4241. func (s *ResultDisplayField) MarshalJSON() ([]byte, error) {
  4242. type NoMethod ResultDisplayField
  4243. raw := NoMethod(*s)
  4244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4245. }
  4246. // ResultDisplayLine: The collection of fields that make up a displayed
  4247. // line
  4248. type ResultDisplayLine struct {
  4249. Fields []*ResultDisplayField `json:"fields,omitempty"`
  4250. // ForceSendFields is a list of field names (e.g. "Fields") to
  4251. // unconditionally include in API requests. By default, fields with
  4252. // empty values are omitted from API requests. However, any non-pointer,
  4253. // non-interface field appearing in ForceSendFields will be sent to the
  4254. // server regardless of whether the field is empty or not. This may be
  4255. // used to include empty fields in Patch requests.
  4256. ForceSendFields []string `json:"-"`
  4257. // NullFields is a list of field names (e.g. "Fields") to include in API
  4258. // requests with the JSON null value. By default, fields with empty
  4259. // values are omitted from API requests. However, any field with an
  4260. // empty value appearing in NullFields will be sent to the server as
  4261. // null. It is an error if a field in this list has a non-empty value.
  4262. // This may be used to include null fields in Patch requests.
  4263. NullFields []string `json:"-"`
  4264. }
  4265. func (s *ResultDisplayLine) MarshalJSON() ([]byte, error) {
  4266. type NoMethod ResultDisplayLine
  4267. raw := NoMethod(*s)
  4268. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4269. }
  4270. type ResultDisplayMetadata struct {
  4271. // Metalines: The metalines content to be displayed with the result.
  4272. Metalines []*ResultDisplayLine `json:"metalines,omitempty"`
  4273. // ObjectTypeLabel: The display label for the object.
  4274. ObjectTypeLabel string `json:"objectTypeLabel,omitempty"`
  4275. // ForceSendFields is a list of field names (e.g. "Metalines") to
  4276. // unconditionally include in API requests. By default, fields with
  4277. // empty values are omitted from API requests. However, any non-pointer,
  4278. // non-interface field appearing in ForceSendFields will be sent to the
  4279. // server regardless of whether the field is empty or not. This may be
  4280. // used to include empty fields in Patch requests.
  4281. ForceSendFields []string `json:"-"`
  4282. // NullFields is a list of field names (e.g. "Metalines") to include in
  4283. // API requests with the JSON null value. By default, fields with empty
  4284. // values are omitted from API requests. However, any field with an
  4285. // empty value appearing in NullFields will be sent to the server as
  4286. // null. It is an error if a field in this list has a non-empty value.
  4287. // This may be used to include null fields in Patch requests.
  4288. NullFields []string `json:"-"`
  4289. }
  4290. func (s *ResultDisplayMetadata) MarshalJSON() ([]byte, error) {
  4291. type NoMethod ResultDisplayMetadata
  4292. raw := NoMethod(*s)
  4293. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4294. }
  4295. type RetrievalImportance struct {
  4296. // Importance: Indicates the ranking importance given to property when
  4297. // it is matched
  4298. // during retrieval. Once set, the token importance of a property cannot
  4299. // be
  4300. // changed.
  4301. //
  4302. // Possible values:
  4303. // "DEFAULT" - Treat the match like a body text match.
  4304. // "HIGHEST" - Treat the match like a match against title of the item.
  4305. // "HIGH" - Treat the match with higher importance than body text.
  4306. // "LOW" - Treat the match with lower importance than body text.
  4307. // "NONE" - Do not match against this field during retrieval. The
  4308. // property can still
  4309. // be used for operator matching, faceting, and suggest if
  4310. // desired.
  4311. Importance string `json:"importance,omitempty"`
  4312. // ForceSendFields is a list of field names (e.g. "Importance") to
  4313. // unconditionally include in API requests. By default, fields with
  4314. // empty values are omitted from API requests. However, any non-pointer,
  4315. // non-interface field appearing in ForceSendFields will be sent to the
  4316. // server regardless of whether the field is empty or not. This may be
  4317. // used to include empty fields in Patch requests.
  4318. ForceSendFields []string `json:"-"`
  4319. // NullFields is a list of field names (e.g. "Importance") to include in
  4320. // API requests with the JSON null value. By default, fields with empty
  4321. // values are omitted from API requests. However, any field with an
  4322. // empty value appearing in NullFields will be sent to the server as
  4323. // null. It is an error if a field in this list has a non-empty value.
  4324. // This may be used to include null fields in Patch requests.
  4325. NullFields []string `json:"-"`
  4326. }
  4327. func (s *RetrievalImportance) MarshalJSON() ([]byte, error) {
  4328. type NoMethod RetrievalImportance
  4329. raw := NoMethod(*s)
  4330. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4331. }
  4332. // Schema: The schema definition for a data source.
  4333. type Schema struct {
  4334. // ObjectDefinitions: The list of top-level objects for the data
  4335. // source.
  4336. // The maximum number of elements is 10.
  4337. ObjectDefinitions []*ObjectDefinition `json:"objectDefinitions,omitempty"`
  4338. // OperationIds: IDs of the Long Running Operations (LROs) currently
  4339. // running for this
  4340. // schema. After modifying the schema, wait for operations to
  4341. // complete
  4342. // before indexing additional content.
  4343. OperationIds []string `json:"operationIds,omitempty"`
  4344. // ServerResponse contains the HTTP response code and headers from the
  4345. // server.
  4346. googleapi.ServerResponse `json:"-"`
  4347. // ForceSendFields is a list of field names (e.g. "ObjectDefinitions")
  4348. // to unconditionally include in API requests. By default, fields with
  4349. // empty values are omitted from API requests. However, any non-pointer,
  4350. // non-interface field appearing in ForceSendFields will be sent to the
  4351. // server regardless of whether the field is empty or not. This may be
  4352. // used to include empty fields in Patch requests.
  4353. ForceSendFields []string `json:"-"`
  4354. // NullFields is a list of field names (e.g. "ObjectDefinitions") to
  4355. // include in API requests with the JSON null value. By default, fields
  4356. // with empty values are omitted from API requests. However, any field
  4357. // with an empty value appearing in NullFields will be sent to the
  4358. // server as null. It is an error if a field in this list has a
  4359. // non-empty value. This may be used to include null fields in Patch
  4360. // requests.
  4361. NullFields []string `json:"-"`
  4362. }
  4363. func (s *Schema) MarshalJSON() ([]byte, error) {
  4364. type NoMethod Schema
  4365. raw := NoMethod(*s)
  4366. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4367. }
  4368. // ScoringConfig: Scoring configurations for a source while processing
  4369. // a
  4370. // Search or
  4371. // Suggest request.
  4372. type ScoringConfig struct {
  4373. // DisableFreshness: Whether to use freshness as a ranking signal. By
  4374. // default, freshness is used
  4375. // as a ranking signal.
  4376. DisableFreshness bool `json:"disableFreshness,omitempty"`
  4377. // DisablePersonalization: Whether to personalize the results. By
  4378. // default, personal signals will
  4379. // be used to boost results.
  4380. DisablePersonalization bool `json:"disablePersonalization,omitempty"`
  4381. // ForceSendFields is a list of field names (e.g. "DisableFreshness") to
  4382. // unconditionally include in API requests. By default, fields with
  4383. // empty values are omitted from API requests. However, any non-pointer,
  4384. // non-interface field appearing in ForceSendFields will be sent to the
  4385. // server regardless of whether the field is empty or not. This may be
  4386. // used to include empty fields in Patch requests.
  4387. ForceSendFields []string `json:"-"`
  4388. // NullFields is a list of field names (e.g. "DisableFreshness") to
  4389. // include in API requests with the JSON null value. By default, fields
  4390. // with empty values are omitted from API requests. However, any field
  4391. // with an empty value appearing in NullFields will be sent to the
  4392. // server as null. It is an error if a field in this list has a
  4393. // non-empty value. This may be used to include null fields in Patch
  4394. // requests.
  4395. NullFields []string `json:"-"`
  4396. }
  4397. func (s *ScoringConfig) MarshalJSON() ([]byte, error) {
  4398. type NoMethod ScoringConfig
  4399. raw := NoMethod(*s)
  4400. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4401. }
  4402. // SearchApplication: SearchApplication
  4403. type SearchApplication struct {
  4404. // DataSourceRestrictions: Retrictions applied to the
  4405. // configurations.
  4406. // The maximum number of elements is 10.
  4407. DataSourceRestrictions []*DataSourceRestriction `json:"dataSourceRestrictions,omitempty"`
  4408. // DefaultFacetOptions: The default fields for returning facet
  4409. // results.
  4410. // The sources specified here also have been included
  4411. // in
  4412. // data_source_restrictions
  4413. // above.
  4414. DefaultFacetOptions []*FacetOptions `json:"defaultFacetOptions,omitempty"`
  4415. // DefaultSortOptions: The default options for sorting the search
  4416. // results
  4417. DefaultSortOptions *SortOptions `json:"defaultSortOptions,omitempty"`
  4418. // DisplayName: Display name of the Search Application.
  4419. // The maximum length is 300 characters.
  4420. DisplayName string `json:"displayName,omitempty"`
  4421. // Name: Name of the Search Application.
  4422. // <br />Format: searchapplications/{application_id}.
  4423. Name string `json:"name,omitempty"`
  4424. // OperationIds: IDs of the Long Running Operations (LROs) currently
  4425. // running for this
  4426. // schema. Output only field.
  4427. OperationIds []string `json:"operationIds,omitempty"`
  4428. // ScoringConfig: Configuration for ranking results.
  4429. ScoringConfig *ScoringConfig `json:"scoringConfig,omitempty"`
  4430. // SourceConfig: Configuration for a sources specified in
  4431. // data_source_restrictions.
  4432. SourceConfig []*SourceConfig `json:"sourceConfig,omitempty"`
  4433. // ServerResponse contains the HTTP response code and headers from the
  4434. // server.
  4435. googleapi.ServerResponse `json:"-"`
  4436. // ForceSendFields is a list of field names (e.g.
  4437. // "DataSourceRestrictions") to unconditionally include in API requests.
  4438. // By default, fields with empty values are omitted from API requests.
  4439. // However, any non-pointer, non-interface field appearing in
  4440. // ForceSendFields will be sent to the server regardless of whether the
  4441. // field is empty or not. This may be used to include empty fields in
  4442. // Patch requests.
  4443. ForceSendFields []string `json:"-"`
  4444. // NullFields is a list of field names (e.g. "DataSourceRestrictions")
  4445. // to include in API requests with the JSON null value. By default,
  4446. // fields with empty values are omitted from API requests. However, any
  4447. // field with an empty value appearing in NullFields will be sent to the
  4448. // server as null. It is an error if a field in this list has a
  4449. // non-empty value. This may be used to include null fields in Patch
  4450. // requests.
  4451. NullFields []string `json:"-"`
  4452. }
  4453. func (s *SearchApplication) MarshalJSON() ([]byte, error) {
  4454. type NoMethod SearchApplication
  4455. raw := NoMethod(*s)
  4456. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4457. }
  4458. type SearchItemsByViewUrlRequest struct {
  4459. // DebugOptions: Common debug options.
  4460. DebugOptions *DebugOptions `json:"debugOptions,omitempty"`
  4461. // PageToken: The next_page_token value returned from a previous
  4462. // request, if any.
  4463. PageToken string `json:"pageToken,omitempty"`
  4464. // ViewUrl: Specify the full view URL to find the corresponding
  4465. // item.
  4466. // The maximum length is 2048 characters.
  4467. ViewUrl string `json:"viewUrl,omitempty"`
  4468. // ForceSendFields is a list of field names (e.g. "DebugOptions") to
  4469. // unconditionally include in API requests. By default, fields with
  4470. // empty values are omitted from API requests. However, any non-pointer,
  4471. // non-interface field appearing in ForceSendFields will be sent to the
  4472. // server regardless of whether the field is empty or not. This may be
  4473. // used to include empty fields in Patch requests.
  4474. ForceSendFields []string `json:"-"`
  4475. // NullFields is a list of field names (e.g. "DebugOptions") to include
  4476. // in API requests with the JSON null value. By default, fields with
  4477. // empty values are omitted from API requests. However, any field with
  4478. // an empty value appearing in NullFields will be sent to the server as
  4479. // null. It is an error if a field in this list has a non-empty value.
  4480. // This may be used to include null fields in Patch requests.
  4481. NullFields []string `json:"-"`
  4482. }
  4483. func (s *SearchItemsByViewUrlRequest) MarshalJSON() ([]byte, error) {
  4484. type NoMethod SearchItemsByViewUrlRequest
  4485. raw := NoMethod(*s)
  4486. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4487. }
  4488. type SearchItemsByViewUrlResponse struct {
  4489. Items []*Item `json:"items,omitempty"`
  4490. // NextPageToken: Token to retrieve the next page of results, or empty
  4491. // if there are no
  4492. // more results in the list.
  4493. NextPageToken string `json:"nextPageToken,omitempty"`
  4494. // ServerResponse contains the HTTP response code and headers from the
  4495. // server.
  4496. googleapi.ServerResponse `json:"-"`
  4497. // ForceSendFields is a list of field names (e.g. "Items") to
  4498. // unconditionally include in API requests. By default, fields with
  4499. // empty values are omitted from API requests. However, any non-pointer,
  4500. // non-interface field appearing in ForceSendFields will be sent to the
  4501. // server regardless of whether the field is empty or not. This may be
  4502. // used to include empty fields in Patch requests.
  4503. ForceSendFields []string `json:"-"`
  4504. // NullFields is a list of field names (e.g. "Items") to include in API
  4505. // requests with the JSON null value. By default, fields with empty
  4506. // values are omitted from API requests. However, any field with an
  4507. // empty value appearing in NullFields will be sent to the server as
  4508. // null. It is an error if a field in this list has a non-empty value.
  4509. // This may be used to include null fields in Patch requests.
  4510. NullFields []string `json:"-"`
  4511. }
  4512. func (s *SearchItemsByViewUrlResponse) MarshalJSON() ([]byte, error) {
  4513. type NoMethod SearchItemsByViewUrlResponse
  4514. raw := NoMethod(*s)
  4515. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4516. }
  4517. // SearchQualityMetadata: Additional search quality metadata of the
  4518. // item.
  4519. type SearchQualityMetadata struct {
  4520. // Quality: An indication of the quality of the item, used to influence
  4521. // search quality.
  4522. // Value should be between 0.0 (lowest quality) and 1.0 (highest
  4523. // quality). The
  4524. // default value is 0.0.
  4525. Quality float64 `json:"quality,omitempty"`
  4526. // ForceSendFields is a list of field names (e.g. "Quality") to
  4527. // unconditionally include in API requests. By default, fields with
  4528. // empty values are omitted from API requests. However, any non-pointer,
  4529. // non-interface field appearing in ForceSendFields will be sent to the
  4530. // server regardless of whether the field is empty or not. This may be
  4531. // used to include empty fields in Patch requests.
  4532. ForceSendFields []string `json:"-"`
  4533. // NullFields is a list of field names (e.g. "Quality") to include in
  4534. // API requests with the JSON null value. By default, fields with empty
  4535. // values are omitted from API requests. However, any field with an
  4536. // empty value appearing in NullFields will be sent to the server as
  4537. // null. It is an error if a field in this list has a non-empty value.
  4538. // This may be used to include null fields in Patch requests.
  4539. NullFields []string `json:"-"`
  4540. }
  4541. func (s *SearchQualityMetadata) MarshalJSON() ([]byte, error) {
  4542. type NoMethod SearchQualityMetadata
  4543. raw := NoMethod(*s)
  4544. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4545. }
  4546. func (s *SearchQualityMetadata) UnmarshalJSON(data []byte) error {
  4547. type NoMethod SearchQualityMetadata
  4548. var s1 struct {
  4549. Quality gensupport.JSONFloat64 `json:"quality"`
  4550. *NoMethod
  4551. }
  4552. s1.NoMethod = (*NoMethod)(s)
  4553. if err := json.Unmarshal(data, &s1); err != nil {
  4554. return err
  4555. }
  4556. s.Quality = float64(s1.Quality)
  4557. return nil
  4558. }
  4559. // SearchRequest: The search API request.
  4560. type SearchRequest struct {
  4561. // DataSourceRestrictions: The sources to use for querying. If not
  4562. // specified, all data sources
  4563. // from the current search application are used.
  4564. DataSourceRestrictions []*DataSourceRestriction `json:"dataSourceRestrictions,omitempty"`
  4565. FacetOptions []*FacetOptions `json:"facetOptions,omitempty"`
  4566. // PageSize: Maximum number of search results to return in one
  4567. // page.
  4568. // Valid values are between 1 and 100, inclusive.
  4569. // Default value is 10.
  4570. PageSize int64 `json:"pageSize,omitempty"`
  4571. // Query: The raw query string.
  4572. // See supported search operators in the [Cloud
  4573. // search
  4574. // Cheat
  4575. // Sheet](https://gsuite.google.com/learning-center/products
  4576. // /cloudsearch/cheat-sheet/)
  4577. Query string `json:"query,omitempty"`
  4578. // QueryInterpretationOptions: Options to interpret the user query.
  4579. QueryInterpretationOptions *QueryInterpretationOptions `json:"queryInterpretationOptions,omitempty"`
  4580. // RequestOptions: Request options, such as the search application and
  4581. // user timezone.
  4582. RequestOptions *RequestOptions `json:"requestOptions,omitempty"`
  4583. // SortOptions: The options for sorting the search results
  4584. SortOptions *SortOptions `json:"sortOptions,omitempty"`
  4585. // Start: Starting index of the results.
  4586. Start int64 `json:"start,omitempty"`
  4587. // ForceSendFields is a list of field names (e.g.
  4588. // "DataSourceRestrictions") to unconditionally include in API requests.
  4589. // By default, fields with empty values are omitted from API requests.
  4590. // However, any non-pointer, non-interface field appearing in
  4591. // ForceSendFields will be sent to the server regardless of whether the
  4592. // field is empty or not. This may be used to include empty fields in
  4593. // Patch requests.
  4594. ForceSendFields []string `json:"-"`
  4595. // NullFields is a list of field names (e.g. "DataSourceRestrictions")
  4596. // to include in API requests with the JSON null value. By default,
  4597. // fields with empty values are omitted from API requests. However, any
  4598. // field with an empty value appearing in NullFields will be sent to the
  4599. // server as null. It is an error if a field in this list has a
  4600. // non-empty value. This may be used to include null fields in Patch
  4601. // requests.
  4602. NullFields []string `json:"-"`
  4603. }
  4604. func (s *SearchRequest) MarshalJSON() ([]byte, error) {
  4605. type NoMethod SearchRequest
  4606. raw := NoMethod(*s)
  4607. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4608. }
  4609. // SearchResponse: The search API response.
  4610. type SearchResponse struct {
  4611. // DebugInfo: Debugging information about the response.
  4612. DebugInfo *ResponseDebugInfo `json:"debugInfo,omitempty"`
  4613. // ErrorInfo: Error information about the response.
  4614. ErrorInfo *ErrorInfo `json:"errorInfo,omitempty"`
  4615. // FacetResults: Repeated facet results.
  4616. FacetResults []*FacetResult `json:"facetResults,omitempty"`
  4617. // HasMoreResults: Whether there are more search results matching the
  4618. // query.
  4619. HasMoreResults bool `json:"hasMoreResults,omitempty"`
  4620. // QueryInterpretation: Query interpretation result for user query.
  4621. // Empty if query interpretation
  4622. // is disabled.
  4623. QueryInterpretation *QueryInterpretation `json:"queryInterpretation,omitempty"`
  4624. // ResultCountEstimate: The estimated result count for this query.
  4625. ResultCountEstimate int64 `json:"resultCountEstimate,omitempty,string"`
  4626. // ResultCountExact: The exact result count for this query.
  4627. ResultCountExact int64 `json:"resultCountExact,omitempty,string"`
  4628. // ResultCounts: Expanded result count information.
  4629. ResultCounts *ResultCounts `json:"resultCounts,omitempty"`
  4630. // Results: Results from a search query.
  4631. Results []*SearchResult `json:"results,omitempty"`
  4632. // SpellResults: Suggested spelling for the query.
  4633. SpellResults []*SpellResult `json:"spellResults,omitempty"`
  4634. // StructuredResults: Structured results for the user query. These
  4635. // results are not counted
  4636. // against the page_size.
  4637. StructuredResults []*StructuredResult `json:"structuredResults,omitempty"`
  4638. // ServerResponse contains the HTTP response code and headers from the
  4639. // server.
  4640. googleapi.ServerResponse `json:"-"`
  4641. // ForceSendFields is a list of field names (e.g. "DebugInfo") to
  4642. // unconditionally include in API requests. By default, fields with
  4643. // empty values are omitted from API requests. However, any non-pointer,
  4644. // non-interface field appearing in ForceSendFields will be sent to the
  4645. // server regardless of whether the field is empty or not. This may be
  4646. // used to include empty fields in Patch requests.
  4647. ForceSendFields []string `json:"-"`
  4648. // NullFields is a list of field names (e.g. "DebugInfo") to include in
  4649. // API requests with the JSON null value. By default, fields with empty
  4650. // values are omitted from API requests. However, any field with an
  4651. // empty value appearing in NullFields will be sent to the server as
  4652. // null. It is an error if a field in this list has a non-empty value.
  4653. // This may be used to include null fields in Patch requests.
  4654. NullFields []string `json:"-"`
  4655. }
  4656. func (s *SearchResponse) MarshalJSON() ([]byte, error) {
  4657. type NoMethod SearchResponse
  4658. raw := NoMethod(*s)
  4659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4660. }
  4661. // SearchResult: Results containing indexed information for a document.
  4662. type SearchResult struct {
  4663. // ClusteredResults: If source is clustered, provide list of clustered
  4664. // results. There will only
  4665. // be one level of clustered results. If current source is not enabled
  4666. // for
  4667. // clustering, this field will be empty.
  4668. ClusteredResults []*SearchResult `json:"clusteredResults,omitempty"`
  4669. // DebugInfo: Debugging information about this search result.
  4670. DebugInfo *ResultDebugInfo `json:"debugInfo,omitempty"`
  4671. // Metadata: Metadata of the search result.
  4672. Metadata *Metadata `json:"metadata,omitempty"`
  4673. // Snippet: The concatenation of all snippets (summaries) available for
  4674. // this result.
  4675. Snippet *Snippet `json:"snippet,omitempty"`
  4676. // Title: Title of the search result.
  4677. Title string `json:"title,omitempty"`
  4678. // Url: The URL of the result.
  4679. Url string `json:"url,omitempty"`
  4680. // ForceSendFields is a list of field names (e.g. "ClusteredResults") to
  4681. // unconditionally include in API requests. By default, fields with
  4682. // empty values are omitted from API requests. However, any non-pointer,
  4683. // non-interface field appearing in ForceSendFields will be sent to the
  4684. // server regardless of whether the field is empty or not. This may be
  4685. // used to include empty fields in Patch requests.
  4686. ForceSendFields []string `json:"-"`
  4687. // NullFields is a list of field names (e.g. "ClusteredResults") to
  4688. // include in API requests with the JSON null value. By default, fields
  4689. // with empty values are omitted from API requests. However, any field
  4690. // with an empty value appearing in NullFields will be sent to the
  4691. // server as null. It is an error if a field in this list has a
  4692. // non-empty value. This may be used to include null fields in Patch
  4693. // requests.
  4694. NullFields []string `json:"-"`
  4695. }
  4696. func (s *SearchResult) MarshalJSON() ([]byte, error) {
  4697. type NoMethod SearchResult
  4698. raw := NoMethod(*s)
  4699. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4700. }
  4701. // Snippet: Snippet of the search result, which summarizes the content
  4702. // of the resulting
  4703. // page.
  4704. type Snippet struct {
  4705. // MatchRanges: The matched ranges in the snippet.
  4706. MatchRanges []*MatchRange `json:"matchRanges,omitempty"`
  4707. // Snippet: The snippet of the document.
  4708. // The snippet of the document. May contain escaped HTML character
  4709. // that
  4710. // should be unescaped prior to rendering.
  4711. Snippet string `json:"snippet,omitempty"`
  4712. // ForceSendFields is a list of field names (e.g. "MatchRanges") to
  4713. // unconditionally include in API requests. By default, fields with
  4714. // empty values are omitted from API requests. However, any non-pointer,
  4715. // non-interface field appearing in ForceSendFields will be sent to the
  4716. // server regardless of whether the field is empty or not. This may be
  4717. // used to include empty fields in Patch requests.
  4718. ForceSendFields []string `json:"-"`
  4719. // NullFields is a list of field names (e.g. "MatchRanges") to include
  4720. // in API requests with the JSON null value. By default, fields with
  4721. // empty values are omitted from API requests. However, any field with
  4722. // an empty value appearing in NullFields will be sent to the server as
  4723. // null. It is an error if a field in this list has a non-empty value.
  4724. // This may be used to include null fields in Patch requests.
  4725. NullFields []string `json:"-"`
  4726. }
  4727. func (s *Snippet) MarshalJSON() ([]byte, error) {
  4728. type NoMethod Snippet
  4729. raw := NoMethod(*s)
  4730. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4731. }
  4732. type SortOptions struct {
  4733. // OperatorName: Name of the operator corresponding to the field to sort
  4734. // on.
  4735. // The corresponding property must be marked as
  4736. // sortable.
  4737. OperatorName string `json:"operatorName,omitempty"`
  4738. // SortOrder: Ascending is the default sort order
  4739. //
  4740. // Possible values:
  4741. // "ASCENDING"
  4742. // "DESCENDING"
  4743. SortOrder string `json:"sortOrder,omitempty"`
  4744. // ForceSendFields is a list of field names (e.g. "OperatorName") to
  4745. // unconditionally include in API requests. By default, fields with
  4746. // empty values are omitted from API requests. However, any non-pointer,
  4747. // non-interface field appearing in ForceSendFields will be sent to the
  4748. // server regardless of whether the field is empty or not. This may be
  4749. // used to include empty fields in Patch requests.
  4750. ForceSendFields []string `json:"-"`
  4751. // NullFields is a list of field names (e.g. "OperatorName") to include
  4752. // in API requests with the JSON null value. By default, fields with
  4753. // empty values are omitted from API requests. However, any field with
  4754. // an empty value appearing in NullFields will be sent to the server as
  4755. // null. It is an error if a field in this list has a non-empty value.
  4756. // This may be used to include null fields in Patch requests.
  4757. NullFields []string `json:"-"`
  4758. }
  4759. func (s *SortOptions) MarshalJSON() ([]byte, error) {
  4760. type NoMethod SortOptions
  4761. raw := NoMethod(*s)
  4762. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4763. }
  4764. // Source: Defines sources for the suggest/search APIs.
  4765. type Source struct {
  4766. // Name: Source name for content indexed by the
  4767. // Indexing API.
  4768. Name string `json:"name,omitempty"`
  4769. // PredefinedSource: Predefined content source for Google Apps.
  4770. //
  4771. // Possible values:
  4772. // "NONE"
  4773. // "QUERY_HISTORY" - Suggests queries issued by the user in the past.
  4774. // Only valid when used
  4775. // with the suggest API. Ignored when used in the query API.
  4776. // "PERSON" - Suggests people in the organization. Only valid when
  4777. // used
  4778. // with the suggest API. Results in an error when used in the query API.
  4779. // "GOOGLE_DRIVE"
  4780. // "GOOGLE_GMAIL"
  4781. // "GOOGLE_SITES"
  4782. // "GOOGLE_GROUPS"
  4783. // "GOOGLE_CALENDAR"
  4784. // "GOOGLE_KEEP"
  4785. PredefinedSource string `json:"predefinedSource,omitempty"`
  4786. // ForceSendFields is a list of field names (e.g. "Name") to
  4787. // unconditionally include in API requests. By default, fields with
  4788. // empty values are omitted from API requests. However, any non-pointer,
  4789. // non-interface field appearing in ForceSendFields will be sent to the
  4790. // server regardless of whether the field is empty or not. This may be
  4791. // used to include empty fields in Patch requests.
  4792. ForceSendFields []string `json:"-"`
  4793. // NullFields is a list of field names (e.g. "Name") to include in API
  4794. // requests with the JSON null value. By default, fields with empty
  4795. // values are omitted from API requests. However, any field with an
  4796. // empty value appearing in NullFields will be sent to the server as
  4797. // null. It is an error if a field in this list has a non-empty value.
  4798. // This may be used to include null fields in Patch requests.
  4799. NullFields []string `json:"-"`
  4800. }
  4801. func (s *Source) MarshalJSON() ([]byte, error) {
  4802. type NoMethod Source
  4803. raw := NoMethod(*s)
  4804. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4805. }
  4806. // SourceConfig: Configurations for a source while processing a
  4807. // Search or
  4808. // Suggest request.
  4809. type SourceConfig struct {
  4810. // CrowdingConfig: The crowding configuration for the source.
  4811. CrowdingConfig *SourceCrowdingConfig `json:"crowdingConfig,omitempty"`
  4812. // ScoringConfig: The scoring configuration for the source.
  4813. ScoringConfig *SourceScoringConfig `json:"scoringConfig,omitempty"`
  4814. // Source: The source for which this configuration is to be used.
  4815. Source *Source `json:"source,omitempty"`
  4816. // ForceSendFields is a list of field names (e.g. "CrowdingConfig") to
  4817. // unconditionally include in API requests. By default, fields with
  4818. // empty values are omitted from API requests. However, any non-pointer,
  4819. // non-interface field appearing in ForceSendFields will be sent to the
  4820. // server regardless of whether the field is empty or not. This may be
  4821. // used to include empty fields in Patch requests.
  4822. ForceSendFields []string `json:"-"`
  4823. // NullFields is a list of field names (e.g. "CrowdingConfig") to
  4824. // include in API requests with the JSON null value. By default, fields
  4825. // with empty values are omitted from API requests. However, any field
  4826. // with an empty value appearing in NullFields will be sent to the
  4827. // server as null. It is an error if a field in this list has a
  4828. // non-empty value. This may be used to include null fields in Patch
  4829. // requests.
  4830. NullFields []string `json:"-"`
  4831. }
  4832. func (s *SourceConfig) MarshalJSON() ([]byte, error) {
  4833. type NoMethod SourceConfig
  4834. raw := NoMethod(*s)
  4835. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4836. }
  4837. // SourceCrowdingConfig: Set search results crowding limits. Crowding is
  4838. // a situation in which
  4839. // multiple results from the same source or host "crowd out" other
  4840. // results,
  4841. // diminishing the quality of search for users. To foster better search
  4842. // quality
  4843. // and source diversity in search results, you can set a condition to
  4844. // reduce
  4845. // repetitive results by source.
  4846. type SourceCrowdingConfig struct {
  4847. // Field: Use a field to control results crowding. For example, if you
  4848. // want to
  4849. // control overly similar results from Gmail topics, use
  4850. // `thread_id`.
  4851. // For similar pages from Google Sites, you can use `webspace_id`.
  4852. // When matching query results contain the same field value
  4853. // in
  4854. // `GenericMetadata`, crowding limits are set on those records.
  4855. Field string `json:"field,omitempty"`
  4856. // NumResults: Maximum number of results allowed from a source.
  4857. // No limits will be set on results if this value is less than or equal
  4858. // to 0.
  4859. NumResults int64 `json:"numResults,omitempty"`
  4860. // NumSuggestions: Maximum number of suggestions allowed from a
  4861. // source.
  4862. // No limits will be set on results if this value is less than or equal
  4863. // to 0.
  4864. NumSuggestions int64 `json:"numSuggestions,omitempty"`
  4865. // Source: Control results by content source. This option limits the
  4866. // total number
  4867. // of results from a given source and ignores field-based crowding
  4868. // control.
  4869. Source bool `json:"source,omitempty"`
  4870. // ForceSendFields is a list of field names (e.g. "Field") to
  4871. // unconditionally include in API requests. By default, fields with
  4872. // empty values are omitted from API requests. However, any non-pointer,
  4873. // non-interface field appearing in ForceSendFields will be sent to the
  4874. // server regardless of whether the field is empty or not. This may be
  4875. // used to include empty fields in Patch requests.
  4876. ForceSendFields []string `json:"-"`
  4877. // NullFields is a list of field names (e.g. "Field") to include in API
  4878. // requests with the JSON null value. By default, fields with empty
  4879. // values are omitted from API requests. However, any field with an
  4880. // empty value appearing in NullFields will be sent to the server as
  4881. // null. It is an error if a field in this list has a non-empty value.
  4882. // This may be used to include null fields in Patch requests.
  4883. NullFields []string `json:"-"`
  4884. }
  4885. func (s *SourceCrowdingConfig) MarshalJSON() ([]byte, error) {
  4886. type NoMethod SourceCrowdingConfig
  4887. raw := NoMethod(*s)
  4888. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4889. }
  4890. // SourceResultCount: Per source result count information.
  4891. type SourceResultCount struct {
  4892. // HasMoreResults: Whether there are more search results for this
  4893. // source.
  4894. HasMoreResults bool `json:"hasMoreResults,omitempty"`
  4895. // ResultCountEstimate: The estimated result count for this source.
  4896. ResultCountEstimate int64 `json:"resultCountEstimate,omitempty,string"`
  4897. // ResultCountExact: The exact result count for this source.
  4898. ResultCountExact int64 `json:"resultCountExact,omitempty,string"`
  4899. // Source: The source the result count information is associated with.
  4900. Source *Source `json:"source,omitempty"`
  4901. // ForceSendFields is a list of field names (e.g. "HasMoreResults") to
  4902. // unconditionally include in API requests. By default, fields with
  4903. // empty values are omitted from API requests. However, any non-pointer,
  4904. // non-interface field appearing in ForceSendFields will be sent to the
  4905. // server regardless of whether the field is empty or not. This may be
  4906. // used to include empty fields in Patch requests.
  4907. ForceSendFields []string `json:"-"`
  4908. // NullFields is a list of field names (e.g. "HasMoreResults") to
  4909. // include in API requests with the JSON null value. By default, fields
  4910. // with empty values are omitted from API requests. However, any field
  4911. // with an empty value appearing in NullFields will be sent to the
  4912. // server as null. It is an error if a field in this list has a
  4913. // non-empty value. This may be used to include null fields in Patch
  4914. // requests.
  4915. NullFields []string `json:"-"`
  4916. }
  4917. func (s *SourceResultCount) MarshalJSON() ([]byte, error) {
  4918. type NoMethod SourceResultCount
  4919. raw := NoMethod(*s)
  4920. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4921. }
  4922. // SourceScoringConfig: Set the scoring configuration. This allows
  4923. // modifying the ranking of results
  4924. // for a source.
  4925. type SourceScoringConfig struct {
  4926. // SourceImportance: Importance of the source.
  4927. //
  4928. // Possible values:
  4929. // "DEFAULT"
  4930. // "LOW"
  4931. // "HIGH"
  4932. SourceImportance string `json:"sourceImportance,omitempty"`
  4933. // ForceSendFields is a list of field names (e.g. "SourceImportance") to
  4934. // unconditionally include in API requests. By default, fields with
  4935. // empty values are omitted from API requests. However, any non-pointer,
  4936. // non-interface field appearing in ForceSendFields will be sent to the
  4937. // server regardless of whether the field is empty or not. This may be
  4938. // used to include empty fields in Patch requests.
  4939. ForceSendFields []string `json:"-"`
  4940. // NullFields is a list of field names (e.g. "SourceImportance") to
  4941. // include in API requests with the JSON null value. By default, fields
  4942. // with empty values are omitted from API requests. However, any field
  4943. // with an empty value appearing in NullFields will be sent to the
  4944. // server as null. It is an error if a field in this list has a
  4945. // non-empty value. This may be used to include null fields in Patch
  4946. // requests.
  4947. NullFields []string `json:"-"`
  4948. }
  4949. func (s *SourceScoringConfig) MarshalJSON() ([]byte, error) {
  4950. type NoMethod SourceScoringConfig
  4951. raw := NoMethod(*s)
  4952. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4953. }
  4954. type SpellResult struct {
  4955. // SuggestedQuery: The suggested spelling of the query.
  4956. SuggestedQuery string `json:"suggestedQuery,omitempty"`
  4957. // ForceSendFields is a list of field names (e.g. "SuggestedQuery") to
  4958. // unconditionally include in API requests. By default, fields with
  4959. // empty values are omitted from API requests. However, any non-pointer,
  4960. // non-interface field appearing in ForceSendFields will be sent to the
  4961. // server regardless of whether the field is empty or not. This may be
  4962. // used to include empty fields in Patch requests.
  4963. ForceSendFields []string `json:"-"`
  4964. // NullFields is a list of field names (e.g. "SuggestedQuery") to
  4965. // include in API requests with the JSON null value. By default, fields
  4966. // with empty values are omitted from API requests. However, any field
  4967. // with an empty value appearing in NullFields will be sent to the
  4968. // server as null. It is an error if a field in this list has a
  4969. // non-empty value. This may be used to include null fields in Patch
  4970. // requests.
  4971. NullFields []string `json:"-"`
  4972. }
  4973. func (s *SpellResult) MarshalJSON() ([]byte, error) {
  4974. type NoMethod SpellResult
  4975. raw := NoMethod(*s)
  4976. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4977. }
  4978. // StartUploadItemRequest: Start upload file request.
  4979. type StartUploadItemRequest struct {
  4980. // ConnectorName: Name of connector making this call.
  4981. // <br />Format: datasources/{source_id}/connectors/{ID}
  4982. ConnectorName string `json:"connectorName,omitempty"`
  4983. // DebugOptions: Common debug options.
  4984. DebugOptions *DebugOptions `json:"debugOptions,omitempty"`
  4985. // ForceSendFields is a list of field names (e.g. "ConnectorName") to
  4986. // unconditionally include in API requests. By default, fields with
  4987. // empty values are omitted from API requests. However, any non-pointer,
  4988. // non-interface field appearing in ForceSendFields will be sent to the
  4989. // server regardless of whether the field is empty or not. This may be
  4990. // used to include empty fields in Patch requests.
  4991. ForceSendFields []string `json:"-"`
  4992. // NullFields is a list of field names (e.g. "ConnectorName") to include
  4993. // in API requests with the JSON null value. By default, fields with
  4994. // empty values are omitted from API requests. However, any field with
  4995. // an empty value appearing in NullFields will be sent to the server as
  4996. // null. It is an error if a field in this list has a non-empty value.
  4997. // This may be used to include null fields in Patch requests.
  4998. NullFields []string `json:"-"`
  4999. }
  5000. func (s *StartUploadItemRequest) MarshalJSON() ([]byte, error) {
  5001. type NoMethod StartUploadItemRequest
  5002. raw := NoMethod(*s)
  5003. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5004. }
  5005. // Status: The `Status` type defines a logical error model that is
  5006. // suitable for different
  5007. // programming environments, including REST APIs and RPC APIs. It is
  5008. // used by
  5009. // [gRPC](https://github.com/grpc). The error model is designed to
  5010. // be:
  5011. //
  5012. // - Simple to use and understand for most users
  5013. // - Flexible enough to meet unexpected needs
  5014. //
  5015. // # Overview
  5016. //
  5017. // The `Status` message contains three pieces of data: error code, error
  5018. // message,
  5019. // and error details. The error code should be an enum value
  5020. // of
  5021. // google.rpc.Code, but it may accept additional error codes if needed.
  5022. // The
  5023. // error message should be a developer-facing English message that
  5024. // helps
  5025. // developers *understand* and *resolve* the error. If a localized
  5026. // user-facing
  5027. // error message is needed, put the localized message in the error
  5028. // details or
  5029. // localize it in the client. The optional error details may contain
  5030. // arbitrary
  5031. // information about the error. There is a predefined set of error
  5032. // detail types
  5033. // in the package `google.rpc` that can be used for common error
  5034. // conditions.
  5035. //
  5036. // # Language mapping
  5037. //
  5038. // The `Status` message is the logical representation of the error
  5039. // model, but it
  5040. // is not necessarily the actual wire format. When the `Status` message
  5041. // is
  5042. // exposed in different client libraries and different wire protocols,
  5043. // it can be
  5044. // mapped differently. For example, it will likely be mapped to some
  5045. // exceptions
  5046. // in Java, but more likely mapped to some error codes in C.
  5047. //
  5048. // # Other uses
  5049. //
  5050. // The error model and the `Status` message can be used in a variety
  5051. // of
  5052. // environments, either with or without APIs, to provide a
  5053. // consistent developer experience across different
  5054. // environments.
  5055. //
  5056. // Example uses of this error model include:
  5057. //
  5058. // - Partial errors. If a service needs to return partial errors to the
  5059. // client,
  5060. // it may embed the `Status` in the normal response to indicate the
  5061. // partial
  5062. // errors.
  5063. //
  5064. // - Workflow errors. A typical workflow has multiple steps. Each step
  5065. // may
  5066. // have a `Status` message for error reporting.
  5067. //
  5068. // - Batch operations. If a client uses batch request and batch
  5069. // response, the
  5070. // `Status` message should be used directly inside batch response,
  5071. // one for
  5072. // each error sub-response.
  5073. //
  5074. // - Asynchronous operations. If an API call embeds asynchronous
  5075. // operation
  5076. // results in its response, the status of those operations should
  5077. // be
  5078. // represented directly using the `Status` message.
  5079. //
  5080. // - Logging. If some API errors are stored in logs, the message
  5081. // `Status` could
  5082. // be used directly after any stripping needed for security/privacy
  5083. // reasons.
  5084. type Status struct {
  5085. // Code: The status code, which should be an enum value of
  5086. // google.rpc.Code.
  5087. Code int64 `json:"code,omitempty"`
  5088. // Details: A list of messages that carry the error details. There is a
  5089. // common set of
  5090. // message types for APIs to use.
  5091. Details []googleapi.RawMessage `json:"details,omitempty"`
  5092. // Message: A developer-facing error message, which should be in
  5093. // English. Any
  5094. // user-facing error message should be localized and sent in
  5095. // the
  5096. // google.rpc.Status.details field, or localized by the client.
  5097. Message string `json:"message,omitempty"`
  5098. // ForceSendFields is a list of field names (e.g. "Code") to
  5099. // unconditionally include in API requests. By default, fields with
  5100. // empty values are omitted from API requests. However, any non-pointer,
  5101. // non-interface field appearing in ForceSendFields will be sent to the
  5102. // server regardless of whether the field is empty or not. This may be
  5103. // used to include empty fields in Patch requests.
  5104. ForceSendFields []string `json:"-"`
  5105. // NullFields is a list of field names (e.g. "Code") to include in API
  5106. // requests with the JSON null value. By default, fields with empty
  5107. // values are omitted from API requests. However, any field with an
  5108. // empty value appearing in NullFields will be sent to the server as
  5109. // null. It is an error if a field in this list has a non-empty value.
  5110. // This may be used to include null fields in Patch requests.
  5111. NullFields []string `json:"-"`
  5112. }
  5113. func (s *Status) MarshalJSON() ([]byte, error) {
  5114. type NoMethod Status
  5115. raw := NoMethod(*s)
  5116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5117. }
  5118. // StructuredDataObject: A structured data object consisting of named
  5119. // properties.
  5120. type StructuredDataObject struct {
  5121. // Properties: The properties for the object.
  5122. // The maximum number of elements is 1000.
  5123. Properties []*NamedProperty `json:"properties,omitempty"`
  5124. // ForceSendFields is a list of field names (e.g. "Properties") to
  5125. // unconditionally include in API requests. By default, fields with
  5126. // empty values are omitted from API requests. However, any non-pointer,
  5127. // non-interface field appearing in ForceSendFields will be sent to the
  5128. // server regardless of whether the field is empty or not. This may be
  5129. // used to include empty fields in Patch requests.
  5130. ForceSendFields []string `json:"-"`
  5131. // NullFields is a list of field names (e.g. "Properties") to include in
  5132. // API requests with the JSON null value. By default, fields with empty
  5133. // values are omitted from API requests. However, any field with an
  5134. // empty value appearing in NullFields will be sent to the server as
  5135. // null. It is an error if a field in this list has a non-empty value.
  5136. // This may be used to include null fields in Patch requests.
  5137. NullFields []string `json:"-"`
  5138. }
  5139. func (s *StructuredDataObject) MarshalJSON() ([]byte, error) {
  5140. type NoMethod StructuredDataObject
  5141. raw := NoMethod(*s)
  5142. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5143. }
  5144. // StructuredResult: Structured results that are returned as part of
  5145. // search request.
  5146. type StructuredResult struct {
  5147. // Person: Representation of a person
  5148. Person *Person `json:"person,omitempty"`
  5149. // ForceSendFields is a list of field names (e.g. "Person") to
  5150. // unconditionally include in API requests. By default, fields with
  5151. // empty values are omitted from API requests. However, any non-pointer,
  5152. // non-interface field appearing in ForceSendFields will be sent to the
  5153. // server regardless of whether the field is empty or not. This may be
  5154. // used to include empty fields in Patch requests.
  5155. ForceSendFields []string `json:"-"`
  5156. // NullFields is a list of field names (e.g. "Person") to include in API
  5157. // requests with the JSON null value. By default, fields with empty
  5158. // values are omitted from API requests. However, any field with an
  5159. // empty value appearing in NullFields will be sent to the server as
  5160. // null. It is an error if a field in this list has a non-empty value.
  5161. // This may be used to include null fields in Patch requests.
  5162. NullFields []string `json:"-"`
  5163. }
  5164. func (s *StructuredResult) MarshalJSON() ([]byte, error) {
  5165. type NoMethod StructuredResult
  5166. raw := NoMethod(*s)
  5167. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5168. }
  5169. // SuggestRequest: Request of suggest API.
  5170. type SuggestRequest struct {
  5171. // DataSourceRestrictions: The sources to use for suggestions. If not
  5172. // specified, all data sources
  5173. // from the current search application are used.
  5174. DataSourceRestrictions []*DataSourceRestriction `json:"dataSourceRestrictions,omitempty"`
  5175. // Query: Partial query for the completion suggestion.
  5176. Query string `json:"query,omitempty"`
  5177. // RequestOptions: Request options, such as the search application and
  5178. // user timezone.
  5179. RequestOptions *RequestOptions `json:"requestOptions,omitempty"`
  5180. // ForceSendFields is a list of field names (e.g.
  5181. // "DataSourceRestrictions") to unconditionally include in API requests.
  5182. // By default, fields with empty values are omitted from API requests.
  5183. // However, any non-pointer, non-interface field appearing in
  5184. // ForceSendFields will be sent to the server regardless of whether the
  5185. // field is empty or not. This may be used to include empty fields in
  5186. // Patch requests.
  5187. ForceSendFields []string `json:"-"`
  5188. // NullFields is a list of field names (e.g. "DataSourceRestrictions")
  5189. // to include in API requests with the JSON null value. By default,
  5190. // fields with empty values are omitted from API requests. However, any
  5191. // field with an empty value appearing in NullFields will be sent to the
  5192. // server as null. It is an error if a field in this list has a
  5193. // non-empty value. This may be used to include null fields in Patch
  5194. // requests.
  5195. NullFields []string `json:"-"`
  5196. }
  5197. func (s *SuggestRequest) MarshalJSON() ([]byte, error) {
  5198. type NoMethod SuggestRequest
  5199. raw := NoMethod(*s)
  5200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5201. }
  5202. // SuggestResponse: Response of the suggest API.
  5203. type SuggestResponse struct {
  5204. // SuggestResults: List of suggestion results.
  5205. SuggestResults []*SuggestResult `json:"suggestResults,omitempty"`
  5206. // ServerResponse contains the HTTP response code and headers from the
  5207. // server.
  5208. googleapi.ServerResponse `json:"-"`
  5209. // ForceSendFields is a list of field names (e.g. "SuggestResults") to
  5210. // unconditionally include in API requests. By default, fields with
  5211. // empty values are omitted from API requests. However, any non-pointer,
  5212. // non-interface field appearing in ForceSendFields will be sent to the
  5213. // server regardless of whether the field is empty or not. This may be
  5214. // used to include empty fields in Patch requests.
  5215. ForceSendFields []string `json:"-"`
  5216. // NullFields is a list of field names (e.g. "SuggestResults") to
  5217. // include in API requests with the JSON null value. By default, fields
  5218. // with empty values are omitted from API requests. However, any field
  5219. // with an empty value appearing in NullFields will be sent to the
  5220. // server as null. It is an error if a field in this list has a
  5221. // non-empty value. This may be used to include null fields in Patch
  5222. // requests.
  5223. NullFields []string `json:"-"`
  5224. }
  5225. func (s *SuggestResponse) MarshalJSON() ([]byte, error) {
  5226. type NoMethod SuggestResponse
  5227. raw := NoMethod(*s)
  5228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5229. }
  5230. // SuggestResult: One suggestion result.
  5231. type SuggestResult struct {
  5232. PeopleSuggestion *PeopleSuggestion `json:"peopleSuggestion,omitempty"`
  5233. QuerySuggestion *QuerySuggestion `json:"querySuggestion,omitempty"`
  5234. // Source: The source of the suggestion.
  5235. Source *Source `json:"source,omitempty"`
  5236. // SuggestedQuery: The suggested query that will be used for search,
  5237. // when the user
  5238. // clicks on the suggestion
  5239. SuggestedQuery string `json:"suggestedQuery,omitempty"`
  5240. // ForceSendFields is a list of field names (e.g. "PeopleSuggestion") to
  5241. // unconditionally include in API requests. By default, fields with
  5242. // empty values are omitted from API requests. However, any non-pointer,
  5243. // non-interface field appearing in ForceSendFields will be sent to the
  5244. // server regardless of whether the field is empty or not. This may be
  5245. // used to include empty fields in Patch requests.
  5246. ForceSendFields []string `json:"-"`
  5247. // NullFields is a list of field names (e.g. "PeopleSuggestion") to
  5248. // include in API requests with the JSON null value. By default, fields
  5249. // with empty values are omitted from API requests. However, any field
  5250. // with an empty value appearing in NullFields will be sent to the
  5251. // server as null. It is an error if a field in this list has a
  5252. // non-empty value. This may be used to include null fields in Patch
  5253. // requests.
  5254. NullFields []string `json:"-"`
  5255. }
  5256. func (s *SuggestResult) MarshalJSON() ([]byte, error) {
  5257. type NoMethod SuggestResult
  5258. raw := NoMethod(*s)
  5259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5260. }
  5261. // TextOperatorOptions: Used to provide a search operator for text
  5262. // properties. This is optional.
  5263. // Search operators let users restrict the query to specific fields
  5264. // relevant
  5265. // to the type of item being searched.
  5266. type TextOperatorOptions struct {
  5267. // ExactMatchWithOperator: If true, the text value will be tokenized as
  5268. // one atomic value in
  5269. // operator searches and facet matches. For example, if the operator
  5270. // name is
  5271. // "genre" and the value is "science-fiction" the query
  5272. // restrictions
  5273. // "genre:science" and "genre:fiction" will not match the
  5274. // item;
  5275. // "genre:science-fiction" will. Value matching is case-sensitive
  5276. // and does not remove special characters.
  5277. // If false, the text will be tokenized. For example, if the value
  5278. // is
  5279. // "science-fiction" the queries "genre:science" and "genre:fiction"
  5280. // will
  5281. // match the item.
  5282. ExactMatchWithOperator bool `json:"exactMatchWithOperator,omitempty"`
  5283. // OperatorName: Indicates the operator name required in the query in
  5284. // order to isolate the
  5285. // text property. For example, if operatorName is *subject* and
  5286. // the
  5287. // property's name is *subjectLine*, then queries
  5288. // like
  5289. // *subject:&lt;value&gt;* will show results only where the value of
  5290. // the
  5291. // property named *subjectLine* matches *&lt;value&gt;*. By contrast,
  5292. // a
  5293. // search that uses the same *&lt;value&gt;* without an operator will
  5294. // return
  5295. // all items where *&lt;value&gt;* matches the value of any
  5296. // text properties or text within the content field for the item.
  5297. // The operator name can only contain lowercase letters (a-z).
  5298. // The maximum length is 32 characters.
  5299. OperatorName string `json:"operatorName,omitempty"`
  5300. // ForceSendFields is a list of field names (e.g.
  5301. // "ExactMatchWithOperator") to unconditionally include in API requests.
  5302. // By default, fields with empty values are omitted from API requests.
  5303. // However, any non-pointer, non-interface field appearing in
  5304. // ForceSendFields will be sent to the server regardless of whether the
  5305. // field is empty or not. This may be used to include empty fields in
  5306. // Patch requests.
  5307. ForceSendFields []string `json:"-"`
  5308. // NullFields is a list of field names (e.g. "ExactMatchWithOperator")
  5309. // to include in API requests with the JSON null value. By default,
  5310. // fields with empty values are omitted from API requests. However, any
  5311. // field with an empty value appearing in NullFields will be sent to the
  5312. // server as null. It is an error if a field in this list has a
  5313. // non-empty value. This may be used to include null fields in Patch
  5314. // requests.
  5315. NullFields []string `json:"-"`
  5316. }
  5317. func (s *TextOperatorOptions) MarshalJSON() ([]byte, error) {
  5318. type NoMethod TextOperatorOptions
  5319. raw := NoMethod(*s)
  5320. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5321. }
  5322. // TextPropertyOptions: Options for text properties.
  5323. type TextPropertyOptions struct {
  5324. // OperatorOptions: If set, describes how the property should be used as
  5325. // a search operator.
  5326. OperatorOptions *TextOperatorOptions `json:"operatorOptions,omitempty"`
  5327. // RetrievalImportance: Indicates the search quality importance of the
  5328. // tokens within the
  5329. // field when used for retrieval.
  5330. RetrievalImportance *RetrievalImportance `json:"retrievalImportance,omitempty"`
  5331. // ForceSendFields is a list of field names (e.g. "OperatorOptions") to
  5332. // unconditionally include in API requests. By default, fields with
  5333. // empty values are omitted from API requests. However, any non-pointer,
  5334. // non-interface field appearing in ForceSendFields will be sent to the
  5335. // server regardless of whether the field is empty or not. This may be
  5336. // used to include empty fields in Patch requests.
  5337. ForceSendFields []string `json:"-"`
  5338. // NullFields is a list of field names (e.g. "OperatorOptions") to
  5339. // include in API requests with the JSON null value. By default, fields
  5340. // with empty values are omitted from API requests. However, any field
  5341. // with an empty value appearing in NullFields will be sent to the
  5342. // server as null. It is an error if a field in this list has a
  5343. // non-empty value. This may be used to include null fields in Patch
  5344. // requests.
  5345. NullFields []string `json:"-"`
  5346. }
  5347. func (s *TextPropertyOptions) MarshalJSON() ([]byte, error) {
  5348. type NoMethod TextPropertyOptions
  5349. raw := NoMethod(*s)
  5350. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5351. }
  5352. // TextValues: List of text values.
  5353. type TextValues struct {
  5354. // Values: The maximum allowable length for text values is 2048
  5355. // characters.
  5356. Values []string `json:"values,omitempty"`
  5357. // ForceSendFields is a list of field names (e.g. "Values") to
  5358. // unconditionally include in API requests. By default, fields with
  5359. // empty values are omitted from API requests. However, any non-pointer,
  5360. // non-interface field appearing in ForceSendFields will be sent to the
  5361. // server regardless of whether the field is empty or not. This may be
  5362. // used to include empty fields in Patch requests.
  5363. ForceSendFields []string `json:"-"`
  5364. // NullFields is a list of field names (e.g. "Values") to include in API
  5365. // requests with the JSON null value. By default, fields with empty
  5366. // values are omitted from API requests. However, any field with an
  5367. // empty value appearing in NullFields will be sent to the server as
  5368. // null. It is an error if a field in this list has a non-empty value.
  5369. // This may be used to include null fields in Patch requests.
  5370. NullFields []string `json:"-"`
  5371. }
  5372. func (s *TextValues) MarshalJSON() ([]byte, error) {
  5373. type NoMethod TextValues
  5374. raw := NoMethod(*s)
  5375. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5376. }
  5377. // TimestampOperatorOptions: Used to provide a search operator for
  5378. // timestamp properties. This is
  5379. // optional. Search operators let users restrict the query to specific
  5380. // fields
  5381. // relevant to the type of item being searched.
  5382. type TimestampOperatorOptions struct {
  5383. // GreaterThanOperatorName: Indicates the operator name required in the
  5384. // query in order to isolate the
  5385. // timestamp property using the greater-than operator. For example,
  5386. // if
  5387. // greaterThanOperatorName is *closedafter* and the property's name
  5388. // is
  5389. // *closeDate*, then queries like *closedafter:&lt;value&gt;* will
  5390. // show results only where the value of the property named *closeDate*
  5391. // is
  5392. // later than *&lt;value&gt;*.
  5393. // The operator name can only contain lowercase letters (a-z).
  5394. // The maximum length is 32 characters.
  5395. GreaterThanOperatorName string `json:"greaterThanOperatorName,omitempty"`
  5396. // LessThanOperatorName: Indicates the operator name required in the
  5397. // query in order to isolate the
  5398. // timestamp property using the less-than operator. For example,
  5399. // if
  5400. // lessThanOperatorName is *closedbefore* and the property's name
  5401. // is
  5402. // *closeDate*, then queries like *closedbefore:&lt;value&gt;* will
  5403. // show results only where the value of the property named *closeDate*
  5404. // is
  5405. // earlier than *&lt;value&gt;*.
  5406. // The operator name can only contain lowercase letters (a-z).
  5407. // The maximum length is 32 characters.
  5408. LessThanOperatorName string `json:"lessThanOperatorName,omitempty"`
  5409. // OperatorName: Indicates the operator name required in the query in
  5410. // order to isolate the
  5411. // timestamp property. For example, if operatorName is *closedon* and
  5412. // the
  5413. // property's name is *closeDate*, then queries
  5414. // like
  5415. // *closedon:&lt;value&gt;* will show results only where the value of
  5416. // the
  5417. // property named *closeDate* matches *&lt;value&gt;*. By contrast,
  5418. // a
  5419. // search that uses the same *&lt;value&gt;* without an operator will
  5420. // return
  5421. // all items where *&lt;value&gt;* matches the value of any
  5422. // String
  5423. // properties or text within the content field for the item. The
  5424. // operator
  5425. // name can only contain lowercase letters (a-z). The maximum length is
  5426. // 32
  5427. // characters.
  5428. OperatorName string `json:"operatorName,omitempty"`
  5429. // ForceSendFields is a list of field names (e.g.
  5430. // "GreaterThanOperatorName") to unconditionally include in API
  5431. // requests. By default, fields with empty values are omitted from API
  5432. // requests. However, any non-pointer, non-interface field appearing in
  5433. // ForceSendFields will be sent to the server regardless of whether the
  5434. // field is empty or not. This may be used to include empty fields in
  5435. // Patch requests.
  5436. ForceSendFields []string `json:"-"`
  5437. // NullFields is a list of field names (e.g. "GreaterThanOperatorName")
  5438. // to include in API requests with the JSON null value. By default,
  5439. // fields with empty values are omitted from API requests. However, any
  5440. // field with an empty value appearing in NullFields will be sent to the
  5441. // server as null. It is an error if a field in this list has a
  5442. // non-empty value. This may be used to include null fields in Patch
  5443. // requests.
  5444. NullFields []string `json:"-"`
  5445. }
  5446. func (s *TimestampOperatorOptions) MarshalJSON() ([]byte, error) {
  5447. type NoMethod TimestampOperatorOptions
  5448. raw := NoMethod(*s)
  5449. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5450. }
  5451. // TimestampPropertyOptions: Options for timestamp properties.
  5452. type TimestampPropertyOptions struct {
  5453. // OperatorOptions: If set, describes how the timestamp should be used
  5454. // as a search operator.
  5455. OperatorOptions *TimestampOperatorOptions `json:"operatorOptions,omitempty"`
  5456. // ForceSendFields is a list of field names (e.g. "OperatorOptions") to
  5457. // unconditionally include in API requests. By default, fields with
  5458. // empty values are omitted from API requests. However, any non-pointer,
  5459. // non-interface field appearing in ForceSendFields will be sent to the
  5460. // server regardless of whether the field is empty or not. This may be
  5461. // used to include empty fields in Patch requests.
  5462. ForceSendFields []string `json:"-"`
  5463. // NullFields is a list of field names (e.g. "OperatorOptions") to
  5464. // include in API requests with the JSON null value. By default, fields
  5465. // with empty values are omitted from API requests. However, any field
  5466. // with an empty value appearing in NullFields will be sent to the
  5467. // server as null. It is an error if a field in this list has a
  5468. // non-empty value. This may be used to include null fields in Patch
  5469. // requests.
  5470. NullFields []string `json:"-"`
  5471. }
  5472. func (s *TimestampPropertyOptions) MarshalJSON() ([]byte, error) {
  5473. type NoMethod TimestampPropertyOptions
  5474. raw := NoMethod(*s)
  5475. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5476. }
  5477. // TimestampValues: List of timestamp values.
  5478. type TimestampValues struct {
  5479. Values []string `json:"values,omitempty"`
  5480. // ForceSendFields is a list of field names (e.g. "Values") to
  5481. // unconditionally include in API requests. By default, fields with
  5482. // empty values are omitted from API requests. However, any non-pointer,
  5483. // non-interface field appearing in ForceSendFields will be sent to the
  5484. // server regardless of whether the field is empty or not. This may be
  5485. // used to include empty fields in Patch requests.
  5486. ForceSendFields []string `json:"-"`
  5487. // NullFields is a list of field names (e.g. "Values") to include in API
  5488. // requests with the JSON null value. By default, fields with empty
  5489. // values are omitted from API requests. However, any field with an
  5490. // empty value appearing in NullFields will be sent to the server as
  5491. // null. It is an error if a field in this list has a non-empty value.
  5492. // This may be used to include null fields in Patch requests.
  5493. NullFields []string `json:"-"`
  5494. }
  5495. func (s *TimestampValues) MarshalJSON() ([]byte, error) {
  5496. type NoMethod TimestampValues
  5497. raw := NoMethod(*s)
  5498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5499. }
  5500. type UnmappedIdentity struct {
  5501. // ExternalIdentity: The resource name for an external user.
  5502. ExternalIdentity *Principal `json:"externalIdentity,omitempty"`
  5503. // ResolutionStatusCode: The resolution status for the external
  5504. // identity.
  5505. //
  5506. // Possible values:
  5507. // "CODE_UNSPECIFIED" - Input-only value. Used to list all unmapped
  5508. // identities regardless of
  5509. // status.
  5510. // "NOT_FOUND" - The unmapped identity was not found in IDaaS, and
  5511. // needs to be provided by
  5512. // the user.
  5513. // "IDENTITY_SOURCE_NOT_FOUND" - The identity source associated with
  5514. // the identity was either not found or
  5515. // deleted.
  5516. // "IDENTITY_SOURCE_MISCONFIGURED" - IDaaS does not understand the
  5517. // identity source, probably because the
  5518. // schema was modified in a non compatible way.
  5519. // "TOO_MANY_MAPPINGS_FOUND" - The number of users associated with the
  5520. // external identity is too large.
  5521. // "INTERNAL_ERROR" - Internal error.
  5522. ResolutionStatusCode string `json:"resolutionStatusCode,omitempty"`
  5523. // ForceSendFields is a list of field names (e.g. "ExternalIdentity") to
  5524. // unconditionally include in API requests. By default, fields with
  5525. // empty values are omitted from API requests. However, any non-pointer,
  5526. // non-interface field appearing in ForceSendFields will be sent to the
  5527. // server regardless of whether the field is empty or not. This may be
  5528. // used to include empty fields in Patch requests.
  5529. ForceSendFields []string `json:"-"`
  5530. // NullFields is a list of field names (e.g. "ExternalIdentity") to
  5531. // include in API requests with the JSON null value. By default, fields
  5532. // with empty values are omitted from API requests. However, any field
  5533. // with an empty value appearing in NullFields will be sent to the
  5534. // server as null. It is an error if a field in this list has a
  5535. // non-empty value. This may be used to include null fields in Patch
  5536. // requests.
  5537. NullFields []string `json:"-"`
  5538. }
  5539. func (s *UnmappedIdentity) MarshalJSON() ([]byte, error) {
  5540. type NoMethod UnmappedIdentity
  5541. raw := NoMethod(*s)
  5542. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5543. }
  5544. type UnreserveItemsRequest struct {
  5545. // ConnectorName: Name of connector making this call.
  5546. // <br />Format: datasources/{source_id}/connectors/{ID}
  5547. ConnectorName string `json:"connectorName,omitempty"`
  5548. // DebugOptions: Common debug options.
  5549. DebugOptions *DebugOptions `json:"debugOptions,omitempty"`
  5550. // Queue: Name of a queue to unreserve items from.
  5551. Queue string `json:"queue,omitempty"`
  5552. // ForceSendFields is a list of field names (e.g. "ConnectorName") to
  5553. // unconditionally include in API requests. By default, fields with
  5554. // empty values are omitted from API requests. However, any non-pointer,
  5555. // non-interface field appearing in ForceSendFields will be sent to the
  5556. // server regardless of whether the field is empty or not. This may be
  5557. // used to include empty fields in Patch requests.
  5558. ForceSendFields []string `json:"-"`
  5559. // NullFields is a list of field names (e.g. "ConnectorName") to include
  5560. // in API requests with the JSON null value. By default, fields with
  5561. // empty values are omitted from API requests. However, any field with
  5562. // an empty value appearing in NullFields will be sent to the server as
  5563. // null. It is an error if a field in this list has a non-empty value.
  5564. // This may be used to include null fields in Patch requests.
  5565. NullFields []string `json:"-"`
  5566. }
  5567. func (s *UnreserveItemsRequest) MarshalJSON() ([]byte, error) {
  5568. type NoMethod UnreserveItemsRequest
  5569. raw := NoMethod(*s)
  5570. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5571. }
  5572. type UpdateDataSourceRequest struct {
  5573. // DebugOptions: Common debug options.
  5574. DebugOptions *DebugOptions `json:"debugOptions,omitempty"`
  5575. Source *DataSource `json:"source,omitempty"`
  5576. // ForceSendFields is a list of field names (e.g. "DebugOptions") to
  5577. // unconditionally include in API requests. By default, fields with
  5578. // empty values are omitted from API requests. However, any non-pointer,
  5579. // non-interface field appearing in ForceSendFields will be sent to the
  5580. // server regardless of whether the field is empty or not. This may be
  5581. // used to include empty fields in Patch requests.
  5582. ForceSendFields []string `json:"-"`
  5583. // NullFields is a list of field names (e.g. "DebugOptions") to include
  5584. // in API requests with the JSON null value. By default, fields with
  5585. // empty values are omitted from API requests. However, any field with
  5586. // an empty value appearing in NullFields will be sent to the server as
  5587. // null. It is an error if a field in this list has a non-empty value.
  5588. // This may be used to include null fields in Patch requests.
  5589. NullFields []string `json:"-"`
  5590. }
  5591. func (s *UpdateDataSourceRequest) MarshalJSON() ([]byte, error) {
  5592. type NoMethod UpdateDataSourceRequest
  5593. raw := NoMethod(*s)
  5594. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5595. }
  5596. type UpdateSchemaRequest struct {
  5597. // DebugOptions: Common debug options.
  5598. DebugOptions *DebugOptions `json:"debugOptions,omitempty"`
  5599. // Schema: The new schema for the source.
  5600. Schema *Schema `json:"schema,omitempty"`
  5601. // ValidateOnly: If true, the request will be validated without side
  5602. // effects.
  5603. ValidateOnly bool `json:"validateOnly,omitempty"`
  5604. // ForceSendFields is a list of field names (e.g. "DebugOptions") to
  5605. // unconditionally include in API requests. By default, fields with
  5606. // empty values are omitted from API requests. However, any non-pointer,
  5607. // non-interface field appearing in ForceSendFields will be sent to the
  5608. // server regardless of whether the field is empty or not. This may be
  5609. // used to include empty fields in Patch requests.
  5610. ForceSendFields []string `json:"-"`
  5611. // NullFields is a list of field names (e.g. "DebugOptions") to include
  5612. // in API requests with the JSON null value. By default, fields with
  5613. // empty values are omitted from API requests. However, any field with
  5614. // an empty value appearing in NullFields will be sent to the server as
  5615. // null. It is an error if a field in this list has a non-empty value.
  5616. // This may be used to include null fields in Patch requests.
  5617. NullFields []string `json:"-"`
  5618. }
  5619. func (s *UpdateSchemaRequest) MarshalJSON() ([]byte, error) {
  5620. type NoMethod UpdateSchemaRequest
  5621. raw := NoMethod(*s)
  5622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5623. }
  5624. // UploadItemRef: Represents an upload session reference.
  5625. // This reference is created via upload
  5626. // method.
  5627. // Updating of item content may refer to this uploaded content
  5628. // via
  5629. // contentDataRef.
  5630. type UploadItemRef struct {
  5631. // Name: Name of the content reference.
  5632. // The maximum length is 2048 characters.
  5633. Name string `json:"name,omitempty"`
  5634. // ServerResponse contains the HTTP response code and headers from the
  5635. // server.
  5636. googleapi.ServerResponse `json:"-"`
  5637. // ForceSendFields is a list of field names (e.g. "Name") to
  5638. // unconditionally include in API requests. By default, fields with
  5639. // empty values are omitted from API requests. However, any non-pointer,
  5640. // non-interface field appearing in ForceSendFields will be sent to the
  5641. // server regardless of whether the field is empty or not. This may be
  5642. // used to include empty fields in Patch requests.
  5643. ForceSendFields []string `json:"-"`
  5644. // NullFields is a list of field names (e.g. "Name") to include in API
  5645. // requests with the JSON null value. By default, fields with empty
  5646. // values are omitted from API requests. However, any field with an
  5647. // empty value appearing in NullFields will be sent to the server as
  5648. // null. It is an error if a field in this list has a non-empty value.
  5649. // This may be used to include null fields in Patch requests.
  5650. NullFields []string `json:"-"`
  5651. }
  5652. func (s *UploadItemRef) MarshalJSON() ([]byte, error) {
  5653. type NoMethod UploadItemRef
  5654. raw := NoMethod(*s)
  5655. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5656. }
  5657. // Value: Definition of a single value with generic type.
  5658. type Value struct {
  5659. BooleanValue bool `json:"booleanValue,omitempty"`
  5660. DateValue *Date `json:"dateValue,omitempty"`
  5661. DoubleValue float64 `json:"doubleValue,omitempty"`
  5662. IntegerValue int64 `json:"integerValue,omitempty,string"`
  5663. StringValue string `json:"stringValue,omitempty"`
  5664. TimestampValue string `json:"timestampValue,omitempty"`
  5665. // ForceSendFields is a list of field names (e.g. "BooleanValue") to
  5666. // unconditionally include in API requests. By default, fields with
  5667. // empty values are omitted from API requests. However, any non-pointer,
  5668. // non-interface field appearing in ForceSendFields will be sent to the
  5669. // server regardless of whether the field is empty or not. This may be
  5670. // used to include empty fields in Patch requests.
  5671. ForceSendFields []string `json:"-"`
  5672. // NullFields is a list of field names (e.g. "BooleanValue") to include
  5673. // in API requests with the JSON null value. By default, fields with
  5674. // empty values are omitted from API requests. However, any field with
  5675. // an empty value appearing in NullFields will be sent to the server as
  5676. // null. It is an error if a field in this list has a non-empty value.
  5677. // This may be used to include null fields in Patch requests.
  5678. NullFields []string `json:"-"`
  5679. }
  5680. func (s *Value) MarshalJSON() ([]byte, error) {
  5681. type NoMethod Value
  5682. raw := NoMethod(*s)
  5683. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5684. }
  5685. func (s *Value) UnmarshalJSON(data []byte) error {
  5686. type NoMethod Value
  5687. var s1 struct {
  5688. DoubleValue gensupport.JSONFloat64 `json:"doubleValue"`
  5689. *NoMethod
  5690. }
  5691. s1.NoMethod = (*NoMethod)(s)
  5692. if err := json.Unmarshal(data, &s1); err != nil {
  5693. return err
  5694. }
  5695. s.DoubleValue = float64(s1.DoubleValue)
  5696. return nil
  5697. }
  5698. type ValueFilter struct {
  5699. // OperatorName: The `operator_name` applied to the query, such as
  5700. // *price_greater_than*.
  5701. // The filter can work against both types of filters defined in the
  5702. // schema
  5703. // for your data source:
  5704. // <br/><br/>
  5705. // 1. `operator_name`, where the query filters results by the
  5706. // property
  5707. // that matches the value.
  5708. // <br/>
  5709. // 2. `greater_than_operator_name` or `less_than_operator_name` in
  5710. // your
  5711. // schema. The query filters the results for the property values that
  5712. // are
  5713. // greater than or less than the supplied value in the query.
  5714. OperatorName string `json:"operatorName,omitempty"`
  5715. // Value: The value to be compared with.
  5716. Value *Value `json:"value,omitempty"`
  5717. // ForceSendFields is a list of field names (e.g. "OperatorName") to
  5718. // unconditionally include in API requests. By default, fields with
  5719. // empty values are omitted from API requests. However, any non-pointer,
  5720. // non-interface field appearing in ForceSendFields will be sent to the
  5721. // server regardless of whether the field is empty or not. This may be
  5722. // used to include empty fields in Patch requests.
  5723. ForceSendFields []string `json:"-"`
  5724. // NullFields is a list of field names (e.g. "OperatorName") to include
  5725. // in API requests with the JSON null value. By default, fields with
  5726. // empty values are omitted from API requests. However, any field with
  5727. // an empty value appearing in NullFields will be sent to the server as
  5728. // null. It is an error if a field in this list has a non-empty value.
  5729. // This may be used to include null fields in Patch requests.
  5730. NullFields []string `json:"-"`
  5731. }
  5732. func (s *ValueFilter) MarshalJSON() ([]byte, error) {
  5733. type NoMethod ValueFilter
  5734. raw := NoMethod(*s)
  5735. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5736. }
  5737. // method id "cloudsearch.debug.datasources.items.checkAccess":
  5738. type DebugDatasourcesItemsCheckAccessCall struct {
  5739. s *Service
  5740. name string
  5741. principal *Principal
  5742. urlParams_ gensupport.URLParams
  5743. ctx_ context.Context
  5744. header_ http.Header
  5745. }
  5746. // CheckAccess: Checks whether an item is accessible by specified
  5747. // principal.
  5748. func (r *DebugDatasourcesItemsService) CheckAccess(name string, principal *Principal) *DebugDatasourcesItemsCheckAccessCall {
  5749. c := &DebugDatasourcesItemsCheckAccessCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5750. c.name = name
  5751. c.principal = principal
  5752. return c
  5753. }
  5754. // DebugOptionsEnableDebugging sets the optional parameter
  5755. // "debugOptions.enableDebugging": If set, the request will enable
  5756. // debugging features of Cloud Search.
  5757. // Only turn on this field, if asked by Google to help with debugging.
  5758. func (c *DebugDatasourcesItemsCheckAccessCall) DebugOptionsEnableDebugging(debugOptionsEnableDebugging bool) *DebugDatasourcesItemsCheckAccessCall {
  5759. c.urlParams_.Set("debugOptions.enableDebugging", fmt.Sprint(debugOptionsEnableDebugging))
  5760. return c
  5761. }
  5762. // Fields allows partial responses to be retrieved. See
  5763. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5764. // for more information.
  5765. func (c *DebugDatasourcesItemsCheckAccessCall) Fields(s ...googleapi.Field) *DebugDatasourcesItemsCheckAccessCall {
  5766. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5767. return c
  5768. }
  5769. // Context sets the context to be used in this call's Do method. Any
  5770. // pending HTTP request will be aborted if the provided context is
  5771. // canceled.
  5772. func (c *DebugDatasourcesItemsCheckAccessCall) Context(ctx context.Context) *DebugDatasourcesItemsCheckAccessCall {
  5773. c.ctx_ = ctx
  5774. return c
  5775. }
  5776. // Header returns an http.Header that can be modified by the caller to
  5777. // add HTTP headers to the request.
  5778. func (c *DebugDatasourcesItemsCheckAccessCall) Header() http.Header {
  5779. if c.header_ == nil {
  5780. c.header_ = make(http.Header)
  5781. }
  5782. return c.header_
  5783. }
  5784. func (c *DebugDatasourcesItemsCheckAccessCall) doRequest(alt string) (*http.Response, error) {
  5785. reqHeaders := make(http.Header)
  5786. for k, v := range c.header_ {
  5787. reqHeaders[k] = v
  5788. }
  5789. reqHeaders.Set("User-Agent", c.s.userAgent())
  5790. var body io.Reader = nil
  5791. body, err := googleapi.WithoutDataWrapper.JSONReader(c.principal)
  5792. if err != nil {
  5793. return nil, err
  5794. }
  5795. reqHeaders.Set("Content-Type", "application/json")
  5796. c.urlParams_.Set("alt", alt)
  5797. c.urlParams_.Set("prettyPrint", "false")
  5798. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/debug/{+name}:checkAccess")
  5799. urls += "?" + c.urlParams_.Encode()
  5800. req, err := http.NewRequest("POST", urls, body)
  5801. if err != nil {
  5802. return nil, err
  5803. }
  5804. req.Header = reqHeaders
  5805. googleapi.Expand(req.URL, map[string]string{
  5806. "name": c.name,
  5807. })
  5808. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5809. }
  5810. // Do executes the "cloudsearch.debug.datasources.items.checkAccess" call.
  5811. // Exactly one of *CheckAccessResponse or error will be non-nil. Any
  5812. // non-2xx status code is an error. Response headers are in either
  5813. // *CheckAccessResponse.ServerResponse.Header or (if a response was
  5814. // returned at all) in error.(*googleapi.Error).Header. Use
  5815. // googleapi.IsNotModified to check whether the returned error was
  5816. // because http.StatusNotModified was returned.
  5817. func (c *DebugDatasourcesItemsCheckAccessCall) Do(opts ...googleapi.CallOption) (*CheckAccessResponse, error) {
  5818. gensupport.SetOptions(c.urlParams_, opts...)
  5819. res, err := c.doRequest("json")
  5820. if res != nil && res.StatusCode == http.StatusNotModified {
  5821. if res.Body != nil {
  5822. res.Body.Close()
  5823. }
  5824. return nil, &googleapi.Error{
  5825. Code: res.StatusCode,
  5826. Header: res.Header,
  5827. }
  5828. }
  5829. if err != nil {
  5830. return nil, err
  5831. }
  5832. defer googleapi.CloseBody(res)
  5833. if err := googleapi.CheckResponse(res); err != nil {
  5834. return nil, err
  5835. }
  5836. ret := &CheckAccessResponse{
  5837. ServerResponse: googleapi.ServerResponse{
  5838. Header: res.Header,
  5839. HTTPStatusCode: res.StatusCode,
  5840. },
  5841. }
  5842. target := &ret
  5843. if err := gensupport.DecodeResponse(target, res); err != nil {
  5844. return nil, err
  5845. }
  5846. return ret, nil
  5847. // {
  5848. // "description": "Checks whether an item is accessible by specified principal.",
  5849. // "flatPath": "v1/debug/datasources/{datasourcesId}/items/{itemsId}:checkAccess",
  5850. // "httpMethod": "POST",
  5851. // "id": "cloudsearch.debug.datasources.items.checkAccess",
  5852. // "parameterOrder": [
  5853. // "name"
  5854. // ],
  5855. // "parameters": {
  5856. // "debugOptions.enableDebugging": {
  5857. // "description": "If set, the request will enable debugging features of Cloud Search.\nOnly turn on this field, if asked by Google to help with debugging.",
  5858. // "location": "query",
  5859. // "type": "boolean"
  5860. // },
  5861. // "name": {
  5862. // "description": "Item name, format:\ndatasources/{source_id}/items/{item_id}",
  5863. // "location": "path",
  5864. // "pattern": "^datasources/[^/]+/items/[^/]+$",
  5865. // "required": true,
  5866. // "type": "string"
  5867. // }
  5868. // },
  5869. // "path": "v1/debug/{+name}:checkAccess",
  5870. // "request": {
  5871. // "$ref": "Principal"
  5872. // },
  5873. // "response": {
  5874. // "$ref": "CheckAccessResponse"
  5875. // },
  5876. // "scopes": [
  5877. // "https://www.googleapis.com/auth/cloud_search",
  5878. // "https://www.googleapis.com/auth/cloud_search.debug"
  5879. // ]
  5880. // }
  5881. }
  5882. // method id "cloudsearch.debug.datasources.items.searchByViewUrl":
  5883. type DebugDatasourcesItemsSearchByViewUrlCall struct {
  5884. s *Service
  5885. name string
  5886. searchitemsbyviewurlrequest *SearchItemsByViewUrlRequest
  5887. urlParams_ gensupport.URLParams
  5888. ctx_ context.Context
  5889. header_ http.Header
  5890. }
  5891. // SearchByViewUrl: Fetches the item whose viewUrl exactly matches that
  5892. // of the URL provided
  5893. // in the request.
  5894. func (r *DebugDatasourcesItemsService) SearchByViewUrl(name string, searchitemsbyviewurlrequest *SearchItemsByViewUrlRequest) *DebugDatasourcesItemsSearchByViewUrlCall {
  5895. c := &DebugDatasourcesItemsSearchByViewUrlCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5896. c.name = name
  5897. c.searchitemsbyviewurlrequest = searchitemsbyviewurlrequest
  5898. return c
  5899. }
  5900. // Fields allows partial responses to be retrieved. See
  5901. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5902. // for more information.
  5903. func (c *DebugDatasourcesItemsSearchByViewUrlCall) Fields(s ...googleapi.Field) *DebugDatasourcesItemsSearchByViewUrlCall {
  5904. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5905. return c
  5906. }
  5907. // Context sets the context to be used in this call's Do method. Any
  5908. // pending HTTP request will be aborted if the provided context is
  5909. // canceled.
  5910. func (c *DebugDatasourcesItemsSearchByViewUrlCall) Context(ctx context.Context) *DebugDatasourcesItemsSearchByViewUrlCall {
  5911. c.ctx_ = ctx
  5912. return c
  5913. }
  5914. // Header returns an http.Header that can be modified by the caller to
  5915. // add HTTP headers to the request.
  5916. func (c *DebugDatasourcesItemsSearchByViewUrlCall) Header() http.Header {
  5917. if c.header_ == nil {
  5918. c.header_ = make(http.Header)
  5919. }
  5920. return c.header_
  5921. }
  5922. func (c *DebugDatasourcesItemsSearchByViewUrlCall) doRequest(alt string) (*http.Response, error) {
  5923. reqHeaders := make(http.Header)
  5924. for k, v := range c.header_ {
  5925. reqHeaders[k] = v
  5926. }
  5927. reqHeaders.Set("User-Agent", c.s.userAgent())
  5928. var body io.Reader = nil
  5929. body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchitemsbyviewurlrequest)
  5930. if err != nil {
  5931. return nil, err
  5932. }
  5933. reqHeaders.Set("Content-Type", "application/json")
  5934. c.urlParams_.Set("alt", alt)
  5935. c.urlParams_.Set("prettyPrint", "false")
  5936. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/debug/{+name}/items:searchByViewUrl")
  5937. urls += "?" + c.urlParams_.Encode()
  5938. req, err := http.NewRequest("POST", urls, body)
  5939. if err != nil {
  5940. return nil, err
  5941. }
  5942. req.Header = reqHeaders
  5943. googleapi.Expand(req.URL, map[string]string{
  5944. "name": c.name,
  5945. })
  5946. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5947. }
  5948. // Do executes the "cloudsearch.debug.datasources.items.searchByViewUrl" call.
  5949. // Exactly one of *SearchItemsByViewUrlResponse or error will be
  5950. // non-nil. Any non-2xx status code is an error. Response headers are in
  5951. // either *SearchItemsByViewUrlResponse.ServerResponse.Header or (if a
  5952. // response was returned at all) in error.(*googleapi.Error).Header. Use
  5953. // googleapi.IsNotModified to check whether the returned error was
  5954. // because http.StatusNotModified was returned.
  5955. func (c *DebugDatasourcesItemsSearchByViewUrlCall) Do(opts ...googleapi.CallOption) (*SearchItemsByViewUrlResponse, error) {
  5956. gensupport.SetOptions(c.urlParams_, opts...)
  5957. res, err := c.doRequest("json")
  5958. if res != nil && res.StatusCode == http.StatusNotModified {
  5959. if res.Body != nil {
  5960. res.Body.Close()
  5961. }
  5962. return nil, &googleapi.Error{
  5963. Code: res.StatusCode,
  5964. Header: res.Header,
  5965. }
  5966. }
  5967. if err != nil {
  5968. return nil, err
  5969. }
  5970. defer googleapi.CloseBody(res)
  5971. if err := googleapi.CheckResponse(res); err != nil {
  5972. return nil, err
  5973. }
  5974. ret := &SearchItemsByViewUrlResponse{
  5975. ServerResponse: googleapi.ServerResponse{
  5976. Header: res.Header,
  5977. HTTPStatusCode: res.StatusCode,
  5978. },
  5979. }
  5980. target := &ret
  5981. if err := gensupport.DecodeResponse(target, res); err != nil {
  5982. return nil, err
  5983. }
  5984. return ret, nil
  5985. // {
  5986. // "description": "Fetches the item whose viewUrl exactly matches that of the URL provided\nin the request.",
  5987. // "flatPath": "v1/debug/datasources/{datasourcesId}/items:searchByViewUrl",
  5988. // "httpMethod": "POST",
  5989. // "id": "cloudsearch.debug.datasources.items.searchByViewUrl",
  5990. // "parameterOrder": [
  5991. // "name"
  5992. // ],
  5993. // "parameters": {
  5994. // "name": {
  5995. // "description": "Source name, format:\ndatasources/{source_id}",
  5996. // "location": "path",
  5997. // "pattern": "^datasources/[^/]+$",
  5998. // "required": true,
  5999. // "type": "string"
  6000. // }
  6001. // },
  6002. // "path": "v1/debug/{+name}/items:searchByViewUrl",
  6003. // "request": {
  6004. // "$ref": "SearchItemsByViewUrlRequest"
  6005. // },
  6006. // "response": {
  6007. // "$ref": "SearchItemsByViewUrlResponse"
  6008. // },
  6009. // "scopes": [
  6010. // "https://www.googleapis.com/auth/cloud_search",
  6011. // "https://www.googleapis.com/auth/cloud_search.debug"
  6012. // ]
  6013. // }
  6014. }
  6015. // Pages invokes f for each page of results.
  6016. // A non-nil error returned from f will halt the iteration.
  6017. // The provided context supersedes any context provided to the Context method.
  6018. func (c *DebugDatasourcesItemsSearchByViewUrlCall) Pages(ctx context.Context, f func(*SearchItemsByViewUrlResponse) error) error {
  6019. c.ctx_ = ctx
  6020. defer func(pt string) { c.searchitemsbyviewurlrequest.PageToken = pt }(c.searchitemsbyviewurlrequest.PageToken) // reset paging to original point
  6021. for {
  6022. x, err := c.Do()
  6023. if err != nil {
  6024. return err
  6025. }
  6026. if err := f(x); err != nil {
  6027. return err
  6028. }
  6029. if x.NextPageToken == "" {
  6030. return nil
  6031. }
  6032. c.searchitemsbyviewurlrequest.PageToken = x.NextPageToken
  6033. }
  6034. }
  6035. // method id "cloudsearch.debug.datasources.items.unmappedids.list":
  6036. type DebugDatasourcesItemsUnmappedidsListCall struct {
  6037. s *Service
  6038. parent string
  6039. urlParams_ gensupport.URLParams
  6040. ifNoneMatch_ string
  6041. ctx_ context.Context
  6042. header_ http.Header
  6043. }
  6044. // List: List all unmapped identities for a specific item.
  6045. func (r *DebugDatasourcesItemsUnmappedidsService) List(parent string) *DebugDatasourcesItemsUnmappedidsListCall {
  6046. c := &DebugDatasourcesItemsUnmappedidsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6047. c.parent = parent
  6048. return c
  6049. }
  6050. // DebugOptionsEnableDebugging sets the optional parameter
  6051. // "debugOptions.enableDebugging": If set, the request will enable
  6052. // debugging features of Cloud Search.
  6053. // Only turn on this field, if asked by Google to help with debugging.
  6054. func (c *DebugDatasourcesItemsUnmappedidsListCall) DebugOptionsEnableDebugging(debugOptionsEnableDebugging bool) *DebugDatasourcesItemsUnmappedidsListCall {
  6055. c.urlParams_.Set("debugOptions.enableDebugging", fmt.Sprint(debugOptionsEnableDebugging))
  6056. return c
  6057. }
  6058. // PageSize sets the optional parameter "pageSize": Maximum number of
  6059. // items to fetch in a request.
  6060. // Defaults to 100.
  6061. func (c *DebugDatasourcesItemsUnmappedidsListCall) PageSize(pageSize int64) *DebugDatasourcesItemsUnmappedidsListCall {
  6062. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6063. return c
  6064. }
  6065. // PageToken sets the optional parameter "pageToken": The
  6066. // next_page_token value returned from a previous List request, if any.
  6067. func (c *DebugDatasourcesItemsUnmappedidsListCall) PageToken(pageToken string) *DebugDatasourcesItemsUnmappedidsListCall {
  6068. c.urlParams_.Set("pageToken", pageToken)
  6069. return c
  6070. }
  6071. // Fields allows partial responses to be retrieved. See
  6072. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6073. // for more information.
  6074. func (c *DebugDatasourcesItemsUnmappedidsListCall) Fields(s ...googleapi.Field) *DebugDatasourcesItemsUnmappedidsListCall {
  6075. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6076. return c
  6077. }
  6078. // IfNoneMatch sets the optional parameter which makes the operation
  6079. // fail if the object's ETag matches the given value. This is useful for
  6080. // getting updates only after the object has changed since the last
  6081. // request. Use googleapi.IsNotModified to check whether the response
  6082. // error from Do is the result of In-None-Match.
  6083. func (c *DebugDatasourcesItemsUnmappedidsListCall) IfNoneMatch(entityTag string) *DebugDatasourcesItemsUnmappedidsListCall {
  6084. c.ifNoneMatch_ = entityTag
  6085. return c
  6086. }
  6087. // Context sets the context to be used in this call's Do method. Any
  6088. // pending HTTP request will be aborted if the provided context is
  6089. // canceled.
  6090. func (c *DebugDatasourcesItemsUnmappedidsListCall) Context(ctx context.Context) *DebugDatasourcesItemsUnmappedidsListCall {
  6091. c.ctx_ = ctx
  6092. return c
  6093. }
  6094. // Header returns an http.Header that can be modified by the caller to
  6095. // add HTTP headers to the request.
  6096. func (c *DebugDatasourcesItemsUnmappedidsListCall) Header() http.Header {
  6097. if c.header_ == nil {
  6098. c.header_ = make(http.Header)
  6099. }
  6100. return c.header_
  6101. }
  6102. func (c *DebugDatasourcesItemsUnmappedidsListCall) doRequest(alt string) (*http.Response, error) {
  6103. reqHeaders := make(http.Header)
  6104. for k, v := range c.header_ {
  6105. reqHeaders[k] = v
  6106. }
  6107. reqHeaders.Set("User-Agent", c.s.userAgent())
  6108. if c.ifNoneMatch_ != "" {
  6109. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6110. }
  6111. var body io.Reader = nil
  6112. c.urlParams_.Set("alt", alt)
  6113. c.urlParams_.Set("prettyPrint", "false")
  6114. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/debug/{+parent}/unmappedids")
  6115. urls += "?" + c.urlParams_.Encode()
  6116. req, err := http.NewRequest("GET", urls, body)
  6117. if err != nil {
  6118. return nil, err
  6119. }
  6120. req.Header = reqHeaders
  6121. googleapi.Expand(req.URL, map[string]string{
  6122. "parent": c.parent,
  6123. })
  6124. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6125. }
  6126. // Do executes the "cloudsearch.debug.datasources.items.unmappedids.list" call.
  6127. // Exactly one of *ListUnmappedIdentitiesResponse or error will be
  6128. // non-nil. Any non-2xx status code is an error. Response headers are in
  6129. // either *ListUnmappedIdentitiesResponse.ServerResponse.Header or (if a
  6130. // response was returned at all) in error.(*googleapi.Error).Header. Use
  6131. // googleapi.IsNotModified to check whether the returned error was
  6132. // because http.StatusNotModified was returned.
  6133. func (c *DebugDatasourcesItemsUnmappedidsListCall) Do(opts ...googleapi.CallOption) (*ListUnmappedIdentitiesResponse, error) {
  6134. gensupport.SetOptions(c.urlParams_, opts...)
  6135. res, err := c.doRequest("json")
  6136. if res != nil && res.StatusCode == http.StatusNotModified {
  6137. if res.Body != nil {
  6138. res.Body.Close()
  6139. }
  6140. return nil, &googleapi.Error{
  6141. Code: res.StatusCode,
  6142. Header: res.Header,
  6143. }
  6144. }
  6145. if err != nil {
  6146. return nil, err
  6147. }
  6148. defer googleapi.CloseBody(res)
  6149. if err := googleapi.CheckResponse(res); err != nil {
  6150. return nil, err
  6151. }
  6152. ret := &ListUnmappedIdentitiesResponse{
  6153. ServerResponse: googleapi.ServerResponse{
  6154. Header: res.Header,
  6155. HTTPStatusCode: res.StatusCode,
  6156. },
  6157. }
  6158. target := &ret
  6159. if err := gensupport.DecodeResponse(target, res); err != nil {
  6160. return nil, err
  6161. }
  6162. return ret, nil
  6163. // {
  6164. // "description": "List all unmapped identities for a specific item.",
  6165. // "flatPath": "v1/debug/datasources/{datasourcesId}/items/{itemsId}/unmappedids",
  6166. // "httpMethod": "GET",
  6167. // "id": "cloudsearch.debug.datasources.items.unmappedids.list",
  6168. // "parameterOrder": [
  6169. // "parent"
  6170. // ],
  6171. // "parameters": {
  6172. // "debugOptions.enableDebugging": {
  6173. // "description": "If set, the request will enable debugging features of Cloud Search.\nOnly turn on this field, if asked by Google to help with debugging.",
  6174. // "location": "query",
  6175. // "type": "boolean"
  6176. // },
  6177. // "pageSize": {
  6178. // "description": "Maximum number of items to fetch in a request.\nDefaults to 100.",
  6179. // "format": "int32",
  6180. // "location": "query",
  6181. // "type": "integer"
  6182. // },
  6183. // "pageToken": {
  6184. // "description": "The next_page_token value returned from a previous List request, if any.",
  6185. // "location": "query",
  6186. // "type": "string"
  6187. // },
  6188. // "parent": {
  6189. // "description": "The name of the item, in the following format:\ndatasources/{source_id}/items/{ID}",
  6190. // "location": "path",
  6191. // "pattern": "^datasources/[^/]+/items/[^/]+$",
  6192. // "required": true,
  6193. // "type": "string"
  6194. // }
  6195. // },
  6196. // "path": "v1/debug/{+parent}/unmappedids",
  6197. // "response": {
  6198. // "$ref": "ListUnmappedIdentitiesResponse"
  6199. // },
  6200. // "scopes": [
  6201. // "https://www.googleapis.com/auth/cloud_search",
  6202. // "https://www.googleapis.com/auth/cloud_search.debug"
  6203. // ]
  6204. // }
  6205. }
  6206. // Pages invokes f for each page of results.
  6207. // A non-nil error returned from f will halt the iteration.
  6208. // The provided context supersedes any context provided to the Context method.
  6209. func (c *DebugDatasourcesItemsUnmappedidsListCall) Pages(ctx context.Context, f func(*ListUnmappedIdentitiesResponse) error) error {
  6210. c.ctx_ = ctx
  6211. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6212. for {
  6213. x, err := c.Do()
  6214. if err != nil {
  6215. return err
  6216. }
  6217. if err := f(x); err != nil {
  6218. return err
  6219. }
  6220. if x.NextPageToken == "" {
  6221. return nil
  6222. }
  6223. c.PageToken(x.NextPageToken)
  6224. }
  6225. }
  6226. // method id "cloudsearch.debug.identitysources.items.listForunmappedidentity":
  6227. type DebugIdentitysourcesItemsListForunmappedidentityCall struct {
  6228. s *Service
  6229. parent string
  6230. urlParams_ gensupport.URLParams
  6231. ifNoneMatch_ string
  6232. ctx_ context.Context
  6233. header_ http.Header
  6234. }
  6235. // ListForunmappedidentity: Lists names of items associated with an
  6236. // unmapped identity.
  6237. func (r *DebugIdentitysourcesItemsService) ListForunmappedidentity(parent string) *DebugIdentitysourcesItemsListForunmappedidentityCall {
  6238. c := &DebugIdentitysourcesItemsListForunmappedidentityCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6239. c.parent = parent
  6240. return c
  6241. }
  6242. // DebugOptionsEnableDebugging sets the optional parameter
  6243. // "debugOptions.enableDebugging": If set, the request will enable
  6244. // debugging features of Cloud Search.
  6245. // Only turn on this field, if asked by Google to help with debugging.
  6246. func (c *DebugIdentitysourcesItemsListForunmappedidentityCall) DebugOptionsEnableDebugging(debugOptionsEnableDebugging bool) *DebugIdentitysourcesItemsListForunmappedidentityCall {
  6247. c.urlParams_.Set("debugOptions.enableDebugging", fmt.Sprint(debugOptionsEnableDebugging))
  6248. return c
  6249. }
  6250. // GroupResourceName sets the optional parameter "groupResourceName":
  6251. func (c *DebugIdentitysourcesItemsListForunmappedidentityCall) GroupResourceName(groupResourceName string) *DebugIdentitysourcesItemsListForunmappedidentityCall {
  6252. c.urlParams_.Set("groupResourceName", groupResourceName)
  6253. return c
  6254. }
  6255. // PageSize sets the optional parameter "pageSize": Maximum number of
  6256. // items to fetch in a request.
  6257. // Defaults to 100.
  6258. func (c *DebugIdentitysourcesItemsListForunmappedidentityCall) PageSize(pageSize int64) *DebugIdentitysourcesItemsListForunmappedidentityCall {
  6259. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6260. return c
  6261. }
  6262. // PageToken sets the optional parameter "pageToken": The
  6263. // next_page_token value returned from a previous List request, if any.
  6264. func (c *DebugIdentitysourcesItemsListForunmappedidentityCall) PageToken(pageToken string) *DebugIdentitysourcesItemsListForunmappedidentityCall {
  6265. c.urlParams_.Set("pageToken", pageToken)
  6266. return c
  6267. }
  6268. // UserResourceName sets the optional parameter "userResourceName":
  6269. func (c *DebugIdentitysourcesItemsListForunmappedidentityCall) UserResourceName(userResourceName string) *DebugIdentitysourcesItemsListForunmappedidentityCall {
  6270. c.urlParams_.Set("userResourceName", userResourceName)
  6271. return c
  6272. }
  6273. // Fields allows partial responses to be retrieved. See
  6274. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6275. // for more information.
  6276. func (c *DebugIdentitysourcesItemsListForunmappedidentityCall) Fields(s ...googleapi.Field) *DebugIdentitysourcesItemsListForunmappedidentityCall {
  6277. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6278. return c
  6279. }
  6280. // IfNoneMatch sets the optional parameter which makes the operation
  6281. // fail if the object's ETag matches the given value. This is useful for
  6282. // getting updates only after the object has changed since the last
  6283. // request. Use googleapi.IsNotModified to check whether the response
  6284. // error from Do is the result of In-None-Match.
  6285. func (c *DebugIdentitysourcesItemsListForunmappedidentityCall) IfNoneMatch(entityTag string) *DebugIdentitysourcesItemsListForunmappedidentityCall {
  6286. c.ifNoneMatch_ = entityTag
  6287. return c
  6288. }
  6289. // Context sets the context to be used in this call's Do method. Any
  6290. // pending HTTP request will be aborted if the provided context is
  6291. // canceled.
  6292. func (c *DebugIdentitysourcesItemsListForunmappedidentityCall) Context(ctx context.Context) *DebugIdentitysourcesItemsListForunmappedidentityCall {
  6293. c.ctx_ = ctx
  6294. return c
  6295. }
  6296. // Header returns an http.Header that can be modified by the caller to
  6297. // add HTTP headers to the request.
  6298. func (c *DebugIdentitysourcesItemsListForunmappedidentityCall) Header() http.Header {
  6299. if c.header_ == nil {
  6300. c.header_ = make(http.Header)
  6301. }
  6302. return c.header_
  6303. }
  6304. func (c *DebugIdentitysourcesItemsListForunmappedidentityCall) doRequest(alt string) (*http.Response, error) {
  6305. reqHeaders := make(http.Header)
  6306. for k, v := range c.header_ {
  6307. reqHeaders[k] = v
  6308. }
  6309. reqHeaders.Set("User-Agent", c.s.userAgent())
  6310. if c.ifNoneMatch_ != "" {
  6311. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6312. }
  6313. var body io.Reader = nil
  6314. c.urlParams_.Set("alt", alt)
  6315. c.urlParams_.Set("prettyPrint", "false")
  6316. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/debug/{+parent}/items:forunmappedidentity")
  6317. urls += "?" + c.urlParams_.Encode()
  6318. req, err := http.NewRequest("GET", urls, body)
  6319. if err != nil {
  6320. return nil, err
  6321. }
  6322. req.Header = reqHeaders
  6323. googleapi.Expand(req.URL, map[string]string{
  6324. "parent": c.parent,
  6325. })
  6326. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6327. }
  6328. // Do executes the "cloudsearch.debug.identitysources.items.listForunmappedidentity" call.
  6329. // Exactly one of *ListItemNamesForUnmappedIdentityResponse or error
  6330. // will be non-nil. Any non-2xx status code is an error. Response
  6331. // headers are in either
  6332. // *ListItemNamesForUnmappedIdentityResponse.ServerResponse.Header or
  6333. // (if a response was returned at all) in
  6334. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6335. // whether the returned error was because http.StatusNotModified was
  6336. // returned.
  6337. func (c *DebugIdentitysourcesItemsListForunmappedidentityCall) Do(opts ...googleapi.CallOption) (*ListItemNamesForUnmappedIdentityResponse, error) {
  6338. gensupport.SetOptions(c.urlParams_, opts...)
  6339. res, err := c.doRequest("json")
  6340. if res != nil && res.StatusCode == http.StatusNotModified {
  6341. if res.Body != nil {
  6342. res.Body.Close()
  6343. }
  6344. return nil, &googleapi.Error{
  6345. Code: res.StatusCode,
  6346. Header: res.Header,
  6347. }
  6348. }
  6349. if err != nil {
  6350. return nil, err
  6351. }
  6352. defer googleapi.CloseBody(res)
  6353. if err := googleapi.CheckResponse(res); err != nil {
  6354. return nil, err
  6355. }
  6356. ret := &ListItemNamesForUnmappedIdentityResponse{
  6357. ServerResponse: googleapi.ServerResponse{
  6358. Header: res.Header,
  6359. HTTPStatusCode: res.StatusCode,
  6360. },
  6361. }
  6362. target := &ret
  6363. if err := gensupport.DecodeResponse(target, res); err != nil {
  6364. return nil, err
  6365. }
  6366. return ret, nil
  6367. // {
  6368. // "description": "Lists names of items associated with an unmapped identity.",
  6369. // "flatPath": "v1/debug/identitysources/{identitysourcesId}/items:forunmappedidentity",
  6370. // "httpMethod": "GET",
  6371. // "id": "cloudsearch.debug.identitysources.items.listForunmappedidentity",
  6372. // "parameterOrder": [
  6373. // "parent"
  6374. // ],
  6375. // "parameters": {
  6376. // "debugOptions.enableDebugging": {
  6377. // "description": "If set, the request will enable debugging features of Cloud Search.\nOnly turn on this field, if asked by Google to help with debugging.",
  6378. // "location": "query",
  6379. // "type": "boolean"
  6380. // },
  6381. // "groupResourceName": {
  6382. // "location": "query",
  6383. // "type": "string"
  6384. // },
  6385. // "pageSize": {
  6386. // "description": "Maximum number of items to fetch in a request.\nDefaults to 100.",
  6387. // "format": "int32",
  6388. // "location": "query",
  6389. // "type": "integer"
  6390. // },
  6391. // "pageToken": {
  6392. // "description": "The next_page_token value returned from a previous List request, if any.",
  6393. // "location": "query",
  6394. // "type": "string"
  6395. // },
  6396. // "parent": {
  6397. // "description": "The name of the identity source, in the following format:\nidentitysources/{source_id}}",
  6398. // "location": "path",
  6399. // "pattern": "^identitysources/[^/]+$",
  6400. // "required": true,
  6401. // "type": "string"
  6402. // },
  6403. // "userResourceName": {
  6404. // "location": "query",
  6405. // "type": "string"
  6406. // }
  6407. // },
  6408. // "path": "v1/debug/{+parent}/items:forunmappedidentity",
  6409. // "response": {
  6410. // "$ref": "ListItemNamesForUnmappedIdentityResponse"
  6411. // },
  6412. // "scopes": [
  6413. // "https://www.googleapis.com/auth/cloud_search",
  6414. // "https://www.googleapis.com/auth/cloud_search.debug"
  6415. // ]
  6416. // }
  6417. }
  6418. // Pages invokes f for each page of results.
  6419. // A non-nil error returned from f will halt the iteration.
  6420. // The provided context supersedes any context provided to the Context method.
  6421. func (c *DebugIdentitysourcesItemsListForunmappedidentityCall) Pages(ctx context.Context, f func(*ListItemNamesForUnmappedIdentityResponse) error) error {
  6422. c.ctx_ = ctx
  6423. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6424. for {
  6425. x, err := c.Do()
  6426. if err != nil {
  6427. return err
  6428. }
  6429. if err := f(x); err != nil {
  6430. return err
  6431. }
  6432. if x.NextPageToken == "" {
  6433. return nil
  6434. }
  6435. c.PageToken(x.NextPageToken)
  6436. }
  6437. }
  6438. // method id "cloudsearch.debug.identitysources.unmappedids.list":
  6439. type DebugIdentitysourcesUnmappedidsListCall struct {
  6440. s *Service
  6441. parent string
  6442. urlParams_ gensupport.URLParams
  6443. ifNoneMatch_ string
  6444. ctx_ context.Context
  6445. header_ http.Header
  6446. }
  6447. // List: Lists unmapped user identities for an identity source.
  6448. func (r *DebugIdentitysourcesUnmappedidsService) List(parent string) *DebugIdentitysourcesUnmappedidsListCall {
  6449. c := &DebugIdentitysourcesUnmappedidsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6450. c.parent = parent
  6451. return c
  6452. }
  6453. // DebugOptionsEnableDebugging sets the optional parameter
  6454. // "debugOptions.enableDebugging": If set, the request will enable
  6455. // debugging features of Cloud Search.
  6456. // Only turn on this field, if asked by Google to help with debugging.
  6457. func (c *DebugIdentitysourcesUnmappedidsListCall) DebugOptionsEnableDebugging(debugOptionsEnableDebugging bool) *DebugIdentitysourcesUnmappedidsListCall {
  6458. c.urlParams_.Set("debugOptions.enableDebugging", fmt.Sprint(debugOptionsEnableDebugging))
  6459. return c
  6460. }
  6461. // PageSize sets the optional parameter "pageSize": Maximum number of
  6462. // items to fetch in a request.
  6463. // Defaults to 100.
  6464. func (c *DebugIdentitysourcesUnmappedidsListCall) PageSize(pageSize int64) *DebugIdentitysourcesUnmappedidsListCall {
  6465. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6466. return c
  6467. }
  6468. // PageToken sets the optional parameter "pageToken": The
  6469. // next_page_token value returned from a previous List request, if any.
  6470. func (c *DebugIdentitysourcesUnmappedidsListCall) PageToken(pageToken string) *DebugIdentitysourcesUnmappedidsListCall {
  6471. c.urlParams_.Set("pageToken", pageToken)
  6472. return c
  6473. }
  6474. // ResolutionStatusCode sets the optional parameter
  6475. // "resolutionStatusCode": Limit users selection to this status.
  6476. //
  6477. // Possible values:
  6478. // "CODE_UNSPECIFIED"
  6479. // "NOT_FOUND"
  6480. // "IDENTITY_SOURCE_NOT_FOUND"
  6481. // "IDENTITY_SOURCE_MISCONFIGURED"
  6482. // "TOO_MANY_MAPPINGS_FOUND"
  6483. // "INTERNAL_ERROR"
  6484. func (c *DebugIdentitysourcesUnmappedidsListCall) ResolutionStatusCode(resolutionStatusCode string) *DebugIdentitysourcesUnmappedidsListCall {
  6485. c.urlParams_.Set("resolutionStatusCode", resolutionStatusCode)
  6486. return c
  6487. }
  6488. // Fields allows partial responses to be retrieved. See
  6489. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6490. // for more information.
  6491. func (c *DebugIdentitysourcesUnmappedidsListCall) Fields(s ...googleapi.Field) *DebugIdentitysourcesUnmappedidsListCall {
  6492. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6493. return c
  6494. }
  6495. // IfNoneMatch sets the optional parameter which makes the operation
  6496. // fail if the object's ETag matches the given value. This is useful for
  6497. // getting updates only after the object has changed since the last
  6498. // request. Use googleapi.IsNotModified to check whether the response
  6499. // error from Do is the result of In-None-Match.
  6500. func (c *DebugIdentitysourcesUnmappedidsListCall) IfNoneMatch(entityTag string) *DebugIdentitysourcesUnmappedidsListCall {
  6501. c.ifNoneMatch_ = entityTag
  6502. return c
  6503. }
  6504. // Context sets the context to be used in this call's Do method. Any
  6505. // pending HTTP request will be aborted if the provided context is
  6506. // canceled.
  6507. func (c *DebugIdentitysourcesUnmappedidsListCall) Context(ctx context.Context) *DebugIdentitysourcesUnmappedidsListCall {
  6508. c.ctx_ = ctx
  6509. return c
  6510. }
  6511. // Header returns an http.Header that can be modified by the caller to
  6512. // add HTTP headers to the request.
  6513. func (c *DebugIdentitysourcesUnmappedidsListCall) Header() http.Header {
  6514. if c.header_ == nil {
  6515. c.header_ = make(http.Header)
  6516. }
  6517. return c.header_
  6518. }
  6519. func (c *DebugIdentitysourcesUnmappedidsListCall) doRequest(alt string) (*http.Response, error) {
  6520. reqHeaders := make(http.Header)
  6521. for k, v := range c.header_ {
  6522. reqHeaders[k] = v
  6523. }
  6524. reqHeaders.Set("User-Agent", c.s.userAgent())
  6525. if c.ifNoneMatch_ != "" {
  6526. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6527. }
  6528. var body io.Reader = nil
  6529. c.urlParams_.Set("alt", alt)
  6530. c.urlParams_.Set("prettyPrint", "false")
  6531. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/debug/{+parent}/unmappedids")
  6532. urls += "?" + c.urlParams_.Encode()
  6533. req, err := http.NewRequest("GET", urls, body)
  6534. if err != nil {
  6535. return nil, err
  6536. }
  6537. req.Header = reqHeaders
  6538. googleapi.Expand(req.URL, map[string]string{
  6539. "parent": c.parent,
  6540. })
  6541. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6542. }
  6543. // Do executes the "cloudsearch.debug.identitysources.unmappedids.list" call.
  6544. // Exactly one of *ListUnmappedIdentitiesResponse or error will be
  6545. // non-nil. Any non-2xx status code is an error. Response headers are in
  6546. // either *ListUnmappedIdentitiesResponse.ServerResponse.Header or (if a
  6547. // response was returned at all) in error.(*googleapi.Error).Header. Use
  6548. // googleapi.IsNotModified to check whether the returned error was
  6549. // because http.StatusNotModified was returned.
  6550. func (c *DebugIdentitysourcesUnmappedidsListCall) Do(opts ...googleapi.CallOption) (*ListUnmappedIdentitiesResponse, error) {
  6551. gensupport.SetOptions(c.urlParams_, opts...)
  6552. res, err := c.doRequest("json")
  6553. if res != nil && res.StatusCode == http.StatusNotModified {
  6554. if res.Body != nil {
  6555. res.Body.Close()
  6556. }
  6557. return nil, &googleapi.Error{
  6558. Code: res.StatusCode,
  6559. Header: res.Header,
  6560. }
  6561. }
  6562. if err != nil {
  6563. return nil, err
  6564. }
  6565. defer googleapi.CloseBody(res)
  6566. if err := googleapi.CheckResponse(res); err != nil {
  6567. return nil, err
  6568. }
  6569. ret := &ListUnmappedIdentitiesResponse{
  6570. ServerResponse: googleapi.ServerResponse{
  6571. Header: res.Header,
  6572. HTTPStatusCode: res.StatusCode,
  6573. },
  6574. }
  6575. target := &ret
  6576. if err := gensupport.DecodeResponse(target, res); err != nil {
  6577. return nil, err
  6578. }
  6579. return ret, nil
  6580. // {
  6581. // "description": "Lists unmapped user identities for an identity source.",
  6582. // "flatPath": "v1/debug/identitysources/{identitysourcesId}/unmappedids",
  6583. // "httpMethod": "GET",
  6584. // "id": "cloudsearch.debug.identitysources.unmappedids.list",
  6585. // "parameterOrder": [
  6586. // "parent"
  6587. // ],
  6588. // "parameters": {
  6589. // "debugOptions.enableDebugging": {
  6590. // "description": "If set, the request will enable debugging features of Cloud Search.\nOnly turn on this field, if asked by Google to help with debugging.",
  6591. // "location": "query",
  6592. // "type": "boolean"
  6593. // },
  6594. // "pageSize": {
  6595. // "description": "Maximum number of items to fetch in a request.\nDefaults to 100.",
  6596. // "format": "int32",
  6597. // "location": "query",
  6598. // "type": "integer"
  6599. // },
  6600. // "pageToken": {
  6601. // "description": "The next_page_token value returned from a previous List request, if any.",
  6602. // "location": "query",
  6603. // "type": "string"
  6604. // },
  6605. // "parent": {
  6606. // "description": "The name of the identity source, in the following format:\nidentitysources/{source_id}",
  6607. // "location": "path",
  6608. // "pattern": "^identitysources/[^/]+$",
  6609. // "required": true,
  6610. // "type": "string"
  6611. // },
  6612. // "resolutionStatusCode": {
  6613. // "description": "Limit users selection to this status.",
  6614. // "enum": [
  6615. // "CODE_UNSPECIFIED",
  6616. // "NOT_FOUND",
  6617. // "IDENTITY_SOURCE_NOT_FOUND",
  6618. // "IDENTITY_SOURCE_MISCONFIGURED",
  6619. // "TOO_MANY_MAPPINGS_FOUND",
  6620. // "INTERNAL_ERROR"
  6621. // ],
  6622. // "location": "query",
  6623. // "type": "string"
  6624. // }
  6625. // },
  6626. // "path": "v1/debug/{+parent}/unmappedids",
  6627. // "response": {
  6628. // "$ref": "ListUnmappedIdentitiesResponse"
  6629. // },
  6630. // "scopes": [
  6631. // "https://www.googleapis.com/auth/cloud_search",
  6632. // "https://www.googleapis.com/auth/cloud_search.debug"
  6633. // ]
  6634. // }
  6635. }
  6636. // Pages invokes f for each page of results.
  6637. // A non-nil error returned from f will halt the iteration.
  6638. // The provided context supersedes any context provided to the Context method.
  6639. func (c *DebugIdentitysourcesUnmappedidsListCall) Pages(ctx context.Context, f func(*ListUnmappedIdentitiesResponse) error) error {
  6640. c.ctx_ = ctx
  6641. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6642. for {
  6643. x, err := c.Do()
  6644. if err != nil {
  6645. return err
  6646. }
  6647. if err := f(x); err != nil {
  6648. return err
  6649. }
  6650. if x.NextPageToken == "" {
  6651. return nil
  6652. }
  6653. c.PageToken(x.NextPageToken)
  6654. }
  6655. }
  6656. // method id "cloudsearch.indexing.datasources.deleteSchema":
  6657. type IndexingDatasourcesDeleteSchemaCall struct {
  6658. s *Service
  6659. name string
  6660. urlParams_ gensupport.URLParams
  6661. ctx_ context.Context
  6662. header_ http.Header
  6663. }
  6664. // DeleteSchema: Deletes the schema of a data source.
  6665. func (r *IndexingDatasourcesService) DeleteSchema(name string) *IndexingDatasourcesDeleteSchemaCall {
  6666. c := &IndexingDatasourcesDeleteSchemaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6667. c.name = name
  6668. return c
  6669. }
  6670. // DebugOptionsEnableDebugging sets the optional parameter
  6671. // "debugOptions.enableDebugging": If set, the request will enable
  6672. // debugging features of Cloud Search.
  6673. // Only turn on this field, if asked by Google to help with debugging.
  6674. func (c *IndexingDatasourcesDeleteSchemaCall) DebugOptionsEnableDebugging(debugOptionsEnableDebugging bool) *IndexingDatasourcesDeleteSchemaCall {
  6675. c.urlParams_.Set("debugOptions.enableDebugging", fmt.Sprint(debugOptionsEnableDebugging))
  6676. return c
  6677. }
  6678. // Fields allows partial responses to be retrieved. See
  6679. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6680. // for more information.
  6681. func (c *IndexingDatasourcesDeleteSchemaCall) Fields(s ...googleapi.Field) *IndexingDatasourcesDeleteSchemaCall {
  6682. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6683. return c
  6684. }
  6685. // Context sets the context to be used in this call's Do method. Any
  6686. // pending HTTP request will be aborted if the provided context is
  6687. // canceled.
  6688. func (c *IndexingDatasourcesDeleteSchemaCall) Context(ctx context.Context) *IndexingDatasourcesDeleteSchemaCall {
  6689. c.ctx_ = ctx
  6690. return c
  6691. }
  6692. // Header returns an http.Header that can be modified by the caller to
  6693. // add HTTP headers to the request.
  6694. func (c *IndexingDatasourcesDeleteSchemaCall) Header() http.Header {
  6695. if c.header_ == nil {
  6696. c.header_ = make(http.Header)
  6697. }
  6698. return c.header_
  6699. }
  6700. func (c *IndexingDatasourcesDeleteSchemaCall) doRequest(alt string) (*http.Response, error) {
  6701. reqHeaders := make(http.Header)
  6702. for k, v := range c.header_ {
  6703. reqHeaders[k] = v
  6704. }
  6705. reqHeaders.Set("User-Agent", c.s.userAgent())
  6706. var body io.Reader = nil
  6707. c.urlParams_.Set("alt", alt)
  6708. c.urlParams_.Set("prettyPrint", "false")
  6709. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/indexing/{+name}/schema")
  6710. urls += "?" + c.urlParams_.Encode()
  6711. req, err := http.NewRequest("DELETE", urls, body)
  6712. if err != nil {
  6713. return nil, err
  6714. }
  6715. req.Header = reqHeaders
  6716. googleapi.Expand(req.URL, map[string]string{
  6717. "name": c.name,
  6718. })
  6719. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6720. }
  6721. // Do executes the "cloudsearch.indexing.datasources.deleteSchema" call.
  6722. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6723. // status code is an error. Response headers are in either
  6724. // *Operation.ServerResponse.Header or (if a response was returned at
  6725. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6726. // to check whether the returned error was because
  6727. // http.StatusNotModified was returned.
  6728. func (c *IndexingDatasourcesDeleteSchemaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6729. gensupport.SetOptions(c.urlParams_, opts...)
  6730. res, err := c.doRequest("json")
  6731. if res != nil && res.StatusCode == http.StatusNotModified {
  6732. if res.Body != nil {
  6733. res.Body.Close()
  6734. }
  6735. return nil, &googleapi.Error{
  6736. Code: res.StatusCode,
  6737. Header: res.Header,
  6738. }
  6739. }
  6740. if err != nil {
  6741. return nil, err
  6742. }
  6743. defer googleapi.CloseBody(res)
  6744. if err := googleapi.CheckResponse(res); err != nil {
  6745. return nil, err
  6746. }
  6747. ret := &Operation{
  6748. ServerResponse: googleapi.ServerResponse{
  6749. Header: res.Header,
  6750. HTTPStatusCode: res.StatusCode,
  6751. },
  6752. }
  6753. target := &ret
  6754. if err := gensupport.DecodeResponse(target, res); err != nil {
  6755. return nil, err
  6756. }
  6757. return ret, nil
  6758. // {
  6759. // "description": "Deletes the schema of a data source.",
  6760. // "flatPath": "v1/indexing/datasources/{datasourcesId}/schema",
  6761. // "httpMethod": "DELETE",
  6762. // "id": "cloudsearch.indexing.datasources.deleteSchema",
  6763. // "parameterOrder": [
  6764. // "name"
  6765. // ],
  6766. // "parameters": {
  6767. // "debugOptions.enableDebugging": {
  6768. // "description": "If set, the request will enable debugging features of Cloud Search.\nOnly turn on this field, if asked by Google to help with debugging.",
  6769. // "location": "query",
  6770. // "type": "boolean"
  6771. // },
  6772. // "name": {
  6773. // "description": "Name of the data source to delete Schema. Format:\ndatasources/{source_id}",
  6774. // "location": "path",
  6775. // "pattern": "^datasources/[^/]+$",
  6776. // "required": true,
  6777. // "type": "string"
  6778. // }
  6779. // },
  6780. // "path": "v1/indexing/{+name}/schema",
  6781. // "response": {
  6782. // "$ref": "Operation"
  6783. // },
  6784. // "scopes": [
  6785. // "https://www.googleapis.com/auth/cloud_search",
  6786. // "https://www.googleapis.com/auth/cloud_search.settings",
  6787. // "https://www.googleapis.com/auth/cloud_search.settings.indexing"
  6788. // ]
  6789. // }
  6790. }
  6791. // method id "cloudsearch.indexing.datasources.getSchema":
  6792. type IndexingDatasourcesGetSchemaCall struct {
  6793. s *Service
  6794. name string
  6795. urlParams_ gensupport.URLParams
  6796. ifNoneMatch_ string
  6797. ctx_ context.Context
  6798. header_ http.Header
  6799. }
  6800. // GetSchema: Gets the schema of a data source.
  6801. func (r *IndexingDatasourcesService) GetSchema(name string) *IndexingDatasourcesGetSchemaCall {
  6802. c := &IndexingDatasourcesGetSchemaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6803. c.name = name
  6804. return c
  6805. }
  6806. // DebugOptionsEnableDebugging sets the optional parameter
  6807. // "debugOptions.enableDebugging": If set, the request will enable
  6808. // debugging features of Cloud Search.
  6809. // Only turn on this field, if asked by Google to help with debugging.
  6810. func (c *IndexingDatasourcesGetSchemaCall) DebugOptionsEnableDebugging(debugOptionsEnableDebugging bool) *IndexingDatasourcesGetSchemaCall {
  6811. c.urlParams_.Set("debugOptions.enableDebugging", fmt.Sprint(debugOptionsEnableDebugging))
  6812. return c
  6813. }
  6814. // Fields allows partial responses to be retrieved. See
  6815. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6816. // for more information.
  6817. func (c *IndexingDatasourcesGetSchemaCall) Fields(s ...googleapi.Field) *IndexingDatasourcesGetSchemaCall {
  6818. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6819. return c
  6820. }
  6821. // IfNoneMatch sets the optional parameter which makes the operation
  6822. // fail if the object's ETag matches the given value. This is useful for
  6823. // getting updates only after the object has changed since the last
  6824. // request. Use googleapi.IsNotModified to check whether the response
  6825. // error from Do is the result of In-None-Match.
  6826. func (c *IndexingDatasourcesGetSchemaCall) IfNoneMatch(entityTag string) *IndexingDatasourcesGetSchemaCall {
  6827. c.ifNoneMatch_ = entityTag
  6828. return c
  6829. }
  6830. // Context sets the context to be used in this call's Do method. Any
  6831. // pending HTTP request will be aborted if the provided context is
  6832. // canceled.
  6833. func (c *IndexingDatasourcesGetSchemaCall) Context(ctx context.Context) *IndexingDatasourcesGetSchemaCall {
  6834. c.ctx_ = ctx
  6835. return c
  6836. }
  6837. // Header returns an http.Header that can be modified by the caller to
  6838. // add HTTP headers to the request.
  6839. func (c *IndexingDatasourcesGetSchemaCall) Header() http.Header {
  6840. if c.header_ == nil {
  6841. c.header_ = make(http.Header)
  6842. }
  6843. return c.header_
  6844. }
  6845. func (c *IndexingDatasourcesGetSchemaCall) doRequest(alt string) (*http.Response, error) {
  6846. reqHeaders := make(http.Header)
  6847. for k, v := range c.header_ {
  6848. reqHeaders[k] = v
  6849. }
  6850. reqHeaders.Set("User-Agent", c.s.userAgent())
  6851. if c.ifNoneMatch_ != "" {
  6852. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6853. }
  6854. var body io.Reader = nil
  6855. c.urlParams_.Set("alt", alt)
  6856. c.urlParams_.Set("prettyPrint", "false")
  6857. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/indexing/{+name}/schema")
  6858. urls += "?" + c.urlParams_.Encode()
  6859. req, err := http.NewRequest("GET", urls, body)
  6860. if err != nil {
  6861. return nil, err
  6862. }
  6863. req.Header = reqHeaders
  6864. googleapi.Expand(req.URL, map[string]string{
  6865. "name": c.name,
  6866. })
  6867. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6868. }
  6869. // Do executes the "cloudsearch.indexing.datasources.getSchema" call.
  6870. // Exactly one of *Schema or error will be non-nil. Any non-2xx status
  6871. // code is an error. Response headers are in either
  6872. // *Schema.ServerResponse.Header or (if a response was returned at all)
  6873. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6874. // check whether the returned error was because http.StatusNotModified
  6875. // was returned.
  6876. func (c *IndexingDatasourcesGetSchemaCall) Do(opts ...googleapi.CallOption) (*Schema, error) {
  6877. gensupport.SetOptions(c.urlParams_, opts...)
  6878. res, err := c.doRequest("json")
  6879. if res != nil && res.StatusCode == http.StatusNotModified {
  6880. if res.Body != nil {
  6881. res.Body.Close()
  6882. }
  6883. return nil, &googleapi.Error{
  6884. Code: res.StatusCode,
  6885. Header: res.Header,
  6886. }
  6887. }
  6888. if err != nil {
  6889. return nil, err
  6890. }
  6891. defer googleapi.CloseBody(res)
  6892. if err := googleapi.CheckResponse(res); err != nil {
  6893. return nil, err
  6894. }
  6895. ret := &Schema{
  6896. ServerResponse: googleapi.ServerResponse{
  6897. Header: res.Header,
  6898. HTTPStatusCode: res.StatusCode,
  6899. },
  6900. }
  6901. target := &ret
  6902. if err := gensupport.DecodeResponse(target, res); err != nil {
  6903. return nil, err
  6904. }
  6905. return ret, nil
  6906. // {
  6907. // "description": "Gets the schema of a data source.",
  6908. // "flatPath": "v1/indexing/datasources/{datasourcesId}/schema",
  6909. // "httpMethod": "GET",
  6910. // "id": "cloudsearch.indexing.datasources.getSchema",
  6911. // "parameterOrder": [
  6912. // "name"
  6913. // ],
  6914. // "parameters": {
  6915. // "debugOptions.enableDebugging": {
  6916. // "description": "If set, the request will enable debugging features of Cloud Search.\nOnly turn on this field, if asked by Google to help with debugging.",
  6917. // "location": "query",
  6918. // "type": "boolean"
  6919. // },
  6920. // "name": {
  6921. // "description": "Name of the data source to get Schema. Format:\ndatasources/{source_id}",
  6922. // "location": "path",
  6923. // "pattern": "^datasources/[^/]+$",
  6924. // "required": true,
  6925. // "type": "string"
  6926. // }
  6927. // },
  6928. // "path": "v1/indexing/{+name}/schema",
  6929. // "response": {
  6930. // "$ref": "Schema"
  6931. // },
  6932. // "scopes": [
  6933. // "https://www.googleapis.com/auth/cloud_search",
  6934. // "https://www.googleapis.com/auth/cloud_search.settings",
  6935. // "https://www.googleapis.com/auth/cloud_search.settings.indexing"
  6936. // ]
  6937. // }
  6938. }
  6939. // method id "cloudsearch.indexing.datasources.updateSchema":
  6940. type IndexingDatasourcesUpdateSchemaCall struct {
  6941. s *Service
  6942. name string
  6943. updateschemarequest *UpdateSchemaRequest
  6944. urlParams_ gensupport.URLParams
  6945. ctx_ context.Context
  6946. header_ http.Header
  6947. }
  6948. // UpdateSchema: Updates the schema of a data source.
  6949. func (r *IndexingDatasourcesService) UpdateSchema(name string, updateschemarequest *UpdateSchemaRequest) *IndexingDatasourcesUpdateSchemaCall {
  6950. c := &IndexingDatasourcesUpdateSchemaCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6951. c.name = name
  6952. c.updateschemarequest = updateschemarequest
  6953. return c
  6954. }
  6955. // Fields allows partial responses to be retrieved. See
  6956. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6957. // for more information.
  6958. func (c *IndexingDatasourcesUpdateSchemaCall) Fields(s ...googleapi.Field) *IndexingDatasourcesUpdateSchemaCall {
  6959. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6960. return c
  6961. }
  6962. // Context sets the context to be used in this call's Do method. Any
  6963. // pending HTTP request will be aborted if the provided context is
  6964. // canceled.
  6965. func (c *IndexingDatasourcesUpdateSchemaCall) Context(ctx context.Context) *IndexingDatasourcesUpdateSchemaCall {
  6966. c.ctx_ = ctx
  6967. return c
  6968. }
  6969. // Header returns an http.Header that can be modified by the caller to
  6970. // add HTTP headers to the request.
  6971. func (c *IndexingDatasourcesUpdateSchemaCall) Header() http.Header {
  6972. if c.header_ == nil {
  6973. c.header_ = make(http.Header)
  6974. }
  6975. return c.header_
  6976. }
  6977. func (c *IndexingDatasourcesUpdateSchemaCall) doRequest(alt string) (*http.Response, error) {
  6978. reqHeaders := make(http.Header)
  6979. for k, v := range c.header_ {
  6980. reqHeaders[k] = v
  6981. }
  6982. reqHeaders.Set("User-Agent", c.s.userAgent())
  6983. var body io.Reader = nil
  6984. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updateschemarequest)
  6985. if err != nil {
  6986. return nil, err
  6987. }
  6988. reqHeaders.Set("Content-Type", "application/json")
  6989. c.urlParams_.Set("alt", alt)
  6990. c.urlParams_.Set("prettyPrint", "false")
  6991. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/indexing/{+name}/schema")
  6992. urls += "?" + c.urlParams_.Encode()
  6993. req, err := http.NewRequest("PUT", urls, body)
  6994. if err != nil {
  6995. return nil, err
  6996. }
  6997. req.Header = reqHeaders
  6998. googleapi.Expand(req.URL, map[string]string{
  6999. "name": c.name,
  7000. })
  7001. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7002. }
  7003. // Do executes the "cloudsearch.indexing.datasources.updateSchema" call.
  7004. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7005. // status code is an error. Response headers are in either
  7006. // *Operation.ServerResponse.Header or (if a response was returned at
  7007. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7008. // to check whether the returned error was because
  7009. // http.StatusNotModified was returned.
  7010. func (c *IndexingDatasourcesUpdateSchemaCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7011. gensupport.SetOptions(c.urlParams_, opts...)
  7012. res, err := c.doRequest("json")
  7013. if res != nil && res.StatusCode == http.StatusNotModified {
  7014. if res.Body != nil {
  7015. res.Body.Close()
  7016. }
  7017. return nil, &googleapi.Error{
  7018. Code: res.StatusCode,
  7019. Header: res.Header,
  7020. }
  7021. }
  7022. if err != nil {
  7023. return nil, err
  7024. }
  7025. defer googleapi.CloseBody(res)
  7026. if err := googleapi.CheckResponse(res); err != nil {
  7027. return nil, err
  7028. }
  7029. ret := &Operation{
  7030. ServerResponse: googleapi.ServerResponse{
  7031. Header: res.Header,
  7032. HTTPStatusCode: res.StatusCode,
  7033. },
  7034. }
  7035. target := &ret
  7036. if err := gensupport.DecodeResponse(target, res); err != nil {
  7037. return nil, err
  7038. }
  7039. return ret, nil
  7040. // {
  7041. // "description": "Updates the schema of a data source.",
  7042. // "flatPath": "v1/indexing/datasources/{datasourcesId}/schema",
  7043. // "httpMethod": "PUT",
  7044. // "id": "cloudsearch.indexing.datasources.updateSchema",
  7045. // "parameterOrder": [
  7046. // "name"
  7047. // ],
  7048. // "parameters": {
  7049. // "name": {
  7050. // "description": "Name of the data source to update Schema. Format:\ndatasources/{source_id}",
  7051. // "location": "path",
  7052. // "pattern": "^datasources/[^/]+$",
  7053. // "required": true,
  7054. // "type": "string"
  7055. // }
  7056. // },
  7057. // "path": "v1/indexing/{+name}/schema",
  7058. // "request": {
  7059. // "$ref": "UpdateSchemaRequest"
  7060. // },
  7061. // "response": {
  7062. // "$ref": "Operation"
  7063. // },
  7064. // "scopes": [
  7065. // "https://www.googleapis.com/auth/cloud_search",
  7066. // "https://www.googleapis.com/auth/cloud_search.settings",
  7067. // "https://www.googleapis.com/auth/cloud_search.settings.indexing"
  7068. // ]
  7069. // }
  7070. }
  7071. // method id "cloudsearch.indexing.datasources.items.delete":
  7072. type IndexingDatasourcesItemsDeleteCall struct {
  7073. s *Service
  7074. name string
  7075. urlParams_ gensupport.URLParams
  7076. ctx_ context.Context
  7077. header_ http.Header
  7078. }
  7079. // Delete: Deletes Item resource for the
  7080. // specified resource name.
  7081. func (r *IndexingDatasourcesItemsService) Delete(name string) *IndexingDatasourcesItemsDeleteCall {
  7082. c := &IndexingDatasourcesItemsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7083. c.name = name
  7084. return c
  7085. }
  7086. // ConnectorName sets the optional parameter "connectorName": Name of
  7087. // connector making this call.
  7088. // <br />Format: datasources/{source_id}/connectors/{ID}
  7089. func (c *IndexingDatasourcesItemsDeleteCall) ConnectorName(connectorName string) *IndexingDatasourcesItemsDeleteCall {
  7090. c.urlParams_.Set("connectorName", connectorName)
  7091. return c
  7092. }
  7093. // DebugOptionsEnableDebugging sets the optional parameter
  7094. // "debugOptions.enableDebugging": If set, the request will enable
  7095. // debugging features of Cloud Search.
  7096. // Only turn on this field, if asked by Google to help with debugging.
  7097. func (c *IndexingDatasourcesItemsDeleteCall) DebugOptionsEnableDebugging(debugOptionsEnableDebugging bool) *IndexingDatasourcesItemsDeleteCall {
  7098. c.urlParams_.Set("debugOptions.enableDebugging", fmt.Sprint(debugOptionsEnableDebugging))
  7099. return c
  7100. }
  7101. // Mode sets the optional parameter "mode": Required. The RequestMode
  7102. // for this request.
  7103. //
  7104. // Possible values:
  7105. // "UNSPECIFIED"
  7106. // "SYNCHRONOUS"
  7107. // "ASYNCHRONOUS"
  7108. func (c *IndexingDatasourcesItemsDeleteCall) Mode(mode string) *IndexingDatasourcesItemsDeleteCall {
  7109. c.urlParams_.Set("mode", mode)
  7110. return c
  7111. }
  7112. // Version sets the optional parameter "version": Required. The
  7113. // incremented version of the item to delete from the index.
  7114. // The indexing system stores the version from the datasource as a
  7115. // byte string and compares the Item version in the index
  7116. // to the version of the queued Item using lexical ordering.
  7117. // <br /><br />
  7118. // Cloud Search Indexing won't delete any queued item with
  7119. // a version value that is less than or equal to
  7120. // the version of the currently indexed item.
  7121. // The maximum length for this field is 1024 bytes.
  7122. func (c *IndexingDatasourcesItemsDeleteCall) Version(version string) *IndexingDatasourcesItemsDeleteCall {
  7123. c.urlParams_.Set("version", version)
  7124. return c
  7125. }
  7126. // Fields allows partial responses to be retrieved. See
  7127. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7128. // for more information.
  7129. func (c *IndexingDatasourcesItemsDeleteCall) Fields(s ...googleapi.Field) *IndexingDatasourcesItemsDeleteCall {
  7130. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7131. return c
  7132. }
  7133. // Context sets the context to be used in this call's Do method. Any
  7134. // pending HTTP request will be aborted if the provided context is
  7135. // canceled.
  7136. func (c *IndexingDatasourcesItemsDeleteCall) Context(ctx context.Context) *IndexingDatasourcesItemsDeleteCall {
  7137. c.ctx_ = ctx
  7138. return c
  7139. }
  7140. // Header returns an http.Header that can be modified by the caller to
  7141. // add HTTP headers to the request.
  7142. func (c *IndexingDatasourcesItemsDeleteCall) Header() http.Header {
  7143. if c.header_ == nil {
  7144. c.header_ = make(http.Header)
  7145. }
  7146. return c.header_
  7147. }
  7148. func (c *IndexingDatasourcesItemsDeleteCall) doRequest(alt string) (*http.Response, error) {
  7149. reqHeaders := make(http.Header)
  7150. for k, v := range c.header_ {
  7151. reqHeaders[k] = v
  7152. }
  7153. reqHeaders.Set("User-Agent", c.s.userAgent())
  7154. var body io.Reader = nil
  7155. c.urlParams_.Set("alt", alt)
  7156. c.urlParams_.Set("prettyPrint", "false")
  7157. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/indexing/{+name}")
  7158. urls += "?" + c.urlParams_.Encode()
  7159. req, err := http.NewRequest("DELETE", urls, body)
  7160. if err != nil {
  7161. return nil, err
  7162. }
  7163. req.Header = reqHeaders
  7164. googleapi.Expand(req.URL, map[string]string{
  7165. "name": c.name,
  7166. })
  7167. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7168. }
  7169. // Do executes the "cloudsearch.indexing.datasources.items.delete" call.
  7170. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7171. // status code is an error. Response headers are in either
  7172. // *Operation.ServerResponse.Header or (if a response was returned at
  7173. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7174. // to check whether the returned error was because
  7175. // http.StatusNotModified was returned.
  7176. func (c *IndexingDatasourcesItemsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7177. gensupport.SetOptions(c.urlParams_, opts...)
  7178. res, err := c.doRequest("json")
  7179. if res != nil && res.StatusCode == http.StatusNotModified {
  7180. if res.Body != nil {
  7181. res.Body.Close()
  7182. }
  7183. return nil, &googleapi.Error{
  7184. Code: res.StatusCode,
  7185. Header: res.Header,
  7186. }
  7187. }
  7188. if err != nil {
  7189. return nil, err
  7190. }
  7191. defer googleapi.CloseBody(res)
  7192. if err := googleapi.CheckResponse(res); err != nil {
  7193. return nil, err
  7194. }
  7195. ret := &Operation{
  7196. ServerResponse: googleapi.ServerResponse{
  7197. Header: res.Header,
  7198. HTTPStatusCode: res.StatusCode,
  7199. },
  7200. }
  7201. target := &ret
  7202. if err := gensupport.DecodeResponse(target, res); err != nil {
  7203. return nil, err
  7204. }
  7205. return ret, nil
  7206. // {
  7207. // "description": "Deletes Item resource for the\nspecified resource name.",
  7208. // "flatPath": "v1/indexing/datasources/{datasourcesId}/items/{itemsId}",
  7209. // "httpMethod": "DELETE",
  7210. // "id": "cloudsearch.indexing.datasources.items.delete",
  7211. // "parameterOrder": [
  7212. // "name"
  7213. // ],
  7214. // "parameters": {
  7215. // "connectorName": {
  7216. // "description": "Name of connector making this call.\n\u003cbr /\u003eFormat: datasources/{source_id}/connectors/{ID}",
  7217. // "location": "query",
  7218. // "type": "string"
  7219. // },
  7220. // "debugOptions.enableDebugging": {
  7221. // "description": "If set, the request will enable debugging features of Cloud Search.\nOnly turn on this field, if asked by Google to help with debugging.",
  7222. // "location": "query",
  7223. // "type": "boolean"
  7224. // },
  7225. // "mode": {
  7226. // "description": "Required. The RequestMode for this request.",
  7227. // "enum": [
  7228. // "UNSPECIFIED",
  7229. // "SYNCHRONOUS",
  7230. // "ASYNCHRONOUS"
  7231. // ],
  7232. // "location": "query",
  7233. // "type": "string"
  7234. // },
  7235. // "name": {
  7236. // "description": "Required. Name of the item to delete.\nFormat: datasources/{source_id}/items/{item_id}",
  7237. // "location": "path",
  7238. // "pattern": "^datasources/[^/]+/items/[^/]+$",
  7239. // "required": true,
  7240. // "type": "string"
  7241. // },
  7242. // "version": {
  7243. // "description": "Required. The incremented version of the item to delete from the index.\nThe indexing system stores the version from the datasource as a\nbyte string and compares the Item version in the index\nto the version of the queued Item using lexical ordering.\n\u003cbr /\u003e\u003cbr /\u003e\nCloud Search Indexing won't delete any queued item with\na version value that is less than or equal to\nthe version of the currently indexed item.\nThe maximum length for this field is 1024 bytes.",
  7244. // "format": "byte",
  7245. // "location": "query",
  7246. // "type": "string"
  7247. // }
  7248. // },
  7249. // "path": "v1/indexing/{+name}",
  7250. // "response": {
  7251. // "$ref": "Operation"
  7252. // },
  7253. // "scopes": [
  7254. // "https://www.googleapis.com/auth/cloud_search",
  7255. // "https://www.googleapis.com/auth/cloud_search.indexing"
  7256. // ]
  7257. // }
  7258. }
  7259. // method id "cloudsearch.indexing.datasources.items.deleteQueueItems":
  7260. type IndexingDatasourcesItemsDeleteQueueItemsCall struct {
  7261. s *Service
  7262. name string
  7263. deletequeueitemsrequest *DeleteQueueItemsRequest
  7264. urlParams_ gensupport.URLParams
  7265. ctx_ context.Context
  7266. header_ http.Header
  7267. }
  7268. // DeleteQueueItems: Deletes all items in a queue. This method is useful
  7269. // for deleting stale
  7270. // items.
  7271. func (r *IndexingDatasourcesItemsService) DeleteQueueItems(name string, deletequeueitemsrequest *DeleteQueueItemsRequest) *IndexingDatasourcesItemsDeleteQueueItemsCall {
  7272. c := &IndexingDatasourcesItemsDeleteQueueItemsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7273. c.name = name
  7274. c.deletequeueitemsrequest = deletequeueitemsrequest
  7275. return c
  7276. }
  7277. // Fields allows partial responses to be retrieved. See
  7278. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7279. // for more information.
  7280. func (c *IndexingDatasourcesItemsDeleteQueueItemsCall) Fields(s ...googleapi.Field) *IndexingDatasourcesItemsDeleteQueueItemsCall {
  7281. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7282. return c
  7283. }
  7284. // Context sets the context to be used in this call's Do method. Any
  7285. // pending HTTP request will be aborted if the provided context is
  7286. // canceled.
  7287. func (c *IndexingDatasourcesItemsDeleteQueueItemsCall) Context(ctx context.Context) *IndexingDatasourcesItemsDeleteQueueItemsCall {
  7288. c.ctx_ = ctx
  7289. return c
  7290. }
  7291. // Header returns an http.Header that can be modified by the caller to
  7292. // add HTTP headers to the request.
  7293. func (c *IndexingDatasourcesItemsDeleteQueueItemsCall) Header() http.Header {
  7294. if c.header_ == nil {
  7295. c.header_ = make(http.Header)
  7296. }
  7297. return c.header_
  7298. }
  7299. func (c *IndexingDatasourcesItemsDeleteQueueItemsCall) doRequest(alt string) (*http.Response, error) {
  7300. reqHeaders := make(http.Header)
  7301. for k, v := range c.header_ {
  7302. reqHeaders[k] = v
  7303. }
  7304. reqHeaders.Set("User-Agent", c.s.userAgent())
  7305. var body io.Reader = nil
  7306. body, err := googleapi.WithoutDataWrapper.JSONReader(c.deletequeueitemsrequest)
  7307. if err != nil {
  7308. return nil, err
  7309. }
  7310. reqHeaders.Set("Content-Type", "application/json")
  7311. c.urlParams_.Set("alt", alt)
  7312. c.urlParams_.Set("prettyPrint", "false")
  7313. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/indexing/{+name}/items:deleteQueueItems")
  7314. urls += "?" + c.urlParams_.Encode()
  7315. req, err := http.NewRequest("POST", urls, body)
  7316. if err != nil {
  7317. return nil, err
  7318. }
  7319. req.Header = reqHeaders
  7320. googleapi.Expand(req.URL, map[string]string{
  7321. "name": c.name,
  7322. })
  7323. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7324. }
  7325. // Do executes the "cloudsearch.indexing.datasources.items.deleteQueueItems" call.
  7326. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7327. // status code is an error. Response headers are in either
  7328. // *Operation.ServerResponse.Header or (if a response was returned at
  7329. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7330. // to check whether the returned error was because
  7331. // http.StatusNotModified was returned.
  7332. func (c *IndexingDatasourcesItemsDeleteQueueItemsCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7333. gensupport.SetOptions(c.urlParams_, opts...)
  7334. res, err := c.doRequest("json")
  7335. if res != nil && res.StatusCode == http.StatusNotModified {
  7336. if res.Body != nil {
  7337. res.Body.Close()
  7338. }
  7339. return nil, &googleapi.Error{
  7340. Code: res.StatusCode,
  7341. Header: res.Header,
  7342. }
  7343. }
  7344. if err != nil {
  7345. return nil, err
  7346. }
  7347. defer googleapi.CloseBody(res)
  7348. if err := googleapi.CheckResponse(res); err != nil {
  7349. return nil, err
  7350. }
  7351. ret := &Operation{
  7352. ServerResponse: googleapi.ServerResponse{
  7353. Header: res.Header,
  7354. HTTPStatusCode: res.StatusCode,
  7355. },
  7356. }
  7357. target := &ret
  7358. if err := gensupport.DecodeResponse(target, res); err != nil {
  7359. return nil, err
  7360. }
  7361. return ret, nil
  7362. // {
  7363. // "description": "Deletes all items in a queue. This method is useful for deleting stale\nitems.",
  7364. // "flatPath": "v1/indexing/datasources/{datasourcesId}/items:deleteQueueItems",
  7365. // "httpMethod": "POST",
  7366. // "id": "cloudsearch.indexing.datasources.items.deleteQueueItems",
  7367. // "parameterOrder": [
  7368. // "name"
  7369. // ],
  7370. // "parameters": {
  7371. // "name": {
  7372. // "description": "Name of the Data Source to delete items in a queue.\nFormat: datasources/{source_id}",
  7373. // "location": "path",
  7374. // "pattern": "^datasources/[^/]+$",
  7375. // "required": true,
  7376. // "type": "string"
  7377. // }
  7378. // },
  7379. // "path": "v1/indexing/{+name}/items:deleteQueueItems",
  7380. // "request": {
  7381. // "$ref": "DeleteQueueItemsRequest"
  7382. // },
  7383. // "response": {
  7384. // "$ref": "Operation"
  7385. // },
  7386. // "scopes": [
  7387. // "https://www.googleapis.com/auth/cloud_search",
  7388. // "https://www.googleapis.com/auth/cloud_search.indexing"
  7389. // ]
  7390. // }
  7391. }
  7392. // method id "cloudsearch.indexing.datasources.items.get":
  7393. type IndexingDatasourcesItemsGetCall struct {
  7394. s *Service
  7395. name string
  7396. urlParams_ gensupport.URLParams
  7397. ifNoneMatch_ string
  7398. ctx_ context.Context
  7399. header_ http.Header
  7400. }
  7401. // Get: Gets Item resource by item name.
  7402. func (r *IndexingDatasourcesItemsService) Get(name string) *IndexingDatasourcesItemsGetCall {
  7403. c := &IndexingDatasourcesItemsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7404. c.name = name
  7405. return c
  7406. }
  7407. // ConnectorName sets the optional parameter "connectorName": Name of
  7408. // connector making this call.
  7409. // <br />Format: datasources/{source_id}/connectors/{ID}
  7410. func (c *IndexingDatasourcesItemsGetCall) ConnectorName(connectorName string) *IndexingDatasourcesItemsGetCall {
  7411. c.urlParams_.Set("connectorName", connectorName)
  7412. return c
  7413. }
  7414. // DebugOptionsEnableDebugging sets the optional parameter
  7415. // "debugOptions.enableDebugging": If set, the request will enable
  7416. // debugging features of Cloud Search.
  7417. // Only turn on this field, if asked by Google to help with debugging.
  7418. func (c *IndexingDatasourcesItemsGetCall) DebugOptionsEnableDebugging(debugOptionsEnableDebugging bool) *IndexingDatasourcesItemsGetCall {
  7419. c.urlParams_.Set("debugOptions.enableDebugging", fmt.Sprint(debugOptionsEnableDebugging))
  7420. return c
  7421. }
  7422. // Fields allows partial responses to be retrieved. See
  7423. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7424. // for more information.
  7425. func (c *IndexingDatasourcesItemsGetCall) Fields(s ...googleapi.Field) *IndexingDatasourcesItemsGetCall {
  7426. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7427. return c
  7428. }
  7429. // IfNoneMatch sets the optional parameter which makes the operation
  7430. // fail if the object's ETag matches the given value. This is useful for
  7431. // getting updates only after the object has changed since the last
  7432. // request. Use googleapi.IsNotModified to check whether the response
  7433. // error from Do is the result of In-None-Match.
  7434. func (c *IndexingDatasourcesItemsGetCall) IfNoneMatch(entityTag string) *IndexingDatasourcesItemsGetCall {
  7435. c.ifNoneMatch_ = entityTag
  7436. return c
  7437. }
  7438. // Context sets the context to be used in this call's Do method. Any
  7439. // pending HTTP request will be aborted if the provided context is
  7440. // canceled.
  7441. func (c *IndexingDatasourcesItemsGetCall) Context(ctx context.Context) *IndexingDatasourcesItemsGetCall {
  7442. c.ctx_ = ctx
  7443. return c
  7444. }
  7445. // Header returns an http.Header that can be modified by the caller to
  7446. // add HTTP headers to the request.
  7447. func (c *IndexingDatasourcesItemsGetCall) Header() http.Header {
  7448. if c.header_ == nil {
  7449. c.header_ = make(http.Header)
  7450. }
  7451. return c.header_
  7452. }
  7453. func (c *IndexingDatasourcesItemsGetCall) doRequest(alt string) (*http.Response, error) {
  7454. reqHeaders := make(http.Header)
  7455. for k, v := range c.header_ {
  7456. reqHeaders[k] = v
  7457. }
  7458. reqHeaders.Set("User-Agent", c.s.userAgent())
  7459. if c.ifNoneMatch_ != "" {
  7460. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7461. }
  7462. var body io.Reader = nil
  7463. c.urlParams_.Set("alt", alt)
  7464. c.urlParams_.Set("prettyPrint", "false")
  7465. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/indexing/{+name}")
  7466. urls += "?" + c.urlParams_.Encode()
  7467. req, err := http.NewRequest("GET", urls, body)
  7468. if err != nil {
  7469. return nil, err
  7470. }
  7471. req.Header = reqHeaders
  7472. googleapi.Expand(req.URL, map[string]string{
  7473. "name": c.name,
  7474. })
  7475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7476. }
  7477. // Do executes the "cloudsearch.indexing.datasources.items.get" call.
  7478. // Exactly one of *Item or error will be non-nil. Any non-2xx status
  7479. // code is an error. Response headers are in either
  7480. // *Item.ServerResponse.Header or (if a response was returned at all) in
  7481. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7482. // whether the returned error was because http.StatusNotModified was
  7483. // returned.
  7484. func (c *IndexingDatasourcesItemsGetCall) Do(opts ...googleapi.CallOption) (*Item, error) {
  7485. gensupport.SetOptions(c.urlParams_, opts...)
  7486. res, err := c.doRequest("json")
  7487. if res != nil && res.StatusCode == http.StatusNotModified {
  7488. if res.Body != nil {
  7489. res.Body.Close()
  7490. }
  7491. return nil, &googleapi.Error{
  7492. Code: res.StatusCode,
  7493. Header: res.Header,
  7494. }
  7495. }
  7496. if err != nil {
  7497. return nil, err
  7498. }
  7499. defer googleapi.CloseBody(res)
  7500. if err := googleapi.CheckResponse(res); err != nil {
  7501. return nil, err
  7502. }
  7503. ret := &Item{
  7504. ServerResponse: googleapi.ServerResponse{
  7505. Header: res.Header,
  7506. HTTPStatusCode: res.StatusCode,
  7507. },
  7508. }
  7509. target := &ret
  7510. if err := gensupport.DecodeResponse(target, res); err != nil {
  7511. return nil, err
  7512. }
  7513. return ret, nil
  7514. // {
  7515. // "description": "Gets Item resource by item name.",
  7516. // "flatPath": "v1/indexing/datasources/{datasourcesId}/items/{itemsId}",
  7517. // "httpMethod": "GET",
  7518. // "id": "cloudsearch.indexing.datasources.items.get",
  7519. // "parameterOrder": [
  7520. // "name"
  7521. // ],
  7522. // "parameters": {
  7523. // "connectorName": {
  7524. // "description": "Name of connector making this call.\n\u003cbr /\u003eFormat: datasources/{source_id}/connectors/{ID}",
  7525. // "location": "query",
  7526. // "type": "string"
  7527. // },
  7528. // "debugOptions.enableDebugging": {
  7529. // "description": "If set, the request will enable debugging features of Cloud Search.\nOnly turn on this field, if asked by Google to help with debugging.",
  7530. // "location": "query",
  7531. // "type": "boolean"
  7532. // },
  7533. // "name": {
  7534. // "description": "Name of the item to get info.\nFormat: datasources/{source_id}/items/{item_id}",
  7535. // "location": "path",
  7536. // "pattern": "^datasources/[^/]+/items/[^/]+$",
  7537. // "required": true,
  7538. // "type": "string"
  7539. // }
  7540. // },
  7541. // "path": "v1/indexing/{+name}",
  7542. // "response": {
  7543. // "$ref": "Item"
  7544. // },
  7545. // "scopes": [
  7546. // "https://www.googleapis.com/auth/cloud_search",
  7547. // "https://www.googleapis.com/auth/cloud_search.indexing"
  7548. // ]
  7549. // }
  7550. }
  7551. // method id "cloudsearch.indexing.datasources.items.index":
  7552. type IndexingDatasourcesItemsIndexCall struct {
  7553. s *Service
  7554. name string
  7555. indexitemrequest *IndexItemRequest
  7556. urlParams_ gensupport.URLParams
  7557. ctx_ context.Context
  7558. header_ http.Header
  7559. }
  7560. // Index: Updates Item ACL, metadata, and
  7561. // content. It will insert the Item if it
  7562. // does not exist.
  7563. // This method does not support partial updates. Fields with no
  7564. // provided
  7565. // values are cleared out in the Cloud Search index.
  7566. func (r *IndexingDatasourcesItemsService) Index(name string, indexitemrequest *IndexItemRequest) *IndexingDatasourcesItemsIndexCall {
  7567. c := &IndexingDatasourcesItemsIndexCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7568. c.name = name
  7569. c.indexitemrequest = indexitemrequest
  7570. return c
  7571. }
  7572. // Fields allows partial responses to be retrieved. See
  7573. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7574. // for more information.
  7575. func (c *IndexingDatasourcesItemsIndexCall) Fields(s ...googleapi.Field) *IndexingDatasourcesItemsIndexCall {
  7576. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7577. return c
  7578. }
  7579. // Context sets the context to be used in this call's Do method. Any
  7580. // pending HTTP request will be aborted if the provided context is
  7581. // canceled.
  7582. func (c *IndexingDatasourcesItemsIndexCall) Context(ctx context.Context) *IndexingDatasourcesItemsIndexCall {
  7583. c.ctx_ = ctx
  7584. return c
  7585. }
  7586. // Header returns an http.Header that can be modified by the caller to
  7587. // add HTTP headers to the request.
  7588. func (c *IndexingDatasourcesItemsIndexCall) Header() http.Header {
  7589. if c.header_ == nil {
  7590. c.header_ = make(http.Header)
  7591. }
  7592. return c.header_
  7593. }
  7594. func (c *IndexingDatasourcesItemsIndexCall) doRequest(alt string) (*http.Response, error) {
  7595. reqHeaders := make(http.Header)
  7596. for k, v := range c.header_ {
  7597. reqHeaders[k] = v
  7598. }
  7599. reqHeaders.Set("User-Agent", c.s.userAgent())
  7600. var body io.Reader = nil
  7601. body, err := googleapi.WithoutDataWrapper.JSONReader(c.indexitemrequest)
  7602. if err != nil {
  7603. return nil, err
  7604. }
  7605. reqHeaders.Set("Content-Type", "application/json")
  7606. c.urlParams_.Set("alt", alt)
  7607. c.urlParams_.Set("prettyPrint", "false")
  7608. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/indexing/{+name}:index")
  7609. urls += "?" + c.urlParams_.Encode()
  7610. req, err := http.NewRequest("POST", urls, body)
  7611. if err != nil {
  7612. return nil, err
  7613. }
  7614. req.Header = reqHeaders
  7615. googleapi.Expand(req.URL, map[string]string{
  7616. "name": c.name,
  7617. })
  7618. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7619. }
  7620. // Do executes the "cloudsearch.indexing.datasources.items.index" call.
  7621. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7622. // status code is an error. Response headers are in either
  7623. // *Operation.ServerResponse.Header or (if a response was returned at
  7624. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7625. // to check whether the returned error was because
  7626. // http.StatusNotModified was returned.
  7627. func (c *IndexingDatasourcesItemsIndexCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7628. gensupport.SetOptions(c.urlParams_, opts...)
  7629. res, err := c.doRequest("json")
  7630. if res != nil && res.StatusCode == http.StatusNotModified {
  7631. if res.Body != nil {
  7632. res.Body.Close()
  7633. }
  7634. return nil, &googleapi.Error{
  7635. Code: res.StatusCode,
  7636. Header: res.Header,
  7637. }
  7638. }
  7639. if err != nil {
  7640. return nil, err
  7641. }
  7642. defer googleapi.CloseBody(res)
  7643. if err := googleapi.CheckResponse(res); err != nil {
  7644. return nil, err
  7645. }
  7646. ret := &Operation{
  7647. ServerResponse: googleapi.ServerResponse{
  7648. Header: res.Header,
  7649. HTTPStatusCode: res.StatusCode,
  7650. },
  7651. }
  7652. target := &ret
  7653. if err := gensupport.DecodeResponse(target, res); err != nil {
  7654. return nil, err
  7655. }
  7656. return ret, nil
  7657. // {
  7658. // "description": "Updates Item ACL, metadata, and\ncontent. It will insert the Item if it\ndoes not exist.\nThis method does not support partial updates. Fields with no provided\nvalues are cleared out in the Cloud Search index.",
  7659. // "flatPath": "v1/indexing/datasources/{datasourcesId}/items/{itemsId}:index",
  7660. // "httpMethod": "POST",
  7661. // "id": "cloudsearch.indexing.datasources.items.index",
  7662. // "parameterOrder": [
  7663. // "name"
  7664. // ],
  7665. // "parameters": {
  7666. // "name": {
  7667. // "description": "Name of the Item. Format:\ndatasources/{source_id}/items/{item_id}\n\u003cbr /\u003eThis is a required field.\nThe maximum length is 1536 characters.",
  7668. // "location": "path",
  7669. // "pattern": "^datasources/[^/]+/items/[^/]+$",
  7670. // "required": true,
  7671. // "type": "string"
  7672. // }
  7673. // },
  7674. // "path": "v1/indexing/{+name}:index",
  7675. // "request": {
  7676. // "$ref": "IndexItemRequest"
  7677. // },
  7678. // "response": {
  7679. // "$ref": "Operation"
  7680. // },
  7681. // "scopes": [
  7682. // "https://www.googleapis.com/auth/cloud_search",
  7683. // "https://www.googleapis.com/auth/cloud_search.indexing"
  7684. // ]
  7685. // }
  7686. }
  7687. // method id "cloudsearch.indexing.datasources.items.list":
  7688. type IndexingDatasourcesItemsListCall struct {
  7689. s *Service
  7690. name string
  7691. urlParams_ gensupport.URLParams
  7692. ifNoneMatch_ string
  7693. ctx_ context.Context
  7694. header_ http.Header
  7695. }
  7696. // List: Lists all or a subset of Item resources.
  7697. func (r *IndexingDatasourcesItemsService) List(name string) *IndexingDatasourcesItemsListCall {
  7698. c := &IndexingDatasourcesItemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7699. c.name = name
  7700. return c
  7701. }
  7702. // Brief sets the optional parameter "brief": When set to true, the
  7703. // indexing system only populates the following
  7704. // fields:
  7705. // name,
  7706. // version,
  7707. // metadata.hash,
  7708. // structured_data.hash,
  7709. // content.ha
  7710. // sh.
  7711. // <br />If this value is false, then all the fields are populated in
  7712. // Item.
  7713. func (c *IndexingDatasourcesItemsListCall) Brief(brief bool) *IndexingDatasourcesItemsListCall {
  7714. c.urlParams_.Set("brief", fmt.Sprint(brief))
  7715. return c
  7716. }
  7717. // ConnectorName sets the optional parameter "connectorName": Name of
  7718. // connector making this call.
  7719. // <br />Format: datasources/{source_id}/connectors/{ID}
  7720. func (c *IndexingDatasourcesItemsListCall) ConnectorName(connectorName string) *IndexingDatasourcesItemsListCall {
  7721. c.urlParams_.Set("connectorName", connectorName)
  7722. return c
  7723. }
  7724. // DebugOptionsEnableDebugging sets the optional parameter
  7725. // "debugOptions.enableDebugging": If set, the request will enable
  7726. // debugging features of Cloud Search.
  7727. // Only turn on this field, if asked by Google to help with debugging.
  7728. func (c *IndexingDatasourcesItemsListCall) DebugOptionsEnableDebugging(debugOptionsEnableDebugging bool) *IndexingDatasourcesItemsListCall {
  7729. c.urlParams_.Set("debugOptions.enableDebugging", fmt.Sprint(debugOptionsEnableDebugging))
  7730. return c
  7731. }
  7732. // PageSize sets the optional parameter "pageSize": Maximum number of
  7733. // items to fetch in a request.
  7734. // The max value is 1000 when brief is true. The max value is 10 if
  7735. // brief
  7736. // is false.
  7737. // <br />The default value is 10
  7738. func (c *IndexingDatasourcesItemsListCall) PageSize(pageSize int64) *IndexingDatasourcesItemsListCall {
  7739. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7740. return c
  7741. }
  7742. // PageToken sets the optional parameter "pageToken": The
  7743. // next_page_token value returned from a previous List request, if any.
  7744. func (c *IndexingDatasourcesItemsListCall) PageToken(pageToken string) *IndexingDatasourcesItemsListCall {
  7745. c.urlParams_.Set("pageToken", pageToken)
  7746. return c
  7747. }
  7748. // Fields allows partial responses to be retrieved. See
  7749. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7750. // for more information.
  7751. func (c *IndexingDatasourcesItemsListCall) Fields(s ...googleapi.Field) *IndexingDatasourcesItemsListCall {
  7752. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7753. return c
  7754. }
  7755. // IfNoneMatch sets the optional parameter which makes the operation
  7756. // fail if the object's ETag matches the given value. This is useful for
  7757. // getting updates only after the object has changed since the last
  7758. // request. Use googleapi.IsNotModified to check whether the response
  7759. // error from Do is the result of In-None-Match.
  7760. func (c *IndexingDatasourcesItemsListCall) IfNoneMatch(entityTag string) *IndexingDatasourcesItemsListCall {
  7761. c.ifNoneMatch_ = entityTag
  7762. return c
  7763. }
  7764. // Context sets the context to be used in this call's Do method. Any
  7765. // pending HTTP request will be aborted if the provided context is
  7766. // canceled.
  7767. func (c *IndexingDatasourcesItemsListCall) Context(ctx context.Context) *IndexingDatasourcesItemsListCall {
  7768. c.ctx_ = ctx
  7769. return c
  7770. }
  7771. // Header returns an http.Header that can be modified by the caller to
  7772. // add HTTP headers to the request.
  7773. func (c *IndexingDatasourcesItemsListCall) Header() http.Header {
  7774. if c.header_ == nil {
  7775. c.header_ = make(http.Header)
  7776. }
  7777. return c.header_
  7778. }
  7779. func (c *IndexingDatasourcesItemsListCall) doRequest(alt string) (*http.Response, error) {
  7780. reqHeaders := make(http.Header)
  7781. for k, v := range c.header_ {
  7782. reqHeaders[k] = v
  7783. }
  7784. reqHeaders.Set("User-Agent", c.s.userAgent())
  7785. if c.ifNoneMatch_ != "" {
  7786. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7787. }
  7788. var body io.Reader = nil
  7789. c.urlParams_.Set("alt", alt)
  7790. c.urlParams_.Set("prettyPrint", "false")
  7791. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/indexing/{+name}/items")
  7792. urls += "?" + c.urlParams_.Encode()
  7793. req, err := http.NewRequest("GET", urls, body)
  7794. if err != nil {
  7795. return nil, err
  7796. }
  7797. req.Header = reqHeaders
  7798. googleapi.Expand(req.URL, map[string]string{
  7799. "name": c.name,
  7800. })
  7801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7802. }
  7803. // Do executes the "cloudsearch.indexing.datasources.items.list" call.
  7804. // Exactly one of *ListItemsResponse or error will be non-nil. Any
  7805. // non-2xx status code is an error. Response headers are in either
  7806. // *ListItemsResponse.ServerResponse.Header or (if a response was
  7807. // returned at all) in error.(*googleapi.Error).Header. Use
  7808. // googleapi.IsNotModified to check whether the returned error was
  7809. // because http.StatusNotModified was returned.
  7810. func (c *IndexingDatasourcesItemsListCall) Do(opts ...googleapi.CallOption) (*ListItemsResponse, error) {
  7811. gensupport.SetOptions(c.urlParams_, opts...)
  7812. res, err := c.doRequest("json")
  7813. if res != nil && res.StatusCode == http.StatusNotModified {
  7814. if res.Body != nil {
  7815. res.Body.Close()
  7816. }
  7817. return nil, &googleapi.Error{
  7818. Code: res.StatusCode,
  7819. Header: res.Header,
  7820. }
  7821. }
  7822. if err != nil {
  7823. return nil, err
  7824. }
  7825. defer googleapi.CloseBody(res)
  7826. if err := googleapi.CheckResponse(res); err != nil {
  7827. return nil, err
  7828. }
  7829. ret := &ListItemsResponse{
  7830. ServerResponse: googleapi.ServerResponse{
  7831. Header: res.Header,
  7832. HTTPStatusCode: res.StatusCode,
  7833. },
  7834. }
  7835. target := &ret
  7836. if err := gensupport.DecodeResponse(target, res); err != nil {
  7837. return nil, err
  7838. }
  7839. return ret, nil
  7840. // {
  7841. // "description": "Lists all or a subset of Item resources.",
  7842. // "flatPath": "v1/indexing/datasources/{datasourcesId}/items",
  7843. // "httpMethod": "GET",
  7844. // "id": "cloudsearch.indexing.datasources.items.list",
  7845. // "parameterOrder": [
  7846. // "name"
  7847. // ],
  7848. // "parameters": {
  7849. // "brief": {
  7850. // "description": "When set to true, the indexing system only populates the following fields:\nname,\nversion,\nmetadata.hash,\nstructured_data.hash,\ncontent.hash.\n\u003cbr /\u003eIf this value is false, then all the fields are populated in Item.",
  7851. // "location": "query",
  7852. // "type": "boolean"
  7853. // },
  7854. // "connectorName": {
  7855. // "description": "Name of connector making this call.\n\u003cbr /\u003eFormat: datasources/{source_id}/connectors/{ID}",
  7856. // "location": "query",
  7857. // "type": "string"
  7858. // },
  7859. // "debugOptions.enableDebugging": {
  7860. // "description": "If set, the request will enable debugging features of Cloud Search.\nOnly turn on this field, if asked by Google to help with debugging.",
  7861. // "location": "query",
  7862. // "type": "boolean"
  7863. // },
  7864. // "name": {
  7865. // "description": "Name of the Data Source to list Items. Format:\ndatasources/{source_id}",
  7866. // "location": "path",
  7867. // "pattern": "^datasources/[^/]+$",
  7868. // "required": true,
  7869. // "type": "string"
  7870. // },
  7871. // "pageSize": {
  7872. // "description": "Maximum number of items to fetch in a request.\nThe max value is 1000 when brief is true. The max value is 10 if brief\nis false.\n\u003cbr /\u003eThe default value is 10",
  7873. // "format": "int32",
  7874. // "location": "query",
  7875. // "type": "integer"
  7876. // },
  7877. // "pageToken": {
  7878. // "description": "The next_page_token value returned from a previous List request, if any.",
  7879. // "location": "query",
  7880. // "type": "string"
  7881. // }
  7882. // },
  7883. // "path": "v1/indexing/{+name}/items",
  7884. // "response": {
  7885. // "$ref": "ListItemsResponse"
  7886. // },
  7887. // "scopes": [
  7888. // "https://www.googleapis.com/auth/cloud_search",
  7889. // "https://www.googleapis.com/auth/cloud_search.indexing"
  7890. // ]
  7891. // }
  7892. }
  7893. // Pages invokes f for each page of results.
  7894. // A non-nil error returned from f will halt the iteration.
  7895. // The provided context supersedes any context provided to the Context method.
  7896. func (c *IndexingDatasourcesItemsListCall) Pages(ctx context.Context, f func(*ListItemsResponse) error) error {
  7897. c.ctx_ = ctx
  7898. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7899. for {
  7900. x, err := c.Do()
  7901. if err != nil {
  7902. return err
  7903. }
  7904. if err := f(x); err != nil {
  7905. return err
  7906. }
  7907. if x.NextPageToken == "" {
  7908. return nil
  7909. }
  7910. c.PageToken(x.NextPageToken)
  7911. }
  7912. }
  7913. // method id "cloudsearch.indexing.datasources.items.poll":
  7914. type IndexingDatasourcesItemsPollCall struct {
  7915. s *Service
  7916. name string
  7917. pollitemsrequest *PollItemsRequest
  7918. urlParams_ gensupport.URLParams
  7919. ctx_ context.Context
  7920. header_ http.Header
  7921. }
  7922. // Poll: Polls for unreserved items from the indexing queue and marks
  7923. // a
  7924. // set as reserved, starting with items that have
  7925. // the oldest timestamp from the highest priority
  7926. // ItemStatus.
  7927. // The priority order is as follows: <br />
  7928. // ERROR
  7929. // <br />
  7930. // MODIFIED
  7931. // <br />
  7932. // NEW_ITEM
  7933. // <br />
  7934. // ACCEPTED
  7935. // <br />
  7936. // Reserving items ensures that polling from other threads
  7937. // cannot create overlapping sets.
  7938. //
  7939. // After handling the reserved items, the client should put items
  7940. // back
  7941. // into the unreserved state, either by calling
  7942. // index,
  7943. // or by calling
  7944. // push with
  7945. // the type REQUEUE.
  7946. //
  7947. // Items automatically become available (unreserved) after 4 hours even
  7948. // if no
  7949. // update or push method is called.
  7950. func (r *IndexingDatasourcesItemsService) Poll(name string, pollitemsrequest *PollItemsRequest) *IndexingDatasourcesItemsPollCall {
  7951. c := &IndexingDatasourcesItemsPollCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7952. c.name = name
  7953. c.pollitemsrequest = pollitemsrequest
  7954. return c
  7955. }
  7956. // Fields allows partial responses to be retrieved. See
  7957. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7958. // for more information.
  7959. func (c *IndexingDatasourcesItemsPollCall) Fields(s ...googleapi.Field) *IndexingDatasourcesItemsPollCall {
  7960. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7961. return c
  7962. }
  7963. // Context sets the context to be used in this call's Do method. Any
  7964. // pending HTTP request will be aborted if the provided context is
  7965. // canceled.
  7966. func (c *IndexingDatasourcesItemsPollCall) Context(ctx context.Context) *IndexingDatasourcesItemsPollCall {
  7967. c.ctx_ = ctx
  7968. return c
  7969. }
  7970. // Header returns an http.Header that can be modified by the caller to
  7971. // add HTTP headers to the request.
  7972. func (c *IndexingDatasourcesItemsPollCall) Header() http.Header {
  7973. if c.header_ == nil {
  7974. c.header_ = make(http.Header)
  7975. }
  7976. return c.header_
  7977. }
  7978. func (c *IndexingDatasourcesItemsPollCall) doRequest(alt string) (*http.Response, error) {
  7979. reqHeaders := make(http.Header)
  7980. for k, v := range c.header_ {
  7981. reqHeaders[k] = v
  7982. }
  7983. reqHeaders.Set("User-Agent", c.s.userAgent())
  7984. var body io.Reader = nil
  7985. body, err := googleapi.WithoutDataWrapper.JSONReader(c.pollitemsrequest)
  7986. if err != nil {
  7987. return nil, err
  7988. }
  7989. reqHeaders.Set("Content-Type", "application/json")
  7990. c.urlParams_.Set("alt", alt)
  7991. c.urlParams_.Set("prettyPrint", "false")
  7992. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/indexing/{+name}/items:poll")
  7993. urls += "?" + c.urlParams_.Encode()
  7994. req, err := http.NewRequest("POST", urls, body)
  7995. if err != nil {
  7996. return nil, err
  7997. }
  7998. req.Header = reqHeaders
  7999. googleapi.Expand(req.URL, map[string]string{
  8000. "name": c.name,
  8001. })
  8002. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8003. }
  8004. // Do executes the "cloudsearch.indexing.datasources.items.poll" call.
  8005. // Exactly one of *PollItemsResponse or error will be non-nil. Any
  8006. // non-2xx status code is an error. Response headers are in either
  8007. // *PollItemsResponse.ServerResponse.Header or (if a response was
  8008. // returned at all) in error.(*googleapi.Error).Header. Use
  8009. // googleapi.IsNotModified to check whether the returned error was
  8010. // because http.StatusNotModified was returned.
  8011. func (c *IndexingDatasourcesItemsPollCall) Do(opts ...googleapi.CallOption) (*PollItemsResponse, error) {
  8012. gensupport.SetOptions(c.urlParams_, opts...)
  8013. res, err := c.doRequest("json")
  8014. if res != nil && res.StatusCode == http.StatusNotModified {
  8015. if res.Body != nil {
  8016. res.Body.Close()
  8017. }
  8018. return nil, &googleapi.Error{
  8019. Code: res.StatusCode,
  8020. Header: res.Header,
  8021. }
  8022. }
  8023. if err != nil {
  8024. return nil, err
  8025. }
  8026. defer googleapi.CloseBody(res)
  8027. if err := googleapi.CheckResponse(res); err != nil {
  8028. return nil, err
  8029. }
  8030. ret := &PollItemsResponse{
  8031. ServerResponse: googleapi.ServerResponse{
  8032. Header: res.Header,
  8033. HTTPStatusCode: res.StatusCode,
  8034. },
  8035. }
  8036. target := &ret
  8037. if err := gensupport.DecodeResponse(target, res); err != nil {
  8038. return nil, err
  8039. }
  8040. return ret, nil
  8041. // {
  8042. // "description": "Polls for unreserved items from the indexing queue and marks a\nset as reserved, starting with items that have\nthe oldest timestamp from the highest priority\nItemStatus.\nThe priority order is as follows: \u003cbr /\u003e\nERROR\n\u003cbr /\u003e\nMODIFIED\n\u003cbr /\u003e\nNEW_ITEM\n\u003cbr /\u003e\nACCEPTED\n\u003cbr /\u003e\nReserving items ensures that polling from other threads\ncannot create overlapping sets.\n\nAfter handling the reserved items, the client should put items back\ninto the unreserved state, either by calling\nindex,\nor by calling\npush with\nthe type REQUEUE.\n\nItems automatically become available (unreserved) after 4 hours even if no\nupdate or push method is called.",
  8043. // "flatPath": "v1/indexing/datasources/{datasourcesId}/items:poll",
  8044. // "httpMethod": "POST",
  8045. // "id": "cloudsearch.indexing.datasources.items.poll",
  8046. // "parameterOrder": [
  8047. // "name"
  8048. // ],
  8049. // "parameters": {
  8050. // "name": {
  8051. // "description": "Name of the Data Source to poll items.\nFormat: datasources/{source_id}",
  8052. // "location": "path",
  8053. // "pattern": "^datasources/[^/]+$",
  8054. // "required": true,
  8055. // "type": "string"
  8056. // }
  8057. // },
  8058. // "path": "v1/indexing/{+name}/items:poll",
  8059. // "request": {
  8060. // "$ref": "PollItemsRequest"
  8061. // },
  8062. // "response": {
  8063. // "$ref": "PollItemsResponse"
  8064. // },
  8065. // "scopes": [
  8066. // "https://www.googleapis.com/auth/cloud_search",
  8067. // "https://www.googleapis.com/auth/cloud_search.indexing"
  8068. // ]
  8069. // }
  8070. }
  8071. // method id "cloudsearch.indexing.datasources.items.push":
  8072. type IndexingDatasourcesItemsPushCall struct {
  8073. s *Service
  8074. name string
  8075. pushitemrequest *PushItemRequest
  8076. urlParams_ gensupport.URLParams
  8077. ctx_ context.Context
  8078. header_ http.Header
  8079. }
  8080. // Push: Pushes an item onto a queue for later polling and updating.
  8081. func (r *IndexingDatasourcesItemsService) Push(name string, pushitemrequest *PushItemRequest) *IndexingDatasourcesItemsPushCall {
  8082. c := &IndexingDatasourcesItemsPushCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8083. c.name = name
  8084. c.pushitemrequest = pushitemrequest
  8085. return c
  8086. }
  8087. // Fields allows partial responses to be retrieved. See
  8088. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8089. // for more information.
  8090. func (c *IndexingDatasourcesItemsPushCall) Fields(s ...googleapi.Field) *IndexingDatasourcesItemsPushCall {
  8091. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8092. return c
  8093. }
  8094. // Context sets the context to be used in this call's Do method. Any
  8095. // pending HTTP request will be aborted if the provided context is
  8096. // canceled.
  8097. func (c *IndexingDatasourcesItemsPushCall) Context(ctx context.Context) *IndexingDatasourcesItemsPushCall {
  8098. c.ctx_ = ctx
  8099. return c
  8100. }
  8101. // Header returns an http.Header that can be modified by the caller to
  8102. // add HTTP headers to the request.
  8103. func (c *IndexingDatasourcesItemsPushCall) Header() http.Header {
  8104. if c.header_ == nil {
  8105. c.header_ = make(http.Header)
  8106. }
  8107. return c.header_
  8108. }
  8109. func (c *IndexingDatasourcesItemsPushCall) doRequest(alt string) (*http.Response, error) {
  8110. reqHeaders := make(http.Header)
  8111. for k, v := range c.header_ {
  8112. reqHeaders[k] = v
  8113. }
  8114. reqHeaders.Set("User-Agent", c.s.userAgent())
  8115. var body io.Reader = nil
  8116. body, err := googleapi.WithoutDataWrapper.JSONReader(c.pushitemrequest)
  8117. if err != nil {
  8118. return nil, err
  8119. }
  8120. reqHeaders.Set("Content-Type", "application/json")
  8121. c.urlParams_.Set("alt", alt)
  8122. c.urlParams_.Set("prettyPrint", "false")
  8123. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/indexing/{+name}:push")
  8124. urls += "?" + c.urlParams_.Encode()
  8125. req, err := http.NewRequest("POST", urls, body)
  8126. if err != nil {
  8127. return nil, err
  8128. }
  8129. req.Header = reqHeaders
  8130. googleapi.Expand(req.URL, map[string]string{
  8131. "name": c.name,
  8132. })
  8133. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8134. }
  8135. // Do executes the "cloudsearch.indexing.datasources.items.push" call.
  8136. // Exactly one of *Item or error will be non-nil. Any non-2xx status
  8137. // code is an error. Response headers are in either
  8138. // *Item.ServerResponse.Header or (if a response was returned at all) in
  8139. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8140. // whether the returned error was because http.StatusNotModified was
  8141. // returned.
  8142. func (c *IndexingDatasourcesItemsPushCall) Do(opts ...googleapi.CallOption) (*Item, error) {
  8143. gensupport.SetOptions(c.urlParams_, opts...)
  8144. res, err := c.doRequest("json")
  8145. if res != nil && res.StatusCode == http.StatusNotModified {
  8146. if res.Body != nil {
  8147. res.Body.Close()
  8148. }
  8149. return nil, &googleapi.Error{
  8150. Code: res.StatusCode,
  8151. Header: res.Header,
  8152. }
  8153. }
  8154. if err != nil {
  8155. return nil, err
  8156. }
  8157. defer googleapi.CloseBody(res)
  8158. if err := googleapi.CheckResponse(res); err != nil {
  8159. return nil, err
  8160. }
  8161. ret := &Item{
  8162. ServerResponse: googleapi.ServerResponse{
  8163. Header: res.Header,
  8164. HTTPStatusCode: res.StatusCode,
  8165. },
  8166. }
  8167. target := &ret
  8168. if err := gensupport.DecodeResponse(target, res); err != nil {
  8169. return nil, err
  8170. }
  8171. return ret, nil
  8172. // {
  8173. // "description": "Pushes an item onto a queue for later polling and updating.",
  8174. // "flatPath": "v1/indexing/datasources/{datasourcesId}/items/{itemsId}:push",
  8175. // "httpMethod": "POST",
  8176. // "id": "cloudsearch.indexing.datasources.items.push",
  8177. // "parameterOrder": [
  8178. // "name"
  8179. // ],
  8180. // "parameters": {
  8181. // "name": {
  8182. // "description": "Name of the item to\npush into the indexing queue.\u003cbr /\u003e\nFormat: datasources/{source_id}/items/{ID}\n\u003cbr /\u003eThis is a required field.\nThe maximum length is 1536 characters.",
  8183. // "location": "path",
  8184. // "pattern": "^datasources/[^/]+/items/[^/]+$",
  8185. // "required": true,
  8186. // "type": "string"
  8187. // }
  8188. // },
  8189. // "path": "v1/indexing/{+name}:push",
  8190. // "request": {
  8191. // "$ref": "PushItemRequest"
  8192. // },
  8193. // "response": {
  8194. // "$ref": "Item"
  8195. // },
  8196. // "scopes": [
  8197. // "https://www.googleapis.com/auth/cloud_search",
  8198. // "https://www.googleapis.com/auth/cloud_search.indexing"
  8199. // ]
  8200. // }
  8201. }
  8202. // method id "cloudsearch.indexing.datasources.items.unreserve":
  8203. type IndexingDatasourcesItemsUnreserveCall struct {
  8204. s *Service
  8205. name string
  8206. unreserveitemsrequest *UnreserveItemsRequest
  8207. urlParams_ gensupport.URLParams
  8208. ctx_ context.Context
  8209. header_ http.Header
  8210. }
  8211. // Unreserve: Unreserves all items from a queue, making them all
  8212. // eligible to be
  8213. // polled. This method is useful for resetting the indexing queue
  8214. // after a connector has been restarted.
  8215. func (r *IndexingDatasourcesItemsService) Unreserve(name string, unreserveitemsrequest *UnreserveItemsRequest) *IndexingDatasourcesItemsUnreserveCall {
  8216. c := &IndexingDatasourcesItemsUnreserveCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8217. c.name = name
  8218. c.unreserveitemsrequest = unreserveitemsrequest
  8219. return c
  8220. }
  8221. // Fields allows partial responses to be retrieved. See
  8222. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8223. // for more information.
  8224. func (c *IndexingDatasourcesItemsUnreserveCall) Fields(s ...googleapi.Field) *IndexingDatasourcesItemsUnreserveCall {
  8225. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8226. return c
  8227. }
  8228. // Context sets the context to be used in this call's Do method. Any
  8229. // pending HTTP request will be aborted if the provided context is
  8230. // canceled.
  8231. func (c *IndexingDatasourcesItemsUnreserveCall) Context(ctx context.Context) *IndexingDatasourcesItemsUnreserveCall {
  8232. c.ctx_ = ctx
  8233. return c
  8234. }
  8235. // Header returns an http.Header that can be modified by the caller to
  8236. // add HTTP headers to the request.
  8237. func (c *IndexingDatasourcesItemsUnreserveCall) Header() http.Header {
  8238. if c.header_ == nil {
  8239. c.header_ = make(http.Header)
  8240. }
  8241. return c.header_
  8242. }
  8243. func (c *IndexingDatasourcesItemsUnreserveCall) doRequest(alt string) (*http.Response, error) {
  8244. reqHeaders := make(http.Header)
  8245. for k, v := range c.header_ {
  8246. reqHeaders[k] = v
  8247. }
  8248. reqHeaders.Set("User-Agent", c.s.userAgent())
  8249. var body io.Reader = nil
  8250. body, err := googleapi.WithoutDataWrapper.JSONReader(c.unreserveitemsrequest)
  8251. if err != nil {
  8252. return nil, err
  8253. }
  8254. reqHeaders.Set("Content-Type", "application/json")
  8255. c.urlParams_.Set("alt", alt)
  8256. c.urlParams_.Set("prettyPrint", "false")
  8257. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/indexing/{+name}/items:unreserve")
  8258. urls += "?" + c.urlParams_.Encode()
  8259. req, err := http.NewRequest("POST", urls, body)
  8260. if err != nil {
  8261. return nil, err
  8262. }
  8263. req.Header = reqHeaders
  8264. googleapi.Expand(req.URL, map[string]string{
  8265. "name": c.name,
  8266. })
  8267. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8268. }
  8269. // Do executes the "cloudsearch.indexing.datasources.items.unreserve" call.
  8270. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8271. // status code is an error. Response headers are in either
  8272. // *Operation.ServerResponse.Header or (if a response was returned at
  8273. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8274. // to check whether the returned error was because
  8275. // http.StatusNotModified was returned.
  8276. func (c *IndexingDatasourcesItemsUnreserveCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8277. gensupport.SetOptions(c.urlParams_, opts...)
  8278. res, err := c.doRequest("json")
  8279. if res != nil && res.StatusCode == http.StatusNotModified {
  8280. if res.Body != nil {
  8281. res.Body.Close()
  8282. }
  8283. return nil, &googleapi.Error{
  8284. Code: res.StatusCode,
  8285. Header: res.Header,
  8286. }
  8287. }
  8288. if err != nil {
  8289. return nil, err
  8290. }
  8291. defer googleapi.CloseBody(res)
  8292. if err := googleapi.CheckResponse(res); err != nil {
  8293. return nil, err
  8294. }
  8295. ret := &Operation{
  8296. ServerResponse: googleapi.ServerResponse{
  8297. Header: res.Header,
  8298. HTTPStatusCode: res.StatusCode,
  8299. },
  8300. }
  8301. target := &ret
  8302. if err := gensupport.DecodeResponse(target, res); err != nil {
  8303. return nil, err
  8304. }
  8305. return ret, nil
  8306. // {
  8307. // "description": "Unreserves all items from a queue, making them all eligible to be\npolled. This method is useful for resetting the indexing queue\nafter a connector has been restarted.",
  8308. // "flatPath": "v1/indexing/datasources/{datasourcesId}/items:unreserve",
  8309. // "httpMethod": "POST",
  8310. // "id": "cloudsearch.indexing.datasources.items.unreserve",
  8311. // "parameterOrder": [
  8312. // "name"
  8313. // ],
  8314. // "parameters": {
  8315. // "name": {
  8316. // "description": "Name of the Data Source to unreserve all items.\nFormat: datasources/{source_id}",
  8317. // "location": "path",
  8318. // "pattern": "^datasources/[^/]+$",
  8319. // "required": true,
  8320. // "type": "string"
  8321. // }
  8322. // },
  8323. // "path": "v1/indexing/{+name}/items:unreserve",
  8324. // "request": {
  8325. // "$ref": "UnreserveItemsRequest"
  8326. // },
  8327. // "response": {
  8328. // "$ref": "Operation"
  8329. // },
  8330. // "scopes": [
  8331. // "https://www.googleapis.com/auth/cloud_search",
  8332. // "https://www.googleapis.com/auth/cloud_search.indexing"
  8333. // ]
  8334. // }
  8335. }
  8336. // method id "cloudsearch.indexing.datasources.items.upload":
  8337. type IndexingDatasourcesItemsUploadCall struct {
  8338. s *Service
  8339. name string
  8340. startuploaditemrequest *StartUploadItemRequest
  8341. urlParams_ gensupport.URLParams
  8342. ctx_ context.Context
  8343. header_ http.Header
  8344. }
  8345. // Upload: Creates an upload session for uploading item content. For
  8346. // items smaller
  8347. // than 100 KiB, it's easier to embed the content
  8348. // inline within
  8349. // update.
  8350. func (r *IndexingDatasourcesItemsService) Upload(name string, startuploaditemrequest *StartUploadItemRequest) *IndexingDatasourcesItemsUploadCall {
  8351. c := &IndexingDatasourcesItemsUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8352. c.name = name
  8353. c.startuploaditemrequest = startuploaditemrequest
  8354. return c
  8355. }
  8356. // Fields allows partial responses to be retrieved. See
  8357. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8358. // for more information.
  8359. func (c *IndexingDatasourcesItemsUploadCall) Fields(s ...googleapi.Field) *IndexingDatasourcesItemsUploadCall {
  8360. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8361. return c
  8362. }
  8363. // Context sets the context to be used in this call's Do method. Any
  8364. // pending HTTP request will be aborted if the provided context is
  8365. // canceled.
  8366. func (c *IndexingDatasourcesItemsUploadCall) Context(ctx context.Context) *IndexingDatasourcesItemsUploadCall {
  8367. c.ctx_ = ctx
  8368. return c
  8369. }
  8370. // Header returns an http.Header that can be modified by the caller to
  8371. // add HTTP headers to the request.
  8372. func (c *IndexingDatasourcesItemsUploadCall) Header() http.Header {
  8373. if c.header_ == nil {
  8374. c.header_ = make(http.Header)
  8375. }
  8376. return c.header_
  8377. }
  8378. func (c *IndexingDatasourcesItemsUploadCall) doRequest(alt string) (*http.Response, error) {
  8379. reqHeaders := make(http.Header)
  8380. for k, v := range c.header_ {
  8381. reqHeaders[k] = v
  8382. }
  8383. reqHeaders.Set("User-Agent", c.s.userAgent())
  8384. var body io.Reader = nil
  8385. body, err := googleapi.WithoutDataWrapper.JSONReader(c.startuploaditemrequest)
  8386. if err != nil {
  8387. return nil, err
  8388. }
  8389. reqHeaders.Set("Content-Type", "application/json")
  8390. c.urlParams_.Set("alt", alt)
  8391. c.urlParams_.Set("prettyPrint", "false")
  8392. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/indexing/{+name}:upload")
  8393. urls += "?" + c.urlParams_.Encode()
  8394. req, err := http.NewRequest("POST", urls, body)
  8395. if err != nil {
  8396. return nil, err
  8397. }
  8398. req.Header = reqHeaders
  8399. googleapi.Expand(req.URL, map[string]string{
  8400. "name": c.name,
  8401. })
  8402. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8403. }
  8404. // Do executes the "cloudsearch.indexing.datasources.items.upload" call.
  8405. // Exactly one of *UploadItemRef or error will be non-nil. Any non-2xx
  8406. // status code is an error. Response headers are in either
  8407. // *UploadItemRef.ServerResponse.Header or (if a response was returned
  8408. // at all) in error.(*googleapi.Error).Header. Use
  8409. // googleapi.IsNotModified to check whether the returned error was
  8410. // because http.StatusNotModified was returned.
  8411. func (c *IndexingDatasourcesItemsUploadCall) Do(opts ...googleapi.CallOption) (*UploadItemRef, error) {
  8412. gensupport.SetOptions(c.urlParams_, opts...)
  8413. res, err := c.doRequest("json")
  8414. if res != nil && res.StatusCode == http.StatusNotModified {
  8415. if res.Body != nil {
  8416. res.Body.Close()
  8417. }
  8418. return nil, &googleapi.Error{
  8419. Code: res.StatusCode,
  8420. Header: res.Header,
  8421. }
  8422. }
  8423. if err != nil {
  8424. return nil, err
  8425. }
  8426. defer googleapi.CloseBody(res)
  8427. if err := googleapi.CheckResponse(res); err != nil {
  8428. return nil, err
  8429. }
  8430. ret := &UploadItemRef{
  8431. ServerResponse: googleapi.ServerResponse{
  8432. Header: res.Header,
  8433. HTTPStatusCode: res.StatusCode,
  8434. },
  8435. }
  8436. target := &ret
  8437. if err := gensupport.DecodeResponse(target, res); err != nil {
  8438. return nil, err
  8439. }
  8440. return ret, nil
  8441. // {
  8442. // "description": "Creates an upload session for uploading item content. For items smaller\nthan 100 KiB, it's easier to embed the content\ninline within\nupdate.",
  8443. // "flatPath": "v1/indexing/datasources/{datasourcesId}/items/{itemsId}:upload",
  8444. // "httpMethod": "POST",
  8445. // "id": "cloudsearch.indexing.datasources.items.upload",
  8446. // "parameterOrder": [
  8447. // "name"
  8448. // ],
  8449. // "parameters": {
  8450. // "name": {
  8451. // "description": "Name of the Data Source to start a resumable upload.\nFormat: datasources/{source_id}",
  8452. // "location": "path",
  8453. // "pattern": "^datasources/[^/]+/items/[^/]+$",
  8454. // "required": true,
  8455. // "type": "string"
  8456. // }
  8457. // },
  8458. // "path": "v1/indexing/{+name}:upload",
  8459. // "request": {
  8460. // "$ref": "StartUploadItemRequest"
  8461. // },
  8462. // "response": {
  8463. // "$ref": "UploadItemRef"
  8464. // },
  8465. // "scopes": [
  8466. // "https://www.googleapis.com/auth/cloud_search",
  8467. // "https://www.googleapis.com/auth/cloud_search.indexing"
  8468. // ]
  8469. // }
  8470. }
  8471. // method id "cloudsearch.media.upload":
  8472. type MediaUploadCall struct {
  8473. s *Service
  8474. resourceName string
  8475. media *Media
  8476. urlParams_ gensupport.URLParams
  8477. mediaInfo_ *gensupport.MediaInfo
  8478. ctx_ context.Context
  8479. header_ http.Header
  8480. }
  8481. // Upload: Uploads media for indexing.
  8482. //
  8483. // The upload endpoint supports direct and resumable upload protocols
  8484. // and
  8485. // is intended for large items that can not be inlined during index
  8486. // requests. To
  8487. // index large content:
  8488. //
  8489. // 1. Call upload to begin
  8490. // a session and get the item reference.
  8491. // 1. Upload the content using the item reference's resource name.
  8492. // 1. Call index with the item
  8493. // reference as the content.
  8494. //
  8495. // For additional information, see
  8496. // [Create a content connector using the REST
  8497. // API](https://developers.google.com/cloud-search/docs/guides/content-co
  8498. // nnector#rest).
  8499. func (r *MediaService) Upload(resourceName string, media *Media) *MediaUploadCall {
  8500. c := &MediaUploadCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8501. c.resourceName = resourceName
  8502. c.media = media
  8503. return c
  8504. }
  8505. // Media specifies the media to upload in one or more chunks. The chunk
  8506. // size may be controlled by supplying a MediaOption generated by
  8507. // googleapi.ChunkSize. The chunk size defaults to
  8508. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  8509. // upload request will be determined by sniffing the contents of r,
  8510. // unless a MediaOption generated by googleapi.ContentType is
  8511. // supplied.
  8512. // At most one of Media and ResumableMedia may be set.
  8513. func (c *MediaUploadCall) Media(r io.Reader, options ...googleapi.MediaOption) *MediaUploadCall {
  8514. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  8515. return c
  8516. }
  8517. // ResumableMedia specifies the media to upload in chunks and can be
  8518. // canceled with ctx.
  8519. //
  8520. // Deprecated: use Media instead.
  8521. //
  8522. // At most one of Media and ResumableMedia may be set. mediaType
  8523. // identifies the MIME media type of the upload, such as "image/png". If
  8524. // mediaType is "", it will be auto-detected. The provided ctx will
  8525. // supersede any context previously provided to the Context method.
  8526. func (c *MediaUploadCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *MediaUploadCall {
  8527. c.ctx_ = ctx
  8528. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  8529. return c
  8530. }
  8531. // ProgressUpdater provides a callback function that will be called
  8532. // after every chunk. It should be a low-latency function in order to
  8533. // not slow down the upload operation. This should only be called when
  8534. // using ResumableMedia (as opposed to Media).
  8535. func (c *MediaUploadCall) ProgressUpdater(pu googleapi.ProgressUpdater) *MediaUploadCall {
  8536. c.mediaInfo_.SetProgressUpdater(pu)
  8537. return c
  8538. }
  8539. // Fields allows partial responses to be retrieved. See
  8540. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8541. // for more information.
  8542. func (c *MediaUploadCall) Fields(s ...googleapi.Field) *MediaUploadCall {
  8543. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8544. return c
  8545. }
  8546. // Context sets the context to be used in this call's Do method. Any
  8547. // pending HTTP request will be aborted if the provided context is
  8548. // canceled.
  8549. // This context will supersede any context previously provided to the
  8550. // ResumableMedia method.
  8551. func (c *MediaUploadCall) Context(ctx context.Context) *MediaUploadCall {
  8552. c.ctx_ = ctx
  8553. return c
  8554. }
  8555. // Header returns an http.Header that can be modified by the caller to
  8556. // add HTTP headers to the request.
  8557. func (c *MediaUploadCall) Header() http.Header {
  8558. if c.header_ == nil {
  8559. c.header_ = make(http.Header)
  8560. }
  8561. return c.header_
  8562. }
  8563. func (c *MediaUploadCall) doRequest(alt string) (*http.Response, error) {
  8564. reqHeaders := make(http.Header)
  8565. for k, v := range c.header_ {
  8566. reqHeaders[k] = v
  8567. }
  8568. reqHeaders.Set("User-Agent", c.s.userAgent())
  8569. var body io.Reader = nil
  8570. body, err := googleapi.WithoutDataWrapper.JSONReader(c.media)
  8571. if err != nil {
  8572. return nil, err
  8573. }
  8574. reqHeaders.Set("Content-Type", "application/json")
  8575. c.urlParams_.Set("alt", alt)
  8576. c.urlParams_.Set("prettyPrint", "false")
  8577. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/media/{+resourceName}")
  8578. if c.mediaInfo_ != nil {
  8579. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  8580. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  8581. }
  8582. if body == nil {
  8583. body = new(bytes.Buffer)
  8584. reqHeaders.Set("Content-Type", "application/json")
  8585. }
  8586. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  8587. defer cleanup()
  8588. urls += "?" + c.urlParams_.Encode()
  8589. req, err := http.NewRequest("POST", urls, body)
  8590. if err != nil {
  8591. return nil, err
  8592. }
  8593. req.Header = reqHeaders
  8594. req.GetBody = getBody
  8595. googleapi.Expand(req.URL, map[string]string{
  8596. "resourceName": c.resourceName,
  8597. })
  8598. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8599. }
  8600. // Do executes the "cloudsearch.media.upload" call.
  8601. // Exactly one of *Media or error will be non-nil. Any non-2xx status
  8602. // code is an error. Response headers are in either
  8603. // *Media.ServerResponse.Header or (if a response was returned at all)
  8604. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8605. // check whether the returned error was because http.StatusNotModified
  8606. // was returned.
  8607. func (c *MediaUploadCall) Do(opts ...googleapi.CallOption) (*Media, error) {
  8608. gensupport.SetOptions(c.urlParams_, opts...)
  8609. res, err := c.doRequest("json")
  8610. if res != nil && res.StatusCode == http.StatusNotModified {
  8611. if res.Body != nil {
  8612. res.Body.Close()
  8613. }
  8614. return nil, &googleapi.Error{
  8615. Code: res.StatusCode,
  8616. Header: res.Header,
  8617. }
  8618. }
  8619. if err != nil {
  8620. return nil, err
  8621. }
  8622. defer googleapi.CloseBody(res)
  8623. if err := googleapi.CheckResponse(res); err != nil {
  8624. return nil, err
  8625. }
  8626. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  8627. if rx != nil {
  8628. rx.Client = c.s.client
  8629. rx.UserAgent = c.s.userAgent()
  8630. ctx := c.ctx_
  8631. if ctx == nil {
  8632. ctx = context.TODO()
  8633. }
  8634. res, err = rx.Upload(ctx)
  8635. if err != nil {
  8636. return nil, err
  8637. }
  8638. defer res.Body.Close()
  8639. if err := googleapi.CheckResponse(res); err != nil {
  8640. return nil, err
  8641. }
  8642. }
  8643. ret := &Media{
  8644. ServerResponse: googleapi.ServerResponse{
  8645. Header: res.Header,
  8646. HTTPStatusCode: res.StatusCode,
  8647. },
  8648. }
  8649. target := &ret
  8650. if err := gensupport.DecodeResponse(target, res); err != nil {
  8651. return nil, err
  8652. }
  8653. return ret, nil
  8654. // {
  8655. // "description": "Uploads media for indexing.\n\nThe upload endpoint supports direct and resumable upload protocols and\nis intended for large items that can not be inlined during index requests. To\nindex large content:\n\n1. Call upload to begin\n a session and get the item reference.\n1. Upload the content using the item reference's resource name.\n1. Call index with the item\n reference as the content.\n\nFor additional information, see\n[Create a content connector using the REST API](https://developers.google.com/cloud-search/docs/guides/content-connector#rest).",
  8656. // "flatPath": "v1/media/{mediaId}",
  8657. // "httpMethod": "POST",
  8658. // "id": "cloudsearch.media.upload",
  8659. // "mediaUpload": {
  8660. // "accept": [
  8661. // "*/*"
  8662. // ],
  8663. // "protocols": {
  8664. // "simple": {
  8665. // "multipart": true,
  8666. // "path": "/upload/v1/media/{+resourceName}"
  8667. // }
  8668. // }
  8669. // },
  8670. // "parameterOrder": [
  8671. // "resourceName"
  8672. // ],
  8673. // "parameters": {
  8674. // "resourceName": {
  8675. // "description": "Name of the media that is being downloaded. See\nReadRequest.resource_name.",
  8676. // "location": "path",
  8677. // "pattern": "^.+$",
  8678. // "required": true,
  8679. // "type": "string"
  8680. // }
  8681. // },
  8682. // "path": "v1/media/{+resourceName}",
  8683. // "request": {
  8684. // "$ref": "Media"
  8685. // },
  8686. // "response": {
  8687. // "$ref": "Media"
  8688. // },
  8689. // "scopes": [
  8690. // "https://www.googleapis.com/auth/cloud_search",
  8691. // "https://www.googleapis.com/auth/cloud_search.indexing"
  8692. // ],
  8693. // "supportsMediaUpload": true
  8694. // }
  8695. }
  8696. // method id "cloudsearch.operations.get":
  8697. type OperationsGetCall struct {
  8698. s *Service
  8699. name string
  8700. urlParams_ gensupport.URLParams
  8701. ifNoneMatch_ string
  8702. ctx_ context.Context
  8703. header_ http.Header
  8704. }
  8705. // Get: Gets the latest state of a long-running operation. Clients can
  8706. // use this
  8707. // method to poll the operation result at intervals as recommended by
  8708. // the API
  8709. // service.
  8710. func (r *OperationsService) Get(name string) *OperationsGetCall {
  8711. c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8712. c.name = name
  8713. return c
  8714. }
  8715. // Fields allows partial responses to be retrieved. See
  8716. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8717. // for more information.
  8718. func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
  8719. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8720. return c
  8721. }
  8722. // IfNoneMatch sets the optional parameter which makes the operation
  8723. // fail if the object's ETag matches the given value. This is useful for
  8724. // getting updates only after the object has changed since the last
  8725. // request. Use googleapi.IsNotModified to check whether the response
  8726. // error from Do is the result of In-None-Match.
  8727. func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
  8728. c.ifNoneMatch_ = entityTag
  8729. return c
  8730. }
  8731. // Context sets the context to be used in this call's Do method. Any
  8732. // pending HTTP request will be aborted if the provided context is
  8733. // canceled.
  8734. func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
  8735. c.ctx_ = ctx
  8736. return c
  8737. }
  8738. // Header returns an http.Header that can be modified by the caller to
  8739. // add HTTP headers to the request.
  8740. func (c *OperationsGetCall) Header() http.Header {
  8741. if c.header_ == nil {
  8742. c.header_ = make(http.Header)
  8743. }
  8744. return c.header_
  8745. }
  8746. func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
  8747. reqHeaders := make(http.Header)
  8748. for k, v := range c.header_ {
  8749. reqHeaders[k] = v
  8750. }
  8751. reqHeaders.Set("User-Agent", c.s.userAgent())
  8752. if c.ifNoneMatch_ != "" {
  8753. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8754. }
  8755. var body io.Reader = nil
  8756. c.urlParams_.Set("alt", alt)
  8757. c.urlParams_.Set("prettyPrint", "false")
  8758. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  8759. urls += "?" + c.urlParams_.Encode()
  8760. req, err := http.NewRequest("GET", urls, body)
  8761. if err != nil {
  8762. return nil, err
  8763. }
  8764. req.Header = reqHeaders
  8765. googleapi.Expand(req.URL, map[string]string{
  8766. "name": c.name,
  8767. })
  8768. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8769. }
  8770. // Do executes the "cloudsearch.operations.get" call.
  8771. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8772. // status code is an error. Response headers are in either
  8773. // *Operation.ServerResponse.Header or (if a response was returned at
  8774. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8775. // to check whether the returned error was because
  8776. // http.StatusNotModified was returned.
  8777. func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8778. gensupport.SetOptions(c.urlParams_, opts...)
  8779. res, err := c.doRequest("json")
  8780. if res != nil && res.StatusCode == http.StatusNotModified {
  8781. if res.Body != nil {
  8782. res.Body.Close()
  8783. }
  8784. return nil, &googleapi.Error{
  8785. Code: res.StatusCode,
  8786. Header: res.Header,
  8787. }
  8788. }
  8789. if err != nil {
  8790. return nil, err
  8791. }
  8792. defer googleapi.CloseBody(res)
  8793. if err := googleapi.CheckResponse(res); err != nil {
  8794. return nil, err
  8795. }
  8796. ret := &Operation{
  8797. ServerResponse: googleapi.ServerResponse{
  8798. Header: res.Header,
  8799. HTTPStatusCode: res.StatusCode,
  8800. },
  8801. }
  8802. target := &ret
  8803. if err := gensupport.DecodeResponse(target, res); err != nil {
  8804. return nil, err
  8805. }
  8806. return ret, nil
  8807. // {
  8808. // "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.",
  8809. // "flatPath": "v1/operations/{operationsId}",
  8810. // "httpMethod": "GET",
  8811. // "id": "cloudsearch.operations.get",
  8812. // "parameterOrder": [
  8813. // "name"
  8814. // ],
  8815. // "parameters": {
  8816. // "name": {
  8817. // "description": "The name of the operation resource.",
  8818. // "location": "path",
  8819. // "pattern": "^operations/.+$",
  8820. // "required": true,
  8821. // "type": "string"
  8822. // }
  8823. // },
  8824. // "path": "v1/{+name}",
  8825. // "response": {
  8826. // "$ref": "Operation"
  8827. // },
  8828. // "scopes": [
  8829. // "https://www.googleapis.com/auth/cloud_search",
  8830. // "https://www.googleapis.com/auth/cloud_search.debug",
  8831. // "https://www.googleapis.com/auth/cloud_search.indexing",
  8832. // "https://www.googleapis.com/auth/cloud_search.settings",
  8833. // "https://www.googleapis.com/auth/cloud_search.settings.indexing",
  8834. // "https://www.googleapis.com/auth/cloud_search.settings.query"
  8835. // ]
  8836. // }
  8837. }
  8838. // method id "cloudsearch.query.search":
  8839. type QuerySearchCall struct {
  8840. s *Service
  8841. searchrequest *SearchRequest
  8842. urlParams_ gensupport.URLParams
  8843. ctx_ context.Context
  8844. header_ http.Header
  8845. }
  8846. // Search: The Cloud Search Query API provides the search method, which
  8847. // returns
  8848. // the most relevant results from a user query. The results can come
  8849. // from
  8850. // G Suite Apps, such as Gmail or Google Drive, or they can come from
  8851. // data
  8852. // that you have indexed from a third party.
  8853. func (r *QueryService) Search(searchrequest *SearchRequest) *QuerySearchCall {
  8854. c := &QuerySearchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8855. c.searchrequest = searchrequest
  8856. return c
  8857. }
  8858. // Fields allows partial responses to be retrieved. See
  8859. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8860. // for more information.
  8861. func (c *QuerySearchCall) Fields(s ...googleapi.Field) *QuerySearchCall {
  8862. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8863. return c
  8864. }
  8865. // Context sets the context to be used in this call's Do method. Any
  8866. // pending HTTP request will be aborted if the provided context is
  8867. // canceled.
  8868. func (c *QuerySearchCall) Context(ctx context.Context) *QuerySearchCall {
  8869. c.ctx_ = ctx
  8870. return c
  8871. }
  8872. // Header returns an http.Header that can be modified by the caller to
  8873. // add HTTP headers to the request.
  8874. func (c *QuerySearchCall) Header() http.Header {
  8875. if c.header_ == nil {
  8876. c.header_ = make(http.Header)
  8877. }
  8878. return c.header_
  8879. }
  8880. func (c *QuerySearchCall) doRequest(alt string) (*http.Response, error) {
  8881. reqHeaders := make(http.Header)
  8882. for k, v := range c.header_ {
  8883. reqHeaders[k] = v
  8884. }
  8885. reqHeaders.Set("User-Agent", c.s.userAgent())
  8886. var body io.Reader = nil
  8887. body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchrequest)
  8888. if err != nil {
  8889. return nil, err
  8890. }
  8891. reqHeaders.Set("Content-Type", "application/json")
  8892. c.urlParams_.Set("alt", alt)
  8893. c.urlParams_.Set("prettyPrint", "false")
  8894. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/query/search")
  8895. urls += "?" + c.urlParams_.Encode()
  8896. req, err := http.NewRequest("POST", urls, body)
  8897. if err != nil {
  8898. return nil, err
  8899. }
  8900. req.Header = reqHeaders
  8901. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8902. }
  8903. // Do executes the "cloudsearch.query.search" call.
  8904. // Exactly one of *SearchResponse or error will be non-nil. Any non-2xx
  8905. // status code is an error. Response headers are in either
  8906. // *SearchResponse.ServerResponse.Header or (if a response was returned
  8907. // at all) in error.(*googleapi.Error).Header. Use
  8908. // googleapi.IsNotModified to check whether the returned error was
  8909. // because http.StatusNotModified was returned.
  8910. func (c *QuerySearchCall) Do(opts ...googleapi.CallOption) (*SearchResponse, error) {
  8911. gensupport.SetOptions(c.urlParams_, opts...)
  8912. res, err := c.doRequest("json")
  8913. if res != nil && res.StatusCode == http.StatusNotModified {
  8914. if res.Body != nil {
  8915. res.Body.Close()
  8916. }
  8917. return nil, &googleapi.Error{
  8918. Code: res.StatusCode,
  8919. Header: res.Header,
  8920. }
  8921. }
  8922. if err != nil {
  8923. return nil, err
  8924. }
  8925. defer googleapi.CloseBody(res)
  8926. if err := googleapi.CheckResponse(res); err != nil {
  8927. return nil, err
  8928. }
  8929. ret := &SearchResponse{
  8930. ServerResponse: googleapi.ServerResponse{
  8931. Header: res.Header,
  8932. HTTPStatusCode: res.StatusCode,
  8933. },
  8934. }
  8935. target := &ret
  8936. if err := gensupport.DecodeResponse(target, res); err != nil {
  8937. return nil, err
  8938. }
  8939. return ret, nil
  8940. // {
  8941. // "description": "The Cloud Search Query API provides the search method, which returns\nthe most relevant results from a user query. The results can come from\nG Suite Apps, such as Gmail or Google Drive, or they can come from data\nthat you have indexed from a third party.",
  8942. // "flatPath": "v1/query/search",
  8943. // "httpMethod": "POST",
  8944. // "id": "cloudsearch.query.search",
  8945. // "parameterOrder": [],
  8946. // "parameters": {},
  8947. // "path": "v1/query/search",
  8948. // "request": {
  8949. // "$ref": "SearchRequest"
  8950. // },
  8951. // "response": {
  8952. // "$ref": "SearchResponse"
  8953. // },
  8954. // "scopes": [
  8955. // "https://www.googleapis.com/auth/cloud_search",
  8956. // "https://www.googleapis.com/auth/cloud_search.query"
  8957. // ]
  8958. // }
  8959. }
  8960. // method id "cloudsearch.query.suggest":
  8961. type QuerySuggestCall struct {
  8962. s *Service
  8963. suggestrequest *SuggestRequest
  8964. urlParams_ gensupport.URLParams
  8965. ctx_ context.Context
  8966. header_ http.Header
  8967. }
  8968. // Suggest: Provides suggestions for autocompleting the query.
  8969. func (r *QueryService) Suggest(suggestrequest *SuggestRequest) *QuerySuggestCall {
  8970. c := &QuerySuggestCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8971. c.suggestrequest = suggestrequest
  8972. return c
  8973. }
  8974. // Fields allows partial responses to be retrieved. See
  8975. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8976. // for more information.
  8977. func (c *QuerySuggestCall) Fields(s ...googleapi.Field) *QuerySuggestCall {
  8978. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8979. return c
  8980. }
  8981. // Context sets the context to be used in this call's Do method. Any
  8982. // pending HTTP request will be aborted if the provided context is
  8983. // canceled.
  8984. func (c *QuerySuggestCall) Context(ctx context.Context) *QuerySuggestCall {
  8985. c.ctx_ = ctx
  8986. return c
  8987. }
  8988. // Header returns an http.Header that can be modified by the caller to
  8989. // add HTTP headers to the request.
  8990. func (c *QuerySuggestCall) Header() http.Header {
  8991. if c.header_ == nil {
  8992. c.header_ = make(http.Header)
  8993. }
  8994. return c.header_
  8995. }
  8996. func (c *QuerySuggestCall) doRequest(alt string) (*http.Response, error) {
  8997. reqHeaders := make(http.Header)
  8998. for k, v := range c.header_ {
  8999. reqHeaders[k] = v
  9000. }
  9001. reqHeaders.Set("User-Agent", c.s.userAgent())
  9002. var body io.Reader = nil
  9003. body, err := googleapi.WithoutDataWrapper.JSONReader(c.suggestrequest)
  9004. if err != nil {
  9005. return nil, err
  9006. }
  9007. reqHeaders.Set("Content-Type", "application/json")
  9008. c.urlParams_.Set("alt", alt)
  9009. c.urlParams_.Set("prettyPrint", "false")
  9010. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/query/suggest")
  9011. urls += "?" + c.urlParams_.Encode()
  9012. req, err := http.NewRequest("POST", urls, body)
  9013. if err != nil {
  9014. return nil, err
  9015. }
  9016. req.Header = reqHeaders
  9017. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9018. }
  9019. // Do executes the "cloudsearch.query.suggest" call.
  9020. // Exactly one of *SuggestResponse or error will be non-nil. Any non-2xx
  9021. // status code is an error. Response headers are in either
  9022. // *SuggestResponse.ServerResponse.Header or (if a response was returned
  9023. // at all) in error.(*googleapi.Error).Header. Use
  9024. // googleapi.IsNotModified to check whether the returned error was
  9025. // because http.StatusNotModified was returned.
  9026. func (c *QuerySuggestCall) Do(opts ...googleapi.CallOption) (*SuggestResponse, error) {
  9027. gensupport.SetOptions(c.urlParams_, opts...)
  9028. res, err := c.doRequest("json")
  9029. if res != nil && res.StatusCode == http.StatusNotModified {
  9030. if res.Body != nil {
  9031. res.Body.Close()
  9032. }
  9033. return nil, &googleapi.Error{
  9034. Code: res.StatusCode,
  9035. Header: res.Header,
  9036. }
  9037. }
  9038. if err != nil {
  9039. return nil, err
  9040. }
  9041. defer googleapi.CloseBody(res)
  9042. if err := googleapi.CheckResponse(res); err != nil {
  9043. return nil, err
  9044. }
  9045. ret := &SuggestResponse{
  9046. ServerResponse: googleapi.ServerResponse{
  9047. Header: res.Header,
  9048. HTTPStatusCode: res.StatusCode,
  9049. },
  9050. }
  9051. target := &ret
  9052. if err := gensupport.DecodeResponse(target, res); err != nil {
  9053. return nil, err
  9054. }
  9055. return ret, nil
  9056. // {
  9057. // "description": "Provides suggestions for autocompleting the query.",
  9058. // "flatPath": "v1/query/suggest",
  9059. // "httpMethod": "POST",
  9060. // "id": "cloudsearch.query.suggest",
  9061. // "parameterOrder": [],
  9062. // "parameters": {},
  9063. // "path": "v1/query/suggest",
  9064. // "request": {
  9065. // "$ref": "SuggestRequest"
  9066. // },
  9067. // "response": {
  9068. // "$ref": "SuggestResponse"
  9069. // },
  9070. // "scopes": [
  9071. // "https://www.googleapis.com/auth/cloud_search",
  9072. // "https://www.googleapis.com/auth/cloud_search.query"
  9073. // ]
  9074. // }
  9075. }
  9076. // method id "cloudsearch.query.sources.list":
  9077. type QuerySourcesListCall struct {
  9078. s *Service
  9079. urlParams_ gensupport.URLParams
  9080. ifNoneMatch_ string
  9081. ctx_ context.Context
  9082. header_ http.Header
  9083. }
  9084. // List: Returns list of sources that user can use for Search and
  9085. // Suggest APIs.
  9086. func (r *QuerySourcesService) List() *QuerySourcesListCall {
  9087. c := &QuerySourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9088. return c
  9089. }
  9090. // PageToken sets the optional parameter "pageToken": Number of sources
  9091. // to return in the response.
  9092. func (c *QuerySourcesListCall) PageToken(pageToken string) *QuerySourcesListCall {
  9093. c.urlParams_.Set("pageToken", pageToken)
  9094. return c
  9095. }
  9096. // RequestOptionsDebugOptionsEnableDebugging sets the optional parameter
  9097. // "requestOptions.debugOptions.enableDebugging": If set, the request
  9098. // will enable debugging features of Cloud Search.
  9099. // Only turn on this field, if asked by Google to help with debugging.
  9100. func (c *QuerySourcesListCall) RequestOptionsDebugOptionsEnableDebugging(requestOptionsDebugOptionsEnableDebugging bool) *QuerySourcesListCall {
  9101. c.urlParams_.Set("requestOptions.debugOptions.enableDebugging", fmt.Sprint(requestOptionsDebugOptionsEnableDebugging))
  9102. return c
  9103. }
  9104. // RequestOptionsLanguageCode sets the optional parameter
  9105. // "requestOptions.languageCode": The BCP-47 language code, such as
  9106. // "en-US" or "sr-Latn".
  9107. // For more information,
  9108. // see
  9109. // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
  9110. // Fo
  9111. // r translations.
  9112. func (c *QuerySourcesListCall) RequestOptionsLanguageCode(requestOptionsLanguageCode string) *QuerySourcesListCall {
  9113. c.urlParams_.Set("requestOptions.languageCode", requestOptionsLanguageCode)
  9114. return c
  9115. }
  9116. // RequestOptionsSearchApplicationId sets the optional parameter
  9117. // "requestOptions.searchApplicationId": Id of the application created
  9118. // using SearchApplicationsService.
  9119. func (c *QuerySourcesListCall) RequestOptionsSearchApplicationId(requestOptionsSearchApplicationId string) *QuerySourcesListCall {
  9120. c.urlParams_.Set("requestOptions.searchApplicationId", requestOptionsSearchApplicationId)
  9121. return c
  9122. }
  9123. // RequestOptionsTimeZone sets the optional parameter
  9124. // "requestOptions.timeZone": Current user's time zone id, such as
  9125. // "America/Los_Angeles" or
  9126. // "Australia/Sydney". These IDs are defined by
  9127. // [Unicode Common Locale Data Repository
  9128. // (CLDR)](http://cldr.unicode.org/)
  9129. // project, and currently available in the
  9130. // file
  9131. // [timezone.xml](http://unicode.org/repos/cldr/trunk/common/bcp47/t
  9132. // imezone.xml)
  9133. func (c *QuerySourcesListCall) RequestOptionsTimeZone(requestOptionsTimeZone string) *QuerySourcesListCall {
  9134. c.urlParams_.Set("requestOptions.timeZone", requestOptionsTimeZone)
  9135. return c
  9136. }
  9137. // Fields allows partial responses to be retrieved. See
  9138. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9139. // for more information.
  9140. func (c *QuerySourcesListCall) Fields(s ...googleapi.Field) *QuerySourcesListCall {
  9141. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9142. return c
  9143. }
  9144. // IfNoneMatch sets the optional parameter which makes the operation
  9145. // fail if the object's ETag matches the given value. This is useful for
  9146. // getting updates only after the object has changed since the last
  9147. // request. Use googleapi.IsNotModified to check whether the response
  9148. // error from Do is the result of In-None-Match.
  9149. func (c *QuerySourcesListCall) IfNoneMatch(entityTag string) *QuerySourcesListCall {
  9150. c.ifNoneMatch_ = entityTag
  9151. return c
  9152. }
  9153. // Context sets the context to be used in this call's Do method. Any
  9154. // pending HTTP request will be aborted if the provided context is
  9155. // canceled.
  9156. func (c *QuerySourcesListCall) Context(ctx context.Context) *QuerySourcesListCall {
  9157. c.ctx_ = ctx
  9158. return c
  9159. }
  9160. // Header returns an http.Header that can be modified by the caller to
  9161. // add HTTP headers to the request.
  9162. func (c *QuerySourcesListCall) Header() http.Header {
  9163. if c.header_ == nil {
  9164. c.header_ = make(http.Header)
  9165. }
  9166. return c.header_
  9167. }
  9168. func (c *QuerySourcesListCall) doRequest(alt string) (*http.Response, error) {
  9169. reqHeaders := make(http.Header)
  9170. for k, v := range c.header_ {
  9171. reqHeaders[k] = v
  9172. }
  9173. reqHeaders.Set("User-Agent", c.s.userAgent())
  9174. if c.ifNoneMatch_ != "" {
  9175. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9176. }
  9177. var body io.Reader = nil
  9178. c.urlParams_.Set("alt", alt)
  9179. c.urlParams_.Set("prettyPrint", "false")
  9180. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/query/sources")
  9181. urls += "?" + c.urlParams_.Encode()
  9182. req, err := http.NewRequest("GET", urls, body)
  9183. if err != nil {
  9184. return nil, err
  9185. }
  9186. req.Header = reqHeaders
  9187. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9188. }
  9189. // Do executes the "cloudsearch.query.sources.list" call.
  9190. // Exactly one of *ListQuerySourcesResponse or error will be non-nil.
  9191. // Any non-2xx status code is an error. Response headers are in either
  9192. // *ListQuerySourcesResponse.ServerResponse.Header or (if a response was
  9193. // returned at all) in error.(*googleapi.Error).Header. Use
  9194. // googleapi.IsNotModified to check whether the returned error was
  9195. // because http.StatusNotModified was returned.
  9196. func (c *QuerySourcesListCall) Do(opts ...googleapi.CallOption) (*ListQuerySourcesResponse, error) {
  9197. gensupport.SetOptions(c.urlParams_, opts...)
  9198. res, err := c.doRequest("json")
  9199. if res != nil && res.StatusCode == http.StatusNotModified {
  9200. if res.Body != nil {
  9201. res.Body.Close()
  9202. }
  9203. return nil, &googleapi.Error{
  9204. Code: res.StatusCode,
  9205. Header: res.Header,
  9206. }
  9207. }
  9208. if err != nil {
  9209. return nil, err
  9210. }
  9211. defer googleapi.CloseBody(res)
  9212. if err := googleapi.CheckResponse(res); err != nil {
  9213. return nil, err
  9214. }
  9215. ret := &ListQuerySourcesResponse{
  9216. ServerResponse: googleapi.ServerResponse{
  9217. Header: res.Header,
  9218. HTTPStatusCode: res.StatusCode,
  9219. },
  9220. }
  9221. target := &ret
  9222. if err := gensupport.DecodeResponse(target, res); err != nil {
  9223. return nil, err
  9224. }
  9225. return ret, nil
  9226. // {
  9227. // "description": "Returns list of sources that user can use for Search and Suggest APIs.",
  9228. // "flatPath": "v1/query/sources",
  9229. // "httpMethod": "GET",
  9230. // "id": "cloudsearch.query.sources.list",
  9231. // "parameterOrder": [],
  9232. // "parameters": {
  9233. // "pageToken": {
  9234. // "description": "Number of sources to return in the response.",
  9235. // "location": "query",
  9236. // "type": "string"
  9237. // },
  9238. // "requestOptions.debugOptions.enableDebugging": {
  9239. // "description": "If set, the request will enable debugging features of Cloud Search.\nOnly turn on this field, if asked by Google to help with debugging.",
  9240. // "location": "query",
  9241. // "type": "boolean"
  9242. // },
  9243. // "requestOptions.languageCode": {
  9244. // "description": "The BCP-47 language code, such as \"en-US\" or \"sr-Latn\".\nFor more information, see\nhttp://www.unicode.org/reports/tr35/#Unicode_locale_identifier.\nFor translations.",
  9245. // "location": "query",
  9246. // "type": "string"
  9247. // },
  9248. // "requestOptions.searchApplicationId": {
  9249. // "description": "Id of the application created using SearchApplicationsService.",
  9250. // "location": "query",
  9251. // "type": "string"
  9252. // },
  9253. // "requestOptions.timeZone": {
  9254. // "description": "Current user's time zone id, such as \"America/Los_Angeles\" or\n\"Australia/Sydney\". These IDs are defined by\n[Unicode Common Locale Data Repository (CLDR)](http://cldr.unicode.org/)\nproject, and currently available in the file\n[timezone.xml](http://unicode.org/repos/cldr/trunk/common/bcp47/timezone.xml)",
  9255. // "location": "query",
  9256. // "type": "string"
  9257. // }
  9258. // },
  9259. // "path": "v1/query/sources",
  9260. // "response": {
  9261. // "$ref": "ListQuerySourcesResponse"
  9262. // },
  9263. // "scopes": [
  9264. // "https://www.googleapis.com/auth/cloud_search",
  9265. // "https://www.googleapis.com/auth/cloud_search.query"
  9266. // ]
  9267. // }
  9268. }
  9269. // Pages invokes f for each page of results.
  9270. // A non-nil error returned from f will halt the iteration.
  9271. // The provided context supersedes any context provided to the Context method.
  9272. func (c *QuerySourcesListCall) Pages(ctx context.Context, f func(*ListQuerySourcesResponse) error) error {
  9273. c.ctx_ = ctx
  9274. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9275. for {
  9276. x, err := c.Do()
  9277. if err != nil {
  9278. return err
  9279. }
  9280. if err := f(x); err != nil {
  9281. return err
  9282. }
  9283. if x.NextPageToken == "" {
  9284. return nil
  9285. }
  9286. c.PageToken(x.NextPageToken)
  9287. }
  9288. }
  9289. // method id "cloudsearch.settings.datasources.create":
  9290. type SettingsDatasourcesCreateCall struct {
  9291. s *Service
  9292. datasource *DataSource
  9293. urlParams_ gensupport.URLParams
  9294. ctx_ context.Context
  9295. header_ http.Header
  9296. }
  9297. // Create: Creates a datasource.
  9298. func (r *SettingsDatasourcesService) Create(datasource *DataSource) *SettingsDatasourcesCreateCall {
  9299. c := &SettingsDatasourcesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9300. c.datasource = datasource
  9301. return c
  9302. }
  9303. // Fields allows partial responses to be retrieved. See
  9304. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9305. // for more information.
  9306. func (c *SettingsDatasourcesCreateCall) Fields(s ...googleapi.Field) *SettingsDatasourcesCreateCall {
  9307. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9308. return c
  9309. }
  9310. // Context sets the context to be used in this call's Do method. Any
  9311. // pending HTTP request will be aborted if the provided context is
  9312. // canceled.
  9313. func (c *SettingsDatasourcesCreateCall) Context(ctx context.Context) *SettingsDatasourcesCreateCall {
  9314. c.ctx_ = ctx
  9315. return c
  9316. }
  9317. // Header returns an http.Header that can be modified by the caller to
  9318. // add HTTP headers to the request.
  9319. func (c *SettingsDatasourcesCreateCall) Header() http.Header {
  9320. if c.header_ == nil {
  9321. c.header_ = make(http.Header)
  9322. }
  9323. return c.header_
  9324. }
  9325. func (c *SettingsDatasourcesCreateCall) doRequest(alt string) (*http.Response, error) {
  9326. reqHeaders := make(http.Header)
  9327. for k, v := range c.header_ {
  9328. reqHeaders[k] = v
  9329. }
  9330. reqHeaders.Set("User-Agent", c.s.userAgent())
  9331. var body io.Reader = nil
  9332. body, err := googleapi.WithoutDataWrapper.JSONReader(c.datasource)
  9333. if err != nil {
  9334. return nil, err
  9335. }
  9336. reqHeaders.Set("Content-Type", "application/json")
  9337. c.urlParams_.Set("alt", alt)
  9338. c.urlParams_.Set("prettyPrint", "false")
  9339. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/settings/datasources")
  9340. urls += "?" + c.urlParams_.Encode()
  9341. req, err := http.NewRequest("POST", urls, body)
  9342. if err != nil {
  9343. return nil, err
  9344. }
  9345. req.Header = reqHeaders
  9346. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9347. }
  9348. // Do executes the "cloudsearch.settings.datasources.create" call.
  9349. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9350. // status code is an error. Response headers are in either
  9351. // *Operation.ServerResponse.Header or (if a response was returned at
  9352. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9353. // to check whether the returned error was because
  9354. // http.StatusNotModified was returned.
  9355. func (c *SettingsDatasourcesCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9356. gensupport.SetOptions(c.urlParams_, opts...)
  9357. res, err := c.doRequest("json")
  9358. if res != nil && res.StatusCode == http.StatusNotModified {
  9359. if res.Body != nil {
  9360. res.Body.Close()
  9361. }
  9362. return nil, &googleapi.Error{
  9363. Code: res.StatusCode,
  9364. Header: res.Header,
  9365. }
  9366. }
  9367. if err != nil {
  9368. return nil, err
  9369. }
  9370. defer googleapi.CloseBody(res)
  9371. if err := googleapi.CheckResponse(res); err != nil {
  9372. return nil, err
  9373. }
  9374. ret := &Operation{
  9375. ServerResponse: googleapi.ServerResponse{
  9376. Header: res.Header,
  9377. HTTPStatusCode: res.StatusCode,
  9378. },
  9379. }
  9380. target := &ret
  9381. if err := gensupport.DecodeResponse(target, res); err != nil {
  9382. return nil, err
  9383. }
  9384. return ret, nil
  9385. // {
  9386. // "description": "Creates a datasource.",
  9387. // "flatPath": "v1/settings/datasources",
  9388. // "httpMethod": "POST",
  9389. // "id": "cloudsearch.settings.datasources.create",
  9390. // "parameterOrder": [],
  9391. // "parameters": {},
  9392. // "path": "v1/settings/datasources",
  9393. // "request": {
  9394. // "$ref": "DataSource"
  9395. // },
  9396. // "response": {
  9397. // "$ref": "Operation"
  9398. // },
  9399. // "scopes": [
  9400. // "https://www.googleapis.com/auth/cloud_search",
  9401. // "https://www.googleapis.com/auth/cloud_search.settings",
  9402. // "https://www.googleapis.com/auth/cloud_search.settings.indexing"
  9403. // ]
  9404. // }
  9405. }
  9406. // method id "cloudsearch.settings.datasources.delete":
  9407. type SettingsDatasourcesDeleteCall struct {
  9408. s *Service
  9409. name string
  9410. urlParams_ gensupport.URLParams
  9411. ctx_ context.Context
  9412. header_ http.Header
  9413. }
  9414. // Delete: Deletes a datasource.
  9415. func (r *SettingsDatasourcesService) Delete(name string) *SettingsDatasourcesDeleteCall {
  9416. c := &SettingsDatasourcesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9417. c.name = name
  9418. return c
  9419. }
  9420. // DebugOptionsEnableDebugging sets the optional parameter
  9421. // "debugOptions.enableDebugging": If set, the request will enable
  9422. // debugging features of Cloud Search.
  9423. // Only turn on this field, if asked by Google to help with debugging.
  9424. func (c *SettingsDatasourcesDeleteCall) DebugOptionsEnableDebugging(debugOptionsEnableDebugging bool) *SettingsDatasourcesDeleteCall {
  9425. c.urlParams_.Set("debugOptions.enableDebugging", fmt.Sprint(debugOptionsEnableDebugging))
  9426. return c
  9427. }
  9428. // Fields allows partial responses to be retrieved. See
  9429. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9430. // for more information.
  9431. func (c *SettingsDatasourcesDeleteCall) Fields(s ...googleapi.Field) *SettingsDatasourcesDeleteCall {
  9432. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9433. return c
  9434. }
  9435. // Context sets the context to be used in this call's Do method. Any
  9436. // pending HTTP request will be aborted if the provided context is
  9437. // canceled.
  9438. func (c *SettingsDatasourcesDeleteCall) Context(ctx context.Context) *SettingsDatasourcesDeleteCall {
  9439. c.ctx_ = ctx
  9440. return c
  9441. }
  9442. // Header returns an http.Header that can be modified by the caller to
  9443. // add HTTP headers to the request.
  9444. func (c *SettingsDatasourcesDeleteCall) Header() http.Header {
  9445. if c.header_ == nil {
  9446. c.header_ = make(http.Header)
  9447. }
  9448. return c.header_
  9449. }
  9450. func (c *SettingsDatasourcesDeleteCall) doRequest(alt string) (*http.Response, error) {
  9451. reqHeaders := make(http.Header)
  9452. for k, v := range c.header_ {
  9453. reqHeaders[k] = v
  9454. }
  9455. reqHeaders.Set("User-Agent", c.s.userAgent())
  9456. var body io.Reader = nil
  9457. c.urlParams_.Set("alt", alt)
  9458. c.urlParams_.Set("prettyPrint", "false")
  9459. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/settings/{+name}")
  9460. urls += "?" + c.urlParams_.Encode()
  9461. req, err := http.NewRequest("DELETE", urls, body)
  9462. if err != nil {
  9463. return nil, err
  9464. }
  9465. req.Header = reqHeaders
  9466. googleapi.Expand(req.URL, map[string]string{
  9467. "name": c.name,
  9468. })
  9469. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9470. }
  9471. // Do executes the "cloudsearch.settings.datasources.delete" call.
  9472. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9473. // status code is an error. Response headers are in either
  9474. // *Operation.ServerResponse.Header or (if a response was returned at
  9475. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9476. // to check whether the returned error was because
  9477. // http.StatusNotModified was returned.
  9478. func (c *SettingsDatasourcesDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9479. gensupport.SetOptions(c.urlParams_, opts...)
  9480. res, err := c.doRequest("json")
  9481. if res != nil && res.StatusCode == http.StatusNotModified {
  9482. if res.Body != nil {
  9483. res.Body.Close()
  9484. }
  9485. return nil, &googleapi.Error{
  9486. Code: res.StatusCode,
  9487. Header: res.Header,
  9488. }
  9489. }
  9490. if err != nil {
  9491. return nil, err
  9492. }
  9493. defer googleapi.CloseBody(res)
  9494. if err := googleapi.CheckResponse(res); err != nil {
  9495. return nil, err
  9496. }
  9497. ret := &Operation{
  9498. ServerResponse: googleapi.ServerResponse{
  9499. Header: res.Header,
  9500. HTTPStatusCode: res.StatusCode,
  9501. },
  9502. }
  9503. target := &ret
  9504. if err := gensupport.DecodeResponse(target, res); err != nil {
  9505. return nil, err
  9506. }
  9507. return ret, nil
  9508. // {
  9509. // "description": "Deletes a datasource.",
  9510. // "flatPath": "v1/settings/datasources/{datasourcesId}",
  9511. // "httpMethod": "DELETE",
  9512. // "id": "cloudsearch.settings.datasources.delete",
  9513. // "parameterOrder": [
  9514. // "name"
  9515. // ],
  9516. // "parameters": {
  9517. // "debugOptions.enableDebugging": {
  9518. // "description": "If set, the request will enable debugging features of Cloud Search.\nOnly turn on this field, if asked by Google to help with debugging.",
  9519. // "location": "query",
  9520. // "type": "boolean"
  9521. // },
  9522. // "name": {
  9523. // "description": "Name of the datasource.\nFormat: datasources/{source_id}.",
  9524. // "location": "path",
  9525. // "pattern": "^datasources/[^/]+$",
  9526. // "required": true,
  9527. // "type": "string"
  9528. // }
  9529. // },
  9530. // "path": "v1/settings/{+name}",
  9531. // "response": {
  9532. // "$ref": "Operation"
  9533. // },
  9534. // "scopes": [
  9535. // "https://www.googleapis.com/auth/cloud_search",
  9536. // "https://www.googleapis.com/auth/cloud_search.settings",
  9537. // "https://www.googleapis.com/auth/cloud_search.settings.indexing"
  9538. // ]
  9539. // }
  9540. }
  9541. // method id "cloudsearch.settings.datasources.get":
  9542. type SettingsDatasourcesGetCall struct {
  9543. s *Service
  9544. name string
  9545. urlParams_ gensupport.URLParams
  9546. ifNoneMatch_ string
  9547. ctx_ context.Context
  9548. header_ http.Header
  9549. }
  9550. // Get: Gets a datasource.
  9551. func (r *SettingsDatasourcesService) Get(name string) *SettingsDatasourcesGetCall {
  9552. c := &SettingsDatasourcesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9553. c.name = name
  9554. return c
  9555. }
  9556. // DebugOptionsEnableDebugging sets the optional parameter
  9557. // "debugOptions.enableDebugging": If set, the request will enable
  9558. // debugging features of Cloud Search.
  9559. // Only turn on this field, if asked by Google to help with debugging.
  9560. func (c *SettingsDatasourcesGetCall) DebugOptionsEnableDebugging(debugOptionsEnableDebugging bool) *SettingsDatasourcesGetCall {
  9561. c.urlParams_.Set("debugOptions.enableDebugging", fmt.Sprint(debugOptionsEnableDebugging))
  9562. return c
  9563. }
  9564. // Fields allows partial responses to be retrieved. See
  9565. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9566. // for more information.
  9567. func (c *SettingsDatasourcesGetCall) Fields(s ...googleapi.Field) *SettingsDatasourcesGetCall {
  9568. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9569. return c
  9570. }
  9571. // IfNoneMatch sets the optional parameter which makes the operation
  9572. // fail if the object's ETag matches the given value. This is useful for
  9573. // getting updates only after the object has changed since the last
  9574. // request. Use googleapi.IsNotModified to check whether the response
  9575. // error from Do is the result of In-None-Match.
  9576. func (c *SettingsDatasourcesGetCall) IfNoneMatch(entityTag string) *SettingsDatasourcesGetCall {
  9577. c.ifNoneMatch_ = entityTag
  9578. return c
  9579. }
  9580. // Context sets the context to be used in this call's Do method. Any
  9581. // pending HTTP request will be aborted if the provided context is
  9582. // canceled.
  9583. func (c *SettingsDatasourcesGetCall) Context(ctx context.Context) *SettingsDatasourcesGetCall {
  9584. c.ctx_ = ctx
  9585. return c
  9586. }
  9587. // Header returns an http.Header that can be modified by the caller to
  9588. // add HTTP headers to the request.
  9589. func (c *SettingsDatasourcesGetCall) Header() http.Header {
  9590. if c.header_ == nil {
  9591. c.header_ = make(http.Header)
  9592. }
  9593. return c.header_
  9594. }
  9595. func (c *SettingsDatasourcesGetCall) doRequest(alt string) (*http.Response, error) {
  9596. reqHeaders := make(http.Header)
  9597. for k, v := range c.header_ {
  9598. reqHeaders[k] = v
  9599. }
  9600. reqHeaders.Set("User-Agent", c.s.userAgent())
  9601. if c.ifNoneMatch_ != "" {
  9602. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9603. }
  9604. var body io.Reader = nil
  9605. c.urlParams_.Set("alt", alt)
  9606. c.urlParams_.Set("prettyPrint", "false")
  9607. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/settings/{+name}")
  9608. urls += "?" + c.urlParams_.Encode()
  9609. req, err := http.NewRequest("GET", urls, body)
  9610. if err != nil {
  9611. return nil, err
  9612. }
  9613. req.Header = reqHeaders
  9614. googleapi.Expand(req.URL, map[string]string{
  9615. "name": c.name,
  9616. })
  9617. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9618. }
  9619. // Do executes the "cloudsearch.settings.datasources.get" call.
  9620. // Exactly one of *DataSource or error will be non-nil. Any non-2xx
  9621. // status code is an error. Response headers are in either
  9622. // *DataSource.ServerResponse.Header or (if a response was returned at
  9623. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9624. // to check whether the returned error was because
  9625. // http.StatusNotModified was returned.
  9626. func (c *SettingsDatasourcesGetCall) Do(opts ...googleapi.CallOption) (*DataSource, error) {
  9627. gensupport.SetOptions(c.urlParams_, opts...)
  9628. res, err := c.doRequest("json")
  9629. if res != nil && res.StatusCode == http.StatusNotModified {
  9630. if res.Body != nil {
  9631. res.Body.Close()
  9632. }
  9633. return nil, &googleapi.Error{
  9634. Code: res.StatusCode,
  9635. Header: res.Header,
  9636. }
  9637. }
  9638. if err != nil {
  9639. return nil, err
  9640. }
  9641. defer googleapi.CloseBody(res)
  9642. if err := googleapi.CheckResponse(res); err != nil {
  9643. return nil, err
  9644. }
  9645. ret := &DataSource{
  9646. ServerResponse: googleapi.ServerResponse{
  9647. Header: res.Header,
  9648. HTTPStatusCode: res.StatusCode,
  9649. },
  9650. }
  9651. target := &ret
  9652. if err := gensupport.DecodeResponse(target, res); err != nil {
  9653. return nil, err
  9654. }
  9655. return ret, nil
  9656. // {
  9657. // "description": "Gets a datasource.",
  9658. // "flatPath": "v1/settings/datasources/{datasourcesId}",
  9659. // "httpMethod": "GET",
  9660. // "id": "cloudsearch.settings.datasources.get",
  9661. // "parameterOrder": [
  9662. // "name"
  9663. // ],
  9664. // "parameters": {
  9665. // "debugOptions.enableDebugging": {
  9666. // "description": "If set, the request will enable debugging features of Cloud Search.\nOnly turn on this field, if asked by Google to help with debugging.",
  9667. // "location": "query",
  9668. // "type": "boolean"
  9669. // },
  9670. // "name": {
  9671. // "description": "Name of the datasource resource.\nFormat: datasources/{source_id}.",
  9672. // "location": "path",
  9673. // "pattern": "^datasources/[^/]+$",
  9674. // "required": true,
  9675. // "type": "string"
  9676. // }
  9677. // },
  9678. // "path": "v1/settings/{+name}",
  9679. // "response": {
  9680. // "$ref": "DataSource"
  9681. // },
  9682. // "scopes": [
  9683. // "https://www.googleapis.com/auth/cloud_search",
  9684. // "https://www.googleapis.com/auth/cloud_search.settings",
  9685. // "https://www.googleapis.com/auth/cloud_search.settings.indexing"
  9686. // ]
  9687. // }
  9688. }
  9689. // method id "cloudsearch.settings.datasources.list":
  9690. type SettingsDatasourcesListCall struct {
  9691. s *Service
  9692. urlParams_ gensupport.URLParams
  9693. ifNoneMatch_ string
  9694. ctx_ context.Context
  9695. header_ http.Header
  9696. }
  9697. // List: Lists datasources.
  9698. func (r *SettingsDatasourcesService) List() *SettingsDatasourcesListCall {
  9699. c := &SettingsDatasourcesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9700. return c
  9701. }
  9702. // DebugOptionsEnableDebugging sets the optional parameter
  9703. // "debugOptions.enableDebugging": If set, the request will enable
  9704. // debugging features of Cloud Search.
  9705. // Only turn on this field, if asked by Google to help with debugging.
  9706. func (c *SettingsDatasourcesListCall) DebugOptionsEnableDebugging(debugOptionsEnableDebugging bool) *SettingsDatasourcesListCall {
  9707. c.urlParams_.Set("debugOptions.enableDebugging", fmt.Sprint(debugOptionsEnableDebugging))
  9708. return c
  9709. }
  9710. // PageSize sets the optional parameter "pageSize": Maximum number of
  9711. // datasources to fetch in a request.
  9712. // The max value is 100.
  9713. // <br />The default value is 10
  9714. func (c *SettingsDatasourcesListCall) PageSize(pageSize int64) *SettingsDatasourcesListCall {
  9715. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  9716. return c
  9717. }
  9718. // PageToken sets the optional parameter "pageToken": Starting index of
  9719. // the results.
  9720. func (c *SettingsDatasourcesListCall) PageToken(pageToken string) *SettingsDatasourcesListCall {
  9721. c.urlParams_.Set("pageToken", pageToken)
  9722. return c
  9723. }
  9724. // Fields allows partial responses to be retrieved. See
  9725. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9726. // for more information.
  9727. func (c *SettingsDatasourcesListCall) Fields(s ...googleapi.Field) *SettingsDatasourcesListCall {
  9728. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9729. return c
  9730. }
  9731. // IfNoneMatch sets the optional parameter which makes the operation
  9732. // fail if the object's ETag matches the given value. This is useful for
  9733. // getting updates only after the object has changed since the last
  9734. // request. Use googleapi.IsNotModified to check whether the response
  9735. // error from Do is the result of In-None-Match.
  9736. func (c *SettingsDatasourcesListCall) IfNoneMatch(entityTag string) *SettingsDatasourcesListCall {
  9737. c.ifNoneMatch_ = entityTag
  9738. return c
  9739. }
  9740. // Context sets the context to be used in this call's Do method. Any
  9741. // pending HTTP request will be aborted if the provided context is
  9742. // canceled.
  9743. func (c *SettingsDatasourcesListCall) Context(ctx context.Context) *SettingsDatasourcesListCall {
  9744. c.ctx_ = ctx
  9745. return c
  9746. }
  9747. // Header returns an http.Header that can be modified by the caller to
  9748. // add HTTP headers to the request.
  9749. func (c *SettingsDatasourcesListCall) Header() http.Header {
  9750. if c.header_ == nil {
  9751. c.header_ = make(http.Header)
  9752. }
  9753. return c.header_
  9754. }
  9755. func (c *SettingsDatasourcesListCall) doRequest(alt string) (*http.Response, error) {
  9756. reqHeaders := make(http.Header)
  9757. for k, v := range c.header_ {
  9758. reqHeaders[k] = v
  9759. }
  9760. reqHeaders.Set("User-Agent", c.s.userAgent())
  9761. if c.ifNoneMatch_ != "" {
  9762. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9763. }
  9764. var body io.Reader = nil
  9765. c.urlParams_.Set("alt", alt)
  9766. c.urlParams_.Set("prettyPrint", "false")
  9767. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/settings/datasources")
  9768. urls += "?" + c.urlParams_.Encode()
  9769. req, err := http.NewRequest("GET", urls, body)
  9770. if err != nil {
  9771. return nil, err
  9772. }
  9773. req.Header = reqHeaders
  9774. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9775. }
  9776. // Do executes the "cloudsearch.settings.datasources.list" call.
  9777. // Exactly one of *ListDataSourceResponse or error will be non-nil. Any
  9778. // non-2xx status code is an error. Response headers are in either
  9779. // *ListDataSourceResponse.ServerResponse.Header or (if a response was
  9780. // returned at all) in error.(*googleapi.Error).Header. Use
  9781. // googleapi.IsNotModified to check whether the returned error was
  9782. // because http.StatusNotModified was returned.
  9783. func (c *SettingsDatasourcesListCall) Do(opts ...googleapi.CallOption) (*ListDataSourceResponse, error) {
  9784. gensupport.SetOptions(c.urlParams_, opts...)
  9785. res, err := c.doRequest("json")
  9786. if res != nil && res.StatusCode == http.StatusNotModified {
  9787. if res.Body != nil {
  9788. res.Body.Close()
  9789. }
  9790. return nil, &googleapi.Error{
  9791. Code: res.StatusCode,
  9792. Header: res.Header,
  9793. }
  9794. }
  9795. if err != nil {
  9796. return nil, err
  9797. }
  9798. defer googleapi.CloseBody(res)
  9799. if err := googleapi.CheckResponse(res); err != nil {
  9800. return nil, err
  9801. }
  9802. ret := &ListDataSourceResponse{
  9803. ServerResponse: googleapi.ServerResponse{
  9804. Header: res.Header,
  9805. HTTPStatusCode: res.StatusCode,
  9806. },
  9807. }
  9808. target := &ret
  9809. if err := gensupport.DecodeResponse(target, res); err != nil {
  9810. return nil, err
  9811. }
  9812. return ret, nil
  9813. // {
  9814. // "description": "Lists datasources.",
  9815. // "flatPath": "v1/settings/datasources",
  9816. // "httpMethod": "GET",
  9817. // "id": "cloudsearch.settings.datasources.list",
  9818. // "parameterOrder": [],
  9819. // "parameters": {
  9820. // "debugOptions.enableDebugging": {
  9821. // "description": "If set, the request will enable debugging features of Cloud Search.\nOnly turn on this field, if asked by Google to help with debugging.",
  9822. // "location": "query",
  9823. // "type": "boolean"
  9824. // },
  9825. // "pageSize": {
  9826. // "description": "Maximum number of datasources to fetch in a request.\nThe max value is 100.\n\u003cbr /\u003eThe default value is 10",
  9827. // "format": "int32",
  9828. // "location": "query",
  9829. // "type": "integer"
  9830. // },
  9831. // "pageToken": {
  9832. // "description": "Starting index of the results.",
  9833. // "location": "query",
  9834. // "type": "string"
  9835. // }
  9836. // },
  9837. // "path": "v1/settings/datasources",
  9838. // "response": {
  9839. // "$ref": "ListDataSourceResponse"
  9840. // },
  9841. // "scopes": [
  9842. // "https://www.googleapis.com/auth/cloud_search",
  9843. // "https://www.googleapis.com/auth/cloud_search.settings",
  9844. // "https://www.googleapis.com/auth/cloud_search.settings.indexing"
  9845. // ]
  9846. // }
  9847. }
  9848. // Pages invokes f for each page of results.
  9849. // A non-nil error returned from f will halt the iteration.
  9850. // The provided context supersedes any context provided to the Context method.
  9851. func (c *SettingsDatasourcesListCall) Pages(ctx context.Context, f func(*ListDataSourceResponse) error) error {
  9852. c.ctx_ = ctx
  9853. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9854. for {
  9855. x, err := c.Do()
  9856. if err != nil {
  9857. return err
  9858. }
  9859. if err := f(x); err != nil {
  9860. return err
  9861. }
  9862. if x.NextPageToken == "" {
  9863. return nil
  9864. }
  9865. c.PageToken(x.NextPageToken)
  9866. }
  9867. }
  9868. // method id "cloudsearch.settings.datasources.update":
  9869. type SettingsDatasourcesUpdateCall struct {
  9870. s *Service
  9871. name string
  9872. updatedatasourcerequest *UpdateDataSourceRequest
  9873. urlParams_ gensupport.URLParams
  9874. ctx_ context.Context
  9875. header_ http.Header
  9876. }
  9877. // Update: Updates a datasource.
  9878. func (r *SettingsDatasourcesService) Update(name string, updatedatasourcerequest *UpdateDataSourceRequest) *SettingsDatasourcesUpdateCall {
  9879. c := &SettingsDatasourcesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9880. c.name = name
  9881. c.updatedatasourcerequest = updatedatasourcerequest
  9882. return c
  9883. }
  9884. // Fields allows partial responses to be retrieved. See
  9885. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9886. // for more information.
  9887. func (c *SettingsDatasourcesUpdateCall) Fields(s ...googleapi.Field) *SettingsDatasourcesUpdateCall {
  9888. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9889. return c
  9890. }
  9891. // Context sets the context to be used in this call's Do method. Any
  9892. // pending HTTP request will be aborted if the provided context is
  9893. // canceled.
  9894. func (c *SettingsDatasourcesUpdateCall) Context(ctx context.Context) *SettingsDatasourcesUpdateCall {
  9895. c.ctx_ = ctx
  9896. return c
  9897. }
  9898. // Header returns an http.Header that can be modified by the caller to
  9899. // add HTTP headers to the request.
  9900. func (c *SettingsDatasourcesUpdateCall) Header() http.Header {
  9901. if c.header_ == nil {
  9902. c.header_ = make(http.Header)
  9903. }
  9904. return c.header_
  9905. }
  9906. func (c *SettingsDatasourcesUpdateCall) doRequest(alt string) (*http.Response, error) {
  9907. reqHeaders := make(http.Header)
  9908. for k, v := range c.header_ {
  9909. reqHeaders[k] = v
  9910. }
  9911. reqHeaders.Set("User-Agent", c.s.userAgent())
  9912. var body io.Reader = nil
  9913. body, err := googleapi.WithoutDataWrapper.JSONReader(c.updatedatasourcerequest)
  9914. if err != nil {
  9915. return nil, err
  9916. }
  9917. reqHeaders.Set("Content-Type", "application/json")
  9918. c.urlParams_.Set("alt", alt)
  9919. c.urlParams_.Set("prettyPrint", "false")
  9920. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/settings/{+name}")
  9921. urls += "?" + c.urlParams_.Encode()
  9922. req, err := http.NewRequest("PUT", urls, body)
  9923. if err != nil {
  9924. return nil, err
  9925. }
  9926. req.Header = reqHeaders
  9927. googleapi.Expand(req.URL, map[string]string{
  9928. "name": c.name,
  9929. })
  9930. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9931. }
  9932. // Do executes the "cloudsearch.settings.datasources.update" call.
  9933. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  9934. // status code is an error. Response headers are in either
  9935. // *Operation.ServerResponse.Header or (if a response was returned at
  9936. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  9937. // to check whether the returned error was because
  9938. // http.StatusNotModified was returned.
  9939. func (c *SettingsDatasourcesUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  9940. gensupport.SetOptions(c.urlParams_, opts...)
  9941. res, err := c.doRequest("json")
  9942. if res != nil && res.StatusCode == http.StatusNotModified {
  9943. if res.Body != nil {
  9944. res.Body.Close()
  9945. }
  9946. return nil, &googleapi.Error{
  9947. Code: res.StatusCode,
  9948. Header: res.Header,
  9949. }
  9950. }
  9951. if err != nil {
  9952. return nil, err
  9953. }
  9954. defer googleapi.CloseBody(res)
  9955. if err := googleapi.CheckResponse(res); err != nil {
  9956. return nil, err
  9957. }
  9958. ret := &Operation{
  9959. ServerResponse: googleapi.ServerResponse{
  9960. Header: res.Header,
  9961. HTTPStatusCode: res.StatusCode,
  9962. },
  9963. }
  9964. target := &ret
  9965. if err := gensupport.DecodeResponse(target, res); err != nil {
  9966. return nil, err
  9967. }
  9968. return ret, nil
  9969. // {
  9970. // "description": "Updates a datasource.",
  9971. // "flatPath": "v1/settings/datasources/{datasourcesId}",
  9972. // "httpMethod": "PUT",
  9973. // "id": "cloudsearch.settings.datasources.update",
  9974. // "parameterOrder": [
  9975. // "name"
  9976. // ],
  9977. // "parameters": {
  9978. // "name": {
  9979. // "description": "Name of the datasource resource.\nFormat: datasources/{source_id}.\n\u003cbr /\u003eThe name is ignored when creating a datasource.",
  9980. // "location": "path",
  9981. // "pattern": "^datasources/[^/]+$",
  9982. // "required": true,
  9983. // "type": "string"
  9984. // }
  9985. // },
  9986. // "path": "v1/settings/{+name}",
  9987. // "request": {
  9988. // "$ref": "UpdateDataSourceRequest"
  9989. // },
  9990. // "response": {
  9991. // "$ref": "Operation"
  9992. // },
  9993. // "scopes": [
  9994. // "https://www.googleapis.com/auth/cloud_search",
  9995. // "https://www.googleapis.com/auth/cloud_search.settings",
  9996. // "https://www.googleapis.com/auth/cloud_search.settings.indexing"
  9997. // ]
  9998. // }
  9999. }
  10000. // method id "cloudsearch.settings.searchapplications.create":
  10001. type SettingsSearchapplicationsCreateCall struct {
  10002. s *Service
  10003. searchapplication *SearchApplication
  10004. urlParams_ gensupport.URLParams
  10005. ctx_ context.Context
  10006. header_ http.Header
  10007. }
  10008. // Create: Creates a search application.
  10009. func (r *SettingsSearchapplicationsService) Create(searchapplication *SearchApplication) *SettingsSearchapplicationsCreateCall {
  10010. c := &SettingsSearchapplicationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10011. c.searchapplication = searchapplication
  10012. return c
  10013. }
  10014. // Fields allows partial responses to be retrieved. See
  10015. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10016. // for more information.
  10017. func (c *SettingsSearchapplicationsCreateCall) Fields(s ...googleapi.Field) *SettingsSearchapplicationsCreateCall {
  10018. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10019. return c
  10020. }
  10021. // Context sets the context to be used in this call's Do method. Any
  10022. // pending HTTP request will be aborted if the provided context is
  10023. // canceled.
  10024. func (c *SettingsSearchapplicationsCreateCall) Context(ctx context.Context) *SettingsSearchapplicationsCreateCall {
  10025. c.ctx_ = ctx
  10026. return c
  10027. }
  10028. // Header returns an http.Header that can be modified by the caller to
  10029. // add HTTP headers to the request.
  10030. func (c *SettingsSearchapplicationsCreateCall) Header() http.Header {
  10031. if c.header_ == nil {
  10032. c.header_ = make(http.Header)
  10033. }
  10034. return c.header_
  10035. }
  10036. func (c *SettingsSearchapplicationsCreateCall) doRequest(alt string) (*http.Response, error) {
  10037. reqHeaders := make(http.Header)
  10038. for k, v := range c.header_ {
  10039. reqHeaders[k] = v
  10040. }
  10041. reqHeaders.Set("User-Agent", c.s.userAgent())
  10042. var body io.Reader = nil
  10043. body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchapplication)
  10044. if err != nil {
  10045. return nil, err
  10046. }
  10047. reqHeaders.Set("Content-Type", "application/json")
  10048. c.urlParams_.Set("alt", alt)
  10049. c.urlParams_.Set("prettyPrint", "false")
  10050. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/settings/searchapplications")
  10051. urls += "?" + c.urlParams_.Encode()
  10052. req, err := http.NewRequest("POST", urls, body)
  10053. if err != nil {
  10054. return nil, err
  10055. }
  10056. req.Header = reqHeaders
  10057. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10058. }
  10059. // Do executes the "cloudsearch.settings.searchapplications.create" call.
  10060. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10061. // status code is an error. Response headers are in either
  10062. // *Operation.ServerResponse.Header or (if a response was returned at
  10063. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10064. // to check whether the returned error was because
  10065. // http.StatusNotModified was returned.
  10066. func (c *SettingsSearchapplicationsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10067. gensupport.SetOptions(c.urlParams_, opts...)
  10068. res, err := c.doRequest("json")
  10069. if res != nil && res.StatusCode == http.StatusNotModified {
  10070. if res.Body != nil {
  10071. res.Body.Close()
  10072. }
  10073. return nil, &googleapi.Error{
  10074. Code: res.StatusCode,
  10075. Header: res.Header,
  10076. }
  10077. }
  10078. if err != nil {
  10079. return nil, err
  10080. }
  10081. defer googleapi.CloseBody(res)
  10082. if err := googleapi.CheckResponse(res); err != nil {
  10083. return nil, err
  10084. }
  10085. ret := &Operation{
  10086. ServerResponse: googleapi.ServerResponse{
  10087. Header: res.Header,
  10088. HTTPStatusCode: res.StatusCode,
  10089. },
  10090. }
  10091. target := &ret
  10092. if err := gensupport.DecodeResponse(target, res); err != nil {
  10093. return nil, err
  10094. }
  10095. return ret, nil
  10096. // {
  10097. // "description": "Creates a search application.",
  10098. // "flatPath": "v1/settings/searchapplications",
  10099. // "httpMethod": "POST",
  10100. // "id": "cloudsearch.settings.searchapplications.create",
  10101. // "parameterOrder": [],
  10102. // "parameters": {},
  10103. // "path": "v1/settings/searchapplications",
  10104. // "request": {
  10105. // "$ref": "SearchApplication"
  10106. // },
  10107. // "response": {
  10108. // "$ref": "Operation"
  10109. // },
  10110. // "scopes": [
  10111. // "https://www.googleapis.com/auth/cloud_search",
  10112. // "https://www.googleapis.com/auth/cloud_search.settings",
  10113. // "https://www.googleapis.com/auth/cloud_search.settings.query"
  10114. // ]
  10115. // }
  10116. }
  10117. // method id "cloudsearch.settings.searchapplications.delete":
  10118. type SettingsSearchapplicationsDeleteCall struct {
  10119. s *Service
  10120. name string
  10121. urlParams_ gensupport.URLParams
  10122. ctx_ context.Context
  10123. header_ http.Header
  10124. }
  10125. // Delete: Deletes a search application.
  10126. func (r *SettingsSearchapplicationsService) Delete(name string) *SettingsSearchapplicationsDeleteCall {
  10127. c := &SettingsSearchapplicationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10128. c.name = name
  10129. return c
  10130. }
  10131. // DebugOptionsEnableDebugging sets the optional parameter
  10132. // "debugOptions.enableDebugging": If set, the request will enable
  10133. // debugging features of Cloud Search.
  10134. // Only turn on this field, if asked by Google to help with debugging.
  10135. func (c *SettingsSearchapplicationsDeleteCall) DebugOptionsEnableDebugging(debugOptionsEnableDebugging bool) *SettingsSearchapplicationsDeleteCall {
  10136. c.urlParams_.Set("debugOptions.enableDebugging", fmt.Sprint(debugOptionsEnableDebugging))
  10137. return c
  10138. }
  10139. // Fields allows partial responses to be retrieved. See
  10140. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10141. // for more information.
  10142. func (c *SettingsSearchapplicationsDeleteCall) Fields(s ...googleapi.Field) *SettingsSearchapplicationsDeleteCall {
  10143. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10144. return c
  10145. }
  10146. // Context sets the context to be used in this call's Do method. Any
  10147. // pending HTTP request will be aborted if the provided context is
  10148. // canceled.
  10149. func (c *SettingsSearchapplicationsDeleteCall) Context(ctx context.Context) *SettingsSearchapplicationsDeleteCall {
  10150. c.ctx_ = ctx
  10151. return c
  10152. }
  10153. // Header returns an http.Header that can be modified by the caller to
  10154. // add HTTP headers to the request.
  10155. func (c *SettingsSearchapplicationsDeleteCall) Header() http.Header {
  10156. if c.header_ == nil {
  10157. c.header_ = make(http.Header)
  10158. }
  10159. return c.header_
  10160. }
  10161. func (c *SettingsSearchapplicationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  10162. reqHeaders := make(http.Header)
  10163. for k, v := range c.header_ {
  10164. reqHeaders[k] = v
  10165. }
  10166. reqHeaders.Set("User-Agent", c.s.userAgent())
  10167. var body io.Reader = nil
  10168. c.urlParams_.Set("alt", alt)
  10169. c.urlParams_.Set("prettyPrint", "false")
  10170. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/settings/{+name}")
  10171. urls += "?" + c.urlParams_.Encode()
  10172. req, err := http.NewRequest("DELETE", urls, body)
  10173. if err != nil {
  10174. return nil, err
  10175. }
  10176. req.Header = reqHeaders
  10177. googleapi.Expand(req.URL, map[string]string{
  10178. "name": c.name,
  10179. })
  10180. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10181. }
  10182. // Do executes the "cloudsearch.settings.searchapplications.delete" call.
  10183. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10184. // status code is an error. Response headers are in either
  10185. // *Operation.ServerResponse.Header or (if a response was returned at
  10186. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10187. // to check whether the returned error was because
  10188. // http.StatusNotModified was returned.
  10189. func (c *SettingsSearchapplicationsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10190. gensupport.SetOptions(c.urlParams_, opts...)
  10191. res, err := c.doRequest("json")
  10192. if res != nil && res.StatusCode == http.StatusNotModified {
  10193. if res.Body != nil {
  10194. res.Body.Close()
  10195. }
  10196. return nil, &googleapi.Error{
  10197. Code: res.StatusCode,
  10198. Header: res.Header,
  10199. }
  10200. }
  10201. if err != nil {
  10202. return nil, err
  10203. }
  10204. defer googleapi.CloseBody(res)
  10205. if err := googleapi.CheckResponse(res); err != nil {
  10206. return nil, err
  10207. }
  10208. ret := &Operation{
  10209. ServerResponse: googleapi.ServerResponse{
  10210. Header: res.Header,
  10211. HTTPStatusCode: res.StatusCode,
  10212. },
  10213. }
  10214. target := &ret
  10215. if err := gensupport.DecodeResponse(target, res); err != nil {
  10216. return nil, err
  10217. }
  10218. return ret, nil
  10219. // {
  10220. // "description": "Deletes a search application.",
  10221. // "flatPath": "v1/settings/searchapplications/{searchapplicationsId}",
  10222. // "httpMethod": "DELETE",
  10223. // "id": "cloudsearch.settings.searchapplications.delete",
  10224. // "parameterOrder": [
  10225. // "name"
  10226. // ],
  10227. // "parameters": {
  10228. // "debugOptions.enableDebugging": {
  10229. // "description": "If set, the request will enable debugging features of Cloud Search.\nOnly turn on this field, if asked by Google to help with debugging.",
  10230. // "location": "query",
  10231. // "type": "boolean"
  10232. // },
  10233. // "name": {
  10234. // "description": "The name of the search application to be deleted.\n\u003cbr /\u003eFormat: applications/{application_id}.",
  10235. // "location": "path",
  10236. // "pattern": "^searchapplications/[^/]+$",
  10237. // "required": true,
  10238. // "type": "string"
  10239. // }
  10240. // },
  10241. // "path": "v1/settings/{+name}",
  10242. // "response": {
  10243. // "$ref": "Operation"
  10244. // },
  10245. // "scopes": [
  10246. // "https://www.googleapis.com/auth/cloud_search",
  10247. // "https://www.googleapis.com/auth/cloud_search.settings",
  10248. // "https://www.googleapis.com/auth/cloud_search.settings.query"
  10249. // ]
  10250. // }
  10251. }
  10252. // method id "cloudsearch.settings.searchapplications.get":
  10253. type SettingsSearchapplicationsGetCall struct {
  10254. s *Service
  10255. name string
  10256. urlParams_ gensupport.URLParams
  10257. ifNoneMatch_ string
  10258. ctx_ context.Context
  10259. header_ http.Header
  10260. }
  10261. // Get: Gets the specified search application.
  10262. func (r *SettingsSearchapplicationsService) Get(name string) *SettingsSearchapplicationsGetCall {
  10263. c := &SettingsSearchapplicationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10264. c.name = name
  10265. return c
  10266. }
  10267. // DebugOptionsEnableDebugging sets the optional parameter
  10268. // "debugOptions.enableDebugging": If set, the request will enable
  10269. // debugging features of Cloud Search.
  10270. // Only turn on this field, if asked by Google to help with debugging.
  10271. func (c *SettingsSearchapplicationsGetCall) DebugOptionsEnableDebugging(debugOptionsEnableDebugging bool) *SettingsSearchapplicationsGetCall {
  10272. c.urlParams_.Set("debugOptions.enableDebugging", fmt.Sprint(debugOptionsEnableDebugging))
  10273. return c
  10274. }
  10275. // Fields allows partial responses to be retrieved. See
  10276. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10277. // for more information.
  10278. func (c *SettingsSearchapplicationsGetCall) Fields(s ...googleapi.Field) *SettingsSearchapplicationsGetCall {
  10279. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10280. return c
  10281. }
  10282. // IfNoneMatch sets the optional parameter which makes the operation
  10283. // fail if the object's ETag matches the given value. This is useful for
  10284. // getting updates only after the object has changed since the last
  10285. // request. Use googleapi.IsNotModified to check whether the response
  10286. // error from Do is the result of In-None-Match.
  10287. func (c *SettingsSearchapplicationsGetCall) IfNoneMatch(entityTag string) *SettingsSearchapplicationsGetCall {
  10288. c.ifNoneMatch_ = entityTag
  10289. return c
  10290. }
  10291. // Context sets the context to be used in this call's Do method. Any
  10292. // pending HTTP request will be aborted if the provided context is
  10293. // canceled.
  10294. func (c *SettingsSearchapplicationsGetCall) Context(ctx context.Context) *SettingsSearchapplicationsGetCall {
  10295. c.ctx_ = ctx
  10296. return c
  10297. }
  10298. // Header returns an http.Header that can be modified by the caller to
  10299. // add HTTP headers to the request.
  10300. func (c *SettingsSearchapplicationsGetCall) Header() http.Header {
  10301. if c.header_ == nil {
  10302. c.header_ = make(http.Header)
  10303. }
  10304. return c.header_
  10305. }
  10306. func (c *SettingsSearchapplicationsGetCall) doRequest(alt string) (*http.Response, error) {
  10307. reqHeaders := make(http.Header)
  10308. for k, v := range c.header_ {
  10309. reqHeaders[k] = v
  10310. }
  10311. reqHeaders.Set("User-Agent", c.s.userAgent())
  10312. if c.ifNoneMatch_ != "" {
  10313. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10314. }
  10315. var body io.Reader = nil
  10316. c.urlParams_.Set("alt", alt)
  10317. c.urlParams_.Set("prettyPrint", "false")
  10318. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/settings/{+name}")
  10319. urls += "?" + c.urlParams_.Encode()
  10320. req, err := http.NewRequest("GET", urls, body)
  10321. if err != nil {
  10322. return nil, err
  10323. }
  10324. req.Header = reqHeaders
  10325. googleapi.Expand(req.URL, map[string]string{
  10326. "name": c.name,
  10327. })
  10328. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10329. }
  10330. // Do executes the "cloudsearch.settings.searchapplications.get" call.
  10331. // Exactly one of *SearchApplication or error will be non-nil. Any
  10332. // non-2xx status code is an error. Response headers are in either
  10333. // *SearchApplication.ServerResponse.Header or (if a response was
  10334. // returned at all) in error.(*googleapi.Error).Header. Use
  10335. // googleapi.IsNotModified to check whether the returned error was
  10336. // because http.StatusNotModified was returned.
  10337. func (c *SettingsSearchapplicationsGetCall) Do(opts ...googleapi.CallOption) (*SearchApplication, error) {
  10338. gensupport.SetOptions(c.urlParams_, opts...)
  10339. res, err := c.doRequest("json")
  10340. if res != nil && res.StatusCode == http.StatusNotModified {
  10341. if res.Body != nil {
  10342. res.Body.Close()
  10343. }
  10344. return nil, &googleapi.Error{
  10345. Code: res.StatusCode,
  10346. Header: res.Header,
  10347. }
  10348. }
  10349. if err != nil {
  10350. return nil, err
  10351. }
  10352. defer googleapi.CloseBody(res)
  10353. if err := googleapi.CheckResponse(res); err != nil {
  10354. return nil, err
  10355. }
  10356. ret := &SearchApplication{
  10357. ServerResponse: googleapi.ServerResponse{
  10358. Header: res.Header,
  10359. HTTPStatusCode: res.StatusCode,
  10360. },
  10361. }
  10362. target := &ret
  10363. if err := gensupport.DecodeResponse(target, res); err != nil {
  10364. return nil, err
  10365. }
  10366. return ret, nil
  10367. // {
  10368. // "description": "Gets the specified search application.",
  10369. // "flatPath": "v1/settings/searchapplications/{searchapplicationsId}",
  10370. // "httpMethod": "GET",
  10371. // "id": "cloudsearch.settings.searchapplications.get",
  10372. // "parameterOrder": [
  10373. // "name"
  10374. // ],
  10375. // "parameters": {
  10376. // "debugOptions.enableDebugging": {
  10377. // "description": "If set, the request will enable debugging features of Cloud Search.\nOnly turn on this field, if asked by Google to help with debugging.",
  10378. // "location": "query",
  10379. // "type": "boolean"
  10380. // },
  10381. // "name": {
  10382. // "description": "Name of the search application.\n\u003cbr /\u003eFormat: applications/{application_id}.",
  10383. // "location": "path",
  10384. // "pattern": "^searchapplications/[^/]+$",
  10385. // "required": true,
  10386. // "type": "string"
  10387. // }
  10388. // },
  10389. // "path": "v1/settings/{+name}",
  10390. // "response": {
  10391. // "$ref": "SearchApplication"
  10392. // },
  10393. // "scopes": [
  10394. // "https://www.googleapis.com/auth/cloud_search",
  10395. // "https://www.googleapis.com/auth/cloud_search.settings",
  10396. // "https://www.googleapis.com/auth/cloud_search.settings.query"
  10397. // ]
  10398. // }
  10399. }
  10400. // method id "cloudsearch.settings.searchapplications.list":
  10401. type SettingsSearchapplicationsListCall struct {
  10402. s *Service
  10403. urlParams_ gensupport.URLParams
  10404. ifNoneMatch_ string
  10405. ctx_ context.Context
  10406. header_ http.Header
  10407. }
  10408. // List: Lists all search applications.
  10409. func (r *SettingsSearchapplicationsService) List() *SettingsSearchapplicationsListCall {
  10410. c := &SettingsSearchapplicationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10411. return c
  10412. }
  10413. // DebugOptionsEnableDebugging sets the optional parameter
  10414. // "debugOptions.enableDebugging": If set, the request will enable
  10415. // debugging features of Cloud Search.
  10416. // Only turn on this field, if asked by Google to help with debugging.
  10417. func (c *SettingsSearchapplicationsListCall) DebugOptionsEnableDebugging(debugOptionsEnableDebugging bool) *SettingsSearchapplicationsListCall {
  10418. c.urlParams_.Set("debugOptions.enableDebugging", fmt.Sprint(debugOptionsEnableDebugging))
  10419. return c
  10420. }
  10421. // PageSize sets the optional parameter "pageSize": The maximum number
  10422. // of items to return.
  10423. func (c *SettingsSearchapplicationsListCall) PageSize(pageSize int64) *SettingsSearchapplicationsListCall {
  10424. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  10425. return c
  10426. }
  10427. // PageToken sets the optional parameter "pageToken": The
  10428. // next_page_token value returned from a previous List request, if
  10429. // any.
  10430. // <br/> The default value is 10
  10431. func (c *SettingsSearchapplicationsListCall) PageToken(pageToken string) *SettingsSearchapplicationsListCall {
  10432. c.urlParams_.Set("pageToken", pageToken)
  10433. return c
  10434. }
  10435. // Fields allows partial responses to be retrieved. See
  10436. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10437. // for more information.
  10438. func (c *SettingsSearchapplicationsListCall) Fields(s ...googleapi.Field) *SettingsSearchapplicationsListCall {
  10439. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10440. return c
  10441. }
  10442. // IfNoneMatch sets the optional parameter which makes the operation
  10443. // fail if the object's ETag matches the given value. This is useful for
  10444. // getting updates only after the object has changed since the last
  10445. // request. Use googleapi.IsNotModified to check whether the response
  10446. // error from Do is the result of In-None-Match.
  10447. func (c *SettingsSearchapplicationsListCall) IfNoneMatch(entityTag string) *SettingsSearchapplicationsListCall {
  10448. c.ifNoneMatch_ = entityTag
  10449. return c
  10450. }
  10451. // Context sets the context to be used in this call's Do method. Any
  10452. // pending HTTP request will be aborted if the provided context is
  10453. // canceled.
  10454. func (c *SettingsSearchapplicationsListCall) Context(ctx context.Context) *SettingsSearchapplicationsListCall {
  10455. c.ctx_ = ctx
  10456. return c
  10457. }
  10458. // Header returns an http.Header that can be modified by the caller to
  10459. // add HTTP headers to the request.
  10460. func (c *SettingsSearchapplicationsListCall) Header() http.Header {
  10461. if c.header_ == nil {
  10462. c.header_ = make(http.Header)
  10463. }
  10464. return c.header_
  10465. }
  10466. func (c *SettingsSearchapplicationsListCall) doRequest(alt string) (*http.Response, error) {
  10467. reqHeaders := make(http.Header)
  10468. for k, v := range c.header_ {
  10469. reqHeaders[k] = v
  10470. }
  10471. reqHeaders.Set("User-Agent", c.s.userAgent())
  10472. if c.ifNoneMatch_ != "" {
  10473. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10474. }
  10475. var body io.Reader = nil
  10476. c.urlParams_.Set("alt", alt)
  10477. c.urlParams_.Set("prettyPrint", "false")
  10478. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/settings/searchapplications")
  10479. urls += "?" + c.urlParams_.Encode()
  10480. req, err := http.NewRequest("GET", urls, body)
  10481. if err != nil {
  10482. return nil, err
  10483. }
  10484. req.Header = reqHeaders
  10485. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10486. }
  10487. // Do executes the "cloudsearch.settings.searchapplications.list" call.
  10488. // Exactly one of *ListSearchApplicationsResponse or error will be
  10489. // non-nil. Any non-2xx status code is an error. Response headers are in
  10490. // either *ListSearchApplicationsResponse.ServerResponse.Header or (if a
  10491. // response was returned at all) in error.(*googleapi.Error).Header. Use
  10492. // googleapi.IsNotModified to check whether the returned error was
  10493. // because http.StatusNotModified was returned.
  10494. func (c *SettingsSearchapplicationsListCall) Do(opts ...googleapi.CallOption) (*ListSearchApplicationsResponse, error) {
  10495. gensupport.SetOptions(c.urlParams_, opts...)
  10496. res, err := c.doRequest("json")
  10497. if res != nil && res.StatusCode == http.StatusNotModified {
  10498. if res.Body != nil {
  10499. res.Body.Close()
  10500. }
  10501. return nil, &googleapi.Error{
  10502. Code: res.StatusCode,
  10503. Header: res.Header,
  10504. }
  10505. }
  10506. if err != nil {
  10507. return nil, err
  10508. }
  10509. defer googleapi.CloseBody(res)
  10510. if err := googleapi.CheckResponse(res); err != nil {
  10511. return nil, err
  10512. }
  10513. ret := &ListSearchApplicationsResponse{
  10514. ServerResponse: googleapi.ServerResponse{
  10515. Header: res.Header,
  10516. HTTPStatusCode: res.StatusCode,
  10517. },
  10518. }
  10519. target := &ret
  10520. if err := gensupport.DecodeResponse(target, res); err != nil {
  10521. return nil, err
  10522. }
  10523. return ret, nil
  10524. // {
  10525. // "description": "Lists all search applications.",
  10526. // "flatPath": "v1/settings/searchapplications",
  10527. // "httpMethod": "GET",
  10528. // "id": "cloudsearch.settings.searchapplications.list",
  10529. // "parameterOrder": [],
  10530. // "parameters": {
  10531. // "debugOptions.enableDebugging": {
  10532. // "description": "If set, the request will enable debugging features of Cloud Search.\nOnly turn on this field, if asked by Google to help with debugging.",
  10533. // "location": "query",
  10534. // "type": "boolean"
  10535. // },
  10536. // "pageSize": {
  10537. // "description": "The maximum number of items to return.",
  10538. // "format": "int32",
  10539. // "location": "query",
  10540. // "type": "integer"
  10541. // },
  10542. // "pageToken": {
  10543. // "description": "The next_page_token value returned from a previous List request, if any.\n\u003cbr/\u003e The default value is 10",
  10544. // "location": "query",
  10545. // "type": "string"
  10546. // }
  10547. // },
  10548. // "path": "v1/settings/searchapplications",
  10549. // "response": {
  10550. // "$ref": "ListSearchApplicationsResponse"
  10551. // },
  10552. // "scopes": [
  10553. // "https://www.googleapis.com/auth/cloud_search",
  10554. // "https://www.googleapis.com/auth/cloud_search.settings",
  10555. // "https://www.googleapis.com/auth/cloud_search.settings.query"
  10556. // ]
  10557. // }
  10558. }
  10559. // Pages invokes f for each page of results.
  10560. // A non-nil error returned from f will halt the iteration.
  10561. // The provided context supersedes any context provided to the Context method.
  10562. func (c *SettingsSearchapplicationsListCall) Pages(ctx context.Context, f func(*ListSearchApplicationsResponse) error) error {
  10563. c.ctx_ = ctx
  10564. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10565. for {
  10566. x, err := c.Do()
  10567. if err != nil {
  10568. return err
  10569. }
  10570. if err := f(x); err != nil {
  10571. return err
  10572. }
  10573. if x.NextPageToken == "" {
  10574. return nil
  10575. }
  10576. c.PageToken(x.NextPageToken)
  10577. }
  10578. }
  10579. // method id "cloudsearch.settings.searchapplications.reset":
  10580. type SettingsSearchapplicationsResetCall struct {
  10581. s *Service
  10582. name string
  10583. resetsearchapplicationrequest *ResetSearchApplicationRequest
  10584. urlParams_ gensupport.URLParams
  10585. ctx_ context.Context
  10586. header_ http.Header
  10587. }
  10588. // Reset: Resets a search application to default settings. This will
  10589. // return an empty
  10590. // response.
  10591. func (r *SettingsSearchapplicationsService) Reset(name string, resetsearchapplicationrequest *ResetSearchApplicationRequest) *SettingsSearchapplicationsResetCall {
  10592. c := &SettingsSearchapplicationsResetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10593. c.name = name
  10594. c.resetsearchapplicationrequest = resetsearchapplicationrequest
  10595. return c
  10596. }
  10597. // Fields allows partial responses to be retrieved. See
  10598. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10599. // for more information.
  10600. func (c *SettingsSearchapplicationsResetCall) Fields(s ...googleapi.Field) *SettingsSearchapplicationsResetCall {
  10601. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10602. return c
  10603. }
  10604. // Context sets the context to be used in this call's Do method. Any
  10605. // pending HTTP request will be aborted if the provided context is
  10606. // canceled.
  10607. func (c *SettingsSearchapplicationsResetCall) Context(ctx context.Context) *SettingsSearchapplicationsResetCall {
  10608. c.ctx_ = ctx
  10609. return c
  10610. }
  10611. // Header returns an http.Header that can be modified by the caller to
  10612. // add HTTP headers to the request.
  10613. func (c *SettingsSearchapplicationsResetCall) Header() http.Header {
  10614. if c.header_ == nil {
  10615. c.header_ = make(http.Header)
  10616. }
  10617. return c.header_
  10618. }
  10619. func (c *SettingsSearchapplicationsResetCall) doRequest(alt string) (*http.Response, error) {
  10620. reqHeaders := make(http.Header)
  10621. for k, v := range c.header_ {
  10622. reqHeaders[k] = v
  10623. }
  10624. reqHeaders.Set("User-Agent", c.s.userAgent())
  10625. var body io.Reader = nil
  10626. body, err := googleapi.WithoutDataWrapper.JSONReader(c.resetsearchapplicationrequest)
  10627. if err != nil {
  10628. return nil, err
  10629. }
  10630. reqHeaders.Set("Content-Type", "application/json")
  10631. c.urlParams_.Set("alt", alt)
  10632. c.urlParams_.Set("prettyPrint", "false")
  10633. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/settings/{+name}:reset")
  10634. urls += "?" + c.urlParams_.Encode()
  10635. req, err := http.NewRequest("POST", urls, body)
  10636. if err != nil {
  10637. return nil, err
  10638. }
  10639. req.Header = reqHeaders
  10640. googleapi.Expand(req.URL, map[string]string{
  10641. "name": c.name,
  10642. })
  10643. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10644. }
  10645. // Do executes the "cloudsearch.settings.searchapplications.reset" call.
  10646. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10647. // status code is an error. Response headers are in either
  10648. // *Operation.ServerResponse.Header or (if a response was returned at
  10649. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10650. // to check whether the returned error was because
  10651. // http.StatusNotModified was returned.
  10652. func (c *SettingsSearchapplicationsResetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10653. gensupport.SetOptions(c.urlParams_, opts...)
  10654. res, err := c.doRequest("json")
  10655. if res != nil && res.StatusCode == http.StatusNotModified {
  10656. if res.Body != nil {
  10657. res.Body.Close()
  10658. }
  10659. return nil, &googleapi.Error{
  10660. Code: res.StatusCode,
  10661. Header: res.Header,
  10662. }
  10663. }
  10664. if err != nil {
  10665. return nil, err
  10666. }
  10667. defer googleapi.CloseBody(res)
  10668. if err := googleapi.CheckResponse(res); err != nil {
  10669. return nil, err
  10670. }
  10671. ret := &Operation{
  10672. ServerResponse: googleapi.ServerResponse{
  10673. Header: res.Header,
  10674. HTTPStatusCode: res.StatusCode,
  10675. },
  10676. }
  10677. target := &ret
  10678. if err := gensupport.DecodeResponse(target, res); err != nil {
  10679. return nil, err
  10680. }
  10681. return ret, nil
  10682. // {
  10683. // "description": "Resets a search application to default settings. This will return an empty\nresponse.",
  10684. // "flatPath": "v1/settings/searchapplications/{searchapplicationsId}:reset",
  10685. // "httpMethod": "POST",
  10686. // "id": "cloudsearch.settings.searchapplications.reset",
  10687. // "parameterOrder": [
  10688. // "name"
  10689. // ],
  10690. // "parameters": {
  10691. // "name": {
  10692. // "description": "The name of the search application to be reset.\n\u003cbr /\u003eFormat: applications/{application_id}.",
  10693. // "location": "path",
  10694. // "pattern": "^searchapplications/[^/]+$",
  10695. // "required": true,
  10696. // "type": "string"
  10697. // }
  10698. // },
  10699. // "path": "v1/settings/{+name}:reset",
  10700. // "request": {
  10701. // "$ref": "ResetSearchApplicationRequest"
  10702. // },
  10703. // "response": {
  10704. // "$ref": "Operation"
  10705. // },
  10706. // "scopes": [
  10707. // "https://www.googleapis.com/auth/cloud_search",
  10708. // "https://www.googleapis.com/auth/cloud_search.settings",
  10709. // "https://www.googleapis.com/auth/cloud_search.settings.query"
  10710. // ]
  10711. // }
  10712. }
  10713. // method id "cloudsearch.settings.searchapplications.update":
  10714. type SettingsSearchapplicationsUpdateCall struct {
  10715. s *Service
  10716. name string
  10717. searchapplication *SearchApplication
  10718. urlParams_ gensupport.URLParams
  10719. ctx_ context.Context
  10720. header_ http.Header
  10721. }
  10722. // Update: Updates a search application.
  10723. func (r *SettingsSearchapplicationsService) Update(name string, searchapplication *SearchApplication) *SettingsSearchapplicationsUpdateCall {
  10724. c := &SettingsSearchapplicationsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10725. c.name = name
  10726. c.searchapplication = searchapplication
  10727. return c
  10728. }
  10729. // Fields allows partial responses to be retrieved. See
  10730. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10731. // for more information.
  10732. func (c *SettingsSearchapplicationsUpdateCall) Fields(s ...googleapi.Field) *SettingsSearchapplicationsUpdateCall {
  10733. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10734. return c
  10735. }
  10736. // Context sets the context to be used in this call's Do method. Any
  10737. // pending HTTP request will be aborted if the provided context is
  10738. // canceled.
  10739. func (c *SettingsSearchapplicationsUpdateCall) Context(ctx context.Context) *SettingsSearchapplicationsUpdateCall {
  10740. c.ctx_ = ctx
  10741. return c
  10742. }
  10743. // Header returns an http.Header that can be modified by the caller to
  10744. // add HTTP headers to the request.
  10745. func (c *SettingsSearchapplicationsUpdateCall) Header() http.Header {
  10746. if c.header_ == nil {
  10747. c.header_ = make(http.Header)
  10748. }
  10749. return c.header_
  10750. }
  10751. func (c *SettingsSearchapplicationsUpdateCall) doRequest(alt string) (*http.Response, error) {
  10752. reqHeaders := make(http.Header)
  10753. for k, v := range c.header_ {
  10754. reqHeaders[k] = v
  10755. }
  10756. reqHeaders.Set("User-Agent", c.s.userAgent())
  10757. var body io.Reader = nil
  10758. body, err := googleapi.WithoutDataWrapper.JSONReader(c.searchapplication)
  10759. if err != nil {
  10760. return nil, err
  10761. }
  10762. reqHeaders.Set("Content-Type", "application/json")
  10763. c.urlParams_.Set("alt", alt)
  10764. c.urlParams_.Set("prettyPrint", "false")
  10765. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/settings/{+name}")
  10766. urls += "?" + c.urlParams_.Encode()
  10767. req, err := http.NewRequest("PUT", urls, body)
  10768. if err != nil {
  10769. return nil, err
  10770. }
  10771. req.Header = reqHeaders
  10772. googleapi.Expand(req.URL, map[string]string{
  10773. "name": c.name,
  10774. })
  10775. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10776. }
  10777. // Do executes the "cloudsearch.settings.searchapplications.update" call.
  10778. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10779. // status code is an error. Response headers are in either
  10780. // *Operation.ServerResponse.Header or (if a response was returned at
  10781. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10782. // to check whether the returned error was because
  10783. // http.StatusNotModified was returned.
  10784. func (c *SettingsSearchapplicationsUpdateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10785. gensupport.SetOptions(c.urlParams_, opts...)
  10786. res, err := c.doRequest("json")
  10787. if res != nil && res.StatusCode == http.StatusNotModified {
  10788. if res.Body != nil {
  10789. res.Body.Close()
  10790. }
  10791. return nil, &googleapi.Error{
  10792. Code: res.StatusCode,
  10793. Header: res.Header,
  10794. }
  10795. }
  10796. if err != nil {
  10797. return nil, err
  10798. }
  10799. defer googleapi.CloseBody(res)
  10800. if err := googleapi.CheckResponse(res); err != nil {
  10801. return nil, err
  10802. }
  10803. ret := &Operation{
  10804. ServerResponse: googleapi.ServerResponse{
  10805. Header: res.Header,
  10806. HTTPStatusCode: res.StatusCode,
  10807. },
  10808. }
  10809. target := &ret
  10810. if err := gensupport.DecodeResponse(target, res); err != nil {
  10811. return nil, err
  10812. }
  10813. return ret, nil
  10814. // {
  10815. // "description": "Updates a search application.",
  10816. // "flatPath": "v1/settings/searchapplications/{searchapplicationsId}",
  10817. // "httpMethod": "PUT",
  10818. // "id": "cloudsearch.settings.searchapplications.update",
  10819. // "parameterOrder": [
  10820. // "name"
  10821. // ],
  10822. // "parameters": {
  10823. // "name": {
  10824. // "description": "Name of the Search Application.\n\u003cbr /\u003eFormat: searchapplications/{application_id}.",
  10825. // "location": "path",
  10826. // "pattern": "^searchapplications/[^/]+$",
  10827. // "required": true,
  10828. // "type": "string"
  10829. // }
  10830. // },
  10831. // "path": "v1/settings/{+name}",
  10832. // "request": {
  10833. // "$ref": "SearchApplication"
  10834. // },
  10835. // "response": {
  10836. // "$ref": "Operation"
  10837. // },
  10838. // "scopes": [
  10839. // "https://www.googleapis.com/auth/cloud_search",
  10840. // "https://www.googleapis.com/auth/cloud_search.settings",
  10841. // "https://www.googleapis.com/auth/cloud_search.settings.query"
  10842. // ]
  10843. // }
  10844. }
  10845. // method id "cloudsearch.stats.getIndex":
  10846. type StatsGetIndexCall struct {
  10847. s *Service
  10848. urlParams_ gensupport.URLParams
  10849. ifNoneMatch_ string
  10850. ctx_ context.Context
  10851. header_ http.Header
  10852. }
  10853. // GetIndex: Gets indexed item statistics aggreggated across all data
  10854. // sources.
  10855. func (r *StatsService) GetIndex() *StatsGetIndexCall {
  10856. c := &StatsGetIndexCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10857. return c
  10858. }
  10859. // FromDateDay sets the optional parameter "fromDate.day": Day of month.
  10860. // Must be from 1 to 31 and valid for the year and month.
  10861. func (c *StatsGetIndexCall) FromDateDay(fromDateDay int64) *StatsGetIndexCall {
  10862. c.urlParams_.Set("fromDate.day", fmt.Sprint(fromDateDay))
  10863. return c
  10864. }
  10865. // FromDateMonth sets the optional parameter "fromDate.month": Month of
  10866. // date. Must be from 1 to 12.
  10867. func (c *StatsGetIndexCall) FromDateMonth(fromDateMonth int64) *StatsGetIndexCall {
  10868. c.urlParams_.Set("fromDate.month", fmt.Sprint(fromDateMonth))
  10869. return c
  10870. }
  10871. // FromDateYear sets the optional parameter "fromDate.year": Year of
  10872. // date. Must be from 1 to 9999.
  10873. func (c *StatsGetIndexCall) FromDateYear(fromDateYear int64) *StatsGetIndexCall {
  10874. c.urlParams_.Set("fromDate.year", fmt.Sprint(fromDateYear))
  10875. return c
  10876. }
  10877. // ToDateDay sets the optional parameter "toDate.day": Day of month.
  10878. // Must be from 1 to 31 and valid for the year and month.
  10879. func (c *StatsGetIndexCall) ToDateDay(toDateDay int64) *StatsGetIndexCall {
  10880. c.urlParams_.Set("toDate.day", fmt.Sprint(toDateDay))
  10881. return c
  10882. }
  10883. // ToDateMonth sets the optional parameter "toDate.month": Month of
  10884. // date. Must be from 1 to 12.
  10885. func (c *StatsGetIndexCall) ToDateMonth(toDateMonth int64) *StatsGetIndexCall {
  10886. c.urlParams_.Set("toDate.month", fmt.Sprint(toDateMonth))
  10887. return c
  10888. }
  10889. // ToDateYear sets the optional parameter "toDate.year": Year of date.
  10890. // Must be from 1 to 9999.
  10891. func (c *StatsGetIndexCall) ToDateYear(toDateYear int64) *StatsGetIndexCall {
  10892. c.urlParams_.Set("toDate.year", fmt.Sprint(toDateYear))
  10893. return c
  10894. }
  10895. // Fields allows partial responses to be retrieved. See
  10896. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10897. // for more information.
  10898. func (c *StatsGetIndexCall) Fields(s ...googleapi.Field) *StatsGetIndexCall {
  10899. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10900. return c
  10901. }
  10902. // IfNoneMatch sets the optional parameter which makes the operation
  10903. // fail if the object's ETag matches the given value. This is useful for
  10904. // getting updates only after the object has changed since the last
  10905. // request. Use googleapi.IsNotModified to check whether the response
  10906. // error from Do is the result of In-None-Match.
  10907. func (c *StatsGetIndexCall) IfNoneMatch(entityTag string) *StatsGetIndexCall {
  10908. c.ifNoneMatch_ = entityTag
  10909. return c
  10910. }
  10911. // Context sets the context to be used in this call's Do method. Any
  10912. // pending HTTP request will be aborted if the provided context is
  10913. // canceled.
  10914. func (c *StatsGetIndexCall) Context(ctx context.Context) *StatsGetIndexCall {
  10915. c.ctx_ = ctx
  10916. return c
  10917. }
  10918. // Header returns an http.Header that can be modified by the caller to
  10919. // add HTTP headers to the request.
  10920. func (c *StatsGetIndexCall) Header() http.Header {
  10921. if c.header_ == nil {
  10922. c.header_ = make(http.Header)
  10923. }
  10924. return c.header_
  10925. }
  10926. func (c *StatsGetIndexCall) doRequest(alt string) (*http.Response, error) {
  10927. reqHeaders := make(http.Header)
  10928. for k, v := range c.header_ {
  10929. reqHeaders[k] = v
  10930. }
  10931. reqHeaders.Set("User-Agent", c.s.userAgent())
  10932. if c.ifNoneMatch_ != "" {
  10933. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10934. }
  10935. var body io.Reader = nil
  10936. c.urlParams_.Set("alt", alt)
  10937. c.urlParams_.Set("prettyPrint", "false")
  10938. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/stats/index")
  10939. urls += "?" + c.urlParams_.Encode()
  10940. req, err := http.NewRequest("GET", urls, body)
  10941. if err != nil {
  10942. return nil, err
  10943. }
  10944. req.Header = reqHeaders
  10945. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10946. }
  10947. // Do executes the "cloudsearch.stats.getIndex" call.
  10948. // Exactly one of *GetCustomerIndexStatsResponse or error will be
  10949. // non-nil. Any non-2xx status code is an error. Response headers are in
  10950. // either *GetCustomerIndexStatsResponse.ServerResponse.Header or (if a
  10951. // response was returned at all) in error.(*googleapi.Error).Header. Use
  10952. // googleapi.IsNotModified to check whether the returned error was
  10953. // because http.StatusNotModified was returned.
  10954. func (c *StatsGetIndexCall) Do(opts ...googleapi.CallOption) (*GetCustomerIndexStatsResponse, error) {
  10955. gensupport.SetOptions(c.urlParams_, opts...)
  10956. res, err := c.doRequest("json")
  10957. if res != nil && res.StatusCode == http.StatusNotModified {
  10958. if res.Body != nil {
  10959. res.Body.Close()
  10960. }
  10961. return nil, &googleapi.Error{
  10962. Code: res.StatusCode,
  10963. Header: res.Header,
  10964. }
  10965. }
  10966. if err != nil {
  10967. return nil, err
  10968. }
  10969. defer googleapi.CloseBody(res)
  10970. if err := googleapi.CheckResponse(res); err != nil {
  10971. return nil, err
  10972. }
  10973. ret := &GetCustomerIndexStatsResponse{
  10974. ServerResponse: googleapi.ServerResponse{
  10975. Header: res.Header,
  10976. HTTPStatusCode: res.StatusCode,
  10977. },
  10978. }
  10979. target := &ret
  10980. if err := gensupport.DecodeResponse(target, res); err != nil {
  10981. return nil, err
  10982. }
  10983. return ret, nil
  10984. // {
  10985. // "description": "Gets indexed item statistics aggreggated across all data sources.",
  10986. // "flatPath": "v1/stats/index",
  10987. // "httpMethod": "GET",
  10988. // "id": "cloudsearch.stats.getIndex",
  10989. // "parameterOrder": [],
  10990. // "parameters": {
  10991. // "fromDate.day": {
  10992. // "description": "Day of month. Must be from 1 to 31 and valid for the year and month.",
  10993. // "format": "int32",
  10994. // "location": "query",
  10995. // "type": "integer"
  10996. // },
  10997. // "fromDate.month": {
  10998. // "description": "Month of date. Must be from 1 to 12.",
  10999. // "format": "int32",
  11000. // "location": "query",
  11001. // "type": "integer"
  11002. // },
  11003. // "fromDate.year": {
  11004. // "description": "Year of date. Must be from 1 to 9999.",
  11005. // "format": "int32",
  11006. // "location": "query",
  11007. // "type": "integer"
  11008. // },
  11009. // "toDate.day": {
  11010. // "description": "Day of month. Must be from 1 to 31 and valid for the year and month.",
  11011. // "format": "int32",
  11012. // "location": "query",
  11013. // "type": "integer"
  11014. // },
  11015. // "toDate.month": {
  11016. // "description": "Month of date. Must be from 1 to 12.",
  11017. // "format": "int32",
  11018. // "location": "query",
  11019. // "type": "integer"
  11020. // },
  11021. // "toDate.year": {
  11022. // "description": "Year of date. Must be from 1 to 9999.",
  11023. // "format": "int32",
  11024. // "location": "query",
  11025. // "type": "integer"
  11026. // }
  11027. // },
  11028. // "path": "v1/stats/index",
  11029. // "response": {
  11030. // "$ref": "GetCustomerIndexStatsResponse"
  11031. // },
  11032. // "scopes": [
  11033. // "https://www.googleapis.com/auth/cloud_search",
  11034. // "https://www.googleapis.com/auth/cloud_search.stats",
  11035. // "https://www.googleapis.com/auth/cloud_search.stats.indexing"
  11036. // ]
  11037. // }
  11038. }
  11039. // method id "cloudsearch.stats.index.datasources.get":
  11040. type StatsIndexDatasourcesGetCall struct {
  11041. s *Service
  11042. name string
  11043. urlParams_ gensupport.URLParams
  11044. ifNoneMatch_ string
  11045. ctx_ context.Context
  11046. header_ http.Header
  11047. }
  11048. // Get: Gets indexed item statistics for a single data source.
  11049. func (r *StatsIndexDatasourcesService) Get(name string) *StatsIndexDatasourcesGetCall {
  11050. c := &StatsIndexDatasourcesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11051. c.name = name
  11052. return c
  11053. }
  11054. // FromDateDay sets the optional parameter "fromDate.day": Day of month.
  11055. // Must be from 1 to 31 and valid for the year and month.
  11056. func (c *StatsIndexDatasourcesGetCall) FromDateDay(fromDateDay int64) *StatsIndexDatasourcesGetCall {
  11057. c.urlParams_.Set("fromDate.day", fmt.Sprint(fromDateDay))
  11058. return c
  11059. }
  11060. // FromDateMonth sets the optional parameter "fromDate.month": Month of
  11061. // date. Must be from 1 to 12.
  11062. func (c *StatsIndexDatasourcesGetCall) FromDateMonth(fromDateMonth int64) *StatsIndexDatasourcesGetCall {
  11063. c.urlParams_.Set("fromDate.month", fmt.Sprint(fromDateMonth))
  11064. return c
  11065. }
  11066. // FromDateYear sets the optional parameter "fromDate.year": Year of
  11067. // date. Must be from 1 to 9999.
  11068. func (c *StatsIndexDatasourcesGetCall) FromDateYear(fromDateYear int64) *StatsIndexDatasourcesGetCall {
  11069. c.urlParams_.Set("fromDate.year", fmt.Sprint(fromDateYear))
  11070. return c
  11071. }
  11072. // ToDateDay sets the optional parameter "toDate.day": Day of month.
  11073. // Must be from 1 to 31 and valid for the year and month.
  11074. func (c *StatsIndexDatasourcesGetCall) ToDateDay(toDateDay int64) *StatsIndexDatasourcesGetCall {
  11075. c.urlParams_.Set("toDate.day", fmt.Sprint(toDateDay))
  11076. return c
  11077. }
  11078. // ToDateMonth sets the optional parameter "toDate.month": Month of
  11079. // date. Must be from 1 to 12.
  11080. func (c *StatsIndexDatasourcesGetCall) ToDateMonth(toDateMonth int64) *StatsIndexDatasourcesGetCall {
  11081. c.urlParams_.Set("toDate.month", fmt.Sprint(toDateMonth))
  11082. return c
  11083. }
  11084. // ToDateYear sets the optional parameter "toDate.year": Year of date.
  11085. // Must be from 1 to 9999.
  11086. func (c *StatsIndexDatasourcesGetCall) ToDateYear(toDateYear int64) *StatsIndexDatasourcesGetCall {
  11087. c.urlParams_.Set("toDate.year", fmt.Sprint(toDateYear))
  11088. return c
  11089. }
  11090. // Fields allows partial responses to be retrieved. See
  11091. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11092. // for more information.
  11093. func (c *StatsIndexDatasourcesGetCall) Fields(s ...googleapi.Field) *StatsIndexDatasourcesGetCall {
  11094. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11095. return c
  11096. }
  11097. // IfNoneMatch sets the optional parameter which makes the operation
  11098. // fail if the object's ETag matches the given value. This is useful for
  11099. // getting updates only after the object has changed since the last
  11100. // request. Use googleapi.IsNotModified to check whether the response
  11101. // error from Do is the result of In-None-Match.
  11102. func (c *StatsIndexDatasourcesGetCall) IfNoneMatch(entityTag string) *StatsIndexDatasourcesGetCall {
  11103. c.ifNoneMatch_ = entityTag
  11104. return c
  11105. }
  11106. // Context sets the context to be used in this call's Do method. Any
  11107. // pending HTTP request will be aborted if the provided context is
  11108. // canceled.
  11109. func (c *StatsIndexDatasourcesGetCall) Context(ctx context.Context) *StatsIndexDatasourcesGetCall {
  11110. c.ctx_ = ctx
  11111. return c
  11112. }
  11113. // Header returns an http.Header that can be modified by the caller to
  11114. // add HTTP headers to the request.
  11115. func (c *StatsIndexDatasourcesGetCall) Header() http.Header {
  11116. if c.header_ == nil {
  11117. c.header_ = make(http.Header)
  11118. }
  11119. return c.header_
  11120. }
  11121. func (c *StatsIndexDatasourcesGetCall) doRequest(alt string) (*http.Response, error) {
  11122. reqHeaders := make(http.Header)
  11123. for k, v := range c.header_ {
  11124. reqHeaders[k] = v
  11125. }
  11126. reqHeaders.Set("User-Agent", c.s.userAgent())
  11127. if c.ifNoneMatch_ != "" {
  11128. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11129. }
  11130. var body io.Reader = nil
  11131. c.urlParams_.Set("alt", alt)
  11132. c.urlParams_.Set("prettyPrint", "false")
  11133. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/stats/index/{+name}")
  11134. urls += "?" + c.urlParams_.Encode()
  11135. req, err := http.NewRequest("GET", urls, body)
  11136. if err != nil {
  11137. return nil, err
  11138. }
  11139. req.Header = reqHeaders
  11140. googleapi.Expand(req.URL, map[string]string{
  11141. "name": c.name,
  11142. })
  11143. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11144. }
  11145. // Do executes the "cloudsearch.stats.index.datasources.get" call.
  11146. // Exactly one of *GetDataSourceIndexStatsResponse or error will be
  11147. // non-nil. Any non-2xx status code is an error. Response headers are in
  11148. // either *GetDataSourceIndexStatsResponse.ServerResponse.Header or (if
  11149. // a response was returned at all) in error.(*googleapi.Error).Header.
  11150. // Use googleapi.IsNotModified to check whether the returned error was
  11151. // because http.StatusNotModified was returned.
  11152. func (c *StatsIndexDatasourcesGetCall) Do(opts ...googleapi.CallOption) (*GetDataSourceIndexStatsResponse, error) {
  11153. gensupport.SetOptions(c.urlParams_, opts...)
  11154. res, err := c.doRequest("json")
  11155. if res != nil && res.StatusCode == http.StatusNotModified {
  11156. if res.Body != nil {
  11157. res.Body.Close()
  11158. }
  11159. return nil, &googleapi.Error{
  11160. Code: res.StatusCode,
  11161. Header: res.Header,
  11162. }
  11163. }
  11164. if err != nil {
  11165. return nil, err
  11166. }
  11167. defer googleapi.CloseBody(res)
  11168. if err := googleapi.CheckResponse(res); err != nil {
  11169. return nil, err
  11170. }
  11171. ret := &GetDataSourceIndexStatsResponse{
  11172. ServerResponse: googleapi.ServerResponse{
  11173. Header: res.Header,
  11174. HTTPStatusCode: res.StatusCode,
  11175. },
  11176. }
  11177. target := &ret
  11178. if err := gensupport.DecodeResponse(target, res); err != nil {
  11179. return nil, err
  11180. }
  11181. return ret, nil
  11182. // {
  11183. // "description": "Gets indexed item statistics for a single data source.",
  11184. // "flatPath": "v1/stats/index/datasources/{datasourcesId}",
  11185. // "httpMethod": "GET",
  11186. // "id": "cloudsearch.stats.index.datasources.get",
  11187. // "parameterOrder": [
  11188. // "name"
  11189. // ],
  11190. // "parameters": {
  11191. // "fromDate.day": {
  11192. // "description": "Day of month. Must be from 1 to 31 and valid for the year and month.",
  11193. // "format": "int32",
  11194. // "location": "query",
  11195. // "type": "integer"
  11196. // },
  11197. // "fromDate.month": {
  11198. // "description": "Month of date. Must be from 1 to 12.",
  11199. // "format": "int32",
  11200. // "location": "query",
  11201. // "type": "integer"
  11202. // },
  11203. // "fromDate.year": {
  11204. // "description": "Year of date. Must be from 1 to 9999.",
  11205. // "format": "int32",
  11206. // "location": "query",
  11207. // "type": "integer"
  11208. // },
  11209. // "name": {
  11210. // "description": "The resource id of the data source to retrieve statistics for,\nin the following format: \"datasources/{source_id}\"",
  11211. // "location": "path",
  11212. // "pattern": "^datasources/[^/]+$",
  11213. // "required": true,
  11214. // "type": "string"
  11215. // },
  11216. // "toDate.day": {
  11217. // "description": "Day of month. Must be from 1 to 31 and valid for the year and month.",
  11218. // "format": "int32",
  11219. // "location": "query",
  11220. // "type": "integer"
  11221. // },
  11222. // "toDate.month": {
  11223. // "description": "Month of date. Must be from 1 to 12.",
  11224. // "format": "int32",
  11225. // "location": "query",
  11226. // "type": "integer"
  11227. // },
  11228. // "toDate.year": {
  11229. // "description": "Year of date. Must be from 1 to 9999.",
  11230. // "format": "int32",
  11231. // "location": "query",
  11232. // "type": "integer"
  11233. // }
  11234. // },
  11235. // "path": "v1/stats/index/{+name}",
  11236. // "response": {
  11237. // "$ref": "GetDataSourceIndexStatsResponse"
  11238. // },
  11239. // "scopes": [
  11240. // "https://www.googleapis.com/auth/cloud_search",
  11241. // "https://www.googleapis.com/auth/cloud_search.stats",
  11242. // "https://www.googleapis.com/auth/cloud_search.stats.indexing"
  11243. // ]
  11244. // }
  11245. }