You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

2864 lines
117 KiB

  1. // Package videointelligence provides access to the Cloud Video Intelligence API.
  2. //
  3. // See https://cloud.google.com/video-intelligence/docs/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/videointelligence/v1"
  8. // ...
  9. // videointelligenceService, err := videointelligence.New(oauthHttpClient)
  10. package videointelligence // import "google.golang.org/api/videointelligence/v1"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "videointelligence:v1"
  41. const apiName = "videointelligence"
  42. const apiVersion = "v1"
  43. const basePath = "https://videointelligence.googleapis.com/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. )
  49. func New(client *http.Client) (*Service, error) {
  50. if client == nil {
  51. return nil, errors.New("client is nil")
  52. }
  53. s := &Service{client: client, BasePath: basePath}
  54. s.Operations = NewOperationsService(s)
  55. s.Videos = NewVideosService(s)
  56. return s, nil
  57. }
  58. type Service struct {
  59. client *http.Client
  60. BasePath string // API endpoint base URL
  61. UserAgent string // optional additional User-Agent fragment
  62. Operations *OperationsService
  63. Videos *VideosService
  64. }
  65. func (s *Service) userAgent() string {
  66. if s.UserAgent == "" {
  67. return googleapi.UserAgent
  68. }
  69. return googleapi.UserAgent + " " + s.UserAgent
  70. }
  71. func NewOperationsService(s *Service) *OperationsService {
  72. rs := &OperationsService{s: s}
  73. return rs
  74. }
  75. type OperationsService struct {
  76. s *Service
  77. }
  78. func NewVideosService(s *Service) *VideosService {
  79. rs := &VideosService{s: s}
  80. return rs
  81. }
  82. type VideosService struct {
  83. s *Service
  84. }
  85. // GoogleCloudVideointelligenceV1AnnotateVideoProgress: Video annotation
  86. // progress. Included in the `metadata`
  87. // field of the `Operation` returned by the `GetOperation`
  88. // call of the `google::longrunning::Operations` service.
  89. type GoogleCloudVideointelligenceV1AnnotateVideoProgress struct {
  90. // AnnotationProgress: Progress metadata for all videos specified in
  91. // `AnnotateVideoRequest`.
  92. AnnotationProgress []*GoogleCloudVideointelligenceV1VideoAnnotationProgress `json:"annotationProgress,omitempty"`
  93. // ForceSendFields is a list of field names (e.g. "AnnotationProgress")
  94. // to unconditionally include in API requests. By default, fields with
  95. // empty values are omitted from API requests. However, any non-pointer,
  96. // non-interface field appearing in ForceSendFields will be sent to the
  97. // server regardless of whether the field is empty or not. This may be
  98. // used to include empty fields in Patch requests.
  99. ForceSendFields []string `json:"-"`
  100. // NullFields is a list of field names (e.g. "AnnotationProgress") to
  101. // include in API requests with the JSON null value. By default, fields
  102. // with empty values are omitted from API requests. However, any field
  103. // with an empty value appearing in NullFields will be sent to the
  104. // server as null. It is an error if a field in this list has a
  105. // non-empty value. This may be used to include null fields in Patch
  106. // requests.
  107. NullFields []string `json:"-"`
  108. }
  109. func (s *GoogleCloudVideointelligenceV1AnnotateVideoProgress) MarshalJSON() ([]byte, error) {
  110. type NoMethod GoogleCloudVideointelligenceV1AnnotateVideoProgress
  111. raw := NoMethod(*s)
  112. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  113. }
  114. // GoogleCloudVideointelligenceV1AnnotateVideoRequest: Video annotation
  115. // request.
  116. type GoogleCloudVideointelligenceV1AnnotateVideoRequest struct {
  117. // Features: Requested video annotation features.
  118. //
  119. // Possible values:
  120. // "FEATURE_UNSPECIFIED" - Unspecified.
  121. // "LABEL_DETECTION" - Label detection. Detect objects, such as dog or
  122. // flower.
  123. // "SHOT_CHANGE_DETECTION" - Shot change detection.
  124. // "EXPLICIT_CONTENT_DETECTION" - Explicit content detection.
  125. Features []string `json:"features,omitempty"`
  126. // InputContent: The video data bytes.
  127. // If unset, the input video(s) should be specified via `input_uri`.
  128. // If set, `input_uri` should be unset.
  129. InputContent string `json:"inputContent,omitempty"`
  130. // InputUri: Input video location. Currently, only
  131. // [Google Cloud Storage](https://cloud.google.com/storage/) URIs
  132. // are
  133. // supported, which must be specified in the following
  134. // format:
  135. // `gs://bucket-id/object-id` (other URI formats
  136. // return
  137. // google.rpc.Code.INVALID_ARGUMENT). For more information, see
  138. // [Request URIs](/storage/docs/reference-uris).
  139. // A video URI may include wildcards in `object-id`, and thus
  140. // identify
  141. // multiple videos. Supported wildcards: '*' to match 0 or more
  142. // characters;
  143. // '?' to match 1 character. If unset, the input video should be
  144. // embedded
  145. // in the request as `input_content`. If set, `input_content` should be
  146. // unset.
  147. InputUri string `json:"inputUri,omitempty"`
  148. // LocationId: Optional cloud region where annotation should take place.
  149. // Supported cloud
  150. // regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no
  151. // region
  152. // is specified, a region will be determined based on video file
  153. // location.
  154. LocationId string `json:"locationId,omitempty"`
  155. // OutputUri: Optional location where the output (in JSON format) should
  156. // be stored.
  157. // Currently, only [Google Cloud
  158. // Storage](https://cloud.google.com/storage/)
  159. // URIs are supported, which must be specified in the following
  160. // format:
  161. // `gs://bucket-id/object-id` (other URI formats
  162. // return
  163. // google.rpc.Code.INVALID_ARGUMENT). For more information, see
  164. // [Request URIs](/storage/docs/reference-uris).
  165. OutputUri string `json:"outputUri,omitempty"`
  166. // VideoContext: Additional video context and/or feature-specific
  167. // parameters.
  168. VideoContext *GoogleCloudVideointelligenceV1VideoContext `json:"videoContext,omitempty"`
  169. // ForceSendFields is a list of field names (e.g. "Features") to
  170. // unconditionally include in API requests. By default, fields with
  171. // empty values are omitted from API requests. However, any non-pointer,
  172. // non-interface field appearing in ForceSendFields will be sent to the
  173. // server regardless of whether the field is empty or not. This may be
  174. // used to include empty fields in Patch requests.
  175. ForceSendFields []string `json:"-"`
  176. // NullFields is a list of field names (e.g. "Features") to include in
  177. // API requests with the JSON null value. By default, fields with empty
  178. // values are omitted from API requests. However, any field with an
  179. // empty value appearing in NullFields will be sent to the server as
  180. // null. It is an error if a field in this list has a non-empty value.
  181. // This may be used to include null fields in Patch requests.
  182. NullFields []string `json:"-"`
  183. }
  184. func (s *GoogleCloudVideointelligenceV1AnnotateVideoRequest) MarshalJSON() ([]byte, error) {
  185. type NoMethod GoogleCloudVideointelligenceV1AnnotateVideoRequest
  186. raw := NoMethod(*s)
  187. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  188. }
  189. // GoogleCloudVideointelligenceV1AnnotateVideoResponse: Video annotation
  190. // response. Included in the `response`
  191. // field of the `Operation` returned by the `GetOperation`
  192. // call of the `google::longrunning::Operations` service.
  193. type GoogleCloudVideointelligenceV1AnnotateVideoResponse struct {
  194. // AnnotationResults: Annotation results for all videos specified in
  195. // `AnnotateVideoRequest`.
  196. AnnotationResults []*GoogleCloudVideointelligenceV1VideoAnnotationResults `json:"annotationResults,omitempty"`
  197. // ForceSendFields is a list of field names (e.g. "AnnotationResults")
  198. // to unconditionally include in API requests. By default, fields with
  199. // empty values are omitted from API requests. However, any non-pointer,
  200. // non-interface field appearing in ForceSendFields will be sent to the
  201. // server regardless of whether the field is empty or not. This may be
  202. // used to include empty fields in Patch requests.
  203. ForceSendFields []string `json:"-"`
  204. // NullFields is a list of field names (e.g. "AnnotationResults") to
  205. // include in API requests with the JSON null value. By default, fields
  206. // with empty values are omitted from API requests. However, any field
  207. // with an empty value appearing in NullFields will be sent to the
  208. // server as null. It is an error if a field in this list has a
  209. // non-empty value. This may be used to include null fields in Patch
  210. // requests.
  211. NullFields []string `json:"-"`
  212. }
  213. func (s *GoogleCloudVideointelligenceV1AnnotateVideoResponse) MarshalJSON() ([]byte, error) {
  214. type NoMethod GoogleCloudVideointelligenceV1AnnotateVideoResponse
  215. raw := NoMethod(*s)
  216. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  217. }
  218. // GoogleCloudVideointelligenceV1Entity: Detected entity from video
  219. // analysis.
  220. type GoogleCloudVideointelligenceV1Entity struct {
  221. // Description: Textual description, e.g. `Fixed-gear bicycle`.
  222. Description string `json:"description,omitempty"`
  223. // EntityId: Opaque entity ID. Some IDs may be available in
  224. // [Google Knowledge Graph
  225. // Search
  226. // API](https://developers.google.com/knowledge-graph/).
  227. EntityId string `json:"entityId,omitempty"`
  228. // LanguageCode: Language code for `description` in BCP-47 format.
  229. LanguageCode string `json:"languageCode,omitempty"`
  230. // ForceSendFields is a list of field names (e.g. "Description") to
  231. // unconditionally include in API requests. By default, fields with
  232. // empty values are omitted from API requests. However, any non-pointer,
  233. // non-interface field appearing in ForceSendFields will be sent to the
  234. // server regardless of whether the field is empty or not. This may be
  235. // used to include empty fields in Patch requests.
  236. ForceSendFields []string `json:"-"`
  237. // NullFields is a list of field names (e.g. "Description") to include
  238. // in API requests with the JSON null value. By default, fields with
  239. // empty values are omitted from API requests. However, any field with
  240. // an empty value appearing in NullFields will be sent to the server as
  241. // null. It is an error if a field in this list has a non-empty value.
  242. // This may be used to include null fields in Patch requests.
  243. NullFields []string `json:"-"`
  244. }
  245. func (s *GoogleCloudVideointelligenceV1Entity) MarshalJSON() ([]byte, error) {
  246. type NoMethod GoogleCloudVideointelligenceV1Entity
  247. raw := NoMethod(*s)
  248. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  249. }
  250. // GoogleCloudVideointelligenceV1ExplicitContentAnnotation: Explicit
  251. // content annotation (based on per-frame visual signals only).
  252. // If no explicit content has been detected in a frame, no annotations
  253. // are
  254. // present for that frame.
  255. type GoogleCloudVideointelligenceV1ExplicitContentAnnotation struct {
  256. // Frames: All video frames where explicit content was detected.
  257. Frames []*GoogleCloudVideointelligenceV1ExplicitContentFrame `json:"frames,omitempty"`
  258. // ForceSendFields is a list of field names (e.g. "Frames") to
  259. // unconditionally include in API requests. By default, fields with
  260. // empty values are omitted from API requests. However, any non-pointer,
  261. // non-interface field appearing in ForceSendFields will be sent to the
  262. // server regardless of whether the field is empty or not. This may be
  263. // used to include empty fields in Patch requests.
  264. ForceSendFields []string `json:"-"`
  265. // NullFields is a list of field names (e.g. "Frames") to include in API
  266. // requests with the JSON null value. By default, fields with empty
  267. // values are omitted from API requests. However, any field with an
  268. // empty value appearing in NullFields will be sent to the server as
  269. // null. It is an error if a field in this list has a non-empty value.
  270. // This may be used to include null fields in Patch requests.
  271. NullFields []string `json:"-"`
  272. }
  273. func (s *GoogleCloudVideointelligenceV1ExplicitContentAnnotation) MarshalJSON() ([]byte, error) {
  274. type NoMethod GoogleCloudVideointelligenceV1ExplicitContentAnnotation
  275. raw := NoMethod(*s)
  276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  277. }
  278. // GoogleCloudVideointelligenceV1ExplicitContentDetectionConfig: Config
  279. // for EXPLICIT_CONTENT_DETECTION.
  280. type GoogleCloudVideointelligenceV1ExplicitContentDetectionConfig struct {
  281. // Model: Model to use for explicit content detection.
  282. // Supported values: "builtin/stable" (the default if unset)
  283. // and
  284. // "builtin/latest".
  285. Model string `json:"model,omitempty"`
  286. // ForceSendFields is a list of field names (e.g. "Model") to
  287. // unconditionally include in API requests. By default, fields with
  288. // empty values are omitted from API requests. However, any non-pointer,
  289. // non-interface field appearing in ForceSendFields will be sent to the
  290. // server regardless of whether the field is empty or not. This may be
  291. // used to include empty fields in Patch requests.
  292. ForceSendFields []string `json:"-"`
  293. // NullFields is a list of field names (e.g. "Model") to include in API
  294. // requests with the JSON null value. By default, fields with empty
  295. // values are omitted from API requests. However, any field with an
  296. // empty value appearing in NullFields will be sent to the server as
  297. // null. It is an error if a field in this list has a non-empty value.
  298. // This may be used to include null fields in Patch requests.
  299. NullFields []string `json:"-"`
  300. }
  301. func (s *GoogleCloudVideointelligenceV1ExplicitContentDetectionConfig) MarshalJSON() ([]byte, error) {
  302. type NoMethod GoogleCloudVideointelligenceV1ExplicitContentDetectionConfig
  303. raw := NoMethod(*s)
  304. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  305. }
  306. // GoogleCloudVideointelligenceV1ExplicitContentFrame: Video frame level
  307. // annotation results for explicit content.
  308. type GoogleCloudVideointelligenceV1ExplicitContentFrame struct {
  309. // PornographyLikelihood: Likelihood of the pornography content..
  310. //
  311. // Possible values:
  312. // "LIKELIHOOD_UNSPECIFIED" - Unspecified likelihood.
  313. // "VERY_UNLIKELY" - Very unlikely.
  314. // "UNLIKELY" - Unlikely.
  315. // "POSSIBLE" - Possible.
  316. // "LIKELY" - Likely.
  317. // "VERY_LIKELY" - Very likely.
  318. PornographyLikelihood string `json:"pornographyLikelihood,omitempty"`
  319. // TimeOffset: Time-offset, relative to the beginning of the video,
  320. // corresponding to the
  321. // video frame for this location.
  322. TimeOffset string `json:"timeOffset,omitempty"`
  323. // ForceSendFields is a list of field names (e.g.
  324. // "PornographyLikelihood") to unconditionally include in API requests.
  325. // By default, fields with empty values are omitted from API requests.
  326. // However, any non-pointer, non-interface field appearing in
  327. // ForceSendFields will be sent to the server regardless of whether the
  328. // field is empty or not. This may be used to include empty fields in
  329. // Patch requests.
  330. ForceSendFields []string `json:"-"`
  331. // NullFields is a list of field names (e.g. "PornographyLikelihood") to
  332. // include in API requests with the JSON null value. By default, fields
  333. // with empty values are omitted from API requests. However, any field
  334. // with an empty value appearing in NullFields will be sent to the
  335. // server as null. It is an error if a field in this list has a
  336. // non-empty value. This may be used to include null fields in Patch
  337. // requests.
  338. NullFields []string `json:"-"`
  339. }
  340. func (s *GoogleCloudVideointelligenceV1ExplicitContentFrame) MarshalJSON() ([]byte, error) {
  341. type NoMethod GoogleCloudVideointelligenceV1ExplicitContentFrame
  342. raw := NoMethod(*s)
  343. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  344. }
  345. // GoogleCloudVideointelligenceV1LabelAnnotation: Label annotation.
  346. type GoogleCloudVideointelligenceV1LabelAnnotation struct {
  347. // CategoryEntities: Common categories for the detected entity.
  348. // E.g. when the label is `Terrier` the category is likely `dog`. And in
  349. // some
  350. // cases there might be more than one categories e.g. `Terrier` could
  351. // also be
  352. // a `pet`.
  353. CategoryEntities []*GoogleCloudVideointelligenceV1Entity `json:"categoryEntities,omitempty"`
  354. // Entity: Detected entity.
  355. Entity *GoogleCloudVideointelligenceV1Entity `json:"entity,omitempty"`
  356. // Frames: All video frames where a label was detected.
  357. Frames []*GoogleCloudVideointelligenceV1LabelFrame `json:"frames,omitempty"`
  358. // Segments: All video segments where a label was detected.
  359. Segments []*GoogleCloudVideointelligenceV1LabelSegment `json:"segments,omitempty"`
  360. // ForceSendFields is a list of field names (e.g. "CategoryEntities") to
  361. // unconditionally include in API requests. By default, fields with
  362. // empty values are omitted from API requests. However, any non-pointer,
  363. // non-interface field appearing in ForceSendFields will be sent to the
  364. // server regardless of whether the field is empty or not. This may be
  365. // used to include empty fields in Patch requests.
  366. ForceSendFields []string `json:"-"`
  367. // NullFields is a list of field names (e.g. "CategoryEntities") to
  368. // include in API requests with the JSON null value. By default, fields
  369. // with empty values are omitted from API requests. However, any field
  370. // with an empty value appearing in NullFields will be sent to the
  371. // server as null. It is an error if a field in this list has a
  372. // non-empty value. This may be used to include null fields in Patch
  373. // requests.
  374. NullFields []string `json:"-"`
  375. }
  376. func (s *GoogleCloudVideointelligenceV1LabelAnnotation) MarshalJSON() ([]byte, error) {
  377. type NoMethod GoogleCloudVideointelligenceV1LabelAnnotation
  378. raw := NoMethod(*s)
  379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  380. }
  381. // GoogleCloudVideointelligenceV1LabelDetectionConfig: Config for
  382. // LABEL_DETECTION.
  383. type GoogleCloudVideointelligenceV1LabelDetectionConfig struct {
  384. // LabelDetectionMode: What labels should be detected with
  385. // LABEL_DETECTION, in addition to
  386. // video-level labels or segment-level labels.
  387. // If unspecified, defaults to `SHOT_MODE`.
  388. //
  389. // Possible values:
  390. // "LABEL_DETECTION_MODE_UNSPECIFIED" - Unspecified.
  391. // "SHOT_MODE" - Detect shot-level labels.
  392. // "FRAME_MODE" - Detect frame-level labels.
  393. // "SHOT_AND_FRAME_MODE" - Detect both shot-level and frame-level
  394. // labels.
  395. LabelDetectionMode string `json:"labelDetectionMode,omitempty"`
  396. // Model: Model to use for label detection.
  397. // Supported values: "builtin/stable" (the default if unset)
  398. // and
  399. // "builtin/latest".
  400. Model string `json:"model,omitempty"`
  401. // StationaryCamera: Whether the video has been shot from a stationary
  402. // (i.e. non-moving) camera.
  403. // When set to true, might improve detection accuracy for moving
  404. // objects.
  405. // Should be used with `SHOT_AND_FRAME_MODE` enabled.
  406. StationaryCamera bool `json:"stationaryCamera,omitempty"`
  407. // ForceSendFields is a list of field names (e.g. "LabelDetectionMode")
  408. // to unconditionally include in API requests. By default, fields with
  409. // empty values are omitted from API requests. However, any non-pointer,
  410. // non-interface field appearing in ForceSendFields will be sent to the
  411. // server regardless of whether the field is empty or not. This may be
  412. // used to include empty fields in Patch requests.
  413. ForceSendFields []string `json:"-"`
  414. // NullFields is a list of field names (e.g. "LabelDetectionMode") to
  415. // include in API requests with the JSON null value. By default, fields
  416. // with empty values are omitted from API requests. However, any field
  417. // with an empty value appearing in NullFields will be sent to the
  418. // server as null. It is an error if a field in this list has a
  419. // non-empty value. This may be used to include null fields in Patch
  420. // requests.
  421. NullFields []string `json:"-"`
  422. }
  423. func (s *GoogleCloudVideointelligenceV1LabelDetectionConfig) MarshalJSON() ([]byte, error) {
  424. type NoMethod GoogleCloudVideointelligenceV1LabelDetectionConfig
  425. raw := NoMethod(*s)
  426. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  427. }
  428. // GoogleCloudVideointelligenceV1LabelFrame: Video frame level
  429. // annotation results for label detection.
  430. type GoogleCloudVideointelligenceV1LabelFrame struct {
  431. // Confidence: Confidence that the label is accurate. Range: [0, 1].
  432. Confidence float64 `json:"confidence,omitempty"`
  433. // TimeOffset: Time-offset, relative to the beginning of the video,
  434. // corresponding to the
  435. // video frame for this location.
  436. TimeOffset string `json:"timeOffset,omitempty"`
  437. // ForceSendFields is a list of field names (e.g. "Confidence") to
  438. // unconditionally include in API requests. By default, fields with
  439. // empty values are omitted from API requests. However, any non-pointer,
  440. // non-interface field appearing in ForceSendFields will be sent to the
  441. // server regardless of whether the field is empty or not. This may be
  442. // used to include empty fields in Patch requests.
  443. ForceSendFields []string `json:"-"`
  444. // NullFields is a list of field names (e.g. "Confidence") to include in
  445. // API requests with the JSON null value. By default, fields with empty
  446. // values are omitted from API requests. However, any field with an
  447. // empty value appearing in NullFields will be sent to the server as
  448. // null. It is an error if a field in this list has a non-empty value.
  449. // This may be used to include null fields in Patch requests.
  450. NullFields []string `json:"-"`
  451. }
  452. func (s *GoogleCloudVideointelligenceV1LabelFrame) MarshalJSON() ([]byte, error) {
  453. type NoMethod GoogleCloudVideointelligenceV1LabelFrame
  454. raw := NoMethod(*s)
  455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  456. }
  457. func (s *GoogleCloudVideointelligenceV1LabelFrame) UnmarshalJSON(data []byte) error {
  458. type NoMethod GoogleCloudVideointelligenceV1LabelFrame
  459. var s1 struct {
  460. Confidence gensupport.JSONFloat64 `json:"confidence"`
  461. *NoMethod
  462. }
  463. s1.NoMethod = (*NoMethod)(s)
  464. if err := json.Unmarshal(data, &s1); err != nil {
  465. return err
  466. }
  467. s.Confidence = float64(s1.Confidence)
  468. return nil
  469. }
  470. // GoogleCloudVideointelligenceV1LabelSegment: Video segment level
  471. // annotation results for label detection.
  472. type GoogleCloudVideointelligenceV1LabelSegment struct {
  473. // Confidence: Confidence that the label is accurate. Range: [0, 1].
  474. Confidence float64 `json:"confidence,omitempty"`
  475. // Segment: Video segment where a label was detected.
  476. Segment *GoogleCloudVideointelligenceV1VideoSegment `json:"segment,omitempty"`
  477. // ForceSendFields is a list of field names (e.g. "Confidence") to
  478. // unconditionally include in API requests. By default, fields with
  479. // empty values are omitted from API requests. However, any non-pointer,
  480. // non-interface field appearing in ForceSendFields will be sent to the
  481. // server regardless of whether the field is empty or not. This may be
  482. // used to include empty fields in Patch requests.
  483. ForceSendFields []string `json:"-"`
  484. // NullFields is a list of field names (e.g. "Confidence") to include in
  485. // API requests with the JSON null value. By default, fields with empty
  486. // values are omitted from API requests. However, any field with an
  487. // empty value appearing in NullFields will be sent to the server as
  488. // null. It is an error if a field in this list has a non-empty value.
  489. // This may be used to include null fields in Patch requests.
  490. NullFields []string `json:"-"`
  491. }
  492. func (s *GoogleCloudVideointelligenceV1LabelSegment) MarshalJSON() ([]byte, error) {
  493. type NoMethod GoogleCloudVideointelligenceV1LabelSegment
  494. raw := NoMethod(*s)
  495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  496. }
  497. func (s *GoogleCloudVideointelligenceV1LabelSegment) UnmarshalJSON(data []byte) error {
  498. type NoMethod GoogleCloudVideointelligenceV1LabelSegment
  499. var s1 struct {
  500. Confidence gensupport.JSONFloat64 `json:"confidence"`
  501. *NoMethod
  502. }
  503. s1.NoMethod = (*NoMethod)(s)
  504. if err := json.Unmarshal(data, &s1); err != nil {
  505. return err
  506. }
  507. s.Confidence = float64(s1.Confidence)
  508. return nil
  509. }
  510. // GoogleCloudVideointelligenceV1ShotChangeDetectionConfig: Config for
  511. // SHOT_CHANGE_DETECTION.
  512. type GoogleCloudVideointelligenceV1ShotChangeDetectionConfig struct {
  513. // Model: Model to use for shot change detection.
  514. // Supported values: "builtin/stable" (the default if unset)
  515. // and
  516. // "builtin/latest".
  517. Model string `json:"model,omitempty"`
  518. // ForceSendFields is a list of field names (e.g. "Model") to
  519. // unconditionally include in API requests. By default, fields with
  520. // empty values are omitted from API requests. However, any non-pointer,
  521. // non-interface field appearing in ForceSendFields will be sent to the
  522. // server regardless of whether the field is empty or not. This may be
  523. // used to include empty fields in Patch requests.
  524. ForceSendFields []string `json:"-"`
  525. // NullFields is a list of field names (e.g. "Model") to include in API
  526. // requests with the JSON null value. By default, fields with empty
  527. // values are omitted from API requests. However, any field with an
  528. // empty value appearing in NullFields will be sent to the server as
  529. // null. It is an error if a field in this list has a non-empty value.
  530. // This may be used to include null fields in Patch requests.
  531. NullFields []string `json:"-"`
  532. }
  533. func (s *GoogleCloudVideointelligenceV1ShotChangeDetectionConfig) MarshalJSON() ([]byte, error) {
  534. type NoMethod GoogleCloudVideointelligenceV1ShotChangeDetectionConfig
  535. raw := NoMethod(*s)
  536. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  537. }
  538. // GoogleCloudVideointelligenceV1VideoAnnotationProgress: Annotation
  539. // progress for a single video.
  540. type GoogleCloudVideointelligenceV1VideoAnnotationProgress struct {
  541. // InputUri: Output only. Video file location in
  542. // [Google Cloud Storage](https://cloud.google.com/storage/).
  543. InputUri string `json:"inputUri,omitempty"`
  544. // ProgressPercent: Output only. Approximate percentage processed thus
  545. // far. Guaranteed to be
  546. // 100 when fully processed.
  547. ProgressPercent int64 `json:"progressPercent,omitempty"`
  548. // StartTime: Output only. Time when the request was received.
  549. StartTime string `json:"startTime,omitempty"`
  550. // UpdateTime: Output only. Time of the most recent update.
  551. UpdateTime string `json:"updateTime,omitempty"`
  552. // ForceSendFields is a list of field names (e.g. "InputUri") to
  553. // unconditionally include in API requests. By default, fields with
  554. // empty values are omitted from API requests. However, any non-pointer,
  555. // non-interface field appearing in ForceSendFields will be sent to the
  556. // server regardless of whether the field is empty or not. This may be
  557. // used to include empty fields in Patch requests.
  558. ForceSendFields []string `json:"-"`
  559. // NullFields is a list of field names (e.g. "InputUri") to include in
  560. // API requests with the JSON null value. By default, fields with empty
  561. // values are omitted from API requests. However, any field with an
  562. // empty value appearing in NullFields will be sent to the server as
  563. // null. It is an error if a field in this list has a non-empty value.
  564. // This may be used to include null fields in Patch requests.
  565. NullFields []string `json:"-"`
  566. }
  567. func (s *GoogleCloudVideointelligenceV1VideoAnnotationProgress) MarshalJSON() ([]byte, error) {
  568. type NoMethod GoogleCloudVideointelligenceV1VideoAnnotationProgress
  569. raw := NoMethod(*s)
  570. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  571. }
  572. // GoogleCloudVideointelligenceV1VideoAnnotationResults: Annotation
  573. // results for a single video.
  574. type GoogleCloudVideointelligenceV1VideoAnnotationResults struct {
  575. // Error: Output only. Non-streaming error only. If set, indicates an
  576. // error. Note
  577. // that for a single `AnnotateVideoRequest` some videos may succeed and
  578. // some
  579. // may fail.
  580. Error *GoogleRpcStatus `json:"error,omitempty"`
  581. // ExplicitAnnotation: Explicit content annotation.
  582. ExplicitAnnotation *GoogleCloudVideointelligenceV1ExplicitContentAnnotation `json:"explicitAnnotation,omitempty"`
  583. // FrameLabelAnnotations: Label annotations on frame level.
  584. // There is exactly one element for each unique label.
  585. FrameLabelAnnotations []*GoogleCloudVideointelligenceV1LabelAnnotation `json:"frameLabelAnnotations,omitempty"`
  586. // InputUri: Output only. Video file location in
  587. // [Google Cloud Storage](https://cloud.google.com/storage/).
  588. InputUri string `json:"inputUri,omitempty"`
  589. // SegmentLabelAnnotations: Label annotations on video level or user
  590. // specified segment level.
  591. // There is exactly one element for each unique label.
  592. SegmentLabelAnnotations []*GoogleCloudVideointelligenceV1LabelAnnotation `json:"segmentLabelAnnotations,omitempty"`
  593. // ShotAnnotations: Shot annotations. Each shot is represented as a
  594. // video segment.
  595. ShotAnnotations []*GoogleCloudVideointelligenceV1VideoSegment `json:"shotAnnotations,omitempty"`
  596. // ShotLabelAnnotations: Label annotations on shot level.
  597. // There is exactly one element for each unique label.
  598. ShotLabelAnnotations []*GoogleCloudVideointelligenceV1LabelAnnotation `json:"shotLabelAnnotations,omitempty"`
  599. // ForceSendFields is a list of field names (e.g. "Error") to
  600. // unconditionally include in API requests. By default, fields with
  601. // empty values are omitted from API requests. However, any non-pointer,
  602. // non-interface field appearing in ForceSendFields will be sent to the
  603. // server regardless of whether the field is empty or not. This may be
  604. // used to include empty fields in Patch requests.
  605. ForceSendFields []string `json:"-"`
  606. // NullFields is a list of field names (e.g. "Error") to include in API
  607. // requests with the JSON null value. By default, fields with empty
  608. // values are omitted from API requests. However, any field with an
  609. // empty value appearing in NullFields will be sent to the server as
  610. // null. It is an error if a field in this list has a non-empty value.
  611. // This may be used to include null fields in Patch requests.
  612. NullFields []string `json:"-"`
  613. }
  614. func (s *GoogleCloudVideointelligenceV1VideoAnnotationResults) MarshalJSON() ([]byte, error) {
  615. type NoMethod GoogleCloudVideointelligenceV1VideoAnnotationResults
  616. raw := NoMethod(*s)
  617. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  618. }
  619. // GoogleCloudVideointelligenceV1VideoContext: Video context and/or
  620. // feature-specific parameters.
  621. type GoogleCloudVideointelligenceV1VideoContext struct {
  622. // ExplicitContentDetectionConfig: Config for
  623. // EXPLICIT_CONTENT_DETECTION.
  624. ExplicitContentDetectionConfig *GoogleCloudVideointelligenceV1ExplicitContentDetectionConfig `json:"explicitContentDetectionConfig,omitempty"`
  625. // LabelDetectionConfig: Config for LABEL_DETECTION.
  626. LabelDetectionConfig *GoogleCloudVideointelligenceV1LabelDetectionConfig `json:"labelDetectionConfig,omitempty"`
  627. // Segments: Non-streaming request only. Video segments to annotate. The
  628. // segments may
  629. // overlap and are not required to be contiguous or span the whole
  630. // video. If
  631. // unspecified, each video is treated as a single segment.
  632. Segments []*GoogleCloudVideointelligenceV1VideoSegment `json:"segments,omitempty"`
  633. // ShotChangeDetectionConfig: Config for SHOT_CHANGE_DETECTION.
  634. ShotChangeDetectionConfig *GoogleCloudVideointelligenceV1ShotChangeDetectionConfig `json:"shotChangeDetectionConfig,omitempty"`
  635. // ForceSendFields is a list of field names (e.g.
  636. // "ExplicitContentDetectionConfig") to unconditionally include in API
  637. // requests. By default, fields with empty values are omitted from API
  638. // requests. However, any non-pointer, non-interface field appearing in
  639. // ForceSendFields will be sent to the server regardless of whether the
  640. // field is empty or not. This may be used to include empty fields in
  641. // Patch requests.
  642. ForceSendFields []string `json:"-"`
  643. // NullFields is a list of field names (e.g.
  644. // "ExplicitContentDetectionConfig") to include in API requests with the
  645. // JSON null value. By default, fields with empty values are omitted
  646. // from API requests. However, any field with an empty value appearing
  647. // in NullFields will be sent to the server as null. It is an error if a
  648. // field in this list has a non-empty value. This may be used to include
  649. // null fields in Patch requests.
  650. NullFields []string `json:"-"`
  651. }
  652. func (s *GoogleCloudVideointelligenceV1VideoContext) MarshalJSON() ([]byte, error) {
  653. type NoMethod GoogleCloudVideointelligenceV1VideoContext
  654. raw := NoMethod(*s)
  655. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  656. }
  657. // GoogleCloudVideointelligenceV1VideoSegment: Video segment.
  658. type GoogleCloudVideointelligenceV1VideoSegment struct {
  659. // EndTimeOffset: Time-offset, relative to the beginning of the
  660. // video,
  661. // corresponding to the end of the segment (inclusive).
  662. EndTimeOffset string `json:"endTimeOffset,omitempty"`
  663. // StartTimeOffset: Time-offset, relative to the beginning of the
  664. // video,
  665. // corresponding to the start of the segment (inclusive).
  666. StartTimeOffset string `json:"startTimeOffset,omitempty"`
  667. // ForceSendFields is a list of field names (e.g. "EndTimeOffset") to
  668. // unconditionally include in API requests. By default, fields with
  669. // empty values are omitted from API requests. However, any non-pointer,
  670. // non-interface field appearing in ForceSendFields will be sent to the
  671. // server regardless of whether the field is empty or not. This may be
  672. // used to include empty fields in Patch requests.
  673. ForceSendFields []string `json:"-"`
  674. // NullFields is a list of field names (e.g. "EndTimeOffset") to include
  675. // in API requests with the JSON null value. By default, fields with
  676. // empty values are omitted from API requests. However, any field with
  677. // an empty value appearing in NullFields will be sent to the server as
  678. // null. It is an error if a field in this list has a non-empty value.
  679. // This may be used to include null fields in Patch requests.
  680. NullFields []string `json:"-"`
  681. }
  682. func (s *GoogleCloudVideointelligenceV1VideoSegment) MarshalJSON() ([]byte, error) {
  683. type NoMethod GoogleCloudVideointelligenceV1VideoSegment
  684. raw := NoMethod(*s)
  685. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  686. }
  687. // GoogleCloudVideointelligenceV1beta2AnnotateVideoProgress: Video
  688. // annotation progress. Included in the `metadata`
  689. // field of the `Operation` returned by the `GetOperation`
  690. // call of the `google::longrunning::Operations` service.
  691. type GoogleCloudVideointelligenceV1beta2AnnotateVideoProgress struct {
  692. // AnnotationProgress: Progress metadata for all videos specified in
  693. // `AnnotateVideoRequest`.
  694. AnnotationProgress []*GoogleCloudVideointelligenceV1beta2VideoAnnotationProgress `json:"annotationProgress,omitempty"`
  695. // ForceSendFields is a list of field names (e.g. "AnnotationProgress")
  696. // to unconditionally include in API requests. By default, fields with
  697. // empty values are omitted from API requests. However, any non-pointer,
  698. // non-interface field appearing in ForceSendFields will be sent to the
  699. // server regardless of whether the field is empty or not. This may be
  700. // used to include empty fields in Patch requests.
  701. ForceSendFields []string `json:"-"`
  702. // NullFields is a list of field names (e.g. "AnnotationProgress") to
  703. // include in API requests with the JSON null value. By default, fields
  704. // with empty values are omitted from API requests. However, any field
  705. // with an empty value appearing in NullFields will be sent to the
  706. // server as null. It is an error if a field in this list has a
  707. // non-empty value. This may be used to include null fields in Patch
  708. // requests.
  709. NullFields []string `json:"-"`
  710. }
  711. func (s *GoogleCloudVideointelligenceV1beta2AnnotateVideoProgress) MarshalJSON() ([]byte, error) {
  712. type NoMethod GoogleCloudVideointelligenceV1beta2AnnotateVideoProgress
  713. raw := NoMethod(*s)
  714. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  715. }
  716. // GoogleCloudVideointelligenceV1beta2AnnotateVideoResponse: Video
  717. // annotation response. Included in the `response`
  718. // field of the `Operation` returned by the `GetOperation`
  719. // call of the `google::longrunning::Operations` service.
  720. type GoogleCloudVideointelligenceV1beta2AnnotateVideoResponse struct {
  721. // AnnotationResults: Annotation results for all videos specified in
  722. // `AnnotateVideoRequest`.
  723. AnnotationResults []*GoogleCloudVideointelligenceV1beta2VideoAnnotationResults `json:"annotationResults,omitempty"`
  724. // ForceSendFields is a list of field names (e.g. "AnnotationResults")
  725. // to unconditionally include in API requests. By default, fields with
  726. // empty values are omitted from API requests. However, any non-pointer,
  727. // non-interface field appearing in ForceSendFields will be sent to the
  728. // server regardless of whether the field is empty or not. This may be
  729. // used to include empty fields in Patch requests.
  730. ForceSendFields []string `json:"-"`
  731. // NullFields is a list of field names (e.g. "AnnotationResults") to
  732. // include in API requests with the JSON null value. By default, fields
  733. // with empty values are omitted from API requests. However, any field
  734. // with an empty value appearing in NullFields will be sent to the
  735. // server as null. It is an error if a field in this list has a
  736. // non-empty value. This may be used to include null fields in Patch
  737. // requests.
  738. NullFields []string `json:"-"`
  739. }
  740. func (s *GoogleCloudVideointelligenceV1beta2AnnotateVideoResponse) MarshalJSON() ([]byte, error) {
  741. type NoMethod GoogleCloudVideointelligenceV1beta2AnnotateVideoResponse
  742. raw := NoMethod(*s)
  743. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  744. }
  745. // GoogleCloudVideointelligenceV1beta2Entity: Detected entity from video
  746. // analysis.
  747. type GoogleCloudVideointelligenceV1beta2Entity struct {
  748. // Description: Textual description, e.g. `Fixed-gear bicycle`.
  749. Description string `json:"description,omitempty"`
  750. // EntityId: Opaque entity ID. Some IDs may be available in
  751. // [Google Knowledge Graph
  752. // Search
  753. // API](https://developers.google.com/knowledge-graph/).
  754. EntityId string `json:"entityId,omitempty"`
  755. // LanguageCode: Language code for `description` in BCP-47 format.
  756. LanguageCode string `json:"languageCode,omitempty"`
  757. // ForceSendFields is a list of field names (e.g. "Description") to
  758. // unconditionally include in API requests. By default, fields with
  759. // empty values are omitted from API requests. However, any non-pointer,
  760. // non-interface field appearing in ForceSendFields will be sent to the
  761. // server regardless of whether the field is empty or not. This may be
  762. // used to include empty fields in Patch requests.
  763. ForceSendFields []string `json:"-"`
  764. // NullFields is a list of field names (e.g. "Description") to include
  765. // in API requests with the JSON null value. By default, fields with
  766. // empty values are omitted from API requests. However, any field with
  767. // an empty value appearing in NullFields will be sent to the server as
  768. // null. It is an error if a field in this list has a non-empty value.
  769. // This may be used to include null fields in Patch requests.
  770. NullFields []string `json:"-"`
  771. }
  772. func (s *GoogleCloudVideointelligenceV1beta2Entity) MarshalJSON() ([]byte, error) {
  773. type NoMethod GoogleCloudVideointelligenceV1beta2Entity
  774. raw := NoMethod(*s)
  775. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  776. }
  777. // GoogleCloudVideointelligenceV1beta2ExplicitContentAnnotation:
  778. // Explicit content annotation (based on per-frame visual signals
  779. // only).
  780. // If no explicit content has been detected in a frame, no annotations
  781. // are
  782. // present for that frame.
  783. type GoogleCloudVideointelligenceV1beta2ExplicitContentAnnotation struct {
  784. // Frames: All video frames where explicit content was detected.
  785. Frames []*GoogleCloudVideointelligenceV1beta2ExplicitContentFrame `json:"frames,omitempty"`
  786. // ForceSendFields is a list of field names (e.g. "Frames") to
  787. // unconditionally include in API requests. By default, fields with
  788. // empty values are omitted from API requests. However, any non-pointer,
  789. // non-interface field appearing in ForceSendFields will be sent to the
  790. // server regardless of whether the field is empty or not. This may be
  791. // used to include empty fields in Patch requests.
  792. ForceSendFields []string `json:"-"`
  793. // NullFields is a list of field names (e.g. "Frames") to include in API
  794. // requests with the JSON null value. By default, fields with empty
  795. // values are omitted from API requests. However, any field with an
  796. // empty value appearing in NullFields will be sent to the server as
  797. // null. It is an error if a field in this list has a non-empty value.
  798. // This may be used to include null fields in Patch requests.
  799. NullFields []string `json:"-"`
  800. }
  801. func (s *GoogleCloudVideointelligenceV1beta2ExplicitContentAnnotation) MarshalJSON() ([]byte, error) {
  802. type NoMethod GoogleCloudVideointelligenceV1beta2ExplicitContentAnnotation
  803. raw := NoMethod(*s)
  804. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  805. }
  806. // GoogleCloudVideointelligenceV1beta2ExplicitContentFrame: Video frame
  807. // level annotation results for explicit content.
  808. type GoogleCloudVideointelligenceV1beta2ExplicitContentFrame struct {
  809. // PornographyLikelihood: Likelihood of the pornography content..
  810. //
  811. // Possible values:
  812. // "LIKELIHOOD_UNSPECIFIED" - Unspecified likelihood.
  813. // "VERY_UNLIKELY" - Very unlikely.
  814. // "UNLIKELY" - Unlikely.
  815. // "POSSIBLE" - Possible.
  816. // "LIKELY" - Likely.
  817. // "VERY_LIKELY" - Very likely.
  818. PornographyLikelihood string `json:"pornographyLikelihood,omitempty"`
  819. // TimeOffset: Time-offset, relative to the beginning of the video,
  820. // corresponding to the
  821. // video frame for this location.
  822. TimeOffset string `json:"timeOffset,omitempty"`
  823. // ForceSendFields is a list of field names (e.g.
  824. // "PornographyLikelihood") to unconditionally include in API requests.
  825. // By default, fields with empty values are omitted from API requests.
  826. // However, any non-pointer, non-interface field appearing in
  827. // ForceSendFields will be sent to the server regardless of whether the
  828. // field is empty or not. This may be used to include empty fields in
  829. // Patch requests.
  830. ForceSendFields []string `json:"-"`
  831. // NullFields is a list of field names (e.g. "PornographyLikelihood") to
  832. // include in API requests with the JSON null value. By default, fields
  833. // with empty values are omitted from API requests. However, any field
  834. // with an empty value appearing in NullFields will be sent to the
  835. // server as null. It is an error if a field in this list has a
  836. // non-empty value. This may be used to include null fields in Patch
  837. // requests.
  838. NullFields []string `json:"-"`
  839. }
  840. func (s *GoogleCloudVideointelligenceV1beta2ExplicitContentFrame) MarshalJSON() ([]byte, error) {
  841. type NoMethod GoogleCloudVideointelligenceV1beta2ExplicitContentFrame
  842. raw := NoMethod(*s)
  843. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  844. }
  845. // GoogleCloudVideointelligenceV1beta2LabelAnnotation: Label annotation.
  846. type GoogleCloudVideointelligenceV1beta2LabelAnnotation struct {
  847. // CategoryEntities: Common categories for the detected entity.
  848. // E.g. when the label is `Terrier` the category is likely `dog`. And in
  849. // some
  850. // cases there might be more than one categories e.g. `Terrier` could
  851. // also be
  852. // a `pet`.
  853. CategoryEntities []*GoogleCloudVideointelligenceV1beta2Entity `json:"categoryEntities,omitempty"`
  854. // Entity: Detected entity.
  855. Entity *GoogleCloudVideointelligenceV1beta2Entity `json:"entity,omitempty"`
  856. // Frames: All video frames where a label was detected.
  857. Frames []*GoogleCloudVideointelligenceV1beta2LabelFrame `json:"frames,omitempty"`
  858. // Segments: All video segments where a label was detected.
  859. Segments []*GoogleCloudVideointelligenceV1beta2LabelSegment `json:"segments,omitempty"`
  860. // ForceSendFields is a list of field names (e.g. "CategoryEntities") to
  861. // unconditionally include in API requests. By default, fields with
  862. // empty values are omitted from API requests. However, any non-pointer,
  863. // non-interface field appearing in ForceSendFields will be sent to the
  864. // server regardless of whether the field is empty or not. This may be
  865. // used to include empty fields in Patch requests.
  866. ForceSendFields []string `json:"-"`
  867. // NullFields is a list of field names (e.g. "CategoryEntities") to
  868. // include in API requests with the JSON null value. By default, fields
  869. // with empty values are omitted from API requests. However, any field
  870. // with an empty value appearing in NullFields will be sent to the
  871. // server as null. It is an error if a field in this list has a
  872. // non-empty value. This may be used to include null fields in Patch
  873. // requests.
  874. NullFields []string `json:"-"`
  875. }
  876. func (s *GoogleCloudVideointelligenceV1beta2LabelAnnotation) MarshalJSON() ([]byte, error) {
  877. type NoMethod GoogleCloudVideointelligenceV1beta2LabelAnnotation
  878. raw := NoMethod(*s)
  879. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  880. }
  881. // GoogleCloudVideointelligenceV1beta2LabelFrame: Video frame level
  882. // annotation results for label detection.
  883. type GoogleCloudVideointelligenceV1beta2LabelFrame struct {
  884. // Confidence: Confidence that the label is accurate. Range: [0, 1].
  885. Confidence float64 `json:"confidence,omitempty"`
  886. // TimeOffset: Time-offset, relative to the beginning of the video,
  887. // corresponding to the
  888. // video frame for this location.
  889. TimeOffset string `json:"timeOffset,omitempty"`
  890. // ForceSendFields is a list of field names (e.g. "Confidence") to
  891. // unconditionally include in API requests. By default, fields with
  892. // empty values are omitted from API requests. However, any non-pointer,
  893. // non-interface field appearing in ForceSendFields will be sent to the
  894. // server regardless of whether the field is empty or not. This may be
  895. // used to include empty fields in Patch requests.
  896. ForceSendFields []string `json:"-"`
  897. // NullFields is a list of field names (e.g. "Confidence") to include in
  898. // API requests with the JSON null value. By default, fields with empty
  899. // values are omitted from API requests. However, any field with an
  900. // empty value appearing in NullFields will be sent to the server as
  901. // null. It is an error if a field in this list has a non-empty value.
  902. // This may be used to include null fields in Patch requests.
  903. NullFields []string `json:"-"`
  904. }
  905. func (s *GoogleCloudVideointelligenceV1beta2LabelFrame) MarshalJSON() ([]byte, error) {
  906. type NoMethod GoogleCloudVideointelligenceV1beta2LabelFrame
  907. raw := NoMethod(*s)
  908. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  909. }
  910. func (s *GoogleCloudVideointelligenceV1beta2LabelFrame) UnmarshalJSON(data []byte) error {
  911. type NoMethod GoogleCloudVideointelligenceV1beta2LabelFrame
  912. var s1 struct {
  913. Confidence gensupport.JSONFloat64 `json:"confidence"`
  914. *NoMethod
  915. }
  916. s1.NoMethod = (*NoMethod)(s)
  917. if err := json.Unmarshal(data, &s1); err != nil {
  918. return err
  919. }
  920. s.Confidence = float64(s1.Confidence)
  921. return nil
  922. }
  923. // GoogleCloudVideointelligenceV1beta2LabelSegment: Video segment level
  924. // annotation results for label detection.
  925. type GoogleCloudVideointelligenceV1beta2LabelSegment struct {
  926. // Confidence: Confidence that the label is accurate. Range: [0, 1].
  927. Confidence float64 `json:"confidence,omitempty"`
  928. // Segment: Video segment where a label was detected.
  929. Segment *GoogleCloudVideointelligenceV1beta2VideoSegment `json:"segment,omitempty"`
  930. // ForceSendFields is a list of field names (e.g. "Confidence") to
  931. // unconditionally include in API requests. By default, fields with
  932. // empty values are omitted from API requests. However, any non-pointer,
  933. // non-interface field appearing in ForceSendFields will be sent to the
  934. // server regardless of whether the field is empty or not. This may be
  935. // used to include empty fields in Patch requests.
  936. ForceSendFields []string `json:"-"`
  937. // NullFields is a list of field names (e.g. "Confidence") to include in
  938. // API requests with the JSON null value. By default, fields with empty
  939. // values are omitted from API requests. However, any field with an
  940. // empty value appearing in NullFields will be sent to the server as
  941. // null. It is an error if a field in this list has a non-empty value.
  942. // This may be used to include null fields in Patch requests.
  943. NullFields []string `json:"-"`
  944. }
  945. func (s *GoogleCloudVideointelligenceV1beta2LabelSegment) MarshalJSON() ([]byte, error) {
  946. type NoMethod GoogleCloudVideointelligenceV1beta2LabelSegment
  947. raw := NoMethod(*s)
  948. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  949. }
  950. func (s *GoogleCloudVideointelligenceV1beta2LabelSegment) UnmarshalJSON(data []byte) error {
  951. type NoMethod GoogleCloudVideointelligenceV1beta2LabelSegment
  952. var s1 struct {
  953. Confidence gensupport.JSONFloat64 `json:"confidence"`
  954. *NoMethod
  955. }
  956. s1.NoMethod = (*NoMethod)(s)
  957. if err := json.Unmarshal(data, &s1); err != nil {
  958. return err
  959. }
  960. s.Confidence = float64(s1.Confidence)
  961. return nil
  962. }
  963. // GoogleCloudVideointelligenceV1beta2VideoAnnotationProgress:
  964. // Annotation progress for a single video.
  965. type GoogleCloudVideointelligenceV1beta2VideoAnnotationProgress struct {
  966. // InputUri: Output only. Video file location in
  967. // [Google Cloud Storage](https://cloud.google.com/storage/).
  968. InputUri string `json:"inputUri,omitempty"`
  969. // ProgressPercent: Output only. Approximate percentage processed thus
  970. // far. Guaranteed to be
  971. // 100 when fully processed.
  972. ProgressPercent int64 `json:"progressPercent,omitempty"`
  973. // StartTime: Output only. Time when the request was received.
  974. StartTime string `json:"startTime,omitempty"`
  975. // UpdateTime: Output only. Time of the most recent update.
  976. UpdateTime string `json:"updateTime,omitempty"`
  977. // ForceSendFields is a list of field names (e.g. "InputUri") to
  978. // unconditionally include in API requests. By default, fields with
  979. // empty values are omitted from API requests. However, any non-pointer,
  980. // non-interface field appearing in ForceSendFields will be sent to the
  981. // server regardless of whether the field is empty or not. This may be
  982. // used to include empty fields in Patch requests.
  983. ForceSendFields []string `json:"-"`
  984. // NullFields is a list of field names (e.g. "InputUri") to include in
  985. // API requests with the JSON null value. By default, fields with empty
  986. // values are omitted from API requests. However, any field with an
  987. // empty value appearing in NullFields will be sent to the server as
  988. // null. It is an error if a field in this list has a non-empty value.
  989. // This may be used to include null fields in Patch requests.
  990. NullFields []string `json:"-"`
  991. }
  992. func (s *GoogleCloudVideointelligenceV1beta2VideoAnnotationProgress) MarshalJSON() ([]byte, error) {
  993. type NoMethod GoogleCloudVideointelligenceV1beta2VideoAnnotationProgress
  994. raw := NoMethod(*s)
  995. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  996. }
  997. // GoogleCloudVideointelligenceV1beta2VideoAnnotationResults: Annotation
  998. // results for a single video.
  999. type GoogleCloudVideointelligenceV1beta2VideoAnnotationResults struct {
  1000. // Error: Output only. Non-streaming error only. If set, indicates an
  1001. // error. Note
  1002. // that for a single `AnnotateVideoRequest` some videos may succeed and
  1003. // some
  1004. // may fail.
  1005. Error *GoogleRpcStatus `json:"error,omitempty"`
  1006. // ExplicitAnnotation: Explicit content annotation.
  1007. ExplicitAnnotation *GoogleCloudVideointelligenceV1beta2ExplicitContentAnnotation `json:"explicitAnnotation,omitempty"`
  1008. // FrameLabelAnnotations: Label annotations on frame level.
  1009. // There is exactly one element for each unique label.
  1010. FrameLabelAnnotations []*GoogleCloudVideointelligenceV1beta2LabelAnnotation `json:"frameLabelAnnotations,omitempty"`
  1011. // InputUri: Output only. Video file location in
  1012. // [Google Cloud Storage](https://cloud.google.com/storage/).
  1013. InputUri string `json:"inputUri,omitempty"`
  1014. // SegmentLabelAnnotations: Label annotations on video level or user
  1015. // specified segment level.
  1016. // There is exactly one element for each unique label.
  1017. SegmentLabelAnnotations []*GoogleCloudVideointelligenceV1beta2LabelAnnotation `json:"segmentLabelAnnotations,omitempty"`
  1018. // ShotAnnotations: Shot annotations. Each shot is represented as a
  1019. // video segment.
  1020. ShotAnnotations []*GoogleCloudVideointelligenceV1beta2VideoSegment `json:"shotAnnotations,omitempty"`
  1021. // ShotLabelAnnotations: Label annotations on shot level.
  1022. // There is exactly one element for each unique label.
  1023. ShotLabelAnnotations []*GoogleCloudVideointelligenceV1beta2LabelAnnotation `json:"shotLabelAnnotations,omitempty"`
  1024. // ForceSendFields is a list of field names (e.g. "Error") to
  1025. // unconditionally include in API requests. By default, fields with
  1026. // empty values are omitted from API requests. However, any non-pointer,
  1027. // non-interface field appearing in ForceSendFields will be sent to the
  1028. // server regardless of whether the field is empty or not. This may be
  1029. // used to include empty fields in Patch requests.
  1030. ForceSendFields []string `json:"-"`
  1031. // NullFields is a list of field names (e.g. "Error") to include in API
  1032. // requests with the JSON null value. By default, fields with empty
  1033. // values are omitted from API requests. However, any field with an
  1034. // empty value appearing in NullFields will be sent to the server as
  1035. // null. It is an error if a field in this list has a non-empty value.
  1036. // This may be used to include null fields in Patch requests.
  1037. NullFields []string `json:"-"`
  1038. }
  1039. func (s *GoogleCloudVideointelligenceV1beta2VideoAnnotationResults) MarshalJSON() ([]byte, error) {
  1040. type NoMethod GoogleCloudVideointelligenceV1beta2VideoAnnotationResults
  1041. raw := NoMethod(*s)
  1042. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1043. }
  1044. // GoogleCloudVideointelligenceV1beta2VideoSegment: Video segment.
  1045. type GoogleCloudVideointelligenceV1beta2VideoSegment struct {
  1046. // EndTimeOffset: Time-offset, relative to the beginning of the
  1047. // video,
  1048. // corresponding to the end of the segment (inclusive).
  1049. EndTimeOffset string `json:"endTimeOffset,omitempty"`
  1050. // StartTimeOffset: Time-offset, relative to the beginning of the
  1051. // video,
  1052. // corresponding to the start of the segment (inclusive).
  1053. StartTimeOffset string `json:"startTimeOffset,omitempty"`
  1054. // ForceSendFields is a list of field names (e.g. "EndTimeOffset") to
  1055. // unconditionally include in API requests. By default, fields with
  1056. // empty values are omitted from API requests. However, any non-pointer,
  1057. // non-interface field appearing in ForceSendFields will be sent to the
  1058. // server regardless of whether the field is empty or not. This may be
  1059. // used to include empty fields in Patch requests.
  1060. ForceSendFields []string `json:"-"`
  1061. // NullFields is a list of field names (e.g. "EndTimeOffset") to include
  1062. // in API requests with the JSON null value. By default, fields with
  1063. // empty values are omitted from API requests. However, any field with
  1064. // an empty value appearing in NullFields will be sent to the server as
  1065. // null. It is an error if a field in this list has a non-empty value.
  1066. // This may be used to include null fields in Patch requests.
  1067. NullFields []string `json:"-"`
  1068. }
  1069. func (s *GoogleCloudVideointelligenceV1beta2VideoSegment) MarshalJSON() ([]byte, error) {
  1070. type NoMethod GoogleCloudVideointelligenceV1beta2VideoSegment
  1071. raw := NoMethod(*s)
  1072. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1073. }
  1074. // GoogleCloudVideointelligenceV1p1beta1AnnotateVideoProgress: Video
  1075. // annotation progress. Included in the `metadata`
  1076. // field of the `Operation` returned by the `GetOperation`
  1077. // call of the `google::longrunning::Operations` service.
  1078. type GoogleCloudVideointelligenceV1p1beta1AnnotateVideoProgress struct {
  1079. // AnnotationProgress: Progress metadata for all videos specified in
  1080. // `AnnotateVideoRequest`.
  1081. AnnotationProgress []*GoogleCloudVideointelligenceV1p1beta1VideoAnnotationProgress `json:"annotationProgress,omitempty"`
  1082. // ForceSendFields is a list of field names (e.g. "AnnotationProgress")
  1083. // to unconditionally include in API requests. By default, fields with
  1084. // empty values are omitted from API requests. However, any non-pointer,
  1085. // non-interface field appearing in ForceSendFields will be sent to the
  1086. // server regardless of whether the field is empty or not. This may be
  1087. // used to include empty fields in Patch requests.
  1088. ForceSendFields []string `json:"-"`
  1089. // NullFields is a list of field names (e.g. "AnnotationProgress") to
  1090. // include in API requests with the JSON null value. By default, fields
  1091. // with empty values are omitted from API requests. However, any field
  1092. // with an empty value appearing in NullFields will be sent to the
  1093. // server as null. It is an error if a field in this list has a
  1094. // non-empty value. This may be used to include null fields in Patch
  1095. // requests.
  1096. NullFields []string `json:"-"`
  1097. }
  1098. func (s *GoogleCloudVideointelligenceV1p1beta1AnnotateVideoProgress) MarshalJSON() ([]byte, error) {
  1099. type NoMethod GoogleCloudVideointelligenceV1p1beta1AnnotateVideoProgress
  1100. raw := NoMethod(*s)
  1101. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1102. }
  1103. // GoogleCloudVideointelligenceV1p1beta1AnnotateVideoResponse: Video
  1104. // annotation response. Included in the `response`
  1105. // field of the `Operation` returned by the `GetOperation`
  1106. // call of the `google::longrunning::Operations` service.
  1107. type GoogleCloudVideointelligenceV1p1beta1AnnotateVideoResponse struct {
  1108. // AnnotationResults: Annotation results for all videos specified in
  1109. // `AnnotateVideoRequest`.
  1110. AnnotationResults []*GoogleCloudVideointelligenceV1p1beta1VideoAnnotationResults `json:"annotationResults,omitempty"`
  1111. // ForceSendFields is a list of field names (e.g. "AnnotationResults")
  1112. // to unconditionally include in API requests. By default, fields with
  1113. // empty values are omitted from API requests. However, any non-pointer,
  1114. // non-interface field appearing in ForceSendFields will be sent to the
  1115. // server regardless of whether the field is empty or not. This may be
  1116. // used to include empty fields in Patch requests.
  1117. ForceSendFields []string `json:"-"`
  1118. // NullFields is a list of field names (e.g. "AnnotationResults") to
  1119. // include in API requests with the JSON null value. By default, fields
  1120. // with empty values are omitted from API requests. However, any field
  1121. // with an empty value appearing in NullFields will be sent to the
  1122. // server as null. It is an error if a field in this list has a
  1123. // non-empty value. This may be used to include null fields in Patch
  1124. // requests.
  1125. NullFields []string `json:"-"`
  1126. }
  1127. func (s *GoogleCloudVideointelligenceV1p1beta1AnnotateVideoResponse) MarshalJSON() ([]byte, error) {
  1128. type NoMethod GoogleCloudVideointelligenceV1p1beta1AnnotateVideoResponse
  1129. raw := NoMethod(*s)
  1130. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1131. }
  1132. // GoogleCloudVideointelligenceV1p1beta1Entity: Detected entity from
  1133. // video analysis.
  1134. type GoogleCloudVideointelligenceV1p1beta1Entity struct {
  1135. // Description: Textual description, e.g. `Fixed-gear bicycle`.
  1136. Description string `json:"description,omitempty"`
  1137. // EntityId: Opaque entity ID. Some IDs may be available in
  1138. // [Google Knowledge Graph
  1139. // Search
  1140. // API](https://developers.google.com/knowledge-graph/).
  1141. EntityId string `json:"entityId,omitempty"`
  1142. // LanguageCode: Language code for `description` in BCP-47 format.
  1143. LanguageCode string `json:"languageCode,omitempty"`
  1144. // ForceSendFields is a list of field names (e.g. "Description") to
  1145. // unconditionally include in API requests. By default, fields with
  1146. // empty values are omitted from API requests. However, any non-pointer,
  1147. // non-interface field appearing in ForceSendFields will be sent to the
  1148. // server regardless of whether the field is empty or not. This may be
  1149. // used to include empty fields in Patch requests.
  1150. ForceSendFields []string `json:"-"`
  1151. // NullFields is a list of field names (e.g. "Description") to include
  1152. // in API requests with the JSON null value. By default, fields with
  1153. // empty values are omitted from API requests. However, any field with
  1154. // an empty value appearing in NullFields will be sent to the server as
  1155. // null. It is an error if a field in this list has a non-empty value.
  1156. // This may be used to include null fields in Patch requests.
  1157. NullFields []string `json:"-"`
  1158. }
  1159. func (s *GoogleCloudVideointelligenceV1p1beta1Entity) MarshalJSON() ([]byte, error) {
  1160. type NoMethod GoogleCloudVideointelligenceV1p1beta1Entity
  1161. raw := NoMethod(*s)
  1162. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1163. }
  1164. // GoogleCloudVideointelligenceV1p1beta1ExplicitContentAnnotation:
  1165. // Explicit content annotation (based on per-frame visual signals
  1166. // only).
  1167. // If no explicit content has been detected in a frame, no annotations
  1168. // are
  1169. // present for that frame.
  1170. type GoogleCloudVideointelligenceV1p1beta1ExplicitContentAnnotation struct {
  1171. // Frames: All video frames where explicit content was detected.
  1172. Frames []*GoogleCloudVideointelligenceV1p1beta1ExplicitContentFrame `json:"frames,omitempty"`
  1173. // ForceSendFields is a list of field names (e.g. "Frames") to
  1174. // unconditionally include in API requests. By default, fields with
  1175. // empty values are omitted from API requests. However, any non-pointer,
  1176. // non-interface field appearing in ForceSendFields will be sent to the
  1177. // server regardless of whether the field is empty or not. This may be
  1178. // used to include empty fields in Patch requests.
  1179. ForceSendFields []string `json:"-"`
  1180. // NullFields is a list of field names (e.g. "Frames") to include in API
  1181. // requests with the JSON null value. By default, fields with empty
  1182. // values are omitted from API requests. However, any field with an
  1183. // empty value appearing in NullFields will be sent to the server as
  1184. // null. It is an error if a field in this list has a non-empty value.
  1185. // This may be used to include null fields in Patch requests.
  1186. NullFields []string `json:"-"`
  1187. }
  1188. func (s *GoogleCloudVideointelligenceV1p1beta1ExplicitContentAnnotation) MarshalJSON() ([]byte, error) {
  1189. type NoMethod GoogleCloudVideointelligenceV1p1beta1ExplicitContentAnnotation
  1190. raw := NoMethod(*s)
  1191. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1192. }
  1193. // GoogleCloudVideointelligenceV1p1beta1ExplicitContentFrame: Video
  1194. // frame level annotation results for explicit content.
  1195. type GoogleCloudVideointelligenceV1p1beta1ExplicitContentFrame struct {
  1196. // PornographyLikelihood: Likelihood of the pornography content..
  1197. //
  1198. // Possible values:
  1199. // "LIKELIHOOD_UNSPECIFIED" - Unspecified likelihood.
  1200. // "VERY_UNLIKELY" - Very unlikely.
  1201. // "UNLIKELY" - Unlikely.
  1202. // "POSSIBLE" - Possible.
  1203. // "LIKELY" - Likely.
  1204. // "VERY_LIKELY" - Very likely.
  1205. PornographyLikelihood string `json:"pornographyLikelihood,omitempty"`
  1206. // TimeOffset: Time-offset, relative to the beginning of the video,
  1207. // corresponding to the
  1208. // video frame for this location.
  1209. TimeOffset string `json:"timeOffset,omitempty"`
  1210. // ForceSendFields is a list of field names (e.g.
  1211. // "PornographyLikelihood") to unconditionally include in API requests.
  1212. // By default, fields with empty values are omitted from API requests.
  1213. // However, any non-pointer, non-interface field appearing in
  1214. // ForceSendFields will be sent to the server regardless of whether the
  1215. // field is empty or not. This may be used to include empty fields in
  1216. // Patch requests.
  1217. ForceSendFields []string `json:"-"`
  1218. // NullFields is a list of field names (e.g. "PornographyLikelihood") to
  1219. // include in API requests with the JSON null value. By default, fields
  1220. // with empty values are omitted from API requests. However, any field
  1221. // with an empty value appearing in NullFields will be sent to the
  1222. // server as null. It is an error if a field in this list has a
  1223. // non-empty value. This may be used to include null fields in Patch
  1224. // requests.
  1225. NullFields []string `json:"-"`
  1226. }
  1227. func (s *GoogleCloudVideointelligenceV1p1beta1ExplicitContentFrame) MarshalJSON() ([]byte, error) {
  1228. type NoMethod GoogleCloudVideointelligenceV1p1beta1ExplicitContentFrame
  1229. raw := NoMethod(*s)
  1230. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1231. }
  1232. // GoogleCloudVideointelligenceV1p1beta1LabelAnnotation: Label
  1233. // annotation.
  1234. type GoogleCloudVideointelligenceV1p1beta1LabelAnnotation struct {
  1235. // CategoryEntities: Common categories for the detected entity.
  1236. // E.g. when the label is `Terrier` the category is likely `dog`. And in
  1237. // some
  1238. // cases there might be more than one categories e.g. `Terrier` could
  1239. // also be
  1240. // a `pet`.
  1241. CategoryEntities []*GoogleCloudVideointelligenceV1p1beta1Entity `json:"categoryEntities,omitempty"`
  1242. // Entity: Detected entity.
  1243. Entity *GoogleCloudVideointelligenceV1p1beta1Entity `json:"entity,omitempty"`
  1244. // Frames: All video frames where a label was detected.
  1245. Frames []*GoogleCloudVideointelligenceV1p1beta1LabelFrame `json:"frames,omitempty"`
  1246. // Segments: All video segments where a label was detected.
  1247. Segments []*GoogleCloudVideointelligenceV1p1beta1LabelSegment `json:"segments,omitempty"`
  1248. // ForceSendFields is a list of field names (e.g. "CategoryEntities") to
  1249. // unconditionally include in API requests. By default, fields with
  1250. // empty values are omitted from API requests. However, any non-pointer,
  1251. // non-interface field appearing in ForceSendFields will be sent to the
  1252. // server regardless of whether the field is empty or not. This may be
  1253. // used to include empty fields in Patch requests.
  1254. ForceSendFields []string `json:"-"`
  1255. // NullFields is a list of field names (e.g. "CategoryEntities") to
  1256. // include in API requests with the JSON null value. By default, fields
  1257. // with empty values are omitted from API requests. However, any field
  1258. // with an empty value appearing in NullFields will be sent to the
  1259. // server as null. It is an error if a field in this list has a
  1260. // non-empty value. This may be used to include null fields in Patch
  1261. // requests.
  1262. NullFields []string `json:"-"`
  1263. }
  1264. func (s *GoogleCloudVideointelligenceV1p1beta1LabelAnnotation) MarshalJSON() ([]byte, error) {
  1265. type NoMethod GoogleCloudVideointelligenceV1p1beta1LabelAnnotation
  1266. raw := NoMethod(*s)
  1267. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1268. }
  1269. // GoogleCloudVideointelligenceV1p1beta1LabelFrame: Video frame level
  1270. // annotation results for label detection.
  1271. type GoogleCloudVideointelligenceV1p1beta1LabelFrame struct {
  1272. // Confidence: Confidence that the label is accurate. Range: [0, 1].
  1273. Confidence float64 `json:"confidence,omitempty"`
  1274. // TimeOffset: Time-offset, relative to the beginning of the video,
  1275. // corresponding to the
  1276. // video frame for this location.
  1277. TimeOffset string `json:"timeOffset,omitempty"`
  1278. // ForceSendFields is a list of field names (e.g. "Confidence") 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. "Confidence") to include in
  1286. // API requests with the JSON null value. By default, fields with empty
  1287. // values are omitted from API requests. However, any field with an
  1288. // 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 *GoogleCloudVideointelligenceV1p1beta1LabelFrame) MarshalJSON() ([]byte, error) {
  1294. type NoMethod GoogleCloudVideointelligenceV1p1beta1LabelFrame
  1295. raw := NoMethod(*s)
  1296. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1297. }
  1298. func (s *GoogleCloudVideointelligenceV1p1beta1LabelFrame) UnmarshalJSON(data []byte) error {
  1299. type NoMethod GoogleCloudVideointelligenceV1p1beta1LabelFrame
  1300. var s1 struct {
  1301. Confidence gensupport.JSONFloat64 `json:"confidence"`
  1302. *NoMethod
  1303. }
  1304. s1.NoMethod = (*NoMethod)(s)
  1305. if err := json.Unmarshal(data, &s1); err != nil {
  1306. return err
  1307. }
  1308. s.Confidence = float64(s1.Confidence)
  1309. return nil
  1310. }
  1311. // GoogleCloudVideointelligenceV1p1beta1LabelSegment: Video segment
  1312. // level annotation results for label detection.
  1313. type GoogleCloudVideointelligenceV1p1beta1LabelSegment struct {
  1314. // Confidence: Confidence that the label is accurate. Range: [0, 1].
  1315. Confidence float64 `json:"confidence,omitempty"`
  1316. // Segment: Video segment where a label was detected.
  1317. Segment *GoogleCloudVideointelligenceV1p1beta1VideoSegment `json:"segment,omitempty"`
  1318. // ForceSendFields is a list of field names (e.g. "Confidence") to
  1319. // unconditionally include in API requests. By default, fields with
  1320. // empty values are omitted from API requests. However, any non-pointer,
  1321. // non-interface field appearing in ForceSendFields will be sent to the
  1322. // server regardless of whether the field is empty or not. This may be
  1323. // used to include empty fields in Patch requests.
  1324. ForceSendFields []string `json:"-"`
  1325. // NullFields is a list of field names (e.g. "Confidence") to include in
  1326. // API requests with the JSON null value. By default, fields with empty
  1327. // values are omitted from API requests. However, any field with an
  1328. // empty value appearing in NullFields will be sent to the server as
  1329. // null. It is an error if a field in this list has a non-empty value.
  1330. // This may be used to include null fields in Patch requests.
  1331. NullFields []string `json:"-"`
  1332. }
  1333. func (s *GoogleCloudVideointelligenceV1p1beta1LabelSegment) MarshalJSON() ([]byte, error) {
  1334. type NoMethod GoogleCloudVideointelligenceV1p1beta1LabelSegment
  1335. raw := NoMethod(*s)
  1336. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1337. }
  1338. func (s *GoogleCloudVideointelligenceV1p1beta1LabelSegment) UnmarshalJSON(data []byte) error {
  1339. type NoMethod GoogleCloudVideointelligenceV1p1beta1LabelSegment
  1340. var s1 struct {
  1341. Confidence gensupport.JSONFloat64 `json:"confidence"`
  1342. *NoMethod
  1343. }
  1344. s1.NoMethod = (*NoMethod)(s)
  1345. if err := json.Unmarshal(data, &s1); err != nil {
  1346. return err
  1347. }
  1348. s.Confidence = float64(s1.Confidence)
  1349. return nil
  1350. }
  1351. // GoogleCloudVideointelligenceV1p1beta1SpeechRecognitionAlternative:
  1352. // Alternative hypotheses (a.k.a. n-best list).
  1353. type GoogleCloudVideointelligenceV1p1beta1SpeechRecognitionAlternative struct {
  1354. // Confidence: Output only. The confidence estimate between 0.0 and 1.0.
  1355. // A higher number
  1356. // indicates an estimated greater likelihood that the recognized words
  1357. // are
  1358. // correct. This field is typically provided only for the top
  1359. // hypothesis, and
  1360. // only for `is_final=true` results. Clients should not rely on
  1361. // the
  1362. // `confidence` field as it is not guaranteed to be accurate or
  1363. // consistent.
  1364. // The default of 0.0 is a sentinel value indicating `confidence` was
  1365. // not set.
  1366. Confidence float64 `json:"confidence,omitempty"`
  1367. // Transcript: Output only. Transcript text representing the words that
  1368. // the user spoke.
  1369. Transcript string `json:"transcript,omitempty"`
  1370. // Words: Output only. A list of word-specific information for each
  1371. // recognized word.
  1372. Words []*GoogleCloudVideointelligenceV1p1beta1WordInfo `json:"words,omitempty"`
  1373. // ForceSendFields is a list of field names (e.g. "Confidence") to
  1374. // unconditionally include in API requests. By default, fields with
  1375. // empty values are omitted from API requests. However, any non-pointer,
  1376. // non-interface field appearing in ForceSendFields will be sent to the
  1377. // server regardless of whether the field is empty or not. This may be
  1378. // used to include empty fields in Patch requests.
  1379. ForceSendFields []string `json:"-"`
  1380. // NullFields is a list of field names (e.g. "Confidence") to include in
  1381. // API requests with the JSON null value. By default, fields with empty
  1382. // values are omitted from API requests. However, any field with an
  1383. // empty value appearing in NullFields will be sent to the server as
  1384. // null. It is an error if a field in this list has a non-empty value.
  1385. // This may be used to include null fields in Patch requests.
  1386. NullFields []string `json:"-"`
  1387. }
  1388. func (s *GoogleCloudVideointelligenceV1p1beta1SpeechRecognitionAlternative) MarshalJSON() ([]byte, error) {
  1389. type NoMethod GoogleCloudVideointelligenceV1p1beta1SpeechRecognitionAlternative
  1390. raw := NoMethod(*s)
  1391. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1392. }
  1393. func (s *GoogleCloudVideointelligenceV1p1beta1SpeechRecognitionAlternative) UnmarshalJSON(data []byte) error {
  1394. type NoMethod GoogleCloudVideointelligenceV1p1beta1SpeechRecognitionAlternative
  1395. var s1 struct {
  1396. Confidence gensupport.JSONFloat64 `json:"confidence"`
  1397. *NoMethod
  1398. }
  1399. s1.NoMethod = (*NoMethod)(s)
  1400. if err := json.Unmarshal(data, &s1); err != nil {
  1401. return err
  1402. }
  1403. s.Confidence = float64(s1.Confidence)
  1404. return nil
  1405. }
  1406. // GoogleCloudVideointelligenceV1p1beta1SpeechTranscription: A speech
  1407. // recognition result corresponding to a portion of the audio.
  1408. type GoogleCloudVideointelligenceV1p1beta1SpeechTranscription struct {
  1409. // Alternatives: Output only. May contain one or more recognition
  1410. // hypotheses (up to the
  1411. // maximum specified in `max_alternatives`).
  1412. // These alternatives are ordered in terms of accuracy, with the top
  1413. // (first)
  1414. // alternative being the most probable, as ranked by the recognizer.
  1415. Alternatives []*GoogleCloudVideointelligenceV1p1beta1SpeechRecognitionAlternative `json:"alternatives,omitempty"`
  1416. // ForceSendFields is a list of field names (e.g. "Alternatives") to
  1417. // unconditionally include in API requests. By default, fields with
  1418. // empty values are omitted from API requests. However, any non-pointer,
  1419. // non-interface field appearing in ForceSendFields will be sent to the
  1420. // server regardless of whether the field is empty or not. This may be
  1421. // used to include empty fields in Patch requests.
  1422. ForceSendFields []string `json:"-"`
  1423. // NullFields is a list of field names (e.g. "Alternatives") to include
  1424. // in API requests with the JSON null value. By default, fields with
  1425. // empty values are omitted from API requests. However, any field with
  1426. // an empty value appearing in NullFields will be sent to the server as
  1427. // null. It is an error if a field in this list has a non-empty value.
  1428. // This may be used to include null fields in Patch requests.
  1429. NullFields []string `json:"-"`
  1430. }
  1431. func (s *GoogleCloudVideointelligenceV1p1beta1SpeechTranscription) MarshalJSON() ([]byte, error) {
  1432. type NoMethod GoogleCloudVideointelligenceV1p1beta1SpeechTranscription
  1433. raw := NoMethod(*s)
  1434. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1435. }
  1436. // GoogleCloudVideointelligenceV1p1beta1VideoAnnotationProgress:
  1437. // Annotation progress for a single video.
  1438. type GoogleCloudVideointelligenceV1p1beta1VideoAnnotationProgress struct {
  1439. // InputUri: Output only. Video file location in
  1440. // [Google Cloud Storage](https://cloud.google.com/storage/).
  1441. InputUri string `json:"inputUri,omitempty"`
  1442. // ProgressPercent: Output only. Approximate percentage processed thus
  1443. // far. Guaranteed to be
  1444. // 100 when fully processed.
  1445. ProgressPercent int64 `json:"progressPercent,omitempty"`
  1446. // StartTime: Output only. Time when the request was received.
  1447. StartTime string `json:"startTime,omitempty"`
  1448. // UpdateTime: Output only. Time of the most recent update.
  1449. UpdateTime string `json:"updateTime,omitempty"`
  1450. // ForceSendFields is a list of field names (e.g. "InputUri") to
  1451. // unconditionally include in API requests. By default, fields with
  1452. // empty values are omitted from API requests. However, any non-pointer,
  1453. // non-interface field appearing in ForceSendFields will be sent to the
  1454. // server regardless of whether the field is empty or not. This may be
  1455. // used to include empty fields in Patch requests.
  1456. ForceSendFields []string `json:"-"`
  1457. // NullFields is a list of field names (e.g. "InputUri") to include in
  1458. // API requests with the JSON null value. By default, fields with empty
  1459. // values are omitted from API requests. However, any field with an
  1460. // empty value appearing in NullFields will be sent to the server as
  1461. // null. It is an error if a field in this list has a non-empty value.
  1462. // This may be used to include null fields in Patch requests.
  1463. NullFields []string `json:"-"`
  1464. }
  1465. func (s *GoogleCloudVideointelligenceV1p1beta1VideoAnnotationProgress) MarshalJSON() ([]byte, error) {
  1466. type NoMethod GoogleCloudVideointelligenceV1p1beta1VideoAnnotationProgress
  1467. raw := NoMethod(*s)
  1468. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1469. }
  1470. // GoogleCloudVideointelligenceV1p1beta1VideoAnnotationResults:
  1471. // Annotation results for a single video.
  1472. type GoogleCloudVideointelligenceV1p1beta1VideoAnnotationResults struct {
  1473. // Error: Output only. Non-streaming error only. If set, indicates an
  1474. // error. Note
  1475. // that for a single `AnnotateVideoRequest` some videos may succeed and
  1476. // some
  1477. // may fail.
  1478. Error *GoogleRpcStatus `json:"error,omitempty"`
  1479. // ExplicitAnnotation: Explicit content annotation.
  1480. ExplicitAnnotation *GoogleCloudVideointelligenceV1p1beta1ExplicitContentAnnotation `json:"explicitAnnotation,omitempty"`
  1481. // FrameLabelAnnotations: Label annotations on frame level.
  1482. // There is exactly one element for each unique label.
  1483. FrameLabelAnnotations []*GoogleCloudVideointelligenceV1p1beta1LabelAnnotation `json:"frameLabelAnnotations,omitempty"`
  1484. // InputUri: Output only. Video file location in
  1485. // [Google Cloud Storage](https://cloud.google.com/storage/).
  1486. InputUri string `json:"inputUri,omitempty"`
  1487. // SegmentLabelAnnotations: Label annotations on video level or user
  1488. // specified segment level.
  1489. // There is exactly one element for each unique label.
  1490. SegmentLabelAnnotations []*GoogleCloudVideointelligenceV1p1beta1LabelAnnotation `json:"segmentLabelAnnotations,omitempty"`
  1491. // ShotAnnotations: Shot annotations. Each shot is represented as a
  1492. // video segment.
  1493. ShotAnnotations []*GoogleCloudVideointelligenceV1p1beta1VideoSegment `json:"shotAnnotations,omitempty"`
  1494. // ShotLabelAnnotations: Label annotations on shot level.
  1495. // There is exactly one element for each unique label.
  1496. ShotLabelAnnotations []*GoogleCloudVideointelligenceV1p1beta1LabelAnnotation `json:"shotLabelAnnotations,omitempty"`
  1497. // SpeechTranscriptions: Speech transcription.
  1498. SpeechTranscriptions []*GoogleCloudVideointelligenceV1p1beta1SpeechTranscription `json:"speechTranscriptions,omitempty"`
  1499. // ForceSendFields is a list of field names (e.g. "Error") to
  1500. // unconditionally include in API requests. By default, fields with
  1501. // empty values are omitted from API requests. However, any non-pointer,
  1502. // non-interface field appearing in ForceSendFields will be sent to the
  1503. // server regardless of whether the field is empty or not. This may be
  1504. // used to include empty fields in Patch requests.
  1505. ForceSendFields []string `json:"-"`
  1506. // NullFields is a list of field names (e.g. "Error") to include in API
  1507. // requests with the JSON null value. By default, fields with empty
  1508. // values are omitted from API requests. However, any field with an
  1509. // empty value appearing in NullFields will be sent to the server as
  1510. // null. It is an error if a field in this list has a non-empty value.
  1511. // This may be used to include null fields in Patch requests.
  1512. NullFields []string `json:"-"`
  1513. }
  1514. func (s *GoogleCloudVideointelligenceV1p1beta1VideoAnnotationResults) MarshalJSON() ([]byte, error) {
  1515. type NoMethod GoogleCloudVideointelligenceV1p1beta1VideoAnnotationResults
  1516. raw := NoMethod(*s)
  1517. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1518. }
  1519. // GoogleCloudVideointelligenceV1p1beta1VideoSegment: Video segment.
  1520. type GoogleCloudVideointelligenceV1p1beta1VideoSegment struct {
  1521. // EndTimeOffset: Time-offset, relative to the beginning of the
  1522. // video,
  1523. // corresponding to the end of the segment (inclusive).
  1524. EndTimeOffset string `json:"endTimeOffset,omitempty"`
  1525. // StartTimeOffset: Time-offset, relative to the beginning of the
  1526. // video,
  1527. // corresponding to the start of the segment (inclusive).
  1528. StartTimeOffset string `json:"startTimeOffset,omitempty"`
  1529. // ForceSendFields is a list of field names (e.g. "EndTimeOffset") to
  1530. // unconditionally include in API requests. By default, fields with
  1531. // empty values are omitted from API requests. However, any non-pointer,
  1532. // non-interface field appearing in ForceSendFields will be sent to the
  1533. // server regardless of whether the field is empty or not. This may be
  1534. // used to include empty fields in Patch requests.
  1535. ForceSendFields []string `json:"-"`
  1536. // NullFields is a list of field names (e.g. "EndTimeOffset") to include
  1537. // in API requests with the JSON null value. By default, fields with
  1538. // empty values are omitted from API requests. However, any field with
  1539. // an empty value appearing in NullFields will be sent to the server as
  1540. // null. It is an error if a field in this list has a non-empty value.
  1541. // This may be used to include null fields in Patch requests.
  1542. NullFields []string `json:"-"`
  1543. }
  1544. func (s *GoogleCloudVideointelligenceV1p1beta1VideoSegment) MarshalJSON() ([]byte, error) {
  1545. type NoMethod GoogleCloudVideointelligenceV1p1beta1VideoSegment
  1546. raw := NoMethod(*s)
  1547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1548. }
  1549. // GoogleCloudVideointelligenceV1p1beta1WordInfo: Word-specific
  1550. // information for recognized words. Word information is only
  1551. // included in the response when certain request parameters are set,
  1552. // such
  1553. // as `enable_word_time_offsets`.
  1554. type GoogleCloudVideointelligenceV1p1beta1WordInfo struct {
  1555. // EndTime: Output only. Time offset relative to the beginning of the
  1556. // audio, and
  1557. // corresponding to the end of the spoken word. This field is only set
  1558. // if
  1559. // `enable_word_time_offsets=true` and only in the top hypothesis. This
  1560. // is an
  1561. // experimental feature and the accuracy of the time offset can vary.
  1562. EndTime string `json:"endTime,omitempty"`
  1563. // StartTime: Output only. Time offset relative to the beginning of the
  1564. // audio, and
  1565. // corresponding to the start of the spoken word. This field is only set
  1566. // if
  1567. // `enable_word_time_offsets=true` and only in the top hypothesis. This
  1568. // is an
  1569. // experimental feature and the accuracy of the time offset can vary.
  1570. StartTime string `json:"startTime,omitempty"`
  1571. // Word: Output only. The word corresponding to this set of information.
  1572. Word string `json:"word,omitempty"`
  1573. // ForceSendFields is a list of field names (e.g. "EndTime") to
  1574. // unconditionally include in API requests. By default, fields with
  1575. // empty values are omitted from API requests. However, any non-pointer,
  1576. // non-interface field appearing in ForceSendFields will be sent to the
  1577. // server regardless of whether the field is empty or not. This may be
  1578. // used to include empty fields in Patch requests.
  1579. ForceSendFields []string `json:"-"`
  1580. // NullFields is a list of field names (e.g. "EndTime") to include in
  1581. // API requests with the JSON null value. By default, fields with empty
  1582. // values are omitted from API requests. However, any field with an
  1583. // empty value appearing in NullFields will be sent to the server as
  1584. // null. It is an error if a field in this list has a non-empty value.
  1585. // This may be used to include null fields in Patch requests.
  1586. NullFields []string `json:"-"`
  1587. }
  1588. func (s *GoogleCloudVideointelligenceV1p1beta1WordInfo) MarshalJSON() ([]byte, error) {
  1589. type NoMethod GoogleCloudVideointelligenceV1p1beta1WordInfo
  1590. raw := NoMethod(*s)
  1591. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1592. }
  1593. // GoogleLongrunningCancelOperationRequest: The request message for
  1594. // Operations.CancelOperation.
  1595. type GoogleLongrunningCancelOperationRequest struct {
  1596. }
  1597. // GoogleLongrunningListOperationsResponse: The response message for
  1598. // Operations.ListOperations.
  1599. type GoogleLongrunningListOperationsResponse struct {
  1600. // NextPageToken: The standard List next-page token.
  1601. NextPageToken string `json:"nextPageToken,omitempty"`
  1602. // Operations: A list of operations that matches the specified filter in
  1603. // the request.
  1604. Operations []*GoogleLongrunningOperation `json:"operations,omitempty"`
  1605. // ServerResponse contains the HTTP response code and headers from the
  1606. // server.
  1607. googleapi.ServerResponse `json:"-"`
  1608. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1609. // unconditionally include in API requests. By default, fields with
  1610. // empty values are omitted from API requests. However, any non-pointer,
  1611. // non-interface field appearing in ForceSendFields will be sent to the
  1612. // server regardless of whether the field is empty or not. This may be
  1613. // used to include empty fields in Patch requests.
  1614. ForceSendFields []string `json:"-"`
  1615. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1616. // in API requests with the JSON null value. By default, fields with
  1617. // empty values are omitted from API requests. However, any field with
  1618. // an empty value appearing in NullFields will be sent to the server as
  1619. // null. It is an error if a field in this list has a non-empty value.
  1620. // This may be used to include null fields in Patch requests.
  1621. NullFields []string `json:"-"`
  1622. }
  1623. func (s *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) {
  1624. type NoMethod GoogleLongrunningListOperationsResponse
  1625. raw := NoMethod(*s)
  1626. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1627. }
  1628. // GoogleLongrunningOperation: This resource represents a long-running
  1629. // operation that is the result of a
  1630. // network API call.
  1631. type GoogleLongrunningOperation struct {
  1632. // Done: If the value is `false`, it means the operation is still in
  1633. // progress.
  1634. // If `true`, the operation is completed, and either `error` or
  1635. // `response` is
  1636. // available.
  1637. Done bool `json:"done,omitempty"`
  1638. // Error: The error result of the operation in case of failure or
  1639. // cancellation.
  1640. Error *GoogleRpcStatus `json:"error,omitempty"`
  1641. // Metadata: Service-specific metadata associated with the operation.
  1642. // It typically
  1643. // contains progress information and common metadata such as create
  1644. // time.
  1645. // Some services might not provide such metadata. Any method that
  1646. // returns a
  1647. // long-running operation should document the metadata type, if any.
  1648. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  1649. // Name: The server-assigned name, which is only unique within the same
  1650. // service that
  1651. // originally returns it. If you use the default HTTP mapping,
  1652. // the
  1653. // `name` should have the format of `operations/some/unique/name`.
  1654. Name string `json:"name,omitempty"`
  1655. // Response: The normal response of the operation in case of success.
  1656. // If the original
  1657. // method returns no data on success, such as `Delete`, the response
  1658. // is
  1659. // `google.protobuf.Empty`. If the original method is
  1660. // standard
  1661. // `Get`/`Create`/`Update`, the response should be the resource. For
  1662. // other
  1663. // methods, the response should have the type `XxxResponse`, where
  1664. // `Xxx`
  1665. // is the original method name. For example, if the original method
  1666. // name
  1667. // is `TakeSnapshot()`, the inferred response type
  1668. // is
  1669. // `TakeSnapshotResponse`.
  1670. Response googleapi.RawMessage `json:"response,omitempty"`
  1671. // ServerResponse contains the HTTP response code and headers from the
  1672. // server.
  1673. googleapi.ServerResponse `json:"-"`
  1674. // ForceSendFields is a list of field names (e.g. "Done") to
  1675. // unconditionally include in API requests. By default, fields with
  1676. // empty values are omitted from API requests. However, any non-pointer,
  1677. // non-interface field appearing in ForceSendFields will be sent to the
  1678. // server regardless of whether the field is empty or not. This may be
  1679. // used to include empty fields in Patch requests.
  1680. ForceSendFields []string `json:"-"`
  1681. // NullFields is a list of field names (e.g. "Done") to include in API
  1682. // requests with the JSON null value. By default, fields with empty
  1683. // values are omitted from API requests. However, any field with an
  1684. // empty value appearing in NullFields will be sent to the server as
  1685. // null. It is an error if a field in this list has a non-empty value.
  1686. // This may be used to include null fields in Patch requests.
  1687. NullFields []string `json:"-"`
  1688. }
  1689. func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) {
  1690. type NoMethod GoogleLongrunningOperation
  1691. raw := NoMethod(*s)
  1692. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1693. }
  1694. // GoogleProtobufEmpty: A generic empty message that you can re-use to
  1695. // avoid defining duplicated
  1696. // empty messages in your APIs. A typical example is to use it as the
  1697. // request
  1698. // or the response type of an API method. For instance:
  1699. //
  1700. // service Foo {
  1701. // rpc Bar(google.protobuf.Empty) returns
  1702. // (google.protobuf.Empty);
  1703. // }
  1704. //
  1705. // The JSON representation for `Empty` is empty JSON object `{}`.
  1706. type GoogleProtobufEmpty struct {
  1707. // ServerResponse contains the HTTP response code and headers from the
  1708. // server.
  1709. googleapi.ServerResponse `json:"-"`
  1710. }
  1711. // GoogleRpcStatus: The `Status` type defines a logical error model that
  1712. // is suitable for different
  1713. // programming environments, including REST APIs and RPC APIs. It is
  1714. // used by
  1715. // [gRPC](https://github.com/grpc). The error model is designed to
  1716. // be:
  1717. //
  1718. // - Simple to use and understand for most users
  1719. // - Flexible enough to meet unexpected needs
  1720. //
  1721. // # Overview
  1722. //
  1723. // The `Status` message contains three pieces of data: error code, error
  1724. // message,
  1725. // and error details. The error code should be an enum value
  1726. // of
  1727. // google.rpc.Code, but it may accept additional error codes if needed.
  1728. // The
  1729. // error message should be a developer-facing English message that
  1730. // helps
  1731. // developers *understand* and *resolve* the error. If a localized
  1732. // user-facing
  1733. // error message is needed, put the localized message in the error
  1734. // details or
  1735. // localize it in the client. The optional error details may contain
  1736. // arbitrary
  1737. // information about the error. There is a predefined set of error
  1738. // detail types
  1739. // in the package `google.rpc` that can be used for common error
  1740. // conditions.
  1741. //
  1742. // # Language mapping
  1743. //
  1744. // The `Status` message is the logical representation of the error
  1745. // model, but it
  1746. // is not necessarily the actual wire format. When the `Status` message
  1747. // is
  1748. // exposed in different client libraries and different wire protocols,
  1749. // it can be
  1750. // mapped differently. For example, it will likely be mapped to some
  1751. // exceptions
  1752. // in Java, but more likely mapped to some error codes in C.
  1753. //
  1754. // # Other uses
  1755. //
  1756. // The error model and the `Status` message can be used in a variety
  1757. // of
  1758. // environments, either with or without APIs, to provide a
  1759. // consistent developer experience across different
  1760. // environments.
  1761. //
  1762. // Example uses of this error model include:
  1763. //
  1764. // - Partial errors. If a service needs to return partial errors to the
  1765. // client,
  1766. // it may embed the `Status` in the normal response to indicate the
  1767. // partial
  1768. // errors.
  1769. //
  1770. // - Workflow errors. A typical workflow has multiple steps. Each step
  1771. // may
  1772. // have a `Status` message for error reporting.
  1773. //
  1774. // - Batch operations. If a client uses batch request and batch
  1775. // response, the
  1776. // `Status` message should be used directly inside batch response,
  1777. // one for
  1778. // each error sub-response.
  1779. //
  1780. // - Asynchronous operations. If an API call embeds asynchronous
  1781. // operation
  1782. // results in its response, the status of those operations should
  1783. // be
  1784. // represented directly using the `Status` message.
  1785. //
  1786. // - Logging. If some API errors are stored in logs, the message
  1787. // `Status` could
  1788. // be used directly after any stripping needed for security/privacy
  1789. // reasons.
  1790. type GoogleRpcStatus struct {
  1791. // Code: The status code, which should be an enum value of
  1792. // google.rpc.Code.
  1793. Code int64 `json:"code,omitempty"`
  1794. // Details: A list of messages that carry the error details. There is a
  1795. // common set of
  1796. // message types for APIs to use.
  1797. Details []googleapi.RawMessage `json:"details,omitempty"`
  1798. // Message: A developer-facing error message, which should be in
  1799. // English. Any
  1800. // user-facing error message should be localized and sent in
  1801. // the
  1802. // google.rpc.Status.details field, or localized by the client.
  1803. Message string `json:"message,omitempty"`
  1804. // ForceSendFields is a list of field names (e.g. "Code") to
  1805. // unconditionally include in API requests. By default, fields with
  1806. // empty values are omitted from API requests. However, any non-pointer,
  1807. // non-interface field appearing in ForceSendFields will be sent to the
  1808. // server regardless of whether the field is empty or not. This may be
  1809. // used to include empty fields in Patch requests.
  1810. ForceSendFields []string `json:"-"`
  1811. // NullFields is a list of field names (e.g. "Code") to include in API
  1812. // requests with the JSON null value. By default, fields with empty
  1813. // values are omitted from API requests. However, any field with an
  1814. // empty value appearing in NullFields will be sent to the server as
  1815. // null. It is an error if a field in this list has a non-empty value.
  1816. // This may be used to include null fields in Patch requests.
  1817. NullFields []string `json:"-"`
  1818. }
  1819. func (s *GoogleRpcStatus) MarshalJSON() ([]byte, error) {
  1820. type NoMethod GoogleRpcStatus
  1821. raw := NoMethod(*s)
  1822. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1823. }
  1824. // method id "videointelligence.operations.cancel":
  1825. type OperationsCancelCall struct {
  1826. s *Service
  1827. name string
  1828. googlelongrunningCanceloperationrequest *GoogleLongrunningCancelOperationRequest
  1829. urlParams_ gensupport.URLParams
  1830. ctx_ context.Context
  1831. header_ http.Header
  1832. }
  1833. // Cancel: Starts asynchronous cancellation on a long-running operation.
  1834. // The server
  1835. // makes a best effort to cancel the operation, but success is
  1836. // not
  1837. // guaranteed. If the server doesn't support this method, it
  1838. // returns
  1839. // `google.rpc.Code.UNIMPLEMENTED`. Clients can
  1840. // use
  1841. // Operations.GetOperation or
  1842. // other methods to check whether the cancellation succeeded or whether
  1843. // the
  1844. // operation completed despite cancellation. On successful
  1845. // cancellation,
  1846. // the operation is not deleted; instead, it becomes an operation
  1847. // with
  1848. // an Operation.error value with a google.rpc.Status.code of
  1849. // 1,
  1850. // corresponding to `Code.CANCELLED`.
  1851. func (r *OperationsService) Cancel(name string, googlelongrunningCanceloperationrequest *GoogleLongrunningCancelOperationRequest) *OperationsCancelCall {
  1852. c := &OperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1853. c.name = name
  1854. c.googlelongrunningCanceloperationrequest = googlelongrunningCanceloperationrequest
  1855. return c
  1856. }
  1857. // Fields allows partial responses to be retrieved. See
  1858. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1859. // for more information.
  1860. func (c *OperationsCancelCall) Fields(s ...googleapi.Field) *OperationsCancelCall {
  1861. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1862. return c
  1863. }
  1864. // Context sets the context to be used in this call's Do method. Any
  1865. // pending HTTP request will be aborted if the provided context is
  1866. // canceled.
  1867. func (c *OperationsCancelCall) Context(ctx context.Context) *OperationsCancelCall {
  1868. c.ctx_ = ctx
  1869. return c
  1870. }
  1871. // Header returns an http.Header that can be modified by the caller to
  1872. // add HTTP headers to the request.
  1873. func (c *OperationsCancelCall) Header() http.Header {
  1874. if c.header_ == nil {
  1875. c.header_ = make(http.Header)
  1876. }
  1877. return c.header_
  1878. }
  1879. func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  1880. reqHeaders := make(http.Header)
  1881. for k, v := range c.header_ {
  1882. reqHeaders[k] = v
  1883. }
  1884. reqHeaders.Set("User-Agent", c.s.userAgent())
  1885. var body io.Reader = nil
  1886. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlelongrunningCanceloperationrequest)
  1887. if err != nil {
  1888. return nil, err
  1889. }
  1890. reqHeaders.Set("Content-Type", "application/json")
  1891. c.urlParams_.Set("alt", alt)
  1892. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/operations/{+name}:cancel")
  1893. urls += "?" + c.urlParams_.Encode()
  1894. req, _ := http.NewRequest("POST", urls, body)
  1895. req.Header = reqHeaders
  1896. googleapi.Expand(req.URL, map[string]string{
  1897. "name": c.name,
  1898. })
  1899. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  1900. }
  1901. // Do executes the "videointelligence.operations.cancel" call.
  1902. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  1903. // non-2xx status code is an error. Response headers are in either
  1904. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  1905. // returned at all) in error.(*googleapi.Error).Header. Use
  1906. // googleapi.IsNotModified to check whether the returned error was
  1907. // because http.StatusNotModified was returned.
  1908. func (c *OperationsCancelCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  1909. gensupport.SetOptions(c.urlParams_, opts...)
  1910. res, err := c.doRequest("json")
  1911. if res != nil && res.StatusCode == http.StatusNotModified {
  1912. if res.Body != nil {
  1913. res.Body.Close()
  1914. }
  1915. return nil, &googleapi.Error{
  1916. Code: res.StatusCode,
  1917. Header: res.Header,
  1918. }
  1919. }
  1920. if err != nil {
  1921. return nil, err
  1922. }
  1923. defer googleapi.CloseBody(res)
  1924. if err := googleapi.CheckResponse(res); err != nil {
  1925. return nil, err
  1926. }
  1927. ret := &GoogleProtobufEmpty{
  1928. ServerResponse: googleapi.ServerResponse{
  1929. Header: res.Header,
  1930. HTTPStatusCode: res.StatusCode,
  1931. },
  1932. }
  1933. target := &ret
  1934. if err := gensupport.DecodeResponse(target, res); err != nil {
  1935. return nil, err
  1936. }
  1937. return ret, nil
  1938. // {
  1939. // "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`.",
  1940. // "flatPath": "v1/operations/{operationsId}:cancel",
  1941. // "httpMethod": "POST",
  1942. // "id": "videointelligence.operations.cancel",
  1943. // "parameterOrder": [
  1944. // "name"
  1945. // ],
  1946. // "parameters": {
  1947. // "name": {
  1948. // "description": "The name of the operation resource to be cancelled.",
  1949. // "location": "path",
  1950. // "pattern": "^[^/]+$",
  1951. // "required": true,
  1952. // "type": "string"
  1953. // }
  1954. // },
  1955. // "path": "v1/operations/{+name}:cancel",
  1956. // "request": {
  1957. // "$ref": "GoogleLongrunning_CancelOperationRequest"
  1958. // },
  1959. // "response": {
  1960. // "$ref": "GoogleProtobuf_Empty"
  1961. // },
  1962. // "scopes": [
  1963. // "https://www.googleapis.com/auth/cloud-platform"
  1964. // ]
  1965. // }
  1966. }
  1967. // method id "videointelligence.operations.delete":
  1968. type OperationsDeleteCall struct {
  1969. s *Service
  1970. name string
  1971. urlParams_ gensupport.URLParams
  1972. ctx_ context.Context
  1973. header_ http.Header
  1974. }
  1975. // Delete: Deletes a long-running operation. This method indicates that
  1976. // the client is
  1977. // no longer interested in the operation result. It does not cancel
  1978. // the
  1979. // operation. If the server doesn't support this method, it
  1980. // returns
  1981. // `google.rpc.Code.UNIMPLEMENTED`.
  1982. func (r *OperationsService) Delete(name string) *OperationsDeleteCall {
  1983. c := &OperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1984. c.name = name
  1985. return c
  1986. }
  1987. // Fields allows partial responses to be retrieved. See
  1988. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1989. // for more information.
  1990. func (c *OperationsDeleteCall) Fields(s ...googleapi.Field) *OperationsDeleteCall {
  1991. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1992. return c
  1993. }
  1994. // Context sets the context to be used in this call's Do method. Any
  1995. // pending HTTP request will be aborted if the provided context is
  1996. // canceled.
  1997. func (c *OperationsDeleteCall) Context(ctx context.Context) *OperationsDeleteCall {
  1998. c.ctx_ = ctx
  1999. return c
  2000. }
  2001. // Header returns an http.Header that can be modified by the caller to
  2002. // add HTTP headers to the request.
  2003. func (c *OperationsDeleteCall) Header() http.Header {
  2004. if c.header_ == nil {
  2005. c.header_ = make(http.Header)
  2006. }
  2007. return c.header_
  2008. }
  2009. func (c *OperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  2010. reqHeaders := make(http.Header)
  2011. for k, v := range c.header_ {
  2012. reqHeaders[k] = v
  2013. }
  2014. reqHeaders.Set("User-Agent", c.s.userAgent())
  2015. var body io.Reader = nil
  2016. c.urlParams_.Set("alt", alt)
  2017. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/operations/{+name}")
  2018. urls += "?" + c.urlParams_.Encode()
  2019. req, _ := http.NewRequest("DELETE", urls, body)
  2020. req.Header = reqHeaders
  2021. googleapi.Expand(req.URL, map[string]string{
  2022. "name": c.name,
  2023. })
  2024. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2025. }
  2026. // Do executes the "videointelligence.operations.delete" call.
  2027. // Exactly one of *GoogleProtobufEmpty or error will be non-nil. Any
  2028. // non-2xx status code is an error. Response headers are in either
  2029. // *GoogleProtobufEmpty.ServerResponse.Header or (if a response was
  2030. // returned at all) in error.(*googleapi.Error).Header. Use
  2031. // googleapi.IsNotModified to check whether the returned error was
  2032. // because http.StatusNotModified was returned.
  2033. func (c *OperationsDeleteCall) Do(opts ...googleapi.CallOption) (*GoogleProtobufEmpty, error) {
  2034. gensupport.SetOptions(c.urlParams_, opts...)
  2035. res, err := c.doRequest("json")
  2036. if res != nil && res.StatusCode == http.StatusNotModified {
  2037. if res.Body != nil {
  2038. res.Body.Close()
  2039. }
  2040. return nil, &googleapi.Error{
  2041. Code: res.StatusCode,
  2042. Header: res.Header,
  2043. }
  2044. }
  2045. if err != nil {
  2046. return nil, err
  2047. }
  2048. defer googleapi.CloseBody(res)
  2049. if err := googleapi.CheckResponse(res); err != nil {
  2050. return nil, err
  2051. }
  2052. ret := &GoogleProtobufEmpty{
  2053. ServerResponse: googleapi.ServerResponse{
  2054. Header: res.Header,
  2055. HTTPStatusCode: res.StatusCode,
  2056. },
  2057. }
  2058. target := &ret
  2059. if err := gensupport.DecodeResponse(target, res); err != nil {
  2060. return nil, err
  2061. }
  2062. return ret, nil
  2063. // {
  2064. // "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`.",
  2065. // "flatPath": "v1/operations/{operationsId}",
  2066. // "httpMethod": "DELETE",
  2067. // "id": "videointelligence.operations.delete",
  2068. // "parameterOrder": [
  2069. // "name"
  2070. // ],
  2071. // "parameters": {
  2072. // "name": {
  2073. // "description": "The name of the operation resource to be deleted.",
  2074. // "location": "path",
  2075. // "pattern": "^[^/]+$",
  2076. // "required": true,
  2077. // "type": "string"
  2078. // }
  2079. // },
  2080. // "path": "v1/operations/{+name}",
  2081. // "response": {
  2082. // "$ref": "GoogleProtobuf_Empty"
  2083. // },
  2084. // "scopes": [
  2085. // "https://www.googleapis.com/auth/cloud-platform"
  2086. // ]
  2087. // }
  2088. }
  2089. // method id "videointelligence.operations.get":
  2090. type OperationsGetCall struct {
  2091. s *Service
  2092. name string
  2093. urlParams_ gensupport.URLParams
  2094. ifNoneMatch_ string
  2095. ctx_ context.Context
  2096. header_ http.Header
  2097. }
  2098. // Get: Gets the latest state of a long-running operation. Clients can
  2099. // use this
  2100. // method to poll the operation result at intervals as recommended by
  2101. // the API
  2102. // service.
  2103. func (r *OperationsService) Get(name string) *OperationsGetCall {
  2104. c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2105. c.name = name
  2106. return c
  2107. }
  2108. // Fields allows partial responses to be retrieved. See
  2109. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2110. // for more information.
  2111. func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall {
  2112. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2113. return c
  2114. }
  2115. // IfNoneMatch sets the optional parameter which makes the operation
  2116. // fail if the object's ETag matches the given value. This is useful for
  2117. // getting updates only after the object has changed since the last
  2118. // request. Use googleapi.IsNotModified to check whether the response
  2119. // error from Do is the result of In-None-Match.
  2120. func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall {
  2121. c.ifNoneMatch_ = entityTag
  2122. return c
  2123. }
  2124. // Context sets the context to be used in this call's Do method. Any
  2125. // pending HTTP request will be aborted if the provided context is
  2126. // canceled.
  2127. func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall {
  2128. c.ctx_ = ctx
  2129. return c
  2130. }
  2131. // Header returns an http.Header that can be modified by the caller to
  2132. // add HTTP headers to the request.
  2133. func (c *OperationsGetCall) Header() http.Header {
  2134. if c.header_ == nil {
  2135. c.header_ = make(http.Header)
  2136. }
  2137. return c.header_
  2138. }
  2139. func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) {
  2140. reqHeaders := make(http.Header)
  2141. for k, v := range c.header_ {
  2142. reqHeaders[k] = v
  2143. }
  2144. reqHeaders.Set("User-Agent", c.s.userAgent())
  2145. if c.ifNoneMatch_ != "" {
  2146. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2147. }
  2148. var body io.Reader = nil
  2149. c.urlParams_.Set("alt", alt)
  2150. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/operations/{+name}")
  2151. urls += "?" + c.urlParams_.Encode()
  2152. req, _ := http.NewRequest("GET", urls, body)
  2153. req.Header = reqHeaders
  2154. googleapi.Expand(req.URL, map[string]string{
  2155. "name": c.name,
  2156. })
  2157. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2158. }
  2159. // Do executes the "videointelligence.operations.get" call.
  2160. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  2161. // Any non-2xx status code is an error. Response headers are in either
  2162. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  2163. // was returned at all) in error.(*googleapi.Error).Header. Use
  2164. // googleapi.IsNotModified to check whether the returned error was
  2165. // because http.StatusNotModified was returned.
  2166. func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  2167. gensupport.SetOptions(c.urlParams_, opts...)
  2168. res, err := c.doRequest("json")
  2169. if res != nil && res.StatusCode == http.StatusNotModified {
  2170. if res.Body != nil {
  2171. res.Body.Close()
  2172. }
  2173. return nil, &googleapi.Error{
  2174. Code: res.StatusCode,
  2175. Header: res.Header,
  2176. }
  2177. }
  2178. if err != nil {
  2179. return nil, err
  2180. }
  2181. defer googleapi.CloseBody(res)
  2182. if err := googleapi.CheckResponse(res); err != nil {
  2183. return nil, err
  2184. }
  2185. ret := &GoogleLongrunningOperation{
  2186. ServerResponse: googleapi.ServerResponse{
  2187. Header: res.Header,
  2188. HTTPStatusCode: res.StatusCode,
  2189. },
  2190. }
  2191. target := &ret
  2192. if err := gensupport.DecodeResponse(target, res); err != nil {
  2193. return nil, err
  2194. }
  2195. return ret, nil
  2196. // {
  2197. // "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.",
  2198. // "flatPath": "v1/operations/{operationsId}",
  2199. // "httpMethod": "GET",
  2200. // "id": "videointelligence.operations.get",
  2201. // "parameterOrder": [
  2202. // "name"
  2203. // ],
  2204. // "parameters": {
  2205. // "name": {
  2206. // "description": "The name of the operation resource.",
  2207. // "location": "path",
  2208. // "pattern": "^[^/]+$",
  2209. // "required": true,
  2210. // "type": "string"
  2211. // }
  2212. // },
  2213. // "path": "v1/operations/{+name}",
  2214. // "response": {
  2215. // "$ref": "GoogleLongrunning_Operation"
  2216. // },
  2217. // "scopes": [
  2218. // "https://www.googleapis.com/auth/cloud-platform"
  2219. // ]
  2220. // }
  2221. }
  2222. // method id "videointelligence.operations.list":
  2223. type OperationsListCall struct {
  2224. s *Service
  2225. urlParams_ gensupport.URLParams
  2226. ifNoneMatch_ string
  2227. ctx_ context.Context
  2228. header_ http.Header
  2229. }
  2230. // List: Lists operations that match the specified filter in the
  2231. // request. If the
  2232. // server doesn't support this method, it returns
  2233. // `UNIMPLEMENTED`.
  2234. //
  2235. // NOTE: the `name` binding allows API services to override the
  2236. // binding
  2237. // to use different resource name schemes, such as `users/*/operations`.
  2238. // To
  2239. // override the binding, API services can add a binding such
  2240. // as
  2241. // "/v1/{name=users/*}/operations" to their service configuration.
  2242. // For backwards compatibility, the default name includes the
  2243. // operations
  2244. // collection id, however overriding users must ensure the name
  2245. // binding
  2246. // is the parent resource, without the operations collection id.
  2247. func (r *OperationsService) List() *OperationsListCall {
  2248. c := &OperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2249. return c
  2250. }
  2251. // Filter sets the optional parameter "filter": The standard list
  2252. // filter.
  2253. func (c *OperationsListCall) Filter(filter string) *OperationsListCall {
  2254. c.urlParams_.Set("filter", filter)
  2255. return c
  2256. }
  2257. // Name sets the optional parameter "name": The name of the operation's
  2258. // parent resource.
  2259. func (c *OperationsListCall) Name(name string) *OperationsListCall {
  2260. c.urlParams_.Set("name", name)
  2261. return c
  2262. }
  2263. // PageSize sets the optional parameter "pageSize": The standard list
  2264. // page size.
  2265. func (c *OperationsListCall) PageSize(pageSize int64) *OperationsListCall {
  2266. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  2267. return c
  2268. }
  2269. // PageToken sets the optional parameter "pageToken": The standard list
  2270. // page token.
  2271. func (c *OperationsListCall) PageToken(pageToken string) *OperationsListCall {
  2272. c.urlParams_.Set("pageToken", pageToken)
  2273. return c
  2274. }
  2275. // Fields allows partial responses to be retrieved. See
  2276. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2277. // for more information.
  2278. func (c *OperationsListCall) Fields(s ...googleapi.Field) *OperationsListCall {
  2279. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2280. return c
  2281. }
  2282. // IfNoneMatch sets the optional parameter which makes the operation
  2283. // fail if the object's ETag matches the given value. This is useful for
  2284. // getting updates only after the object has changed since the last
  2285. // request. Use googleapi.IsNotModified to check whether the response
  2286. // error from Do is the result of In-None-Match.
  2287. func (c *OperationsListCall) IfNoneMatch(entityTag string) *OperationsListCall {
  2288. c.ifNoneMatch_ = entityTag
  2289. return c
  2290. }
  2291. // Context sets the context to be used in this call's Do method. Any
  2292. // pending HTTP request will be aborted if the provided context is
  2293. // canceled.
  2294. func (c *OperationsListCall) Context(ctx context.Context) *OperationsListCall {
  2295. c.ctx_ = ctx
  2296. return c
  2297. }
  2298. // Header returns an http.Header that can be modified by the caller to
  2299. // add HTTP headers to the request.
  2300. func (c *OperationsListCall) Header() http.Header {
  2301. if c.header_ == nil {
  2302. c.header_ = make(http.Header)
  2303. }
  2304. return c.header_
  2305. }
  2306. func (c *OperationsListCall) doRequest(alt string) (*http.Response, error) {
  2307. reqHeaders := make(http.Header)
  2308. for k, v := range c.header_ {
  2309. reqHeaders[k] = v
  2310. }
  2311. reqHeaders.Set("User-Agent", c.s.userAgent())
  2312. if c.ifNoneMatch_ != "" {
  2313. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2314. }
  2315. var body io.Reader = nil
  2316. c.urlParams_.Set("alt", alt)
  2317. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/operations")
  2318. urls += "?" + c.urlParams_.Encode()
  2319. req, _ := http.NewRequest("GET", urls, body)
  2320. req.Header = reqHeaders
  2321. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2322. }
  2323. // Do executes the "videointelligence.operations.list" call.
  2324. // Exactly one of *GoogleLongrunningListOperationsResponse or error will
  2325. // be non-nil. Any non-2xx status code is an error. Response headers are
  2326. // in either
  2327. // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if
  2328. // a response was returned at all) in error.(*googleapi.Error).Header.
  2329. // Use googleapi.IsNotModified to check whether the returned error was
  2330. // because http.StatusNotModified was returned.
  2331. func (c *OperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
  2332. gensupport.SetOptions(c.urlParams_, opts...)
  2333. res, err := c.doRequest("json")
  2334. if res != nil && res.StatusCode == http.StatusNotModified {
  2335. if res.Body != nil {
  2336. res.Body.Close()
  2337. }
  2338. return nil, &googleapi.Error{
  2339. Code: res.StatusCode,
  2340. Header: res.Header,
  2341. }
  2342. }
  2343. if err != nil {
  2344. return nil, err
  2345. }
  2346. defer googleapi.CloseBody(res)
  2347. if err := googleapi.CheckResponse(res); err != nil {
  2348. return nil, err
  2349. }
  2350. ret := &GoogleLongrunningListOperationsResponse{
  2351. ServerResponse: googleapi.ServerResponse{
  2352. Header: res.Header,
  2353. HTTPStatusCode: res.StatusCode,
  2354. },
  2355. }
  2356. target := &ret
  2357. if err := gensupport.DecodeResponse(target, res); err != nil {
  2358. return nil, err
  2359. }
  2360. return ret, nil
  2361. // {
  2362. // "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.",
  2363. // "flatPath": "v1/operations",
  2364. // "httpMethod": "GET",
  2365. // "id": "videointelligence.operations.list",
  2366. // "parameterOrder": [],
  2367. // "parameters": {
  2368. // "filter": {
  2369. // "description": "The standard list filter.",
  2370. // "location": "query",
  2371. // "type": "string"
  2372. // },
  2373. // "name": {
  2374. // "description": "The name of the operation's parent resource.",
  2375. // "location": "query",
  2376. // "type": "string"
  2377. // },
  2378. // "pageSize": {
  2379. // "description": "The standard list page size.",
  2380. // "format": "int32",
  2381. // "location": "query",
  2382. // "type": "integer"
  2383. // },
  2384. // "pageToken": {
  2385. // "description": "The standard list page token.",
  2386. // "location": "query",
  2387. // "type": "string"
  2388. // }
  2389. // },
  2390. // "path": "v1/operations",
  2391. // "response": {
  2392. // "$ref": "GoogleLongrunning_ListOperationsResponse"
  2393. // },
  2394. // "scopes": [
  2395. // "https://www.googleapis.com/auth/cloud-platform"
  2396. // ]
  2397. // }
  2398. }
  2399. // Pages invokes f for each page of results.
  2400. // A non-nil error returned from f will halt the iteration.
  2401. // The provided context supersedes any context provided to the Context method.
  2402. func (c *OperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
  2403. c.ctx_ = ctx
  2404. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  2405. for {
  2406. x, err := c.Do()
  2407. if err != nil {
  2408. return err
  2409. }
  2410. if err := f(x); err != nil {
  2411. return err
  2412. }
  2413. if x.NextPageToken == "" {
  2414. return nil
  2415. }
  2416. c.PageToken(x.NextPageToken)
  2417. }
  2418. }
  2419. // method id "videointelligence.videos.annotate":
  2420. type VideosAnnotateCall struct {
  2421. s *Service
  2422. googlecloudvideointelligencev1Annotatevideorequest *GoogleCloudVideointelligenceV1AnnotateVideoRequest
  2423. urlParams_ gensupport.URLParams
  2424. ctx_ context.Context
  2425. header_ http.Header
  2426. }
  2427. // Annotate: Performs asynchronous video annotation. Progress and
  2428. // results can be
  2429. // retrieved through the `google.longrunning.Operations`
  2430. // interface.
  2431. // `Operation.metadata` contains `AnnotateVideoProgress`
  2432. // (progress).
  2433. // `Operation.response` contains `AnnotateVideoResponse` (results).
  2434. func (r *VideosService) Annotate(googlecloudvideointelligencev1Annotatevideorequest *GoogleCloudVideointelligenceV1AnnotateVideoRequest) *VideosAnnotateCall {
  2435. c := &VideosAnnotateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2436. c.googlecloudvideointelligencev1Annotatevideorequest = googlecloudvideointelligencev1Annotatevideorequest
  2437. return c
  2438. }
  2439. // Fields allows partial responses to be retrieved. See
  2440. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2441. // for more information.
  2442. func (c *VideosAnnotateCall) Fields(s ...googleapi.Field) *VideosAnnotateCall {
  2443. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2444. return c
  2445. }
  2446. // Context sets the context to be used in this call's Do method. Any
  2447. // pending HTTP request will be aborted if the provided context is
  2448. // canceled.
  2449. func (c *VideosAnnotateCall) Context(ctx context.Context) *VideosAnnotateCall {
  2450. c.ctx_ = ctx
  2451. return c
  2452. }
  2453. // Header returns an http.Header that can be modified by the caller to
  2454. // add HTTP headers to the request.
  2455. func (c *VideosAnnotateCall) Header() http.Header {
  2456. if c.header_ == nil {
  2457. c.header_ = make(http.Header)
  2458. }
  2459. return c.header_
  2460. }
  2461. func (c *VideosAnnotateCall) doRequest(alt string) (*http.Response, error) {
  2462. reqHeaders := make(http.Header)
  2463. for k, v := range c.header_ {
  2464. reqHeaders[k] = v
  2465. }
  2466. reqHeaders.Set("User-Agent", c.s.userAgent())
  2467. var body io.Reader = nil
  2468. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googlecloudvideointelligencev1Annotatevideorequest)
  2469. if err != nil {
  2470. return nil, err
  2471. }
  2472. reqHeaders.Set("Content-Type", "application/json")
  2473. c.urlParams_.Set("alt", alt)
  2474. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/videos:annotate")
  2475. urls += "?" + c.urlParams_.Encode()
  2476. req, _ := http.NewRequest("POST", urls, body)
  2477. req.Header = reqHeaders
  2478. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2479. }
  2480. // Do executes the "videointelligence.videos.annotate" call.
  2481. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  2482. // Any non-2xx status code is an error. Response headers are in either
  2483. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  2484. // was returned at all) in error.(*googleapi.Error).Header. Use
  2485. // googleapi.IsNotModified to check whether the returned error was
  2486. // because http.StatusNotModified was returned.
  2487. func (c *VideosAnnotateCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  2488. gensupport.SetOptions(c.urlParams_, opts...)
  2489. res, err := c.doRequest("json")
  2490. if res != nil && res.StatusCode == http.StatusNotModified {
  2491. if res.Body != nil {
  2492. res.Body.Close()
  2493. }
  2494. return nil, &googleapi.Error{
  2495. Code: res.StatusCode,
  2496. Header: res.Header,
  2497. }
  2498. }
  2499. if err != nil {
  2500. return nil, err
  2501. }
  2502. defer googleapi.CloseBody(res)
  2503. if err := googleapi.CheckResponse(res); err != nil {
  2504. return nil, err
  2505. }
  2506. ret := &GoogleLongrunningOperation{
  2507. ServerResponse: googleapi.ServerResponse{
  2508. Header: res.Header,
  2509. HTTPStatusCode: res.StatusCode,
  2510. },
  2511. }
  2512. target := &ret
  2513. if err := gensupport.DecodeResponse(target, res); err != nil {
  2514. return nil, err
  2515. }
  2516. return ret, nil
  2517. // {
  2518. // "description": "Performs asynchronous video annotation. Progress and results can be\nretrieved through the `google.longrunning.Operations` interface.\n`Operation.metadata` contains `AnnotateVideoProgress` (progress).\n`Operation.response` contains `AnnotateVideoResponse` (results).",
  2519. // "flatPath": "v1/videos:annotate",
  2520. // "httpMethod": "POST",
  2521. // "id": "videointelligence.videos.annotate",
  2522. // "parameterOrder": [],
  2523. // "parameters": {},
  2524. // "path": "v1/videos:annotate",
  2525. // "request": {
  2526. // "$ref": "GoogleCloudVideointelligenceV1_AnnotateVideoRequest"
  2527. // },
  2528. // "response": {
  2529. // "$ref": "GoogleLongrunning_Operation"
  2530. // },
  2531. // "scopes": [
  2532. // "https://www.googleapis.com/auth/cloud-platform"
  2533. // ]
  2534. // }
  2535. }