Skip to content

Conversation

tylerwarner33
Copy link
Contributor

@tylerwarner33 tylerwarner33 commented Aug 26, 2025

Reason

The reason for this change is to add 'UserDefinedMetadata' to an OSS Object using the existing methods of the SDK.

Parameters

Below are available parameters on the 'CompleteSignedS3UploadAsync()'.

  • xAdsMetaContentType = The Content-Type value for the uploaded object to record within OSS. (optional)
  • xAdsMetaContentDisposition = The Content-Disposition value for the uploaded object to record within OSS. (optional)
  • xAdsMetaContentEncoding = The Content-Encoding value for the uploaded object to record within OSS. (optional)
  • xAdsMetaCacheControl = The Cache-Control value for the uploaded object to record within OSS. (optional)
  • xAdsUserDefinedMetadata = Custom metadata to be stored with the object, which can be retrieved later on download or when retrieving object details. Must be a JSON object that is less than 100 bytes. (optional)

Existing Methods

The 'CompleteSignedS3UploadAsync()' method already has the above parameters and is used within the 'Upload()' method.

The 'GetObjectDetailsAsync()' method already has the 'With' parameter in place to allow for the retrieval of the metadata after adding it to an object.

Changed Methods

Added parameters to the 'Upload()' method so they can be passed to the 'CompleteSignedS3UploadAsync()' method.

Added parameters to the 'UploadObjectAsync()' method so they can be passed to the 'Upload()' method.

Added parameters to the 'UploadObjectAsync()' (stream) method so they can be passed to the 'Upload()' method.

Testing

string xAdsMetaContentType = "application/json";
string xAdsUserDefinedMetadata = System.Text.Json.JsonSerializer.Serialize(new
{
  id= "123ABC",
  name = "Test Example",
  building = new { level = new { height = 10 } }
});

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for custom metadata parameters (xAdsMeta properties) to the OSS object upload methods in the SDK. The change enables users to specify metadata like content type, content disposition, content encoding, cache control, and user-defined metadata when uploading objects.

  • Adds five new optional parameters to upload methods for metadata control
  • Updates method signatures across the upload chain from public API to internal implementation
  • Includes test coverage for the new metadata parameters

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
oss/source/custom-code/OssClient.cs Adds metadata parameters to both UploadObjectAsync method overloads and passes them through to the file transfer layer
oss/source/custom-code/OSSFileTransfer.cs Updates Upload method signature to accept metadata parameters and passes them to CompleteSignedS3UploadAsync
oss/source/custom-code/IOSSFileTransfer.cs Updates interface definition to include the new metadata parameters
oss/test/TestOss.cs Adds test environment variables for metadata and creates new test method for stream upload with metadata parameters

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@srivastavarahull
Copy link
Contributor

Hi @tylerwarner33, Thanks for the PR we are looking into it.

@srivastavarahull srivastavarahull changed the base branch from main to DAS-358-add-xAdsMeta-propertites-to-upload September 17, 2025 06:17
@srivastavarahull srivastavarahull merged commit 972f0ac into autodesk-platform-services:DAS-358-add-xAdsMeta-propertites-to-upload Sep 17, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants