Skip to content

Latest commit

 

History

History
299 lines (224 loc) · 11.9 KB

File metadata and controls

299 lines (224 loc) · 11.9 KB

AttachmentProperty

Method HTTP request Release Stage
get_attachment GET /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/attachments/{property} Stable
get_attachment_by_rid GET /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/attachments/{property}/{attachmentRid} Stable
read_attachment GET /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/attachments/{property}/content Stable
read_attachment_by_rid GET /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/attachments/{property}/{attachmentRid}/content Stable

get_attachment

Get the metadata of attachments parented to the given object.

Parameters

Name Type Description Notes
ontology OntologyIdentifier
object_type ObjectTypeApiName The API name of the object type. To find the API name, use the List object types endpoint or check the Ontology Manager.
primary_key PropertyValueEscapedString The primary key of the object containing the attachment.
property PropertyApiName The API name of the attachment property. To find the API name for your attachment, check the Ontology Manager or use the Get object type endpoint.
sdk_package_rid Optional[SdkPackageRid] The package rid of the generated SDK. [optional]
sdk_version Optional[SdkVersion] The version of the generated SDK. [optional]

Return type

AttachmentMetadataResponse

Example

from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint

client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")

# OntologyIdentifier
ontology = "palantir"
# ObjectTypeApiName | The API name of the object type. To find the API name, use the **List object types** endpoint or check the **Ontology Manager**.
object_type = "employee"
# PropertyValueEscapedString | The primary key of the object containing the attachment.
primary_key = 50030
# PropertyApiName | The API name of the attachment property. To find the API name for your attachment, check the **Ontology Manager** or use the **Get object type** endpoint.
property = "performance"
# Optional[SdkPackageRid] | The package rid of the generated SDK.
sdk_package_rid = None
# Optional[SdkVersion] | The version of the generated SDK.
sdk_version = None


