Class RecommendationAICreateCatalogItem
- java.lang.Object
-
- org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<com.google.api.client.json.GenericJson>,org.apache.beam.sdk.values.PCollectionTuple>
-
- org.apache.beam.sdk.extensions.ml.RecommendationAICreateCatalogItem
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.beam.sdk.transforms.display.HasDisplayData
public abstract class RecommendationAICreateCatalogItem extends org.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<com.google.api.client.json.GenericJson>,org.apache.beam.sdk.values.PCollectionTuple>APTransformusing the Recommendations AI API (https://cloud.google.com/recommendations). Takes an inputPCollectionofGenericJsons and converts them to and createsCatalogItems. It outputs a PCollectionTuple which will contain the successfully created and failed catalog items.It is possible to provide a catalog name to which you want to add the catalog item (defaults to "default_catalog").
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.beam.sdk.values.TupleTag<com.google.cloud.recommendationengine.v1beta1.CatalogItem>FAILURE_TAGstatic org.apache.beam.sdk.values.TupleTag<com.google.cloud.recommendationengine.v1beta1.CatalogItem>SUCCESS_TAG
-
Constructor Summary
Constructors Constructor Description RecommendationAICreateCatalogItem()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.lang.StringcatalogName()Returns name of the catalog where the catalog items will be created (defaults to "default_catalog").org.apache.beam.sdk.values.PCollectionTupleexpand(org.apache.beam.sdk.values.PCollection<com.google.api.client.json.GenericJson> input)The transform converts the contents of input PCollection intoCatalogItems and then calls the Recommendation AI service to create the catalog item.abstract java.lang.StringprojectId()Returns ID of Google Cloud project to be used for creating catalog items.RecommendationAICreateCatalogItemwithCatalogName(java.lang.String catalogName)RecommendationAICreateCatalogItemwithProjectId(java.lang.String projectId)-
Methods inherited from class org.apache.beam.sdk.transforms.PTransform
addAnnotation, compose, compose, getAdditionalInputs, getAnnotations, getDefaultOutputCoder, getDefaultOutputCoder, getDefaultOutputCoder, getKindString, getName, getResourceHints, populateDisplayData, setDisplayData, setResourceHints, toString, validate, validate
-
-
-
-
Method Detail
-
projectId
@Nullable public abstract java.lang.String projectId()
Returns ID of Google Cloud project to be used for creating catalog items.
-
catalogName
@Nullable public abstract java.lang.String catalogName()
Returns name of the catalog where the catalog items will be created (defaults to "default_catalog").
-
withProjectId
public RecommendationAICreateCatalogItem withProjectId(java.lang.String projectId)
-
withCatalogName
public RecommendationAICreateCatalogItem withCatalogName(java.lang.String catalogName)
-
expand
public org.apache.beam.sdk.values.PCollectionTuple expand(org.apache.beam.sdk.values.PCollection<com.google.api.client.json.GenericJson> input)
The transform converts the contents of input PCollection intoCatalogItems and then calls the Recommendation AI service to create the catalog item.- Specified by:
expandin classorg.apache.beam.sdk.transforms.PTransform<org.apache.beam.sdk.values.PCollection<com.google.api.client.json.GenericJson>,org.apache.beam.sdk.values.PCollectionTuple>- Parameters:
input- input PCollection- Returns:
- PCollectionTuple with successful and failed
CatalogItems
-
-