1package entitysearch 2 3// Copyright (c) Microsoft Corporation. All rights reserved. 4// Licensed under the MIT License. See License.txt in the project root for license information. 5// 6// Code generated by Microsoft (R) AutoRest Code Generator. 7// Changes may cause incorrect behavior and will be lost if the code is regenerated. 8 9import ( 10 "encoding/json" 11 "github.com/Azure/go-autorest/autorest" 12) 13 14// The package's fully qualified name. 15const fqdn = "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v1.0/entitysearch" 16 17// Airport ... 18type Airport struct { 19 // IataCode - READ-ONLY 20 IataCode *string `json:"iataCode,omitempty"` 21 // IcaoCode - READ-ONLY 22 IcaoCode *string `json:"icaoCode,omitempty"` 23 // Address - READ-ONLY; The postal address of where the entity is located 24 Address *PostalAddress `json:"address,omitempty"` 25 // Telephone - READ-ONLY; The entity's telephone number 26 Telephone *string `json:"telephone,omitempty"` 27 // Name - READ-ONLY; The name of the thing represented by this object. 28 Name *string `json:"name,omitempty"` 29 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 30 URL *string `json:"url,omitempty"` 31 // Image - READ-ONLY 32 Image *ImageObject `json:"image,omitempty"` 33 // Description - READ-ONLY; A short description of the item. 34 Description *string `json:"description,omitempty"` 35 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 36 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 37 // BingID - READ-ONLY; An ID that uniquely identifies this item. 38 BingID *string `json:"bingId,omitempty"` 39 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 40 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 41 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 42 WebSearchURL *string `json:"webSearchUrl,omitempty"` 43 // ID - READ-ONLY; A String identifier. 44 ID *string `json:"id,omitempty"` 45 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 46 Type TypeBasicResponseBase `json:"_type,omitempty"` 47} 48 49// MarshalJSON is the custom marshaler for Airport. 50func (a Airport) MarshalJSON() ([]byte, error) { 51 a.Type = TypeAirport 52 objectMap := make(map[string]interface{}) 53 if a.Type != "" { 54 objectMap["_type"] = a.Type 55 } 56 return json.Marshal(objectMap) 57} 58 59// AsImageObject is the BasicResponseBase implementation for Airport. 60func (a Airport) AsImageObject() (*ImageObject, bool) { 61 return nil, false 62} 63 64// AsThing is the BasicResponseBase implementation for Airport. 65func (a Airport) AsThing() (*Thing, bool) { 66 return nil, false 67} 68 69// AsBasicThing is the BasicResponseBase implementation for Airport. 70func (a Airport) AsBasicThing() (BasicThing, bool) { 71 return &a, true 72} 73 74// AsEntities is the BasicResponseBase implementation for Airport. 75func (a Airport) AsEntities() (*Entities, bool) { 76 return nil, false 77} 78 79// AsPlaces is the BasicResponseBase implementation for Airport. 80func (a Airport) AsPlaces() (*Places, bool) { 81 return nil, false 82} 83 84// AsSearchResponse is the BasicResponseBase implementation for Airport. 85func (a Airport) AsSearchResponse() (*SearchResponse, bool) { 86 return nil, false 87} 88 89// AsResponse is the BasicResponseBase implementation for Airport. 90func (a Airport) AsResponse() (*Response, bool) { 91 return nil, false 92} 93 94// AsBasicResponse is the BasicResponseBase implementation for Airport. 95func (a Airport) AsBasicResponse() (BasicResponse, bool) { 96 return &a, true 97} 98 99// AsSearchResultsAnswer is the BasicResponseBase implementation for Airport. 100func (a Airport) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 101 return nil, false 102} 103 104// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Airport. 105func (a Airport) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 106 return nil, false 107} 108 109// AsIdentifiable is the BasicResponseBase implementation for Airport. 110func (a Airport) AsIdentifiable() (*Identifiable, bool) { 111 return nil, false 112} 113 114// AsBasicIdentifiable is the BasicResponseBase implementation for Airport. 115func (a Airport) AsBasicIdentifiable() (BasicIdentifiable, bool) { 116 return &a, true 117} 118 119// AsAnswer is the BasicResponseBase implementation for Airport. 120func (a Airport) AsAnswer() (*Answer, bool) { 121 return nil, false 122} 123 124// AsBasicAnswer is the BasicResponseBase implementation for Airport. 125func (a Airport) AsBasicAnswer() (BasicAnswer, bool) { 126 return nil, false 127} 128 129// AsErrorResponse is the BasicResponseBase implementation for Airport. 130func (a Airport) AsErrorResponse() (*ErrorResponse, bool) { 131 return nil, false 132} 133 134// AsPostalAddress is the BasicResponseBase implementation for Airport. 135func (a Airport) AsPostalAddress() (*PostalAddress, bool) { 136 return nil, false 137} 138 139// AsPlace is the BasicResponseBase implementation for Airport. 140func (a Airport) AsPlace() (*Place, bool) { 141 return nil, false 142} 143 144// AsBasicPlace is the BasicResponseBase implementation for Airport. 145func (a Airport) AsBasicPlace() (BasicPlace, bool) { 146 return &a, true 147} 148 149// AsOrganization is the BasicResponseBase implementation for Airport. 150func (a Airport) AsOrganization() (*Organization, bool) { 151 return nil, false 152} 153 154// AsCreativeWork is the BasicResponseBase implementation for Airport. 155func (a Airport) AsCreativeWork() (*CreativeWork, bool) { 156 return nil, false 157} 158 159// AsBasicCreativeWork is the BasicResponseBase implementation for Airport. 160func (a Airport) AsBasicCreativeWork() (BasicCreativeWork, bool) { 161 return nil, false 162} 163 164// AsIntangible is the BasicResponseBase implementation for Airport. 165func (a Airport) AsIntangible() (*Intangible, bool) { 166 return nil, false 167} 168 169// AsBasicIntangible is the BasicResponseBase implementation for Airport. 170func (a Airport) AsBasicIntangible() (BasicIntangible, bool) { 171 return nil, false 172} 173 174// AsMovieTheater is the BasicResponseBase implementation for Airport. 175func (a Airport) AsMovieTheater() (*MovieTheater, bool) { 176 return nil, false 177} 178 179// AsMediaObject is the BasicResponseBase implementation for Airport. 180func (a Airport) AsMediaObject() (*MediaObject, bool) { 181 return nil, false 182} 183 184// AsBasicMediaObject is the BasicResponseBase implementation for Airport. 185func (a Airport) AsBasicMediaObject() (BasicMediaObject, bool) { 186 return nil, false 187} 188 189// AsCivicStructure is the BasicResponseBase implementation for Airport. 190func (a Airport) AsCivicStructure() (*CivicStructure, bool) { 191 return nil, false 192} 193 194// AsBasicCivicStructure is the BasicResponseBase implementation for Airport. 195func (a Airport) AsBasicCivicStructure() (BasicCivicStructure, bool) { 196 return &a, true 197} 198 199// AsLocalBusiness is the BasicResponseBase implementation for Airport. 200func (a Airport) AsLocalBusiness() (*LocalBusiness, bool) { 201 return nil, false 202} 203 204// AsBasicLocalBusiness is the BasicResponseBase implementation for Airport. 205func (a Airport) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 206 return nil, false 207} 208 209// AsTouristAttraction is the BasicResponseBase implementation for Airport. 210func (a Airport) AsTouristAttraction() (*TouristAttraction, bool) { 211 return nil, false 212} 213 214// AsAirport is the BasicResponseBase implementation for Airport. 215func (a Airport) AsAirport() (*Airport, bool) { 216 return &a, true 217} 218 219// AsLicense is the BasicResponseBase implementation for Airport. 220func (a Airport) AsLicense() (*License, bool) { 221 return nil, false 222} 223 224// AsStructuredValue is the BasicResponseBase implementation for Airport. 225func (a Airport) AsStructuredValue() (*StructuredValue, bool) { 226 return nil, false 227} 228 229// AsBasicStructuredValue is the BasicResponseBase implementation for Airport. 230func (a Airport) AsBasicStructuredValue() (BasicStructuredValue, bool) { 231 return nil, false 232} 233 234// AsEntertainmentBusiness is the BasicResponseBase implementation for Airport. 235func (a Airport) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 236 return nil, false 237} 238 239// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for Airport. 240func (a Airport) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 241 return nil, false 242} 243 244// AsFoodEstablishment is the BasicResponseBase implementation for Airport. 245func (a Airport) AsFoodEstablishment() (*FoodEstablishment, bool) { 246 return nil, false 247} 248 249// AsBasicFoodEstablishment is the BasicResponseBase implementation for Airport. 250func (a Airport) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 251 return nil, false 252} 253 254// AsLodgingBusiness is the BasicResponseBase implementation for Airport. 255func (a Airport) AsLodgingBusiness() (*LodgingBusiness, bool) { 256 return nil, false 257} 258 259// AsBasicLodgingBusiness is the BasicResponseBase implementation for Airport. 260func (a Airport) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 261 return nil, false 262} 263 264// AsRestaurant is the BasicResponseBase implementation for Airport. 265func (a Airport) AsRestaurant() (*Restaurant, bool) { 266 return nil, false 267} 268 269// AsHotel is the BasicResponseBase implementation for Airport. 270func (a Airport) AsHotel() (*Hotel, bool) { 271 return nil, false 272} 273 274// AsResponseBase is the BasicResponseBase implementation for Airport. 275func (a Airport) AsResponseBase() (*ResponseBase, bool) { 276 return nil, false 277} 278 279// AsBasicResponseBase is the BasicResponseBase implementation for Airport. 280func (a Airport) AsBasicResponseBase() (BasicResponseBase, bool) { 281 return &a, true 282} 283 284// UnmarshalJSON is the custom unmarshaler for Airport struct. 285func (a *Airport) UnmarshalJSON(body []byte) error { 286 var m map[string]*json.RawMessage 287 err := json.Unmarshal(body, &m) 288 if err != nil { 289 return err 290 } 291 for k, v := range m { 292 switch k { 293 case "iataCode": 294 if v != nil { 295 var iataCode string 296 err = json.Unmarshal(*v, &iataCode) 297 if err != nil { 298 return err 299 } 300 a.IataCode = &iataCode 301 } 302 case "icaoCode": 303 if v != nil { 304 var icaoCode string 305 err = json.Unmarshal(*v, &icaoCode) 306 if err != nil { 307 return err 308 } 309 a.IcaoCode = &icaoCode 310 } 311 case "address": 312 if v != nil { 313 var address PostalAddress 314 err = json.Unmarshal(*v, &address) 315 if err != nil { 316 return err 317 } 318 a.Address = &address 319 } 320 case "telephone": 321 if v != nil { 322 var telephone string 323 err = json.Unmarshal(*v, &telephone) 324 if err != nil { 325 return err 326 } 327 a.Telephone = &telephone 328 } 329 case "name": 330 if v != nil { 331 var name string 332 err = json.Unmarshal(*v, &name) 333 if err != nil { 334 return err 335 } 336 a.Name = &name 337 } 338 case "url": 339 if v != nil { 340 var URL string 341 err = json.Unmarshal(*v, &URL) 342 if err != nil { 343 return err 344 } 345 a.URL = &URL 346 } 347 case "image": 348 if v != nil { 349 var imageVar ImageObject 350 err = json.Unmarshal(*v, &imageVar) 351 if err != nil { 352 return err 353 } 354 a.Image = &imageVar 355 } 356 case "description": 357 if v != nil { 358 var description string 359 err = json.Unmarshal(*v, &description) 360 if err != nil { 361 return err 362 } 363 a.Description = &description 364 } 365 case "entityPresentationInfo": 366 if v != nil { 367 var entityPresentationInfo EntitiesEntityPresentationInfo 368 err = json.Unmarshal(*v, &entityPresentationInfo) 369 if err != nil { 370 return err 371 } 372 a.EntityPresentationInfo = &entityPresentationInfo 373 } 374 case "bingId": 375 if v != nil { 376 var bingID string 377 err = json.Unmarshal(*v, &bingID) 378 if err != nil { 379 return err 380 } 381 a.BingID = &bingID 382 } 383 case "contractualRules": 384 if v != nil { 385 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 386 if err != nil { 387 return err 388 } 389 a.ContractualRules = &contractualRules 390 } 391 case "webSearchUrl": 392 if v != nil { 393 var webSearchURL string 394 err = json.Unmarshal(*v, &webSearchURL) 395 if err != nil { 396 return err 397 } 398 a.WebSearchURL = &webSearchURL 399 } 400 case "id": 401 if v != nil { 402 var ID string 403 err = json.Unmarshal(*v, &ID) 404 if err != nil { 405 return err 406 } 407 a.ID = &ID 408 } 409 case "_type": 410 if v != nil { 411 var typeVar TypeBasicResponseBase 412 err = json.Unmarshal(*v, &typeVar) 413 if err != nil { 414 return err 415 } 416 a.Type = typeVar 417 } 418 } 419 } 420 421 return nil 422} 423 424// BasicAnswer ... 425type BasicAnswer interface { 426 AsEntities() (*Entities, bool) 427 AsPlaces() (*Places, bool) 428 AsSearchResultsAnswer() (*SearchResultsAnswer, bool) 429 AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) 430 AsAnswer() (*Answer, bool) 431} 432 433// Answer ... 434type Answer struct { 435 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 436 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 437 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 438 WebSearchURL *string `json:"webSearchUrl,omitempty"` 439 // ID - READ-ONLY; A String identifier. 440 ID *string `json:"id,omitempty"` 441 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 442 Type TypeBasicResponseBase `json:"_type,omitempty"` 443} 444 445func unmarshalBasicAnswer(body []byte) (BasicAnswer, error) { 446 var m map[string]interface{} 447 err := json.Unmarshal(body, &m) 448 if err != nil { 449 return nil, err 450 } 451 452 switch m["_type"] { 453 case string(TypeEntities): 454 var e Entities 455 err := json.Unmarshal(body, &e) 456 return e, err 457 case string(TypePlaces): 458 var p Places 459 err := json.Unmarshal(body, &p) 460 return p, err 461 case string(TypeSearchResultsAnswer): 462 var sra SearchResultsAnswer 463 err := json.Unmarshal(body, &sra) 464 return sra, err 465 default: 466 var a Answer 467 err := json.Unmarshal(body, &a) 468 return a, err 469 } 470} 471func unmarshalBasicAnswerArray(body []byte) ([]BasicAnswer, error) { 472 var rawMessages []*json.RawMessage 473 err := json.Unmarshal(body, &rawMessages) 474 if err != nil { 475 return nil, err 476 } 477 478 aArray := make([]BasicAnswer, len(rawMessages)) 479 480 for index, rawMessage := range rawMessages { 481 a, err := unmarshalBasicAnswer(*rawMessage) 482 if err != nil { 483 return nil, err 484 } 485 aArray[index] = a 486 } 487 return aArray, nil 488} 489 490// MarshalJSON is the custom marshaler for Answer. 491func (a Answer) MarshalJSON() ([]byte, error) { 492 a.Type = TypeAnswer 493 objectMap := make(map[string]interface{}) 494 if a.Type != "" { 495 objectMap["_type"] = a.Type 496 } 497 return json.Marshal(objectMap) 498} 499 500// AsImageObject is the BasicResponseBase implementation for Answer. 501func (a Answer) AsImageObject() (*ImageObject, bool) { 502 return nil, false 503} 504 505// AsThing is the BasicResponseBase implementation for Answer. 506func (a Answer) AsThing() (*Thing, bool) { 507 return nil, false 508} 509 510// AsBasicThing is the BasicResponseBase implementation for Answer. 511func (a Answer) AsBasicThing() (BasicThing, bool) { 512 return nil, false 513} 514 515// AsEntities is the BasicResponseBase implementation for Answer. 516func (a Answer) AsEntities() (*Entities, bool) { 517 return nil, false 518} 519 520// AsPlaces is the BasicResponseBase implementation for Answer. 521func (a Answer) AsPlaces() (*Places, bool) { 522 return nil, false 523} 524 525// AsSearchResponse is the BasicResponseBase implementation for Answer. 526func (a Answer) AsSearchResponse() (*SearchResponse, bool) { 527 return nil, false 528} 529 530// AsResponse is the BasicResponseBase implementation for Answer. 531func (a Answer) AsResponse() (*Response, bool) { 532 return nil, false 533} 534 535// AsBasicResponse is the BasicResponseBase implementation for Answer. 536func (a Answer) AsBasicResponse() (BasicResponse, bool) { 537 return &a, true 538} 539 540// AsSearchResultsAnswer is the BasicResponseBase implementation for Answer. 541func (a Answer) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 542 return nil, false 543} 544 545// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Answer. 546func (a Answer) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 547 return nil, false 548} 549 550// AsIdentifiable is the BasicResponseBase implementation for Answer. 551func (a Answer) AsIdentifiable() (*Identifiable, bool) { 552 return nil, false 553} 554 555// AsBasicIdentifiable is the BasicResponseBase implementation for Answer. 556func (a Answer) AsBasicIdentifiable() (BasicIdentifiable, bool) { 557 return &a, true 558} 559 560// AsAnswer is the BasicResponseBase implementation for Answer. 561func (a Answer) AsAnswer() (*Answer, bool) { 562 return &a, true 563} 564 565// AsBasicAnswer is the BasicResponseBase implementation for Answer. 566func (a Answer) AsBasicAnswer() (BasicAnswer, bool) { 567 return &a, true 568} 569 570// AsErrorResponse is the BasicResponseBase implementation for Answer. 571func (a Answer) AsErrorResponse() (*ErrorResponse, bool) { 572 return nil, false 573} 574 575// AsPostalAddress is the BasicResponseBase implementation for Answer. 576func (a Answer) AsPostalAddress() (*PostalAddress, bool) { 577 return nil, false 578} 579 580// AsPlace is the BasicResponseBase implementation for Answer. 581func (a Answer) AsPlace() (*Place, bool) { 582 return nil, false 583} 584 585// AsBasicPlace is the BasicResponseBase implementation for Answer. 586func (a Answer) AsBasicPlace() (BasicPlace, bool) { 587 return nil, false 588} 589 590// AsOrganization is the BasicResponseBase implementation for Answer. 591func (a Answer) AsOrganization() (*Organization, bool) { 592 return nil, false 593} 594 595// AsCreativeWork is the BasicResponseBase implementation for Answer. 596func (a Answer) AsCreativeWork() (*CreativeWork, bool) { 597 return nil, false 598} 599 600// AsBasicCreativeWork is the BasicResponseBase implementation for Answer. 601func (a Answer) AsBasicCreativeWork() (BasicCreativeWork, bool) { 602 return nil, false 603} 604 605// AsIntangible is the BasicResponseBase implementation for Answer. 606func (a Answer) AsIntangible() (*Intangible, bool) { 607 return nil, false 608} 609 610// AsBasicIntangible is the BasicResponseBase implementation for Answer. 611func (a Answer) AsBasicIntangible() (BasicIntangible, bool) { 612 return nil, false 613} 614 615// AsMovieTheater is the BasicResponseBase implementation for Answer. 616func (a Answer) AsMovieTheater() (*MovieTheater, bool) { 617 return nil, false 618} 619 620// AsMediaObject is the BasicResponseBase implementation for Answer. 621func (a Answer) AsMediaObject() (*MediaObject, bool) { 622 return nil, false 623} 624 625// AsBasicMediaObject is the BasicResponseBase implementation for Answer. 626func (a Answer) AsBasicMediaObject() (BasicMediaObject, bool) { 627 return nil, false 628} 629 630// AsCivicStructure is the BasicResponseBase implementation for Answer. 631func (a Answer) AsCivicStructure() (*CivicStructure, bool) { 632 return nil, false 633} 634 635// AsBasicCivicStructure is the BasicResponseBase implementation for Answer. 636func (a Answer) AsBasicCivicStructure() (BasicCivicStructure, bool) { 637 return nil, false 638} 639 640// AsLocalBusiness is the BasicResponseBase implementation for Answer. 641func (a Answer) AsLocalBusiness() (*LocalBusiness, bool) { 642 return nil, false 643} 644 645// AsBasicLocalBusiness is the BasicResponseBase implementation for Answer. 646func (a Answer) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 647 return nil, false 648} 649 650// AsTouristAttraction is the BasicResponseBase implementation for Answer. 651func (a Answer) AsTouristAttraction() (*TouristAttraction, bool) { 652 return nil, false 653} 654 655// AsAirport is the BasicResponseBase implementation for Answer. 656func (a Answer) AsAirport() (*Airport, bool) { 657 return nil, false 658} 659 660// AsLicense is the BasicResponseBase implementation for Answer. 661func (a Answer) AsLicense() (*License, bool) { 662 return nil, false 663} 664 665// AsStructuredValue is the BasicResponseBase implementation for Answer. 666func (a Answer) AsStructuredValue() (*StructuredValue, bool) { 667 return nil, false 668} 669 670// AsBasicStructuredValue is the BasicResponseBase implementation for Answer. 671func (a Answer) AsBasicStructuredValue() (BasicStructuredValue, bool) { 672 return nil, false 673} 674 675// AsEntertainmentBusiness is the BasicResponseBase implementation for Answer. 676func (a Answer) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 677 return nil, false 678} 679 680// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for Answer. 681func (a Answer) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 682 return nil, false 683} 684 685// AsFoodEstablishment is the BasicResponseBase implementation for Answer. 686func (a Answer) AsFoodEstablishment() (*FoodEstablishment, bool) { 687 return nil, false 688} 689 690// AsBasicFoodEstablishment is the BasicResponseBase implementation for Answer. 691func (a Answer) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 692 return nil, false 693} 694 695// AsLodgingBusiness is the BasicResponseBase implementation for Answer. 696func (a Answer) AsLodgingBusiness() (*LodgingBusiness, bool) { 697 return nil, false 698} 699 700// AsBasicLodgingBusiness is the BasicResponseBase implementation for Answer. 701func (a Answer) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 702 return nil, false 703} 704 705// AsRestaurant is the BasicResponseBase implementation for Answer. 706func (a Answer) AsRestaurant() (*Restaurant, bool) { 707 return nil, false 708} 709 710// AsHotel is the BasicResponseBase implementation for Answer. 711func (a Answer) AsHotel() (*Hotel, bool) { 712 return nil, false 713} 714 715// AsResponseBase is the BasicResponseBase implementation for Answer. 716func (a Answer) AsResponseBase() (*ResponseBase, bool) { 717 return nil, false 718} 719 720// AsBasicResponseBase is the BasicResponseBase implementation for Answer. 721func (a Answer) AsBasicResponseBase() (BasicResponseBase, bool) { 722 return &a, true 723} 724 725// UnmarshalJSON is the custom unmarshaler for Answer struct. 726func (a *Answer) UnmarshalJSON(body []byte) error { 727 var m map[string]*json.RawMessage 728 err := json.Unmarshal(body, &m) 729 if err != nil { 730 return err 731 } 732 for k, v := range m { 733 switch k { 734 case "contractualRules": 735 if v != nil { 736 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 737 if err != nil { 738 return err 739 } 740 a.ContractualRules = &contractualRules 741 } 742 case "webSearchUrl": 743 if v != nil { 744 var webSearchURL string 745 err = json.Unmarshal(*v, &webSearchURL) 746 if err != nil { 747 return err 748 } 749 a.WebSearchURL = &webSearchURL 750 } 751 case "id": 752 if v != nil { 753 var ID string 754 err = json.Unmarshal(*v, &ID) 755 if err != nil { 756 return err 757 } 758 a.ID = &ID 759 } 760 case "_type": 761 if v != nil { 762 var typeVar TypeBasicResponseBase 763 err = json.Unmarshal(*v, &typeVar) 764 if err != nil { 765 return err 766 } 767 a.Type = typeVar 768 } 769 } 770 } 771 772 return nil 773} 774 775// BasicCivicStructure ... 776type BasicCivicStructure interface { 777 AsAirport() (*Airport, bool) 778 AsCivicStructure() (*CivicStructure, bool) 779} 780 781// CivicStructure ... 782type CivicStructure struct { 783 // Address - READ-ONLY; The postal address of where the entity is located 784 Address *PostalAddress `json:"address,omitempty"` 785 // Telephone - READ-ONLY; The entity's telephone number 786 Telephone *string `json:"telephone,omitempty"` 787 // Name - READ-ONLY; The name of the thing represented by this object. 788 Name *string `json:"name,omitempty"` 789 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 790 URL *string `json:"url,omitempty"` 791 // Image - READ-ONLY 792 Image *ImageObject `json:"image,omitempty"` 793 // Description - READ-ONLY; A short description of the item. 794 Description *string `json:"description,omitempty"` 795 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 796 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 797 // BingID - READ-ONLY; An ID that uniquely identifies this item. 798 BingID *string `json:"bingId,omitempty"` 799 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 800 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 801 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 802 WebSearchURL *string `json:"webSearchUrl,omitempty"` 803 // ID - READ-ONLY; A String identifier. 804 ID *string `json:"id,omitempty"` 805 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 806 Type TypeBasicResponseBase `json:"_type,omitempty"` 807} 808 809func unmarshalBasicCivicStructure(body []byte) (BasicCivicStructure, error) { 810 var m map[string]interface{} 811 err := json.Unmarshal(body, &m) 812 if err != nil { 813 return nil, err 814 } 815 816 switch m["_type"] { 817 case string(TypeAirport): 818 var a Airport 819 err := json.Unmarshal(body, &a) 820 return a, err 821 default: 822 var cs CivicStructure 823 err := json.Unmarshal(body, &cs) 824 return cs, err 825 } 826} 827func unmarshalBasicCivicStructureArray(body []byte) ([]BasicCivicStructure, error) { 828 var rawMessages []*json.RawMessage 829 err := json.Unmarshal(body, &rawMessages) 830 if err != nil { 831 return nil, err 832 } 833 834 csArray := make([]BasicCivicStructure, len(rawMessages)) 835 836 for index, rawMessage := range rawMessages { 837 cs, err := unmarshalBasicCivicStructure(*rawMessage) 838 if err != nil { 839 return nil, err 840 } 841 csArray[index] = cs 842 } 843 return csArray, nil 844} 845 846// MarshalJSON is the custom marshaler for CivicStructure. 847func (cs CivicStructure) MarshalJSON() ([]byte, error) { 848 cs.Type = TypeCivicStructure 849 objectMap := make(map[string]interface{}) 850 if cs.Type != "" { 851 objectMap["_type"] = cs.Type 852 } 853 return json.Marshal(objectMap) 854} 855 856// AsImageObject is the BasicResponseBase implementation for CivicStructure. 857func (cs CivicStructure) AsImageObject() (*ImageObject, bool) { 858 return nil, false 859} 860 861// AsThing is the BasicResponseBase implementation for CivicStructure. 862func (cs CivicStructure) AsThing() (*Thing, bool) { 863 return nil, false 864} 865 866// AsBasicThing is the BasicResponseBase implementation for CivicStructure. 867func (cs CivicStructure) AsBasicThing() (BasicThing, bool) { 868 return &cs, true 869} 870 871// AsEntities is the BasicResponseBase implementation for CivicStructure. 872func (cs CivicStructure) AsEntities() (*Entities, bool) { 873 return nil, false 874} 875 876// AsPlaces is the BasicResponseBase implementation for CivicStructure. 877func (cs CivicStructure) AsPlaces() (*Places, bool) { 878 return nil, false 879} 880 881// AsSearchResponse is the BasicResponseBase implementation for CivicStructure. 882func (cs CivicStructure) AsSearchResponse() (*SearchResponse, bool) { 883 return nil, false 884} 885 886// AsResponse is the BasicResponseBase implementation for CivicStructure. 887func (cs CivicStructure) AsResponse() (*Response, bool) { 888 return nil, false 889} 890 891// AsBasicResponse is the BasicResponseBase implementation for CivicStructure. 892func (cs CivicStructure) AsBasicResponse() (BasicResponse, bool) { 893 return &cs, true 894} 895 896// AsSearchResultsAnswer is the BasicResponseBase implementation for CivicStructure. 897func (cs CivicStructure) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 898 return nil, false 899} 900 901// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for CivicStructure. 902func (cs CivicStructure) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 903 return nil, false 904} 905 906// AsIdentifiable is the BasicResponseBase implementation for CivicStructure. 907func (cs CivicStructure) AsIdentifiable() (*Identifiable, bool) { 908 return nil, false 909} 910 911// AsBasicIdentifiable is the BasicResponseBase implementation for CivicStructure. 912func (cs CivicStructure) AsBasicIdentifiable() (BasicIdentifiable, bool) { 913 return &cs, true 914} 915 916// AsAnswer is the BasicResponseBase implementation for CivicStructure. 917func (cs CivicStructure) AsAnswer() (*Answer, bool) { 918 return nil, false 919} 920 921// AsBasicAnswer is the BasicResponseBase implementation for CivicStructure. 922func (cs CivicStructure) AsBasicAnswer() (BasicAnswer, bool) { 923 return nil, false 924} 925 926// AsErrorResponse is the BasicResponseBase implementation for CivicStructure. 927func (cs CivicStructure) AsErrorResponse() (*ErrorResponse, bool) { 928 return nil, false 929} 930 931// AsPostalAddress is the BasicResponseBase implementation for CivicStructure. 932func (cs CivicStructure) AsPostalAddress() (*PostalAddress, bool) { 933 return nil, false 934} 935 936// AsPlace is the BasicResponseBase implementation for CivicStructure. 937func (cs CivicStructure) AsPlace() (*Place, bool) { 938 return nil, false 939} 940 941// AsBasicPlace is the BasicResponseBase implementation for CivicStructure. 942func (cs CivicStructure) AsBasicPlace() (BasicPlace, bool) { 943 return &cs, true 944} 945 946// AsOrganization is the BasicResponseBase implementation for CivicStructure. 947func (cs CivicStructure) AsOrganization() (*Organization, bool) { 948 return nil, false 949} 950 951// AsCreativeWork is the BasicResponseBase implementation for CivicStructure. 952func (cs CivicStructure) AsCreativeWork() (*CreativeWork, bool) { 953 return nil, false 954} 955 956// AsBasicCreativeWork is the BasicResponseBase implementation for CivicStructure. 957func (cs CivicStructure) AsBasicCreativeWork() (BasicCreativeWork, bool) { 958 return nil, false 959} 960 961// AsIntangible is the BasicResponseBase implementation for CivicStructure. 962func (cs CivicStructure) AsIntangible() (*Intangible, bool) { 963 return nil, false 964} 965 966// AsBasicIntangible is the BasicResponseBase implementation for CivicStructure. 967func (cs CivicStructure) AsBasicIntangible() (BasicIntangible, bool) { 968 return nil, false 969} 970 971// AsMovieTheater is the BasicResponseBase implementation for CivicStructure. 972func (cs CivicStructure) AsMovieTheater() (*MovieTheater, bool) { 973 return nil, false 974} 975 976// AsMediaObject is the BasicResponseBase implementation for CivicStructure. 977func (cs CivicStructure) AsMediaObject() (*MediaObject, bool) { 978 return nil, false 979} 980 981// AsBasicMediaObject is the BasicResponseBase implementation for CivicStructure. 982func (cs CivicStructure) AsBasicMediaObject() (BasicMediaObject, bool) { 983 return nil, false 984} 985 986// AsCivicStructure is the BasicResponseBase implementation for CivicStructure. 987func (cs CivicStructure) AsCivicStructure() (*CivicStructure, bool) { 988 return &cs, true 989} 990 991// AsBasicCivicStructure is the BasicResponseBase implementation for CivicStructure. 992func (cs CivicStructure) AsBasicCivicStructure() (BasicCivicStructure, bool) { 993 return &cs, true 994} 995 996// AsLocalBusiness is the BasicResponseBase implementation for CivicStructure. 997func (cs CivicStructure) AsLocalBusiness() (*LocalBusiness, bool) { 998 return nil, false 999} 1000 1001// AsBasicLocalBusiness is the BasicResponseBase implementation for CivicStructure. 1002func (cs CivicStructure) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 1003 return nil, false 1004} 1005 1006// AsTouristAttraction is the BasicResponseBase implementation for CivicStructure. 1007func (cs CivicStructure) AsTouristAttraction() (*TouristAttraction, bool) { 1008 return nil, false 1009} 1010 1011// AsAirport is the BasicResponseBase implementation for CivicStructure. 1012func (cs CivicStructure) AsAirport() (*Airport, bool) { 1013 return nil, false 1014} 1015 1016// AsLicense is the BasicResponseBase implementation for CivicStructure. 1017func (cs CivicStructure) AsLicense() (*License, bool) { 1018 return nil, false 1019} 1020 1021// AsStructuredValue is the BasicResponseBase implementation for CivicStructure. 1022func (cs CivicStructure) AsStructuredValue() (*StructuredValue, bool) { 1023 return nil, false 1024} 1025 1026// AsBasicStructuredValue is the BasicResponseBase implementation for CivicStructure. 1027func (cs CivicStructure) AsBasicStructuredValue() (BasicStructuredValue, bool) { 1028 return nil, false 1029} 1030 1031// AsEntertainmentBusiness is the BasicResponseBase implementation for CivicStructure. 1032func (cs CivicStructure) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 1033 return nil, false 1034} 1035 1036// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for CivicStructure. 1037func (cs CivicStructure) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 1038 return nil, false 1039} 1040 1041// AsFoodEstablishment is the BasicResponseBase implementation for CivicStructure. 1042func (cs CivicStructure) AsFoodEstablishment() (*FoodEstablishment, bool) { 1043 return nil, false 1044} 1045 1046// AsBasicFoodEstablishment is the BasicResponseBase implementation for CivicStructure. 1047func (cs CivicStructure) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 1048 return nil, false 1049} 1050 1051// AsLodgingBusiness is the BasicResponseBase implementation for CivicStructure. 1052func (cs CivicStructure) AsLodgingBusiness() (*LodgingBusiness, bool) { 1053 return nil, false 1054} 1055 1056// AsBasicLodgingBusiness is the BasicResponseBase implementation for CivicStructure. 1057func (cs CivicStructure) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 1058 return nil, false 1059} 1060 1061// AsRestaurant is the BasicResponseBase implementation for CivicStructure. 1062func (cs CivicStructure) AsRestaurant() (*Restaurant, bool) { 1063 return nil, false 1064} 1065 1066// AsHotel is the BasicResponseBase implementation for CivicStructure. 1067func (cs CivicStructure) AsHotel() (*Hotel, bool) { 1068 return nil, false 1069} 1070 1071// AsResponseBase is the BasicResponseBase implementation for CivicStructure. 1072func (cs CivicStructure) AsResponseBase() (*ResponseBase, bool) { 1073 return nil, false 1074} 1075 1076// AsBasicResponseBase is the BasicResponseBase implementation for CivicStructure. 1077func (cs CivicStructure) AsBasicResponseBase() (BasicResponseBase, bool) { 1078 return &cs, true 1079} 1080 1081// UnmarshalJSON is the custom unmarshaler for CivicStructure struct. 1082func (cs *CivicStructure) UnmarshalJSON(body []byte) error { 1083 var m map[string]*json.RawMessage 1084 err := json.Unmarshal(body, &m) 1085 if err != nil { 1086 return err 1087 } 1088 for k, v := range m { 1089 switch k { 1090 case "address": 1091 if v != nil { 1092 var address PostalAddress 1093 err = json.Unmarshal(*v, &address) 1094 if err != nil { 1095 return err 1096 } 1097 cs.Address = &address 1098 } 1099 case "telephone": 1100 if v != nil { 1101 var telephone string 1102 err = json.Unmarshal(*v, &telephone) 1103 if err != nil { 1104 return err 1105 } 1106 cs.Telephone = &telephone 1107 } 1108 case "name": 1109 if v != nil { 1110 var name string 1111 err = json.Unmarshal(*v, &name) 1112 if err != nil { 1113 return err 1114 } 1115 cs.Name = &name 1116 } 1117 case "url": 1118 if v != nil { 1119 var URL string 1120 err = json.Unmarshal(*v, &URL) 1121 if err != nil { 1122 return err 1123 } 1124 cs.URL = &URL 1125 } 1126 case "image": 1127 if v != nil { 1128 var imageVar ImageObject 1129 err = json.Unmarshal(*v, &imageVar) 1130 if err != nil { 1131 return err 1132 } 1133 cs.Image = &imageVar 1134 } 1135 case "description": 1136 if v != nil { 1137 var description string 1138 err = json.Unmarshal(*v, &description) 1139 if err != nil { 1140 return err 1141 } 1142 cs.Description = &description 1143 } 1144 case "entityPresentationInfo": 1145 if v != nil { 1146 var entityPresentationInfo EntitiesEntityPresentationInfo 1147 err = json.Unmarshal(*v, &entityPresentationInfo) 1148 if err != nil { 1149 return err 1150 } 1151 cs.EntityPresentationInfo = &entityPresentationInfo 1152 } 1153 case "bingId": 1154 if v != nil { 1155 var bingID string 1156 err = json.Unmarshal(*v, &bingID) 1157 if err != nil { 1158 return err 1159 } 1160 cs.BingID = &bingID 1161 } 1162 case "contractualRules": 1163 if v != nil { 1164 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 1165 if err != nil { 1166 return err 1167 } 1168 cs.ContractualRules = &contractualRules 1169 } 1170 case "webSearchUrl": 1171 if v != nil { 1172 var webSearchURL string 1173 err = json.Unmarshal(*v, &webSearchURL) 1174 if err != nil { 1175 return err 1176 } 1177 cs.WebSearchURL = &webSearchURL 1178 } 1179 case "id": 1180 if v != nil { 1181 var ID string 1182 err = json.Unmarshal(*v, &ID) 1183 if err != nil { 1184 return err 1185 } 1186 cs.ID = &ID 1187 } 1188 case "_type": 1189 if v != nil { 1190 var typeVar TypeBasicResponseBase 1191 err = json.Unmarshal(*v, &typeVar) 1192 if err != nil { 1193 return err 1194 } 1195 cs.Type = typeVar 1196 } 1197 } 1198 } 1199 1200 return nil 1201} 1202 1203// BasicContractualRulesAttribution ... 1204type BasicContractualRulesAttribution interface { 1205 AsContractualRulesLicenseAttribution() (*ContractualRulesLicenseAttribution, bool) 1206 AsContractualRulesLinkAttribution() (*ContractualRulesLinkAttribution, bool) 1207 AsContractualRulesMediaAttribution() (*ContractualRulesMediaAttribution, bool) 1208 AsContractualRulesTextAttribution() (*ContractualRulesTextAttribution, bool) 1209 AsContractualRulesAttribution() (*ContractualRulesAttribution, bool) 1210} 1211 1212// ContractualRulesAttribution ... 1213type ContractualRulesAttribution struct { 1214 // MustBeCloseToContent - READ-ONLY; A Boolean value that determines whether the contents of the rule must be placed in close proximity to the field that the rule applies to. If true, the contents must be placed in close proximity. If false, or this field does not exist, the contents may be placed at the caller's discretion. 1215 MustBeCloseToContent *bool `json:"mustBeCloseToContent,omitempty"` 1216 // TargetPropertyName - READ-ONLY; The name of the field that the rule applies to. 1217 TargetPropertyName *string `json:"targetPropertyName,omitempty"` 1218 // Type - Possible values include: 'TypeContractualRulesContractualRule', 'TypeContractualRulesAttribution', 'TypeContractualRulesLicenseAttribution', 'TypeContractualRulesLinkAttribution', 'TypeContractualRulesMediaAttribution', 'TypeContractualRulesTextAttribution' 1219 Type Type `json:"_type,omitempty"` 1220} 1221 1222func unmarshalBasicContractualRulesAttribution(body []byte) (BasicContractualRulesAttribution, error) { 1223 var m map[string]interface{} 1224 err := json.Unmarshal(body, &m) 1225 if err != nil { 1226 return nil, err 1227 } 1228 1229 switch m["_type"] { 1230 case string(TypeContractualRulesLicenseAttribution): 1231 var crla ContractualRulesLicenseAttribution 1232 err := json.Unmarshal(body, &crla) 1233 return crla, err 1234 case string(TypeContractualRulesLinkAttribution): 1235 var crla ContractualRulesLinkAttribution 1236 err := json.Unmarshal(body, &crla) 1237 return crla, err 1238 case string(TypeContractualRulesMediaAttribution): 1239 var crma ContractualRulesMediaAttribution 1240 err := json.Unmarshal(body, &crma) 1241 return crma, err 1242 case string(TypeContractualRulesTextAttribution): 1243 var crta ContractualRulesTextAttribution 1244 err := json.Unmarshal(body, &crta) 1245 return crta, err 1246 default: 1247 var cra ContractualRulesAttribution 1248 err := json.Unmarshal(body, &cra) 1249 return cra, err 1250 } 1251} 1252func unmarshalBasicContractualRulesAttributionArray(body []byte) ([]BasicContractualRulesAttribution, error) { 1253 var rawMessages []*json.RawMessage 1254 err := json.Unmarshal(body, &rawMessages) 1255 if err != nil { 1256 return nil, err 1257 } 1258 1259 craArray := make([]BasicContractualRulesAttribution, len(rawMessages)) 1260 1261 for index, rawMessage := range rawMessages { 1262 cra, err := unmarshalBasicContractualRulesAttribution(*rawMessage) 1263 if err != nil { 1264 return nil, err 1265 } 1266 craArray[index] = cra 1267 } 1268 return craArray, nil 1269} 1270 1271// MarshalJSON is the custom marshaler for ContractualRulesAttribution. 1272func (cra ContractualRulesAttribution) MarshalJSON() ([]byte, error) { 1273 cra.Type = TypeContractualRulesAttribution 1274 objectMap := make(map[string]interface{}) 1275 if cra.Type != "" { 1276 objectMap["_type"] = cra.Type 1277 } 1278 return json.Marshal(objectMap) 1279} 1280 1281// AsContractualRulesAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesAttribution. 1282func (cra ContractualRulesAttribution) AsContractualRulesAttribution() (*ContractualRulesAttribution, bool) { 1283 return &cra, true 1284} 1285 1286// AsBasicContractualRulesAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesAttribution. 1287func (cra ContractualRulesAttribution) AsBasicContractualRulesAttribution() (BasicContractualRulesAttribution, bool) { 1288 return &cra, true 1289} 1290 1291// AsContractualRulesLicenseAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesAttribution. 1292func (cra ContractualRulesAttribution) AsContractualRulesLicenseAttribution() (*ContractualRulesLicenseAttribution, bool) { 1293 return nil, false 1294} 1295 1296// AsContractualRulesLinkAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesAttribution. 1297func (cra ContractualRulesAttribution) AsContractualRulesLinkAttribution() (*ContractualRulesLinkAttribution, bool) { 1298 return nil, false 1299} 1300 1301// AsContractualRulesMediaAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesAttribution. 1302func (cra ContractualRulesAttribution) AsContractualRulesMediaAttribution() (*ContractualRulesMediaAttribution, bool) { 1303 return nil, false 1304} 1305 1306// AsContractualRulesTextAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesAttribution. 1307func (cra ContractualRulesAttribution) AsContractualRulesTextAttribution() (*ContractualRulesTextAttribution, bool) { 1308 return nil, false 1309} 1310 1311// AsContractualRulesContractualRule is the BasicContractualRulesContractualRule implementation for ContractualRulesAttribution. 1312func (cra ContractualRulesAttribution) AsContractualRulesContractualRule() (*ContractualRulesContractualRule, bool) { 1313 return nil, false 1314} 1315 1316// AsBasicContractualRulesContractualRule is the BasicContractualRulesContractualRule implementation for ContractualRulesAttribution. 1317func (cra ContractualRulesAttribution) AsBasicContractualRulesContractualRule() (BasicContractualRulesContractualRule, bool) { 1318 return &cra, true 1319} 1320 1321// BasicContractualRulesContractualRule ... 1322type BasicContractualRulesContractualRule interface { 1323 AsContractualRulesAttribution() (*ContractualRulesAttribution, bool) 1324 AsBasicContractualRulesAttribution() (BasicContractualRulesAttribution, bool) 1325 AsContractualRulesLicenseAttribution() (*ContractualRulesLicenseAttribution, bool) 1326 AsContractualRulesLinkAttribution() (*ContractualRulesLinkAttribution, bool) 1327 AsContractualRulesMediaAttribution() (*ContractualRulesMediaAttribution, bool) 1328 AsContractualRulesTextAttribution() (*ContractualRulesTextAttribution, bool) 1329 AsContractualRulesContractualRule() (*ContractualRulesContractualRule, bool) 1330} 1331 1332// ContractualRulesContractualRule ... 1333type ContractualRulesContractualRule struct { 1334 // TargetPropertyName - READ-ONLY; The name of the field that the rule applies to. 1335 TargetPropertyName *string `json:"targetPropertyName,omitempty"` 1336 // Type - Possible values include: 'TypeContractualRulesContractualRule', 'TypeContractualRulesAttribution', 'TypeContractualRulesLicenseAttribution', 'TypeContractualRulesLinkAttribution', 'TypeContractualRulesMediaAttribution', 'TypeContractualRulesTextAttribution' 1337 Type Type `json:"_type,omitempty"` 1338} 1339 1340func unmarshalBasicContractualRulesContractualRule(body []byte) (BasicContractualRulesContractualRule, error) { 1341 var m map[string]interface{} 1342 err := json.Unmarshal(body, &m) 1343 if err != nil { 1344 return nil, err 1345 } 1346 1347 switch m["_type"] { 1348 case string(TypeContractualRulesAttribution): 1349 var cra ContractualRulesAttribution 1350 err := json.Unmarshal(body, &cra) 1351 return cra, err 1352 case string(TypeContractualRulesLicenseAttribution): 1353 var crla ContractualRulesLicenseAttribution 1354 err := json.Unmarshal(body, &crla) 1355 return crla, err 1356 case string(TypeContractualRulesLinkAttribution): 1357 var crla ContractualRulesLinkAttribution 1358 err := json.Unmarshal(body, &crla) 1359 return crla, err 1360 case string(TypeContractualRulesMediaAttribution): 1361 var crma ContractualRulesMediaAttribution 1362 err := json.Unmarshal(body, &crma) 1363 return crma, err 1364 case string(TypeContractualRulesTextAttribution): 1365 var crta ContractualRulesTextAttribution 1366 err := json.Unmarshal(body, &crta) 1367 return crta, err 1368 default: 1369 var crcr ContractualRulesContractualRule 1370 err := json.Unmarshal(body, &crcr) 1371 return crcr, err 1372 } 1373} 1374func unmarshalBasicContractualRulesContractualRuleArray(body []byte) ([]BasicContractualRulesContractualRule, error) { 1375 var rawMessages []*json.RawMessage 1376 err := json.Unmarshal(body, &rawMessages) 1377 if err != nil { 1378 return nil, err 1379 } 1380 1381 crcrArray := make([]BasicContractualRulesContractualRule, len(rawMessages)) 1382 1383 for index, rawMessage := range rawMessages { 1384 crcr, err := unmarshalBasicContractualRulesContractualRule(*rawMessage) 1385 if err != nil { 1386 return nil, err 1387 } 1388 crcrArray[index] = crcr 1389 } 1390 return crcrArray, nil 1391} 1392 1393// MarshalJSON is the custom marshaler for ContractualRulesContractualRule. 1394func (crcr ContractualRulesContractualRule) MarshalJSON() ([]byte, error) { 1395 crcr.Type = TypeContractualRulesContractualRule 1396 objectMap := make(map[string]interface{}) 1397 if crcr.Type != "" { 1398 objectMap["_type"] = crcr.Type 1399 } 1400 return json.Marshal(objectMap) 1401} 1402 1403// AsContractualRulesAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesContractualRule. 1404func (crcr ContractualRulesContractualRule) AsContractualRulesAttribution() (*ContractualRulesAttribution, bool) { 1405 return nil, false 1406} 1407 1408// AsBasicContractualRulesAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesContractualRule. 1409func (crcr ContractualRulesContractualRule) AsBasicContractualRulesAttribution() (BasicContractualRulesAttribution, bool) { 1410 return nil, false 1411} 1412 1413// AsContractualRulesLicenseAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesContractualRule. 1414func (crcr ContractualRulesContractualRule) AsContractualRulesLicenseAttribution() (*ContractualRulesLicenseAttribution, bool) { 1415 return nil, false 1416} 1417 1418// AsContractualRulesLinkAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesContractualRule. 1419func (crcr ContractualRulesContractualRule) AsContractualRulesLinkAttribution() (*ContractualRulesLinkAttribution, bool) { 1420 return nil, false 1421} 1422 1423// AsContractualRulesMediaAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesContractualRule. 1424func (crcr ContractualRulesContractualRule) AsContractualRulesMediaAttribution() (*ContractualRulesMediaAttribution, bool) { 1425 return nil, false 1426} 1427 1428// AsContractualRulesTextAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesContractualRule. 1429func (crcr ContractualRulesContractualRule) AsContractualRulesTextAttribution() (*ContractualRulesTextAttribution, bool) { 1430 return nil, false 1431} 1432 1433// AsContractualRulesContractualRule is the BasicContractualRulesContractualRule implementation for ContractualRulesContractualRule. 1434func (crcr ContractualRulesContractualRule) AsContractualRulesContractualRule() (*ContractualRulesContractualRule, bool) { 1435 return &crcr, true 1436} 1437 1438// AsBasicContractualRulesContractualRule is the BasicContractualRulesContractualRule implementation for ContractualRulesContractualRule. 1439func (crcr ContractualRulesContractualRule) AsBasicContractualRulesContractualRule() (BasicContractualRulesContractualRule, bool) { 1440 return &crcr, true 1441} 1442 1443// ContractualRulesLicenseAttribution defines a contractual rule for license attribution. 1444type ContractualRulesLicenseAttribution struct { 1445 // License - READ-ONLY; The license under which the content may be used. 1446 License *License `json:"license,omitempty"` 1447 // LicenseNotice - READ-ONLY; The license to display next to the targeted field. 1448 LicenseNotice *string `json:"licenseNotice,omitempty"` 1449 // MustBeCloseToContent - READ-ONLY; A Boolean value that determines whether the contents of the rule must be placed in close proximity to the field that the rule applies to. If true, the contents must be placed in close proximity. If false, or this field does not exist, the contents may be placed at the caller's discretion. 1450 MustBeCloseToContent *bool `json:"mustBeCloseToContent,omitempty"` 1451 // TargetPropertyName - READ-ONLY; The name of the field that the rule applies to. 1452 TargetPropertyName *string `json:"targetPropertyName,omitempty"` 1453 // Type - Possible values include: 'TypeContractualRulesContractualRule', 'TypeContractualRulesAttribution', 'TypeContractualRulesLicenseAttribution', 'TypeContractualRulesLinkAttribution', 'TypeContractualRulesMediaAttribution', 'TypeContractualRulesTextAttribution' 1454 Type Type `json:"_type,omitempty"` 1455} 1456 1457// MarshalJSON is the custom marshaler for ContractualRulesLicenseAttribution. 1458func (crla ContractualRulesLicenseAttribution) MarshalJSON() ([]byte, error) { 1459 crla.Type = TypeContractualRulesLicenseAttribution 1460 objectMap := make(map[string]interface{}) 1461 if crla.Type != "" { 1462 objectMap["_type"] = crla.Type 1463 } 1464 return json.Marshal(objectMap) 1465} 1466 1467// AsContractualRulesAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesLicenseAttribution. 1468func (crla ContractualRulesLicenseAttribution) AsContractualRulesAttribution() (*ContractualRulesAttribution, bool) { 1469 return nil, false 1470} 1471 1472// AsBasicContractualRulesAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesLicenseAttribution. 1473func (crla ContractualRulesLicenseAttribution) AsBasicContractualRulesAttribution() (BasicContractualRulesAttribution, bool) { 1474 return &crla, true 1475} 1476 1477// AsContractualRulesLicenseAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesLicenseAttribution. 1478func (crla ContractualRulesLicenseAttribution) AsContractualRulesLicenseAttribution() (*ContractualRulesLicenseAttribution, bool) { 1479 return &crla, true 1480} 1481 1482// AsContractualRulesLinkAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesLicenseAttribution. 1483func (crla ContractualRulesLicenseAttribution) AsContractualRulesLinkAttribution() (*ContractualRulesLinkAttribution, bool) { 1484 return nil, false 1485} 1486 1487// AsContractualRulesMediaAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesLicenseAttribution. 1488func (crla ContractualRulesLicenseAttribution) AsContractualRulesMediaAttribution() (*ContractualRulesMediaAttribution, bool) { 1489 return nil, false 1490} 1491 1492// AsContractualRulesTextAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesLicenseAttribution. 1493func (crla ContractualRulesLicenseAttribution) AsContractualRulesTextAttribution() (*ContractualRulesTextAttribution, bool) { 1494 return nil, false 1495} 1496 1497// AsContractualRulesContractualRule is the BasicContractualRulesContractualRule implementation for ContractualRulesLicenseAttribution. 1498func (crla ContractualRulesLicenseAttribution) AsContractualRulesContractualRule() (*ContractualRulesContractualRule, bool) { 1499 return nil, false 1500} 1501 1502// AsBasicContractualRulesContractualRule is the BasicContractualRulesContractualRule implementation for ContractualRulesLicenseAttribution. 1503func (crla ContractualRulesLicenseAttribution) AsBasicContractualRulesContractualRule() (BasicContractualRulesContractualRule, bool) { 1504 return &crla, true 1505} 1506 1507// ContractualRulesLinkAttribution defines a contractual rule for link attribution. 1508type ContractualRulesLinkAttribution struct { 1509 // Text - The attribution text. 1510 Text *string `json:"text,omitempty"` 1511 // URL - The URL to the provider's website. Use text and URL to create the hyperlink. 1512 URL *string `json:"url,omitempty"` 1513 // OptionalForListDisplay - READ-ONLY; Indicates whether this provider's attribution is optional. 1514 OptionalForListDisplay *bool `json:"optionalForListDisplay,omitempty"` 1515 // MustBeCloseToContent - READ-ONLY; A Boolean value that determines whether the contents of the rule must be placed in close proximity to the field that the rule applies to. If true, the contents must be placed in close proximity. If false, or this field does not exist, the contents may be placed at the caller's discretion. 1516 MustBeCloseToContent *bool `json:"mustBeCloseToContent,omitempty"` 1517 // TargetPropertyName - READ-ONLY; The name of the field that the rule applies to. 1518 TargetPropertyName *string `json:"targetPropertyName,omitempty"` 1519 // Type - Possible values include: 'TypeContractualRulesContractualRule', 'TypeContractualRulesAttribution', 'TypeContractualRulesLicenseAttribution', 'TypeContractualRulesLinkAttribution', 'TypeContractualRulesMediaAttribution', 'TypeContractualRulesTextAttribution' 1520 Type Type `json:"_type,omitempty"` 1521} 1522 1523// MarshalJSON is the custom marshaler for ContractualRulesLinkAttribution. 1524func (crla ContractualRulesLinkAttribution) MarshalJSON() ([]byte, error) { 1525 crla.Type = TypeContractualRulesLinkAttribution 1526 objectMap := make(map[string]interface{}) 1527 if crla.Text != nil { 1528 objectMap["text"] = crla.Text 1529 } 1530 if crla.URL != nil { 1531 objectMap["url"] = crla.URL 1532 } 1533 if crla.Type != "" { 1534 objectMap["_type"] = crla.Type 1535 } 1536 return json.Marshal(objectMap) 1537} 1538 1539// AsContractualRulesAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesLinkAttribution. 1540func (crla ContractualRulesLinkAttribution) AsContractualRulesAttribution() (*ContractualRulesAttribution, bool) { 1541 return nil, false 1542} 1543 1544// AsBasicContractualRulesAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesLinkAttribution. 1545func (crla ContractualRulesLinkAttribution) AsBasicContractualRulesAttribution() (BasicContractualRulesAttribution, bool) { 1546 return &crla, true 1547} 1548 1549// AsContractualRulesLicenseAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesLinkAttribution. 1550func (crla ContractualRulesLinkAttribution) AsContractualRulesLicenseAttribution() (*ContractualRulesLicenseAttribution, bool) { 1551 return nil, false 1552} 1553 1554// AsContractualRulesLinkAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesLinkAttribution. 1555func (crla ContractualRulesLinkAttribution) AsContractualRulesLinkAttribution() (*ContractualRulesLinkAttribution, bool) { 1556 return &crla, true 1557} 1558 1559// AsContractualRulesMediaAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesLinkAttribution. 1560func (crla ContractualRulesLinkAttribution) AsContractualRulesMediaAttribution() (*ContractualRulesMediaAttribution, bool) { 1561 return nil, false 1562} 1563 1564// AsContractualRulesTextAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesLinkAttribution. 1565func (crla ContractualRulesLinkAttribution) AsContractualRulesTextAttribution() (*ContractualRulesTextAttribution, bool) { 1566 return nil, false 1567} 1568 1569// AsContractualRulesContractualRule is the BasicContractualRulesContractualRule implementation for ContractualRulesLinkAttribution. 1570func (crla ContractualRulesLinkAttribution) AsContractualRulesContractualRule() (*ContractualRulesContractualRule, bool) { 1571 return nil, false 1572} 1573 1574// AsBasicContractualRulesContractualRule is the BasicContractualRulesContractualRule implementation for ContractualRulesLinkAttribution. 1575func (crla ContractualRulesLinkAttribution) AsBasicContractualRulesContractualRule() (BasicContractualRulesContractualRule, bool) { 1576 return &crla, true 1577} 1578 1579// ContractualRulesMediaAttribution defines a contractual rule for media attribution. 1580type ContractualRulesMediaAttribution struct { 1581 // URL - READ-ONLY; The URL that you use to create of hyperlink of the media content. For example, if the target is an image, you would use the URL to make the image clickable. 1582 URL *string `json:"url,omitempty"` 1583 // MustBeCloseToContent - READ-ONLY; A Boolean value that determines whether the contents of the rule must be placed in close proximity to the field that the rule applies to. If true, the contents must be placed in close proximity. If false, or this field does not exist, the contents may be placed at the caller's discretion. 1584 MustBeCloseToContent *bool `json:"mustBeCloseToContent,omitempty"` 1585 // TargetPropertyName - READ-ONLY; The name of the field that the rule applies to. 1586 TargetPropertyName *string `json:"targetPropertyName,omitempty"` 1587 // Type - Possible values include: 'TypeContractualRulesContractualRule', 'TypeContractualRulesAttribution', 'TypeContractualRulesLicenseAttribution', 'TypeContractualRulesLinkAttribution', 'TypeContractualRulesMediaAttribution', 'TypeContractualRulesTextAttribution' 1588 Type Type `json:"_type,omitempty"` 1589} 1590 1591// MarshalJSON is the custom marshaler for ContractualRulesMediaAttribution. 1592func (crma ContractualRulesMediaAttribution) MarshalJSON() ([]byte, error) { 1593 crma.Type = TypeContractualRulesMediaAttribution 1594 objectMap := make(map[string]interface{}) 1595 if crma.Type != "" { 1596 objectMap["_type"] = crma.Type 1597 } 1598 return json.Marshal(objectMap) 1599} 1600 1601// AsContractualRulesAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesMediaAttribution. 1602func (crma ContractualRulesMediaAttribution) AsContractualRulesAttribution() (*ContractualRulesAttribution, bool) { 1603 return nil, false 1604} 1605 1606// AsBasicContractualRulesAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesMediaAttribution. 1607func (crma ContractualRulesMediaAttribution) AsBasicContractualRulesAttribution() (BasicContractualRulesAttribution, bool) { 1608 return &crma, true 1609} 1610 1611// AsContractualRulesLicenseAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesMediaAttribution. 1612func (crma ContractualRulesMediaAttribution) AsContractualRulesLicenseAttribution() (*ContractualRulesLicenseAttribution, bool) { 1613 return nil, false 1614} 1615 1616// AsContractualRulesLinkAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesMediaAttribution. 1617func (crma ContractualRulesMediaAttribution) AsContractualRulesLinkAttribution() (*ContractualRulesLinkAttribution, bool) { 1618 return nil, false 1619} 1620 1621// AsContractualRulesMediaAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesMediaAttribution. 1622func (crma ContractualRulesMediaAttribution) AsContractualRulesMediaAttribution() (*ContractualRulesMediaAttribution, bool) { 1623 return &crma, true 1624} 1625 1626// AsContractualRulesTextAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesMediaAttribution. 1627func (crma ContractualRulesMediaAttribution) AsContractualRulesTextAttribution() (*ContractualRulesTextAttribution, bool) { 1628 return nil, false 1629} 1630 1631// AsContractualRulesContractualRule is the BasicContractualRulesContractualRule implementation for ContractualRulesMediaAttribution. 1632func (crma ContractualRulesMediaAttribution) AsContractualRulesContractualRule() (*ContractualRulesContractualRule, bool) { 1633 return nil, false 1634} 1635 1636// AsBasicContractualRulesContractualRule is the BasicContractualRulesContractualRule implementation for ContractualRulesMediaAttribution. 1637func (crma ContractualRulesMediaAttribution) AsBasicContractualRulesContractualRule() (BasicContractualRulesContractualRule, bool) { 1638 return &crma, true 1639} 1640 1641// ContractualRulesTextAttribution defines a contractual rule for text attribution. 1642type ContractualRulesTextAttribution struct { 1643 // Text - The attribution text. Text attribution applies to the entity as a whole and should be displayed immediately following the entity presentation. If there are multiple text or link attribution rules that do not specify a target, you should concatenate them and display them using a "Data from:" label. 1644 Text *string `json:"text,omitempty"` 1645 // OptionalForListDisplay - READ-ONLY; Indicates whether this provider's attribution is optional. 1646 OptionalForListDisplay *bool `json:"optionalForListDisplay,omitempty"` 1647 // MustBeCloseToContent - READ-ONLY; A Boolean value that determines whether the contents of the rule must be placed in close proximity to the field that the rule applies to. If true, the contents must be placed in close proximity. If false, or this field does not exist, the contents may be placed at the caller's discretion. 1648 MustBeCloseToContent *bool `json:"mustBeCloseToContent,omitempty"` 1649 // TargetPropertyName - READ-ONLY; The name of the field that the rule applies to. 1650 TargetPropertyName *string `json:"targetPropertyName,omitempty"` 1651 // Type - Possible values include: 'TypeContractualRulesContractualRule', 'TypeContractualRulesAttribution', 'TypeContractualRulesLicenseAttribution', 'TypeContractualRulesLinkAttribution', 'TypeContractualRulesMediaAttribution', 'TypeContractualRulesTextAttribution' 1652 Type Type `json:"_type,omitempty"` 1653} 1654 1655// MarshalJSON is the custom marshaler for ContractualRulesTextAttribution. 1656func (crta ContractualRulesTextAttribution) MarshalJSON() ([]byte, error) { 1657 crta.Type = TypeContractualRulesTextAttribution 1658 objectMap := make(map[string]interface{}) 1659 if crta.Text != nil { 1660 objectMap["text"] = crta.Text 1661 } 1662 if crta.Type != "" { 1663 objectMap["_type"] = crta.Type 1664 } 1665 return json.Marshal(objectMap) 1666} 1667 1668// AsContractualRulesAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesTextAttribution. 1669func (crta ContractualRulesTextAttribution) AsContractualRulesAttribution() (*ContractualRulesAttribution, bool) { 1670 return nil, false 1671} 1672 1673// AsBasicContractualRulesAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesTextAttribution. 1674func (crta ContractualRulesTextAttribution) AsBasicContractualRulesAttribution() (BasicContractualRulesAttribution, bool) { 1675 return &crta, true 1676} 1677 1678// AsContractualRulesLicenseAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesTextAttribution. 1679func (crta ContractualRulesTextAttribution) AsContractualRulesLicenseAttribution() (*ContractualRulesLicenseAttribution, bool) { 1680 return nil, false 1681} 1682 1683// AsContractualRulesLinkAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesTextAttribution. 1684func (crta ContractualRulesTextAttribution) AsContractualRulesLinkAttribution() (*ContractualRulesLinkAttribution, bool) { 1685 return nil, false 1686} 1687 1688// AsContractualRulesMediaAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesTextAttribution. 1689func (crta ContractualRulesTextAttribution) AsContractualRulesMediaAttribution() (*ContractualRulesMediaAttribution, bool) { 1690 return nil, false 1691} 1692 1693// AsContractualRulesTextAttribution is the BasicContractualRulesContractualRule implementation for ContractualRulesTextAttribution. 1694func (crta ContractualRulesTextAttribution) AsContractualRulesTextAttribution() (*ContractualRulesTextAttribution, bool) { 1695 return &crta, true 1696} 1697 1698// AsContractualRulesContractualRule is the BasicContractualRulesContractualRule implementation for ContractualRulesTextAttribution. 1699func (crta ContractualRulesTextAttribution) AsContractualRulesContractualRule() (*ContractualRulesContractualRule, bool) { 1700 return nil, false 1701} 1702 1703// AsBasicContractualRulesContractualRule is the BasicContractualRulesContractualRule implementation for ContractualRulesTextAttribution. 1704func (crta ContractualRulesTextAttribution) AsBasicContractualRulesContractualRule() (BasicContractualRulesContractualRule, bool) { 1705 return &crta, true 1706} 1707 1708// BasicCreativeWork ... 1709type BasicCreativeWork interface { 1710 AsImageObject() (*ImageObject, bool) 1711 AsMediaObject() (*MediaObject, bool) 1712 AsBasicMediaObject() (BasicMediaObject, bool) 1713 AsLicense() (*License, bool) 1714 AsCreativeWork() (*CreativeWork, bool) 1715} 1716 1717// CreativeWork ... 1718type CreativeWork struct { 1719 // ThumbnailURL - READ-ONLY; The URL to a thumbnail of the item. 1720 ThumbnailURL *string `json:"thumbnailUrl,omitempty"` 1721 // Provider - READ-ONLY; The source of the creative work. 1722 Provider *[]BasicThing `json:"provider,omitempty"` 1723 // Text - READ-ONLY 1724 Text *string `json:"text,omitempty"` 1725 // Name - READ-ONLY; The name of the thing represented by this object. 1726 Name *string `json:"name,omitempty"` 1727 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 1728 URL *string `json:"url,omitempty"` 1729 // Image - READ-ONLY 1730 Image *ImageObject `json:"image,omitempty"` 1731 // Description - READ-ONLY; A short description of the item. 1732 Description *string `json:"description,omitempty"` 1733 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 1734 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 1735 // BingID - READ-ONLY; An ID that uniquely identifies this item. 1736 BingID *string `json:"bingId,omitempty"` 1737 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 1738 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 1739 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 1740 WebSearchURL *string `json:"webSearchUrl,omitempty"` 1741 // ID - READ-ONLY; A String identifier. 1742 ID *string `json:"id,omitempty"` 1743 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 1744 Type TypeBasicResponseBase `json:"_type,omitempty"` 1745} 1746 1747func unmarshalBasicCreativeWork(body []byte) (BasicCreativeWork, error) { 1748 var m map[string]interface{} 1749 err := json.Unmarshal(body, &m) 1750 if err != nil { 1751 return nil, err 1752 } 1753 1754 switch m["_type"] { 1755 case string(TypeImageObject): 1756 var ioVar ImageObject 1757 err := json.Unmarshal(body, &ioVar) 1758 return ioVar, err 1759 case string(TypeMediaObject): 1760 var mo MediaObject 1761 err := json.Unmarshal(body, &mo) 1762 return mo, err 1763 case string(TypeLicense): 1764 var l License 1765 err := json.Unmarshal(body, &l) 1766 return l, err 1767 default: 1768 var cw CreativeWork 1769 err := json.Unmarshal(body, &cw) 1770 return cw, err 1771 } 1772} 1773func unmarshalBasicCreativeWorkArray(body []byte) ([]BasicCreativeWork, error) { 1774 var rawMessages []*json.RawMessage 1775 err := json.Unmarshal(body, &rawMessages) 1776 if err != nil { 1777 return nil, err 1778 } 1779 1780 cwArray := make([]BasicCreativeWork, len(rawMessages)) 1781 1782 for index, rawMessage := range rawMessages { 1783 cw, err := unmarshalBasicCreativeWork(*rawMessage) 1784 if err != nil { 1785 return nil, err 1786 } 1787 cwArray[index] = cw 1788 } 1789 return cwArray, nil 1790} 1791 1792// MarshalJSON is the custom marshaler for CreativeWork. 1793func (cw CreativeWork) MarshalJSON() ([]byte, error) { 1794 cw.Type = TypeCreativeWork 1795 objectMap := make(map[string]interface{}) 1796 if cw.Type != "" { 1797 objectMap["_type"] = cw.Type 1798 } 1799 return json.Marshal(objectMap) 1800} 1801 1802// AsImageObject is the BasicResponseBase implementation for CreativeWork. 1803func (cw CreativeWork) AsImageObject() (*ImageObject, bool) { 1804 return nil, false 1805} 1806 1807// AsThing is the BasicResponseBase implementation for CreativeWork. 1808func (cw CreativeWork) AsThing() (*Thing, bool) { 1809 return nil, false 1810} 1811 1812// AsBasicThing is the BasicResponseBase implementation for CreativeWork. 1813func (cw CreativeWork) AsBasicThing() (BasicThing, bool) { 1814 return &cw, true 1815} 1816 1817// AsEntities is the BasicResponseBase implementation for CreativeWork. 1818func (cw CreativeWork) AsEntities() (*Entities, bool) { 1819 return nil, false 1820} 1821 1822// AsPlaces is the BasicResponseBase implementation for CreativeWork. 1823func (cw CreativeWork) AsPlaces() (*Places, bool) { 1824 return nil, false 1825} 1826 1827// AsSearchResponse is the BasicResponseBase implementation for CreativeWork. 1828func (cw CreativeWork) AsSearchResponse() (*SearchResponse, bool) { 1829 return nil, false 1830} 1831 1832// AsResponse is the BasicResponseBase implementation for CreativeWork. 1833func (cw CreativeWork) AsResponse() (*Response, bool) { 1834 return nil, false 1835} 1836 1837// AsBasicResponse is the BasicResponseBase implementation for CreativeWork. 1838func (cw CreativeWork) AsBasicResponse() (BasicResponse, bool) { 1839 return &cw, true 1840} 1841 1842// AsSearchResultsAnswer is the BasicResponseBase implementation for CreativeWork. 1843func (cw CreativeWork) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 1844 return nil, false 1845} 1846 1847// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for CreativeWork. 1848func (cw CreativeWork) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 1849 return nil, false 1850} 1851 1852// AsIdentifiable is the BasicResponseBase implementation for CreativeWork. 1853func (cw CreativeWork) AsIdentifiable() (*Identifiable, bool) { 1854 return nil, false 1855} 1856 1857// AsBasicIdentifiable is the BasicResponseBase implementation for CreativeWork. 1858func (cw CreativeWork) AsBasicIdentifiable() (BasicIdentifiable, bool) { 1859 return &cw, true 1860} 1861 1862// AsAnswer is the BasicResponseBase implementation for CreativeWork. 1863func (cw CreativeWork) AsAnswer() (*Answer, bool) { 1864 return nil, false 1865} 1866 1867// AsBasicAnswer is the BasicResponseBase implementation for CreativeWork. 1868func (cw CreativeWork) AsBasicAnswer() (BasicAnswer, bool) { 1869 return nil, false 1870} 1871 1872// AsErrorResponse is the BasicResponseBase implementation for CreativeWork. 1873func (cw CreativeWork) AsErrorResponse() (*ErrorResponse, bool) { 1874 return nil, false 1875} 1876 1877// AsPostalAddress is the BasicResponseBase implementation for CreativeWork. 1878func (cw CreativeWork) AsPostalAddress() (*PostalAddress, bool) { 1879 return nil, false 1880} 1881 1882// AsPlace is the BasicResponseBase implementation for CreativeWork. 1883func (cw CreativeWork) AsPlace() (*Place, bool) { 1884 return nil, false 1885} 1886 1887// AsBasicPlace is the BasicResponseBase implementation for CreativeWork. 1888func (cw CreativeWork) AsBasicPlace() (BasicPlace, bool) { 1889 return nil, false 1890} 1891 1892// AsOrganization is the BasicResponseBase implementation for CreativeWork. 1893func (cw CreativeWork) AsOrganization() (*Organization, bool) { 1894 return nil, false 1895} 1896 1897// AsCreativeWork is the BasicResponseBase implementation for CreativeWork. 1898func (cw CreativeWork) AsCreativeWork() (*CreativeWork, bool) { 1899 return &cw, true 1900} 1901 1902// AsBasicCreativeWork is the BasicResponseBase implementation for CreativeWork. 1903func (cw CreativeWork) AsBasicCreativeWork() (BasicCreativeWork, bool) { 1904 return &cw, true 1905} 1906 1907// AsIntangible is the BasicResponseBase implementation for CreativeWork. 1908func (cw CreativeWork) AsIntangible() (*Intangible, bool) { 1909 return nil, false 1910} 1911 1912// AsBasicIntangible is the BasicResponseBase implementation for CreativeWork. 1913func (cw CreativeWork) AsBasicIntangible() (BasicIntangible, bool) { 1914 return nil, false 1915} 1916 1917// AsMovieTheater is the BasicResponseBase implementation for CreativeWork. 1918func (cw CreativeWork) AsMovieTheater() (*MovieTheater, bool) { 1919 return nil, false 1920} 1921 1922// AsMediaObject is the BasicResponseBase implementation for CreativeWork. 1923func (cw CreativeWork) AsMediaObject() (*MediaObject, bool) { 1924 return nil, false 1925} 1926 1927// AsBasicMediaObject is the BasicResponseBase implementation for CreativeWork. 1928func (cw CreativeWork) AsBasicMediaObject() (BasicMediaObject, bool) { 1929 return nil, false 1930} 1931 1932// AsCivicStructure is the BasicResponseBase implementation for CreativeWork. 1933func (cw CreativeWork) AsCivicStructure() (*CivicStructure, bool) { 1934 return nil, false 1935} 1936 1937// AsBasicCivicStructure is the BasicResponseBase implementation for CreativeWork. 1938func (cw CreativeWork) AsBasicCivicStructure() (BasicCivicStructure, bool) { 1939 return nil, false 1940} 1941 1942// AsLocalBusiness is the BasicResponseBase implementation for CreativeWork. 1943func (cw CreativeWork) AsLocalBusiness() (*LocalBusiness, bool) { 1944 return nil, false 1945} 1946 1947// AsBasicLocalBusiness is the BasicResponseBase implementation for CreativeWork. 1948func (cw CreativeWork) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 1949 return nil, false 1950} 1951 1952// AsTouristAttraction is the BasicResponseBase implementation for CreativeWork. 1953func (cw CreativeWork) AsTouristAttraction() (*TouristAttraction, bool) { 1954 return nil, false 1955} 1956 1957// AsAirport is the BasicResponseBase implementation for CreativeWork. 1958func (cw CreativeWork) AsAirport() (*Airport, bool) { 1959 return nil, false 1960} 1961 1962// AsLicense is the BasicResponseBase implementation for CreativeWork. 1963func (cw CreativeWork) AsLicense() (*License, bool) { 1964 return nil, false 1965} 1966 1967// AsStructuredValue is the BasicResponseBase implementation for CreativeWork. 1968func (cw CreativeWork) AsStructuredValue() (*StructuredValue, bool) { 1969 return nil, false 1970} 1971 1972// AsBasicStructuredValue is the BasicResponseBase implementation for CreativeWork. 1973func (cw CreativeWork) AsBasicStructuredValue() (BasicStructuredValue, bool) { 1974 return nil, false 1975} 1976 1977// AsEntertainmentBusiness is the BasicResponseBase implementation for CreativeWork. 1978func (cw CreativeWork) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 1979 return nil, false 1980} 1981 1982// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for CreativeWork. 1983func (cw CreativeWork) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 1984 return nil, false 1985} 1986 1987// AsFoodEstablishment is the BasicResponseBase implementation for CreativeWork. 1988func (cw CreativeWork) AsFoodEstablishment() (*FoodEstablishment, bool) { 1989 return nil, false 1990} 1991 1992// AsBasicFoodEstablishment is the BasicResponseBase implementation for CreativeWork. 1993func (cw CreativeWork) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 1994 return nil, false 1995} 1996 1997// AsLodgingBusiness is the BasicResponseBase implementation for CreativeWork. 1998func (cw CreativeWork) AsLodgingBusiness() (*LodgingBusiness, bool) { 1999 return nil, false 2000} 2001 2002// AsBasicLodgingBusiness is the BasicResponseBase implementation for CreativeWork. 2003func (cw CreativeWork) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 2004 return nil, false 2005} 2006 2007// AsRestaurant is the BasicResponseBase implementation for CreativeWork. 2008func (cw CreativeWork) AsRestaurant() (*Restaurant, bool) { 2009 return nil, false 2010} 2011 2012// AsHotel is the BasicResponseBase implementation for CreativeWork. 2013func (cw CreativeWork) AsHotel() (*Hotel, bool) { 2014 return nil, false 2015} 2016 2017// AsResponseBase is the BasicResponseBase implementation for CreativeWork. 2018func (cw CreativeWork) AsResponseBase() (*ResponseBase, bool) { 2019 return nil, false 2020} 2021 2022// AsBasicResponseBase is the BasicResponseBase implementation for CreativeWork. 2023func (cw CreativeWork) AsBasicResponseBase() (BasicResponseBase, bool) { 2024 return &cw, true 2025} 2026 2027// UnmarshalJSON is the custom unmarshaler for CreativeWork struct. 2028func (cw *CreativeWork) UnmarshalJSON(body []byte) error { 2029 var m map[string]*json.RawMessage 2030 err := json.Unmarshal(body, &m) 2031 if err != nil { 2032 return err 2033 } 2034 for k, v := range m { 2035 switch k { 2036 case "thumbnailUrl": 2037 if v != nil { 2038 var thumbnailURL string 2039 err = json.Unmarshal(*v, &thumbnailURL) 2040 if err != nil { 2041 return err 2042 } 2043 cw.ThumbnailURL = &thumbnailURL 2044 } 2045 case "provider": 2046 if v != nil { 2047 provider, err := unmarshalBasicThingArray(*v) 2048 if err != nil { 2049 return err 2050 } 2051 cw.Provider = &provider 2052 } 2053 case "text": 2054 if v != nil { 2055 var textVar string 2056 err = json.Unmarshal(*v, &textVar) 2057 if err != nil { 2058 return err 2059 } 2060 cw.Text = &textVar 2061 } 2062 case "name": 2063 if v != nil { 2064 var name string 2065 err = json.Unmarshal(*v, &name) 2066 if err != nil { 2067 return err 2068 } 2069 cw.Name = &name 2070 } 2071 case "url": 2072 if v != nil { 2073 var URL string 2074 err = json.Unmarshal(*v, &URL) 2075 if err != nil { 2076 return err 2077 } 2078 cw.URL = &URL 2079 } 2080 case "image": 2081 if v != nil { 2082 var imageVar ImageObject 2083 err = json.Unmarshal(*v, &imageVar) 2084 if err != nil { 2085 return err 2086 } 2087 cw.Image = &imageVar 2088 } 2089 case "description": 2090 if v != nil { 2091 var description string 2092 err = json.Unmarshal(*v, &description) 2093 if err != nil { 2094 return err 2095 } 2096 cw.Description = &description 2097 } 2098 case "entityPresentationInfo": 2099 if v != nil { 2100 var entityPresentationInfo EntitiesEntityPresentationInfo 2101 err = json.Unmarshal(*v, &entityPresentationInfo) 2102 if err != nil { 2103 return err 2104 } 2105 cw.EntityPresentationInfo = &entityPresentationInfo 2106 } 2107 case "bingId": 2108 if v != nil { 2109 var bingID string 2110 err = json.Unmarshal(*v, &bingID) 2111 if err != nil { 2112 return err 2113 } 2114 cw.BingID = &bingID 2115 } 2116 case "contractualRules": 2117 if v != nil { 2118 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 2119 if err != nil { 2120 return err 2121 } 2122 cw.ContractualRules = &contractualRules 2123 } 2124 case "webSearchUrl": 2125 if v != nil { 2126 var webSearchURL string 2127 err = json.Unmarshal(*v, &webSearchURL) 2128 if err != nil { 2129 return err 2130 } 2131 cw.WebSearchURL = &webSearchURL 2132 } 2133 case "id": 2134 if v != nil { 2135 var ID string 2136 err = json.Unmarshal(*v, &ID) 2137 if err != nil { 2138 return err 2139 } 2140 cw.ID = &ID 2141 } 2142 case "_type": 2143 if v != nil { 2144 var typeVar TypeBasicResponseBase 2145 err = json.Unmarshal(*v, &typeVar) 2146 if err != nil { 2147 return err 2148 } 2149 cw.Type = typeVar 2150 } 2151 } 2152 } 2153 2154 return nil 2155} 2156 2157// BasicEntertainmentBusiness ... 2158type BasicEntertainmentBusiness interface { 2159 AsMovieTheater() (*MovieTheater, bool) 2160 AsEntertainmentBusiness() (*EntertainmentBusiness, bool) 2161} 2162 2163// EntertainmentBusiness ... 2164type EntertainmentBusiness struct { 2165 // PriceRange - READ-ONLY; $$. 2166 PriceRange *string `json:"priceRange,omitempty"` 2167 // Panoramas - READ-ONLY 2168 Panoramas *[]ImageObject `json:"panoramas,omitempty"` 2169 // IsPermanentlyClosed - READ-ONLY 2170 IsPermanentlyClosed *bool `json:"isPermanentlyClosed,omitempty"` 2171 // TagLine - READ-ONLY 2172 TagLine *string `json:"tagLine,omitempty"` 2173 // Address - READ-ONLY; The postal address of where the entity is located 2174 Address *PostalAddress `json:"address,omitempty"` 2175 // Telephone - READ-ONLY; The entity's telephone number 2176 Telephone *string `json:"telephone,omitempty"` 2177 // Name - READ-ONLY; The name of the thing represented by this object. 2178 Name *string `json:"name,omitempty"` 2179 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 2180 URL *string `json:"url,omitempty"` 2181 // Image - READ-ONLY 2182 Image *ImageObject `json:"image,omitempty"` 2183 // Description - READ-ONLY; A short description of the item. 2184 Description *string `json:"description,omitempty"` 2185 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 2186 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 2187 // BingID - READ-ONLY; An ID that uniquely identifies this item. 2188 BingID *string `json:"bingId,omitempty"` 2189 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 2190 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 2191 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 2192 WebSearchURL *string `json:"webSearchUrl,omitempty"` 2193 // ID - READ-ONLY; A String identifier. 2194 ID *string `json:"id,omitempty"` 2195 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 2196 Type TypeBasicResponseBase `json:"_type,omitempty"` 2197} 2198 2199func unmarshalBasicEntertainmentBusiness(body []byte) (BasicEntertainmentBusiness, error) { 2200 var m map[string]interface{} 2201 err := json.Unmarshal(body, &m) 2202 if err != nil { 2203 return nil, err 2204 } 2205 2206 switch m["_type"] { 2207 case string(TypeMovieTheater): 2208 var mt MovieTheater 2209 err := json.Unmarshal(body, &mt) 2210 return mt, err 2211 default: 2212 var eb EntertainmentBusiness 2213 err := json.Unmarshal(body, &eb) 2214 return eb, err 2215 } 2216} 2217func unmarshalBasicEntertainmentBusinessArray(body []byte) ([]BasicEntertainmentBusiness, error) { 2218 var rawMessages []*json.RawMessage 2219 err := json.Unmarshal(body, &rawMessages) 2220 if err != nil { 2221 return nil, err 2222 } 2223 2224 ebArray := make([]BasicEntertainmentBusiness, len(rawMessages)) 2225 2226 for index, rawMessage := range rawMessages { 2227 eb, err := unmarshalBasicEntertainmentBusiness(*rawMessage) 2228 if err != nil { 2229 return nil, err 2230 } 2231 ebArray[index] = eb 2232 } 2233 return ebArray, nil 2234} 2235 2236// MarshalJSON is the custom marshaler for EntertainmentBusiness. 2237func (eb EntertainmentBusiness) MarshalJSON() ([]byte, error) { 2238 eb.Type = TypeEntertainmentBusiness 2239 objectMap := make(map[string]interface{}) 2240 if eb.Type != "" { 2241 objectMap["_type"] = eb.Type 2242 } 2243 return json.Marshal(objectMap) 2244} 2245 2246// AsImageObject is the BasicResponseBase implementation for EntertainmentBusiness. 2247func (eb EntertainmentBusiness) AsImageObject() (*ImageObject, bool) { 2248 return nil, false 2249} 2250 2251// AsThing is the BasicResponseBase implementation for EntertainmentBusiness. 2252func (eb EntertainmentBusiness) AsThing() (*Thing, bool) { 2253 return nil, false 2254} 2255 2256// AsBasicThing is the BasicResponseBase implementation for EntertainmentBusiness. 2257func (eb EntertainmentBusiness) AsBasicThing() (BasicThing, bool) { 2258 return &eb, true 2259} 2260 2261// AsEntities is the BasicResponseBase implementation for EntertainmentBusiness. 2262func (eb EntertainmentBusiness) AsEntities() (*Entities, bool) { 2263 return nil, false 2264} 2265 2266// AsPlaces is the BasicResponseBase implementation for EntertainmentBusiness. 2267func (eb EntertainmentBusiness) AsPlaces() (*Places, bool) { 2268 return nil, false 2269} 2270 2271// AsSearchResponse is the BasicResponseBase implementation for EntertainmentBusiness. 2272func (eb EntertainmentBusiness) AsSearchResponse() (*SearchResponse, bool) { 2273 return nil, false 2274} 2275 2276// AsResponse is the BasicResponseBase implementation for EntertainmentBusiness. 2277func (eb EntertainmentBusiness) AsResponse() (*Response, bool) { 2278 return nil, false 2279} 2280 2281// AsBasicResponse is the BasicResponseBase implementation for EntertainmentBusiness. 2282func (eb EntertainmentBusiness) AsBasicResponse() (BasicResponse, bool) { 2283 return &eb, true 2284} 2285 2286// AsSearchResultsAnswer is the BasicResponseBase implementation for EntertainmentBusiness. 2287func (eb EntertainmentBusiness) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 2288 return nil, false 2289} 2290 2291// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for EntertainmentBusiness. 2292func (eb EntertainmentBusiness) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 2293 return nil, false 2294} 2295 2296// AsIdentifiable is the BasicResponseBase implementation for EntertainmentBusiness. 2297func (eb EntertainmentBusiness) AsIdentifiable() (*Identifiable, bool) { 2298 return nil, false 2299} 2300 2301// AsBasicIdentifiable is the BasicResponseBase implementation for EntertainmentBusiness. 2302func (eb EntertainmentBusiness) AsBasicIdentifiable() (BasicIdentifiable, bool) { 2303 return &eb, true 2304} 2305 2306// AsAnswer is the BasicResponseBase implementation for EntertainmentBusiness. 2307func (eb EntertainmentBusiness) AsAnswer() (*Answer, bool) { 2308 return nil, false 2309} 2310 2311// AsBasicAnswer is the BasicResponseBase implementation for EntertainmentBusiness. 2312func (eb EntertainmentBusiness) AsBasicAnswer() (BasicAnswer, bool) { 2313 return nil, false 2314} 2315 2316// AsErrorResponse is the BasicResponseBase implementation for EntertainmentBusiness. 2317func (eb EntertainmentBusiness) AsErrorResponse() (*ErrorResponse, bool) { 2318 return nil, false 2319} 2320 2321// AsPostalAddress is the BasicResponseBase implementation for EntertainmentBusiness. 2322func (eb EntertainmentBusiness) AsPostalAddress() (*PostalAddress, bool) { 2323 return nil, false 2324} 2325 2326// AsPlace is the BasicResponseBase implementation for EntertainmentBusiness. 2327func (eb EntertainmentBusiness) AsPlace() (*Place, bool) { 2328 return nil, false 2329} 2330 2331// AsBasicPlace is the BasicResponseBase implementation for EntertainmentBusiness. 2332func (eb EntertainmentBusiness) AsBasicPlace() (BasicPlace, bool) { 2333 return &eb, true 2334} 2335 2336// AsOrganization is the BasicResponseBase implementation for EntertainmentBusiness. 2337func (eb EntertainmentBusiness) AsOrganization() (*Organization, bool) { 2338 return nil, false 2339} 2340 2341// AsCreativeWork is the BasicResponseBase implementation for EntertainmentBusiness. 2342func (eb EntertainmentBusiness) AsCreativeWork() (*CreativeWork, bool) { 2343 return nil, false 2344} 2345 2346// AsBasicCreativeWork is the BasicResponseBase implementation for EntertainmentBusiness. 2347func (eb EntertainmentBusiness) AsBasicCreativeWork() (BasicCreativeWork, bool) { 2348 return nil, false 2349} 2350 2351// AsIntangible is the BasicResponseBase implementation for EntertainmentBusiness. 2352func (eb EntertainmentBusiness) AsIntangible() (*Intangible, bool) { 2353 return nil, false 2354} 2355 2356// AsBasicIntangible is the BasicResponseBase implementation for EntertainmentBusiness. 2357func (eb EntertainmentBusiness) AsBasicIntangible() (BasicIntangible, bool) { 2358 return nil, false 2359} 2360 2361// AsMovieTheater is the BasicResponseBase implementation for EntertainmentBusiness. 2362func (eb EntertainmentBusiness) AsMovieTheater() (*MovieTheater, bool) { 2363 return nil, false 2364} 2365 2366// AsMediaObject is the BasicResponseBase implementation for EntertainmentBusiness. 2367func (eb EntertainmentBusiness) AsMediaObject() (*MediaObject, bool) { 2368 return nil, false 2369} 2370 2371// AsBasicMediaObject is the BasicResponseBase implementation for EntertainmentBusiness. 2372func (eb EntertainmentBusiness) AsBasicMediaObject() (BasicMediaObject, bool) { 2373 return nil, false 2374} 2375 2376// AsCivicStructure is the BasicResponseBase implementation for EntertainmentBusiness. 2377func (eb EntertainmentBusiness) AsCivicStructure() (*CivicStructure, bool) { 2378 return nil, false 2379} 2380 2381// AsBasicCivicStructure is the BasicResponseBase implementation for EntertainmentBusiness. 2382func (eb EntertainmentBusiness) AsBasicCivicStructure() (BasicCivicStructure, bool) { 2383 return nil, false 2384} 2385 2386// AsLocalBusiness is the BasicResponseBase implementation for EntertainmentBusiness. 2387func (eb EntertainmentBusiness) AsLocalBusiness() (*LocalBusiness, bool) { 2388 return nil, false 2389} 2390 2391// AsBasicLocalBusiness is the BasicResponseBase implementation for EntertainmentBusiness. 2392func (eb EntertainmentBusiness) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 2393 return &eb, true 2394} 2395 2396// AsTouristAttraction is the BasicResponseBase implementation for EntertainmentBusiness. 2397func (eb EntertainmentBusiness) AsTouristAttraction() (*TouristAttraction, bool) { 2398 return nil, false 2399} 2400 2401// AsAirport is the BasicResponseBase implementation for EntertainmentBusiness. 2402func (eb EntertainmentBusiness) AsAirport() (*Airport, bool) { 2403 return nil, false 2404} 2405 2406// AsLicense is the BasicResponseBase implementation for EntertainmentBusiness. 2407func (eb EntertainmentBusiness) AsLicense() (*License, bool) { 2408 return nil, false 2409} 2410 2411// AsStructuredValue is the BasicResponseBase implementation for EntertainmentBusiness. 2412func (eb EntertainmentBusiness) AsStructuredValue() (*StructuredValue, bool) { 2413 return nil, false 2414} 2415 2416// AsBasicStructuredValue is the BasicResponseBase implementation for EntertainmentBusiness. 2417func (eb EntertainmentBusiness) AsBasicStructuredValue() (BasicStructuredValue, bool) { 2418 return nil, false 2419} 2420 2421// AsEntertainmentBusiness is the BasicResponseBase implementation for EntertainmentBusiness. 2422func (eb EntertainmentBusiness) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 2423 return &eb, true 2424} 2425 2426// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for EntertainmentBusiness. 2427func (eb EntertainmentBusiness) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 2428 return &eb, true 2429} 2430 2431// AsFoodEstablishment is the BasicResponseBase implementation for EntertainmentBusiness. 2432func (eb EntertainmentBusiness) AsFoodEstablishment() (*FoodEstablishment, bool) { 2433 return nil, false 2434} 2435 2436// AsBasicFoodEstablishment is the BasicResponseBase implementation for EntertainmentBusiness. 2437func (eb EntertainmentBusiness) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 2438 return nil, false 2439} 2440 2441// AsLodgingBusiness is the BasicResponseBase implementation for EntertainmentBusiness. 2442func (eb EntertainmentBusiness) AsLodgingBusiness() (*LodgingBusiness, bool) { 2443 return nil, false 2444} 2445 2446// AsBasicLodgingBusiness is the BasicResponseBase implementation for EntertainmentBusiness. 2447func (eb EntertainmentBusiness) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 2448 return nil, false 2449} 2450 2451// AsRestaurant is the BasicResponseBase implementation for EntertainmentBusiness. 2452func (eb EntertainmentBusiness) AsRestaurant() (*Restaurant, bool) { 2453 return nil, false 2454} 2455 2456// AsHotel is the BasicResponseBase implementation for EntertainmentBusiness. 2457func (eb EntertainmentBusiness) AsHotel() (*Hotel, bool) { 2458 return nil, false 2459} 2460 2461// AsResponseBase is the BasicResponseBase implementation for EntertainmentBusiness. 2462func (eb EntertainmentBusiness) AsResponseBase() (*ResponseBase, bool) { 2463 return nil, false 2464} 2465 2466// AsBasicResponseBase is the BasicResponseBase implementation for EntertainmentBusiness. 2467func (eb EntertainmentBusiness) AsBasicResponseBase() (BasicResponseBase, bool) { 2468 return &eb, true 2469} 2470 2471// UnmarshalJSON is the custom unmarshaler for EntertainmentBusiness struct. 2472func (eb *EntertainmentBusiness) UnmarshalJSON(body []byte) error { 2473 var m map[string]*json.RawMessage 2474 err := json.Unmarshal(body, &m) 2475 if err != nil { 2476 return err 2477 } 2478 for k, v := range m { 2479 switch k { 2480 case "priceRange": 2481 if v != nil { 2482 var priceRange string 2483 err = json.Unmarshal(*v, &priceRange) 2484 if err != nil { 2485 return err 2486 } 2487 eb.PriceRange = &priceRange 2488 } 2489 case "panoramas": 2490 if v != nil { 2491 var panoramas []ImageObject 2492 err = json.Unmarshal(*v, &panoramas) 2493 if err != nil { 2494 return err 2495 } 2496 eb.Panoramas = &panoramas 2497 } 2498 case "isPermanentlyClosed": 2499 if v != nil { 2500 var isPermanentlyClosed bool 2501 err = json.Unmarshal(*v, &isPermanentlyClosed) 2502 if err != nil { 2503 return err 2504 } 2505 eb.IsPermanentlyClosed = &isPermanentlyClosed 2506 } 2507 case "tagLine": 2508 if v != nil { 2509 var tagLine string 2510 err = json.Unmarshal(*v, &tagLine) 2511 if err != nil { 2512 return err 2513 } 2514 eb.TagLine = &tagLine 2515 } 2516 case "address": 2517 if v != nil { 2518 var address PostalAddress 2519 err = json.Unmarshal(*v, &address) 2520 if err != nil { 2521 return err 2522 } 2523 eb.Address = &address 2524 } 2525 case "telephone": 2526 if v != nil { 2527 var telephone string 2528 err = json.Unmarshal(*v, &telephone) 2529 if err != nil { 2530 return err 2531 } 2532 eb.Telephone = &telephone 2533 } 2534 case "name": 2535 if v != nil { 2536 var name string 2537 err = json.Unmarshal(*v, &name) 2538 if err != nil { 2539 return err 2540 } 2541 eb.Name = &name 2542 } 2543 case "url": 2544 if v != nil { 2545 var URL string 2546 err = json.Unmarshal(*v, &URL) 2547 if err != nil { 2548 return err 2549 } 2550 eb.URL = &URL 2551 } 2552 case "image": 2553 if v != nil { 2554 var imageVar ImageObject 2555 err = json.Unmarshal(*v, &imageVar) 2556 if err != nil { 2557 return err 2558 } 2559 eb.Image = &imageVar 2560 } 2561 case "description": 2562 if v != nil { 2563 var description string 2564 err = json.Unmarshal(*v, &description) 2565 if err != nil { 2566 return err 2567 } 2568 eb.Description = &description 2569 } 2570 case "entityPresentationInfo": 2571 if v != nil { 2572 var entityPresentationInfo EntitiesEntityPresentationInfo 2573 err = json.Unmarshal(*v, &entityPresentationInfo) 2574 if err != nil { 2575 return err 2576 } 2577 eb.EntityPresentationInfo = &entityPresentationInfo 2578 } 2579 case "bingId": 2580 if v != nil { 2581 var bingID string 2582 err = json.Unmarshal(*v, &bingID) 2583 if err != nil { 2584 return err 2585 } 2586 eb.BingID = &bingID 2587 } 2588 case "contractualRules": 2589 if v != nil { 2590 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 2591 if err != nil { 2592 return err 2593 } 2594 eb.ContractualRules = &contractualRules 2595 } 2596 case "webSearchUrl": 2597 if v != nil { 2598 var webSearchURL string 2599 err = json.Unmarshal(*v, &webSearchURL) 2600 if err != nil { 2601 return err 2602 } 2603 eb.WebSearchURL = &webSearchURL 2604 } 2605 case "id": 2606 if v != nil { 2607 var ID string 2608 err = json.Unmarshal(*v, &ID) 2609 if err != nil { 2610 return err 2611 } 2612 eb.ID = &ID 2613 } 2614 case "_type": 2615 if v != nil { 2616 var typeVar TypeBasicResponseBase 2617 err = json.Unmarshal(*v, &typeVar) 2618 if err != nil { 2619 return err 2620 } 2621 eb.Type = typeVar 2622 } 2623 } 2624 } 2625 2626 return nil 2627} 2628 2629// Entities defines an entity answer. 2630type Entities struct { 2631 // QueryScenario - READ-ONLY; The supported query scenario. This field is set to DominantEntity or DisambiguationItem. The field is set to DominantEntity if Bing determines that only a single entity satisfies the request. For example, a book, movie, person, or attraction. If multiple entities could satisfy the request, the field is set to DisambiguationItem. For example, if the request uses the generic title of a movie franchise, the entity's type would likely be DisambiguationItem. But, if the request specifies a specific title from the franchise, the entity's type would likely be DominantEntity. Possible values include: 'DominantEntity', 'DominantEntityWithDisambiguation', 'Disambiguation', 'List', 'ListWithPivot' 2632 QueryScenario EntityQueryScenario `json:"queryScenario,omitempty"` 2633 // Value - A list of entities. 2634 Value *[]BasicThing `json:"value,omitempty"` 2635 // QueryContext - READ-ONLY 2636 QueryContext *QueryContext `json:"queryContext,omitempty"` 2637 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 2638 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 2639 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 2640 WebSearchURL *string `json:"webSearchUrl,omitempty"` 2641 // ID - READ-ONLY; A String identifier. 2642 ID *string `json:"id,omitempty"` 2643 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 2644 Type TypeBasicResponseBase `json:"_type,omitempty"` 2645} 2646 2647// MarshalJSON is the custom marshaler for Entities. 2648func (e Entities) MarshalJSON() ([]byte, error) { 2649 e.Type = TypeEntities 2650 objectMap := make(map[string]interface{}) 2651 if e.Value != nil { 2652 objectMap["value"] = e.Value 2653 } 2654 if e.Type != "" { 2655 objectMap["_type"] = e.Type 2656 } 2657 return json.Marshal(objectMap) 2658} 2659 2660// AsImageObject is the BasicResponseBase implementation for Entities. 2661func (e Entities) AsImageObject() (*ImageObject, bool) { 2662 return nil, false 2663} 2664 2665// AsThing is the BasicResponseBase implementation for Entities. 2666func (e Entities) AsThing() (*Thing, bool) { 2667 return nil, false 2668} 2669 2670// AsBasicThing is the BasicResponseBase implementation for Entities. 2671func (e Entities) AsBasicThing() (BasicThing, bool) { 2672 return nil, false 2673} 2674 2675// AsEntities is the BasicResponseBase implementation for Entities. 2676func (e Entities) AsEntities() (*Entities, bool) { 2677 return &e, true 2678} 2679 2680// AsPlaces is the BasicResponseBase implementation for Entities. 2681func (e Entities) AsPlaces() (*Places, bool) { 2682 return nil, false 2683} 2684 2685// AsSearchResponse is the BasicResponseBase implementation for Entities. 2686func (e Entities) AsSearchResponse() (*SearchResponse, bool) { 2687 return nil, false 2688} 2689 2690// AsResponse is the BasicResponseBase implementation for Entities. 2691func (e Entities) AsResponse() (*Response, bool) { 2692 return nil, false 2693} 2694 2695// AsBasicResponse is the BasicResponseBase implementation for Entities. 2696func (e Entities) AsBasicResponse() (BasicResponse, bool) { 2697 return &e, true 2698} 2699 2700// AsSearchResultsAnswer is the BasicResponseBase implementation for Entities. 2701func (e Entities) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 2702 return nil, false 2703} 2704 2705// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Entities. 2706func (e Entities) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 2707 return &e, true 2708} 2709 2710// AsIdentifiable is the BasicResponseBase implementation for Entities. 2711func (e Entities) AsIdentifiable() (*Identifiable, bool) { 2712 return nil, false 2713} 2714 2715// AsBasicIdentifiable is the BasicResponseBase implementation for Entities. 2716func (e Entities) AsBasicIdentifiable() (BasicIdentifiable, bool) { 2717 return &e, true 2718} 2719 2720// AsAnswer is the BasicResponseBase implementation for Entities. 2721func (e Entities) AsAnswer() (*Answer, bool) { 2722 return nil, false 2723} 2724 2725// AsBasicAnswer is the BasicResponseBase implementation for Entities. 2726func (e Entities) AsBasicAnswer() (BasicAnswer, bool) { 2727 return &e, true 2728} 2729 2730// AsErrorResponse is the BasicResponseBase implementation for Entities. 2731func (e Entities) AsErrorResponse() (*ErrorResponse, bool) { 2732 return nil, false 2733} 2734 2735// AsPostalAddress is the BasicResponseBase implementation for Entities. 2736func (e Entities) AsPostalAddress() (*PostalAddress, bool) { 2737 return nil, false 2738} 2739 2740// AsPlace is the BasicResponseBase implementation for Entities. 2741func (e Entities) AsPlace() (*Place, bool) { 2742 return nil, false 2743} 2744 2745// AsBasicPlace is the BasicResponseBase implementation for Entities. 2746func (e Entities) AsBasicPlace() (BasicPlace, bool) { 2747 return nil, false 2748} 2749 2750// AsOrganization is the BasicResponseBase implementation for Entities. 2751func (e Entities) AsOrganization() (*Organization, bool) { 2752 return nil, false 2753} 2754 2755// AsCreativeWork is the BasicResponseBase implementation for Entities. 2756func (e Entities) AsCreativeWork() (*CreativeWork, bool) { 2757 return nil, false 2758} 2759 2760// AsBasicCreativeWork is the BasicResponseBase implementation for Entities. 2761func (e Entities) AsBasicCreativeWork() (BasicCreativeWork, bool) { 2762 return nil, false 2763} 2764 2765// AsIntangible is the BasicResponseBase implementation for Entities. 2766func (e Entities) AsIntangible() (*Intangible, bool) { 2767 return nil, false 2768} 2769 2770// AsBasicIntangible is the BasicResponseBase implementation for Entities. 2771func (e Entities) AsBasicIntangible() (BasicIntangible, bool) { 2772 return nil, false 2773} 2774 2775// AsMovieTheater is the BasicResponseBase implementation for Entities. 2776func (e Entities) AsMovieTheater() (*MovieTheater, bool) { 2777 return nil, false 2778} 2779 2780// AsMediaObject is the BasicResponseBase implementation for Entities. 2781func (e Entities) AsMediaObject() (*MediaObject, bool) { 2782 return nil, false 2783} 2784 2785// AsBasicMediaObject is the BasicResponseBase implementation for Entities. 2786func (e Entities) AsBasicMediaObject() (BasicMediaObject, bool) { 2787 return nil, false 2788} 2789 2790// AsCivicStructure is the BasicResponseBase implementation for Entities. 2791func (e Entities) AsCivicStructure() (*CivicStructure, bool) { 2792 return nil, false 2793} 2794 2795// AsBasicCivicStructure is the BasicResponseBase implementation for Entities. 2796func (e Entities) AsBasicCivicStructure() (BasicCivicStructure, bool) { 2797 return nil, false 2798} 2799 2800// AsLocalBusiness is the BasicResponseBase implementation for Entities. 2801func (e Entities) AsLocalBusiness() (*LocalBusiness, bool) { 2802 return nil, false 2803} 2804 2805// AsBasicLocalBusiness is the BasicResponseBase implementation for Entities. 2806func (e Entities) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 2807 return nil, false 2808} 2809 2810// AsTouristAttraction is the BasicResponseBase implementation for Entities. 2811func (e Entities) AsTouristAttraction() (*TouristAttraction, bool) { 2812 return nil, false 2813} 2814 2815// AsAirport is the BasicResponseBase implementation for Entities. 2816func (e Entities) AsAirport() (*Airport, bool) { 2817 return nil, false 2818} 2819 2820// AsLicense is the BasicResponseBase implementation for Entities. 2821func (e Entities) AsLicense() (*License, bool) { 2822 return nil, false 2823} 2824 2825// AsStructuredValue is the BasicResponseBase implementation for Entities. 2826func (e Entities) AsStructuredValue() (*StructuredValue, bool) { 2827 return nil, false 2828} 2829 2830// AsBasicStructuredValue is the BasicResponseBase implementation for Entities. 2831func (e Entities) AsBasicStructuredValue() (BasicStructuredValue, bool) { 2832 return nil, false 2833} 2834 2835// AsEntertainmentBusiness is the BasicResponseBase implementation for Entities. 2836func (e Entities) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 2837 return nil, false 2838} 2839 2840// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for Entities. 2841func (e Entities) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 2842 return nil, false 2843} 2844 2845// AsFoodEstablishment is the BasicResponseBase implementation for Entities. 2846func (e Entities) AsFoodEstablishment() (*FoodEstablishment, bool) { 2847 return nil, false 2848} 2849 2850// AsBasicFoodEstablishment is the BasicResponseBase implementation for Entities. 2851func (e Entities) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 2852 return nil, false 2853} 2854 2855// AsLodgingBusiness is the BasicResponseBase implementation for Entities. 2856func (e Entities) AsLodgingBusiness() (*LodgingBusiness, bool) { 2857 return nil, false 2858} 2859 2860// AsBasicLodgingBusiness is the BasicResponseBase implementation for Entities. 2861func (e Entities) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 2862 return nil, false 2863} 2864 2865// AsRestaurant is the BasicResponseBase implementation for Entities. 2866func (e Entities) AsRestaurant() (*Restaurant, bool) { 2867 return nil, false 2868} 2869 2870// AsHotel is the BasicResponseBase implementation for Entities. 2871func (e Entities) AsHotel() (*Hotel, bool) { 2872 return nil, false 2873} 2874 2875// AsResponseBase is the BasicResponseBase implementation for Entities. 2876func (e Entities) AsResponseBase() (*ResponseBase, bool) { 2877 return nil, false 2878} 2879 2880// AsBasicResponseBase is the BasicResponseBase implementation for Entities. 2881func (e Entities) AsBasicResponseBase() (BasicResponseBase, bool) { 2882 return &e, true 2883} 2884 2885// UnmarshalJSON is the custom unmarshaler for Entities struct. 2886func (e *Entities) UnmarshalJSON(body []byte) error { 2887 var m map[string]*json.RawMessage 2888 err := json.Unmarshal(body, &m) 2889 if err != nil { 2890 return err 2891 } 2892 for k, v := range m { 2893 switch k { 2894 case "queryScenario": 2895 if v != nil { 2896 var queryScenario EntityQueryScenario 2897 err = json.Unmarshal(*v, &queryScenario) 2898 if err != nil { 2899 return err 2900 } 2901 e.QueryScenario = queryScenario 2902 } 2903 case "value": 2904 if v != nil { 2905 value, err := unmarshalBasicThingArray(*v) 2906 if err != nil { 2907 return err 2908 } 2909 e.Value = &value 2910 } 2911 case "queryContext": 2912 if v != nil { 2913 var queryContext QueryContext 2914 err = json.Unmarshal(*v, &queryContext) 2915 if err != nil { 2916 return err 2917 } 2918 e.QueryContext = &queryContext 2919 } 2920 case "contractualRules": 2921 if v != nil { 2922 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 2923 if err != nil { 2924 return err 2925 } 2926 e.ContractualRules = &contractualRules 2927 } 2928 case "webSearchUrl": 2929 if v != nil { 2930 var webSearchURL string 2931 err = json.Unmarshal(*v, &webSearchURL) 2932 if err != nil { 2933 return err 2934 } 2935 e.WebSearchURL = &webSearchURL 2936 } 2937 case "id": 2938 if v != nil { 2939 var ID string 2940 err = json.Unmarshal(*v, &ID) 2941 if err != nil { 2942 return err 2943 } 2944 e.ID = &ID 2945 } 2946 case "_type": 2947 if v != nil { 2948 var typeVar TypeBasicResponseBase 2949 err = json.Unmarshal(*v, &typeVar) 2950 if err != nil { 2951 return err 2952 } 2953 e.Type = typeVar 2954 } 2955 } 2956 } 2957 2958 return nil 2959} 2960 2961// EntitiesEntityPresentationInfo defines additional information about an entity such as type hints. 2962type EntitiesEntityPresentationInfo struct { 2963 // EntityScenario - The supported scenario. Possible values include: 'EntityScenarioDominantEntity', 'EntityScenarioDisambiguationItem', 'EntityScenarioListItem' 2964 EntityScenario EntityScenario `json:"entityScenario,omitempty"` 2965 // EntityTypeHints - READ-ONLY; A list of hints that indicate the entity's type. The list could contain a single hint such as Movie or a list of hints such as Place, LocalBusiness, Restaurant. Each successive hint in the array narrows the entity's type. 2966 EntityTypeHints *[]EntityType `json:"entityTypeHints,omitempty"` 2967 // EntityTypeDisplayHint - READ-ONLY; A display version of the entity hint. For example, if entityTypeHints is Artist, this field may be set to American Singer. 2968 EntityTypeDisplayHint *string `json:"entityTypeDisplayHint,omitempty"` 2969} 2970 2971// MarshalJSON is the custom marshaler for EntitiesEntityPresentationInfo. 2972func (eepi EntitiesEntityPresentationInfo) MarshalJSON() ([]byte, error) { 2973 objectMap := make(map[string]interface{}) 2974 if eepi.EntityScenario != "" { 2975 objectMap["entityScenario"] = eepi.EntityScenario 2976 } 2977 return json.Marshal(objectMap) 2978} 2979 2980// Error defines the error that occurred. 2981type Error struct { 2982 // Code - The error code that identifies the category of error. Possible values include: 'None', 'ServerError', 'InvalidRequest', 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization' 2983 Code ErrorCode `json:"code,omitempty"` 2984 // SubCode - READ-ONLY; The error code that further helps to identify the error. Possible values include: 'UnexpectedError', 'ResourceError', 'NotImplemented', 'ParameterMissing', 'ParameterInvalidValue', 'HTTPNotAllowed', 'Blocked', 'AuthorizationMissing', 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired' 2985 SubCode ErrorSubCode `json:"subCode,omitempty"` 2986 // Message - A description of the error. 2987 Message *string `json:"message,omitempty"` 2988 // MoreDetails - READ-ONLY; A description that provides additional information about the error. 2989 MoreDetails *string `json:"moreDetails,omitempty"` 2990 // Parameter - READ-ONLY; The parameter in the request that caused the error. 2991 Parameter *string `json:"parameter,omitempty"` 2992 // Value - READ-ONLY; The parameter's value in the request that was not valid. 2993 Value *string `json:"value,omitempty"` 2994} 2995 2996// MarshalJSON is the custom marshaler for Error. 2997func (e Error) MarshalJSON() ([]byte, error) { 2998 objectMap := make(map[string]interface{}) 2999 if e.Code != "" { 3000 objectMap["code"] = e.Code 3001 } 3002 if e.Message != nil { 3003 objectMap["message"] = e.Message 3004 } 3005 return json.Marshal(objectMap) 3006} 3007 3008// ErrorResponse the top-level response that represents a failed request. 3009type ErrorResponse struct { 3010 // Errors - A list of errors that describe the reasons why the request failed. 3011 Errors *[]Error `json:"errors,omitempty"` 3012 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 3013 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 3014 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 3015 WebSearchURL *string `json:"webSearchUrl,omitempty"` 3016 // ID - READ-ONLY; A String identifier. 3017 ID *string `json:"id,omitempty"` 3018 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 3019 Type TypeBasicResponseBase `json:"_type,omitempty"` 3020} 3021 3022// MarshalJSON is the custom marshaler for ErrorResponse. 3023func (er ErrorResponse) MarshalJSON() ([]byte, error) { 3024 er.Type = TypeErrorResponse 3025 objectMap := make(map[string]interface{}) 3026 if er.Errors != nil { 3027 objectMap["errors"] = er.Errors 3028 } 3029 if er.Type != "" { 3030 objectMap["_type"] = er.Type 3031 } 3032 return json.Marshal(objectMap) 3033} 3034 3035// AsImageObject is the BasicResponseBase implementation for ErrorResponse. 3036func (er ErrorResponse) AsImageObject() (*ImageObject, bool) { 3037 return nil, false 3038} 3039 3040// AsThing is the BasicResponseBase implementation for ErrorResponse. 3041func (er ErrorResponse) AsThing() (*Thing, bool) { 3042 return nil, false 3043} 3044 3045// AsBasicThing is the BasicResponseBase implementation for ErrorResponse. 3046func (er ErrorResponse) AsBasicThing() (BasicThing, bool) { 3047 return nil, false 3048} 3049 3050// AsEntities is the BasicResponseBase implementation for ErrorResponse. 3051func (er ErrorResponse) AsEntities() (*Entities, bool) { 3052 return nil, false 3053} 3054 3055// AsPlaces is the BasicResponseBase implementation for ErrorResponse. 3056func (er ErrorResponse) AsPlaces() (*Places, bool) { 3057 return nil, false 3058} 3059 3060// AsSearchResponse is the BasicResponseBase implementation for ErrorResponse. 3061func (er ErrorResponse) AsSearchResponse() (*SearchResponse, bool) { 3062 return nil, false 3063} 3064 3065// AsResponse is the BasicResponseBase implementation for ErrorResponse. 3066func (er ErrorResponse) AsResponse() (*Response, bool) { 3067 return nil, false 3068} 3069 3070// AsBasicResponse is the BasicResponseBase implementation for ErrorResponse. 3071func (er ErrorResponse) AsBasicResponse() (BasicResponse, bool) { 3072 return &er, true 3073} 3074 3075// AsSearchResultsAnswer is the BasicResponseBase implementation for ErrorResponse. 3076func (er ErrorResponse) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 3077 return nil, false 3078} 3079 3080// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for ErrorResponse. 3081func (er ErrorResponse) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 3082 return nil, false 3083} 3084 3085// AsIdentifiable is the BasicResponseBase implementation for ErrorResponse. 3086func (er ErrorResponse) AsIdentifiable() (*Identifiable, bool) { 3087 return nil, false 3088} 3089 3090// AsBasicIdentifiable is the BasicResponseBase implementation for ErrorResponse. 3091func (er ErrorResponse) AsBasicIdentifiable() (BasicIdentifiable, bool) { 3092 return &er, true 3093} 3094 3095// AsAnswer is the BasicResponseBase implementation for ErrorResponse. 3096func (er ErrorResponse) AsAnswer() (*Answer, bool) { 3097 return nil, false 3098} 3099 3100// AsBasicAnswer is the BasicResponseBase implementation for ErrorResponse. 3101func (er ErrorResponse) AsBasicAnswer() (BasicAnswer, bool) { 3102 return nil, false 3103} 3104 3105// AsErrorResponse is the BasicResponseBase implementation for ErrorResponse. 3106func (er ErrorResponse) AsErrorResponse() (*ErrorResponse, bool) { 3107 return &er, true 3108} 3109 3110// AsPostalAddress is the BasicResponseBase implementation for ErrorResponse. 3111func (er ErrorResponse) AsPostalAddress() (*PostalAddress, bool) { 3112 return nil, false 3113} 3114 3115// AsPlace is the BasicResponseBase implementation for ErrorResponse. 3116func (er ErrorResponse) AsPlace() (*Place, bool) { 3117 return nil, false 3118} 3119 3120// AsBasicPlace is the BasicResponseBase implementation for ErrorResponse. 3121func (er ErrorResponse) AsBasicPlace() (BasicPlace, bool) { 3122 return nil, false 3123} 3124 3125// AsOrganization is the BasicResponseBase implementation for ErrorResponse. 3126func (er ErrorResponse) AsOrganization() (*Organization, bool) { 3127 return nil, false 3128} 3129 3130// AsCreativeWork is the BasicResponseBase implementation for ErrorResponse. 3131func (er ErrorResponse) AsCreativeWork() (*CreativeWork, bool) { 3132 return nil, false 3133} 3134 3135// AsBasicCreativeWork is the BasicResponseBase implementation for ErrorResponse. 3136func (er ErrorResponse) AsBasicCreativeWork() (BasicCreativeWork, bool) { 3137 return nil, false 3138} 3139 3140// AsIntangible is the BasicResponseBase implementation for ErrorResponse. 3141func (er ErrorResponse) AsIntangible() (*Intangible, bool) { 3142 return nil, false 3143} 3144 3145// AsBasicIntangible is the BasicResponseBase implementation for ErrorResponse. 3146func (er ErrorResponse) AsBasicIntangible() (BasicIntangible, bool) { 3147 return nil, false 3148} 3149 3150// AsMovieTheater is the BasicResponseBase implementation for ErrorResponse. 3151func (er ErrorResponse) AsMovieTheater() (*MovieTheater, bool) { 3152 return nil, false 3153} 3154 3155// AsMediaObject is the BasicResponseBase implementation for ErrorResponse. 3156func (er ErrorResponse) AsMediaObject() (*MediaObject, bool) { 3157 return nil, false 3158} 3159 3160// AsBasicMediaObject is the BasicResponseBase implementation for ErrorResponse. 3161func (er ErrorResponse) AsBasicMediaObject() (BasicMediaObject, bool) { 3162 return nil, false 3163} 3164 3165// AsCivicStructure is the BasicResponseBase implementation for ErrorResponse. 3166func (er ErrorResponse) AsCivicStructure() (*CivicStructure, bool) { 3167 return nil, false 3168} 3169 3170// AsBasicCivicStructure is the BasicResponseBase implementation for ErrorResponse. 3171func (er ErrorResponse) AsBasicCivicStructure() (BasicCivicStructure, bool) { 3172 return nil, false 3173} 3174 3175// AsLocalBusiness is the BasicResponseBase implementation for ErrorResponse. 3176func (er ErrorResponse) AsLocalBusiness() (*LocalBusiness, bool) { 3177 return nil, false 3178} 3179 3180// AsBasicLocalBusiness is the BasicResponseBase implementation for ErrorResponse. 3181func (er ErrorResponse) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 3182 return nil, false 3183} 3184 3185// AsTouristAttraction is the BasicResponseBase implementation for ErrorResponse. 3186func (er ErrorResponse) AsTouristAttraction() (*TouristAttraction, bool) { 3187 return nil, false 3188} 3189 3190// AsAirport is the BasicResponseBase implementation for ErrorResponse. 3191func (er ErrorResponse) AsAirport() (*Airport, bool) { 3192 return nil, false 3193} 3194 3195// AsLicense is the BasicResponseBase implementation for ErrorResponse. 3196func (er ErrorResponse) AsLicense() (*License, bool) { 3197 return nil, false 3198} 3199 3200// AsStructuredValue is the BasicResponseBase implementation for ErrorResponse. 3201func (er ErrorResponse) AsStructuredValue() (*StructuredValue, bool) { 3202 return nil, false 3203} 3204 3205// AsBasicStructuredValue is the BasicResponseBase implementation for ErrorResponse. 3206func (er ErrorResponse) AsBasicStructuredValue() (BasicStructuredValue, bool) { 3207 return nil, false 3208} 3209 3210// AsEntertainmentBusiness is the BasicResponseBase implementation for ErrorResponse. 3211func (er ErrorResponse) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 3212 return nil, false 3213} 3214 3215// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for ErrorResponse. 3216func (er ErrorResponse) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 3217 return nil, false 3218} 3219 3220// AsFoodEstablishment is the BasicResponseBase implementation for ErrorResponse. 3221func (er ErrorResponse) AsFoodEstablishment() (*FoodEstablishment, bool) { 3222 return nil, false 3223} 3224 3225// AsBasicFoodEstablishment is the BasicResponseBase implementation for ErrorResponse. 3226func (er ErrorResponse) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 3227 return nil, false 3228} 3229 3230// AsLodgingBusiness is the BasicResponseBase implementation for ErrorResponse. 3231func (er ErrorResponse) AsLodgingBusiness() (*LodgingBusiness, bool) { 3232 return nil, false 3233} 3234 3235// AsBasicLodgingBusiness is the BasicResponseBase implementation for ErrorResponse. 3236func (er ErrorResponse) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 3237 return nil, false 3238} 3239 3240// AsRestaurant is the BasicResponseBase implementation for ErrorResponse. 3241func (er ErrorResponse) AsRestaurant() (*Restaurant, bool) { 3242 return nil, false 3243} 3244 3245// AsHotel is the BasicResponseBase implementation for ErrorResponse. 3246func (er ErrorResponse) AsHotel() (*Hotel, bool) { 3247 return nil, false 3248} 3249 3250// AsResponseBase is the BasicResponseBase implementation for ErrorResponse. 3251func (er ErrorResponse) AsResponseBase() (*ResponseBase, bool) { 3252 return nil, false 3253} 3254 3255// AsBasicResponseBase is the BasicResponseBase implementation for ErrorResponse. 3256func (er ErrorResponse) AsBasicResponseBase() (BasicResponseBase, bool) { 3257 return &er, true 3258} 3259 3260// UnmarshalJSON is the custom unmarshaler for ErrorResponse struct. 3261func (er *ErrorResponse) UnmarshalJSON(body []byte) error { 3262 var m map[string]*json.RawMessage 3263 err := json.Unmarshal(body, &m) 3264 if err != nil { 3265 return err 3266 } 3267 for k, v := range m { 3268 switch k { 3269 case "errors": 3270 if v != nil { 3271 var errorsVar []Error 3272 err = json.Unmarshal(*v, &errorsVar) 3273 if err != nil { 3274 return err 3275 } 3276 er.Errors = &errorsVar 3277 } 3278 case "contractualRules": 3279 if v != nil { 3280 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 3281 if err != nil { 3282 return err 3283 } 3284 er.ContractualRules = &contractualRules 3285 } 3286 case "webSearchUrl": 3287 if v != nil { 3288 var webSearchURL string 3289 err = json.Unmarshal(*v, &webSearchURL) 3290 if err != nil { 3291 return err 3292 } 3293 er.WebSearchURL = &webSearchURL 3294 } 3295 case "id": 3296 if v != nil { 3297 var ID string 3298 err = json.Unmarshal(*v, &ID) 3299 if err != nil { 3300 return err 3301 } 3302 er.ID = &ID 3303 } 3304 case "_type": 3305 if v != nil { 3306 var typeVar TypeBasicResponseBase 3307 err = json.Unmarshal(*v, &typeVar) 3308 if err != nil { 3309 return err 3310 } 3311 er.Type = typeVar 3312 } 3313 } 3314 } 3315 3316 return nil 3317} 3318 3319// BasicFoodEstablishment ... 3320type BasicFoodEstablishment interface { 3321 AsRestaurant() (*Restaurant, bool) 3322 AsFoodEstablishment() (*FoodEstablishment, bool) 3323} 3324 3325// FoodEstablishment ... 3326type FoodEstablishment struct { 3327 // PriceRange - READ-ONLY; $$. 3328 PriceRange *string `json:"priceRange,omitempty"` 3329 // Panoramas - READ-ONLY 3330 Panoramas *[]ImageObject `json:"panoramas,omitempty"` 3331 // IsPermanentlyClosed - READ-ONLY 3332 IsPermanentlyClosed *bool `json:"isPermanentlyClosed,omitempty"` 3333 // TagLine - READ-ONLY 3334 TagLine *string `json:"tagLine,omitempty"` 3335 // Address - READ-ONLY; The postal address of where the entity is located 3336 Address *PostalAddress `json:"address,omitempty"` 3337 // Telephone - READ-ONLY; The entity's telephone number 3338 Telephone *string `json:"telephone,omitempty"` 3339 // Name - READ-ONLY; The name of the thing represented by this object. 3340 Name *string `json:"name,omitempty"` 3341 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 3342 URL *string `json:"url,omitempty"` 3343 // Image - READ-ONLY 3344 Image *ImageObject `json:"image,omitempty"` 3345 // Description - READ-ONLY; A short description of the item. 3346 Description *string `json:"description,omitempty"` 3347 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 3348 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 3349 // BingID - READ-ONLY; An ID that uniquely identifies this item. 3350 BingID *string `json:"bingId,omitempty"` 3351 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 3352 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 3353 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 3354 WebSearchURL *string `json:"webSearchUrl,omitempty"` 3355 // ID - READ-ONLY; A String identifier. 3356 ID *string `json:"id,omitempty"` 3357 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 3358 Type TypeBasicResponseBase `json:"_type,omitempty"` 3359} 3360 3361func unmarshalBasicFoodEstablishment(body []byte) (BasicFoodEstablishment, error) { 3362 var m map[string]interface{} 3363 err := json.Unmarshal(body, &m) 3364 if err != nil { 3365 return nil, err 3366 } 3367 3368 switch m["_type"] { 3369 case string(TypeRestaurant): 3370 var r Restaurant 3371 err := json.Unmarshal(body, &r) 3372 return r, err 3373 default: 3374 var fe FoodEstablishment 3375 err := json.Unmarshal(body, &fe) 3376 return fe, err 3377 } 3378} 3379func unmarshalBasicFoodEstablishmentArray(body []byte) ([]BasicFoodEstablishment, error) { 3380 var rawMessages []*json.RawMessage 3381 err := json.Unmarshal(body, &rawMessages) 3382 if err != nil { 3383 return nil, err 3384 } 3385 3386 feArray := make([]BasicFoodEstablishment, len(rawMessages)) 3387 3388 for index, rawMessage := range rawMessages { 3389 fe, err := unmarshalBasicFoodEstablishment(*rawMessage) 3390 if err != nil { 3391 return nil, err 3392 } 3393 feArray[index] = fe 3394 } 3395 return feArray, nil 3396} 3397 3398// MarshalJSON is the custom marshaler for FoodEstablishment. 3399func (fe FoodEstablishment) MarshalJSON() ([]byte, error) { 3400 fe.Type = TypeFoodEstablishment 3401 objectMap := make(map[string]interface{}) 3402 if fe.Type != "" { 3403 objectMap["_type"] = fe.Type 3404 } 3405 return json.Marshal(objectMap) 3406} 3407 3408// AsImageObject is the BasicResponseBase implementation for FoodEstablishment. 3409func (fe FoodEstablishment) AsImageObject() (*ImageObject, bool) { 3410 return nil, false 3411} 3412 3413// AsThing is the BasicResponseBase implementation for FoodEstablishment. 3414func (fe FoodEstablishment) AsThing() (*Thing, bool) { 3415 return nil, false 3416} 3417 3418// AsBasicThing is the BasicResponseBase implementation for FoodEstablishment. 3419func (fe FoodEstablishment) AsBasicThing() (BasicThing, bool) { 3420 return &fe, true 3421} 3422 3423// AsEntities is the BasicResponseBase implementation for FoodEstablishment. 3424func (fe FoodEstablishment) AsEntities() (*Entities, bool) { 3425 return nil, false 3426} 3427 3428// AsPlaces is the BasicResponseBase implementation for FoodEstablishment. 3429func (fe FoodEstablishment) AsPlaces() (*Places, bool) { 3430 return nil, false 3431} 3432 3433// AsSearchResponse is the BasicResponseBase implementation for FoodEstablishment. 3434func (fe FoodEstablishment) AsSearchResponse() (*SearchResponse, bool) { 3435 return nil, false 3436} 3437 3438// AsResponse is the BasicResponseBase implementation for FoodEstablishment. 3439func (fe FoodEstablishment) AsResponse() (*Response, bool) { 3440 return nil, false 3441} 3442 3443// AsBasicResponse is the BasicResponseBase implementation for FoodEstablishment. 3444func (fe FoodEstablishment) AsBasicResponse() (BasicResponse, bool) { 3445 return &fe, true 3446} 3447 3448// AsSearchResultsAnswer is the BasicResponseBase implementation for FoodEstablishment. 3449func (fe FoodEstablishment) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 3450 return nil, false 3451} 3452 3453// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for FoodEstablishment. 3454func (fe FoodEstablishment) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 3455 return nil, false 3456} 3457 3458// AsIdentifiable is the BasicResponseBase implementation for FoodEstablishment. 3459func (fe FoodEstablishment) AsIdentifiable() (*Identifiable, bool) { 3460 return nil, false 3461} 3462 3463// AsBasicIdentifiable is the BasicResponseBase implementation for FoodEstablishment. 3464func (fe FoodEstablishment) AsBasicIdentifiable() (BasicIdentifiable, bool) { 3465 return &fe, true 3466} 3467 3468// AsAnswer is the BasicResponseBase implementation for FoodEstablishment. 3469func (fe FoodEstablishment) AsAnswer() (*Answer, bool) { 3470 return nil, false 3471} 3472 3473// AsBasicAnswer is the BasicResponseBase implementation for FoodEstablishment. 3474func (fe FoodEstablishment) AsBasicAnswer() (BasicAnswer, bool) { 3475 return nil, false 3476} 3477 3478// AsErrorResponse is the BasicResponseBase implementation for FoodEstablishment. 3479func (fe FoodEstablishment) AsErrorResponse() (*ErrorResponse, bool) { 3480 return nil, false 3481} 3482 3483// AsPostalAddress is the BasicResponseBase implementation for FoodEstablishment. 3484func (fe FoodEstablishment) AsPostalAddress() (*PostalAddress, bool) { 3485 return nil, false 3486} 3487 3488// AsPlace is the BasicResponseBase implementation for FoodEstablishment. 3489func (fe FoodEstablishment) AsPlace() (*Place, bool) { 3490 return nil, false 3491} 3492 3493// AsBasicPlace is the BasicResponseBase implementation for FoodEstablishment. 3494func (fe FoodEstablishment) AsBasicPlace() (BasicPlace, bool) { 3495 return &fe, true 3496} 3497 3498// AsOrganization is the BasicResponseBase implementation for FoodEstablishment. 3499func (fe FoodEstablishment) AsOrganization() (*Organization, bool) { 3500 return nil, false 3501} 3502 3503// AsCreativeWork is the BasicResponseBase implementation for FoodEstablishment. 3504func (fe FoodEstablishment) AsCreativeWork() (*CreativeWork, bool) { 3505 return nil, false 3506} 3507 3508// AsBasicCreativeWork is the BasicResponseBase implementation for FoodEstablishment. 3509func (fe FoodEstablishment) AsBasicCreativeWork() (BasicCreativeWork, bool) { 3510 return nil, false 3511} 3512 3513// AsIntangible is the BasicResponseBase implementation for FoodEstablishment. 3514func (fe FoodEstablishment) AsIntangible() (*Intangible, bool) { 3515 return nil, false 3516} 3517 3518// AsBasicIntangible is the BasicResponseBase implementation for FoodEstablishment. 3519func (fe FoodEstablishment) AsBasicIntangible() (BasicIntangible, bool) { 3520 return nil, false 3521} 3522 3523// AsMovieTheater is the BasicResponseBase implementation for FoodEstablishment. 3524func (fe FoodEstablishment) AsMovieTheater() (*MovieTheater, bool) { 3525 return nil, false 3526} 3527 3528// AsMediaObject is the BasicResponseBase implementation for FoodEstablishment. 3529func (fe FoodEstablishment) AsMediaObject() (*MediaObject, bool) { 3530 return nil, false 3531} 3532 3533// AsBasicMediaObject is the BasicResponseBase implementation for FoodEstablishment. 3534func (fe FoodEstablishment) AsBasicMediaObject() (BasicMediaObject, bool) { 3535 return nil, false 3536} 3537 3538// AsCivicStructure is the BasicResponseBase implementation for FoodEstablishment. 3539func (fe FoodEstablishment) AsCivicStructure() (*CivicStructure, bool) { 3540 return nil, false 3541} 3542 3543// AsBasicCivicStructure is the BasicResponseBase implementation for FoodEstablishment. 3544func (fe FoodEstablishment) AsBasicCivicStructure() (BasicCivicStructure, bool) { 3545 return nil, false 3546} 3547 3548// AsLocalBusiness is the BasicResponseBase implementation for FoodEstablishment. 3549func (fe FoodEstablishment) AsLocalBusiness() (*LocalBusiness, bool) { 3550 return nil, false 3551} 3552 3553// AsBasicLocalBusiness is the BasicResponseBase implementation for FoodEstablishment. 3554func (fe FoodEstablishment) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 3555 return &fe, true 3556} 3557 3558// AsTouristAttraction is the BasicResponseBase implementation for FoodEstablishment. 3559func (fe FoodEstablishment) AsTouristAttraction() (*TouristAttraction, bool) { 3560 return nil, false 3561} 3562 3563// AsAirport is the BasicResponseBase implementation for FoodEstablishment. 3564func (fe FoodEstablishment) AsAirport() (*Airport, bool) { 3565 return nil, false 3566} 3567 3568// AsLicense is the BasicResponseBase implementation for FoodEstablishment. 3569func (fe FoodEstablishment) AsLicense() (*License, bool) { 3570 return nil, false 3571} 3572 3573// AsStructuredValue is the BasicResponseBase implementation for FoodEstablishment. 3574func (fe FoodEstablishment) AsStructuredValue() (*StructuredValue, bool) { 3575 return nil, false 3576} 3577 3578// AsBasicStructuredValue is the BasicResponseBase implementation for FoodEstablishment. 3579func (fe FoodEstablishment) AsBasicStructuredValue() (BasicStructuredValue, bool) { 3580 return nil, false 3581} 3582 3583// AsEntertainmentBusiness is the BasicResponseBase implementation for FoodEstablishment. 3584func (fe FoodEstablishment) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 3585 return nil, false 3586} 3587 3588// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for FoodEstablishment. 3589func (fe FoodEstablishment) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 3590 return nil, false 3591} 3592 3593// AsFoodEstablishment is the BasicResponseBase implementation for FoodEstablishment. 3594func (fe FoodEstablishment) AsFoodEstablishment() (*FoodEstablishment, bool) { 3595 return &fe, true 3596} 3597 3598// AsBasicFoodEstablishment is the BasicResponseBase implementation for FoodEstablishment. 3599func (fe FoodEstablishment) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 3600 return &fe, true 3601} 3602 3603// AsLodgingBusiness is the BasicResponseBase implementation for FoodEstablishment. 3604func (fe FoodEstablishment) AsLodgingBusiness() (*LodgingBusiness, bool) { 3605 return nil, false 3606} 3607 3608// AsBasicLodgingBusiness is the BasicResponseBase implementation for FoodEstablishment. 3609func (fe FoodEstablishment) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 3610 return nil, false 3611} 3612 3613// AsRestaurant is the BasicResponseBase implementation for FoodEstablishment. 3614func (fe FoodEstablishment) AsRestaurant() (*Restaurant, bool) { 3615 return nil, false 3616} 3617 3618// AsHotel is the BasicResponseBase implementation for FoodEstablishment. 3619func (fe FoodEstablishment) AsHotel() (*Hotel, bool) { 3620 return nil, false 3621} 3622 3623// AsResponseBase is the BasicResponseBase implementation for FoodEstablishment. 3624func (fe FoodEstablishment) AsResponseBase() (*ResponseBase, bool) { 3625 return nil, false 3626} 3627 3628// AsBasicResponseBase is the BasicResponseBase implementation for FoodEstablishment. 3629func (fe FoodEstablishment) AsBasicResponseBase() (BasicResponseBase, bool) { 3630 return &fe, true 3631} 3632 3633// UnmarshalJSON is the custom unmarshaler for FoodEstablishment struct. 3634func (fe *FoodEstablishment) UnmarshalJSON(body []byte) error { 3635 var m map[string]*json.RawMessage 3636 err := json.Unmarshal(body, &m) 3637 if err != nil { 3638 return err 3639 } 3640 for k, v := range m { 3641 switch k { 3642 case "priceRange": 3643 if v != nil { 3644 var priceRange string 3645 err = json.Unmarshal(*v, &priceRange) 3646 if err != nil { 3647 return err 3648 } 3649 fe.PriceRange = &priceRange 3650 } 3651 case "panoramas": 3652 if v != nil { 3653 var panoramas []ImageObject 3654 err = json.Unmarshal(*v, &panoramas) 3655 if err != nil { 3656 return err 3657 } 3658 fe.Panoramas = &panoramas 3659 } 3660 case "isPermanentlyClosed": 3661 if v != nil { 3662 var isPermanentlyClosed bool 3663 err = json.Unmarshal(*v, &isPermanentlyClosed) 3664 if err != nil { 3665 return err 3666 } 3667 fe.IsPermanentlyClosed = &isPermanentlyClosed 3668 } 3669 case "tagLine": 3670 if v != nil { 3671 var tagLine string 3672 err = json.Unmarshal(*v, &tagLine) 3673 if err != nil { 3674 return err 3675 } 3676 fe.TagLine = &tagLine 3677 } 3678 case "address": 3679 if v != nil { 3680 var address PostalAddress 3681 err = json.Unmarshal(*v, &address) 3682 if err != nil { 3683 return err 3684 } 3685 fe.Address = &address 3686 } 3687 case "telephone": 3688 if v != nil { 3689 var telephone string 3690 err = json.Unmarshal(*v, &telephone) 3691 if err != nil { 3692 return err 3693 } 3694 fe.Telephone = &telephone 3695 } 3696 case "name": 3697 if v != nil { 3698 var name string 3699 err = json.Unmarshal(*v, &name) 3700 if err != nil { 3701 return err 3702 } 3703 fe.Name = &name 3704 } 3705 case "url": 3706 if v != nil { 3707 var URL string 3708 err = json.Unmarshal(*v, &URL) 3709 if err != nil { 3710 return err 3711 } 3712 fe.URL = &URL 3713 } 3714 case "image": 3715 if v != nil { 3716 var imageVar ImageObject 3717 err = json.Unmarshal(*v, &imageVar) 3718 if err != nil { 3719 return err 3720 } 3721 fe.Image = &imageVar 3722 } 3723 case "description": 3724 if v != nil { 3725 var description string 3726 err = json.Unmarshal(*v, &description) 3727 if err != nil { 3728 return err 3729 } 3730 fe.Description = &description 3731 } 3732 case "entityPresentationInfo": 3733 if v != nil { 3734 var entityPresentationInfo EntitiesEntityPresentationInfo 3735 err = json.Unmarshal(*v, &entityPresentationInfo) 3736 if err != nil { 3737 return err 3738 } 3739 fe.EntityPresentationInfo = &entityPresentationInfo 3740 } 3741 case "bingId": 3742 if v != nil { 3743 var bingID string 3744 err = json.Unmarshal(*v, &bingID) 3745 if err != nil { 3746 return err 3747 } 3748 fe.BingID = &bingID 3749 } 3750 case "contractualRules": 3751 if v != nil { 3752 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 3753 if err != nil { 3754 return err 3755 } 3756 fe.ContractualRules = &contractualRules 3757 } 3758 case "webSearchUrl": 3759 if v != nil { 3760 var webSearchURL string 3761 err = json.Unmarshal(*v, &webSearchURL) 3762 if err != nil { 3763 return err 3764 } 3765 fe.WebSearchURL = &webSearchURL 3766 } 3767 case "id": 3768 if v != nil { 3769 var ID string 3770 err = json.Unmarshal(*v, &ID) 3771 if err != nil { 3772 return err 3773 } 3774 fe.ID = &ID 3775 } 3776 case "_type": 3777 if v != nil { 3778 var typeVar TypeBasicResponseBase 3779 err = json.Unmarshal(*v, &typeVar) 3780 if err != nil { 3781 return err 3782 } 3783 fe.Type = typeVar 3784 } 3785 } 3786 } 3787 3788 return nil 3789} 3790 3791// Hotel ... 3792type Hotel struct { 3793 // HotelClass - READ-ONLY 3794 HotelClass *string `json:"hotelClass,omitempty"` 3795 // Amenities - READ-ONLY 3796 Amenities *[]string `json:"amenities,omitempty"` 3797 // PriceRange - READ-ONLY; $$. 3798 PriceRange *string `json:"priceRange,omitempty"` 3799 // Panoramas - READ-ONLY 3800 Panoramas *[]ImageObject `json:"panoramas,omitempty"` 3801 // IsPermanentlyClosed - READ-ONLY 3802 IsPermanentlyClosed *bool `json:"isPermanentlyClosed,omitempty"` 3803 // TagLine - READ-ONLY 3804 TagLine *string `json:"tagLine,omitempty"` 3805 // Address - READ-ONLY; The postal address of where the entity is located 3806 Address *PostalAddress `json:"address,omitempty"` 3807 // Telephone - READ-ONLY; The entity's telephone number 3808 Telephone *string `json:"telephone,omitempty"` 3809 // Name - READ-ONLY; The name of the thing represented by this object. 3810 Name *string `json:"name,omitempty"` 3811 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 3812 URL *string `json:"url,omitempty"` 3813 // Image - READ-ONLY 3814 Image *ImageObject `json:"image,omitempty"` 3815 // Description - READ-ONLY; A short description of the item. 3816 Description *string `json:"description,omitempty"` 3817 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 3818 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 3819 // BingID - READ-ONLY; An ID that uniquely identifies this item. 3820 BingID *string `json:"bingId,omitempty"` 3821 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 3822 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 3823 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 3824 WebSearchURL *string `json:"webSearchUrl,omitempty"` 3825 // ID - READ-ONLY; A String identifier. 3826 ID *string `json:"id,omitempty"` 3827 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 3828 Type TypeBasicResponseBase `json:"_type,omitempty"` 3829} 3830 3831// MarshalJSON is the custom marshaler for Hotel. 3832func (h Hotel) MarshalJSON() ([]byte, error) { 3833 h.Type = TypeHotel 3834 objectMap := make(map[string]interface{}) 3835 if h.Type != "" { 3836 objectMap["_type"] = h.Type 3837 } 3838 return json.Marshal(objectMap) 3839} 3840 3841// AsImageObject is the BasicResponseBase implementation for Hotel. 3842func (h Hotel) AsImageObject() (*ImageObject, bool) { 3843 return nil, false 3844} 3845 3846// AsThing is the BasicResponseBase implementation for Hotel. 3847func (h Hotel) AsThing() (*Thing, bool) { 3848 return nil, false 3849} 3850 3851// AsBasicThing is the BasicResponseBase implementation for Hotel. 3852func (h Hotel) AsBasicThing() (BasicThing, bool) { 3853 return &h, true 3854} 3855 3856// AsEntities is the BasicResponseBase implementation for Hotel. 3857func (h Hotel) AsEntities() (*Entities, bool) { 3858 return nil, false 3859} 3860 3861// AsPlaces is the BasicResponseBase implementation for Hotel. 3862func (h Hotel) AsPlaces() (*Places, bool) { 3863 return nil, false 3864} 3865 3866// AsSearchResponse is the BasicResponseBase implementation for Hotel. 3867func (h Hotel) AsSearchResponse() (*SearchResponse, bool) { 3868 return nil, false 3869} 3870 3871// AsResponse is the BasicResponseBase implementation for Hotel. 3872func (h Hotel) AsResponse() (*Response, bool) { 3873 return nil, false 3874} 3875 3876// AsBasicResponse is the BasicResponseBase implementation for Hotel. 3877func (h Hotel) AsBasicResponse() (BasicResponse, bool) { 3878 return &h, true 3879} 3880 3881// AsSearchResultsAnswer is the BasicResponseBase implementation for Hotel. 3882func (h Hotel) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 3883 return nil, false 3884} 3885 3886// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Hotel. 3887func (h Hotel) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 3888 return nil, false 3889} 3890 3891// AsIdentifiable is the BasicResponseBase implementation for Hotel. 3892func (h Hotel) AsIdentifiable() (*Identifiable, bool) { 3893 return nil, false 3894} 3895 3896// AsBasicIdentifiable is the BasicResponseBase implementation for Hotel. 3897func (h Hotel) AsBasicIdentifiable() (BasicIdentifiable, bool) { 3898 return &h, true 3899} 3900 3901// AsAnswer is the BasicResponseBase implementation for Hotel. 3902func (h Hotel) AsAnswer() (*Answer, bool) { 3903 return nil, false 3904} 3905 3906// AsBasicAnswer is the BasicResponseBase implementation for Hotel. 3907func (h Hotel) AsBasicAnswer() (BasicAnswer, bool) { 3908 return nil, false 3909} 3910 3911// AsErrorResponse is the BasicResponseBase implementation for Hotel. 3912func (h Hotel) AsErrorResponse() (*ErrorResponse, bool) { 3913 return nil, false 3914} 3915 3916// AsPostalAddress is the BasicResponseBase implementation for Hotel. 3917func (h Hotel) AsPostalAddress() (*PostalAddress, bool) { 3918 return nil, false 3919} 3920 3921// AsPlace is the BasicResponseBase implementation for Hotel. 3922func (h Hotel) AsPlace() (*Place, bool) { 3923 return nil, false 3924} 3925 3926// AsBasicPlace is the BasicResponseBase implementation for Hotel. 3927func (h Hotel) AsBasicPlace() (BasicPlace, bool) { 3928 return &h, true 3929} 3930 3931// AsOrganization is the BasicResponseBase implementation for Hotel. 3932func (h Hotel) AsOrganization() (*Organization, bool) { 3933 return nil, false 3934} 3935 3936// AsCreativeWork is the BasicResponseBase implementation for Hotel. 3937func (h Hotel) AsCreativeWork() (*CreativeWork, bool) { 3938 return nil, false 3939} 3940 3941// AsBasicCreativeWork is the BasicResponseBase implementation for Hotel. 3942func (h Hotel) AsBasicCreativeWork() (BasicCreativeWork, bool) { 3943 return nil, false 3944} 3945 3946// AsIntangible is the BasicResponseBase implementation for Hotel. 3947func (h Hotel) AsIntangible() (*Intangible, bool) { 3948 return nil, false 3949} 3950 3951// AsBasicIntangible is the BasicResponseBase implementation for Hotel. 3952func (h Hotel) AsBasicIntangible() (BasicIntangible, bool) { 3953 return nil, false 3954} 3955 3956// AsMovieTheater is the BasicResponseBase implementation for Hotel. 3957func (h Hotel) AsMovieTheater() (*MovieTheater, bool) { 3958 return nil, false 3959} 3960 3961// AsMediaObject is the BasicResponseBase implementation for Hotel. 3962func (h Hotel) AsMediaObject() (*MediaObject, bool) { 3963 return nil, false 3964} 3965 3966// AsBasicMediaObject is the BasicResponseBase implementation for Hotel. 3967func (h Hotel) AsBasicMediaObject() (BasicMediaObject, bool) { 3968 return nil, false 3969} 3970 3971// AsCivicStructure is the BasicResponseBase implementation for Hotel. 3972func (h Hotel) AsCivicStructure() (*CivicStructure, bool) { 3973 return nil, false 3974} 3975 3976// AsBasicCivicStructure is the BasicResponseBase implementation for Hotel. 3977func (h Hotel) AsBasicCivicStructure() (BasicCivicStructure, bool) { 3978 return nil, false 3979} 3980 3981// AsLocalBusiness is the BasicResponseBase implementation for Hotel. 3982func (h Hotel) AsLocalBusiness() (*LocalBusiness, bool) { 3983 return nil, false 3984} 3985 3986// AsBasicLocalBusiness is the BasicResponseBase implementation for Hotel. 3987func (h Hotel) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 3988 return &h, true 3989} 3990 3991// AsTouristAttraction is the BasicResponseBase implementation for Hotel. 3992func (h Hotel) AsTouristAttraction() (*TouristAttraction, bool) { 3993 return nil, false 3994} 3995 3996// AsAirport is the BasicResponseBase implementation for Hotel. 3997func (h Hotel) AsAirport() (*Airport, bool) { 3998 return nil, false 3999} 4000 4001// AsLicense is the BasicResponseBase implementation for Hotel. 4002func (h Hotel) AsLicense() (*License, bool) { 4003 return nil, false 4004} 4005 4006// AsStructuredValue is the BasicResponseBase implementation for Hotel. 4007func (h Hotel) AsStructuredValue() (*StructuredValue, bool) { 4008 return nil, false 4009} 4010 4011// AsBasicStructuredValue is the BasicResponseBase implementation for Hotel. 4012func (h Hotel) AsBasicStructuredValue() (BasicStructuredValue, bool) { 4013 return nil, false 4014} 4015 4016// AsEntertainmentBusiness is the BasicResponseBase implementation for Hotel. 4017func (h Hotel) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 4018 return nil, false 4019} 4020 4021// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for Hotel. 4022func (h Hotel) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 4023 return nil, false 4024} 4025 4026// AsFoodEstablishment is the BasicResponseBase implementation for Hotel. 4027func (h Hotel) AsFoodEstablishment() (*FoodEstablishment, bool) { 4028 return nil, false 4029} 4030 4031// AsBasicFoodEstablishment is the BasicResponseBase implementation for Hotel. 4032func (h Hotel) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 4033 return nil, false 4034} 4035 4036// AsLodgingBusiness is the BasicResponseBase implementation for Hotel. 4037func (h Hotel) AsLodgingBusiness() (*LodgingBusiness, bool) { 4038 return nil, false 4039} 4040 4041// AsBasicLodgingBusiness is the BasicResponseBase implementation for Hotel. 4042func (h Hotel) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 4043 return &h, true 4044} 4045 4046// AsRestaurant is the BasicResponseBase implementation for Hotel. 4047func (h Hotel) AsRestaurant() (*Restaurant, bool) { 4048 return nil, false 4049} 4050 4051// AsHotel is the BasicResponseBase implementation for Hotel. 4052func (h Hotel) AsHotel() (*Hotel, bool) { 4053 return &h, true 4054} 4055 4056// AsResponseBase is the BasicResponseBase implementation for Hotel. 4057func (h Hotel) AsResponseBase() (*ResponseBase, bool) { 4058 return nil, false 4059} 4060 4061// AsBasicResponseBase is the BasicResponseBase implementation for Hotel. 4062func (h Hotel) AsBasicResponseBase() (BasicResponseBase, bool) { 4063 return &h, true 4064} 4065 4066// UnmarshalJSON is the custom unmarshaler for Hotel struct. 4067func (h *Hotel) UnmarshalJSON(body []byte) error { 4068 var m map[string]*json.RawMessage 4069 err := json.Unmarshal(body, &m) 4070 if err != nil { 4071 return err 4072 } 4073 for k, v := range m { 4074 switch k { 4075 case "hotelClass": 4076 if v != nil { 4077 var hotelClass string 4078 err = json.Unmarshal(*v, &hotelClass) 4079 if err != nil { 4080 return err 4081 } 4082 h.HotelClass = &hotelClass 4083 } 4084 case "amenities": 4085 if v != nil { 4086 var amenities []string 4087 err = json.Unmarshal(*v, &amenities) 4088 if err != nil { 4089 return err 4090 } 4091 h.Amenities = &amenities 4092 } 4093 case "priceRange": 4094 if v != nil { 4095 var priceRange string 4096 err = json.Unmarshal(*v, &priceRange) 4097 if err != nil { 4098 return err 4099 } 4100 h.PriceRange = &priceRange 4101 } 4102 case "panoramas": 4103 if v != nil { 4104 var panoramas []ImageObject 4105 err = json.Unmarshal(*v, &panoramas) 4106 if err != nil { 4107 return err 4108 } 4109 h.Panoramas = &panoramas 4110 } 4111 case "isPermanentlyClosed": 4112 if v != nil { 4113 var isPermanentlyClosed bool 4114 err = json.Unmarshal(*v, &isPermanentlyClosed) 4115 if err != nil { 4116 return err 4117 } 4118 h.IsPermanentlyClosed = &isPermanentlyClosed 4119 } 4120 case "tagLine": 4121 if v != nil { 4122 var tagLine string 4123 err = json.Unmarshal(*v, &tagLine) 4124 if err != nil { 4125 return err 4126 } 4127 h.TagLine = &tagLine 4128 } 4129 case "address": 4130 if v != nil { 4131 var address PostalAddress 4132 err = json.Unmarshal(*v, &address) 4133 if err != nil { 4134 return err 4135 } 4136 h.Address = &address 4137 } 4138 case "telephone": 4139 if v != nil { 4140 var telephone string 4141 err = json.Unmarshal(*v, &telephone) 4142 if err != nil { 4143 return err 4144 } 4145 h.Telephone = &telephone 4146 } 4147 case "name": 4148 if v != nil { 4149 var name string 4150 err = json.Unmarshal(*v, &name) 4151 if err != nil { 4152 return err 4153 } 4154 h.Name = &name 4155 } 4156 case "url": 4157 if v != nil { 4158 var URL string 4159 err = json.Unmarshal(*v, &URL) 4160 if err != nil { 4161 return err 4162 } 4163 h.URL = &URL 4164 } 4165 case "image": 4166 if v != nil { 4167 var imageVar ImageObject 4168 err = json.Unmarshal(*v, &imageVar) 4169 if err != nil { 4170 return err 4171 } 4172 h.Image = &imageVar 4173 } 4174 case "description": 4175 if v != nil { 4176 var description string 4177 err = json.Unmarshal(*v, &description) 4178 if err != nil { 4179 return err 4180 } 4181 h.Description = &description 4182 } 4183 case "entityPresentationInfo": 4184 if v != nil { 4185 var entityPresentationInfo EntitiesEntityPresentationInfo 4186 err = json.Unmarshal(*v, &entityPresentationInfo) 4187 if err != nil { 4188 return err 4189 } 4190 h.EntityPresentationInfo = &entityPresentationInfo 4191 } 4192 case "bingId": 4193 if v != nil { 4194 var bingID string 4195 err = json.Unmarshal(*v, &bingID) 4196 if err != nil { 4197 return err 4198 } 4199 h.BingID = &bingID 4200 } 4201 case "contractualRules": 4202 if v != nil { 4203 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 4204 if err != nil { 4205 return err 4206 } 4207 h.ContractualRules = &contractualRules 4208 } 4209 case "webSearchUrl": 4210 if v != nil { 4211 var webSearchURL string 4212 err = json.Unmarshal(*v, &webSearchURL) 4213 if err != nil { 4214 return err 4215 } 4216 h.WebSearchURL = &webSearchURL 4217 } 4218 case "id": 4219 if v != nil { 4220 var ID string 4221 err = json.Unmarshal(*v, &ID) 4222 if err != nil { 4223 return err 4224 } 4225 h.ID = &ID 4226 } 4227 case "_type": 4228 if v != nil { 4229 var typeVar TypeBasicResponseBase 4230 err = json.Unmarshal(*v, &typeVar) 4231 if err != nil { 4232 return err 4233 } 4234 h.Type = typeVar 4235 } 4236 } 4237 } 4238 4239 return nil 4240} 4241 4242// BasicIdentifiable defines the identity of a resource. 4243type BasicIdentifiable interface { 4244 AsImageObject() (*ImageObject, bool) 4245 AsThing() (*Thing, bool) 4246 AsBasicThing() (BasicThing, bool) 4247 AsEntities() (*Entities, bool) 4248 AsPlaces() (*Places, bool) 4249 AsSearchResponse() (*SearchResponse, bool) 4250 AsResponse() (*Response, bool) 4251 AsBasicResponse() (BasicResponse, bool) 4252 AsSearchResultsAnswer() (*SearchResultsAnswer, bool) 4253 AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) 4254 AsAnswer() (*Answer, bool) 4255 AsBasicAnswer() (BasicAnswer, bool) 4256 AsErrorResponse() (*ErrorResponse, bool) 4257 AsPostalAddress() (*PostalAddress, bool) 4258 AsPlace() (*Place, bool) 4259 AsBasicPlace() (BasicPlace, bool) 4260 AsOrganization() (*Organization, bool) 4261 AsCreativeWork() (*CreativeWork, bool) 4262 AsBasicCreativeWork() (BasicCreativeWork, bool) 4263 AsIntangible() (*Intangible, bool) 4264 AsBasicIntangible() (BasicIntangible, bool) 4265 AsMovieTheater() (*MovieTheater, bool) 4266 AsMediaObject() (*MediaObject, bool) 4267 AsBasicMediaObject() (BasicMediaObject, bool) 4268 AsCivicStructure() (*CivicStructure, bool) 4269 AsBasicCivicStructure() (BasicCivicStructure, bool) 4270 AsLocalBusiness() (*LocalBusiness, bool) 4271 AsBasicLocalBusiness() (BasicLocalBusiness, bool) 4272 AsTouristAttraction() (*TouristAttraction, bool) 4273 AsAirport() (*Airport, bool) 4274 AsLicense() (*License, bool) 4275 AsStructuredValue() (*StructuredValue, bool) 4276 AsBasicStructuredValue() (BasicStructuredValue, bool) 4277 AsEntertainmentBusiness() (*EntertainmentBusiness, bool) 4278 AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) 4279 AsFoodEstablishment() (*FoodEstablishment, bool) 4280 AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) 4281 AsLodgingBusiness() (*LodgingBusiness, bool) 4282 AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) 4283 AsRestaurant() (*Restaurant, bool) 4284 AsHotel() (*Hotel, bool) 4285 AsIdentifiable() (*Identifiable, bool) 4286} 4287 4288// Identifiable defines the identity of a resource. 4289type Identifiable struct { 4290 // ID - READ-ONLY; A String identifier. 4291 ID *string `json:"id,omitempty"` 4292 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 4293 Type TypeBasicResponseBase `json:"_type,omitempty"` 4294} 4295 4296func unmarshalBasicIdentifiable(body []byte) (BasicIdentifiable, error) { 4297 var m map[string]interface{} 4298 err := json.Unmarshal(body, &m) 4299 if err != nil { 4300 return nil, err 4301 } 4302 4303 switch m["_type"] { 4304 case string(TypeImageObject): 4305 var ioVar ImageObject 4306 err := json.Unmarshal(body, &ioVar) 4307 return ioVar, err 4308 case string(TypeThing): 4309 var t Thing 4310 err := json.Unmarshal(body, &t) 4311 return t, err 4312 case string(TypeEntities): 4313 var e Entities 4314 err := json.Unmarshal(body, &e) 4315 return e, err 4316 case string(TypePlaces): 4317 var p Places 4318 err := json.Unmarshal(body, &p) 4319 return p, err 4320 case string(TypeSearchResponse): 4321 var sr SearchResponse 4322 err := json.Unmarshal(body, &sr) 4323 return sr, err 4324 case string(TypeResponse): 4325 var r Response 4326 err := json.Unmarshal(body, &r) 4327 return r, err 4328 case string(TypeSearchResultsAnswer): 4329 var sra SearchResultsAnswer 4330 err := json.Unmarshal(body, &sra) 4331 return sra, err 4332 case string(TypeAnswer): 4333 var a Answer 4334 err := json.Unmarshal(body, &a) 4335 return a, err 4336 case string(TypeErrorResponse): 4337 var er ErrorResponse 4338 err := json.Unmarshal(body, &er) 4339 return er, err 4340 case string(TypePostalAddress): 4341 var pa PostalAddress 4342 err := json.Unmarshal(body, &pa) 4343 return pa, err 4344 case string(TypePlace): 4345 var p Place 4346 err := json.Unmarshal(body, &p) 4347 return p, err 4348 case string(TypeOrganization): 4349 var o Organization 4350 err := json.Unmarshal(body, &o) 4351 return o, err 4352 case string(TypeCreativeWork): 4353 var cw CreativeWork 4354 err := json.Unmarshal(body, &cw) 4355 return cw, err 4356 case string(TypeIntangible): 4357 var i Intangible 4358 err := json.Unmarshal(body, &i) 4359 return i, err 4360 case string(TypeMovieTheater): 4361 var mt MovieTheater 4362 err := json.Unmarshal(body, &mt) 4363 return mt, err 4364 case string(TypeMediaObject): 4365 var mo MediaObject 4366 err := json.Unmarshal(body, &mo) 4367 return mo, err 4368 case string(TypeCivicStructure): 4369 var cs CivicStructure 4370 err := json.Unmarshal(body, &cs) 4371 return cs, err 4372 case string(TypeLocalBusiness): 4373 var lb LocalBusiness 4374 err := json.Unmarshal(body, &lb) 4375 return lb, err 4376 case string(TypeTouristAttraction): 4377 var ta TouristAttraction 4378 err := json.Unmarshal(body, &ta) 4379 return ta, err 4380 case string(TypeAirport): 4381 var a Airport 4382 err := json.Unmarshal(body, &a) 4383 return a, err 4384 case string(TypeLicense): 4385 var l License 4386 err := json.Unmarshal(body, &l) 4387 return l, err 4388 case string(TypeStructuredValue): 4389 var sv StructuredValue 4390 err := json.Unmarshal(body, &sv) 4391 return sv, err 4392 case string(TypeEntertainmentBusiness): 4393 var eb EntertainmentBusiness 4394 err := json.Unmarshal(body, &eb) 4395 return eb, err 4396 case string(TypeFoodEstablishment): 4397 var fe FoodEstablishment 4398 err := json.Unmarshal(body, &fe) 4399 return fe, err 4400 case string(TypeLodgingBusiness): 4401 var lb LodgingBusiness 4402 err := json.Unmarshal(body, &lb) 4403 return lb, err 4404 case string(TypeRestaurant): 4405 var r Restaurant 4406 err := json.Unmarshal(body, &r) 4407 return r, err 4408 case string(TypeHotel): 4409 var h Hotel 4410 err := json.Unmarshal(body, &h) 4411 return h, err 4412 default: 4413 var i Identifiable 4414 err := json.Unmarshal(body, &i) 4415 return i, err 4416 } 4417} 4418func unmarshalBasicIdentifiableArray(body []byte) ([]BasicIdentifiable, error) { 4419 var rawMessages []*json.RawMessage 4420 err := json.Unmarshal(body, &rawMessages) 4421 if err != nil { 4422 return nil, err 4423 } 4424 4425 iArray := make([]BasicIdentifiable, len(rawMessages)) 4426 4427 for index, rawMessage := range rawMessages { 4428 i, err := unmarshalBasicIdentifiable(*rawMessage) 4429 if err != nil { 4430 return nil, err 4431 } 4432 iArray[index] = i 4433 } 4434 return iArray, nil 4435} 4436 4437// MarshalJSON is the custom marshaler for Identifiable. 4438func (i Identifiable) MarshalJSON() ([]byte, error) { 4439 i.Type = TypeIdentifiable 4440 objectMap := make(map[string]interface{}) 4441 if i.Type != "" { 4442 objectMap["_type"] = i.Type 4443 } 4444 return json.Marshal(objectMap) 4445} 4446 4447// AsImageObject is the BasicResponseBase implementation for Identifiable. 4448func (i Identifiable) AsImageObject() (*ImageObject, bool) { 4449 return nil, false 4450} 4451 4452// AsThing is the BasicResponseBase implementation for Identifiable. 4453func (i Identifiable) AsThing() (*Thing, bool) { 4454 return nil, false 4455} 4456 4457// AsBasicThing is the BasicResponseBase implementation for Identifiable. 4458func (i Identifiable) AsBasicThing() (BasicThing, bool) { 4459 return nil, false 4460} 4461 4462// AsEntities is the BasicResponseBase implementation for Identifiable. 4463func (i Identifiable) AsEntities() (*Entities, bool) { 4464 return nil, false 4465} 4466 4467// AsPlaces is the BasicResponseBase implementation for Identifiable. 4468func (i Identifiable) AsPlaces() (*Places, bool) { 4469 return nil, false 4470} 4471 4472// AsSearchResponse is the BasicResponseBase implementation for Identifiable. 4473func (i Identifiable) AsSearchResponse() (*SearchResponse, bool) { 4474 return nil, false 4475} 4476 4477// AsResponse is the BasicResponseBase implementation for Identifiable. 4478func (i Identifiable) AsResponse() (*Response, bool) { 4479 return nil, false 4480} 4481 4482// AsBasicResponse is the BasicResponseBase implementation for Identifiable. 4483func (i Identifiable) AsBasicResponse() (BasicResponse, bool) { 4484 return nil, false 4485} 4486 4487// AsSearchResultsAnswer is the BasicResponseBase implementation for Identifiable. 4488func (i Identifiable) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 4489 return nil, false 4490} 4491 4492// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Identifiable. 4493func (i Identifiable) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 4494 return nil, false 4495} 4496 4497// AsIdentifiable is the BasicResponseBase implementation for Identifiable. 4498func (i Identifiable) AsIdentifiable() (*Identifiable, bool) { 4499 return &i, true 4500} 4501 4502// AsBasicIdentifiable is the BasicResponseBase implementation for Identifiable. 4503func (i Identifiable) AsBasicIdentifiable() (BasicIdentifiable, bool) { 4504 return &i, true 4505} 4506 4507// AsAnswer is the BasicResponseBase implementation for Identifiable. 4508func (i Identifiable) AsAnswer() (*Answer, bool) { 4509 return nil, false 4510} 4511 4512// AsBasicAnswer is the BasicResponseBase implementation for Identifiable. 4513func (i Identifiable) AsBasicAnswer() (BasicAnswer, bool) { 4514 return nil, false 4515} 4516 4517// AsErrorResponse is the BasicResponseBase implementation for Identifiable. 4518func (i Identifiable) AsErrorResponse() (*ErrorResponse, bool) { 4519 return nil, false 4520} 4521 4522// AsPostalAddress is the BasicResponseBase implementation for Identifiable. 4523func (i Identifiable) AsPostalAddress() (*PostalAddress, bool) { 4524 return nil, false 4525} 4526 4527// AsPlace is the BasicResponseBase implementation for Identifiable. 4528func (i Identifiable) AsPlace() (*Place, bool) { 4529 return nil, false 4530} 4531 4532// AsBasicPlace is the BasicResponseBase implementation for Identifiable. 4533func (i Identifiable) AsBasicPlace() (BasicPlace, bool) { 4534 return nil, false 4535} 4536 4537// AsOrganization is the BasicResponseBase implementation for Identifiable. 4538func (i Identifiable) AsOrganization() (*Organization, bool) { 4539 return nil, false 4540} 4541 4542// AsCreativeWork is the BasicResponseBase implementation for Identifiable. 4543func (i Identifiable) AsCreativeWork() (*CreativeWork, bool) { 4544 return nil, false 4545} 4546 4547// AsBasicCreativeWork is the BasicResponseBase implementation for Identifiable. 4548func (i Identifiable) AsBasicCreativeWork() (BasicCreativeWork, bool) { 4549 return nil, false 4550} 4551 4552// AsIntangible is the BasicResponseBase implementation for Identifiable. 4553func (i Identifiable) AsIntangible() (*Intangible, bool) { 4554 return nil, false 4555} 4556 4557// AsBasicIntangible is the BasicResponseBase implementation for Identifiable. 4558func (i Identifiable) AsBasicIntangible() (BasicIntangible, bool) { 4559 return nil, false 4560} 4561 4562// AsMovieTheater is the BasicResponseBase implementation for Identifiable. 4563func (i Identifiable) AsMovieTheater() (*MovieTheater, bool) { 4564 return nil, false 4565} 4566 4567// AsMediaObject is the BasicResponseBase implementation for Identifiable. 4568func (i Identifiable) AsMediaObject() (*MediaObject, bool) { 4569 return nil, false 4570} 4571 4572// AsBasicMediaObject is the BasicResponseBase implementation for Identifiable. 4573func (i Identifiable) AsBasicMediaObject() (BasicMediaObject, bool) { 4574 return nil, false 4575} 4576 4577// AsCivicStructure is the BasicResponseBase implementation for Identifiable. 4578func (i Identifiable) AsCivicStructure() (*CivicStructure, bool) { 4579 return nil, false 4580} 4581 4582// AsBasicCivicStructure is the BasicResponseBase implementation for Identifiable. 4583func (i Identifiable) AsBasicCivicStructure() (BasicCivicStructure, bool) { 4584 return nil, false 4585} 4586 4587// AsLocalBusiness is the BasicResponseBase implementation for Identifiable. 4588func (i Identifiable) AsLocalBusiness() (*LocalBusiness, bool) { 4589 return nil, false 4590} 4591 4592// AsBasicLocalBusiness is the BasicResponseBase implementation for Identifiable. 4593func (i Identifiable) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 4594 return nil, false 4595} 4596 4597// AsTouristAttraction is the BasicResponseBase implementation for Identifiable. 4598func (i Identifiable) AsTouristAttraction() (*TouristAttraction, bool) { 4599 return nil, false 4600} 4601 4602// AsAirport is the BasicResponseBase implementation for Identifiable. 4603func (i Identifiable) AsAirport() (*Airport, bool) { 4604 return nil, false 4605} 4606 4607// AsLicense is the BasicResponseBase implementation for Identifiable. 4608func (i Identifiable) AsLicense() (*License, bool) { 4609 return nil, false 4610} 4611 4612// AsStructuredValue is the BasicResponseBase implementation for Identifiable. 4613func (i Identifiable) AsStructuredValue() (*StructuredValue, bool) { 4614 return nil, false 4615} 4616 4617// AsBasicStructuredValue is the BasicResponseBase implementation for Identifiable. 4618func (i Identifiable) AsBasicStructuredValue() (BasicStructuredValue, bool) { 4619 return nil, false 4620} 4621 4622// AsEntertainmentBusiness is the BasicResponseBase implementation for Identifiable. 4623func (i Identifiable) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 4624 return nil, false 4625} 4626 4627// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for Identifiable. 4628func (i Identifiable) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 4629 return nil, false 4630} 4631 4632// AsFoodEstablishment is the BasicResponseBase implementation for Identifiable. 4633func (i Identifiable) AsFoodEstablishment() (*FoodEstablishment, bool) { 4634 return nil, false 4635} 4636 4637// AsBasicFoodEstablishment is the BasicResponseBase implementation for Identifiable. 4638func (i Identifiable) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 4639 return nil, false 4640} 4641 4642// AsLodgingBusiness is the BasicResponseBase implementation for Identifiable. 4643func (i Identifiable) AsLodgingBusiness() (*LodgingBusiness, bool) { 4644 return nil, false 4645} 4646 4647// AsBasicLodgingBusiness is the BasicResponseBase implementation for Identifiable. 4648func (i Identifiable) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 4649 return nil, false 4650} 4651 4652// AsRestaurant is the BasicResponseBase implementation for Identifiable. 4653func (i Identifiable) AsRestaurant() (*Restaurant, bool) { 4654 return nil, false 4655} 4656 4657// AsHotel is the BasicResponseBase implementation for Identifiable. 4658func (i Identifiable) AsHotel() (*Hotel, bool) { 4659 return nil, false 4660} 4661 4662// AsResponseBase is the BasicResponseBase implementation for Identifiable. 4663func (i Identifiable) AsResponseBase() (*ResponseBase, bool) { 4664 return nil, false 4665} 4666 4667// AsBasicResponseBase is the BasicResponseBase implementation for Identifiable. 4668func (i Identifiable) AsBasicResponseBase() (BasicResponseBase, bool) { 4669 return &i, true 4670} 4671 4672// ImageObject defines an image 4673type ImageObject struct { 4674 // Thumbnail - READ-ONLY; The URL to a thumbnail of the image 4675 Thumbnail *ImageObject `json:"thumbnail,omitempty"` 4676 // ContentURL - READ-ONLY; Original URL to retrieve the source (file) for the media object (e.g the source URL for the image). 4677 ContentURL *string `json:"contentUrl,omitempty"` 4678 // HostPageURL - READ-ONLY; URL of the page that hosts the media object. 4679 HostPageURL *string `json:"hostPageUrl,omitempty"` 4680 // Width - READ-ONLY; The width of the source media object, in pixels. 4681 Width *int32 `json:"width,omitempty"` 4682 // Height - READ-ONLY; The height of the source media object, in pixels. 4683 Height *int32 `json:"height,omitempty"` 4684 // ThumbnailURL - READ-ONLY; The URL to a thumbnail of the item. 4685 ThumbnailURL *string `json:"thumbnailUrl,omitempty"` 4686 // Provider - READ-ONLY; The source of the creative work. 4687 Provider *[]BasicThing `json:"provider,omitempty"` 4688 // Text - READ-ONLY 4689 Text *string `json:"text,omitempty"` 4690 // Name - READ-ONLY; The name of the thing represented by this object. 4691 Name *string `json:"name,omitempty"` 4692 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 4693 URL *string `json:"url,omitempty"` 4694 // Image - READ-ONLY 4695 Image *ImageObject `json:"image,omitempty"` 4696 // Description - READ-ONLY; A short description of the item. 4697 Description *string `json:"description,omitempty"` 4698 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 4699 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 4700 // BingID - READ-ONLY; An ID that uniquely identifies this item. 4701 BingID *string `json:"bingId,omitempty"` 4702 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 4703 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 4704 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 4705 WebSearchURL *string `json:"webSearchUrl,omitempty"` 4706 // ID - READ-ONLY; A String identifier. 4707 ID *string `json:"id,omitempty"` 4708 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 4709 Type TypeBasicResponseBase `json:"_type,omitempty"` 4710} 4711 4712// MarshalJSON is the custom marshaler for ImageObject. 4713func (ioVar ImageObject) MarshalJSON() ([]byte, error) { 4714 ioVar.Type = TypeImageObject 4715 objectMap := make(map[string]interface{}) 4716 if ioVar.Type != "" { 4717 objectMap["_type"] = ioVar.Type 4718 } 4719 return json.Marshal(objectMap) 4720} 4721 4722// AsImageObject is the BasicResponseBase implementation for ImageObject. 4723func (ioVar ImageObject) AsImageObject() (*ImageObject, bool) { 4724 return &ioVar, true 4725} 4726 4727// AsThing is the BasicResponseBase implementation for ImageObject. 4728func (ioVar ImageObject) AsThing() (*Thing, bool) { 4729 return nil, false 4730} 4731 4732// AsBasicThing is the BasicResponseBase implementation for ImageObject. 4733func (ioVar ImageObject) AsBasicThing() (BasicThing, bool) { 4734 return &ioVar, true 4735} 4736 4737// AsEntities is the BasicResponseBase implementation for ImageObject. 4738func (ioVar ImageObject) AsEntities() (*Entities, bool) { 4739 return nil, false 4740} 4741 4742// AsPlaces is the BasicResponseBase implementation for ImageObject. 4743func (ioVar ImageObject) AsPlaces() (*Places, bool) { 4744 return nil, false 4745} 4746 4747// AsSearchResponse is the BasicResponseBase implementation for ImageObject. 4748func (ioVar ImageObject) AsSearchResponse() (*SearchResponse, bool) { 4749 return nil, false 4750} 4751 4752// AsResponse is the BasicResponseBase implementation for ImageObject. 4753func (ioVar ImageObject) AsResponse() (*Response, bool) { 4754 return nil, false 4755} 4756 4757// AsBasicResponse is the BasicResponseBase implementation for ImageObject. 4758func (ioVar ImageObject) AsBasicResponse() (BasicResponse, bool) { 4759 return &ioVar, true 4760} 4761 4762// AsSearchResultsAnswer is the BasicResponseBase implementation for ImageObject. 4763func (ioVar ImageObject) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 4764 return nil, false 4765} 4766 4767// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for ImageObject. 4768func (ioVar ImageObject) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 4769 return nil, false 4770} 4771 4772// AsIdentifiable is the BasicResponseBase implementation for ImageObject. 4773func (ioVar ImageObject) AsIdentifiable() (*Identifiable, bool) { 4774 return nil, false 4775} 4776 4777// AsBasicIdentifiable is the BasicResponseBase implementation for ImageObject. 4778func (ioVar ImageObject) AsBasicIdentifiable() (BasicIdentifiable, bool) { 4779 return &ioVar, true 4780} 4781 4782// AsAnswer is the BasicResponseBase implementation for ImageObject. 4783func (ioVar ImageObject) AsAnswer() (*Answer, bool) { 4784 return nil, false 4785} 4786 4787// AsBasicAnswer is the BasicResponseBase implementation for ImageObject. 4788func (ioVar ImageObject) AsBasicAnswer() (BasicAnswer, bool) { 4789 return nil, false 4790} 4791 4792// AsErrorResponse is the BasicResponseBase implementation for ImageObject. 4793func (ioVar ImageObject) AsErrorResponse() (*ErrorResponse, bool) { 4794 return nil, false 4795} 4796 4797// AsPostalAddress is the BasicResponseBase implementation for ImageObject. 4798func (ioVar ImageObject) AsPostalAddress() (*PostalAddress, bool) { 4799 return nil, false 4800} 4801 4802// AsPlace is the BasicResponseBase implementation for ImageObject. 4803func (ioVar ImageObject) AsPlace() (*Place, bool) { 4804 return nil, false 4805} 4806 4807// AsBasicPlace is the BasicResponseBase implementation for ImageObject. 4808func (ioVar ImageObject) AsBasicPlace() (BasicPlace, bool) { 4809 return nil, false 4810} 4811 4812// AsOrganization is the BasicResponseBase implementation for ImageObject. 4813func (ioVar ImageObject) AsOrganization() (*Organization, bool) { 4814 return nil, false 4815} 4816 4817// AsCreativeWork is the BasicResponseBase implementation for ImageObject. 4818func (ioVar ImageObject) AsCreativeWork() (*CreativeWork, bool) { 4819 return nil, false 4820} 4821 4822// AsBasicCreativeWork is the BasicResponseBase implementation for ImageObject. 4823func (ioVar ImageObject) AsBasicCreativeWork() (BasicCreativeWork, bool) { 4824 return &ioVar, true 4825} 4826 4827// AsIntangible is the BasicResponseBase implementation for ImageObject. 4828func (ioVar ImageObject) AsIntangible() (*Intangible, bool) { 4829 return nil, false 4830} 4831 4832// AsBasicIntangible is the BasicResponseBase implementation for ImageObject. 4833func (ioVar ImageObject) AsBasicIntangible() (BasicIntangible, bool) { 4834 return nil, false 4835} 4836 4837// AsMovieTheater is the BasicResponseBase implementation for ImageObject. 4838func (ioVar ImageObject) AsMovieTheater() (*MovieTheater, bool) { 4839 return nil, false 4840} 4841 4842// AsMediaObject is the BasicResponseBase implementation for ImageObject. 4843func (ioVar ImageObject) AsMediaObject() (*MediaObject, bool) { 4844 return nil, false 4845} 4846 4847// AsBasicMediaObject is the BasicResponseBase implementation for ImageObject. 4848func (ioVar ImageObject) AsBasicMediaObject() (BasicMediaObject, bool) { 4849 return &ioVar, true 4850} 4851 4852// AsCivicStructure is the BasicResponseBase implementation for ImageObject. 4853func (ioVar ImageObject) AsCivicStructure() (*CivicStructure, bool) { 4854 return nil, false 4855} 4856 4857// AsBasicCivicStructure is the BasicResponseBase implementation for ImageObject. 4858func (ioVar ImageObject) AsBasicCivicStructure() (BasicCivicStructure, bool) { 4859 return nil, false 4860} 4861 4862// AsLocalBusiness is the BasicResponseBase implementation for ImageObject. 4863func (ioVar ImageObject) AsLocalBusiness() (*LocalBusiness, bool) { 4864 return nil, false 4865} 4866 4867// AsBasicLocalBusiness is the BasicResponseBase implementation for ImageObject. 4868func (ioVar ImageObject) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 4869 return nil, false 4870} 4871 4872// AsTouristAttraction is the BasicResponseBase implementation for ImageObject. 4873func (ioVar ImageObject) AsTouristAttraction() (*TouristAttraction, bool) { 4874 return nil, false 4875} 4876 4877// AsAirport is the BasicResponseBase implementation for ImageObject. 4878func (ioVar ImageObject) AsAirport() (*Airport, bool) { 4879 return nil, false 4880} 4881 4882// AsLicense is the BasicResponseBase implementation for ImageObject. 4883func (ioVar ImageObject) AsLicense() (*License, bool) { 4884 return nil, false 4885} 4886 4887// AsStructuredValue is the BasicResponseBase implementation for ImageObject. 4888func (ioVar ImageObject) AsStructuredValue() (*StructuredValue, bool) { 4889 return nil, false 4890} 4891 4892// AsBasicStructuredValue is the BasicResponseBase implementation for ImageObject. 4893func (ioVar ImageObject) AsBasicStructuredValue() (BasicStructuredValue, bool) { 4894 return nil, false 4895} 4896 4897// AsEntertainmentBusiness is the BasicResponseBase implementation for ImageObject. 4898func (ioVar ImageObject) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 4899 return nil, false 4900} 4901 4902// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for ImageObject. 4903func (ioVar ImageObject) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 4904 return nil, false 4905} 4906 4907// AsFoodEstablishment is the BasicResponseBase implementation for ImageObject. 4908func (ioVar ImageObject) AsFoodEstablishment() (*FoodEstablishment, bool) { 4909 return nil, false 4910} 4911 4912// AsBasicFoodEstablishment is the BasicResponseBase implementation for ImageObject. 4913func (ioVar ImageObject) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 4914 return nil, false 4915} 4916 4917// AsLodgingBusiness is the BasicResponseBase implementation for ImageObject. 4918func (ioVar ImageObject) AsLodgingBusiness() (*LodgingBusiness, bool) { 4919 return nil, false 4920} 4921 4922// AsBasicLodgingBusiness is the BasicResponseBase implementation for ImageObject. 4923func (ioVar ImageObject) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 4924 return nil, false 4925} 4926 4927// AsRestaurant is the BasicResponseBase implementation for ImageObject. 4928func (ioVar ImageObject) AsRestaurant() (*Restaurant, bool) { 4929 return nil, false 4930} 4931 4932// AsHotel is the BasicResponseBase implementation for ImageObject. 4933func (ioVar ImageObject) AsHotel() (*Hotel, bool) { 4934 return nil, false 4935} 4936 4937// AsResponseBase is the BasicResponseBase implementation for ImageObject. 4938func (ioVar ImageObject) AsResponseBase() (*ResponseBase, bool) { 4939 return nil, false 4940} 4941 4942// AsBasicResponseBase is the BasicResponseBase implementation for ImageObject. 4943func (ioVar ImageObject) AsBasicResponseBase() (BasicResponseBase, bool) { 4944 return &ioVar, true 4945} 4946 4947// UnmarshalJSON is the custom unmarshaler for ImageObject struct. 4948func (ioVar *ImageObject) UnmarshalJSON(body []byte) error { 4949 var m map[string]*json.RawMessage 4950 err := json.Unmarshal(body, &m) 4951 if err != nil { 4952 return err 4953 } 4954 for k, v := range m { 4955 switch k { 4956 case "thumbnail": 4957 if v != nil { 4958 var thumbnail ImageObject 4959 err = json.Unmarshal(*v, &thumbnail) 4960 if err != nil { 4961 return err 4962 } 4963 ioVar.Thumbnail = &thumbnail 4964 } 4965 case "contentUrl": 4966 if v != nil { 4967 var contentURL string 4968 err = json.Unmarshal(*v, &contentURL) 4969 if err != nil { 4970 return err 4971 } 4972 ioVar.ContentURL = &contentURL 4973 } 4974 case "hostPageUrl": 4975 if v != nil { 4976 var hostPageURL string 4977 err = json.Unmarshal(*v, &hostPageURL) 4978 if err != nil { 4979 return err 4980 } 4981 ioVar.HostPageURL = &hostPageURL 4982 } 4983 case "width": 4984 if v != nil { 4985 var width int32 4986 err = json.Unmarshal(*v, &width) 4987 if err != nil { 4988 return err 4989 } 4990 ioVar.Width = &width 4991 } 4992 case "height": 4993 if v != nil { 4994 var height int32 4995 err = json.Unmarshal(*v, &height) 4996 if err != nil { 4997 return err 4998 } 4999 ioVar.Height = &height 5000 } 5001 case "thumbnailUrl": 5002 if v != nil { 5003 var thumbnailURL string 5004 err = json.Unmarshal(*v, &thumbnailURL) 5005 if err != nil { 5006 return err 5007 } 5008 ioVar.ThumbnailURL = &thumbnailURL 5009 } 5010 case "provider": 5011 if v != nil { 5012 provider, err := unmarshalBasicThingArray(*v) 5013 if err != nil { 5014 return err 5015 } 5016 ioVar.Provider = &provider 5017 } 5018 case "text": 5019 if v != nil { 5020 var textVar string 5021 err = json.Unmarshal(*v, &textVar) 5022 if err != nil { 5023 return err 5024 } 5025 ioVar.Text = &textVar 5026 } 5027 case "name": 5028 if v != nil { 5029 var name string 5030 err = json.Unmarshal(*v, &name) 5031 if err != nil { 5032 return err 5033 } 5034 ioVar.Name = &name 5035 } 5036 case "url": 5037 if v != nil { 5038 var URL string 5039 err = json.Unmarshal(*v, &URL) 5040 if err != nil { 5041 return err 5042 } 5043 ioVar.URL = &URL 5044 } 5045 case "image": 5046 if v != nil { 5047 var imageVar ImageObject 5048 err = json.Unmarshal(*v, &imageVar) 5049 if err != nil { 5050 return err 5051 } 5052 ioVar.Image = &imageVar 5053 } 5054 case "description": 5055 if v != nil { 5056 var description string 5057 err = json.Unmarshal(*v, &description) 5058 if err != nil { 5059 return err 5060 } 5061 ioVar.Description = &description 5062 } 5063 case "entityPresentationInfo": 5064 if v != nil { 5065 var entityPresentationInfo EntitiesEntityPresentationInfo 5066 err = json.Unmarshal(*v, &entityPresentationInfo) 5067 if err != nil { 5068 return err 5069 } 5070 ioVar.EntityPresentationInfo = &entityPresentationInfo 5071 } 5072 case "bingId": 5073 if v != nil { 5074 var bingID string 5075 err = json.Unmarshal(*v, &bingID) 5076 if err != nil { 5077 return err 5078 } 5079 ioVar.BingID = &bingID 5080 } 5081 case "contractualRules": 5082 if v != nil { 5083 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 5084 if err != nil { 5085 return err 5086 } 5087 ioVar.ContractualRules = &contractualRules 5088 } 5089 case "webSearchUrl": 5090 if v != nil { 5091 var webSearchURL string 5092 err = json.Unmarshal(*v, &webSearchURL) 5093 if err != nil { 5094 return err 5095 } 5096 ioVar.WebSearchURL = &webSearchURL 5097 } 5098 case "id": 5099 if v != nil { 5100 var ID string 5101 err = json.Unmarshal(*v, &ID) 5102 if err != nil { 5103 return err 5104 } 5105 ioVar.ID = &ID 5106 } 5107 case "_type": 5108 if v != nil { 5109 var typeVar TypeBasicResponseBase 5110 err = json.Unmarshal(*v, &typeVar) 5111 if err != nil { 5112 return err 5113 } 5114 ioVar.Type = typeVar 5115 } 5116 } 5117 } 5118 5119 return nil 5120} 5121 5122// BasicIntangible ... 5123type BasicIntangible interface { 5124 AsPostalAddress() (*PostalAddress, bool) 5125 AsStructuredValue() (*StructuredValue, bool) 5126 AsBasicStructuredValue() (BasicStructuredValue, bool) 5127 AsIntangible() (*Intangible, bool) 5128} 5129 5130// Intangible ... 5131type Intangible struct { 5132 // Name - READ-ONLY; The name of the thing represented by this object. 5133 Name *string `json:"name,omitempty"` 5134 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 5135 URL *string `json:"url,omitempty"` 5136 // Image - READ-ONLY 5137 Image *ImageObject `json:"image,omitempty"` 5138 // Description - READ-ONLY; A short description of the item. 5139 Description *string `json:"description,omitempty"` 5140 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 5141 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 5142 // BingID - READ-ONLY; An ID that uniquely identifies this item. 5143 BingID *string `json:"bingId,omitempty"` 5144 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 5145 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 5146 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 5147 WebSearchURL *string `json:"webSearchUrl,omitempty"` 5148 // ID - READ-ONLY; A String identifier. 5149 ID *string `json:"id,omitempty"` 5150 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 5151 Type TypeBasicResponseBase `json:"_type,omitempty"` 5152} 5153 5154func unmarshalBasicIntangible(body []byte) (BasicIntangible, error) { 5155 var m map[string]interface{} 5156 err := json.Unmarshal(body, &m) 5157 if err != nil { 5158 return nil, err 5159 } 5160 5161 switch m["_type"] { 5162 case string(TypePostalAddress): 5163 var pa PostalAddress 5164 err := json.Unmarshal(body, &pa) 5165 return pa, err 5166 case string(TypeStructuredValue): 5167 var sv StructuredValue 5168 err := json.Unmarshal(body, &sv) 5169 return sv, err 5170 default: 5171 var i Intangible 5172 err := json.Unmarshal(body, &i) 5173 return i, err 5174 } 5175} 5176func unmarshalBasicIntangibleArray(body []byte) ([]BasicIntangible, error) { 5177 var rawMessages []*json.RawMessage 5178 err := json.Unmarshal(body, &rawMessages) 5179 if err != nil { 5180 return nil, err 5181 } 5182 5183 iArray := make([]BasicIntangible, len(rawMessages)) 5184 5185 for index, rawMessage := range rawMessages { 5186 i, err := unmarshalBasicIntangible(*rawMessage) 5187 if err != nil { 5188 return nil, err 5189 } 5190 iArray[index] = i 5191 } 5192 return iArray, nil 5193} 5194 5195// MarshalJSON is the custom marshaler for Intangible. 5196func (i Intangible) MarshalJSON() ([]byte, error) { 5197 i.Type = TypeIntangible 5198 objectMap := make(map[string]interface{}) 5199 if i.Type != "" { 5200 objectMap["_type"] = i.Type 5201 } 5202 return json.Marshal(objectMap) 5203} 5204 5205// AsImageObject is the BasicResponseBase implementation for Intangible. 5206func (i Intangible) AsImageObject() (*ImageObject, bool) { 5207 return nil, false 5208} 5209 5210// AsThing is the BasicResponseBase implementation for Intangible. 5211func (i Intangible) AsThing() (*Thing, bool) { 5212 return nil, false 5213} 5214 5215// AsBasicThing is the BasicResponseBase implementation for Intangible. 5216func (i Intangible) AsBasicThing() (BasicThing, bool) { 5217 return &i, true 5218} 5219 5220// AsEntities is the BasicResponseBase implementation for Intangible. 5221func (i Intangible) AsEntities() (*Entities, bool) { 5222 return nil, false 5223} 5224 5225// AsPlaces is the BasicResponseBase implementation for Intangible. 5226func (i Intangible) AsPlaces() (*Places, bool) { 5227 return nil, false 5228} 5229 5230// AsSearchResponse is the BasicResponseBase implementation for Intangible. 5231func (i Intangible) AsSearchResponse() (*SearchResponse, bool) { 5232 return nil, false 5233} 5234 5235// AsResponse is the BasicResponseBase implementation for Intangible. 5236func (i Intangible) AsResponse() (*Response, bool) { 5237 return nil, false 5238} 5239 5240// AsBasicResponse is the BasicResponseBase implementation for Intangible. 5241func (i Intangible) AsBasicResponse() (BasicResponse, bool) { 5242 return &i, true 5243} 5244 5245// AsSearchResultsAnswer is the BasicResponseBase implementation for Intangible. 5246func (i Intangible) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 5247 return nil, false 5248} 5249 5250// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Intangible. 5251func (i Intangible) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 5252 return nil, false 5253} 5254 5255// AsIdentifiable is the BasicResponseBase implementation for Intangible. 5256func (i Intangible) AsIdentifiable() (*Identifiable, bool) { 5257 return nil, false 5258} 5259 5260// AsBasicIdentifiable is the BasicResponseBase implementation for Intangible. 5261func (i Intangible) AsBasicIdentifiable() (BasicIdentifiable, bool) { 5262 return &i, true 5263} 5264 5265// AsAnswer is the BasicResponseBase implementation for Intangible. 5266func (i Intangible) AsAnswer() (*Answer, bool) { 5267 return nil, false 5268} 5269 5270// AsBasicAnswer is the BasicResponseBase implementation for Intangible. 5271func (i Intangible) AsBasicAnswer() (BasicAnswer, bool) { 5272 return nil, false 5273} 5274 5275// AsErrorResponse is the BasicResponseBase implementation for Intangible. 5276func (i Intangible) AsErrorResponse() (*ErrorResponse, bool) { 5277 return nil, false 5278} 5279 5280// AsPostalAddress is the BasicResponseBase implementation for Intangible. 5281func (i Intangible) AsPostalAddress() (*PostalAddress, bool) { 5282 return nil, false 5283} 5284 5285// AsPlace is the BasicResponseBase implementation for Intangible. 5286func (i Intangible) AsPlace() (*Place, bool) { 5287 return nil, false 5288} 5289 5290// AsBasicPlace is the BasicResponseBase implementation for Intangible. 5291func (i Intangible) AsBasicPlace() (BasicPlace, bool) { 5292 return nil, false 5293} 5294 5295// AsOrganization is the BasicResponseBase implementation for Intangible. 5296func (i Intangible) AsOrganization() (*Organization, bool) { 5297 return nil, false 5298} 5299 5300// AsCreativeWork is the BasicResponseBase implementation for Intangible. 5301func (i Intangible) AsCreativeWork() (*CreativeWork, bool) { 5302 return nil, false 5303} 5304 5305// AsBasicCreativeWork is the BasicResponseBase implementation for Intangible. 5306func (i Intangible) AsBasicCreativeWork() (BasicCreativeWork, bool) { 5307 return nil, false 5308} 5309 5310// AsIntangible is the BasicResponseBase implementation for Intangible. 5311func (i Intangible) AsIntangible() (*Intangible, bool) { 5312 return &i, true 5313} 5314 5315// AsBasicIntangible is the BasicResponseBase implementation for Intangible. 5316func (i Intangible) AsBasicIntangible() (BasicIntangible, bool) { 5317 return &i, true 5318} 5319 5320// AsMovieTheater is the BasicResponseBase implementation for Intangible. 5321func (i Intangible) AsMovieTheater() (*MovieTheater, bool) { 5322 return nil, false 5323} 5324 5325// AsMediaObject is the BasicResponseBase implementation for Intangible. 5326func (i Intangible) AsMediaObject() (*MediaObject, bool) { 5327 return nil, false 5328} 5329 5330// AsBasicMediaObject is the BasicResponseBase implementation for Intangible. 5331func (i Intangible) AsBasicMediaObject() (BasicMediaObject, bool) { 5332 return nil, false 5333} 5334 5335// AsCivicStructure is the BasicResponseBase implementation for Intangible. 5336func (i Intangible) AsCivicStructure() (*CivicStructure, bool) { 5337 return nil, false 5338} 5339 5340// AsBasicCivicStructure is the BasicResponseBase implementation for Intangible. 5341func (i Intangible) AsBasicCivicStructure() (BasicCivicStructure, bool) { 5342 return nil, false 5343} 5344 5345// AsLocalBusiness is the BasicResponseBase implementation for Intangible. 5346func (i Intangible) AsLocalBusiness() (*LocalBusiness, bool) { 5347 return nil, false 5348} 5349 5350// AsBasicLocalBusiness is the BasicResponseBase implementation for Intangible. 5351func (i Intangible) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 5352 return nil, false 5353} 5354 5355// AsTouristAttraction is the BasicResponseBase implementation for Intangible. 5356func (i Intangible) AsTouristAttraction() (*TouristAttraction, bool) { 5357 return nil, false 5358} 5359 5360// AsAirport is the BasicResponseBase implementation for Intangible. 5361func (i Intangible) AsAirport() (*Airport, bool) { 5362 return nil, false 5363} 5364 5365// AsLicense is the BasicResponseBase implementation for Intangible. 5366func (i Intangible) AsLicense() (*License, bool) { 5367 return nil, false 5368} 5369 5370// AsStructuredValue is the BasicResponseBase implementation for Intangible. 5371func (i Intangible) AsStructuredValue() (*StructuredValue, bool) { 5372 return nil, false 5373} 5374 5375// AsBasicStructuredValue is the BasicResponseBase implementation for Intangible. 5376func (i Intangible) AsBasicStructuredValue() (BasicStructuredValue, bool) { 5377 return nil, false 5378} 5379 5380// AsEntertainmentBusiness is the BasicResponseBase implementation for Intangible. 5381func (i Intangible) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 5382 return nil, false 5383} 5384 5385// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for Intangible. 5386func (i Intangible) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 5387 return nil, false 5388} 5389 5390// AsFoodEstablishment is the BasicResponseBase implementation for Intangible. 5391func (i Intangible) AsFoodEstablishment() (*FoodEstablishment, bool) { 5392 return nil, false 5393} 5394 5395// AsBasicFoodEstablishment is the BasicResponseBase implementation for Intangible. 5396func (i Intangible) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 5397 return nil, false 5398} 5399 5400// AsLodgingBusiness is the BasicResponseBase implementation for Intangible. 5401func (i Intangible) AsLodgingBusiness() (*LodgingBusiness, bool) { 5402 return nil, false 5403} 5404 5405// AsBasicLodgingBusiness is the BasicResponseBase implementation for Intangible. 5406func (i Intangible) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 5407 return nil, false 5408} 5409 5410// AsRestaurant is the BasicResponseBase implementation for Intangible. 5411func (i Intangible) AsRestaurant() (*Restaurant, bool) { 5412 return nil, false 5413} 5414 5415// AsHotel is the BasicResponseBase implementation for Intangible. 5416func (i Intangible) AsHotel() (*Hotel, bool) { 5417 return nil, false 5418} 5419 5420// AsResponseBase is the BasicResponseBase implementation for Intangible. 5421func (i Intangible) AsResponseBase() (*ResponseBase, bool) { 5422 return nil, false 5423} 5424 5425// AsBasicResponseBase is the BasicResponseBase implementation for Intangible. 5426func (i Intangible) AsBasicResponseBase() (BasicResponseBase, bool) { 5427 return &i, true 5428} 5429 5430// UnmarshalJSON is the custom unmarshaler for Intangible struct. 5431func (i *Intangible) UnmarshalJSON(body []byte) error { 5432 var m map[string]*json.RawMessage 5433 err := json.Unmarshal(body, &m) 5434 if err != nil { 5435 return err 5436 } 5437 for k, v := range m { 5438 switch k { 5439 case "name": 5440 if v != nil { 5441 var name string 5442 err = json.Unmarshal(*v, &name) 5443 if err != nil { 5444 return err 5445 } 5446 i.Name = &name 5447 } 5448 case "url": 5449 if v != nil { 5450 var URL string 5451 err = json.Unmarshal(*v, &URL) 5452 if err != nil { 5453 return err 5454 } 5455 i.URL = &URL 5456 } 5457 case "image": 5458 if v != nil { 5459 var imageVar ImageObject 5460 err = json.Unmarshal(*v, &imageVar) 5461 if err != nil { 5462 return err 5463 } 5464 i.Image = &imageVar 5465 } 5466 case "description": 5467 if v != nil { 5468 var description string 5469 err = json.Unmarshal(*v, &description) 5470 if err != nil { 5471 return err 5472 } 5473 i.Description = &description 5474 } 5475 case "entityPresentationInfo": 5476 if v != nil { 5477 var entityPresentationInfo EntitiesEntityPresentationInfo 5478 err = json.Unmarshal(*v, &entityPresentationInfo) 5479 if err != nil { 5480 return err 5481 } 5482 i.EntityPresentationInfo = &entityPresentationInfo 5483 } 5484 case "bingId": 5485 if v != nil { 5486 var bingID string 5487 err = json.Unmarshal(*v, &bingID) 5488 if err != nil { 5489 return err 5490 } 5491 i.BingID = &bingID 5492 } 5493 case "contractualRules": 5494 if v != nil { 5495 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 5496 if err != nil { 5497 return err 5498 } 5499 i.ContractualRules = &contractualRules 5500 } 5501 case "webSearchUrl": 5502 if v != nil { 5503 var webSearchURL string 5504 err = json.Unmarshal(*v, &webSearchURL) 5505 if err != nil { 5506 return err 5507 } 5508 i.WebSearchURL = &webSearchURL 5509 } 5510 case "id": 5511 if v != nil { 5512 var ID string 5513 err = json.Unmarshal(*v, &ID) 5514 if err != nil { 5515 return err 5516 } 5517 i.ID = &ID 5518 } 5519 case "_type": 5520 if v != nil { 5521 var typeVar TypeBasicResponseBase 5522 err = json.Unmarshal(*v, &typeVar) 5523 if err != nil { 5524 return err 5525 } 5526 i.Type = typeVar 5527 } 5528 } 5529 } 5530 5531 return nil 5532} 5533 5534// License defines the license under which the text or photo may be used. 5535type License struct { 5536 // ThumbnailURL - READ-ONLY; The URL to a thumbnail of the item. 5537 ThumbnailURL *string `json:"thumbnailUrl,omitempty"` 5538 // Provider - READ-ONLY; The source of the creative work. 5539 Provider *[]BasicThing `json:"provider,omitempty"` 5540 // Text - READ-ONLY 5541 Text *string `json:"text,omitempty"` 5542 // Name - READ-ONLY; The name of the thing represented by this object. 5543 Name *string `json:"name,omitempty"` 5544 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 5545 URL *string `json:"url,omitempty"` 5546 // Image - READ-ONLY 5547 Image *ImageObject `json:"image,omitempty"` 5548 // Description - READ-ONLY; A short description of the item. 5549 Description *string `json:"description,omitempty"` 5550 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 5551 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 5552 // BingID - READ-ONLY; An ID that uniquely identifies this item. 5553 BingID *string `json:"bingId,omitempty"` 5554 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 5555 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 5556 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 5557 WebSearchURL *string `json:"webSearchUrl,omitempty"` 5558 // ID - READ-ONLY; A String identifier. 5559 ID *string `json:"id,omitempty"` 5560 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 5561 Type TypeBasicResponseBase `json:"_type,omitempty"` 5562} 5563 5564// MarshalJSON is the custom marshaler for License. 5565func (l License) MarshalJSON() ([]byte, error) { 5566 l.Type = TypeLicense 5567 objectMap := make(map[string]interface{}) 5568 if l.Type != "" { 5569 objectMap["_type"] = l.Type 5570 } 5571 return json.Marshal(objectMap) 5572} 5573 5574// AsImageObject is the BasicResponseBase implementation for License. 5575func (l License) AsImageObject() (*ImageObject, bool) { 5576 return nil, false 5577} 5578 5579// AsThing is the BasicResponseBase implementation for License. 5580func (l License) AsThing() (*Thing, bool) { 5581 return nil, false 5582} 5583 5584// AsBasicThing is the BasicResponseBase implementation for License. 5585func (l License) AsBasicThing() (BasicThing, bool) { 5586 return &l, true 5587} 5588 5589// AsEntities is the BasicResponseBase implementation for License. 5590func (l License) AsEntities() (*Entities, bool) { 5591 return nil, false 5592} 5593 5594// AsPlaces is the BasicResponseBase implementation for License. 5595func (l License) AsPlaces() (*Places, bool) { 5596 return nil, false 5597} 5598 5599// AsSearchResponse is the BasicResponseBase implementation for License. 5600func (l License) AsSearchResponse() (*SearchResponse, bool) { 5601 return nil, false 5602} 5603 5604// AsResponse is the BasicResponseBase implementation for License. 5605func (l License) AsResponse() (*Response, bool) { 5606 return nil, false 5607} 5608 5609// AsBasicResponse is the BasicResponseBase implementation for License. 5610func (l License) AsBasicResponse() (BasicResponse, bool) { 5611 return &l, true 5612} 5613 5614// AsSearchResultsAnswer is the BasicResponseBase implementation for License. 5615func (l License) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 5616 return nil, false 5617} 5618 5619// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for License. 5620func (l License) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 5621 return nil, false 5622} 5623 5624// AsIdentifiable is the BasicResponseBase implementation for License. 5625func (l License) AsIdentifiable() (*Identifiable, bool) { 5626 return nil, false 5627} 5628 5629// AsBasicIdentifiable is the BasicResponseBase implementation for License. 5630func (l License) AsBasicIdentifiable() (BasicIdentifiable, bool) { 5631 return &l, true 5632} 5633 5634// AsAnswer is the BasicResponseBase implementation for License. 5635func (l License) AsAnswer() (*Answer, bool) { 5636 return nil, false 5637} 5638 5639// AsBasicAnswer is the BasicResponseBase implementation for License. 5640func (l License) AsBasicAnswer() (BasicAnswer, bool) { 5641 return nil, false 5642} 5643 5644// AsErrorResponse is the BasicResponseBase implementation for License. 5645func (l License) AsErrorResponse() (*ErrorResponse, bool) { 5646 return nil, false 5647} 5648 5649// AsPostalAddress is the BasicResponseBase implementation for License. 5650func (l License) AsPostalAddress() (*PostalAddress, bool) { 5651 return nil, false 5652} 5653 5654// AsPlace is the BasicResponseBase implementation for License. 5655func (l License) AsPlace() (*Place, bool) { 5656 return nil, false 5657} 5658 5659// AsBasicPlace is the BasicResponseBase implementation for License. 5660func (l License) AsBasicPlace() (BasicPlace, bool) { 5661 return nil, false 5662} 5663 5664// AsOrganization is the BasicResponseBase implementation for License. 5665func (l License) AsOrganization() (*Organization, bool) { 5666 return nil, false 5667} 5668 5669// AsCreativeWork is the BasicResponseBase implementation for License. 5670func (l License) AsCreativeWork() (*CreativeWork, bool) { 5671 return nil, false 5672} 5673 5674// AsBasicCreativeWork is the BasicResponseBase implementation for License. 5675func (l License) AsBasicCreativeWork() (BasicCreativeWork, bool) { 5676 return &l, true 5677} 5678 5679// AsIntangible is the BasicResponseBase implementation for License. 5680func (l License) AsIntangible() (*Intangible, bool) { 5681 return nil, false 5682} 5683 5684// AsBasicIntangible is the BasicResponseBase implementation for License. 5685func (l License) AsBasicIntangible() (BasicIntangible, bool) { 5686 return nil, false 5687} 5688 5689// AsMovieTheater is the BasicResponseBase implementation for License. 5690func (l License) AsMovieTheater() (*MovieTheater, bool) { 5691 return nil, false 5692} 5693 5694// AsMediaObject is the BasicResponseBase implementation for License. 5695func (l License) AsMediaObject() (*MediaObject, bool) { 5696 return nil, false 5697} 5698 5699// AsBasicMediaObject is the BasicResponseBase implementation for License. 5700func (l License) AsBasicMediaObject() (BasicMediaObject, bool) { 5701 return nil, false 5702} 5703 5704// AsCivicStructure is the BasicResponseBase implementation for License. 5705func (l License) AsCivicStructure() (*CivicStructure, bool) { 5706 return nil, false 5707} 5708 5709// AsBasicCivicStructure is the BasicResponseBase implementation for License. 5710func (l License) AsBasicCivicStructure() (BasicCivicStructure, bool) { 5711 return nil, false 5712} 5713 5714// AsLocalBusiness is the BasicResponseBase implementation for License. 5715func (l License) AsLocalBusiness() (*LocalBusiness, bool) { 5716 return nil, false 5717} 5718 5719// AsBasicLocalBusiness is the BasicResponseBase implementation for License. 5720func (l License) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 5721 return nil, false 5722} 5723 5724// AsTouristAttraction is the BasicResponseBase implementation for License. 5725func (l License) AsTouristAttraction() (*TouristAttraction, bool) { 5726 return nil, false 5727} 5728 5729// AsAirport is the BasicResponseBase implementation for License. 5730func (l License) AsAirport() (*Airport, bool) { 5731 return nil, false 5732} 5733 5734// AsLicense is the BasicResponseBase implementation for License. 5735func (l License) AsLicense() (*License, bool) { 5736 return &l, true 5737} 5738 5739// AsStructuredValue is the BasicResponseBase implementation for License. 5740func (l License) AsStructuredValue() (*StructuredValue, bool) { 5741 return nil, false 5742} 5743 5744// AsBasicStructuredValue is the BasicResponseBase implementation for License. 5745func (l License) AsBasicStructuredValue() (BasicStructuredValue, bool) { 5746 return nil, false 5747} 5748 5749// AsEntertainmentBusiness is the BasicResponseBase implementation for License. 5750func (l License) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 5751 return nil, false 5752} 5753 5754// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for License. 5755func (l License) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 5756 return nil, false 5757} 5758 5759// AsFoodEstablishment is the BasicResponseBase implementation for License. 5760func (l License) AsFoodEstablishment() (*FoodEstablishment, bool) { 5761 return nil, false 5762} 5763 5764// AsBasicFoodEstablishment is the BasicResponseBase implementation for License. 5765func (l License) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 5766 return nil, false 5767} 5768 5769// AsLodgingBusiness is the BasicResponseBase implementation for License. 5770func (l License) AsLodgingBusiness() (*LodgingBusiness, bool) { 5771 return nil, false 5772} 5773 5774// AsBasicLodgingBusiness is the BasicResponseBase implementation for License. 5775func (l License) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 5776 return nil, false 5777} 5778 5779// AsRestaurant is the BasicResponseBase implementation for License. 5780func (l License) AsRestaurant() (*Restaurant, bool) { 5781 return nil, false 5782} 5783 5784// AsHotel is the BasicResponseBase implementation for License. 5785func (l License) AsHotel() (*Hotel, bool) { 5786 return nil, false 5787} 5788 5789// AsResponseBase is the BasicResponseBase implementation for License. 5790func (l License) AsResponseBase() (*ResponseBase, bool) { 5791 return nil, false 5792} 5793 5794// AsBasicResponseBase is the BasicResponseBase implementation for License. 5795func (l License) AsBasicResponseBase() (BasicResponseBase, bool) { 5796 return &l, true 5797} 5798 5799// UnmarshalJSON is the custom unmarshaler for License struct. 5800func (l *License) UnmarshalJSON(body []byte) error { 5801 var m map[string]*json.RawMessage 5802 err := json.Unmarshal(body, &m) 5803 if err != nil { 5804 return err 5805 } 5806 for k, v := range m { 5807 switch k { 5808 case "thumbnailUrl": 5809 if v != nil { 5810 var thumbnailURL string 5811 err = json.Unmarshal(*v, &thumbnailURL) 5812 if err != nil { 5813 return err 5814 } 5815 l.ThumbnailURL = &thumbnailURL 5816 } 5817 case "provider": 5818 if v != nil { 5819 provider, err := unmarshalBasicThingArray(*v) 5820 if err != nil { 5821 return err 5822 } 5823 l.Provider = &provider 5824 } 5825 case "text": 5826 if v != nil { 5827 var textVar string 5828 err = json.Unmarshal(*v, &textVar) 5829 if err != nil { 5830 return err 5831 } 5832 l.Text = &textVar 5833 } 5834 case "name": 5835 if v != nil { 5836 var name string 5837 err = json.Unmarshal(*v, &name) 5838 if err != nil { 5839 return err 5840 } 5841 l.Name = &name 5842 } 5843 case "url": 5844 if v != nil { 5845 var URL string 5846 err = json.Unmarshal(*v, &URL) 5847 if err != nil { 5848 return err 5849 } 5850 l.URL = &URL 5851 } 5852 case "image": 5853 if v != nil { 5854 var imageVar ImageObject 5855 err = json.Unmarshal(*v, &imageVar) 5856 if err != nil { 5857 return err 5858 } 5859 l.Image = &imageVar 5860 } 5861 case "description": 5862 if v != nil { 5863 var description string 5864 err = json.Unmarshal(*v, &description) 5865 if err != nil { 5866 return err 5867 } 5868 l.Description = &description 5869 } 5870 case "entityPresentationInfo": 5871 if v != nil { 5872 var entityPresentationInfo EntitiesEntityPresentationInfo 5873 err = json.Unmarshal(*v, &entityPresentationInfo) 5874 if err != nil { 5875 return err 5876 } 5877 l.EntityPresentationInfo = &entityPresentationInfo 5878 } 5879 case "bingId": 5880 if v != nil { 5881 var bingID string 5882 err = json.Unmarshal(*v, &bingID) 5883 if err != nil { 5884 return err 5885 } 5886 l.BingID = &bingID 5887 } 5888 case "contractualRules": 5889 if v != nil { 5890 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 5891 if err != nil { 5892 return err 5893 } 5894 l.ContractualRules = &contractualRules 5895 } 5896 case "webSearchUrl": 5897 if v != nil { 5898 var webSearchURL string 5899 err = json.Unmarshal(*v, &webSearchURL) 5900 if err != nil { 5901 return err 5902 } 5903 l.WebSearchURL = &webSearchURL 5904 } 5905 case "id": 5906 if v != nil { 5907 var ID string 5908 err = json.Unmarshal(*v, &ID) 5909 if err != nil { 5910 return err 5911 } 5912 l.ID = &ID 5913 } 5914 case "_type": 5915 if v != nil { 5916 var typeVar TypeBasicResponseBase 5917 err = json.Unmarshal(*v, &typeVar) 5918 if err != nil { 5919 return err 5920 } 5921 l.Type = typeVar 5922 } 5923 } 5924 } 5925 5926 return nil 5927} 5928 5929// BasicLocalBusiness ... 5930type BasicLocalBusiness interface { 5931 AsMovieTheater() (*MovieTheater, bool) 5932 AsEntertainmentBusiness() (*EntertainmentBusiness, bool) 5933 AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) 5934 AsFoodEstablishment() (*FoodEstablishment, bool) 5935 AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) 5936 AsLodgingBusiness() (*LodgingBusiness, bool) 5937 AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) 5938 AsRestaurant() (*Restaurant, bool) 5939 AsHotel() (*Hotel, bool) 5940 AsLocalBusiness() (*LocalBusiness, bool) 5941} 5942 5943// LocalBusiness ... 5944type LocalBusiness struct { 5945 // PriceRange - READ-ONLY; $$. 5946 PriceRange *string `json:"priceRange,omitempty"` 5947 // Panoramas - READ-ONLY 5948 Panoramas *[]ImageObject `json:"panoramas,omitempty"` 5949 // IsPermanentlyClosed - READ-ONLY 5950 IsPermanentlyClosed *bool `json:"isPermanentlyClosed,omitempty"` 5951 // TagLine - READ-ONLY 5952 TagLine *string `json:"tagLine,omitempty"` 5953 // Address - READ-ONLY; The postal address of where the entity is located 5954 Address *PostalAddress `json:"address,omitempty"` 5955 // Telephone - READ-ONLY; The entity's telephone number 5956 Telephone *string `json:"telephone,omitempty"` 5957 // Name - READ-ONLY; The name of the thing represented by this object. 5958 Name *string `json:"name,omitempty"` 5959 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 5960 URL *string `json:"url,omitempty"` 5961 // Image - READ-ONLY 5962 Image *ImageObject `json:"image,omitempty"` 5963 // Description - READ-ONLY; A short description of the item. 5964 Description *string `json:"description,omitempty"` 5965 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 5966 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 5967 // BingID - READ-ONLY; An ID that uniquely identifies this item. 5968 BingID *string `json:"bingId,omitempty"` 5969 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 5970 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 5971 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 5972 WebSearchURL *string `json:"webSearchUrl,omitempty"` 5973 // ID - READ-ONLY; A String identifier. 5974 ID *string `json:"id,omitempty"` 5975 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 5976 Type TypeBasicResponseBase `json:"_type,omitempty"` 5977} 5978 5979func unmarshalBasicLocalBusiness(body []byte) (BasicLocalBusiness, error) { 5980 var m map[string]interface{} 5981 err := json.Unmarshal(body, &m) 5982 if err != nil { 5983 return nil, err 5984 } 5985 5986 switch m["_type"] { 5987 case string(TypeMovieTheater): 5988 var mt MovieTheater 5989 err := json.Unmarshal(body, &mt) 5990 return mt, err 5991 case string(TypeEntertainmentBusiness): 5992 var eb EntertainmentBusiness 5993 err := json.Unmarshal(body, &eb) 5994 return eb, err 5995 case string(TypeFoodEstablishment): 5996 var fe FoodEstablishment 5997 err := json.Unmarshal(body, &fe) 5998 return fe, err 5999 case string(TypeLodgingBusiness): 6000 var lb LodgingBusiness 6001 err := json.Unmarshal(body, &lb) 6002 return lb, err 6003 case string(TypeRestaurant): 6004 var r Restaurant 6005 err := json.Unmarshal(body, &r) 6006 return r, err 6007 case string(TypeHotel): 6008 var h Hotel 6009 err := json.Unmarshal(body, &h) 6010 return h, err 6011 default: 6012 var lb LocalBusiness 6013 err := json.Unmarshal(body, &lb) 6014 return lb, err 6015 } 6016} 6017func unmarshalBasicLocalBusinessArray(body []byte) ([]BasicLocalBusiness, error) { 6018 var rawMessages []*json.RawMessage 6019 err := json.Unmarshal(body, &rawMessages) 6020 if err != nil { 6021 return nil, err 6022 } 6023 6024 lbArray := make([]BasicLocalBusiness, len(rawMessages)) 6025 6026 for index, rawMessage := range rawMessages { 6027 lb, err := unmarshalBasicLocalBusiness(*rawMessage) 6028 if err != nil { 6029 return nil, err 6030 } 6031 lbArray[index] = lb 6032 } 6033 return lbArray, nil 6034} 6035 6036// MarshalJSON is the custom marshaler for LocalBusiness. 6037func (lb LocalBusiness) MarshalJSON() ([]byte, error) { 6038 lb.Type = TypeLocalBusiness 6039 objectMap := make(map[string]interface{}) 6040 if lb.Type != "" { 6041 objectMap["_type"] = lb.Type 6042 } 6043 return json.Marshal(objectMap) 6044} 6045 6046// AsImageObject is the BasicResponseBase implementation for LocalBusiness. 6047func (lb LocalBusiness) AsImageObject() (*ImageObject, bool) { 6048 return nil, false 6049} 6050 6051// AsThing is the BasicResponseBase implementation for LocalBusiness. 6052func (lb LocalBusiness) AsThing() (*Thing, bool) { 6053 return nil, false 6054} 6055 6056// AsBasicThing is the BasicResponseBase implementation for LocalBusiness. 6057func (lb LocalBusiness) AsBasicThing() (BasicThing, bool) { 6058 return &lb, true 6059} 6060 6061// AsEntities is the BasicResponseBase implementation for LocalBusiness. 6062func (lb LocalBusiness) AsEntities() (*Entities, bool) { 6063 return nil, false 6064} 6065 6066// AsPlaces is the BasicResponseBase implementation for LocalBusiness. 6067func (lb LocalBusiness) AsPlaces() (*Places, bool) { 6068 return nil, false 6069} 6070 6071// AsSearchResponse is the BasicResponseBase implementation for LocalBusiness. 6072func (lb LocalBusiness) AsSearchResponse() (*SearchResponse, bool) { 6073 return nil, false 6074} 6075 6076// AsResponse is the BasicResponseBase implementation for LocalBusiness. 6077func (lb LocalBusiness) AsResponse() (*Response, bool) { 6078 return nil, false 6079} 6080 6081// AsBasicResponse is the BasicResponseBase implementation for LocalBusiness. 6082func (lb LocalBusiness) AsBasicResponse() (BasicResponse, bool) { 6083 return &lb, true 6084} 6085 6086// AsSearchResultsAnswer is the BasicResponseBase implementation for LocalBusiness. 6087func (lb LocalBusiness) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 6088 return nil, false 6089} 6090 6091// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for LocalBusiness. 6092func (lb LocalBusiness) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 6093 return nil, false 6094} 6095 6096// AsIdentifiable is the BasicResponseBase implementation for LocalBusiness. 6097func (lb LocalBusiness) AsIdentifiable() (*Identifiable, bool) { 6098 return nil, false 6099} 6100 6101// AsBasicIdentifiable is the BasicResponseBase implementation for LocalBusiness. 6102func (lb LocalBusiness) AsBasicIdentifiable() (BasicIdentifiable, bool) { 6103 return &lb, true 6104} 6105 6106// AsAnswer is the BasicResponseBase implementation for LocalBusiness. 6107func (lb LocalBusiness) AsAnswer() (*Answer, bool) { 6108 return nil, false 6109} 6110 6111// AsBasicAnswer is the BasicResponseBase implementation for LocalBusiness. 6112func (lb LocalBusiness) AsBasicAnswer() (BasicAnswer, bool) { 6113 return nil, false 6114} 6115 6116// AsErrorResponse is the BasicResponseBase implementation for LocalBusiness. 6117func (lb LocalBusiness) AsErrorResponse() (*ErrorResponse, bool) { 6118 return nil, false 6119} 6120 6121// AsPostalAddress is the BasicResponseBase implementation for LocalBusiness. 6122func (lb LocalBusiness) AsPostalAddress() (*PostalAddress, bool) { 6123 return nil, false 6124} 6125 6126// AsPlace is the BasicResponseBase implementation for LocalBusiness. 6127func (lb LocalBusiness) AsPlace() (*Place, bool) { 6128 return nil, false 6129} 6130 6131// AsBasicPlace is the BasicResponseBase implementation for LocalBusiness. 6132func (lb LocalBusiness) AsBasicPlace() (BasicPlace, bool) { 6133 return &lb, true 6134} 6135 6136// AsOrganization is the BasicResponseBase implementation for LocalBusiness. 6137func (lb LocalBusiness) AsOrganization() (*Organization, bool) { 6138 return nil, false 6139} 6140 6141// AsCreativeWork is the BasicResponseBase implementation for LocalBusiness. 6142func (lb LocalBusiness) AsCreativeWork() (*CreativeWork, bool) { 6143 return nil, false 6144} 6145 6146// AsBasicCreativeWork is the BasicResponseBase implementation for LocalBusiness. 6147func (lb LocalBusiness) AsBasicCreativeWork() (BasicCreativeWork, bool) { 6148 return nil, false 6149} 6150 6151// AsIntangible is the BasicResponseBase implementation for LocalBusiness. 6152func (lb LocalBusiness) AsIntangible() (*Intangible, bool) { 6153 return nil, false 6154} 6155 6156// AsBasicIntangible is the BasicResponseBase implementation for LocalBusiness. 6157func (lb LocalBusiness) AsBasicIntangible() (BasicIntangible, bool) { 6158 return nil, false 6159} 6160 6161// AsMovieTheater is the BasicResponseBase implementation for LocalBusiness. 6162func (lb LocalBusiness) AsMovieTheater() (*MovieTheater, bool) { 6163 return nil, false 6164} 6165 6166// AsMediaObject is the BasicResponseBase implementation for LocalBusiness. 6167func (lb LocalBusiness) AsMediaObject() (*MediaObject, bool) { 6168 return nil, false 6169} 6170 6171// AsBasicMediaObject is the BasicResponseBase implementation for LocalBusiness. 6172func (lb LocalBusiness) AsBasicMediaObject() (BasicMediaObject, bool) { 6173 return nil, false 6174} 6175 6176// AsCivicStructure is the BasicResponseBase implementation for LocalBusiness. 6177func (lb LocalBusiness) AsCivicStructure() (*CivicStructure, bool) { 6178 return nil, false 6179} 6180 6181// AsBasicCivicStructure is the BasicResponseBase implementation for LocalBusiness. 6182func (lb LocalBusiness) AsBasicCivicStructure() (BasicCivicStructure, bool) { 6183 return nil, false 6184} 6185 6186// AsLocalBusiness is the BasicResponseBase implementation for LocalBusiness. 6187func (lb LocalBusiness) AsLocalBusiness() (*LocalBusiness, bool) { 6188 return &lb, true 6189} 6190 6191// AsBasicLocalBusiness is the BasicResponseBase implementation for LocalBusiness. 6192func (lb LocalBusiness) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 6193 return &lb, true 6194} 6195 6196// AsTouristAttraction is the BasicResponseBase implementation for LocalBusiness. 6197func (lb LocalBusiness) AsTouristAttraction() (*TouristAttraction, bool) { 6198 return nil, false 6199} 6200 6201// AsAirport is the BasicResponseBase implementation for LocalBusiness. 6202func (lb LocalBusiness) AsAirport() (*Airport, bool) { 6203 return nil, false 6204} 6205 6206// AsLicense is the BasicResponseBase implementation for LocalBusiness. 6207func (lb LocalBusiness) AsLicense() (*License, bool) { 6208 return nil, false 6209} 6210 6211// AsStructuredValue is the BasicResponseBase implementation for LocalBusiness. 6212func (lb LocalBusiness) AsStructuredValue() (*StructuredValue, bool) { 6213 return nil, false 6214} 6215 6216// AsBasicStructuredValue is the BasicResponseBase implementation for LocalBusiness. 6217func (lb LocalBusiness) AsBasicStructuredValue() (BasicStructuredValue, bool) { 6218 return nil, false 6219} 6220 6221// AsEntertainmentBusiness is the BasicResponseBase implementation for LocalBusiness. 6222func (lb LocalBusiness) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 6223 return nil, false 6224} 6225 6226// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for LocalBusiness. 6227func (lb LocalBusiness) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 6228 return nil, false 6229} 6230 6231// AsFoodEstablishment is the BasicResponseBase implementation for LocalBusiness. 6232func (lb LocalBusiness) AsFoodEstablishment() (*FoodEstablishment, bool) { 6233 return nil, false 6234} 6235 6236// AsBasicFoodEstablishment is the BasicResponseBase implementation for LocalBusiness. 6237func (lb LocalBusiness) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 6238 return nil, false 6239} 6240 6241// AsLodgingBusiness is the BasicResponseBase implementation for LocalBusiness. 6242func (lb LocalBusiness) AsLodgingBusiness() (*LodgingBusiness, bool) { 6243 return nil, false 6244} 6245 6246// AsBasicLodgingBusiness is the BasicResponseBase implementation for LocalBusiness. 6247func (lb LocalBusiness) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 6248 return nil, false 6249} 6250 6251// AsRestaurant is the BasicResponseBase implementation for LocalBusiness. 6252func (lb LocalBusiness) AsRestaurant() (*Restaurant, bool) { 6253 return nil, false 6254} 6255 6256// AsHotel is the BasicResponseBase implementation for LocalBusiness. 6257func (lb LocalBusiness) AsHotel() (*Hotel, bool) { 6258 return nil, false 6259} 6260 6261// AsResponseBase is the BasicResponseBase implementation for LocalBusiness. 6262func (lb LocalBusiness) AsResponseBase() (*ResponseBase, bool) { 6263 return nil, false 6264} 6265 6266// AsBasicResponseBase is the BasicResponseBase implementation for LocalBusiness. 6267func (lb LocalBusiness) AsBasicResponseBase() (BasicResponseBase, bool) { 6268 return &lb, true 6269} 6270 6271// UnmarshalJSON is the custom unmarshaler for LocalBusiness struct. 6272func (lb *LocalBusiness) UnmarshalJSON(body []byte) error { 6273 var m map[string]*json.RawMessage 6274 err := json.Unmarshal(body, &m) 6275 if err != nil { 6276 return err 6277 } 6278 for k, v := range m { 6279 switch k { 6280 case "priceRange": 6281 if v != nil { 6282 var priceRange string 6283 err = json.Unmarshal(*v, &priceRange) 6284 if err != nil { 6285 return err 6286 } 6287 lb.PriceRange = &priceRange 6288 } 6289 case "panoramas": 6290 if v != nil { 6291 var panoramas []ImageObject 6292 err = json.Unmarshal(*v, &panoramas) 6293 if err != nil { 6294 return err 6295 } 6296 lb.Panoramas = &panoramas 6297 } 6298 case "isPermanentlyClosed": 6299 if v != nil { 6300 var isPermanentlyClosed bool 6301 err = json.Unmarshal(*v, &isPermanentlyClosed) 6302 if err != nil { 6303 return err 6304 } 6305 lb.IsPermanentlyClosed = &isPermanentlyClosed 6306 } 6307 case "tagLine": 6308 if v != nil { 6309 var tagLine string 6310 err = json.Unmarshal(*v, &tagLine) 6311 if err != nil { 6312 return err 6313 } 6314 lb.TagLine = &tagLine 6315 } 6316 case "address": 6317 if v != nil { 6318 var address PostalAddress 6319 err = json.Unmarshal(*v, &address) 6320 if err != nil { 6321 return err 6322 } 6323 lb.Address = &address 6324 } 6325 case "telephone": 6326 if v != nil { 6327 var telephone string 6328 err = json.Unmarshal(*v, &telephone) 6329 if err != nil { 6330 return err 6331 } 6332 lb.Telephone = &telephone 6333 } 6334 case "name": 6335 if v != nil { 6336 var name string 6337 err = json.Unmarshal(*v, &name) 6338 if err != nil { 6339 return err 6340 } 6341 lb.Name = &name 6342 } 6343 case "url": 6344 if v != nil { 6345 var URL string 6346 err = json.Unmarshal(*v, &URL) 6347 if err != nil { 6348 return err 6349 } 6350 lb.URL = &URL 6351 } 6352 case "image": 6353 if v != nil { 6354 var imageVar ImageObject 6355 err = json.Unmarshal(*v, &imageVar) 6356 if err != nil { 6357 return err 6358 } 6359 lb.Image = &imageVar 6360 } 6361 case "description": 6362 if v != nil { 6363 var description string 6364 err = json.Unmarshal(*v, &description) 6365 if err != nil { 6366 return err 6367 } 6368 lb.Description = &description 6369 } 6370 case "entityPresentationInfo": 6371 if v != nil { 6372 var entityPresentationInfo EntitiesEntityPresentationInfo 6373 err = json.Unmarshal(*v, &entityPresentationInfo) 6374 if err != nil { 6375 return err 6376 } 6377 lb.EntityPresentationInfo = &entityPresentationInfo 6378 } 6379 case "bingId": 6380 if v != nil { 6381 var bingID string 6382 err = json.Unmarshal(*v, &bingID) 6383 if err != nil { 6384 return err 6385 } 6386 lb.BingID = &bingID 6387 } 6388 case "contractualRules": 6389 if v != nil { 6390 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 6391 if err != nil { 6392 return err 6393 } 6394 lb.ContractualRules = &contractualRules 6395 } 6396 case "webSearchUrl": 6397 if v != nil { 6398 var webSearchURL string 6399 err = json.Unmarshal(*v, &webSearchURL) 6400 if err != nil { 6401 return err 6402 } 6403 lb.WebSearchURL = &webSearchURL 6404 } 6405 case "id": 6406 if v != nil { 6407 var ID string 6408 err = json.Unmarshal(*v, &ID) 6409 if err != nil { 6410 return err 6411 } 6412 lb.ID = &ID 6413 } 6414 case "_type": 6415 if v != nil { 6416 var typeVar TypeBasicResponseBase 6417 err = json.Unmarshal(*v, &typeVar) 6418 if err != nil { 6419 return err 6420 } 6421 lb.Type = typeVar 6422 } 6423 } 6424 } 6425 6426 return nil 6427} 6428 6429// BasicLodgingBusiness ... 6430type BasicLodgingBusiness interface { 6431 AsHotel() (*Hotel, bool) 6432 AsLodgingBusiness() (*LodgingBusiness, bool) 6433} 6434 6435// LodgingBusiness ... 6436type LodgingBusiness struct { 6437 // PriceRange - READ-ONLY; $$. 6438 PriceRange *string `json:"priceRange,omitempty"` 6439 // Panoramas - READ-ONLY 6440 Panoramas *[]ImageObject `json:"panoramas,omitempty"` 6441 // IsPermanentlyClosed - READ-ONLY 6442 IsPermanentlyClosed *bool `json:"isPermanentlyClosed,omitempty"` 6443 // TagLine - READ-ONLY 6444 TagLine *string `json:"tagLine,omitempty"` 6445 // Address - READ-ONLY; The postal address of where the entity is located 6446 Address *PostalAddress `json:"address,omitempty"` 6447 // Telephone - READ-ONLY; The entity's telephone number 6448 Telephone *string `json:"telephone,omitempty"` 6449 // Name - READ-ONLY; The name of the thing represented by this object. 6450 Name *string `json:"name,omitempty"` 6451 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 6452 URL *string `json:"url,omitempty"` 6453 // Image - READ-ONLY 6454 Image *ImageObject `json:"image,omitempty"` 6455 // Description - READ-ONLY; A short description of the item. 6456 Description *string `json:"description,omitempty"` 6457 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 6458 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 6459 // BingID - READ-ONLY; An ID that uniquely identifies this item. 6460 BingID *string `json:"bingId,omitempty"` 6461 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 6462 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 6463 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 6464 WebSearchURL *string `json:"webSearchUrl,omitempty"` 6465 // ID - READ-ONLY; A String identifier. 6466 ID *string `json:"id,omitempty"` 6467 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 6468 Type TypeBasicResponseBase `json:"_type,omitempty"` 6469} 6470 6471func unmarshalBasicLodgingBusiness(body []byte) (BasicLodgingBusiness, error) { 6472 var m map[string]interface{} 6473 err := json.Unmarshal(body, &m) 6474 if err != nil { 6475 return nil, err 6476 } 6477 6478 switch m["_type"] { 6479 case string(TypeHotel): 6480 var h Hotel 6481 err := json.Unmarshal(body, &h) 6482 return h, err 6483 default: 6484 var lb LodgingBusiness 6485 err := json.Unmarshal(body, &lb) 6486 return lb, err 6487 } 6488} 6489func unmarshalBasicLodgingBusinessArray(body []byte) ([]BasicLodgingBusiness, error) { 6490 var rawMessages []*json.RawMessage 6491 err := json.Unmarshal(body, &rawMessages) 6492 if err != nil { 6493 return nil, err 6494 } 6495 6496 lbArray := make([]BasicLodgingBusiness, len(rawMessages)) 6497 6498 for index, rawMessage := range rawMessages { 6499 lb, err := unmarshalBasicLodgingBusiness(*rawMessage) 6500 if err != nil { 6501 return nil, err 6502 } 6503 lbArray[index] = lb 6504 } 6505 return lbArray, nil 6506} 6507 6508// MarshalJSON is the custom marshaler for LodgingBusiness. 6509func (lb LodgingBusiness) MarshalJSON() ([]byte, error) { 6510 lb.Type = TypeLodgingBusiness 6511 objectMap := make(map[string]interface{}) 6512 if lb.Type != "" { 6513 objectMap["_type"] = lb.Type 6514 } 6515 return json.Marshal(objectMap) 6516} 6517 6518// AsImageObject is the BasicResponseBase implementation for LodgingBusiness. 6519func (lb LodgingBusiness) AsImageObject() (*ImageObject, bool) { 6520 return nil, false 6521} 6522 6523// AsThing is the BasicResponseBase implementation for LodgingBusiness. 6524func (lb LodgingBusiness) AsThing() (*Thing, bool) { 6525 return nil, false 6526} 6527 6528// AsBasicThing is the BasicResponseBase implementation for LodgingBusiness. 6529func (lb LodgingBusiness) AsBasicThing() (BasicThing, bool) { 6530 return &lb, true 6531} 6532 6533// AsEntities is the BasicResponseBase implementation for LodgingBusiness. 6534func (lb LodgingBusiness) AsEntities() (*Entities, bool) { 6535 return nil, false 6536} 6537 6538// AsPlaces is the BasicResponseBase implementation for LodgingBusiness. 6539func (lb LodgingBusiness) AsPlaces() (*Places, bool) { 6540 return nil, false 6541} 6542 6543// AsSearchResponse is the BasicResponseBase implementation for LodgingBusiness. 6544func (lb LodgingBusiness) AsSearchResponse() (*SearchResponse, bool) { 6545 return nil, false 6546} 6547 6548// AsResponse is the BasicResponseBase implementation for LodgingBusiness. 6549func (lb LodgingBusiness) AsResponse() (*Response, bool) { 6550 return nil, false 6551} 6552 6553// AsBasicResponse is the BasicResponseBase implementation for LodgingBusiness. 6554func (lb LodgingBusiness) AsBasicResponse() (BasicResponse, bool) { 6555 return &lb, true 6556} 6557 6558// AsSearchResultsAnswer is the BasicResponseBase implementation for LodgingBusiness. 6559func (lb LodgingBusiness) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 6560 return nil, false 6561} 6562 6563// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for LodgingBusiness. 6564func (lb LodgingBusiness) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 6565 return nil, false 6566} 6567 6568// AsIdentifiable is the BasicResponseBase implementation for LodgingBusiness. 6569func (lb LodgingBusiness) AsIdentifiable() (*Identifiable, bool) { 6570 return nil, false 6571} 6572 6573// AsBasicIdentifiable is the BasicResponseBase implementation for LodgingBusiness. 6574func (lb LodgingBusiness) AsBasicIdentifiable() (BasicIdentifiable, bool) { 6575 return &lb, true 6576} 6577 6578// AsAnswer is the BasicResponseBase implementation for LodgingBusiness. 6579func (lb LodgingBusiness) AsAnswer() (*Answer, bool) { 6580 return nil, false 6581} 6582 6583// AsBasicAnswer is the BasicResponseBase implementation for LodgingBusiness. 6584func (lb LodgingBusiness) AsBasicAnswer() (BasicAnswer, bool) { 6585 return nil, false 6586} 6587 6588// AsErrorResponse is the BasicResponseBase implementation for LodgingBusiness. 6589func (lb LodgingBusiness) AsErrorResponse() (*ErrorResponse, bool) { 6590 return nil, false 6591} 6592 6593// AsPostalAddress is the BasicResponseBase implementation for LodgingBusiness. 6594func (lb LodgingBusiness) AsPostalAddress() (*PostalAddress, bool) { 6595 return nil, false 6596} 6597 6598// AsPlace is the BasicResponseBase implementation for LodgingBusiness. 6599func (lb LodgingBusiness) AsPlace() (*Place, bool) { 6600 return nil, false 6601} 6602 6603// AsBasicPlace is the BasicResponseBase implementation for LodgingBusiness. 6604func (lb LodgingBusiness) AsBasicPlace() (BasicPlace, bool) { 6605 return &lb, true 6606} 6607 6608// AsOrganization is the BasicResponseBase implementation for LodgingBusiness. 6609func (lb LodgingBusiness) AsOrganization() (*Organization, bool) { 6610 return nil, false 6611} 6612 6613// AsCreativeWork is the BasicResponseBase implementation for LodgingBusiness. 6614func (lb LodgingBusiness) AsCreativeWork() (*CreativeWork, bool) { 6615 return nil, false 6616} 6617 6618// AsBasicCreativeWork is the BasicResponseBase implementation for LodgingBusiness. 6619func (lb LodgingBusiness) AsBasicCreativeWork() (BasicCreativeWork, bool) { 6620 return nil, false 6621} 6622 6623// AsIntangible is the BasicResponseBase implementation for LodgingBusiness. 6624func (lb LodgingBusiness) AsIntangible() (*Intangible, bool) { 6625 return nil, false 6626} 6627 6628// AsBasicIntangible is the BasicResponseBase implementation for LodgingBusiness. 6629func (lb LodgingBusiness) AsBasicIntangible() (BasicIntangible, bool) { 6630 return nil, false 6631} 6632 6633// AsMovieTheater is the BasicResponseBase implementation for LodgingBusiness. 6634func (lb LodgingBusiness) AsMovieTheater() (*MovieTheater, bool) { 6635 return nil, false 6636} 6637 6638// AsMediaObject is the BasicResponseBase implementation for LodgingBusiness. 6639func (lb LodgingBusiness) AsMediaObject() (*MediaObject, bool) { 6640 return nil, false 6641} 6642 6643// AsBasicMediaObject is the BasicResponseBase implementation for LodgingBusiness. 6644func (lb LodgingBusiness) AsBasicMediaObject() (BasicMediaObject, bool) { 6645 return nil, false 6646} 6647 6648// AsCivicStructure is the BasicResponseBase implementation for LodgingBusiness. 6649func (lb LodgingBusiness) AsCivicStructure() (*CivicStructure, bool) { 6650 return nil, false 6651} 6652 6653// AsBasicCivicStructure is the BasicResponseBase implementation for LodgingBusiness. 6654func (lb LodgingBusiness) AsBasicCivicStructure() (BasicCivicStructure, bool) { 6655 return nil, false 6656} 6657 6658// AsLocalBusiness is the BasicResponseBase implementation for LodgingBusiness. 6659func (lb LodgingBusiness) AsLocalBusiness() (*LocalBusiness, bool) { 6660 return nil, false 6661} 6662 6663// AsBasicLocalBusiness is the BasicResponseBase implementation for LodgingBusiness. 6664func (lb LodgingBusiness) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 6665 return &lb, true 6666} 6667 6668// AsTouristAttraction is the BasicResponseBase implementation for LodgingBusiness. 6669func (lb LodgingBusiness) AsTouristAttraction() (*TouristAttraction, bool) { 6670 return nil, false 6671} 6672 6673// AsAirport is the BasicResponseBase implementation for LodgingBusiness. 6674func (lb LodgingBusiness) AsAirport() (*Airport, bool) { 6675 return nil, false 6676} 6677 6678// AsLicense is the BasicResponseBase implementation for LodgingBusiness. 6679func (lb LodgingBusiness) AsLicense() (*License, bool) { 6680 return nil, false 6681} 6682 6683// AsStructuredValue is the BasicResponseBase implementation for LodgingBusiness. 6684func (lb LodgingBusiness) AsStructuredValue() (*StructuredValue, bool) { 6685 return nil, false 6686} 6687 6688// AsBasicStructuredValue is the BasicResponseBase implementation for LodgingBusiness. 6689func (lb LodgingBusiness) AsBasicStructuredValue() (BasicStructuredValue, bool) { 6690 return nil, false 6691} 6692 6693// AsEntertainmentBusiness is the BasicResponseBase implementation for LodgingBusiness. 6694func (lb LodgingBusiness) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 6695 return nil, false 6696} 6697 6698// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for LodgingBusiness. 6699func (lb LodgingBusiness) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 6700 return nil, false 6701} 6702 6703// AsFoodEstablishment is the BasicResponseBase implementation for LodgingBusiness. 6704func (lb LodgingBusiness) AsFoodEstablishment() (*FoodEstablishment, bool) { 6705 return nil, false 6706} 6707 6708// AsBasicFoodEstablishment is the BasicResponseBase implementation for LodgingBusiness. 6709func (lb LodgingBusiness) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 6710 return nil, false 6711} 6712 6713// AsLodgingBusiness is the BasicResponseBase implementation for LodgingBusiness. 6714func (lb LodgingBusiness) AsLodgingBusiness() (*LodgingBusiness, bool) { 6715 return &lb, true 6716} 6717 6718// AsBasicLodgingBusiness is the BasicResponseBase implementation for LodgingBusiness. 6719func (lb LodgingBusiness) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 6720 return &lb, true 6721} 6722 6723// AsRestaurant is the BasicResponseBase implementation for LodgingBusiness. 6724func (lb LodgingBusiness) AsRestaurant() (*Restaurant, bool) { 6725 return nil, false 6726} 6727 6728// AsHotel is the BasicResponseBase implementation for LodgingBusiness. 6729func (lb LodgingBusiness) AsHotel() (*Hotel, bool) { 6730 return nil, false 6731} 6732 6733// AsResponseBase is the BasicResponseBase implementation for LodgingBusiness. 6734func (lb LodgingBusiness) AsResponseBase() (*ResponseBase, bool) { 6735 return nil, false 6736} 6737 6738// AsBasicResponseBase is the BasicResponseBase implementation for LodgingBusiness. 6739func (lb LodgingBusiness) AsBasicResponseBase() (BasicResponseBase, bool) { 6740 return &lb, true 6741} 6742 6743// UnmarshalJSON is the custom unmarshaler for LodgingBusiness struct. 6744func (lb *LodgingBusiness) UnmarshalJSON(body []byte) error { 6745 var m map[string]*json.RawMessage 6746 err := json.Unmarshal(body, &m) 6747 if err != nil { 6748 return err 6749 } 6750 for k, v := range m { 6751 switch k { 6752 case "priceRange": 6753 if v != nil { 6754 var priceRange string 6755 err = json.Unmarshal(*v, &priceRange) 6756 if err != nil { 6757 return err 6758 } 6759 lb.PriceRange = &priceRange 6760 } 6761 case "panoramas": 6762 if v != nil { 6763 var panoramas []ImageObject 6764 err = json.Unmarshal(*v, &panoramas) 6765 if err != nil { 6766 return err 6767 } 6768 lb.Panoramas = &panoramas 6769 } 6770 case "isPermanentlyClosed": 6771 if v != nil { 6772 var isPermanentlyClosed bool 6773 err = json.Unmarshal(*v, &isPermanentlyClosed) 6774 if err != nil { 6775 return err 6776 } 6777 lb.IsPermanentlyClosed = &isPermanentlyClosed 6778 } 6779 case "tagLine": 6780 if v != nil { 6781 var tagLine string 6782 err = json.Unmarshal(*v, &tagLine) 6783 if err != nil { 6784 return err 6785 } 6786 lb.TagLine = &tagLine 6787 } 6788 case "address": 6789 if v != nil { 6790 var address PostalAddress 6791 err = json.Unmarshal(*v, &address) 6792 if err != nil { 6793 return err 6794 } 6795 lb.Address = &address 6796 } 6797 case "telephone": 6798 if v != nil { 6799 var telephone string 6800 err = json.Unmarshal(*v, &telephone) 6801 if err != nil { 6802 return err 6803 } 6804 lb.Telephone = &telephone 6805 } 6806 case "name": 6807 if v != nil { 6808 var name string 6809 err = json.Unmarshal(*v, &name) 6810 if err != nil { 6811 return err 6812 } 6813 lb.Name = &name 6814 } 6815 case "url": 6816 if v != nil { 6817 var URL string 6818 err = json.Unmarshal(*v, &URL) 6819 if err != nil { 6820 return err 6821 } 6822 lb.URL = &URL 6823 } 6824 case "image": 6825 if v != nil { 6826 var imageVar ImageObject 6827 err = json.Unmarshal(*v, &imageVar) 6828 if err != nil { 6829 return err 6830 } 6831 lb.Image = &imageVar 6832 } 6833 case "description": 6834 if v != nil { 6835 var description string 6836 err = json.Unmarshal(*v, &description) 6837 if err != nil { 6838 return err 6839 } 6840 lb.Description = &description 6841 } 6842 case "entityPresentationInfo": 6843 if v != nil { 6844 var entityPresentationInfo EntitiesEntityPresentationInfo 6845 err = json.Unmarshal(*v, &entityPresentationInfo) 6846 if err != nil { 6847 return err 6848 } 6849 lb.EntityPresentationInfo = &entityPresentationInfo 6850 } 6851 case "bingId": 6852 if v != nil { 6853 var bingID string 6854 err = json.Unmarshal(*v, &bingID) 6855 if err != nil { 6856 return err 6857 } 6858 lb.BingID = &bingID 6859 } 6860 case "contractualRules": 6861 if v != nil { 6862 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 6863 if err != nil { 6864 return err 6865 } 6866 lb.ContractualRules = &contractualRules 6867 } 6868 case "webSearchUrl": 6869 if v != nil { 6870 var webSearchURL string 6871 err = json.Unmarshal(*v, &webSearchURL) 6872 if err != nil { 6873 return err 6874 } 6875 lb.WebSearchURL = &webSearchURL 6876 } 6877 case "id": 6878 if v != nil { 6879 var ID string 6880 err = json.Unmarshal(*v, &ID) 6881 if err != nil { 6882 return err 6883 } 6884 lb.ID = &ID 6885 } 6886 case "_type": 6887 if v != nil { 6888 var typeVar TypeBasicResponseBase 6889 err = json.Unmarshal(*v, &typeVar) 6890 if err != nil { 6891 return err 6892 } 6893 lb.Type = typeVar 6894 } 6895 } 6896 } 6897 6898 return nil 6899} 6900 6901// BasicMediaObject ... 6902type BasicMediaObject interface { 6903 AsImageObject() (*ImageObject, bool) 6904 AsMediaObject() (*MediaObject, bool) 6905} 6906 6907// MediaObject ... 6908type MediaObject struct { 6909 // ContentURL - READ-ONLY; Original URL to retrieve the source (file) for the media object (e.g the source URL for the image). 6910 ContentURL *string `json:"contentUrl,omitempty"` 6911 // HostPageURL - READ-ONLY; URL of the page that hosts the media object. 6912 HostPageURL *string `json:"hostPageUrl,omitempty"` 6913 // Width - READ-ONLY; The width of the source media object, in pixels. 6914 Width *int32 `json:"width,omitempty"` 6915 // Height - READ-ONLY; The height of the source media object, in pixels. 6916 Height *int32 `json:"height,omitempty"` 6917 // ThumbnailURL - READ-ONLY; The URL to a thumbnail of the item. 6918 ThumbnailURL *string `json:"thumbnailUrl,omitempty"` 6919 // Provider - READ-ONLY; The source of the creative work. 6920 Provider *[]BasicThing `json:"provider,omitempty"` 6921 // Text - READ-ONLY 6922 Text *string `json:"text,omitempty"` 6923 // Name - READ-ONLY; The name of the thing represented by this object. 6924 Name *string `json:"name,omitempty"` 6925 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 6926 URL *string `json:"url,omitempty"` 6927 // Image - READ-ONLY 6928 Image *ImageObject `json:"image,omitempty"` 6929 // Description - READ-ONLY; A short description of the item. 6930 Description *string `json:"description,omitempty"` 6931 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 6932 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 6933 // BingID - READ-ONLY; An ID that uniquely identifies this item. 6934 BingID *string `json:"bingId,omitempty"` 6935 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 6936 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 6937 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 6938 WebSearchURL *string `json:"webSearchUrl,omitempty"` 6939 // ID - READ-ONLY; A String identifier. 6940 ID *string `json:"id,omitempty"` 6941 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 6942 Type TypeBasicResponseBase `json:"_type,omitempty"` 6943} 6944 6945func unmarshalBasicMediaObject(body []byte) (BasicMediaObject, error) { 6946 var m map[string]interface{} 6947 err := json.Unmarshal(body, &m) 6948 if err != nil { 6949 return nil, err 6950 } 6951 6952 switch m["_type"] { 6953 case string(TypeImageObject): 6954 var ioVar ImageObject 6955 err := json.Unmarshal(body, &ioVar) 6956 return ioVar, err 6957 default: 6958 var mo MediaObject 6959 err := json.Unmarshal(body, &mo) 6960 return mo, err 6961 } 6962} 6963func unmarshalBasicMediaObjectArray(body []byte) ([]BasicMediaObject, error) { 6964 var rawMessages []*json.RawMessage 6965 err := json.Unmarshal(body, &rawMessages) 6966 if err != nil { 6967 return nil, err 6968 } 6969 6970 moArray := make([]BasicMediaObject, len(rawMessages)) 6971 6972 for index, rawMessage := range rawMessages { 6973 mo, err := unmarshalBasicMediaObject(*rawMessage) 6974 if err != nil { 6975 return nil, err 6976 } 6977 moArray[index] = mo 6978 } 6979 return moArray, nil 6980} 6981 6982// MarshalJSON is the custom marshaler for MediaObject. 6983func (mo MediaObject) MarshalJSON() ([]byte, error) { 6984 mo.Type = TypeMediaObject 6985 objectMap := make(map[string]interface{}) 6986 if mo.Type != "" { 6987 objectMap["_type"] = mo.Type 6988 } 6989 return json.Marshal(objectMap) 6990} 6991 6992// AsImageObject is the BasicResponseBase implementation for MediaObject. 6993func (mo MediaObject) AsImageObject() (*ImageObject, bool) { 6994 return nil, false 6995} 6996 6997// AsThing is the BasicResponseBase implementation for MediaObject. 6998func (mo MediaObject) AsThing() (*Thing, bool) { 6999 return nil, false 7000} 7001 7002// AsBasicThing is the BasicResponseBase implementation for MediaObject. 7003func (mo MediaObject) AsBasicThing() (BasicThing, bool) { 7004 return &mo, true 7005} 7006 7007// AsEntities is the BasicResponseBase implementation for MediaObject. 7008func (mo MediaObject) AsEntities() (*Entities, bool) { 7009 return nil, false 7010} 7011 7012// AsPlaces is the BasicResponseBase implementation for MediaObject. 7013func (mo MediaObject) AsPlaces() (*Places, bool) { 7014 return nil, false 7015} 7016 7017// AsSearchResponse is the BasicResponseBase implementation for MediaObject. 7018func (mo MediaObject) AsSearchResponse() (*SearchResponse, bool) { 7019 return nil, false 7020} 7021 7022// AsResponse is the BasicResponseBase implementation for MediaObject. 7023func (mo MediaObject) AsResponse() (*Response, bool) { 7024 return nil, false 7025} 7026 7027// AsBasicResponse is the BasicResponseBase implementation for MediaObject. 7028func (mo MediaObject) AsBasicResponse() (BasicResponse, bool) { 7029 return &mo, true 7030} 7031 7032// AsSearchResultsAnswer is the BasicResponseBase implementation for MediaObject. 7033func (mo MediaObject) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 7034 return nil, false 7035} 7036 7037// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for MediaObject. 7038func (mo MediaObject) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 7039 return nil, false 7040} 7041 7042// AsIdentifiable is the BasicResponseBase implementation for MediaObject. 7043func (mo MediaObject) AsIdentifiable() (*Identifiable, bool) { 7044 return nil, false 7045} 7046 7047// AsBasicIdentifiable is the BasicResponseBase implementation for MediaObject. 7048func (mo MediaObject) AsBasicIdentifiable() (BasicIdentifiable, bool) { 7049 return &mo, true 7050} 7051 7052// AsAnswer is the BasicResponseBase implementation for MediaObject. 7053func (mo MediaObject) AsAnswer() (*Answer, bool) { 7054 return nil, false 7055} 7056 7057// AsBasicAnswer is the BasicResponseBase implementation for MediaObject. 7058func (mo MediaObject) AsBasicAnswer() (BasicAnswer, bool) { 7059 return nil, false 7060} 7061 7062// AsErrorResponse is the BasicResponseBase implementation for MediaObject. 7063func (mo MediaObject) AsErrorResponse() (*ErrorResponse, bool) { 7064 return nil, false 7065} 7066 7067// AsPostalAddress is the BasicResponseBase implementation for MediaObject. 7068func (mo MediaObject) AsPostalAddress() (*PostalAddress, bool) { 7069 return nil, false 7070} 7071 7072// AsPlace is the BasicResponseBase implementation for MediaObject. 7073func (mo MediaObject) AsPlace() (*Place, bool) { 7074 return nil, false 7075} 7076 7077// AsBasicPlace is the BasicResponseBase implementation for MediaObject. 7078func (mo MediaObject) AsBasicPlace() (BasicPlace, bool) { 7079 return nil, false 7080} 7081 7082// AsOrganization is the BasicResponseBase implementation for MediaObject. 7083func (mo MediaObject) AsOrganization() (*Organization, bool) { 7084 return nil, false 7085} 7086 7087// AsCreativeWork is the BasicResponseBase implementation for MediaObject. 7088func (mo MediaObject) AsCreativeWork() (*CreativeWork, bool) { 7089 return nil, false 7090} 7091 7092// AsBasicCreativeWork is the BasicResponseBase implementation for MediaObject. 7093func (mo MediaObject) AsBasicCreativeWork() (BasicCreativeWork, bool) { 7094 return &mo, true 7095} 7096 7097// AsIntangible is the BasicResponseBase implementation for MediaObject. 7098func (mo MediaObject) AsIntangible() (*Intangible, bool) { 7099 return nil, false 7100} 7101 7102// AsBasicIntangible is the BasicResponseBase implementation for MediaObject. 7103func (mo MediaObject) AsBasicIntangible() (BasicIntangible, bool) { 7104 return nil, false 7105} 7106 7107// AsMovieTheater is the BasicResponseBase implementation for MediaObject. 7108func (mo MediaObject) AsMovieTheater() (*MovieTheater, bool) { 7109 return nil, false 7110} 7111 7112// AsMediaObject is the BasicResponseBase implementation for MediaObject. 7113func (mo MediaObject) AsMediaObject() (*MediaObject, bool) { 7114 return &mo, true 7115} 7116 7117// AsBasicMediaObject is the BasicResponseBase implementation for MediaObject. 7118func (mo MediaObject) AsBasicMediaObject() (BasicMediaObject, bool) { 7119 return &mo, true 7120} 7121 7122// AsCivicStructure is the BasicResponseBase implementation for MediaObject. 7123func (mo MediaObject) AsCivicStructure() (*CivicStructure, bool) { 7124 return nil, false 7125} 7126 7127// AsBasicCivicStructure is the BasicResponseBase implementation for MediaObject. 7128func (mo MediaObject) AsBasicCivicStructure() (BasicCivicStructure, bool) { 7129 return nil, false 7130} 7131 7132// AsLocalBusiness is the BasicResponseBase implementation for MediaObject. 7133func (mo MediaObject) AsLocalBusiness() (*LocalBusiness, bool) { 7134 return nil, false 7135} 7136 7137// AsBasicLocalBusiness is the BasicResponseBase implementation for MediaObject. 7138func (mo MediaObject) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 7139 return nil, false 7140} 7141 7142// AsTouristAttraction is the BasicResponseBase implementation for MediaObject. 7143func (mo MediaObject) AsTouristAttraction() (*TouristAttraction, bool) { 7144 return nil, false 7145} 7146 7147// AsAirport is the BasicResponseBase implementation for MediaObject. 7148func (mo MediaObject) AsAirport() (*Airport, bool) { 7149 return nil, false 7150} 7151 7152// AsLicense is the BasicResponseBase implementation for MediaObject. 7153func (mo MediaObject) AsLicense() (*License, bool) { 7154 return nil, false 7155} 7156 7157// AsStructuredValue is the BasicResponseBase implementation for MediaObject. 7158func (mo MediaObject) AsStructuredValue() (*StructuredValue, bool) { 7159 return nil, false 7160} 7161 7162// AsBasicStructuredValue is the BasicResponseBase implementation for MediaObject. 7163func (mo MediaObject) AsBasicStructuredValue() (BasicStructuredValue, bool) { 7164 return nil, false 7165} 7166 7167// AsEntertainmentBusiness is the BasicResponseBase implementation for MediaObject. 7168func (mo MediaObject) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 7169 return nil, false 7170} 7171 7172// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for MediaObject. 7173func (mo MediaObject) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 7174 return nil, false 7175} 7176 7177// AsFoodEstablishment is the BasicResponseBase implementation for MediaObject. 7178func (mo MediaObject) AsFoodEstablishment() (*FoodEstablishment, bool) { 7179 return nil, false 7180} 7181 7182// AsBasicFoodEstablishment is the BasicResponseBase implementation for MediaObject. 7183func (mo MediaObject) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 7184 return nil, false 7185} 7186 7187// AsLodgingBusiness is the BasicResponseBase implementation for MediaObject. 7188func (mo MediaObject) AsLodgingBusiness() (*LodgingBusiness, bool) { 7189 return nil, false 7190} 7191 7192// AsBasicLodgingBusiness is the BasicResponseBase implementation for MediaObject. 7193func (mo MediaObject) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 7194 return nil, false 7195} 7196 7197// AsRestaurant is the BasicResponseBase implementation for MediaObject. 7198func (mo MediaObject) AsRestaurant() (*Restaurant, bool) { 7199 return nil, false 7200} 7201 7202// AsHotel is the BasicResponseBase implementation for MediaObject. 7203func (mo MediaObject) AsHotel() (*Hotel, bool) { 7204 return nil, false 7205} 7206 7207// AsResponseBase is the BasicResponseBase implementation for MediaObject. 7208func (mo MediaObject) AsResponseBase() (*ResponseBase, bool) { 7209 return nil, false 7210} 7211 7212// AsBasicResponseBase is the BasicResponseBase implementation for MediaObject. 7213func (mo MediaObject) AsBasicResponseBase() (BasicResponseBase, bool) { 7214 return &mo, true 7215} 7216 7217// UnmarshalJSON is the custom unmarshaler for MediaObject struct. 7218func (mo *MediaObject) UnmarshalJSON(body []byte) error { 7219 var m map[string]*json.RawMessage 7220 err := json.Unmarshal(body, &m) 7221 if err != nil { 7222 return err 7223 } 7224 for k, v := range m { 7225 switch k { 7226 case "contentUrl": 7227 if v != nil { 7228 var contentURL string 7229 err = json.Unmarshal(*v, &contentURL) 7230 if err != nil { 7231 return err 7232 } 7233 mo.ContentURL = &contentURL 7234 } 7235 case "hostPageUrl": 7236 if v != nil { 7237 var hostPageURL string 7238 err = json.Unmarshal(*v, &hostPageURL) 7239 if err != nil { 7240 return err 7241 } 7242 mo.HostPageURL = &hostPageURL 7243 } 7244 case "width": 7245 if v != nil { 7246 var width int32 7247 err = json.Unmarshal(*v, &width) 7248 if err != nil { 7249 return err 7250 } 7251 mo.Width = &width 7252 } 7253 case "height": 7254 if v != nil { 7255 var height int32 7256 err = json.Unmarshal(*v, &height) 7257 if err != nil { 7258 return err 7259 } 7260 mo.Height = &height 7261 } 7262 case "thumbnailUrl": 7263 if v != nil { 7264 var thumbnailURL string 7265 err = json.Unmarshal(*v, &thumbnailURL) 7266 if err != nil { 7267 return err 7268 } 7269 mo.ThumbnailURL = &thumbnailURL 7270 } 7271 case "provider": 7272 if v != nil { 7273 provider, err := unmarshalBasicThingArray(*v) 7274 if err != nil { 7275 return err 7276 } 7277 mo.Provider = &provider 7278 } 7279 case "text": 7280 if v != nil { 7281 var textVar string 7282 err = json.Unmarshal(*v, &textVar) 7283 if err != nil { 7284 return err 7285 } 7286 mo.Text = &textVar 7287 } 7288 case "name": 7289 if v != nil { 7290 var name string 7291 err = json.Unmarshal(*v, &name) 7292 if err != nil { 7293 return err 7294 } 7295 mo.Name = &name 7296 } 7297 case "url": 7298 if v != nil { 7299 var URL string 7300 err = json.Unmarshal(*v, &URL) 7301 if err != nil { 7302 return err 7303 } 7304 mo.URL = &URL 7305 } 7306 case "image": 7307 if v != nil { 7308 var imageVar ImageObject 7309 err = json.Unmarshal(*v, &imageVar) 7310 if err != nil { 7311 return err 7312 } 7313 mo.Image = &imageVar 7314 } 7315 case "description": 7316 if v != nil { 7317 var description string 7318 err = json.Unmarshal(*v, &description) 7319 if err != nil { 7320 return err 7321 } 7322 mo.Description = &description 7323 } 7324 case "entityPresentationInfo": 7325 if v != nil { 7326 var entityPresentationInfo EntitiesEntityPresentationInfo 7327 err = json.Unmarshal(*v, &entityPresentationInfo) 7328 if err != nil { 7329 return err 7330 } 7331 mo.EntityPresentationInfo = &entityPresentationInfo 7332 } 7333 case "bingId": 7334 if v != nil { 7335 var bingID string 7336 err = json.Unmarshal(*v, &bingID) 7337 if err != nil { 7338 return err 7339 } 7340 mo.BingID = &bingID 7341 } 7342 case "contractualRules": 7343 if v != nil { 7344 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 7345 if err != nil { 7346 return err 7347 } 7348 mo.ContractualRules = &contractualRules 7349 } 7350 case "webSearchUrl": 7351 if v != nil { 7352 var webSearchURL string 7353 err = json.Unmarshal(*v, &webSearchURL) 7354 if err != nil { 7355 return err 7356 } 7357 mo.WebSearchURL = &webSearchURL 7358 } 7359 case "id": 7360 if v != nil { 7361 var ID string 7362 err = json.Unmarshal(*v, &ID) 7363 if err != nil { 7364 return err 7365 } 7366 mo.ID = &ID 7367 } 7368 case "_type": 7369 if v != nil { 7370 var typeVar TypeBasicResponseBase 7371 err = json.Unmarshal(*v, &typeVar) 7372 if err != nil { 7373 return err 7374 } 7375 mo.Type = typeVar 7376 } 7377 } 7378 } 7379 7380 return nil 7381} 7382 7383// MovieTheater ... 7384type MovieTheater struct { 7385 // ScreenCount - READ-ONLY 7386 ScreenCount *int32 `json:"screenCount,omitempty"` 7387 // PriceRange - READ-ONLY; $$. 7388 PriceRange *string `json:"priceRange,omitempty"` 7389 // Panoramas - READ-ONLY 7390 Panoramas *[]ImageObject `json:"panoramas,omitempty"` 7391 // IsPermanentlyClosed - READ-ONLY 7392 IsPermanentlyClosed *bool `json:"isPermanentlyClosed,omitempty"` 7393 // TagLine - READ-ONLY 7394 TagLine *string `json:"tagLine,omitempty"` 7395 // Address - READ-ONLY; The postal address of where the entity is located 7396 Address *PostalAddress `json:"address,omitempty"` 7397 // Telephone - READ-ONLY; The entity's telephone number 7398 Telephone *string `json:"telephone,omitempty"` 7399 // Name - READ-ONLY; The name of the thing represented by this object. 7400 Name *string `json:"name,omitempty"` 7401 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 7402 URL *string `json:"url,omitempty"` 7403 // Image - READ-ONLY 7404 Image *ImageObject `json:"image,omitempty"` 7405 // Description - READ-ONLY; A short description of the item. 7406 Description *string `json:"description,omitempty"` 7407 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 7408 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 7409 // BingID - READ-ONLY; An ID that uniquely identifies this item. 7410 BingID *string `json:"bingId,omitempty"` 7411 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 7412 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 7413 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 7414 WebSearchURL *string `json:"webSearchUrl,omitempty"` 7415 // ID - READ-ONLY; A String identifier. 7416 ID *string `json:"id,omitempty"` 7417 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 7418 Type TypeBasicResponseBase `json:"_type,omitempty"` 7419} 7420 7421// MarshalJSON is the custom marshaler for MovieTheater. 7422func (mt MovieTheater) MarshalJSON() ([]byte, error) { 7423 mt.Type = TypeMovieTheater 7424 objectMap := make(map[string]interface{}) 7425 if mt.Type != "" { 7426 objectMap["_type"] = mt.Type 7427 } 7428 return json.Marshal(objectMap) 7429} 7430 7431// AsImageObject is the BasicResponseBase implementation for MovieTheater. 7432func (mt MovieTheater) AsImageObject() (*ImageObject, bool) { 7433 return nil, false 7434} 7435 7436// AsThing is the BasicResponseBase implementation for MovieTheater. 7437func (mt MovieTheater) AsThing() (*Thing, bool) { 7438 return nil, false 7439} 7440 7441// AsBasicThing is the BasicResponseBase implementation for MovieTheater. 7442func (mt MovieTheater) AsBasicThing() (BasicThing, bool) { 7443 return &mt, true 7444} 7445 7446// AsEntities is the BasicResponseBase implementation for MovieTheater. 7447func (mt MovieTheater) AsEntities() (*Entities, bool) { 7448 return nil, false 7449} 7450 7451// AsPlaces is the BasicResponseBase implementation for MovieTheater. 7452func (mt MovieTheater) AsPlaces() (*Places, bool) { 7453 return nil, false 7454} 7455 7456// AsSearchResponse is the BasicResponseBase implementation for MovieTheater. 7457func (mt MovieTheater) AsSearchResponse() (*SearchResponse, bool) { 7458 return nil, false 7459} 7460 7461// AsResponse is the BasicResponseBase implementation for MovieTheater. 7462func (mt MovieTheater) AsResponse() (*Response, bool) { 7463 return nil, false 7464} 7465 7466// AsBasicResponse is the BasicResponseBase implementation for MovieTheater. 7467func (mt MovieTheater) AsBasicResponse() (BasicResponse, bool) { 7468 return &mt, true 7469} 7470 7471// AsSearchResultsAnswer is the BasicResponseBase implementation for MovieTheater. 7472func (mt MovieTheater) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 7473 return nil, false 7474} 7475 7476// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for MovieTheater. 7477func (mt MovieTheater) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 7478 return nil, false 7479} 7480 7481// AsIdentifiable is the BasicResponseBase implementation for MovieTheater. 7482func (mt MovieTheater) AsIdentifiable() (*Identifiable, bool) { 7483 return nil, false 7484} 7485 7486// AsBasicIdentifiable is the BasicResponseBase implementation for MovieTheater. 7487func (mt MovieTheater) AsBasicIdentifiable() (BasicIdentifiable, bool) { 7488 return &mt, true 7489} 7490 7491// AsAnswer is the BasicResponseBase implementation for MovieTheater. 7492func (mt MovieTheater) AsAnswer() (*Answer, bool) { 7493 return nil, false 7494} 7495 7496// AsBasicAnswer is the BasicResponseBase implementation for MovieTheater. 7497func (mt MovieTheater) AsBasicAnswer() (BasicAnswer, bool) { 7498 return nil, false 7499} 7500 7501// AsErrorResponse is the BasicResponseBase implementation for MovieTheater. 7502func (mt MovieTheater) AsErrorResponse() (*ErrorResponse, bool) { 7503 return nil, false 7504} 7505 7506// AsPostalAddress is the BasicResponseBase implementation for MovieTheater. 7507func (mt MovieTheater) AsPostalAddress() (*PostalAddress, bool) { 7508 return nil, false 7509} 7510 7511// AsPlace is the BasicResponseBase implementation for MovieTheater. 7512func (mt MovieTheater) AsPlace() (*Place, bool) { 7513 return nil, false 7514} 7515 7516// AsBasicPlace is the BasicResponseBase implementation for MovieTheater. 7517func (mt MovieTheater) AsBasicPlace() (BasicPlace, bool) { 7518 return &mt, true 7519} 7520 7521// AsOrganization is the BasicResponseBase implementation for MovieTheater. 7522func (mt MovieTheater) AsOrganization() (*Organization, bool) { 7523 return nil, false 7524} 7525 7526// AsCreativeWork is the BasicResponseBase implementation for MovieTheater. 7527func (mt MovieTheater) AsCreativeWork() (*CreativeWork, bool) { 7528 return nil, false 7529} 7530 7531// AsBasicCreativeWork is the BasicResponseBase implementation for MovieTheater. 7532func (mt MovieTheater) AsBasicCreativeWork() (BasicCreativeWork, bool) { 7533 return nil, false 7534} 7535 7536// AsIntangible is the BasicResponseBase implementation for MovieTheater. 7537func (mt MovieTheater) AsIntangible() (*Intangible, bool) { 7538 return nil, false 7539} 7540 7541// AsBasicIntangible is the BasicResponseBase implementation for MovieTheater. 7542func (mt MovieTheater) AsBasicIntangible() (BasicIntangible, bool) { 7543 return nil, false 7544} 7545 7546// AsMovieTheater is the BasicResponseBase implementation for MovieTheater. 7547func (mt MovieTheater) AsMovieTheater() (*MovieTheater, bool) { 7548 return &mt, true 7549} 7550 7551// AsMediaObject is the BasicResponseBase implementation for MovieTheater. 7552func (mt MovieTheater) AsMediaObject() (*MediaObject, bool) { 7553 return nil, false 7554} 7555 7556// AsBasicMediaObject is the BasicResponseBase implementation for MovieTheater. 7557func (mt MovieTheater) AsBasicMediaObject() (BasicMediaObject, bool) { 7558 return nil, false 7559} 7560 7561// AsCivicStructure is the BasicResponseBase implementation for MovieTheater. 7562func (mt MovieTheater) AsCivicStructure() (*CivicStructure, bool) { 7563 return nil, false 7564} 7565 7566// AsBasicCivicStructure is the BasicResponseBase implementation for MovieTheater. 7567func (mt MovieTheater) AsBasicCivicStructure() (BasicCivicStructure, bool) { 7568 return nil, false 7569} 7570 7571// AsLocalBusiness is the BasicResponseBase implementation for MovieTheater. 7572func (mt MovieTheater) AsLocalBusiness() (*LocalBusiness, bool) { 7573 return nil, false 7574} 7575 7576// AsBasicLocalBusiness is the BasicResponseBase implementation for MovieTheater. 7577func (mt MovieTheater) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 7578 return &mt, true 7579} 7580 7581// AsTouristAttraction is the BasicResponseBase implementation for MovieTheater. 7582func (mt MovieTheater) AsTouristAttraction() (*TouristAttraction, bool) { 7583 return nil, false 7584} 7585 7586// AsAirport is the BasicResponseBase implementation for MovieTheater. 7587func (mt MovieTheater) AsAirport() (*Airport, bool) { 7588 return nil, false 7589} 7590 7591// AsLicense is the BasicResponseBase implementation for MovieTheater. 7592func (mt MovieTheater) AsLicense() (*License, bool) { 7593 return nil, false 7594} 7595 7596// AsStructuredValue is the BasicResponseBase implementation for MovieTheater. 7597func (mt MovieTheater) AsStructuredValue() (*StructuredValue, bool) { 7598 return nil, false 7599} 7600 7601// AsBasicStructuredValue is the BasicResponseBase implementation for MovieTheater. 7602func (mt MovieTheater) AsBasicStructuredValue() (BasicStructuredValue, bool) { 7603 return nil, false 7604} 7605 7606// AsEntertainmentBusiness is the BasicResponseBase implementation for MovieTheater. 7607func (mt MovieTheater) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 7608 return nil, false 7609} 7610 7611// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for MovieTheater. 7612func (mt MovieTheater) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 7613 return &mt, true 7614} 7615 7616// AsFoodEstablishment is the BasicResponseBase implementation for MovieTheater. 7617func (mt MovieTheater) AsFoodEstablishment() (*FoodEstablishment, bool) { 7618 return nil, false 7619} 7620 7621// AsBasicFoodEstablishment is the BasicResponseBase implementation for MovieTheater. 7622func (mt MovieTheater) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 7623 return nil, false 7624} 7625 7626// AsLodgingBusiness is the BasicResponseBase implementation for MovieTheater. 7627func (mt MovieTheater) AsLodgingBusiness() (*LodgingBusiness, bool) { 7628 return nil, false 7629} 7630 7631// AsBasicLodgingBusiness is the BasicResponseBase implementation for MovieTheater. 7632func (mt MovieTheater) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 7633 return nil, false 7634} 7635 7636// AsRestaurant is the BasicResponseBase implementation for MovieTheater. 7637func (mt MovieTheater) AsRestaurant() (*Restaurant, bool) { 7638 return nil, false 7639} 7640 7641// AsHotel is the BasicResponseBase implementation for MovieTheater. 7642func (mt MovieTheater) AsHotel() (*Hotel, bool) { 7643 return nil, false 7644} 7645 7646// AsResponseBase is the BasicResponseBase implementation for MovieTheater. 7647func (mt MovieTheater) AsResponseBase() (*ResponseBase, bool) { 7648 return nil, false 7649} 7650 7651// AsBasicResponseBase is the BasicResponseBase implementation for MovieTheater. 7652func (mt MovieTheater) AsBasicResponseBase() (BasicResponseBase, bool) { 7653 return &mt, true 7654} 7655 7656// UnmarshalJSON is the custom unmarshaler for MovieTheater struct. 7657func (mt *MovieTheater) UnmarshalJSON(body []byte) error { 7658 var m map[string]*json.RawMessage 7659 err := json.Unmarshal(body, &m) 7660 if err != nil { 7661 return err 7662 } 7663 for k, v := range m { 7664 switch k { 7665 case "screenCount": 7666 if v != nil { 7667 var screenCount int32 7668 err = json.Unmarshal(*v, &screenCount) 7669 if err != nil { 7670 return err 7671 } 7672 mt.ScreenCount = &screenCount 7673 } 7674 case "priceRange": 7675 if v != nil { 7676 var priceRange string 7677 err = json.Unmarshal(*v, &priceRange) 7678 if err != nil { 7679 return err 7680 } 7681 mt.PriceRange = &priceRange 7682 } 7683 case "panoramas": 7684 if v != nil { 7685 var panoramas []ImageObject 7686 err = json.Unmarshal(*v, &panoramas) 7687 if err != nil { 7688 return err 7689 } 7690 mt.Panoramas = &panoramas 7691 } 7692 case "isPermanentlyClosed": 7693 if v != nil { 7694 var isPermanentlyClosed bool 7695 err = json.Unmarshal(*v, &isPermanentlyClosed) 7696 if err != nil { 7697 return err 7698 } 7699 mt.IsPermanentlyClosed = &isPermanentlyClosed 7700 } 7701 case "tagLine": 7702 if v != nil { 7703 var tagLine string 7704 err = json.Unmarshal(*v, &tagLine) 7705 if err != nil { 7706 return err 7707 } 7708 mt.TagLine = &tagLine 7709 } 7710 case "address": 7711 if v != nil { 7712 var address PostalAddress 7713 err = json.Unmarshal(*v, &address) 7714 if err != nil { 7715 return err 7716 } 7717 mt.Address = &address 7718 } 7719 case "telephone": 7720 if v != nil { 7721 var telephone string 7722 err = json.Unmarshal(*v, &telephone) 7723 if err != nil { 7724 return err 7725 } 7726 mt.Telephone = &telephone 7727 } 7728 case "name": 7729 if v != nil { 7730 var name string 7731 err = json.Unmarshal(*v, &name) 7732 if err != nil { 7733 return err 7734 } 7735 mt.Name = &name 7736 } 7737 case "url": 7738 if v != nil { 7739 var URL string 7740 err = json.Unmarshal(*v, &URL) 7741 if err != nil { 7742 return err 7743 } 7744 mt.URL = &URL 7745 } 7746 case "image": 7747 if v != nil { 7748 var imageVar ImageObject 7749 err = json.Unmarshal(*v, &imageVar) 7750 if err != nil { 7751 return err 7752 } 7753 mt.Image = &imageVar 7754 } 7755 case "description": 7756 if v != nil { 7757 var description string 7758 err = json.Unmarshal(*v, &description) 7759 if err != nil { 7760 return err 7761 } 7762 mt.Description = &description 7763 } 7764 case "entityPresentationInfo": 7765 if v != nil { 7766 var entityPresentationInfo EntitiesEntityPresentationInfo 7767 err = json.Unmarshal(*v, &entityPresentationInfo) 7768 if err != nil { 7769 return err 7770 } 7771 mt.EntityPresentationInfo = &entityPresentationInfo 7772 } 7773 case "bingId": 7774 if v != nil { 7775 var bingID string 7776 err = json.Unmarshal(*v, &bingID) 7777 if err != nil { 7778 return err 7779 } 7780 mt.BingID = &bingID 7781 } 7782 case "contractualRules": 7783 if v != nil { 7784 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 7785 if err != nil { 7786 return err 7787 } 7788 mt.ContractualRules = &contractualRules 7789 } 7790 case "webSearchUrl": 7791 if v != nil { 7792 var webSearchURL string 7793 err = json.Unmarshal(*v, &webSearchURL) 7794 if err != nil { 7795 return err 7796 } 7797 mt.WebSearchURL = &webSearchURL 7798 } 7799 case "id": 7800 if v != nil { 7801 var ID string 7802 err = json.Unmarshal(*v, &ID) 7803 if err != nil { 7804 return err 7805 } 7806 mt.ID = &ID 7807 } 7808 case "_type": 7809 if v != nil { 7810 var typeVar TypeBasicResponseBase 7811 err = json.Unmarshal(*v, &typeVar) 7812 if err != nil { 7813 return err 7814 } 7815 mt.Type = typeVar 7816 } 7817 } 7818 } 7819 7820 return nil 7821} 7822 7823// Organization defines an organization. 7824type Organization struct { 7825 // Name - READ-ONLY; The name of the thing represented by this object. 7826 Name *string `json:"name,omitempty"` 7827 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 7828 URL *string `json:"url,omitempty"` 7829 // Image - READ-ONLY 7830 Image *ImageObject `json:"image,omitempty"` 7831 // Description - READ-ONLY; A short description of the item. 7832 Description *string `json:"description,omitempty"` 7833 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 7834 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 7835 // BingID - READ-ONLY; An ID that uniquely identifies this item. 7836 BingID *string `json:"bingId,omitempty"` 7837 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 7838 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 7839 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 7840 WebSearchURL *string `json:"webSearchUrl,omitempty"` 7841 // ID - READ-ONLY; A String identifier. 7842 ID *string `json:"id,omitempty"` 7843 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 7844 Type TypeBasicResponseBase `json:"_type,omitempty"` 7845} 7846 7847// MarshalJSON is the custom marshaler for Organization. 7848func (o Organization) MarshalJSON() ([]byte, error) { 7849 o.Type = TypeOrganization 7850 objectMap := make(map[string]interface{}) 7851 if o.Type != "" { 7852 objectMap["_type"] = o.Type 7853 } 7854 return json.Marshal(objectMap) 7855} 7856 7857// AsImageObject is the BasicResponseBase implementation for Organization. 7858func (o Organization) AsImageObject() (*ImageObject, bool) { 7859 return nil, false 7860} 7861 7862// AsThing is the BasicResponseBase implementation for Organization. 7863func (o Organization) AsThing() (*Thing, bool) { 7864 return nil, false 7865} 7866 7867// AsBasicThing is the BasicResponseBase implementation for Organization. 7868func (o Organization) AsBasicThing() (BasicThing, bool) { 7869 return &o, true 7870} 7871 7872// AsEntities is the BasicResponseBase implementation for Organization. 7873func (o Organization) AsEntities() (*Entities, bool) { 7874 return nil, false 7875} 7876 7877// AsPlaces is the BasicResponseBase implementation for Organization. 7878func (o Organization) AsPlaces() (*Places, bool) { 7879 return nil, false 7880} 7881 7882// AsSearchResponse is the BasicResponseBase implementation for Organization. 7883func (o Organization) AsSearchResponse() (*SearchResponse, bool) { 7884 return nil, false 7885} 7886 7887// AsResponse is the BasicResponseBase implementation for Organization. 7888func (o Organization) AsResponse() (*Response, bool) { 7889 return nil, false 7890} 7891 7892// AsBasicResponse is the BasicResponseBase implementation for Organization. 7893func (o Organization) AsBasicResponse() (BasicResponse, bool) { 7894 return &o, true 7895} 7896 7897// AsSearchResultsAnswer is the BasicResponseBase implementation for Organization. 7898func (o Organization) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 7899 return nil, false 7900} 7901 7902// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Organization. 7903func (o Organization) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 7904 return nil, false 7905} 7906 7907// AsIdentifiable is the BasicResponseBase implementation for Organization. 7908func (o Organization) AsIdentifiable() (*Identifiable, bool) { 7909 return nil, false 7910} 7911 7912// AsBasicIdentifiable is the BasicResponseBase implementation for Organization. 7913func (o Organization) AsBasicIdentifiable() (BasicIdentifiable, bool) { 7914 return &o, true 7915} 7916 7917// AsAnswer is the BasicResponseBase implementation for Organization. 7918func (o Organization) AsAnswer() (*Answer, bool) { 7919 return nil, false 7920} 7921 7922// AsBasicAnswer is the BasicResponseBase implementation for Organization. 7923func (o Organization) AsBasicAnswer() (BasicAnswer, bool) { 7924 return nil, false 7925} 7926 7927// AsErrorResponse is the BasicResponseBase implementation for Organization. 7928func (o Organization) AsErrorResponse() (*ErrorResponse, bool) { 7929 return nil, false 7930} 7931 7932// AsPostalAddress is the BasicResponseBase implementation for Organization. 7933func (o Organization) AsPostalAddress() (*PostalAddress, bool) { 7934 return nil, false 7935} 7936 7937// AsPlace is the BasicResponseBase implementation for Organization. 7938func (o Organization) AsPlace() (*Place, bool) { 7939 return nil, false 7940} 7941 7942// AsBasicPlace is the BasicResponseBase implementation for Organization. 7943func (o Organization) AsBasicPlace() (BasicPlace, bool) { 7944 return nil, false 7945} 7946 7947// AsOrganization is the BasicResponseBase implementation for Organization. 7948func (o Organization) AsOrganization() (*Organization, bool) { 7949 return &o, true 7950} 7951 7952// AsCreativeWork is the BasicResponseBase implementation for Organization. 7953func (o Organization) AsCreativeWork() (*CreativeWork, bool) { 7954 return nil, false 7955} 7956 7957// AsBasicCreativeWork is the BasicResponseBase implementation for Organization. 7958func (o Organization) AsBasicCreativeWork() (BasicCreativeWork, bool) { 7959 return nil, false 7960} 7961 7962// AsIntangible is the BasicResponseBase implementation for Organization. 7963func (o Organization) AsIntangible() (*Intangible, bool) { 7964 return nil, false 7965} 7966 7967// AsBasicIntangible is the BasicResponseBase implementation for Organization. 7968func (o Organization) AsBasicIntangible() (BasicIntangible, bool) { 7969 return nil, false 7970} 7971 7972// AsMovieTheater is the BasicResponseBase implementation for Organization. 7973func (o Organization) AsMovieTheater() (*MovieTheater, bool) { 7974 return nil, false 7975} 7976 7977// AsMediaObject is the BasicResponseBase implementation for Organization. 7978func (o Organization) AsMediaObject() (*MediaObject, bool) { 7979 return nil, false 7980} 7981 7982// AsBasicMediaObject is the BasicResponseBase implementation for Organization. 7983func (o Organization) AsBasicMediaObject() (BasicMediaObject, bool) { 7984 return nil, false 7985} 7986 7987// AsCivicStructure is the BasicResponseBase implementation for Organization. 7988func (o Organization) AsCivicStructure() (*CivicStructure, bool) { 7989 return nil, false 7990} 7991 7992// AsBasicCivicStructure is the BasicResponseBase implementation for Organization. 7993func (o Organization) AsBasicCivicStructure() (BasicCivicStructure, bool) { 7994 return nil, false 7995} 7996 7997// AsLocalBusiness is the BasicResponseBase implementation for Organization. 7998func (o Organization) AsLocalBusiness() (*LocalBusiness, bool) { 7999 return nil, false 8000} 8001 8002// AsBasicLocalBusiness is the BasicResponseBase implementation for Organization. 8003func (o Organization) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 8004 return nil, false 8005} 8006 8007// AsTouristAttraction is the BasicResponseBase implementation for Organization. 8008func (o Organization) AsTouristAttraction() (*TouristAttraction, bool) { 8009 return nil, false 8010} 8011 8012// AsAirport is the BasicResponseBase implementation for Organization. 8013func (o Organization) AsAirport() (*Airport, bool) { 8014 return nil, false 8015} 8016 8017// AsLicense is the BasicResponseBase implementation for Organization. 8018func (o Organization) AsLicense() (*License, bool) { 8019 return nil, false 8020} 8021 8022// AsStructuredValue is the BasicResponseBase implementation for Organization. 8023func (o Organization) AsStructuredValue() (*StructuredValue, bool) { 8024 return nil, false 8025} 8026 8027// AsBasicStructuredValue is the BasicResponseBase implementation for Organization. 8028func (o Organization) AsBasicStructuredValue() (BasicStructuredValue, bool) { 8029 return nil, false 8030} 8031 8032// AsEntertainmentBusiness is the BasicResponseBase implementation for Organization. 8033func (o Organization) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 8034 return nil, false 8035} 8036 8037// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for Organization. 8038func (o Organization) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 8039 return nil, false 8040} 8041 8042// AsFoodEstablishment is the BasicResponseBase implementation for Organization. 8043func (o Organization) AsFoodEstablishment() (*FoodEstablishment, bool) { 8044 return nil, false 8045} 8046 8047// AsBasicFoodEstablishment is the BasicResponseBase implementation for Organization. 8048func (o Organization) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 8049 return nil, false 8050} 8051 8052// AsLodgingBusiness is the BasicResponseBase implementation for Organization. 8053func (o Organization) AsLodgingBusiness() (*LodgingBusiness, bool) { 8054 return nil, false 8055} 8056 8057// AsBasicLodgingBusiness is the BasicResponseBase implementation for Organization. 8058func (o Organization) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 8059 return nil, false 8060} 8061 8062// AsRestaurant is the BasicResponseBase implementation for Organization. 8063func (o Organization) AsRestaurant() (*Restaurant, bool) { 8064 return nil, false 8065} 8066 8067// AsHotel is the BasicResponseBase implementation for Organization. 8068func (o Organization) AsHotel() (*Hotel, bool) { 8069 return nil, false 8070} 8071 8072// AsResponseBase is the BasicResponseBase implementation for Organization. 8073func (o Organization) AsResponseBase() (*ResponseBase, bool) { 8074 return nil, false 8075} 8076 8077// AsBasicResponseBase is the BasicResponseBase implementation for Organization. 8078func (o Organization) AsBasicResponseBase() (BasicResponseBase, bool) { 8079 return &o, true 8080} 8081 8082// UnmarshalJSON is the custom unmarshaler for Organization struct. 8083func (o *Organization) UnmarshalJSON(body []byte) error { 8084 var m map[string]*json.RawMessage 8085 err := json.Unmarshal(body, &m) 8086 if err != nil { 8087 return err 8088 } 8089 for k, v := range m { 8090 switch k { 8091 case "name": 8092 if v != nil { 8093 var name string 8094 err = json.Unmarshal(*v, &name) 8095 if err != nil { 8096 return err 8097 } 8098 o.Name = &name 8099 } 8100 case "url": 8101 if v != nil { 8102 var URL string 8103 err = json.Unmarshal(*v, &URL) 8104 if err != nil { 8105 return err 8106 } 8107 o.URL = &URL 8108 } 8109 case "image": 8110 if v != nil { 8111 var imageVar ImageObject 8112 err = json.Unmarshal(*v, &imageVar) 8113 if err != nil { 8114 return err 8115 } 8116 o.Image = &imageVar 8117 } 8118 case "description": 8119 if v != nil { 8120 var description string 8121 err = json.Unmarshal(*v, &description) 8122 if err != nil { 8123 return err 8124 } 8125 o.Description = &description 8126 } 8127 case "entityPresentationInfo": 8128 if v != nil { 8129 var entityPresentationInfo EntitiesEntityPresentationInfo 8130 err = json.Unmarshal(*v, &entityPresentationInfo) 8131 if err != nil { 8132 return err 8133 } 8134 o.EntityPresentationInfo = &entityPresentationInfo 8135 } 8136 case "bingId": 8137 if v != nil { 8138 var bingID string 8139 err = json.Unmarshal(*v, &bingID) 8140 if err != nil { 8141 return err 8142 } 8143 o.BingID = &bingID 8144 } 8145 case "contractualRules": 8146 if v != nil { 8147 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 8148 if err != nil { 8149 return err 8150 } 8151 o.ContractualRules = &contractualRules 8152 } 8153 case "webSearchUrl": 8154 if v != nil { 8155 var webSearchURL string 8156 err = json.Unmarshal(*v, &webSearchURL) 8157 if err != nil { 8158 return err 8159 } 8160 o.WebSearchURL = &webSearchURL 8161 } 8162 case "id": 8163 if v != nil { 8164 var ID string 8165 err = json.Unmarshal(*v, &ID) 8166 if err != nil { 8167 return err 8168 } 8169 o.ID = &ID 8170 } 8171 case "_type": 8172 if v != nil { 8173 var typeVar TypeBasicResponseBase 8174 err = json.Unmarshal(*v, &typeVar) 8175 if err != nil { 8176 return err 8177 } 8178 o.Type = typeVar 8179 } 8180 } 8181 } 8182 8183 return nil 8184} 8185 8186// BasicPlace defines information about a local entity, such as a restaurant or hotel. 8187type BasicPlace interface { 8188 AsMovieTheater() (*MovieTheater, bool) 8189 AsCivicStructure() (*CivicStructure, bool) 8190 AsBasicCivicStructure() (BasicCivicStructure, bool) 8191 AsLocalBusiness() (*LocalBusiness, bool) 8192 AsBasicLocalBusiness() (BasicLocalBusiness, bool) 8193 AsTouristAttraction() (*TouristAttraction, bool) 8194 AsAirport() (*Airport, bool) 8195 AsEntertainmentBusiness() (*EntertainmentBusiness, bool) 8196 AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) 8197 AsFoodEstablishment() (*FoodEstablishment, bool) 8198 AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) 8199 AsLodgingBusiness() (*LodgingBusiness, bool) 8200 AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) 8201 AsRestaurant() (*Restaurant, bool) 8202 AsHotel() (*Hotel, bool) 8203 AsPlace() (*Place, bool) 8204} 8205 8206// Place defines information about a local entity, such as a restaurant or hotel. 8207type Place struct { 8208 // Address - READ-ONLY; The postal address of where the entity is located 8209 Address *PostalAddress `json:"address,omitempty"` 8210 // Telephone - READ-ONLY; The entity's telephone number 8211 Telephone *string `json:"telephone,omitempty"` 8212 // Name - READ-ONLY; The name of the thing represented by this object. 8213 Name *string `json:"name,omitempty"` 8214 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 8215 URL *string `json:"url,omitempty"` 8216 // Image - READ-ONLY 8217 Image *ImageObject `json:"image,omitempty"` 8218 // Description - READ-ONLY; A short description of the item. 8219 Description *string `json:"description,omitempty"` 8220 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 8221 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 8222 // BingID - READ-ONLY; An ID that uniquely identifies this item. 8223 BingID *string `json:"bingId,omitempty"` 8224 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 8225 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 8226 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 8227 WebSearchURL *string `json:"webSearchUrl,omitempty"` 8228 // ID - READ-ONLY; A String identifier. 8229 ID *string `json:"id,omitempty"` 8230 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 8231 Type TypeBasicResponseBase `json:"_type,omitempty"` 8232} 8233 8234func unmarshalBasicPlace(body []byte) (BasicPlace, error) { 8235 var m map[string]interface{} 8236 err := json.Unmarshal(body, &m) 8237 if err != nil { 8238 return nil, err 8239 } 8240 8241 switch m["_type"] { 8242 case string(TypeMovieTheater): 8243 var mt MovieTheater 8244 err := json.Unmarshal(body, &mt) 8245 return mt, err 8246 case string(TypeCivicStructure): 8247 var cs CivicStructure 8248 err := json.Unmarshal(body, &cs) 8249 return cs, err 8250 case string(TypeLocalBusiness): 8251 var lb LocalBusiness 8252 err := json.Unmarshal(body, &lb) 8253 return lb, err 8254 case string(TypeTouristAttraction): 8255 var ta TouristAttraction 8256 err := json.Unmarshal(body, &ta) 8257 return ta, err 8258 case string(TypeAirport): 8259 var a Airport 8260 err := json.Unmarshal(body, &a) 8261 return a, err 8262 case string(TypeEntertainmentBusiness): 8263 var eb EntertainmentBusiness 8264 err := json.Unmarshal(body, &eb) 8265 return eb, err 8266 case string(TypeFoodEstablishment): 8267 var fe FoodEstablishment 8268 err := json.Unmarshal(body, &fe) 8269 return fe, err 8270 case string(TypeLodgingBusiness): 8271 var lb LodgingBusiness 8272 err := json.Unmarshal(body, &lb) 8273 return lb, err 8274 case string(TypeRestaurant): 8275 var r Restaurant 8276 err := json.Unmarshal(body, &r) 8277 return r, err 8278 case string(TypeHotel): 8279 var h Hotel 8280 err := json.Unmarshal(body, &h) 8281 return h, err 8282 default: 8283 var p Place 8284 err := json.Unmarshal(body, &p) 8285 return p, err 8286 } 8287} 8288func unmarshalBasicPlaceArray(body []byte) ([]BasicPlace, error) { 8289 var rawMessages []*json.RawMessage 8290 err := json.Unmarshal(body, &rawMessages) 8291 if err != nil { 8292 return nil, err 8293 } 8294 8295 pArray := make([]BasicPlace, len(rawMessages)) 8296 8297 for index, rawMessage := range rawMessages { 8298 p, err := unmarshalBasicPlace(*rawMessage) 8299 if err != nil { 8300 return nil, err 8301 } 8302 pArray[index] = p 8303 } 8304 return pArray, nil 8305} 8306 8307// MarshalJSON is the custom marshaler for Place. 8308func (p Place) MarshalJSON() ([]byte, error) { 8309 p.Type = TypePlace 8310 objectMap := make(map[string]interface{}) 8311 if p.Type != "" { 8312 objectMap["_type"] = p.Type 8313 } 8314 return json.Marshal(objectMap) 8315} 8316 8317// AsImageObject is the BasicResponseBase implementation for Place. 8318func (p Place) AsImageObject() (*ImageObject, bool) { 8319 return nil, false 8320} 8321 8322// AsThing is the BasicResponseBase implementation for Place. 8323func (p Place) AsThing() (*Thing, bool) { 8324 return nil, false 8325} 8326 8327// AsBasicThing is the BasicResponseBase implementation for Place. 8328func (p Place) AsBasicThing() (BasicThing, bool) { 8329 return &p, true 8330} 8331 8332// AsEntities is the BasicResponseBase implementation for Place. 8333func (p Place) AsEntities() (*Entities, bool) { 8334 return nil, false 8335} 8336 8337// AsPlaces is the BasicResponseBase implementation for Place. 8338func (p Place) AsPlaces() (*Places, bool) { 8339 return nil, false 8340} 8341 8342// AsSearchResponse is the BasicResponseBase implementation for Place. 8343func (p Place) AsSearchResponse() (*SearchResponse, bool) { 8344 return nil, false 8345} 8346 8347// AsResponse is the BasicResponseBase implementation for Place. 8348func (p Place) AsResponse() (*Response, bool) { 8349 return nil, false 8350} 8351 8352// AsBasicResponse is the BasicResponseBase implementation for Place. 8353func (p Place) AsBasicResponse() (BasicResponse, bool) { 8354 return &p, true 8355} 8356 8357// AsSearchResultsAnswer is the BasicResponseBase implementation for Place. 8358func (p Place) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 8359 return nil, false 8360} 8361 8362// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Place. 8363func (p Place) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 8364 return nil, false 8365} 8366 8367// AsIdentifiable is the BasicResponseBase implementation for Place. 8368func (p Place) AsIdentifiable() (*Identifiable, bool) { 8369 return nil, false 8370} 8371 8372// AsBasicIdentifiable is the BasicResponseBase implementation for Place. 8373func (p Place) AsBasicIdentifiable() (BasicIdentifiable, bool) { 8374 return &p, true 8375} 8376 8377// AsAnswer is the BasicResponseBase implementation for Place. 8378func (p Place) AsAnswer() (*Answer, bool) { 8379 return nil, false 8380} 8381 8382// AsBasicAnswer is the BasicResponseBase implementation for Place. 8383func (p Place) AsBasicAnswer() (BasicAnswer, bool) { 8384 return nil, false 8385} 8386 8387// AsErrorResponse is the BasicResponseBase implementation for Place. 8388func (p Place) AsErrorResponse() (*ErrorResponse, bool) { 8389 return nil, false 8390} 8391 8392// AsPostalAddress is the BasicResponseBase implementation for Place. 8393func (p Place) AsPostalAddress() (*PostalAddress, bool) { 8394 return nil, false 8395} 8396 8397// AsPlace is the BasicResponseBase implementation for Place. 8398func (p Place) AsPlace() (*Place, bool) { 8399 return &p, true 8400} 8401 8402// AsBasicPlace is the BasicResponseBase implementation for Place. 8403func (p Place) AsBasicPlace() (BasicPlace, bool) { 8404 return &p, true 8405} 8406 8407// AsOrganization is the BasicResponseBase implementation for Place. 8408func (p Place) AsOrganization() (*Organization, bool) { 8409 return nil, false 8410} 8411 8412// AsCreativeWork is the BasicResponseBase implementation for Place. 8413func (p Place) AsCreativeWork() (*CreativeWork, bool) { 8414 return nil, false 8415} 8416 8417// AsBasicCreativeWork is the BasicResponseBase implementation for Place. 8418func (p Place) AsBasicCreativeWork() (BasicCreativeWork, bool) { 8419 return nil, false 8420} 8421 8422// AsIntangible is the BasicResponseBase implementation for Place. 8423func (p Place) AsIntangible() (*Intangible, bool) { 8424 return nil, false 8425} 8426 8427// AsBasicIntangible is the BasicResponseBase implementation for Place. 8428func (p Place) AsBasicIntangible() (BasicIntangible, bool) { 8429 return nil, false 8430} 8431 8432// AsMovieTheater is the BasicResponseBase implementation for Place. 8433func (p Place) AsMovieTheater() (*MovieTheater, bool) { 8434 return nil, false 8435} 8436 8437// AsMediaObject is the BasicResponseBase implementation for Place. 8438func (p Place) AsMediaObject() (*MediaObject, bool) { 8439 return nil, false 8440} 8441 8442// AsBasicMediaObject is the BasicResponseBase implementation for Place. 8443func (p Place) AsBasicMediaObject() (BasicMediaObject, bool) { 8444 return nil, false 8445} 8446 8447// AsCivicStructure is the BasicResponseBase implementation for Place. 8448func (p Place) AsCivicStructure() (*CivicStructure, bool) { 8449 return nil, false 8450} 8451 8452// AsBasicCivicStructure is the BasicResponseBase implementation for Place. 8453func (p Place) AsBasicCivicStructure() (BasicCivicStructure, bool) { 8454 return nil, false 8455} 8456 8457// AsLocalBusiness is the BasicResponseBase implementation for Place. 8458func (p Place) AsLocalBusiness() (*LocalBusiness, bool) { 8459 return nil, false 8460} 8461 8462// AsBasicLocalBusiness is the BasicResponseBase implementation for Place. 8463func (p Place) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 8464 return nil, false 8465} 8466 8467// AsTouristAttraction is the BasicResponseBase implementation for Place. 8468func (p Place) AsTouristAttraction() (*TouristAttraction, bool) { 8469 return nil, false 8470} 8471 8472// AsAirport is the BasicResponseBase implementation for Place. 8473func (p Place) AsAirport() (*Airport, bool) { 8474 return nil, false 8475} 8476 8477// AsLicense is the BasicResponseBase implementation for Place. 8478func (p Place) AsLicense() (*License, bool) { 8479 return nil, false 8480} 8481 8482// AsStructuredValue is the BasicResponseBase implementation for Place. 8483func (p Place) AsStructuredValue() (*StructuredValue, bool) { 8484 return nil, false 8485} 8486 8487// AsBasicStructuredValue is the BasicResponseBase implementation for Place. 8488func (p Place) AsBasicStructuredValue() (BasicStructuredValue, bool) { 8489 return nil, false 8490} 8491 8492// AsEntertainmentBusiness is the BasicResponseBase implementation for Place. 8493func (p Place) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 8494 return nil, false 8495} 8496 8497// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for Place. 8498func (p Place) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 8499 return nil, false 8500} 8501 8502// AsFoodEstablishment is the BasicResponseBase implementation for Place. 8503func (p Place) AsFoodEstablishment() (*FoodEstablishment, bool) { 8504 return nil, false 8505} 8506 8507// AsBasicFoodEstablishment is the BasicResponseBase implementation for Place. 8508func (p Place) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 8509 return nil, false 8510} 8511 8512// AsLodgingBusiness is the BasicResponseBase implementation for Place. 8513func (p Place) AsLodgingBusiness() (*LodgingBusiness, bool) { 8514 return nil, false 8515} 8516 8517// AsBasicLodgingBusiness is the BasicResponseBase implementation for Place. 8518func (p Place) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 8519 return nil, false 8520} 8521 8522// AsRestaurant is the BasicResponseBase implementation for Place. 8523func (p Place) AsRestaurant() (*Restaurant, bool) { 8524 return nil, false 8525} 8526 8527// AsHotel is the BasicResponseBase implementation for Place. 8528func (p Place) AsHotel() (*Hotel, bool) { 8529 return nil, false 8530} 8531 8532// AsResponseBase is the BasicResponseBase implementation for Place. 8533func (p Place) AsResponseBase() (*ResponseBase, bool) { 8534 return nil, false 8535} 8536 8537// AsBasicResponseBase is the BasicResponseBase implementation for Place. 8538func (p Place) AsBasicResponseBase() (BasicResponseBase, bool) { 8539 return &p, true 8540} 8541 8542// UnmarshalJSON is the custom unmarshaler for Place struct. 8543func (p *Place) UnmarshalJSON(body []byte) error { 8544 var m map[string]*json.RawMessage 8545 err := json.Unmarshal(body, &m) 8546 if err != nil { 8547 return err 8548 } 8549 for k, v := range m { 8550 switch k { 8551 case "address": 8552 if v != nil { 8553 var address PostalAddress 8554 err = json.Unmarshal(*v, &address) 8555 if err != nil { 8556 return err 8557 } 8558 p.Address = &address 8559 } 8560 case "telephone": 8561 if v != nil { 8562 var telephone string 8563 err = json.Unmarshal(*v, &telephone) 8564 if err != nil { 8565 return err 8566 } 8567 p.Telephone = &telephone 8568 } 8569 case "name": 8570 if v != nil { 8571 var name string 8572 err = json.Unmarshal(*v, &name) 8573 if err != nil { 8574 return err 8575 } 8576 p.Name = &name 8577 } 8578 case "url": 8579 if v != nil { 8580 var URL string 8581 err = json.Unmarshal(*v, &URL) 8582 if err != nil { 8583 return err 8584 } 8585 p.URL = &URL 8586 } 8587 case "image": 8588 if v != nil { 8589 var imageVar ImageObject 8590 err = json.Unmarshal(*v, &imageVar) 8591 if err != nil { 8592 return err 8593 } 8594 p.Image = &imageVar 8595 } 8596 case "description": 8597 if v != nil { 8598 var description string 8599 err = json.Unmarshal(*v, &description) 8600 if err != nil { 8601 return err 8602 } 8603 p.Description = &description 8604 } 8605 case "entityPresentationInfo": 8606 if v != nil { 8607 var entityPresentationInfo EntitiesEntityPresentationInfo 8608 err = json.Unmarshal(*v, &entityPresentationInfo) 8609 if err != nil { 8610 return err 8611 } 8612 p.EntityPresentationInfo = &entityPresentationInfo 8613 } 8614 case "bingId": 8615 if v != nil { 8616 var bingID string 8617 err = json.Unmarshal(*v, &bingID) 8618 if err != nil { 8619 return err 8620 } 8621 p.BingID = &bingID 8622 } 8623 case "contractualRules": 8624 if v != nil { 8625 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 8626 if err != nil { 8627 return err 8628 } 8629 p.ContractualRules = &contractualRules 8630 } 8631 case "webSearchUrl": 8632 if v != nil { 8633 var webSearchURL string 8634 err = json.Unmarshal(*v, &webSearchURL) 8635 if err != nil { 8636 return err 8637 } 8638 p.WebSearchURL = &webSearchURL 8639 } 8640 case "id": 8641 if v != nil { 8642 var ID string 8643 err = json.Unmarshal(*v, &ID) 8644 if err != nil { 8645 return err 8646 } 8647 p.ID = &ID 8648 } 8649 case "_type": 8650 if v != nil { 8651 var typeVar TypeBasicResponseBase 8652 err = json.Unmarshal(*v, &typeVar) 8653 if err != nil { 8654 return err 8655 } 8656 p.Type = typeVar 8657 } 8658 } 8659 } 8660 8661 return nil 8662} 8663 8664// Places defines a local entity answer. 8665type Places struct { 8666 // Value - A list of local entities, such as restaurants or hotels. 8667 Value *[]BasicThing `json:"value,omitempty"` 8668 // QueryContext - READ-ONLY 8669 QueryContext *QueryContext `json:"queryContext,omitempty"` 8670 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 8671 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 8672 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 8673 WebSearchURL *string `json:"webSearchUrl,omitempty"` 8674 // ID - READ-ONLY; A String identifier. 8675 ID *string `json:"id,omitempty"` 8676 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 8677 Type TypeBasicResponseBase `json:"_type,omitempty"` 8678} 8679 8680// MarshalJSON is the custom marshaler for Places. 8681func (p Places) MarshalJSON() ([]byte, error) { 8682 p.Type = TypePlaces 8683 objectMap := make(map[string]interface{}) 8684 if p.Value != nil { 8685 objectMap["value"] = p.Value 8686 } 8687 if p.Type != "" { 8688 objectMap["_type"] = p.Type 8689 } 8690 return json.Marshal(objectMap) 8691} 8692 8693// AsImageObject is the BasicResponseBase implementation for Places. 8694func (p Places) AsImageObject() (*ImageObject, bool) { 8695 return nil, false 8696} 8697 8698// AsThing is the BasicResponseBase implementation for Places. 8699func (p Places) AsThing() (*Thing, bool) { 8700 return nil, false 8701} 8702 8703// AsBasicThing is the BasicResponseBase implementation for Places. 8704func (p Places) AsBasicThing() (BasicThing, bool) { 8705 return nil, false 8706} 8707 8708// AsEntities is the BasicResponseBase implementation for Places. 8709func (p Places) AsEntities() (*Entities, bool) { 8710 return nil, false 8711} 8712 8713// AsPlaces is the BasicResponseBase implementation for Places. 8714func (p Places) AsPlaces() (*Places, bool) { 8715 return &p, true 8716} 8717 8718// AsSearchResponse is the BasicResponseBase implementation for Places. 8719func (p Places) AsSearchResponse() (*SearchResponse, bool) { 8720 return nil, false 8721} 8722 8723// AsResponse is the BasicResponseBase implementation for Places. 8724func (p Places) AsResponse() (*Response, bool) { 8725 return nil, false 8726} 8727 8728// AsBasicResponse is the BasicResponseBase implementation for Places. 8729func (p Places) AsBasicResponse() (BasicResponse, bool) { 8730 return &p, true 8731} 8732 8733// AsSearchResultsAnswer is the BasicResponseBase implementation for Places. 8734func (p Places) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 8735 return nil, false 8736} 8737 8738// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Places. 8739func (p Places) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 8740 return &p, true 8741} 8742 8743// AsIdentifiable is the BasicResponseBase implementation for Places. 8744func (p Places) AsIdentifiable() (*Identifiable, bool) { 8745 return nil, false 8746} 8747 8748// AsBasicIdentifiable is the BasicResponseBase implementation for Places. 8749func (p Places) AsBasicIdentifiable() (BasicIdentifiable, bool) { 8750 return &p, true 8751} 8752 8753// AsAnswer is the BasicResponseBase implementation for Places. 8754func (p Places) AsAnswer() (*Answer, bool) { 8755 return nil, false 8756} 8757 8758// AsBasicAnswer is the BasicResponseBase implementation for Places. 8759func (p Places) AsBasicAnswer() (BasicAnswer, bool) { 8760 return &p, true 8761} 8762 8763// AsErrorResponse is the BasicResponseBase implementation for Places. 8764func (p Places) AsErrorResponse() (*ErrorResponse, bool) { 8765 return nil, false 8766} 8767 8768// AsPostalAddress is the BasicResponseBase implementation for Places. 8769func (p Places) AsPostalAddress() (*PostalAddress, bool) { 8770 return nil, false 8771} 8772 8773// AsPlace is the BasicResponseBase implementation for Places. 8774func (p Places) AsPlace() (*Place, bool) { 8775 return nil, false 8776} 8777 8778// AsBasicPlace is the BasicResponseBase implementation for Places. 8779func (p Places) AsBasicPlace() (BasicPlace, bool) { 8780 return nil, false 8781} 8782 8783// AsOrganization is the BasicResponseBase implementation for Places. 8784func (p Places) AsOrganization() (*Organization, bool) { 8785 return nil, false 8786} 8787 8788// AsCreativeWork is the BasicResponseBase implementation for Places. 8789func (p Places) AsCreativeWork() (*CreativeWork, bool) { 8790 return nil, false 8791} 8792 8793// AsBasicCreativeWork is the BasicResponseBase implementation for Places. 8794func (p Places) AsBasicCreativeWork() (BasicCreativeWork, bool) { 8795 return nil, false 8796} 8797 8798// AsIntangible is the BasicResponseBase implementation for Places. 8799func (p Places) AsIntangible() (*Intangible, bool) { 8800 return nil, false 8801} 8802 8803// AsBasicIntangible is the BasicResponseBase implementation for Places. 8804func (p Places) AsBasicIntangible() (BasicIntangible, bool) { 8805 return nil, false 8806} 8807 8808// AsMovieTheater is the BasicResponseBase implementation for Places. 8809func (p Places) AsMovieTheater() (*MovieTheater, bool) { 8810 return nil, false 8811} 8812 8813// AsMediaObject is the BasicResponseBase implementation for Places. 8814func (p Places) AsMediaObject() (*MediaObject, bool) { 8815 return nil, false 8816} 8817 8818// AsBasicMediaObject is the BasicResponseBase implementation for Places. 8819func (p Places) AsBasicMediaObject() (BasicMediaObject, bool) { 8820 return nil, false 8821} 8822 8823// AsCivicStructure is the BasicResponseBase implementation for Places. 8824func (p Places) AsCivicStructure() (*CivicStructure, bool) { 8825 return nil, false 8826} 8827 8828// AsBasicCivicStructure is the BasicResponseBase implementation for Places. 8829func (p Places) AsBasicCivicStructure() (BasicCivicStructure, bool) { 8830 return nil, false 8831} 8832 8833// AsLocalBusiness is the BasicResponseBase implementation for Places. 8834func (p Places) AsLocalBusiness() (*LocalBusiness, bool) { 8835 return nil, false 8836} 8837 8838// AsBasicLocalBusiness is the BasicResponseBase implementation for Places. 8839func (p Places) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 8840 return nil, false 8841} 8842 8843// AsTouristAttraction is the BasicResponseBase implementation for Places. 8844func (p Places) AsTouristAttraction() (*TouristAttraction, bool) { 8845 return nil, false 8846} 8847 8848// AsAirport is the BasicResponseBase implementation for Places. 8849func (p Places) AsAirport() (*Airport, bool) { 8850 return nil, false 8851} 8852 8853// AsLicense is the BasicResponseBase implementation for Places. 8854func (p Places) AsLicense() (*License, bool) { 8855 return nil, false 8856} 8857 8858// AsStructuredValue is the BasicResponseBase implementation for Places. 8859func (p Places) AsStructuredValue() (*StructuredValue, bool) { 8860 return nil, false 8861} 8862 8863// AsBasicStructuredValue is the BasicResponseBase implementation for Places. 8864func (p Places) AsBasicStructuredValue() (BasicStructuredValue, bool) { 8865 return nil, false 8866} 8867 8868// AsEntertainmentBusiness is the BasicResponseBase implementation for Places. 8869func (p Places) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 8870 return nil, false 8871} 8872 8873// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for Places. 8874func (p Places) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 8875 return nil, false 8876} 8877 8878// AsFoodEstablishment is the BasicResponseBase implementation for Places. 8879func (p Places) AsFoodEstablishment() (*FoodEstablishment, bool) { 8880 return nil, false 8881} 8882 8883// AsBasicFoodEstablishment is the BasicResponseBase implementation for Places. 8884func (p Places) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 8885 return nil, false 8886} 8887 8888// AsLodgingBusiness is the BasicResponseBase implementation for Places. 8889func (p Places) AsLodgingBusiness() (*LodgingBusiness, bool) { 8890 return nil, false 8891} 8892 8893// AsBasicLodgingBusiness is the BasicResponseBase implementation for Places. 8894func (p Places) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 8895 return nil, false 8896} 8897 8898// AsRestaurant is the BasicResponseBase implementation for Places. 8899func (p Places) AsRestaurant() (*Restaurant, bool) { 8900 return nil, false 8901} 8902 8903// AsHotel is the BasicResponseBase implementation for Places. 8904func (p Places) AsHotel() (*Hotel, bool) { 8905 return nil, false 8906} 8907 8908// AsResponseBase is the BasicResponseBase implementation for Places. 8909func (p Places) AsResponseBase() (*ResponseBase, bool) { 8910 return nil, false 8911} 8912 8913// AsBasicResponseBase is the BasicResponseBase implementation for Places. 8914func (p Places) AsBasicResponseBase() (BasicResponseBase, bool) { 8915 return &p, true 8916} 8917 8918// UnmarshalJSON is the custom unmarshaler for Places struct. 8919func (p *Places) UnmarshalJSON(body []byte) error { 8920 var m map[string]*json.RawMessage 8921 err := json.Unmarshal(body, &m) 8922 if err != nil { 8923 return err 8924 } 8925 for k, v := range m { 8926 switch k { 8927 case "value": 8928 if v != nil { 8929 value, err := unmarshalBasicThingArray(*v) 8930 if err != nil { 8931 return err 8932 } 8933 p.Value = &value 8934 } 8935 case "queryContext": 8936 if v != nil { 8937 var queryContext QueryContext 8938 err = json.Unmarshal(*v, &queryContext) 8939 if err != nil { 8940 return err 8941 } 8942 p.QueryContext = &queryContext 8943 } 8944 case "contractualRules": 8945 if v != nil { 8946 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 8947 if err != nil { 8948 return err 8949 } 8950 p.ContractualRules = &contractualRules 8951 } 8952 case "webSearchUrl": 8953 if v != nil { 8954 var webSearchURL string 8955 err = json.Unmarshal(*v, &webSearchURL) 8956 if err != nil { 8957 return err 8958 } 8959 p.WebSearchURL = &webSearchURL 8960 } 8961 case "id": 8962 if v != nil { 8963 var ID string 8964 err = json.Unmarshal(*v, &ID) 8965 if err != nil { 8966 return err 8967 } 8968 p.ID = &ID 8969 } 8970 case "_type": 8971 if v != nil { 8972 var typeVar TypeBasicResponseBase 8973 err = json.Unmarshal(*v, &typeVar) 8974 if err != nil { 8975 return err 8976 } 8977 p.Type = typeVar 8978 } 8979 } 8980 } 8981 8982 return nil 8983} 8984 8985// PostalAddress defines a postal address. 8986type PostalAddress struct { 8987 // StreetAddress - READ-ONLY 8988 StreetAddress *string `json:"streetAddress,omitempty"` 8989 // AddressLocality - READ-ONLY; The city where the street address is located. For example, Seattle. 8990 AddressLocality *string `json:"addressLocality,omitempty"` 8991 // AddressSubregion - READ-ONLY 8992 AddressSubregion *string `json:"addressSubregion,omitempty"` 8993 // AddressRegion - READ-ONLY; The state or province code where the street address is located. This could be the two-letter code. For example, WA, or the full name , Washington. 8994 AddressRegion *string `json:"addressRegion,omitempty"` 8995 // PostalCode - READ-ONLY; The zip code or postal code where the street address is located. For example, 98052. 8996 PostalCode *string `json:"postalCode,omitempty"` 8997 // PostOfficeBoxNumber - READ-ONLY 8998 PostOfficeBoxNumber *string `json:"postOfficeBoxNumber,omitempty"` 8999 // AddressCountry - READ-ONLY; The country/region where the street address is located. This could be the two-letter ISO code. For example, US, or the full name, United States. 9000 AddressCountry *string `json:"addressCountry,omitempty"` 9001 // CountryIso - READ-ONLY; The two letter ISO code of this country. For example, US. 9002 CountryIso *string `json:"countryIso,omitempty"` 9003 // Neighborhood - READ-ONLY; The neighborhood where the street address is located. For example, Westlake. 9004 Neighborhood *string `json:"neighborhood,omitempty"` 9005 // AddressRegionAbbreviation - READ-ONLY; Region Abbreviation. For example, WA. 9006 AddressRegionAbbreviation *string `json:"addressRegionAbbreviation,omitempty"` 9007 // Text - READ-ONLY; The complete address. For example, 2100 Westlake Ave N, Bellevue, WA 98052. 9008 Text *string `json:"text,omitempty"` 9009 // Name - READ-ONLY; The name of the thing represented by this object. 9010 Name *string `json:"name,omitempty"` 9011 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 9012 URL *string `json:"url,omitempty"` 9013 // Image - READ-ONLY 9014 Image *ImageObject `json:"image,omitempty"` 9015 // Description - READ-ONLY; A short description of the item. 9016 Description *string `json:"description,omitempty"` 9017 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 9018 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 9019 // BingID - READ-ONLY; An ID that uniquely identifies this item. 9020 BingID *string `json:"bingId,omitempty"` 9021 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 9022 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 9023 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 9024 WebSearchURL *string `json:"webSearchUrl,omitempty"` 9025 // ID - READ-ONLY; A String identifier. 9026 ID *string `json:"id,omitempty"` 9027 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 9028 Type TypeBasicResponseBase `json:"_type,omitempty"` 9029} 9030 9031// MarshalJSON is the custom marshaler for PostalAddress. 9032func (pa PostalAddress) MarshalJSON() ([]byte, error) { 9033 pa.Type = TypePostalAddress 9034 objectMap := make(map[string]interface{}) 9035 if pa.Type != "" { 9036 objectMap["_type"] = pa.Type 9037 } 9038 return json.Marshal(objectMap) 9039} 9040 9041// AsImageObject is the BasicResponseBase implementation for PostalAddress. 9042func (pa PostalAddress) AsImageObject() (*ImageObject, bool) { 9043 return nil, false 9044} 9045 9046// AsThing is the BasicResponseBase implementation for PostalAddress. 9047func (pa PostalAddress) AsThing() (*Thing, bool) { 9048 return nil, false 9049} 9050 9051// AsBasicThing is the BasicResponseBase implementation for PostalAddress. 9052func (pa PostalAddress) AsBasicThing() (BasicThing, bool) { 9053 return &pa, true 9054} 9055 9056// AsEntities is the BasicResponseBase implementation for PostalAddress. 9057func (pa PostalAddress) AsEntities() (*Entities, bool) { 9058 return nil, false 9059} 9060 9061// AsPlaces is the BasicResponseBase implementation for PostalAddress. 9062func (pa PostalAddress) AsPlaces() (*Places, bool) { 9063 return nil, false 9064} 9065 9066// AsSearchResponse is the BasicResponseBase implementation for PostalAddress. 9067func (pa PostalAddress) AsSearchResponse() (*SearchResponse, bool) { 9068 return nil, false 9069} 9070 9071// AsResponse is the BasicResponseBase implementation for PostalAddress. 9072func (pa PostalAddress) AsResponse() (*Response, bool) { 9073 return nil, false 9074} 9075 9076// AsBasicResponse is the BasicResponseBase implementation for PostalAddress. 9077func (pa PostalAddress) AsBasicResponse() (BasicResponse, bool) { 9078 return &pa, true 9079} 9080 9081// AsSearchResultsAnswer is the BasicResponseBase implementation for PostalAddress. 9082func (pa PostalAddress) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 9083 return nil, false 9084} 9085 9086// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for PostalAddress. 9087func (pa PostalAddress) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 9088 return nil, false 9089} 9090 9091// AsIdentifiable is the BasicResponseBase implementation for PostalAddress. 9092func (pa PostalAddress) AsIdentifiable() (*Identifiable, bool) { 9093 return nil, false 9094} 9095 9096// AsBasicIdentifiable is the BasicResponseBase implementation for PostalAddress. 9097func (pa PostalAddress) AsBasicIdentifiable() (BasicIdentifiable, bool) { 9098 return &pa, true 9099} 9100 9101// AsAnswer is the BasicResponseBase implementation for PostalAddress. 9102func (pa PostalAddress) AsAnswer() (*Answer, bool) { 9103 return nil, false 9104} 9105 9106// AsBasicAnswer is the BasicResponseBase implementation for PostalAddress. 9107func (pa PostalAddress) AsBasicAnswer() (BasicAnswer, bool) { 9108 return nil, false 9109} 9110 9111// AsErrorResponse is the BasicResponseBase implementation for PostalAddress. 9112func (pa PostalAddress) AsErrorResponse() (*ErrorResponse, bool) { 9113 return nil, false 9114} 9115 9116// AsPostalAddress is the BasicResponseBase implementation for PostalAddress. 9117func (pa PostalAddress) AsPostalAddress() (*PostalAddress, bool) { 9118 return &pa, true 9119} 9120 9121// AsPlace is the BasicResponseBase implementation for PostalAddress. 9122func (pa PostalAddress) AsPlace() (*Place, bool) { 9123 return nil, false 9124} 9125 9126// AsBasicPlace is the BasicResponseBase implementation for PostalAddress. 9127func (pa PostalAddress) AsBasicPlace() (BasicPlace, bool) { 9128 return nil, false 9129} 9130 9131// AsOrganization is the BasicResponseBase implementation for PostalAddress. 9132func (pa PostalAddress) AsOrganization() (*Organization, bool) { 9133 return nil, false 9134} 9135 9136// AsCreativeWork is the BasicResponseBase implementation for PostalAddress. 9137func (pa PostalAddress) AsCreativeWork() (*CreativeWork, bool) { 9138 return nil, false 9139} 9140 9141// AsBasicCreativeWork is the BasicResponseBase implementation for PostalAddress. 9142func (pa PostalAddress) AsBasicCreativeWork() (BasicCreativeWork, bool) { 9143 return nil, false 9144} 9145 9146// AsIntangible is the BasicResponseBase implementation for PostalAddress. 9147func (pa PostalAddress) AsIntangible() (*Intangible, bool) { 9148 return nil, false 9149} 9150 9151// AsBasicIntangible is the BasicResponseBase implementation for PostalAddress. 9152func (pa PostalAddress) AsBasicIntangible() (BasicIntangible, bool) { 9153 return &pa, true 9154} 9155 9156// AsMovieTheater is the BasicResponseBase implementation for PostalAddress. 9157func (pa PostalAddress) AsMovieTheater() (*MovieTheater, bool) { 9158 return nil, false 9159} 9160 9161// AsMediaObject is the BasicResponseBase implementation for PostalAddress. 9162func (pa PostalAddress) AsMediaObject() (*MediaObject, bool) { 9163 return nil, false 9164} 9165 9166// AsBasicMediaObject is the BasicResponseBase implementation for PostalAddress. 9167func (pa PostalAddress) AsBasicMediaObject() (BasicMediaObject, bool) { 9168 return nil, false 9169} 9170 9171// AsCivicStructure is the BasicResponseBase implementation for PostalAddress. 9172func (pa PostalAddress) AsCivicStructure() (*CivicStructure, bool) { 9173 return nil, false 9174} 9175 9176// AsBasicCivicStructure is the BasicResponseBase implementation for PostalAddress. 9177func (pa PostalAddress) AsBasicCivicStructure() (BasicCivicStructure, bool) { 9178 return nil, false 9179} 9180 9181// AsLocalBusiness is the BasicResponseBase implementation for PostalAddress. 9182func (pa PostalAddress) AsLocalBusiness() (*LocalBusiness, bool) { 9183 return nil, false 9184} 9185 9186// AsBasicLocalBusiness is the BasicResponseBase implementation for PostalAddress. 9187func (pa PostalAddress) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 9188 return nil, false 9189} 9190 9191// AsTouristAttraction is the BasicResponseBase implementation for PostalAddress. 9192func (pa PostalAddress) AsTouristAttraction() (*TouristAttraction, bool) { 9193 return nil, false 9194} 9195 9196// AsAirport is the BasicResponseBase implementation for PostalAddress. 9197func (pa PostalAddress) AsAirport() (*Airport, bool) { 9198 return nil, false 9199} 9200 9201// AsLicense is the BasicResponseBase implementation for PostalAddress. 9202func (pa PostalAddress) AsLicense() (*License, bool) { 9203 return nil, false 9204} 9205 9206// AsStructuredValue is the BasicResponseBase implementation for PostalAddress. 9207func (pa PostalAddress) AsStructuredValue() (*StructuredValue, bool) { 9208 return nil, false 9209} 9210 9211// AsBasicStructuredValue is the BasicResponseBase implementation for PostalAddress. 9212func (pa PostalAddress) AsBasicStructuredValue() (BasicStructuredValue, bool) { 9213 return &pa, true 9214} 9215 9216// AsEntertainmentBusiness is the BasicResponseBase implementation for PostalAddress. 9217func (pa PostalAddress) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 9218 return nil, false 9219} 9220 9221// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for PostalAddress. 9222func (pa PostalAddress) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 9223 return nil, false 9224} 9225 9226// AsFoodEstablishment is the BasicResponseBase implementation for PostalAddress. 9227func (pa PostalAddress) AsFoodEstablishment() (*FoodEstablishment, bool) { 9228 return nil, false 9229} 9230 9231// AsBasicFoodEstablishment is the BasicResponseBase implementation for PostalAddress. 9232func (pa PostalAddress) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 9233 return nil, false 9234} 9235 9236// AsLodgingBusiness is the BasicResponseBase implementation for PostalAddress. 9237func (pa PostalAddress) AsLodgingBusiness() (*LodgingBusiness, bool) { 9238 return nil, false 9239} 9240 9241// AsBasicLodgingBusiness is the BasicResponseBase implementation for PostalAddress. 9242func (pa PostalAddress) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 9243 return nil, false 9244} 9245 9246// AsRestaurant is the BasicResponseBase implementation for PostalAddress. 9247func (pa PostalAddress) AsRestaurant() (*Restaurant, bool) { 9248 return nil, false 9249} 9250 9251// AsHotel is the BasicResponseBase implementation for PostalAddress. 9252func (pa PostalAddress) AsHotel() (*Hotel, bool) { 9253 return nil, false 9254} 9255 9256// AsResponseBase is the BasicResponseBase implementation for PostalAddress. 9257func (pa PostalAddress) AsResponseBase() (*ResponseBase, bool) { 9258 return nil, false 9259} 9260 9261// AsBasicResponseBase is the BasicResponseBase implementation for PostalAddress. 9262func (pa PostalAddress) AsBasicResponseBase() (BasicResponseBase, bool) { 9263 return &pa, true 9264} 9265 9266// UnmarshalJSON is the custom unmarshaler for PostalAddress struct. 9267func (pa *PostalAddress) UnmarshalJSON(body []byte) error { 9268 var m map[string]*json.RawMessage 9269 err := json.Unmarshal(body, &m) 9270 if err != nil { 9271 return err 9272 } 9273 for k, v := range m { 9274 switch k { 9275 case "streetAddress": 9276 if v != nil { 9277 var streetAddress string 9278 err = json.Unmarshal(*v, &streetAddress) 9279 if err != nil { 9280 return err 9281 } 9282 pa.StreetAddress = &streetAddress 9283 } 9284 case "addressLocality": 9285 if v != nil { 9286 var addressLocality string 9287 err = json.Unmarshal(*v, &addressLocality) 9288 if err != nil { 9289 return err 9290 } 9291 pa.AddressLocality = &addressLocality 9292 } 9293 case "addressSubregion": 9294 if v != nil { 9295 var addressSubregion string 9296 err = json.Unmarshal(*v, &addressSubregion) 9297 if err != nil { 9298 return err 9299 } 9300 pa.AddressSubregion = &addressSubregion 9301 } 9302 case "addressRegion": 9303 if v != nil { 9304 var addressRegion string 9305 err = json.Unmarshal(*v, &addressRegion) 9306 if err != nil { 9307 return err 9308 } 9309 pa.AddressRegion = &addressRegion 9310 } 9311 case "postalCode": 9312 if v != nil { 9313 var postalCode string 9314 err = json.Unmarshal(*v, &postalCode) 9315 if err != nil { 9316 return err 9317 } 9318 pa.PostalCode = &postalCode 9319 } 9320 case "postOfficeBoxNumber": 9321 if v != nil { 9322 var postOfficeBoxNumber string 9323 err = json.Unmarshal(*v, &postOfficeBoxNumber) 9324 if err != nil { 9325 return err 9326 } 9327 pa.PostOfficeBoxNumber = &postOfficeBoxNumber 9328 } 9329 case "addressCountry": 9330 if v != nil { 9331 var addressCountry string 9332 err = json.Unmarshal(*v, &addressCountry) 9333 if err != nil { 9334 return err 9335 } 9336 pa.AddressCountry = &addressCountry 9337 } 9338 case "countryIso": 9339 if v != nil { 9340 var countryIso string 9341 err = json.Unmarshal(*v, &countryIso) 9342 if err != nil { 9343 return err 9344 } 9345 pa.CountryIso = &countryIso 9346 } 9347 case "neighborhood": 9348 if v != nil { 9349 var neighborhood string 9350 err = json.Unmarshal(*v, &neighborhood) 9351 if err != nil { 9352 return err 9353 } 9354 pa.Neighborhood = &neighborhood 9355 } 9356 case "addressRegionAbbreviation": 9357 if v != nil { 9358 var addressRegionAbbreviation string 9359 err = json.Unmarshal(*v, &addressRegionAbbreviation) 9360 if err != nil { 9361 return err 9362 } 9363 pa.AddressRegionAbbreviation = &addressRegionAbbreviation 9364 } 9365 case "text": 9366 if v != nil { 9367 var textVar string 9368 err = json.Unmarshal(*v, &textVar) 9369 if err != nil { 9370 return err 9371 } 9372 pa.Text = &textVar 9373 } 9374 case "name": 9375 if v != nil { 9376 var name string 9377 err = json.Unmarshal(*v, &name) 9378 if err != nil { 9379 return err 9380 } 9381 pa.Name = &name 9382 } 9383 case "url": 9384 if v != nil { 9385 var URL string 9386 err = json.Unmarshal(*v, &URL) 9387 if err != nil { 9388 return err 9389 } 9390 pa.URL = &URL 9391 } 9392 case "image": 9393 if v != nil { 9394 var imageVar ImageObject 9395 err = json.Unmarshal(*v, &imageVar) 9396 if err != nil { 9397 return err 9398 } 9399 pa.Image = &imageVar 9400 } 9401 case "description": 9402 if v != nil { 9403 var description string 9404 err = json.Unmarshal(*v, &description) 9405 if err != nil { 9406 return err 9407 } 9408 pa.Description = &description 9409 } 9410 case "entityPresentationInfo": 9411 if v != nil { 9412 var entityPresentationInfo EntitiesEntityPresentationInfo 9413 err = json.Unmarshal(*v, &entityPresentationInfo) 9414 if err != nil { 9415 return err 9416 } 9417 pa.EntityPresentationInfo = &entityPresentationInfo 9418 } 9419 case "bingId": 9420 if v != nil { 9421 var bingID string 9422 err = json.Unmarshal(*v, &bingID) 9423 if err != nil { 9424 return err 9425 } 9426 pa.BingID = &bingID 9427 } 9428 case "contractualRules": 9429 if v != nil { 9430 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 9431 if err != nil { 9432 return err 9433 } 9434 pa.ContractualRules = &contractualRules 9435 } 9436 case "webSearchUrl": 9437 if v != nil { 9438 var webSearchURL string 9439 err = json.Unmarshal(*v, &webSearchURL) 9440 if err != nil { 9441 return err 9442 } 9443 pa.WebSearchURL = &webSearchURL 9444 } 9445 case "id": 9446 if v != nil { 9447 var ID string 9448 err = json.Unmarshal(*v, &ID) 9449 if err != nil { 9450 return err 9451 } 9452 pa.ID = &ID 9453 } 9454 case "_type": 9455 if v != nil { 9456 var typeVar TypeBasicResponseBase 9457 err = json.Unmarshal(*v, &typeVar) 9458 if err != nil { 9459 return err 9460 } 9461 pa.Type = typeVar 9462 } 9463 } 9464 } 9465 9466 return nil 9467} 9468 9469// QueryContext defines the query context that Bing used for the request. 9470type QueryContext struct { 9471 // OriginalQuery - The query string as specified in the request. 9472 OriginalQuery *string `json:"originalQuery,omitempty"` 9473 // AlteredQuery - READ-ONLY; The query string used by Bing to perform the query. Bing uses the altered query string if the original query string contained spelling mistakes. For example, if the query string is "saling downwind", the altered query string will be "sailing downwind". This field is included only if the original query string contains a spelling mistake. 9474 AlteredQuery *string `json:"alteredQuery,omitempty"` 9475 // AlterationOverrideQuery - READ-ONLY; The query string to use to force Bing to use the original string. For example, if the query string is "saling downwind", the override query string will be "+saling downwind". Remember to encode the query string which results in "%2Bsaling+downwind". This field is included only if the original query string contains a spelling mistake. 9476 AlterationOverrideQuery *string `json:"alterationOverrideQuery,omitempty"` 9477 // AdultIntent - READ-ONLY; A Boolean value that indicates whether the specified query has adult intent. The value is true if the query has adult intent; otherwise, false. 9478 AdultIntent *bool `json:"adultIntent,omitempty"` 9479 // AskUserForLocation - READ-ONLY; A Boolean value that indicates whether Bing requires the user's location to provide accurate results. If you specified the user's location by using the X-MSEdge-ClientIP and X-Search-Location headers, you can ignore this field. For location aware queries, such as "today's weather" or "restaurants near me" that need the user's location to provide accurate results, this field is set to true. For location aware queries that include the location (for example, "Seattle weather"), this field is set to false. This field is also set to false for queries that are not location aware, such as "best sellers". 9480 AskUserForLocation *bool `json:"askUserForLocation,omitempty"` 9481} 9482 9483// MarshalJSON is the custom marshaler for QueryContext. 9484func (qc QueryContext) MarshalJSON() ([]byte, error) { 9485 objectMap := make(map[string]interface{}) 9486 if qc.OriginalQuery != nil { 9487 objectMap["originalQuery"] = qc.OriginalQuery 9488 } 9489 return json.Marshal(objectMap) 9490} 9491 9492// BasicResponse defines a response. All schemas that could be returned at the root of a response should inherit from 9493// this 9494type BasicResponse interface { 9495 AsImageObject() (*ImageObject, bool) 9496 AsThing() (*Thing, bool) 9497 AsBasicThing() (BasicThing, bool) 9498 AsEntities() (*Entities, bool) 9499 AsPlaces() (*Places, bool) 9500 AsSearchResponse() (*SearchResponse, bool) 9501 AsSearchResultsAnswer() (*SearchResultsAnswer, bool) 9502 AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) 9503 AsAnswer() (*Answer, bool) 9504 AsBasicAnswer() (BasicAnswer, bool) 9505 AsErrorResponse() (*ErrorResponse, bool) 9506 AsPostalAddress() (*PostalAddress, bool) 9507 AsPlace() (*Place, bool) 9508 AsBasicPlace() (BasicPlace, bool) 9509 AsOrganization() (*Organization, bool) 9510 AsCreativeWork() (*CreativeWork, bool) 9511 AsBasicCreativeWork() (BasicCreativeWork, bool) 9512 AsIntangible() (*Intangible, bool) 9513 AsBasicIntangible() (BasicIntangible, bool) 9514 AsMovieTheater() (*MovieTheater, bool) 9515 AsMediaObject() (*MediaObject, bool) 9516 AsBasicMediaObject() (BasicMediaObject, bool) 9517 AsCivicStructure() (*CivicStructure, bool) 9518 AsBasicCivicStructure() (BasicCivicStructure, bool) 9519 AsLocalBusiness() (*LocalBusiness, bool) 9520 AsBasicLocalBusiness() (BasicLocalBusiness, bool) 9521 AsTouristAttraction() (*TouristAttraction, bool) 9522 AsAirport() (*Airport, bool) 9523 AsLicense() (*License, bool) 9524 AsStructuredValue() (*StructuredValue, bool) 9525 AsBasicStructuredValue() (BasicStructuredValue, bool) 9526 AsEntertainmentBusiness() (*EntertainmentBusiness, bool) 9527 AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) 9528 AsFoodEstablishment() (*FoodEstablishment, bool) 9529 AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) 9530 AsLodgingBusiness() (*LodgingBusiness, bool) 9531 AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) 9532 AsRestaurant() (*Restaurant, bool) 9533 AsHotel() (*Hotel, bool) 9534 AsResponse() (*Response, bool) 9535} 9536 9537// Response defines a response. All schemas that could be returned at the root of a response should inherit 9538// from this 9539type Response struct { 9540 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 9541 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 9542 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 9543 WebSearchURL *string `json:"webSearchUrl,omitempty"` 9544 // ID - READ-ONLY; A String identifier. 9545 ID *string `json:"id,omitempty"` 9546 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 9547 Type TypeBasicResponseBase `json:"_type,omitempty"` 9548} 9549 9550func unmarshalBasicResponse(body []byte) (BasicResponse, error) { 9551 var m map[string]interface{} 9552 err := json.Unmarshal(body, &m) 9553 if err != nil { 9554 return nil, err 9555 } 9556 9557 switch m["_type"] { 9558 case string(TypeImageObject): 9559 var ioVar ImageObject 9560 err := json.Unmarshal(body, &ioVar) 9561 return ioVar, err 9562 case string(TypeThing): 9563 var t Thing 9564 err := json.Unmarshal(body, &t) 9565 return t, err 9566 case string(TypeEntities): 9567 var e Entities 9568 err := json.Unmarshal(body, &e) 9569 return e, err 9570 case string(TypePlaces): 9571 var p Places 9572 err := json.Unmarshal(body, &p) 9573 return p, err 9574 case string(TypeSearchResponse): 9575 var sr SearchResponse 9576 err := json.Unmarshal(body, &sr) 9577 return sr, err 9578 case string(TypeSearchResultsAnswer): 9579 var sra SearchResultsAnswer 9580 err := json.Unmarshal(body, &sra) 9581 return sra, err 9582 case string(TypeAnswer): 9583 var a Answer 9584 err := json.Unmarshal(body, &a) 9585 return a, err 9586 case string(TypeErrorResponse): 9587 var er ErrorResponse 9588 err := json.Unmarshal(body, &er) 9589 return er, err 9590 case string(TypePostalAddress): 9591 var pa PostalAddress 9592 err := json.Unmarshal(body, &pa) 9593 return pa, err 9594 case string(TypePlace): 9595 var p Place 9596 err := json.Unmarshal(body, &p) 9597 return p, err 9598 case string(TypeOrganization): 9599 var o Organization 9600 err := json.Unmarshal(body, &o) 9601 return o, err 9602 case string(TypeCreativeWork): 9603 var cw CreativeWork 9604 err := json.Unmarshal(body, &cw) 9605 return cw, err 9606 case string(TypeIntangible): 9607 var i Intangible 9608 err := json.Unmarshal(body, &i) 9609 return i, err 9610 case string(TypeMovieTheater): 9611 var mt MovieTheater 9612 err := json.Unmarshal(body, &mt) 9613 return mt, err 9614 case string(TypeMediaObject): 9615 var mo MediaObject 9616 err := json.Unmarshal(body, &mo) 9617 return mo, err 9618 case string(TypeCivicStructure): 9619 var cs CivicStructure 9620 err := json.Unmarshal(body, &cs) 9621 return cs, err 9622 case string(TypeLocalBusiness): 9623 var lb LocalBusiness 9624 err := json.Unmarshal(body, &lb) 9625 return lb, err 9626 case string(TypeTouristAttraction): 9627 var ta TouristAttraction 9628 err := json.Unmarshal(body, &ta) 9629 return ta, err 9630 case string(TypeAirport): 9631 var a Airport 9632 err := json.Unmarshal(body, &a) 9633 return a, err 9634 case string(TypeLicense): 9635 var l License 9636 err := json.Unmarshal(body, &l) 9637 return l, err 9638 case string(TypeStructuredValue): 9639 var sv StructuredValue 9640 err := json.Unmarshal(body, &sv) 9641 return sv, err 9642 case string(TypeEntertainmentBusiness): 9643 var eb EntertainmentBusiness 9644 err := json.Unmarshal(body, &eb) 9645 return eb, err 9646 case string(TypeFoodEstablishment): 9647 var fe FoodEstablishment 9648 err := json.Unmarshal(body, &fe) 9649 return fe, err 9650 case string(TypeLodgingBusiness): 9651 var lb LodgingBusiness 9652 err := json.Unmarshal(body, &lb) 9653 return lb, err 9654 case string(TypeRestaurant): 9655 var r Restaurant 9656 err := json.Unmarshal(body, &r) 9657 return r, err 9658 case string(TypeHotel): 9659 var h Hotel 9660 err := json.Unmarshal(body, &h) 9661 return h, err 9662 default: 9663 var r Response 9664 err := json.Unmarshal(body, &r) 9665 return r, err 9666 } 9667} 9668func unmarshalBasicResponseArray(body []byte) ([]BasicResponse, error) { 9669 var rawMessages []*json.RawMessage 9670 err := json.Unmarshal(body, &rawMessages) 9671 if err != nil { 9672 return nil, err 9673 } 9674 9675 rArray := make([]BasicResponse, len(rawMessages)) 9676 9677 for index, rawMessage := range rawMessages { 9678 r, err := unmarshalBasicResponse(*rawMessage) 9679 if err != nil { 9680 return nil, err 9681 } 9682 rArray[index] = r 9683 } 9684 return rArray, nil 9685} 9686 9687// MarshalJSON is the custom marshaler for Response. 9688func (r Response) MarshalJSON() ([]byte, error) { 9689 r.Type = TypeResponse 9690 objectMap := make(map[string]interface{}) 9691 if r.Type != "" { 9692 objectMap["_type"] = r.Type 9693 } 9694 return json.Marshal(objectMap) 9695} 9696 9697// AsImageObject is the BasicResponseBase implementation for Response. 9698func (r Response) AsImageObject() (*ImageObject, bool) { 9699 return nil, false 9700} 9701 9702// AsThing is the BasicResponseBase implementation for Response. 9703func (r Response) AsThing() (*Thing, bool) { 9704 return nil, false 9705} 9706 9707// AsBasicThing is the BasicResponseBase implementation for Response. 9708func (r Response) AsBasicThing() (BasicThing, bool) { 9709 return nil, false 9710} 9711 9712// AsEntities is the BasicResponseBase implementation for Response. 9713func (r Response) AsEntities() (*Entities, bool) { 9714 return nil, false 9715} 9716 9717// AsPlaces is the BasicResponseBase implementation for Response. 9718func (r Response) AsPlaces() (*Places, bool) { 9719 return nil, false 9720} 9721 9722// AsSearchResponse is the BasicResponseBase implementation for Response. 9723func (r Response) AsSearchResponse() (*SearchResponse, bool) { 9724 return nil, false 9725} 9726 9727// AsResponse is the BasicResponseBase implementation for Response. 9728func (r Response) AsResponse() (*Response, bool) { 9729 return &r, true 9730} 9731 9732// AsBasicResponse is the BasicResponseBase implementation for Response. 9733func (r Response) AsBasicResponse() (BasicResponse, bool) { 9734 return &r, true 9735} 9736 9737// AsSearchResultsAnswer is the BasicResponseBase implementation for Response. 9738func (r Response) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 9739 return nil, false 9740} 9741 9742// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Response. 9743func (r Response) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 9744 return nil, false 9745} 9746 9747// AsIdentifiable is the BasicResponseBase implementation for Response. 9748func (r Response) AsIdentifiable() (*Identifiable, bool) { 9749 return nil, false 9750} 9751 9752// AsBasicIdentifiable is the BasicResponseBase implementation for Response. 9753func (r Response) AsBasicIdentifiable() (BasicIdentifiable, bool) { 9754 return &r, true 9755} 9756 9757// AsAnswer is the BasicResponseBase implementation for Response. 9758func (r Response) AsAnswer() (*Answer, bool) { 9759 return nil, false 9760} 9761 9762// AsBasicAnswer is the BasicResponseBase implementation for Response. 9763func (r Response) AsBasicAnswer() (BasicAnswer, bool) { 9764 return nil, false 9765} 9766 9767// AsErrorResponse is the BasicResponseBase implementation for Response. 9768func (r Response) AsErrorResponse() (*ErrorResponse, bool) { 9769 return nil, false 9770} 9771 9772// AsPostalAddress is the BasicResponseBase implementation for Response. 9773func (r Response) AsPostalAddress() (*PostalAddress, bool) { 9774 return nil, false 9775} 9776 9777// AsPlace is the BasicResponseBase implementation for Response. 9778func (r Response) AsPlace() (*Place, bool) { 9779 return nil, false 9780} 9781 9782// AsBasicPlace is the BasicResponseBase implementation for Response. 9783func (r Response) AsBasicPlace() (BasicPlace, bool) { 9784 return nil, false 9785} 9786 9787// AsOrganization is the BasicResponseBase implementation for Response. 9788func (r Response) AsOrganization() (*Organization, bool) { 9789 return nil, false 9790} 9791 9792// AsCreativeWork is the BasicResponseBase implementation for Response. 9793func (r Response) AsCreativeWork() (*CreativeWork, bool) { 9794 return nil, false 9795} 9796 9797// AsBasicCreativeWork is the BasicResponseBase implementation for Response. 9798func (r Response) AsBasicCreativeWork() (BasicCreativeWork, bool) { 9799 return nil, false 9800} 9801 9802// AsIntangible is the BasicResponseBase implementation for Response. 9803func (r Response) AsIntangible() (*Intangible, bool) { 9804 return nil, false 9805} 9806 9807// AsBasicIntangible is the BasicResponseBase implementation for Response. 9808func (r Response) AsBasicIntangible() (BasicIntangible, bool) { 9809 return nil, false 9810} 9811 9812// AsMovieTheater is the BasicResponseBase implementation for Response. 9813func (r Response) AsMovieTheater() (*MovieTheater, bool) { 9814 return nil, false 9815} 9816 9817// AsMediaObject is the BasicResponseBase implementation for Response. 9818func (r Response) AsMediaObject() (*MediaObject, bool) { 9819 return nil, false 9820} 9821 9822// AsBasicMediaObject is the BasicResponseBase implementation for Response. 9823func (r Response) AsBasicMediaObject() (BasicMediaObject, bool) { 9824 return nil, false 9825} 9826 9827// AsCivicStructure is the BasicResponseBase implementation for Response. 9828func (r Response) AsCivicStructure() (*CivicStructure, bool) { 9829 return nil, false 9830} 9831 9832// AsBasicCivicStructure is the BasicResponseBase implementation for Response. 9833func (r Response) AsBasicCivicStructure() (BasicCivicStructure, bool) { 9834 return nil, false 9835} 9836 9837// AsLocalBusiness is the BasicResponseBase implementation for Response. 9838func (r Response) AsLocalBusiness() (*LocalBusiness, bool) { 9839 return nil, false 9840} 9841 9842// AsBasicLocalBusiness is the BasicResponseBase implementation for Response. 9843func (r Response) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 9844 return nil, false 9845} 9846 9847// AsTouristAttraction is the BasicResponseBase implementation for Response. 9848func (r Response) AsTouristAttraction() (*TouristAttraction, bool) { 9849 return nil, false 9850} 9851 9852// AsAirport is the BasicResponseBase implementation for Response. 9853func (r Response) AsAirport() (*Airport, bool) { 9854 return nil, false 9855} 9856 9857// AsLicense is the BasicResponseBase implementation for Response. 9858func (r Response) AsLicense() (*License, bool) { 9859 return nil, false 9860} 9861 9862// AsStructuredValue is the BasicResponseBase implementation for Response. 9863func (r Response) AsStructuredValue() (*StructuredValue, bool) { 9864 return nil, false 9865} 9866 9867// AsBasicStructuredValue is the BasicResponseBase implementation for Response. 9868func (r Response) AsBasicStructuredValue() (BasicStructuredValue, bool) { 9869 return nil, false 9870} 9871 9872// AsEntertainmentBusiness is the BasicResponseBase implementation for Response. 9873func (r Response) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 9874 return nil, false 9875} 9876 9877// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for Response. 9878func (r Response) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 9879 return nil, false 9880} 9881 9882// AsFoodEstablishment is the BasicResponseBase implementation for Response. 9883func (r Response) AsFoodEstablishment() (*FoodEstablishment, bool) { 9884 return nil, false 9885} 9886 9887// AsBasicFoodEstablishment is the BasicResponseBase implementation for Response. 9888func (r Response) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 9889 return nil, false 9890} 9891 9892// AsLodgingBusiness is the BasicResponseBase implementation for Response. 9893func (r Response) AsLodgingBusiness() (*LodgingBusiness, bool) { 9894 return nil, false 9895} 9896 9897// AsBasicLodgingBusiness is the BasicResponseBase implementation for Response. 9898func (r Response) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 9899 return nil, false 9900} 9901 9902// AsRestaurant is the BasicResponseBase implementation for Response. 9903func (r Response) AsRestaurant() (*Restaurant, bool) { 9904 return nil, false 9905} 9906 9907// AsHotel is the BasicResponseBase implementation for Response. 9908func (r Response) AsHotel() (*Hotel, bool) { 9909 return nil, false 9910} 9911 9912// AsResponseBase is the BasicResponseBase implementation for Response. 9913func (r Response) AsResponseBase() (*ResponseBase, bool) { 9914 return nil, false 9915} 9916 9917// AsBasicResponseBase is the BasicResponseBase implementation for Response. 9918func (r Response) AsBasicResponseBase() (BasicResponseBase, bool) { 9919 return &r, true 9920} 9921 9922// UnmarshalJSON is the custom unmarshaler for Response struct. 9923func (r *Response) UnmarshalJSON(body []byte) error { 9924 var m map[string]*json.RawMessage 9925 err := json.Unmarshal(body, &m) 9926 if err != nil { 9927 return err 9928 } 9929 for k, v := range m { 9930 switch k { 9931 case "contractualRules": 9932 if v != nil { 9933 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 9934 if err != nil { 9935 return err 9936 } 9937 r.ContractualRules = &contractualRules 9938 } 9939 case "webSearchUrl": 9940 if v != nil { 9941 var webSearchURL string 9942 err = json.Unmarshal(*v, &webSearchURL) 9943 if err != nil { 9944 return err 9945 } 9946 r.WebSearchURL = &webSearchURL 9947 } 9948 case "id": 9949 if v != nil { 9950 var ID string 9951 err = json.Unmarshal(*v, &ID) 9952 if err != nil { 9953 return err 9954 } 9955 r.ID = &ID 9956 } 9957 case "_type": 9958 if v != nil { 9959 var typeVar TypeBasicResponseBase 9960 err = json.Unmarshal(*v, &typeVar) 9961 if err != nil { 9962 return err 9963 } 9964 r.Type = typeVar 9965 } 9966 } 9967 } 9968 9969 return nil 9970} 9971 9972// BasicResponseBase ... 9973type BasicResponseBase interface { 9974 AsImageObject() (*ImageObject, bool) 9975 AsThing() (*Thing, bool) 9976 AsBasicThing() (BasicThing, bool) 9977 AsEntities() (*Entities, bool) 9978 AsPlaces() (*Places, bool) 9979 AsSearchResponse() (*SearchResponse, bool) 9980 AsResponse() (*Response, bool) 9981 AsBasicResponse() (BasicResponse, bool) 9982 AsSearchResultsAnswer() (*SearchResultsAnswer, bool) 9983 AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) 9984 AsIdentifiable() (*Identifiable, bool) 9985 AsBasicIdentifiable() (BasicIdentifiable, bool) 9986 AsAnswer() (*Answer, bool) 9987 AsBasicAnswer() (BasicAnswer, bool) 9988 AsErrorResponse() (*ErrorResponse, bool) 9989 AsPostalAddress() (*PostalAddress, bool) 9990 AsPlace() (*Place, bool) 9991 AsBasicPlace() (BasicPlace, bool) 9992 AsOrganization() (*Organization, bool) 9993 AsCreativeWork() (*CreativeWork, bool) 9994 AsBasicCreativeWork() (BasicCreativeWork, bool) 9995 AsIntangible() (*Intangible, bool) 9996 AsBasicIntangible() (BasicIntangible, bool) 9997 AsMovieTheater() (*MovieTheater, bool) 9998 AsMediaObject() (*MediaObject, bool) 9999 AsBasicMediaObject() (BasicMediaObject, bool) 10000 AsCivicStructure() (*CivicStructure, bool) 10001 AsBasicCivicStructure() (BasicCivicStructure, bool) 10002 AsLocalBusiness() (*LocalBusiness, bool) 10003 AsBasicLocalBusiness() (BasicLocalBusiness, bool) 10004 AsTouristAttraction() (*TouristAttraction, bool) 10005 AsAirport() (*Airport, bool) 10006 AsLicense() (*License, bool) 10007 AsStructuredValue() (*StructuredValue, bool) 10008 AsBasicStructuredValue() (BasicStructuredValue, bool) 10009 AsEntertainmentBusiness() (*EntertainmentBusiness, bool) 10010 AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) 10011 AsFoodEstablishment() (*FoodEstablishment, bool) 10012 AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) 10013 AsLodgingBusiness() (*LodgingBusiness, bool) 10014 AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) 10015 AsRestaurant() (*Restaurant, bool) 10016 AsHotel() (*Hotel, bool) 10017 AsResponseBase() (*ResponseBase, bool) 10018} 10019 10020// ResponseBase ... 10021type ResponseBase struct { 10022 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 10023 Type TypeBasicResponseBase `json:"_type,omitempty"` 10024} 10025 10026func unmarshalBasicResponseBase(body []byte) (BasicResponseBase, error) { 10027 var m map[string]interface{} 10028 err := json.Unmarshal(body, &m) 10029 if err != nil { 10030 return nil, err 10031 } 10032 10033 switch m["_type"] { 10034 case string(TypeImageObject): 10035 var ioVar ImageObject 10036 err := json.Unmarshal(body, &ioVar) 10037 return ioVar, err 10038 case string(TypeThing): 10039 var t Thing 10040 err := json.Unmarshal(body, &t) 10041 return t, err 10042 case string(TypeEntities): 10043 var e Entities 10044 err := json.Unmarshal(body, &e) 10045 return e, err 10046 case string(TypePlaces): 10047 var p Places 10048 err := json.Unmarshal(body, &p) 10049 return p, err 10050 case string(TypeSearchResponse): 10051 var sr SearchResponse 10052 err := json.Unmarshal(body, &sr) 10053 return sr, err 10054 case string(TypeResponse): 10055 var r Response 10056 err := json.Unmarshal(body, &r) 10057 return r, err 10058 case string(TypeSearchResultsAnswer): 10059 var sra SearchResultsAnswer 10060 err := json.Unmarshal(body, &sra) 10061 return sra, err 10062 case string(TypeIdentifiable): 10063 var i Identifiable 10064 err := json.Unmarshal(body, &i) 10065 return i, err 10066 case string(TypeAnswer): 10067 var a Answer 10068 err := json.Unmarshal(body, &a) 10069 return a, err 10070 case string(TypeErrorResponse): 10071 var er ErrorResponse 10072 err := json.Unmarshal(body, &er) 10073 return er, err 10074 case string(TypePostalAddress): 10075 var pa PostalAddress 10076 err := json.Unmarshal(body, &pa) 10077 return pa, err 10078 case string(TypePlace): 10079 var p Place 10080 err := json.Unmarshal(body, &p) 10081 return p, err 10082 case string(TypeOrganization): 10083 var o Organization 10084 err := json.Unmarshal(body, &o) 10085 return o, err 10086 case string(TypeCreativeWork): 10087 var cw CreativeWork 10088 err := json.Unmarshal(body, &cw) 10089 return cw, err 10090 case string(TypeIntangible): 10091 var i Intangible 10092 err := json.Unmarshal(body, &i) 10093 return i, err 10094 case string(TypeMovieTheater): 10095 var mt MovieTheater 10096 err := json.Unmarshal(body, &mt) 10097 return mt, err 10098 case string(TypeMediaObject): 10099 var mo MediaObject 10100 err := json.Unmarshal(body, &mo) 10101 return mo, err 10102 case string(TypeCivicStructure): 10103 var cs CivicStructure 10104 err := json.Unmarshal(body, &cs) 10105 return cs, err 10106 case string(TypeLocalBusiness): 10107 var lb LocalBusiness 10108 err := json.Unmarshal(body, &lb) 10109 return lb, err 10110 case string(TypeTouristAttraction): 10111 var ta TouristAttraction 10112 err := json.Unmarshal(body, &ta) 10113 return ta, err 10114 case string(TypeAirport): 10115 var a Airport 10116 err := json.Unmarshal(body, &a) 10117 return a, err 10118 case string(TypeLicense): 10119 var l License 10120 err := json.Unmarshal(body, &l) 10121 return l, err 10122 case string(TypeStructuredValue): 10123 var sv StructuredValue 10124 err := json.Unmarshal(body, &sv) 10125 return sv, err 10126 case string(TypeEntertainmentBusiness): 10127 var eb EntertainmentBusiness 10128 err := json.Unmarshal(body, &eb) 10129 return eb, err 10130 case string(TypeFoodEstablishment): 10131 var fe FoodEstablishment 10132 err := json.Unmarshal(body, &fe) 10133 return fe, err 10134 case string(TypeLodgingBusiness): 10135 var lb LodgingBusiness 10136 err := json.Unmarshal(body, &lb) 10137 return lb, err 10138 case string(TypeRestaurant): 10139 var r Restaurant 10140 err := json.Unmarshal(body, &r) 10141 return r, err 10142 case string(TypeHotel): 10143 var h Hotel 10144 err := json.Unmarshal(body, &h) 10145 return h, err 10146 default: 10147 var rb ResponseBase 10148 err := json.Unmarshal(body, &rb) 10149 return rb, err 10150 } 10151} 10152func unmarshalBasicResponseBaseArray(body []byte) ([]BasicResponseBase, error) { 10153 var rawMessages []*json.RawMessage 10154 err := json.Unmarshal(body, &rawMessages) 10155 if err != nil { 10156 return nil, err 10157 } 10158 10159 rbArray := make([]BasicResponseBase, len(rawMessages)) 10160 10161 for index, rawMessage := range rawMessages { 10162 rb, err := unmarshalBasicResponseBase(*rawMessage) 10163 if err != nil { 10164 return nil, err 10165 } 10166 rbArray[index] = rb 10167 } 10168 return rbArray, nil 10169} 10170 10171// MarshalJSON is the custom marshaler for ResponseBase. 10172func (rb ResponseBase) MarshalJSON() ([]byte, error) { 10173 rb.Type = TypeResponseBase 10174 objectMap := make(map[string]interface{}) 10175 if rb.Type != "" { 10176 objectMap["_type"] = rb.Type 10177 } 10178 return json.Marshal(objectMap) 10179} 10180 10181// AsImageObject is the BasicResponseBase implementation for ResponseBase. 10182func (rb ResponseBase) AsImageObject() (*ImageObject, bool) { 10183 return nil, false 10184} 10185 10186// AsThing is the BasicResponseBase implementation for ResponseBase. 10187func (rb ResponseBase) AsThing() (*Thing, bool) { 10188 return nil, false 10189} 10190 10191// AsBasicThing is the BasicResponseBase implementation for ResponseBase. 10192func (rb ResponseBase) AsBasicThing() (BasicThing, bool) { 10193 return nil, false 10194} 10195 10196// AsEntities is the BasicResponseBase implementation for ResponseBase. 10197func (rb ResponseBase) AsEntities() (*Entities, bool) { 10198 return nil, false 10199} 10200 10201// AsPlaces is the BasicResponseBase implementation for ResponseBase. 10202func (rb ResponseBase) AsPlaces() (*Places, bool) { 10203 return nil, false 10204} 10205 10206// AsSearchResponse is the BasicResponseBase implementation for ResponseBase. 10207func (rb ResponseBase) AsSearchResponse() (*SearchResponse, bool) { 10208 return nil, false 10209} 10210 10211// AsResponse is the BasicResponseBase implementation for ResponseBase. 10212func (rb ResponseBase) AsResponse() (*Response, bool) { 10213 return nil, false 10214} 10215 10216// AsBasicResponse is the BasicResponseBase implementation for ResponseBase. 10217func (rb ResponseBase) AsBasicResponse() (BasicResponse, bool) { 10218 return nil, false 10219} 10220 10221// AsSearchResultsAnswer is the BasicResponseBase implementation for ResponseBase. 10222func (rb ResponseBase) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 10223 return nil, false 10224} 10225 10226// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for ResponseBase. 10227func (rb ResponseBase) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 10228 return nil, false 10229} 10230 10231// AsIdentifiable is the BasicResponseBase implementation for ResponseBase. 10232func (rb ResponseBase) AsIdentifiable() (*Identifiable, bool) { 10233 return nil, false 10234} 10235 10236// AsBasicIdentifiable is the BasicResponseBase implementation for ResponseBase. 10237func (rb ResponseBase) AsBasicIdentifiable() (BasicIdentifiable, bool) { 10238 return nil, false 10239} 10240 10241// AsAnswer is the BasicResponseBase implementation for ResponseBase. 10242func (rb ResponseBase) AsAnswer() (*Answer, bool) { 10243 return nil, false 10244} 10245 10246// AsBasicAnswer is the BasicResponseBase implementation for ResponseBase. 10247func (rb ResponseBase) AsBasicAnswer() (BasicAnswer, bool) { 10248 return nil, false 10249} 10250 10251// AsErrorResponse is the BasicResponseBase implementation for ResponseBase. 10252func (rb ResponseBase) AsErrorResponse() (*ErrorResponse, bool) { 10253 return nil, false 10254} 10255 10256// AsPostalAddress is the BasicResponseBase implementation for ResponseBase. 10257func (rb ResponseBase) AsPostalAddress() (*PostalAddress, bool) { 10258 return nil, false 10259} 10260 10261// AsPlace is the BasicResponseBase implementation for ResponseBase. 10262func (rb ResponseBase) AsPlace() (*Place, bool) { 10263 return nil, false 10264} 10265 10266// AsBasicPlace is the BasicResponseBase implementation for ResponseBase. 10267func (rb ResponseBase) AsBasicPlace() (BasicPlace, bool) { 10268 return nil, false 10269} 10270 10271// AsOrganization is the BasicResponseBase implementation for ResponseBase. 10272func (rb ResponseBase) AsOrganization() (*Organization, bool) { 10273 return nil, false 10274} 10275 10276// AsCreativeWork is the BasicResponseBase implementation for ResponseBase. 10277func (rb ResponseBase) AsCreativeWork() (*CreativeWork, bool) { 10278 return nil, false 10279} 10280 10281// AsBasicCreativeWork is the BasicResponseBase implementation for ResponseBase. 10282func (rb ResponseBase) AsBasicCreativeWork() (BasicCreativeWork, bool) { 10283 return nil, false 10284} 10285 10286// AsIntangible is the BasicResponseBase implementation for ResponseBase. 10287func (rb ResponseBase) AsIntangible() (*Intangible, bool) { 10288 return nil, false 10289} 10290 10291// AsBasicIntangible is the BasicResponseBase implementation for ResponseBase. 10292func (rb ResponseBase) AsBasicIntangible() (BasicIntangible, bool) { 10293 return nil, false 10294} 10295 10296// AsMovieTheater is the BasicResponseBase implementation for ResponseBase. 10297func (rb ResponseBase) AsMovieTheater() (*MovieTheater, bool) { 10298 return nil, false 10299} 10300 10301// AsMediaObject is the BasicResponseBase implementation for ResponseBase. 10302func (rb ResponseBase) AsMediaObject() (*MediaObject, bool) { 10303 return nil, false 10304} 10305 10306// AsBasicMediaObject is the BasicResponseBase implementation for ResponseBase. 10307func (rb ResponseBase) AsBasicMediaObject() (BasicMediaObject, bool) { 10308 return nil, false 10309} 10310 10311// AsCivicStructure is the BasicResponseBase implementation for ResponseBase. 10312func (rb ResponseBase) AsCivicStructure() (*CivicStructure, bool) { 10313 return nil, false 10314} 10315 10316// AsBasicCivicStructure is the BasicResponseBase implementation for ResponseBase. 10317func (rb ResponseBase) AsBasicCivicStructure() (BasicCivicStructure, bool) { 10318 return nil, false 10319} 10320 10321// AsLocalBusiness is the BasicResponseBase implementation for ResponseBase. 10322func (rb ResponseBase) AsLocalBusiness() (*LocalBusiness, bool) { 10323 return nil, false 10324} 10325 10326// AsBasicLocalBusiness is the BasicResponseBase implementation for ResponseBase. 10327func (rb ResponseBase) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 10328 return nil, false 10329} 10330 10331// AsTouristAttraction is the BasicResponseBase implementation for ResponseBase. 10332func (rb ResponseBase) AsTouristAttraction() (*TouristAttraction, bool) { 10333 return nil, false 10334} 10335 10336// AsAirport is the BasicResponseBase implementation for ResponseBase. 10337func (rb ResponseBase) AsAirport() (*Airport, bool) { 10338 return nil, false 10339} 10340 10341// AsLicense is the BasicResponseBase implementation for ResponseBase. 10342func (rb ResponseBase) AsLicense() (*License, bool) { 10343 return nil, false 10344} 10345 10346// AsStructuredValue is the BasicResponseBase implementation for ResponseBase. 10347func (rb ResponseBase) AsStructuredValue() (*StructuredValue, bool) { 10348 return nil, false 10349} 10350 10351// AsBasicStructuredValue is the BasicResponseBase implementation for ResponseBase. 10352func (rb ResponseBase) AsBasicStructuredValue() (BasicStructuredValue, bool) { 10353 return nil, false 10354} 10355 10356// AsEntertainmentBusiness is the BasicResponseBase implementation for ResponseBase. 10357func (rb ResponseBase) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 10358 return nil, false 10359} 10360 10361// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for ResponseBase. 10362func (rb ResponseBase) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 10363 return nil, false 10364} 10365 10366// AsFoodEstablishment is the BasicResponseBase implementation for ResponseBase. 10367func (rb ResponseBase) AsFoodEstablishment() (*FoodEstablishment, bool) { 10368 return nil, false 10369} 10370 10371// AsBasicFoodEstablishment is the BasicResponseBase implementation for ResponseBase. 10372func (rb ResponseBase) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 10373 return nil, false 10374} 10375 10376// AsLodgingBusiness is the BasicResponseBase implementation for ResponseBase. 10377func (rb ResponseBase) AsLodgingBusiness() (*LodgingBusiness, bool) { 10378 return nil, false 10379} 10380 10381// AsBasicLodgingBusiness is the BasicResponseBase implementation for ResponseBase. 10382func (rb ResponseBase) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 10383 return nil, false 10384} 10385 10386// AsRestaurant is the BasicResponseBase implementation for ResponseBase. 10387func (rb ResponseBase) AsRestaurant() (*Restaurant, bool) { 10388 return nil, false 10389} 10390 10391// AsHotel is the BasicResponseBase implementation for ResponseBase. 10392func (rb ResponseBase) AsHotel() (*Hotel, bool) { 10393 return nil, false 10394} 10395 10396// AsResponseBase is the BasicResponseBase implementation for ResponseBase. 10397func (rb ResponseBase) AsResponseBase() (*ResponseBase, bool) { 10398 return &rb, true 10399} 10400 10401// AsBasicResponseBase is the BasicResponseBase implementation for ResponseBase. 10402func (rb ResponseBase) AsBasicResponseBase() (BasicResponseBase, bool) { 10403 return &rb, true 10404} 10405 10406// Restaurant ... 10407type Restaurant struct { 10408 // AcceptsReservations - READ-ONLY 10409 AcceptsReservations *bool `json:"acceptsReservations,omitempty"` 10410 // ReservationURL - READ-ONLY 10411 ReservationURL *string `json:"reservationUrl,omitempty"` 10412 // ServesCuisine - READ-ONLY 10413 ServesCuisine *[]string `json:"servesCuisine,omitempty"` 10414 // MenuURL - READ-ONLY 10415 MenuURL *string `json:"menuUrl,omitempty"` 10416 // PriceRange - READ-ONLY; $$. 10417 PriceRange *string `json:"priceRange,omitempty"` 10418 // Panoramas - READ-ONLY 10419 Panoramas *[]ImageObject `json:"panoramas,omitempty"` 10420 // IsPermanentlyClosed - READ-ONLY 10421 IsPermanentlyClosed *bool `json:"isPermanentlyClosed,omitempty"` 10422 // TagLine - READ-ONLY 10423 TagLine *string `json:"tagLine,omitempty"` 10424 // Address - READ-ONLY; The postal address of where the entity is located 10425 Address *PostalAddress `json:"address,omitempty"` 10426 // Telephone - READ-ONLY; The entity's telephone number 10427 Telephone *string `json:"telephone,omitempty"` 10428 // Name - READ-ONLY; The name of the thing represented by this object. 10429 Name *string `json:"name,omitempty"` 10430 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 10431 URL *string `json:"url,omitempty"` 10432 // Image - READ-ONLY 10433 Image *ImageObject `json:"image,omitempty"` 10434 // Description - READ-ONLY; A short description of the item. 10435 Description *string `json:"description,omitempty"` 10436 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 10437 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 10438 // BingID - READ-ONLY; An ID that uniquely identifies this item. 10439 BingID *string `json:"bingId,omitempty"` 10440 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 10441 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 10442 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 10443 WebSearchURL *string `json:"webSearchUrl,omitempty"` 10444 // ID - READ-ONLY; A String identifier. 10445 ID *string `json:"id,omitempty"` 10446 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 10447 Type TypeBasicResponseBase `json:"_type,omitempty"` 10448} 10449 10450// MarshalJSON is the custom marshaler for Restaurant. 10451func (r Restaurant) MarshalJSON() ([]byte, error) { 10452 r.Type = TypeRestaurant 10453 objectMap := make(map[string]interface{}) 10454 if r.Type != "" { 10455 objectMap["_type"] = r.Type 10456 } 10457 return json.Marshal(objectMap) 10458} 10459 10460// AsImageObject is the BasicResponseBase implementation for Restaurant. 10461func (r Restaurant) AsImageObject() (*ImageObject, bool) { 10462 return nil, false 10463} 10464 10465// AsThing is the BasicResponseBase implementation for Restaurant. 10466func (r Restaurant) AsThing() (*Thing, bool) { 10467 return nil, false 10468} 10469 10470// AsBasicThing is the BasicResponseBase implementation for Restaurant. 10471func (r Restaurant) AsBasicThing() (BasicThing, bool) { 10472 return &r, true 10473} 10474 10475// AsEntities is the BasicResponseBase implementation for Restaurant. 10476func (r Restaurant) AsEntities() (*Entities, bool) { 10477 return nil, false 10478} 10479 10480// AsPlaces is the BasicResponseBase implementation for Restaurant. 10481func (r Restaurant) AsPlaces() (*Places, bool) { 10482 return nil, false 10483} 10484 10485// AsSearchResponse is the BasicResponseBase implementation for Restaurant. 10486func (r Restaurant) AsSearchResponse() (*SearchResponse, bool) { 10487 return nil, false 10488} 10489 10490// AsResponse is the BasicResponseBase implementation for Restaurant. 10491func (r Restaurant) AsResponse() (*Response, bool) { 10492 return nil, false 10493} 10494 10495// AsBasicResponse is the BasicResponseBase implementation for Restaurant. 10496func (r Restaurant) AsBasicResponse() (BasicResponse, bool) { 10497 return &r, true 10498} 10499 10500// AsSearchResultsAnswer is the BasicResponseBase implementation for Restaurant. 10501func (r Restaurant) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 10502 return nil, false 10503} 10504 10505// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Restaurant. 10506func (r Restaurant) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 10507 return nil, false 10508} 10509 10510// AsIdentifiable is the BasicResponseBase implementation for Restaurant. 10511func (r Restaurant) AsIdentifiable() (*Identifiable, bool) { 10512 return nil, false 10513} 10514 10515// AsBasicIdentifiable is the BasicResponseBase implementation for Restaurant. 10516func (r Restaurant) AsBasicIdentifiable() (BasicIdentifiable, bool) { 10517 return &r, true 10518} 10519 10520// AsAnswer is the BasicResponseBase implementation for Restaurant. 10521func (r Restaurant) AsAnswer() (*Answer, bool) { 10522 return nil, false 10523} 10524 10525// AsBasicAnswer is the BasicResponseBase implementation for Restaurant. 10526func (r Restaurant) AsBasicAnswer() (BasicAnswer, bool) { 10527 return nil, false 10528} 10529 10530// AsErrorResponse is the BasicResponseBase implementation for Restaurant. 10531func (r Restaurant) AsErrorResponse() (*ErrorResponse, bool) { 10532 return nil, false 10533} 10534 10535// AsPostalAddress is the BasicResponseBase implementation for Restaurant. 10536func (r Restaurant) AsPostalAddress() (*PostalAddress, bool) { 10537 return nil, false 10538} 10539 10540// AsPlace is the BasicResponseBase implementation for Restaurant. 10541func (r Restaurant) AsPlace() (*Place, bool) { 10542 return nil, false 10543} 10544 10545// AsBasicPlace is the BasicResponseBase implementation for Restaurant. 10546func (r Restaurant) AsBasicPlace() (BasicPlace, bool) { 10547 return &r, true 10548} 10549 10550// AsOrganization is the BasicResponseBase implementation for Restaurant. 10551func (r Restaurant) AsOrganization() (*Organization, bool) { 10552 return nil, false 10553} 10554 10555// AsCreativeWork is the BasicResponseBase implementation for Restaurant. 10556func (r Restaurant) AsCreativeWork() (*CreativeWork, bool) { 10557 return nil, false 10558} 10559 10560// AsBasicCreativeWork is the BasicResponseBase implementation for Restaurant. 10561func (r Restaurant) AsBasicCreativeWork() (BasicCreativeWork, bool) { 10562 return nil, false 10563} 10564 10565// AsIntangible is the BasicResponseBase implementation for Restaurant. 10566func (r Restaurant) AsIntangible() (*Intangible, bool) { 10567 return nil, false 10568} 10569 10570// AsBasicIntangible is the BasicResponseBase implementation for Restaurant. 10571func (r Restaurant) AsBasicIntangible() (BasicIntangible, bool) { 10572 return nil, false 10573} 10574 10575// AsMovieTheater is the BasicResponseBase implementation for Restaurant. 10576func (r Restaurant) AsMovieTheater() (*MovieTheater, bool) { 10577 return nil, false 10578} 10579 10580// AsMediaObject is the BasicResponseBase implementation for Restaurant. 10581func (r Restaurant) AsMediaObject() (*MediaObject, bool) { 10582 return nil, false 10583} 10584 10585// AsBasicMediaObject is the BasicResponseBase implementation for Restaurant. 10586func (r Restaurant) AsBasicMediaObject() (BasicMediaObject, bool) { 10587 return nil, false 10588} 10589 10590// AsCivicStructure is the BasicResponseBase implementation for Restaurant. 10591func (r Restaurant) AsCivicStructure() (*CivicStructure, bool) { 10592 return nil, false 10593} 10594 10595// AsBasicCivicStructure is the BasicResponseBase implementation for Restaurant. 10596func (r Restaurant) AsBasicCivicStructure() (BasicCivicStructure, bool) { 10597 return nil, false 10598} 10599 10600// AsLocalBusiness is the BasicResponseBase implementation for Restaurant. 10601func (r Restaurant) AsLocalBusiness() (*LocalBusiness, bool) { 10602 return nil, false 10603} 10604 10605// AsBasicLocalBusiness is the BasicResponseBase implementation for Restaurant. 10606func (r Restaurant) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 10607 return &r, true 10608} 10609 10610// AsTouristAttraction is the BasicResponseBase implementation for Restaurant. 10611func (r Restaurant) AsTouristAttraction() (*TouristAttraction, bool) { 10612 return nil, false 10613} 10614 10615// AsAirport is the BasicResponseBase implementation for Restaurant. 10616func (r Restaurant) AsAirport() (*Airport, bool) { 10617 return nil, false 10618} 10619 10620// AsLicense is the BasicResponseBase implementation for Restaurant. 10621func (r Restaurant) AsLicense() (*License, bool) { 10622 return nil, false 10623} 10624 10625// AsStructuredValue is the BasicResponseBase implementation for Restaurant. 10626func (r Restaurant) AsStructuredValue() (*StructuredValue, bool) { 10627 return nil, false 10628} 10629 10630// AsBasicStructuredValue is the BasicResponseBase implementation for Restaurant. 10631func (r Restaurant) AsBasicStructuredValue() (BasicStructuredValue, bool) { 10632 return nil, false 10633} 10634 10635// AsEntertainmentBusiness is the BasicResponseBase implementation for Restaurant. 10636func (r Restaurant) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 10637 return nil, false 10638} 10639 10640// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for Restaurant. 10641func (r Restaurant) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 10642 return nil, false 10643} 10644 10645// AsFoodEstablishment is the BasicResponseBase implementation for Restaurant. 10646func (r Restaurant) AsFoodEstablishment() (*FoodEstablishment, bool) { 10647 return nil, false 10648} 10649 10650// AsBasicFoodEstablishment is the BasicResponseBase implementation for Restaurant. 10651func (r Restaurant) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 10652 return &r, true 10653} 10654 10655// AsLodgingBusiness is the BasicResponseBase implementation for Restaurant. 10656func (r Restaurant) AsLodgingBusiness() (*LodgingBusiness, bool) { 10657 return nil, false 10658} 10659 10660// AsBasicLodgingBusiness is the BasicResponseBase implementation for Restaurant. 10661func (r Restaurant) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 10662 return nil, false 10663} 10664 10665// AsRestaurant is the BasicResponseBase implementation for Restaurant. 10666func (r Restaurant) AsRestaurant() (*Restaurant, bool) { 10667 return &r, true 10668} 10669 10670// AsHotel is the BasicResponseBase implementation for Restaurant. 10671func (r Restaurant) AsHotel() (*Hotel, bool) { 10672 return nil, false 10673} 10674 10675// AsResponseBase is the BasicResponseBase implementation for Restaurant. 10676func (r Restaurant) AsResponseBase() (*ResponseBase, bool) { 10677 return nil, false 10678} 10679 10680// AsBasicResponseBase is the BasicResponseBase implementation for Restaurant. 10681func (r Restaurant) AsBasicResponseBase() (BasicResponseBase, bool) { 10682 return &r, true 10683} 10684 10685// UnmarshalJSON is the custom unmarshaler for Restaurant struct. 10686func (r *Restaurant) UnmarshalJSON(body []byte) error { 10687 var m map[string]*json.RawMessage 10688 err := json.Unmarshal(body, &m) 10689 if err != nil { 10690 return err 10691 } 10692 for k, v := range m { 10693 switch k { 10694 case "acceptsReservations": 10695 if v != nil { 10696 var acceptsReservations bool 10697 err = json.Unmarshal(*v, &acceptsReservations) 10698 if err != nil { 10699 return err 10700 } 10701 r.AcceptsReservations = &acceptsReservations 10702 } 10703 case "reservationUrl": 10704 if v != nil { 10705 var reservationURL string 10706 err = json.Unmarshal(*v, &reservationURL) 10707 if err != nil { 10708 return err 10709 } 10710 r.ReservationURL = &reservationURL 10711 } 10712 case "servesCuisine": 10713 if v != nil { 10714 var servesCuisine []string 10715 err = json.Unmarshal(*v, &servesCuisine) 10716 if err != nil { 10717 return err 10718 } 10719 r.ServesCuisine = &servesCuisine 10720 } 10721 case "menuUrl": 10722 if v != nil { 10723 var menuURL string 10724 err = json.Unmarshal(*v, &menuURL) 10725 if err != nil { 10726 return err 10727 } 10728 r.MenuURL = &menuURL 10729 } 10730 case "priceRange": 10731 if v != nil { 10732 var priceRange string 10733 err = json.Unmarshal(*v, &priceRange) 10734 if err != nil { 10735 return err 10736 } 10737 r.PriceRange = &priceRange 10738 } 10739 case "panoramas": 10740 if v != nil { 10741 var panoramas []ImageObject 10742 err = json.Unmarshal(*v, &panoramas) 10743 if err != nil { 10744 return err 10745 } 10746 r.Panoramas = &panoramas 10747 } 10748 case "isPermanentlyClosed": 10749 if v != nil { 10750 var isPermanentlyClosed bool 10751 err = json.Unmarshal(*v, &isPermanentlyClosed) 10752 if err != nil { 10753 return err 10754 } 10755 r.IsPermanentlyClosed = &isPermanentlyClosed 10756 } 10757 case "tagLine": 10758 if v != nil { 10759 var tagLine string 10760 err = json.Unmarshal(*v, &tagLine) 10761 if err != nil { 10762 return err 10763 } 10764 r.TagLine = &tagLine 10765 } 10766 case "address": 10767 if v != nil { 10768 var address PostalAddress 10769 err = json.Unmarshal(*v, &address) 10770 if err != nil { 10771 return err 10772 } 10773 r.Address = &address 10774 } 10775 case "telephone": 10776 if v != nil { 10777 var telephone string 10778 err = json.Unmarshal(*v, &telephone) 10779 if err != nil { 10780 return err 10781 } 10782 r.Telephone = &telephone 10783 } 10784 case "name": 10785 if v != nil { 10786 var name string 10787 err = json.Unmarshal(*v, &name) 10788 if err != nil { 10789 return err 10790 } 10791 r.Name = &name 10792 } 10793 case "url": 10794 if v != nil { 10795 var URL string 10796 err = json.Unmarshal(*v, &URL) 10797 if err != nil { 10798 return err 10799 } 10800 r.URL = &URL 10801 } 10802 case "image": 10803 if v != nil { 10804 var imageVar ImageObject 10805 err = json.Unmarshal(*v, &imageVar) 10806 if err != nil { 10807 return err 10808 } 10809 r.Image = &imageVar 10810 } 10811 case "description": 10812 if v != nil { 10813 var description string 10814 err = json.Unmarshal(*v, &description) 10815 if err != nil { 10816 return err 10817 } 10818 r.Description = &description 10819 } 10820 case "entityPresentationInfo": 10821 if v != nil { 10822 var entityPresentationInfo EntitiesEntityPresentationInfo 10823 err = json.Unmarshal(*v, &entityPresentationInfo) 10824 if err != nil { 10825 return err 10826 } 10827 r.EntityPresentationInfo = &entityPresentationInfo 10828 } 10829 case "bingId": 10830 if v != nil { 10831 var bingID string 10832 err = json.Unmarshal(*v, &bingID) 10833 if err != nil { 10834 return err 10835 } 10836 r.BingID = &bingID 10837 } 10838 case "contractualRules": 10839 if v != nil { 10840 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 10841 if err != nil { 10842 return err 10843 } 10844 r.ContractualRules = &contractualRules 10845 } 10846 case "webSearchUrl": 10847 if v != nil { 10848 var webSearchURL string 10849 err = json.Unmarshal(*v, &webSearchURL) 10850 if err != nil { 10851 return err 10852 } 10853 r.WebSearchURL = &webSearchURL 10854 } 10855 case "id": 10856 if v != nil { 10857 var ID string 10858 err = json.Unmarshal(*v, &ID) 10859 if err != nil { 10860 return err 10861 } 10862 r.ID = &ID 10863 } 10864 case "_type": 10865 if v != nil { 10866 var typeVar TypeBasicResponseBase 10867 err = json.Unmarshal(*v, &typeVar) 10868 if err != nil { 10869 return err 10870 } 10871 r.Type = typeVar 10872 } 10873 } 10874 } 10875 10876 return nil 10877} 10878 10879// SearchResponse defines the top-level object that the response includes when the request succeeds. 10880type SearchResponse struct { 10881 autorest.Response `json:"-"` 10882 // QueryContext - READ-ONLY; An object that contains the query string that Bing used for the request. This object contains the query string as entered by the user. It may also contain an altered query string that Bing used for the query if the query string contained a spelling mistake. 10883 QueryContext *QueryContext `json:"queryContext,omitempty"` 10884 // Entities - READ-ONLY; A list of entities that are relevant to the search query. 10885 Entities *Entities `json:"entities,omitempty"` 10886 // Places - READ-ONLY; A list of local entities such as restaurants or hotels that are relevant to the query. 10887 Places *Places `json:"places,omitempty"` 10888 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 10889 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 10890 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 10891 WebSearchURL *string `json:"webSearchUrl,omitempty"` 10892 // ID - READ-ONLY; A String identifier. 10893 ID *string `json:"id,omitempty"` 10894 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 10895 Type TypeBasicResponseBase `json:"_type,omitempty"` 10896} 10897 10898// MarshalJSON is the custom marshaler for SearchResponse. 10899func (sr SearchResponse) MarshalJSON() ([]byte, error) { 10900 sr.Type = TypeSearchResponse 10901 objectMap := make(map[string]interface{}) 10902 if sr.Type != "" { 10903 objectMap["_type"] = sr.Type 10904 } 10905 return json.Marshal(objectMap) 10906} 10907 10908// AsImageObject is the BasicResponseBase implementation for SearchResponse. 10909func (sr SearchResponse) AsImageObject() (*ImageObject, bool) { 10910 return nil, false 10911} 10912 10913// AsThing is the BasicResponseBase implementation for SearchResponse. 10914func (sr SearchResponse) AsThing() (*Thing, bool) { 10915 return nil, false 10916} 10917 10918// AsBasicThing is the BasicResponseBase implementation for SearchResponse. 10919func (sr SearchResponse) AsBasicThing() (BasicThing, bool) { 10920 return nil, false 10921} 10922 10923// AsEntities is the BasicResponseBase implementation for SearchResponse. 10924func (sr SearchResponse) AsEntities() (*Entities, bool) { 10925 return nil, false 10926} 10927 10928// AsPlaces is the BasicResponseBase implementation for SearchResponse. 10929func (sr SearchResponse) AsPlaces() (*Places, bool) { 10930 return nil, false 10931} 10932 10933// AsSearchResponse is the BasicResponseBase implementation for SearchResponse. 10934func (sr SearchResponse) AsSearchResponse() (*SearchResponse, bool) { 10935 return &sr, true 10936} 10937 10938// AsResponse is the BasicResponseBase implementation for SearchResponse. 10939func (sr SearchResponse) AsResponse() (*Response, bool) { 10940 return nil, false 10941} 10942 10943// AsBasicResponse is the BasicResponseBase implementation for SearchResponse. 10944func (sr SearchResponse) AsBasicResponse() (BasicResponse, bool) { 10945 return &sr, true 10946} 10947 10948// AsSearchResultsAnswer is the BasicResponseBase implementation for SearchResponse. 10949func (sr SearchResponse) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 10950 return nil, false 10951} 10952 10953// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for SearchResponse. 10954func (sr SearchResponse) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 10955 return nil, false 10956} 10957 10958// AsIdentifiable is the BasicResponseBase implementation for SearchResponse. 10959func (sr SearchResponse) AsIdentifiable() (*Identifiable, bool) { 10960 return nil, false 10961} 10962 10963// AsBasicIdentifiable is the BasicResponseBase implementation for SearchResponse. 10964func (sr SearchResponse) AsBasicIdentifiable() (BasicIdentifiable, bool) { 10965 return &sr, true 10966} 10967 10968// AsAnswer is the BasicResponseBase implementation for SearchResponse. 10969func (sr SearchResponse) AsAnswer() (*Answer, bool) { 10970 return nil, false 10971} 10972 10973// AsBasicAnswer is the BasicResponseBase implementation for SearchResponse. 10974func (sr SearchResponse) AsBasicAnswer() (BasicAnswer, bool) { 10975 return nil, false 10976} 10977 10978// AsErrorResponse is the BasicResponseBase implementation for SearchResponse. 10979func (sr SearchResponse) AsErrorResponse() (*ErrorResponse, bool) { 10980 return nil, false 10981} 10982 10983// AsPostalAddress is the BasicResponseBase implementation for SearchResponse. 10984func (sr SearchResponse) AsPostalAddress() (*PostalAddress, bool) { 10985 return nil, false 10986} 10987 10988// AsPlace is the BasicResponseBase implementation for SearchResponse. 10989func (sr SearchResponse) AsPlace() (*Place, bool) { 10990 return nil, false 10991} 10992 10993// AsBasicPlace is the BasicResponseBase implementation for SearchResponse. 10994func (sr SearchResponse) AsBasicPlace() (BasicPlace, bool) { 10995 return nil, false 10996} 10997 10998// AsOrganization is the BasicResponseBase implementation for SearchResponse. 10999func (sr SearchResponse) AsOrganization() (*Organization, bool) { 11000 return nil, false 11001} 11002 11003// AsCreativeWork is the BasicResponseBase implementation for SearchResponse. 11004func (sr SearchResponse) AsCreativeWork() (*CreativeWork, bool) { 11005 return nil, false 11006} 11007 11008// AsBasicCreativeWork is the BasicResponseBase implementation for SearchResponse. 11009func (sr SearchResponse) AsBasicCreativeWork() (BasicCreativeWork, bool) { 11010 return nil, false 11011} 11012 11013// AsIntangible is the BasicResponseBase implementation for SearchResponse. 11014func (sr SearchResponse) AsIntangible() (*Intangible, bool) { 11015 return nil, false 11016} 11017 11018// AsBasicIntangible is the BasicResponseBase implementation for SearchResponse. 11019func (sr SearchResponse) AsBasicIntangible() (BasicIntangible, bool) { 11020 return nil, false 11021} 11022 11023// AsMovieTheater is the BasicResponseBase implementation for SearchResponse. 11024func (sr SearchResponse) AsMovieTheater() (*MovieTheater, bool) { 11025 return nil, false 11026} 11027 11028// AsMediaObject is the BasicResponseBase implementation for SearchResponse. 11029func (sr SearchResponse) AsMediaObject() (*MediaObject, bool) { 11030 return nil, false 11031} 11032 11033// AsBasicMediaObject is the BasicResponseBase implementation for SearchResponse. 11034func (sr SearchResponse) AsBasicMediaObject() (BasicMediaObject, bool) { 11035 return nil, false 11036} 11037 11038// AsCivicStructure is the BasicResponseBase implementation for SearchResponse. 11039func (sr SearchResponse) AsCivicStructure() (*CivicStructure, bool) { 11040 return nil, false 11041} 11042 11043// AsBasicCivicStructure is the BasicResponseBase implementation for SearchResponse. 11044func (sr SearchResponse) AsBasicCivicStructure() (BasicCivicStructure, bool) { 11045 return nil, false 11046} 11047 11048// AsLocalBusiness is the BasicResponseBase implementation for SearchResponse. 11049func (sr SearchResponse) AsLocalBusiness() (*LocalBusiness, bool) { 11050 return nil, false 11051} 11052 11053// AsBasicLocalBusiness is the BasicResponseBase implementation for SearchResponse. 11054func (sr SearchResponse) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 11055 return nil, false 11056} 11057 11058// AsTouristAttraction is the BasicResponseBase implementation for SearchResponse. 11059func (sr SearchResponse) AsTouristAttraction() (*TouristAttraction, bool) { 11060 return nil, false 11061} 11062 11063// AsAirport is the BasicResponseBase implementation for SearchResponse. 11064func (sr SearchResponse) AsAirport() (*Airport, bool) { 11065 return nil, false 11066} 11067 11068// AsLicense is the BasicResponseBase implementation for SearchResponse. 11069func (sr SearchResponse) AsLicense() (*License, bool) { 11070 return nil, false 11071} 11072 11073// AsStructuredValue is the BasicResponseBase implementation for SearchResponse. 11074func (sr SearchResponse) AsStructuredValue() (*StructuredValue, bool) { 11075 return nil, false 11076} 11077 11078// AsBasicStructuredValue is the BasicResponseBase implementation for SearchResponse. 11079func (sr SearchResponse) AsBasicStructuredValue() (BasicStructuredValue, bool) { 11080 return nil, false 11081} 11082 11083// AsEntertainmentBusiness is the BasicResponseBase implementation for SearchResponse. 11084func (sr SearchResponse) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 11085 return nil, false 11086} 11087 11088// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for SearchResponse. 11089func (sr SearchResponse) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 11090 return nil, false 11091} 11092 11093// AsFoodEstablishment is the BasicResponseBase implementation for SearchResponse. 11094func (sr SearchResponse) AsFoodEstablishment() (*FoodEstablishment, bool) { 11095 return nil, false 11096} 11097 11098// AsBasicFoodEstablishment is the BasicResponseBase implementation for SearchResponse. 11099func (sr SearchResponse) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 11100 return nil, false 11101} 11102 11103// AsLodgingBusiness is the BasicResponseBase implementation for SearchResponse. 11104func (sr SearchResponse) AsLodgingBusiness() (*LodgingBusiness, bool) { 11105 return nil, false 11106} 11107 11108// AsBasicLodgingBusiness is the BasicResponseBase implementation for SearchResponse. 11109func (sr SearchResponse) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 11110 return nil, false 11111} 11112 11113// AsRestaurant is the BasicResponseBase implementation for SearchResponse. 11114func (sr SearchResponse) AsRestaurant() (*Restaurant, bool) { 11115 return nil, false 11116} 11117 11118// AsHotel is the BasicResponseBase implementation for SearchResponse. 11119func (sr SearchResponse) AsHotel() (*Hotel, bool) { 11120 return nil, false 11121} 11122 11123// AsResponseBase is the BasicResponseBase implementation for SearchResponse. 11124func (sr SearchResponse) AsResponseBase() (*ResponseBase, bool) { 11125 return nil, false 11126} 11127 11128// AsBasicResponseBase is the BasicResponseBase implementation for SearchResponse. 11129func (sr SearchResponse) AsBasicResponseBase() (BasicResponseBase, bool) { 11130 return &sr, true 11131} 11132 11133// UnmarshalJSON is the custom unmarshaler for SearchResponse struct. 11134func (sr *SearchResponse) UnmarshalJSON(body []byte) error { 11135 var m map[string]*json.RawMessage 11136 err := json.Unmarshal(body, &m) 11137 if err != nil { 11138 return err 11139 } 11140 for k, v := range m { 11141 switch k { 11142 case "queryContext": 11143 if v != nil { 11144 var queryContext QueryContext 11145 err = json.Unmarshal(*v, &queryContext) 11146 if err != nil { 11147 return err 11148 } 11149 sr.QueryContext = &queryContext 11150 } 11151 case "entities": 11152 if v != nil { 11153 var entities Entities 11154 err = json.Unmarshal(*v, &entities) 11155 if err != nil { 11156 return err 11157 } 11158 sr.Entities = &entities 11159 } 11160 case "places": 11161 if v != nil { 11162 var places Places 11163 err = json.Unmarshal(*v, &places) 11164 if err != nil { 11165 return err 11166 } 11167 sr.Places = &places 11168 } 11169 case "contractualRules": 11170 if v != nil { 11171 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 11172 if err != nil { 11173 return err 11174 } 11175 sr.ContractualRules = &contractualRules 11176 } 11177 case "webSearchUrl": 11178 if v != nil { 11179 var webSearchURL string 11180 err = json.Unmarshal(*v, &webSearchURL) 11181 if err != nil { 11182 return err 11183 } 11184 sr.WebSearchURL = &webSearchURL 11185 } 11186 case "id": 11187 if v != nil { 11188 var ID string 11189 err = json.Unmarshal(*v, &ID) 11190 if err != nil { 11191 return err 11192 } 11193 sr.ID = &ID 11194 } 11195 case "_type": 11196 if v != nil { 11197 var typeVar TypeBasicResponseBase 11198 err = json.Unmarshal(*v, &typeVar) 11199 if err != nil { 11200 return err 11201 } 11202 sr.Type = typeVar 11203 } 11204 } 11205 } 11206 11207 return nil 11208} 11209 11210// BasicSearchResultsAnswer ... 11211type BasicSearchResultsAnswer interface { 11212 AsEntities() (*Entities, bool) 11213 AsPlaces() (*Places, bool) 11214 AsSearchResultsAnswer() (*SearchResultsAnswer, bool) 11215} 11216 11217// SearchResultsAnswer ... 11218type SearchResultsAnswer struct { 11219 // QueryContext - READ-ONLY 11220 QueryContext *QueryContext `json:"queryContext,omitempty"` 11221 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 11222 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 11223 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 11224 WebSearchURL *string `json:"webSearchUrl,omitempty"` 11225 // ID - READ-ONLY; A String identifier. 11226 ID *string `json:"id,omitempty"` 11227 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 11228 Type TypeBasicResponseBase `json:"_type,omitempty"` 11229} 11230 11231func unmarshalBasicSearchResultsAnswer(body []byte) (BasicSearchResultsAnswer, error) { 11232 var m map[string]interface{} 11233 err := json.Unmarshal(body, &m) 11234 if err != nil { 11235 return nil, err 11236 } 11237 11238 switch m["_type"] { 11239 case string(TypeEntities): 11240 var e Entities 11241 err := json.Unmarshal(body, &e) 11242 return e, err 11243 case string(TypePlaces): 11244 var p Places 11245 err := json.Unmarshal(body, &p) 11246 return p, err 11247 default: 11248 var sra SearchResultsAnswer 11249 err := json.Unmarshal(body, &sra) 11250 return sra, err 11251 } 11252} 11253func unmarshalBasicSearchResultsAnswerArray(body []byte) ([]BasicSearchResultsAnswer, error) { 11254 var rawMessages []*json.RawMessage 11255 err := json.Unmarshal(body, &rawMessages) 11256 if err != nil { 11257 return nil, err 11258 } 11259 11260 sraArray := make([]BasicSearchResultsAnswer, len(rawMessages)) 11261 11262 for index, rawMessage := range rawMessages { 11263 sra, err := unmarshalBasicSearchResultsAnswer(*rawMessage) 11264 if err != nil { 11265 return nil, err 11266 } 11267 sraArray[index] = sra 11268 } 11269 return sraArray, nil 11270} 11271 11272// MarshalJSON is the custom marshaler for SearchResultsAnswer. 11273func (sra SearchResultsAnswer) MarshalJSON() ([]byte, error) { 11274 sra.Type = TypeSearchResultsAnswer 11275 objectMap := make(map[string]interface{}) 11276 if sra.Type != "" { 11277 objectMap["_type"] = sra.Type 11278 } 11279 return json.Marshal(objectMap) 11280} 11281 11282// AsImageObject is the BasicResponseBase implementation for SearchResultsAnswer. 11283func (sra SearchResultsAnswer) AsImageObject() (*ImageObject, bool) { 11284 return nil, false 11285} 11286 11287// AsThing is the BasicResponseBase implementation for SearchResultsAnswer. 11288func (sra SearchResultsAnswer) AsThing() (*Thing, bool) { 11289 return nil, false 11290} 11291 11292// AsBasicThing is the BasicResponseBase implementation for SearchResultsAnswer. 11293func (sra SearchResultsAnswer) AsBasicThing() (BasicThing, bool) { 11294 return nil, false 11295} 11296 11297// AsEntities is the BasicResponseBase implementation for SearchResultsAnswer. 11298func (sra SearchResultsAnswer) AsEntities() (*Entities, bool) { 11299 return nil, false 11300} 11301 11302// AsPlaces is the BasicResponseBase implementation for SearchResultsAnswer. 11303func (sra SearchResultsAnswer) AsPlaces() (*Places, bool) { 11304 return nil, false 11305} 11306 11307// AsSearchResponse is the BasicResponseBase implementation for SearchResultsAnswer. 11308func (sra SearchResultsAnswer) AsSearchResponse() (*SearchResponse, bool) { 11309 return nil, false 11310} 11311 11312// AsResponse is the BasicResponseBase implementation for SearchResultsAnswer. 11313func (sra SearchResultsAnswer) AsResponse() (*Response, bool) { 11314 return nil, false 11315} 11316 11317// AsBasicResponse is the BasicResponseBase implementation for SearchResultsAnswer. 11318func (sra SearchResultsAnswer) AsBasicResponse() (BasicResponse, bool) { 11319 return &sra, true 11320} 11321 11322// AsSearchResultsAnswer is the BasicResponseBase implementation for SearchResultsAnswer. 11323func (sra SearchResultsAnswer) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 11324 return &sra, true 11325} 11326 11327// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for SearchResultsAnswer. 11328func (sra SearchResultsAnswer) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 11329 return &sra, true 11330} 11331 11332// AsIdentifiable is the BasicResponseBase implementation for SearchResultsAnswer. 11333func (sra SearchResultsAnswer) AsIdentifiable() (*Identifiable, bool) { 11334 return nil, false 11335} 11336 11337// AsBasicIdentifiable is the BasicResponseBase implementation for SearchResultsAnswer. 11338func (sra SearchResultsAnswer) AsBasicIdentifiable() (BasicIdentifiable, bool) { 11339 return &sra, true 11340} 11341 11342// AsAnswer is the BasicResponseBase implementation for SearchResultsAnswer. 11343func (sra SearchResultsAnswer) AsAnswer() (*Answer, bool) { 11344 return nil, false 11345} 11346 11347// AsBasicAnswer is the BasicResponseBase implementation for SearchResultsAnswer. 11348func (sra SearchResultsAnswer) AsBasicAnswer() (BasicAnswer, bool) { 11349 return &sra, true 11350} 11351 11352// AsErrorResponse is the BasicResponseBase implementation for SearchResultsAnswer. 11353func (sra SearchResultsAnswer) AsErrorResponse() (*ErrorResponse, bool) { 11354 return nil, false 11355} 11356 11357// AsPostalAddress is the BasicResponseBase implementation for SearchResultsAnswer. 11358func (sra SearchResultsAnswer) AsPostalAddress() (*PostalAddress, bool) { 11359 return nil, false 11360} 11361 11362// AsPlace is the BasicResponseBase implementation for SearchResultsAnswer. 11363func (sra SearchResultsAnswer) AsPlace() (*Place, bool) { 11364 return nil, false 11365} 11366 11367// AsBasicPlace is the BasicResponseBase implementation for SearchResultsAnswer. 11368func (sra SearchResultsAnswer) AsBasicPlace() (BasicPlace, bool) { 11369 return nil, false 11370} 11371 11372// AsOrganization is the BasicResponseBase implementation for SearchResultsAnswer. 11373func (sra SearchResultsAnswer) AsOrganization() (*Organization, bool) { 11374 return nil, false 11375} 11376 11377// AsCreativeWork is the BasicResponseBase implementation for SearchResultsAnswer. 11378func (sra SearchResultsAnswer) AsCreativeWork() (*CreativeWork, bool) { 11379 return nil, false 11380} 11381 11382// AsBasicCreativeWork is the BasicResponseBase implementation for SearchResultsAnswer. 11383func (sra SearchResultsAnswer) AsBasicCreativeWork() (BasicCreativeWork, bool) { 11384 return nil, false 11385} 11386 11387// AsIntangible is the BasicResponseBase implementation for SearchResultsAnswer. 11388func (sra SearchResultsAnswer) AsIntangible() (*Intangible, bool) { 11389 return nil, false 11390} 11391 11392// AsBasicIntangible is the BasicResponseBase implementation for SearchResultsAnswer. 11393func (sra SearchResultsAnswer) AsBasicIntangible() (BasicIntangible, bool) { 11394 return nil, false 11395} 11396 11397// AsMovieTheater is the BasicResponseBase implementation for SearchResultsAnswer. 11398func (sra SearchResultsAnswer) AsMovieTheater() (*MovieTheater, bool) { 11399 return nil, false 11400} 11401 11402// AsMediaObject is the BasicResponseBase implementation for SearchResultsAnswer. 11403func (sra SearchResultsAnswer) AsMediaObject() (*MediaObject, bool) { 11404 return nil, false 11405} 11406 11407// AsBasicMediaObject is the BasicResponseBase implementation for SearchResultsAnswer. 11408func (sra SearchResultsAnswer) AsBasicMediaObject() (BasicMediaObject, bool) { 11409 return nil, false 11410} 11411 11412// AsCivicStructure is the BasicResponseBase implementation for SearchResultsAnswer. 11413func (sra SearchResultsAnswer) AsCivicStructure() (*CivicStructure, bool) { 11414 return nil, false 11415} 11416 11417// AsBasicCivicStructure is the BasicResponseBase implementation for SearchResultsAnswer. 11418func (sra SearchResultsAnswer) AsBasicCivicStructure() (BasicCivicStructure, bool) { 11419 return nil, false 11420} 11421 11422// AsLocalBusiness is the BasicResponseBase implementation for SearchResultsAnswer. 11423func (sra SearchResultsAnswer) AsLocalBusiness() (*LocalBusiness, bool) { 11424 return nil, false 11425} 11426 11427// AsBasicLocalBusiness is the BasicResponseBase implementation for SearchResultsAnswer. 11428func (sra SearchResultsAnswer) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 11429 return nil, false 11430} 11431 11432// AsTouristAttraction is the BasicResponseBase implementation for SearchResultsAnswer. 11433func (sra SearchResultsAnswer) AsTouristAttraction() (*TouristAttraction, bool) { 11434 return nil, false 11435} 11436 11437// AsAirport is the BasicResponseBase implementation for SearchResultsAnswer. 11438func (sra SearchResultsAnswer) AsAirport() (*Airport, bool) { 11439 return nil, false 11440} 11441 11442// AsLicense is the BasicResponseBase implementation for SearchResultsAnswer. 11443func (sra SearchResultsAnswer) AsLicense() (*License, bool) { 11444 return nil, false 11445} 11446 11447// AsStructuredValue is the BasicResponseBase implementation for SearchResultsAnswer. 11448func (sra SearchResultsAnswer) AsStructuredValue() (*StructuredValue, bool) { 11449 return nil, false 11450} 11451 11452// AsBasicStructuredValue is the BasicResponseBase implementation for SearchResultsAnswer. 11453func (sra SearchResultsAnswer) AsBasicStructuredValue() (BasicStructuredValue, bool) { 11454 return nil, false 11455} 11456 11457// AsEntertainmentBusiness is the BasicResponseBase implementation for SearchResultsAnswer. 11458func (sra SearchResultsAnswer) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 11459 return nil, false 11460} 11461 11462// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for SearchResultsAnswer. 11463func (sra SearchResultsAnswer) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 11464 return nil, false 11465} 11466 11467// AsFoodEstablishment is the BasicResponseBase implementation for SearchResultsAnswer. 11468func (sra SearchResultsAnswer) AsFoodEstablishment() (*FoodEstablishment, bool) { 11469 return nil, false 11470} 11471 11472// AsBasicFoodEstablishment is the BasicResponseBase implementation for SearchResultsAnswer. 11473func (sra SearchResultsAnswer) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 11474 return nil, false 11475} 11476 11477// AsLodgingBusiness is the BasicResponseBase implementation for SearchResultsAnswer. 11478func (sra SearchResultsAnswer) AsLodgingBusiness() (*LodgingBusiness, bool) { 11479 return nil, false 11480} 11481 11482// AsBasicLodgingBusiness is the BasicResponseBase implementation for SearchResultsAnswer. 11483func (sra SearchResultsAnswer) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 11484 return nil, false 11485} 11486 11487// AsRestaurant is the BasicResponseBase implementation for SearchResultsAnswer. 11488func (sra SearchResultsAnswer) AsRestaurant() (*Restaurant, bool) { 11489 return nil, false 11490} 11491 11492// AsHotel is the BasicResponseBase implementation for SearchResultsAnswer. 11493func (sra SearchResultsAnswer) AsHotel() (*Hotel, bool) { 11494 return nil, false 11495} 11496 11497// AsResponseBase is the BasicResponseBase implementation for SearchResultsAnswer. 11498func (sra SearchResultsAnswer) AsResponseBase() (*ResponseBase, bool) { 11499 return nil, false 11500} 11501 11502// AsBasicResponseBase is the BasicResponseBase implementation for SearchResultsAnswer. 11503func (sra SearchResultsAnswer) AsBasicResponseBase() (BasicResponseBase, bool) { 11504 return &sra, true 11505} 11506 11507// UnmarshalJSON is the custom unmarshaler for SearchResultsAnswer struct. 11508func (sra *SearchResultsAnswer) UnmarshalJSON(body []byte) error { 11509 var m map[string]*json.RawMessage 11510 err := json.Unmarshal(body, &m) 11511 if err != nil { 11512 return err 11513 } 11514 for k, v := range m { 11515 switch k { 11516 case "queryContext": 11517 if v != nil { 11518 var queryContext QueryContext 11519 err = json.Unmarshal(*v, &queryContext) 11520 if err != nil { 11521 return err 11522 } 11523 sra.QueryContext = &queryContext 11524 } 11525 case "contractualRules": 11526 if v != nil { 11527 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 11528 if err != nil { 11529 return err 11530 } 11531 sra.ContractualRules = &contractualRules 11532 } 11533 case "webSearchUrl": 11534 if v != nil { 11535 var webSearchURL string 11536 err = json.Unmarshal(*v, &webSearchURL) 11537 if err != nil { 11538 return err 11539 } 11540 sra.WebSearchURL = &webSearchURL 11541 } 11542 case "id": 11543 if v != nil { 11544 var ID string 11545 err = json.Unmarshal(*v, &ID) 11546 if err != nil { 11547 return err 11548 } 11549 sra.ID = &ID 11550 } 11551 case "_type": 11552 if v != nil { 11553 var typeVar TypeBasicResponseBase 11554 err = json.Unmarshal(*v, &typeVar) 11555 if err != nil { 11556 return err 11557 } 11558 sra.Type = typeVar 11559 } 11560 } 11561 } 11562 11563 return nil 11564} 11565 11566// BasicStructuredValue ... 11567type BasicStructuredValue interface { 11568 AsPostalAddress() (*PostalAddress, bool) 11569 AsStructuredValue() (*StructuredValue, bool) 11570} 11571 11572// StructuredValue ... 11573type StructuredValue struct { 11574 // Name - READ-ONLY; The name of the thing represented by this object. 11575 Name *string `json:"name,omitempty"` 11576 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 11577 URL *string `json:"url,omitempty"` 11578 // Image - READ-ONLY 11579 Image *ImageObject `json:"image,omitempty"` 11580 // Description - READ-ONLY; A short description of the item. 11581 Description *string `json:"description,omitempty"` 11582 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 11583 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 11584 // BingID - READ-ONLY; An ID that uniquely identifies this item. 11585 BingID *string `json:"bingId,omitempty"` 11586 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 11587 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 11588 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 11589 WebSearchURL *string `json:"webSearchUrl,omitempty"` 11590 // ID - READ-ONLY; A String identifier. 11591 ID *string `json:"id,omitempty"` 11592 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 11593 Type TypeBasicResponseBase `json:"_type,omitempty"` 11594} 11595 11596func unmarshalBasicStructuredValue(body []byte) (BasicStructuredValue, error) { 11597 var m map[string]interface{} 11598 err := json.Unmarshal(body, &m) 11599 if err != nil { 11600 return nil, err 11601 } 11602 11603 switch m["_type"] { 11604 case string(TypePostalAddress): 11605 var pa PostalAddress 11606 err := json.Unmarshal(body, &pa) 11607 return pa, err 11608 default: 11609 var sv StructuredValue 11610 err := json.Unmarshal(body, &sv) 11611 return sv, err 11612 } 11613} 11614func unmarshalBasicStructuredValueArray(body []byte) ([]BasicStructuredValue, error) { 11615 var rawMessages []*json.RawMessage 11616 err := json.Unmarshal(body, &rawMessages) 11617 if err != nil { 11618 return nil, err 11619 } 11620 11621 svArray := make([]BasicStructuredValue, len(rawMessages)) 11622 11623 for index, rawMessage := range rawMessages { 11624 sv, err := unmarshalBasicStructuredValue(*rawMessage) 11625 if err != nil { 11626 return nil, err 11627 } 11628 svArray[index] = sv 11629 } 11630 return svArray, nil 11631} 11632 11633// MarshalJSON is the custom marshaler for StructuredValue. 11634func (sv StructuredValue) MarshalJSON() ([]byte, error) { 11635 sv.Type = TypeStructuredValue 11636 objectMap := make(map[string]interface{}) 11637 if sv.Type != "" { 11638 objectMap["_type"] = sv.Type 11639 } 11640 return json.Marshal(objectMap) 11641} 11642 11643// AsImageObject is the BasicResponseBase implementation for StructuredValue. 11644func (sv StructuredValue) AsImageObject() (*ImageObject, bool) { 11645 return nil, false 11646} 11647 11648// AsThing is the BasicResponseBase implementation for StructuredValue. 11649func (sv StructuredValue) AsThing() (*Thing, bool) { 11650 return nil, false 11651} 11652 11653// AsBasicThing is the BasicResponseBase implementation for StructuredValue. 11654func (sv StructuredValue) AsBasicThing() (BasicThing, bool) { 11655 return &sv, true 11656} 11657 11658// AsEntities is the BasicResponseBase implementation for StructuredValue. 11659func (sv StructuredValue) AsEntities() (*Entities, bool) { 11660 return nil, false 11661} 11662 11663// AsPlaces is the BasicResponseBase implementation for StructuredValue. 11664func (sv StructuredValue) AsPlaces() (*Places, bool) { 11665 return nil, false 11666} 11667 11668// AsSearchResponse is the BasicResponseBase implementation for StructuredValue. 11669func (sv StructuredValue) AsSearchResponse() (*SearchResponse, bool) { 11670 return nil, false 11671} 11672 11673// AsResponse is the BasicResponseBase implementation for StructuredValue. 11674func (sv StructuredValue) AsResponse() (*Response, bool) { 11675 return nil, false 11676} 11677 11678// AsBasicResponse is the BasicResponseBase implementation for StructuredValue. 11679func (sv StructuredValue) AsBasicResponse() (BasicResponse, bool) { 11680 return &sv, true 11681} 11682 11683// AsSearchResultsAnswer is the BasicResponseBase implementation for StructuredValue. 11684func (sv StructuredValue) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 11685 return nil, false 11686} 11687 11688// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for StructuredValue. 11689func (sv StructuredValue) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 11690 return nil, false 11691} 11692 11693// AsIdentifiable is the BasicResponseBase implementation for StructuredValue. 11694func (sv StructuredValue) AsIdentifiable() (*Identifiable, bool) { 11695 return nil, false 11696} 11697 11698// AsBasicIdentifiable is the BasicResponseBase implementation for StructuredValue. 11699func (sv StructuredValue) AsBasicIdentifiable() (BasicIdentifiable, bool) { 11700 return &sv, true 11701} 11702 11703// AsAnswer is the BasicResponseBase implementation for StructuredValue. 11704func (sv StructuredValue) AsAnswer() (*Answer, bool) { 11705 return nil, false 11706} 11707 11708// AsBasicAnswer is the BasicResponseBase implementation for StructuredValue. 11709func (sv StructuredValue) AsBasicAnswer() (BasicAnswer, bool) { 11710 return nil, false 11711} 11712 11713// AsErrorResponse is the BasicResponseBase implementation for StructuredValue. 11714func (sv StructuredValue) AsErrorResponse() (*ErrorResponse, bool) { 11715 return nil, false 11716} 11717 11718// AsPostalAddress is the BasicResponseBase implementation for StructuredValue. 11719func (sv StructuredValue) AsPostalAddress() (*PostalAddress, bool) { 11720 return nil, false 11721} 11722 11723// AsPlace is the BasicResponseBase implementation for StructuredValue. 11724func (sv StructuredValue) AsPlace() (*Place, bool) { 11725 return nil, false 11726} 11727 11728// AsBasicPlace is the BasicResponseBase implementation for StructuredValue. 11729func (sv StructuredValue) AsBasicPlace() (BasicPlace, bool) { 11730 return nil, false 11731} 11732 11733// AsOrganization is the BasicResponseBase implementation for StructuredValue. 11734func (sv StructuredValue) AsOrganization() (*Organization, bool) { 11735 return nil, false 11736} 11737 11738// AsCreativeWork is the BasicResponseBase implementation for StructuredValue. 11739func (sv StructuredValue) AsCreativeWork() (*CreativeWork, bool) { 11740 return nil, false 11741} 11742 11743// AsBasicCreativeWork is the BasicResponseBase implementation for StructuredValue. 11744func (sv StructuredValue) AsBasicCreativeWork() (BasicCreativeWork, bool) { 11745 return nil, false 11746} 11747 11748// AsIntangible is the BasicResponseBase implementation for StructuredValue. 11749func (sv StructuredValue) AsIntangible() (*Intangible, bool) { 11750 return nil, false 11751} 11752 11753// AsBasicIntangible is the BasicResponseBase implementation for StructuredValue. 11754func (sv StructuredValue) AsBasicIntangible() (BasicIntangible, bool) { 11755 return &sv, true 11756} 11757 11758// AsMovieTheater is the BasicResponseBase implementation for StructuredValue. 11759func (sv StructuredValue) AsMovieTheater() (*MovieTheater, bool) { 11760 return nil, false 11761} 11762 11763// AsMediaObject is the BasicResponseBase implementation for StructuredValue. 11764func (sv StructuredValue) AsMediaObject() (*MediaObject, bool) { 11765 return nil, false 11766} 11767 11768// AsBasicMediaObject is the BasicResponseBase implementation for StructuredValue. 11769func (sv StructuredValue) AsBasicMediaObject() (BasicMediaObject, bool) { 11770 return nil, false 11771} 11772 11773// AsCivicStructure is the BasicResponseBase implementation for StructuredValue. 11774func (sv StructuredValue) AsCivicStructure() (*CivicStructure, bool) { 11775 return nil, false 11776} 11777 11778// AsBasicCivicStructure is the BasicResponseBase implementation for StructuredValue. 11779func (sv StructuredValue) AsBasicCivicStructure() (BasicCivicStructure, bool) { 11780 return nil, false 11781} 11782 11783// AsLocalBusiness is the BasicResponseBase implementation for StructuredValue. 11784func (sv StructuredValue) AsLocalBusiness() (*LocalBusiness, bool) { 11785 return nil, false 11786} 11787 11788// AsBasicLocalBusiness is the BasicResponseBase implementation for StructuredValue. 11789func (sv StructuredValue) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 11790 return nil, false 11791} 11792 11793// AsTouristAttraction is the BasicResponseBase implementation for StructuredValue. 11794func (sv StructuredValue) AsTouristAttraction() (*TouristAttraction, bool) { 11795 return nil, false 11796} 11797 11798// AsAirport is the BasicResponseBase implementation for StructuredValue. 11799func (sv StructuredValue) AsAirport() (*Airport, bool) { 11800 return nil, false 11801} 11802 11803// AsLicense is the BasicResponseBase implementation for StructuredValue. 11804func (sv StructuredValue) AsLicense() (*License, bool) { 11805 return nil, false 11806} 11807 11808// AsStructuredValue is the BasicResponseBase implementation for StructuredValue. 11809func (sv StructuredValue) AsStructuredValue() (*StructuredValue, bool) { 11810 return &sv, true 11811} 11812 11813// AsBasicStructuredValue is the BasicResponseBase implementation for StructuredValue. 11814func (sv StructuredValue) AsBasicStructuredValue() (BasicStructuredValue, bool) { 11815 return &sv, true 11816} 11817 11818// AsEntertainmentBusiness is the BasicResponseBase implementation for StructuredValue. 11819func (sv StructuredValue) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 11820 return nil, false 11821} 11822 11823// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for StructuredValue. 11824func (sv StructuredValue) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 11825 return nil, false 11826} 11827 11828// AsFoodEstablishment is the BasicResponseBase implementation for StructuredValue. 11829func (sv StructuredValue) AsFoodEstablishment() (*FoodEstablishment, bool) { 11830 return nil, false 11831} 11832 11833// AsBasicFoodEstablishment is the BasicResponseBase implementation for StructuredValue. 11834func (sv StructuredValue) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 11835 return nil, false 11836} 11837 11838// AsLodgingBusiness is the BasicResponseBase implementation for StructuredValue. 11839func (sv StructuredValue) AsLodgingBusiness() (*LodgingBusiness, bool) { 11840 return nil, false 11841} 11842 11843// AsBasicLodgingBusiness is the BasicResponseBase implementation for StructuredValue. 11844func (sv StructuredValue) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 11845 return nil, false 11846} 11847 11848// AsRestaurant is the BasicResponseBase implementation for StructuredValue. 11849func (sv StructuredValue) AsRestaurant() (*Restaurant, bool) { 11850 return nil, false 11851} 11852 11853// AsHotel is the BasicResponseBase implementation for StructuredValue. 11854func (sv StructuredValue) AsHotel() (*Hotel, bool) { 11855 return nil, false 11856} 11857 11858// AsResponseBase is the BasicResponseBase implementation for StructuredValue. 11859func (sv StructuredValue) AsResponseBase() (*ResponseBase, bool) { 11860 return nil, false 11861} 11862 11863// AsBasicResponseBase is the BasicResponseBase implementation for StructuredValue. 11864func (sv StructuredValue) AsBasicResponseBase() (BasicResponseBase, bool) { 11865 return &sv, true 11866} 11867 11868// UnmarshalJSON is the custom unmarshaler for StructuredValue struct. 11869func (sv *StructuredValue) UnmarshalJSON(body []byte) error { 11870 var m map[string]*json.RawMessage 11871 err := json.Unmarshal(body, &m) 11872 if err != nil { 11873 return err 11874 } 11875 for k, v := range m { 11876 switch k { 11877 case "name": 11878 if v != nil { 11879 var name string 11880 err = json.Unmarshal(*v, &name) 11881 if err != nil { 11882 return err 11883 } 11884 sv.Name = &name 11885 } 11886 case "url": 11887 if v != nil { 11888 var URL string 11889 err = json.Unmarshal(*v, &URL) 11890 if err != nil { 11891 return err 11892 } 11893 sv.URL = &URL 11894 } 11895 case "image": 11896 if v != nil { 11897 var imageVar ImageObject 11898 err = json.Unmarshal(*v, &imageVar) 11899 if err != nil { 11900 return err 11901 } 11902 sv.Image = &imageVar 11903 } 11904 case "description": 11905 if v != nil { 11906 var description string 11907 err = json.Unmarshal(*v, &description) 11908 if err != nil { 11909 return err 11910 } 11911 sv.Description = &description 11912 } 11913 case "entityPresentationInfo": 11914 if v != nil { 11915 var entityPresentationInfo EntitiesEntityPresentationInfo 11916 err = json.Unmarshal(*v, &entityPresentationInfo) 11917 if err != nil { 11918 return err 11919 } 11920 sv.EntityPresentationInfo = &entityPresentationInfo 11921 } 11922 case "bingId": 11923 if v != nil { 11924 var bingID string 11925 err = json.Unmarshal(*v, &bingID) 11926 if err != nil { 11927 return err 11928 } 11929 sv.BingID = &bingID 11930 } 11931 case "contractualRules": 11932 if v != nil { 11933 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 11934 if err != nil { 11935 return err 11936 } 11937 sv.ContractualRules = &contractualRules 11938 } 11939 case "webSearchUrl": 11940 if v != nil { 11941 var webSearchURL string 11942 err = json.Unmarshal(*v, &webSearchURL) 11943 if err != nil { 11944 return err 11945 } 11946 sv.WebSearchURL = &webSearchURL 11947 } 11948 case "id": 11949 if v != nil { 11950 var ID string 11951 err = json.Unmarshal(*v, &ID) 11952 if err != nil { 11953 return err 11954 } 11955 sv.ID = &ID 11956 } 11957 case "_type": 11958 if v != nil { 11959 var typeVar TypeBasicResponseBase 11960 err = json.Unmarshal(*v, &typeVar) 11961 if err != nil { 11962 return err 11963 } 11964 sv.Type = typeVar 11965 } 11966 } 11967 } 11968 11969 return nil 11970} 11971 11972// BasicThing ... 11973type BasicThing interface { 11974 AsImageObject() (*ImageObject, bool) 11975 AsPostalAddress() (*PostalAddress, bool) 11976 AsPlace() (*Place, bool) 11977 AsBasicPlace() (BasicPlace, bool) 11978 AsOrganization() (*Organization, bool) 11979 AsCreativeWork() (*CreativeWork, bool) 11980 AsBasicCreativeWork() (BasicCreativeWork, bool) 11981 AsIntangible() (*Intangible, bool) 11982 AsBasicIntangible() (BasicIntangible, bool) 11983 AsMovieTheater() (*MovieTheater, bool) 11984 AsMediaObject() (*MediaObject, bool) 11985 AsBasicMediaObject() (BasicMediaObject, bool) 11986 AsCivicStructure() (*CivicStructure, bool) 11987 AsBasicCivicStructure() (BasicCivicStructure, bool) 11988 AsLocalBusiness() (*LocalBusiness, bool) 11989 AsBasicLocalBusiness() (BasicLocalBusiness, bool) 11990 AsTouristAttraction() (*TouristAttraction, bool) 11991 AsAirport() (*Airport, bool) 11992 AsLicense() (*License, bool) 11993 AsStructuredValue() (*StructuredValue, bool) 11994 AsBasicStructuredValue() (BasicStructuredValue, bool) 11995 AsEntertainmentBusiness() (*EntertainmentBusiness, bool) 11996 AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) 11997 AsFoodEstablishment() (*FoodEstablishment, bool) 11998 AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) 11999 AsLodgingBusiness() (*LodgingBusiness, bool) 12000 AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) 12001 AsRestaurant() (*Restaurant, bool) 12002 AsHotel() (*Hotel, bool) 12003 AsThing() (*Thing, bool) 12004} 12005 12006// Thing ... 12007type Thing struct { 12008 // Name - READ-ONLY; The name of the thing represented by this object. 12009 Name *string `json:"name,omitempty"` 12010 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 12011 URL *string `json:"url,omitempty"` 12012 // Image - READ-ONLY 12013 Image *ImageObject `json:"image,omitempty"` 12014 // Description - READ-ONLY; A short description of the item. 12015 Description *string `json:"description,omitempty"` 12016 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 12017 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 12018 // BingID - READ-ONLY; An ID that uniquely identifies this item. 12019 BingID *string `json:"bingId,omitempty"` 12020 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 12021 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 12022 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 12023 WebSearchURL *string `json:"webSearchUrl,omitempty"` 12024 // ID - READ-ONLY; A String identifier. 12025 ID *string `json:"id,omitempty"` 12026 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 12027 Type TypeBasicResponseBase `json:"_type,omitempty"` 12028} 12029 12030func unmarshalBasicThing(body []byte) (BasicThing, error) { 12031 var m map[string]interface{} 12032 err := json.Unmarshal(body, &m) 12033 if err != nil { 12034 return nil, err 12035 } 12036 12037 switch m["_type"] { 12038 case string(TypeImageObject): 12039 var ioVar ImageObject 12040 err := json.Unmarshal(body, &ioVar) 12041 return ioVar, err 12042 case string(TypePostalAddress): 12043 var pa PostalAddress 12044 err := json.Unmarshal(body, &pa) 12045 return pa, err 12046 case string(TypePlace): 12047 var p Place 12048 err := json.Unmarshal(body, &p) 12049 return p, err 12050 case string(TypeOrganization): 12051 var o Organization 12052 err := json.Unmarshal(body, &o) 12053 return o, err 12054 case string(TypeCreativeWork): 12055 var cw CreativeWork 12056 err := json.Unmarshal(body, &cw) 12057 return cw, err 12058 case string(TypeIntangible): 12059 var i Intangible 12060 err := json.Unmarshal(body, &i) 12061 return i, err 12062 case string(TypeMovieTheater): 12063 var mt MovieTheater 12064 err := json.Unmarshal(body, &mt) 12065 return mt, err 12066 case string(TypeMediaObject): 12067 var mo MediaObject 12068 err := json.Unmarshal(body, &mo) 12069 return mo, err 12070 case string(TypeCivicStructure): 12071 var cs CivicStructure 12072 err := json.Unmarshal(body, &cs) 12073 return cs, err 12074 case string(TypeLocalBusiness): 12075 var lb LocalBusiness 12076 err := json.Unmarshal(body, &lb) 12077 return lb, err 12078 case string(TypeTouristAttraction): 12079 var ta TouristAttraction 12080 err := json.Unmarshal(body, &ta) 12081 return ta, err 12082 case string(TypeAirport): 12083 var a Airport 12084 err := json.Unmarshal(body, &a) 12085 return a, err 12086 case string(TypeLicense): 12087 var l License 12088 err := json.Unmarshal(body, &l) 12089 return l, err 12090 case string(TypeStructuredValue): 12091 var sv StructuredValue 12092 err := json.Unmarshal(body, &sv) 12093 return sv, err 12094 case string(TypeEntertainmentBusiness): 12095 var eb EntertainmentBusiness 12096 err := json.Unmarshal(body, &eb) 12097 return eb, err 12098 case string(TypeFoodEstablishment): 12099 var fe FoodEstablishment 12100 err := json.Unmarshal(body, &fe) 12101 return fe, err 12102 case string(TypeLodgingBusiness): 12103 var lb LodgingBusiness 12104 err := json.Unmarshal(body, &lb) 12105 return lb, err 12106 case string(TypeRestaurant): 12107 var r Restaurant 12108 err := json.Unmarshal(body, &r) 12109 return r, err 12110 case string(TypeHotel): 12111 var h Hotel 12112 err := json.Unmarshal(body, &h) 12113 return h, err 12114 default: 12115 var t Thing 12116 err := json.Unmarshal(body, &t) 12117 return t, err 12118 } 12119} 12120func unmarshalBasicThingArray(body []byte) ([]BasicThing, error) { 12121 var rawMessages []*json.RawMessage 12122 err := json.Unmarshal(body, &rawMessages) 12123 if err != nil { 12124 return nil, err 12125 } 12126 12127 tArray := make([]BasicThing, len(rawMessages)) 12128 12129 for index, rawMessage := range rawMessages { 12130 t, err := unmarshalBasicThing(*rawMessage) 12131 if err != nil { 12132 return nil, err 12133 } 12134 tArray[index] = t 12135 } 12136 return tArray, nil 12137} 12138 12139// MarshalJSON is the custom marshaler for Thing. 12140func (t Thing) MarshalJSON() ([]byte, error) { 12141 t.Type = TypeThing 12142 objectMap := make(map[string]interface{}) 12143 if t.Type != "" { 12144 objectMap["_type"] = t.Type 12145 } 12146 return json.Marshal(objectMap) 12147} 12148 12149// AsImageObject is the BasicResponseBase implementation for Thing. 12150func (t Thing) AsImageObject() (*ImageObject, bool) { 12151 return nil, false 12152} 12153 12154// AsThing is the BasicResponseBase implementation for Thing. 12155func (t Thing) AsThing() (*Thing, bool) { 12156 return &t, true 12157} 12158 12159// AsBasicThing is the BasicResponseBase implementation for Thing. 12160func (t Thing) AsBasicThing() (BasicThing, bool) { 12161 return &t, true 12162} 12163 12164// AsEntities is the BasicResponseBase implementation for Thing. 12165func (t Thing) AsEntities() (*Entities, bool) { 12166 return nil, false 12167} 12168 12169// AsPlaces is the BasicResponseBase implementation for Thing. 12170func (t Thing) AsPlaces() (*Places, bool) { 12171 return nil, false 12172} 12173 12174// AsSearchResponse is the BasicResponseBase implementation for Thing. 12175func (t Thing) AsSearchResponse() (*SearchResponse, bool) { 12176 return nil, false 12177} 12178 12179// AsResponse is the BasicResponseBase implementation for Thing. 12180func (t Thing) AsResponse() (*Response, bool) { 12181 return nil, false 12182} 12183 12184// AsBasicResponse is the BasicResponseBase implementation for Thing. 12185func (t Thing) AsBasicResponse() (BasicResponse, bool) { 12186 return &t, true 12187} 12188 12189// AsSearchResultsAnswer is the BasicResponseBase implementation for Thing. 12190func (t Thing) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 12191 return nil, false 12192} 12193 12194// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for Thing. 12195func (t Thing) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 12196 return nil, false 12197} 12198 12199// AsIdentifiable is the BasicResponseBase implementation for Thing. 12200func (t Thing) AsIdentifiable() (*Identifiable, bool) { 12201 return nil, false 12202} 12203 12204// AsBasicIdentifiable is the BasicResponseBase implementation for Thing. 12205func (t Thing) AsBasicIdentifiable() (BasicIdentifiable, bool) { 12206 return &t, true 12207} 12208 12209// AsAnswer is the BasicResponseBase implementation for Thing. 12210func (t Thing) AsAnswer() (*Answer, bool) { 12211 return nil, false 12212} 12213 12214// AsBasicAnswer is the BasicResponseBase implementation for Thing. 12215func (t Thing) AsBasicAnswer() (BasicAnswer, bool) { 12216 return nil, false 12217} 12218 12219// AsErrorResponse is the BasicResponseBase implementation for Thing. 12220func (t Thing) AsErrorResponse() (*ErrorResponse, bool) { 12221 return nil, false 12222} 12223 12224// AsPostalAddress is the BasicResponseBase implementation for Thing. 12225func (t Thing) AsPostalAddress() (*PostalAddress, bool) { 12226 return nil, false 12227} 12228 12229// AsPlace is the BasicResponseBase implementation for Thing. 12230func (t Thing) AsPlace() (*Place, bool) { 12231 return nil, false 12232} 12233 12234// AsBasicPlace is the BasicResponseBase implementation for Thing. 12235func (t Thing) AsBasicPlace() (BasicPlace, bool) { 12236 return nil, false 12237} 12238 12239// AsOrganization is the BasicResponseBase implementation for Thing. 12240func (t Thing) AsOrganization() (*Organization, bool) { 12241 return nil, false 12242} 12243 12244// AsCreativeWork is the BasicResponseBase implementation for Thing. 12245func (t Thing) AsCreativeWork() (*CreativeWork, bool) { 12246 return nil, false 12247} 12248 12249// AsBasicCreativeWork is the BasicResponseBase implementation for Thing. 12250func (t Thing) AsBasicCreativeWork() (BasicCreativeWork, bool) { 12251 return nil, false 12252} 12253 12254// AsIntangible is the BasicResponseBase implementation for Thing. 12255func (t Thing) AsIntangible() (*Intangible, bool) { 12256 return nil, false 12257} 12258 12259// AsBasicIntangible is the BasicResponseBase implementation for Thing. 12260func (t Thing) AsBasicIntangible() (BasicIntangible, bool) { 12261 return nil, false 12262} 12263 12264// AsMovieTheater is the BasicResponseBase implementation for Thing. 12265func (t Thing) AsMovieTheater() (*MovieTheater, bool) { 12266 return nil, false 12267} 12268 12269// AsMediaObject is the BasicResponseBase implementation for Thing. 12270func (t Thing) AsMediaObject() (*MediaObject, bool) { 12271 return nil, false 12272} 12273 12274// AsBasicMediaObject is the BasicResponseBase implementation for Thing. 12275func (t Thing) AsBasicMediaObject() (BasicMediaObject, bool) { 12276 return nil, false 12277} 12278 12279// AsCivicStructure is the BasicResponseBase implementation for Thing. 12280func (t Thing) AsCivicStructure() (*CivicStructure, bool) { 12281 return nil, false 12282} 12283 12284// AsBasicCivicStructure is the BasicResponseBase implementation for Thing. 12285func (t Thing) AsBasicCivicStructure() (BasicCivicStructure, bool) { 12286 return nil, false 12287} 12288 12289// AsLocalBusiness is the BasicResponseBase implementation for Thing. 12290func (t Thing) AsLocalBusiness() (*LocalBusiness, bool) { 12291 return nil, false 12292} 12293 12294// AsBasicLocalBusiness is the BasicResponseBase implementation for Thing. 12295func (t Thing) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 12296 return nil, false 12297} 12298 12299// AsTouristAttraction is the BasicResponseBase implementation for Thing. 12300func (t Thing) AsTouristAttraction() (*TouristAttraction, bool) { 12301 return nil, false 12302} 12303 12304// AsAirport is the BasicResponseBase implementation for Thing. 12305func (t Thing) AsAirport() (*Airport, bool) { 12306 return nil, false 12307} 12308 12309// AsLicense is the BasicResponseBase implementation for Thing. 12310func (t Thing) AsLicense() (*License, bool) { 12311 return nil, false 12312} 12313 12314// AsStructuredValue is the BasicResponseBase implementation for Thing. 12315func (t Thing) AsStructuredValue() (*StructuredValue, bool) { 12316 return nil, false 12317} 12318 12319// AsBasicStructuredValue is the BasicResponseBase implementation for Thing. 12320func (t Thing) AsBasicStructuredValue() (BasicStructuredValue, bool) { 12321 return nil, false 12322} 12323 12324// AsEntertainmentBusiness is the BasicResponseBase implementation for Thing. 12325func (t Thing) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 12326 return nil, false 12327} 12328 12329// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for Thing. 12330func (t Thing) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 12331 return nil, false 12332} 12333 12334// AsFoodEstablishment is the BasicResponseBase implementation for Thing. 12335func (t Thing) AsFoodEstablishment() (*FoodEstablishment, bool) { 12336 return nil, false 12337} 12338 12339// AsBasicFoodEstablishment is the BasicResponseBase implementation for Thing. 12340func (t Thing) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 12341 return nil, false 12342} 12343 12344// AsLodgingBusiness is the BasicResponseBase implementation for Thing. 12345func (t Thing) AsLodgingBusiness() (*LodgingBusiness, bool) { 12346 return nil, false 12347} 12348 12349// AsBasicLodgingBusiness is the BasicResponseBase implementation for Thing. 12350func (t Thing) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 12351 return nil, false 12352} 12353 12354// AsRestaurant is the BasicResponseBase implementation for Thing. 12355func (t Thing) AsRestaurant() (*Restaurant, bool) { 12356 return nil, false 12357} 12358 12359// AsHotel is the BasicResponseBase implementation for Thing. 12360func (t Thing) AsHotel() (*Hotel, bool) { 12361 return nil, false 12362} 12363 12364// AsResponseBase is the BasicResponseBase implementation for Thing. 12365func (t Thing) AsResponseBase() (*ResponseBase, bool) { 12366 return nil, false 12367} 12368 12369// AsBasicResponseBase is the BasicResponseBase implementation for Thing. 12370func (t Thing) AsBasicResponseBase() (BasicResponseBase, bool) { 12371 return &t, true 12372} 12373 12374// UnmarshalJSON is the custom unmarshaler for Thing struct. 12375func (t *Thing) UnmarshalJSON(body []byte) error { 12376 var m map[string]*json.RawMessage 12377 err := json.Unmarshal(body, &m) 12378 if err != nil { 12379 return err 12380 } 12381 for k, v := range m { 12382 switch k { 12383 case "name": 12384 if v != nil { 12385 var name string 12386 err = json.Unmarshal(*v, &name) 12387 if err != nil { 12388 return err 12389 } 12390 t.Name = &name 12391 } 12392 case "url": 12393 if v != nil { 12394 var URL string 12395 err = json.Unmarshal(*v, &URL) 12396 if err != nil { 12397 return err 12398 } 12399 t.URL = &URL 12400 } 12401 case "image": 12402 if v != nil { 12403 var imageVar ImageObject 12404 err = json.Unmarshal(*v, &imageVar) 12405 if err != nil { 12406 return err 12407 } 12408 t.Image = &imageVar 12409 } 12410 case "description": 12411 if v != nil { 12412 var description string 12413 err = json.Unmarshal(*v, &description) 12414 if err != nil { 12415 return err 12416 } 12417 t.Description = &description 12418 } 12419 case "entityPresentationInfo": 12420 if v != nil { 12421 var entityPresentationInfo EntitiesEntityPresentationInfo 12422 err = json.Unmarshal(*v, &entityPresentationInfo) 12423 if err != nil { 12424 return err 12425 } 12426 t.EntityPresentationInfo = &entityPresentationInfo 12427 } 12428 case "bingId": 12429 if v != nil { 12430 var bingID string 12431 err = json.Unmarshal(*v, &bingID) 12432 if err != nil { 12433 return err 12434 } 12435 t.BingID = &bingID 12436 } 12437 case "contractualRules": 12438 if v != nil { 12439 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 12440 if err != nil { 12441 return err 12442 } 12443 t.ContractualRules = &contractualRules 12444 } 12445 case "webSearchUrl": 12446 if v != nil { 12447 var webSearchURL string 12448 err = json.Unmarshal(*v, &webSearchURL) 12449 if err != nil { 12450 return err 12451 } 12452 t.WebSearchURL = &webSearchURL 12453 } 12454 case "id": 12455 if v != nil { 12456 var ID string 12457 err = json.Unmarshal(*v, &ID) 12458 if err != nil { 12459 return err 12460 } 12461 t.ID = &ID 12462 } 12463 case "_type": 12464 if v != nil { 12465 var typeVar TypeBasicResponseBase 12466 err = json.Unmarshal(*v, &typeVar) 12467 if err != nil { 12468 return err 12469 } 12470 t.Type = typeVar 12471 } 12472 } 12473 } 12474 12475 return nil 12476} 12477 12478// TouristAttraction ... 12479type TouristAttraction struct { 12480 // Address - READ-ONLY; The postal address of where the entity is located 12481 Address *PostalAddress `json:"address,omitempty"` 12482 // Telephone - READ-ONLY; The entity's telephone number 12483 Telephone *string `json:"telephone,omitempty"` 12484 // Name - READ-ONLY; The name of the thing represented by this object. 12485 Name *string `json:"name,omitempty"` 12486 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 12487 URL *string `json:"url,omitempty"` 12488 // Image - READ-ONLY 12489 Image *ImageObject `json:"image,omitempty"` 12490 // Description - READ-ONLY; A short description of the item. 12491 Description *string `json:"description,omitempty"` 12492 // EntityPresentationInfo - READ-ONLY; Additional information about the entity such as hints that you can use to determine the entity's type. To determine the entity's type, use the entityScenario and entityTypeHint fields. 12493 EntityPresentationInfo *EntitiesEntityPresentationInfo `json:"entityPresentationInfo,omitempty"` 12494 // BingID - READ-ONLY; An ID that uniquely identifies this item. 12495 BingID *string `json:"bingId,omitempty"` 12496 // ContractualRules - READ-ONLY; A list of rules that you must adhere to if you display the item. 12497 ContractualRules *[]BasicContractualRulesContractualRule `json:"contractualRules,omitempty"` 12498 // WebSearchURL - READ-ONLY; The URL To Bing's search result for this item. 12499 WebSearchURL *string `json:"webSearchUrl,omitempty"` 12500 // ID - READ-ONLY; A String identifier. 12501 ID *string `json:"id,omitempty"` 12502 // Type - Possible values include: 'TypeResponseBase', 'TypeImageObject', 'TypeThing', 'TypeEntities', 'TypePlaces', 'TypeSearchResponse', 'TypeResponse', 'TypeSearchResultsAnswer', 'TypeIdentifiable', 'TypeAnswer', 'TypeErrorResponse', 'TypePostalAddress', 'TypePlace', 'TypeOrganization', 'TypeCreativeWork', 'TypeIntangible', 'TypeMovieTheater', 'TypeMediaObject', 'TypeCivicStructure', 'TypeLocalBusiness', 'TypeTouristAttraction', 'TypeAirport', 'TypeLicense', 'TypeStructuredValue', 'TypeEntertainmentBusiness', 'TypeFoodEstablishment', 'TypeLodgingBusiness', 'TypeRestaurant', 'TypeHotel' 12503 Type TypeBasicResponseBase `json:"_type,omitempty"` 12504} 12505 12506// MarshalJSON is the custom marshaler for TouristAttraction. 12507func (ta TouristAttraction) MarshalJSON() ([]byte, error) { 12508 ta.Type = TypeTouristAttraction 12509 objectMap := make(map[string]interface{}) 12510 if ta.Type != "" { 12511 objectMap["_type"] = ta.Type 12512 } 12513 return json.Marshal(objectMap) 12514} 12515 12516// AsImageObject is the BasicResponseBase implementation for TouristAttraction. 12517func (ta TouristAttraction) AsImageObject() (*ImageObject, bool) { 12518 return nil, false 12519} 12520 12521// AsThing is the BasicResponseBase implementation for TouristAttraction. 12522func (ta TouristAttraction) AsThing() (*Thing, bool) { 12523 return nil, false 12524} 12525 12526// AsBasicThing is the BasicResponseBase implementation for TouristAttraction. 12527func (ta TouristAttraction) AsBasicThing() (BasicThing, bool) { 12528 return &ta, true 12529} 12530 12531// AsEntities is the BasicResponseBase implementation for TouristAttraction. 12532func (ta TouristAttraction) AsEntities() (*Entities, bool) { 12533 return nil, false 12534} 12535 12536// AsPlaces is the BasicResponseBase implementation for TouristAttraction. 12537func (ta TouristAttraction) AsPlaces() (*Places, bool) { 12538 return nil, false 12539} 12540 12541// AsSearchResponse is the BasicResponseBase implementation for TouristAttraction. 12542func (ta TouristAttraction) AsSearchResponse() (*SearchResponse, bool) { 12543 return nil, false 12544} 12545 12546// AsResponse is the BasicResponseBase implementation for TouristAttraction. 12547func (ta TouristAttraction) AsResponse() (*Response, bool) { 12548 return nil, false 12549} 12550 12551// AsBasicResponse is the BasicResponseBase implementation for TouristAttraction. 12552func (ta TouristAttraction) AsBasicResponse() (BasicResponse, bool) { 12553 return &ta, true 12554} 12555 12556// AsSearchResultsAnswer is the BasicResponseBase implementation for TouristAttraction. 12557func (ta TouristAttraction) AsSearchResultsAnswer() (*SearchResultsAnswer, bool) { 12558 return nil, false 12559} 12560 12561// AsBasicSearchResultsAnswer is the BasicResponseBase implementation for TouristAttraction. 12562func (ta TouristAttraction) AsBasicSearchResultsAnswer() (BasicSearchResultsAnswer, bool) { 12563 return nil, false 12564} 12565 12566// AsIdentifiable is the BasicResponseBase implementation for TouristAttraction. 12567func (ta TouristAttraction) AsIdentifiable() (*Identifiable, bool) { 12568 return nil, false 12569} 12570 12571// AsBasicIdentifiable is the BasicResponseBase implementation for TouristAttraction. 12572func (ta TouristAttraction) AsBasicIdentifiable() (BasicIdentifiable, bool) { 12573 return &ta, true 12574} 12575 12576// AsAnswer is the BasicResponseBase implementation for TouristAttraction. 12577func (ta TouristAttraction) AsAnswer() (*Answer, bool) { 12578 return nil, false 12579} 12580 12581// AsBasicAnswer is the BasicResponseBase implementation for TouristAttraction. 12582func (ta TouristAttraction) AsBasicAnswer() (BasicAnswer, bool) { 12583 return nil, false 12584} 12585 12586// AsErrorResponse is the BasicResponseBase implementation for TouristAttraction. 12587func (ta TouristAttraction) AsErrorResponse() (*ErrorResponse, bool) { 12588 return nil, false 12589} 12590 12591// AsPostalAddress is the BasicResponseBase implementation for TouristAttraction. 12592func (ta TouristAttraction) AsPostalAddress() (*PostalAddress, bool) { 12593 return nil, false 12594} 12595 12596// AsPlace is the BasicResponseBase implementation for TouristAttraction. 12597func (ta TouristAttraction) AsPlace() (*Place, bool) { 12598 return nil, false 12599} 12600 12601// AsBasicPlace is the BasicResponseBase implementation for TouristAttraction. 12602func (ta TouristAttraction) AsBasicPlace() (BasicPlace, bool) { 12603 return &ta, true 12604} 12605 12606// AsOrganization is the BasicResponseBase implementation for TouristAttraction. 12607func (ta TouristAttraction) AsOrganization() (*Organization, bool) { 12608 return nil, false 12609} 12610 12611// AsCreativeWork is the BasicResponseBase implementation for TouristAttraction. 12612func (ta TouristAttraction) AsCreativeWork() (*CreativeWork, bool) { 12613 return nil, false 12614} 12615 12616// AsBasicCreativeWork is the BasicResponseBase implementation for TouristAttraction. 12617func (ta TouristAttraction) AsBasicCreativeWork() (BasicCreativeWork, bool) { 12618 return nil, false 12619} 12620 12621// AsIntangible is the BasicResponseBase implementation for TouristAttraction. 12622func (ta TouristAttraction) AsIntangible() (*Intangible, bool) { 12623 return nil, false 12624} 12625 12626// AsBasicIntangible is the BasicResponseBase implementation for TouristAttraction. 12627func (ta TouristAttraction) AsBasicIntangible() (BasicIntangible, bool) { 12628 return nil, false 12629} 12630 12631// AsMovieTheater is the BasicResponseBase implementation for TouristAttraction. 12632func (ta TouristAttraction) AsMovieTheater() (*MovieTheater, bool) { 12633 return nil, false 12634} 12635 12636// AsMediaObject is the BasicResponseBase implementation for TouristAttraction. 12637func (ta TouristAttraction) AsMediaObject() (*MediaObject, bool) { 12638 return nil, false 12639} 12640 12641// AsBasicMediaObject is the BasicResponseBase implementation for TouristAttraction. 12642func (ta TouristAttraction) AsBasicMediaObject() (BasicMediaObject, bool) { 12643 return nil, false 12644} 12645 12646// AsCivicStructure is the BasicResponseBase implementation for TouristAttraction. 12647func (ta TouristAttraction) AsCivicStructure() (*CivicStructure, bool) { 12648 return nil, false 12649} 12650 12651// AsBasicCivicStructure is the BasicResponseBase implementation for TouristAttraction. 12652func (ta TouristAttraction) AsBasicCivicStructure() (BasicCivicStructure, bool) { 12653 return nil, false 12654} 12655 12656// AsLocalBusiness is the BasicResponseBase implementation for TouristAttraction. 12657func (ta TouristAttraction) AsLocalBusiness() (*LocalBusiness, bool) { 12658 return nil, false 12659} 12660 12661// AsBasicLocalBusiness is the BasicResponseBase implementation for TouristAttraction. 12662func (ta TouristAttraction) AsBasicLocalBusiness() (BasicLocalBusiness, bool) { 12663 return nil, false 12664} 12665 12666// AsTouristAttraction is the BasicResponseBase implementation for TouristAttraction. 12667func (ta TouristAttraction) AsTouristAttraction() (*TouristAttraction, bool) { 12668 return &ta, true 12669} 12670 12671// AsAirport is the BasicResponseBase implementation for TouristAttraction. 12672func (ta TouristAttraction) AsAirport() (*Airport, bool) { 12673 return nil, false 12674} 12675 12676// AsLicense is the BasicResponseBase implementation for TouristAttraction. 12677func (ta TouristAttraction) AsLicense() (*License, bool) { 12678 return nil, false 12679} 12680 12681// AsStructuredValue is the BasicResponseBase implementation for TouristAttraction. 12682func (ta TouristAttraction) AsStructuredValue() (*StructuredValue, bool) { 12683 return nil, false 12684} 12685 12686// AsBasicStructuredValue is the BasicResponseBase implementation for TouristAttraction. 12687func (ta TouristAttraction) AsBasicStructuredValue() (BasicStructuredValue, bool) { 12688 return nil, false 12689} 12690 12691// AsEntertainmentBusiness is the BasicResponseBase implementation for TouristAttraction. 12692func (ta TouristAttraction) AsEntertainmentBusiness() (*EntertainmentBusiness, bool) { 12693 return nil, false 12694} 12695 12696// AsBasicEntertainmentBusiness is the BasicResponseBase implementation for TouristAttraction. 12697func (ta TouristAttraction) AsBasicEntertainmentBusiness() (BasicEntertainmentBusiness, bool) { 12698 return nil, false 12699} 12700 12701// AsFoodEstablishment is the BasicResponseBase implementation for TouristAttraction. 12702func (ta TouristAttraction) AsFoodEstablishment() (*FoodEstablishment, bool) { 12703 return nil, false 12704} 12705 12706// AsBasicFoodEstablishment is the BasicResponseBase implementation for TouristAttraction. 12707func (ta TouristAttraction) AsBasicFoodEstablishment() (BasicFoodEstablishment, bool) { 12708 return nil, false 12709} 12710 12711// AsLodgingBusiness is the BasicResponseBase implementation for TouristAttraction. 12712func (ta TouristAttraction) AsLodgingBusiness() (*LodgingBusiness, bool) { 12713 return nil, false 12714} 12715 12716// AsBasicLodgingBusiness is the BasicResponseBase implementation for TouristAttraction. 12717func (ta TouristAttraction) AsBasicLodgingBusiness() (BasicLodgingBusiness, bool) { 12718 return nil, false 12719} 12720 12721// AsRestaurant is the BasicResponseBase implementation for TouristAttraction. 12722func (ta TouristAttraction) AsRestaurant() (*Restaurant, bool) { 12723 return nil, false 12724} 12725 12726// AsHotel is the BasicResponseBase implementation for TouristAttraction. 12727func (ta TouristAttraction) AsHotel() (*Hotel, bool) { 12728 return nil, false 12729} 12730 12731// AsResponseBase is the BasicResponseBase implementation for TouristAttraction. 12732func (ta TouristAttraction) AsResponseBase() (*ResponseBase, bool) { 12733 return nil, false 12734} 12735 12736// AsBasicResponseBase is the BasicResponseBase implementation for TouristAttraction. 12737func (ta TouristAttraction) AsBasicResponseBase() (BasicResponseBase, bool) { 12738 return &ta, true 12739} 12740 12741// UnmarshalJSON is the custom unmarshaler for TouristAttraction struct. 12742func (ta *TouristAttraction) UnmarshalJSON(body []byte) error { 12743 var m map[string]*json.RawMessage 12744 err := json.Unmarshal(body, &m) 12745 if err != nil { 12746 return err 12747 } 12748 for k, v := range m { 12749 switch k { 12750 case "address": 12751 if v != nil { 12752 var address PostalAddress 12753 err = json.Unmarshal(*v, &address) 12754 if err != nil { 12755 return err 12756 } 12757 ta.Address = &address 12758 } 12759 case "telephone": 12760 if v != nil { 12761 var telephone string 12762 err = json.Unmarshal(*v, &telephone) 12763 if err != nil { 12764 return err 12765 } 12766 ta.Telephone = &telephone 12767 } 12768 case "name": 12769 if v != nil { 12770 var name string 12771 err = json.Unmarshal(*v, &name) 12772 if err != nil { 12773 return err 12774 } 12775 ta.Name = &name 12776 } 12777 case "url": 12778 if v != nil { 12779 var URL string 12780 err = json.Unmarshal(*v, &URL) 12781 if err != nil { 12782 return err 12783 } 12784 ta.URL = &URL 12785 } 12786 case "image": 12787 if v != nil { 12788 var imageVar ImageObject 12789 err = json.Unmarshal(*v, &imageVar) 12790 if err != nil { 12791 return err 12792 } 12793 ta.Image = &imageVar 12794 } 12795 case "description": 12796 if v != nil { 12797 var description string 12798 err = json.Unmarshal(*v, &description) 12799 if err != nil { 12800 return err 12801 } 12802 ta.Description = &description 12803 } 12804 case "entityPresentationInfo": 12805 if v != nil { 12806 var entityPresentationInfo EntitiesEntityPresentationInfo 12807 err = json.Unmarshal(*v, &entityPresentationInfo) 12808 if err != nil { 12809 return err 12810 } 12811 ta.EntityPresentationInfo = &entityPresentationInfo 12812 } 12813 case "bingId": 12814 if v != nil { 12815 var bingID string 12816 err = json.Unmarshal(*v, &bingID) 12817 if err != nil { 12818 return err 12819 } 12820 ta.BingID = &bingID 12821 } 12822 case "contractualRules": 12823 if v != nil { 12824 contractualRules, err := unmarshalBasicContractualRulesContractualRuleArray(*v) 12825 if err != nil { 12826 return err 12827 } 12828 ta.ContractualRules = &contractualRules 12829 } 12830 case "webSearchUrl": 12831 if v != nil { 12832 var webSearchURL string 12833 err = json.Unmarshal(*v, &webSearchURL) 12834 if err != nil { 12835 return err 12836 } 12837 ta.WebSearchURL = &webSearchURL 12838 } 12839 case "id": 12840 if v != nil { 12841 var ID string 12842 err = json.Unmarshal(*v, &ID) 12843 if err != nil { 12844 return err 12845 } 12846 ta.ID = &ID 12847 } 12848 case "_type": 12849 if v != nil { 12850 var typeVar TypeBasicResponseBase 12851 err = json.Unmarshal(*v, &typeVar) 12852 if err != nil { 12853 return err 12854 } 12855 ta.Type = typeVar 12856 } 12857 } 12858 } 12859 12860 return nil 12861} 12862