From 538b95f63a8a34939d96152bea443de53940c67a Mon Sep 17 00:00:00 2001 From: pshah Date: Mon, 9 Sep 2019 15:24:31 -0400 Subject: [PATCH 1/3] add google fields to hotel entity --- entity_hotel.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/entity_hotel.go b/entity_hotel.go index 9d74989..3b32915 100644 --- a/entity_hotel.go +++ b/entity_hotel.go @@ -47,6 +47,11 @@ type HotelEntity struct { InstagramHandle *string `json:"instagramHandle,omitempty"` TwitterHandle *string `json:"twitterHandle,omitempty"` + GoogleCoverPhoto **Image `json:"googleCoverPhoto,omitempty"` + GooglePreferredPhoto *string `json:"googlePreferredPhoto,omitempty"` + GoogleProfilePhoto **Image `json:"googleProfilePhoto,omitempty"` + GoogleWebsiteOverride *string `json:"googleWebsiteOverride,omitempty"` + // Media Logo **Photo `json:"logo,omitempty"` PhotoGallery *[]Photo `json:"photoGallery,omitempty"` From 456e8a1b0bbcdbccd5d825aa2189d1b83c3ec493 Mon Sep 17 00:00:00 2001 From: pshah Date: Wed, 11 Sep 2019 16:51:16 -0400 Subject: [PATCH 2/3] modify v2 loc converter to accept hotel --- entity_hotel.go | 1 + location.go | 1 + 2 files changed, 2 insertions(+) diff --git a/entity_hotel.go b/entity_hotel.go index 3b32915..be453f3 100644 --- a/entity_hotel.go +++ b/entity_hotel.go @@ -51,6 +51,7 @@ type HotelEntity struct { GooglePreferredPhoto *string `json:"googlePreferredPhoto,omitempty"` GoogleProfilePhoto **Image `json:"googleProfilePhoto,omitempty"` GoogleWebsiteOverride *string `json:"googleWebsiteOverride,omitempty"` + GoogleAttributes *map[string][]string `json:"googleAttributes,omitempty"` // Media Logo **Photo `json:"logo,omitempty"` diff --git a/location.go b/location.go index dffb4a1..59f8e72 100644 --- a/location.go +++ b/location.go @@ -17,6 +17,7 @@ var LOCATIONTYPE_HEALTHCARE_PROFESSIONAL LocationType = String("HEALTHCARE_PROFE var LOCATIONTYPE_HEALTHCARE_FACILITY LocationType = String("HEALTHCARE_FACILITY") var LOCATIONTYPE_RESTAURANT LocationType = String("RESTAURANT") var LOCATIONTYPE_EVENT LocationType = String("EVENT") +var LOCATIONTYPE_HOTEL LocationType = String("HOTEL") // Location is the representation of a Location in Yext Location Manager. // For details see https://www.yext.com/support/platform-api/#Administration_API/Locations.htm From dee69655dea4f1fb038dc842c71c4edecbaf514b Mon Sep 17 00:00:00 2001 From: pshah Date: Wed, 25 Sep 2019 22:15:41 -0400 Subject: [PATCH 3/3] add GetMultiOptionIds for error handling --- customfield_service.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/customfield_service.go b/customfield_service.go index a746e6c..efd6086 100644 --- a/customfield_service.go +++ b/customfield_service.go @@ -209,6 +209,31 @@ func (c *CustomFieldManager) MustMultiOptionIds(fieldName string, optionNames .. return ToUnorderedStrings(optionIds) } +func (c *CustomFieldManager) GetMultiOptionIds(fieldName string, optionNames ...string) (*UnorderedStrings, error) { + if len(optionNames) == 0 { + return c.NullMultiOption() + } + var optionIds = []string{} + for _, optionName := range optionNames { + id, err := c.CustomFieldOptionId(fieldName, optionName) + if err != nil { + return nil, err + } + shouldAddOptionId := true + for _, optionId := range optionIds { + if id == optionId { // Don't add duplicate option ids + shouldAddOptionId = false + break + } + } + + if shouldAddOptionId { + optionIds = append(optionIds, id) + } + } + return ToUnorderedStrings(optionIds), nil +} + func (c *CustomFieldManager) MustIsMultiOptionSet(fieldName string, optionName string, setOptionIds *UnorderedStrings) bool { if setOptionIds == nil { return false