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 diff --git a/entity_hotel.go b/entity_hotel.go index 1c29cc8..b1891a2 100644 --- a/entity_hotel.go +++ b/entity_hotel.go @@ -47,11 +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"` - GoogleAttributes *map[string][]string `json:"googleAttributes,omitempty"` + GoogleCoverPhoto **Image `json:"googleCoverPhoto,omitempty"` + 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"`