1// 2package streams 3 4import ( 5 "github.com/writeas/activity/vocab" 6 "net/url" 7 "time" 8) 9 10// Represents an individual person. This is a convenience wrapper of a type with the same name in the vocab package. Accessing it with the Raw function allows direct manipulaton of the object, and does not provide the same integrity guarantees as this package. 11type Person struct { 12 // The raw type from the vocab package 13 raw *vocab.Person 14} 15 16// Raw returns the vocab type for manaual manipulation. Note that manipulating the underlying type to be in an inconsistent state may cause this convenience type's methods to later fail. 17func (t *Person) Raw() (n *vocab.Person) { 18 return t.raw 19 20} 21 22// Serialize turns this object into a map[string]interface{}. 23func (t *Person) Serialize() (m map[string]interface{}, err error) { 24 return t.raw.Serialize() 25 26} 27 28// GetAltitude attempts to get this 'altitude' property as a float64. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 29func (t *Person) GetAltitude() (r Resolution, k float64) { 30 r = Unresolved 31 handled := false 32 if t.raw.IsAltitude() { 33 k = t.raw.GetAltitude() 34 if handled { 35 r = Resolved 36 } 37 } else if t.raw.IsAltitudeIRI() { 38 r = RawResolutionNeeded 39 } 40 return 41 42} 43 44// HasAltitude returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 45func (t *Person) HasAltitude() (p Presence) { 46 p = NoPresence 47 if t.raw.IsAltitude() { 48 p = ConvenientPresence 49 } else if t.raw.IsAltitudeIRI() { 50 p = RawPresence 51 } 52 return 53 54} 55 56// SetAltitude sets the value for property 'altitude'. 57func (t *Person) SetAltitude(k float64) { 58 t.raw.SetAltitude(k) 59 60} 61 62// LenAttachment returns the number of values this property contains. Each index be used with HasAttachment to determine if ResolveAttachment is safe to call or if raw handling would be needed. 63func (t *Person) LenAttachment() (idx int) { 64 return t.raw.AttachmentLen() 65 66} 67 68// ResolveAttachment passes the actual concrete type to the resolver for handing property attachment. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 69func (t *Person) ResolveAttachment(r *Resolver, idx int) (s Resolution, err error) { 70 s = Unresolved 71 handled := false 72 if t.raw.IsAttachmentObject(idx) { 73 handled, err = r.dispatch(t.raw.GetAttachmentObject(idx)) 74 if handled { 75 s = Resolved 76 } 77 } else if t.raw.IsAttachmentLink(idx) { 78 handled, err = r.dispatch(t.raw.GetAttachmentLink(idx)) 79 if handled { 80 s = Resolved 81 } 82 } else if t.raw.IsAttachmentIRI(idx) { 83 s = RawResolutionNeeded 84 } 85 return 86 87} 88 89// HasAttachment returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 90func (t *Person) HasAttachment(idx int) (p Presence) { 91 p = NoPresence 92 if t.raw.IsAttachmentObject(idx) { 93 p = ConvenientPresence 94 } else if t.raw.IsAttachmentLink(idx) { 95 p = ConvenientPresence 96 } else if t.raw.IsAttachmentIRI(idx) { 97 p = RawPresence 98 } 99 return 100 101} 102 103// AppendAttachment appends an 'Object' typed value. 104func (t *Person) AppendAttachment(i vocab.ObjectType) { 105 t.raw.AppendAttachmentObject(i) 106 107} 108 109// PrependAttachment prepends an 'Object' typed value. 110func (t *Person) PrependAttachment(i vocab.ObjectType) { 111 t.raw.PrependAttachmentObject(i) 112 113} 114 115// AppendAttachmentLink appends a 'Link' typed value. 116func (t *Person) AppendAttachmentLink(i vocab.LinkType) { 117 t.raw.AppendAttachmentLink(i) 118 119} 120 121// PrependAttachmentLink prepends a 'Link' typed value. 122func (t *Person) PrependAttachmentLink(i vocab.LinkType) { 123 t.raw.PrependAttachmentLink(i) 124 125} 126 127// LenAttributedTo returns the number of values this property contains. Each index be used with HasAttributedTo to determine if GetAttributedTo is safe to call or if raw handling would be needed. 128func (t *Person) LenAttributedTo() (idx int) { 129 return t.raw.AttributedToLen() 130 131} 132 133// GetAttributedTo attempts to get this 'attributedTo' property as a *url.URL. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 134func (t *Person) GetAttributedTo(idx int) (r Resolution, k *url.URL) { 135 r = Unresolved 136 handled := false 137 if t.raw.IsAttributedToIRI(idx) { 138 k = t.raw.GetAttributedToIRI(idx) 139 if handled { 140 r = Resolved 141 } 142 } else if t.raw.IsAttributedToObject(idx) { 143 r = RawResolutionNeeded 144 } else if t.raw.IsAttributedToLink(idx) { 145 r = RawResolutionNeeded 146 } 147 return 148 149} 150 151// AppendAttributedTo appends the value for property 'attributedTo'. 152func (t *Person) AppendAttributedTo(k *url.URL) { 153 t.raw.AppendAttributedToIRI(k) 154 155} 156 157// PrependAttributedTo prepends the value for property 'attributedTo'. 158func (t *Person) PrependAttributedTo(k *url.URL) { 159 t.raw.PrependAttributedToIRI(k) 160 161} 162 163// RemoveAttributedTo deletes the value from the specified index for property 'attributedTo'. 164func (t *Person) RemoveAttributedTo(idx int) { 165 t.raw.RemoveAttributedToIRI(idx) 166 167} 168 169// HasAttributedTo returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 170func (t *Person) HasAttributedTo(idx int) (p Presence) { 171 p = NoPresence 172 if t.raw.IsAttributedToIRI(idx) { 173 p = ConvenientPresence 174 } else if t.raw.IsAttributedToLink(idx) { 175 p = RawPresence 176 } else if t.raw.IsAttributedToIRI(idx) { 177 p = RawPresence 178 } 179 return 180 181} 182 183// LenAudience returns the number of values this property contains. Each index be used with HasAudience to determine if GetAudience is safe to call or if raw handling would be needed. 184func (t *Person) LenAudience() (idx int) { 185 return t.raw.AudienceLen() 186 187} 188 189// GetAudience attempts to get this 'audience' property as a *url.URL. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 190func (t *Person) GetAudience(idx int) (r Resolution, k *url.URL) { 191 r = Unresolved 192 handled := false 193 if t.raw.IsAudienceIRI(idx) { 194 k = t.raw.GetAudienceIRI(idx) 195 if handled { 196 r = Resolved 197 } 198 } else if t.raw.IsAudienceObject(idx) { 199 r = RawResolutionNeeded 200 } else if t.raw.IsAudienceLink(idx) { 201 r = RawResolutionNeeded 202 } 203 return 204 205} 206 207// AppendAudience appends the value for property 'audience'. 208func (t *Person) AppendAudience(k *url.URL) { 209 t.raw.AppendAudienceIRI(k) 210 211} 212 213// PrependAudience prepends the value for property 'audience'. 214func (t *Person) PrependAudience(k *url.URL) { 215 t.raw.PrependAudienceIRI(k) 216 217} 218 219// RemoveAudience deletes the value from the specified index for property 'audience'. 220func (t *Person) RemoveAudience(idx int) { 221 t.raw.RemoveAudienceIRI(idx) 222 223} 224 225// HasAudience returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 226func (t *Person) HasAudience(idx int) (p Presence) { 227 p = NoPresence 228 if t.raw.IsAudienceIRI(idx) { 229 p = ConvenientPresence 230 } else if t.raw.IsAudienceLink(idx) { 231 p = RawPresence 232 } else if t.raw.IsAudienceIRI(idx) { 233 p = RawPresence 234 } 235 return 236 237} 238 239// LenContent returns the number of values this property contains. Each index be used with HasContent to determine if GetContent is safe to call or if raw handling would be needed. 240func (t *Person) LenContent() (idx int) { 241 return t.raw.ContentLen() 242 243} 244 245// GetContent attempts to get this 'content' property as a string. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 246func (t *Person) GetContent(idx int) (r Resolution, k string) { 247 r = Unresolved 248 handled := false 249 if t.raw.IsContentString(idx) { 250 k = t.raw.GetContentString(idx) 251 if handled { 252 r = Resolved 253 } 254 } else if t.raw.IsContentLangString(idx) { 255 r = RawResolutionNeeded 256 } else if t.raw.IsContentIRI(idx) { 257 r = RawResolutionNeeded 258 } 259 return 260 261} 262 263// AppendContent appends the value for property 'content'. 264func (t *Person) AppendContent(k string) { 265 t.raw.AppendContentString(k) 266 267} 268 269// PrependContent prepends the value for property 'content'. 270func (t *Person) PrependContent(k string) { 271 t.raw.PrependContentString(k) 272 273} 274 275// RemoveContent deletes the value from the specified index for property 'content'. 276func (t *Person) RemoveContent(idx int) { 277 t.raw.RemoveContentString(idx) 278 279} 280 281// HasContent returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 282func (t *Person) HasContent(idx int) (p Presence) { 283 p = NoPresence 284 if t.raw.IsContentString(idx) { 285 p = ConvenientPresence 286 } else if t.raw.IsContentLangString(idx) { 287 p = RawPresence 288 } else if t.raw.IsContentIRI(idx) { 289 p = RawPresence 290 } 291 return 292 293} 294 295// ContentLanguages returns all languages for this property's language mapping, or nil if there are none. 296func (t *Person) ContentLanguages() (l []string) { 297 return t.raw.ContentMapLanguages() 298 299} 300 301// GetContentMap retrieves the value of 'content' for the specified language, or an empty string if it does not exist 302func (t *Person) GetContentForLanguage(l string) (v string) { 303 return t.raw.GetContentMap(l) 304 305} 306 307// SetContentForLanguage sets the value of 'content' for the specified language 308func (t *Person) SetContentForLanguage(l string, v string) { 309 t.raw.SetContentMap(l, v) 310 311} 312 313// LenContext returns the number of values this property contains. Each index be used with HasContext to determine if ResolveContext is safe to call or if raw handling would be needed. 314func (t *Person) LenContext() (idx int) { 315 return t.raw.ContextLen() 316 317} 318 319// ResolveContext passes the actual concrete type to the resolver for handing property context. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 320func (t *Person) ResolveContext(r *Resolver, idx int) (s Resolution, err error) { 321 s = Unresolved 322 handled := false 323 if t.raw.IsContextObject(idx) { 324 handled, err = r.dispatch(t.raw.GetContextObject(idx)) 325 if handled { 326 s = Resolved 327 } 328 } else if t.raw.IsContextLink(idx) { 329 handled, err = r.dispatch(t.raw.GetContextLink(idx)) 330 if handled { 331 s = Resolved 332 } 333 } else if t.raw.IsContextIRI(idx) { 334 s = RawResolutionNeeded 335 } 336 return 337 338} 339 340// HasContext returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 341func (t *Person) HasContext(idx int) (p Presence) { 342 p = NoPresence 343 if t.raw.IsContextObject(idx) { 344 p = ConvenientPresence 345 } else if t.raw.IsContextLink(idx) { 346 p = ConvenientPresence 347 } else if t.raw.IsContextIRI(idx) { 348 p = RawPresence 349 } 350 return 351 352} 353 354// AppendContext appends an 'Object' typed value. 355func (t *Person) AppendContext(i vocab.ObjectType) { 356 t.raw.AppendContextObject(i) 357 358} 359 360// PrependContext prepends an 'Object' typed value. 361func (t *Person) PrependContext(i vocab.ObjectType) { 362 t.raw.PrependContextObject(i) 363 364} 365 366// AppendContextLink appends a 'Link' typed value. 367func (t *Person) AppendContextLink(i vocab.LinkType) { 368 t.raw.AppendContextLink(i) 369 370} 371 372// PrependContextLink prepends a 'Link' typed value. 373func (t *Person) PrependContextLink(i vocab.LinkType) { 374 t.raw.PrependContextLink(i) 375 376} 377 378// LenName returns the number of values this property contains. Each index be used with HasName to determine if GetName is safe to call or if raw handling would be needed. 379func (t *Person) LenName() (idx int) { 380 return t.raw.NameLen() 381 382} 383 384// GetName attempts to get this 'name' property as a string. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 385func (t *Person) GetName(idx int) (r Resolution, k string) { 386 r = Unresolved 387 handled := false 388 if t.raw.IsNameString(idx) { 389 k = t.raw.GetNameString(idx) 390 if handled { 391 r = Resolved 392 } 393 } else if t.raw.IsNameLangString(idx) { 394 r = RawResolutionNeeded 395 } else if t.raw.IsNameIRI(idx) { 396 r = RawResolutionNeeded 397 } 398 return 399 400} 401 402// AppendName appends the value for property 'name'. 403func (t *Person) AppendName(k string) { 404 t.raw.AppendNameString(k) 405 406} 407 408// PrependName prepends the value for property 'name'. 409func (t *Person) PrependName(k string) { 410 t.raw.PrependNameString(k) 411 412} 413 414// RemoveName deletes the value from the specified index for property 'name'. 415func (t *Person) RemoveName(idx int) { 416 t.raw.RemoveNameString(idx) 417 418} 419 420// HasName returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 421func (t *Person) HasName(idx int) (p Presence) { 422 p = NoPresence 423 if t.raw.IsNameString(idx) { 424 p = ConvenientPresence 425 } else if t.raw.IsNameLangString(idx) { 426 p = RawPresence 427 } else if t.raw.IsNameIRI(idx) { 428 p = RawPresence 429 } 430 return 431 432} 433 434// NameLanguages returns all languages for this property's language mapping, or nil if there are none. 435func (t *Person) NameLanguages() (l []string) { 436 return t.raw.NameMapLanguages() 437 438} 439 440// GetNameMap retrieves the value of 'name' for the specified language, or an empty string if it does not exist 441func (t *Person) GetNameForLanguage(l string) (v string) { 442 return t.raw.GetNameMap(l) 443 444} 445 446// SetNameForLanguage sets the value of 'name' for the specified language 447func (t *Person) SetNameForLanguage(l string, v string) { 448 t.raw.SetNameMap(l, v) 449 450} 451 452// GetEndTime attempts to get this 'endTime' property as a time.Time. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 453func (t *Person) GetEndTime() (r Resolution, k time.Time) { 454 r = Unresolved 455 handled := false 456 if t.raw.IsEndTime() { 457 k = t.raw.GetEndTime() 458 if handled { 459 r = Resolved 460 } 461 } else if t.raw.IsEndTimeIRI() { 462 r = RawResolutionNeeded 463 } 464 return 465 466} 467 468// HasEndTime returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 469func (t *Person) HasEndTime() (p Presence) { 470 p = NoPresence 471 if t.raw.IsEndTime() { 472 p = ConvenientPresence 473 } else if t.raw.IsEndTimeIRI() { 474 p = RawPresence 475 } 476 return 477 478} 479 480// SetEndTime sets the value for property 'endTime'. 481func (t *Person) SetEndTime(k time.Time) { 482 t.raw.SetEndTime(k) 483 484} 485 486// LenGenerator returns the number of values this property contains. Each index be used with HasGenerator to determine if ResolveGenerator is safe to call or if raw handling would be needed. 487func (t *Person) LenGenerator() (idx int) { 488 return t.raw.GeneratorLen() 489 490} 491 492// ResolveGenerator passes the actual concrete type to the resolver for handing property generator. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 493func (t *Person) ResolveGenerator(r *Resolver, idx int) (s Resolution, err error) { 494 s = Unresolved 495 handled := false 496 if t.raw.IsGeneratorObject(idx) { 497 handled, err = r.dispatch(t.raw.GetGeneratorObject(idx)) 498 if handled { 499 s = Resolved 500 } 501 } else if t.raw.IsGeneratorLink(idx) { 502 handled, err = r.dispatch(t.raw.GetGeneratorLink(idx)) 503 if handled { 504 s = Resolved 505 } 506 } else if t.raw.IsGeneratorIRI(idx) { 507 s = RawResolutionNeeded 508 } 509 return 510 511} 512 513// HasGenerator returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 514func (t *Person) HasGenerator(idx int) (p Presence) { 515 p = NoPresence 516 if t.raw.IsGeneratorObject(idx) { 517 p = ConvenientPresence 518 } else if t.raw.IsGeneratorLink(idx) { 519 p = ConvenientPresence 520 } else if t.raw.IsGeneratorIRI(idx) { 521 p = RawPresence 522 } 523 return 524 525} 526 527// AppendGenerator appends an 'Object' typed value. 528func (t *Person) AppendGenerator(i vocab.ObjectType) { 529 t.raw.AppendGeneratorObject(i) 530 531} 532 533// PrependGenerator prepends an 'Object' typed value. 534func (t *Person) PrependGenerator(i vocab.ObjectType) { 535 t.raw.PrependGeneratorObject(i) 536 537} 538 539// AppendGeneratorLink appends a 'Link' typed value. 540func (t *Person) AppendGeneratorLink(i vocab.LinkType) { 541 t.raw.AppendGeneratorLink(i) 542 543} 544 545// PrependGeneratorLink prepends a 'Link' typed value. 546func (t *Person) PrependGeneratorLink(i vocab.LinkType) { 547 t.raw.PrependGeneratorLink(i) 548 549} 550 551// LenIcon returns the number of values this property contains. Each index be used with HasIcon to determine if ResolveIcon is safe to call or if raw handling would be needed. 552func (t *Person) LenIcon() (idx int) { 553 return t.raw.IconLen() 554 555} 556 557// ResolveIcon passes the actual concrete type to the resolver for handing property icon. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 558func (t *Person) ResolveIcon(r *Resolver, idx int) (s Resolution, err error) { 559 s = Unresolved 560 handled := false 561 if t.raw.IsIconImage(idx) { 562 handled, err = r.dispatch(t.raw.GetIconImage(idx)) 563 if handled { 564 s = Resolved 565 } 566 } else if t.raw.IsIconLink(idx) { 567 s = RawResolutionNeeded 568 } else if t.raw.IsIconIRI(idx) { 569 s = RawResolutionNeeded 570 } 571 return 572 573} 574 575// AppendIcon appends the value for property 'icon'. 576func (t *Person) AppendIcon(i vocab.ImageType) { 577 t.raw.AppendIconImage(i) 578 579} 580 581// PrependIcon prepends the value for property 'icon'. 582func (t *Person) PrependIcon(i vocab.ImageType) { 583 t.raw.PrependIconImage(i) 584 585} 586 587// RemoveIcon deletes the value from the specified index for property 'icon'. 588func (t *Person) RemoveIcon(idx int) { 589 t.raw.RemoveIconImage(idx) 590 591} 592 593// HasIcon returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 594func (t *Person) HasIcon(idx int) (p Presence) { 595 p = NoPresence 596 if t.raw.IsIconImage(idx) { 597 p = ConvenientPresence 598 } else if t.raw.IsIconLink(idx) { 599 p = RawPresence 600 } else if t.raw.IsIconIRI(idx) { 601 p = RawPresence 602 } 603 return 604 605} 606 607// GetId attempts to get this 'id' property as a *url.URL. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 608func (t *Person) GetId() (r Resolution, k *url.URL) { 609 r = Unresolved 610 handled := false 611 if t.raw.HasId() { 612 k = t.raw.GetId() 613 if handled { 614 r = Resolved 615 } 616 } 617 return 618 619} 620 621// HasId returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 622func (t *Person) HasId() (p Presence) { 623 p = NoPresence 624 if t.raw.HasId() { 625 p = ConvenientPresence 626 } 627 return 628 629} 630 631// SetId sets the value for property 'id'. 632func (t *Person) SetId(k *url.URL) { 633 t.raw.SetId(k) 634 635} 636 637// LenImage returns the number of values this property contains. Each index be used with HasImage to determine if ResolveImage is safe to call or if raw handling would be needed. 638func (t *Person) LenImage() (idx int) { 639 return t.raw.ImageLen() 640 641} 642 643// ResolveImage passes the actual concrete type to the resolver for handing property image. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 644func (t *Person) ResolveImage(r *Resolver, idx int) (s Resolution, err error) { 645 s = Unresolved 646 handled := false 647 if t.raw.IsImageImage(idx) { 648 handled, err = r.dispatch(t.raw.GetImageImage(idx)) 649 if handled { 650 s = Resolved 651 } 652 } else if t.raw.IsImageLink(idx) { 653 s = RawResolutionNeeded 654 } else if t.raw.IsImageIRI(idx) { 655 s = RawResolutionNeeded 656 } 657 return 658 659} 660 661// AppendImage appends the value for property 'image'. 662func (t *Person) AppendImage(i vocab.ImageType) { 663 t.raw.AppendImageImage(i) 664 665} 666 667// PrependImage prepends the value for property 'image'. 668func (t *Person) PrependImage(i vocab.ImageType) { 669 t.raw.PrependImageImage(i) 670 671} 672 673// RemoveImage deletes the value from the specified index for property 'image'. 674func (t *Person) RemoveImage(idx int) { 675 t.raw.RemoveImageImage(idx) 676 677} 678 679// HasImage returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 680func (t *Person) HasImage(idx int) (p Presence) { 681 p = NoPresence 682 if t.raw.IsImageImage(idx) { 683 p = ConvenientPresence 684 } else if t.raw.IsImageLink(idx) { 685 p = RawPresence 686 } else if t.raw.IsImageIRI(idx) { 687 p = RawPresence 688 } 689 return 690 691} 692 693// LenInReplyTo returns the number of values this property contains. Each index be used with HasInReplyTo to determine if GetInReplyTo is safe to call or if raw handling would be needed. 694func (t *Person) LenInReplyTo() (idx int) { 695 return t.raw.InReplyToLen() 696 697} 698 699// GetInReplyTo attempts to get this 'inReplyTo' property as a *url.URL. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 700func (t *Person) GetInReplyTo(idx int) (r Resolution, k *url.URL) { 701 r = Unresolved 702 handled := false 703 if t.raw.IsInReplyToIRI(idx) { 704 k = t.raw.GetInReplyToIRI(idx) 705 if handled { 706 r = Resolved 707 } 708 } else if t.raw.IsInReplyToObject(idx) { 709 r = RawResolutionNeeded 710 } else if t.raw.IsInReplyToLink(idx) { 711 r = RawResolutionNeeded 712 } 713 return 714 715} 716 717// AppendInReplyTo appends the value for property 'inReplyTo'. 718func (t *Person) AppendInReplyTo(k *url.URL) { 719 t.raw.AppendInReplyToIRI(k) 720 721} 722 723// PrependInReplyTo prepends the value for property 'inReplyTo'. 724func (t *Person) PrependInReplyTo(k *url.URL) { 725 t.raw.PrependInReplyToIRI(k) 726 727} 728 729// RemoveInReplyTo deletes the value from the specified index for property 'inReplyTo'. 730func (t *Person) RemoveInReplyTo(idx int) { 731 t.raw.RemoveInReplyToIRI(idx) 732 733} 734 735// HasInReplyTo returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 736func (t *Person) HasInReplyTo(idx int) (p Presence) { 737 p = NoPresence 738 if t.raw.IsInReplyToIRI(idx) { 739 p = ConvenientPresence 740 } else if t.raw.IsInReplyToLink(idx) { 741 p = RawPresence 742 } else if t.raw.IsInReplyToIRI(idx) { 743 p = RawPresence 744 } 745 return 746 747} 748 749// LenLocation returns the number of values this property contains. Each index be used with HasLocation to determine if ResolveLocation is safe to call or if raw handling would be needed. 750func (t *Person) LenLocation() (idx int) { 751 return t.raw.LocationLen() 752 753} 754 755// ResolveLocation passes the actual concrete type to the resolver for handing property location. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 756func (t *Person) ResolveLocation(r *Resolver, idx int) (s Resolution, err error) { 757 s = Unresolved 758 handled := false 759 if t.raw.IsLocationObject(idx) { 760 handled, err = r.dispatch(t.raw.GetLocationObject(idx)) 761 if handled { 762 s = Resolved 763 } 764 } else if t.raw.IsLocationLink(idx) { 765 handled, err = r.dispatch(t.raw.GetLocationLink(idx)) 766 if handled { 767 s = Resolved 768 } 769 } else if t.raw.IsLocationIRI(idx) { 770 s = RawResolutionNeeded 771 } 772 return 773 774} 775 776// HasLocation returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 777func (t *Person) HasLocation(idx int) (p Presence) { 778 p = NoPresence 779 if t.raw.IsLocationObject(idx) { 780 p = ConvenientPresence 781 } else if t.raw.IsLocationLink(idx) { 782 p = ConvenientPresence 783 } else if t.raw.IsLocationIRI(idx) { 784 p = RawPresence 785 } 786 return 787 788} 789 790// AppendLocation appends an 'Object' typed value. 791func (t *Person) AppendLocation(i vocab.ObjectType) { 792 t.raw.AppendLocationObject(i) 793 794} 795 796// PrependLocation prepends an 'Object' typed value. 797func (t *Person) PrependLocation(i vocab.ObjectType) { 798 t.raw.PrependLocationObject(i) 799 800} 801 802// AppendLocationLink appends a 'Link' typed value. 803func (t *Person) AppendLocationLink(i vocab.LinkType) { 804 t.raw.AppendLocationLink(i) 805 806} 807 808// PrependLocationLink prepends a 'Link' typed value. 809func (t *Person) PrependLocationLink(i vocab.LinkType) { 810 t.raw.PrependLocationLink(i) 811 812} 813 814// LenPreview returns the number of values this property contains. Each index be used with HasPreview to determine if ResolvePreview is safe to call or if raw handling would be needed. 815func (t *Person) LenPreview() (idx int) { 816 return t.raw.PreviewLen() 817 818} 819 820// ResolvePreview passes the actual concrete type to the resolver for handing property preview. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 821func (t *Person) ResolvePreview(r *Resolver, idx int) (s Resolution, err error) { 822 s = Unresolved 823 handled := false 824 if t.raw.IsPreviewObject(idx) { 825 handled, err = r.dispatch(t.raw.GetPreviewObject(idx)) 826 if handled { 827 s = Resolved 828 } 829 } else if t.raw.IsPreviewLink(idx) { 830 handled, err = r.dispatch(t.raw.GetPreviewLink(idx)) 831 if handled { 832 s = Resolved 833 } 834 } else if t.raw.IsPreviewIRI(idx) { 835 s = RawResolutionNeeded 836 } 837 return 838 839} 840 841// HasPreview returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 842func (t *Person) HasPreview(idx int) (p Presence) { 843 p = NoPresence 844 if t.raw.IsPreviewObject(idx) { 845 p = ConvenientPresence 846 } else if t.raw.IsPreviewLink(idx) { 847 p = ConvenientPresence 848 } else if t.raw.IsPreviewIRI(idx) { 849 p = RawPresence 850 } 851 return 852 853} 854 855// AppendPreview appends an 'Object' typed value. 856func (t *Person) AppendPreview(i vocab.ObjectType) { 857 t.raw.AppendPreviewObject(i) 858 859} 860 861// PrependPreview prepends an 'Object' typed value. 862func (t *Person) PrependPreview(i vocab.ObjectType) { 863 t.raw.PrependPreviewObject(i) 864 865} 866 867// AppendPreviewLink appends a 'Link' typed value. 868func (t *Person) AppendPreviewLink(i vocab.LinkType) { 869 t.raw.AppendPreviewLink(i) 870 871} 872 873// PrependPreviewLink prepends a 'Link' typed value. 874func (t *Person) PrependPreviewLink(i vocab.LinkType) { 875 t.raw.PrependPreviewLink(i) 876 877} 878 879// GetPublished attempts to get this 'published' property as a time.Time. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 880func (t *Person) GetPublished() (r Resolution, k time.Time) { 881 r = Unresolved 882 handled := false 883 if t.raw.IsPublished() { 884 k = t.raw.GetPublished() 885 if handled { 886 r = Resolved 887 } 888 } else if t.raw.IsPublishedIRI() { 889 r = RawResolutionNeeded 890 } 891 return 892 893} 894 895// HasPublished returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 896func (t *Person) HasPublished() (p Presence) { 897 p = NoPresence 898 if t.raw.IsPublished() { 899 p = ConvenientPresence 900 } else if t.raw.IsPublishedIRI() { 901 p = RawPresence 902 } 903 return 904 905} 906 907// SetPublished sets the value for property 'published'. 908func (t *Person) SetPublished(k time.Time) { 909 t.raw.SetPublished(k) 910 911} 912 913// ResolveReplies passes the actual concrete type to the resolver for handing property replies. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 914func (t *Person) ResolveReplies(r *Resolver) (s Resolution, err error) { 915 s = Unresolved 916 handled := false 917 if t.raw.IsReplies() { 918 handled, err = r.dispatch(t.raw.GetReplies()) 919 if handled { 920 s = Resolved 921 } 922 } else if t.raw.IsRepliesIRI() { 923 s = RawResolutionNeeded 924 } 925 return 926 927} 928 929// HasReplies returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 930func (t *Person) HasReplies() (p Presence) { 931 p = NoPresence 932 if t.raw.IsReplies() { 933 p = ConvenientPresence 934 } else if t.raw.IsRepliesIRI() { 935 p = RawPresence 936 } 937 return 938 939} 940 941// SetReplies sets this value to be a 'Collection' type. 942func (t *Person) SetReplies(i vocab.CollectionType) { 943 t.raw.SetReplies(i) 944 945} 946 947// GetStartTime attempts to get this 'startTime' property as a time.Time. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 948func (t *Person) GetStartTime() (r Resolution, k time.Time) { 949 r = Unresolved 950 handled := false 951 if t.raw.IsStartTime() { 952 k = t.raw.GetStartTime() 953 if handled { 954 r = Resolved 955 } 956 } else if t.raw.IsStartTimeIRI() { 957 r = RawResolutionNeeded 958 } 959 return 960 961} 962 963// HasStartTime returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 964func (t *Person) HasStartTime() (p Presence) { 965 p = NoPresence 966 if t.raw.IsStartTime() { 967 p = ConvenientPresence 968 } else if t.raw.IsStartTimeIRI() { 969 p = RawPresence 970 } 971 return 972 973} 974 975// SetStartTime sets the value for property 'startTime'. 976func (t *Person) SetStartTime(k time.Time) { 977 t.raw.SetStartTime(k) 978 979} 980 981// LenSummary returns the number of values this property contains. Each index be used with HasSummary to determine if GetSummary is safe to call or if raw handling would be needed. 982func (t *Person) LenSummary() (idx int) { 983 return t.raw.SummaryLen() 984 985} 986 987// GetSummary attempts to get this 'summary' property as a string. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 988func (t *Person) GetSummary(idx int) (r Resolution, k string) { 989 r = Unresolved 990 handled := false 991 if t.raw.IsSummaryString(idx) { 992 k = t.raw.GetSummaryString(idx) 993 if handled { 994 r = Resolved 995 } 996 } else if t.raw.IsSummaryLangString(idx) { 997 r = RawResolutionNeeded 998 } else if t.raw.IsSummaryIRI(idx) { 999 r = RawResolutionNeeded 1000 } 1001 return 1002 1003} 1004 1005// AppendSummary appends the value for property 'summary'. 1006func (t *Person) AppendSummary(k string) { 1007 t.raw.AppendSummaryString(k) 1008 1009} 1010 1011// PrependSummary prepends the value for property 'summary'. 1012func (t *Person) PrependSummary(k string) { 1013 t.raw.PrependSummaryString(k) 1014 1015} 1016 1017// RemoveSummary deletes the value from the specified index for property 'summary'. 1018func (t *Person) RemoveSummary(idx int) { 1019 t.raw.RemoveSummaryString(idx) 1020 1021} 1022 1023// HasSummary returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1024func (t *Person) HasSummary(idx int) (p Presence) { 1025 p = NoPresence 1026 if t.raw.IsSummaryString(idx) { 1027 p = ConvenientPresence 1028 } else if t.raw.IsSummaryLangString(idx) { 1029 p = RawPresence 1030 } else if t.raw.IsSummaryIRI(idx) { 1031 p = RawPresence 1032 } 1033 return 1034 1035} 1036 1037// SummaryLanguages returns all languages for this property's language mapping, or nil if there are none. 1038func (t *Person) SummaryLanguages() (l []string) { 1039 return t.raw.SummaryMapLanguages() 1040 1041} 1042 1043// GetSummaryMap retrieves the value of 'summary' for the specified language, or an empty string if it does not exist 1044func (t *Person) GetSummaryForLanguage(l string) (v string) { 1045 return t.raw.GetSummaryMap(l) 1046 1047} 1048 1049// SetSummaryForLanguage sets the value of 'summary' for the specified language 1050func (t *Person) SetSummaryForLanguage(l string, v string) { 1051 t.raw.SetSummaryMap(l, v) 1052 1053} 1054 1055// LenTag returns the number of values this property contains. Each index be used with HasTag to determine if ResolveTag is safe to call or if raw handling would be needed. 1056func (t *Person) LenTag() (idx int) { 1057 return t.raw.TagLen() 1058 1059} 1060 1061// ResolveTag passes the actual concrete type to the resolver for handing property tag. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1062func (t *Person) ResolveTag(r *Resolver, idx int) (s Resolution, err error) { 1063 s = Unresolved 1064 handled := false 1065 if t.raw.IsTagObject(idx) { 1066 handled, err = r.dispatch(t.raw.GetTagObject(idx)) 1067 if handled { 1068 s = Resolved 1069 } 1070 } else if t.raw.IsTagLink(idx) { 1071 handled, err = r.dispatch(t.raw.GetTagLink(idx)) 1072 if handled { 1073 s = Resolved 1074 } 1075 } else if t.raw.IsTagIRI(idx) { 1076 s = RawResolutionNeeded 1077 } 1078 return 1079 1080} 1081 1082// HasTag returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1083func (t *Person) HasTag(idx int) (p Presence) { 1084 p = NoPresence 1085 if t.raw.IsTagObject(idx) { 1086 p = ConvenientPresence 1087 } else if t.raw.IsTagLink(idx) { 1088 p = ConvenientPresence 1089 } else if t.raw.IsTagIRI(idx) { 1090 p = RawPresence 1091 } 1092 return 1093 1094} 1095 1096// AppendTag appends an 'Object' typed value. 1097func (t *Person) AppendTag(i vocab.ObjectType) { 1098 t.raw.AppendTagObject(i) 1099 1100} 1101 1102// PrependTag prepends an 'Object' typed value. 1103func (t *Person) PrependTag(i vocab.ObjectType) { 1104 t.raw.PrependTagObject(i) 1105 1106} 1107 1108// AppendTagLink appends a 'Link' typed value. 1109func (t *Person) AppendTagLink(i vocab.LinkType) { 1110 t.raw.AppendTagLink(i) 1111 1112} 1113 1114// PrependTagLink prepends a 'Link' typed value. 1115func (t *Person) PrependTagLink(i vocab.LinkType) { 1116 t.raw.PrependTagLink(i) 1117 1118} 1119 1120// LenType returns the number of values this property contains. Each index be used with HasType to determine if GetType is safe to call or if raw handling would be needed. 1121func (t *Person) LenType() (idx int) { 1122 return t.raw.TypeLen() 1123 1124} 1125 1126// GetType attempts to get this 'type' property as a string. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 1127func (t *Person) GetType(idx int) (r Resolution, s string) { 1128 r = Unresolved 1129 if tmp := t.raw.GetType(idx); tmp != nil { 1130 ok := false 1131 if s, ok = tmp.(string); ok { 1132 r = Resolved 1133 } else { 1134 r = RawResolutionNeeded 1135 } 1136 } 1137 return 1138 1139} 1140 1141// AppendType appends the value for property 'type'. 1142func (t *Person) AppendType(i interface{}) { 1143 t.raw.AppendType(i) 1144 1145} 1146 1147// PrependType prepends the value for property 'type'. 1148func (t *Person) PrependType(i interface{}) { 1149 t.raw.PrependType(i) 1150 1151} 1152 1153// RemoveType deletes the value from the specified index for property 'type'. 1154func (t *Person) RemoveType(idx int) { 1155 t.raw.RemoveType(idx) 1156 1157} 1158 1159// GetUpdated attempts to get this 'updated' property as a time.Time. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 1160func (t *Person) GetUpdated() (r Resolution, k time.Time) { 1161 r = Unresolved 1162 handled := false 1163 if t.raw.IsUpdated() { 1164 k = t.raw.GetUpdated() 1165 if handled { 1166 r = Resolved 1167 } 1168 } else if t.raw.IsUpdatedIRI() { 1169 r = RawResolutionNeeded 1170 } 1171 return 1172 1173} 1174 1175// HasUpdated returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1176func (t *Person) HasUpdated() (p Presence) { 1177 p = NoPresence 1178 if t.raw.IsUpdated() { 1179 p = ConvenientPresence 1180 } else if t.raw.IsUpdatedIRI() { 1181 p = RawPresence 1182 } 1183 return 1184 1185} 1186 1187// SetUpdated sets the value for property 'updated'. 1188func (t *Person) SetUpdated(k time.Time) { 1189 t.raw.SetUpdated(k) 1190 1191} 1192 1193// LenUrl returns the number of values this property contains. Each index be used with HasUrl to determine if GetUrl is safe to call or if raw handling would be needed. 1194func (t *Person) LenUrl() (idx int) { 1195 return t.raw.UrlLen() 1196 1197} 1198 1199// GetUrl attempts to get this 'url' property as a *url.URL. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 1200func (t *Person) GetUrl(idx int) (r Resolution, k *url.URL) { 1201 r = Unresolved 1202 handled := false 1203 if t.raw.IsUrlAnyURI(idx) { 1204 k = t.raw.GetUrlAnyURI(idx) 1205 if handled { 1206 r = Resolved 1207 } 1208 } else if t.raw.IsUrlLink(idx) { 1209 r = RawResolutionNeeded 1210 } 1211 return 1212 1213} 1214 1215// AppendUrl appends the value for property 'url'. 1216func (t *Person) AppendUrl(k *url.URL) { 1217 t.raw.AppendUrlAnyURI(k) 1218 1219} 1220 1221// PrependUrl prepends the value for property 'url'. 1222func (t *Person) PrependUrl(k *url.URL) { 1223 t.raw.PrependUrlAnyURI(k) 1224 1225} 1226 1227// RemoveUrl deletes the value from the specified index for property 'url'. 1228func (t *Person) RemoveUrl(idx int) { 1229 t.raw.RemoveUrlAnyURI(idx) 1230 1231} 1232 1233// HasUrl returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1234func (t *Person) HasUrl(idx int) (p Presence) { 1235 p = NoPresence 1236 if t.raw.IsUrlAnyURI(idx) { 1237 p = ConvenientPresence 1238 } else if t.raw.IsUrlLink(idx) { 1239 p = RawPresence 1240 } 1241 return 1242 1243} 1244 1245// LenTo returns the number of values this property contains. Each index be used with HasTo to determine if GetTo is safe to call or if raw handling would be needed. 1246func (t *Person) LenTo() (idx int) { 1247 return t.raw.ToLen() 1248 1249} 1250 1251// GetTo attempts to get this 'to' property as a *url.URL. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 1252func (t *Person) GetTo(idx int) (r Resolution, k *url.URL) { 1253 r = Unresolved 1254 handled := false 1255 if t.raw.IsToIRI(idx) { 1256 k = t.raw.GetToIRI(idx) 1257 if handled { 1258 r = Resolved 1259 } 1260 } else if t.raw.IsToObject(idx) { 1261 r = RawResolutionNeeded 1262 } else if t.raw.IsToLink(idx) { 1263 r = RawResolutionNeeded 1264 } 1265 return 1266 1267} 1268 1269// AppendTo appends the value for property 'to'. 1270func (t *Person) AppendTo(k *url.URL) { 1271 t.raw.AppendToIRI(k) 1272 1273} 1274 1275// PrependTo prepends the value for property 'to'. 1276func (t *Person) PrependTo(k *url.URL) { 1277 t.raw.PrependToIRI(k) 1278 1279} 1280 1281// RemoveTo deletes the value from the specified index for property 'to'. 1282func (t *Person) RemoveTo(idx int) { 1283 t.raw.RemoveToIRI(idx) 1284 1285} 1286 1287// HasTo returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1288func (t *Person) HasTo(idx int) (p Presence) { 1289 p = NoPresence 1290 if t.raw.IsToIRI(idx) { 1291 p = ConvenientPresence 1292 } else if t.raw.IsToLink(idx) { 1293 p = RawPresence 1294 } else if t.raw.IsToIRI(idx) { 1295 p = RawPresence 1296 } 1297 return 1298 1299} 1300 1301// LenBto returns the number of values this property contains. Each index be used with HasBto to determine if GetBto is safe to call or if raw handling would be needed. 1302func (t *Person) LenBto() (idx int) { 1303 return t.raw.BtoLen() 1304 1305} 1306 1307// GetBto attempts to get this 'bto' property as a *url.URL. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 1308func (t *Person) GetBto(idx int) (r Resolution, k *url.URL) { 1309 r = Unresolved 1310 handled := false 1311 if t.raw.IsBtoIRI(idx) { 1312 k = t.raw.GetBtoIRI(idx) 1313 if handled { 1314 r = Resolved 1315 } 1316 } else if t.raw.IsBtoObject(idx) { 1317 r = RawResolutionNeeded 1318 } else if t.raw.IsBtoLink(idx) { 1319 r = RawResolutionNeeded 1320 } 1321 return 1322 1323} 1324 1325// AppendBto appends the value for property 'bto'. 1326func (t *Person) AppendBto(k *url.URL) { 1327 t.raw.AppendBtoIRI(k) 1328 1329} 1330 1331// PrependBto prepends the value for property 'bto'. 1332func (t *Person) PrependBto(k *url.URL) { 1333 t.raw.PrependBtoIRI(k) 1334 1335} 1336 1337// RemoveBto deletes the value from the specified index for property 'bto'. 1338func (t *Person) RemoveBto(idx int) { 1339 t.raw.RemoveBtoIRI(idx) 1340 1341} 1342 1343// HasBto returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1344func (t *Person) HasBto(idx int) (p Presence) { 1345 p = NoPresence 1346 if t.raw.IsBtoIRI(idx) { 1347 p = ConvenientPresence 1348 } else if t.raw.IsBtoLink(idx) { 1349 p = RawPresence 1350 } else if t.raw.IsBtoIRI(idx) { 1351 p = RawPresence 1352 } 1353 return 1354 1355} 1356 1357// LenCc returns the number of values this property contains. Each index be used with HasCc to determine if GetCc is safe to call or if raw handling would be needed. 1358func (t *Person) LenCc() (idx int) { 1359 return t.raw.CcLen() 1360 1361} 1362 1363// GetCc attempts to get this 'cc' property as a *url.URL. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 1364func (t *Person) GetCc(idx int) (r Resolution, k *url.URL) { 1365 r = Unresolved 1366 handled := false 1367 if t.raw.IsCcIRI(idx) { 1368 k = t.raw.GetCcIRI(idx) 1369 if handled { 1370 r = Resolved 1371 } 1372 } else if t.raw.IsCcObject(idx) { 1373 r = RawResolutionNeeded 1374 } else if t.raw.IsCcLink(idx) { 1375 r = RawResolutionNeeded 1376 } 1377 return 1378 1379} 1380 1381// AppendCc appends the value for property 'cc'. 1382func (t *Person) AppendCc(k *url.URL) { 1383 t.raw.AppendCcIRI(k) 1384 1385} 1386 1387// PrependCc prepends the value for property 'cc'. 1388func (t *Person) PrependCc(k *url.URL) { 1389 t.raw.PrependCcIRI(k) 1390 1391} 1392 1393// RemoveCc deletes the value from the specified index for property 'cc'. 1394func (t *Person) RemoveCc(idx int) { 1395 t.raw.RemoveCcIRI(idx) 1396 1397} 1398 1399// HasCc returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1400func (t *Person) HasCc(idx int) (p Presence) { 1401 p = NoPresence 1402 if t.raw.IsCcIRI(idx) { 1403 p = ConvenientPresence 1404 } else if t.raw.IsCcLink(idx) { 1405 p = RawPresence 1406 } else if t.raw.IsCcIRI(idx) { 1407 p = RawPresence 1408 } 1409 return 1410 1411} 1412 1413// LenBcc returns the number of values this property contains. Each index be used with HasBcc to determine if GetBcc is safe to call or if raw handling would be needed. 1414func (t *Person) LenBcc() (idx int) { 1415 return t.raw.BccLen() 1416 1417} 1418 1419// GetBcc attempts to get this 'bcc' property as a *url.URL. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 1420func (t *Person) GetBcc(idx int) (r Resolution, k *url.URL) { 1421 r = Unresolved 1422 handled := false 1423 if t.raw.IsBccIRI(idx) { 1424 k = t.raw.GetBccIRI(idx) 1425 if handled { 1426 r = Resolved 1427 } 1428 } else if t.raw.IsBccObject(idx) { 1429 r = RawResolutionNeeded 1430 } else if t.raw.IsBccLink(idx) { 1431 r = RawResolutionNeeded 1432 } 1433 return 1434 1435} 1436 1437// AppendBcc appends the value for property 'bcc'. 1438func (t *Person) AppendBcc(k *url.URL) { 1439 t.raw.AppendBccIRI(k) 1440 1441} 1442 1443// PrependBcc prepends the value for property 'bcc'. 1444func (t *Person) PrependBcc(k *url.URL) { 1445 t.raw.PrependBccIRI(k) 1446 1447} 1448 1449// RemoveBcc deletes the value from the specified index for property 'bcc'. 1450func (t *Person) RemoveBcc(idx int) { 1451 t.raw.RemoveBccIRI(idx) 1452 1453} 1454 1455// HasBcc returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1456func (t *Person) HasBcc(idx int) (p Presence) { 1457 p = NoPresence 1458 if t.raw.IsBccIRI(idx) { 1459 p = ConvenientPresence 1460 } else if t.raw.IsBccLink(idx) { 1461 p = RawPresence 1462 } else if t.raw.IsBccIRI(idx) { 1463 p = RawPresence 1464 } 1465 return 1466 1467} 1468 1469// GetMediaType attempts to get this 'mediaType' property as a string. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 1470func (t *Person) GetMediaType() (r Resolution, k string) { 1471 r = Unresolved 1472 handled := false 1473 if t.raw.IsMediaType() { 1474 k = t.raw.GetMediaType() 1475 if handled { 1476 r = Resolved 1477 } 1478 } else if t.raw.IsMediaTypeIRI() { 1479 r = RawResolutionNeeded 1480 } 1481 return 1482 1483} 1484 1485// HasMediaType returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1486func (t *Person) HasMediaType() (p Presence) { 1487 p = NoPresence 1488 if t.raw.IsMediaType() { 1489 p = ConvenientPresence 1490 } else if t.raw.IsMediaTypeIRI() { 1491 p = RawPresence 1492 } 1493 return 1494 1495} 1496 1497// SetMediaType sets the value for property 'mediaType'. 1498func (t *Person) SetMediaType(k string) { 1499 t.raw.SetMediaType(k) 1500 1501} 1502 1503// GetDuration attempts to get this 'duration' property as a time.Duration. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 1504func (t *Person) GetDuration() (r Resolution, k time.Duration) { 1505 r = Unresolved 1506 handled := false 1507 if t.raw.IsDuration() { 1508 k = t.raw.GetDuration() 1509 if handled { 1510 r = Resolved 1511 } 1512 } else if t.raw.IsDurationIRI() { 1513 r = RawResolutionNeeded 1514 } 1515 return 1516 1517} 1518 1519// HasDuration returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1520func (t *Person) HasDuration() (p Presence) { 1521 p = NoPresence 1522 if t.raw.IsDuration() { 1523 p = ConvenientPresence 1524 } else if t.raw.IsDurationIRI() { 1525 p = RawPresence 1526 } 1527 return 1528 1529} 1530 1531// SetDuration sets the value for property 'duration'. 1532func (t *Person) SetDuration(k time.Duration) { 1533 t.raw.SetDuration(k) 1534 1535} 1536 1537// ResolveSource passes the actual concrete type to the resolver for handing property source. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1538func (t *Person) ResolveSource(r *Resolver) (s Resolution, err error) { 1539 s = Unresolved 1540 handled := false 1541 if t.raw.IsSource() { 1542 handled, err = r.dispatch(t.raw.GetSource()) 1543 if handled { 1544 s = Resolved 1545 } 1546 } else if t.raw.IsSourceIRI() { 1547 s = RawResolutionNeeded 1548 } 1549 return 1550 1551} 1552 1553// HasSource returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1554func (t *Person) HasSource() (p Presence) { 1555 p = NoPresence 1556 if t.raw.IsSource() { 1557 p = ConvenientPresence 1558 } else if t.raw.IsSourceIRI() { 1559 p = RawPresence 1560 } 1561 return 1562 1563} 1564 1565// SetSource sets this value to be a 'Object' type. 1566func (t *Person) SetSource(i vocab.ObjectType) { 1567 t.raw.SetSource(i) 1568 1569} 1570 1571// ResolveInbox passes the actual concrete type to the resolver for handing property inbox. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1572func (t *Person) ResolveInbox(r *Resolver) (s Resolution, err error) { 1573 s = Unresolved 1574 handled := false 1575 if t.raw.IsInboxOrderedCollection() { 1576 handled, err = r.dispatch(t.raw.GetInboxOrderedCollection()) 1577 if handled { 1578 s = Resolved 1579 } 1580 } else if t.raw.IsInboxAnyURI() { 1581 s = RawResolutionNeeded 1582 } 1583 return 1584 1585} 1586 1587// HasInbox returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1588func (t *Person) HasInbox() (p Presence) { 1589 p = NoPresence 1590 if t.raw.IsInboxOrderedCollection() { 1591 p = ConvenientPresence 1592 } else if t.raw.IsInboxAnyURI() { 1593 p = RawPresence 1594 } 1595 return 1596 1597} 1598 1599// SetInbox sets this value to be a 'OrderedCollection' type. 1600func (t *Person) SetInbox(i vocab.OrderedCollectionType) { 1601 t.raw.SetInboxOrderedCollection(i) 1602 1603} 1604 1605// ResolveOutbox passes the actual concrete type to the resolver for handing property outbox. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1606func (t *Person) ResolveOutbox(r *Resolver) (s Resolution, err error) { 1607 s = Unresolved 1608 handled := false 1609 if t.raw.IsOutboxOrderedCollection() { 1610 handled, err = r.dispatch(t.raw.GetOutboxOrderedCollection()) 1611 if handled { 1612 s = Resolved 1613 } 1614 } else if t.raw.IsOutboxAnyURI() { 1615 s = RawResolutionNeeded 1616 } 1617 return 1618 1619} 1620 1621// HasOutbox returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1622func (t *Person) HasOutbox() (p Presence) { 1623 p = NoPresence 1624 if t.raw.IsOutboxOrderedCollection() { 1625 p = ConvenientPresence 1626 } else if t.raw.IsOutboxAnyURI() { 1627 p = RawPresence 1628 } 1629 return 1630 1631} 1632 1633// SetOutbox sets this value to be a 'OrderedCollection' type. 1634func (t *Person) SetOutbox(i vocab.OrderedCollectionType) { 1635 t.raw.SetOutboxOrderedCollection(i) 1636 1637} 1638 1639// ResolveFollowing passes the actual concrete type to the resolver for handing property following. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1640func (t *Person) ResolveFollowing(r *Resolver) (s Resolution, err error) { 1641 s = Unresolved 1642 handled := false 1643 if t.raw.IsFollowingCollection() { 1644 handled, err = r.dispatch(t.raw.GetFollowingCollection()) 1645 if handled { 1646 s = Resolved 1647 } 1648 } else if t.raw.IsFollowingOrderedCollection() { 1649 s = RawResolutionNeeded 1650 } else if t.raw.IsFollowingAnyURI() { 1651 s = RawResolutionNeeded 1652 } 1653 return 1654 1655} 1656 1657// HasFollowing returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1658func (t *Person) HasFollowing() (p Presence) { 1659 p = NoPresence 1660 if t.raw.IsFollowingCollection() { 1661 p = ConvenientPresence 1662 } else if t.raw.IsFollowingOrderedCollection() { 1663 p = RawPresence 1664 } else if t.raw.IsFollowingAnyURI() { 1665 p = RawPresence 1666 } 1667 return 1668 1669} 1670 1671// SetFollowing sets this value to be a 'Collection' type. 1672func (t *Person) SetFollowing(i vocab.CollectionType) { 1673 t.raw.SetFollowingCollection(i) 1674 1675} 1676 1677// ResolveFollowers passes the actual concrete type to the resolver for handing property followers. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1678func (t *Person) ResolveFollowers(r *Resolver) (s Resolution, err error) { 1679 s = Unresolved 1680 handled := false 1681 if t.raw.IsFollowersCollection() { 1682 handled, err = r.dispatch(t.raw.GetFollowersCollection()) 1683 if handled { 1684 s = Resolved 1685 } 1686 } else if t.raw.IsFollowersOrderedCollection() { 1687 s = RawResolutionNeeded 1688 } else if t.raw.IsFollowersAnyURI() { 1689 s = RawResolutionNeeded 1690 } 1691 return 1692 1693} 1694 1695// HasFollowers returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1696func (t *Person) HasFollowers() (p Presence) { 1697 p = NoPresence 1698 if t.raw.IsFollowersCollection() { 1699 p = ConvenientPresence 1700 } else if t.raw.IsFollowersOrderedCollection() { 1701 p = RawPresence 1702 } else if t.raw.IsFollowersAnyURI() { 1703 p = RawPresence 1704 } 1705 return 1706 1707} 1708 1709// SetFollowers sets this value to be a 'Collection' type. 1710func (t *Person) SetFollowers(i vocab.CollectionType) { 1711 t.raw.SetFollowersCollection(i) 1712 1713} 1714 1715// ResolveLiked passes the actual concrete type to the resolver for handing property liked. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1716func (t *Person) ResolveLiked(r *Resolver) (s Resolution, err error) { 1717 s = Unresolved 1718 handled := false 1719 if t.raw.IsLikedCollection() { 1720 handled, err = r.dispatch(t.raw.GetLikedCollection()) 1721 if handled { 1722 s = Resolved 1723 } 1724 } else if t.raw.IsLikedOrderedCollection() { 1725 s = RawResolutionNeeded 1726 } else if t.raw.IsLikedAnyURI() { 1727 s = RawResolutionNeeded 1728 } 1729 return 1730 1731} 1732 1733// HasLiked returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1734func (t *Person) HasLiked() (p Presence) { 1735 p = NoPresence 1736 if t.raw.IsLikedCollection() { 1737 p = ConvenientPresence 1738 } else if t.raw.IsLikedOrderedCollection() { 1739 p = RawPresence 1740 } else if t.raw.IsLikedAnyURI() { 1741 p = RawPresence 1742 } 1743 return 1744 1745} 1746 1747// SetLiked sets this value to be a 'Collection' type. 1748func (t *Person) SetLiked(i vocab.CollectionType) { 1749 t.raw.SetLikedCollection(i) 1750 1751} 1752 1753// ResolveLikes passes the actual concrete type to the resolver for handing property likes. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1754func (t *Person) ResolveLikes(r *Resolver) (s Resolution, err error) { 1755 s = Unresolved 1756 handled := false 1757 if t.raw.IsLikesCollection() { 1758 handled, err = r.dispatch(t.raw.GetLikesCollection()) 1759 if handled { 1760 s = Resolved 1761 } 1762 } else if t.raw.IsLikesOrderedCollection() { 1763 s = RawResolutionNeeded 1764 } else if t.raw.IsLikesAnyURI() { 1765 s = RawResolutionNeeded 1766 } 1767 return 1768 1769} 1770 1771// HasLikes returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1772func (t *Person) HasLikes() (p Presence) { 1773 p = NoPresence 1774 if t.raw.IsLikesCollection() { 1775 p = ConvenientPresence 1776 } else if t.raw.IsLikesOrderedCollection() { 1777 p = RawPresence 1778 } else if t.raw.IsLikesAnyURI() { 1779 p = RawPresence 1780 } 1781 return 1782 1783} 1784 1785// SetLikes sets this value to be a 'Collection' type. 1786func (t *Person) SetLikes(i vocab.CollectionType) { 1787 t.raw.SetLikesCollection(i) 1788 1789} 1790 1791// LenStreams returns the number of values this property contains. Each index be used with HasStreams to determine if GetStreams is safe to call or if raw handling would be needed. 1792func (t *Person) LenStreams() (idx int) { 1793 return t.raw.StreamsLen() 1794 1795} 1796 1797// GetStreams attempts to get this 'streams' property as a *url.URL. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 1798func (t *Person) GetStreams(idx int) (r Resolution, k *url.URL) { 1799 r = Unresolved 1800 handled := false 1801 if /*t.raw.HasStreams(idx)*/ true { 1802 k = t.raw.GetStreams(idx) 1803 if handled { 1804 r = Resolved 1805 } 1806 } 1807 return 1808 1809} 1810 1811// AppendStreams appends the value for property 'streams'. 1812func (t *Person) AppendStreams(k *url.URL) { 1813 t.raw.AppendStreams(k) 1814 1815} 1816 1817// PrependStreams prepends the value for property 'streams'. 1818func (t *Person) PrependStreams(k *url.URL) { 1819 t.raw.PrependStreams(k) 1820 1821} 1822 1823// RemoveStreams deletes the value from the specified index for property 'streams'. 1824func (t *Person) RemoveStreams(idx int) { 1825 t.raw.RemoveStreams(idx) 1826 1827} 1828 1829// GetPreferredUsername attempts to get this 'preferredUsername' property as a string. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 1830func (t *Person) GetPreferredUsername() (r Resolution, k string) { 1831 r = Unresolved 1832 handled := false 1833 if t.raw.IsPreferredUsername() { 1834 k = t.raw.GetPreferredUsername() 1835 if handled { 1836 r = Resolved 1837 } 1838 } else if t.raw.IsPreferredUsernameIRI() { 1839 r = RawResolutionNeeded 1840 } 1841 return 1842 1843} 1844 1845// HasPreferredUsername returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1846func (t *Person) HasPreferredUsername() (p Presence) { 1847 p = NoPresence 1848 if t.raw.IsPreferredUsername() { 1849 p = ConvenientPresence 1850 } else if t.raw.IsPreferredUsernameIRI() { 1851 p = RawPresence 1852 } 1853 return 1854 1855} 1856 1857// SetPreferredUsername sets the value for property 'preferredUsername'. 1858func (t *Person) SetPreferredUsername(k string) { 1859 t.raw.SetPreferredUsername(k) 1860 1861} 1862 1863// PreferredUsernameLanguages returns all languages for this property's language mapping, or nil if there are none. 1864func (t *Person) PreferredUsernameLanguages() (l []string) { 1865 return t.raw.PreferredUsernameMapLanguages() 1866 1867} 1868 1869// GetPreferredUsernameMap retrieves the value of 'preferredUsername' for the specified language, or an empty string if it does not exist 1870func (t *Person) GetPreferredUsernameForLanguage(l string) (v string) { 1871 return t.raw.GetPreferredUsernameMap(l) 1872 1873} 1874 1875// SetPreferredUsernameForLanguage sets the value of 'preferredUsername' for the specified language 1876func (t *Person) SetPreferredUsernameForLanguage(l string, v string) { 1877 t.raw.SetPreferredUsernameMap(l, v) 1878 1879} 1880 1881// ResolveEndpoints passes the actual concrete type to the resolver for handing property endpoints. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1882func (t *Person) ResolveEndpoints(r *Resolver) (s Resolution, err error) { 1883 s = Unresolved 1884 handled := false 1885 if t.raw.IsEndpoints() { 1886 handled, err = r.dispatch(t.raw.GetEndpoints()) 1887 if handled { 1888 s = Resolved 1889 } 1890 } else if t.raw.IsEndpointsIRI() { 1891 s = RawResolutionNeeded 1892 } 1893 return 1894 1895} 1896 1897// HasEndpoints returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1898func (t *Person) HasEndpoints() (p Presence) { 1899 p = NoPresence 1900 if t.raw.IsEndpoints() { 1901 p = ConvenientPresence 1902 } else if t.raw.IsEndpointsIRI() { 1903 p = RawPresence 1904 } 1905 return 1906 1907} 1908 1909// SetEndpoints sets this value to be a 'Object' type. 1910func (t *Person) SetEndpoints(i vocab.ObjectType) { 1911 t.raw.SetEndpoints(i) 1912 1913} 1914 1915// GetProxyUrl attempts to get this 'proxyUrl' property as a *url.URL. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 1916func (t *Person) GetProxyUrl() (r Resolution, k *url.URL) { 1917 r = Unresolved 1918 handled := false 1919 if t.raw.HasProxyUrl() { 1920 k = t.raw.GetProxyUrl() 1921 if handled { 1922 r = Resolved 1923 } 1924 } 1925 return 1926 1927} 1928 1929// HasProxyUrl returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1930func (t *Person) HasProxyUrl() (p Presence) { 1931 p = NoPresence 1932 if t.raw.HasProxyUrl() { 1933 p = ConvenientPresence 1934 } 1935 return 1936 1937} 1938 1939// SetProxyUrl sets the value for property 'proxyUrl'. 1940func (t *Person) SetProxyUrl(k *url.URL) { 1941 t.raw.SetProxyUrl(k) 1942 1943} 1944 1945// GetOauthAuthorizationEndpoint attempts to get this 'oauthAuthorizationEndpoint' property as a *url.URL. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 1946func (t *Person) GetOauthAuthorizationEndpoint() (r Resolution, k *url.URL) { 1947 r = Unresolved 1948 handled := false 1949 if t.raw.HasOauthAuthorizationEndpoint() { 1950 k = t.raw.GetOauthAuthorizationEndpoint() 1951 if handled { 1952 r = Resolved 1953 } 1954 } 1955 return 1956 1957} 1958 1959// HasOauthAuthorizationEndpoint returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1960func (t *Person) HasOauthAuthorizationEndpoint() (p Presence) { 1961 p = NoPresence 1962 if t.raw.HasOauthAuthorizationEndpoint() { 1963 p = ConvenientPresence 1964 } 1965 return 1966 1967} 1968 1969// SetOauthAuthorizationEndpoint sets the value for property 'oauthAuthorizationEndpoint'. 1970func (t *Person) SetOauthAuthorizationEndpoint(k *url.URL) { 1971 t.raw.SetOauthAuthorizationEndpoint(k) 1972 1973} 1974 1975// GetOauthTokenEndpoint attempts to get this 'oauthTokenEndpoint' property as a *url.URL. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 1976func (t *Person) GetOauthTokenEndpoint() (r Resolution, k *url.URL) { 1977 r = Unresolved 1978 handled := false 1979 if t.raw.HasOauthTokenEndpoint() { 1980 k = t.raw.GetOauthTokenEndpoint() 1981 if handled { 1982 r = Resolved 1983 } 1984 } 1985 return 1986 1987} 1988 1989// HasOauthTokenEndpoint returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 1990func (t *Person) HasOauthTokenEndpoint() (p Presence) { 1991 p = NoPresence 1992 if t.raw.HasOauthTokenEndpoint() { 1993 p = ConvenientPresence 1994 } 1995 return 1996 1997} 1998 1999// SetOauthTokenEndpoint sets the value for property 'oauthTokenEndpoint'. 2000func (t *Person) SetOauthTokenEndpoint(k *url.URL) { 2001 t.raw.SetOauthTokenEndpoint(k) 2002 2003} 2004 2005// GetProvideClientKey attempts to get this 'provideClientKey' property as a *url.URL. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 2006func (t *Person) GetProvideClientKey() (r Resolution, k *url.URL) { 2007 r = Unresolved 2008 handled := false 2009 if t.raw.HasProvideClientKey() { 2010 k = t.raw.GetProvideClientKey() 2011 if handled { 2012 r = Resolved 2013 } 2014 } 2015 return 2016 2017} 2018 2019// HasProvideClientKey returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 2020func (t *Person) HasProvideClientKey() (p Presence) { 2021 p = NoPresence 2022 if t.raw.HasProvideClientKey() { 2023 p = ConvenientPresence 2024 } 2025 return 2026 2027} 2028 2029// SetProvideClientKey sets the value for property 'provideClientKey'. 2030func (t *Person) SetProvideClientKey(k *url.URL) { 2031 t.raw.SetProvideClientKey(k) 2032 2033} 2034 2035// GetSignClientKey attempts to get this 'signClientKey' property as a *url.URL. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 2036func (t *Person) GetSignClientKey() (r Resolution, k *url.URL) { 2037 r = Unresolved 2038 handled := false 2039 if t.raw.HasSignClientKey() { 2040 k = t.raw.GetSignClientKey() 2041 if handled { 2042 r = Resolved 2043 } 2044 } 2045 return 2046 2047} 2048 2049// HasSignClientKey returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 2050func (t *Person) HasSignClientKey() (p Presence) { 2051 p = NoPresence 2052 if t.raw.HasSignClientKey() { 2053 p = ConvenientPresence 2054 } 2055 return 2056 2057} 2058 2059// SetSignClientKey sets the value for property 'signClientKey'. 2060func (t *Person) SetSignClientKey(k *url.URL) { 2061 t.raw.SetSignClientKey(k) 2062 2063} 2064 2065// GetSharedInbox attempts to get this 'sharedInbox' property as a *url.URL. It returns a Resolution appropriate for clients to determine whether it would be necessary to do raw handling. 2066func (t *Person) GetSharedInbox() (r Resolution, k *url.URL) { 2067 r = Unresolved 2068 handled := false 2069 if t.raw.HasSharedInbox() { 2070 k = t.raw.GetSharedInbox() 2071 if handled { 2072 r = Resolved 2073 } 2074 } 2075 return 2076 2077} 2078 2079// HasSharedInbox returns a Presence appropriate for clients to determine whether it would be necessary to do raw handling, if desired. 2080func (t *Person) HasSharedInbox() (p Presence) { 2081 p = NoPresence 2082 if t.raw.HasSharedInbox() { 2083 p = ConvenientPresence 2084 } 2085 return 2086 2087} 2088 2089// SetSharedInbox sets the value for property 'sharedInbox'. 2090func (t *Person) SetSharedInbox(k *url.URL) { 2091 t.raw.SetSharedInbox(k) 2092 2093} 2094