try:
    api_response = client.ontologies.AttachmentProperty.get_attachment(
        ontology,
        object_type,
        primary_key,
        property,
        sdk_package_rid=sdk_package_rid,
        sdk_version=sdk_version,
    )
    print("The get_attachment response:\n")
    pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
    print("HTTP error when calling AttachmentProperty.get_attachment: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 AttachmentMetadataResponse Success response. application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_attachment_by_rid

Get the metadata of a particular attachment in an attachment list.

Parameters

Name Type Description Notes
ontology OntologyIdentifier
object_type ObjectTypeApiName The API name of the object type. To find the API name, use the List object types endpoint or check the Ontology Manager.
primary_key PropertyValueEscapedString The primary key of the object containing the attachment.
property PropertyApiName The API name of the attachment property. To find the API name for your attachment, check the Ontology Manager or use the Get object type endpoint.
attachment_rid AttachmentRid The RID of the attachment.
sdk_package_rid Optional[SdkPackageRid] The package rid of the generated SDK. [optional]
sdk_version Optional[SdkVersion] The version of the generated SDK. [optional]

Return type

AttachmentV2

Example

from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint

client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")

# OntologyIdentifier
ontology = "palantir"
# ObjectTypeApiName | The API name of the object type. To find the API name, use the **List object types** endpoint or check the **Ontology Manager**.
object_type = "employee"
# PropertyValueEscapedString | The primary key of the object containing the attachment.
primary_key = 50030
# PropertyApiName | The API name of the attachment property. To find the API name for your attachment, check the **Ontology Manager** or use the **Get object type** endpoint.
property = "performance"
# AttachmentRid | The RID of the attachment.
attachment_rid = "ri.attachments.main.attachment.bb32154e-e043-4b00-9461-93136ca96b6f"
# Optional[SdkPackageRid] | The package rid of the generated SDK.
sdk_package_rid = None
# Optional[SdkVersion] | The version of the generated SDK.
sdk_version = None


try:
    api_response = client.ontologies.AttachmentProperty.get_attachment_by_rid(
        ontology,
        object_type,
        primary_key,
        property,
        attachment_rid,
        sdk_package_rid=sdk_package_rid,
        sdk_version=sdk_version,
    )
    print("The get_attachment_by_rid response:\n")
    pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
    print("HTTP error when calling AttachmentProperty.get_attachment_by_rid: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 AttachmentV2 Success response. application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

read_attachment

Get the content of an attachment.

Parameters

Name Type Description Notes
ontology OntologyIdentifier
object_type ObjectTypeApiName The API name of the object type. To find the API name, use the List object types endpoint or check the Ontology Manager.
primary_key PropertyValueEscapedString The primary key of the object containing the attachment.
property PropertyApiName The API name of the attachment property. To find the API name for your attachment, check the Ontology Manager or use the Get object type endpoint.
sdk_package_rid Optional[SdkPackageRid] The package rid of the generated SDK. [optional]
sdk_version Optional[SdkVersion] The version of the generated SDK. [optional]

Return type

bytes

Example

from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint

client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")

# OntologyIdentifier
ontology = "palantir"
# ObjectTypeApiName | The API name of the object type. To find the API name, use the **List object types** endpoint or check the **Ontology Manager**.
object_type = "employee"
# PropertyValueEscapedString | The primary key of the object containing the attachment.
primary_key = 50030
# PropertyApiName | The API name of the attachment property. To find the API name for your attachment, check the **Ontology Manager** or use the **Get object type** endpoint.
property = "performance"
# Optional[SdkPackageRid] | The package rid of the generated SDK.
sdk_package_rid = None
# Optional[SdkVersion] | The version of the generated SDK.
sdk_version = None


try:
    api_response = client.ontologies.AttachmentProperty.read_attachment(
        ontology,
        object_type,
        primary_key,
        property,
        sdk_package_rid=sdk_package_rid,
        sdk_version=sdk_version,
    )
    print("The read_attachment response:\n")
    pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
    print("HTTP error when calling AttachmentProperty.read_attachment: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 bytes Success response. /

[Back to top] [Back to API list] [Back to Model list] [Back to README]

read_attachment_by_rid

Get the content of an attachment by its RID.

The RID must exist in the attachment array of the property.

Parameters

Name Type Description Notes
ontology OntologyIdentifier
object_type ObjectTypeApiName The API name of the object type. To find the API name, use the List object types endpoint or check the Ontology Manager.
primary_key PropertyValueEscapedString The primary key of the object containing the attachment.
property PropertyApiName The API name of the attachment property. To find the API name for your attachment, check the Ontology Manager or use the Get object type endpoint.
attachment_rid AttachmentRid The RID of the attachment.
sdk_package_rid Optional[SdkPackageRid] The package rid of the generated SDK. [optional]
sdk_version Optional[SdkVersion] The version of the generated SDK. [optional]

Return type

bytes

Example

from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint

client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")

# OntologyIdentifier
ontology = "palantir"
# ObjectTypeApiName | The API name of the object type. To find the API name, use the **List object types** endpoint or check the **Ontology Manager**.
object_type = "employee"
# PropertyValueEscapedString | The primary key of the object containing the attachment.
primary_key = 50030
# PropertyApiName | The API name of the attachment property. To find the API name for your attachment, check the **Ontology Manager** or use the **Get object type** endpoint.
property = "performance"
# AttachmentRid | The RID of the attachment.
attachment_rid = "ri.attachments.main.attachment.bb32154e-e043-4b00-9461-93136ca96b6f"
# Optional[SdkPackageRid] | The package rid of the generated SDK.
sdk_package_rid = None
# Optional[SdkVersion] | The version of the generated SDK.
sdk_version = None


try:
    api_response = client.ontologies.AttachmentProperty.read_attachment_by_rid(
        ontology,
        object_type,
        primary_key,
        property,
        attachment_rid,
        sdk_package_rid=sdk_package_rid,
        sdk_version=sdk_version,
    )
    print("The read_attachment_by_rid response:\n")
    pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
    print("HTTP error when calling AttachmentProperty.read_attachment_by_rid: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 bytes Success response. /

[Back to top] [Back to API list] [Back to Model list] [Back to README]