EasyPost / easypost-csharp

EasyPost Shipping API Client Library for .NET and .NET Framework applications
https://easypost.com/docs/api
MIT License
66 stars 74 forks source link

[Bug]: Code is not accessible in CustomsItem object #567

Closed HottieHotton closed 5 months ago

HottieHotton commented 5 months ago

Software Version

6.4.0

Language Version

8.0.201

Operating System

OS 14.4.1

What happened?

  1. Create a customsItem object
  2. Add the Code field
  3. See the following error appear:
  4. image

What was expected?

Customers are supposed to utilize the Code field for their customsItems objects.

Sample Code

using Newtonsoft.Json;
using EasyPost;
using EasyPost.Models.API;

namespace EasyPostExamples
{
    public class Examples
    {
        public static async Task Main()
        {
            var client = new Client(new ClientConfiguration(""));

            EasyPost.Parameters.CustomsItem.Create parameters = new()
            {
                Description = "T-shirt",
                Quantity = 1,
                Weight = 5,
                Value = 10,
                Code = "23", <----- doesn't work
                HsTariffNumber = "123456",
                OriginCountry = "US"
            };

            CustomsItem customsItem = await client.CustomsItem.Create(parameters);

            Console.WriteLine(JsonConvert.SerializeObject(customsItem, Formatting.Indented));
        }
    }
}

Relevant logs

The error displays on the line `Code` as: 'Create' does not contain a definition for 'Code'