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"` StatusHref string `json:"status_href"`
} `json:"_info"` } `json:"_info"`
} `json:"status"` } `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"` AddressLine1 string `json:"addressLine1"`
City string `json:"city"` City string `json:"city"`
State string `json:"state"` State string `json:"state"`
@ -32,20 +39,8 @@ type Company struct {
PhoneNumber string `json:"phoneNumber"` PhoneNumber string `json:"phoneNumber"`
FaxNumber string `json:"faxNumber"` FaxNumber string `json:"faxNumber"`
Website string `json:"website"` Website string `json:"website"`
Territory struct { TerritoryID int `json:"territoryId"`
ID int `json:"id"` MarketID int `json:"marketId"`
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"`
AccountNumber string `json:"accountNumber"` AccountNumber string `json:"accountNumber"`
DefaultContact struct { DefaultContact struct {
ID int `json:"id"` ID int `json:"id"`
@ -57,20 +52,19 @@ type Company struct {
DateAcquired time.Time `json:"dateAcquired"` DateAcquired time.Time `json:"dateAcquired"`
AnnualRevenue float64 `json:"annualRevenue"` AnnualRevenue float64 `json:"annualRevenue"`
NumberOfEmployees int `json:"numberOfEmployees"` NumberOfEmployees int `json:"numberOfEmployees"`
TimeZoneSetup struct { TimeZone struct {
ID int `json:"id"` ID int `json:"id"`
Name string `json:"name"` Name string `json:"name"`
Info struct { Info struct {
TimeZoneSetupHref string `json:"timeZoneSetup_href"` TimeZoneSetupHref string `json:"timeZoneSetup_href"`
} `json:"_info"` } `json:"_info"`
} `json:"timeZoneSetup"` } `json:"timeZone"`
LeadFlag bool `json:"leadFlag"` LeadFlag bool `json:"leadFlag"`
UnsubscribeFlag bool `json:"unsubscribeFlag"` UnsubscribeFlag bool `json:"unsubscribeFlag"`
UserDefinedField1 string `json:"userDefinedField1"` UserDefinedField1 string `json:"userDefinedField1"`
UserDefinedField2 string `json:"userDefinedField2"` UserDefinedField2 string `json:"userDefinedField2"`
UserDefinedField3 string `json:"userDefinedField3"` UserDefinedField3 string `json:"userDefinedField3"`
UserDefinedField4 string `json:"userDefinedField4"` UserDefinedField7 string `json:"userDefinedField7"`
UserDefinedField5 string `json:"userDefinedField5"`
VendorIdentifier string `json:"vendorIdentifier"` VendorIdentifier string `json:"vendorIdentifier"`
TaxIdentifier string `json:"taxIdentifier"` TaxIdentifier string `json:"taxIdentifier"`
TaxCode struct { TaxCode struct {
@ -113,7 +107,15 @@ type Company struct {
InvoiceToEmailAddress string `json:"invoiceToEmailAddress"` InvoiceToEmailAddress string `json:"invoiceToEmailAddress"`
DeletedFlag bool `json:"deletedFlag"` DeletedFlag bool `json:"deletedFlag"`
MobileGUID string `json:"mobileGuid"` MobileGUID string `json:"mobileGuid"`
TypeIds []int `json:"typeIds"` 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 { Info struct {
LastUpdated time.Time `json:"lastUpdated"` LastUpdated time.Time `json:"lastUpdated"`
UpdatedBy string `json:"updatedBy"` UpdatedBy string `json:"updatedBy"`
@ -382,8 +384,6 @@ func (cw *Site) GetCompanyByName(companyName string) (*Company, error) {
return nil, fmt.Errorf("request failed for %s: %s", req.RestAction, err) return nil, fmt.Errorf("request failed for %s: %s", req.RestAction, err)
} }
fmt.Println(string(req.Body))
co := &[]Company{} co := &[]Company{}
err = json.Unmarshal(req.Body, co) err = json.Unmarshal(req.Body, co)
if err != nil { if err != nil {