| // Copyright 2018 The Feed Authors. |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| syntax = "proto2"; |
| |
| package search.now.ui.stream; |
| |
| option optimize_for=LITE_RUNTIME; |
| |
| import "src/main/proto/search/now/ui/piet/piet.proto"; |
| import "src/main/proto/search/now/wire/feed/content_id.proto"; |
| import "src/main/proto/search/now/wire/feed/feature.proto"; |
| |
| option java_package = "com.google.search.now.ui.stream"; |
| option java_outer_classname = "StreamStructureProto"; |
| option cc_enable_arenas = true; |
| |
| // Top level feature which shows a stream of cards. Provides any UI information |
| // which may be needed in order to render the stream of cards. |
| message Stream { |
| extend search.now.wire.feed.Feature { |
| optional Stream stream_extension = 185431437; |
| } |
| |
| // Empty for now as don't support any custom information. |
| } |
| |
| // Feature which represents a cluster in a Stream. May have a Card or Content |
| // as children. |
| message Cluster { |
| extend search.now.wire.feed.Feature { |
| optional Cluster cluster_extension = 190812910; |
| } |
| |
| // Empty for now as we don't support any custom information. |
| } |
| |
| // Experimental feature which represents a carousel in a Stream. May have a list |
| // of Cards or Content as children. |
| message Carousel { |
| extend search.now.wire.feed.Feature { |
| optional Carousel carousel_extension = 244251946; |
| } |
| |
| // Please use CL numbers you own for extension numbers. |
| extensions 10000 to max; |
| } |
| |
| // Feature which represents a full card in a Stream. Allows metadata to be sent |
| // to describe how to render the card. |
| message Card { |
| extend search.now.wire.feed.Feature { |
| optional Card card_extension = 185431438; |
| } |
| |
| // Please use CL numbers you own for extension numbers. |
| extensions 10000 to max; |
| } |
| |
| // Metadata object providing basic information for logging content. |
| message BasicLoggingMetadata { |
| // Score given by NowStream |
| optional float score = 2; |
| |
| // Please use CL numbers you own for extension numbers. |
| extensions 10000 to max; |
| |
| reserved 1; |
| } |
| |
| message RepresentationData { |
| // URI (usually a URL) of what the content links to |
| optional string uri = 1; |
| |
| // Time when content was published |
| optional int64 published_time_seconds = 2; |
| } |
| |
| message OfflineMetadata { |
| // Title of the content. |
| optional string title = 1; |
| |
| // Url for image for the content. |
| optional string image_url = 2; |
| |
| // Publisher of the content. |
| optional string publisher = 3; |
| |
| // Url for the favicon for the content. |
| optional string favicon_url = 4; |
| |
| // Short string from the content, typically the start of an article. |
| optional string snippet = 5; |
| } |
| |
| // Feature which is able to show actual content in a stream. This could be |
| // inside or outside a card. Actual data on what to display will be sent on an |
| // extension. |
| message Content { |
| extend search.now.wire.feed.Feature { |
| optional Content content_extension = 185431439; |
| } |
| |
| enum Type { |
| UNKNOWN_CONTENT = 0; |
| PIET = 1; |
| } |
| optional Type type = 1; |
| optional BasicLoggingMetadata basic_logging_metadata = 2; |
| optional RepresentationData representation_data = 3; |
| optional OfflineMetadata offline_metadata = 4; |
| |
| // Please use CL numbers you own for extension numbers. |
| extensions 10000 to max; |
| } |
| |
| // Content which is able to show a Piet frame. This includes any data which may |
| // be needed to show a Piet frame. |
| message PietContent { |
| extend Content { |
| optional PietContent piet_content_extension = 185431440; |
| } |
| |
| // Content Ids of Piet Shared States which should be provided to Piet in order |
| // to show its content. |
| repeated search.now.wire.feed.ContentId piet_shared_states = 1; |
| |
| // The Piet frame to render. |
| optional search.now.ui.piet.Frame frame = 2; |
| } |