Class Recommendation (2.10.0)

public final class Recommendation extends GeneratedMessageV3 implements RecommendationOrBuilder

A recommendation along with a suggested action. E.g., a rightsizing recommendation for an underutilized VM, IAM role recommendations, etc

Protobuf type google.cloud.recommender.v1.Recommendation

Static Fields

ADDITIONAL_IMPACT_FIELD_NUMBER

public static final int ADDITIONAL_IMPACT_FIELD_NUMBER
Field Value
TypeDescription
int

ASSOCIATED_INSIGHTS_FIELD_NUMBER

public static final int ASSOCIATED_INSIGHTS_FIELD_NUMBER
Field Value
TypeDescription
int

CONTENT_FIELD_NUMBER

public static final int CONTENT_FIELD_NUMBER
Field Value
TypeDescription
int

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
TypeDescription
int

ETAG_FIELD_NUMBER

public static final int ETAG_FIELD_NUMBER
Field Value
TypeDescription
int

LAST_REFRESH_TIME_FIELD_NUMBER

public static final int LAST_REFRESH_TIME_FIELD_NUMBER
Field Value
TypeDescription
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
TypeDescription
int

PRIMARY_IMPACT_FIELD_NUMBER

public static final int PRIMARY_IMPACT_FIELD_NUMBER
Field Value
TypeDescription
int

PRIORITY_FIELD_NUMBER

public static final int PRIORITY_FIELD_NUMBER
Field Value
TypeDescription
int

RECOMMENDER_SUBTYPE_FIELD_NUMBER

public static final int RECOMMENDER_SUBTYPE_FIELD_NUMBER
Field Value
TypeDescription
int

STATE_INFO_FIELD_NUMBER

public static final int STATE_INFO_FIELD_NUMBER
Field Value
TypeDescription
int

XOR_GROUP_ID_FIELD_NUMBER

public static final int XOR_GROUP_ID_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Recommendation getDefaultInstance()
Returns
TypeDescription
Recommendation

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Recommendation.Builder newBuilder()
Returns
TypeDescription
Recommendation.Builder

newBuilder(Recommendation prototype)

public static Recommendation.Builder newBuilder(Recommendation prototype)
Parameter
NameDescription
prototypeRecommendation
Returns
TypeDescription
Recommendation.Builder

parseDelimitedFrom(InputStream input)

public static Recommendation parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Recommendation
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Recommendation parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Recommendation
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Recommendation parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Recommendation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Recommendation parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Recommendation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Recommendation parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Recommendation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Recommendation parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Recommendation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Recommendation parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Recommendation
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Recommendation parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Recommendation
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Recommendation parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Recommendation
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Recommendation parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Recommendation
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Recommendation parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Recommendation
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Recommendation parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Recommendation
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Recommendation> parser()
Returns
TypeDescription
Parser<Recommendation>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getAdditionalImpact(int index)

public Impact getAdditionalImpact(int index)

Optional set of additional impact that this recommendation may have when trying to optimize for the primary category. These may be positive or negative.

repeated .google.cloud.recommender.v1.Impact additional_impact = 6;

Parameter
NameDescription
indexint
Returns
TypeDescription
Impact

getAdditionalImpactCount()

public int getAdditionalImpactCount()

Optional set of additional impact that this recommendation may have when trying to optimize for the primary category. These may be positive or negative.

repeated .google.cloud.recommender.v1.Impact additional_impact = 6;

Returns
TypeDescription
int

getAdditionalImpactList()

public List<Impact> getAdditionalImpactList()

Optional set of additional impact that this recommendation may have when trying to optimize for the primary category. These may be positive or negative.

repeated .google.cloud.recommender.v1.Impact additional_impact = 6;

Returns
TypeDescription
List<Impact>

getAdditionalImpactOrBuilder(int index)

public ImpactOrBuilder getAdditionalImpactOrBuilder(int index)

Optional set of additional impact that this recommendation may have when trying to optimize for the primary category. These may be positive or negative.

repeated .google.cloud.recommender.v1.Impact additional_impact = 6;

Parameter
NameDescription
indexint
Returns
TypeDescription
ImpactOrBuilder

getAdditionalImpactOrBuilderList()

public List<? extends ImpactOrBuilder> getAdditionalImpactOrBuilderList()

Optional set of additional impact that this recommendation may have when trying to optimize for the primary category. These may be positive or negative.

repeated .google.cloud.recommender.v1.Impact additional_impact = 6;

Returns
TypeDescription
List<? extends com.google.cloud.recommender.v1.ImpactOrBuilder>

getAssociatedInsights(int index)

public Recommendation.InsightReference getAssociatedInsights(int index)

Insights that led to this recommendation.

repeated .google.cloud.recommender.v1.Recommendation.InsightReference associated_insights = 14;

Parameter
NameDescription
indexint
Returns
TypeDescription
Recommendation.InsightReference

getAssociatedInsightsCount()

public int getAssociatedInsightsCount()

Insights that led to this recommendation.

repeated .google.cloud.recommender.v1.Recommendation.InsightReference associated_insights = 14;

Returns
TypeDescription
int

getAssociatedInsightsList()

public List<Recommendation.InsightReference> getAssociatedInsightsList()

Insights that led to this recommendation.

repeated .google.cloud.recommender.v1.Recommendation.InsightReference associated_insights = 14;

Returns
TypeDescription
List<InsightReference>

getAssociatedInsightsOrBuilder(int index)

public Recommendation.InsightReferenceOrBuilder getAssociatedInsightsOrBuilder(int index)

Insights that led to this recommendation.

repeated .google.cloud.recommender.v1.Recommendation.InsightReference associated_insights = 14;

Parameter
NameDescription
indexint
Returns
TypeDescription
Recommendation.InsightReferenceOrBuilder

getAssociatedInsightsOrBuilderList()

public List<? extends Recommendation.InsightReferenceOrBuilder> getAssociatedInsightsOrBuilderList()

Insights that led to this recommendation.

repeated .google.cloud.recommender.v1.Recommendation.InsightReference associated_insights = 14;

Returns
TypeDescription
List<? extends com.google.cloud.recommender.v1.Recommendation.InsightReferenceOrBuilder>

getContent()

public RecommendationContent getContent()

Content of the recommendation describing recommended changes to resources.

.google.cloud.recommender.v1.RecommendationContent content = 7;

Returns
TypeDescription
RecommendationContent

The content.

getContentOrBuilder()

public RecommendationContentOrBuilder getContentOrBuilder()

Content of the recommendation describing recommended changes to resources.

.google.cloud.recommender.v1.RecommendationContent content = 7;

Returns
TypeDescription
RecommendationContentOrBuilder

getDefaultInstanceForType()

public Recommendation getDefaultInstanceForType()
Returns
TypeDescription
Recommendation

getDescription()

public String getDescription()

Free-form human readable summary in English. The maximum length is 500 characters.

string description = 2;

Returns
TypeDescription
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

Free-form human readable summary in English. The maximum length is 500 characters.

string description = 2;

Returns
TypeDescription
ByteString

The bytes for description.

getEtag()

public String getEtag()

Fingerprint of the Recommendation. Provides optimistic locking when updating states.

string etag = 11;

Returns
TypeDescription
String

The etag.

getEtagBytes()

public ByteString getEtagBytes()

Fingerprint of the Recommendation. Provides optimistic locking when updating states.

string etag = 11;

Returns
TypeDescription
ByteString

The bytes for etag.

getLastRefreshTime()

public Timestamp getLastRefreshTime()

Last time this recommendation was refreshed by the system that created it in the first place.

.google.protobuf.Timestamp last_refresh_time = 4;

Returns
TypeDescription
Timestamp

The lastRefreshTime.

getLastRefreshTimeOrBuilder()

public TimestampOrBuilder getLastRefreshTimeOrBuilder()

Last time this recommendation was refreshed by the system that created it in the first place.

.google.protobuf.Timestamp last_refresh_time = 4;

Returns
TypeDescription
TimestampOrBuilder

getName()

public String getName()

Name of recommendation.

string name = 1;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

Name of recommendation.

string name = 1;

Returns
TypeDescription
ByteString

The bytes for name.

getParserForType()

public Parser<Recommendation> getParserForType()
Returns
TypeDescription
Parser<Recommendation>
Overrides

getPrimaryImpact()

public Impact getPrimaryImpact()

The primary impact that this recommendation can have while trying to optimize for one category.

.google.cloud.recommender.v1.Impact primary_impact = 5;

Returns
TypeDescription
Impact

The primaryImpact.

