intercom / intercom-dotnet

Intercom API client library for .NET
https://developers.intercom.io/reference
Apache License 2.0
63 stars 53 forks source link

Company plan doesn't get added to company object correctly. #104

Closed jonnyom closed 6 years ago

jonnyom commented 6 years ago

Using this code:

Company company = companyC.Create(new Company() { company_id = "67", name = "company_name",
                plan = new Plan{ name = "Stop Avengers"}});
            Console.WriteLine(company);

Generates this payload:

"params":{"company_id":"67","name":"company_name","plan":"Stop Avengers","company":{"company_id":"67","name":"company_name","plan":"Stop Avengers"}}

But the plan doesn't appear on the company.

kmossco commented 6 years ago

Thank you for the report @jonnyom! Looking into this!

kmossco commented 6 years ago

@jonnyom I tested this a bit more thoroughly and it seems to be working using this code:

public static void Main(string[] args)
        {
            string TOKEN = "token="; 
            CompanyClient companyClient = new CompanyClient(new Authentication(TOKEN));

            Company company = companyClient.Create(new Company()
            {
                company_id = "jonny_test",
                name = "company_name",
                plan = new Plan(){ name = "thingy" }
            });
        }

This generated the following payload:

"params":{"company_id":"jonny_test","name":"company_name","plan":"thingy","company":{"company_id":"jonny_test","name":"company_name","plan":"thingy"}}

image

It does take a few seconds until it loads in the UI, maybe that was what caused the confusion? In any case, closing this for now as I can't seem to reproduce the problem and this is working right now.