From 9fdb1641d96e8feb6afbb0b517e202475b452805 Mon Sep 17 00:00:00 2001 From: Steven Polley Date: Sun, 22 Jul 2018 01:45:09 -0600 Subject: [PATCH] Added OrganizationType Added Metadata --- itglue/organizations.go | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/itglue/organizations.go b/itglue/organizations.go index 641c13e..7b329a9 100644 --- a/itglue/organizations.go +++ b/itglue/organizations.go @@ -30,9 +30,9 @@ type OrganizationTypeData struct { } `json:"links"` } -//OrganizationInternalData contains the schema of an Organization in IT Glue without the "data" wrapper. +//OrganizationData contains the schema of an Organization in IT Glue without the "data" wrapper. //This allows us to reuse the schema when data is either a JSON object or an array, depending on what results are returned -type OrganizationInternalData struct { +type OrganizationData struct { ID string `json:"id"` Type string `json:"type"` Attributes struct { @@ -52,12 +52,24 @@ type OrganizationInternalData struct { //Organization contains a single Organization type Organization struct { - Data struct{ OrganizationInternalData } `json:"data"` + Data struct{ OrganizationData } `json:"data"` + Meta struct{ Metadata } `json:"metadata"` } //OrganizationList contains a slice of Organizations type OrganizationList struct { - Data []struct{ OrganizationInternalData } `json:"data"` + Data []struct{ OrganizationData } `json:"data"` + Meta struct{ Metadata } `json:"metadata"` +} + +type OrganizationType struct { + Data struct{ OrganizationTypeData } `json:"data"` + Meta struct{ Metadata } `json:"metadata"` +} + +type OrganizationTypeList struct { + Data []struct{ OrganizationTypeData } `json:"data"` + Meta struct{ Metadata } `json:"metadata"` } ///organization_types