Class Recommendation (2.48.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
Type Description
int

ASSOCIATED_INSIGHTS_FIELD_NUMBER

public static final int ASSOCIATED_INSIGHTS_FIELD_NUMBER
Field Value
Type Description
int

CONTENT_FIELD_NUMBER

public static final int CONTENT_FIELD_NUMBER
Field Value
Type Description
int

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
Type Description
int

ETAG_FIELD_NUMBER

public static final int ETAG_FIELD_NUMBER
Field Value
Type Description
int

LAST_REFRESH_TIME_FIELD_NUMBER

public static final int LAST_REFRESH_TIME_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

PRIMARY_IMPACT_FIELD_NUMBER

public static final int PRIMARY_IMPACT_FIELD_NUMBER
Field Value
Type Description
int

PRIORITY_FIELD_NUMBER

public static final int PRIORITY_FIELD_NUMBER
Field Value
Type Description
int

RECOMMENDER_SUBTYPE_FIELD_NUMBER

public static final int RECOMMENDER_SUBTYPE_FIELD_NUMBER
Field Value
Type Description
int

STATE_INFO_FIELD_NUMBER

public static final int STATE_INFO_FIELD_NUMBER
Field Value
Type Description
int

XOR_GROUP_ID_FIELD_NUMBER

public static final int XOR_GROUP_ID_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Recommendation getDefaultInstance()
Returns
Type Description
Recommendation

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static Recommendation.Builder newBuilder()
Returns
Type Description
Recommendation.Builder

newBuilder(Recommendation prototype)

public static Recommendation.Builder newBuilder(Recommendation prototype)
Parameter
Name Description
prototype Recommendation
Returns
Type Description
Recommendation.Builder

parseDelimitedFrom(InputStream input)

public static Recommendation parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Recommendation
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Recommendation parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Recommendation
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Recommendation parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Recommendation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Recommendation parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Recommendation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Recommendation parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Recommendation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Recommendation parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Recommendation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Recommendation parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Recommendation
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Recommendation parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Recommendation
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Recommendation parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Recommendation
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Recommendation parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Recommendation
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Recommendation parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Recommendation
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Recommendation parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Recommendation
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Recommendation> parser()
Returns
Type Description
Parser<Recommendation>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
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
Name Description
index int
Returns
Type Description
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
Type Description
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
Type Description
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
Name Description
index int
Returns
Type Description
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
Type Description
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
Name Description
index int
Returns
Type Description
Recommendation.InsightReference

getAssociatedInsightsCount()

public int getAssociatedInsightsCount()

Insights that led to this recommendation.

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

Returns
Type Description
int

getAssociatedInsightsList()

public List<Recommendation.InsightReference> getAssociatedInsightsList()

Insights that led to this recommendation.

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

Returns
Type Description
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
Name Description
index int
Returns
Type Description
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
Type Description
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
Type Description
RecommendationContent

The content.

getContentOrBuilder()

public RecommendationContentOrBuilder getContentOrBuilder()

Content of the recommendation describing recommended changes to resources.

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

Returns
Type Description
RecommendationContentOrBuilder

getDefaultInstanceForType()

public Recommendation getDefaultInstanceForType()
Returns
Type Description
Recommendation

getDescription()

public String getDescription()

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

string description = 2;

Returns
Type Description
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

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

string description = 2;

Returns
Type Description
ByteString

The bytes for description.

getEtag()

public String getEtag()

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

string etag = 11;

Returns
Type Description
String

The etag.

getEtagBytes()

public ByteString getEtagBytes()

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

string etag = 11;

Returns
Type Description
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
Type Description
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
Type Description
TimestampOrBuilder

getName()

public String getName()

Name of recommendation.

string name = 1;

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Name of recommendation.

string name = 1;

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

public Parser<Recommendation> getParserForType()
Returns
Type Description
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
Type Description
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
Type Description
ImpactOrBuilder

getPriority()

public Recommendation.Priority getPriority()

Recommendation's priority.

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

Returns
Type Description
Recommendation.Priority

The priority.

getPriorityValue()

public int getPriorityValue()

Recommendation's priority.

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

Returns
Type Description
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
Type Description
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
Type Description
ByteString

The bytes for recommenderSubtype.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getStateInfo()

public RecommendationStateInfo getStateInfo()

Information for state. Contains state and metadata.

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

Returns
Type Description
RecommendationStateInfo

The stateInfo.

getStateInfoOrBuilder()

public RecommendationStateInfoOrBuilder getStateInfoOrBuilder()

Information for state. Contains state and metadata.

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

Returns
Type Description
RecommendationStateInfoOrBuilder

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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
boolean

Whether the stateInfo field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Recommendation.Builder newBuilderForType()
Returns
Type Description
Recommendation.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Recommendation.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Recommendation.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Recommendation.Builder toBuilder()
Returns
Type Description
Recommendation.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException