Hi All,
Below code is my request format expected by api
{
utilityProductMatch(sites: [
{
utilityId: "96d83432",
constraints: [
"Commercial"
],
products: [
{
productId: YZZ
existingProductCategory: "test",
equivalentWatts: 500,
operatingHours: 1800,
fixtureType: "test1"
}
]
}
])
{
utilityId
}
}
currently i created request format is below, now i m not able to understand how i can i append my below request on "utilityProductMatch" as mention in above.
{
"sites": [
{
"utilityId": "19dbc535a",
"constraints": {
"commercial": true
},
"products": [
{
"productId": "XYZ",
"existingProductCategory": "test",
"equivalentWatts": 500,
"operatingHours": "1800",
"FixtureType": "Lamp"
}
]
}
]
}
my classes are below to create current request format
- public class GetCreateRequest
- {
- public List<Site> sites { get; set; }
- }
- public class Site
- {
- public string utilityId { get; set; }
- public ProgramConstraints constraints { get; set; }
- public List<Product> products { get; set; }
- }
- public class ProgramConstraints
- {
- public bool commercial
- {
- get;
- set;
- }
- }
- public class Product
- {
- public string productId { get; set; }
- public string existingProductCategory { get; set; }
- public int equivalentWatts { get; set; }
- public string operatingHours { get; set; }
- public string FixtureType { get; set; }
- }
please suggest where i need to change in existing request format, so i will create request format as api expected.