Compare commits

..

No commits in common. "947924bd6d08f20c332eb65b432278fc57608350" and "2f10dcd9fc67767f78946e78a7346c9f6127e896" have entirely different histories.

View File

@ -18,6 +18,13 @@ type Company struct {
StatusHref string `json:"status_href"`
} `json:"_info"`
} `json:"status"`
Type struct {
ID int `json:"id"`
Name string `json:"name"`
Info struct {
TypeHref string `json:"type_href"`
} `json:"_info"`
} `json:"type"`
AddressLine1 string `json:"addressLine1"`
City string `json:"city"`
State string `json:"state"`
@ -29,23 +36,11 @@ type Company struct {
CountryHref string `json:"country_href"`
} `json:"_info"`
} `json:"country"`
PhoneNumber string `json:"phoneNumber"`
FaxNumber string `json:"faxNumber"`
Website string `json:"website"`
Territory struct {
ID int `json:"id"`
Name string `json:"name"`
Info struct {
LocationHref string `json:"location_href"`
} `json:"_info"`
} `json:"territory"`
Market struct {
ID int `json:"id"`
Name string `json:"name"`
Info struct {
MarketHref string `json:"Market_href"`
} `json:"_info"`
} `json:"market"`
PhoneNumber string `json:"phoneNumber"`
FaxNumber string `json:"faxNumber"`
Website string `json:"website"`
TerritoryID int `json:"territoryId"`
MarketID int `json:"marketId"`
AccountNumber string `json:"accountNumber"`
DefaultContact struct {
ID int `json:"id"`
@ -57,20 +52,19 @@ type Company struct {
DateAcquired time.Time `json:"dateAcquired"`
AnnualRevenue float64 `json:"annualRevenue"`
NumberOfEmployees int `json:"numberOfEmployees"`
TimeZoneSetup struct {
TimeZone struct {
ID int `json:"id"`
Name string `json:"name"`
Info struct {
TimeZoneSetupHref string `json:"timeZoneSetup_href"`
} `json:"_info"`
} `json:"timeZoneSetup"`
} `json:"timeZone"`
LeadFlag bool `json:"leadFlag"`
UnsubscribeFlag bool `json:"unsubscribeFlag"`
UserDefinedField1 string `json:"userDefinedField1"`
UserDefinedField2 string `json:"userDefinedField2"`
UserDefinedField3 string `json:"userDefinedField3"`
UserDefinedField4 string `json:"userDefinedField4"`
UserDefinedField5 string `json:"userDefinedField5"`
UserDefinedField7 string `json:"userDefinedField7"`
VendorIdentifier string `json:"vendorIdentifier"`
TaxIdentifier string `json:"taxIdentifier"`
TaxCode struct {
@ -113,8 +107,16 @@ type Company struct {
InvoiceToEmailAddress string `json:"invoiceToEmailAddress"`
DeletedFlag bool `json:"deletedFlag"`
MobileGUID string `json:"mobileGuid"`
TypeIds []int `json:"typeIds"`
Info struct {
Currency struct {
ID int `json:"id"`
Symbol string `json:"symbol"`
IsoCode string `json:"isoCode"`
Name string `json:"name"`
Info struct {
CurrencyHref string `json:"currency_href"`
} `json:"_info"`
} `json:"currency"`
Info struct {
LastUpdated time.Time `json:"lastUpdated"`
UpdatedBy string `json:"updatedBy"`
DateEntered time.Time `json:"dateEntered"`
@ -382,8 +384,6 @@ func (cw *Site) GetCompanyByName(companyName string) (*Company, error) {
return nil, fmt.Errorf("request failed for %s: %s", req.RestAction, err)
}
fmt.Println(string(req.Body))
co := &[]Company{}
err = json.Unmarshal(req.Body, co)
if err != nil {