yext

package module
v2.0.0-...-f6dd4a5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2023 License: MIT Imports: 17 Imported by: 3

README

yext-go

Go client for the Yext API

GoDoc Build Status

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

View Source
const (
	ACCESS_ACCOUNT  = AccessOn("ACCOUNT")
	ACCESS_FOLDER   = AccessOn("FOLDER")
	ACCESS_LOCATION = AccessOn("LOCATION")
)
View Source
const (
	SandboxHost    string = "api-sandbox.yext.com"
	ProductionHost string = "api.yext.com"
	AccountId      string = "me"
	Version        string = "20180226"
)
View Source
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"
)
View Source
const (
	ErrorTypeFatal    = "FATAL_ERROR"
	ErrorTypeNonFatal = "NON_FATAL_ERROR"
	ErrorTypeWarning  = "WARNING"
)
View Source
const (
	HoursClosedAllWeek = "1:closed,2:closed,3:closed,4:closed,5:closed,6:closed,7:closed"
	HoursOpen24Hours   = "00:00:00:00"
	HoursClosed        = "closed"
)
View Source
const (
	ACCOUNTS_PATH string = "accounts"
)

Variables

View Source
var AssetListMaxLimit = 1000
View Source
var CustomFieldListMaxLimit = 1000
View Source
var DefaultBackoffPolicy = BackoffPolicy{
	[]int{0, 0, 1000, 5000},
}

Default is a backoff policy ranging up to 5 seconds.

View Source
var (
	FolderListMaxLimit = 1000
)
View Source
var (
	ListListMaxLimit = 50
)
View Source
var (
	LocationListMaxLimit = 50
)
View Source
var (
	ReviewListMaxLimit = 50
)
View Source
var (
	UnsetPhotoValue = (*Photo)(nil)
)
View Source
var UserListMaxLimit = 50

Functions

func BioItemCompare

func BioItemCompare(itemA Bio, itemB Bio) bool

func Bool

func Bool(v bool) *bool

func ConvertBetweenFormats

func ConvertBetweenFormats(hours string, convertFromFormat string, convertToFormat string) (string, error)

func Float

func Float(v float64) *float64

func HoursAreEquivalent

func HoursAreEquivalent(a, b string) bool

func Int

func Int(v int) *int

func IsErrorCode

func IsErrorCode(err error, code int) bool

func IsNotFoundError

func IsNotFoundError(err error) bool

func Must

func Must(err error)

func ParseAndFormatHours

func ParseAndFormatHours(tFormat string, openHours string, closeHours string) (string, error)

func ParseCustomFields

func ParseCustomFields(cfraw map[string]interface{}, cfs []*CustomField) (map[string]interface{}, error)

func ParseOpenAndCloseHoursFromString

func ParseOpenAndCloseHoursFromString(hours string) (string, string, error)

func String

func String(v string) *string

func Strings

func Strings(v []string) *[]string

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

func (a ACL) Diff(b ACL) (delta *ACL, diff bool)

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.

func (ACL) Hash

func (a ACL) Hash() string

Hash returns a string representation of the elements that make an ACL functionally unique in Yext. Useful for comparing ACLs for "real-world" equality - "Do two ACLs have the same effect?"

func (ACL) String

func (a ACL) String() string

type ACLList

type ACLList []ACL

func (ACLList) Diff

func (a ACLList) Diff(b ACLList) (delta ACLList, diff bool)

Diff for ACLList calculates if ACLList a is identical to ACLList b (order is ignored). If any ACL in a is missing in b, return the entire list b.

type AccessOn

type AccessOn string

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"`
	IstOrganicShareOfSearch               *float64 `json:"Ist Organic Share Of Search"`
	IstLocalPackShareOfSearch             *float64 `json:"Ist Local Pack Share Of Search"`
	IstShareOfIntelligentSearch           *float64 `json:"Ist Share Of Intelligent Search"`
	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

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 AssetListResponse struct {
	Count  int      `json:"count"`
	Assets []*Asset `json:"assets"`
}

type AssetService

type AssetService struct {
	// contains filtered or unexported fields
}

func (*AssetService) Create

func (a *AssetService) Create(asset *Asset) (*Response, error)

func (*AssetService) Delete

func (a *AssetService) Delete(assetId string) (*Response, error)

func (*AssetService) Get

func (a *AssetService) Get(assetId string) (*Asset, *Response, error)

func (*AssetService) List

func (*AssetService) ListAll

func (a *AssetService) ListAll() ([]*Asset, error)

func (*AssetService) Update

func (a *AssetService) Update(assetId string, asset *Asset) (*Response, error)

type AssetType

type AssetType string
const (
	AssetTypeText  AssetType = "AssetTypeText"
	AssetTypePhoto AssetType = "AssetTypePhoto"
	AssetTypeVideo AssetType = "AssetTypeVideo"
)

type BackoffPolicy

type BackoffPolicy struct {
	Millis []int
}

BackoffPolicy implements a backoff policy, randomizing its delays and saturating at the final value in Millis.

func (BackoffPolicy) Duration

func (b BackoffPolicy) Duration(n int) time.Duration

Duration returns the time duration of the n'th wait cycle in a backoff policy. This is b.Millis[n], randomized to avoid thundering herds.

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"`
}

func (*BioList) Equal

func (a *BioList) Equal(b *BioList) bool

func (BioList) String

func (b BioList) String() string

type BioListSection

type BioListSection struct {
	ListSection
	Items []*Bio `json:"items,omitempty"` // max 100 items
}

type BioListsResponse

type BioListsResponse struct {
	Count    int        `json:"count"`
	BioLists []*BioList `json:"bios"`
}

type Calories

type Calories struct {
	Type    string `json:"type,omitempty"`
	Calorie int    `json:"calorie,omitempty"`
	RangeTo int    `json:"rangeTo,omitempty"`
}

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 CategoryListOptions struct {
	Language *string
	Country  *string
}

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 NewClient

func NewClient(config *Config) *Client

func (*Client) Do

func (c *Client) Do(req *http.Request, v interface{}) (*Response, error)

func (*Client) DoRequest

func (c *Client) DoRequest(method string, path string, v interface{}) (*Response, error)

func (*Client) DoRequestJSON

func (c *Client) DoRequestJSON(method string, path string, obj interface{}, v interface{}) (*Response, error)

func (*Client) DoRootRequest

func (c *Client) DoRootRequest(method string, path string, v interface{}) (*Response, error)

func (*Client) DoRootRequestJSON

func (c *Client) DoRootRequestJSON(method string, path string, obj interface{}, v interface{}) (*Response, error)

func (*Client) NewAccountRequestBody

func (c *Client) NewAccountRequestBody(method string, path string, data []byte) (*http.Request, error)

func (*Client) NewRequest

func (c *Client) NewRequest(method string, path string) (*http.Request, error)

func (*Client) NewRequestBody

func (c *Client) NewRequestBody(method string, fullPath string, data []byte) (*http.Request, error)

func (*Client) NewRequestJSON

func (c *Client) NewRequestJSON(method string, path string, obj interface{}) (*http.Request, error)

func (*Client) NewRootRequest

func (c *Client) NewRootRequest(method string, path string) (*http.Request, error)

func (*Client) NewRootRequestBody

func (c *Client) NewRootRequestBody(method string, path string, data []byte) (*http.Request, error)

func (*Client) NewRootRequestJSON

func (c *Client) NewRootRequestJSON(method string, path string, obj interface{}) (*http.Request, error)

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 (y Comment) GetAuthorEmail() string

func (Comment) GetAuthorName

func (y Comment) GetAuthorName() string

func (Comment) GetAuthorRole

func (y Comment) GetAuthorRole() string

func (Comment) GetContent

func (y Comment) GetContent() string

func (Comment) GetId

func (y Comment) GetId() int

func (Comment) GetParentId

func (y Comment) GetParentId() int

func (Comment) GetPublisherDate

func (y Comment) GetPublisherDate() int

func (Comment) GetVisibility

func (y Comment) GetVisibility() string

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 NewConfig

func NewConfig() *Config

func NewDefaultConfig

func NewDefaultConfig() *Config

func (*Config) WithAccountId

func (c *Config) WithAccountId(id string) *Config

func (*Config) WithApiKey

func (c *Config) WithApiKey(apikey string) *Config

func (*Config) WithBaseUrl

func (c *Config) WithBaseUrl(baseUrl string) *Config

func (*Config) WithEnvCredentials

func (c *Config) WithEnvCredentials() *Config

func (*Config) WithHTTPClient

func (c *Config) WithHTTPClient(client *http.Client) *Config

func (*Config) WithHost

func (c *Config) WithHost(host string) *Config

func (*Config) WithLogger

func (c *Config) WithLogger(l Logger) *Config

func (*Config) WithMockClock

func (c *Config) WithMockClock() *Config

func (*Config) WithProductionHost

func (c *Config) WithProductionHost() *Config

