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