Class ConnectionMapping

java.lang.Object
software.amazon.awssdk.services.context.model.ConnectionMapping
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<ConnectionMapping.Builder,ConnectionMapping>

@Generated("software.amazon.awssdk:codegen") public final class ConnectionMapping extends Object implements SdkPojo, Serializable, ToCopyableBuilder<ConnectionMapping.Builder,ConnectionMapping>

A connection mapping entry on CreateAgentContext and UpdateAgentContext. Each entry binds a connection to one or more ontologies within the agent context, optionally scoped by a data filter, extraction depth, and path segments.

See Also:
  • Method Details

    • connectionId

      public final String connectionId()

      The connection, by its ID (which starts with conn-) or its full ARN. Required. AWS Context resolves an ID to an ARN in your account and the current Region.

      Returns:
      The connection, by its ID (which starts with conn-) or its full ARN. Required. AWS Context resolves an ID to an ARN in your account and the current Region.
    • hasOntologyMappings

      public final boolean hasOntologyMappings()
      For responses, this returns true if the service returned a value for the OntologyMappings property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • ontologyMappings

      public final List<OntologyMapping> ontologyMappings()

      The ontology mappings for this connection mapping. Each entry identifies an ontology that this mapping targets. BEDROCK_KNOWLEDGE_BASE rejects the AWS managed Data ontology. GLUE_DATA_CATALOG rejects the AWS managed Enterprise and Business Process ontologies. AWS Context accepts a new or changed mapping to a customer-owned ontology only on BEDROCK_KNOWLEDGE_BASE. An incompatible mapping, or an ontology that isn't PUBLISHED, fails with ValidationException.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasOntologyMappings() method.

      Returns:
      The ontology mappings for this connection mapping. Each entry identifies an ontology that this mapping targets. BEDROCK_KNOWLEDGE_BASE rejects the AWS managed Data ontology. GLUE_DATA_CATALOG rejects the AWS managed Enterprise and Business Process ontologies. AWS Context accepts a new or changed mapping to a customer-owned ontology only on BEDROCK_KNOWLEDGE_BASE. An incompatible mapping, or an ontology that isn't PUBLISHED, fails with ValidationException.
    • dataFilter

      public final DataFilter dataFilter()

      Optional. The data filter for this connection mapping. A document matches if it matches any filter in the list. Within a filter, all conditions must match. If you omit it, every document matches.

      Returns:
      Optional. The data filter for this connection mapping. A document matches if it matches any filter in the list. Within a filter, all conditions must match. If you omit it, every document matches.
    • extractionDepth

      public final String extractionDepth()

      Optional extraction depth override for BEDROCK_KNOWLEDGE_BASE connections.

      Returns:
      Optional extraction depth override for BEDROCK_KNOWLEDGE_BASE connections.
    • hasPathSegments

      public final boolean hasPathSegments()
      For responses, this returns true if the service returned a value for the PathSegments property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • pathSegments

      public final List<PathSegment> pathSegments()

      The path segments that scope ingestion within the data source, 0–100 segments. Optional. An empty list is the same as omitting the field and matches everything. The segments name levels from one branch of the connection type's level hierarchy. The container levels form a contiguous prefix of that branch that starts at its root, and a link can also name the table level. AWS Context rejects a link that mixes branches. The branches are the following:

      • GLUE_DATA_CATALOG - The native branch (glueDatabase, glueTable) and one branch for each federated AWS data source: redshiftNamespace, redshiftDatabase, redshiftSchema, redshiftTable, rdsInstance, rdsDatabase, rdsSchema, rdsTable, s3TableBucket, s3Namespace, s3Table, and sagemakerModelGroup.

      • SNOWFLAKE - snowflakeDatabase, snowflakeSchema, snowflakeTable.

      • DATABRICKS - databricksCatalog, databricksSchema, databricksTable.

      The connection holds the source's identity, such as the account locator or metastore ID, so it isn't a segment. AWS Context matches IDs as opaque strings against the source's coordinate values.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasPathSegments() method.

      Returns:
      The path segments that scope ingestion within the data source, 0–100 segments. Optional. An empty list is the same as omitting the field and matches everything. The segments name levels from one branch of the connection type's level hierarchy. The container levels form a contiguous prefix of that branch that starts at its root, and a link can also name the table level. AWS Context rejects a link that mixes branches. The branches are the following:

      • GLUE_DATA_CATALOG - The native branch (glueDatabase, glueTable) and one branch for each federated AWS data source: redshiftNamespace, redshiftDatabase, redshiftSchema, redshiftTable, rdsInstance, rdsDatabase, rdsSchema, rdsTable, s3TableBucket, s3Namespace, s3Table, and sagemakerModelGroup.

      • SNOWFLAKE - snowflakeDatabase, snowflakeSchema, snowflakeTable.

      • DATABRICKS - databricksCatalog, databricksSchema, databricksTable.

      The connection holds the source's identity, such as the account locator or metastore ID, so it isn't a segment. AWS Context matches IDs as opaque strings against the source's coordinate values.

    • type

      public final ConnectionType type()

      The connection's data source type. AWS Context sets it from the referenced connection's data source type when you create or update the mapping. Read-only.

      Valid values:

      • GLUE_DATA_CATALOG - An AWS Glue Data Catalog, or an AWS Glue connection that fronts a federated AWS data source.

      • BEDROCK_KNOWLEDGE_BASE - An Amazon Bedrock knowledge base.

      • DATABRICKS - A Databricks third-party catalog.

      • SNOWFLAKE - A Snowflake third-party catalog.

      If the service returns an enum value that is not available in the current SDK version, type will return ConnectionType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from typeAsString().

      Returns:
      The connection's data source type. AWS Context sets it from the referenced connection's data source type when you create or update the mapping. Read-only.

      Valid values:

      • GLUE_DATA_CATALOG - An AWS Glue Data Catalog, or an AWS Glue connection that fronts a federated AWS data source.

      • BEDROCK_KNOWLEDGE_BASE - An Amazon Bedrock knowledge base.

      • DATABRICKS - A Databricks third-party catalog.

      • SNOWFLAKE - A Snowflake third-party catalog.

      See Also:
    • typeAsString

      public final String typeAsString()

      The connection's data source type. AWS Context sets it from the referenced connection's data source type when you create or update the mapping. Read-only.

      Valid values:

      • GLUE_DATA_CATALOG - An AWS Glue Data Catalog, or an AWS Glue connection that fronts a federated AWS data source.

      • BEDROCK_KNOWLEDGE_BASE - An Amazon Bedrock knowledge base.

      • DATABRICKS - A Databricks third-party catalog.

      • SNOWFLAKE - A Snowflake third-party catalog.

      If the service returns an enum value that is not available in the current SDK version, type will return ConnectionType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from typeAsString().

      Returns:
      The connection's data source type. AWS Context sets it from the referenced connection's data source type when you create or update the mapping. Read-only.

      Valid values:

      • GLUE_DATA_CATALOG - An AWS Glue Data Catalog, or an AWS Glue connection that fronts a federated AWS data source.

      • BEDROCK_KNOWLEDGE_BASE - An Amazon Bedrock knowledge base.

      • DATABRICKS - A Databricks third-party catalog.

      • SNOWFLAKE - A Snowflake third-party catalog.

      See Also:
    • toBuilder

      public ConnectionMapping.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<ConnectionMapping.Builder,ConnectionMapping>
      Returns:
      a builder for type T
    • builder

      public static ConnectionMapping.Builder builder()
    • serializableBuilderClass

      public static Class<? extends ConnectionMapping.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo
      Returns:
      The mapping between the field name and its corresponding field.