1package visualsearch 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "encoding/json" 22 "github.com/Azure/go-autorest/autorest" 23) 24 25// The package's fully qualified name. 26const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/cognitiveservices/v1.0/visualsearch" 27 28// Currency enumerates the values for currency. 29type Currency string 30 31const ( 32 // AED ... 33 AED Currency = "AED" 34 // AFN ... 35 AFN Currency = "AFN" 36 // ALL ... 37 ALL Currency = "ALL" 38 // AMD ... 39 AMD Currency = "AMD" 40 // ANG ... 41 ANG Currency = "ANG" 42 // AOA ... 43 AOA Currency = "AOA" 44 // ARS ... 45 ARS Currency = "ARS" 46 // AUD ... 47 AUD Currency = "AUD" 48 // AWG ... 49 AWG Currency = "AWG" 50 // AZN ... 51 AZN Currency = "AZN" 52 // BAM ... 53 BAM Currency = "BAM" 54 // BBD ... 55 BBD Currency = "BBD" 56 // BDT ... 57 BDT Currency = "BDT" 58 // BGN ... 59 BGN Currency = "BGN" 60 // BHD ... 61 BHD Currency = "BHD" 62 // BIF ... 63 BIF Currency = "BIF" 64 // BMD ... 65 BMD Currency = "BMD" 66 // BND ... 67 BND Currency = "BND" 68 // BOB ... 69 BOB Currency = "BOB" 70 // BOV ... 71 BOV Currency = "BOV" 72 // BRL ... 73 BRL Currency = "BRL" 74 // BSD ... 75 BSD Currency = "BSD" 76 // BTN ... 77 BTN Currency = "BTN" 78 // BWP ... 79 BWP Currency = "BWP" 80 // BYR ... 81 BYR Currency = "BYR" 82 // BZD ... 83 BZD Currency = "BZD" 84 // CAD ... 85 CAD Currency = "CAD" 86 // CDF ... 87 CDF Currency = "CDF" 88 // CHE ... 89 CHE Currency = "CHE" 90 // CHF ... 91 CHF Currency = "CHF" 92 // CHW ... 93 CHW Currency = "CHW" 94 // CLF ... 95 CLF Currency = "CLF" 96 // CLP ... 97 CLP Currency = "CLP" 98 // CNY ... 99 CNY Currency = "CNY" 100 // COP ... 101 COP Currency = "COP" 102 // COU ... 103 COU Currency = "COU" 104 // CRC ... 105 CRC Currency = "CRC" 106 // CUC ... 107 CUC Currency = "CUC" 108 // CUP ... 109 CUP Currency = "CUP" 110 // CVE ... 111 CVE Currency = "CVE" 112 // CZK ... 113 CZK Currency = "CZK" 114 // DJF ... 115 DJF Currency = "DJF" 116 // DKK ... 117 DKK Currency = "DKK" 118 // DOP ... 119 DOP Currency = "DOP" 120 // DZD ... 121 DZD Currency = "DZD" 122 // EGP ... 123 EGP Currency = "EGP" 124 // ERN ... 125 ERN Currency = "ERN" 126 // ETB ... 127 ETB Currency = "ETB" 128 // EUR ... 129 EUR Currency = "EUR" 130 // FJD ... 131 FJD Currency = "FJD" 132 // FKP ... 133 FKP Currency = "FKP" 134 // GBP ... 135 GBP Currency = "GBP" 136 // GEL ... 137 GEL Currency = "GEL" 138 // GHS ... 139 GHS Currency = "GHS" 140 // GIP ... 141 GIP Currency = "GIP" 142 // GMD ... 143 GMD Currency = "GMD" 144 // GNF ... 145 GNF Currency = "GNF" 146 // GTQ ... 147 GTQ Currency = "GTQ" 148 // GYD ... 149 GYD Currency = "GYD" 150 // HKD ... 151 HKD Currency = "HKD" 152 // HNL ... 153 HNL Currency = "HNL" 154 // HRK ... 155 HRK Currency = "HRK" 156 // HTG ... 157 HTG Currency = "HTG" 158 // HUF ... 159 HUF Currency = "HUF" 160 // IDR ... 161 IDR Currency = "IDR" 162 // ILS ... 163 ILS Currency = "ILS" 164 // INR ... 165 INR Currency = "INR" 166 // IQD ... 167 IQD Currency = "IQD" 168 // IRR ... 169 IRR Currency = "IRR" 170 // ISK ... 171 ISK Currency = "ISK" 172 // JMD ... 173 JMD Currency = "JMD" 174 // JOD ... 175 JOD Currency = "JOD" 176 // JPY ... 177 JPY Currency = "JPY" 178 // KES ... 179 KES Currency = "KES" 180 // KGS ... 181 KGS Currency = "KGS" 182 // KHR ... 183 KHR Currency = "KHR" 184 // KMF ... 185 KMF Currency = "KMF" 186 // KPW ... 187 KPW Currency = "KPW" 188 // KRW ... 189 KRW Currency = "KRW" 190 // KWD ... 191 KWD Currency = "KWD" 192 // KYD ... 193 KYD Currency = "KYD" 194 // KZT ... 195 KZT Currency = "KZT" 196 // LAK ... 197 LAK Currency = "LAK" 198 // LBP ... 199 LBP Currency = "LBP" 200 // LKR ... 201 LKR Currency = "LKR" 202 // LRD ... 203 LRD Currency = "LRD" 204 // LSL ... 205 LSL Currency = "LSL" 206 // LYD ... 207 LYD Currency = "LYD" 208 // MAD ... 209 MAD Currency = "MAD" 210 // MDL ... 211 MDL Currency = "MDL" 212 // MGA ... 213 MGA Currency = "MGA" 214 // MKD ... 215 MKD Currency = "MKD" 216 // MMK ... 217 MMK Currency = "MMK" 218 // MNT ... 219 MNT Currency = "MNT" 220 // MOP ... 221 MOP Currency = "MOP" 222 // MRO ... 223 MRO Currency = "MRO" 224 // MUR ... 225 MUR Currency = "MUR" 226 // MVR ... 227 MVR Currency = "MVR" 228 // MWK ... 229 MWK Currency = "MWK" 230 // MXN ... 231 MXN Currency = "MXN" 232 // MXV ... 233 MXV Currency = "MXV" 234 // MYR ... 235 MYR Currency = "MYR" 236 // MZN ... 237 MZN Currency = "MZN" 238 // NAD ... 239 NAD Currency = "NAD" 240 // NGN ... 241 NGN Currency = "NGN" 242 // NIO ... 243 NIO Currency = "NIO" 244 // NOK ... 245 NOK Currency = "NOK" 246 // NPR ... 247 NPR Currency = "NPR" 248 // NZD ... 249 NZD Currency = "NZD" 250 // OMR ... 251 OMR Currency = "OMR" 252 // PAB ... 253 PAB Currency = "PAB" 254 // PEN ... 255 PEN Currency = "PEN" 256 // PGK ... 257 PGK Currency = "PGK" 258 // PHP ... 259 PHP Currency = "PHP" 260 // PKR ... 261 PKR Currency = "PKR" 262 // PLN ... 263 PLN Currency = "PLN" 264 // PYG ... 265 PYG Currency = "PYG" 266 // QAR ... 267 QAR Currency = "QAR" 268 // RON ... 269 RON Currency = "RON" 270 // RSD ... 271 RSD Currency = "RSD" 272 // RUB ... 273 RUB Currency = "RUB" 274 // RWF ... 275 RWF Currency = "RWF" 276 // SAR ... 277 SAR Currency = "SAR" 278 // SBD ... 279 SBD Currency = "SBD" 280 // SCR ... 281 SCR Currency = "SCR" 282 // SDG ... 283 SDG Currency = "SDG" 284 // SEK ... 285 SEK Currency = "SEK" 286 // SGD ... 287 SGD Currency = "SGD" 288 // SHP ... 289 SHP Currency = "SHP" 290 // SLL ... 291 SLL Currency = "SLL" 292 // SOS ... 293 SOS Currency = "SOS" 294 // SRD ... 295 SRD Currency = "SRD" 296 // SSP ... 297 SSP Currency = "SSP" 298 // STD ... 299 STD Currency = "STD" 300 // SYP ... 301 SYP Currency = "SYP" 302 // SZL ... 303 SZL Currency = "SZL" 304 // THB ... 305 THB Currency = "THB" 306 // TJS ... 307 TJS Currency = "TJS" 308 // TMT ... 309 TMT Currency = "TMT" 310 // TND ... 311 TND Currency = "TND" 312 // TOP ... 313 TOP Currency = "TOP" 314 // TRY ... 315 TRY Currency = "TRY" 316 // TTD ... 317 TTD Currency = "TTD" 318 // TWD ... 319 TWD Currency = "TWD" 320 // TZS ... 321 TZS Currency = "TZS" 322 // UAH ... 323 UAH Currency = "UAH" 324 // UGX ... 325 UGX Currency = "UGX" 326 // USD ... 327 USD Currency = "USD" 328 // UYU ... 329 UYU Currency = "UYU" 330 // UZS ... 331 UZS Currency = "UZS" 332 // VEF ... 333 VEF Currency = "VEF" 334 // VND ... 335 VND Currency = "VND" 336 // VUV ... 337 VUV Currency = "VUV" 338 // WST ... 339 WST Currency = "WST" 340 // XAF ... 341 XAF Currency = "XAF" 342 // XCD ... 343 XCD Currency = "XCD" 344 // XOF ... 345 XOF Currency = "XOF" 346 // XPF ... 347 XPF Currency = "XPF" 348 // YER ... 349 YER Currency = "YER" 350 // ZAR ... 351 ZAR Currency = "ZAR" 352 // ZMW ... 353 ZMW Currency = "ZMW" 354) 355 356// PossibleCurrencyValues returns an array of possible values for the Currency const type. 357func PossibleCurrencyValues() []Currency { 358 return []Currency{AED, AFN, ALL, AMD, ANG, AOA, ARS, AUD, AWG, AZN, BAM, BBD, BDT, BGN, BHD, BIF, BMD, BND, BOB, BOV, BRL, BSD, BTN, BWP, BYR, BZD, CAD, CDF, CHE, CHF, CHW, CLF, CLP, CNY, COP, COU, CRC, CUC, CUP, CVE, CZK, DJF, DKK, DOP, DZD, EGP, ERN, ETB, EUR, FJD, FKP, GBP, GEL, GHS, GIP, GMD, GNF, GTQ, GYD, HKD, HNL, HRK, HTG, HUF, IDR, ILS, INR, IQD, IRR, ISK, JMD, JOD, JPY, KES, KGS, KHR, KMF, KPW, KRW, KWD, KYD, KZT, LAK, LBP, LKR, LRD, LSL, LYD, MAD, MDL, MGA, MKD, MMK, MNT, MOP, MRO, MUR, MVR, MWK, MXN, MXV, MYR, MZN, NAD, NGN, NIO, NOK, NPR, NZD, OMR, PAB, PEN, PGK, PHP, PKR, PLN, PYG, QAR, RON, RSD, RUB, RWF, SAR, SBD, SCR, SDG, SEK, SGD, SHP, SLL, SOS, SRD, SSP, STD, SYP, SZL, THB, TJS, TMT, TND, TOP, TRY, TTD, TWD, TZS, UAH, UGX, USD, UYU, UZS, VEF, VND, VUV, WST, XAF, XCD, XOF, XPF, YER, ZAR, ZMW} 359} 360 361// ErrorCode enumerates the values for error code. 362type ErrorCode string 363 364const ( 365 // InsufficientAuthorization ... 366 InsufficientAuthorization ErrorCode = "InsufficientAuthorization" 367 // InvalidAuthorization ... 368 InvalidAuthorization ErrorCode = "InvalidAuthorization" 369 // InvalidRequest ... 370 InvalidRequest ErrorCode = "InvalidRequest" 371 // None ... 372 None ErrorCode = "None" 373 // RateLimitExceeded ... 374 RateLimitExceeded ErrorCode = "RateLimitExceeded" 375 // ServerError ... 376 ServerError ErrorCode = "ServerError" 377) 378 379// PossibleErrorCodeValues returns an array of possible values for the ErrorCode const type. 380func PossibleErrorCodeValues() []ErrorCode { 381 return []ErrorCode{InsufficientAuthorization, InvalidAuthorization, InvalidRequest, None, RateLimitExceeded, ServerError} 382} 383 384// ErrorSubCode enumerates the values for error sub code. 385type ErrorSubCode string 386 387const ( 388 // AuthorizationDisabled ... 389 AuthorizationDisabled ErrorSubCode = "AuthorizationDisabled" 390 // AuthorizationExpired ... 391 AuthorizationExpired ErrorSubCode = "AuthorizationExpired" 392 // AuthorizationMissing ... 393 AuthorizationMissing ErrorSubCode = "AuthorizationMissing" 394 // AuthorizationRedundancy ... 395 AuthorizationRedundancy ErrorSubCode = "AuthorizationRedundancy" 396 // Blocked ... 397 Blocked ErrorSubCode = "Blocked" 398 // HTTPNotAllowed ... 399 HTTPNotAllowed ErrorSubCode = "HttpNotAllowed" 400 // NotImplemented ... 401 NotImplemented ErrorSubCode = "NotImplemented" 402 // ParameterInvalidValue ... 403 ParameterInvalidValue ErrorSubCode = "ParameterInvalidValue" 404 // ParameterMissing ... 405 ParameterMissing ErrorSubCode = "ParameterMissing" 406 // ResourceError ... 407 ResourceError ErrorSubCode = "ResourceError" 408 // UnexpectedError ... 409 UnexpectedError ErrorSubCode = "UnexpectedError" 410) 411 412// PossibleErrorSubCodeValues returns an array of possible values for the ErrorSubCode const type. 413func PossibleErrorSubCodeValues() []ErrorSubCode { 414 return []ErrorSubCode{AuthorizationDisabled, AuthorizationExpired, AuthorizationMissing, AuthorizationRedundancy, Blocked, HTTPNotAllowed, NotImplemented, ParameterInvalidValue, ParameterMissing, ResourceError, UnexpectedError} 415} 416 417// ItemAvailability enumerates the values for item availability. 418type ItemAvailability string 419 420const ( 421 // Discontinued ... 422 Discontinued ItemAvailability = "Discontinued" 423 // InStock ... 424 InStock ItemAvailability = "InStock" 425 // InStoreOnly ... 426 InStoreOnly ItemAvailability = "InStoreOnly" 427 // LimitedAvailability ... 428 LimitedAvailability ItemAvailability = "LimitedAvailability" 429 // OnlineOnly ... 430 OnlineOnly ItemAvailability = "OnlineOnly" 431 // OutOfStock ... 432 OutOfStock ItemAvailability = "OutOfStock" 433 // PreOrder ... 434 PreOrder ItemAvailability = "PreOrder" 435 // SoldOut ... 436 SoldOut ItemAvailability = "SoldOut" 437) 438 439// PossibleItemAvailabilityValues returns an array of possible values for the ItemAvailability const type. 440func PossibleItemAvailabilityValues() []ItemAvailability { 441 return []ItemAvailability{Discontinued, InStock, InStoreOnly, LimitedAvailability, OnlineOnly, OutOfStock, PreOrder, SoldOut} 442} 443 444// SafeSearch enumerates the values for safe search. 445type SafeSearch string 446 447const ( 448 // Moderate ... 449 Moderate SafeSearch = "Moderate" 450 // Off ... 451 Off SafeSearch = "Off" 452 // Strict ... 453 Strict SafeSearch = "Strict" 454) 455 456// PossibleSafeSearchValues returns an array of possible values for the SafeSearch const type. 457func PossibleSafeSearchValues() []SafeSearch { 458 return []SafeSearch{Moderate, Off, Strict} 459} 460 461// Type enumerates the values for type. 462type Type string 463 464const ( 465 // TypeAction ... 466 TypeAction Type = "Action" 467 // TypeAggregateOffer ... 468 TypeAggregateOffer Type = "AggregateOffer" 469 // TypeCreativeWork ... 470 TypeCreativeWork Type = "CreativeWork" 471 // TypeErrorResponse ... 472 TypeErrorResponse Type = "ErrorResponse" 473 // TypeIdentifiable ... 474 TypeIdentifiable Type = "Identifiable" 475 // TypeImageAction ... 476 TypeImageAction Type = "ImageAction" 477 // TypeImageEntityAction ... 478 TypeImageEntityAction Type = "ImageEntityAction" 479 // TypeImageKnowledge ... 480 TypeImageKnowledge Type = "ImageKnowledge" 481 // TypeImageModuleAction ... 482 TypeImageModuleAction Type = "ImageModuleAction" 483 // TypeImageObject ... 484 TypeImageObject Type = "ImageObject" 485 // TypeImageRecipesAction ... 486 TypeImageRecipesAction Type = "ImageRecipesAction" 487 // TypeImageRelatedSearchesAction ... 488 TypeImageRelatedSearchesAction Type = "ImageRelatedSearchesAction" 489 // TypeImageShoppingSourcesAction ... 490 TypeImageShoppingSourcesAction Type = "ImageShoppingSourcesAction" 491 // TypeImageTag ... 492 TypeImageTag Type = "ImageTag" 493 // TypeIntangible ... 494 TypeIntangible Type = "Intangible" 495 // TypeMediaObject ... 496 TypeMediaObject Type = "MediaObject" 497 // TypeNormalizedQuadrilateral ... 498 TypeNormalizedQuadrilateral Type = "NormalizedQuadrilateral" 499 // TypeOffer ... 500 TypeOffer Type = "Offer" 501 // TypeOrganization ... 502 TypeOrganization Type = "Organization" 503 // TypePerson ... 504 TypePerson Type = "Person" 505 // TypePoint2D ... 506 TypePoint2D Type = "Point2D" 507 // TypeRecipe ... 508 TypeRecipe Type = "Recipe" 509 // TypeResponse ... 510 TypeResponse Type = "Response" 511 // TypeResponseBase ... 512 TypeResponseBase Type = "ResponseBase" 513 // TypeStructuredValue ... 514 TypeStructuredValue Type = "StructuredValue" 515 // TypeThing ... 516 TypeThing Type = "Thing" 517) 518 519// PossibleTypeValues returns an array of possible values for the Type const type. 520func PossibleTypeValues() []Type { 521 return []Type{TypeAction, TypeAggregateOffer, TypeCreativeWork, TypeErrorResponse, TypeIdentifiable, TypeImageAction, TypeImageEntityAction, TypeImageKnowledge, TypeImageModuleAction, TypeImageObject, TypeImageRecipesAction, TypeImageRelatedSearchesAction, TypeImageShoppingSourcesAction, TypeImageTag, TypeIntangible, TypeMediaObject, TypeNormalizedQuadrilateral, TypeOffer, TypeOrganization, TypePerson, TypePoint2D, TypeRecipe, TypeResponse, TypeResponseBase, TypeStructuredValue, TypeThing} 522} 523 524// TypeBasicPropertiesItem enumerates the values for type basic properties item. 525type TypeBasicPropertiesItem string 526 527const ( 528 // TypeAggregateRating ... 529 TypeAggregateRating TypeBasicPropertiesItem = "AggregateRating" 530 // TypePropertiesItem ... 531 TypePropertiesItem TypeBasicPropertiesItem = "Properties/Item" 532 // TypeRating ... 533 TypeRating TypeBasicPropertiesItem = "Rating" 534) 535 536// PossibleTypeBasicPropertiesItemValues returns an array of possible values for the TypeBasicPropertiesItem const type. 537func PossibleTypeBasicPropertiesItemValues() []TypeBasicPropertiesItem { 538 return []TypeBasicPropertiesItem{TypeAggregateRating, TypePropertiesItem, TypeRating} 539} 540 541// BasicAction defines an action. 542type BasicAction interface { 543 AsImageAction() (*ImageAction, bool) 544 AsBasicImageAction() (BasicImageAction, bool) 545 AsImageEntityAction() (*ImageEntityAction, bool) 546 AsImageModuleAction() (*ImageModuleAction, bool) 547 AsImageRecipesAction() (*ImageRecipesAction, bool) 548 AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) 549 AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) 550 AsAction() (*Action, bool) 551} 552 553// Action defines an action. 554type Action struct { 555 // Result - READ-ONLY; The result produced in the action. 556 Result *[]BasicThing `json:"result,omitempty"` 557 // DisplayName - READ-ONLY; A display name for the action. 558 DisplayName *string `json:"displayName,omitempty"` 559 // IsTopAction - READ-ONLY; A Boolean representing whether this result is the top action. 560 IsTopAction *bool `json:"isTopAction,omitempty"` 561 // ServiceURL - READ-ONLY; Use this URL to get additional data to determine how to take the appropriate action. For example, the serviceUrl might return JSON along with an image URL. 562 ServiceURL *string `json:"serviceUrl,omitempty"` 563 // ThumbnailURL - READ-ONLY; The URL to a thumbnail of the item. 564 ThumbnailURL *string `json:"thumbnailUrl,omitempty"` 565 // Provider - READ-ONLY; The source of the creative work. 566 Provider *[]BasicThing `json:"provider,omitempty"` 567 // DatePublished - READ-ONLY; The date on which the CreativeWork was published. 568 DatePublished *string `json:"datePublished,omitempty"` 569 // Text - READ-ONLY; Text content of this creative work. 570 Text *string `json:"text,omitempty"` 571 // Name - READ-ONLY; The name of the thing represented by this object. 572 Name *string `json:"name,omitempty"` 573 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 574 URL *string `json:"url,omitempty"` 575 // Image - READ-ONLY; An image of the item. 576 Image *ImageObject `json:"image,omitempty"` 577 // Description - READ-ONLY; A short description of the item. 578 Description *string `json:"description,omitempty"` 579 // AlternateName - READ-ONLY; An alias for the item. 580 AlternateName *string `json:"alternateName,omitempty"` 581 // BingID - READ-ONLY; An ID that uniquely identifies this item. 582 BingID *string `json:"bingId,omitempty"` 583 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 584 ReadLink *string `json:"readLink,omitempty"` 585 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 586 WebSearchURL *string `json:"webSearchUrl,omitempty"` 587 // ID - READ-ONLY; A String identifier. 588 ID *string `json:"id,omitempty"` 589 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 590 Type Type `json:"_type,omitempty"` 591} 592 593func unmarshalBasicAction(body []byte) (BasicAction, error) { 594 var m map[string]interface{} 595 err := json.Unmarshal(body, &m) 596 if err != nil { 597 return nil, err 598 } 599 600 switch m["_type"] { 601 case string(TypeImageAction): 602 var ia ImageAction 603 err := json.Unmarshal(body, &ia) 604 return ia, err 605 case string(TypeImageEntityAction): 606 var iea ImageEntityAction 607 err := json.Unmarshal(body, &iea) 608 return iea, err 609 case string(TypeImageModuleAction): 610 var ima ImageModuleAction 611 err := json.Unmarshal(body, &ima) 612 return ima, err 613 case string(TypeImageRecipesAction): 614 var ira ImageRecipesAction 615 err := json.Unmarshal(body, &ira) 616 return ira, err 617 case string(TypeImageRelatedSearchesAction): 618 var irsa ImageRelatedSearchesAction 619 err := json.Unmarshal(body, &irsa) 620 return irsa, err 621 case string(TypeImageShoppingSourcesAction): 622 var issa ImageShoppingSourcesAction 623 err := json.Unmarshal(body, &issa) 624 return issa, err 625 default: 626 var a Action 627 err := json.Unmarshal(body, &a) 628 return a, err 629 } 630} 631func unmarshalBasicActionArray(body []byte) ([]BasicAction, error) { 632 var rawMessages []*json.RawMessage 633 err := json.Unmarshal(body, &rawMessages) 634 if err != nil { 635 return nil, err 636 } 637 638 aArray := make([]BasicAction, len(rawMessages)) 639 640 for index, rawMessage := range rawMessages { 641 a, err := unmarshalBasicAction(*rawMessage) 642 if err != nil { 643 return nil, err 644 } 645 aArray[index] = a 646 } 647 return aArray, nil 648} 649 650// MarshalJSON is the custom marshaler for Action. 651func (a Action) MarshalJSON() ([]byte, error) { 652 a.Type = TypeAction 653 objectMap := make(map[string]interface{}) 654 if a.Type != "" { 655 objectMap["_type"] = a.Type 656 } 657 return json.Marshal(objectMap) 658} 659 660// AsPoint2D is the BasicResponseBase implementation for Action. 661func (a Action) AsPoint2D() (*Point2D, bool) { 662 return nil, false 663} 664 665// AsNormalizedQuadrilateral is the BasicResponseBase implementation for Action. 666func (a Action) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 667 return nil, false 668} 669 670// AsImageAction is the BasicResponseBase implementation for Action. 671func (a Action) AsImageAction() (*ImageAction, bool) { 672 return nil, false 673} 674 675// AsBasicImageAction is the BasicResponseBase implementation for Action. 676func (a Action) AsBasicImageAction() (BasicImageAction, bool) { 677 return nil, false 678} 679 680// AsImageTag is the BasicResponseBase implementation for Action. 681func (a Action) AsImageTag() (*ImageTag, bool) { 682 return nil, false 683} 684 685// AsOrganization is the BasicResponseBase implementation for Action. 686func (a Action) AsOrganization() (*Organization, bool) { 687 return nil, false 688} 689 690// AsOffer is the BasicResponseBase implementation for Action. 691func (a Action) AsOffer() (*Offer, bool) { 692 return nil, false 693} 694 695// AsBasicOffer is the BasicResponseBase implementation for Action. 696func (a Action) AsBasicOffer() (BasicOffer, bool) { 697 return nil, false 698} 699 700// AsAggregateOffer is the BasicResponseBase implementation for Action. 701func (a Action) AsAggregateOffer() (*AggregateOffer, bool) { 702 return nil, false 703} 704 705// AsImageObject is the BasicResponseBase implementation for Action. 706func (a Action) AsImageObject() (*ImageObject, bool) { 707 return nil, false 708} 709 710// AsImageKnowledge is the BasicResponseBase implementation for Action. 711func (a Action) AsImageKnowledge() (*ImageKnowledge, bool) { 712 return nil, false 713} 714 715// AsResponse is the BasicResponseBase implementation for Action. 716func (a Action) AsResponse() (*Response, bool) { 717 return nil, false 718} 719 720// AsBasicResponse is the BasicResponseBase implementation for Action. 721func (a Action) AsBasicResponse() (BasicResponse, bool) { 722 return &a, true 723} 724 725// AsIdentifiable is the BasicResponseBase implementation for Action. 726func (a Action) AsIdentifiable() (*Identifiable, bool) { 727 return nil, false 728} 729 730// AsBasicIdentifiable is the BasicResponseBase implementation for Action. 731func (a Action) AsBasicIdentifiable() (BasicIdentifiable, bool) { 732 return &a, true 733} 734 735// AsErrorResponse is the BasicResponseBase implementation for Action. 736func (a Action) AsErrorResponse() (*ErrorResponse, bool) { 737 return nil, false 738} 739 740// AsThing is the BasicResponseBase implementation for Action. 741func (a Action) AsThing() (*Thing, bool) { 742 return nil, false 743} 744 745// AsBasicThing is the BasicResponseBase implementation for Action. 746func (a Action) AsBasicThing() (BasicThing, bool) { 747 return &a, true 748} 749 750// AsAction is the BasicResponseBase implementation for Action. 751func (a Action) AsAction() (*Action, bool) { 752 return &a, true 753} 754 755// AsBasicAction is the BasicResponseBase implementation for Action. 756func (a Action) AsBasicAction() (BasicAction, bool) { 757 return &a, true 758} 759 760// AsMediaObject is the BasicResponseBase implementation for Action. 761func (a Action) AsMediaObject() (*MediaObject, bool) { 762 return nil, false 763} 764 765// AsBasicMediaObject is the BasicResponseBase implementation for Action. 766func (a Action) AsBasicMediaObject() (BasicMediaObject, bool) { 767 return nil, false 768} 769 770// AsCreativeWork is the BasicResponseBase implementation for Action. 771func (a Action) AsCreativeWork() (*CreativeWork, bool) { 772 return nil, false 773} 774 775// AsBasicCreativeWork is the BasicResponseBase implementation for Action. 776func (a Action) AsBasicCreativeWork() (BasicCreativeWork, bool) { 777 return &a, true 778} 779 780// AsPerson is the BasicResponseBase implementation for Action. 781func (a Action) AsPerson() (*Person, bool) { 782 return nil, false 783} 784 785// AsIntangible is the BasicResponseBase implementation for Action. 786func (a Action) AsIntangible() (*Intangible, bool) { 787 return nil, false 788} 789 790// AsBasicIntangible is the BasicResponseBase implementation for Action. 791func (a Action) AsBasicIntangible() (BasicIntangible, bool) { 792 return nil, false 793} 794 795// AsImageEntityAction is the BasicResponseBase implementation for Action. 796func (a Action) AsImageEntityAction() (*ImageEntityAction, bool) { 797 return nil, false 798} 799 800// AsImageModuleAction is the BasicResponseBase implementation for Action. 801func (a Action) AsImageModuleAction() (*ImageModuleAction, bool) { 802 return nil, false 803} 804 805// AsRecipe is the BasicResponseBase implementation for Action. 806func (a Action) AsRecipe() (*Recipe, bool) { 807 return nil, false 808} 809 810// AsImageRecipesAction is the BasicResponseBase implementation for Action. 811func (a Action) AsImageRecipesAction() (*ImageRecipesAction, bool) { 812 return nil, false 813} 814 815// AsImageRelatedSearchesAction is the BasicResponseBase implementation for Action. 816func (a Action) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 817 return nil, false 818} 819 820// AsImageShoppingSourcesAction is the BasicResponseBase implementation for Action. 821func (a Action) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 822 return nil, false 823} 824 825// AsStructuredValue is the BasicResponseBase implementation for Action. 826func (a Action) AsStructuredValue() (*StructuredValue, bool) { 827 return nil, false 828} 829 830// AsBasicStructuredValue is the BasicResponseBase implementation for Action. 831func (a Action) AsBasicStructuredValue() (BasicStructuredValue, bool) { 832 return nil, false 833} 834 835// AsResponseBase is the BasicResponseBase implementation for Action. 836func (a Action) AsResponseBase() (*ResponseBase, bool) { 837 return nil, false 838} 839 840// AsBasicResponseBase is the BasicResponseBase implementation for Action. 841func (a Action) AsBasicResponseBase() (BasicResponseBase, bool) { 842 return &a, true 843} 844 845// UnmarshalJSON is the custom unmarshaler for Action struct. 846func (a *Action) UnmarshalJSON(body []byte) error { 847 var m map[string]*json.RawMessage 848 err := json.Unmarshal(body, &m) 849 if err != nil { 850 return err 851 } 852 for k, v := range m { 853 switch k { 854 case "result": 855 if v != nil { 856 resultVar, err := unmarshalBasicThingArray(*v) 857 if err != nil { 858 return err 859 } 860 a.Result = &resultVar 861 } 862 case "displayName": 863 if v != nil { 864 var displayName string 865 err = json.Unmarshal(*v, &displayName) 866 if err != nil { 867 return err 868 } 869 a.DisplayName = &displayName 870 } 871 case "isTopAction": 872 if v != nil { 873 var isTopAction bool 874 err = json.Unmarshal(*v, &isTopAction) 875 if err != nil { 876 return err 877 } 878 a.IsTopAction = &isTopAction 879 } 880 case "serviceUrl": 881 if v != nil { 882 var serviceURL string 883 err = json.Unmarshal(*v, &serviceURL) 884 if err != nil { 885 return err 886 } 887 a.ServiceURL = &serviceURL 888 } 889 case "thumbnailUrl": 890 if v != nil { 891 var thumbnailURL string 892 err = json.Unmarshal(*v, &thumbnailURL) 893 if err != nil { 894 return err 895 } 896 a.ThumbnailURL = &thumbnailURL 897 } 898 case "provider": 899 if v != nil { 900 provider, err := unmarshalBasicThingArray(*v) 901 if err != nil { 902 return err 903 } 904 a.Provider = &provider 905 } 906 case "datePublished": 907 if v != nil { 908 var datePublished string 909 err = json.Unmarshal(*v, &datePublished) 910 if err != nil { 911 return err 912 } 913 a.DatePublished = &datePublished 914 } 915 case "text": 916 if v != nil { 917 var textVar string 918 err = json.Unmarshal(*v, &textVar) 919 if err != nil { 920 return err 921 } 922 a.Text = &textVar 923 } 924 case "name": 925 if v != nil { 926 var name string 927 err = json.Unmarshal(*v, &name) 928 if err != nil { 929 return err 930 } 931 a.Name = &name 932 } 933 case "url": 934 if v != nil { 935 var URL string 936 err = json.Unmarshal(*v, &URL) 937 if err != nil { 938 return err 939 } 940 a.URL = &URL 941 } 942 case "image": 943 if v != nil { 944 var imageVar ImageObject 945 err = json.Unmarshal(*v, &imageVar) 946 if err != nil { 947 return err 948 } 949 a.Image = &imageVar 950 } 951 case "description": 952 if v != nil { 953 var description string 954 err = json.Unmarshal(*v, &description) 955 if err != nil { 956 return err 957 } 958 a.Description = &description 959 } 960 case "alternateName": 961 if v != nil { 962 var alternateName string 963 err = json.Unmarshal(*v, &alternateName) 964 if err != nil { 965 return err 966 } 967 a.AlternateName = &alternateName 968 } 969 case "bingId": 970 if v != nil { 971 var bingID string 972 err = json.Unmarshal(*v, &bingID) 973 if err != nil { 974 return err 975 } 976 a.BingID = &bingID 977 } 978 case "readLink": 979 if v != nil { 980 var readLink string 981 err = json.Unmarshal(*v, &readLink) 982 if err != nil { 983 return err 984 } 985 a.ReadLink = &readLink 986 } 987 case "webSearchUrl": 988 if v != nil { 989 var webSearchURL string 990 err = json.Unmarshal(*v, &webSearchURL) 991 if err != nil { 992 return err 993 } 994 a.WebSearchURL = &webSearchURL 995 } 996 case "id": 997 if v != nil { 998 var ID string 999 err = json.Unmarshal(*v, &ID) 1000 if err != nil { 1001 return err 1002 } 1003 a.ID = &ID 1004 } 1005 case "_type": 1006 if v != nil { 1007 var typeVar Type 1008 err = json.Unmarshal(*v, &typeVar) 1009 if err != nil { 1010 return err 1011 } 1012 a.Type = typeVar 1013 } 1014 } 1015 } 1016 1017 return nil 1018} 1019 1020// AggregateOffer defines a list of offers from merchants that are related to the image. 1021type AggregateOffer struct { 1022 // Offers - READ-ONLY; A list of offers from merchants that have offerings related to the image. 1023 Offers *[]BasicOffer `json:"offers,omitempty"` 1024 // Seller - READ-ONLY; Seller for this offer. 1025 Seller *Organization `json:"seller,omitempty"` 1026 // Price - READ-ONLY; The item's price. 1027 Price *float64 `json:"price,omitempty"` 1028 // PriceCurrency - READ-ONLY; The monetary currency. For example, USD. Possible values include: 'USD', 'CAD', 'GBP', 'EUR', 'COP', 'JPY', 'CNY', 'AUD', 'INR', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AWG', 'AZN', 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BOV', 'BRL', 'BSD', 'BTN', 'BWP', 'BYR', 'BZD', 'CDF', 'CHE', 'CHF', 'CHW', 'CLF', 'CLP', 'COU', 'CRC', 'CUC', 'CUP', 'CVE', 'CZK', 'DJF', 'DKK', 'DOP', 'DZD', 'EGP', 'ERN', 'ETB', 'FJD', 'FKP', 'GEL', 'GHS', 'GIP', 'GMD', 'GNF', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', 'IDR', 'ILS', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'KES', 'KGS', 'KHR', 'KMF', 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', 'MVR', 'MWK', 'MXN', 'MXV', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', 'QAR', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SBD', 'SCR', 'SDG', 'SEK', 'SGD', 'SHP', 'SLL', 'SOS', 'SRD', 'SSP', 'STD', 'SYP', 'SZL', 'THB', 'TJS', 'TMT', 'TND', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS', 'UAH', 'UGX', 'UYU', 'UZS', 'VEF', 'VND', 'VUV', 'WST', 'XAF', 'XCD', 'XOF', 'XPF', 'YER', 'ZAR', 'ZMW' 1029 PriceCurrency Currency `json:"priceCurrency,omitempty"` 1030 // Availability - READ-ONLY; The item's availability. The following are the possible values: Discontinued, InStock, InStoreOnly, LimitedAvailability, OnlineOnly, OutOfStock, PreOrder, SoldOut. Possible values include: 'Discontinued', 'InStock', 'InStoreOnly', 'LimitedAvailability', 'OnlineOnly', 'OutOfStock', 'PreOrder', 'SoldOut' 1031 Availability ItemAvailability `json:"availability,omitempty"` 1032 // AggregateRating - READ-ONLY; An aggregated rating that indicates how well the product has been rated by others. 1033 AggregateRating *AggregateRating `json:"aggregateRating,omitempty"` 1034 // LastUpdated - READ-ONLY; The last date that the offer was updated. The date is in the form YYYY-MM-DD. 1035 LastUpdated *string `json:"lastUpdated,omitempty"` 1036 // Name - READ-ONLY; The name of the thing represented by this object. 1037 Name *string `json:"name,omitempty"` 1038 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 1039 URL *string `json:"url,omitempty"` 1040 // Image - READ-ONLY; An image of the item. 1041 Image *ImageObject `json:"image,omitempty"` 1042 // Description - READ-ONLY; A short description of the item. 1043 Description *string `json:"description,omitempty"` 1044 // AlternateName - READ-ONLY; An alias for the item. 1045 AlternateName *string `json:"alternateName,omitempty"` 1046 // BingID - READ-ONLY; An ID that uniquely identifies this item. 1047 BingID *string `json:"bingId,omitempty"` 1048 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 1049 ReadLink *string `json:"readLink,omitempty"` 1050 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 1051 WebSearchURL *string `json:"webSearchUrl,omitempty"` 1052 // ID - READ-ONLY; A String identifier. 1053 ID *string `json:"id,omitempty"` 1054 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 1055 Type Type `json:"_type,omitempty"` 1056} 1057 1058// MarshalJSON is the custom marshaler for AggregateOffer. 1059func (ao AggregateOffer) MarshalJSON() ([]byte, error) { 1060 ao.Type = TypeAggregateOffer 1061 objectMap := make(map[string]interface{}) 1062 if ao.Type != "" { 1063 objectMap["_type"] = ao.Type 1064 } 1065 return json.Marshal(objectMap) 1066} 1067 1068// AsPoint2D is the BasicResponseBase implementation for AggregateOffer. 1069func (ao AggregateOffer) AsPoint2D() (*Point2D, bool) { 1070 return nil, false 1071} 1072 1073// AsNormalizedQuadrilateral is the BasicResponseBase implementation for AggregateOffer. 1074func (ao AggregateOffer) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 1075 return nil, false 1076} 1077 1078// AsImageAction is the BasicResponseBase implementation for AggregateOffer. 1079func (ao AggregateOffer) AsImageAction() (*ImageAction, bool) { 1080 return nil, false 1081} 1082 1083// AsBasicImageAction is the BasicResponseBase implementation for AggregateOffer. 1084func (ao AggregateOffer) AsBasicImageAction() (BasicImageAction, bool) { 1085 return nil, false 1086} 1087 1088// AsImageTag is the BasicResponseBase implementation for AggregateOffer. 1089func (ao AggregateOffer) AsImageTag() (*ImageTag, bool) { 1090 return nil, false 1091} 1092 1093// AsOrganization is the BasicResponseBase implementation for AggregateOffer. 1094func (ao AggregateOffer) AsOrganization() (*Organization, bool) { 1095 return nil, false 1096} 1097 1098// AsOffer is the BasicResponseBase implementation for AggregateOffer. 1099func (ao AggregateOffer) AsOffer() (*Offer, bool) { 1100 return nil, false 1101} 1102 1103// AsBasicOffer is the BasicResponseBase implementation for AggregateOffer. 1104func (ao AggregateOffer) AsBasicOffer() (BasicOffer, bool) { 1105 return &ao, true 1106} 1107 1108// AsAggregateOffer is the BasicResponseBase implementation for AggregateOffer. 1109func (ao AggregateOffer) AsAggregateOffer() (*AggregateOffer, bool) { 1110 return &ao, true 1111} 1112 1113// AsImageObject is the BasicResponseBase implementation for AggregateOffer. 1114func (ao AggregateOffer) AsImageObject() (*ImageObject, bool) { 1115 return nil, false 1116} 1117 1118// AsImageKnowledge is the BasicResponseBase implementation for AggregateOffer. 1119func (ao AggregateOffer) AsImageKnowledge() (*ImageKnowledge, bool) { 1120 return nil, false 1121} 1122 1123// AsResponse is the BasicResponseBase implementation for AggregateOffer. 1124func (ao AggregateOffer) AsResponse() (*Response, bool) { 1125 return nil, false 1126} 1127 1128// AsBasicResponse is the BasicResponseBase implementation for AggregateOffer. 1129func (ao AggregateOffer) AsBasicResponse() (BasicResponse, bool) { 1130 return &ao, true 1131} 1132 1133// AsIdentifiable is the BasicResponseBase implementation for AggregateOffer. 1134func (ao AggregateOffer) AsIdentifiable() (*Identifiable, bool) { 1135 return nil, false 1136} 1137 1138// AsBasicIdentifiable is the BasicResponseBase implementation for AggregateOffer. 1139func (ao AggregateOffer) AsBasicIdentifiable() (BasicIdentifiable, bool) { 1140 return &ao, true 1141} 1142 1143// AsErrorResponse is the BasicResponseBase implementation for AggregateOffer. 1144func (ao AggregateOffer) AsErrorResponse() (*ErrorResponse, bool) { 1145 return nil, false 1146} 1147 1148// AsThing is the BasicResponseBase implementation for AggregateOffer. 1149func (ao AggregateOffer) AsThing() (*Thing, bool) { 1150 return nil, false 1151} 1152 1153// AsBasicThing is the BasicResponseBase implementation for AggregateOffer. 1154func (ao AggregateOffer) AsBasicThing() (BasicThing, bool) { 1155 return &ao, true 1156} 1157 1158// AsAction is the BasicResponseBase implementation for AggregateOffer. 1159func (ao AggregateOffer) AsAction() (*Action, bool) { 1160 return nil, false 1161} 1162 1163// AsBasicAction is the BasicResponseBase implementation for AggregateOffer. 1164func (ao AggregateOffer) AsBasicAction() (BasicAction, bool) { 1165 return nil, false 1166} 1167 1168// AsMediaObject is the BasicResponseBase implementation for AggregateOffer. 1169func (ao AggregateOffer) AsMediaObject() (*MediaObject, bool) { 1170 return nil, false 1171} 1172 1173// AsBasicMediaObject is the BasicResponseBase implementation for AggregateOffer. 1174func (ao AggregateOffer) AsBasicMediaObject() (BasicMediaObject, bool) { 1175 return nil, false 1176} 1177 1178// AsCreativeWork is the BasicResponseBase implementation for AggregateOffer. 1179func (ao AggregateOffer) AsCreativeWork() (*CreativeWork, bool) { 1180 return nil, false 1181} 1182 1183// AsBasicCreativeWork is the BasicResponseBase implementation for AggregateOffer. 1184func (ao AggregateOffer) AsBasicCreativeWork() (BasicCreativeWork, bool) { 1185 return nil, false 1186} 1187 1188// AsPerson is the BasicResponseBase implementation for AggregateOffer. 1189func (ao AggregateOffer) AsPerson() (*Person, bool) { 1190 return nil, false 1191} 1192 1193// AsIntangible is the BasicResponseBase implementation for AggregateOffer. 1194func (ao AggregateOffer) AsIntangible() (*Intangible, bool) { 1195 return nil, false 1196} 1197 1198// AsBasicIntangible is the BasicResponseBase implementation for AggregateOffer. 1199func (ao AggregateOffer) AsBasicIntangible() (BasicIntangible, bool) { 1200 return nil, false 1201} 1202 1203// AsImageEntityAction is the BasicResponseBase implementation for AggregateOffer. 1204func (ao AggregateOffer) AsImageEntityAction() (*ImageEntityAction, bool) { 1205 return nil, false 1206} 1207 1208// AsImageModuleAction is the BasicResponseBase implementation for AggregateOffer. 1209func (ao AggregateOffer) AsImageModuleAction() (*ImageModuleAction, bool) { 1210 return nil, false 1211} 1212 1213// AsRecipe is the BasicResponseBase implementation for AggregateOffer. 1214func (ao AggregateOffer) AsRecipe() (*Recipe, bool) { 1215 return nil, false 1216} 1217 1218// AsImageRecipesAction is the BasicResponseBase implementation for AggregateOffer. 1219func (ao AggregateOffer) AsImageRecipesAction() (*ImageRecipesAction, bool) { 1220 return nil, false 1221} 1222 1223// AsImageRelatedSearchesAction is the BasicResponseBase implementation for AggregateOffer. 1224func (ao AggregateOffer) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 1225 return nil, false 1226} 1227 1228// AsImageShoppingSourcesAction is the BasicResponseBase implementation for AggregateOffer. 1229func (ao AggregateOffer) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 1230 return nil, false 1231} 1232 1233// AsStructuredValue is the BasicResponseBase implementation for AggregateOffer. 1234func (ao AggregateOffer) AsStructuredValue() (*StructuredValue, bool) { 1235 return nil, false 1236} 1237 1238// AsBasicStructuredValue is the BasicResponseBase implementation for AggregateOffer. 1239func (ao AggregateOffer) AsBasicStructuredValue() (BasicStructuredValue, bool) { 1240 return nil, false 1241} 1242 1243// AsResponseBase is the BasicResponseBase implementation for AggregateOffer. 1244func (ao AggregateOffer) AsResponseBase() (*ResponseBase, bool) { 1245 return nil, false 1246} 1247 1248// AsBasicResponseBase is the BasicResponseBase implementation for AggregateOffer. 1249func (ao AggregateOffer) AsBasicResponseBase() (BasicResponseBase, bool) { 1250 return &ao, true 1251} 1252 1253// UnmarshalJSON is the custom unmarshaler for AggregateOffer struct. 1254func (ao *AggregateOffer) UnmarshalJSON(body []byte) error { 1255 var m map[string]*json.RawMessage 1256 err := json.Unmarshal(body, &m) 1257 if err != nil { 1258 return err 1259 } 1260 for k, v := range m { 1261 switch k { 1262 case "offers": 1263 if v != nil { 1264 offers, err := unmarshalBasicOfferArray(*v) 1265 if err != nil { 1266 return err 1267 } 1268 ao.Offers = &offers 1269 } 1270 case "seller": 1271 if v != nil { 1272 var seller Organization 1273 err = json.Unmarshal(*v, &seller) 1274 if err != nil { 1275 return err 1276 } 1277 ao.Seller = &seller 1278 } 1279 case "price": 1280 if v != nil { 1281 var price float64 1282 err = json.Unmarshal(*v, &price) 1283 if err != nil { 1284 return err 1285 } 1286 ao.Price = &price 1287 } 1288 case "priceCurrency": 1289 if v != nil { 1290 var priceCurrency Currency 1291 err = json.Unmarshal(*v, &priceCurrency) 1292 if err != nil { 1293 return err 1294 } 1295 ao.PriceCurrency = priceCurrency 1296 } 1297 case "availability": 1298 if v != nil { 1299 var availability ItemAvailability 1300 err = json.Unmarshal(*v, &availability) 1301 if err != nil { 1302 return err 1303 } 1304 ao.Availability = availability 1305 } 1306 case "aggregateRating": 1307 if v != nil { 1308 var aggregateRating AggregateRating 1309 err = json.Unmarshal(*v, &aggregateRating) 1310 if err != nil { 1311 return err 1312 } 1313 ao.AggregateRating = &aggregateRating 1314 } 1315 case "lastUpdated": 1316 if v != nil { 1317 var lastUpdated string 1318 err = json.Unmarshal(*v, &lastUpdated) 1319 if err != nil { 1320 return err 1321 } 1322 ao.LastUpdated = &lastUpdated 1323 } 1324 case "name": 1325 if v != nil { 1326 var name string 1327 err = json.Unmarshal(*v, &name) 1328 if err != nil { 1329 return err 1330 } 1331 ao.Name = &name 1332 } 1333 case "url": 1334 if v != nil { 1335 var URL string 1336 err = json.Unmarshal(*v, &URL) 1337 if err != nil { 1338 return err 1339 } 1340 ao.URL = &URL 1341 } 1342 case "image": 1343 if v != nil { 1344 var imageVar ImageObject 1345 err = json.Unmarshal(*v, &imageVar) 1346 if err != nil { 1347 return err 1348 } 1349 ao.Image = &imageVar 1350 } 1351 case "description": 1352 if v != nil { 1353 var description string 1354 err = json.Unmarshal(*v, &description) 1355 if err != nil { 1356 return err 1357 } 1358 ao.Description = &description 1359 } 1360 case "alternateName": 1361 if v != nil { 1362 var alternateName string 1363 err = json.Unmarshal(*v, &alternateName) 1364 if err != nil { 1365 return err 1366 } 1367 ao.AlternateName = &alternateName 1368 } 1369 case "bingId": 1370 if v != nil { 1371 var bingID string 1372 err = json.Unmarshal(*v, &bingID) 1373 if err != nil { 1374 return err 1375 } 1376 ao.BingID = &bingID 1377 } 1378 case "readLink": 1379 if v != nil { 1380 var readLink string 1381 err = json.Unmarshal(*v, &readLink) 1382 if err != nil { 1383 return err 1384 } 1385 ao.ReadLink = &readLink 1386 } 1387 case "webSearchUrl": 1388 if v != nil { 1389 var webSearchURL string 1390 err = json.Unmarshal(*v, &webSearchURL) 1391 if err != nil { 1392 return err 1393 } 1394 ao.WebSearchURL = &webSearchURL 1395 } 1396 case "id": 1397 if v != nil { 1398 var ID string 1399 err = json.Unmarshal(*v, &ID) 1400 if err != nil { 1401 return err 1402 } 1403 ao.ID = &ID 1404 } 1405 case "_type": 1406 if v != nil { 1407 var typeVar Type 1408 err = json.Unmarshal(*v, &typeVar) 1409 if err != nil { 1410 return err 1411 } 1412 ao.Type = typeVar 1413 } 1414 } 1415 } 1416 1417 return nil 1418} 1419 1420// AggregateRating defines the metrics that indicate how well an item was rated by others. 1421type AggregateRating struct { 1422 // ReviewCount - READ-ONLY; The number of times the recipe has been rated or reviewed. 1423 ReviewCount *int32 `json:"reviewCount,omitempty"` 1424 // RatingValue - The mean (average) rating. The possible values are 1.0 through 5.0. 1425 RatingValue *float64 `json:"ratingValue,omitempty"` 1426 // BestRating - READ-ONLY; The highest rated review. The possible values are 1.0 through 5.0. 1427 BestRating *float64 `json:"bestRating,omitempty"` 1428 // Text - READ-ONLY; Text representation of an item. 1429 Text *string `json:"text,omitempty"` 1430 // Type - Possible values include: 'TypePropertiesItem', 'TypeAggregateRating', 'TypeRating' 1431 Type TypeBasicPropertiesItem `json:"_type,omitempty"` 1432} 1433 1434// MarshalJSON is the custom marshaler for AggregateRating. 1435func (ar AggregateRating) MarshalJSON() ([]byte, error) { 1436 ar.Type = TypeAggregateRating 1437 objectMap := make(map[string]interface{}) 1438 if ar.RatingValue != nil { 1439 objectMap["ratingValue"] = ar.RatingValue 1440 } 1441 if ar.Type != "" { 1442 objectMap["_type"] = ar.Type 1443 } 1444 return json.Marshal(objectMap) 1445} 1446 1447// AsAggregateRating is the BasicPropertiesItem implementation for AggregateRating. 1448func (ar AggregateRating) AsAggregateRating() (*AggregateRating, bool) { 1449 return &ar, true 1450} 1451 1452// AsRating is the BasicPropertiesItem implementation for AggregateRating. 1453func (ar AggregateRating) AsRating() (*Rating, bool) { 1454 return nil, false 1455} 1456 1457// AsBasicRating is the BasicPropertiesItem implementation for AggregateRating. 1458func (ar AggregateRating) AsBasicRating() (BasicRating, bool) { 1459 return &ar, true 1460} 1461 1462// AsPropertiesItem is the BasicPropertiesItem implementation for AggregateRating. 1463func (ar AggregateRating) AsPropertiesItem() (*PropertiesItem, bool) { 1464 return nil, false 1465} 1466 1467// AsBasicPropertiesItem is the BasicPropertiesItem implementation for AggregateRating. 1468func (ar AggregateRating) AsBasicPropertiesItem() (BasicPropertiesItem, bool) { 1469 return &ar, true 1470} 1471 1472// BasicCreativeWork the most generic kind of creative work, including books, movies, photographs, software programs, 1473// etc. 1474type BasicCreativeWork interface { 1475 AsImageAction() (*ImageAction, bool) 1476 AsBasicImageAction() (BasicImageAction, bool) 1477 AsImageObject() (*ImageObject, bool) 1478 AsAction() (*Action, bool) 1479 AsBasicAction() (BasicAction, bool) 1480 AsMediaObject() (*MediaObject, bool) 1481 AsBasicMediaObject() (BasicMediaObject, bool) 1482 AsImageEntityAction() (*ImageEntityAction, bool) 1483 AsImageModuleAction() (*ImageModuleAction, bool) 1484 AsRecipe() (*Recipe, bool) 1485 AsImageRecipesAction() (*ImageRecipesAction, bool) 1486 AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) 1487 AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) 1488 AsCreativeWork() (*CreativeWork, bool) 1489} 1490 1491// CreativeWork the most generic kind of creative work, including books, movies, photographs, software 1492// programs, etc. 1493type CreativeWork struct { 1494 // ThumbnailURL - READ-ONLY; The URL to a thumbnail of the item. 1495 ThumbnailURL *string `json:"thumbnailUrl,omitempty"` 1496 // Provider - READ-ONLY; The source of the creative work. 1497 Provider *[]BasicThing `json:"provider,omitempty"` 1498 // DatePublished - READ-ONLY; The date on which the CreativeWork was published. 1499 DatePublished *string `json:"datePublished,omitempty"` 1500 // Text - READ-ONLY; Text content of this creative work. 1501 Text *string `json:"text,omitempty"` 1502 // Name - READ-ONLY; The name of the thing represented by this object. 1503 Name *string `json:"name,omitempty"` 1504 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 1505 URL *string `json:"url,omitempty"` 1506 // Image - READ-ONLY; An image of the item. 1507 Image *ImageObject `json:"image,omitempty"` 1508 // Description - READ-ONLY; A short description of the item. 1509 Description *string `json:"description,omitempty"` 1510 // AlternateName - READ-ONLY; An alias for the item. 1511 AlternateName *string `json:"alternateName,omitempty"` 1512 // BingID - READ-ONLY; An ID that uniquely identifies this item. 1513 BingID *string `json:"bingId,omitempty"` 1514 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 1515 ReadLink *string `json:"readLink,omitempty"` 1516 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 1517 WebSearchURL *string `json:"webSearchUrl,omitempty"` 1518 // ID - READ-ONLY; A String identifier. 1519 ID *string `json:"id,omitempty"` 1520 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 1521 Type Type `json:"_type,omitempty"` 1522} 1523 1524func unmarshalBasicCreativeWork(body []byte) (BasicCreativeWork, error) { 1525 var m map[string]interface{} 1526 err := json.Unmarshal(body, &m) 1527 if err != nil { 1528 return nil, err 1529 } 1530 1531 switch m["_type"] { 1532 case string(TypeImageAction): 1533 var ia ImageAction 1534 err := json.Unmarshal(body, &ia) 1535 return ia, err 1536 case string(TypeImageObject): 1537 var ioVar ImageObject 1538 err := json.Unmarshal(body, &ioVar) 1539 return ioVar, err 1540 case string(TypeAction): 1541 var a Action 1542 err := json.Unmarshal(body, &a) 1543 return a, err 1544 case string(TypeMediaObject): 1545 var mo MediaObject 1546 err := json.Unmarshal(body, &mo) 1547 return mo, err 1548 case string(TypeImageEntityAction): 1549 var iea ImageEntityAction 1550 err := json.Unmarshal(body, &iea) 1551 return iea, err 1552 case string(TypeImageModuleAction): 1553 var ima ImageModuleAction 1554 err := json.Unmarshal(body, &ima) 1555 return ima, err 1556 case string(TypeRecipe): 1557 var r Recipe 1558 err := json.Unmarshal(body, &r) 1559 return r, err 1560 case string(TypeImageRecipesAction): 1561 var ira ImageRecipesAction 1562 err := json.Unmarshal(body, &ira) 1563 return ira, err 1564 case string(TypeImageRelatedSearchesAction): 1565 var irsa ImageRelatedSearchesAction 1566 err := json.Unmarshal(body, &irsa) 1567 return irsa, err 1568 case string(TypeImageShoppingSourcesAction): 1569 var issa ImageShoppingSourcesAction 1570 err := json.Unmarshal(body, &issa) 1571 return issa, err 1572 default: 1573 var cw CreativeWork 1574 err := json.Unmarshal(body, &cw) 1575 return cw, err 1576 } 1577} 1578func unmarshalBasicCreativeWorkArray(body []byte) ([]BasicCreativeWork, error) { 1579 var rawMessages []*json.RawMessage 1580 err := json.Unmarshal(body, &rawMessages) 1581 if err != nil { 1582 return nil, err 1583 } 1584 1585 cwArray := make([]BasicCreativeWork, len(rawMessages)) 1586 1587 for index, rawMessage := range rawMessages { 1588 cw, err := unmarshalBasicCreativeWork(*rawMessage) 1589 if err != nil { 1590 return nil, err 1591 } 1592 cwArray[index] = cw 1593 } 1594 return cwArray, nil 1595} 1596 1597// MarshalJSON is the custom marshaler for CreativeWork. 1598func (cw CreativeWork) MarshalJSON() ([]byte, error) { 1599 cw.Type = TypeCreativeWork 1600 objectMap := make(map[string]interface{}) 1601 if cw.Type != "" { 1602 objectMap["_type"] = cw.Type 1603 } 1604 return json.Marshal(objectMap) 1605} 1606 1607// AsPoint2D is the BasicResponseBase implementation for CreativeWork. 1608func (cw CreativeWork) AsPoint2D() (*Point2D, bool) { 1609 return nil, false 1610} 1611 1612// AsNormalizedQuadrilateral is the BasicResponseBase implementation for CreativeWork. 1613func (cw CreativeWork) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 1614 return nil, false 1615} 1616 1617// AsImageAction is the BasicResponseBase implementation for CreativeWork. 1618func (cw CreativeWork) AsImageAction() (*ImageAction, bool) { 1619 return nil, false 1620} 1621 1622// AsBasicImageAction is the BasicResponseBase implementation for CreativeWork. 1623func (cw CreativeWork) AsBasicImageAction() (BasicImageAction, bool) { 1624 return nil, false 1625} 1626 1627// AsImageTag is the BasicResponseBase implementation for CreativeWork. 1628func (cw CreativeWork) AsImageTag() (*ImageTag, bool) { 1629 return nil, false 1630} 1631 1632// AsOrganization is the BasicResponseBase implementation for CreativeWork. 1633func (cw CreativeWork) AsOrganization() (*Organization, bool) { 1634 return nil, false 1635} 1636 1637// AsOffer is the BasicResponseBase implementation for CreativeWork. 1638func (cw CreativeWork) AsOffer() (*Offer, bool) { 1639 return nil, false 1640} 1641 1642// AsBasicOffer is the BasicResponseBase implementation for CreativeWork. 1643func (cw CreativeWork) AsBasicOffer() (BasicOffer, bool) { 1644 return nil, false 1645} 1646 1647// AsAggregateOffer is the BasicResponseBase implementation for CreativeWork. 1648func (cw CreativeWork) AsAggregateOffer() (*AggregateOffer, bool) { 1649 return nil, false 1650} 1651 1652// AsImageObject is the BasicResponseBase implementation for CreativeWork. 1653func (cw CreativeWork) AsImageObject() (*ImageObject, bool) { 1654 return nil, false 1655} 1656 1657// AsImageKnowledge is the BasicResponseBase implementation for CreativeWork. 1658func (cw CreativeWork) AsImageKnowledge() (*ImageKnowledge, bool) { 1659 return nil, false 1660} 1661 1662// AsResponse is the BasicResponseBase implementation for CreativeWork. 1663func (cw CreativeWork) AsResponse() (*Response, bool) { 1664 return nil, false 1665} 1666 1667// AsBasicResponse is the BasicResponseBase implementation for CreativeWork. 1668func (cw CreativeWork) AsBasicResponse() (BasicResponse, bool) { 1669 return &cw, true 1670} 1671 1672// AsIdentifiable is the BasicResponseBase implementation for CreativeWork. 1673func (cw CreativeWork) AsIdentifiable() (*Identifiable, bool) { 1674 return nil, false 1675} 1676 1677// AsBasicIdentifiable is the BasicResponseBase implementation for CreativeWork. 1678func (cw CreativeWork) AsBasicIdentifiable() (BasicIdentifiable, bool) { 1679 return &cw, true 1680} 1681 1682// AsErrorResponse is the BasicResponseBase implementation for CreativeWork. 1683func (cw CreativeWork) AsErrorResponse() (*ErrorResponse, bool) { 1684 return nil, false 1685} 1686 1687// AsThing is the BasicResponseBase implementation for CreativeWork. 1688func (cw CreativeWork) AsThing() (*Thing, bool) { 1689 return nil, false 1690} 1691 1692// AsBasicThing is the BasicResponseBase implementation for CreativeWork. 1693func (cw CreativeWork) AsBasicThing() (BasicThing, bool) { 1694 return &cw, true 1695} 1696 1697// AsAction is the BasicResponseBase implementation for CreativeWork. 1698func (cw CreativeWork) AsAction() (*Action, bool) { 1699 return nil, false 1700} 1701 1702// AsBasicAction is the BasicResponseBase implementation for CreativeWork. 1703func (cw CreativeWork) AsBasicAction() (BasicAction, bool) { 1704 return nil, false 1705} 1706 1707// AsMediaObject is the BasicResponseBase implementation for CreativeWork. 1708func (cw CreativeWork) AsMediaObject() (*MediaObject, bool) { 1709 return nil, false 1710} 1711 1712// AsBasicMediaObject is the BasicResponseBase implementation for CreativeWork. 1713func (cw CreativeWork) AsBasicMediaObject() (BasicMediaObject, bool) { 1714 return nil, false 1715} 1716 1717// AsCreativeWork is the BasicResponseBase implementation for CreativeWork. 1718func (cw CreativeWork) AsCreativeWork() (*CreativeWork, bool) { 1719 return &cw, true 1720} 1721 1722// AsBasicCreativeWork is the BasicResponseBase implementation for CreativeWork. 1723func (cw CreativeWork) AsBasicCreativeWork() (BasicCreativeWork, bool) { 1724 return &cw, true 1725} 1726 1727// AsPerson is the BasicResponseBase implementation for CreativeWork. 1728func (cw CreativeWork) AsPerson() (*Person, bool) { 1729 return nil, false 1730} 1731 1732// AsIntangible is the BasicResponseBase implementation for CreativeWork. 1733func (cw CreativeWork) AsIntangible() (*Intangible, bool) { 1734 return nil, false 1735} 1736 1737// AsBasicIntangible is the BasicResponseBase implementation for CreativeWork. 1738func (cw CreativeWork) AsBasicIntangible() (BasicIntangible, bool) { 1739 return nil, false 1740} 1741 1742// AsImageEntityAction is the BasicResponseBase implementation for CreativeWork. 1743func (cw CreativeWork) AsImageEntityAction() (*ImageEntityAction, bool) { 1744 return nil, false 1745} 1746 1747// AsImageModuleAction is the BasicResponseBase implementation for CreativeWork. 1748func (cw CreativeWork) AsImageModuleAction() (*ImageModuleAction, bool) { 1749 return nil, false 1750} 1751 1752// AsRecipe is the BasicResponseBase implementation for CreativeWork. 1753func (cw CreativeWork) AsRecipe() (*Recipe, bool) { 1754 return nil, false 1755} 1756 1757// AsImageRecipesAction is the BasicResponseBase implementation for CreativeWork. 1758func (cw CreativeWork) AsImageRecipesAction() (*ImageRecipesAction, bool) { 1759 return nil, false 1760} 1761 1762// AsImageRelatedSearchesAction is the BasicResponseBase implementation for CreativeWork. 1763func (cw CreativeWork) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 1764 return nil, false 1765} 1766 1767// AsImageShoppingSourcesAction is the BasicResponseBase implementation for CreativeWork. 1768func (cw CreativeWork) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 1769 return nil, false 1770} 1771 1772// AsStructuredValue is the BasicResponseBase implementation for CreativeWork. 1773func (cw CreativeWork) AsStructuredValue() (*StructuredValue, bool) { 1774 return nil, false 1775} 1776 1777// AsBasicStructuredValue is the BasicResponseBase implementation for CreativeWork. 1778func (cw CreativeWork) AsBasicStructuredValue() (BasicStructuredValue, bool) { 1779 return nil, false 1780} 1781 1782// AsResponseBase is the BasicResponseBase implementation for CreativeWork. 1783func (cw CreativeWork) AsResponseBase() (*ResponseBase, bool) { 1784 return nil, false 1785} 1786 1787// AsBasicResponseBase is the BasicResponseBase implementation for CreativeWork. 1788func (cw CreativeWork) AsBasicResponseBase() (BasicResponseBase, bool) { 1789 return &cw, true 1790} 1791 1792// UnmarshalJSON is the custom unmarshaler for CreativeWork struct. 1793func (cw *CreativeWork) UnmarshalJSON(body []byte) error { 1794 var m map[string]*json.RawMessage 1795 err := json.Unmarshal(body, &m) 1796 if err != nil { 1797 return err 1798 } 1799 for k, v := range m { 1800 switch k { 1801 case "thumbnailUrl": 1802 if v != nil { 1803 var thumbnailURL string 1804 err = json.Unmarshal(*v, &thumbnailURL) 1805 if err != nil { 1806 return err 1807 } 1808 cw.ThumbnailURL = &thumbnailURL 1809 } 1810 case "provider": 1811 if v != nil { 1812 provider, err := unmarshalBasicThingArray(*v) 1813 if err != nil { 1814 return err 1815 } 1816 cw.Provider = &provider 1817 } 1818 case "datePublished": 1819 if v != nil { 1820 var datePublished string 1821 err = json.Unmarshal(*v, &datePublished) 1822 if err != nil { 1823 return err 1824 } 1825 cw.DatePublished = &datePublished 1826 } 1827 case "text": 1828 if v != nil { 1829 var textVar string 1830 err = json.Unmarshal(*v, &textVar) 1831 if err != nil { 1832 return err 1833 } 1834 cw.Text = &textVar 1835 } 1836 case "name": 1837 if v != nil { 1838 var name string 1839 err = json.Unmarshal(*v, &name) 1840 if err != nil { 1841 return err 1842 } 1843 cw.Name = &name 1844 } 1845 case "url": 1846 if v != nil { 1847 var URL string 1848 err = json.Unmarshal(*v, &URL) 1849 if err != nil { 1850 return err 1851 } 1852 cw.URL = &URL 1853 } 1854 case "image": 1855 if v != nil { 1856 var imageVar ImageObject 1857 err = json.Unmarshal(*v, &imageVar) 1858 if err != nil { 1859 return err 1860 } 1861 cw.Image = &imageVar 1862 } 1863 case "description": 1864 if v != nil { 1865 var description string 1866 err = json.Unmarshal(*v, &description) 1867 if err != nil { 1868 return err 1869 } 1870 cw.Description = &description 1871 } 1872 case "alternateName": 1873 if v != nil { 1874 var alternateName string 1875 err = json.Unmarshal(*v, &alternateName) 1876 if err != nil { 1877 return err 1878 } 1879 cw.AlternateName = &alternateName 1880 } 1881 case "bingId": 1882 if v != nil { 1883 var bingID string 1884 err = json.Unmarshal(*v, &bingID) 1885 if err != nil { 1886 return err 1887 } 1888 cw.BingID = &bingID 1889 } 1890 case "readLink": 1891 if v != nil { 1892 var readLink string 1893 err = json.Unmarshal(*v, &readLink) 1894 if err != nil { 1895 return err 1896 } 1897 cw.ReadLink = &readLink 1898 } 1899 case "webSearchUrl": 1900 if v != nil { 1901 var webSearchURL string 1902 err = json.Unmarshal(*v, &webSearchURL) 1903 if err != nil { 1904 return err 1905 } 1906 cw.WebSearchURL = &webSearchURL 1907 } 1908 case "id": 1909 if v != nil { 1910 var ID string 1911 err = json.Unmarshal(*v, &ID) 1912 if err != nil { 1913 return err 1914 } 1915 cw.ID = &ID 1916 } 1917 case "_type": 1918 if v != nil { 1919 var typeVar Type 1920 err = json.Unmarshal(*v, &typeVar) 1921 if err != nil { 1922 return err 1923 } 1924 cw.Type = typeVar 1925 } 1926 } 1927 } 1928 1929 return nil 1930} 1931 1932// CropArea a JSON object consisting of coordinates specifying the four corners of a cropped rectangle 1933// within the input image. 1934type CropArea struct { 1935 // Top - The top coordinate of the region to be cropped. The coordinate is a fractional value of the original image's height and is measured from the top edge of the image. Specify the coordinate as a value from 0.0 through 1.0. 1936 Top *float64 `json:"top,omitempty"` 1937 // Bottom - The bottom coordinate of the region to be cropped. The coordinate is a fractional value of the original image's height and is measured from the top edge of the image. Specify the coordinate as a value from 0.0 through 1.0. 1938 Bottom *float64 `json:"bottom,omitempty"` 1939 // Left - The left coordinate of the region to be cropped. The coordinate is a fractional value of the original image's width and is measured from the left edge of the image. Specify the coordinate as a value from 0.0 through 1.0. 1940 Left *float64 `json:"left,omitempty"` 1941 // Right - The right coordinate of the region to be cropped. The coordinate is a fractional value of the original image's width and is measured from the left edge of the image. Specify the coordinate as a value from 0.0 through 1.0. 1942 Right *float64 `json:"right,omitempty"` 1943} 1944 1945// Error defines the error that occurred. 1946type Error struct { 1947 // Code - The error code that identifies the category of error. Possible values include: 'None', 'ServerError', 'InvalidRequest', 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization' 1948 Code ErrorCode `json:"code,omitempty"` 1949 // 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' 1950 SubCode ErrorSubCode `json:"subCode,omitempty"` 1951 // Message - A description of the error. 1952 Message *string `json:"message,omitempty"` 1953 // MoreDetails - READ-ONLY; A description that provides additional information about the error. 1954 MoreDetails *string `json:"moreDetails,omitempty"` 1955 // Parameter - READ-ONLY; The parameter in the request that caused the error. 1956 Parameter *string `json:"parameter,omitempty"` 1957 // Value - READ-ONLY; The parameter's value in the request that was not valid. 1958 Value *string `json:"value,omitempty"` 1959} 1960 1961// ErrorResponse the top-level response that represents a failed request. 1962type ErrorResponse struct { 1963 // Errors - A list of errors that describe the reasons why the request failed. 1964 Errors *[]Error `json:"errors,omitempty"` 1965 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 1966 ReadLink *string `json:"readLink,omitempty"` 1967 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 1968 WebSearchURL *string `json:"webSearchUrl,omitempty"` 1969 // ID - READ-ONLY; A String identifier. 1970 ID *string `json:"id,omitempty"` 1971 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 1972 Type Type `json:"_type,omitempty"` 1973} 1974 1975// MarshalJSON is the custom marshaler for ErrorResponse. 1976func (er ErrorResponse) MarshalJSON() ([]byte, error) { 1977 er.Type = TypeErrorResponse 1978 objectMap := make(map[string]interface{}) 1979 if er.Errors != nil { 1980 objectMap["errors"] = er.Errors 1981 } 1982 if er.Type != "" { 1983 objectMap["_type"] = er.Type 1984 } 1985 return json.Marshal(objectMap) 1986} 1987 1988// AsPoint2D is the BasicResponseBase implementation for ErrorResponse. 1989func (er ErrorResponse) AsPoint2D() (*Point2D, bool) { 1990 return nil, false 1991} 1992 1993// AsNormalizedQuadrilateral is the BasicResponseBase implementation for ErrorResponse. 1994func (er ErrorResponse) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 1995 return nil, false 1996} 1997 1998// AsImageAction is the BasicResponseBase implementation for ErrorResponse. 1999func (er ErrorResponse) AsImageAction() (*ImageAction, bool) { 2000 return nil, false 2001} 2002 2003// AsBasicImageAction is the BasicResponseBase implementation for ErrorResponse. 2004func (er ErrorResponse) AsBasicImageAction() (BasicImageAction, bool) { 2005 return nil, false 2006} 2007 2008// AsImageTag is the BasicResponseBase implementation for ErrorResponse. 2009func (er ErrorResponse) AsImageTag() (*ImageTag, bool) { 2010 return nil, false 2011} 2012 2013// AsOrganization is the BasicResponseBase implementation for ErrorResponse. 2014func (er ErrorResponse) AsOrganization() (*Organization, bool) { 2015 return nil, false 2016} 2017 2018// AsOffer is the BasicResponseBase implementation for ErrorResponse. 2019func (er ErrorResponse) AsOffer() (*Offer, bool) { 2020 return nil, false 2021} 2022 2023// AsBasicOffer is the BasicResponseBase implementation for ErrorResponse. 2024func (er ErrorResponse) AsBasicOffer() (BasicOffer, bool) { 2025 return nil, false 2026} 2027 2028// AsAggregateOffer is the BasicResponseBase implementation for ErrorResponse. 2029func (er ErrorResponse) AsAggregateOffer() (*AggregateOffer, bool) { 2030 return nil, false 2031} 2032 2033// AsImageObject is the BasicResponseBase implementation for ErrorResponse. 2034func (er ErrorResponse) AsImageObject() (*ImageObject, bool) { 2035 return nil, false 2036} 2037 2038// AsImageKnowledge is the BasicResponseBase implementation for ErrorResponse. 2039func (er ErrorResponse) AsImageKnowledge() (*ImageKnowledge, bool) { 2040 return nil, false 2041} 2042 2043// AsResponse is the BasicResponseBase implementation for ErrorResponse. 2044func (er ErrorResponse) AsResponse() (*Response, bool) { 2045 return nil, false 2046} 2047 2048// AsBasicResponse is the BasicResponseBase implementation for ErrorResponse. 2049func (er ErrorResponse) AsBasicResponse() (BasicResponse, bool) { 2050 return &er, true 2051} 2052 2053// AsIdentifiable is the BasicResponseBase implementation for ErrorResponse. 2054func (er ErrorResponse) AsIdentifiable() (*Identifiable, bool) { 2055 return nil, false 2056} 2057 2058// AsBasicIdentifiable is the BasicResponseBase implementation for ErrorResponse. 2059func (er ErrorResponse) AsBasicIdentifiable() (BasicIdentifiable, bool) { 2060 return &er, true 2061} 2062 2063// AsErrorResponse is the BasicResponseBase implementation for ErrorResponse. 2064func (er ErrorResponse) AsErrorResponse() (*ErrorResponse, bool) { 2065 return &er, true 2066} 2067 2068// AsThing is the BasicResponseBase implementation for ErrorResponse. 2069func (er ErrorResponse) AsThing() (*Thing, bool) { 2070 return nil, false 2071} 2072 2073// AsBasicThing is the BasicResponseBase implementation for ErrorResponse. 2074func (er ErrorResponse) AsBasicThing() (BasicThing, bool) { 2075 return nil, false 2076} 2077 2078// AsAction is the BasicResponseBase implementation for ErrorResponse. 2079func (er ErrorResponse) AsAction() (*Action, bool) { 2080 return nil, false 2081} 2082 2083// AsBasicAction is the BasicResponseBase implementation for ErrorResponse. 2084func (er ErrorResponse) AsBasicAction() (BasicAction, bool) { 2085 return nil, false 2086} 2087 2088// AsMediaObject is the BasicResponseBase implementation for ErrorResponse. 2089func (er ErrorResponse) AsMediaObject() (*MediaObject, bool) { 2090 return nil, false 2091} 2092 2093// AsBasicMediaObject is the BasicResponseBase implementation for ErrorResponse. 2094func (er ErrorResponse) AsBasicMediaObject() (BasicMediaObject, bool) { 2095 return nil, false 2096} 2097 2098// AsCreativeWork is the BasicResponseBase implementation for ErrorResponse. 2099func (er ErrorResponse) AsCreativeWork() (*CreativeWork, bool) { 2100 return nil, false 2101} 2102 2103// AsBasicCreativeWork is the BasicResponseBase implementation for ErrorResponse. 2104func (er ErrorResponse) AsBasicCreativeWork() (BasicCreativeWork, bool) { 2105 return nil, false 2106} 2107 2108// AsPerson is the BasicResponseBase implementation for ErrorResponse. 2109func (er ErrorResponse) AsPerson() (*Person, bool) { 2110 return nil, false 2111} 2112 2113// AsIntangible is the BasicResponseBase implementation for ErrorResponse. 2114func (er ErrorResponse) AsIntangible() (*Intangible, bool) { 2115 return nil, false 2116} 2117 2118// AsBasicIntangible is the BasicResponseBase implementation for ErrorResponse. 2119func (er ErrorResponse) AsBasicIntangible() (BasicIntangible, bool) { 2120 return nil, false 2121} 2122 2123// AsImageEntityAction is the BasicResponseBase implementation for ErrorResponse. 2124func (er ErrorResponse) AsImageEntityAction() (*ImageEntityAction, bool) { 2125 return nil, false 2126} 2127 2128// AsImageModuleAction is the BasicResponseBase implementation for ErrorResponse. 2129func (er ErrorResponse) AsImageModuleAction() (*ImageModuleAction, bool) { 2130 return nil, false 2131} 2132 2133// AsRecipe is the BasicResponseBase implementation for ErrorResponse. 2134func (er ErrorResponse) AsRecipe() (*Recipe, bool) { 2135 return nil, false 2136} 2137 2138// AsImageRecipesAction is the BasicResponseBase implementation for ErrorResponse. 2139func (er ErrorResponse) AsImageRecipesAction() (*ImageRecipesAction, bool) { 2140 return nil, false 2141} 2142 2143// AsImageRelatedSearchesAction is the BasicResponseBase implementation for ErrorResponse. 2144func (er ErrorResponse) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 2145 return nil, false 2146} 2147 2148// AsImageShoppingSourcesAction is the BasicResponseBase implementation for ErrorResponse. 2149func (er ErrorResponse) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 2150 return nil, false 2151} 2152 2153// AsStructuredValue is the BasicResponseBase implementation for ErrorResponse. 2154func (er ErrorResponse) AsStructuredValue() (*StructuredValue, bool) { 2155 return nil, false 2156} 2157 2158// AsBasicStructuredValue is the BasicResponseBase implementation for ErrorResponse. 2159func (er ErrorResponse) AsBasicStructuredValue() (BasicStructuredValue, bool) { 2160 return nil, false 2161} 2162 2163// AsResponseBase is the BasicResponseBase implementation for ErrorResponse. 2164func (er ErrorResponse) AsResponseBase() (*ResponseBase, bool) { 2165 return nil, false 2166} 2167 2168// AsBasicResponseBase is the BasicResponseBase implementation for ErrorResponse. 2169func (er ErrorResponse) AsBasicResponseBase() (BasicResponseBase, bool) { 2170 return &er, true 2171} 2172 2173// Filters a key-value object consisting of filters that may be specified to limit the results returned by 2174// the API. Current available filters: site. 2175type Filters struct { 2176 // Site - The URL of the site to return similar images and similar products from. (e.g., "www.bing.com", "bing.com"). 2177 Site *string `json:"site,omitempty"` 2178} 2179 2180// BasicIdentifiable defines the identity of a resource. 2181type BasicIdentifiable interface { 2182 AsPoint2D() (*Point2D, bool) 2183 AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) 2184 AsImageAction() (*ImageAction, bool) 2185 AsBasicImageAction() (BasicImageAction, bool) 2186 AsImageTag() (*ImageTag, bool) 2187 AsOrganization() (*Organization, bool) 2188 AsOffer() (*Offer, bool) 2189 AsBasicOffer() (BasicOffer, bool) 2190 AsAggregateOffer() (*AggregateOffer, bool) 2191 AsImageObject() (*ImageObject, bool) 2192 AsImageKnowledge() (*ImageKnowledge, bool) 2193 AsResponse() (*Response, bool) 2194 AsBasicResponse() (BasicResponse, bool) 2195 AsErrorResponse() (*ErrorResponse, bool) 2196 AsThing() (*Thing, bool) 2197 AsBasicThing() (BasicThing, bool) 2198 AsAction() (*Action, bool) 2199 AsBasicAction() (BasicAction, bool) 2200 AsMediaObject() (*MediaObject, bool) 2201 AsBasicMediaObject() (BasicMediaObject, bool) 2202 AsCreativeWork() (*CreativeWork, bool) 2203 AsBasicCreativeWork() (BasicCreativeWork, bool) 2204 AsPerson() (*Person, bool) 2205 AsIntangible() (*Intangible, bool) 2206 AsBasicIntangible() (BasicIntangible, bool) 2207 AsImageEntityAction() (*ImageEntityAction, bool) 2208 AsImageModuleAction() (*ImageModuleAction, bool) 2209 AsRecipe() (*Recipe, bool) 2210 AsImageRecipesAction() (*ImageRecipesAction, bool) 2211 AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) 2212 AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) 2213 AsStructuredValue() (*StructuredValue, bool) 2214 AsBasicStructuredValue() (BasicStructuredValue, bool) 2215 AsIdentifiable() (*Identifiable, bool) 2216} 2217 2218// Identifiable defines the identity of a resource. 2219type Identifiable struct { 2220 // ID - READ-ONLY; A String identifier. 2221 ID *string `json:"id,omitempty"` 2222 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 2223 Type Type `json:"_type,omitempty"` 2224} 2225 2226func unmarshalBasicIdentifiable(body []byte) (BasicIdentifiable, error) { 2227 var m map[string]interface{} 2228 err := json.Unmarshal(body, &m) 2229 if err != nil { 2230 return nil, err 2231 } 2232 2233 switch m["_type"] { 2234 case string(TypePoint2D): 2235 var p2 Point2D 2236 err := json.Unmarshal(body, &p2) 2237 return p2, err 2238 case string(TypeNormalizedQuadrilateral): 2239 var nq NormalizedQuadrilateral 2240 err := json.Unmarshal(body, &nq) 2241 return nq, err 2242 case string(TypeImageAction): 2243 var ia ImageAction 2244 err := json.Unmarshal(body, &ia) 2245 return ia, err 2246 case string(TypeImageTag): 2247 var it ImageTag 2248 err := json.Unmarshal(body, &it) 2249 return it, err 2250 case string(TypeOrganization): 2251 var o Organization 2252 err := json.Unmarshal(body, &o) 2253 return o, err 2254 case string(TypeOffer): 2255 var o Offer 2256 err := json.Unmarshal(body, &o) 2257 return o, err 2258 case string(TypeAggregateOffer): 2259 var ao AggregateOffer 2260 err := json.Unmarshal(body, &ao) 2261 return ao, err 2262 case string(TypeImageObject): 2263 var ioVar ImageObject 2264 err := json.Unmarshal(body, &ioVar) 2265 return ioVar, err 2266 case string(TypeImageKnowledge): 2267 var ik ImageKnowledge 2268 err := json.Unmarshal(body, &ik) 2269 return ik, err 2270 case string(TypeResponse): 2271 var r Response 2272 err := json.Unmarshal(body, &r) 2273 return r, err 2274 case string(TypeErrorResponse): 2275 var er ErrorResponse 2276 err := json.Unmarshal(body, &er) 2277 return er, err 2278 case string(TypeThing): 2279 var t Thing 2280 err := json.Unmarshal(body, &t) 2281 return t, err 2282 case string(TypeAction): 2283 var a Action 2284 err := json.Unmarshal(body, &a) 2285 return a, err 2286 case string(TypeMediaObject): 2287 var mo MediaObject 2288 err := json.Unmarshal(body, &mo) 2289 return mo, err 2290 case string(TypeCreativeWork): 2291 var cw CreativeWork 2292 err := json.Unmarshal(body, &cw) 2293 return cw, err 2294 case string(TypePerson): 2295 var p Person 2296 err := json.Unmarshal(body, &p) 2297 return p, err 2298 case string(TypeIntangible): 2299 var i Intangible 2300 err := json.Unmarshal(body, &i) 2301 return i, err 2302 case string(TypeImageEntityAction): 2303 var iea ImageEntityAction 2304 err := json.Unmarshal(body, &iea) 2305 return iea, err 2306 case string(TypeImageModuleAction): 2307 var ima ImageModuleAction 2308 err := json.Unmarshal(body, &ima) 2309 return ima, err 2310 case string(TypeRecipe): 2311 var r Recipe 2312 err := json.Unmarshal(body, &r) 2313 return r, err 2314 case string(TypeImageRecipesAction): 2315 var ira ImageRecipesAction 2316 err := json.Unmarshal(body, &ira) 2317 return ira, err 2318 case string(TypeImageRelatedSearchesAction): 2319 var irsa ImageRelatedSearchesAction 2320 err := json.Unmarshal(body, &irsa) 2321 return irsa, err 2322 case string(TypeImageShoppingSourcesAction): 2323 var issa ImageShoppingSourcesAction 2324 err := json.Unmarshal(body, &issa) 2325 return issa, err 2326 case string(TypeStructuredValue): 2327 var sv StructuredValue 2328 err := json.Unmarshal(body, &sv) 2329 return sv, err 2330 default: 2331 var i Identifiable 2332 err := json.Unmarshal(body, &i) 2333 return i, err 2334 } 2335} 2336func unmarshalBasicIdentifiableArray(body []byte) ([]BasicIdentifiable, error) { 2337 var rawMessages []*json.RawMessage 2338 err := json.Unmarshal(body, &rawMessages) 2339 if err != nil { 2340 return nil, err 2341 } 2342 2343 iArray := make([]BasicIdentifiable, len(rawMessages)) 2344 2345 for index, rawMessage := range rawMessages { 2346 i, err := unmarshalBasicIdentifiable(*rawMessage) 2347 if err != nil { 2348 return nil, err 2349 } 2350 iArray[index] = i 2351 } 2352 return iArray, nil 2353} 2354 2355// MarshalJSON is the custom marshaler for Identifiable. 2356func (i Identifiable) MarshalJSON() ([]byte, error) { 2357 i.Type = TypeIdentifiable 2358 objectMap := make(map[string]interface{}) 2359 if i.Type != "" { 2360 objectMap["_type"] = i.Type 2361 } 2362 return json.Marshal(objectMap) 2363} 2364 2365// AsPoint2D is the BasicResponseBase implementation for Identifiable. 2366func (i Identifiable) AsPoint2D() (*Point2D, bool) { 2367 return nil, false 2368} 2369 2370// AsNormalizedQuadrilateral is the BasicResponseBase implementation for Identifiable. 2371func (i Identifiable) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 2372 return nil, false 2373} 2374 2375// AsImageAction is the BasicResponseBase implementation for Identifiable. 2376func (i Identifiable) AsImageAction() (*ImageAction, bool) { 2377 return nil, false 2378} 2379 2380// AsBasicImageAction is the BasicResponseBase implementation for Identifiable. 2381func (i Identifiable) AsBasicImageAction() (BasicImageAction, bool) { 2382 return nil, false 2383} 2384 2385// AsImageTag is the BasicResponseBase implementation for Identifiable. 2386func (i Identifiable) AsImageTag() (*ImageTag, bool) { 2387 return nil, false 2388} 2389 2390// AsOrganization is the BasicResponseBase implementation for Identifiable. 2391func (i Identifiable) AsOrganization() (*Organization, bool) { 2392 return nil, false 2393} 2394 2395// AsOffer is the BasicResponseBase implementation for Identifiable. 2396func (i Identifiable) AsOffer() (*Offer, bool) { 2397 return nil, false 2398} 2399 2400// AsBasicOffer is the BasicResponseBase implementation for Identifiable. 2401func (i Identifiable) AsBasicOffer() (BasicOffer, bool) { 2402 return nil, false 2403} 2404 2405// AsAggregateOffer is the BasicResponseBase implementation for Identifiable. 2406func (i Identifiable) AsAggregateOffer() (*AggregateOffer, bool) { 2407 return nil, false 2408} 2409 2410// AsImageObject is the BasicResponseBase implementation for Identifiable. 2411func (i Identifiable) AsImageObject() (*ImageObject, bool) { 2412 return nil, false 2413} 2414 2415// AsImageKnowledge is the BasicResponseBase implementation for Identifiable. 2416func (i Identifiable) AsImageKnowledge() (*ImageKnowledge, bool) { 2417 return nil, false 2418} 2419 2420// AsResponse is the BasicResponseBase implementation for Identifiable. 2421func (i Identifiable) AsResponse() (*Response, bool) { 2422 return nil, false 2423} 2424 2425// AsBasicResponse is the BasicResponseBase implementation for Identifiable. 2426func (i Identifiable) AsBasicResponse() (BasicResponse, bool) { 2427 return nil, false 2428} 2429 2430// AsIdentifiable is the BasicResponseBase implementation for Identifiable. 2431func (i Identifiable) AsIdentifiable() (*Identifiable, bool) { 2432 return &i, true 2433} 2434 2435// AsBasicIdentifiable is the BasicResponseBase implementation for Identifiable. 2436func (i Identifiable) AsBasicIdentifiable() (BasicIdentifiable, bool) { 2437 return &i, true 2438} 2439 2440// AsErrorResponse is the BasicResponseBase implementation for Identifiable. 2441func (i Identifiable) AsErrorResponse() (*ErrorResponse, bool) { 2442 return nil, false 2443} 2444 2445// AsThing is the BasicResponseBase implementation for Identifiable. 2446func (i Identifiable) AsThing() (*Thing, bool) { 2447 return nil, false 2448} 2449 2450// AsBasicThing is the BasicResponseBase implementation for Identifiable. 2451func (i Identifiable) AsBasicThing() (BasicThing, bool) { 2452 return nil, false 2453} 2454 2455// AsAction is the BasicResponseBase implementation for Identifiable. 2456func (i Identifiable) AsAction() (*Action, bool) { 2457 return nil, false 2458} 2459 2460// AsBasicAction is the BasicResponseBase implementation for Identifiable. 2461func (i Identifiable) AsBasicAction() (BasicAction, bool) { 2462 return nil, false 2463} 2464 2465// AsMediaObject is the BasicResponseBase implementation for Identifiable. 2466func (i Identifiable) AsMediaObject() (*MediaObject, bool) { 2467 return nil, false 2468} 2469 2470// AsBasicMediaObject is the BasicResponseBase implementation for Identifiable. 2471func (i Identifiable) AsBasicMediaObject() (BasicMediaObject, bool) { 2472 return nil, false 2473} 2474 2475// AsCreativeWork is the BasicResponseBase implementation for Identifiable. 2476func (i Identifiable) AsCreativeWork() (*CreativeWork, bool) { 2477 return nil, false 2478} 2479 2480// AsBasicCreativeWork is the BasicResponseBase implementation for Identifiable. 2481func (i Identifiable) AsBasicCreativeWork() (BasicCreativeWork, bool) { 2482 return nil, false 2483} 2484 2485// AsPerson is the BasicResponseBase implementation for Identifiable. 2486func (i Identifiable) AsPerson() (*Person, bool) { 2487 return nil, false 2488} 2489 2490// AsIntangible is the BasicResponseBase implementation for Identifiable. 2491func (i Identifiable) AsIntangible() (*Intangible, bool) { 2492 return nil, false 2493} 2494 2495// AsBasicIntangible is the BasicResponseBase implementation for Identifiable. 2496func (i Identifiable) AsBasicIntangible() (BasicIntangible, bool) { 2497 return nil, false 2498} 2499 2500// AsImageEntityAction is the BasicResponseBase implementation for Identifiable. 2501func (i Identifiable) AsImageEntityAction() (*ImageEntityAction, bool) { 2502 return nil, false 2503} 2504 2505// AsImageModuleAction is the BasicResponseBase implementation for Identifiable. 2506func (i Identifiable) AsImageModuleAction() (*ImageModuleAction, bool) { 2507 return nil, false 2508} 2509 2510// AsRecipe is the BasicResponseBase implementation for Identifiable. 2511func (i Identifiable) AsRecipe() (*Recipe, bool) { 2512 return nil, false 2513} 2514 2515// AsImageRecipesAction is the BasicResponseBase implementation for Identifiable. 2516func (i Identifiable) AsImageRecipesAction() (*ImageRecipesAction, bool) { 2517 return nil, false 2518} 2519 2520// AsImageRelatedSearchesAction is the BasicResponseBase implementation for Identifiable. 2521func (i Identifiable) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 2522 return nil, false 2523} 2524 2525// AsImageShoppingSourcesAction is the BasicResponseBase implementation for Identifiable. 2526func (i Identifiable) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 2527 return nil, false 2528} 2529 2530// AsStructuredValue is the BasicResponseBase implementation for Identifiable. 2531func (i Identifiable) AsStructuredValue() (*StructuredValue, bool) { 2532 return nil, false 2533} 2534 2535// AsBasicStructuredValue is the BasicResponseBase implementation for Identifiable. 2536func (i Identifiable) AsBasicStructuredValue() (BasicStructuredValue, bool) { 2537 return nil, false 2538} 2539 2540// AsResponseBase is the BasicResponseBase implementation for Identifiable. 2541func (i Identifiable) AsResponseBase() (*ResponseBase, bool) { 2542 return nil, false 2543} 2544 2545// AsBasicResponseBase is the BasicResponseBase implementation for Identifiable. 2546func (i Identifiable) AsBasicResponseBase() (BasicResponseBase, bool) { 2547 return &i, true 2548} 2549 2550// BasicImageAction defines an image action. 2551type BasicImageAction interface { 2552 AsImageEntityAction() (*ImageEntityAction, bool) 2553 AsImageModuleAction() (*ImageModuleAction, bool) 2554 AsImageRecipesAction() (*ImageRecipesAction, bool) 2555 AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) 2556 AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) 2557 AsImageAction() (*ImageAction, bool) 2558} 2559 2560// ImageAction defines an image action. 2561type ImageAction struct { 2562 // ActionType - READ-ONLY; A string representing the type of action. 2563 ActionType *string `json:"actionType,omitempty"` 2564 // Result - READ-ONLY; The result produced in the action. 2565 Result *[]BasicThing `json:"result,omitempty"` 2566 // DisplayName - READ-ONLY; A display name for the action. 2567 DisplayName *string `json:"displayName,omitempty"` 2568 // IsTopAction - READ-ONLY; A Boolean representing whether this result is the top action. 2569 IsTopAction *bool `json:"isTopAction,omitempty"` 2570 // ServiceURL - READ-ONLY; Use this URL to get additional data to determine how to take the appropriate action. For example, the serviceUrl might return JSON along with an image URL. 2571 ServiceURL *string `json:"serviceUrl,omitempty"` 2572 // ThumbnailURL - READ-ONLY; The URL to a thumbnail of the item. 2573 ThumbnailURL *string `json:"thumbnailUrl,omitempty"` 2574 // Provider - READ-ONLY; The source of the creative work. 2575 Provider *[]BasicThing `json:"provider,omitempty"` 2576 // DatePublished - READ-ONLY; The date on which the CreativeWork was published. 2577 DatePublished *string `json:"datePublished,omitempty"` 2578 // Text - READ-ONLY; Text content of this creative work. 2579 Text *string `json:"text,omitempty"` 2580 // Name - READ-ONLY; The name of the thing represented by this object. 2581 Name *string `json:"name,omitempty"` 2582 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 2583 URL *string `json:"url,omitempty"` 2584 // Image - READ-ONLY; An image of the item. 2585 Image *ImageObject `json:"image,omitempty"` 2586 // Description - READ-ONLY; A short description of the item. 2587 Description *string `json:"description,omitempty"` 2588 // AlternateName - READ-ONLY; An alias for the item. 2589 AlternateName *string `json:"alternateName,omitempty"` 2590 // BingID - READ-ONLY; An ID that uniquely identifies this item. 2591 BingID *string `json:"bingId,omitempty"` 2592 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 2593 ReadLink *string `json:"readLink,omitempty"` 2594 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 2595 WebSearchURL *string `json:"webSearchUrl,omitempty"` 2596 // ID - READ-ONLY; A String identifier. 2597 ID *string `json:"id,omitempty"` 2598 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 2599 Type Type `json:"_type,omitempty"` 2600} 2601 2602func unmarshalBasicImageAction(body []byte) (BasicImageAction, error) { 2603 var m map[string]interface{} 2604 err := json.Unmarshal(body, &m) 2605 if err != nil { 2606 return nil, err 2607 } 2608 2609 switch m["_type"] { 2610 case string(TypeImageEntityAction): 2611 var iea ImageEntityAction 2612 err := json.Unmarshal(body, &iea) 2613 return iea, err 2614 case string(TypeImageModuleAction): 2615 var ima ImageModuleAction 2616 err := json.Unmarshal(body, &ima) 2617 return ima, err 2618 case string(TypeImageRecipesAction): 2619 var ira ImageRecipesAction 2620 err := json.Unmarshal(body, &ira) 2621 return ira, err 2622 case string(TypeImageRelatedSearchesAction): 2623 var irsa ImageRelatedSearchesAction 2624 err := json.Unmarshal(body, &irsa) 2625 return irsa, err 2626 case string(TypeImageShoppingSourcesAction): 2627 var issa ImageShoppingSourcesAction 2628 err := json.Unmarshal(body, &issa) 2629 return issa, err 2630 default: 2631 var ia ImageAction 2632 err := json.Unmarshal(body, &ia) 2633 return ia, err 2634 } 2635} 2636func unmarshalBasicImageActionArray(body []byte) ([]BasicImageAction, error) { 2637 var rawMessages []*json.RawMessage 2638 err := json.Unmarshal(body, &rawMessages) 2639 if err != nil { 2640 return nil, err 2641 } 2642 2643 iaArray := make([]BasicImageAction, len(rawMessages)) 2644 2645 for index, rawMessage := range rawMessages { 2646 ia, err := unmarshalBasicImageAction(*rawMessage) 2647 if err != nil { 2648 return nil, err 2649 } 2650 iaArray[index] = ia 2651 } 2652 return iaArray, nil 2653} 2654 2655// MarshalJSON is the custom marshaler for ImageAction. 2656func (ia ImageAction) MarshalJSON() ([]byte, error) { 2657 ia.Type = TypeImageAction 2658 objectMap := make(map[string]interface{}) 2659 if ia.Type != "" { 2660 objectMap["_type"] = ia.Type 2661 } 2662 return json.Marshal(objectMap) 2663} 2664 2665// AsPoint2D is the BasicResponseBase implementation for ImageAction. 2666func (ia ImageAction) AsPoint2D() (*Point2D, bool) { 2667 return nil, false 2668} 2669 2670// AsNormalizedQuadrilateral is the BasicResponseBase implementation for ImageAction. 2671func (ia ImageAction) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 2672 return nil, false 2673} 2674 2675// AsImageAction is the BasicResponseBase implementation for ImageAction. 2676func (ia ImageAction) AsImageAction() (*ImageAction, bool) { 2677 return &ia, true 2678} 2679 2680// AsBasicImageAction is the BasicResponseBase implementation for ImageAction. 2681func (ia ImageAction) AsBasicImageAction() (BasicImageAction, bool) { 2682 return &ia, true 2683} 2684 2685// AsImageTag is the BasicResponseBase implementation for ImageAction. 2686func (ia ImageAction) AsImageTag() (*ImageTag, bool) { 2687 return nil, false 2688} 2689 2690// AsOrganization is the BasicResponseBase implementation for ImageAction. 2691func (ia ImageAction) AsOrganization() (*Organization, bool) { 2692 return nil, false 2693} 2694 2695// AsOffer is the BasicResponseBase implementation for ImageAction. 2696func (ia ImageAction) AsOffer() (*Offer, bool) { 2697 return nil, false 2698} 2699 2700// AsBasicOffer is the BasicResponseBase implementation for ImageAction. 2701func (ia ImageAction) AsBasicOffer() (BasicOffer, bool) { 2702 return nil, false 2703} 2704 2705// AsAggregateOffer is the BasicResponseBase implementation for ImageAction. 2706func (ia ImageAction) AsAggregateOffer() (*AggregateOffer, bool) { 2707 return nil, false 2708} 2709 2710// AsImageObject is the BasicResponseBase implementation for ImageAction. 2711func (ia ImageAction) AsImageObject() (*ImageObject, bool) { 2712 return nil, false 2713} 2714 2715// AsImageKnowledge is the BasicResponseBase implementation for ImageAction. 2716func (ia ImageAction) AsImageKnowledge() (*ImageKnowledge, bool) { 2717 return nil, false 2718} 2719 2720// AsResponse is the BasicResponseBase implementation for ImageAction. 2721func (ia ImageAction) AsResponse() (*Response, bool) { 2722 return nil, false 2723} 2724 2725// AsBasicResponse is the BasicResponseBase implementation for ImageAction. 2726func (ia ImageAction) AsBasicResponse() (BasicResponse, bool) { 2727 return &ia, true 2728} 2729 2730// AsIdentifiable is the BasicResponseBase implementation for ImageAction. 2731func (ia ImageAction) AsIdentifiable() (*Identifiable, bool) { 2732 return nil, false 2733} 2734 2735// AsBasicIdentifiable is the BasicResponseBase implementation for ImageAction. 2736func (ia ImageAction) AsBasicIdentifiable() (BasicIdentifiable, bool) { 2737 return &ia, true 2738} 2739 2740// AsErrorResponse is the BasicResponseBase implementation for ImageAction. 2741func (ia ImageAction) AsErrorResponse() (*ErrorResponse, bool) { 2742 return nil, false 2743} 2744 2745// AsThing is the BasicResponseBase implementation for ImageAction. 2746func (ia ImageAction) AsThing() (*Thing, bool) { 2747 return nil, false 2748} 2749 2750// AsBasicThing is the BasicResponseBase implementation for ImageAction. 2751func (ia ImageAction) AsBasicThing() (BasicThing, bool) { 2752 return &ia, true 2753} 2754 2755// AsAction is the BasicResponseBase implementation for ImageAction. 2756func (ia ImageAction) AsAction() (*Action, bool) { 2757 return nil, false 2758} 2759 2760// AsBasicAction is the BasicResponseBase implementation for ImageAction. 2761func (ia ImageAction) AsBasicAction() (BasicAction, bool) { 2762 return &ia, true 2763} 2764 2765// AsMediaObject is the BasicResponseBase implementation for ImageAction. 2766func (ia ImageAction) AsMediaObject() (*MediaObject, bool) { 2767 return nil, false 2768} 2769 2770// AsBasicMediaObject is the BasicResponseBase implementation for ImageAction. 2771func (ia ImageAction) AsBasicMediaObject() (BasicMediaObject, bool) { 2772 return nil, false 2773} 2774 2775// AsCreativeWork is the BasicResponseBase implementation for ImageAction. 2776func (ia ImageAction) AsCreativeWork() (*CreativeWork, bool) { 2777 return nil, false 2778} 2779 2780// AsBasicCreativeWork is the BasicResponseBase implementation for ImageAction. 2781func (ia ImageAction) AsBasicCreativeWork() (BasicCreativeWork, bool) { 2782 return &ia, true 2783} 2784 2785// AsPerson is the BasicResponseBase implementation for ImageAction. 2786func (ia ImageAction) AsPerson() (*Person, bool) { 2787 return nil, false 2788} 2789 2790// AsIntangible is the BasicResponseBase implementation for ImageAction. 2791func (ia ImageAction) AsIntangible() (*Intangible, bool) { 2792 return nil, false 2793} 2794 2795// AsBasicIntangible is the BasicResponseBase implementation for ImageAction. 2796func (ia ImageAction) AsBasicIntangible() (BasicIntangible, bool) { 2797 return nil, false 2798} 2799 2800// AsImageEntityAction is the BasicResponseBase implementation for ImageAction. 2801func (ia ImageAction) AsImageEntityAction() (*ImageEntityAction, bool) { 2802 return nil, false 2803} 2804 2805// AsImageModuleAction is the BasicResponseBase implementation for ImageAction. 2806func (ia ImageAction) AsImageModuleAction() (*ImageModuleAction, bool) { 2807 return nil, false 2808} 2809 2810// AsRecipe is the BasicResponseBase implementation for ImageAction. 2811func (ia ImageAction) AsRecipe() (*Recipe, bool) { 2812 return nil, false 2813} 2814 2815// AsImageRecipesAction is the BasicResponseBase implementation for ImageAction. 2816func (ia ImageAction) AsImageRecipesAction() (*ImageRecipesAction, bool) { 2817 return nil, false 2818} 2819 2820// AsImageRelatedSearchesAction is the BasicResponseBase implementation for ImageAction. 2821func (ia ImageAction) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 2822 return nil, false 2823} 2824 2825// AsImageShoppingSourcesAction is the BasicResponseBase implementation for ImageAction. 2826func (ia ImageAction) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 2827 return nil, false 2828} 2829 2830// AsStructuredValue is the BasicResponseBase implementation for ImageAction. 2831func (ia ImageAction) AsStructuredValue() (*StructuredValue, bool) { 2832 return nil, false 2833} 2834 2835// AsBasicStructuredValue is the BasicResponseBase implementation for ImageAction. 2836func (ia ImageAction) AsBasicStructuredValue() (BasicStructuredValue, bool) { 2837 return nil, false 2838} 2839 2840// AsResponseBase is the BasicResponseBase implementation for ImageAction. 2841func (ia ImageAction) AsResponseBase() (*ResponseBase, bool) { 2842 return nil, false 2843} 2844 2845// AsBasicResponseBase is the BasicResponseBase implementation for ImageAction. 2846func (ia ImageAction) AsBasicResponseBase() (BasicResponseBase, bool) { 2847 return &ia, true 2848} 2849 2850// UnmarshalJSON is the custom unmarshaler for ImageAction struct. 2851func (ia *ImageAction) UnmarshalJSON(body []byte) error { 2852 var m map[string]*json.RawMessage 2853 err := json.Unmarshal(body, &m) 2854 if err != nil { 2855 return err 2856 } 2857 for k, v := range m { 2858 switch k { 2859 case "actionType": 2860 if v != nil { 2861 var actionType string 2862 err = json.Unmarshal(*v, &actionType) 2863 if err != nil { 2864 return err 2865 } 2866 ia.ActionType = &actionType 2867 } 2868 case "result": 2869 if v != nil { 2870 resultVar, err := unmarshalBasicThingArray(*v) 2871 if err != nil { 2872 return err 2873 } 2874 ia.Result = &resultVar 2875 } 2876 case "displayName": 2877 if v != nil { 2878 var displayName string 2879 err = json.Unmarshal(*v, &displayName) 2880 if err != nil { 2881 return err 2882 } 2883 ia.DisplayName = &displayName 2884 } 2885 case "isTopAction": 2886 if v != nil { 2887 var isTopAction bool 2888 err = json.Unmarshal(*v, &isTopAction) 2889 if err != nil { 2890 return err 2891 } 2892 ia.IsTopAction = &isTopAction 2893 } 2894 case "serviceUrl": 2895 if v != nil { 2896 var serviceURL string 2897 err = json.Unmarshal(*v, &serviceURL) 2898 if err != nil { 2899 return err 2900 } 2901 ia.ServiceURL = &serviceURL 2902 } 2903 case "thumbnailUrl": 2904 if v != nil { 2905 var thumbnailURL string 2906 err = json.Unmarshal(*v, &thumbnailURL) 2907 if err != nil { 2908 return err 2909 } 2910 ia.ThumbnailURL = &thumbnailURL 2911 } 2912 case "provider": 2913 if v != nil { 2914 provider, err := unmarshalBasicThingArray(*v) 2915 if err != nil { 2916 return err 2917 } 2918 ia.Provider = &provider 2919 } 2920 case "datePublished": 2921 if v != nil { 2922 var datePublished string 2923 err = json.Unmarshal(*v, &datePublished) 2924 if err != nil { 2925 return err 2926 } 2927 ia.DatePublished = &datePublished 2928 } 2929 case "text": 2930 if v != nil { 2931 var textVar string 2932 err = json.Unmarshal(*v, &textVar) 2933 if err != nil { 2934 return err 2935 } 2936 ia.Text = &textVar 2937 } 2938 case "name": 2939 if v != nil { 2940 var name string 2941 err = json.Unmarshal(*v, &name) 2942 if err != nil { 2943 return err 2944 } 2945 ia.Name = &name 2946 } 2947 case "url": 2948 if v != nil { 2949 var URL string 2950 err = json.Unmarshal(*v, &URL) 2951 if err != nil { 2952 return err 2953 } 2954 ia.URL = &URL 2955 } 2956 case "image": 2957 if v != nil { 2958 var imageVar ImageObject 2959 err = json.Unmarshal(*v, &imageVar) 2960 if err != nil { 2961 return err 2962 } 2963 ia.Image = &imageVar 2964 } 2965 case "description": 2966 if v != nil { 2967 var description string 2968 err = json.Unmarshal(*v, &description) 2969 if err != nil { 2970 return err 2971 } 2972 ia.Description = &description 2973 } 2974 case "alternateName": 2975 if v != nil { 2976 var alternateName string 2977 err = json.Unmarshal(*v, &alternateName) 2978 if err != nil { 2979 return err 2980 } 2981 ia.AlternateName = &alternateName 2982 } 2983 case "bingId": 2984 if v != nil { 2985 var bingID string 2986 err = json.Unmarshal(*v, &bingID) 2987 if err != nil { 2988 return err 2989 } 2990 ia.BingID = &bingID 2991 } 2992 case "readLink": 2993 if v != nil { 2994 var readLink string 2995 err = json.Unmarshal(*v, &readLink) 2996 if err != nil { 2997 return err 2998 } 2999 ia.ReadLink = &readLink 3000 } 3001 case "webSearchUrl": 3002 if v != nil { 3003 var webSearchURL string 3004 err = json.Unmarshal(*v, &webSearchURL) 3005 if err != nil { 3006 return err 3007 } 3008 ia.WebSearchURL = &webSearchURL 3009 } 3010 case "id": 3011 if v != nil { 3012 var ID string 3013 err = json.Unmarshal(*v, &ID) 3014 if err != nil { 3015 return err 3016 } 3017 ia.ID = &ID 3018 } 3019 case "_type": 3020 if v != nil { 3021 var typeVar Type 3022 err = json.Unmarshal(*v, &typeVar) 3023 if err != nil { 3024 return err 3025 } 3026 ia.Type = typeVar 3027 } 3028 } 3029 } 3030 3031 return nil 3032} 3033 3034// ImageEntityAction defines an entity action. 3035type ImageEntityAction struct { 3036 // ActionType - READ-ONLY; A string representing the type of action. 3037 ActionType *string `json:"actionType,omitempty"` 3038 // Result - READ-ONLY; The result produced in the action. 3039 Result *[]BasicThing `json:"result,omitempty"` 3040 // DisplayName - READ-ONLY; A display name for the action. 3041 DisplayName *string `json:"displayName,omitempty"` 3042 // IsTopAction - READ-ONLY; A Boolean representing whether this result is the top action. 3043 IsTopAction *bool `json:"isTopAction,omitempty"` 3044 // ServiceURL - READ-ONLY; Use this URL to get additional data to determine how to take the appropriate action. For example, the serviceUrl might return JSON along with an image URL. 3045 ServiceURL *string `json:"serviceUrl,omitempty"` 3046 // ThumbnailURL - READ-ONLY; The URL to a thumbnail of the item. 3047 ThumbnailURL *string `json:"thumbnailUrl,omitempty"` 3048 // Provider - READ-ONLY; The source of the creative work. 3049 Provider *[]BasicThing `json:"provider,omitempty"` 3050 // DatePublished - READ-ONLY; The date on which the CreativeWork was published. 3051 DatePublished *string `json:"datePublished,omitempty"` 3052 // Text - READ-ONLY; Text content of this creative work. 3053 Text *string `json:"text,omitempty"` 3054 // Name - READ-ONLY; The name of the thing represented by this object. 3055 Name *string `json:"name,omitempty"` 3056 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 3057 URL *string `json:"url,omitempty"` 3058 // Image - READ-ONLY; An image of the item. 3059 Image *ImageObject `json:"image,omitempty"` 3060 // Description - READ-ONLY; A short description of the item. 3061 Description *string `json:"description,omitempty"` 3062 // AlternateName - READ-ONLY; An alias for the item. 3063 AlternateName *string `json:"alternateName,omitempty"` 3064 // BingID - READ-ONLY; An ID that uniquely identifies this item. 3065 BingID *string `json:"bingId,omitempty"` 3066 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 3067 ReadLink *string `json:"readLink,omitempty"` 3068 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 3069 WebSearchURL *string `json:"webSearchUrl,omitempty"` 3070 // ID - READ-ONLY; A String identifier. 3071 ID *string `json:"id,omitempty"` 3072 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 3073 Type Type `json:"_type,omitempty"` 3074} 3075 3076// MarshalJSON is the custom marshaler for ImageEntityAction. 3077func (iea ImageEntityAction) MarshalJSON() ([]byte, error) { 3078 iea.Type = TypeImageEntityAction 3079 objectMap := make(map[string]interface{}) 3080 if iea.Type != "" { 3081 objectMap["_type"] = iea.Type 3082 } 3083 return json.Marshal(objectMap) 3084} 3085 3086// AsPoint2D is the BasicResponseBase implementation for ImageEntityAction. 3087func (iea ImageEntityAction) AsPoint2D() (*Point2D, bool) { 3088 return nil, false 3089} 3090 3091// AsNormalizedQuadrilateral is the BasicResponseBase implementation for ImageEntityAction. 3092func (iea ImageEntityAction) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 3093 return nil, false 3094} 3095 3096// AsImageAction is the BasicResponseBase implementation for ImageEntityAction. 3097func (iea ImageEntityAction) AsImageAction() (*ImageAction, bool) { 3098 return nil, false 3099} 3100 3101// AsBasicImageAction is the BasicResponseBase implementation for ImageEntityAction. 3102func (iea ImageEntityAction) AsBasicImageAction() (BasicImageAction, bool) { 3103 return &iea, true 3104} 3105 3106// AsImageTag is the BasicResponseBase implementation for ImageEntityAction. 3107func (iea ImageEntityAction) AsImageTag() (*ImageTag, bool) { 3108 return nil, false 3109} 3110 3111// AsOrganization is the BasicResponseBase implementation for ImageEntityAction. 3112func (iea ImageEntityAction) AsOrganization() (*Organization, bool) { 3113 return nil, false 3114} 3115 3116// AsOffer is the BasicResponseBase implementation for ImageEntityAction. 3117func (iea ImageEntityAction) AsOffer() (*Offer, bool) { 3118 return nil, false 3119} 3120 3121// AsBasicOffer is the BasicResponseBase implementation for ImageEntityAction. 3122func (iea ImageEntityAction) AsBasicOffer() (BasicOffer, bool) { 3123 return nil, false 3124} 3125 3126// AsAggregateOffer is the BasicResponseBase implementation for ImageEntityAction. 3127func (iea ImageEntityAction) AsAggregateOffer() (*AggregateOffer, bool) { 3128 return nil, false 3129} 3130 3131// AsImageObject is the BasicResponseBase implementation for ImageEntityAction. 3132func (iea ImageEntityAction) AsImageObject() (*ImageObject, bool) { 3133 return nil, false 3134} 3135 3136// AsImageKnowledge is the BasicResponseBase implementation for ImageEntityAction. 3137func (iea ImageEntityAction) AsImageKnowledge() (*ImageKnowledge, bool) { 3138 return nil, false 3139} 3140 3141// AsResponse is the BasicResponseBase implementation for ImageEntityAction. 3142func (iea ImageEntityAction) AsResponse() (*Response, bool) { 3143 return nil, false 3144} 3145 3146// AsBasicResponse is the BasicResponseBase implementation for ImageEntityAction. 3147func (iea ImageEntityAction) AsBasicResponse() (BasicResponse, bool) { 3148 return &iea, true 3149} 3150 3151// AsIdentifiable is the BasicResponseBase implementation for ImageEntityAction. 3152func (iea ImageEntityAction) AsIdentifiable() (*Identifiable, bool) { 3153 return nil, false 3154} 3155 3156// AsBasicIdentifiable is the BasicResponseBase implementation for ImageEntityAction. 3157func (iea ImageEntityAction) AsBasicIdentifiable() (BasicIdentifiable, bool) { 3158 return &iea, true 3159} 3160 3161// AsErrorResponse is the BasicResponseBase implementation for ImageEntityAction. 3162func (iea ImageEntityAction) AsErrorResponse() (*ErrorResponse, bool) { 3163 return nil, false 3164} 3165 3166// AsThing is the BasicResponseBase implementation for ImageEntityAction. 3167func (iea ImageEntityAction) AsThing() (*Thing, bool) { 3168 return nil, false 3169} 3170 3171// AsBasicThing is the BasicResponseBase implementation for ImageEntityAction. 3172func (iea ImageEntityAction) AsBasicThing() (BasicThing, bool) { 3173 return &iea, true 3174} 3175 3176// AsAction is the BasicResponseBase implementation for ImageEntityAction. 3177func (iea ImageEntityAction) AsAction() (*Action, bool) { 3178 return nil, false 3179} 3180 3181// AsBasicAction is the BasicResponseBase implementation for ImageEntityAction. 3182func (iea ImageEntityAction) AsBasicAction() (BasicAction, bool) { 3183 return &iea, true 3184} 3185 3186// AsMediaObject is the BasicResponseBase implementation for ImageEntityAction. 3187func (iea ImageEntityAction) AsMediaObject() (*MediaObject, bool) { 3188 return nil, false 3189} 3190 3191// AsBasicMediaObject is the BasicResponseBase implementation for ImageEntityAction. 3192func (iea ImageEntityAction) AsBasicMediaObject() (BasicMediaObject, bool) { 3193 return nil, false 3194} 3195 3196// AsCreativeWork is the BasicResponseBase implementation for ImageEntityAction. 3197func (iea ImageEntityAction) AsCreativeWork() (*CreativeWork, bool) { 3198 return nil, false 3199} 3200 3201// AsBasicCreativeWork is the BasicResponseBase implementation for ImageEntityAction. 3202func (iea ImageEntityAction) AsBasicCreativeWork() (BasicCreativeWork, bool) { 3203 return &iea, true 3204} 3205 3206// AsPerson is the BasicResponseBase implementation for ImageEntityAction. 3207func (iea ImageEntityAction) AsPerson() (*Person, bool) { 3208 return nil, false 3209} 3210 3211// AsIntangible is the BasicResponseBase implementation for ImageEntityAction. 3212func (iea ImageEntityAction) AsIntangible() (*Intangible, bool) { 3213 return nil, false 3214} 3215 3216// AsBasicIntangible is the BasicResponseBase implementation for ImageEntityAction. 3217func (iea ImageEntityAction) AsBasicIntangible() (BasicIntangible, bool) { 3218 return nil, false 3219} 3220 3221// AsImageEntityAction is the BasicResponseBase implementation for ImageEntityAction. 3222func (iea ImageEntityAction) AsImageEntityAction() (*ImageEntityAction, bool) { 3223 return &iea, true 3224} 3225 3226// AsImageModuleAction is the BasicResponseBase implementation for ImageEntityAction. 3227func (iea ImageEntityAction) AsImageModuleAction() (*ImageModuleAction, bool) { 3228 return nil, false 3229} 3230 3231// AsRecipe is the BasicResponseBase implementation for ImageEntityAction. 3232func (iea ImageEntityAction) AsRecipe() (*Recipe, bool) { 3233 return nil, false 3234} 3235 3236// AsImageRecipesAction is the BasicResponseBase implementation for ImageEntityAction. 3237func (iea ImageEntityAction) AsImageRecipesAction() (*ImageRecipesAction, bool) { 3238 return nil, false 3239} 3240 3241// AsImageRelatedSearchesAction is the BasicResponseBase implementation for ImageEntityAction. 3242func (iea ImageEntityAction) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 3243 return nil, false 3244} 3245 3246// AsImageShoppingSourcesAction is the BasicResponseBase implementation for ImageEntityAction. 3247func (iea ImageEntityAction) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 3248 return nil, false 3249} 3250 3251// AsStructuredValue is the BasicResponseBase implementation for ImageEntityAction. 3252func (iea ImageEntityAction) AsStructuredValue() (*StructuredValue, bool) { 3253 return nil, false 3254} 3255 3256// AsBasicStructuredValue is the BasicResponseBase implementation for ImageEntityAction. 3257func (iea ImageEntityAction) AsBasicStructuredValue() (BasicStructuredValue, bool) { 3258 return nil, false 3259} 3260 3261// AsResponseBase is the BasicResponseBase implementation for ImageEntityAction. 3262func (iea ImageEntityAction) AsResponseBase() (*ResponseBase, bool) { 3263 return nil, false 3264} 3265 3266// AsBasicResponseBase is the BasicResponseBase implementation for ImageEntityAction. 3267func (iea ImageEntityAction) AsBasicResponseBase() (BasicResponseBase, bool) { 3268 return &iea, true 3269} 3270 3271// UnmarshalJSON is the custom unmarshaler for ImageEntityAction struct. 3272func (iea *ImageEntityAction) UnmarshalJSON(body []byte) error { 3273 var m map[string]*json.RawMessage 3274 err := json.Unmarshal(body, &m) 3275 if err != nil { 3276 return err 3277 } 3278 for k, v := range m { 3279 switch k { 3280 case "actionType": 3281 if v != nil { 3282 var actionType string 3283 err = json.Unmarshal(*v, &actionType) 3284 if err != nil { 3285 return err 3286 } 3287 iea.ActionType = &actionType 3288 } 3289 case "result": 3290 if v != nil { 3291 resultVar, err := unmarshalBasicThingArray(*v) 3292 if err != nil { 3293 return err 3294 } 3295 iea.Result = &resultVar 3296 } 3297 case "displayName": 3298 if v != nil { 3299 var displayName string 3300 err = json.Unmarshal(*v, &displayName) 3301 if err != nil { 3302 return err 3303 } 3304 iea.DisplayName = &displayName 3305 } 3306 case "isTopAction": 3307 if v != nil { 3308 var isTopAction bool 3309 err = json.Unmarshal(*v, &isTopAction) 3310 if err != nil { 3311 return err 3312 } 3313 iea.IsTopAction = &isTopAction 3314 } 3315 case "serviceUrl": 3316 if v != nil { 3317 var serviceURL string 3318 err = json.Unmarshal(*v, &serviceURL) 3319 if err != nil { 3320 return err 3321 } 3322 iea.ServiceURL = &serviceURL 3323 } 3324 case "thumbnailUrl": 3325 if v != nil { 3326 var thumbnailURL string 3327 err = json.Unmarshal(*v, &thumbnailURL) 3328 if err != nil { 3329 return err 3330 } 3331 iea.ThumbnailURL = &thumbnailURL 3332 } 3333 case "provider": 3334 if v != nil { 3335 provider, err := unmarshalBasicThingArray(*v) 3336 if err != nil { 3337 return err 3338 } 3339 iea.Provider = &provider 3340 } 3341 case "datePublished": 3342 if v != nil { 3343 var datePublished string 3344 err = json.Unmarshal(*v, &datePublished) 3345 if err != nil { 3346 return err 3347 } 3348 iea.DatePublished = &datePublished 3349 } 3350 case "text": 3351 if v != nil { 3352 var textVar string 3353 err = json.Unmarshal(*v, &textVar) 3354 if err != nil { 3355 return err 3356 } 3357 iea.Text = &textVar 3358 } 3359 case "name": 3360 if v != nil { 3361 var name string 3362 err = json.Unmarshal(*v, &name) 3363 if err != nil { 3364 return err 3365 } 3366 iea.Name = &name 3367 } 3368 case "url": 3369 if v != nil { 3370 var URL string 3371 err = json.Unmarshal(*v, &URL) 3372 if err != nil { 3373 return err 3374 } 3375 iea.URL = &URL 3376 } 3377 case "image": 3378 if v != nil { 3379 var imageVar ImageObject 3380 err = json.Unmarshal(*v, &imageVar) 3381 if err != nil { 3382 return err 3383 } 3384 iea.Image = &imageVar 3385 } 3386 case "description": 3387 if v != nil { 3388 var description string 3389 err = json.Unmarshal(*v, &description) 3390 if err != nil { 3391 return err 3392 } 3393 iea.Description = &description 3394 } 3395 case "alternateName": 3396 if v != nil { 3397 var alternateName string 3398 err = json.Unmarshal(*v, &alternateName) 3399 if err != nil { 3400 return err 3401 } 3402 iea.AlternateName = &alternateName 3403 } 3404 case "bingId": 3405 if v != nil { 3406 var bingID string 3407 err = json.Unmarshal(*v, &bingID) 3408 if err != nil { 3409 return err 3410 } 3411 iea.BingID = &bingID 3412 } 3413 case "readLink": 3414 if v != nil { 3415 var readLink string 3416 err = json.Unmarshal(*v, &readLink) 3417 if err != nil { 3418 return err 3419 } 3420 iea.ReadLink = &readLink 3421 } 3422 case "webSearchUrl": 3423 if v != nil { 3424 var webSearchURL string 3425 err = json.Unmarshal(*v, &webSearchURL) 3426 if err != nil { 3427 return err 3428 } 3429 iea.WebSearchURL = &webSearchURL 3430 } 3431 case "id": 3432 if v != nil { 3433 var ID string 3434 err = json.Unmarshal(*v, &ID) 3435 if err != nil { 3436 return err 3437 } 3438 iea.ID = &ID 3439 } 3440 case "_type": 3441 if v != nil { 3442 var typeVar Type 3443 err = json.Unmarshal(*v, &typeVar) 3444 if err != nil { 3445 return err 3446 } 3447 iea.Type = typeVar 3448 } 3449 } 3450 } 3451 3452 return nil 3453} 3454 3455// ImageInfo a JSON object that identities the image to get insights of . It also includes the optional 3456// crop area that you use to identify the region of interest in the image. 3457type ImageInfo struct { 3458 // ImageInsightsToken - An image insights token. To get the insights token, call one of the Image Search APIs (for example, /images/search). In the search results, the [Image](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#image) object's [imageInsightsToken](https://docs.microsoft.com/en-us/rest/api/cognitiveservices/bing-images-api-v7-reference#image-imageinsightstoken) field contains the token. The imageInsightsToken and url fields mutually exclusive; do not specify both. Do not specify an insights token if the request includes the image form data. 3459 ImageInsightsToken *string `json:"imageInsightsToken,omitempty"` 3460 // URL - The URL of the input image. The imageInsightsToken and url fields are mutually exclusive; do not specify both. Do not specify the URL if the request includes the image form data. 3461 URL *string `json:"url,omitempty"` 3462 // CropArea - A JSON object consisting of coordinates specifying the four corners of a cropped rectangle within the input image. Use the crop area to identify the region of interest in the image. You can apply the crop area to the images specified using the imageInsightsToken or url fields, or an image binary specified in an image form data. 3463 CropArea *CropArea `json:"cropArea,omitempty"` 3464} 3465 3466// ImageKnowledge defines a visual search API response. 3467type ImageKnowledge struct { 3468 autorest.Response `json:"-"` 3469 // Tags - READ-ONLY; A list of visual search tags. 3470 Tags *[]ImageTag `json:"tags,omitempty"` 3471 // Image - READ-ONLY; Image object containing metadata about the requested image. 3472 Image *ImageObject `json:"image,omitempty"` 3473 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 3474 ReadLink *string `json:"readLink,omitempty"` 3475 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 3476 WebSearchURL *string `json:"webSearchUrl,omitempty"` 3477 // ID - READ-ONLY; A String identifier. 3478 ID *string `json:"id,omitempty"` 3479 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 3480 Type Type `json:"_type,omitempty"` 3481} 3482 3483// MarshalJSON is the custom marshaler for ImageKnowledge. 3484func (ik ImageKnowledge) MarshalJSON() ([]byte, error) { 3485 ik.Type = TypeImageKnowledge 3486 objectMap := make(map[string]interface{}) 3487 if ik.Type != "" { 3488 objectMap["_type"] = ik.Type 3489 } 3490 return json.Marshal(objectMap) 3491} 3492 3493// AsPoint2D is the BasicResponseBase implementation for ImageKnowledge. 3494func (ik ImageKnowledge) AsPoint2D() (*Point2D, bool) { 3495 return nil, false 3496} 3497 3498// AsNormalizedQuadrilateral is the BasicResponseBase implementation for ImageKnowledge. 3499func (ik ImageKnowledge) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 3500 return nil, false 3501} 3502 3503// AsImageAction is the BasicResponseBase implementation for ImageKnowledge. 3504func (ik ImageKnowledge) AsImageAction() (*ImageAction, bool) { 3505 return nil, false 3506} 3507 3508// AsBasicImageAction is the BasicResponseBase implementation for ImageKnowledge. 3509func (ik ImageKnowledge) AsBasicImageAction() (BasicImageAction, bool) { 3510 return nil, false 3511} 3512 3513// AsImageTag is the BasicResponseBase implementation for ImageKnowledge. 3514func (ik ImageKnowledge) AsImageTag() (*ImageTag, bool) { 3515 return nil, false 3516} 3517 3518// AsOrganization is the BasicResponseBase implementation for ImageKnowledge. 3519func (ik ImageKnowledge) AsOrganization() (*Organization, bool) { 3520 return nil, false 3521} 3522 3523// AsOffer is the BasicResponseBase implementation for ImageKnowledge. 3524func (ik ImageKnowledge) AsOffer() (*Offer, bool) { 3525 return nil, false 3526} 3527 3528// AsBasicOffer is the BasicResponseBase implementation for ImageKnowledge. 3529func (ik ImageKnowledge) AsBasicOffer() (BasicOffer, bool) { 3530 return nil, false 3531} 3532 3533// AsAggregateOffer is the BasicResponseBase implementation for ImageKnowledge. 3534func (ik ImageKnowledge) AsAggregateOffer() (*AggregateOffer, bool) { 3535 return nil, false 3536} 3537 3538// AsImageObject is the BasicResponseBase implementation for ImageKnowledge. 3539func (ik ImageKnowledge) AsImageObject() (*ImageObject, bool) { 3540 return nil, false 3541} 3542 3543// AsImageKnowledge is the BasicResponseBase implementation for ImageKnowledge. 3544func (ik ImageKnowledge) AsImageKnowledge() (*ImageKnowledge, bool) { 3545 return &ik, true 3546} 3547 3548// AsResponse is the BasicResponseBase implementation for ImageKnowledge. 3549func (ik ImageKnowledge) AsResponse() (*Response, bool) { 3550 return nil, false 3551} 3552 3553// AsBasicResponse is the BasicResponseBase implementation for ImageKnowledge. 3554func (ik ImageKnowledge) AsBasicResponse() (BasicResponse, bool) { 3555 return &ik, true 3556} 3557 3558// AsIdentifiable is the BasicResponseBase implementation for ImageKnowledge. 3559func (ik ImageKnowledge) AsIdentifiable() (*Identifiable, bool) { 3560 return nil, false 3561} 3562 3563// AsBasicIdentifiable is the BasicResponseBase implementation for ImageKnowledge. 3564func (ik ImageKnowledge) AsBasicIdentifiable() (BasicIdentifiable, bool) { 3565 return &ik, true 3566} 3567 3568// AsErrorResponse is the BasicResponseBase implementation for ImageKnowledge. 3569func (ik ImageKnowledge) AsErrorResponse() (*ErrorResponse, bool) { 3570 return nil, false 3571} 3572 3573// AsThing is the BasicResponseBase implementation for ImageKnowledge. 3574func (ik ImageKnowledge) AsThing() (*Thing, bool) { 3575 return nil, false 3576} 3577 3578// AsBasicThing is the BasicResponseBase implementation for ImageKnowledge. 3579func (ik ImageKnowledge) AsBasicThing() (BasicThing, bool) { 3580 return nil, false 3581} 3582 3583// AsAction is the BasicResponseBase implementation for ImageKnowledge. 3584func (ik ImageKnowledge) AsAction() (*Action, bool) { 3585 return nil, false 3586} 3587 3588// AsBasicAction is the BasicResponseBase implementation for ImageKnowledge. 3589func (ik ImageKnowledge) AsBasicAction() (BasicAction, bool) { 3590 return nil, false 3591} 3592 3593// AsMediaObject is the BasicResponseBase implementation for ImageKnowledge. 3594func (ik ImageKnowledge) AsMediaObject() (*MediaObject, bool) { 3595 return nil, false 3596} 3597 3598// AsBasicMediaObject is the BasicResponseBase implementation for ImageKnowledge. 3599func (ik ImageKnowledge) AsBasicMediaObject() (BasicMediaObject, bool) { 3600 return nil, false 3601} 3602 3603// AsCreativeWork is the BasicResponseBase implementation for ImageKnowledge. 3604func (ik ImageKnowledge) AsCreativeWork() (*CreativeWork, bool) { 3605 return nil, false 3606} 3607 3608// AsBasicCreativeWork is the BasicResponseBase implementation for ImageKnowledge. 3609func (ik ImageKnowledge) AsBasicCreativeWork() (BasicCreativeWork, bool) { 3610 return nil, false 3611} 3612 3613// AsPerson is the BasicResponseBase implementation for ImageKnowledge. 3614func (ik ImageKnowledge) AsPerson() (*Person, bool) { 3615 return nil, false 3616} 3617 3618// AsIntangible is the BasicResponseBase implementation for ImageKnowledge. 3619func (ik ImageKnowledge) AsIntangible() (*Intangible, bool) { 3620 return nil, false 3621} 3622 3623// AsBasicIntangible is the BasicResponseBase implementation for ImageKnowledge. 3624func (ik ImageKnowledge) AsBasicIntangible() (BasicIntangible, bool) { 3625 return nil, false 3626} 3627 3628// AsImageEntityAction is the BasicResponseBase implementation for ImageKnowledge. 3629func (ik ImageKnowledge) AsImageEntityAction() (*ImageEntityAction, bool) { 3630 return nil, false 3631} 3632 3633// AsImageModuleAction is the BasicResponseBase implementation for ImageKnowledge. 3634func (ik ImageKnowledge) AsImageModuleAction() (*ImageModuleAction, bool) { 3635 return nil, false 3636} 3637 3638// AsRecipe is the BasicResponseBase implementation for ImageKnowledge. 3639func (ik ImageKnowledge) AsRecipe() (*Recipe, bool) { 3640 return nil, false 3641} 3642 3643// AsImageRecipesAction is the BasicResponseBase implementation for ImageKnowledge. 3644func (ik ImageKnowledge) AsImageRecipesAction() (*ImageRecipesAction, bool) { 3645 return nil, false 3646} 3647 3648// AsImageRelatedSearchesAction is the BasicResponseBase implementation for ImageKnowledge. 3649func (ik ImageKnowledge) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 3650 return nil, false 3651} 3652 3653// AsImageShoppingSourcesAction is the BasicResponseBase implementation for ImageKnowledge. 3654func (ik ImageKnowledge) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 3655 return nil, false 3656} 3657 3658// AsStructuredValue is the BasicResponseBase implementation for ImageKnowledge. 3659func (ik ImageKnowledge) AsStructuredValue() (*StructuredValue, bool) { 3660 return nil, false 3661} 3662 3663// AsBasicStructuredValue is the BasicResponseBase implementation for ImageKnowledge. 3664func (ik ImageKnowledge) AsBasicStructuredValue() (BasicStructuredValue, bool) { 3665 return nil, false 3666} 3667 3668// AsResponseBase is the BasicResponseBase implementation for ImageKnowledge. 3669func (ik ImageKnowledge) AsResponseBase() (*ResponseBase, bool) { 3670 return nil, false 3671} 3672 3673// AsBasicResponseBase is the BasicResponseBase implementation for ImageKnowledge. 3674func (ik ImageKnowledge) AsBasicResponseBase() (BasicResponseBase, bool) { 3675 return &ik, true 3676} 3677 3678// ImageModuleAction defines an image list action. 3679type ImageModuleAction struct { 3680 // Data - READ-ONLY; A list of images. 3681 Data *ImagesModule `json:"data,omitempty"` 3682 // ActionType - READ-ONLY; A string representing the type of action. 3683 ActionType *string `json:"actionType,omitempty"` 3684 // Result - READ-ONLY; The result produced in the action. 3685 Result *[]BasicThing `json:"result,omitempty"` 3686 // DisplayName - READ-ONLY; A display name for the action. 3687 DisplayName *string `json:"displayName,omitempty"` 3688 // IsTopAction - READ-ONLY; A Boolean representing whether this result is the top action. 3689 IsTopAction *bool `json:"isTopAction,omitempty"` 3690 // ServiceURL - READ-ONLY; Use this URL to get additional data to determine how to take the appropriate action. For example, the serviceUrl might return JSON along with an image URL. 3691 ServiceURL *string `json:"serviceUrl,omitempty"` 3692 // ThumbnailURL - READ-ONLY; The URL to a thumbnail of the item. 3693 ThumbnailURL *string `json:"thumbnailUrl,omitempty"` 3694 // Provider - READ-ONLY; The source of the creative work. 3695 Provider *[]BasicThing `json:"provider,omitempty"` 3696 // DatePublished - READ-ONLY; The date on which the CreativeWork was published. 3697 DatePublished *string `json:"datePublished,omitempty"` 3698 // Text - READ-ONLY; Text content of this creative work. 3699 Text *string `json:"text,omitempty"` 3700 // Name - READ-ONLY; The name of the thing represented by this object. 3701 Name *string `json:"name,omitempty"` 3702 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 3703 URL *string `json:"url,omitempty"` 3704 // Image - READ-ONLY; An image of the item. 3705 Image *ImageObject `json:"image,omitempty"` 3706 // Description - READ-ONLY; A short description of the item. 3707 Description *string `json:"description,omitempty"` 3708 // AlternateName - READ-ONLY; An alias for the item. 3709 AlternateName *string `json:"alternateName,omitempty"` 3710 // BingID - READ-ONLY; An ID that uniquely identifies this item. 3711 BingID *string `json:"bingId,omitempty"` 3712 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 3713 ReadLink *string `json:"readLink,omitempty"` 3714 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 3715 WebSearchURL *string `json:"webSearchUrl,omitempty"` 3716 // ID - READ-ONLY; A String identifier. 3717 ID *string `json:"id,omitempty"` 3718 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 3719 Type Type `json:"_type,omitempty"` 3720} 3721 3722// MarshalJSON is the custom marshaler for ImageModuleAction. 3723func (ima ImageModuleAction) MarshalJSON() ([]byte, error) { 3724 ima.Type = TypeImageModuleAction 3725 objectMap := make(map[string]interface{}) 3726 if ima.Type != "" { 3727 objectMap["_type"] = ima.Type 3728 } 3729 return json.Marshal(objectMap) 3730} 3731 3732// AsPoint2D is the BasicResponseBase implementation for ImageModuleAction. 3733func (ima ImageModuleAction) AsPoint2D() (*Point2D, bool) { 3734 return nil, false 3735} 3736 3737// AsNormalizedQuadrilateral is the BasicResponseBase implementation for ImageModuleAction. 3738func (ima ImageModuleAction) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 3739 return nil, false 3740} 3741 3742// AsImageAction is the BasicResponseBase implementation for ImageModuleAction. 3743func (ima ImageModuleAction) AsImageAction() (*ImageAction, bool) { 3744 return nil, false 3745} 3746 3747// AsBasicImageAction is the BasicResponseBase implementation for ImageModuleAction. 3748func (ima ImageModuleAction) AsBasicImageAction() (BasicImageAction, bool) { 3749 return &ima, true 3750} 3751 3752// AsImageTag is the BasicResponseBase implementation for ImageModuleAction. 3753func (ima ImageModuleAction) AsImageTag() (*ImageTag, bool) { 3754 return nil, false 3755} 3756 3757// AsOrganization is the BasicResponseBase implementation for ImageModuleAction. 3758func (ima ImageModuleAction) AsOrganization() (*Organization, bool) { 3759 return nil, false 3760} 3761 3762// AsOffer is the BasicResponseBase implementation for ImageModuleAction. 3763func (ima ImageModuleAction) AsOffer() (*Offer, bool) { 3764 return nil, false 3765} 3766 3767// AsBasicOffer is the BasicResponseBase implementation for ImageModuleAction. 3768func (ima ImageModuleAction) AsBasicOffer() (BasicOffer, bool) { 3769 return nil, false 3770} 3771 3772// AsAggregateOffer is the BasicResponseBase implementation for ImageModuleAction. 3773func (ima ImageModuleAction) AsAggregateOffer() (*AggregateOffer, bool) { 3774 return nil, false 3775} 3776 3777// AsImageObject is the BasicResponseBase implementation for ImageModuleAction. 3778func (ima ImageModuleAction) AsImageObject() (*ImageObject, bool) { 3779 return nil, false 3780} 3781 3782// AsImageKnowledge is the BasicResponseBase implementation for ImageModuleAction. 3783func (ima ImageModuleAction) AsImageKnowledge() (*ImageKnowledge, bool) { 3784 return nil, false 3785} 3786 3787// AsResponse is the BasicResponseBase implementation for ImageModuleAction. 3788func (ima ImageModuleAction) AsResponse() (*Response, bool) { 3789 return nil, false 3790} 3791 3792// AsBasicResponse is the BasicResponseBase implementation for ImageModuleAction. 3793func (ima ImageModuleAction) AsBasicResponse() (BasicResponse, bool) { 3794 return &ima, true 3795} 3796 3797// AsIdentifiable is the BasicResponseBase implementation for ImageModuleAction. 3798func (ima ImageModuleAction) AsIdentifiable() (*Identifiable, bool) { 3799 return nil, false 3800} 3801 3802// AsBasicIdentifiable is the BasicResponseBase implementation for ImageModuleAction. 3803func (ima ImageModuleAction) AsBasicIdentifiable() (BasicIdentifiable, bool) { 3804 return &ima, true 3805} 3806 3807// AsErrorResponse is the BasicResponseBase implementation for ImageModuleAction. 3808func (ima ImageModuleAction) AsErrorResponse() (*ErrorResponse, bool) { 3809 return nil, false 3810} 3811 3812// AsThing is the BasicResponseBase implementation for ImageModuleAction. 3813func (ima ImageModuleAction) AsThing() (*Thing, bool) { 3814 return nil, false 3815} 3816 3817// AsBasicThing is the BasicResponseBase implementation for ImageModuleAction. 3818func (ima ImageModuleAction) AsBasicThing() (BasicThing, bool) { 3819 return &ima, true 3820} 3821 3822// AsAction is the BasicResponseBase implementation for ImageModuleAction. 3823func (ima ImageModuleAction) AsAction() (*Action, bool) { 3824 return nil, false 3825} 3826 3827// AsBasicAction is the BasicResponseBase implementation for ImageModuleAction. 3828func (ima ImageModuleAction) AsBasicAction() (BasicAction, bool) { 3829 return &ima, true 3830} 3831 3832// AsMediaObject is the BasicResponseBase implementation for ImageModuleAction. 3833func (ima ImageModuleAction) AsMediaObject() (*MediaObject, bool) { 3834 return nil, false 3835} 3836 3837// AsBasicMediaObject is the BasicResponseBase implementation for ImageModuleAction. 3838func (ima ImageModuleAction) AsBasicMediaObject() (BasicMediaObject, bool) { 3839 return nil, false 3840} 3841 3842// AsCreativeWork is the BasicResponseBase implementation for ImageModuleAction. 3843func (ima ImageModuleAction) AsCreativeWork() (*CreativeWork, bool) { 3844 return nil, false 3845} 3846 3847// AsBasicCreativeWork is the BasicResponseBase implementation for ImageModuleAction. 3848func (ima ImageModuleAction) AsBasicCreativeWork() (BasicCreativeWork, bool) { 3849 return &ima, true 3850} 3851 3852// AsPerson is the BasicResponseBase implementation for ImageModuleAction. 3853func (ima ImageModuleAction) AsPerson() (*Person, bool) { 3854 return nil, false 3855} 3856 3857// AsIntangible is the BasicResponseBase implementation for ImageModuleAction. 3858func (ima ImageModuleAction) AsIntangible() (*Intangible, bool) { 3859 return nil, false 3860} 3861 3862// AsBasicIntangible is the BasicResponseBase implementation for ImageModuleAction. 3863func (ima ImageModuleAction) AsBasicIntangible() (BasicIntangible, bool) { 3864 return nil, false 3865} 3866 3867// AsImageEntityAction is the BasicResponseBase implementation for ImageModuleAction. 3868func (ima ImageModuleAction) AsImageEntityAction() (*ImageEntityAction, bool) { 3869 return nil, false 3870} 3871 3872// AsImageModuleAction is the BasicResponseBase implementation for ImageModuleAction. 3873func (ima ImageModuleAction) AsImageModuleAction() (*ImageModuleAction, bool) { 3874 return &ima, true 3875} 3876 3877// AsRecipe is the BasicResponseBase implementation for ImageModuleAction. 3878func (ima ImageModuleAction) AsRecipe() (*Recipe, bool) { 3879 return nil, false 3880} 3881 3882// AsImageRecipesAction is the BasicResponseBase implementation for ImageModuleAction. 3883func (ima ImageModuleAction) AsImageRecipesAction() (*ImageRecipesAction, bool) { 3884 return nil, false 3885} 3886 3887// AsImageRelatedSearchesAction is the BasicResponseBase implementation for ImageModuleAction. 3888func (ima ImageModuleAction) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 3889 return nil, false 3890} 3891 3892// AsImageShoppingSourcesAction is the BasicResponseBase implementation for ImageModuleAction. 3893func (ima ImageModuleAction) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 3894 return nil, false 3895} 3896 3897// AsStructuredValue is the BasicResponseBase implementation for ImageModuleAction. 3898func (ima ImageModuleAction) AsStructuredValue() (*StructuredValue, bool) { 3899 return nil, false 3900} 3901 3902// AsBasicStructuredValue is the BasicResponseBase implementation for ImageModuleAction. 3903func (ima ImageModuleAction) AsBasicStructuredValue() (BasicStructuredValue, bool) { 3904 return nil, false 3905} 3906 3907// AsResponseBase is the BasicResponseBase implementation for ImageModuleAction. 3908func (ima ImageModuleAction) AsResponseBase() (*ResponseBase, bool) { 3909 return nil, false 3910} 3911 3912// AsBasicResponseBase is the BasicResponseBase implementation for ImageModuleAction. 3913func (ima ImageModuleAction) AsBasicResponseBase() (BasicResponseBase, bool) { 3914 return &ima, true 3915} 3916 3917// UnmarshalJSON is the custom unmarshaler for ImageModuleAction struct. 3918func (ima *ImageModuleAction) UnmarshalJSON(body []byte) error { 3919 var m map[string]*json.RawMessage 3920 err := json.Unmarshal(body, &m) 3921 if err != nil { 3922 return err 3923 } 3924 for k, v := range m { 3925 switch k { 3926 case "data": 3927 if v != nil { 3928 var data ImagesModule 3929 err = json.Unmarshal(*v, &data) 3930 if err != nil { 3931 return err 3932 } 3933 ima.Data = &data 3934 } 3935 case "actionType": 3936 if v != nil { 3937 var actionType string 3938 err = json.Unmarshal(*v, &actionType) 3939 if err != nil { 3940 return err 3941 } 3942 ima.ActionType = &actionType 3943 } 3944 case "result": 3945 if v != nil { 3946 resultVar, err := unmarshalBasicThingArray(*v) 3947 if err != nil { 3948 return err 3949 } 3950 ima.Result = &resultVar 3951 } 3952 case "displayName": 3953 if v != nil { 3954 var displayName string 3955 err = json.Unmarshal(*v, &displayName) 3956 if err != nil { 3957 return err 3958 } 3959 ima.DisplayName = &displayName 3960 } 3961 case "isTopAction": 3962 if v != nil { 3963 var isTopAction bool 3964 err = json.Unmarshal(*v, &isTopAction) 3965 if err != nil { 3966 return err 3967 } 3968 ima.IsTopAction = &isTopAction 3969 } 3970 case "serviceUrl": 3971 if v != nil { 3972 var serviceURL string 3973 err = json.Unmarshal(*v, &serviceURL) 3974 if err != nil { 3975 return err 3976 } 3977 ima.ServiceURL = &serviceURL 3978 } 3979 case "thumbnailUrl": 3980 if v != nil { 3981 var thumbnailURL string 3982 err = json.Unmarshal(*v, &thumbnailURL) 3983 if err != nil { 3984 return err 3985 } 3986 ima.ThumbnailURL = &thumbnailURL 3987 } 3988 case "provider": 3989 if v != nil { 3990 provider, err := unmarshalBasicThingArray(*v) 3991 if err != nil { 3992 return err 3993 } 3994 ima.Provider = &provider 3995 } 3996 case "datePublished": 3997 if v != nil { 3998 var datePublished string 3999 err = json.Unmarshal(*v, &datePublished) 4000 if err != nil { 4001 return err 4002 } 4003 ima.DatePublished = &datePublished 4004 } 4005 case "text": 4006 if v != nil { 4007 var textVar string 4008 err = json.Unmarshal(*v, &textVar) 4009 if err != nil { 4010 return err 4011 } 4012 ima.Text = &textVar 4013 } 4014 case "name": 4015 if v != nil { 4016 var name string 4017 err = json.Unmarshal(*v, &name) 4018 if err != nil { 4019 return err 4020 } 4021 ima.Name = &name 4022 } 4023 case "url": 4024 if v != nil { 4025 var URL string 4026 err = json.Unmarshal(*v, &URL) 4027 if err != nil { 4028 return err 4029 } 4030 ima.URL = &URL 4031 } 4032 case "image": 4033 if v != nil { 4034 var imageVar ImageObject 4035 err = json.Unmarshal(*v, &imageVar) 4036 if err != nil { 4037 return err 4038 } 4039 ima.Image = &imageVar 4040 } 4041 case "description": 4042 if v != nil { 4043 var description string 4044 err = json.Unmarshal(*v, &description) 4045 if err != nil { 4046 return err 4047 } 4048 ima.Description = &description 4049 } 4050 case "alternateName": 4051 if v != nil { 4052 var alternateName string 4053 err = json.Unmarshal(*v, &alternateName) 4054 if err != nil { 4055 return err 4056 } 4057 ima.AlternateName = &alternateName 4058 } 4059 case "bingId": 4060 if v != nil { 4061 var bingID string 4062 err = json.Unmarshal(*v, &bingID) 4063 if err != nil { 4064 return err 4065 } 4066 ima.BingID = &bingID 4067 } 4068 case "readLink": 4069 if v != nil { 4070 var readLink string 4071 err = json.Unmarshal(*v, &readLink) 4072 if err != nil { 4073 return err 4074 } 4075 ima.ReadLink = &readLink 4076 } 4077 case "webSearchUrl": 4078 if v != nil { 4079 var webSearchURL string 4080 err = json.Unmarshal(*v, &webSearchURL) 4081 if err != nil { 4082 return err 4083 } 4084 ima.WebSearchURL = &webSearchURL 4085 } 4086 case "id": 4087 if v != nil { 4088 var ID string 4089 err = json.Unmarshal(*v, &ID) 4090 if err != nil { 4091 return err 4092 } 4093 ima.ID = &ID 4094 } 4095 case "_type": 4096 if v != nil { 4097 var typeVar Type 4098 err = json.Unmarshal(*v, &typeVar) 4099 if err != nil { 4100 return err 4101 } 4102 ima.Type = typeVar 4103 } 4104 } 4105 } 4106 4107 return nil 4108} 4109 4110// ImageObject defines an image. 4111type ImageObject struct { 4112 // Thumbnail - READ-ONLY; The URL to a thumbnail of the image. 4113 Thumbnail *ImageObject `json:"thumbnail,omitempty"` 4114 // ImageInsightsToken - READ-ONLY; The token that you use in a subsequent call to Visual Search API to get additional information about the image. For information about using this token, see the imageInsightsToken field inside the knowledgeRequest request parameter. 4115 ImageInsightsToken *string `json:"imageInsightsToken,omitempty"` 4116 // InsightsMetadata - READ-ONLY; A count of the number of websites where you can shop or perform other actions related to the image. For example, if the image is of an apple pie, this object includes a count of the number of websites where you can buy an apple pie. To indicate the number of offers in your UX, include badging such as a shopping cart icon that contains the count. When the user clicks on the icon, use imageInsightsToken in a subsequent Visual Search API call to get the list of shopping websites. 4117 InsightsMetadata *ImagesImageMetadata `json:"insightsMetadata,omitempty"` 4118 // ImageID - READ-ONLY; Unique Id for the image. 4119 ImageID *string `json:"imageId,omitempty"` 4120 // AccentColor - READ-ONLY; A three-byte hexadecimal number that represents the color that dominates the image. Use the color as the temporary background in your client until the image is loaded. 4121 AccentColor *string `json:"accentColor,omitempty"` 4122 // VisualWords - READ-ONLY; For internal use only. 4123 VisualWords *string `json:"visualWords,omitempty"` 4124 // ContentURL - READ-ONLY; Original URL to retrieve the source (file) for the media object (e.g., the source URL for the image). 4125 ContentURL *string `json:"contentUrl,omitempty"` 4126 // HostPageURL - READ-ONLY; URL of the page that hosts the media object. 4127 HostPageURL *string `json:"hostPageUrl,omitempty"` 4128 // ContentSize - READ-ONLY; Size of the media object content. Use format "value unit" (e.g., "1024 B"). 4129 ContentSize *string `json:"contentSize,omitempty"` 4130 // EncodingFormat - READ-ONLY; Encoding format (e.g., png, gif, jpeg, etc). 4131 EncodingFormat *string `json:"encodingFormat,omitempty"` 4132 // HostPageDisplayURL - READ-ONLY; Display URL of the page that hosts the media object. 4133 HostPageDisplayURL *string `json:"hostPageDisplayUrl,omitempty"` 4134 // Width - READ-ONLY; The width of the media object, in pixels. 4135 Width *int32 `json:"width,omitempty"` 4136 // Height - READ-ONLY; The height of the media object, in pixels. 4137 Height *int32 `json:"height,omitempty"` 4138 // ThumbnailURL - READ-ONLY; The URL to a thumbnail of the item. 4139 ThumbnailURL *string `json:"thumbnailUrl,omitempty"` 4140 // Provider - READ-ONLY; The source of the creative work. 4141 Provider *[]BasicThing `json:"provider,omitempty"` 4142 // DatePublished - READ-ONLY; The date on which the CreativeWork was published. 4143 DatePublished *string `json:"datePublished,omitempty"` 4144 // Text - READ-ONLY; Text content of this creative work. 4145 Text *string `json:"text,omitempty"` 4146 // Name - READ-ONLY; The name of the thing represented by this object. 4147 Name *string `json:"name,omitempty"` 4148 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 4149 URL *string `json:"url,omitempty"` 4150 // Image - READ-ONLY; An image of the item. 4151 Image *ImageObject `json:"image,omitempty"` 4152 // Description - READ-ONLY; A short description of the item. 4153 Description *string `json:"description,omitempty"` 4154 // AlternateName - READ-ONLY; An alias for the item. 4155 AlternateName *string `json:"alternateName,omitempty"` 4156 // BingID - READ-ONLY; An ID that uniquely identifies this item. 4157 BingID *string `json:"bingId,omitempty"` 4158 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 4159 ReadLink *string `json:"readLink,omitempty"` 4160 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 4161 WebSearchURL *string `json:"webSearchUrl,omitempty"` 4162 // ID - READ-ONLY; A String identifier. 4163 ID *string `json:"id,omitempty"` 4164 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 4165 Type Type `json:"_type,omitempty"` 4166} 4167 4168// MarshalJSON is the custom marshaler for ImageObject. 4169func (ioVar ImageObject) MarshalJSON() ([]byte, error) { 4170 ioVar.Type = TypeImageObject 4171 objectMap := make(map[string]interface{}) 4172 if ioVar.Type != "" { 4173 objectMap["_type"] = ioVar.Type 4174 } 4175 return json.Marshal(objectMap) 4176} 4177 4178// AsPoint2D is the BasicResponseBase implementation for ImageObject. 4179func (ioVar ImageObject) AsPoint2D() (*Point2D, bool) { 4180 return nil, false 4181} 4182 4183// AsNormalizedQuadrilateral is the BasicResponseBase implementation for ImageObject. 4184func (ioVar ImageObject) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 4185 return nil, false 4186} 4187 4188// AsImageAction is the BasicResponseBase implementation for ImageObject. 4189func (ioVar ImageObject) AsImageAction() (*ImageAction, bool) { 4190 return nil, false 4191} 4192 4193// AsBasicImageAction is the BasicResponseBase implementation for ImageObject. 4194func (ioVar ImageObject) AsBasicImageAction() (BasicImageAction, bool) { 4195 return nil, false 4196} 4197 4198// AsImageTag is the BasicResponseBase implementation for ImageObject. 4199func (ioVar ImageObject) AsImageTag() (*ImageTag, bool) { 4200 return nil, false 4201} 4202 4203// AsOrganization is the BasicResponseBase implementation for ImageObject. 4204func (ioVar ImageObject) AsOrganization() (*Organization, bool) { 4205 return nil, false 4206} 4207 4208// AsOffer is the BasicResponseBase implementation for ImageObject. 4209func (ioVar ImageObject) AsOffer() (*Offer, bool) { 4210 return nil, false 4211} 4212 4213// AsBasicOffer is the BasicResponseBase implementation for ImageObject. 4214func (ioVar ImageObject) AsBasicOffer() (BasicOffer, bool) { 4215 return nil, false 4216} 4217 4218// AsAggregateOffer is the BasicResponseBase implementation for ImageObject. 4219func (ioVar ImageObject) AsAggregateOffer() (*AggregateOffer, bool) { 4220 return nil, false 4221} 4222 4223// AsImageObject is the BasicResponseBase implementation for ImageObject. 4224func (ioVar ImageObject) AsImageObject() (*ImageObject, bool) { 4225 return &ioVar, true 4226} 4227 4228// AsImageKnowledge is the BasicResponseBase implementation for ImageObject. 4229func (ioVar ImageObject) AsImageKnowledge() (*ImageKnowledge, bool) { 4230 return nil, false 4231} 4232 4233// AsResponse is the BasicResponseBase implementation for ImageObject. 4234func (ioVar ImageObject) AsResponse() (*Response, bool) { 4235 return nil, false 4236} 4237 4238// AsBasicResponse is the BasicResponseBase implementation for ImageObject. 4239func (ioVar ImageObject) AsBasicResponse() (BasicResponse, bool) { 4240 return &ioVar, true 4241} 4242 4243// AsIdentifiable is the BasicResponseBase implementation for ImageObject. 4244func (ioVar ImageObject) AsIdentifiable() (*Identifiable, bool) { 4245 return nil, false 4246} 4247 4248// AsBasicIdentifiable is the BasicResponseBase implementation for ImageObject. 4249func (ioVar ImageObject) AsBasicIdentifiable() (BasicIdentifiable, bool) { 4250 return &ioVar, true 4251} 4252 4253// AsErrorResponse is the BasicResponseBase implementation for ImageObject. 4254func (ioVar ImageObject) AsErrorResponse() (*ErrorResponse, bool) { 4255 return nil, false 4256} 4257 4258// AsThing is the BasicResponseBase implementation for ImageObject. 4259func (ioVar ImageObject) AsThing() (*Thing, bool) { 4260 return nil, false 4261} 4262 4263// AsBasicThing is the BasicResponseBase implementation for ImageObject. 4264func (ioVar ImageObject) AsBasicThing() (BasicThing, bool) { 4265 return &ioVar, true 4266} 4267 4268// AsAction is the BasicResponseBase implementation for ImageObject. 4269func (ioVar ImageObject) AsAction() (*Action, bool) { 4270 return nil, false 4271} 4272 4273// AsBasicAction is the BasicResponseBase implementation for ImageObject. 4274func (ioVar ImageObject) AsBasicAction() (BasicAction, bool) { 4275 return nil, false 4276} 4277 4278// AsMediaObject is the BasicResponseBase implementation for ImageObject. 4279func (ioVar ImageObject) AsMediaObject() (*MediaObject, bool) { 4280 return nil, false 4281} 4282 4283// AsBasicMediaObject is the BasicResponseBase implementation for ImageObject. 4284func (ioVar ImageObject) AsBasicMediaObject() (BasicMediaObject, bool) { 4285 return &ioVar, true 4286} 4287 4288// AsCreativeWork is the BasicResponseBase implementation for ImageObject. 4289func (ioVar ImageObject) AsCreativeWork() (*CreativeWork, bool) { 4290 return nil, false 4291} 4292 4293// AsBasicCreativeWork is the BasicResponseBase implementation for ImageObject. 4294func (ioVar ImageObject) AsBasicCreativeWork() (BasicCreativeWork, bool) { 4295 return &ioVar, true 4296} 4297 4298// AsPerson is the BasicResponseBase implementation for ImageObject. 4299func (ioVar ImageObject) AsPerson() (*Person, bool) { 4300 return nil, false 4301} 4302 4303// AsIntangible is the BasicResponseBase implementation for ImageObject. 4304func (ioVar ImageObject) AsIntangible() (*Intangible, bool) { 4305 return nil, false 4306} 4307 4308// AsBasicIntangible is the BasicResponseBase implementation for ImageObject. 4309func (ioVar ImageObject) AsBasicIntangible() (BasicIntangible, bool) { 4310 return nil, false 4311} 4312 4313// AsImageEntityAction is the BasicResponseBase implementation for ImageObject. 4314func (ioVar ImageObject) AsImageEntityAction() (*ImageEntityAction, bool) { 4315 return nil, false 4316} 4317 4318// AsImageModuleAction is the BasicResponseBase implementation for ImageObject. 4319func (ioVar ImageObject) AsImageModuleAction() (*ImageModuleAction, bool) { 4320 return nil, false 4321} 4322 4323// AsRecipe is the BasicResponseBase implementation for ImageObject. 4324func (ioVar ImageObject) AsRecipe() (*Recipe, bool) { 4325 return nil, false 4326} 4327 4328// AsImageRecipesAction is the BasicResponseBase implementation for ImageObject. 4329func (ioVar ImageObject) AsImageRecipesAction() (*ImageRecipesAction, bool) { 4330 return nil, false 4331} 4332 4333// AsImageRelatedSearchesAction is the BasicResponseBase implementation for ImageObject. 4334func (ioVar ImageObject) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 4335 return nil, false 4336} 4337 4338// AsImageShoppingSourcesAction is the BasicResponseBase implementation for ImageObject. 4339func (ioVar ImageObject) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 4340 return nil, false 4341} 4342 4343// AsStructuredValue is the BasicResponseBase implementation for ImageObject. 4344func (ioVar ImageObject) AsStructuredValue() (*StructuredValue, bool) { 4345 return nil, false 4346} 4347 4348// AsBasicStructuredValue is the BasicResponseBase implementation for ImageObject. 4349func (ioVar ImageObject) AsBasicStructuredValue() (BasicStructuredValue, bool) { 4350 return nil, false 4351} 4352 4353// AsResponseBase is the BasicResponseBase implementation for ImageObject. 4354func (ioVar ImageObject) AsResponseBase() (*ResponseBase, bool) { 4355 return nil, false 4356} 4357 4358// AsBasicResponseBase is the BasicResponseBase implementation for ImageObject. 4359func (ioVar ImageObject) AsBasicResponseBase() (BasicResponseBase, bool) { 4360 return &ioVar, true 4361} 4362 4363// UnmarshalJSON is the custom unmarshaler for ImageObject struct. 4364func (ioVar *ImageObject) UnmarshalJSON(body []byte) error { 4365 var m map[string]*json.RawMessage 4366 err := json.Unmarshal(body, &m) 4367 if err != nil { 4368 return err 4369 } 4370 for k, v := range m { 4371 switch k { 4372 case "thumbnail": 4373 if v != nil { 4374 var thumbnail ImageObject 4375 err = json.Unmarshal(*v, &thumbnail) 4376 if err != nil { 4377 return err 4378 } 4379 ioVar.Thumbnail = &thumbnail 4380 } 4381 case "imageInsightsToken": 4382 if v != nil { 4383 var imageInsightsToken string 4384 err = json.Unmarshal(*v, &imageInsightsToken) 4385 if err != nil { 4386 return err 4387 } 4388 ioVar.ImageInsightsToken = &imageInsightsToken 4389 } 4390 case "insightsMetadata": 4391 if v != nil { 4392 var insightsMetadata ImagesImageMetadata 4393 err = json.Unmarshal(*v, &insightsMetadata) 4394 if err != nil { 4395 return err 4396 } 4397 ioVar.InsightsMetadata = &insightsMetadata 4398 } 4399 case "imageId": 4400 if v != nil { 4401 var imageID string 4402 err = json.Unmarshal(*v, &imageID) 4403 if err != nil { 4404 return err 4405 } 4406 ioVar.ImageID = &imageID 4407 } 4408 case "accentColor": 4409 if v != nil { 4410 var accentColor string 4411 err = json.Unmarshal(*v, &accentColor) 4412 if err != nil { 4413 return err 4414 } 4415 ioVar.AccentColor = &accentColor 4416 } 4417 case "visualWords": 4418 if v != nil { 4419 var visualWords string 4420 err = json.Unmarshal(*v, &visualWords) 4421 if err != nil { 4422 return err 4423 } 4424 ioVar.VisualWords = &visualWords 4425 } 4426 case "contentUrl": 4427 if v != nil { 4428 var contentURL string 4429 err = json.Unmarshal(*v, &contentURL) 4430 if err != nil { 4431 return err 4432 } 4433 ioVar.ContentURL = &contentURL 4434 } 4435 case "hostPageUrl": 4436 if v != nil { 4437 var hostPageURL string 4438 err = json.Unmarshal(*v, &hostPageURL) 4439 if err != nil { 4440 return err 4441 } 4442 ioVar.HostPageURL = &hostPageURL 4443 } 4444 case "contentSize": 4445 if v != nil { 4446 var contentSize string 4447 err = json.Unmarshal(*v, &contentSize) 4448 if err != nil { 4449 return err 4450 } 4451 ioVar.ContentSize = &contentSize 4452 } 4453 case "encodingFormat": 4454 if v != nil { 4455 var encodingFormat string 4456 err = json.Unmarshal(*v, &encodingFormat) 4457 if err != nil { 4458 return err 4459 } 4460 ioVar.EncodingFormat = &encodingFormat 4461 } 4462 case "hostPageDisplayUrl": 4463 if v != nil { 4464 var hostPageDisplayURL string 4465 err = json.Unmarshal(*v, &hostPageDisplayURL) 4466 if err != nil { 4467 return err 4468 } 4469 ioVar.HostPageDisplayURL = &hostPageDisplayURL 4470 } 4471 case "width": 4472 if v != nil { 4473 var width int32 4474 err = json.Unmarshal(*v, &width) 4475 if err != nil { 4476 return err 4477 } 4478 ioVar.Width = &width 4479 } 4480 case "height": 4481 if v != nil { 4482 var height int32 4483 err = json.Unmarshal(*v, &height) 4484 if err != nil { 4485 return err 4486 } 4487 ioVar.Height = &height 4488 } 4489 case "thumbnailUrl": 4490 if v != nil { 4491 var thumbnailURL string 4492 err = json.Unmarshal(*v, &thumbnailURL) 4493 if err != nil { 4494 return err 4495 } 4496 ioVar.ThumbnailURL = &thumbnailURL 4497 } 4498 case "provider": 4499 if v != nil { 4500 provider, err := unmarshalBasicThingArray(*v) 4501 if err != nil { 4502 return err 4503 } 4504 ioVar.Provider = &provider 4505 } 4506 case "datePublished": 4507 if v != nil { 4508 var datePublished string 4509 err = json.Unmarshal(*v, &datePublished) 4510 if err != nil { 4511 return err 4512 } 4513 ioVar.DatePublished = &datePublished 4514 } 4515 case "text": 4516 if v != nil { 4517 var textVar string 4518 err = json.Unmarshal(*v, &textVar) 4519 if err != nil { 4520 return err 4521 } 4522 ioVar.Text = &textVar 4523 } 4524 case "name": 4525 if v != nil { 4526 var name string 4527 err = json.Unmarshal(*v, &name) 4528 if err != nil { 4529 return err 4530 } 4531 ioVar.Name = &name 4532 } 4533 case "url": 4534 if v != nil { 4535 var URL string 4536 err = json.Unmarshal(*v, &URL) 4537 if err != nil { 4538 return err 4539 } 4540 ioVar.URL = &URL 4541 } 4542 case "image": 4543 if v != nil { 4544 var imageVar ImageObject 4545 err = json.Unmarshal(*v, &imageVar) 4546 if err != nil { 4547 return err 4548 } 4549 ioVar.Image = &imageVar 4550 } 4551 case "description": 4552 if v != nil { 4553 var description string 4554 err = json.Unmarshal(*v, &description) 4555 if err != nil { 4556 return err 4557 } 4558 ioVar.Description = &description 4559 } 4560 case "alternateName": 4561 if v != nil { 4562 var alternateName string 4563 err = json.Unmarshal(*v, &alternateName) 4564 if err != nil { 4565 return err 4566 } 4567 ioVar.AlternateName = &alternateName 4568 } 4569 case "bingId": 4570 if v != nil { 4571 var bingID string 4572 err = json.Unmarshal(*v, &bingID) 4573 if err != nil { 4574 return err 4575 } 4576 ioVar.BingID = &bingID 4577 } 4578 case "readLink": 4579 if v != nil { 4580 var readLink string 4581 err = json.Unmarshal(*v, &readLink) 4582 if err != nil { 4583 return err 4584 } 4585 ioVar.ReadLink = &readLink 4586 } 4587 case "webSearchUrl": 4588 if v != nil { 4589 var webSearchURL string 4590 err = json.Unmarshal(*v, &webSearchURL) 4591 if err != nil { 4592 return err 4593 } 4594 ioVar.WebSearchURL = &webSearchURL 4595 } 4596 case "id": 4597 if v != nil { 4598 var ID string 4599 err = json.Unmarshal(*v, &ID) 4600 if err != nil { 4601 return err 4602 } 4603 ioVar.ID = &ID 4604 } 4605 case "_type": 4606 if v != nil { 4607 var typeVar Type 4608 err = json.Unmarshal(*v, &typeVar) 4609 if err != nil { 4610 return err 4611 } 4612 ioVar.Type = typeVar 4613 } 4614 } 4615 } 4616 4617 return nil 4618} 4619 4620// ImageRecipesAction defines an recipe action. 4621type ImageRecipesAction struct { 4622 // Data - READ-ONLY; A list of recipes related to the image. 4623 Data *RecipesModule `json:"data,omitempty"` 4624 // ActionType - READ-ONLY; A string representing the type of action. 4625 ActionType *string `json:"actionType,omitempty"` 4626 // Result - READ-ONLY; The result produced in the action. 4627 Result *[]BasicThing `json:"result,omitempty"` 4628 // DisplayName - READ-ONLY; A display name for the action. 4629 DisplayName *string `json:"displayName,omitempty"` 4630 // IsTopAction - READ-ONLY; A Boolean representing whether this result is the top action. 4631 IsTopAction *bool `json:"isTopAction,omitempty"` 4632 // ServiceURL - READ-ONLY; Use this URL to get additional data to determine how to take the appropriate action. For example, the serviceUrl might return JSON along with an image URL. 4633 ServiceURL *string `json:"serviceUrl,omitempty"` 4634 // ThumbnailURL - READ-ONLY; The URL to a thumbnail of the item. 4635 ThumbnailURL *string `json:"thumbnailUrl,omitempty"` 4636 // Provider - READ-ONLY; The source of the creative work. 4637 Provider *[]BasicThing `json:"provider,omitempty"` 4638 // DatePublished - READ-ONLY; The date on which the CreativeWork was published. 4639 DatePublished *string `json:"datePublished,omitempty"` 4640 // Text - READ-ONLY; Text content of this creative work. 4641 Text *string `json:"text,omitempty"` 4642 // Name - READ-ONLY; The name of the thing represented by this object. 4643 Name *string `json:"name,omitempty"` 4644 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 4645 URL *string `json:"url,omitempty"` 4646 // Image - READ-ONLY; An image of the item. 4647 Image *ImageObject `json:"image,omitempty"` 4648 // Description - READ-ONLY; A short description of the item. 4649 Description *string `json:"description,omitempty"` 4650 // AlternateName - READ-ONLY; An alias for the item. 4651 AlternateName *string `json:"alternateName,omitempty"` 4652 // BingID - READ-ONLY; An ID that uniquely identifies this item. 4653 BingID *string `json:"bingId,omitempty"` 4654 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 4655 ReadLink *string `json:"readLink,omitempty"` 4656 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 4657 WebSearchURL *string `json:"webSearchUrl,omitempty"` 4658 // ID - READ-ONLY; A String identifier. 4659 ID *string `json:"id,omitempty"` 4660 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 4661 Type Type `json:"_type,omitempty"` 4662} 4663 4664// MarshalJSON is the custom marshaler for ImageRecipesAction. 4665func (ira ImageRecipesAction) MarshalJSON() ([]byte, error) { 4666 ira.Type = TypeImageRecipesAction 4667 objectMap := make(map[string]interface{}) 4668 if ira.Type != "" { 4669 objectMap["_type"] = ira.Type 4670 } 4671 return json.Marshal(objectMap) 4672} 4673 4674// AsPoint2D is the BasicResponseBase implementation for ImageRecipesAction. 4675func (ira ImageRecipesAction) AsPoint2D() (*Point2D, bool) { 4676 return nil, false 4677} 4678 4679// AsNormalizedQuadrilateral is the BasicResponseBase implementation for ImageRecipesAction. 4680func (ira ImageRecipesAction) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 4681 return nil, false 4682} 4683 4684// AsImageAction is the BasicResponseBase implementation for ImageRecipesAction. 4685func (ira ImageRecipesAction) AsImageAction() (*ImageAction, bool) { 4686 return nil, false 4687} 4688 4689// AsBasicImageAction is the BasicResponseBase implementation for ImageRecipesAction. 4690func (ira ImageRecipesAction) AsBasicImageAction() (BasicImageAction, bool) { 4691 return &ira, true 4692} 4693 4694// AsImageTag is the BasicResponseBase implementation for ImageRecipesAction. 4695func (ira ImageRecipesAction) AsImageTag() (*ImageTag, bool) { 4696 return nil, false 4697} 4698 4699// AsOrganization is the BasicResponseBase implementation for ImageRecipesAction. 4700func (ira ImageRecipesAction) AsOrganization() (*Organization, bool) { 4701 return nil, false 4702} 4703 4704// AsOffer is the BasicResponseBase implementation for ImageRecipesAction. 4705func (ira ImageRecipesAction) AsOffer() (*Offer, bool) { 4706 return nil, false 4707} 4708 4709// AsBasicOffer is the BasicResponseBase implementation for ImageRecipesAction. 4710func (ira ImageRecipesAction) AsBasicOffer() (BasicOffer, bool) { 4711 return nil, false 4712} 4713 4714// AsAggregateOffer is the BasicResponseBase implementation for ImageRecipesAction. 4715func (ira ImageRecipesAction) AsAggregateOffer() (*AggregateOffer, bool) { 4716 return nil, false 4717} 4718 4719// AsImageObject is the BasicResponseBase implementation for ImageRecipesAction. 4720func (ira ImageRecipesAction) AsImageObject() (*ImageObject, bool) { 4721 return nil, false 4722} 4723 4724// AsImageKnowledge is the BasicResponseBase implementation for ImageRecipesAction. 4725func (ira ImageRecipesAction) AsImageKnowledge() (*ImageKnowledge, bool) { 4726 return nil, false 4727} 4728 4729// AsResponse is the BasicResponseBase implementation for ImageRecipesAction. 4730func (ira ImageRecipesAction) AsResponse() (*Response, bool) { 4731 return nil, false 4732} 4733 4734// AsBasicResponse is the BasicResponseBase implementation for ImageRecipesAction. 4735func (ira ImageRecipesAction) AsBasicResponse() (BasicResponse, bool) { 4736 return &ira, true 4737} 4738 4739// AsIdentifiable is the BasicResponseBase implementation for ImageRecipesAction. 4740func (ira ImageRecipesAction) AsIdentifiable() (*Identifiable, bool) { 4741 return nil, false 4742} 4743 4744// AsBasicIdentifiable is the BasicResponseBase implementation for ImageRecipesAction. 4745func (ira ImageRecipesAction) AsBasicIdentifiable() (BasicIdentifiable, bool) { 4746 return &ira, true 4747} 4748 4749// AsErrorResponse is the BasicResponseBase implementation for ImageRecipesAction. 4750func (ira ImageRecipesAction) AsErrorResponse() (*ErrorResponse, bool) { 4751 return nil, false 4752} 4753 4754// AsThing is the BasicResponseBase implementation for ImageRecipesAction. 4755func (ira ImageRecipesAction) AsThing() (*Thing, bool) { 4756 return nil, false 4757} 4758 4759// AsBasicThing is the BasicResponseBase implementation for ImageRecipesAction. 4760func (ira ImageRecipesAction) AsBasicThing() (BasicThing, bool) { 4761 return &ira, true 4762} 4763 4764// AsAction is the BasicResponseBase implementation for ImageRecipesAction. 4765func (ira ImageRecipesAction) AsAction() (*Action, bool) { 4766 return nil, false 4767} 4768 4769// AsBasicAction is the BasicResponseBase implementation for ImageRecipesAction. 4770func (ira ImageRecipesAction) AsBasicAction() (BasicAction, bool) { 4771 return &ira, true 4772} 4773 4774// AsMediaObject is the BasicResponseBase implementation for ImageRecipesAction. 4775func (ira ImageRecipesAction) AsMediaObject() (*MediaObject, bool) { 4776 return nil, false 4777} 4778 4779// AsBasicMediaObject is the BasicResponseBase implementation for ImageRecipesAction. 4780func (ira ImageRecipesAction) AsBasicMediaObject() (BasicMediaObject, bool) { 4781 return nil, false 4782} 4783 4784// AsCreativeWork is the BasicResponseBase implementation for ImageRecipesAction. 4785func (ira ImageRecipesAction) AsCreativeWork() (*CreativeWork, bool) { 4786 return nil, false 4787} 4788 4789// AsBasicCreativeWork is the BasicResponseBase implementation for ImageRecipesAction. 4790func (ira ImageRecipesAction) AsBasicCreativeWork() (BasicCreativeWork, bool) { 4791 return &ira, true 4792} 4793 4794// AsPerson is the BasicResponseBase implementation for ImageRecipesAction. 4795func (ira ImageRecipesAction) AsPerson() (*Person, bool) { 4796 return nil, false 4797} 4798 4799// AsIntangible is the BasicResponseBase implementation for ImageRecipesAction. 4800func (ira ImageRecipesAction) AsIntangible() (*Intangible, bool) { 4801 return nil, false 4802} 4803 4804// AsBasicIntangible is the BasicResponseBase implementation for ImageRecipesAction. 4805func (ira ImageRecipesAction) AsBasicIntangible() (BasicIntangible, bool) { 4806 return nil, false 4807} 4808 4809// AsImageEntityAction is the BasicResponseBase implementation for ImageRecipesAction. 4810func (ira ImageRecipesAction) AsImageEntityAction() (*ImageEntityAction, bool) { 4811 return nil, false 4812} 4813 4814// AsImageModuleAction is the BasicResponseBase implementation for ImageRecipesAction. 4815func (ira ImageRecipesAction) AsImageModuleAction() (*ImageModuleAction, bool) { 4816 return nil, false 4817} 4818 4819// AsRecipe is the BasicResponseBase implementation for ImageRecipesAction. 4820func (ira ImageRecipesAction) AsRecipe() (*Recipe, bool) { 4821 return nil, false 4822} 4823 4824// AsImageRecipesAction is the BasicResponseBase implementation for ImageRecipesAction. 4825func (ira ImageRecipesAction) AsImageRecipesAction() (*ImageRecipesAction, bool) { 4826 return &ira, true 4827} 4828 4829// AsImageRelatedSearchesAction is the BasicResponseBase implementation for ImageRecipesAction. 4830func (ira ImageRecipesAction) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 4831 return nil, false 4832} 4833 4834// AsImageShoppingSourcesAction is the BasicResponseBase implementation for ImageRecipesAction. 4835func (ira ImageRecipesAction) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 4836 return nil, false 4837} 4838 4839// AsStructuredValue is the BasicResponseBase implementation for ImageRecipesAction. 4840func (ira ImageRecipesAction) AsStructuredValue() (*StructuredValue, bool) { 4841 return nil, false 4842} 4843 4844// AsBasicStructuredValue is the BasicResponseBase implementation for ImageRecipesAction. 4845func (ira ImageRecipesAction) AsBasicStructuredValue() (BasicStructuredValue, bool) { 4846 return nil, false 4847} 4848 4849// AsResponseBase is the BasicResponseBase implementation for ImageRecipesAction. 4850func (ira ImageRecipesAction) AsResponseBase() (*ResponseBase, bool) { 4851 return nil, false 4852} 4853 4854// AsBasicResponseBase is the BasicResponseBase implementation for ImageRecipesAction. 4855func (ira ImageRecipesAction) AsBasicResponseBase() (BasicResponseBase, bool) { 4856 return &ira, true 4857} 4858 4859// UnmarshalJSON is the custom unmarshaler for ImageRecipesAction struct. 4860func (ira *ImageRecipesAction) UnmarshalJSON(body []byte) error { 4861 var m map[string]*json.RawMessage 4862 err := json.Unmarshal(body, &m) 4863 if err != nil { 4864 return err 4865 } 4866 for k, v := range m { 4867 switch k { 4868 case "data": 4869 if v != nil { 4870 var data RecipesModule 4871 err = json.Unmarshal(*v, &data) 4872 if err != nil { 4873 return err 4874 } 4875 ira.Data = &data 4876 } 4877 case "actionType": 4878 if v != nil { 4879 var actionType string 4880 err = json.Unmarshal(*v, &actionType) 4881 if err != nil { 4882 return err 4883 } 4884 ira.ActionType = &actionType 4885 } 4886 case "result": 4887 if v != nil { 4888 resultVar, err := unmarshalBasicThingArray(*v) 4889 if err != nil { 4890 return err 4891 } 4892 ira.Result = &resultVar 4893 } 4894 case "displayName": 4895 if v != nil { 4896 var displayName string 4897 err = json.Unmarshal(*v, &displayName) 4898 if err != nil { 4899 return err 4900 } 4901 ira.DisplayName = &displayName 4902 } 4903 case "isTopAction": 4904 if v != nil { 4905 var isTopAction bool 4906 err = json.Unmarshal(*v, &isTopAction) 4907 if err != nil { 4908 return err 4909 } 4910 ira.IsTopAction = &isTopAction 4911 } 4912 case "serviceUrl": 4913 if v != nil { 4914 var serviceURL string 4915 err = json.Unmarshal(*v, &serviceURL) 4916 if err != nil { 4917 return err 4918 } 4919 ira.ServiceURL = &serviceURL 4920 } 4921 case "thumbnailUrl": 4922 if v != nil { 4923 var thumbnailURL string 4924 err = json.Unmarshal(*v, &thumbnailURL) 4925 if err != nil { 4926 return err 4927 } 4928 ira.ThumbnailURL = &thumbnailURL 4929 } 4930 case "provider": 4931 if v != nil { 4932 provider, err := unmarshalBasicThingArray(*v) 4933 if err != nil { 4934 return err 4935 } 4936 ira.Provider = &provider 4937 } 4938 case "datePublished": 4939 if v != nil { 4940 var datePublished string 4941 err = json.Unmarshal(*v, &datePublished) 4942 if err != nil { 4943 return err 4944 } 4945 ira.DatePublished = &datePublished 4946 } 4947 case "text": 4948 if v != nil { 4949 var textVar string 4950 err = json.Unmarshal(*v, &textVar) 4951 if err != nil { 4952 return err 4953 } 4954 ira.Text = &textVar 4955 } 4956 case "name": 4957 if v != nil { 4958 var name string 4959 err = json.Unmarshal(*v, &name) 4960 if err != nil { 4961 return err 4962 } 4963 ira.Name = &name 4964 } 4965 case "url": 4966 if v != nil { 4967 var URL string 4968 err = json.Unmarshal(*v, &URL) 4969 if err != nil { 4970 return err 4971 } 4972 ira.URL = &URL 4973 } 4974 case "image": 4975 if v != nil { 4976 var imageVar ImageObject 4977 err = json.Unmarshal(*v, &imageVar) 4978 if err != nil { 4979 return err 4980 } 4981 ira.Image = &imageVar 4982 } 4983 case "description": 4984 if v != nil { 4985 var description string 4986 err = json.Unmarshal(*v, &description) 4987 if err != nil { 4988 return err 4989 } 4990 ira.Description = &description 4991 } 4992 case "alternateName": 4993 if v != nil { 4994 var alternateName string 4995 err = json.Unmarshal(*v, &alternateName) 4996 if err != nil { 4997 return err 4998 } 4999 ira.AlternateName = &alternateName 5000 } 5001 case "bingId": 5002 if v != nil { 5003 var bingID string 5004 err = json.Unmarshal(*v, &bingID) 5005 if err != nil { 5006 return err 5007 } 5008 ira.BingID = &bingID 5009 } 5010 case "readLink": 5011 if v != nil { 5012 var readLink string 5013 err = json.Unmarshal(*v, &readLink) 5014 if err != nil { 5015 return err 5016 } 5017 ira.ReadLink = &readLink 5018 } 5019 case "webSearchUrl": 5020 if v != nil { 5021 var webSearchURL string 5022 err = json.Unmarshal(*v, &webSearchURL) 5023 if err != nil { 5024 return err 5025 } 5026 ira.WebSearchURL = &webSearchURL 5027 } 5028 case "id": 5029 if v != nil { 5030 var ID string 5031 err = json.Unmarshal(*v, &ID) 5032 if err != nil { 5033 return err 5034 } 5035 ira.ID = &ID 5036 } 5037 case "_type": 5038 if v != nil { 5039 var typeVar Type 5040 err = json.Unmarshal(*v, &typeVar) 5041 if err != nil { 5042 return err 5043 } 5044 ira.Type = typeVar 5045 } 5046 } 5047 } 5048 5049 return nil 5050} 5051 5052// ImageRelatedSearchesAction defines an related search action. 5053type ImageRelatedSearchesAction struct { 5054 // Data - READ-ONLY; A list of queries related to the image. 5055 Data *RelatedSearchesModule `json:"data,omitempty"` 5056 // ActionType - READ-ONLY; A string representing the type of action. 5057 ActionType *string `json:"actionType,omitempty"` 5058 // Result - READ-ONLY; The result produced in the action. 5059 Result *[]BasicThing `json:"result,omitempty"` 5060 // DisplayName - READ-ONLY; A display name for the action. 5061 DisplayName *string `json:"displayName,omitempty"` 5062 // IsTopAction - READ-ONLY; A Boolean representing whether this result is the top action. 5063 IsTopAction *bool `json:"isTopAction,omitempty"` 5064 // ServiceURL - READ-ONLY; Use this URL to get additional data to determine how to take the appropriate action. For example, the serviceUrl might return JSON along with an image URL. 5065 ServiceURL *string `json:"serviceUrl,omitempty"` 5066 // ThumbnailURL - READ-ONLY; The URL to a thumbnail of the item. 5067 ThumbnailURL *string `json:"thumbnailUrl,omitempty"` 5068 // Provider - READ-ONLY; The source of the creative work. 5069 Provider *[]BasicThing `json:"provider,omitempty"` 5070 // DatePublished - READ-ONLY; The date on which the CreativeWork was published. 5071 DatePublished *string `json:"datePublished,omitempty"` 5072 // Text - READ-ONLY; Text content of this creative work. 5073 Text *string `json:"text,omitempty"` 5074 // Name - READ-ONLY; The name of the thing represented by this object. 5075 Name *string `json:"name,omitempty"` 5076 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 5077 URL *string `json:"url,omitempty"` 5078 // Image - READ-ONLY; An image of the item. 5079 Image *ImageObject `json:"image,omitempty"` 5080 // Description - READ-ONLY; A short description of the item. 5081 Description *string `json:"description,omitempty"` 5082 // AlternateName - READ-ONLY; An alias for the item. 5083 AlternateName *string `json:"alternateName,omitempty"` 5084 // BingID - READ-ONLY; An ID that uniquely identifies this item. 5085 BingID *string `json:"bingId,omitempty"` 5086 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 5087 ReadLink *string `json:"readLink,omitempty"` 5088 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 5089 WebSearchURL *string `json:"webSearchUrl,omitempty"` 5090 // ID - READ-ONLY; A String identifier. 5091 ID *string `json:"id,omitempty"` 5092 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 5093 Type Type `json:"_type,omitempty"` 5094} 5095 5096// MarshalJSON is the custom marshaler for ImageRelatedSearchesAction. 5097func (irsa ImageRelatedSearchesAction) MarshalJSON() ([]byte, error) { 5098 irsa.Type = TypeImageRelatedSearchesAction 5099 objectMap := make(map[string]interface{}) 5100 if irsa.Type != "" { 5101 objectMap["_type"] = irsa.Type 5102 } 5103 return json.Marshal(objectMap) 5104} 5105 5106// AsPoint2D is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5107func (irsa ImageRelatedSearchesAction) AsPoint2D() (*Point2D, bool) { 5108 return nil, false 5109} 5110 5111// AsNormalizedQuadrilateral is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5112func (irsa ImageRelatedSearchesAction) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 5113 return nil, false 5114} 5115 5116// AsImageAction is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5117func (irsa ImageRelatedSearchesAction) AsImageAction() (*ImageAction, bool) { 5118 return nil, false 5119} 5120 5121// AsBasicImageAction is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5122func (irsa ImageRelatedSearchesAction) AsBasicImageAction() (BasicImageAction, bool) { 5123 return &irsa, true 5124} 5125 5126// AsImageTag is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5127func (irsa ImageRelatedSearchesAction) AsImageTag() (*ImageTag, bool) { 5128 return nil, false 5129} 5130 5131// AsOrganization is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5132func (irsa ImageRelatedSearchesAction) AsOrganization() (*Organization, bool) { 5133 return nil, false 5134} 5135 5136// AsOffer is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5137func (irsa ImageRelatedSearchesAction) AsOffer() (*Offer, bool) { 5138 return nil, false 5139} 5140 5141// AsBasicOffer is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5142func (irsa ImageRelatedSearchesAction) AsBasicOffer() (BasicOffer, bool) { 5143 return nil, false 5144} 5145 5146// AsAggregateOffer is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5147func (irsa ImageRelatedSearchesAction) AsAggregateOffer() (*AggregateOffer, bool) { 5148 return nil, false 5149} 5150 5151// AsImageObject is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5152func (irsa ImageRelatedSearchesAction) AsImageObject() (*ImageObject, bool) { 5153 return nil, false 5154} 5155 5156// AsImageKnowledge is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5157func (irsa ImageRelatedSearchesAction) AsImageKnowledge() (*ImageKnowledge, bool) { 5158 return nil, false 5159} 5160 5161// AsResponse is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5162func (irsa ImageRelatedSearchesAction) AsResponse() (*Response, bool) { 5163 return nil, false 5164} 5165 5166// AsBasicResponse is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5167func (irsa ImageRelatedSearchesAction) AsBasicResponse() (BasicResponse, bool) { 5168 return &irsa, true 5169} 5170 5171// AsIdentifiable is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5172func (irsa ImageRelatedSearchesAction) AsIdentifiable() (*Identifiable, bool) { 5173 return nil, false 5174} 5175 5176// AsBasicIdentifiable is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5177func (irsa ImageRelatedSearchesAction) AsBasicIdentifiable() (BasicIdentifiable, bool) { 5178 return &irsa, true 5179} 5180 5181// AsErrorResponse is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5182func (irsa ImageRelatedSearchesAction) AsErrorResponse() (*ErrorResponse, bool) { 5183 return nil, false 5184} 5185 5186// AsThing is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5187func (irsa ImageRelatedSearchesAction) AsThing() (*Thing, bool) { 5188 return nil, false 5189} 5190 5191// AsBasicThing is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5192func (irsa ImageRelatedSearchesAction) AsBasicThing() (BasicThing, bool) { 5193 return &irsa, true 5194} 5195 5196// AsAction is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5197func (irsa ImageRelatedSearchesAction) AsAction() (*Action, bool) { 5198 return nil, false 5199} 5200 5201// AsBasicAction is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5202func (irsa ImageRelatedSearchesAction) AsBasicAction() (BasicAction, bool) { 5203 return &irsa, true 5204} 5205 5206// AsMediaObject is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5207func (irsa ImageRelatedSearchesAction) AsMediaObject() (*MediaObject, bool) { 5208 return nil, false 5209} 5210 5211// AsBasicMediaObject is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5212func (irsa ImageRelatedSearchesAction) AsBasicMediaObject() (BasicMediaObject, bool) { 5213 return nil, false 5214} 5215 5216// AsCreativeWork is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5217func (irsa ImageRelatedSearchesAction) AsCreativeWork() (*CreativeWork, bool) { 5218 return nil, false 5219} 5220 5221// AsBasicCreativeWork is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5222func (irsa ImageRelatedSearchesAction) AsBasicCreativeWork() (BasicCreativeWork, bool) { 5223 return &irsa, true 5224} 5225 5226// AsPerson is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5227func (irsa ImageRelatedSearchesAction) AsPerson() (*Person, bool) { 5228 return nil, false 5229} 5230 5231// AsIntangible is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5232func (irsa ImageRelatedSearchesAction) AsIntangible() (*Intangible, bool) { 5233 return nil, false 5234} 5235 5236// AsBasicIntangible is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5237func (irsa ImageRelatedSearchesAction) AsBasicIntangible() (BasicIntangible, bool) { 5238 return nil, false 5239} 5240 5241// AsImageEntityAction is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5242func (irsa ImageRelatedSearchesAction) AsImageEntityAction() (*ImageEntityAction, bool) { 5243 return nil, false 5244} 5245 5246// AsImageModuleAction is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5247func (irsa ImageRelatedSearchesAction) AsImageModuleAction() (*ImageModuleAction, bool) { 5248 return nil, false 5249} 5250 5251// AsRecipe is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5252func (irsa ImageRelatedSearchesAction) AsRecipe() (*Recipe, bool) { 5253 return nil, false 5254} 5255 5256// AsImageRecipesAction is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5257func (irsa ImageRelatedSearchesAction) AsImageRecipesAction() (*ImageRecipesAction, bool) { 5258 return nil, false 5259} 5260 5261// AsImageRelatedSearchesAction is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5262func (irsa ImageRelatedSearchesAction) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 5263 return &irsa, true 5264} 5265 5266// AsImageShoppingSourcesAction is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5267func (irsa ImageRelatedSearchesAction) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 5268 return nil, false 5269} 5270 5271// AsStructuredValue is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5272func (irsa ImageRelatedSearchesAction) AsStructuredValue() (*StructuredValue, bool) { 5273 return nil, false 5274} 5275 5276// AsBasicStructuredValue is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5277func (irsa ImageRelatedSearchesAction) AsBasicStructuredValue() (BasicStructuredValue, bool) { 5278 return nil, false 5279} 5280 5281// AsResponseBase is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5282func (irsa ImageRelatedSearchesAction) AsResponseBase() (*ResponseBase, bool) { 5283 return nil, false 5284} 5285 5286// AsBasicResponseBase is the BasicResponseBase implementation for ImageRelatedSearchesAction. 5287func (irsa ImageRelatedSearchesAction) AsBasicResponseBase() (BasicResponseBase, bool) { 5288 return &irsa, true 5289} 5290 5291// UnmarshalJSON is the custom unmarshaler for ImageRelatedSearchesAction struct. 5292func (irsa *ImageRelatedSearchesAction) UnmarshalJSON(body []byte) error { 5293 var m map[string]*json.RawMessage 5294 err := json.Unmarshal(body, &m) 5295 if err != nil { 5296 return err 5297 } 5298 for k, v := range m { 5299 switch k { 5300 case "data": 5301 if v != nil { 5302 var data RelatedSearchesModule 5303 err = json.Unmarshal(*v, &data) 5304 if err != nil { 5305 return err 5306 } 5307 irsa.Data = &data 5308 } 5309 case "actionType": 5310 if v != nil { 5311 var actionType string 5312 err = json.Unmarshal(*v, &actionType) 5313 if err != nil { 5314 return err 5315 } 5316 irsa.ActionType = &actionType 5317 } 5318 case "result": 5319 if v != nil { 5320 resultVar, err := unmarshalBasicThingArray(*v) 5321 if err != nil { 5322 return err 5323 } 5324 irsa.Result = &resultVar 5325 } 5326 case "displayName": 5327 if v != nil { 5328 var displayName string 5329 err = json.Unmarshal(*v, &displayName) 5330 if err != nil { 5331 return err 5332 } 5333 irsa.DisplayName = &displayName 5334 } 5335 case "isTopAction": 5336 if v != nil { 5337 var isTopAction bool 5338 err = json.Unmarshal(*v, &isTopAction) 5339 if err != nil { 5340 return err 5341 } 5342 irsa.IsTopAction = &isTopAction 5343 } 5344 case "serviceUrl": 5345 if v != nil { 5346 var serviceURL string 5347 err = json.Unmarshal(*v, &serviceURL) 5348 if err != nil { 5349 return err 5350 } 5351 irsa.ServiceURL = &serviceURL 5352 } 5353 case "thumbnailUrl": 5354 if v != nil { 5355 var thumbnailURL string 5356 err = json.Unmarshal(*v, &thumbnailURL) 5357 if err != nil { 5358 return err 5359 } 5360 irsa.ThumbnailURL = &thumbnailURL 5361 } 5362 case "provider": 5363 if v != nil { 5364 provider, err := unmarshalBasicThingArray(*v) 5365 if err != nil { 5366 return err 5367 } 5368 irsa.Provider = &provider 5369 } 5370 case "datePublished": 5371 if v != nil { 5372 var datePublished string 5373 err = json.Unmarshal(*v, &datePublished) 5374 if err != nil { 5375 return err 5376 } 5377 irsa.DatePublished = &datePublished 5378 } 5379 case "text": 5380 if v != nil { 5381 var textVar string 5382 err = json.Unmarshal(*v, &textVar) 5383 if err != nil { 5384 return err 5385 } 5386 irsa.Text = &textVar 5387 } 5388 case "name": 5389 if v != nil { 5390 var name string 5391 err = json.Unmarshal(*v, &name) 5392 if err != nil { 5393 return err 5394 } 5395 irsa.Name = &name 5396 } 5397 case "url": 5398 if v != nil { 5399 var URL string 5400 err = json.Unmarshal(*v, &URL) 5401 if err != nil { 5402 return err 5403 } 5404 irsa.URL = &URL 5405 } 5406 case "image": 5407 if v != nil { 5408 var imageVar ImageObject 5409 err = json.Unmarshal(*v, &imageVar) 5410 if err != nil { 5411 return err 5412 } 5413 irsa.Image = &imageVar 5414 } 5415 case "description": 5416 if v != nil { 5417 var description string 5418 err = json.Unmarshal(*v, &description) 5419 if err != nil { 5420 return err 5421 } 5422 irsa.Description = &description 5423 } 5424 case "alternateName": 5425 if v != nil { 5426 var alternateName string 5427 err = json.Unmarshal(*v, &alternateName) 5428 if err != nil { 5429 return err 5430 } 5431 irsa.AlternateName = &alternateName 5432 } 5433 case "bingId": 5434 if v != nil { 5435 var bingID string 5436 err = json.Unmarshal(*v, &bingID) 5437 if err != nil { 5438 return err 5439 } 5440 irsa.BingID = &bingID 5441 } 5442 case "readLink": 5443 if v != nil { 5444 var readLink string 5445 err = json.Unmarshal(*v, &readLink) 5446 if err != nil { 5447 return err 5448 } 5449 irsa.ReadLink = &readLink 5450 } 5451 case "webSearchUrl": 5452 if v != nil { 5453 var webSearchURL string 5454 err = json.Unmarshal(*v, &webSearchURL) 5455 if err != nil { 5456 return err 5457 } 5458 irsa.WebSearchURL = &webSearchURL 5459 } 5460 case "id": 5461 if v != nil { 5462 var ID string 5463 err = json.Unmarshal(*v, &ID) 5464 if err != nil { 5465 return err 5466 } 5467 irsa.ID = &ID 5468 } 5469 case "_type": 5470 if v != nil { 5471 var typeVar Type 5472 err = json.Unmarshal(*v, &typeVar) 5473 if err != nil { 5474 return err 5475 } 5476 irsa.Type = typeVar 5477 } 5478 } 5479 } 5480 5481 return nil 5482} 5483 5484// ImageShoppingSourcesAction defines a shopping sources action. 5485type ImageShoppingSourcesAction struct { 5486 // Data - READ-ONLY; A list of merchants that offer items related to the image. 5487 Data *AggregateOffer `json:"data,omitempty"` 5488 // ActionType - READ-ONLY; A string representing the type of action. 5489 ActionType *string `json:"actionType,omitempty"` 5490 // Result - READ-ONLY; The result produced in the action. 5491 Result *[]BasicThing `json:"result,omitempty"` 5492 // DisplayName - READ-ONLY; A display name for the action. 5493 DisplayName *string `json:"displayName,omitempty"` 5494 // IsTopAction - READ-ONLY; A Boolean representing whether this result is the top action. 5495 IsTopAction *bool `json:"isTopAction,omitempty"` 5496 // ServiceURL - READ-ONLY; Use this URL to get additional data to determine how to take the appropriate action. For example, the serviceUrl might return JSON along with an image URL. 5497 ServiceURL *string `json:"serviceUrl,omitempty"` 5498 // ThumbnailURL - READ-ONLY; The URL to a thumbnail of the item. 5499 ThumbnailURL *string `json:"thumbnailUrl,omitempty"` 5500 // Provider - READ-ONLY; The source of the creative work. 5501 Provider *[]BasicThing `json:"provider,omitempty"` 5502 // DatePublished - READ-ONLY; The date on which the CreativeWork was published. 5503 DatePublished *string `json:"datePublished,omitempty"` 5504 // Text - READ-ONLY; Text content of this creative work. 5505 Text *string `json:"text,omitempty"` 5506 // Name - READ-ONLY; The name of the thing represented by this object. 5507 Name *string `json:"name,omitempty"` 5508 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 5509 URL *string `json:"url,omitempty"` 5510 // Image - READ-ONLY; An image of the item. 5511 Image *ImageObject `json:"image,omitempty"` 5512 // Description - READ-ONLY; A short description of the item. 5513 Description *string `json:"description,omitempty"` 5514 // AlternateName - READ-ONLY; An alias for the item. 5515 AlternateName *string `json:"alternateName,omitempty"` 5516 // BingID - READ-ONLY; An ID that uniquely identifies this item. 5517 BingID *string `json:"bingId,omitempty"` 5518 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 5519 ReadLink *string `json:"readLink,omitempty"` 5520 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 5521 WebSearchURL *string `json:"webSearchUrl,omitempty"` 5522 // ID - READ-ONLY; A String identifier. 5523 ID *string `json:"id,omitempty"` 5524 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 5525 Type Type `json:"_type,omitempty"` 5526} 5527 5528// MarshalJSON is the custom marshaler for ImageShoppingSourcesAction. 5529func (issa ImageShoppingSourcesAction) MarshalJSON() ([]byte, error) { 5530 issa.Type = TypeImageShoppingSourcesAction 5531 objectMap := make(map[string]interface{}) 5532 if issa.Type != "" { 5533 objectMap["_type"] = issa.Type 5534 } 5535 return json.Marshal(objectMap) 5536} 5537 5538// AsPoint2D is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5539func (issa ImageShoppingSourcesAction) AsPoint2D() (*Point2D, bool) { 5540 return nil, false 5541} 5542 5543// AsNormalizedQuadrilateral is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5544func (issa ImageShoppingSourcesAction) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 5545 return nil, false 5546} 5547 5548// AsImageAction is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5549func (issa ImageShoppingSourcesAction) AsImageAction() (*ImageAction, bool) { 5550 return nil, false 5551} 5552 5553// AsBasicImageAction is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5554func (issa ImageShoppingSourcesAction) AsBasicImageAction() (BasicImageAction, bool) { 5555 return &issa, true 5556} 5557 5558// AsImageTag is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5559func (issa ImageShoppingSourcesAction) AsImageTag() (*ImageTag, bool) { 5560 return nil, false 5561} 5562 5563// AsOrganization is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5564func (issa ImageShoppingSourcesAction) AsOrganization() (*Organization, bool) { 5565 return nil, false 5566} 5567 5568// AsOffer is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5569func (issa ImageShoppingSourcesAction) AsOffer() (*Offer, bool) { 5570 return nil, false 5571} 5572 5573// AsBasicOffer is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5574func (issa ImageShoppingSourcesAction) AsBasicOffer() (BasicOffer, bool) { 5575 return nil, false 5576} 5577 5578// AsAggregateOffer is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5579func (issa ImageShoppingSourcesAction) AsAggregateOffer() (*AggregateOffer, bool) { 5580 return nil, false 5581} 5582 5583// AsImageObject is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5584func (issa ImageShoppingSourcesAction) AsImageObject() (*ImageObject, bool) { 5585 return nil, false 5586} 5587 5588// AsImageKnowledge is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5589func (issa ImageShoppingSourcesAction) AsImageKnowledge() (*ImageKnowledge, bool) { 5590 return nil, false 5591} 5592 5593// AsResponse is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5594func (issa ImageShoppingSourcesAction) AsResponse() (*Response, bool) { 5595 return nil, false 5596} 5597 5598// AsBasicResponse is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5599func (issa ImageShoppingSourcesAction) AsBasicResponse() (BasicResponse, bool) { 5600 return &issa, true 5601} 5602 5603// AsIdentifiable is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5604func (issa ImageShoppingSourcesAction) AsIdentifiable() (*Identifiable, bool) { 5605 return nil, false 5606} 5607 5608// AsBasicIdentifiable is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5609func (issa ImageShoppingSourcesAction) AsBasicIdentifiable() (BasicIdentifiable, bool) { 5610 return &issa, true 5611} 5612 5613// AsErrorResponse is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5614func (issa ImageShoppingSourcesAction) AsErrorResponse() (*ErrorResponse, bool) { 5615 return nil, false 5616} 5617 5618// AsThing is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5619func (issa ImageShoppingSourcesAction) AsThing() (*Thing, bool) { 5620 return nil, false 5621} 5622 5623// AsBasicThing is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5624func (issa ImageShoppingSourcesAction) AsBasicThing() (BasicThing, bool) { 5625 return &issa, true 5626} 5627 5628// AsAction is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5629func (issa ImageShoppingSourcesAction) AsAction() (*Action, bool) { 5630 return nil, false 5631} 5632 5633// AsBasicAction is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5634func (issa ImageShoppingSourcesAction) AsBasicAction() (BasicAction, bool) { 5635 return &issa, true 5636} 5637 5638// AsMediaObject is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5639func (issa ImageShoppingSourcesAction) AsMediaObject() (*MediaObject, bool) { 5640 return nil, false 5641} 5642 5643// AsBasicMediaObject is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5644func (issa ImageShoppingSourcesAction) AsBasicMediaObject() (BasicMediaObject, bool) { 5645 return nil, false 5646} 5647 5648// AsCreativeWork is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5649func (issa ImageShoppingSourcesAction) AsCreativeWork() (*CreativeWork, bool) { 5650 return nil, false 5651} 5652 5653// AsBasicCreativeWork is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5654func (issa ImageShoppingSourcesAction) AsBasicCreativeWork() (BasicCreativeWork, bool) { 5655 return &issa, true 5656} 5657 5658// AsPerson is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5659func (issa ImageShoppingSourcesAction) AsPerson() (*Person, bool) { 5660 return nil, false 5661} 5662 5663// AsIntangible is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5664func (issa ImageShoppingSourcesAction) AsIntangible() (*Intangible, bool) { 5665 return nil, false 5666} 5667 5668// AsBasicIntangible is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5669func (issa ImageShoppingSourcesAction) AsBasicIntangible() (BasicIntangible, bool) { 5670 return nil, false 5671} 5672 5673// AsImageEntityAction is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5674func (issa ImageShoppingSourcesAction) AsImageEntityAction() (*ImageEntityAction, bool) { 5675 return nil, false 5676} 5677 5678// AsImageModuleAction is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5679func (issa ImageShoppingSourcesAction) AsImageModuleAction() (*ImageModuleAction, bool) { 5680 return nil, false 5681} 5682 5683// AsRecipe is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5684func (issa ImageShoppingSourcesAction) AsRecipe() (*Recipe, bool) { 5685 return nil, false 5686} 5687 5688// AsImageRecipesAction is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5689func (issa ImageShoppingSourcesAction) AsImageRecipesAction() (*ImageRecipesAction, bool) { 5690 return nil, false 5691} 5692 5693// AsImageRelatedSearchesAction is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5694func (issa ImageShoppingSourcesAction) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 5695 return nil, false 5696} 5697 5698// AsImageShoppingSourcesAction is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5699func (issa ImageShoppingSourcesAction) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 5700 return &issa, true 5701} 5702 5703// AsStructuredValue is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5704func (issa ImageShoppingSourcesAction) AsStructuredValue() (*StructuredValue, bool) { 5705 return nil, false 5706} 5707 5708// AsBasicStructuredValue is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5709func (issa ImageShoppingSourcesAction) AsBasicStructuredValue() (BasicStructuredValue, bool) { 5710 return nil, false 5711} 5712 5713// AsResponseBase is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5714func (issa ImageShoppingSourcesAction) AsResponseBase() (*ResponseBase, bool) { 5715 return nil, false 5716} 5717 5718// AsBasicResponseBase is the BasicResponseBase implementation for ImageShoppingSourcesAction. 5719func (issa ImageShoppingSourcesAction) AsBasicResponseBase() (BasicResponseBase, bool) { 5720 return &issa, true 5721} 5722 5723// UnmarshalJSON is the custom unmarshaler for ImageShoppingSourcesAction struct. 5724func (issa *ImageShoppingSourcesAction) UnmarshalJSON(body []byte) error { 5725 var m map[string]*json.RawMessage 5726 err := json.Unmarshal(body, &m) 5727 if err != nil { 5728 return err 5729 } 5730 for k, v := range m { 5731 switch k { 5732 case "data": 5733 if v != nil { 5734 var data AggregateOffer 5735 err = json.Unmarshal(*v, &data) 5736 if err != nil { 5737 return err 5738 } 5739 issa.Data = &data 5740 } 5741 case "actionType": 5742 if v != nil { 5743 var actionType string 5744 err = json.Unmarshal(*v, &actionType) 5745 if err != nil { 5746 return err 5747 } 5748 issa.ActionType = &actionType 5749 } 5750 case "result": 5751 if v != nil { 5752 resultVar, err := unmarshalBasicThingArray(*v) 5753 if err != nil { 5754 return err 5755 } 5756 issa.Result = &resultVar 5757 } 5758 case "displayName": 5759 if v != nil { 5760 var displayName string 5761 err = json.Unmarshal(*v, &displayName) 5762 if err != nil { 5763 return err 5764 } 5765 issa.DisplayName = &displayName 5766 } 5767 case "isTopAction": 5768 if v != nil { 5769 var isTopAction bool 5770 err = json.Unmarshal(*v, &isTopAction) 5771 if err != nil { 5772 return err 5773 } 5774 issa.IsTopAction = &isTopAction 5775 } 5776 case "serviceUrl": 5777 if v != nil { 5778 var serviceURL string 5779 err = json.Unmarshal(*v, &serviceURL) 5780 if err != nil { 5781 return err 5782 } 5783 issa.ServiceURL = &serviceURL 5784 } 5785 case "thumbnailUrl": 5786 if v != nil { 5787 var thumbnailURL string 5788 err = json.Unmarshal(*v, &thumbnailURL) 5789 if err != nil { 5790 return err 5791 } 5792 issa.ThumbnailURL = &thumbnailURL 5793 } 5794 case "provider": 5795 if v != nil { 5796 provider, err := unmarshalBasicThingArray(*v) 5797 if err != nil { 5798 return err 5799 } 5800 issa.Provider = &provider 5801 } 5802 case "datePublished": 5803 if v != nil { 5804 var datePublished string 5805 err = json.Unmarshal(*v, &datePublished) 5806 if err != nil { 5807 return err 5808 } 5809 issa.DatePublished = &datePublished 5810 } 5811 case "text": 5812 if v != nil { 5813 var textVar string 5814 err = json.Unmarshal(*v, &textVar) 5815 if err != nil { 5816 return err 5817 } 5818 issa.Text = &textVar 5819 } 5820 case "name": 5821 if v != nil { 5822 var name string 5823 err = json.Unmarshal(*v, &name) 5824 if err != nil { 5825 return err 5826 } 5827 issa.Name = &name 5828 } 5829 case "url": 5830 if v != nil { 5831 var URL string 5832 err = json.Unmarshal(*v, &URL) 5833 if err != nil { 5834 return err 5835 } 5836 issa.URL = &URL 5837 } 5838 case "image": 5839 if v != nil { 5840 var imageVar ImageObject 5841 err = json.Unmarshal(*v, &imageVar) 5842 if err != nil { 5843 return err 5844 } 5845 issa.Image = &imageVar 5846 } 5847 case "description": 5848 if v != nil { 5849 var description string 5850 err = json.Unmarshal(*v, &description) 5851 if err != nil { 5852 return err 5853 } 5854 issa.Description = &description 5855 } 5856 case "alternateName": 5857 if v != nil { 5858 var alternateName string 5859 err = json.Unmarshal(*v, &alternateName) 5860 if err != nil { 5861 return err 5862 } 5863 issa.AlternateName = &alternateName 5864 } 5865 case "bingId": 5866 if v != nil { 5867 var bingID string 5868 err = json.Unmarshal(*v, &bingID) 5869 if err != nil { 5870 return err 5871 } 5872 issa.BingID = &bingID 5873 } 5874 case "readLink": 5875 if v != nil { 5876 var readLink string 5877 err = json.Unmarshal(*v, &readLink) 5878 if err != nil { 5879 return err 5880 } 5881 issa.ReadLink = &readLink 5882 } 5883 case "webSearchUrl": 5884 if v != nil { 5885 var webSearchURL string 5886 err = json.Unmarshal(*v, &webSearchURL) 5887 if err != nil { 5888 return err 5889 } 5890 issa.WebSearchURL = &webSearchURL 5891 } 5892 case "id": 5893 if v != nil { 5894 var ID string 5895 err = json.Unmarshal(*v, &ID) 5896 if err != nil { 5897 return err 5898 } 5899 issa.ID = &ID 5900 } 5901 case "_type": 5902 if v != nil { 5903 var typeVar Type 5904 err = json.Unmarshal(*v, &typeVar) 5905 if err != nil { 5906 return err 5907 } 5908 issa.Type = typeVar 5909 } 5910 } 5911 } 5912 5913 return nil 5914} 5915 5916// ImagesImageMetadata defines a count of the number of websites where you can shop or perform other 5917// actions related to the image. 5918type ImagesImageMetadata struct { 5919 // ShoppingSourcesCount - READ-ONLY; The number of websites that sell the products seen in the image. 5920 ShoppingSourcesCount *int32 `json:"shoppingSourcesCount,omitempty"` 5921 // RecipeSourcesCount - READ-ONLY; The number of websites that offer recipes of the food seen in the image. 5922 RecipeSourcesCount *int32 `json:"recipeSourcesCount,omitempty"` 5923 // AggregateOffer - READ-ONLY; A summary of the online offers of products found in the image. For example, if the image is of a dress, the offer might identify the lowest price and the number of offers found. Only visually similar products insights include this field. The offer includes the following fields: Name, AggregateRating, OfferCount, and LowPrice. 5924 AggregateOffer *AggregateOffer `json:"aggregateOffer,omitempty"` 5925} 5926 5927// ImagesModule defines a list of images. 5928type ImagesModule struct { 5929 // Value - READ-ONLY; A list of images. 5930 Value *[]ImageObject `json:"value,omitempty"` 5931} 5932 5933// ImageTag a visual search tag. 5934type ImageTag struct { 5935 // DisplayName - READ-ONLY; Display name for this tag. For the default tag, the display name is empty. 5936 DisplayName *string `json:"displayName,omitempty"` 5937 // BoundingBox - READ-ONLY; The bounding box for this tag. For the default tag, there is no bounding box. 5938 BoundingBox *ImageTagRegion `json:"boundingBox,omitempty"` 5939 // Actions - READ-ONLY; Actions within this tag. The order of the items denotes the default ranking order of these actions, with the first action being the most likely user intent. 5940 Actions *[]BasicImageAction `json:"actions,omitempty"` 5941 // Name - READ-ONLY; The name of the thing represented by this object. 5942 Name *string `json:"name,omitempty"` 5943 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 5944 URL *string `json:"url,omitempty"` 5945 // Image - READ-ONLY; An image of the item. 5946 Image *ImageObject `json:"image,omitempty"` 5947 // Description - READ-ONLY; A short description of the item. 5948 Description *string `json:"description,omitempty"` 5949 // AlternateName - READ-ONLY; An alias for the item. 5950 AlternateName *string `json:"alternateName,omitempty"` 5951 // BingID - READ-ONLY; An ID that uniquely identifies this item. 5952 BingID *string `json:"bingId,omitempty"` 5953 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 5954 ReadLink *string `json:"readLink,omitempty"` 5955 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 5956 WebSearchURL *string `json:"webSearchUrl,omitempty"` 5957 // ID - READ-ONLY; A String identifier. 5958 ID *string `json:"id,omitempty"` 5959 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 5960 Type Type `json:"_type,omitempty"` 5961} 5962 5963// MarshalJSON is the custom marshaler for ImageTag. 5964func (it ImageTag) MarshalJSON() ([]byte, error) { 5965 it.Type = TypeImageTag 5966 objectMap := make(map[string]interface{}) 5967 if it.Type != "" { 5968 objectMap["_type"] = it.Type 5969 } 5970 return json.Marshal(objectMap) 5971} 5972 5973// AsPoint2D is the BasicResponseBase implementation for ImageTag. 5974func (it ImageTag) AsPoint2D() (*Point2D, bool) { 5975 return nil, false 5976} 5977 5978// AsNormalizedQuadrilateral is the BasicResponseBase implementation for ImageTag. 5979func (it ImageTag) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 5980 return nil, false 5981} 5982 5983// AsImageAction is the BasicResponseBase implementation for ImageTag. 5984func (it ImageTag) AsImageAction() (*ImageAction, bool) { 5985 return nil, false 5986} 5987 5988// AsBasicImageAction is the BasicResponseBase implementation for ImageTag. 5989func (it ImageTag) AsBasicImageAction() (BasicImageAction, bool) { 5990 return nil, false 5991} 5992 5993// AsImageTag is the BasicResponseBase implementation for ImageTag. 5994func (it ImageTag) AsImageTag() (*ImageTag, bool) { 5995 return &it, true 5996} 5997 5998// AsOrganization is the BasicResponseBase implementation for ImageTag. 5999func (it ImageTag) AsOrganization() (*Organization, bool) { 6000 return nil, false 6001} 6002 6003// AsOffer is the BasicResponseBase implementation for ImageTag. 6004func (it ImageTag) AsOffer() (*Offer, bool) { 6005 return nil, false 6006} 6007 6008// AsBasicOffer is the BasicResponseBase implementation for ImageTag. 6009func (it ImageTag) AsBasicOffer() (BasicOffer, bool) { 6010 return nil, false 6011} 6012 6013// AsAggregateOffer is the BasicResponseBase implementation for ImageTag. 6014func (it ImageTag) AsAggregateOffer() (*AggregateOffer, bool) { 6015 return nil, false 6016} 6017 6018// AsImageObject is the BasicResponseBase implementation for ImageTag. 6019func (it ImageTag) AsImageObject() (*ImageObject, bool) { 6020 return nil, false 6021} 6022 6023// AsImageKnowledge is the BasicResponseBase implementation for ImageTag. 6024func (it ImageTag) AsImageKnowledge() (*ImageKnowledge, bool) { 6025 return nil, false 6026} 6027 6028// AsResponse is the BasicResponseBase implementation for ImageTag. 6029func (it ImageTag) AsResponse() (*Response, bool) { 6030 return nil, false 6031} 6032 6033// AsBasicResponse is the BasicResponseBase implementation for ImageTag. 6034func (it ImageTag) AsBasicResponse() (BasicResponse, bool) { 6035 return &it, true 6036} 6037 6038// AsIdentifiable is the BasicResponseBase implementation for ImageTag. 6039func (it ImageTag) AsIdentifiable() (*Identifiable, bool) { 6040 return nil, false 6041} 6042 6043// AsBasicIdentifiable is the BasicResponseBase implementation for ImageTag. 6044func (it ImageTag) AsBasicIdentifiable() (BasicIdentifiable, bool) { 6045 return &it, true 6046} 6047 6048// AsErrorResponse is the BasicResponseBase implementation for ImageTag. 6049func (it ImageTag) AsErrorResponse() (*ErrorResponse, bool) { 6050 return nil, false 6051} 6052 6053// AsThing is the BasicResponseBase implementation for ImageTag. 6054func (it ImageTag) AsThing() (*Thing, bool) { 6055 return nil, false 6056} 6057 6058// AsBasicThing is the BasicResponseBase implementation for ImageTag. 6059func (it ImageTag) AsBasicThing() (BasicThing, bool) { 6060 return &it, true 6061} 6062 6063// AsAction is the BasicResponseBase implementation for ImageTag. 6064func (it ImageTag) AsAction() (*Action, bool) { 6065 return nil, false 6066} 6067 6068// AsBasicAction is the BasicResponseBase implementation for ImageTag. 6069func (it ImageTag) AsBasicAction() (BasicAction, bool) { 6070 return nil, false 6071} 6072 6073// AsMediaObject is the BasicResponseBase implementation for ImageTag. 6074func (it ImageTag) AsMediaObject() (*MediaObject, bool) { 6075 return nil, false 6076} 6077 6078// AsBasicMediaObject is the BasicResponseBase implementation for ImageTag. 6079func (it ImageTag) AsBasicMediaObject() (BasicMediaObject, bool) { 6080 return nil, false 6081} 6082 6083// AsCreativeWork is the BasicResponseBase implementation for ImageTag. 6084func (it ImageTag) AsCreativeWork() (*CreativeWork, bool) { 6085 return nil, false 6086} 6087 6088// AsBasicCreativeWork is the BasicResponseBase implementation for ImageTag. 6089func (it ImageTag) AsBasicCreativeWork() (BasicCreativeWork, bool) { 6090 return nil, false 6091} 6092 6093// AsPerson is the BasicResponseBase implementation for ImageTag. 6094func (it ImageTag) AsPerson() (*Person, bool) { 6095 return nil, false 6096} 6097 6098// AsIntangible is the BasicResponseBase implementation for ImageTag. 6099func (it ImageTag) AsIntangible() (*Intangible, bool) { 6100 return nil, false 6101} 6102 6103// AsBasicIntangible is the BasicResponseBase implementation for ImageTag. 6104func (it ImageTag) AsBasicIntangible() (BasicIntangible, bool) { 6105 return nil, false 6106} 6107 6108// AsImageEntityAction is the BasicResponseBase implementation for ImageTag. 6109func (it ImageTag) AsImageEntityAction() (*ImageEntityAction, bool) { 6110 return nil, false 6111} 6112 6113// AsImageModuleAction is the BasicResponseBase implementation for ImageTag. 6114func (it ImageTag) AsImageModuleAction() (*ImageModuleAction, bool) { 6115 return nil, false 6116} 6117 6118// AsRecipe is the BasicResponseBase implementation for ImageTag. 6119func (it ImageTag) AsRecipe() (*Recipe, bool) { 6120 return nil, false 6121} 6122 6123// AsImageRecipesAction is the BasicResponseBase implementation for ImageTag. 6124func (it ImageTag) AsImageRecipesAction() (*ImageRecipesAction, bool) { 6125 return nil, false 6126} 6127 6128// AsImageRelatedSearchesAction is the BasicResponseBase implementation for ImageTag. 6129func (it ImageTag) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 6130 return nil, false 6131} 6132 6133// AsImageShoppingSourcesAction is the BasicResponseBase implementation for ImageTag. 6134func (it ImageTag) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 6135 return nil, false 6136} 6137 6138// AsStructuredValue is the BasicResponseBase implementation for ImageTag. 6139func (it ImageTag) AsStructuredValue() (*StructuredValue, bool) { 6140 return nil, false 6141} 6142 6143// AsBasicStructuredValue is the BasicResponseBase implementation for ImageTag. 6144func (it ImageTag) AsBasicStructuredValue() (BasicStructuredValue, bool) { 6145 return nil, false 6146} 6147 6148// AsResponseBase is the BasicResponseBase implementation for ImageTag. 6149func (it ImageTag) AsResponseBase() (*ResponseBase, bool) { 6150 return nil, false 6151} 6152 6153// AsBasicResponseBase is the BasicResponseBase implementation for ImageTag. 6154func (it ImageTag) AsBasicResponseBase() (BasicResponseBase, bool) { 6155 return &it, true 6156} 6157 6158// UnmarshalJSON is the custom unmarshaler for ImageTag struct. 6159func (it *ImageTag) UnmarshalJSON(body []byte) error { 6160 var m map[string]*json.RawMessage 6161 err := json.Unmarshal(body, &m) 6162 if err != nil { 6163 return err 6164 } 6165 for k, v := range m { 6166 switch k { 6167 case "displayName": 6168 if v != nil { 6169 var displayName string 6170 err = json.Unmarshal(*v, &displayName) 6171 if err != nil { 6172 return err 6173 } 6174 it.DisplayName = &displayName 6175 } 6176 case "boundingBox": 6177 if v != nil { 6178 var boundingBox ImageTagRegion 6179 err = json.Unmarshal(*v, &boundingBox) 6180 if err != nil { 6181 return err 6182 } 6183 it.BoundingBox = &boundingBox 6184 } 6185 case "actions": 6186 if v != nil { 6187 actions, err := unmarshalBasicImageActionArray(*v) 6188 if err != nil { 6189 return err 6190 } 6191 it.Actions = &actions 6192 } 6193 case "name": 6194 if v != nil { 6195 var name string 6196 err = json.Unmarshal(*v, &name) 6197 if err != nil { 6198 return err 6199 } 6200 it.Name = &name 6201 } 6202 case "url": 6203 if v != nil { 6204 var URL string 6205 err = json.Unmarshal(*v, &URL) 6206 if err != nil { 6207 return err 6208 } 6209 it.URL = &URL 6210 } 6211 case "image": 6212 if v != nil { 6213 var imageVar ImageObject 6214 err = json.Unmarshal(*v, &imageVar) 6215 if err != nil { 6216 return err 6217 } 6218 it.Image = &imageVar 6219 } 6220 case "description": 6221 if v != nil { 6222 var description string 6223 err = json.Unmarshal(*v, &description) 6224 if err != nil { 6225 return err 6226 } 6227 it.Description = &description 6228 } 6229 case "alternateName": 6230 if v != nil { 6231 var alternateName string 6232 err = json.Unmarshal(*v, &alternateName) 6233 if err != nil { 6234 return err 6235 } 6236 it.AlternateName = &alternateName 6237 } 6238 case "bingId": 6239 if v != nil { 6240 var bingID string 6241 err = json.Unmarshal(*v, &bingID) 6242 if err != nil { 6243 return err 6244 } 6245 it.BingID = &bingID 6246 } 6247 case "readLink": 6248 if v != nil { 6249 var readLink string 6250 err = json.Unmarshal(*v, &readLink) 6251 if err != nil { 6252 return err 6253 } 6254 it.ReadLink = &readLink 6255 } 6256 case "webSearchUrl": 6257 if v != nil { 6258 var webSearchURL string 6259 err = json.Unmarshal(*v, &webSearchURL) 6260 if err != nil { 6261 return err 6262 } 6263 it.WebSearchURL = &webSearchURL 6264 } 6265 case "id": 6266 if v != nil { 6267 var ID string 6268 err = json.Unmarshal(*v, &ID) 6269 if err != nil { 6270 return err 6271 } 6272 it.ID = &ID 6273 } 6274 case "_type": 6275 if v != nil { 6276 var typeVar Type 6277 err = json.Unmarshal(*v, &typeVar) 6278 if err != nil { 6279 return err 6280 } 6281 it.Type = typeVar 6282 } 6283 } 6284 } 6285 6286 return nil 6287} 6288 6289// ImageTagRegion defines an image region relevant to the ImageTag. 6290type ImageTagRegion struct { 6291 // QueryRectangle - A rectangle that outlines the area of interest for this tag. 6292 QueryRectangle *NormalizedQuadrilateral `json:"queryRectangle,omitempty"` 6293 // DisplayRectangle - A recommended rectangle to show to the user. 6294 DisplayRectangle *NormalizedQuadrilateral `json:"displayRectangle,omitempty"` 6295} 6296 6297// BasicIntangible a utility class that serves as the umbrella for a number of 'intangible' things such as quantities, 6298// structured values, etc. 6299type BasicIntangible interface { 6300 AsPoint2D() (*Point2D, bool) 6301 AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) 6302 AsStructuredValue() (*StructuredValue, bool) 6303 AsBasicStructuredValue() (BasicStructuredValue, bool) 6304 AsIntangible() (*Intangible, bool) 6305} 6306 6307// Intangible a utility class that serves as the umbrella for a number of 'intangible' things such as 6308// quantities, structured values, etc. 6309type Intangible struct { 6310 // Name - READ-ONLY; The name of the thing represented by this object. 6311 Name *string `json:"name,omitempty"` 6312 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 6313 URL *string `json:"url,omitempty"` 6314 // Image - READ-ONLY; An image of the item. 6315 Image *ImageObject `json:"image,omitempty"` 6316 // Description - READ-ONLY; A short description of the item. 6317 Description *string `json:"description,omitempty"` 6318 // AlternateName - READ-ONLY; An alias for the item. 6319 AlternateName *string `json:"alternateName,omitempty"` 6320 // BingID - READ-ONLY; An ID that uniquely identifies this item. 6321 BingID *string `json:"bingId,omitempty"` 6322 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 6323 ReadLink *string `json:"readLink,omitempty"` 6324 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 6325 WebSearchURL *string `json:"webSearchUrl,omitempty"` 6326 // ID - READ-ONLY; A String identifier. 6327 ID *string `json:"id,omitempty"` 6328 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 6329 Type Type `json:"_type,omitempty"` 6330} 6331 6332func unmarshalBasicIntangible(body []byte) (BasicIntangible, error) { 6333 var m map[string]interface{} 6334 err := json.Unmarshal(body, &m) 6335 if err != nil { 6336 return nil, err 6337 } 6338 6339 switch m["_type"] { 6340 case string(TypePoint2D): 6341 var p2 Point2D 6342 err := json.Unmarshal(body, &p2) 6343 return p2, err 6344 case string(TypeNormalizedQuadrilateral): 6345 var nq NormalizedQuadrilateral 6346 err := json.Unmarshal(body, &nq) 6347 return nq, err 6348 case string(TypeStructuredValue): 6349 var sv StructuredValue 6350 err := json.Unmarshal(body, &sv) 6351 return sv, err 6352 default: 6353 var i Intangible 6354 err := json.Unmarshal(body, &i) 6355 return i, err 6356 } 6357} 6358func unmarshalBasicIntangibleArray(body []byte) ([]BasicIntangible, error) { 6359 var rawMessages []*json.RawMessage 6360 err := json.Unmarshal(body, &rawMessages) 6361 if err != nil { 6362 return nil, err 6363 } 6364 6365 iArray := make([]BasicIntangible, len(rawMessages)) 6366 6367 for index, rawMessage := range rawMessages { 6368 i, err := unmarshalBasicIntangible(*rawMessage) 6369 if err != nil { 6370 return nil, err 6371 } 6372 iArray[index] = i 6373 } 6374 return iArray, nil 6375} 6376 6377// MarshalJSON is the custom marshaler for Intangible. 6378func (i Intangible) MarshalJSON() ([]byte, error) { 6379 i.Type = TypeIntangible 6380 objectMap := make(map[string]interface{}) 6381 if i.Type != "" { 6382 objectMap["_type"] = i.Type 6383 } 6384 return json.Marshal(objectMap) 6385} 6386 6387// AsPoint2D is the BasicResponseBase implementation for Intangible. 6388func (i Intangible) AsPoint2D() (*Point2D, bool) { 6389 return nil, false 6390} 6391 6392// AsNormalizedQuadrilateral is the BasicResponseBase implementation for Intangible. 6393func (i Intangible) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 6394 return nil, false 6395} 6396 6397// AsImageAction is the BasicResponseBase implementation for Intangible. 6398func (i Intangible) AsImageAction() (*ImageAction, bool) { 6399 return nil, false 6400} 6401 6402// AsBasicImageAction is the BasicResponseBase implementation for Intangible. 6403func (i Intangible) AsBasicImageAction() (BasicImageAction, bool) { 6404 return nil, false 6405} 6406 6407// AsImageTag is the BasicResponseBase implementation for Intangible. 6408func (i Intangible) AsImageTag() (*ImageTag, bool) { 6409 return nil, false 6410} 6411 6412// AsOrganization is the BasicResponseBase implementation for Intangible. 6413func (i Intangible) AsOrganization() (*Organization, bool) { 6414 return nil, false 6415} 6416 6417// AsOffer is the BasicResponseBase implementation for Intangible. 6418func (i Intangible) AsOffer() (*Offer, bool) { 6419 return nil, false 6420} 6421 6422// AsBasicOffer is the BasicResponseBase implementation for Intangible. 6423func (i Intangible) AsBasicOffer() (BasicOffer, bool) { 6424 return nil, false 6425} 6426 6427// AsAggregateOffer is the BasicResponseBase implementation for Intangible. 6428func (i Intangible) AsAggregateOffer() (*AggregateOffer, bool) { 6429 return nil, false 6430} 6431 6432// AsImageObject is the BasicResponseBase implementation for Intangible. 6433func (i Intangible) AsImageObject() (*ImageObject, bool) { 6434 return nil, false 6435} 6436 6437// AsImageKnowledge is the BasicResponseBase implementation for Intangible. 6438func (i Intangible) AsImageKnowledge() (*ImageKnowledge, bool) { 6439 return nil, false 6440} 6441 6442// AsResponse is the BasicResponseBase implementation for Intangible. 6443func (i Intangible) AsResponse() (*Response, bool) { 6444 return nil, false 6445} 6446 6447// AsBasicResponse is the BasicResponseBase implementation for Intangible. 6448func (i Intangible) AsBasicResponse() (BasicResponse, bool) { 6449 return &i, true 6450} 6451 6452// AsIdentifiable is the BasicResponseBase implementation for Intangible. 6453func (i Intangible) AsIdentifiable() (*Identifiable, bool) { 6454 return nil, false 6455} 6456 6457// AsBasicIdentifiable is the BasicResponseBase implementation for Intangible. 6458func (i Intangible) AsBasicIdentifiable() (BasicIdentifiable, bool) { 6459 return &i, true 6460} 6461 6462// AsErrorResponse is the BasicResponseBase implementation for Intangible. 6463func (i Intangible) AsErrorResponse() (*ErrorResponse, bool) { 6464 return nil, false 6465} 6466 6467// AsThing is the BasicResponseBase implementation for Intangible. 6468func (i Intangible) AsThing() (*Thing, bool) { 6469 return nil, false 6470} 6471 6472// AsBasicThing is the BasicResponseBase implementation for Intangible. 6473func (i Intangible) AsBasicThing() (BasicThing, bool) { 6474 return &i, true 6475} 6476 6477// AsAction is the BasicResponseBase implementation for Intangible. 6478func (i Intangible) AsAction() (*Action, bool) { 6479 return nil, false 6480} 6481 6482// AsBasicAction is the BasicResponseBase implementation for Intangible. 6483func (i Intangible) AsBasicAction() (BasicAction, bool) { 6484 return nil, false 6485} 6486 6487// AsMediaObject is the BasicResponseBase implementation for Intangible. 6488func (i Intangible) AsMediaObject() (*MediaObject, bool) { 6489 return nil, false 6490} 6491 6492// AsBasicMediaObject is the BasicResponseBase implementation for Intangible. 6493func (i Intangible) AsBasicMediaObject() (BasicMediaObject, bool) { 6494 return nil, false 6495} 6496 6497// AsCreativeWork is the BasicResponseBase implementation for Intangible. 6498func (i Intangible) AsCreativeWork() (*CreativeWork, bool) { 6499 return nil, false 6500} 6501 6502// AsBasicCreativeWork is the BasicResponseBase implementation for Intangible. 6503func (i Intangible) AsBasicCreativeWork() (BasicCreativeWork, bool) { 6504 return nil, false 6505} 6506 6507// AsPerson is the BasicResponseBase implementation for Intangible. 6508func (i Intangible) AsPerson() (*Person, bool) { 6509 return nil, false 6510} 6511 6512// AsIntangible is the BasicResponseBase implementation for Intangible. 6513func (i Intangible) AsIntangible() (*Intangible, bool) { 6514 return &i, true 6515} 6516 6517// AsBasicIntangible is the BasicResponseBase implementation for Intangible. 6518func (i Intangible) AsBasicIntangible() (BasicIntangible, bool) { 6519 return &i, true 6520} 6521 6522// AsImageEntityAction is the BasicResponseBase implementation for Intangible. 6523func (i Intangible) AsImageEntityAction() (*ImageEntityAction, bool) { 6524 return nil, false 6525} 6526 6527// AsImageModuleAction is the BasicResponseBase implementation for Intangible. 6528func (i Intangible) AsImageModuleAction() (*ImageModuleAction, bool) { 6529 return nil, false 6530} 6531 6532// AsRecipe is the BasicResponseBase implementation for Intangible. 6533func (i Intangible) AsRecipe() (*Recipe, bool) { 6534 return nil, false 6535} 6536 6537// AsImageRecipesAction is the BasicResponseBase implementation for Intangible. 6538func (i Intangible) AsImageRecipesAction() (*ImageRecipesAction, bool) { 6539 return nil, false 6540} 6541 6542// AsImageRelatedSearchesAction is the BasicResponseBase implementation for Intangible. 6543func (i Intangible) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 6544 return nil, false 6545} 6546 6547// AsImageShoppingSourcesAction is the BasicResponseBase implementation for Intangible. 6548func (i Intangible) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 6549 return nil, false 6550} 6551 6552// AsStructuredValue is the BasicResponseBase implementation for Intangible. 6553func (i Intangible) AsStructuredValue() (*StructuredValue, bool) { 6554 return nil, false 6555} 6556 6557// AsBasicStructuredValue is the BasicResponseBase implementation for Intangible. 6558func (i Intangible) AsBasicStructuredValue() (BasicStructuredValue, bool) { 6559 return nil, false 6560} 6561 6562// AsResponseBase is the BasicResponseBase implementation for Intangible. 6563func (i Intangible) AsResponseBase() (*ResponseBase, bool) { 6564 return nil, false 6565} 6566 6567// AsBasicResponseBase is the BasicResponseBase implementation for Intangible. 6568func (i Intangible) AsBasicResponseBase() (BasicResponseBase, bool) { 6569 return &i, true 6570} 6571 6572// KnowledgeRequest a JSON object containing information about the request, such as filters for the 6573// resulting actions. 6574type KnowledgeRequest struct { 6575 // Filters - A key-value object consisting of filters that may be specified to limit the results returned by the API. 6576 Filters *Filters `json:"filters,omitempty"` 6577} 6578 6579// BasicMediaObject defines a media object. 6580type BasicMediaObject interface { 6581 AsImageObject() (*ImageObject, bool) 6582 AsMediaObject() (*MediaObject, bool) 6583} 6584 6585// MediaObject defines a media object. 6586type MediaObject struct { 6587 // ContentURL - READ-ONLY; Original URL to retrieve the source (file) for the media object (e.g., the source URL for the image). 6588 ContentURL *string `json:"contentUrl,omitempty"` 6589 // HostPageURL - READ-ONLY; URL of the page that hosts the media object. 6590 HostPageURL *string `json:"hostPageUrl,omitempty"` 6591 // ContentSize - READ-ONLY; Size of the media object content. Use format "value unit" (e.g., "1024 B"). 6592 ContentSize *string `json:"contentSize,omitempty"` 6593 // EncodingFormat - READ-ONLY; Encoding format (e.g., png, gif, jpeg, etc). 6594 EncodingFormat *string `json:"encodingFormat,omitempty"` 6595 // HostPageDisplayURL - READ-ONLY; Display URL of the page that hosts the media object. 6596 HostPageDisplayURL *string `json:"hostPageDisplayUrl,omitempty"` 6597 // Width - READ-ONLY; The width of the media object, in pixels. 6598 Width *int32 `json:"width,omitempty"` 6599 // Height - READ-ONLY; The height of the media object, in pixels. 6600 Height *int32 `json:"height,omitempty"` 6601 // ThumbnailURL - READ-ONLY; The URL to a thumbnail of the item. 6602 ThumbnailURL *string `json:"thumbnailUrl,omitempty"` 6603 // Provider - READ-ONLY; The source of the creative work. 6604 Provider *[]BasicThing `json:"provider,omitempty"` 6605 // DatePublished - READ-ONLY; The date on which the CreativeWork was published. 6606 DatePublished *string `json:"datePublished,omitempty"` 6607 // Text - READ-ONLY; Text content of this creative work. 6608 Text *string `json:"text,omitempty"` 6609 // Name - READ-ONLY; The name of the thing represented by this object. 6610 Name *string `json:"name,omitempty"` 6611 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 6612 URL *string `json:"url,omitempty"` 6613 // Image - READ-ONLY; An image of the item. 6614 Image *ImageObject `json:"image,omitempty"` 6615 // Description - READ-ONLY; A short description of the item. 6616 Description *string `json:"description,omitempty"` 6617 // AlternateName - READ-ONLY; An alias for the item. 6618 AlternateName *string `json:"alternateName,omitempty"` 6619 // BingID - READ-ONLY; An ID that uniquely identifies this item. 6620 BingID *string `json:"bingId,omitempty"` 6621 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 6622 ReadLink *string `json:"readLink,omitempty"` 6623 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 6624 WebSearchURL *string `json:"webSearchUrl,omitempty"` 6625 // ID - READ-ONLY; A String identifier. 6626 ID *string `json:"id,omitempty"` 6627 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 6628 Type Type `json:"_type,omitempty"` 6629} 6630 6631func unmarshalBasicMediaObject(body []byte) (BasicMediaObject, error) { 6632 var m map[string]interface{} 6633 err := json.Unmarshal(body, &m) 6634 if err != nil { 6635 return nil, err 6636 } 6637 6638 switch m["_type"] { 6639 case string(TypeImageObject): 6640 var ioVar ImageObject 6641 err := json.Unmarshal(body, &ioVar) 6642 return ioVar, err 6643 default: 6644 var mo MediaObject 6645 err := json.Unmarshal(body, &mo) 6646 return mo, err 6647 } 6648} 6649func unmarshalBasicMediaObjectArray(body []byte) ([]BasicMediaObject, error) { 6650 var rawMessages []*json.RawMessage 6651 err := json.Unmarshal(body, &rawMessages) 6652 if err != nil { 6653 return nil, err 6654 } 6655 6656 moArray := make([]BasicMediaObject, len(rawMessages)) 6657 6658 for index, rawMessage := range rawMessages { 6659 mo, err := unmarshalBasicMediaObject(*rawMessage) 6660 if err != nil { 6661 return nil, err 6662 } 6663 moArray[index] = mo 6664 } 6665 return moArray, nil 6666} 6667 6668// MarshalJSON is the custom marshaler for MediaObject. 6669func (mo MediaObject) MarshalJSON() ([]byte, error) { 6670 mo.Type = TypeMediaObject 6671 objectMap := make(map[string]interface{}) 6672 if mo.Type != "" { 6673 objectMap["_type"] = mo.Type 6674 } 6675 return json.Marshal(objectMap) 6676} 6677 6678// AsPoint2D is the BasicResponseBase implementation for MediaObject. 6679func (mo MediaObject) AsPoint2D() (*Point2D, bool) { 6680 return nil, false 6681} 6682 6683// AsNormalizedQuadrilateral is the BasicResponseBase implementation for MediaObject. 6684func (mo MediaObject) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 6685 return nil, false 6686} 6687 6688// AsImageAction is the BasicResponseBase implementation for MediaObject. 6689func (mo MediaObject) AsImageAction() (*ImageAction, bool) { 6690 return nil, false 6691} 6692 6693// AsBasicImageAction is the BasicResponseBase implementation for MediaObject. 6694func (mo MediaObject) AsBasicImageAction() (BasicImageAction, bool) { 6695 return nil, false 6696} 6697 6698// AsImageTag is the BasicResponseBase implementation for MediaObject. 6699func (mo MediaObject) AsImageTag() (*ImageTag, bool) { 6700 return nil, false 6701} 6702 6703// AsOrganization is the BasicResponseBase implementation for MediaObject. 6704func (mo MediaObject) AsOrganization() (*Organization, bool) { 6705 return nil, false 6706} 6707 6708// AsOffer is the BasicResponseBase implementation for MediaObject. 6709func (mo MediaObject) AsOffer() (*Offer, bool) { 6710 return nil, false 6711} 6712 6713// AsBasicOffer is the BasicResponseBase implementation for MediaObject. 6714func (mo MediaObject) AsBasicOffer() (BasicOffer, bool) { 6715 return nil, false 6716} 6717 6718// AsAggregateOffer is the BasicResponseBase implementation for MediaObject. 6719func (mo MediaObject) AsAggregateOffer() (*AggregateOffer, bool) { 6720 return nil, false 6721} 6722 6723// AsImageObject is the BasicResponseBase implementation for MediaObject. 6724func (mo MediaObject) AsImageObject() (*ImageObject, bool) { 6725 return nil, false 6726} 6727 6728// AsImageKnowledge is the BasicResponseBase implementation for MediaObject. 6729func (mo MediaObject) AsImageKnowledge() (*ImageKnowledge, bool) { 6730 return nil, false 6731} 6732 6733// AsResponse is the BasicResponseBase implementation for MediaObject. 6734func (mo MediaObject) AsResponse() (*Response, bool) { 6735 return nil, false 6736} 6737 6738// AsBasicResponse is the BasicResponseBase implementation for MediaObject. 6739func (mo MediaObject) AsBasicResponse() (BasicResponse, bool) { 6740 return &mo, true 6741} 6742 6743// AsIdentifiable is the BasicResponseBase implementation for MediaObject. 6744func (mo MediaObject) AsIdentifiable() (*Identifiable, bool) { 6745 return nil, false 6746} 6747 6748// AsBasicIdentifiable is the BasicResponseBase implementation for MediaObject. 6749func (mo MediaObject) AsBasicIdentifiable() (BasicIdentifiable, bool) { 6750 return &mo, true 6751} 6752 6753// AsErrorResponse is the BasicResponseBase implementation for MediaObject. 6754func (mo MediaObject) AsErrorResponse() (*ErrorResponse, bool) { 6755 return nil, false 6756} 6757 6758// AsThing is the BasicResponseBase implementation for MediaObject. 6759func (mo MediaObject) AsThing() (*Thing, bool) { 6760 return nil, false 6761} 6762 6763// AsBasicThing is the BasicResponseBase implementation for MediaObject. 6764func (mo MediaObject) AsBasicThing() (BasicThing, bool) { 6765 return &mo, true 6766} 6767 6768// AsAction is the BasicResponseBase implementation for MediaObject. 6769func (mo MediaObject) AsAction() (*Action, bool) { 6770 return nil, false 6771} 6772 6773// AsBasicAction is the BasicResponseBase implementation for MediaObject. 6774func (mo MediaObject) AsBasicAction() (BasicAction, bool) { 6775 return nil, false 6776} 6777 6778// AsMediaObject is the BasicResponseBase implementation for MediaObject. 6779func (mo MediaObject) AsMediaObject() (*MediaObject, bool) { 6780 return &mo, true 6781} 6782 6783// AsBasicMediaObject is the BasicResponseBase implementation for MediaObject. 6784func (mo MediaObject) AsBasicMediaObject() (BasicMediaObject, bool) { 6785 return &mo, true 6786} 6787 6788// AsCreativeWork is the BasicResponseBase implementation for MediaObject. 6789func (mo MediaObject) AsCreativeWork() (*CreativeWork, bool) { 6790 return nil, false 6791} 6792 6793// AsBasicCreativeWork is the BasicResponseBase implementation for MediaObject. 6794func (mo MediaObject) AsBasicCreativeWork() (BasicCreativeWork, bool) { 6795 return &mo, true 6796} 6797 6798// AsPerson is the BasicResponseBase implementation for MediaObject. 6799func (mo MediaObject) AsPerson() (*Person, bool) { 6800 return nil, false 6801} 6802 6803// AsIntangible is the BasicResponseBase implementation for MediaObject. 6804func (mo MediaObject) AsIntangible() (*Intangible, bool) { 6805 return nil, false 6806} 6807 6808// AsBasicIntangible is the BasicResponseBase implementation for MediaObject. 6809func (mo MediaObject) AsBasicIntangible() (BasicIntangible, bool) { 6810 return nil, false 6811} 6812 6813// AsImageEntityAction is the BasicResponseBase implementation for MediaObject. 6814func (mo MediaObject) AsImageEntityAction() (*ImageEntityAction, bool) { 6815 return nil, false 6816} 6817 6818// AsImageModuleAction is the BasicResponseBase implementation for MediaObject. 6819func (mo MediaObject) AsImageModuleAction() (*ImageModuleAction, bool) { 6820 return nil, false 6821} 6822 6823// AsRecipe is the BasicResponseBase implementation for MediaObject. 6824func (mo MediaObject) AsRecipe() (*Recipe, bool) { 6825 return nil, false 6826} 6827 6828// AsImageRecipesAction is the BasicResponseBase implementation for MediaObject. 6829func (mo MediaObject) AsImageRecipesAction() (*ImageRecipesAction, bool) { 6830 return nil, false 6831} 6832 6833// AsImageRelatedSearchesAction is the BasicResponseBase implementation for MediaObject. 6834func (mo MediaObject) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 6835 return nil, false 6836} 6837 6838// AsImageShoppingSourcesAction is the BasicResponseBase implementation for MediaObject. 6839func (mo MediaObject) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 6840 return nil, false 6841} 6842 6843// AsStructuredValue is the BasicResponseBase implementation for MediaObject. 6844func (mo MediaObject) AsStructuredValue() (*StructuredValue, bool) { 6845 return nil, false 6846} 6847 6848// AsBasicStructuredValue is the BasicResponseBase implementation for MediaObject. 6849func (mo MediaObject) AsBasicStructuredValue() (BasicStructuredValue, bool) { 6850 return nil, false 6851} 6852 6853// AsResponseBase is the BasicResponseBase implementation for MediaObject. 6854func (mo MediaObject) AsResponseBase() (*ResponseBase, bool) { 6855 return nil, false 6856} 6857 6858// AsBasicResponseBase is the BasicResponseBase implementation for MediaObject. 6859func (mo MediaObject) AsBasicResponseBase() (BasicResponseBase, bool) { 6860 return &mo, true 6861} 6862 6863// UnmarshalJSON is the custom unmarshaler for MediaObject struct. 6864func (mo *MediaObject) UnmarshalJSON(body []byte) error { 6865 var m map[string]*json.RawMessage 6866 err := json.Unmarshal(body, &m) 6867 if err != nil { 6868 return err 6869 } 6870 for k, v := range m { 6871 switch k { 6872 case "contentUrl": 6873 if v != nil { 6874 var contentURL string 6875 err = json.Unmarshal(*v, &contentURL) 6876 if err != nil { 6877 return err 6878 } 6879 mo.ContentURL = &contentURL 6880 } 6881 case "hostPageUrl": 6882 if v != nil { 6883 var hostPageURL string 6884 err = json.Unmarshal(*v, &hostPageURL) 6885 if err != nil { 6886 return err 6887 } 6888 mo.HostPageURL = &hostPageURL 6889 } 6890 case "contentSize": 6891 if v != nil { 6892 var contentSize string 6893 err = json.Unmarshal(*v, &contentSize) 6894 if err != nil { 6895 return err 6896 } 6897 mo.ContentSize = &contentSize 6898 } 6899 case "encodingFormat": 6900 if v != nil { 6901 var encodingFormat string 6902 err = json.Unmarshal(*v, &encodingFormat) 6903 if err != nil { 6904 return err 6905 } 6906 mo.EncodingFormat = &encodingFormat 6907 } 6908 case "hostPageDisplayUrl": 6909 if v != nil { 6910 var hostPageDisplayURL string 6911 err = json.Unmarshal(*v, &hostPageDisplayURL) 6912 if err != nil { 6913 return err 6914 } 6915 mo.HostPageDisplayURL = &hostPageDisplayURL 6916 } 6917 case "width": 6918 if v != nil { 6919 var width int32 6920 err = json.Unmarshal(*v, &width) 6921 if err != nil { 6922 return err 6923 } 6924 mo.Width = &width 6925 } 6926 case "height": 6927 if v != nil { 6928 var height int32 6929 err = json.Unmarshal(*v, &height) 6930 if err != nil { 6931 return err 6932 } 6933 mo.Height = &height 6934 } 6935 case "thumbnailUrl": 6936 if v != nil { 6937 var thumbnailURL string 6938 err = json.Unmarshal(*v, &thumbnailURL) 6939 if err != nil { 6940 return err 6941 } 6942 mo.ThumbnailURL = &thumbnailURL 6943 } 6944 case "provider": 6945 if v != nil { 6946 provider, err := unmarshalBasicThingArray(*v) 6947 if err != nil { 6948 return err 6949 } 6950 mo.Provider = &provider 6951 } 6952 case "datePublished": 6953 if v != nil { 6954 var datePublished string 6955 err = json.Unmarshal(*v, &datePublished) 6956 if err != nil { 6957 return err 6958 } 6959 mo.DatePublished = &datePublished 6960 } 6961 case "text": 6962 if v != nil { 6963 var textVar string 6964 err = json.Unmarshal(*v, &textVar) 6965 if err != nil { 6966 return err 6967 } 6968 mo.Text = &textVar 6969 } 6970 case "name": 6971 if v != nil { 6972 var name string 6973 err = json.Unmarshal(*v, &name) 6974 if err != nil { 6975 return err 6976 } 6977 mo.Name = &name 6978 } 6979 case "url": 6980 if v != nil { 6981 var URL string 6982 err = json.Unmarshal(*v, &URL) 6983 if err != nil { 6984 return err 6985 } 6986 mo.URL = &URL 6987 } 6988 case "image": 6989 if v != nil { 6990 var imageVar ImageObject 6991 err = json.Unmarshal(*v, &imageVar) 6992 if err != nil { 6993 return err 6994 } 6995 mo.Image = &imageVar 6996 } 6997 case "description": 6998 if v != nil { 6999 var description string 7000 err = json.Unmarshal(*v, &description) 7001 if err != nil { 7002 return err 7003 } 7004 mo.Description = &description 7005 } 7006 case "alternateName": 7007 if v != nil { 7008 var alternateName string 7009 err = json.Unmarshal(*v, &alternateName) 7010 if err != nil { 7011 return err 7012 } 7013 mo.AlternateName = &alternateName 7014 } 7015 case "bingId": 7016 if v != nil { 7017 var bingID string 7018 err = json.Unmarshal(*v, &bingID) 7019 if err != nil { 7020 return err 7021 } 7022 mo.BingID = &bingID 7023 } 7024 case "readLink": 7025 if v != nil { 7026 var readLink string 7027 err = json.Unmarshal(*v, &readLink) 7028 if err != nil { 7029 return err 7030 } 7031 mo.ReadLink = &readLink 7032 } 7033 case "webSearchUrl": 7034 if v != nil { 7035 var webSearchURL string 7036 err = json.Unmarshal(*v, &webSearchURL) 7037 if err != nil { 7038 return err 7039 } 7040 mo.WebSearchURL = &webSearchURL 7041 } 7042 case "id": 7043 if v != nil { 7044 var ID string 7045 err = json.Unmarshal(*v, &ID) 7046 if err != nil { 7047 return err 7048 } 7049 mo.ID = &ID 7050 } 7051 case "_type": 7052 if v != nil { 7053 var typeVar Type 7054 err = json.Unmarshal(*v, &typeVar) 7055 if err != nil { 7056 return err 7057 } 7058 mo.Type = typeVar 7059 } 7060 } 7061 } 7062 7063 return nil 7064} 7065 7066// NormalizedQuadrilateral defines a region of an image. The region is a convex quadrilateral defined by 7067// coordinates of its top left, top right, bottom left, and bottom right points. The coordinates are 7068// fractional values of the original image's width and height in the range 0.0 through 1.0. 7069type NormalizedQuadrilateral struct { 7070 // TopLeft - The top left corner coordinate. 7071 TopLeft *Point2D `json:"topLeft,omitempty"` 7072 // TopRight - The top right corner coordinate. 7073 TopRight *Point2D `json:"topRight,omitempty"` 7074 // BottomRight - The bottom right corner coordinate. 7075 BottomRight *Point2D `json:"bottomRight,omitempty"` 7076 // BottomLeft - The bottom left corner coordinate. 7077 BottomLeft *Point2D `json:"bottomLeft,omitempty"` 7078 // Name - READ-ONLY; The name of the thing represented by this object. 7079 Name *string `json:"name,omitempty"` 7080 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 7081 URL *string `json:"url,omitempty"` 7082 // Image - READ-ONLY; An image of the item. 7083 Image *ImageObject `json:"image,omitempty"` 7084 // Description - READ-ONLY; A short description of the item. 7085 Description *string `json:"description,omitempty"` 7086 // AlternateName - READ-ONLY; An alias for the item. 7087 AlternateName *string `json:"alternateName,omitempty"` 7088 // BingID - READ-ONLY; An ID that uniquely identifies this item. 7089 BingID *string `json:"bingId,omitempty"` 7090 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 7091 ReadLink *string `json:"readLink,omitempty"` 7092 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 7093 WebSearchURL *string `json:"webSearchUrl,omitempty"` 7094 // ID - READ-ONLY; A String identifier. 7095 ID *string `json:"id,omitempty"` 7096 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 7097 Type Type `json:"_type,omitempty"` 7098} 7099 7100// MarshalJSON is the custom marshaler for NormalizedQuadrilateral. 7101func (nq NormalizedQuadrilateral) MarshalJSON() ([]byte, error) { 7102 nq.Type = TypeNormalizedQuadrilateral 7103 objectMap := make(map[string]interface{}) 7104 if nq.TopLeft != nil { 7105 objectMap["topLeft"] = nq.TopLeft 7106 } 7107 if nq.TopRight != nil { 7108 objectMap["topRight"] = nq.TopRight 7109 } 7110 if nq.BottomRight != nil { 7111 objectMap["bottomRight"] = nq.BottomRight 7112 } 7113 if nq.BottomLeft != nil { 7114 objectMap["bottomLeft"] = nq.BottomLeft 7115 } 7116 if nq.Type != "" { 7117 objectMap["_type"] = nq.Type 7118 } 7119 return json.Marshal(objectMap) 7120} 7121 7122// AsPoint2D is the BasicResponseBase implementation for NormalizedQuadrilateral. 7123func (nq NormalizedQuadrilateral) AsPoint2D() (*Point2D, bool) { 7124 return nil, false 7125} 7126 7127// AsNormalizedQuadrilateral is the BasicResponseBase implementation for NormalizedQuadrilateral. 7128func (nq NormalizedQuadrilateral) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 7129 return &nq, true 7130} 7131 7132// AsImageAction is the BasicResponseBase implementation for NormalizedQuadrilateral. 7133func (nq NormalizedQuadrilateral) AsImageAction() (*ImageAction, bool) { 7134 return nil, false 7135} 7136 7137// AsBasicImageAction is the BasicResponseBase implementation for NormalizedQuadrilateral. 7138func (nq NormalizedQuadrilateral) AsBasicImageAction() (BasicImageAction, bool) { 7139 return nil, false 7140} 7141 7142// AsImageTag is the BasicResponseBase implementation for NormalizedQuadrilateral. 7143func (nq NormalizedQuadrilateral) AsImageTag() (*ImageTag, bool) { 7144 return nil, false 7145} 7146 7147// AsOrganization is the BasicResponseBase implementation for NormalizedQuadrilateral. 7148func (nq NormalizedQuadrilateral) AsOrganization() (*Organization, bool) { 7149 return nil, false 7150} 7151 7152// AsOffer is the BasicResponseBase implementation for NormalizedQuadrilateral. 7153func (nq NormalizedQuadrilateral) AsOffer() (*Offer, bool) { 7154 return nil, false 7155} 7156 7157// AsBasicOffer is the BasicResponseBase implementation for NormalizedQuadrilateral. 7158func (nq NormalizedQuadrilateral) AsBasicOffer() (BasicOffer, bool) { 7159 return nil, false 7160} 7161 7162// AsAggregateOffer is the BasicResponseBase implementation for NormalizedQuadrilateral. 7163func (nq NormalizedQuadrilateral) AsAggregateOffer() (*AggregateOffer, bool) { 7164 return nil, false 7165} 7166 7167// AsImageObject is the BasicResponseBase implementation for NormalizedQuadrilateral. 7168func (nq NormalizedQuadrilateral) AsImageObject() (*ImageObject, bool) { 7169 return nil, false 7170} 7171 7172// AsImageKnowledge is the BasicResponseBase implementation for NormalizedQuadrilateral. 7173func (nq NormalizedQuadrilateral) AsImageKnowledge() (*ImageKnowledge, bool) { 7174 return nil, false 7175} 7176 7177// AsResponse is the BasicResponseBase implementation for NormalizedQuadrilateral. 7178func (nq NormalizedQuadrilateral) AsResponse() (*Response, bool) { 7179 return nil, false 7180} 7181 7182// AsBasicResponse is the BasicResponseBase implementation for NormalizedQuadrilateral. 7183func (nq NormalizedQuadrilateral) AsBasicResponse() (BasicResponse, bool) { 7184 return &nq, true 7185} 7186 7187// AsIdentifiable is the BasicResponseBase implementation for NormalizedQuadrilateral. 7188func (nq NormalizedQuadrilateral) AsIdentifiable() (*Identifiable, bool) { 7189 return nil, false 7190} 7191 7192// AsBasicIdentifiable is the BasicResponseBase implementation for NormalizedQuadrilateral. 7193func (nq NormalizedQuadrilateral) AsBasicIdentifiable() (BasicIdentifiable, bool) { 7194 return &nq, true 7195} 7196 7197// AsErrorResponse is the BasicResponseBase implementation for NormalizedQuadrilateral. 7198func (nq NormalizedQuadrilateral) AsErrorResponse() (*ErrorResponse, bool) { 7199 return nil, false 7200} 7201 7202// AsThing is the BasicResponseBase implementation for NormalizedQuadrilateral. 7203func (nq NormalizedQuadrilateral) AsThing() (*Thing, bool) { 7204 return nil, false 7205} 7206 7207// AsBasicThing is the BasicResponseBase implementation for NormalizedQuadrilateral. 7208func (nq NormalizedQuadrilateral) AsBasicThing() (BasicThing, bool) { 7209 return &nq, true 7210} 7211 7212// AsAction is the BasicResponseBase implementation for NormalizedQuadrilateral. 7213func (nq NormalizedQuadrilateral) AsAction() (*Action, bool) { 7214 return nil, false 7215} 7216 7217// AsBasicAction is the BasicResponseBase implementation for NormalizedQuadrilateral. 7218func (nq NormalizedQuadrilateral) AsBasicAction() (BasicAction, bool) { 7219 return nil, false 7220} 7221 7222// AsMediaObject is the BasicResponseBase implementation for NormalizedQuadrilateral. 7223func (nq NormalizedQuadrilateral) AsMediaObject() (*MediaObject, bool) { 7224 return nil, false 7225} 7226 7227// AsBasicMediaObject is the BasicResponseBase implementation for NormalizedQuadrilateral. 7228func (nq NormalizedQuadrilateral) AsBasicMediaObject() (BasicMediaObject, bool) { 7229 return nil, false 7230} 7231 7232// AsCreativeWork is the BasicResponseBase implementation for NormalizedQuadrilateral. 7233func (nq NormalizedQuadrilateral) AsCreativeWork() (*CreativeWork, bool) { 7234 return nil, false 7235} 7236 7237// AsBasicCreativeWork is the BasicResponseBase implementation for NormalizedQuadrilateral. 7238func (nq NormalizedQuadrilateral) AsBasicCreativeWork() (BasicCreativeWork, bool) { 7239 return nil, false 7240} 7241 7242// AsPerson is the BasicResponseBase implementation for NormalizedQuadrilateral. 7243func (nq NormalizedQuadrilateral) AsPerson() (*Person, bool) { 7244 return nil, false 7245} 7246 7247// AsIntangible is the BasicResponseBase implementation for NormalizedQuadrilateral. 7248func (nq NormalizedQuadrilateral) AsIntangible() (*Intangible, bool) { 7249 return nil, false 7250} 7251 7252// AsBasicIntangible is the BasicResponseBase implementation for NormalizedQuadrilateral. 7253func (nq NormalizedQuadrilateral) AsBasicIntangible() (BasicIntangible, bool) { 7254 return &nq, true 7255} 7256 7257// AsImageEntityAction is the BasicResponseBase implementation for NormalizedQuadrilateral. 7258func (nq NormalizedQuadrilateral) AsImageEntityAction() (*ImageEntityAction, bool) { 7259 return nil, false 7260} 7261 7262// AsImageModuleAction is the BasicResponseBase implementation for NormalizedQuadrilateral. 7263func (nq NormalizedQuadrilateral) AsImageModuleAction() (*ImageModuleAction, bool) { 7264 return nil, false 7265} 7266 7267// AsRecipe is the BasicResponseBase implementation for NormalizedQuadrilateral. 7268func (nq NormalizedQuadrilateral) AsRecipe() (*Recipe, bool) { 7269 return nil, false 7270} 7271 7272// AsImageRecipesAction is the BasicResponseBase implementation for NormalizedQuadrilateral. 7273func (nq NormalizedQuadrilateral) AsImageRecipesAction() (*ImageRecipesAction, bool) { 7274 return nil, false 7275} 7276 7277// AsImageRelatedSearchesAction is the BasicResponseBase implementation for NormalizedQuadrilateral. 7278func (nq NormalizedQuadrilateral) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 7279 return nil, false 7280} 7281 7282// AsImageShoppingSourcesAction is the BasicResponseBase implementation for NormalizedQuadrilateral. 7283func (nq NormalizedQuadrilateral) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 7284 return nil, false 7285} 7286 7287// AsStructuredValue is the BasicResponseBase implementation for NormalizedQuadrilateral. 7288func (nq NormalizedQuadrilateral) AsStructuredValue() (*StructuredValue, bool) { 7289 return nil, false 7290} 7291 7292// AsBasicStructuredValue is the BasicResponseBase implementation for NormalizedQuadrilateral. 7293func (nq NormalizedQuadrilateral) AsBasicStructuredValue() (BasicStructuredValue, bool) { 7294 return &nq, true 7295} 7296 7297// AsResponseBase is the BasicResponseBase implementation for NormalizedQuadrilateral. 7298func (nq NormalizedQuadrilateral) AsResponseBase() (*ResponseBase, bool) { 7299 return nil, false 7300} 7301 7302// AsBasicResponseBase is the BasicResponseBase implementation for NormalizedQuadrilateral. 7303func (nq NormalizedQuadrilateral) AsBasicResponseBase() (BasicResponseBase, bool) { 7304 return &nq, true 7305} 7306 7307// BasicOffer defines a merchant's offer. 7308type BasicOffer interface { 7309 AsAggregateOffer() (*AggregateOffer, bool) 7310 AsOffer() (*Offer, bool) 7311} 7312 7313// Offer defines a merchant's offer. 7314type Offer struct { 7315 // Seller - READ-ONLY; Seller for this offer. 7316 Seller *Organization `json:"seller,omitempty"` 7317 // Price - READ-ONLY; The item's price. 7318 Price *float64 `json:"price,omitempty"` 7319 // PriceCurrency - READ-ONLY; The monetary currency. For example, USD. Possible values include: 'USD', 'CAD', 'GBP', 'EUR', 'COP', 'JPY', 'CNY', 'AUD', 'INR', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AWG', 'AZN', 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BOV', 'BRL', 'BSD', 'BTN', 'BWP', 'BYR', 'BZD', 'CDF', 'CHE', 'CHF', 'CHW', 'CLF', 'CLP', 'COU', 'CRC', 'CUC', 'CUP', 'CVE', 'CZK', 'DJF', 'DKK', 'DOP', 'DZD', 'EGP', 'ERN', 'ETB', 'FJD', 'FKP', 'GEL', 'GHS', 'GIP', 'GMD', 'GNF', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', 'IDR', 'ILS', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'KES', 'KGS', 'KHR', 'KMF', 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', 'MVR', 'MWK', 'MXN', 'MXV', 'MYR', 'MZN', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', 'QAR', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SBD', 'SCR', 'SDG', 'SEK', 'SGD', 'SHP', 'SLL', 'SOS', 'SRD', 'SSP', 'STD', 'SYP', 'SZL', 'THB', 'TJS', 'TMT', 'TND', 'TOP', 'TRY', 'TTD', 'TWD', 'TZS', 'UAH', 'UGX', 'UYU', 'UZS', 'VEF', 'VND', 'VUV', 'WST', 'XAF', 'XCD', 'XOF', 'XPF', 'YER', 'ZAR', 'ZMW' 7320 PriceCurrency Currency `json:"priceCurrency,omitempty"` 7321 // Availability - READ-ONLY; The item's availability. The following are the possible values: Discontinued, InStock, InStoreOnly, LimitedAvailability, OnlineOnly, OutOfStock, PreOrder, SoldOut. Possible values include: 'Discontinued', 'InStock', 'InStoreOnly', 'LimitedAvailability', 'OnlineOnly', 'OutOfStock', 'PreOrder', 'SoldOut' 7322 Availability ItemAvailability `json:"availability,omitempty"` 7323 // AggregateRating - READ-ONLY; An aggregated rating that indicates how well the product has been rated by others. 7324 AggregateRating *AggregateRating `json:"aggregateRating,omitempty"` 7325 // LastUpdated - READ-ONLY; The last date that the offer was updated. The date is in the form YYYY-MM-DD. 7326 LastUpdated *string `json:"lastUpdated,omitempty"` 7327 // Name - READ-ONLY; The name of the thing represented by this object. 7328 Name *string `json:"name,omitempty"` 7329 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 7330 URL *string `json:"url,omitempty"` 7331 // Image - READ-ONLY; An image of the item. 7332 Image *ImageObject `json:"image,omitempty"` 7333 // Description - READ-ONLY; A short description of the item. 7334 Description *string `json:"description,omitempty"` 7335 // AlternateName - READ-ONLY; An alias for the item. 7336 AlternateName *string `json:"alternateName,omitempty"` 7337 // BingID - READ-ONLY; An ID that uniquely identifies this item. 7338 BingID *string `json:"bingId,omitempty"` 7339 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 7340 ReadLink *string `json:"readLink,omitempty"` 7341 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 7342 WebSearchURL *string `json:"webSearchUrl,omitempty"` 7343 // ID - READ-ONLY; A String identifier. 7344 ID *string `json:"id,omitempty"` 7345 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 7346 Type Type `json:"_type,omitempty"` 7347} 7348 7349func unmarshalBasicOffer(body []byte) (BasicOffer, error) { 7350 var m map[string]interface{} 7351 err := json.Unmarshal(body, &m) 7352 if err != nil { 7353 return nil, err 7354 } 7355 7356 switch m["_type"] { 7357 case string(TypeAggregateOffer): 7358 var ao AggregateOffer 7359 err := json.Unmarshal(body, &ao) 7360 return ao, err 7361 default: 7362 var o Offer 7363 err := json.Unmarshal(body, &o) 7364 return o, err 7365 } 7366} 7367func unmarshalBasicOfferArray(body []byte) ([]BasicOffer, error) { 7368 var rawMessages []*json.RawMessage 7369 err := json.Unmarshal(body, &rawMessages) 7370 if err != nil { 7371 return nil, err 7372 } 7373 7374 oArray := make([]BasicOffer, len(rawMessages)) 7375 7376 for index, rawMessage := range rawMessages { 7377 o, err := unmarshalBasicOffer(*rawMessage) 7378 if err != nil { 7379 return nil, err 7380 } 7381 oArray[index] = o 7382 } 7383 return oArray, nil 7384} 7385 7386// MarshalJSON is the custom marshaler for Offer. 7387func (o Offer) MarshalJSON() ([]byte, error) { 7388 o.Type = TypeOffer 7389 objectMap := make(map[string]interface{}) 7390 if o.Type != "" { 7391 objectMap["_type"] = o.Type 7392 } 7393 return json.Marshal(objectMap) 7394} 7395 7396// AsPoint2D is the BasicResponseBase implementation for Offer. 7397func (o Offer) AsPoint2D() (*Point2D, bool) { 7398 return nil, false 7399} 7400 7401// AsNormalizedQuadrilateral is the BasicResponseBase implementation for Offer. 7402func (o Offer) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 7403 return nil, false 7404} 7405 7406// AsImageAction is the BasicResponseBase implementation for Offer. 7407func (o Offer) AsImageAction() (*ImageAction, bool) { 7408 return nil, false 7409} 7410 7411// AsBasicImageAction is the BasicResponseBase implementation for Offer. 7412func (o Offer) AsBasicImageAction() (BasicImageAction, bool) { 7413 return nil, false 7414} 7415 7416// AsImageTag is the BasicResponseBase implementation for Offer. 7417func (o Offer) AsImageTag() (*ImageTag, bool) { 7418 return nil, false 7419} 7420 7421// AsOrganization is the BasicResponseBase implementation for Offer. 7422func (o Offer) AsOrganization() (*Organization, bool) { 7423 return nil, false 7424} 7425 7426// AsOffer is the BasicResponseBase implementation for Offer. 7427func (o Offer) AsOffer() (*Offer, bool) { 7428 return &o, true 7429} 7430 7431// AsBasicOffer is the BasicResponseBase implementation for Offer. 7432func (o Offer) AsBasicOffer() (BasicOffer, bool) { 7433 return &o, true 7434} 7435 7436// AsAggregateOffer is the BasicResponseBase implementation for Offer. 7437func (o Offer) AsAggregateOffer() (*AggregateOffer, bool) { 7438 return nil, false 7439} 7440 7441// AsImageObject is the BasicResponseBase implementation for Offer. 7442func (o Offer) AsImageObject() (*ImageObject, bool) { 7443 return nil, false 7444} 7445 7446// AsImageKnowledge is the BasicResponseBase implementation for Offer. 7447func (o Offer) AsImageKnowledge() (*ImageKnowledge, bool) { 7448 return nil, false 7449} 7450 7451// AsResponse is the BasicResponseBase implementation for Offer. 7452func (o Offer) AsResponse() (*Response, bool) { 7453 return nil, false 7454} 7455 7456// AsBasicResponse is the BasicResponseBase implementation for Offer. 7457func (o Offer) AsBasicResponse() (BasicResponse, bool) { 7458 return &o, true 7459} 7460 7461// AsIdentifiable is the BasicResponseBase implementation for Offer. 7462func (o Offer) AsIdentifiable() (*Identifiable, bool) { 7463 return nil, false 7464} 7465 7466// AsBasicIdentifiable is the BasicResponseBase implementation for Offer. 7467func (o Offer) AsBasicIdentifiable() (BasicIdentifiable, bool) { 7468 return &o, true 7469} 7470 7471// AsErrorResponse is the BasicResponseBase implementation for Offer. 7472func (o Offer) AsErrorResponse() (*ErrorResponse, bool) { 7473 return nil, false 7474} 7475 7476// AsThing is the BasicResponseBase implementation for Offer. 7477func (o Offer) AsThing() (*Thing, bool) { 7478 return nil, false 7479} 7480 7481// AsBasicThing is the BasicResponseBase implementation for Offer. 7482func (o Offer) AsBasicThing() (BasicThing, bool) { 7483 return &o, true 7484} 7485 7486// AsAction is the BasicResponseBase implementation for Offer. 7487func (o Offer) AsAction() (*Action, bool) { 7488 return nil, false 7489} 7490 7491// AsBasicAction is the BasicResponseBase implementation for Offer. 7492func (o Offer) AsBasicAction() (BasicAction, bool) { 7493 return nil, false 7494} 7495 7496// AsMediaObject is the BasicResponseBase implementation for Offer. 7497func (o Offer) AsMediaObject() (*MediaObject, bool) { 7498 return nil, false 7499} 7500 7501// AsBasicMediaObject is the BasicResponseBase implementation for Offer. 7502func (o Offer) AsBasicMediaObject() (BasicMediaObject, bool) { 7503 return nil, false 7504} 7505 7506// AsCreativeWork is the BasicResponseBase implementation for Offer. 7507func (o Offer) AsCreativeWork() (*CreativeWork, bool) { 7508 return nil, false 7509} 7510 7511// AsBasicCreativeWork is the BasicResponseBase implementation for Offer. 7512func (o Offer) AsBasicCreativeWork() (BasicCreativeWork, bool) { 7513 return nil, false 7514} 7515 7516// AsPerson is the BasicResponseBase implementation for Offer. 7517func (o Offer) AsPerson() (*Person, bool) { 7518 return nil, false 7519} 7520 7521// AsIntangible is the BasicResponseBase implementation for Offer. 7522func (o Offer) AsIntangible() (*Intangible, bool) { 7523 return nil, false 7524} 7525 7526// AsBasicIntangible is the BasicResponseBase implementation for Offer. 7527func (o Offer) AsBasicIntangible() (BasicIntangible, bool) { 7528 return nil, false 7529} 7530 7531// AsImageEntityAction is the BasicResponseBase implementation for Offer. 7532func (o Offer) AsImageEntityAction() (*ImageEntityAction, bool) { 7533 return nil, false 7534} 7535 7536// AsImageModuleAction is the BasicResponseBase implementation for Offer. 7537func (o Offer) AsImageModuleAction() (*ImageModuleAction, bool) { 7538 return nil, false 7539} 7540 7541// AsRecipe is the BasicResponseBase implementation for Offer. 7542func (o Offer) AsRecipe() (*Recipe, bool) { 7543 return nil, false 7544} 7545 7546// AsImageRecipesAction is the BasicResponseBase implementation for Offer. 7547func (o Offer) AsImageRecipesAction() (*ImageRecipesAction, bool) { 7548 return nil, false 7549} 7550 7551// AsImageRelatedSearchesAction is the BasicResponseBase implementation for Offer. 7552func (o Offer) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 7553 return nil, false 7554} 7555 7556// AsImageShoppingSourcesAction is the BasicResponseBase implementation for Offer. 7557func (o Offer) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 7558 return nil, false 7559} 7560 7561// AsStructuredValue is the BasicResponseBase implementation for Offer. 7562func (o Offer) AsStructuredValue() (*StructuredValue, bool) { 7563 return nil, false 7564} 7565 7566// AsBasicStructuredValue is the BasicResponseBase implementation for Offer. 7567func (o Offer) AsBasicStructuredValue() (BasicStructuredValue, bool) { 7568 return nil, false 7569} 7570 7571// AsResponseBase is the BasicResponseBase implementation for Offer. 7572func (o Offer) AsResponseBase() (*ResponseBase, bool) { 7573 return nil, false 7574} 7575 7576// AsBasicResponseBase is the BasicResponseBase implementation for Offer. 7577func (o Offer) AsBasicResponseBase() (BasicResponseBase, bool) { 7578 return &o, true 7579} 7580 7581// Organization defines an organization. 7582type Organization struct { 7583 // Name - READ-ONLY; The name of the thing represented by this object. 7584 Name *string `json:"name,omitempty"` 7585 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 7586 URL *string `json:"url,omitempty"` 7587 // Image - READ-ONLY; An image of the item. 7588 Image *ImageObject `json:"image,omitempty"` 7589 // Description - READ-ONLY; A short description of the item. 7590 Description *string `json:"description,omitempty"` 7591 // AlternateName - READ-ONLY; An alias for the item. 7592 AlternateName *string `json:"alternateName,omitempty"` 7593 // BingID - READ-ONLY; An ID that uniquely identifies this item. 7594 BingID *string `json:"bingId,omitempty"` 7595 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 7596 ReadLink *string `json:"readLink,omitempty"` 7597 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 7598 WebSearchURL *string `json:"webSearchUrl,omitempty"` 7599 // ID - READ-ONLY; A String identifier. 7600 ID *string `json:"id,omitempty"` 7601 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 7602 Type Type `json:"_type,omitempty"` 7603} 7604 7605// MarshalJSON is the custom marshaler for Organization. 7606func (o Organization) MarshalJSON() ([]byte, error) { 7607 o.Type = TypeOrganization 7608 objectMap := make(map[string]interface{}) 7609 if o.Type != "" { 7610 objectMap["_type"] = o.Type 7611 } 7612 return json.Marshal(objectMap) 7613} 7614 7615// AsPoint2D is the BasicResponseBase implementation for Organization. 7616func (o Organization) AsPoint2D() (*Point2D, bool) { 7617 return nil, false 7618} 7619 7620// AsNormalizedQuadrilateral is the BasicResponseBase implementation for Organization. 7621func (o Organization) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 7622 return nil, false 7623} 7624 7625// AsImageAction is the BasicResponseBase implementation for Organization. 7626func (o Organization) AsImageAction() (*ImageAction, bool) { 7627 return nil, false 7628} 7629 7630// AsBasicImageAction is the BasicResponseBase implementation for Organization. 7631func (o Organization) AsBasicImageAction() (BasicImageAction, bool) { 7632 return nil, false 7633} 7634 7635// AsImageTag is the BasicResponseBase implementation for Organization. 7636func (o Organization) AsImageTag() (*ImageTag, bool) { 7637 return nil, false 7638} 7639 7640// AsOrganization is the BasicResponseBase implementation for Organization. 7641func (o Organization) AsOrganization() (*Organization, bool) { 7642 return &o, true 7643} 7644 7645// AsOffer is the BasicResponseBase implementation for Organization. 7646func (o Organization) AsOffer() (*Offer, bool) { 7647 return nil, false 7648} 7649 7650// AsBasicOffer is the BasicResponseBase implementation for Organization. 7651func (o Organization) AsBasicOffer() (BasicOffer, bool) { 7652 return nil, false 7653} 7654 7655// AsAggregateOffer is the BasicResponseBase implementation for Organization. 7656func (o Organization) AsAggregateOffer() (*AggregateOffer, bool) { 7657 return nil, false 7658} 7659 7660// AsImageObject is the BasicResponseBase implementation for Organization. 7661func (o Organization) AsImageObject() (*ImageObject, bool) { 7662 return nil, false 7663} 7664 7665// AsImageKnowledge is the BasicResponseBase implementation for Organization. 7666func (o Organization) AsImageKnowledge() (*ImageKnowledge, bool) { 7667 return nil, false 7668} 7669 7670// AsResponse is the BasicResponseBase implementation for Organization. 7671func (o Organization) AsResponse() (*Response, bool) { 7672 return nil, false 7673} 7674 7675// AsBasicResponse is the BasicResponseBase implementation for Organization. 7676func (o Organization) AsBasicResponse() (BasicResponse, bool) { 7677 return &o, true 7678} 7679 7680// AsIdentifiable is the BasicResponseBase implementation for Organization. 7681func (o Organization) AsIdentifiable() (*Identifiable, bool) { 7682 return nil, false 7683} 7684 7685// AsBasicIdentifiable is the BasicResponseBase implementation for Organization. 7686func (o Organization) AsBasicIdentifiable() (BasicIdentifiable, bool) { 7687 return &o, true 7688} 7689 7690// AsErrorResponse is the BasicResponseBase implementation for Organization. 7691func (o Organization) AsErrorResponse() (*ErrorResponse, bool) { 7692 return nil, false 7693} 7694 7695// AsThing is the BasicResponseBase implementation for Organization. 7696func (o Organization) AsThing() (*Thing, bool) { 7697 return nil, false 7698} 7699 7700// AsBasicThing is the BasicResponseBase implementation for Organization. 7701func (o Organization) AsBasicThing() (BasicThing, bool) { 7702 return &o, true 7703} 7704 7705// AsAction is the BasicResponseBase implementation for Organization. 7706func (o Organization) AsAction() (*Action, bool) { 7707 return nil, false 7708} 7709 7710// AsBasicAction is the BasicResponseBase implementation for Organization. 7711func (o Organization) AsBasicAction() (BasicAction, bool) { 7712 return nil, false 7713} 7714 7715// AsMediaObject is the BasicResponseBase implementation for Organization. 7716func (o Organization) AsMediaObject() (*MediaObject, bool) { 7717 return nil, false 7718} 7719 7720// AsBasicMediaObject is the BasicResponseBase implementation for Organization. 7721func (o Organization) AsBasicMediaObject() (BasicMediaObject, bool) { 7722 return nil, false 7723} 7724 7725// AsCreativeWork is the BasicResponseBase implementation for Organization. 7726func (o Organization) AsCreativeWork() (*CreativeWork, bool) { 7727 return nil, false 7728} 7729 7730// AsBasicCreativeWork is the BasicResponseBase implementation for Organization. 7731func (o Organization) AsBasicCreativeWork() (BasicCreativeWork, bool) { 7732 return nil, false 7733} 7734 7735// AsPerson is the BasicResponseBase implementation for Organization. 7736func (o Organization) AsPerson() (*Person, bool) { 7737 return nil, false 7738} 7739 7740// AsIntangible is the BasicResponseBase implementation for Organization. 7741func (o Organization) AsIntangible() (*Intangible, bool) { 7742 return nil, false 7743} 7744 7745// AsBasicIntangible is the BasicResponseBase implementation for Organization. 7746func (o Organization) AsBasicIntangible() (BasicIntangible, bool) { 7747 return nil, false 7748} 7749 7750// AsImageEntityAction is the BasicResponseBase implementation for Organization. 7751func (o Organization) AsImageEntityAction() (*ImageEntityAction, bool) { 7752 return nil, false 7753} 7754 7755// AsImageModuleAction is the BasicResponseBase implementation for Organization. 7756func (o Organization) AsImageModuleAction() (*ImageModuleAction, bool) { 7757 return nil, false 7758} 7759 7760// AsRecipe is the BasicResponseBase implementation for Organization. 7761func (o Organization) AsRecipe() (*Recipe, bool) { 7762 return nil, false 7763} 7764 7765// AsImageRecipesAction is the BasicResponseBase implementation for Organization. 7766func (o Organization) AsImageRecipesAction() (*ImageRecipesAction, bool) { 7767 return nil, false 7768} 7769 7770// AsImageRelatedSearchesAction is the BasicResponseBase implementation for Organization. 7771func (o Organization) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 7772 return nil, false 7773} 7774 7775// AsImageShoppingSourcesAction is the BasicResponseBase implementation for Organization. 7776func (o Organization) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 7777 return nil, false 7778} 7779 7780// AsStructuredValue is the BasicResponseBase implementation for Organization. 7781func (o Organization) AsStructuredValue() (*StructuredValue, bool) { 7782 return nil, false 7783} 7784 7785// AsBasicStructuredValue is the BasicResponseBase implementation for Organization. 7786func (o Organization) AsBasicStructuredValue() (BasicStructuredValue, bool) { 7787 return nil, false 7788} 7789 7790// AsResponseBase is the BasicResponseBase implementation for Organization. 7791func (o Organization) AsResponseBase() (*ResponseBase, bool) { 7792 return nil, false 7793} 7794 7795// AsBasicResponseBase is the BasicResponseBase implementation for Organization. 7796func (o Organization) AsBasicResponseBase() (BasicResponseBase, bool) { 7797 return &o, true 7798} 7799 7800// Person defines a person. 7801type Person struct { 7802 // JobTitle - READ-ONLY; The person's job title. 7803 JobTitle *string `json:"jobTitle,omitempty"` 7804 // TwitterProfile - READ-ONLY; The URL of the person's twitter profile. 7805 TwitterProfile *string `json:"twitterProfile,omitempty"` 7806 // Name - READ-ONLY; The name of the thing represented by this object. 7807 Name *string `json:"name,omitempty"` 7808 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 7809 URL *string `json:"url,omitempty"` 7810 // Image - READ-ONLY; An image of the item. 7811 Image *ImageObject `json:"image,omitempty"` 7812 // Description - READ-ONLY; A short description of the item. 7813 Description *string `json:"description,omitempty"` 7814 // AlternateName - READ-ONLY; An alias for the item. 7815 AlternateName *string `json:"alternateName,omitempty"` 7816 // BingID - READ-ONLY; An ID that uniquely identifies this item. 7817 BingID *string `json:"bingId,omitempty"` 7818 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 7819 ReadLink *string `json:"readLink,omitempty"` 7820 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 7821 WebSearchURL *string `json:"webSearchUrl,omitempty"` 7822 // ID - READ-ONLY; A String identifier. 7823 ID *string `json:"id,omitempty"` 7824 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 7825 Type Type `json:"_type,omitempty"` 7826} 7827 7828// MarshalJSON is the custom marshaler for Person. 7829func (p Person) MarshalJSON() ([]byte, error) { 7830 p.Type = TypePerson 7831 objectMap := make(map[string]interface{}) 7832 if p.Type != "" { 7833 objectMap["_type"] = p.Type 7834 } 7835 return json.Marshal(objectMap) 7836} 7837 7838// AsPoint2D is the BasicResponseBase implementation for Person. 7839func (p Person) AsPoint2D() (*Point2D, bool) { 7840 return nil, false 7841} 7842 7843// AsNormalizedQuadrilateral is the BasicResponseBase implementation for Person. 7844func (p Person) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 7845 return nil, false 7846} 7847 7848// AsImageAction is the BasicResponseBase implementation for Person. 7849func (p Person) AsImageAction() (*ImageAction, bool) { 7850 return nil, false 7851} 7852 7853// AsBasicImageAction is the BasicResponseBase implementation for Person. 7854func (p Person) AsBasicImageAction() (BasicImageAction, bool) { 7855 return nil, false 7856} 7857 7858// AsImageTag is the BasicResponseBase implementation for Person. 7859func (p Person) AsImageTag() (*ImageTag, bool) { 7860 return nil, false 7861} 7862 7863// AsOrganization is the BasicResponseBase implementation for Person. 7864func (p Person) AsOrganization() (*Organization, bool) { 7865 return nil, false 7866} 7867 7868// AsOffer is the BasicResponseBase implementation for Person. 7869func (p Person) AsOffer() (*Offer, bool) { 7870 return nil, false 7871} 7872 7873// AsBasicOffer is the BasicResponseBase implementation for Person. 7874func (p Person) AsBasicOffer() (BasicOffer, bool) { 7875 return nil, false 7876} 7877 7878// AsAggregateOffer is the BasicResponseBase implementation for Person. 7879func (p Person) AsAggregateOffer() (*AggregateOffer, bool) { 7880 return nil, false 7881} 7882 7883// AsImageObject is the BasicResponseBase implementation for Person. 7884func (p Person) AsImageObject() (*ImageObject, bool) { 7885 return nil, false 7886} 7887 7888// AsImageKnowledge is the BasicResponseBase implementation for Person. 7889func (p Person) AsImageKnowledge() (*ImageKnowledge, bool) { 7890 return nil, false 7891} 7892 7893// AsResponse is the BasicResponseBase implementation for Person. 7894func (p Person) AsResponse() (*Response, bool) { 7895 return nil, false 7896} 7897 7898// AsBasicResponse is the BasicResponseBase implementation for Person. 7899func (p Person) AsBasicResponse() (BasicResponse, bool) { 7900 return &p, true 7901} 7902 7903// AsIdentifiable is the BasicResponseBase implementation for Person. 7904func (p Person) AsIdentifiable() (*Identifiable, bool) { 7905 return nil, false 7906} 7907 7908// AsBasicIdentifiable is the BasicResponseBase implementation for Person. 7909func (p Person) AsBasicIdentifiable() (BasicIdentifiable, bool) { 7910 return &p, true 7911} 7912 7913// AsErrorResponse is the BasicResponseBase implementation for Person. 7914func (p Person) AsErrorResponse() (*ErrorResponse, bool) { 7915 return nil, false 7916} 7917 7918// AsThing is the BasicResponseBase implementation for Person. 7919func (p Person) AsThing() (*Thing, bool) { 7920 return nil, false 7921} 7922 7923// AsBasicThing is the BasicResponseBase implementation for Person. 7924func (p Person) AsBasicThing() (BasicThing, bool) { 7925 return &p, true 7926} 7927 7928// AsAction is the BasicResponseBase implementation for Person. 7929func (p Person) AsAction() (*Action, bool) { 7930 return nil, false 7931} 7932 7933// AsBasicAction is the BasicResponseBase implementation for Person. 7934func (p Person) AsBasicAction() (BasicAction, bool) { 7935 return nil, false 7936} 7937 7938// AsMediaObject is the BasicResponseBase implementation for Person. 7939func (p Person) AsMediaObject() (*MediaObject, bool) { 7940 return nil, false 7941} 7942 7943// AsBasicMediaObject is the BasicResponseBase implementation for Person. 7944func (p Person) AsBasicMediaObject() (BasicMediaObject, bool) { 7945 return nil, false 7946} 7947 7948// AsCreativeWork is the BasicResponseBase implementation for Person. 7949func (p Person) AsCreativeWork() (*CreativeWork, bool) { 7950 return nil, false 7951} 7952 7953// AsBasicCreativeWork is the BasicResponseBase implementation for Person. 7954func (p Person) AsBasicCreativeWork() (BasicCreativeWork, bool) { 7955 return nil, false 7956} 7957 7958// AsPerson is the BasicResponseBase implementation for Person. 7959func (p Person) AsPerson() (*Person, bool) { 7960 return &p, true 7961} 7962 7963// AsIntangible is the BasicResponseBase implementation for Person. 7964func (p Person) AsIntangible() (*Intangible, bool) { 7965 return nil, false 7966} 7967 7968// AsBasicIntangible is the BasicResponseBase implementation for Person. 7969func (p Person) AsBasicIntangible() (BasicIntangible, bool) { 7970 return nil, false 7971} 7972 7973// AsImageEntityAction is the BasicResponseBase implementation for Person. 7974func (p Person) AsImageEntityAction() (*ImageEntityAction, bool) { 7975 return nil, false 7976} 7977 7978// AsImageModuleAction is the BasicResponseBase implementation for Person. 7979func (p Person) AsImageModuleAction() (*ImageModuleAction, bool) { 7980 return nil, false 7981} 7982 7983// AsRecipe is the BasicResponseBase implementation for Person. 7984func (p Person) AsRecipe() (*Recipe, bool) { 7985 return nil, false 7986} 7987 7988// AsImageRecipesAction is the BasicResponseBase implementation for Person. 7989func (p Person) AsImageRecipesAction() (*ImageRecipesAction, bool) { 7990 return nil, false 7991} 7992 7993// AsImageRelatedSearchesAction is the BasicResponseBase implementation for Person. 7994func (p Person) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 7995 return nil, false 7996} 7997 7998// AsImageShoppingSourcesAction is the BasicResponseBase implementation for Person. 7999func (p Person) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 8000 return nil, false 8001} 8002 8003// AsStructuredValue is the BasicResponseBase implementation for Person. 8004func (p Person) AsStructuredValue() (*StructuredValue, bool) { 8005 return nil, false 8006} 8007 8008// AsBasicStructuredValue is the BasicResponseBase implementation for Person. 8009func (p Person) AsBasicStructuredValue() (BasicStructuredValue, bool) { 8010 return nil, false 8011} 8012 8013// AsResponseBase is the BasicResponseBase implementation for Person. 8014func (p Person) AsResponseBase() (*ResponseBase, bool) { 8015 return nil, false 8016} 8017 8018// AsBasicResponseBase is the BasicResponseBase implementation for Person. 8019func (p Person) AsBasicResponseBase() (BasicResponseBase, bool) { 8020 return &p, true 8021} 8022 8023// Point2D defines a 2D point with X and Y coordinates. 8024type Point2D struct { 8025 // X - The x-coordinate of the point. 8026 X *float64 `json:"x,omitempty"` 8027 // Y - The y-coordinate of the point. 8028 Y *float64 `json:"y,omitempty"` 8029 // Name - READ-ONLY; The name of the thing represented by this object. 8030 Name *string `json:"name,omitempty"` 8031 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 8032 URL *string `json:"url,omitempty"` 8033 // Image - READ-ONLY; An image of the item. 8034 Image *ImageObject `json:"image,omitempty"` 8035 // Description - READ-ONLY; A short description of the item. 8036 Description *string `json:"description,omitempty"` 8037 // AlternateName - READ-ONLY; An alias for the item. 8038 AlternateName *string `json:"alternateName,omitempty"` 8039 // BingID - READ-ONLY; An ID that uniquely identifies this item. 8040 BingID *string `json:"bingId,omitempty"` 8041 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 8042 ReadLink *string `json:"readLink,omitempty"` 8043 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 8044 WebSearchURL *string `json:"webSearchUrl,omitempty"` 8045 // ID - READ-ONLY; A String identifier. 8046 ID *string `json:"id,omitempty"` 8047 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 8048 Type Type `json:"_type,omitempty"` 8049} 8050 8051// MarshalJSON is the custom marshaler for Point2D. 8052func (p2 Point2D) MarshalJSON() ([]byte, error) { 8053 p2.Type = TypePoint2D 8054 objectMap := make(map[string]interface{}) 8055 if p2.X != nil { 8056 objectMap["x"] = p2.X 8057 } 8058 if p2.Y != nil { 8059 objectMap["y"] = p2.Y 8060 } 8061 if p2.Type != "" { 8062 objectMap["_type"] = p2.Type 8063 } 8064 return json.Marshal(objectMap) 8065} 8066 8067// AsPoint2D is the BasicResponseBase implementation for Point2D. 8068func (p2 Point2D) AsPoint2D() (*Point2D, bool) { 8069 return &p2, true 8070} 8071 8072// AsNormalizedQuadrilateral is the BasicResponseBase implementation for Point2D. 8073func (p2 Point2D) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 8074 return nil, false 8075} 8076 8077// AsImageAction is the BasicResponseBase implementation for Point2D. 8078func (p2 Point2D) AsImageAction() (*ImageAction, bool) { 8079 return nil, false 8080} 8081 8082// AsBasicImageAction is the BasicResponseBase implementation for Point2D. 8083func (p2 Point2D) AsBasicImageAction() (BasicImageAction, bool) { 8084 return nil, false 8085} 8086 8087// AsImageTag is the BasicResponseBase implementation for Point2D. 8088func (p2 Point2D) AsImageTag() (*ImageTag, bool) { 8089 return nil, false 8090} 8091 8092// AsOrganization is the BasicResponseBase implementation for Point2D. 8093func (p2 Point2D) AsOrganization() (*Organization, bool) { 8094 return nil, false 8095} 8096 8097// AsOffer is the BasicResponseBase implementation for Point2D. 8098func (p2 Point2D) AsOffer() (*Offer, bool) { 8099 return nil, false 8100} 8101 8102// AsBasicOffer is the BasicResponseBase implementation for Point2D. 8103func (p2 Point2D) AsBasicOffer() (BasicOffer, bool) { 8104 return nil, false 8105} 8106 8107// AsAggregateOffer is the BasicResponseBase implementation for Point2D. 8108func (p2 Point2D) AsAggregateOffer() (*AggregateOffer, bool) { 8109 return nil, false 8110} 8111 8112// AsImageObject is the BasicResponseBase implementation for Point2D. 8113func (p2 Point2D) AsImageObject() (*ImageObject, bool) { 8114 return nil, false 8115} 8116 8117// AsImageKnowledge is the BasicResponseBase implementation for Point2D. 8118func (p2 Point2D) AsImageKnowledge() (*ImageKnowledge, bool) { 8119 return nil, false 8120} 8121 8122// AsResponse is the BasicResponseBase implementation for Point2D. 8123func (p2 Point2D) AsResponse() (*Response, bool) { 8124 return nil, false 8125} 8126 8127// AsBasicResponse is the BasicResponseBase implementation for Point2D. 8128func (p2 Point2D) AsBasicResponse() (BasicResponse, bool) { 8129 return &p2, true 8130} 8131 8132// AsIdentifiable is the BasicResponseBase implementation for Point2D. 8133func (p2 Point2D) AsIdentifiable() (*Identifiable, bool) { 8134 return nil, false 8135} 8136 8137// AsBasicIdentifiable is the BasicResponseBase implementation for Point2D. 8138func (p2 Point2D) AsBasicIdentifiable() (BasicIdentifiable, bool) { 8139 return &p2, true 8140} 8141 8142// AsErrorResponse is the BasicResponseBase implementation for Point2D. 8143func (p2 Point2D) AsErrorResponse() (*ErrorResponse, bool) { 8144 return nil, false 8145} 8146 8147// AsThing is the BasicResponseBase implementation for Point2D. 8148func (p2 Point2D) AsThing() (*Thing, bool) { 8149 return nil, false 8150} 8151 8152// AsBasicThing is the BasicResponseBase implementation for Point2D. 8153func (p2 Point2D) AsBasicThing() (BasicThing, bool) { 8154 return &p2, true 8155} 8156 8157// AsAction is the BasicResponseBase implementation for Point2D. 8158func (p2 Point2D) AsAction() (*Action, bool) { 8159 return nil, false 8160} 8161 8162// AsBasicAction is the BasicResponseBase implementation for Point2D. 8163func (p2 Point2D) AsBasicAction() (BasicAction, bool) { 8164 return nil, false 8165} 8166 8167// AsMediaObject is the BasicResponseBase implementation for Point2D. 8168func (p2 Point2D) AsMediaObject() (*MediaObject, bool) { 8169 return nil, false 8170} 8171 8172// AsBasicMediaObject is the BasicResponseBase implementation for Point2D. 8173func (p2 Point2D) AsBasicMediaObject() (BasicMediaObject, bool) { 8174 return nil, false 8175} 8176 8177// AsCreativeWork is the BasicResponseBase implementation for Point2D. 8178func (p2 Point2D) AsCreativeWork() (*CreativeWork, bool) { 8179 return nil, false 8180} 8181 8182// AsBasicCreativeWork is the BasicResponseBase implementation for Point2D. 8183func (p2 Point2D) AsBasicCreativeWork() (BasicCreativeWork, bool) { 8184 return nil, false 8185} 8186 8187// AsPerson is the BasicResponseBase implementation for Point2D. 8188func (p2 Point2D) AsPerson() (*Person, bool) { 8189 return nil, false 8190} 8191 8192// AsIntangible is the BasicResponseBase implementation for Point2D. 8193func (p2 Point2D) AsIntangible() (*Intangible, bool) { 8194 return nil, false 8195} 8196 8197// AsBasicIntangible is the BasicResponseBase implementation for Point2D. 8198func (p2 Point2D) AsBasicIntangible() (BasicIntangible, bool) { 8199 return &p2, true 8200} 8201 8202// AsImageEntityAction is the BasicResponseBase implementation for Point2D. 8203func (p2 Point2D) AsImageEntityAction() (*ImageEntityAction, bool) { 8204 return nil, false 8205} 8206 8207// AsImageModuleAction is the BasicResponseBase implementation for Point2D. 8208func (p2 Point2D) AsImageModuleAction() (*ImageModuleAction, bool) { 8209 return nil, false 8210} 8211 8212// AsRecipe is the BasicResponseBase implementation for Point2D. 8213func (p2 Point2D) AsRecipe() (*Recipe, bool) { 8214 return nil, false 8215} 8216 8217// AsImageRecipesAction is the BasicResponseBase implementation for Point2D. 8218func (p2 Point2D) AsImageRecipesAction() (*ImageRecipesAction, bool) { 8219 return nil, false 8220} 8221 8222// AsImageRelatedSearchesAction is the BasicResponseBase implementation for Point2D. 8223func (p2 Point2D) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 8224 return nil, false 8225} 8226 8227// AsImageShoppingSourcesAction is the BasicResponseBase implementation for Point2D. 8228func (p2 Point2D) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 8229 return nil, false 8230} 8231 8232// AsStructuredValue is the BasicResponseBase implementation for Point2D. 8233func (p2 Point2D) AsStructuredValue() (*StructuredValue, bool) { 8234 return nil, false 8235} 8236 8237// AsBasicStructuredValue is the BasicResponseBase implementation for Point2D. 8238func (p2 Point2D) AsBasicStructuredValue() (BasicStructuredValue, bool) { 8239 return &p2, true 8240} 8241 8242// AsResponseBase is the BasicResponseBase implementation for Point2D. 8243func (p2 Point2D) AsResponseBase() (*ResponseBase, bool) { 8244 return nil, false 8245} 8246 8247// AsBasicResponseBase is the BasicResponseBase implementation for Point2D. 8248func (p2 Point2D) AsBasicResponseBase() (BasicResponseBase, bool) { 8249 return &p2, true 8250} 8251 8252// BasicPropertiesItem defines an item. 8253type BasicPropertiesItem interface { 8254 AsAggregateRating() (*AggregateRating, bool) 8255 AsRating() (*Rating, bool) 8256 AsBasicRating() (BasicRating, bool) 8257 AsPropertiesItem() (*PropertiesItem, bool) 8258} 8259 8260// PropertiesItem defines an item. 8261type PropertiesItem struct { 8262 // Text - READ-ONLY; Text representation of an item. 8263 Text *string `json:"text,omitempty"` 8264 // Type - Possible values include: 'TypePropertiesItem', 'TypeAggregateRating', 'TypeRating' 8265 Type TypeBasicPropertiesItem `json:"_type,omitempty"` 8266} 8267 8268func unmarshalBasicPropertiesItem(body []byte) (BasicPropertiesItem, error) { 8269 var m map[string]interface{} 8270 err := json.Unmarshal(body, &m) 8271 if err != nil { 8272 return nil, err 8273 } 8274 8275 switch m["_type"] { 8276 case string(TypeAggregateRating): 8277 var ar AggregateRating 8278 err := json.Unmarshal(body, &ar) 8279 return ar, err 8280 case string(TypeRating): 8281 var r Rating 8282 err := json.Unmarshal(body, &r) 8283 return r, err 8284 default: 8285 var pi PropertiesItem 8286 err := json.Unmarshal(body, &pi) 8287 return pi, err 8288 } 8289} 8290func unmarshalBasicPropertiesItemArray(body []byte) ([]BasicPropertiesItem, error) { 8291 var rawMessages []*json.RawMessage 8292 err := json.Unmarshal(body, &rawMessages) 8293 if err != nil { 8294 return nil, err 8295 } 8296 8297 piArray := make([]BasicPropertiesItem, len(rawMessages)) 8298 8299 for index, rawMessage := range rawMessages { 8300 pi, err := unmarshalBasicPropertiesItem(*rawMessage) 8301 if err != nil { 8302 return nil, err 8303 } 8304 piArray[index] = pi 8305 } 8306 return piArray, nil 8307} 8308 8309// MarshalJSON is the custom marshaler for PropertiesItem. 8310func (pi PropertiesItem) MarshalJSON() ([]byte, error) { 8311 pi.Type = TypePropertiesItem 8312 objectMap := make(map[string]interface{}) 8313 if pi.Type != "" { 8314 objectMap["_type"] = pi.Type 8315 } 8316 return json.Marshal(objectMap) 8317} 8318 8319// AsAggregateRating is the BasicPropertiesItem implementation for PropertiesItem. 8320func (pi PropertiesItem) AsAggregateRating() (*AggregateRating, bool) { 8321 return nil, false 8322} 8323 8324// AsRating is the BasicPropertiesItem implementation for PropertiesItem. 8325func (pi PropertiesItem) AsRating() (*Rating, bool) { 8326 return nil, false 8327} 8328 8329// AsBasicRating is the BasicPropertiesItem implementation for PropertiesItem. 8330func (pi PropertiesItem) AsBasicRating() (BasicRating, bool) { 8331 return nil, false 8332} 8333 8334// AsPropertiesItem is the BasicPropertiesItem implementation for PropertiesItem. 8335func (pi PropertiesItem) AsPropertiesItem() (*PropertiesItem, bool) { 8336 return &pi, true 8337} 8338 8339// AsBasicPropertiesItem is the BasicPropertiesItem implementation for PropertiesItem. 8340func (pi PropertiesItem) AsBasicPropertiesItem() (BasicPropertiesItem, bool) { 8341 return &pi, true 8342} 8343 8344// Query defines a search query. 8345type Query struct { 8346 // Text - The query string. Use this string as the query term in a new search request. 8347 Text *string `json:"text,omitempty"` 8348 // DisplayText - READ-ONLY; The display version of the query term. 8349 DisplayText *string `json:"displayText,omitempty"` 8350 // WebSearchURL - READ-ONLY; The URL that takes the user to the Bing search results page for the query. 8351 WebSearchURL *string `json:"webSearchUrl,omitempty"` 8352 // SearchLink - READ-ONLY; The URL that you use to get the results of the related search. Before using the URL, you must append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. Use this URL if you're displaying the results in your own user interface. Otherwise, use the webSearchUrl URL. 8353 SearchLink *string `json:"searchLink,omitempty"` 8354 // Thumbnail - READ-ONLY; The URL to a thumbnail of a related image. 8355 Thumbnail *ImageObject `json:"thumbnail,omitempty"` 8356} 8357 8358// BasicRating defines a rating. 8359type BasicRating interface { 8360 AsAggregateRating() (*AggregateRating, bool) 8361 AsRating() (*Rating, bool) 8362} 8363 8364// Rating defines a rating. 8365type Rating struct { 8366 // RatingValue - The mean (average) rating. The possible values are 1.0 through 5.0. 8367 RatingValue *float64 `json:"ratingValue,omitempty"` 8368 // BestRating - READ-ONLY; The highest rated review. The possible values are 1.0 through 5.0. 8369 BestRating *float64 `json:"bestRating,omitempty"` 8370 // Text - READ-ONLY; Text representation of an item. 8371 Text *string `json:"text,omitempty"` 8372 // Type - Possible values include: 'TypePropertiesItem', 'TypeAggregateRating', 'TypeRating' 8373 Type TypeBasicPropertiesItem `json:"_type,omitempty"` 8374} 8375 8376func unmarshalBasicRating(body []byte) (BasicRating, error) { 8377 var m map[string]interface{} 8378 err := json.Unmarshal(body, &m) 8379 if err != nil { 8380 return nil, err 8381 } 8382 8383 switch m["_type"] { 8384 case string(TypeAggregateRating): 8385 var ar AggregateRating 8386 err := json.Unmarshal(body, &ar) 8387 return ar, err 8388 default: 8389 var r Rating 8390 err := json.Unmarshal(body, &r) 8391 return r, err 8392 } 8393} 8394func unmarshalBasicRatingArray(body []byte) ([]BasicRating, error) { 8395 var rawMessages []*json.RawMessage 8396 err := json.Unmarshal(body, &rawMessages) 8397 if err != nil { 8398 return nil, err 8399 } 8400 8401 rArray := make([]BasicRating, len(rawMessages)) 8402 8403 for index, rawMessage := range rawMessages { 8404 r, err := unmarshalBasicRating(*rawMessage) 8405 if err != nil { 8406 return nil, err 8407 } 8408 rArray[index] = r 8409 } 8410 return rArray, nil 8411} 8412 8413// MarshalJSON is the custom marshaler for Rating. 8414func (r Rating) MarshalJSON() ([]byte, error) { 8415 r.Type = TypeRating 8416 objectMap := make(map[string]interface{}) 8417 if r.RatingValue != nil { 8418 objectMap["ratingValue"] = r.RatingValue 8419 } 8420 if r.Type != "" { 8421 objectMap["_type"] = r.Type 8422 } 8423 return json.Marshal(objectMap) 8424} 8425 8426// AsAggregateRating is the BasicPropertiesItem implementation for Rating. 8427func (r Rating) AsAggregateRating() (*AggregateRating, bool) { 8428 return nil, false 8429} 8430 8431// AsRating is the BasicPropertiesItem implementation for Rating. 8432func (r Rating) AsRating() (*Rating, bool) { 8433 return &r, true 8434} 8435 8436// AsBasicRating is the BasicPropertiesItem implementation for Rating. 8437func (r Rating) AsBasicRating() (BasicRating, bool) { 8438 return &r, true 8439} 8440 8441// AsPropertiesItem is the BasicPropertiesItem implementation for Rating. 8442func (r Rating) AsPropertiesItem() (*PropertiesItem, bool) { 8443 return nil, false 8444} 8445 8446// AsBasicPropertiesItem is the BasicPropertiesItem implementation for Rating. 8447func (r Rating) AsBasicPropertiesItem() (BasicPropertiesItem, bool) { 8448 return &r, true 8449} 8450 8451// Recipe defines a cooking recipe. 8452type Recipe struct { 8453 // CookTime - READ-ONLY; The amount of time the food takes to cook. For example, PT25M. For information about the time format, see http://en.wikipedia.org/wiki/ISO_8601#Durations. 8454 CookTime *string `json:"cookTime,omitempty"` 8455 // PrepTime - READ-ONLY; The amount of time required to prepare the ingredients. For example, PT15M. For information about the time format, see http://en.wikipedia.org/wiki/ISO_8601#Durations. 8456 PrepTime *string `json:"prepTime,omitempty"` 8457 // TotalTime - READ-ONLY; The total amount of time it takes to prepare and cook the recipe. For example, PT45M. For information about the time format, see http://en.wikipedia.org/wiki/ISO_8601#Durations. 8458 TotalTime *string `json:"totalTime,omitempty"` 8459 // ThumbnailURL - READ-ONLY; The URL to a thumbnail of the item. 8460 ThumbnailURL *string `json:"thumbnailUrl,omitempty"` 8461 // Provider - READ-ONLY; The source of the creative work. 8462 Provider *[]BasicThing `json:"provider,omitempty"` 8463 // DatePublished - READ-ONLY; The date on which the CreativeWork was published. 8464 DatePublished *string `json:"datePublished,omitempty"` 8465 // Text - READ-ONLY; Text content of this creative work. 8466 Text *string `json:"text,omitempty"` 8467 // Name - READ-ONLY; The name of the thing represented by this object. 8468 Name *string `json:"name,omitempty"` 8469 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 8470 URL *string `json:"url,omitempty"` 8471 // Image - READ-ONLY; An image of the item. 8472 Image *ImageObject `json:"image,omitempty"` 8473 // Description - READ-ONLY; A short description of the item. 8474 Description *string `json:"description,omitempty"` 8475 // AlternateName - READ-ONLY; An alias for the item. 8476 AlternateName *string `json:"alternateName,omitempty"` 8477 // BingID - READ-ONLY; An ID that uniquely identifies this item. 8478 BingID *string `json:"bingId,omitempty"` 8479 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 8480 ReadLink *string `json:"readLink,omitempty"` 8481 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 8482 WebSearchURL *string `json:"webSearchUrl,omitempty"` 8483 // ID - READ-ONLY; A String identifier. 8484 ID *string `json:"id,omitempty"` 8485 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 8486 Type Type `json:"_type,omitempty"` 8487} 8488 8489// MarshalJSON is the custom marshaler for Recipe. 8490func (r Recipe) MarshalJSON() ([]byte, error) { 8491 r.Type = TypeRecipe 8492 objectMap := make(map[string]interface{}) 8493 if r.Type != "" { 8494 objectMap["_type"] = r.Type 8495 } 8496 return json.Marshal(objectMap) 8497} 8498 8499// AsPoint2D is the BasicResponseBase implementation for Recipe. 8500func (r Recipe) AsPoint2D() (*Point2D, bool) { 8501 return nil, false 8502} 8503 8504// AsNormalizedQuadrilateral is the BasicResponseBase implementation for Recipe. 8505func (r Recipe) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 8506 return nil, false 8507} 8508 8509// AsImageAction is the BasicResponseBase implementation for Recipe. 8510func (r Recipe) AsImageAction() (*ImageAction, bool) { 8511 return nil, false 8512} 8513 8514// AsBasicImageAction is the BasicResponseBase implementation for Recipe. 8515func (r Recipe) AsBasicImageAction() (BasicImageAction, bool) { 8516 return nil, false 8517} 8518 8519// AsImageTag is the BasicResponseBase implementation for Recipe. 8520func (r Recipe) AsImageTag() (*ImageTag, bool) { 8521 return nil, false 8522} 8523 8524// AsOrganization is the BasicResponseBase implementation for Recipe. 8525func (r Recipe) AsOrganization() (*Organization, bool) { 8526 return nil, false 8527} 8528 8529// AsOffer is the BasicResponseBase implementation for Recipe. 8530func (r Recipe) AsOffer() (*Offer, bool) { 8531 return nil, false 8532} 8533 8534// AsBasicOffer is the BasicResponseBase implementation for Recipe. 8535func (r Recipe) AsBasicOffer() (BasicOffer, bool) { 8536 return nil, false 8537} 8538 8539// AsAggregateOffer is the BasicResponseBase implementation for Recipe. 8540func (r Recipe) AsAggregateOffer() (*AggregateOffer, bool) { 8541 return nil, false 8542} 8543 8544// AsImageObject is the BasicResponseBase implementation for Recipe. 8545func (r Recipe) AsImageObject() (*ImageObject, bool) { 8546 return nil, false 8547} 8548 8549// AsImageKnowledge is the BasicResponseBase implementation for Recipe. 8550func (r Recipe) AsImageKnowledge() (*ImageKnowledge, bool) { 8551 return nil, false 8552} 8553 8554// AsResponse is the BasicResponseBase implementation for Recipe. 8555func (r Recipe) AsResponse() (*Response, bool) { 8556 return nil, false 8557} 8558 8559// AsBasicResponse is the BasicResponseBase implementation for Recipe. 8560func (r Recipe) AsBasicResponse() (BasicResponse, bool) { 8561 return &r, true 8562} 8563 8564// AsIdentifiable is the BasicResponseBase implementation for Recipe. 8565func (r Recipe) AsIdentifiable() (*Identifiable, bool) { 8566 return nil, false 8567} 8568 8569// AsBasicIdentifiable is the BasicResponseBase implementation for Recipe. 8570func (r Recipe) AsBasicIdentifiable() (BasicIdentifiable, bool) { 8571 return &r, true 8572} 8573 8574// AsErrorResponse is the BasicResponseBase implementation for Recipe. 8575func (r Recipe) AsErrorResponse() (*ErrorResponse, bool) { 8576 return nil, false 8577} 8578 8579// AsThing is the BasicResponseBase implementation for Recipe. 8580func (r Recipe) AsThing() (*Thing, bool) { 8581 return nil, false 8582} 8583 8584// AsBasicThing is the BasicResponseBase implementation for Recipe. 8585func (r Recipe) AsBasicThing() (BasicThing, bool) { 8586 return &r, true 8587} 8588 8589// AsAction is the BasicResponseBase implementation for Recipe. 8590func (r Recipe) AsAction() (*Action, bool) { 8591 return nil, false 8592} 8593 8594// AsBasicAction is the BasicResponseBase implementation for Recipe. 8595func (r Recipe) AsBasicAction() (BasicAction, bool) { 8596 return nil, false 8597} 8598 8599// AsMediaObject is the BasicResponseBase implementation for Recipe. 8600func (r Recipe) AsMediaObject() (*MediaObject, bool) { 8601 return nil, false 8602} 8603 8604// AsBasicMediaObject is the BasicResponseBase implementation for Recipe. 8605func (r Recipe) AsBasicMediaObject() (BasicMediaObject, bool) { 8606 return nil, false 8607} 8608 8609// AsCreativeWork is the BasicResponseBase implementation for Recipe. 8610func (r Recipe) AsCreativeWork() (*CreativeWork, bool) { 8611 return nil, false 8612} 8613 8614// AsBasicCreativeWork is the BasicResponseBase implementation for Recipe. 8615func (r Recipe) AsBasicCreativeWork() (BasicCreativeWork, bool) { 8616 return &r, true 8617} 8618 8619// AsPerson is the BasicResponseBase implementation for Recipe. 8620func (r Recipe) AsPerson() (*Person, bool) { 8621 return nil, false 8622} 8623 8624// AsIntangible is the BasicResponseBase implementation for Recipe. 8625func (r Recipe) AsIntangible() (*Intangible, bool) { 8626 return nil, false 8627} 8628 8629// AsBasicIntangible is the BasicResponseBase implementation for Recipe. 8630func (r Recipe) AsBasicIntangible() (BasicIntangible, bool) { 8631 return nil, false 8632} 8633 8634// AsImageEntityAction is the BasicResponseBase implementation for Recipe. 8635func (r Recipe) AsImageEntityAction() (*ImageEntityAction, bool) { 8636 return nil, false 8637} 8638 8639// AsImageModuleAction is the BasicResponseBase implementation for Recipe. 8640func (r Recipe) AsImageModuleAction() (*ImageModuleAction, bool) { 8641 return nil, false 8642} 8643 8644// AsRecipe is the BasicResponseBase implementation for Recipe. 8645func (r Recipe) AsRecipe() (*Recipe, bool) { 8646 return &r, true 8647} 8648 8649// AsImageRecipesAction is the BasicResponseBase implementation for Recipe. 8650func (r Recipe) AsImageRecipesAction() (*ImageRecipesAction, bool) { 8651 return nil, false 8652} 8653 8654// AsImageRelatedSearchesAction is the BasicResponseBase implementation for Recipe. 8655func (r Recipe) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 8656 return nil, false 8657} 8658 8659// AsImageShoppingSourcesAction is the BasicResponseBase implementation for Recipe. 8660func (r Recipe) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 8661 return nil, false 8662} 8663 8664// AsStructuredValue is the BasicResponseBase implementation for Recipe. 8665func (r Recipe) AsStructuredValue() (*StructuredValue, bool) { 8666 return nil, false 8667} 8668 8669// AsBasicStructuredValue is the BasicResponseBase implementation for Recipe. 8670func (r Recipe) AsBasicStructuredValue() (BasicStructuredValue, bool) { 8671 return nil, false 8672} 8673 8674// AsResponseBase is the BasicResponseBase implementation for Recipe. 8675func (r Recipe) AsResponseBase() (*ResponseBase, bool) { 8676 return nil, false 8677} 8678 8679// AsBasicResponseBase is the BasicResponseBase implementation for Recipe. 8680func (r Recipe) AsBasicResponseBase() (BasicResponseBase, bool) { 8681 return &r, true 8682} 8683 8684// UnmarshalJSON is the custom unmarshaler for Recipe struct. 8685func (r *Recipe) UnmarshalJSON(body []byte) error { 8686 var m map[string]*json.RawMessage 8687 err := json.Unmarshal(body, &m) 8688 if err != nil { 8689 return err 8690 } 8691 for k, v := range m { 8692 switch k { 8693 case "cookTime": 8694 if v != nil { 8695 var cookTime string 8696 err = json.Unmarshal(*v, &cookTime) 8697 if err != nil { 8698 return err 8699 } 8700 r.CookTime = &cookTime 8701 } 8702 case "prepTime": 8703 if v != nil { 8704 var prepTime string 8705 err = json.Unmarshal(*v, &prepTime) 8706 if err != nil { 8707 return err 8708 } 8709 r.PrepTime = &prepTime 8710 } 8711 case "totalTime": 8712 if v != nil { 8713 var totalTime string 8714 err = json.Unmarshal(*v, &totalTime) 8715 if err != nil { 8716 return err 8717 } 8718 r.TotalTime = &totalTime 8719 } 8720 case "thumbnailUrl": 8721 if v != nil { 8722 var thumbnailURL string 8723 err = json.Unmarshal(*v, &thumbnailURL) 8724 if err != nil { 8725 return err 8726 } 8727 r.ThumbnailURL = &thumbnailURL 8728 } 8729 case "provider": 8730 if v != nil { 8731 provider, err := unmarshalBasicThingArray(*v) 8732 if err != nil { 8733 return err 8734 } 8735 r.Provider = &provider 8736 } 8737 case "datePublished": 8738 if v != nil { 8739 var datePublished string 8740 err = json.Unmarshal(*v, &datePublished) 8741 if err != nil { 8742 return err 8743 } 8744 r.DatePublished = &datePublished 8745 } 8746 case "text": 8747 if v != nil { 8748 var textVar string 8749 err = json.Unmarshal(*v, &textVar) 8750 if err != nil { 8751 return err 8752 } 8753 r.Text = &textVar 8754 } 8755 case "name": 8756 if v != nil { 8757 var name string 8758 err = json.Unmarshal(*v, &name) 8759 if err != nil { 8760 return err 8761 } 8762 r.Name = &name 8763 } 8764 case "url": 8765 if v != nil { 8766 var URL string 8767 err = json.Unmarshal(*v, &URL) 8768 if err != nil { 8769 return err 8770 } 8771 r.URL = &URL 8772 } 8773 case "image": 8774 if v != nil { 8775 var imageVar ImageObject 8776 err = json.Unmarshal(*v, &imageVar) 8777 if err != nil { 8778 return err 8779 } 8780 r.Image = &imageVar 8781 } 8782 case "description": 8783 if v != nil { 8784 var description string 8785 err = json.Unmarshal(*v, &description) 8786 if err != nil { 8787 return err 8788 } 8789 r.Description = &description 8790 } 8791 case "alternateName": 8792 if v != nil { 8793 var alternateName string 8794 err = json.Unmarshal(*v, &alternateName) 8795 if err != nil { 8796 return err 8797 } 8798 r.AlternateName = &alternateName 8799 } 8800 case "bingId": 8801 if v != nil { 8802 var bingID string 8803 err = json.Unmarshal(*v, &bingID) 8804 if err != nil { 8805 return err 8806 } 8807 r.BingID = &bingID 8808 } 8809 case "readLink": 8810 if v != nil { 8811 var readLink string 8812 err = json.Unmarshal(*v, &readLink) 8813 if err != nil { 8814 return err 8815 } 8816 r.ReadLink = &readLink 8817 } 8818 case "webSearchUrl": 8819 if v != nil { 8820 var webSearchURL string 8821 err = json.Unmarshal(*v, &webSearchURL) 8822 if err != nil { 8823 return err 8824 } 8825 r.WebSearchURL = &webSearchURL 8826 } 8827 case "id": 8828 if v != nil { 8829 var ID string 8830 err = json.Unmarshal(*v, &ID) 8831 if err != nil { 8832 return err 8833 } 8834 r.ID = &ID 8835 } 8836 case "_type": 8837 if v != nil { 8838 var typeVar Type 8839 err = json.Unmarshal(*v, &typeVar) 8840 if err != nil { 8841 return err 8842 } 8843 r.Type = typeVar 8844 } 8845 } 8846 } 8847 8848 return nil 8849} 8850 8851// RecipesModule defines a list of recipes. 8852type RecipesModule struct { 8853 // Value - READ-ONLY; A list of recipes. 8854 Value *[]Recipe `json:"value,omitempty"` 8855} 8856 8857// RelatedSearchesModule defines a list of related searches. 8858type RelatedSearchesModule struct { 8859 // Value - READ-ONLY; A list of related searches. 8860 Value *[]Query `json:"value,omitempty"` 8861} 8862 8863// Request a JSON object that contains information about the image to get insights of. Specify this object 8864// only in a knowledgeRequest form data. 8865type Request struct { 8866 // ImageInfo - A JSON object that identities the image to get insights of. 8867 ImageInfo *ImageInfo `json:"imageInfo,omitempty"` 8868 // KnowledgeRequest - A JSON object containing information about the request, such as filters, or a description. 8869 KnowledgeRequest *KnowledgeRequest `json:"knowledgeRequest,omitempty"` 8870} 8871 8872// BasicResponse defines a response. All schemas that return at the root of the response must inherit from this object. 8873type BasicResponse interface { 8874 AsPoint2D() (*Point2D, bool) 8875 AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) 8876 AsImageAction() (*ImageAction, bool) 8877 AsBasicImageAction() (BasicImageAction, bool) 8878 AsImageTag() (*ImageTag, bool) 8879 AsOrganization() (*Organization, bool) 8880 AsOffer() (*Offer, bool) 8881 AsBasicOffer() (BasicOffer, bool) 8882 AsAggregateOffer() (*AggregateOffer, bool) 8883 AsImageObject() (*ImageObject, bool) 8884 AsImageKnowledge() (*ImageKnowledge, bool) 8885 AsErrorResponse() (*ErrorResponse, bool) 8886 AsThing() (*Thing, bool) 8887 AsBasicThing() (BasicThing, bool) 8888 AsAction() (*Action, bool) 8889 AsBasicAction() (BasicAction, bool) 8890 AsMediaObject() (*MediaObject, bool) 8891 AsBasicMediaObject() (BasicMediaObject, bool) 8892 AsCreativeWork() (*CreativeWork, bool) 8893 AsBasicCreativeWork() (BasicCreativeWork, bool) 8894 AsPerson() (*Person, bool) 8895 AsIntangible() (*Intangible, bool) 8896 AsBasicIntangible() (BasicIntangible, bool) 8897 AsImageEntityAction() (*ImageEntityAction, bool) 8898 AsImageModuleAction() (*ImageModuleAction, bool) 8899 AsRecipe() (*Recipe, bool) 8900 AsImageRecipesAction() (*ImageRecipesAction, bool) 8901 AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) 8902 AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) 8903 AsStructuredValue() (*StructuredValue, bool) 8904 AsBasicStructuredValue() (BasicStructuredValue, bool) 8905 AsResponse() (*Response, bool) 8906} 8907 8908// Response defines a response. All schemas that return at the root of the response must inherit from this 8909// object. 8910type Response struct { 8911 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 8912 ReadLink *string `json:"readLink,omitempty"` 8913 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 8914 WebSearchURL *string `json:"webSearchUrl,omitempty"` 8915 // ID - READ-ONLY; A String identifier. 8916 ID *string `json:"id,omitempty"` 8917 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 8918 Type Type `json:"_type,omitempty"` 8919} 8920 8921func unmarshalBasicResponse(body []byte) (BasicResponse, error) { 8922 var m map[string]interface{} 8923 err := json.Unmarshal(body, &m) 8924 if err != nil { 8925 return nil, err 8926 } 8927 8928 switch m["_type"] { 8929 case string(TypePoint2D): 8930 var p2 Point2D 8931 err := json.Unmarshal(body, &p2) 8932 return p2, err 8933 case string(TypeNormalizedQuadrilateral): 8934 var nq NormalizedQuadrilateral 8935 err := json.Unmarshal(body, &nq) 8936 return nq, err 8937 case string(TypeImageAction): 8938 var ia ImageAction 8939 err := json.Unmarshal(body, &ia) 8940 return ia, err 8941 case string(TypeImageTag): 8942 var it ImageTag 8943 err := json.Unmarshal(body, &it) 8944 return it, err 8945 case string(TypeOrganization): 8946 var o Organization 8947 err := json.Unmarshal(body, &o) 8948 return o, err 8949 case string(TypeOffer): 8950 var o Offer 8951 err := json.Unmarshal(body, &o) 8952 return o, err 8953 case string(TypeAggregateOffer): 8954 var ao AggregateOffer 8955 err := json.Unmarshal(body, &ao) 8956 return ao, err 8957 case string(TypeImageObject): 8958 var ioVar ImageObject 8959 err := json.Unmarshal(body, &ioVar) 8960 return ioVar, err 8961 case string(TypeImageKnowledge): 8962 var ik ImageKnowledge 8963 err := json.Unmarshal(body, &ik) 8964 return ik, err 8965 case string(TypeErrorResponse): 8966 var er ErrorResponse 8967 err := json.Unmarshal(body, &er) 8968 return er, err 8969 case string(TypeThing): 8970 var t Thing 8971 err := json.Unmarshal(body, &t) 8972 return t, err 8973 case string(TypeAction): 8974 var a Action 8975 err := json.Unmarshal(body, &a) 8976 return a, err 8977 case string(TypeMediaObject): 8978 var mo MediaObject 8979 err := json.Unmarshal(body, &mo) 8980 return mo, err 8981 case string(TypeCreativeWork): 8982 var cw CreativeWork 8983 err := json.Unmarshal(body, &cw) 8984 return cw, err 8985 case string(TypePerson): 8986 var p Person 8987 err := json.Unmarshal(body, &p) 8988 return p, err 8989 case string(TypeIntangible): 8990 var i Intangible 8991 err := json.Unmarshal(body, &i) 8992 return i, err 8993 case string(TypeImageEntityAction): 8994 var iea ImageEntityAction 8995 err := json.Unmarshal(body, &iea) 8996 return iea, err 8997 case string(TypeImageModuleAction): 8998 var ima ImageModuleAction 8999 err := json.Unmarshal(body, &ima) 9000 return ima, err 9001 case string(TypeRecipe): 9002 var r Recipe 9003 err := json.Unmarshal(body, &r) 9004 return r, err 9005 case string(TypeImageRecipesAction): 9006 var ira ImageRecipesAction 9007 err := json.Unmarshal(body, &ira) 9008 return ira, err 9009 case string(TypeImageRelatedSearchesAction): 9010 var irsa ImageRelatedSearchesAction 9011 err := json.Unmarshal(body, &irsa) 9012 return irsa, err 9013 case string(TypeImageShoppingSourcesAction): 9014 var issa ImageShoppingSourcesAction 9015 err := json.Unmarshal(body, &issa) 9016 return issa, err 9017 case string(TypeStructuredValue): 9018 var sv StructuredValue 9019 err := json.Unmarshal(body, &sv) 9020 return sv, err 9021 default: 9022 var r Response 9023 err := json.Unmarshal(body, &r) 9024 return r, err 9025 } 9026} 9027func unmarshalBasicResponseArray(body []byte) ([]BasicResponse, error) { 9028 var rawMessages []*json.RawMessage 9029 err := json.Unmarshal(body, &rawMessages) 9030 if err != nil { 9031 return nil, err 9032 } 9033 9034 rArray := make([]BasicResponse, len(rawMessages)) 9035 9036 for index, rawMessage := range rawMessages { 9037 r, err := unmarshalBasicResponse(*rawMessage) 9038 if err != nil { 9039 return nil, err 9040 } 9041 rArray[index] = r 9042 } 9043 return rArray, nil 9044} 9045 9046// MarshalJSON is the custom marshaler for Response. 9047func (r Response) MarshalJSON() ([]byte, error) { 9048 r.Type = TypeResponse 9049 objectMap := make(map[string]interface{}) 9050 if r.Type != "" { 9051 objectMap["_type"] = r.Type 9052 } 9053 return json.Marshal(objectMap) 9054} 9055 9056// AsPoint2D is the BasicResponseBase implementation for Response. 9057func (r Response) AsPoint2D() (*Point2D, bool) { 9058 return nil, false 9059} 9060 9061// AsNormalizedQuadrilateral is the BasicResponseBase implementation for Response. 9062func (r Response) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 9063 return nil, false 9064} 9065 9066// AsImageAction is the BasicResponseBase implementation for Response. 9067func (r Response) AsImageAction() (*ImageAction, bool) { 9068 return nil, false 9069} 9070 9071// AsBasicImageAction is the BasicResponseBase implementation for Response. 9072func (r Response) AsBasicImageAction() (BasicImageAction, bool) { 9073 return nil, false 9074} 9075 9076// AsImageTag is the BasicResponseBase implementation for Response. 9077func (r Response) AsImageTag() (*ImageTag, bool) { 9078 return nil, false 9079} 9080 9081// AsOrganization is the BasicResponseBase implementation for Response. 9082func (r Response) AsOrganization() (*Organization, bool) { 9083 return nil, false 9084} 9085 9086// AsOffer is the BasicResponseBase implementation for Response. 9087func (r Response) AsOffer() (*Offer, bool) { 9088 return nil, false 9089} 9090 9091// AsBasicOffer is the BasicResponseBase implementation for Response. 9092func (r Response) AsBasicOffer() (BasicOffer, bool) { 9093 return nil, false 9094} 9095 9096// AsAggregateOffer is the BasicResponseBase implementation for Response. 9097func (r Response) AsAggregateOffer() (*AggregateOffer, bool) { 9098 return nil, false 9099} 9100 9101// AsImageObject is the BasicResponseBase implementation for Response. 9102func (r Response) AsImageObject() (*ImageObject, bool) { 9103 return nil, false 9104} 9105 9106// AsImageKnowledge is the BasicResponseBase implementation for Response. 9107func (r Response) AsImageKnowledge() (*ImageKnowledge, bool) { 9108 return nil, false 9109} 9110 9111// AsResponse is the BasicResponseBase implementation for Response. 9112func (r Response) AsResponse() (*Response, bool) { 9113 return &r, true 9114} 9115 9116// AsBasicResponse is the BasicResponseBase implementation for Response. 9117func (r Response) AsBasicResponse() (BasicResponse, bool) { 9118 return &r, true 9119} 9120 9121// AsIdentifiable is the BasicResponseBase implementation for Response. 9122func (r Response) AsIdentifiable() (*Identifiable, bool) { 9123 return nil, false 9124} 9125 9126// AsBasicIdentifiable is the BasicResponseBase implementation for Response. 9127func (r Response) AsBasicIdentifiable() (BasicIdentifiable, bool) { 9128 return &r, true 9129} 9130 9131// AsErrorResponse is the BasicResponseBase implementation for Response. 9132func (r Response) AsErrorResponse() (*ErrorResponse, bool) { 9133 return nil, false 9134} 9135 9136// AsThing is the BasicResponseBase implementation for Response. 9137func (r Response) AsThing() (*Thing, bool) { 9138 return nil, false 9139} 9140 9141// AsBasicThing is the BasicResponseBase implementation for Response. 9142func (r Response) AsBasicThing() (BasicThing, bool) { 9143 return nil, false 9144} 9145 9146// AsAction is the BasicResponseBase implementation for Response. 9147func (r Response) AsAction() (*Action, bool) { 9148 return nil, false 9149} 9150 9151// AsBasicAction is the BasicResponseBase implementation for Response. 9152func (r Response) AsBasicAction() (BasicAction, bool) { 9153 return nil, false 9154} 9155 9156// AsMediaObject is the BasicResponseBase implementation for Response. 9157func (r Response) AsMediaObject() (*MediaObject, bool) { 9158 return nil, false 9159} 9160 9161// AsBasicMediaObject is the BasicResponseBase implementation for Response. 9162func (r Response) AsBasicMediaObject() (BasicMediaObject, bool) { 9163 return nil, false 9164} 9165 9166// AsCreativeWork is the BasicResponseBase implementation for Response. 9167func (r Response) AsCreativeWork() (*CreativeWork, bool) { 9168 return nil, false 9169} 9170 9171// AsBasicCreativeWork is the BasicResponseBase implementation for Response. 9172func (r Response) AsBasicCreativeWork() (BasicCreativeWork, bool) { 9173 return nil, false 9174} 9175 9176// AsPerson is the BasicResponseBase implementation for Response. 9177func (r Response) AsPerson() (*Person, bool) { 9178 return nil, false 9179} 9180 9181// AsIntangible is the BasicResponseBase implementation for Response. 9182func (r Response) AsIntangible() (*Intangible, bool) { 9183 return nil, false 9184} 9185 9186// AsBasicIntangible is the BasicResponseBase implementation for Response. 9187func (r Response) AsBasicIntangible() (BasicIntangible, bool) { 9188 return nil, false 9189} 9190 9191// AsImageEntityAction is the BasicResponseBase implementation for Response. 9192func (r Response) AsImageEntityAction() (*ImageEntityAction, bool) { 9193 return nil, false 9194} 9195 9196// AsImageModuleAction is the BasicResponseBase implementation for Response. 9197func (r Response) AsImageModuleAction() (*ImageModuleAction, bool) { 9198 return nil, false 9199} 9200 9201// AsRecipe is the BasicResponseBase implementation for Response. 9202func (r Response) AsRecipe() (*Recipe, bool) { 9203 return nil, false 9204} 9205 9206// AsImageRecipesAction is the BasicResponseBase implementation for Response. 9207func (r Response) AsImageRecipesAction() (*ImageRecipesAction, bool) { 9208 return nil, false 9209} 9210 9211// AsImageRelatedSearchesAction is the BasicResponseBase implementation for Response. 9212func (r Response) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 9213 return nil, false 9214} 9215 9216// AsImageShoppingSourcesAction is the BasicResponseBase implementation for Response. 9217func (r Response) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 9218 return nil, false 9219} 9220 9221// AsStructuredValue is the BasicResponseBase implementation for Response. 9222func (r Response) AsStructuredValue() (*StructuredValue, bool) { 9223 return nil, false 9224} 9225 9226// AsBasicStructuredValue is the BasicResponseBase implementation for Response. 9227func (r Response) AsBasicStructuredValue() (BasicStructuredValue, bool) { 9228 return nil, false 9229} 9230 9231// AsResponseBase is the BasicResponseBase implementation for Response. 9232func (r Response) AsResponseBase() (*ResponseBase, bool) { 9233 return nil, false 9234} 9235 9236// AsBasicResponseBase is the BasicResponseBase implementation for Response. 9237func (r Response) AsBasicResponseBase() (BasicResponseBase, bool) { 9238 return &r, true 9239} 9240 9241// BasicResponseBase response base. 9242type BasicResponseBase interface { 9243 AsPoint2D() (*Point2D, bool) 9244 AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) 9245 AsImageAction() (*ImageAction, bool) 9246 AsBasicImageAction() (BasicImageAction, bool) 9247 AsImageTag() (*ImageTag, bool) 9248 AsOrganization() (*Organization, bool) 9249 AsOffer() (*Offer, bool) 9250 AsBasicOffer() (BasicOffer, bool) 9251 AsAggregateOffer() (*AggregateOffer, bool) 9252 AsImageObject() (*ImageObject, bool) 9253 AsImageKnowledge() (*ImageKnowledge, bool) 9254 AsResponse() (*Response, bool) 9255 AsBasicResponse() (BasicResponse, bool) 9256 AsIdentifiable() (*Identifiable, bool) 9257 AsBasicIdentifiable() (BasicIdentifiable, bool) 9258 AsErrorResponse() (*ErrorResponse, bool) 9259 AsThing() (*Thing, bool) 9260 AsBasicThing() (BasicThing, bool) 9261 AsAction() (*Action, bool) 9262 AsBasicAction() (BasicAction, bool) 9263 AsMediaObject() (*MediaObject, bool) 9264 AsBasicMediaObject() (BasicMediaObject, bool) 9265 AsCreativeWork() (*CreativeWork, bool) 9266 AsBasicCreativeWork() (BasicCreativeWork, bool) 9267 AsPerson() (*Person, bool) 9268 AsIntangible() (*Intangible, bool) 9269 AsBasicIntangible() (BasicIntangible, bool) 9270 AsImageEntityAction() (*ImageEntityAction, bool) 9271 AsImageModuleAction() (*ImageModuleAction, bool) 9272 AsRecipe() (*Recipe, bool) 9273 AsImageRecipesAction() (*ImageRecipesAction, bool) 9274 AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) 9275 AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) 9276 AsStructuredValue() (*StructuredValue, bool) 9277 AsBasicStructuredValue() (BasicStructuredValue, bool) 9278 AsResponseBase() (*ResponseBase, bool) 9279} 9280 9281// ResponseBase response base. 9282type ResponseBase struct { 9283 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 9284 Type Type `json:"_type,omitempty"` 9285} 9286 9287func unmarshalBasicResponseBase(body []byte) (BasicResponseBase, error) { 9288 var m map[string]interface{} 9289 err := json.Unmarshal(body, &m) 9290 if err != nil { 9291 return nil, err 9292 } 9293 9294 switch m["_type"] { 9295 case string(TypePoint2D): 9296 var p2 Point2D 9297 err := json.Unmarshal(body, &p2) 9298 return p2, err 9299 case string(TypeNormalizedQuadrilateral): 9300 var nq NormalizedQuadrilateral 9301 err := json.Unmarshal(body, &nq) 9302 return nq, err 9303 case string(TypeImageAction): 9304 var ia ImageAction 9305 err := json.Unmarshal(body, &ia) 9306 return ia, err 9307 case string(TypeImageTag): 9308 var it ImageTag 9309 err := json.Unmarshal(body, &it) 9310 return it, err 9311 case string(TypeOrganization): 9312 var o Organization 9313 err := json.Unmarshal(body, &o) 9314 return o, err 9315 case string(TypeOffer): 9316 var o Offer 9317 err := json.Unmarshal(body, &o) 9318 return o, err 9319 case string(TypeAggregateOffer): 9320 var ao AggregateOffer 9321 err := json.Unmarshal(body, &ao) 9322 return ao, err 9323 case string(TypeImageObject): 9324 var ioVar ImageObject 9325 err := json.Unmarshal(body, &ioVar) 9326 return ioVar, err 9327 case string(TypeImageKnowledge): 9328 var ik ImageKnowledge 9329 err := json.Unmarshal(body, &ik) 9330 return ik, err 9331 case string(TypeResponse): 9332 var r Response 9333 err := json.Unmarshal(body, &r) 9334 return r, err 9335 case string(TypeIdentifiable): 9336 var i Identifiable 9337 err := json.Unmarshal(body, &i) 9338 return i, err 9339 case string(TypeErrorResponse): 9340 var er ErrorResponse 9341 err := json.Unmarshal(body, &er) 9342 return er, err 9343 case string(TypeThing): 9344 var t Thing 9345 err := json.Unmarshal(body, &t) 9346 return t, err 9347 case string(TypeAction): 9348 var a Action 9349 err := json.Unmarshal(body, &a) 9350 return a, err 9351 case string(TypeMediaObject): 9352 var mo MediaObject 9353 err := json.Unmarshal(body, &mo) 9354 return mo, err 9355 case string(TypeCreativeWork): 9356 var cw CreativeWork 9357 err := json.Unmarshal(body, &cw) 9358 return cw, err 9359 case string(TypePerson): 9360 var p Person 9361 err := json.Unmarshal(body, &p) 9362 return p, err 9363 case string(TypeIntangible): 9364 var i Intangible 9365 err := json.Unmarshal(body, &i) 9366 return i, err 9367 case string(TypeImageEntityAction): 9368 var iea ImageEntityAction 9369 err := json.Unmarshal(body, &iea) 9370 return iea, err 9371 case string(TypeImageModuleAction): 9372 var ima ImageModuleAction 9373 err := json.Unmarshal(body, &ima) 9374 return ima, err 9375 case string(TypeRecipe): 9376 var r Recipe 9377 err := json.Unmarshal(body, &r) 9378 return r, err 9379 case string(TypeImageRecipesAction): 9380 var ira ImageRecipesAction 9381 err := json.Unmarshal(body, &ira) 9382 return ira, err 9383 case string(TypeImageRelatedSearchesAction): 9384 var irsa ImageRelatedSearchesAction 9385 err := json.Unmarshal(body, &irsa) 9386 return irsa, err 9387 case string(TypeImageShoppingSourcesAction): 9388 var issa ImageShoppingSourcesAction 9389 err := json.Unmarshal(body, &issa) 9390 return issa, err 9391 case string(TypeStructuredValue): 9392 var sv StructuredValue 9393 err := json.Unmarshal(body, &sv) 9394 return sv, err 9395 default: 9396 var rb ResponseBase 9397 err := json.Unmarshal(body, &rb) 9398 return rb, err 9399 } 9400} 9401func unmarshalBasicResponseBaseArray(body []byte) ([]BasicResponseBase, error) { 9402 var rawMessages []*json.RawMessage 9403 err := json.Unmarshal(body, &rawMessages) 9404 if err != nil { 9405 return nil, err 9406 } 9407 9408 rbArray := make([]BasicResponseBase, len(rawMessages)) 9409 9410 for index, rawMessage := range rawMessages { 9411 rb, err := unmarshalBasicResponseBase(*rawMessage) 9412 if err != nil { 9413 return nil, err 9414 } 9415 rbArray[index] = rb 9416 } 9417 return rbArray, nil 9418} 9419 9420// MarshalJSON is the custom marshaler for ResponseBase. 9421func (rb ResponseBase) MarshalJSON() ([]byte, error) { 9422 rb.Type = TypeResponseBase 9423 objectMap := make(map[string]interface{}) 9424 if rb.Type != "" { 9425 objectMap["_type"] = rb.Type 9426 } 9427 return json.Marshal(objectMap) 9428} 9429 9430// AsPoint2D is the BasicResponseBase implementation for ResponseBase. 9431func (rb ResponseBase) AsPoint2D() (*Point2D, bool) { 9432 return nil, false 9433} 9434 9435// AsNormalizedQuadrilateral is the BasicResponseBase implementation for ResponseBase. 9436func (rb ResponseBase) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 9437 return nil, false 9438} 9439 9440// AsImageAction is the BasicResponseBase implementation for ResponseBase. 9441func (rb ResponseBase) AsImageAction() (*ImageAction, bool) { 9442 return nil, false 9443} 9444 9445// AsBasicImageAction is the BasicResponseBase implementation for ResponseBase. 9446func (rb ResponseBase) AsBasicImageAction() (BasicImageAction, bool) { 9447 return nil, false 9448} 9449 9450// AsImageTag is the BasicResponseBase implementation for ResponseBase. 9451func (rb ResponseBase) AsImageTag() (*ImageTag, bool) { 9452 return nil, false 9453} 9454 9455// AsOrganization is the BasicResponseBase implementation for ResponseBase. 9456func (rb ResponseBase) AsOrganization() (*Organization, bool) { 9457 return nil, false 9458} 9459 9460// AsOffer is the BasicResponseBase implementation for ResponseBase. 9461func (rb ResponseBase) AsOffer() (*Offer, bool) { 9462 return nil, false 9463} 9464 9465// AsBasicOffer is the BasicResponseBase implementation for ResponseBase. 9466func (rb ResponseBase) AsBasicOffer() (BasicOffer, bool) { 9467 return nil, false 9468} 9469 9470// AsAggregateOffer is the BasicResponseBase implementation for ResponseBase. 9471func (rb ResponseBase) AsAggregateOffer() (*AggregateOffer, bool) { 9472 return nil, false 9473} 9474 9475// AsImageObject is the BasicResponseBase implementation for ResponseBase. 9476func (rb ResponseBase) AsImageObject() (*ImageObject, bool) { 9477 return nil, false 9478} 9479 9480// AsImageKnowledge is the BasicResponseBase implementation for ResponseBase. 9481func (rb ResponseBase) AsImageKnowledge() (*ImageKnowledge, bool) { 9482 return nil, false 9483} 9484 9485// AsResponse is the BasicResponseBase implementation for ResponseBase. 9486func (rb ResponseBase) AsResponse() (*Response, bool) { 9487 return nil, false 9488} 9489 9490// AsBasicResponse is the BasicResponseBase implementation for ResponseBase. 9491func (rb ResponseBase) AsBasicResponse() (BasicResponse, bool) { 9492 return nil, false 9493} 9494 9495// AsIdentifiable is the BasicResponseBase implementation for ResponseBase. 9496func (rb ResponseBase) AsIdentifiable() (*Identifiable, bool) { 9497 return nil, false 9498} 9499 9500// AsBasicIdentifiable is the BasicResponseBase implementation for ResponseBase. 9501func (rb ResponseBase) AsBasicIdentifiable() (BasicIdentifiable, bool) { 9502 return nil, false 9503} 9504 9505// AsErrorResponse is the BasicResponseBase implementation for ResponseBase. 9506func (rb ResponseBase) AsErrorResponse() (*ErrorResponse, bool) { 9507 return nil, false 9508} 9509 9510// AsThing is the BasicResponseBase implementation for ResponseBase. 9511func (rb ResponseBase) AsThing() (*Thing, bool) { 9512 return nil, false 9513} 9514 9515// AsBasicThing is the BasicResponseBase implementation for ResponseBase. 9516func (rb ResponseBase) AsBasicThing() (BasicThing, bool) { 9517 return nil, false 9518} 9519 9520// AsAction is the BasicResponseBase implementation for ResponseBase. 9521func (rb ResponseBase) AsAction() (*Action, bool) { 9522 return nil, false 9523} 9524 9525// AsBasicAction is the BasicResponseBase implementation for ResponseBase. 9526func (rb ResponseBase) AsBasicAction() (BasicAction, bool) { 9527 return nil, false 9528} 9529 9530// AsMediaObject is the BasicResponseBase implementation for ResponseBase. 9531func (rb ResponseBase) AsMediaObject() (*MediaObject, bool) { 9532 return nil, false 9533} 9534 9535// AsBasicMediaObject is the BasicResponseBase implementation for ResponseBase. 9536func (rb ResponseBase) AsBasicMediaObject() (BasicMediaObject, bool) { 9537 return nil, false 9538} 9539 9540// AsCreativeWork is the BasicResponseBase implementation for ResponseBase. 9541func (rb ResponseBase) AsCreativeWork() (*CreativeWork, bool) { 9542 return nil, false 9543} 9544 9545// AsBasicCreativeWork is the BasicResponseBase implementation for ResponseBase. 9546func (rb ResponseBase) AsBasicCreativeWork() (BasicCreativeWork, bool) { 9547 return nil, false 9548} 9549 9550// AsPerson is the BasicResponseBase implementation for ResponseBase. 9551func (rb ResponseBase) AsPerson() (*Person, bool) { 9552 return nil, false 9553} 9554 9555// AsIntangible is the BasicResponseBase implementation for ResponseBase. 9556func (rb ResponseBase) AsIntangible() (*Intangible, bool) { 9557 return nil, false 9558} 9559 9560// AsBasicIntangible is the BasicResponseBase implementation for ResponseBase. 9561func (rb ResponseBase) AsBasicIntangible() (BasicIntangible, bool) { 9562 return nil, false 9563} 9564 9565// AsImageEntityAction is the BasicResponseBase implementation for ResponseBase. 9566func (rb ResponseBase) AsImageEntityAction() (*ImageEntityAction, bool) { 9567 return nil, false 9568} 9569 9570// AsImageModuleAction is the BasicResponseBase implementation for ResponseBase. 9571func (rb ResponseBase) AsImageModuleAction() (*ImageModuleAction, bool) { 9572 return nil, false 9573} 9574 9575// AsRecipe is the BasicResponseBase implementation for ResponseBase. 9576func (rb ResponseBase) AsRecipe() (*Recipe, bool) { 9577 return nil, false 9578} 9579 9580// AsImageRecipesAction is the BasicResponseBase implementation for ResponseBase. 9581func (rb ResponseBase) AsImageRecipesAction() (*ImageRecipesAction, bool) { 9582 return nil, false 9583} 9584 9585// AsImageRelatedSearchesAction is the BasicResponseBase implementation for ResponseBase. 9586func (rb ResponseBase) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 9587 return nil, false 9588} 9589 9590// AsImageShoppingSourcesAction is the BasicResponseBase implementation for ResponseBase. 9591func (rb ResponseBase) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 9592 return nil, false 9593} 9594 9595// AsStructuredValue is the BasicResponseBase implementation for ResponseBase. 9596func (rb ResponseBase) AsStructuredValue() (*StructuredValue, bool) { 9597 return nil, false 9598} 9599 9600// AsBasicStructuredValue is the BasicResponseBase implementation for ResponseBase. 9601func (rb ResponseBase) AsBasicStructuredValue() (BasicStructuredValue, bool) { 9602 return nil, false 9603} 9604 9605// AsResponseBase is the BasicResponseBase implementation for ResponseBase. 9606func (rb ResponseBase) AsResponseBase() (*ResponseBase, bool) { 9607 return &rb, true 9608} 9609 9610// AsBasicResponseBase is the BasicResponseBase implementation for ResponseBase. 9611func (rb ResponseBase) AsBasicResponseBase() (BasicResponseBase, bool) { 9612 return &rb, true 9613} 9614 9615// BasicStructuredValue ... 9616type BasicStructuredValue interface { 9617 AsPoint2D() (*Point2D, bool) 9618 AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) 9619 AsStructuredValue() (*StructuredValue, bool) 9620} 9621 9622// StructuredValue ... 9623type StructuredValue struct { 9624 // Name - READ-ONLY; The name of the thing represented by this object. 9625 Name *string `json:"name,omitempty"` 9626 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 9627 URL *string `json:"url,omitempty"` 9628 // Image - READ-ONLY; An image of the item. 9629 Image *ImageObject `json:"image,omitempty"` 9630 // Description - READ-ONLY; A short description of the item. 9631 Description *string `json:"description,omitempty"` 9632 // AlternateName - READ-ONLY; An alias for the item. 9633 AlternateName *string `json:"alternateName,omitempty"` 9634 // BingID - READ-ONLY; An ID that uniquely identifies this item. 9635 BingID *string `json:"bingId,omitempty"` 9636 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 9637 ReadLink *string `json:"readLink,omitempty"` 9638 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 9639 WebSearchURL *string `json:"webSearchUrl,omitempty"` 9640 // ID - READ-ONLY; A String identifier. 9641 ID *string `json:"id,omitempty"` 9642 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 9643 Type Type `json:"_type,omitempty"` 9644} 9645 9646func unmarshalBasicStructuredValue(body []byte) (BasicStructuredValue, error) { 9647 var m map[string]interface{} 9648 err := json.Unmarshal(body, &m) 9649 if err != nil { 9650 return nil, err 9651 } 9652 9653 switch m["_type"] { 9654 case string(TypePoint2D): 9655 var p2 Point2D 9656 err := json.Unmarshal(body, &p2) 9657 return p2, err 9658 case string(TypeNormalizedQuadrilateral): 9659 var nq NormalizedQuadrilateral 9660 err := json.Unmarshal(body, &nq) 9661 return nq, err 9662 default: 9663 var sv StructuredValue 9664 err := json.Unmarshal(body, &sv) 9665 return sv, err 9666 } 9667} 9668func unmarshalBasicStructuredValueArray(body []byte) ([]BasicStructuredValue, error) { 9669 var rawMessages []*json.RawMessage 9670 err := json.Unmarshal(body, &rawMessages) 9671 if err != nil { 9672 return nil, err 9673 } 9674 9675 svArray := make([]BasicStructuredValue, len(rawMessages)) 9676 9677 for index, rawMessage := range rawMessages { 9678 sv, err := unmarshalBasicStructuredValue(*rawMessage) 9679 if err != nil { 9680 return nil, err 9681 } 9682 svArray[index] = sv 9683 } 9684 return svArray, nil 9685} 9686 9687// MarshalJSON is the custom marshaler for StructuredValue. 9688func (sv StructuredValue) MarshalJSON() ([]byte, error) { 9689 sv.Type = TypeStructuredValue 9690 objectMap := make(map[string]interface{}) 9691 if sv.Type != "" { 9692 objectMap["_type"] = sv.Type 9693 } 9694 return json.Marshal(objectMap) 9695} 9696 9697// AsPoint2D is the BasicResponseBase implementation for StructuredValue. 9698func (sv StructuredValue) AsPoint2D() (*Point2D, bool) { 9699 return nil, false 9700} 9701 9702// AsNormalizedQuadrilateral is the BasicResponseBase implementation for StructuredValue. 9703func (sv StructuredValue) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 9704 return nil, false 9705} 9706 9707// AsImageAction is the BasicResponseBase implementation for StructuredValue. 9708func (sv StructuredValue) AsImageAction() (*ImageAction, bool) { 9709 return nil, false 9710} 9711 9712// AsBasicImageAction is the BasicResponseBase implementation for StructuredValue. 9713func (sv StructuredValue) AsBasicImageAction() (BasicImageAction, bool) { 9714 return nil, false 9715} 9716 9717// AsImageTag is the BasicResponseBase implementation for StructuredValue. 9718func (sv StructuredValue) AsImageTag() (*ImageTag, bool) { 9719 return nil, false 9720} 9721 9722// AsOrganization is the BasicResponseBase implementation for StructuredValue. 9723func (sv StructuredValue) AsOrganization() (*Organization, bool) { 9724 return nil, false 9725} 9726 9727// AsOffer is the BasicResponseBase implementation for StructuredValue. 9728func (sv StructuredValue) AsOffer() (*Offer, bool) { 9729 return nil, false 9730} 9731 9732// AsBasicOffer is the BasicResponseBase implementation for StructuredValue. 9733func (sv StructuredValue) AsBasicOffer() (BasicOffer, bool) { 9734 return nil, false 9735} 9736 9737// AsAggregateOffer is the BasicResponseBase implementation for StructuredValue. 9738func (sv StructuredValue) AsAggregateOffer() (*AggregateOffer, bool) { 9739 return nil, false 9740} 9741 9742// AsImageObject is the BasicResponseBase implementation for StructuredValue. 9743func (sv StructuredValue) AsImageObject() (*ImageObject, bool) { 9744 return nil, false 9745} 9746 9747// AsImageKnowledge is the BasicResponseBase implementation for StructuredValue. 9748func (sv StructuredValue) AsImageKnowledge() (*ImageKnowledge, bool) { 9749 return nil, false 9750} 9751 9752// AsResponse is the BasicResponseBase implementation for StructuredValue. 9753func (sv StructuredValue) AsResponse() (*Response, bool) { 9754 return nil, false 9755} 9756 9757// AsBasicResponse is the BasicResponseBase implementation for StructuredValue. 9758func (sv StructuredValue) AsBasicResponse() (BasicResponse, bool) { 9759 return &sv, true 9760} 9761 9762// AsIdentifiable is the BasicResponseBase implementation for StructuredValue. 9763func (sv StructuredValue) AsIdentifiable() (*Identifiable, bool) { 9764 return nil, false 9765} 9766 9767// AsBasicIdentifiable is the BasicResponseBase implementation for StructuredValue. 9768func (sv StructuredValue) AsBasicIdentifiable() (BasicIdentifiable, bool) { 9769 return &sv, true 9770} 9771 9772// AsErrorResponse is the BasicResponseBase implementation for StructuredValue. 9773func (sv StructuredValue) AsErrorResponse() (*ErrorResponse, bool) { 9774 return nil, false 9775} 9776 9777// AsThing is the BasicResponseBase implementation for StructuredValue. 9778func (sv StructuredValue) AsThing() (*Thing, bool) { 9779 return nil, false 9780} 9781 9782// AsBasicThing is the BasicResponseBase implementation for StructuredValue. 9783func (sv StructuredValue) AsBasicThing() (BasicThing, bool) { 9784 return &sv, true 9785} 9786 9787// AsAction is the BasicResponseBase implementation for StructuredValue. 9788func (sv StructuredValue) AsAction() (*Action, bool) { 9789 return nil, false 9790} 9791 9792// AsBasicAction is the BasicResponseBase implementation for StructuredValue. 9793func (sv StructuredValue) AsBasicAction() (BasicAction, bool) { 9794 return nil, false 9795} 9796 9797// AsMediaObject is the BasicResponseBase implementation for StructuredValue. 9798func (sv StructuredValue) AsMediaObject() (*MediaObject, bool) { 9799 return nil, false 9800} 9801 9802// AsBasicMediaObject is the BasicResponseBase implementation for StructuredValue. 9803func (sv StructuredValue) AsBasicMediaObject() (BasicMediaObject, bool) { 9804 return nil, false 9805} 9806 9807// AsCreativeWork is the BasicResponseBase implementation for StructuredValue. 9808func (sv StructuredValue) AsCreativeWork() (*CreativeWork, bool) { 9809 return nil, false 9810} 9811 9812// AsBasicCreativeWork is the BasicResponseBase implementation for StructuredValue. 9813func (sv StructuredValue) AsBasicCreativeWork() (BasicCreativeWork, bool) { 9814 return nil, false 9815} 9816 9817// AsPerson is the BasicResponseBase implementation for StructuredValue. 9818func (sv StructuredValue) AsPerson() (*Person, bool) { 9819 return nil, false 9820} 9821 9822// AsIntangible is the BasicResponseBase implementation for StructuredValue. 9823func (sv StructuredValue) AsIntangible() (*Intangible, bool) { 9824 return nil, false 9825} 9826 9827// AsBasicIntangible is the BasicResponseBase implementation for StructuredValue. 9828func (sv StructuredValue) AsBasicIntangible() (BasicIntangible, bool) { 9829 return &sv, true 9830} 9831 9832// AsImageEntityAction is the BasicResponseBase implementation for StructuredValue. 9833func (sv StructuredValue) AsImageEntityAction() (*ImageEntityAction, bool) { 9834 return nil, false 9835} 9836 9837// AsImageModuleAction is the BasicResponseBase implementation for StructuredValue. 9838func (sv StructuredValue) AsImageModuleAction() (*ImageModuleAction, bool) { 9839 return nil, false 9840} 9841 9842// AsRecipe is the BasicResponseBase implementation for StructuredValue. 9843func (sv StructuredValue) AsRecipe() (*Recipe, bool) { 9844 return nil, false 9845} 9846 9847// AsImageRecipesAction is the BasicResponseBase implementation for StructuredValue. 9848func (sv StructuredValue) AsImageRecipesAction() (*ImageRecipesAction, bool) { 9849 return nil, false 9850} 9851 9852// AsImageRelatedSearchesAction is the BasicResponseBase implementation for StructuredValue. 9853func (sv StructuredValue) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 9854 return nil, false 9855} 9856 9857// AsImageShoppingSourcesAction is the BasicResponseBase implementation for StructuredValue. 9858func (sv StructuredValue) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 9859 return nil, false 9860} 9861 9862// AsStructuredValue is the BasicResponseBase implementation for StructuredValue. 9863func (sv StructuredValue) AsStructuredValue() (*StructuredValue, bool) { 9864 return &sv, true 9865} 9866 9867// AsBasicStructuredValue is the BasicResponseBase implementation for StructuredValue. 9868func (sv StructuredValue) AsBasicStructuredValue() (BasicStructuredValue, bool) { 9869 return &sv, true 9870} 9871 9872// AsResponseBase is the BasicResponseBase implementation for StructuredValue. 9873func (sv StructuredValue) AsResponseBase() (*ResponseBase, bool) { 9874 return nil, false 9875} 9876 9877// AsBasicResponseBase is the BasicResponseBase implementation for StructuredValue. 9878func (sv StructuredValue) AsBasicResponseBase() (BasicResponseBase, bool) { 9879 return &sv, true 9880} 9881 9882// BasicThing defines a thing. 9883type BasicThing interface { 9884 AsPoint2D() (*Point2D, bool) 9885 AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) 9886 AsImageAction() (*ImageAction, bool) 9887 AsBasicImageAction() (BasicImageAction, bool) 9888 AsImageTag() (*ImageTag, bool) 9889 AsOrganization() (*Organization, bool) 9890 AsOffer() (*Offer, bool) 9891 AsBasicOffer() (BasicOffer, bool) 9892 AsAggregateOffer() (*AggregateOffer, bool) 9893 AsImageObject() (*ImageObject, bool) 9894 AsAction() (*Action, bool) 9895 AsBasicAction() (BasicAction, bool) 9896 AsMediaObject() (*MediaObject, bool) 9897 AsBasicMediaObject() (BasicMediaObject, bool) 9898 AsCreativeWork() (*CreativeWork, bool) 9899 AsBasicCreativeWork() (BasicCreativeWork, bool) 9900 AsPerson() (*Person, bool) 9901 AsIntangible() (*Intangible, bool) 9902 AsBasicIntangible() (BasicIntangible, bool) 9903 AsImageEntityAction() (*ImageEntityAction, bool) 9904 AsImageModuleAction() (*ImageModuleAction, bool) 9905 AsRecipe() (*Recipe, bool) 9906 AsImageRecipesAction() (*ImageRecipesAction, bool) 9907 AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) 9908 AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) 9909 AsStructuredValue() (*StructuredValue, bool) 9910 AsBasicStructuredValue() (BasicStructuredValue, bool) 9911 AsThing() (*Thing, bool) 9912} 9913 9914// Thing defines a thing. 9915type Thing struct { 9916 // Name - READ-ONLY; The name of the thing represented by this object. 9917 Name *string `json:"name,omitempty"` 9918 // URL - READ-ONLY; The URL to get more information about the thing represented by this object. 9919 URL *string `json:"url,omitempty"` 9920 // Image - READ-ONLY; An image of the item. 9921 Image *ImageObject `json:"image,omitempty"` 9922 // Description - READ-ONLY; A short description of the item. 9923 Description *string `json:"description,omitempty"` 9924 // AlternateName - READ-ONLY; An alias for the item. 9925 AlternateName *string `json:"alternateName,omitempty"` 9926 // BingID - READ-ONLY; An ID that uniquely identifies this item. 9927 BingID *string `json:"bingId,omitempty"` 9928 // ReadLink - READ-ONLY; The URL that returns this resource. To use the URL, append query parameters as appropriate and include the Ocp-Apim-Subscription-Key header. 9929 ReadLink *string `json:"readLink,omitempty"` 9930 // WebSearchURL - READ-ONLY; The URL to Bing's search result for this item. 9931 WebSearchURL *string `json:"webSearchUrl,omitempty"` 9932 // ID - READ-ONLY; A String identifier. 9933 ID *string `json:"id,omitempty"` 9934 // Type - Possible values include: 'TypeResponseBase', 'TypePoint2D', 'TypeNormalizedQuadrilateral', 'TypeImageAction', 'TypeImageTag', 'TypeOrganization', 'TypeOffer', 'TypeAggregateOffer', 'TypeImageObject', 'TypeImageKnowledge', 'TypeResponse', 'TypeIdentifiable', 'TypeErrorResponse', 'TypeThing', 'TypeAction', 'TypeMediaObject', 'TypeCreativeWork', 'TypePerson', 'TypeIntangible', 'TypeImageEntityAction', 'TypeImageModuleAction', 'TypeRecipe', 'TypeImageRecipesAction', 'TypeImageRelatedSearchesAction', 'TypeImageShoppingSourcesAction', 'TypeStructuredValue' 9935 Type Type `json:"_type,omitempty"` 9936} 9937 9938func unmarshalBasicThing(body []byte) (BasicThing, error) { 9939 var m map[string]interface{} 9940 err := json.Unmarshal(body, &m) 9941 if err != nil { 9942 return nil, err 9943 } 9944 9945 switch m["_type"] { 9946 case string(TypePoint2D): 9947 var p2 Point2D 9948 err := json.Unmarshal(body, &p2) 9949 return p2, err 9950 case string(TypeNormalizedQuadrilateral): 9951 var nq NormalizedQuadrilateral 9952 err := json.Unmarshal(body, &nq) 9953 return nq, err 9954 case string(TypeImageAction): 9955 var ia ImageAction 9956 err := json.Unmarshal(body, &ia) 9957 return ia, err 9958 case string(TypeImageTag): 9959 var it ImageTag 9960 err := json.Unmarshal(body, &it) 9961 return it, err 9962 case string(TypeOrganization): 9963 var o Organization 9964 err := json.Unmarshal(body, &o) 9965 return o, err 9966 case string(TypeOffer): 9967 var o Offer 9968 err := json.Unmarshal(body, &o) 9969 return o, err 9970 case string(TypeAggregateOffer): 9971 var ao AggregateOffer 9972 err := json.Unmarshal(body, &ao) 9973 return ao, err 9974 case string(TypeImageObject): 9975 var ioVar ImageObject 9976 err := json.Unmarshal(body, &ioVar) 9977 return ioVar, err 9978 case string(TypeAction): 9979 var a Action 9980 err := json.Unmarshal(body, &a) 9981 return a, err 9982 case string(TypeMediaObject): 9983 var mo MediaObject 9984 err := json.Unmarshal(body, &mo) 9985 return mo, err 9986 case string(TypeCreativeWork): 9987 var cw CreativeWork 9988 err := json.Unmarshal(body, &cw) 9989 return cw, err 9990 case string(TypePerson): 9991 var p Person 9992 err := json.Unmarshal(body, &p) 9993 return p, err 9994 case string(TypeIntangible): 9995 var i Intangible 9996 err := json.Unmarshal(body, &i) 9997 return i, err 9998 case string(TypeImageEntityAction): 9999 var iea ImageEntityAction 10000 err := json.Unmarshal(body, &iea) 10001 return iea, err 10002 case string(TypeImageModuleAction): 10003 var ima ImageModuleAction 10004 err := json.Unmarshal(body, &ima) 10005 return ima, err 10006 case string(TypeRecipe): 10007 var r Recipe 10008 err := json.Unmarshal(body, &r) 10009 return r, err 10010 case string(TypeImageRecipesAction): 10011 var ira ImageRecipesAction 10012 err := json.Unmarshal(body, &ira) 10013 return ira, err 10014 case string(TypeImageRelatedSearchesAction): 10015 var irsa ImageRelatedSearchesAction 10016 err := json.Unmarshal(body, &irsa) 10017 return irsa, err 10018 case string(TypeImageShoppingSourcesAction): 10019 var issa ImageShoppingSourcesAction 10020 err := json.Unmarshal(body, &issa) 10021 return issa, err 10022 case string(TypeStructuredValue): 10023 var sv StructuredValue 10024 err := json.Unmarshal(body, &sv) 10025 return sv, err 10026 default: 10027 var t Thing 10028 err := json.Unmarshal(body, &t) 10029 return t, err 10030 } 10031} 10032func unmarshalBasicThingArray(body []byte) ([]BasicThing, error) { 10033 var rawMessages []*json.RawMessage 10034 err := json.Unmarshal(body, &rawMessages) 10035 if err != nil { 10036 return nil, err 10037 } 10038 10039 tArray := make([]BasicThing, len(rawMessages)) 10040 10041 for index, rawMessage := range rawMessages { 10042 t, err := unmarshalBasicThing(*rawMessage) 10043 if err != nil { 10044 return nil, err 10045 } 10046 tArray[index] = t 10047 } 10048 return tArray, nil 10049} 10050 10051// MarshalJSON is the custom marshaler for Thing. 10052func (t Thing) MarshalJSON() ([]byte, error) { 10053 t.Type = TypeThing 10054 objectMap := make(map[string]interface{}) 10055 if t.Type != "" { 10056 objectMap["_type"] = t.Type 10057 } 10058 return json.Marshal(objectMap) 10059} 10060 10061// AsPoint2D is the BasicResponseBase implementation for Thing. 10062func (t Thing) AsPoint2D() (*Point2D, bool) { 10063 return nil, false 10064} 10065 10066// AsNormalizedQuadrilateral is the BasicResponseBase implementation for Thing. 10067func (t Thing) AsNormalizedQuadrilateral() (*NormalizedQuadrilateral, bool) { 10068 return nil, false 10069} 10070 10071// AsImageAction is the BasicResponseBase implementation for Thing. 10072func (t Thing) AsImageAction() (*ImageAction, bool) { 10073 return nil, false 10074} 10075 10076// AsBasicImageAction is the BasicResponseBase implementation for Thing. 10077func (t Thing) AsBasicImageAction() (BasicImageAction, bool) { 10078 return nil, false 10079} 10080 10081// AsImageTag is the BasicResponseBase implementation for Thing. 10082func (t Thing) AsImageTag() (*ImageTag, bool) { 10083 return nil, false 10084} 10085 10086// AsOrganization is the BasicResponseBase implementation for Thing. 10087func (t Thing) AsOrganization() (*Organization, bool) { 10088 return nil, false 10089} 10090 10091// AsOffer is the BasicResponseBase implementation for Thing. 10092func (t Thing) AsOffer() (*Offer, bool) { 10093 return nil, false 10094} 10095 10096// AsBasicOffer is the BasicResponseBase implementation for Thing. 10097func (t Thing) AsBasicOffer() (BasicOffer, bool) { 10098 return nil, false 10099} 10100 10101// AsAggregateOffer is the BasicResponseBase implementation for Thing. 10102func (t Thing) AsAggregateOffer() (*AggregateOffer, bool) { 10103 return nil, false 10104} 10105 10106// AsImageObject is the BasicResponseBase implementation for Thing. 10107func (t Thing) AsImageObject() (*ImageObject, bool) { 10108 return nil, false 10109} 10110 10111// AsImageKnowledge is the BasicResponseBase implementation for Thing. 10112func (t Thing) AsImageKnowledge() (*ImageKnowledge, bool) { 10113 return nil, false 10114} 10115 10116// AsResponse is the BasicResponseBase implementation for Thing. 10117func (t Thing) AsResponse() (*Response, bool) { 10118 return nil, false 10119} 10120 10121// AsBasicResponse is the BasicResponseBase implementation for Thing. 10122func (t Thing) AsBasicResponse() (BasicResponse, bool) { 10123 return &t, true 10124} 10125 10126// AsIdentifiable is the BasicResponseBase implementation for Thing. 10127func (t Thing) AsIdentifiable() (*Identifiable, bool) { 10128 return nil, false 10129} 10130 10131// AsBasicIdentifiable is the BasicResponseBase implementation for Thing. 10132func (t Thing) AsBasicIdentifiable() (BasicIdentifiable, bool) { 10133 return &t, true 10134} 10135 10136// AsErrorResponse is the BasicResponseBase implementation for Thing. 10137func (t Thing) AsErrorResponse() (*ErrorResponse, bool) { 10138 return nil, false 10139} 10140 10141// AsThing is the BasicResponseBase implementation for Thing. 10142func (t Thing) AsThing() (*Thing, bool) { 10143 return &t, true 10144} 10145 10146// AsBasicThing is the BasicResponseBase implementation for Thing. 10147func (t Thing) AsBasicThing() (BasicThing, bool) { 10148 return &t, true 10149} 10150 10151// AsAction is the BasicResponseBase implementation for Thing. 10152func (t Thing) AsAction() (*Action, bool) { 10153 return nil, false 10154} 10155 10156// AsBasicAction is the BasicResponseBase implementation for Thing. 10157func (t Thing) AsBasicAction() (BasicAction, bool) { 10158 return nil, false 10159} 10160 10161// AsMediaObject is the BasicResponseBase implementation for Thing. 10162func (t Thing) AsMediaObject() (*MediaObject, bool) { 10163 return nil, false 10164} 10165 10166// AsBasicMediaObject is the BasicResponseBase implementation for Thing. 10167func (t Thing) AsBasicMediaObject() (BasicMediaObject, bool) { 10168 return nil, false 10169} 10170 10171// AsCreativeWork is the BasicResponseBase implementation for Thing. 10172func (t Thing) AsCreativeWork() (*CreativeWork, bool) { 10173 return nil, false 10174} 10175 10176// AsBasicCreativeWork is the BasicResponseBase implementation for Thing. 10177func (t Thing) AsBasicCreativeWork() (BasicCreativeWork, bool) { 10178 return nil, false 10179} 10180 10181// AsPerson is the BasicResponseBase implementation for Thing. 10182func (t Thing) AsPerson() (*Person, bool) { 10183 return nil, false 10184} 10185 10186// AsIntangible is the BasicResponseBase implementation for Thing. 10187func (t Thing) AsIntangible() (*Intangible, bool) { 10188 return nil, false 10189} 10190 10191// AsBasicIntangible is the BasicResponseBase implementation for Thing. 10192func (t Thing) AsBasicIntangible() (BasicIntangible, bool) { 10193 return nil, false 10194} 10195 10196// AsImageEntityAction is the BasicResponseBase implementation for Thing. 10197func (t Thing) AsImageEntityAction() (*ImageEntityAction, bool) { 10198 return nil, false 10199} 10200 10201// AsImageModuleAction is the BasicResponseBase implementation for Thing. 10202func (t Thing) AsImageModuleAction() (*ImageModuleAction, bool) { 10203 return nil, false 10204} 10205 10206// AsRecipe is the BasicResponseBase implementation for Thing. 10207func (t Thing) AsRecipe() (*Recipe, bool) { 10208 return nil, false 10209} 10210 10211// AsImageRecipesAction is the BasicResponseBase implementation for Thing. 10212func (t Thing) AsImageRecipesAction() (*ImageRecipesAction, bool) { 10213 return nil, false 10214} 10215 10216// AsImageRelatedSearchesAction is the BasicResponseBase implementation for Thing. 10217func (t Thing) AsImageRelatedSearchesAction() (*ImageRelatedSearchesAction, bool) { 10218 return nil, false 10219} 10220 10221// AsImageShoppingSourcesAction is the BasicResponseBase implementation for Thing. 10222func (t Thing) AsImageShoppingSourcesAction() (*ImageShoppingSourcesAction, bool) { 10223 return nil, false 10224} 10225 10226// AsStructuredValue is the BasicResponseBase implementation for Thing. 10227func (t Thing) AsStructuredValue() (*StructuredValue, bool) { 10228 return nil, false 10229} 10230 10231// AsBasicStructuredValue is the BasicResponseBase implementation for Thing. 10232func (t Thing) AsBasicStructuredValue() (BasicStructuredValue, bool) { 10233 return nil, false 10234} 10235 10236// AsResponseBase is the BasicResponseBase implementation for Thing. 10237func (t Thing) AsResponseBase() (*ResponseBase, bool) { 10238 return nil, false 10239} 10240 10241// AsBasicResponseBase is the BasicResponseBase implementation for Thing. 10242func (t Thing) AsBasicResponseBase() (BasicResponseBase, bool) { 10243 return &t, true 10244} 10245