func (t *ObjectType) StartTime() *time.Time {
	if t == nil || t.object == nil || t.object.StartTime == nil {
		return nil
	}
	return &t.object.StartTime.Time
}
StartTime returns the start time.
package vocab
import (
	"encoding/json"
	"fmt"
	"net/url"
	"time"
	"github.com/hyperledger/aries-framework-go/pkg/doc/util"
)
type ObjectType struct {
	object     *objectType
	additional Document
}
func NewObject(opts ...Opt) *ObjectType {
	options := NewOptions(opts...)
	return &ObjectType{
		object: &objectType{
			Context:      NewContextProperty(options.Context...),
			ID:           NewURLProperty(options.ID),
			URL:          NewURLCollectionProperty(options.URL...),
			CID:          options.CID,
			Type:         NewTypeProperty(options.Types...),
			To:           NewURLCollectionProperty(options.To...),
			Published:    newTimeProperty(options.Published),
			StartTime:    newTimeProperty(options.StartTime),
			EndTime:      newTimeProperty(options.EndTime),
			InReplyTo:    NewURLProperty(options.InReplyTo),
			Attachment:   options.Attachment,
			AttributedTo: NewURLProperty(options.AttributedTo),
			Generator:    options.Generator,
		},
	}
}
func NewObjectWithDocument(doc Document, opts ...Opt) (*ObjectType, error) {
	if doc == nil {
		return nil, fmt.Errorf("nil document")
	}
	bytes, err := MarshalJSON(NewObject(opts...), doc)
	if err != nil {
		return nil, fmt.Errorf("marshal: %w", err)
	}
	obj := &ObjectType{}
	err = json.Unmarshal(bytes, &obj)
	if err != nil {
		return nil, fmt.Errorf("unmarshal: %w", err)
	}
	return obj, nil
}
type objectType struct {
	Context      *ContextProperty       `json:"@context,omitempty"`
	ID           *URLProperty           `json:"id,omitempty"`
	URL          *URLCollectionProperty `json:"url,omitempty"`
	Type         *TypeProperty          `json:"type,omitempty"`
	To           *URLCollectionProperty `json:"to,omitempty"`
	Published    *util.TimeWrapper      `json:"published,omitempty"`
	StartTime    *util.TimeWrapper      `json:"startTime,omitempty"`
	EndTime      *util.TimeWrapper      `json:"endTime,omitempty"`
	CID          string                 `json:"cid,omitempty"`
	InReplyTo    *URLProperty           `json:"inReplyTo,omitempty"`
	Attachment   []*ObjectProperty      `json:"attachment,omitempty"`
	AttributedTo *URLProperty           `json:"attributedTo,omitempty"`
	Generator    string                 `json:"generator,omitempty"`
}
func (t *ObjectType) Context() *ContextProperty {
	if t == nil || t.object == nil {
		return nil
	}
	return t.object.Context
}
func (t *ObjectType) ID() *URLProperty {
	if t == nil || t.object == nil {
		return nil
	}
	return t.object.ID
}
func (t *ObjectType) SetID(id *url.URL) {
	t.object.ID = NewURLProperty(id)
}
func (t *ObjectType) URL() Urls {
	if t == nil || t.object == nil || t.object.URL == nil {
		return nil
	}
	urls := make([]*url.URL, len(t.object.URL.urls))
	for i, u := range t.object.URL.urls {
		urls[i] = u.u
	}
	return urls
}
func (t *ObjectType) Type() *TypeProperty {
	if t == nil || t.object == nil {
		return nil
	}
	return t.object.Type
}
func (t *ObjectType) Published() *time.Time {
	if t == nil || t.object == nil || t.object.Published == nil {
		return nil
	}
	return &t.object.Published.Time
}