func (*Config) WithRateLimitRetry

func (c *Config) WithRateLimitRetry() *Config

func (*Config) WithRetries

func (c *Config) WithRetries(r int) *Config

func (*Config) WithSandboxHost

func (c *Config) WithSandboxHost() *Config

func (*Config) WithStdLogger

func (c *Config) WithStdLogger() *Config

func (*Config) WithTodaysVersion

func (c *Config) WithTodaysVersion() *Config

func (*Config) WithVersion

func (c *Config) WithVersion(v string) *Config

type Content

type Content struct {
	Content string `json:"content"`
	Locale  string `json:"locale"`
}

type Cost

type Cost struct {
	Type    string         `json:"type,omitempty"`
	Price   string         `json:"price,omitempty"`
	Unit    string         `json:"unit,omitempty"`
	RangeTo string         `json:"rangeTo,omitempty"`
	Other   string         `json:"other,omitempty"`
	Options []*CostOptions `json:"options,omitempty"`
}

type CostOptions

type CostOptions struct {
	Name    string `json:"name,omitempty"`
	Price   string `json:"price,omitempty"`
	Calorie int    `json:"calorie,omitempty"`
}

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 (c *CustomFieldManager) IsOptionSet(fieldName string, optionName string, loc *Location) (bool, error)

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) SetOption

