Documentation
¶
Overview ¶
Package yext provides bindings for Yext Platform API.
For full Platform API documentation visit https://www.yext.com/support/platform-api/
Usage ¶
Create an authenticated client
// `user`, `pass`, and `customerid` should be populated with
// account credentials for a user that has the "API Access" role.
client := yext.NewClient(yext.NewDefaultConfig().WithCredentials("[user]", "[pass]", "[customerid]"))
List all locations
locs, err := client.LocationService.List()
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().WithCredentials("[user]", "[password]", "[customerid]")
// Set authentication parameters from environment
yext.NewDefaultConfig().WithEnvCredentials()
// Communicate with Yext Sandbox
yext.NewConfig().WithSandboxHost()
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 ErrorResponse objects. The ErrorReponse contains a list of encountered errors, each with a Message and Code, as well as the raw http.Response object. A full list a expected errors can be found here: https://www.yext.com/support/platform-api/#API_Conventions_and_Authentication.htm
_, err := client.LocationService.Create(&yext.Location{})
// {"errors": [{"code": "123", message": "Id cannot be blank"}]}
One exception to the above is 404 "Not Found" errors which are returned as the named error `ResourceNotFound`.
All non-4xx errors (transport, API 5xx responses, etc.) are elligible for automatic retries.
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.
- CustomFieldService
- ECLService
- FolderService
- LicenseService
- 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 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 CheckResponseError(res *http.Response) (bool, error)
- func ECLs(ecls []ECL) *[]ECL
- func Float(v float64) *float64
- func Int(v int) *int
- func ParseCustomFields(cfraw map[string]interface{}, cfs []*CustomField) (map[string]interface{}, error)
- func String(v string) *string
- func Strings(v []string) *[]string
- type ACL
- type AccessOn
- type BackoffPolicy
- type Bio
- type BiosECL
- type BiosECLSection
- type Category
- type CategoryService
- type Client
- func (c *Client) Do(req *http.Request, v interface{}) error
- func (c *Client) DoRawRequest(method string, path string, v interface{}) error
- func (c *Client) DoRawRequestJSON(method string, path string, obj interface{}, v interface{}) error
- func (c *Client) DoRequest(method string, path string, v interface{}) error
- func (c *Client) DoRequestJSON(method string, path string, obj interface{}, v interface{}) error
- func (c *Client) NewCustomerRequestBody(method string, path string, data []byte) (*http.Request, error)
- func (c *Client) NewRawRequest(method string, path string) (*http.Request, error)
- func (c *Client) NewRawRequestBody(method string, path string, data []byte) (*http.Request, error)
- func (c *Client) NewRawRequestJSON(method string, path string, obj interface{}) (*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)
- type Comparable
- type Config
- func (c *Config) WithBaseUrl(baseUrl string) *Config
- func (c *Config) WithCredentials(username, password, customerid 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) WithProductionHost() *Config
- func (c *Config) WithRetries(r int) *Config
- func (c *Config) WithSandboxHost() *Config
- func (c *Config) WithStdLogger() *Config
- 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) CustomFieldOptionId(fieldName, optionName string) (string, error)
- func (c *CustomFieldManager) Get(name string, loc *Location) (interface{}, 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) MustCustomFieldOptionId(fieldName, optionName string) string
- func (c *CustomFieldManager) MustGet(name string, loc *Location) interface{}
- 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) MustSetOption(fieldName string, optionName string, loc *Location) *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) SetOption(fieldName string, optionName string, loc *Location) (*Location, error)
- func (c *CustomFieldManager) UnsetOption(fieldName string, optionName string, loc *Location) (*Location, error)
- type CustomFieldService
- type CustomFieldType
- type CustomFieldValue
- type Date
- type ECL
- type ECLItem
- type ECLSection
- type ECLService
- func (e *ECLService) Create(y *ECL) (*ECL, error)
- func (e *ECLService) CreateBioList(y *BiosECL) (*BiosECL, error)
- func (e *ECLService) CreateEventList(y *EventsECL) (*EventsECL, error)
- func (e *ECLService) CreateProductList(y *ProductsECL) (*ProductsECL, error)
- func (e *ECLService) Edit(y *ECL) (*ECL, error)
- func (e *ECLService) EditBioList(y *BiosECL) (*BiosECL, error)
- func (e *ECLService) EditEventList(y *EventsECL) (*EventsECL, error)
- func (e *ECLService) EditProductList(y *ProductsECL) (*ProductsECL, error)
- func (e *ECLService) GetBioList(id string) (*BiosECL, error)
- func (e *ECLService) GetEventList(id string) (*EventsECL, error)
- func (e *ECLService) GetList(id string) (*ECL, error)
- func (e *ECLService) GetProductList(id string) (*ProductsECL, error)
- func (e *ECLService) List() (*ListECLResponse, error)
- type EclPhoto
- type Error
- type ErrorResponse
- type Event
- type EventsECL
- type EventsECLSection
- type Folder
- type FolderService
- type Gallery
- type HolidayHours
- type Hours
- type LicensePack
- type LicenseService
- func (l *LicenseService) AddLocationToLicense(licenseId string, locationId string) (*LicensePack, error)
- func (l *LicenseService) AddLocationsToLicenseBulk(licenseId string, locationIds []string) (*LicensePack, error)
- func (l *LicenseService) Get(id string) (*LicensePack, error)
- func (l *LicenseService) RemoveLocationFromLicense(licenseId string, locationId string) (*LicensePack, error)
- func (l *LicenseService) RemoveLocationsFromLicenseBulk(licenseId string, locationIds []string) (*LicensePack, error)
- type ListECLResponse
- type Location
- func (y Location) Diff(b *Location) (d *Location, diff bool)
- 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) GetBrands() (v []string)
- func (y Location) GetCategoryIds() (v []string)
- func (y Location) GetCity() string
- func (y Location) GetCountryCode() string
- func (y Location) GetCustomerId() 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) GetFacebookPageUrl() string
- func (y Location) GetFaxPhone() string
- func (y Location) GetFirstName() string
- func (y Location) GetFolderId() string
- func (y Location) GetHours() 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) GetLanguages() (v []string)
- func (y Location) GetLastName() string
- func (y Location) GetLists() (v []ECL)
- func (y Location) GetLocalPhone() string
- func (y Location) GetLocationType() string
- func (y Location) GetMiddleName() string
- func (y Location) GetMobilePhone() string
- func (y Location) GetNPI() string
- func (y Location) GetName() string
- func (y Location) GetPaymentOptions() (v []string)
- func (y Location) GetPhone() string
- func (y Location) GetReservationUrl() string
- func (y Location) GetRoutableLat() float64
- func (y Location) GetRoutableLng() float64
- func (y Location) GetServices() (v []string)
- func (y Location) GetSpecialOffer() string
- func (y Location) GetSpecialOfferUrl() 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) SetLabelIds(v []string)
- func (y Location) SetLabelIdsWithUnorderedStrings(v UnorderedStrings)
- func (y Location) String() string
- type LocationClosed
- type LocationPhoto
- type LocationService
- func (l *LocationService) Create(y *Location) (*Location, error)
- func (l *LocationService) Edit(y *Location) (*Location, error)
- func (l *LocationService) Get(id string) (*Location, error)
- func (l *LocationService) HydrateLocation(loc *Location) (*Location, error)
- func (l *LocationService) HydrateLocations(locs []*Location) ([]*Location, error)
- func (l *LocationService) List() ([]*Location, error)
- func (l *LocationService) ListBySearchIds(searchIds []string) ([]*Location, error)
- type Logger
- type MultiLineText
- type MultiOption
- type Number
- type OptionField
- type Photo
- type Product
- type ProductsECL
- type ProductsECLSection
- type Role
- 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 UserService
- func (u *UserService) AvailableRoles() ([]*Role, error)
- func (u *UserService) Create(y *User) (*User, error)
- func (u *UserService) Delete(y *User) error
- func (u *UserService) Edit(y *User) (*User, error)
- func (u *UserService) Get(id string) (*User, error)
- func (u *UserService) List(start, limit int) ([]*User, error)
- func (u *UserService) ListAll() ([]*User, error)
- func (u *UserService) NewCustomerACL(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 YesNo
Constants ¶
const ( ACCESS_CUSTOMER = AccessOn("CUSTOMER") ACCESS_FOLDER = AccessOn("FOLDER") ACCESS_LOCATION = AccessOn("LOCATION") )
const ( SandboxHost string = "api-sandbox.yext.com" ProductionHost string = "api.yext.com" )
const ( CUSTOMFIELDTYPE_YESNO = "BOOLEAN" CUSTOMFIELDTYPE_SINGLELINETEXT = "TEXT" CUSTOMFIELDTYPE_MULTILINETEXT = "MULTILINETEXT" CUSTOMFIELDTYPE_SINGLEOPTION = "SINGLEOPTION" CUSTOMFIELDTYPE_URL = "URL" CUSTOMFIELDTYPE_DATE = "DATE" CUSTOMFIELDTYPE_NUMBER = "NUMBER" CUSTOMFIELDTYPE_MULTIOPTION = "MULTIOPTION" CUSTOMFIELDTYPE_TEXTLIST = "TEXTLIST" CUSTOMFIELDTYPE_PHOTO = "PHOTO" CUSTOMFIELDTYPE_GALLERY = "GALLERY" CUSTOMFIELDTYPE_VIDEO = "VIDEO" CUSTOMFIELDTYPE_HOURS = "HOURS" CUSTOMFIELDTYPE_CUSTOMHOURS = "HOURS" )
const (
CUSTOMERS_PATH string = "customers"
)
Variables ¶
var DefaultBackoffPolicy = BackoffPolicy{ []int{0, 0, 1000, 5000}, }
Default is a backoff policy ranging up to 5 seconds.
var ResourceNotFound = errors.New("Resource not found")
Functions ¶
func BioItemCompare ¶
func ParseCustomFields ¶
func ParseCustomFields(cfraw map[string]interface{}, cfs []*CustomField) (map[string]interface{}, error)
Types ¶
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 {
ECLItem
Title string `json:"title,omitempty"`
Photo *EclPhoto `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 BiosECL ¶
type BiosECL struct {
ECL
Sections []*BiosECLSection `json:"sections,omitempty"`
}
type BiosECLSection ¶
type BiosECLSection struct {
ECLSection
Items []*Bio `json:"items,omitempty"` // max 100 items
}
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 https://www.yext.com/support/platform-api/#Info_API/Categories.htm
type CategoryService ¶
type CategoryService struct {
// contains filtered or unexported fields
}
func (*CategoryService) List ¶
func (s *CategoryService) List() ([]*Category, error)
type Client ¶
type Client struct {
Config *Config
LocationService *LocationService
ECLService *ECLService
CustomFieldService *CustomFieldService
FolderService *FolderService
CategoryService *CategoryService
LicenseService *LicenseService
UserService *UserService
}
func (*Client) DoRawRequest ¶
func (*Client) DoRawRequestJSON ¶
func (*Client) DoRequestJSON ¶
func (*Client) NewCustomerRequestBody ¶
func (*Client) NewRawRequest ¶
func (*Client) NewRawRequestBody ¶
func (*Client) NewRawRequestJSON ¶
func (*Client) NewRequest ¶
func (*Client) NewRequestBody ¶
type Comparable ¶
type Comparable interface {
Equal(Comparable) bool
}
type Config ¶
type Config struct {
HTTPClient *http.Client
BaseUrl string
Username string
Password string
CustomerId string
RetryCount *int
Logger Logger
}
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
func (*Config) WithBaseUrl ¶
func (*Config) WithCredentials ¶
func (*Config) WithEnvCredentials ¶
func (*Config) WithLogger ¶
func (*Config) WithProductionHost ¶
func (*Config) WithRetries ¶
func (*Config) WithSandboxHost ¶
func (*Config) WithStdLogger ¶
type CostOptions ¶
type CustomField ¶
type CustomField struct {
Name string `json:"name"`
Id string `json:"id"`
Options map[string]string `json:"options"` // Only present for multi-option custom fields
Type string `json:"type"`
}
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) String ¶
func (c CustomField) String() 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) CustomFieldOptionId ¶
func (c *CustomFieldManager) CustomFieldOptionId(fieldName, optionName string) (string, error)
func (*CustomFieldManager) Get ¶
func (c *CustomFieldManager) Get(name string, loc *Location) (interface{}, error)
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) MustCustomFieldOptionId ¶
func (c *CustomFieldManager) MustCustomFieldOptionId(fieldName, optionName string) string
func (*CustomFieldManager) MustGet ¶
func (c *CustomFieldManager) MustGet(name string, loc *Location) interface{}
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) MustSetOption ¶
func (c *CustomFieldManager) MustSetOption(fieldName string, optionName string, loc *Location) *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)
func (*CustomFieldManager) UnsetOption ¶
type CustomFieldService ¶
type CustomFieldService struct {
CustomFieldManager *CustomFieldManager
// contains filtered or unexported fields
}
func (*CustomFieldService) CacheCustomFields ¶
func (s *CustomFieldService) CacheCustomFields() error
func (*CustomFieldService) List ¶
func (s *CustomFieldService) List() ([]*CustomField, error)
func (*CustomFieldService) MustCacheCustomFields ¶
func (s *CustomFieldService) MustCacheCustomFields()
type CustomFieldType ¶
type CustomFieldType string
type CustomFieldValue ¶
type CustomFieldValue interface {
CustomFieldTag() string
}
type ECL ¶
type ECL 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"`
Currency *string `json:"currency,omitempty"` // ISO Code for currency
Sections []*ECLSection `json:"sections,omitempty"`
}
func (ECL) GetCurrency ¶
func (ECL) GetPublish ¶
type ECLItem ¶
type ECLItem struct {
Id *string `json:"id"`
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
}
func (ECLItem) GetDescription ¶
type ECLSection ¶
type ECLSection struct {
Id *string `json:"id"`
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
}
func (ECLSection) GetDescription ¶
func (e ECLSection) GetDescription() string
func (ECLSection) GetId ¶
func (e ECLSection) GetId() string
func (ECLSection) GetName ¶
func (e ECLSection) GetName() string
type ECLService ¶
type ECLService struct {
// contains filtered or unexported fields
}
func (*ECLService) CreateBioList ¶
func (e *ECLService) CreateBioList(y *BiosECL) (*BiosECL, error)
func (*ECLService) CreateEventList ¶
func (e *ECLService) CreateEventList(y *EventsECL) (*EventsECL, error)
func (*ECLService) CreateProductList ¶
func (e *ECLService) CreateProductList(y *ProductsECL) (*ProductsECL, error)
func (*ECLService) EditBioList ¶
func (e *ECLService) EditBioList(y *BiosECL) (*BiosECL, error)
func (*ECLService) EditEventList ¶
func (e *ECLService) EditEventList(y *EventsECL) (*EventsECL, error)
func (*ECLService) EditProductList ¶
func (e *ECLService) EditProductList(y *ProductsECL) (*ProductsECL, error)
func (*ECLService) GetBioList ¶
func (e *ECLService) GetBioList(id string) (*BiosECL, error)
func (*ECLService) GetEventList ¶
func (e *ECLService) GetEventList(id string) (*EventsECL, error)
func (*ECLService) GetProductList ¶
func (e *ECLService) GetProductList(id string) (*ProductsECL, error)
func (*ECLService) List ¶
func (e *ECLService) List() (*ListECLResponse, error)
type ErrorResponse ¶
func (*ErrorResponse) Error ¶
func (e *ErrorResponse) Error() string
type EventsECL ¶
type EventsECL struct {
ECL
Sections []*EventsECLSection `json:"sections,omitempty"`
}
type EventsECLSection ¶
type EventsECLSection struct {
ECLSection
Items []*Event `json:"items,omitempty"` // max 100 items
}
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 https://www.yext.com/support/platform-api/#Administration_API/Folders.htm
type FolderService ¶
type FolderService struct {
// contains filtered or unexported fields
}
func (*FolderService) List ¶
func (s *FolderService) List() ([]*Folder, error)
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 LicensePack ¶
type LicenseService ¶
type LicenseService struct {
// contains filtered or unexported fields
}
func (*LicenseService) AddLocationToLicense ¶
func (l *LicenseService) AddLocationToLicense(licenseId string, locationId string) (*LicensePack, error)
func (*LicenseService) AddLocationsToLicenseBulk ¶
func (l *LicenseService) AddLocationsToLicenseBulk(licenseId string, locationIds []string) (*LicensePack, error)
func (*LicenseService) Get ¶
func (l *LicenseService) Get(id string) (*LicensePack, error)
func (*LicenseService) RemoveLocationFromLicense ¶
func (l *LicenseService) RemoveLocationFromLicense(licenseId string, locationId string) (*LicensePack, error)
func (*LicenseService) RemoveLocationsFromLicenseBulk ¶
func (l *LicenseService) RemoveLocationsFromLicenseBulk(licenseId string, locationIds []string) (*LicensePack, error)
type ListECLResponse ¶
type ListECLResponse struct {
AllLists []*ECL
ProductLists []*ProductsECL
BioLists []*BiosECL
EventsLists []*EventsECL
}
ListECLResponse is a calculated value that provides typed access to an underlying 'ListECL' response
type Location ¶
type Location struct {
Id *string `json:"id,omitempty"`
Name *string `json:"locationName,omitempty"`
LocationType *string `json:"locationType,omitempty"`
FirstName *string `json:"firstName,omitempty"`
MiddleName *string `json:"middleName,omitempty"`
LastName *string `json:"lastName,omitempty"`
NPI *string `json:"npi,omitempty"`
Lists *[]ECL `json:"lists,omitempty"`
Keywords *[]string `json:"keywords,omitempty"`
Associations *[]string `json:"associations,omitempty"`
CustomFields map[string]interface{} `json:"customFields,omitempty"`
CustomerId *string `json:"customerId,omitempty"`
Address *string `json:"address,omitempty"`
Address2 *string `json:"address2,omitempty"`
SuppressAddress *bool `json:"suppressAddress,omitempty"`
DisplayAddress *string `json:"displayAddress,omitempty"`
City *string `json:"city,omitempty"`
State *string `json:"state,omitempty"`
Zip *string `json:"zip,omitempty"`
CountryCode *string `json:"countryCode,omitempty"`
Phone *string `json:"phone,omitempty"`
IsPhoneTracked *bool `json:"isPhoneTracked,omitempty"`
LocalPhone *string `json:"localPhone,omitempty"`
AlternatePhone *string `json:"alternatePhone,omitempty"`
FaxPhone *string `json:"faxPhone,omitempty"`
MobilePhone *string `json:"mobilePhone,omitempty"`
TollFreePhone *string `json:"tollFreePhone,omitempty"`
TtyPhone *string `json:"ttyPhone,omitempty"`
SpecialOffer *string `json:"specialOffer,omitempty"`
SpecialOfferUrl *string `json:"specialOfferUrl,omitempty"`
WebsiteUrl *string `json:"websiteUrl,omitempty"`
DisplayWebsiteUrl *string `json:"displayWebsiteUrl,omitempty"`
ReservationUrl *string `json:"reservationUrl,omitempty"`
Hours *string `json:"hours,omitempty"` // A concrete type would be nice for this
AdditionalHoursText *string `json:"additionalHoursText,omitempty"`
Description *string `json:"description,omitempty"`
PaymentOptions *[]string `json:"paymentOptions,omitempty"`
VideoUrls *[]string `json:"videoUrls,omitempty"`
TwitterHandle *string `json:"twitterHandle,omitempty"`
FacebookPageUrl *string `json:"facebookPageUrl,omitempty"`
YearEstablished *string `json:"yearEstablished,omitempty"`
DisplayLat *float64 `json:"displayLat,omitempty"`
DisplayLng *float64 `json:"displayLng,omitempty"`
RoutableLat *float64 `json:"routableLat,omitempty"`
RoutableLng *float64 `json:"routableLng,omitempty"`
Emails *[]string `json:"emails,omitempty"`
Specialties *[]string `json:"specialties,omitempty"`
Services *[]string `json:"services,omitempty"`
Brands *[]string `json:"brands,omitempty"`
Languages *[]string `json:"languages,omitempty"`
FolderId *string `json:"folderId,omitempty"`
LabelIds *UnorderedStrings `json:"labelIds,omitempty"`
FacebookCoverPhoto *LocationPhoto `json:"facebookCoverPhoto,omitempty"`
FacebookProfilePicture *LocationPhoto `json:"facebookProfilePicture,omitempty"`
Logo *LocationPhoto `json:"logo,omitempty"`
Photos []LocationPhoto `json:"photos,omitempty"`
Closed *LocationClosed `json:"closed,omitempty"`
CategoryIds *[]string `json:"categoryIds,omitempty"`
HolidayHours []HolidayHours `json:"holidayHours,omitempty"`
AdmittingHospitals *[]string `json:"admittingHospitals,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 (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) GetAdditionalHoursText ¶
func (Location) GetAddress ¶
func (Location) GetAddress2 ¶
func (Location) GetAdmittingHospitals ¶
func (Location) GetAlternatePhone ¶
func (Location) GetAssociations ¶
func (Location) GetCategoryIds ¶
func (Location) GetCountryCode ¶
func (Location) GetCustomerId ¶
func (Location) GetDescription ¶
func (Location) GetDisplayAddress ¶
func (Location) GetDisplayLat ¶
func (Location) GetDisplayLng ¶
func (Location) GetDisplayWebsiteUrl ¶
func (Location) GetFacebookPageUrl ¶
func (Location) GetFaxPhone ¶
func (Location) GetFirstName ¶
func (Location) GetFolderId ¶
func (Location) GetIsPhoneTracked ¶
func (Location) GetKeywords ¶
func (Location) GetLabelIds ¶
func (y Location) GetLabelIds() (v UnorderedStrings)
func (Location) GetLanguages ¶
func (Location) GetLastName ¶
func (Location) GetLocalPhone ¶
func (Location) GetLocationType ¶
func (Location) GetMiddleName ¶
func (Location) GetMobilePhone ¶
func (Location) GetPaymentOptions ¶
func (Location) GetReservationUrl ¶
func (Location) GetRoutableLat ¶
func (Location) GetRoutableLng ¶
func (Location) GetServices ¶
func (Location) GetSpecialOffer ¶
func (Location) GetSpecialOfferUrl ¶
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 string `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 LocationPhoto ¶
type LocationPhoto struct {
Url string `json:"url,omitempty"`
Description string `json:"description,omitempty"`
ClickThroughURL string `json:"clickthroughUrl,omitempty"`
}
Photo 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) HydrateLocation ¶
func (l *LocationService) HydrateLocation(loc *Location) (*Location, error)
func (*LocationService) HydrateLocations ¶
func (l *LocationService) HydrateLocations(locs []*Location) ([]*Location, error)
func (*LocationService) List ¶
func (l *LocationService) List() ([]*Location, error)
func (*LocationService) ListBySearchIds ¶
func (l *LocationService) ListBySearchIds(searchIds []string) ([]*Location, error)
type Logger ¶
type Logger interface {
Log(...interface{})
}
func NewStdLogger ¶
func NewStdLogger() Logger
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 ProductsECL ¶
type ProductsECL struct {
ECL
Sections []*ProductsECLSection `json:"sections,omitempty"`
}
type ProductsECLSection ¶
type ProductsECLSection struct {
ECLSection
Items []*Product `json:"items,omitempty"` // max 100 items
}
type SingleLineText ¶
type SingleLineText string
func (SingleLineText) CustomFieldTag ¶
func (s SingleLineText) CustomFieldTag() string
type SingleOption ¶
type SingleOption string
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 UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func (*UserService) AvailableRoles ¶
func (u *UserService) AvailableRoles() ([]*Role, error)
func (*UserService) Delete ¶
func (u *UserService) Delete(y *User) error
func (*UserService) ListAll ¶
func (u *UserService) ListAll() ([]*User, error)
func (*UserService) NewCustomerACL ¶
func (u *UserService) NewCustomerACL(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