1 /* 2 * Copyright 2020 Google LLC 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * https://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 // Generated by the protocol buffer compiler. DO NOT EDIT! 17 // source: google/cloud/retail/v2/common.proto 18 19 package com.google.cloud.retail.v2; 20 21 public interface RatingOrBuilder 22 extends 23 // @@protoc_insertion_point(interface_extends:google.cloud.retail.v2.Rating) 24 com.google.protobuf.MessageOrBuilder { 25 26 /** 27 * 28 * 29 * <pre> 30 * The total number of ratings. This value is independent of the value of 31 * [rating_histogram][google.cloud.retail.v2.Rating.rating_histogram]. 32 * This value must be nonnegative. Otherwise, an INVALID_ARGUMENT error is 33 * returned. 34 * </pre> 35 * 36 * <code>int32 rating_count = 1;</code> 37 * 38 * @return The ratingCount. 39 */ getRatingCount()40 int getRatingCount(); 41 42 /** 43 * 44 * 45 * <pre> 46 * The average rating of the [Product][google.cloud.retail.v2.Product]. 47 * The rating is scaled at 1-5. Otherwise, an INVALID_ARGUMENT error is 48 * returned. 49 * </pre> 50 * 51 * <code>float average_rating = 2;</code> 52 * 53 * @return The averageRating. 54 */ getAverageRating()55 float getAverageRating(); 56 57 /** 58 * 59 * 60 * <pre> 61 * List of rating counts per rating value (index = rating - 1). The list is 62 * empty if there is no rating. If the list is non-empty, its size is 63 * always 5. Otherwise, an INVALID_ARGUMENT error is returned. 64 * For example, [41, 14, 13, 47, 303]. It means that the 65 * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14 66 * ratings with 2 star, and so on. 67 * </pre> 68 * 69 * <code>repeated int32 rating_histogram = 3;</code> 70 * 71 * @return A list containing the ratingHistogram. 72 */ getRatingHistogramList()73 java.util.List<java.lang.Integer> getRatingHistogramList(); 74 /** 75 * 76 * 77 * <pre> 78 * List of rating counts per rating value (index = rating - 1). The list is 79 * empty if there is no rating. If the list is non-empty, its size is 80 * always 5. Otherwise, an INVALID_ARGUMENT error is returned. 81 * For example, [41, 14, 13, 47, 303]. It means that the 82 * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14 83 * ratings with 2 star, and so on. 84 * </pre> 85 * 86 * <code>repeated int32 rating_histogram = 3;</code> 87 * 88 * @return The count of ratingHistogram. 89 */ getRatingHistogramCount()90 int getRatingHistogramCount(); 91 /** 92 * 93 * 94 * <pre> 95 * List of rating counts per rating value (index = rating - 1). The list is 96 * empty if there is no rating. If the list is non-empty, its size is 97 * always 5. Otherwise, an INVALID_ARGUMENT error is returned. 98 * For example, [41, 14, 13, 47, 303]. It means that the 99 * [Product][google.cloud.retail.v2.Product] got 41 ratings with 1 star, 14 100 * ratings with 2 star, and so on. 101 * </pre> 102 * 103 * <code>repeated int32 rating_histogram = 3;</code> 104 * 105 * @param index The index of the element to return. 106 * @return The ratingHistogram at the given index. 107 */ getRatingHistogram(int index)108 int getRatingHistogram(int index); 109 } 110