getPrimaryImpactOrBuilder()

public ImpactOrBuilder getPrimaryImpactOrBuilder()

The primary impact that this recommendation can have while trying to optimize for one category.

.google.cloud.recommender.v1.Impact primary_impact = 5;

Returns
TypeDescription
ImpactOrBuilder

getPriority()

public Recommendation.Priority getPriority()

Recommendation's priority.

.google.cloud.recommender.v1.Recommendation.Priority priority = 17;

Returns
TypeDescription
Recommendation.Priority

The priority.

getPriorityValue()

public int getPriorityValue()

Recommendation's priority.

.google.cloud.recommender.v1.Recommendation.Priority priority = 17;

Returns
TypeDescription
int

The enum numeric value on the wire for priority.

getRecommenderSubtype()

public String getRecommenderSubtype()

Contains an identifier for a subtype of recommendations produced for the same recommender. Subtype is a function of content and impact, meaning a new subtype might be added when significant changes to content or primary_impact.category are introduced. See the Recommenders section to see a list of subtypes for a given Recommender. Examples: For recommender = "google.iam.policy.Recommender", recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE"

string recommender_subtype = 12;

Returns
TypeDescription
String

The recommenderSubtype.

getRecommenderSubtypeBytes()

public ByteString getRecommenderSubtypeBytes()

Contains an identifier for a subtype of recommendations produced for the same recommender. Subtype is a function of content and impact, meaning a new subtype might be added when significant changes to content or primary_impact.category are introduced. See the Recommenders section to see a list of subtypes for a given Recommender. Examples: For recommender = "google.iam.policy.Recommender", recommender_subtype can be one of "REMOVE_ROLE"/"REPLACE_ROLE"

string recommender_subtype = 12;

Returns
TypeDescription
ByteString

The bytes for recommenderSubtype.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getStateInfo()

public RecommendationStateInfo getStateInfo()

Information for state. Contains state and metadata.

.google.cloud.recommender.v1.RecommendationStateInfo state_info = 10;

Returns
TypeDescription
RecommendationStateInfo

The stateInfo.

getStateInfoOrBuilder()

public RecommendationStateInfoOrBuilder getStateInfoOrBuilder()

Information for state. Contains state and metadata.

.google.cloud.recommender.v1.RecommendationStateInfo state_info = 10;

Returns
TypeDescription
RecommendationStateInfoOrBuilder

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

getXorGroupId()

public String getXorGroupId()

Corresponds to a mutually exclusive group ID within a recommender. A non-empty ID indicates that the recommendation belongs to a mutually exclusive group. This means that only one recommendation within the group is suggested to be applied.

string xor_group_id = 18;

Returns
TypeDescription
String

The xorGroupId.

getXorGroupIdBytes()

public ByteString getXorGroupIdBytes()

Corresponds to a mutually exclusive group ID within a recommender. A non-empty ID indicates that the recommendation belongs to a mutually exclusive group. This means that only one recommendation within the group is suggested to be applied.

string xor_group_id = 18;

Returns
TypeDescription
ByteString

The bytes for xorGroupId.

hasContent()

public boolean hasContent()

Content of the recommendation describing recommended changes to resources.

.google.cloud.recommender.v1.RecommendationContent content = 7;

Returns
TypeDescription
boolean

Whether the content field is set.

hasLastRefreshTime()

public boolean hasLastRefreshTime()

Last time this recommendation was refreshed by the system that created it in the first place.

.google.protobuf.Timestamp last_refresh_time = 4;

Returns
TypeDescription
boolean

Whether the lastRefreshTime field is set.

hasPrimaryImpact()

public boolean hasPrimaryImpact()

The primary impact that this recommendation can have while trying to optimize for one category.

.google.cloud.recommender.v1.Impact primary_impact = 5;

Returns
TypeDescription
boolean

Whether the primaryImpact field is set.

hasStateInfo()

public boolean hasStateInfo()

Information for state. Contains state and metadata.

.google.cloud.recommender.v1.RecommendationStateInfo state_info = 10;

Returns
TypeDescription
boolean

Whether the stateInfo field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Recommendation.Builder newBuilderForType()
Returns
TypeDescription
Recommendation.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Recommendation.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Recommendation.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Recommendation.Builder toBuilder()
Returns
TypeDescription
Recommendation.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException