Documentation ¶
Overview ¶
Package yext provides bindings for Yext Location Cloud APIs.
For full documentation visit http://developer.yext.com/docs/api-reference/
Usage ¶
Create an authenticated client (requires an API key)
client := yext.NewClient(yext.NewDefaultConfig().WithApiKey("[API KEY]"))
List all locations
locs, err := client.LocationService.ListAll()
Fetch a single location
loc, _, err := client.LocationService.Get("JB-01")
Create a new location (see full documentation for required fields)
loc := &yext.Location{ Id: yext.String("JB-02"), Name: yext.String("Joe's Bake Shop"), } loc, err := client.LocationService.Create(loc)
Edit an existing location
loc := &yext.Location{ Id: yext.String("JB-02"), Name: yext.String("Joe's Pastry Emporium"), } loc, err := client.LocationService.Edit(loc)
Configuration ¶
The behavior of the API client can be controlled with a Config instance. The Config type exposes chainable utility methods to make construction simpler.
// Config with sane settings (prod host, 3 retries) yext.NewDefaultConfig() // Set authentication parameters yext.NewDefaultConfig().WithApiKey("[API KEY]") // Set authentication parameters from environment: $YEXT_API_KEY (required) and $YEXT_API_ACCOUNTID (optional) yext.NewDefaultConfig().WithEnvCredentials() // Communicate with the Yext Sandbox yext.NewConfig().WithSandboxHost()
By default, clients will retry API requests up to 3 times in the case of non-4xx errors including HTTP transport, 5xx responses, etc. This can be modified via Config:
// No retries yext.NewDefaultConfig().WithRetries(0)
Models ¶
In order to support partial object updates, many of the struct attributes are represented as pointers in order to differentiate between "not-present" and "zero-valued". Helpers are provided to make it easier to work with the pointers:
l := &yext.Location{ Id: yext.String("JB-01"), SuppressAddress: yext.Bool(true), DisplayLat: yext.Float(38.813), Keywords: yext.Strings([]string{"pastries", "bakery", "food"}) }
In addition, accessors are provided to make extracting data from the model objects simpler:
l.GetId() // => "JB-01" l.GetSuppressAddress() // => true l.GetDisplayLat() // => 38.813 l.GetKeywords() // => ["pastries", "bakery", "food"]
Error handling ¶
Errors returned from the API are surfaced as Errors objects. The Errors object is comprised of a list of errors, each with a Message, Code, and Type. A full list of expected errors can be found here: http://developer.yext.com/support/error-messages/
_, _, err := client.LocationService.Create(&yext.Location{}) // yext.Errors([{"code": "2068", message": "location.phone: The field location.phone is required", type: "FATAL_ERROR"}])
Response Metadata ¶
Most functions that interact with the API will return at least two parameters - a yext.Response object and an error. Response contains a Meta substructure that in turn has a UUID and Errors attribute. The UUID can be used to look up individual requests in the developer.yext.com portal, useful for debugging requests.
locs, resp, err := client.LocationService.List(nil) resp.Meta.UUID // "a219023e-d090-4e4e-9732-b823e9b66c8a"
Services ¶
Most of the functionality within the API is exposed via domain-specific services available under the `Client` object. For example, if you are interacting with Locations, use the Client instance's LocationService. If you need to interact with Users, you'd use the UserService.
- CategoryService
- CustomFieldService
- ListService
- FolderService
- LocationService
- UserService
Each service provides a set of common data-access functions that you can use to interact with objects under the service's domain.
Get() // Fetch by known ID List() // Fetch all (or first page in paged endpoints) ListAll() // Available in paged endpoints Edit() // Update and return API version Create() // Create and return API version
Where appropriate, services will expose additional, domain-specific functionality.
Index ¶
- Constants
- Variables
- func BioItemCompare(itemA Bio, itemB Bio) bool
- func Bool(v bool) *bool
- func ConvertBetweenFormats(hours string, convertFromFormat string, convertToFormat string) (string, error)
- func Float(v float64) *float64
- func HoursAreEquivalent(a, b string) bool
- func Int(v int) *int
- func IsErrorCode(err error, code int) bool
- func IsNotFoundError(err error) bool
- func Must(err error)
- func ParseAndFormatHours(tFormat string, openHours string, closeHours string) (string, error)
- func ParseCustomFields(cfraw map[string]interface{}, cfs []*CustomField) (map[string]interface{}, error)
- func ParseOpenAndCloseHoursFromString(hours string) (string, string, error)
- func String(v string) *string
- func Strings(v []string) *[]string
- func ToHolidayHours(v []HolidayHours) *[]HolidayHours
- type ACL
- type ACLList
- type AccessOn
- type AnalyticsData
- func (y AnalyticsData) GetAverageRating() float64
- func (y AnalyticsData) GetBingSearches() int
- func (y AnalyticsData) GetDuplicatesDetected() int
- func (y AnalyticsData) GetDuplicatesSuppressed() int
- func (y AnalyticsData) GetFacebookCheckins() int
- func (y AnalyticsData) GetFacebookCtaClicks() int
- func (y AnalyticsData) GetFacebookImpressions() int
- func (y AnalyticsData) GetFacebookLikes() int
- func (y AnalyticsData) GetFacebookPageViews() int
- func (y AnalyticsData) GetFacebookPostImpressions() int
- func (y AnalyticsData) GetFacebookTalkingAbout() int
- func (y AnalyticsData) GetFacebookWereHere() int
- func (y AnalyticsData) GetFeaturedMessageClicks() int
- func (y AnalyticsData) GetFoursquareDailyCheckins() int
- func (y AnalyticsData) GetGoogleCustomerActions() int
- func (y AnalyticsData) GetGoogleMapViews() int
- func (y AnalyticsData) GetGooglePhoneCalls() int
- func (y AnalyticsData) GetGoogleSearchQueries() int
- func (y AnalyticsData) GetGoogleSearchViews() int
- func (y AnalyticsData) GetInstagramPosts() int
- func (y AnalyticsData) GetIstAverageFirstLocalPackMatchPosition() float64
- func (y AnalyticsData) GetIstAverageFirstMatchPosition() float64
- func (y AnalyticsData) GetIstAverageFirstOrganicMatchPosition() float64
- func (y AnalyticsData) GetIstAverageLocalPackNumberOfResults() float64
- func (y AnalyticsData) GetIstAverageLocalPackPosition() float64
- func (y AnalyticsData) GetIstKnowledgeCardExisted() float64
- func (y AnalyticsData) GetIstLocalPackExisted() float64
- func (y AnalyticsData) GetIstLocalPackPresence() float64
- func (y AnalyticsData) GetIstLocalPackShareOfSearch() float64
- func (y AnalyticsData) GetIstMatchesPerSearch() int
- func (y AnalyticsData) GetIstOrganicShareOfSearch() float64
- func (y AnalyticsData) GetIstSearchRequests() int
- func (y AnalyticsData) GetIstShareOfIntelligentSearch() float64
- func (y AnalyticsData) GetListingsLive() int
- func (y AnalyticsData) GetLocationId() string
- func (y AnalyticsData) GetMonth() string
- func (y AnalyticsData) GetNewReviews() int
- func (y AnalyticsData) GetPowerlistingsLive() int
- func (y AnalyticsData) GetProfileUpdates() int
- func (y AnalyticsData) GetProfileViews() int
- func (y AnalyticsData) GetPublisherSuggestions() int
- func (y AnalyticsData) GetSearches() int
- func (y AnalyticsData) GetSocialActivities() int
- func (y AnalyticsData) GetStorepagesCalltoactionclicks() int
- func (y AnalyticsData) GetStorepagesClickstowebsite() int
- func (y AnalyticsData) GetStorepagesDrivingdirections() int
- func (y AnalyticsData) GetStorepagesEventEventtype() int
- func (y AnalyticsData) GetStorepagesPageviews() int
- func (y AnalyticsData) GetStorepagesPhonecalls() int
- func (y AnalyticsData) GetStorepagesSessions() int
- func (y AnalyticsData) GetYelpCustomerActions() int
- func (y AnalyticsData) GetYelpPageViews() int
- type AnalyticsFilters
- type AnalyticsReportRequest
- type AnalyticsReportResponse
- type AnalyticsService
- type Asset
- type AssetListResponse
- type AssetService
- func (a *AssetService) Create(asset *Asset) (*Response, error)
- func (a *AssetService) Delete(assetId string) (*Response, error)
- func (a *AssetService) Get(assetId string) (*Asset, *Response, error)
- func (a *AssetService) List(opts *ListOptions) (*AssetListResponse, *Response, error)
- func (a *AssetService) ListAll() ([]*Asset, error)
- func (a *AssetService) Update(assetId string, asset *Asset) (*Response, error)
- type AssetType
- type BackoffPolicy
- type Bio
- type BioList
- type BioListSection
- type BioListsResponse
- type Calories
- type Category
- type CategoryListOptions
- type CategoryService
- type Client
- func (c *Client) Do(req *http.Request, v interface{}) (*Response, error)
- func (c *Client) DoRequest(method string, path string, v interface{}) (*Response, error)
- func (c *Client) DoRequestJSON(method string, path string, obj interface{}, v interface{}) (*Response, error)
- func (c *Client) DoRootRequest(method string, path string, v interface{}) (*Response, error)
- func (c *Client) DoRootRequestJSON(method string, path string, obj interface{}, v interface{}) (*Response, error)
- func (c *Client) NewAccountRequestBody(method string, path string, data []byte) (*http.Request, error)
- func (c *Client) NewRequest(method string, path string) (*http.Request, error)
- func (c *Client) NewRequestBody(method string, fullPath string, data []byte) (*http.Request, error)
- func (c *Client) NewRequestJSON(method string, path string, obj interface{}) (*http.Request, error)
- func (c *Client) NewRootRequest(method string, path string) (*http.Request, error)
- func (c *Client) NewRootRequestBody(method string, path string, data []byte) (*http.Request, error)
- func (c *Client) NewRootRequestJSON(method string, path string, obj interface{}) (*http.Request, error)
- type Comment
- func (y Comment) GetAuthorEmail() string
- func (y Comment) GetAuthorName() string
- func (y Comment) GetAuthorRole() string
- func (y Comment) GetContent() string
- func (y Comment) GetId() int
- func (y Comment) GetParentId() int
- func (y Comment) GetPublisherDate() int
- func (y Comment) GetVisibility() string
- type Comparable
- type Config
- func (c *Config) WithAccountId(id string) *Config
- func (c *Config) WithApiKey(apikey string) *Config
- func (c *Config) WithBaseUrl(baseUrl string) *Config
- func (c *Config) WithEnvCredentials() *Config
- func (c *Config) WithHTTPClient(client *http.Client) *Config
- func (c *Config) WithHost(host string) *Config
- func (c *Config) WithLogger(l Logger) *Config
- func (c *Config) WithMockClock() *Config
- func (c *Config) WithProductionHost() *Config
- func (c *Config) WithRateLimitRetry() *Config
- func (c *Config) WithRetries(r int) *Config
- func (c *Config) WithSandboxHost() *Config
- func (c *Config) WithStdLogger() *Config
- func (c *Config) WithTodaysVersion() *Config
- func (c *Config) WithVersion(v string) *Config
- type Content
- type Cost
- type CostOptions
- type CustomField
- type CustomFieldManager
- func (c *CustomFieldManager) CustomField(name string) (*CustomField, error)
- func (c *CustomFieldManager) CustomFieldId(name string) (string, error)
- func (c *CustomFieldManager) CustomFieldName(id string) (string, error)
- func (c *CustomFieldManager) CustomFieldOptionId(fieldName, optionName string) (string, error)
- func (c *CustomFieldManager) CustomFieldOptionName(cfName string, optionId string) (string, error)
- func (c *CustomFieldManager) CustomFieldOptionNames(cfName string, optionIds []string) ([]string, error)
- func (c *CustomFieldManager) Get(name string, loc *Location) (interface{}, error)
- func (c *CustomFieldManager) GetBool(name string, loc *Location) (bool, error)
- func (c *CustomFieldManager) GetString(name string, loc *Location) (string, error)
- func (c *CustomFieldManager) GetStringSlice(name string, loc *Location) ([]string, error)
- func (c *CustomFieldManager) IsOptionSet(fieldName string, optionName string, loc *Location) (bool, error)
- func (c *CustomFieldManager) MustCustomField(name string) *CustomField
- func (c *CustomFieldManager) MustCustomFieldId(name string) string
- func (c *CustomFieldManager) MustCustomFieldName(id string) string
- func (c *CustomFieldManager) MustCustomFieldOptionId(fieldName, optionName string) string
- func (c *CustomFieldManager) MustCustomFieldOptionName(fieldName, optionId string) string
- func (c *CustomFieldManager) MustGet(name string, loc *Location) interface{}
- func (c *CustomFieldManager) MustGetBool(name string, loc *Location) bool
- func (c *CustomFieldManager) MustGetString(name string, loc *Location) string
- func (c *CustomFieldManager) MustGetStringSlice(name string, loc *Location) []string
- func (c *CustomFieldManager) MustIsOptionSet(fieldName string, optionName string, loc *Location) bool
- func (c *CustomFieldManager) MustSet(name string, value CustomFieldValue, loc *Location) *Location
- func (c *CustomFieldManager) MustSetBool(name string, value bool, loc *Location)
- func (c *CustomFieldManager) MustSetOption(fieldName string, optionName string, loc *Location) *Location
- func (c *CustomFieldManager) MustSetString(name string, value string, loc *Location)
- func (c *CustomFieldManager) MustSetStringSlice(name string, value []string, loc *Location)
- func (c *CustomFieldManager) MustUnsetOption(fieldName string, optionName string, loc *Location) *Location
- func (c *CustomFieldManager) Set(name string, value CustomFieldValue, loc *Location) (*Location, error)
- func (c *CustomFieldManager) SetBool(name string, value bool, loc *Location) error
- func (c *CustomFieldManager) SetOption(fieldName string, optionName string, loc *Location) (*Location, error)
- func (c *CustomFieldManager) SetPhoto(name string, v *Photo, loc *Location) error
- func (c *CustomFieldManager) SetString(name string, value string, loc *Location) error
- func (c *CustomFieldManager) SetStringSlice(name string, value []string, loc *Location) error
- func (c *CustomFieldManager) UnsetOption(fieldName string, optionName string, loc *Location) (*Location, error)
- func (c *CustomFieldManager) UnsetPhoto(name string, loc *Location) error
- type CustomFieldOption
- type CustomFieldResponse
- type CustomFieldService
- func (s *CustomFieldService) CacheCustomFields() ([]*CustomField, error)
- func (s *CustomFieldService) Create(cf *CustomField) (*Response, error)
- func (s *CustomFieldService) Delete(customFieldId string) (*Response, error)
- func (s *CustomFieldService) Edit(cf *CustomField) (*Response, error)
- func (s *CustomFieldService) List(opts *ListOptions) (*CustomFieldResponse, *Response, error)
- func (s *CustomFieldService) ListAll() ([]*CustomField, error)
- func (s *CustomFieldService) MustCacheCustomFields() []*CustomField
- type CustomFieldType
- type CustomFieldValue
- type DailyTimes
- type Date
- type Error
- type ErrorType
- type Errors
- type Event
- type EventList
- type EventListSection
- type EventListsResponse
- type Folder
- type FolderListResponse
- type FolderService
- type ForLocations
- type Gallery
- type GoogleAttribute
- type GoogleAttributes
- type HolidayHours
- type Hours
- type HoursHelper
- func (h *HoursHelper) AppendHours(weekday Weekday, hours string)
- func (h *HoursHelper) GetHours(weekday Weekday) []string
- func (h *HoursHelper) HoursAreAllUnspecified() bool
- func (h *HoursHelper) HoursAreClosed(weekday Weekday) bool
- func (h *HoursHelper) HoursAreOpen24Hours(weekday Weekday) bool
- func (h *HoursHelper) HoursAreUnspecified(weekday Weekday) bool
- func (h *HoursHelper) MustToStringSlice() []string
- func (h *HoursHelper) Serialize() string
- func (h *HoursHelper) SerializeDay(weekday Weekday) string
- func (h *HoursHelper) SetClosed(weekday Weekday)
- func (h *HoursHelper) SetHours(weekday Weekday, hours []string)
- func (h *HoursHelper) SetOpen24Hours(weekday Weekday)
- func (h *HoursHelper) SetUnspecified(weekday Weekday)
- func (h HoursHelper) ToMap() map[Weekday][]string
- func (h *HoursHelper) ToStringSlice() ([]string, error)
- type LabelOperator
- type LanguageProfile
- type LanguageProfileListResponse
- type LanguageProfileService
- func (l *LanguageProfileService) Delete(id string, languageCode string) (*Response, error)
- func (l *LanguageProfileService) Get(id string, languageCode string) (*LanguageProfile, *Response, error)
- func (l *LanguageProfileService) GetAll(id string) (*LanguageProfileListResponse, *Response, error)
- func (l *LanguageProfileService) HydrateLocations(languageProfiles []*LanguageProfile) ([]*LanguageProfile, error)
- func (l *LanguageProfileService) Upsert(y *LanguageProfile, languageCode string) (*Response, error)
- type List
- type ListItem
- type ListOptions
- type ListPhoto
- type ListSection
- type ListService
- func (e *ListService) CreateBioList(y *BioList) (*Response, error)
- func (e *ListService) CreateEventList(y *EventList) (*Response, error)
- func (e *ListService) CreateMenuList(y *MenuList) (*Response, error)
- func (e *ListService) CreateProductList(y *ProductList) (*Response, error)
- func (e *ListService) DeleteBioList(id string) (*Response, error)
- func (e *ListService) DeleteEventList(id string) (*Response, error)
- func (e *ListService) DeleteMenuList(id string) (*Response, error)
- func (e *ListService) DeleteProductList(id string) (*Response, error)
- func (e *ListService) EditBioList(y *BioList) (*BioList, *Response, error)
- func (e *ListService) EditEventList(y *EventList) (*EventList, *Response, error)
- func (e *ListService) EditMenuList(y *MenuList) (*MenuList, *Response, error)
- func (e *ListService) EditProductList(y *ProductList) (*ProductList, *Response, error)
- func (e *ListService) GetBioList(id string) (*BioList, *Response, error)
- func (e *ListService) GetEventList(id string) (*EventList, *Response, error)
- func (e *ListService) GetMenuList(id string) (*MenuList, *Response, error)
- func (e *ListService) GetProductList(id string) (*ProductList, *Response, error)
- func (e *ListService) ListAllBioLists() ([]*BioList, error)
- func (e *ListService) ListAllEventLists() ([]*EventList, error)
- func (e *ListService) ListAllMenuLists() ([]*MenuList, error)
- func (e *ListService) ListAllProductLists() ([]*ProductList, error)
- func (e *ListService) ListBioLists(opts *ListOptions) (*BioListsResponse, *Response, error)
- func (e *ListService) ListEventLists(opts *ListOptions) (*EventListsResponse, *Response, error)
- func (e *ListService) ListMenuLists(opts *ListOptions) (*MenuListsResponse, *Response, error)
- func (e *ListService) ListProductLists(opts *ListOptions) (*ProductListsResponse, *Response, error)
- type ListType
- type Location
- func (y Location) Diff(b *Location) (d *Location, diff bool)
- func (y Location) GetAcceptingNewPatients() bool
- func (y Location) GetAccountId() string
- func (y Location) GetAdditionalHoursText() string
- func (y Location) GetAddress() string
- func (y Location) GetAddress2() string
- func (y Location) GetAdmittingHospitals() (v []string)
- func (y Location) GetAlternatePhone() string
- func (y Location) GetAssociations() (v []string)
- func (y Location) GetBioListIds() (v []string)
- func (y Location) GetBrands() (v []string)
- func (y Location) GetCategoryIds() (v []string)
- func (y Location) GetCertifications() []string
- func (y Location) GetCity() string
- func (y Location) GetCountryCode() string
- func (y Location) GetDegrees() []string
- func (y Location) GetDescription() string
- func (y Location) GetDisplayAddress() string
- func (y Location) GetDisplayLat() float64
- func (y Location) GetDisplayLng() float64
- func (y Location) GetDisplayWebsiteUrl() string
- func (y Location) GetEmails() (v []string)
- func (y Location) GetEventListIds() (v []string)
- func (y Location) GetFacebookPageUrl() string
- func (y Location) GetFaxPhone() string
- func (y Location) GetFeaturedMessage() string
- func (y Location) GetFeaturedMessageUrl() string
- func (y Location) GetFirstName() string
- func (y Location) GetFirstPartyReviewPage() string
- func (y Location) GetFolderId() string
- func (y Location) GetGender() string
- func (y Location) GetGoogleAttributes() GoogleAttributes
- func (y Location) GetHolidayHours() []HolidayHours
- func (y Location) GetHours() string
- func (y Location) GetISORegionCode() string
- func (y Location) GetId() string
- func (y Location) GetIsPhoneTracked() bool
- func (y Location) GetKeywords() (v []string)
- func (y Location) GetLabelIds() (v UnorderedStrings)
- func (y Location) GetLanguage() (v string)
- func (y Location) GetLanguages() (v []string)
- func (y Location) GetLastName() string
- func (y Location) GetLocalPhone() string
- func (y Location) GetLocationType() string
- func (y Location) GetMenuListIds() (v []string)
- func (y Location) GetMiddleName() string
- func (y Location) GetMobilePhone() string
- func (y Location) GetNPI() string
- func (y Location) GetName() string
- func (y Location) GetOfficeName() string
- func (y Location) GetPaymentOptions() (v []string)
- func (y Location) GetPhone() string
- func (y Location) GetProductListIds() (v []string)
- func (y Location) GetReservationUrl() string
- func (y Location) GetReviewBalancingURL() string
- func (y Location) GetRoutableLat() float64
- func (y Location) GetRoutableLng() float64
- func (y Location) GetServices() (v []string)
- func (y Location) GetSpecialties() (v []string)
- func (y Location) GetState() string
- func (y Location) GetSuppressAddress() bool
- func (y Location) GetTollFreePhone() string
- func (y Location) GetTtyPhone() string
- func (y Location) GetTwitterHandle() string
- func (y Location) GetVideoUrls() (v []string)
- func (y Location) GetWebsiteUrl() string
- func (y Location) GetYearEstablished() string
- func (y Location) GetZip() string
- func (y Location) IsClosed() bool
- func (y *Location) SetLabelIds(v []string)
- func (y *Location) SetLabelIdsWithUnorderedStrings(v UnorderedStrings)
- func (y Location) String() string
- type LocationClosed
- type LocationList
- type LocationListOptions
- type LocationListResponse
- type LocationPhoto
- type LocationService
- func (l *LocationService) Create(y *Location) (*Response, error)
- func (l *LocationService) Edit(y *Location) (*Response, error)
- func (l *LocationService) Get(id string) (*Location, *Response, error)
- func (l *LocationService) GetWithOptions(id string, llopts *LocationListOptions) (*Location, *Response, error)
- func (l *LocationService) HydrateLocations(locs []*Location) ([]*Location, error)
- func (l *LocationService) List(llopts *LocationListOptions) (*LocationListResponse, *Response, error)
- func (l *LocationService) ListAll(llopts *LocationListOptions) ([]*Location, error)
- func (l *LocationService) ListBySearchId(searchId string) ([]*Location, error)
- type Logger
- type Menu
- type MenuList
- type MenuListSection
- type MenuListsResponse
- type Meta
- type MultiLineText
- type MultiOption
- type Number
- type OptionField
- type Photo
- type Product
- type ProductList
- type ProductListSection
- type ProductListsResponse
- type Response
- type Review
- func (y Review) GetAuthorEmail() string
- func (y Review) GetAuthorName() string
- func (y Review) GetComments() (v []Comment)
- func (y Review) GetContent() string
- func (y Review) GetExternalId() string
- func (y Review) GetId() int
- func (y Review) GetLabelIds() (v []int)
- func (y Review) GetLastYextUpdateDate() int
- func (y Review) GetLocationId() string
- func (y Review) GetPublisherDate() int
- func (y Review) GetPublisherId() string
- func (y Review) GetRating() float64
- func (y Review) GetReviewLabels() (v []ReviewLabel)
- func (y Review) GetStatus() string
- func (y Review) GetTitle() string
- func (y Review) GetURL() string
- type ReviewCreateInvitationResponse
- type ReviewLabel
- type ReviewListOptions
- type ReviewListResponse
- type ReviewService
- func (l *ReviewService) CreateInvitation(jsonData []Reviewer) (*[]ReviewCreateInvitationResponse, *Response, error)
- func (l *ReviewService) Get(id int) (*Review, *Response, error)
- func (l *ReviewService) List(opts *ReviewListOptions) (*ReviewListResponse, *Response, error)
- func (l *ReviewService) ListAll() ([]*Review, error)
- func (l *ReviewService) ListAllWithOptions(rlOpts *ReviewListOptions) ([]*Review, error)
- type Reviewer
- type Role
- type RolesListResponse
- type SingleLineText
- type SingleOption
- type TextList
- type UnorderedStrings
- type Url
- type User
- func (u *User) Copy() (n *User)
- func (a *User) Diff(b *User) (d *User, diff bool)
- func (u *User) GetEmailAddress() string
- func (u *User) GetFirstName() string
- func (u *User) GetId() string
- func (u *User) GetLastName() string
- func (u *User) GetPassword() string
- func (u *User) GetPhoneNumber() string
- func (u *User) GetSSO() bool
- func (u *User) GetUserName() string
- func (u *User) String() string
- type UserListResponse
- type UserService
- func (u *UserService) Create(y *User) (*Response, error)
- func (u *UserService) Delete(y *User) (*Response, error)
- func (u *UserService) Edit(y *User) (*Response, error)
- func (u *UserService) Get(id string) (*User, *Response, error)
- func (u *UserService) List(opts *ListOptions) (*UserListResponse, *Response, error)
- func (u *UserService) ListAll() ([]*User, error)
- func (u *UserService) ListRoles() (*RolesListResponse, *Response, error)
- func (u *UserService) NewAccountACL(r Role) ACL
- func (u *UserService) NewFolderACL(f *Folder, r Role) ACL
- func (u *UserService) NewLocationACL(l *Location, r Role) ACL
- type Video
- type VideoGallery
- type Weekday
- type YesNo
Constants ¶
const ( ACCESS_ACCOUNT = AccessOn("ACCOUNT") ACCESS_FOLDER = AccessOn("FOLDER") ACCESS_LOCATION = AccessOn("LOCATION") )
const ( SandboxHost string = "api-sandbox.yext.com" ProductionHost string = "api.yext.com" AccountId string = "me" Version string = "20180226" )
const ( CUSTOMFIELDTYPE_YESNO = "BOOLEAN" CUSTOMFIELDTYPE_SINGLELINETEXT = "TEXT" CUSTOMFIELDTYPE_MULTILINETEXT = "MULTILINE_TEXT" CUSTOMFIELDTYPE_SINGLEOPTION = "SINGLE_OPTION" CUSTOMFIELDTYPE_URL = "URL" CUSTOMFIELDTYPE_DATE = "DATE" CUSTOMFIELDTYPE_NUMBER = "NUMBER" CUSTOMFIELDTYPE_MULTIOPTION = "MULTI_OPTION" CUSTOMFIELDTYPE_TEXTLIST = "TEXT_LIST" CUSTOMFIELDTYPE_PHOTO = "PHOTO" CUSTOMFIELDTYPE_GALLERY = "GALLERY" CUSTOMFIELDTYPE_VIDEO = "VIDEO" CUSTOMFIELDTYPE_HOURS = "HOURS" CUSTOMFIELDTYPE_DAILYTIMES = "DAILY_TIMES" CUSTOMFIELDTYPE_LOCATIONLIST = "LOCATION_LIST" )
const ( ErrorTypeFatal = "FATAL_ERROR" ErrorTypeNonFatal = "NON_FATAL_ERROR" ErrorTypeWarning = "WARNING" )
const ( HoursClosedAllWeek = "1:closed,2:closed,3:closed,4:closed,5:closed,6:closed,7:closed" HoursOpen24Hours = "00:00:00:00" HoursClosed = "closed" )
const (
ACCOUNTS_PATH string = "accounts"
)
Variables ¶
var AssetListMaxLimit = 1000
var CustomFieldListMaxLimit = 1000
var DefaultBackoffPolicy = BackoffPolicy{ []int{0, 0, 1000, 5000}, }
Default is a backoff policy ranging up to 5 seconds.
var (
FolderListMaxLimit = 1000
)
var (
ListListMaxLimit = 50
)
var (
LocationListMaxLimit = 50
)
var (
ReviewListMaxLimit = 50
)
var (
UnsetPhotoValue = (*Photo)(nil)
)
var UserListMaxLimit = 50
Functions ¶
func BioItemCompare ¶
func ConvertBetweenFormats ¶
func HoursAreEquivalent ¶
func IsErrorCode ¶
func IsNotFoundError ¶
func ParseAndFormatHours ¶
func ParseCustomFields ¶
func ParseCustomFields(cfraw map[string]interface{}, cfs []*CustomField) (map[string]interface{}, error)
func ToHolidayHours ¶
func ToHolidayHours(v []HolidayHours) *[]HolidayHours
Types ¶
type ACL ¶
type ACL struct { Role On string `json:"on,omitempty"` AccessOn AccessOn `json:"onType"` AccountId string `json:"accountId"` }
func (ACL) Diff ¶
Diff calculates the differences between a base ACL (a) and a second ACL (b). The result returned is an ACL object with only parameters that are strictly different.
type AnalyticsData ¶
type AnalyticsData struct { ProfileViews *int `json:"Profile Views"` Searches *int `json:"Searches"` PowerlistingsLive *int `json:"Powerlistings Live"` FeaturedMessageClicks *int `json:"Featured Message Clicks"` YelpPageViews *int `json:"Yelp Page Views"` BingSearches *int `json:"Bing Searches"` FacebookLikes *int `json:"Facebook Likes"` FacebookTalkingAbout *int `json:"Facebook Talking About"` FacebookWereHere *int `json:"Facebook Were Here"` FacebookCtaClicks *int `json:"Facebook Cta Clicks"` FacebookImpressions *int `json:"Facebook Impressions"` FacebookCheckins *int `json:"Facebook Checkins"` FacebookPageViews *int `json:"Facebook Page Views"` FacebookPostImpressions *int `json:"Facebook Post Impressions"` FoursquareDailyCheckins *int `json:"Foursquare Daily Checkins"` InstagramPosts *int `json:"Instagram Posts"` GoogleSearchQueries *int `json:"Google Search Queries"` GoogleSearchViews *int `json:"Google Search Views"` GoogleMapViews *int `json:"Google Map Views"` GoogleCustomerActions *int `json:"Google Customer Actions"` GooglePhoneCalls *int `json:"Google Phone Calls"` YelpCustomerActions *int `json:"Yelp Customer Actions"` AverageRating *float64 `json:"Average Rating"` NewReviews *int `json:"New Reviews"` StorepagesSessions *int `json:"Storepages Sessions"` StorepagesPageviews *int `json:"Storepages Pageviews"` StorepagesDrivingdirections *int `json:"Storepages Drivingdirections"` StorepagesPhonecalls *int `json:"Storepages Phonecalls"` StorepagesCalltoactionclicks *int `json:"Storepages Calltoactionclicks"` StorepagesClickstowebsite *int `json:"Storepages Clickstowebsite"` StorepagesEventEventtype *int `json:"Storepages Event Eventtype"` ProfileUpdates *int `json:"Profile Updates"` PublisherSuggestions *int `json:"Publisher Suggestions"` SocialActivities *int `json:"Social Activities"` DuplicatesSuppressed *int `json:"Duplicates Suppressed"` DuplicatesDetected *int `json:"Duplicates Detected"` ListingsLive *int `json:"Listings Live"` IstSearchRequests *int `json:"Ist Search Requests"` IstAverageLocalPackPosition *float64 `json:"Ist Average Local Pack Position"` IstAverageLocalPackNumberOfResults *float64 `json:"Ist Average Local Pack Number Of Results"` IstLocalPackExisted *float64 `json:"Ist Local Pack Existed"` IstLocalPackPresence *float64 `json:"Ist Local Pack Presence"` IstKnowledgeCardExisted *float64 `json:"Ist Knowledge Card Existed"` IstMatchesPerSearch *int `json:"Ist Matches Per Search"` IstAverageFirstOrganicMatchPosition *float64 `json:"Ist Average First Organic Match Position"` IstAverageFirstLocalPackMatchPosition *float64 `json:"Ist Average First Local Pack Match Position"` IstAverageFirstMatchPosition *float64 `json:"Ist Average First Match Position"` LocationId *string `json:"location_id"` Month *string `json:"month"` }
func (AnalyticsData) GetAverageRating ¶
func (y AnalyticsData) GetAverageRating() float64
func (AnalyticsData) GetBingSearches ¶
func (y AnalyticsData) GetBingSearches() int
func (AnalyticsData) GetDuplicatesDetected ¶
func (y AnalyticsData) GetDuplicatesDetected() int
func (AnalyticsData) GetDuplicatesSuppressed ¶
func (y AnalyticsData) GetDuplicatesSuppressed() int
func (AnalyticsData) GetFacebookCheckins ¶
func (y AnalyticsData) GetFacebookCheckins() int
func (AnalyticsData) GetFacebookCtaClicks ¶
func (y AnalyticsData) GetFacebookCtaClicks() int
func (AnalyticsData) GetFacebookImpressions ¶
func (y AnalyticsData) GetFacebookImpressions() int
func (AnalyticsData) GetFacebookLikes ¶
func (y AnalyticsData) GetFacebookLikes() int
func (AnalyticsData) GetFacebookPageViews ¶
func (y AnalyticsData) GetFacebookPageViews() int
func (AnalyticsData) GetFacebookPostImpressions ¶
func (y AnalyticsData) GetFacebookPostImpressions() int
func (AnalyticsData) GetFacebookTalkingAbout ¶
func (y AnalyticsData) GetFacebookTalkingAbout() int
func (AnalyticsData) GetFacebookWereHere ¶
func (y AnalyticsData) GetFacebookWereHere() int
func (AnalyticsData) GetFeaturedMessageClicks ¶
func (y AnalyticsData) GetFeaturedMessageClicks() int
func (AnalyticsData) GetFoursquareDailyCheckins ¶
func (y AnalyticsData) GetFoursquareDailyCheckins() int
func (AnalyticsData) GetGoogleCustomerActions ¶
func (y AnalyticsData) GetGoogleCustomerActions() int
func (AnalyticsData) GetGoogleMapViews ¶
func (y AnalyticsData) GetGoogleMapViews() int
func (AnalyticsData) GetGooglePhoneCalls ¶
func (y AnalyticsData) GetGooglePhoneCalls() int
func (AnalyticsData) GetGoogleSearchQueries ¶
func (y AnalyticsData) GetGoogleSearchQueries() int
func (AnalyticsData) GetGoogleSearchViews ¶
func (y AnalyticsData) GetGoogleSearchViews() int
func (AnalyticsData) GetInstagramPosts ¶
func (y AnalyticsData) GetInstagramPosts() int
func (AnalyticsData) GetIstAverageFirstLocalPackMatchPosition ¶
func (y AnalyticsData) GetIstAverageFirstLocalPackMatchPosition() float64
func (AnalyticsData) GetIstAverageFirstMatchPosition ¶
func (y AnalyticsData) GetIstAverageFirstMatchPosition() float64
func (AnalyticsData) GetIstAverageFirstOrganicMatchPosition ¶
func (y AnalyticsData) GetIstAverageFirstOrganicMatchPosition() float64
func (AnalyticsData) GetIstAverageLocalPackNumberOfResults ¶
func (y AnalyticsData) GetIstAverageLocalPackNumberOfResults() float64
func (AnalyticsData) GetIstAverageLocalPackPosition ¶
func (y AnalyticsData) GetIstAverageLocalPackPosition() float64
func (AnalyticsData) GetIstKnowledgeCardExisted ¶
func (y AnalyticsData) GetIstKnowledgeCardExisted() float64
func (AnalyticsData) GetIstLocalPackExisted ¶
func (y AnalyticsData) GetIstLocalPackExisted() float64
func (AnalyticsData) GetIstLocalPackPresence ¶
func (y AnalyticsData) GetIstLocalPackPresence() float64
func (AnalyticsData) GetIstLocalPackShareOfSearch ¶
func (y AnalyticsData) GetIstLocalPackShareOfSearch() float64
func (AnalyticsData) GetIstMatchesPerSearch ¶
func (y AnalyticsData) GetIstMatchesPerSearch() int
func (AnalyticsData) GetIstOrganicShareOfSearch ¶
func (y AnalyticsData) GetIstOrganicShareOfSearch() float64
func (AnalyticsData) GetIstSearchRequests ¶
func (y AnalyticsData) GetIstSearchRequests() int
func (AnalyticsData) GetIstShareOfIntelligentSearch ¶
func (y AnalyticsData) GetIstShareOfIntelligentSearch() float64
func (AnalyticsData) GetListingsLive ¶
func (y AnalyticsData) GetListingsLive() int
func (AnalyticsData) GetLocationId ¶
func (y AnalyticsData) GetLocationId() string
func (AnalyticsData) GetMonth ¶
func (y AnalyticsData) GetMonth() string
func (AnalyticsData) GetNewReviews ¶
func (y AnalyticsData) GetNewReviews() int
func (AnalyticsData) GetPowerlistingsLive ¶
func (y AnalyticsData) GetPowerlistingsLive() int
func (AnalyticsData) GetProfileUpdates ¶
func (y AnalyticsData) GetProfileUpdates() int
func (AnalyticsData) GetProfileViews ¶
func (y AnalyticsData) GetProfileViews() int
func (AnalyticsData) GetPublisherSuggestions ¶
func (y AnalyticsData) GetPublisherSuggestions() int
func (AnalyticsData) GetSearches ¶
func (y AnalyticsData) GetSearches() int
func (AnalyticsData) GetSocialActivities ¶
func (y AnalyticsData) GetSocialActivities() int
func (AnalyticsData) GetStorepagesCalltoactionclicks ¶
func (y AnalyticsData) GetStorepagesCalltoactionclicks() int
func (AnalyticsData) GetStorepagesClickstowebsite ¶
func (y AnalyticsData) GetStorepagesClickstowebsite() int
func (AnalyticsData) GetStorepagesDrivingdirections ¶
func (y AnalyticsData) GetStorepagesDrivingdirections() int
func (AnalyticsData) GetStorepagesEventEventtype ¶
func (y AnalyticsData) GetStorepagesEventEventtype() int
func (AnalyticsData) GetStorepagesPageviews ¶
func (y AnalyticsData) GetStorepagesPageviews() int
func (AnalyticsData) GetStorepagesPhonecalls ¶
func (y AnalyticsData) GetStorepagesPhonecalls() int
func (AnalyticsData) GetStorepagesSessions ¶
func (y AnalyticsData) GetStorepagesSessions() int
func (AnalyticsData) GetYelpCustomerActions ¶
func (y AnalyticsData) GetYelpCustomerActions() int
func (AnalyticsData) GetYelpPageViews ¶
func (y AnalyticsData) GetYelpPageViews() int
type AnalyticsFilters ¶
type AnalyticsFilters struct { StartDate *string `json:"startDate"` EndDate *string `json:"endDate"` LocationIds *[]string `json:"locationIds"` FolderId *int `json:"folderId"` Countries *[]string `json:"countries"` LocationLabels *[]string `json:"locationLabels"` Platforms *[]string `json:"platforms"` GoogleActionType *[]string `json:"googleActionType"` CustomerActionType *[]string `json:"customerActionType"` GoogleQueryType *[]string `json:"googleQueryType"` Hours *[]int `json:"hours"` Ratings *[]int `json:"ratings"` FrequentWords *[]string `json:"frequentWords"` Partners *[]int `json:"partners"` ReviewLabels *[]int `json:"reviewLabels"` PageTypes *[]string `json:"pageTypes"` ListingsLiveType *string `json:"listingsLiveType"` PublisherSuggestionType *[]string `json:"publisherSuggestionType"` QueryTemplate *[]string `json:"queryTemplate"` SearchEngine *[]string `json:"searchEngine"` Keyword *[]string `json:"keyword"` Competitor *[]string `json:"competitor"` MatchPosition *[]string `json:"matchPosition"` SearchResultType *[]string `json:"searchResultType"` MatchType *[]string `json:"matchType"` MinSearchFrequency *int `json:"minSearchFrequency"` MaxSearchFrequency *int `json:"maxSearchFrequency"` SearchTerm *string `json:"searchTerm"` SearchType *string `json:"searchType"` FoursquareCheckinType *string `json:"foursquareCheckinType"` FoursquareCheckinAge *string `json:"foursquareCheckinAge"` FoursquareCheckinGender *string `json:"foursquareCheckinGender"` FoursquareCheckinTimeOfDay *string `json:"foursquareCheckinTimeOfDay"` InstagramContentType *string `json:"instagramContentType"` Age *[]string `json:"age"` Gender *string `json:"gender"` FacebookImpressionType *[]string `json:"facebookImpressionType"` FacebookStoryType *[]string `json:"facebookStoryType"` }
type AnalyticsReportRequest ¶
type AnalyticsReportRequest struct { Metrics []string `json:"metrics"` Dimensions []string `json:"dimensions"` Filters *AnalyticsFilters `json:"filters"` }
type AnalyticsReportResponse ¶
type AnalyticsReportResponse struct { Data []*AnalyticsData `json:"data"` Id int `json:"id"` }
type AnalyticsService ¶
type AnalyticsService struct {
// contains filtered or unexported fields
}
func (*AnalyticsService) Create ¶
func (a *AnalyticsService) Create(req *AnalyticsReportRequest) (*AnalyticsReportResponse, *Response, error)
type Asset ¶
type Asset struct { Id string `json:"id"` Name string `json:"name"` Type AssetType `json:"type"` ForLocations ForLocations `json:"forLocations"` Description string `json:"description"` Labels []string `json:"labels"` Contents []Content `json:"contents"` // Type:Text PhotoUrl string `json:"photoUrl"` // Type:Photo Details string `json:"details"` // Type:Photo ClickthroughUrl string `json:"clickthroughUrl"` // Type:Photo AlternateText string `json:"alternateText"` // Type:Photo VideoUrl string `json:"videoUrl"` // Type:Video }
type AssetListResponse ¶
type AssetService ¶
type AssetService struct {
// contains filtered or unexported fields
}
func (*AssetService) List ¶
func (a *AssetService) List(opts *ListOptions) (*AssetListResponse, *Response, error)
func (*AssetService) ListAll ¶
func (a *AssetService) ListAll() ([]*Asset, error)
type BackoffPolicy ¶
type BackoffPolicy struct {
Millis []int
}
BackoffPolicy implements a backoff policy, randomizing its delays and saturating at the final value in Millis.
type Bio ¶
type Bio struct { ListItem Title string `json:"title,omitempty"` Photo *ListPhoto `json:"photo,omitempty"` PhoneNumber string `json:"phone,omitempty"` EmailAddress string `json:"email,omitempty"` Education []string `json:"education"` Certifications []string `json:"certifications"` Services []string `json:"services,omitempty"` Url string `json:"url,omitempty"` }
type BioList ¶
type BioList struct { List Sections []*BioListSection `json:"sections,omitempty"` }
type BioListSection ¶
type BioListSection struct { ListSection Items []*Bio `json:"items,omitempty"` // max 100 items }
type BioListsResponse ¶
type Category ¶
type Category struct { Id string `json:"id"` Name string `json:"name"` FullName string `json:"fullName"` Selectable bool `json:"selectable"` ParentId string `json:"parentId"` }
Category is a representation of a Category in Yext Location Manager. For details see http://developer.yext.com/docs/api-reference/#operation/getBusinessCategories
type CategoryListOptions ¶
type CategoryService ¶
type CategoryService struct {
// contains filtered or unexported fields
}
func (*CategoryService) List ¶
func (s *CategoryService) List(opts *CategoryListOptions) ([]*Category, error)
type Client ¶
type Client struct { Config *Config LocationService *LocationService ListService *ListService CustomFieldService *CustomFieldService FolderService *FolderService CategoryService *CategoryService UserService *UserService ReviewService *ReviewService LanguageProfileService *LanguageProfileService AssetService *AssetService AnalyticsService *AnalyticsService }
func (*Client) DoRequestJSON ¶
func (*Client) DoRootRequest ¶
func (*Client) DoRootRequestJSON ¶
func (*Client) NewAccountRequestBody ¶
func (*Client) NewRequest ¶
func (*Client) NewRequestBody ¶
func (*Client) NewRequestJSON ¶
func (*Client) NewRootRequest ¶
func (*Client) NewRootRequestBody ¶
type Comment ¶
type Comment struct { Id *int `json:"id"` ParentId *int `json:"parentId"` PublisherDate *int `json:"publisherDate"` AuthorName *string `json:"authorName"` AuthorEmail *string `json:"authorEmail"` AuthorRole *string `json:"authorRole"` Content *string `json:"content"` Visibility *string `json:"visibility"` }
func (Comment) GetAuthorEmail ¶
func (Comment) GetAuthorName ¶
func (Comment) GetAuthorRole ¶
func (Comment) GetContent ¶
func (Comment) GetParentId ¶
func (Comment) GetPublisherDate ¶
func (Comment) GetVisibility ¶
type Comparable ¶
type Comparable interface {
Equal(Comparable) bool
}
type Config ¶
type Config struct { HTTPClient *http.Client BaseUrl string ApiKey string AccountId string Version string RetryCount *int RateLimitRetry bool Clock clockwork.Clock Logger Logger }
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
func (*Config) WithAccountId ¶
func (*Config) WithApiKey ¶
func (*Config) WithBaseUrl ¶
func (*Config) WithEnvCredentials ¶
func (*Config) WithLogger ¶
func (*Config) WithMockClock ¶
func (*Config) WithProductionHost ¶
func (*Config) WithRateLimitRetry ¶
func (*Config) WithRetries ¶
func (*Config) WithSandboxHost ¶
func (*Config) WithStdLogger ¶
func (*Config) WithTodaysVersion ¶
func (*Config) WithVersion ¶
type CostOptions ¶
type CustomField ¶
type CustomField struct { Id *string `json:"id,omitempty"` Type string `json:"type"` Name string `json:"name"` Options []CustomFieldOption `json:"options,omitempty"` // Only present for multi-option custom fields Group string `json:"group"` Description string `json:"description"` AlternateLanguageBehaviour string `json:"alternateLanguageBehavior"` }
CustomField is the representation of a Custom Field definition in Yext Location Manager. For details see https://www.yext.com/support/platform-api/#Administration_API/Custom_Fields.htm
func (CustomField) GetId ¶
func (c CustomField) GetId() string
type CustomFieldManager ¶
type CustomFieldManager struct {
CustomFields []*CustomField
}
func (*CustomFieldManager) CustomField ¶
func (c *CustomFieldManager) CustomField(name string) (*CustomField, error)
func (*CustomFieldManager) CustomFieldId ¶
func (c *CustomFieldManager) CustomFieldId(name string) (string, error)
func (*CustomFieldManager) CustomFieldName ¶
func (c *CustomFieldManager) CustomFieldName(id string) (string, error)
func (*CustomFieldManager) CustomFieldOptionId ¶
func (c *CustomFieldManager) CustomFieldOptionId(fieldName, optionName string) (string, error)
func (*CustomFieldManager) CustomFieldOptionName ¶
func (c *CustomFieldManager) CustomFieldOptionName(cfName string, optionId string) (string, error)
func (*CustomFieldManager) CustomFieldOptionNames ¶
func (c *CustomFieldManager) CustomFieldOptionNames(cfName string, optionIds []string) ([]string, error)
func (*CustomFieldManager) Get ¶
func (c *CustomFieldManager) Get(name string, loc *Location) (interface{}, error)
func (*CustomFieldManager) GetBool ¶
func (c *CustomFieldManager) GetBool(name string, loc *Location) (bool, error)
func (*CustomFieldManager) GetString ¶
func (c *CustomFieldManager) GetString(name string, loc *Location) (string, error)
GetStringAliasCustomField returns the string value from a string type alias custom field. It will return an error if the field is not a string type.
func (*CustomFieldManager) GetStringSlice ¶
func (c *CustomFieldManager) GetStringSlice(name string, loc *Location) ([]string, error)
GetStringArrayAliasCustomField returns the string array value from a string array type alias custom field. It will return an error if the field is not a string array type.
func (*CustomFieldManager) IsOptionSet ¶
func (*CustomFieldManager) MustCustomField ¶
func (c *CustomFieldManager) MustCustomField(name string) *CustomField
func (*CustomFieldManager) MustCustomFieldId ¶
func (c *CustomFieldManager) MustCustomFieldId(name string) string
func (*CustomFieldManager) MustCustomFieldName ¶
func (c *CustomFieldManager) MustCustomFieldName(id string) string
func (*CustomFieldManager) MustCustomFieldOptionId ¶
func (c *CustomFieldManager) MustCustomFieldOptionId(fieldName, optionName string) string
func (*CustomFieldManager) MustCustomFieldOptionName ¶
func (c *CustomFieldManager) MustCustomFieldOptionName(fieldName, optionId string) string
func (*CustomFieldManager) MustGet ¶
func (c *CustomFieldManager) MustGet(name string, loc *Location) interface{}
func (*CustomFieldManager) MustGetBool ¶
func (c *CustomFieldManager) MustGetBool(name string, loc *Location) bool
func (*CustomFieldManager) MustGetString ¶
func (c *CustomFieldManager) MustGetString(name string, loc *Location) string
func (*CustomFieldManager) MustGetStringSlice ¶
func (c *CustomFieldManager) MustGetStringSlice(name string, loc *Location) []string
func (*CustomFieldManager) MustIsOptionSet ¶
func (c *CustomFieldManager) MustIsOptionSet(fieldName string, optionName string, loc *Location) bool
func (*CustomFieldManager) MustSet ¶
func (c *CustomFieldManager) MustSet(name string, value CustomFieldValue, loc *Location) *Location
func (*CustomFieldManager) MustSetBool ¶
func (c *CustomFieldManager) MustSetBool(name string, value bool, loc *Location)
func (*CustomFieldManager) MustSetOption ¶
func (c *CustomFieldManager) MustSetOption(fieldName string, optionName string, loc *Location) *Location
func (*CustomFieldManager) MustSetString ¶
func (c *CustomFieldManager) MustSetString(name string, value string, loc *Location)
func (*CustomFieldManager) MustSetStringSlice ¶
func (c *CustomFieldManager) MustSetStringSlice(name string, value []string, loc *Location)
func (*CustomFieldManager) MustUnsetOption ¶
func (c *CustomFieldManager) MustUnsetOption(fieldName string, optionName string, loc *Location) *Location
func (*CustomFieldManager) Set ¶
func (c *CustomFieldManager) Set(name string, value CustomFieldValue, loc *Location) (*Location, error)
TODO: Why does this return a location? TODO: Should we validate the the type we received matches the type of the field? Probably.
func (*CustomFieldManager) SetBool ¶
func (c *CustomFieldManager) SetBool(name string, value bool, loc *Location) error
func (*CustomFieldManager) SetPhoto ¶
func (c *CustomFieldManager) SetPhoto(name string, v *Photo, loc *Location) error
func (*CustomFieldManager) SetString ¶
func (c *CustomFieldManager) SetString(name string, value string, loc *Location) error
func (*CustomFieldManager) SetStringSlice ¶
func (c *CustomFieldManager) SetStringSlice(name string, value []string, loc *Location) error
func (*CustomFieldManager) UnsetOption ¶
func (*CustomFieldManager) UnsetPhoto ¶
func (c *CustomFieldManager) UnsetPhoto(name string, loc *Location) error
type CustomFieldOption ¶
type CustomFieldResponse ¶
type CustomFieldResponse struct { Count int `json:"count"` CustomFields []*CustomField `json:"customFields"` }
type CustomFieldService ¶
type CustomFieldService struct { CustomFieldManager *CustomFieldManager // contains filtered or unexported fields }
func (*CustomFieldService) CacheCustomFields ¶
func (s *CustomFieldService) CacheCustomFields() ([]*CustomField, error)
func (*CustomFieldService) Create ¶
func (s *CustomFieldService) Create(cf *CustomField) (*Response, error)
func (*CustomFieldService) Delete ¶
func (s *CustomFieldService) Delete(customFieldId string) (*Response, error)
func (*CustomFieldService) Edit ¶
func (s *CustomFieldService) Edit(cf *CustomField) (*Response, error)
func (*CustomFieldService) List ¶
func (s *CustomFieldService) List(opts *ListOptions) (*CustomFieldResponse, *Response, error)
func (*CustomFieldService) ListAll ¶
func (s *CustomFieldService) ListAll() ([]*CustomField, error)
func (*CustomFieldService) MustCacheCustomFields ¶
func (s *CustomFieldService) MustCacheCustomFields() []*CustomField
type CustomFieldType ¶
type CustomFieldType string
type CustomFieldValue ¶
type CustomFieldValue interface {
CustomFieldTag() string
}
type DailyTimes ¶
type DailyTimes struct {
DailyTimes string `json:"dailyTimes,omitempty"`
}
func (DailyTimes) CustomFieldTag ¶
func (d DailyTimes) CustomFieldTag() string
type Error ¶
type Error struct { Message string `json:"message"` Code int `json:"code"` Type string `json:"type"` RequestUUID string `json:"request_uuid"` }
func ErrorsFromString ¶
func (Error) ErrorWithoutUUID ¶
type EventList ¶
type EventList struct { List Sections []*EventListSection `json:"sections,omitempty"` }
type EventListSection ¶
type EventListSection struct { ListSection Items []*Event `json:"items,omitempty"` // max 100 items }
type EventListsResponse ¶
type Folder ¶
type Folder struct { Id string `json:"id"` Name string `json:"name"` ParentId string `json:"parentId"` }
Folder is a representation of a Folder in Yext Location Manager. For details see http://developer.yext.com/docs/api-reference/#operation/getLocationFolders
type FolderListResponse ¶
type FolderService ¶
type FolderService struct {
// contains filtered or unexported fields
}
func (*FolderService) List ¶
func (s *FolderService) List(opts *ListOptions) (*FolderListResponse, *Response, error)
func (*FolderService) ListAll ¶
func (s *FolderService) ListAll() ([]*Folder, error)
type ForLocations ¶
type ForLocations struct { MappingType string `json:"mappingType"` FolderId string `json:"folderId"` LocationIds []string `json:"locationIds"` LabelIds []string `json:"labelIds"` LabelOperator LabelOperator `json:"labelOperator"` }
type GoogleAttribute ¶
type GoogleAttribute struct { Id *string `json:"id,omitempty"` OptionIds *[]string `json:"optionIds,omitempty"` }
func (*GoogleAttribute) Equal ¶
func (a *GoogleAttribute) Equal(b Comparable) bool
Equal compares GoogleAttribute
type GoogleAttributes ¶
type GoogleAttributes []*GoogleAttribute
func ToGoogleAttributes ¶
func ToGoogleAttributes(v []*GoogleAttribute) *GoogleAttributes
func (*GoogleAttributes) Equal ¶
func (a *GoogleAttributes) Equal(b Comparable) bool
Equal compares GoogleAttributes
type HolidayHours ¶
HolidayHours represents individual exceptions to a Location's regular hours in Yext Location Manager. For details see
type Hours ¶
type Hours struct { AdditionalText string `json:"additionalHoursText,omitempty"` Hours string `json:"hours,omitempty"` HolidayHours []HolidayHours `json:"holidayHours,omitempty"` }
func (Hours) CustomFieldTag ¶
type HoursHelper ¶
type HoursHelper struct { Sunday []string Monday []string Tuesday []string Wednesday []string Thursday []string Friday []string Saturday []string }
func HoursHelperFromString ¶
func HoursHelperFromString(str string) (*HoursHelper, error)
func MustHoursHelperFromString ¶
func MustHoursHelperFromString(str string) *HoursHelper
func (*HoursHelper) AppendHours ¶
func (h *HoursHelper) AppendHours(weekday Weekday, hours string)
func (*HoursHelper) GetHours ¶
func (h *HoursHelper) GetHours(weekday Weekday) []string
func (*HoursHelper) HoursAreAllUnspecified ¶
func (h *HoursHelper) HoursAreAllUnspecified() bool
func (*HoursHelper) HoursAreClosed ¶
func (h *HoursHelper) HoursAreClosed(weekday Weekday) bool
func (*HoursHelper) HoursAreOpen24Hours ¶
func (h *HoursHelper) HoursAreOpen24Hours(weekday Weekday) bool
func (*HoursHelper) HoursAreUnspecified ¶
func (h *HoursHelper) HoursAreUnspecified(weekday Weekday) bool
func (*HoursHelper) MustToStringSlice ¶
func (h *HoursHelper) MustToStringSlice() []string
func (*HoursHelper) Serialize ¶
func (h *HoursHelper) Serialize() string
func (*HoursHelper) SerializeDay ¶
func (h *HoursHelper) SerializeDay(weekday Weekday) string
func (*HoursHelper) SetClosed ¶
func (h *HoursHelper) SetClosed(weekday Weekday)
func (*HoursHelper) SetHours ¶
func (h *HoursHelper) SetHours(weekday Weekday, hours []string)
func (*HoursHelper) SetOpen24Hours ¶
func (h *HoursHelper) SetOpen24Hours(weekday Weekday)
func (*HoursHelper) SetUnspecified ¶
func (h *HoursHelper) SetUnspecified(weekday Weekday)
func (HoursHelper) ToMap ¶
func (h HoursHelper) ToMap() map[Weekday][]string
func (*HoursHelper) ToStringSlice ¶
func (h *HoursHelper) ToStringSlice() ([]string, error)
type LabelOperator ¶
type LabelOperator string
const ( LabelOperatorAnd LabelOperator = "AND" LabelOperatorOr LabelOperator = "OR" )
type LanguageProfile ¶
type LanguageProfile struct {
Location
}
type LanguageProfileListResponse ¶
type LanguageProfileListResponse struct {
LanguageProfiles []*LanguageProfile `json:"languageProfiles"`
}
func (*LanguageProfileListResponse) ResponseAsLocations ¶
func (l *LanguageProfileListResponse) ResponseAsLocations() []*Location
type LanguageProfileService ¶
type LanguageProfileService struct { CustomFields []*CustomField // contains filtered or unexported fields }
func (*LanguageProfileService) Delete ¶
func (l *LanguageProfileService) Delete(id string, languageCode string) (*Response, error)
func (*LanguageProfileService) Get ¶
func (l *LanguageProfileService) Get(id string, languageCode string) (*LanguageProfile, *Response, error)
func (*LanguageProfileService) GetAll ¶
func (l *LanguageProfileService) GetAll(id string) (*LanguageProfileListResponse, *Response, error)
func (*LanguageProfileService) HydrateLocations ¶
func (l *LanguageProfileService) HydrateLocations(languageProfiles []*LanguageProfile) ([]*LanguageProfile, error)
func (*LanguageProfileService) Upsert ¶
func (l *LanguageProfileService) Upsert(y *LanguageProfile, languageCode string) (*Response, error)
type List ¶
type List struct { Id *string `json:"id"` Name *string `json:"name,omitempty"` // max length 100 Title *string `json:"title,omitempty"` // max length 100 Type *string `json:"type,omitempty"` // one of MENU, BIOS, PRODUCTS, EVENTS Size *int `json:"size,omitempty"` // read only Publish *bool `json:"publish"` Language *string `json:"language,omitempty"` Currency *string `json:"currency,omitempty"` // ISO Code for currency Sections []*ListSection `json:"sections,omitempty"` }
Generic base of a list
func (List) GetCurrency ¶
func (List) GetLanguage ¶
func (List) GetPublish ¶
type ListItem ¶
type ListItem struct { Id *string `json:"id"` Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` }
func (ListItem) GetDescription ¶
type ListOptions ¶
type ListSection ¶
type ListSection struct { Id *string `json:"id"` Name *string `json:"name,omitempty"` Description *string `json:"description,omitempty"` }
func (ListSection) GetDescription ¶
func (e ListSection) GetDescription() string
func (ListSection) GetId ¶
func (e ListSection) GetId() string
func (ListSection) GetName ¶
func (e ListSection) GetName() string
type ListService ¶
type ListService struct {
// contains filtered or unexported fields
}
func (*ListService) CreateBioList ¶
func (e *ListService) CreateBioList(y *BioList) (*Response, error)
func (*ListService) CreateEventList ¶
func (e *ListService) CreateEventList(y *EventList) (*Response, error)
func (*ListService) CreateMenuList ¶
func (e *ListService) CreateMenuList(y *MenuList) (*Response, error)
func (*ListService) CreateProductList ¶
func (e *ListService) CreateProductList(y *ProductList) (*Response, error)
func (*ListService) DeleteBioList ¶
func (e *ListService) DeleteBioList(id string) (*Response, error)
func (*ListService) DeleteEventList ¶
func (e *ListService) DeleteEventList(id string) (*Response, error)
func (*ListService) DeleteMenuList ¶
func (e *ListService) DeleteMenuList(id string) (*Response, error)
func (*ListService) DeleteProductList ¶
func (e *ListService) DeleteProductList(id string) (*Response, error)
func (*ListService) EditBioList ¶
func (e *ListService) EditBioList(y *BioList) (*BioList, *Response, error)
func (*ListService) EditEventList ¶
func (e *ListService) EditEventList(y *EventList) (*EventList, *Response, error)
func (*ListService) EditMenuList ¶
func (e *ListService) EditMenuList(y *MenuList) (*MenuList, *Response, error)
func (*ListService) EditProductList ¶
func (e *ListService) EditProductList(y *ProductList) (*ProductList, *Response, error)
func (*ListService) GetBioList ¶
func (e *ListService) GetBioList(id string) (*BioList, *Response, error)
func (*ListService) GetEventList ¶
func (e *ListService) GetEventList(id string) (*EventList, *Response, error)
func (*ListService) GetMenuList ¶
func (e *ListService) GetMenuList(id string) (*MenuList, *Response, error)
func (*ListService) GetProductList ¶
func (e *ListService) GetProductList(id string) (*ProductList, *Response, error)
func (*ListService) ListAllBioLists ¶
func (e *ListService) ListAllBioLists() ([]*BioList, error)
func (*ListService) ListAllEventLists ¶
func (e *ListService) ListAllEventLists() ([]*EventList, error)
func (*ListService) ListAllMenuLists ¶
func (e *ListService) ListAllMenuLists() ([]*MenuList, error)
func (*ListService) ListAllProductLists ¶
func (e *ListService) ListAllProductLists() ([]*ProductList, error)
func (*ListService) ListBioLists ¶
func (e *ListService) ListBioLists(opts *ListOptions) (*BioListsResponse, *Response, error)
func (*ListService) ListEventLists ¶
func (e *ListService) ListEventLists(opts *ListOptions) (*EventListsResponse, *Response, error)
func (*ListService) ListMenuLists ¶
func (e *ListService) ListMenuLists(opts *ListOptions) (*MenuListsResponse, *Response, error)
func (*ListService) ListProductLists ¶
func (e *ListService) ListProductLists(opts *ListOptions) (*ProductListsResponse, *Response, error)
type Location ¶
type Location struct { // Admin Id *string `json:"id,omitempty"` AccountId *string `json:"accountId,omitempty"` LocationType *string `json:"locationType,omitempty"` FolderId *string `json:"folderId,omitempty"` LabelIds *UnorderedStrings `json:"labelIds,omitempty"` CategoryIds *[]string `json:"categoryIds,omitempty"` Closed *LocationClosed `json:"closed,omitempty"` Keywords *[]string `json:"keywords,omitempty"` Language *string `json:"language,omitempty"` CustomFields map[string]interface{} `json:"customFields,omitempty"` // Address Fields Name *string `json:"locationName,omitempty"` Address *string `json:"address,omitempty"` Address2 *string `json:"address2,omitempty"` DisplayAddress *string `json:"displayAddress,omitempty"` City *string `json:"city,omitempty"` State *string `json:"state,omitempty"` Sublocality *string `json:"sublocality,omitempty"` Zip *string `json:"zip,omitempty"` CountryCode *string `json:"countryCode,omitempty"` SuppressAddress *bool `json:"suppressAddress,omitempty"` ISORegionCode *string `json:"isoRegionCode,omitempty"` // Other Contact Info AlternatePhone *string `json:"alternatePhone,omitempty"` FaxPhone *string `json:"faxPhone,omitempty"` LocalPhone *string `json:"localPhone,omitempty"` MobilePhone *string `json:"mobilePhone,omitempty"` Phone *string `json:"phone,omitempty"` TollFreePhone *string `json:"tollFreePhone,omitempty"` TtyPhone *string `json:"ttyPhone,omitempty"` IsPhoneTracked *bool `json:"isPhoneTracked,omitempty"` Emails *[]string `json:"emails,omitempty"` // HealthCare fields FirstName *string `json:"firstName,omitempty"` MiddleName *string `json:"middleName,omitempty"` LastName *string `json:"lastName,omitempty"` Gender *string `json:"gender,omitempty"` Headshot *LocationPhoto `json:"headshot,omitempty"` AcceptingNewPatients *bool `json:"acceptingNewPatients,omitempty"` AdmittingHospitals *[]string `json:"admittingHospitals,omitempty"` ConditionsTreated *[]string `json:"conditionsTreated,omitempty"` InsuranceAccepted *[]string `json:"insuranceAccepted,omitempty"` NPI *string `json:"npi,omitempty"` OfficeName *string `json:"officeName,omitempty"` Degrees *[]string `json:"degrees,omitempty"` // Location Info Description *string `json:"description,omitempty"` HolidayHours *[]HolidayHours `json:"holidayHours,omitempty"` Hours *string `json:"hours,omitempty"` AdditionalHoursText *string `json:"additionalHoursText,omitempty"` YearEstablished *string `json:"yearEstablished,omitempty"` Associations *[]string `json:"associations,omitempty"` Certifications *[]string `json:"certifications,omitempty"` Brands *[]string `json:"brands,omitempty"` Products *[]string `json:"products,omitempty"` Services *[]string `json:"services,omitempty"` Specialties *[]string `json:"specialties,omitempty"` Languages *[]string `json:"languages,omitempty"` Logo *LocationPhoto `json:"logo,omitempty"` PaymentOptions *[]string `json:"paymentOptions,omitempty"` // Lats & Lngs DisplayLat *float64 `json:"displayLat,omitempty"` DisplayLng *float64 `json:"displayLng,omitempty"` DropoffLat *float64 `json:"dropoffLat,omitempty"` DropoffLng *float64 `json:"dropoffLng,omitempty"` WalkableLat *float64 `json:"walkableLat,omitempty"` WalkableLng *float64 `json:"walkableLng,omitempty"` RoutableLat *float64 `json:"routableLat,omitempty"` RoutableLng *float64 `json:"routableLng,omitempty"` PickupLat *float64 `json:"pickupLat,omitempty"` PickupLng *float64 `json:"pickupLng,omitempty"` // ECLS BioListIds *[]string `json:"bioListIds,omitempty"` BioListsLabel *string `json:"bioListsLabel,omitempty"` EventListIds *[]string `json:"eventListIds,omitempty"` EventListsLabel *string `json:"eventListsLabel,omitempty"` MenuListsLabel *string `json:"menusLabel,omitempty"` MenuListIds *[]string `json:"menuIds,omitempty"` ProductListIds *[]string `json:"productListIds,omitempty"` ProductListsLabel *string `json:"productListsLabel,omitempty"` // Urls MenuUrl *string `json:"menuUrl,omitempty"` DisplayMenuUrl *string `json:"displayMenuUrl,omitempty"` OrderUrl *string `json:"orderUrl,omitempty"` DisplayOrderUrl *string `json:"displayOrderUrl,omitempty"` ReservationUrl *string `json:"reservationUrl,omitempty"` DisplayReservationUrl *string `json:"displayReservationUrl,omitempty"` DisplayWebsiteUrl *string `json:"displayWebsiteUrl,omitempty"` WebsiteUrl *string `json:"websiteUrl,omitempty"` FeaturedMessage *string `json:"featuredMessage,omitempty"` FeaturedMessageUrl *string `json:"featuredMessageUrl,omitempty"` // Uber UberClientId *string `json:"uberClientId,omitempty"` UberLinkText *string `json:"uberLinkText,omitempty"` UberLinkType *string `json:"uberLinkType,omitempty"` UberTripBrandingText *string `json:"uberTripBrandingText,omitempty"` UberTripBrandingUrl *string `json:"uberTripBrandingUrl,omitempty"` // Social Media FacebookCoverPhoto *LocationPhoto `json:"facebookCoverPhoto,omitempty"` FacebookPageUrl *string `json:"facebookPageUrl,omitempty"` FacebookProfilePicture *LocationPhoto `json:"facebookProfilePicture,omitempty"` GoogleCoverPhoto *LocationPhoto `json:"googleCoverPhoto,omitempty"` GooglePreferredPhoto *string `json:"googlePreferredPhoto,omitempty"` GoogleProfilePhoto *LocationPhoto `json:"googleProfilePhoto,omitempty"` GoogleWebsiteOverride *string `json:"googleWebsiteOverride,omitempty"` InstagramHandle *string `json:"instagramHandle,omitempty"` TwitterHandle *string `json:"twitterHandle,omitempty"` Photos *[]LocationPhoto `json:"photos,omitempty"` VideoUrls *[]string `json:"videoUrls,omitempty"` GoogleAttributes *GoogleAttributes `json:"googleAttributes,omitempty"` // Reviews ReviewBalancingURL *string `json:"reviewBalancingURL,omitempty"` FirstPartyReviewPage *string `json:"firstPartyReviewPage,omitempty"` // contains filtered or unexported fields }
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
func HydrateLocation ¶
func HydrateLocation(loc *Location, customFields []*CustomField) (*Location, error)
TODO: This mutates the location, no need to return the value
func (Location) Diff ¶
Diff calculates the differences between a base Location (a) and a proposed set of changes represented by a second Location (b). The diffing logic will ignore fields in the proposed Location that aren't set (nil). This characteristic makes the function ideal for calculting the minimal PUT required to bring an object "up-to-date" via the API.
Example:
var ( // Typically, this would come from an authoritative source, like the API base = Location{Name: "Yext, Inc.", Address1: "123 Mulberry St"} proposed = Location{Name: "Yext, Inc.", Address1: "456 Washington St"} ) delta, isDiff := base.Diff(proposed) // isDiff -> true // delta -> &Location{Address1: "456 Washington St"} delta, isDiff = base.Diff(base) // isDiff -> false // delta -> nil
func (Location) GetAcceptingNewPatients ¶
func (Location) GetAccountId ¶
func (Location) GetAdditionalHoursText ¶
func (Location) GetAddress ¶
func (Location) GetAddress2 ¶
func (Location) GetAdmittingHospitals ¶
func (Location) GetAlternatePhone ¶
func (Location) GetAssociations ¶
func (Location) GetBioListIds ¶
func (Location) GetCategoryIds ¶
func (Location) GetCertifications ¶
func (Location) GetCountryCode ¶
func (Location) GetDegrees ¶
func (Location) GetDescription ¶
func (Location) GetDisplayAddress ¶
func (Location) GetDisplayLat ¶
func (Location) GetDisplayLng ¶
func (Location) GetDisplayWebsiteUrl ¶
func (Location) GetEventListIds ¶
func (Location) GetFacebookPageUrl ¶
func (Location) GetFaxPhone ¶
func (Location) GetFeaturedMessage ¶
func (Location) GetFeaturedMessageUrl ¶
func (Location) GetFirstName ¶
func (Location) GetFirstPartyReviewPage ¶
func (Location) GetFolderId ¶
func (Location) GetGoogleAttributes ¶
func (y Location) GetGoogleAttributes() GoogleAttributes
func (Location) GetHolidayHours ¶
func (y Location) GetHolidayHours() []HolidayHours
func (Location) GetISORegionCode ¶
func (Location) GetIsPhoneTracked ¶
func (Location) GetKeywords ¶
func (Location) GetLabelIds ¶
func (y Location) GetLabelIds() (v UnorderedStrings)
func (Location) GetLanguage ¶
func (Location) GetLanguages ¶
func (Location) GetLastName ¶
func (Location) GetLocalPhone ¶
func (Location) GetLocationType ¶
func (Location) GetMenuListIds ¶
func (Location) GetMiddleName ¶
func (Location) GetMobilePhone ¶
func (Location) GetOfficeName ¶
func (Location) GetPaymentOptions ¶
func (Location) GetProductListIds ¶
func (Location) GetReservationUrl ¶
func (Location) GetReviewBalancingURL ¶
func (Location) GetRoutableLat ¶
func (Location) GetRoutableLng ¶
func (Location) GetServices ¶
func (Location) GetSpecialties ¶
func (Location) GetSuppressAddress ¶
func (Location) GetTollFreePhone ¶
func (Location) GetTtyPhone ¶
func (Location) GetTwitterHandle ¶
func (Location) GetVideoUrls ¶
func (Location) GetWebsiteUrl ¶
func (Location) GetYearEstablished ¶
func (*Location) SetLabelIds ¶
func (*Location) SetLabelIdsWithUnorderedStrings ¶
func (y *Location) SetLabelIdsWithUnorderedStrings(v UnorderedStrings)
type LocationClosed ¶
type LocationClosed struct { IsClosed bool `json:"isClosed"` ClosedDate string `json:"closedDate,omitempty"` }
LocationClosed represents the 'closed' state of a Location in Yext Location Manager. For details see https://www.yext.com/support/platform-api/#Administration_API/Locations.htm#Closed
func (LocationClosed) String ¶
func (l LocationClosed) String() string
type LocationList ¶
type LocationList UnorderedStrings
func (LocationList) CustomFieldTag ¶
func (l LocationList) CustomFieldTag() string
func (LocationList) Equal ¶
func (m LocationList) Equal(c Comparable) bool
type LocationListOptions ¶
type LocationListOptions struct { ListOptions SearchID string ResolvePlaceholders bool }
type LocationListResponse ¶
type LocationPhoto ¶
type LocationPhoto struct { Url string `json:"url,omitempty"` Description string `json:"description,omitempty"` AlternateText string `json:"alternateText,omitempty"` ClickThroughUrl string `json:"clickthroughUrl,omitempty"` }
LocationPhoto represents a photo associated with a Location in Yext Location Manager. For details see https://www.yext.com/support/platform-api/#Administration_API/Locations.htm#Photo
type LocationService ¶
type LocationService struct { CustomFields []*CustomField // contains filtered or unexported fields }
func (*LocationService) Get ¶
func (l *LocationService) Get(id string) (*Location, *Response, error)
func (*LocationService) GetWithOptions ¶
func (l *LocationService) GetWithOptions(id string, llopts *LocationListOptions) (*Location, *Response, error)
func (*LocationService) HydrateLocations ¶
func (l *LocationService) HydrateLocations(locs []*Location) ([]*Location, error)
TODO: This mutates the locations, no need to return them
func (*LocationService) List ¶
func (l *LocationService) List(llopts *LocationListOptions) (*LocationListResponse, *Response, error)
func (*LocationService) ListAll ¶
func (l *LocationService) ListAll(llopts *LocationListOptions) ([]*Location, error)
func (*LocationService) ListBySearchId ¶
func (l *LocationService) ListBySearchId(searchId string) ([]*Location, error)
type Logger ¶
type Logger interface {
Log(...interface{})
}
func NewStdLogger ¶
func NewStdLogger() Logger
type MenuList ¶
type MenuList struct { List Sections []*MenuListSection `json:"sections,omitempty"` }
type MenuListSection ¶
type MenuListSection struct { ListSection Items []*Menu `json:"items,omitempty"` // max 100 items }
type MenuListsResponse ¶
type MultiLineText ¶
type MultiLineText string
func (MultiLineText) CustomFieldTag ¶
func (m MultiLineText) CustomFieldTag() string
type MultiOption ¶
type MultiOption UnorderedStrings
func (MultiOption) CustomFieldTag ¶
func (m MultiOption) CustomFieldTag() string
func (MultiOption) Equal ¶
func (m MultiOption) Equal(c Comparable) bool
func (*MultiOption) IsOptionIdSet ¶
func (m *MultiOption) IsOptionIdSet(id string) bool
func (*MultiOption) SetOptionId ¶
func (m *MultiOption) SetOptionId(id string)
func (*MultiOption) UnsetOptionId ¶
func (m *MultiOption) UnsetOptionId(id string)
type OptionField ¶
type OptionField interface { CustomFieldValue SetOptionId(id string) UnsetOptionId(id string) IsOptionIdSet(id string) bool }
type Photo ¶
type Photo struct { Url string `json:"url,omitempty"` Description string `json:"description,omitempty"` Details string `json:"details,omitempty"` ClickThroughURL string `json:"clickthroughUrl,omitempty"` }
func (*Photo) CustomFieldTag ¶
type ProductList ¶
type ProductList struct { List Sections []*ProductListSection `json:"sections,omitempty"` }
func (*ProductList) Equal ¶
func (a *ProductList) Equal(b *ProductList) bool
func (ProductList) String ¶
func (p ProductList) String() string
type ProductListSection ¶
type ProductListSection struct { ListSection Items []*Product `json:"items,omitempty"` // max 100 items }
type ProductListsResponse ¶
type ProductListsResponse struct { Count int `json:"count"` ProductLists []*ProductList `json:"products"` }
type Review ¶
type Review struct { Id *int `json:"id"` LocationId *string `json:"locationId"` PublisherId *string `json:"publisherId"` Rating *float64 `json:"rating"` Title *string `json:"title"` Content *string `json:"content"` AuthorName *string `json:"authorName"` AuthorEmail *string `json:"authorEmail"` URL *string `json:"url"` PublisherDate *int `json:"publisherDate"` LastYextUpdateDate *int `json:"lastYextUpdateDate"` Status *string `json:"status"` Comments *[]Comment `json:"comments"` LabelIds *[]int `json:"labelIds"` ExternalId *string `json:"externalId"` ReviewLabels *[]ReviewLabel `json:"reviewLabels"` InvitationId *string `json:"invitationId"` }
func (Review) GetAuthorEmail ¶
func (Review) GetAuthorName ¶
func (Review) GetComments ¶
func (Review) GetContent ¶
func (Review) GetExternalId ¶
func (Review) GetLabelIds ¶
func (Review) GetLastYextUpdateDate ¶
func (Review) GetLocationId ¶
func (Review) GetPublisherDate ¶
func (Review) GetPublisherId ¶
func (Review) GetReviewLabels ¶
func (y Review) GetReviewLabels() (v []ReviewLabel)
type ReviewCreateInvitationResponse ¶
type ReviewCreateInvitationResponse struct { Id string `json:"id"` LocationId string `json:"locationId"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Contact string `json:"contact"` Image bool `json:"image"` TemplateId string `json:"templateId"` Status string `json:"status"` Details string `json:"details"` }
type ReviewLabel ¶
func (ReviewLabel) GetId ¶
func (y ReviewLabel) GetId() int
func (ReviewLabel) GetName ¶
func (y ReviewLabel) GetName() string
type ReviewListOptions ¶
type ReviewListOptions struct { ListOptions LocationIds []string FolderId string Countries []string LocationLabels []string PublisherIds []string ReviewContent string MinRating float64 MaxRating float64 MinPublisherDate string MaxPublisherDate string MinLastYextUpdateDate string MaxLastYextUpdateDate string AwaitingResponse string MinNonOwnerComments int ReviewerName string ReviewerEmail string Status string }
type ReviewListResponse ¶
type ReviewService ¶
type ReviewService struct {
// contains filtered or unexported fields
}
func (*ReviewService) CreateInvitation ¶
func (l *ReviewService) CreateInvitation(jsonData []Reviewer) (*[]ReviewCreateInvitationResponse, *Response, error)
func (*ReviewService) List ¶
func (l *ReviewService) List(opts *ReviewListOptions) (*ReviewListResponse, *Response, error)
func (*ReviewService) ListAll ¶
func (l *ReviewService) ListAll() ([]*Review, error)
func (*ReviewService) ListAllWithOptions ¶
func (l *ReviewService) ListAllWithOptions(rlOpts *ReviewListOptions) ([]*Review, error)
type RolesListResponse ¶
type SingleLineText ¶
type SingleLineText string
func (SingleLineText) CustomFieldTag ¶
func (s SingleLineText) CustomFieldTag() string
type SingleOption ¶
type SingleOption string
func GetSingleOptionPointer ¶
func GetSingleOptionPointer(option SingleOption) *SingleOption
func (SingleOption) CustomFieldTag ¶
func (s SingleOption) CustomFieldTag() string
func (*SingleOption) IsOptionIdSet ¶
func (s *SingleOption) IsOptionIdSet(id string) bool
func (*SingleOption) SetOptionId ¶
func (s *SingleOption) SetOptionId(id string)
func (*SingleOption) UnsetOptionId ¶
func (s *SingleOption) UnsetOptionId(id string)
type UnorderedStrings ¶
type UnorderedStrings []string
UnorderedStrings masks []string properties for which Order doesn't matter, such as LabelIds
func ToUnorderedStrings ¶
func ToUnorderedStrings(v []string) *UnorderedStrings
func (*UnorderedStrings) Equal ¶
func (a *UnorderedStrings) Equal(b Comparable) bool
Equal compares UnorderedStrings
type User ¶
type User struct { Id *string `json:"id,omitempty"` // req in post FirstName *string `json:"firstName,omitempty"` // req in post LastName *string `json:"lastName,omitempty"` // req in post UserName *string `json:"username,omitempty"` EmailAddress *string `json:"emailAddress,omitempty"` // req in post PhoneNumber *string `json:"phoneNumber,omitempty"` Password *string `json:"password,omitempty"` SSO *bool `json:"sso,omitempty"` ACLs []ACL `json:"acl,omitempty"` }
func (*User) Diff ¶
Diff calculates the differences betwee a base User (a) and a proposed set of changes represented by a second User (b). The diffing logic will ignore fields in (b) location that aren't set (nil). This characteristic makes the function ideal for calculating the minimal PUT required to up date an object via the API.
func (*User) GetEmailAddress ¶
func (*User) GetFirstName ¶
func (*User) GetLastName ¶
func (*User) GetPassword ¶
func (*User) GetPhoneNumber ¶
func (*User) GetUserName ¶
type UserListResponse ¶
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func (*UserService) List ¶
func (u *UserService) List(opts *ListOptions) (*UserListResponse, *Response, error)
func (*UserService) ListAll ¶
func (u *UserService) ListAll() ([]*User, error)
func (*UserService) ListRoles ¶
func (u *UserService) ListRoles() (*RolesListResponse, *Response, error)
func (*UserService) NewAccountACL ¶
func (u *UserService) NewAccountACL(r Role) ACL
func (*UserService) NewFolderACL ¶
func (u *UserService) NewFolderACL(f *Folder, r Role) ACL
func (*UserService) NewLocationACL ¶
func (u *UserService) NewLocationACL(l *Location, r Role) ACL
type VideoGallery ¶
type VideoGallery []Video
func (*VideoGallery) CustomFieldTag ¶
func (v *VideoGallery) CustomFieldTag() string
type Weekday ¶
type Weekday int
Following the documentation of the Yext API, the indexing of days begins at 1 (with Sunday) and ends with 7 (Saturday) http://developer.yext.com/docs/api-reference/
Source Files ¶
- acl.go
- acl_diff.go
- analytics_data.go
- analytics_service.go
- asset.go
- asset_service.go
- backoff.go
- category_service.go
- client.go
- config.go
- customfield.go
- customfield_service.go
- doc.go
- error.go
- folder_service.go
- hours.go
- hydrate.go
- language_profile.go
- language_profile_service.go
- list.go
- list_diff.go
- list_service.go
- location.go
- location_diff.go
- location_service.go
- logger.go
- response.go
- review.go
- review_service.go
- role.go
- role_diff.go
- type.go
- user.go
- user_diff.go
- user_service.go