func (c *CustomFieldManager) SetOption(fieldName string, optionName string, loc *Location) (*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 (c *CustomFieldManager) UnsetOption(fieldName string, optionName string, loc *Location) (*Location, error)

func (*CustomFieldManager) UnsetPhoto

func (c *CustomFieldManager) UnsetPhoto(name string, loc *Location) error

type CustomFieldOption

type CustomFieldOption struct {
	Key   string `json:"key,omitempty"`
	Value string `json:"value"`
}

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 (*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 Date

type Date string

func (Date) CustomFieldTag

func (d Date) 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 ErrorsFromString(errorStr string) ([]*Error, error)

func (Error) Error

func (e Error) Error() string

func (Error) ErrorWithoutUUID

func (e Error) ErrorWithoutUUID() string

func (Error) IsError

func (e Error) IsError() bool

func (Error) IsWarning

func (e Error) IsWarning() bool

type ErrorType

type ErrorType string

type Errors

type Errors []*Error

func (Errors) Error

func (e Errors) Error() string

func (Errors) Errors

func (e Errors) Errors() []*Error

func (Errors) Warnings

func (e Errors) Warnings() []*Error

type Event

type Event struct {
	ListItem
	Type   string       `json:"type,omitempty"`
	Starts string       `json:"starts,omitempty"`
	Ends   string       `json:"ends,omitempty"`
	Photos []*ListPhoto `json:"photos,omitempty"`
	Url    string       `json:"url,omitempty"`
}

type EventList

type EventList struct {
	List
	Sections []*EventListSection `json:"sections,omitempty"`
}

func (*EventList) Equal

func (a *EventList) Equal(b *EventList) bool

func (EventList) String

func (e EventList) String() string

type EventListSection

type EventListSection struct {
	ListSection
	Items []*Event `json:"items,omitempty"` // max 100 items
}

type EventListsResponse

type EventListsResponse struct {
	Count      int          `json:"count"`
	EventLists []*EventList `json:"events"`
}

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 FolderListResponse struct {
	Count   int       `json:"count"`
	Folders []*Folder `json:"folders"`
}

type FolderService

type FolderService struct {
	// contains filtered or unexported fields
}

func (*FolderService) List

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 Gallery []*Photo

func (*Gallery) CustomFieldTag

func (g *Gallery) CustomFieldTag() string

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

type HolidayHours struct {
	Date  string `json:"date"`
	Hours string `json:"hours"`
}

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

func (h Hours) CustomFieldTag() string

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 (*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 (e List) GetCurrency() string

func (List) GetId

func (e List) GetId() string

func (List) GetLanguage

func (e List) GetLanguage() string

func (List) GetName

func (e List) GetName() string

func (List) GetPublish

func (e List) GetPublish() bool

func (List) GetSize

func (e List) GetSize() int

func (List) GetTitle

func (e List) GetTitle() string

func (List) GetType

func (e List) GetType() string

type ListItem

type ListItem struct {
	Id          *string `json:"id"`
	Name        *string `json:"name,omitempty"`
	Description *string `json:"description,omitempty"`
}

func (ListItem) GetDescription

func (e ListItem) GetDescription() string

func (ListItem) GetId

func (e ListItem) GetId() string

func (ListItem) GetName

func (e ListItem) GetName() string

type ListOptions

type ListOptions struct {
	Limit                  int
	Offset                 int
	DisableCountValidation bool
	PageToken              string
}

type ListPhoto

type ListPhoto struct {
	Url           string `json:"url"`
	Height        int    `json:"height,omitempty"`
	Width         int    `json:"width,omitempty"`
	AlternateText string `json:"alternateText,omitempty"`
}

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 ListType

type ListType string
const (
	BIO     ListType = "BIOS"
	MENU    ListType = "MENU"
	PRODUCT ListType = "PRODUCTS"
	EVENT   ListType = "EVENTS"
)

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"`
	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

func (y Location) Diff(b *Location) (d *Location, diff bool)

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 (y Location) GetAcceptingNewPatients() bool

func (Location) GetAccountId

func (y Location) GetAccountId() string

func (Location) GetAdditionalHoursText

func (y Location) GetAdditionalHoursText() string

func (Location) GetAddress

func (y Location) GetAddress() string

func (Location) GetAddress2

func (y Location) GetAddress2() string

func (Location) GetAdmittingHospitals

func (y Location) GetAdmittingHospitals() (v []string)

func (Location) GetAlternatePhone

func (y Location) GetAlternatePhone() string

func (Location) GetAssociations

func (y Location) GetAssociations() (v []string)

func (Location) GetBioListIds

func (y Location) GetBioListIds() (v []string)

func (Location) GetBrands

func (y Location) GetBrands() (v []string)

func (Location) GetCategoryIds

func (y Location) GetCategoryIds() (v []string)

func (Location) GetCertifications

func (y Location) GetCertifications() []string

func (Location) GetCity

func (y Location) GetCity() string

func (Location) GetCountryCode

func (y Location) GetCountryCode() string

func (Location) GetDegrees

func (y Location) GetDegrees() []string

func (Location) GetDescription

func (y Location) GetDescription() string

func (Location) GetDisplayAddress

func (y Location) GetDisplayAddress() string

func (Location) GetDisplayLat

func (y Location) GetDisplayLat() float64

func (Location) GetDisplayLng

func (y Location) GetDisplayLng() float64

func (Location) GetDisplayWebsiteUrl

func (y Location) GetDisplayWebsiteUrl() string

func (Location) GetEmails

func (y Location) GetEmails() (v []string)

func (Location) GetEventListIds

func (y Location) GetEventListIds() (v []string)

func (Location) GetFacebookPageUrl

func (y Location) GetFacebookPageUrl() string

func (Location) GetFaxPhone

func (y Location) GetFaxPhone() string

func (Location) GetFeaturedMessage

func (y Location) GetFeaturedMessage() string

func (Location) GetFeaturedMessageUrl

func (y Location) GetFeaturedMessageUrl() string

func (Location) GetFirstName

func (y Location) GetFirstName() string

func (Location) GetFirstPartyReviewPage

func (y Location) GetFirstPartyReviewPage() string

func (Location) GetFolderId

func (y Location) GetFolderId() string

func (Location) GetGender

func (y Location) GetGender() string

func (Location) GetGoogleAttributes

func (y Location) GetGoogleAttributes() GoogleAttributes

func (Location) GetHolidayHours

func (y Location) GetHolidayHours() []HolidayHours

func (Location) GetHours

func (y Location) GetHours() string

func (Location) GetISORegionCode

func (y Location) GetISORegionCode() string

func (Location) GetId

func (y Location) GetId() string

func (Location) GetIsPhoneTracked

func (y Location) GetIsPhoneTracked() bool

func (Location) GetKeywords

func (y Location) GetKeywords() (v []string)

func (Location) GetLabelIds

func (y Location) GetLabelIds() (v UnorderedStrings)

func (Location) GetLanguage

func (y Location) GetLanguage() (v string)

func (Location) GetLanguages

func (y Location) GetLanguages() (v []string)

func (Location) GetLastName

func (y Location) GetLastName() string

func (Location) GetLocalPhone

func (y Location) GetLocalPhone() string

func (Location) GetLocationType

func (y Location) GetLocationType() string

func (Location) GetMenuListIds

func (y Location) GetMenuListIds() (v []string)

func (Location) GetMiddleName

func (y Location) GetMiddleName() string

func (Location) GetMobilePhone

func (y Location) GetMobilePhone() string

func (Location) GetNPI

func (y Location) GetNPI() string

func (Location) GetName

func (y Location) GetName() string

func (Location) GetOfficeName

func (y Location) GetOfficeName() string

func (Location) GetPaymentOptions

func (y Location) GetPaymentOptions() (v []string)

func (Location) GetPhone

func (y Location) GetPhone() string

func (Location) GetProductListIds

func (y Location) GetProductListIds() (v []string)

func (Location) GetReservationUrl

func (y Location) GetReservationUrl() string

func (Location) GetReviewBalancingURL

func (y Location) GetReviewBalancingURL() string

func (Location) GetRoutableLat

func (y Location) GetRoutableLat() float64

func (Location) GetRoutableLng

func (y Location) GetRoutableLng() float64

func (Location) GetServices

func (y Location) GetServices() (v []string)

func (Location) GetSpecialties

func (y Location) GetSpecialties() (v []string)

func (Location) GetState

func (y Location) GetState() string

func (Location) GetSuppressAddress

func (y Location) GetSuppressAddress() bool

func (Location) GetTollFreePhone

func (y Location) GetTollFreePhone() string

func (Location) GetTtyPhone

func (y Location) GetTtyPhone() string

func (Location) GetTwitterHandle

func (y Location) GetTwitterHandle() string

func (Location) GetVideoUrls

func (y Location) GetVideoUrls() (v []string)

func (Location) GetWebsiteUrl

func (y Location) GetWebsiteUrl() string

func (Location) GetYearEstablished

func (y Location) GetYearEstablished() string

func (Location) GetZip

func (y Location) GetZip() string

func (Location) IsClosed

func (y Location) IsClosed() bool

func (*Location) SetLabelIds

func (y *Location) SetLabelIds(v []string)

func (*Location) SetLabelIdsWithUnorderedStrings

func (y *Location) SetLabelIdsWithUnorderedStrings(v UnorderedStrings)

func (Location) String

func (y Location) String() string

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 LocationListResponse struct {
	Count         int         `json:"count"`
	Locations     []*Location `json:"locations"`
	NextPageToken string      `json:"nextPageToken"`
}

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) Create

func (l *LocationService) Create(y *Location) (*Response, error)

func (*LocationService) Edit

func (l *LocationService) Edit(y *Location) (*Response, error)

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 (*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 Menu struct {
	ListItem
	Cost     *Cost      `json:"cost,omitempty"`
	Photo    *ListPhoto `json:"photo,omitempty"`
	Calories *Calories  `json:"calories,omitempty"`
}
type MenuList struct {
	List
	Sections []*MenuListSection `json:"sections,omitempty"`
}
func (a *MenuList) Equal(b *MenuList) bool
func (m MenuList) String() string
type MenuListSection struct {
	ListSection
	Items []*Menu `json:"items,omitempty"` // max 100 items
}
type MenuListsResponse struct {
	Count     int         `json:"count"`
	MenuLists []*MenuList `json:"menus"`
}

type Meta

type Meta struct {
	UUID   string `json:"uuid"`
	Errors Errors `json:"errors,omitempty"`
}

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 Number

type Number string

func (Number) CustomFieldTag

func (n Number) CustomFieldTag() 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

func (p *Photo) CustomFieldTag() string

func (Photo) String

func (l Photo) String() string

type Product

type Product struct {
	ListItem
	Type   string       `json:"idcode,omitempty"`
	Cost   *Cost        `json:"cost,omitempty"`
	Photos []*ListPhoto `json:"photos,omitempty"`
	Video  string       `json:"video,omitempty"`
	Url    string       `json:"url,omitempty"`
}

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 Response

type Response struct {
	// HttpResponse *http.Response Maybe want this in the future?
	Meta               Meta             `json:"meta"`
	Response           interface{}      `json:"-"`
	ResponseRaw        *json.RawMessage `json:"response,omitempty"`
	RateLimitLimit     int              `json:"-"`
	RateLimitRemaining int              `json:"-"`
	RateLimitReset     int              `json:"-"`
}

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 (y Review) GetAuthorEmail() string

func (Review) GetAuthorName

func (y Review) GetAuthorName() string

func (Review) GetComments

func (y Review) GetComments() (v []Comment)

func (Review) GetContent

func (y Review) GetContent() string

func (Review) GetExternalId

func (y Review) GetExternalId() string

func (Review) GetId

func (y Review) GetId() int

func (Review) GetLabelIds

func (y Review) GetLabelIds() (v []int)

func (Review) GetLastYextUpdateDate

func (y Review) GetLastYextUpdateDate() int

func (Review) GetLocationId

func (y Review) GetLocationId() string

func (Review) GetPublisherDate

func (y Review) GetPublisherDate() int

func (Review) GetPublisherId

func (y Review) GetPublisherId() string

func (Review) GetRating

func (y Review) GetRating() float64

func (Review) GetReviewLabels

func (y Review) GetReviewLabels() (v []ReviewLabel)

func (Review) GetStatus

func (y Review) GetStatus() string

func (Review) GetTitle

func (y Review) GetTitle() string

func (Review) GetURL

func (y Review) GetURL() string

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

type ReviewLabel struct {
	Id   *int    `json:"id"`
	Name *string `json:"name"`
}

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 ReviewListResponse struct {
	Count         int       `json:"count"`
	AverageRating float64   `json:"averageRating"`
	Reviews       []*Review `json:"reviews"`
	NextPageToken string    `json:"nextPageToken"`
}

type ReviewService

type ReviewService struct {
	// contains filtered or unexported fields
}

func (*ReviewService) CreateInvitation

func (l *ReviewService) CreateInvitation(jsonData []Reviewer) (*[]ReviewCreateInvitationResponse, *Response, error)

func (*ReviewService) Get

func (l *ReviewService) Get(id int) (*Review, *Response, error)

func (*ReviewService) List

func (*ReviewService) ListAll

func (l *ReviewService) ListAll() ([]*Review, error)

func (*ReviewService) ListAllWithOptions

func (l *ReviewService) ListAllWithOptions(rlOpts *ReviewListOptions) ([]*Review, error)

type Reviewer

type Reviewer struct {
	LocationId *string `json:"locationId"`
	FirstName  *string `json:"firstName"`
	LastName   *string `json:"lastName"`
	Contact    *string `json:"contact"`
	Image      *bool   `json:"image"`
	TemplateId *string `json:"templateId"`
}

type Role

type Role struct {
	Id   *string `json:"roleId,omitempty"`
	Name *string `json:"roleName,omitempty"`
}

func (Role) Diff

func (a Role) Diff(b Role) (Role, bool)

Diff performs a diff of two roles and their parameters.

func (*Role) GetId

func (r *Role) GetId() string

func (*Role) GetName

func (r *Role) GetName() string

func (*Role) String

func (r *Role) String() string

type RolesListResponse

type RolesListResponse struct {
	Count int     `json:"count"`
	Roles []*Role `json:"roles"`
}

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 TextList

type TextList []string

func (TextList) CustomFieldTag

func (t TextList) CustomFieldTag() 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 Url

type Url string

func (Url) CustomFieldTag

func (u Url) CustomFieldTag() string

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) Copy

func (u *User) Copy() (n *User)

func (*User) Diff

func (a *User) Diff(b *User) (d *User, diff bool)

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 (u *User) GetEmailAddress() string

func (*User) GetFirstName

func (u *User) GetFirstName() string

func (*User) GetId

func (u *User) GetId() string

func (*User) GetLastName

func (u *User) GetLastName() string

func (*User) GetPassword

func (u *User) GetPassword() string

func (*User) GetPhoneNumber

func (u *User) GetPhoneNumber() string

func (*User) GetSSO

func (u *User) GetSSO() bool

func (*User) GetUserName

func (u *User) GetUserName() string

func (*User) String

func (u *User) String() string

type UserListResponse

type UserListResponse struct {
	Count int     `json:"count"`
	Users []*User `json:"users"`
}

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

func (*UserService) Create

func (u *UserService) Create(y *User) (*Response, error)

func (*UserService) Delete

func (u *UserService) Delete(y *User) (*Response, error)

func (*UserService) Edit

func (u *UserService) Edit(y *User) (*Response, error)

func (*UserService) Get

func (u *UserService) Get(id string) (*User, *Response, error)

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 Video

type Video struct {
	Description string `json:"description"`
	Url         string `json:"url"`
}

type VideoGallery

type VideoGallery []Video

func (*VideoGallery) CustomFieldTag

func (v *VideoGallery) CustomFieldTag() string

type Weekday

type Weekday int
const (
	Sunday Weekday = iota + 1
	Monday
	Tuesday
	Wednesday
	Thursday
	Friday
	Saturday
)

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/

func (Weekday) ToString

func (w Weekday) ToString() string

type YesNo

type YesNo bool

func (YesNo) CustomFieldTag

func (y YesNo) CustomFieldTag() string

Directories

Path Synopsis
TODO: Make these into real *testing.T tests
TODO: Make these into real *testing.T tests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL