// Returns an instance of just the public contract portion of the model Event.
// I don't like returning a pointer from this method but I have to in order to
// satisfy the Filter, Format interfaces.
324493
func (e Event) ToContract() *contract.Event {
	event := contract.Event{
		ID:       e.ID,
		Pushed:   e.Pushed,
		Device:   e.Device,
		Created:  e.Created,
		Modified: e.Modified,
		Origin:   e.Origin,
	}

	for _, r := range e.Readings {
		event.Readings = append(event.Readings, r)
	}
	return &event
}
1335825
func (m *MembershipEvent) GetScope() string {
	if m == nil || m.Scope == nil {
		return ""
	}
	return *m.Scope
}
97856
func (p *PullRequestReviewRequest) GetEvent() string {
	if p == nil || p.Event == nil {
		return ""
	}
	return *p.Event
}
660781
func (m *MarketplacePlan) GetPriceModel() string {
	if m == nil || m.PriceModel == nil {
		return ""
	}
	return *m.PriceModel
}
590962
func (p *Pipeline) FilterEvent(filters ...EventFilter) *Pipeline {
	return &Pipeline{
		prior:       p,
		transformer: filterNilEvent(filterEvent(filters...)),
	}
}
594359
func GetEventDescriptor(event *Event) EventDescriptor {
	bee := GetBee(event.Bee)
	if bee == nil {
		panic("Bee " + event.Bee + " not registered")
	}
	factory := (*GetFactory((*bee).Namespace()))
	for _, ev := range factory.Events() {
		if ev.Name == event.Name {
			return ev
		}
	}

	return EventDescriptor{}
}
112638
func (c *Client) ListServiceUsageEventsByQuery(query url.Values) ([]ServiceUsageEvent, error) {
	var serviceUsageEvents []ServiceUsageEvent
	requestURL := fmt.Sprintf("/v2/service_usage_events?%s", query.Encode())
	for {
		var serviceUsageEventsResponse ServiceUsageEventsResponse
		r := c.NewRequest("GET", requestURL)
		resp, err := c.DoRequest(r)
		if err != nil {
			return nil, errors.Wrap(err, "error requesting events")
		}
		defer resp.Body.Close()
		if err := json.NewDecoder(resp.Body).Decode(&serviceUsageEventsResponse); err != nil {
			return nil, errors.Wrap(err, "error unmarshaling events")
		}
		for _, e := range serviceUsageEventsResponse.Resources {
			e.Entity.GUID = e.Meta.Guid
			e.Entity.CreatedAt = e.Meta.CreatedAt
			e.Entity.c = c
			serviceUsageEvents = append(serviceUsageEvents, e.Entity)
		}
		requestURL = serviceUsageEventsResponse.NextURL
		if requestURL == "" {
			break
		}
	}
	return serviceUsageEvents, nil
}
648886
func (c *Client) GetPrefilter() (*models.Prefilter, error) {
	resp, err := c.Prefilter.GetPrefilter(nil)
	if err != nil {
		return nil, Hint(err)
	}
	return resp.Payload, nil
}
174633
func (c *Client) EventsByCreationTime(startTime, endTime int64, limit int) (events []contract.Event, err error) {
	conn := c.Pool.Get()
	defer conn.Close()

	objects, err := getObjectsByScore(conn, db.EventsCollection+":created", startTime, endTime, limit)
	if err != nil {
		if err != redis.ErrNil {
			return events, err
		}
	}

	events = make([]contract.Event, len(objects))
	err = unmarshalEvents(objects, events)
	if err != nil {
		return events, err
	}

	return events, nil
}
1019673
func (_PublicResolver *PublicResolverCaller) ABI(opts *bind.CallOpts, node [32]byte, contentTypes *big.Int) (struct {
	ContentType *big.Int
	Data        []byte
}, error) {
	ret := new(struct {
		ContentType *big.Int
		Data        []byte
	})
	out := ret
	err := _PublicResolver.contract.Call(opts, out, "ABI", node, contentTypes)
	return *ret, err
}
904357
func (c *Client) EventsOlderThanAge(age int64) ([]contract.Event, error) {
	expireDate := db.MakeTimestamp() - age

	return c.EventsByCreationTime(0, expireDate, 0)
}
986101
func (e *Event) GetObjectValue(keys ...string) string {
	return getValue(e.Data.Object, keys)
}
892651
func eventFilterSelf(event types.BaseEvent, self types.ManagedObjectReference) bool {
	return doEntityEventArgument(event, func(ref types.ManagedObjectReference, _ *types.EntityEventArgument) bool {
		return self == ref
	})
}
587802
func NewPublicResolverCaller(address common.Address, caller bind.ContractCaller) (*PublicResolverCaller, error) {
	contract, err := bindPublicResolver(address, caller, nil, nil)
	if err != nil {
		return nil, err
	}
	return &PublicResolverCaller{contract: contract}, nil
}
925578
func (e *Endpoint) GetModel() *models.Endpoint {
	if e == nil {
		return nil
	}
	// NOTE: Using rlock on mutex directly because GetModelRLocked handles removed endpoint properly
	e.mutex.RLock()
	defer e.mutex.RUnlock()

	return e.GetModelRLocked()
}
528673
func (c Client) Get(id string, params *stripe.EventParams) (*stripe.Event, error) {
	path := stripe.FormatURLPath("/v1/events/%s", id)
	event := &stripe.Event{}
	err := c.B.Call(http.MethodGet, path, c.Key, params, event)
	return event, err
}
79430
func (api *BaseAPI) getModelFilters(filters params.OfferFilters) (
	models map[string]Model,
	filtersPerModel map[string][]jujucrossmodel.ApplicationOfferFilter,
	_ error,
) {
	models = make(map[string]Model)
	filtersPerModel = make(map[string][]jujucrossmodel.ApplicationOfferFilter)

	// Group the filters per model and then query each model with the relevant filters
	// for that model.
	modelUUIDs := make(map[string]string)
	for _, f := range filters.Filters {
		if f.ModelName == "" {
			return nil, nil, errors.New("application offer filter must specify a model name")
		}
		var (
			modelUUID string
			ok        bool
		)
		if modelUUID, ok = modelUUIDs[f.ModelName]; !ok {
			var err error
			model, absModelPath, ok, err := api.modelForName(f.ModelName, f.OwnerName)
			if err != nil {
				return nil, nil, errors.Trace(err)
			}
			if !ok {
				err := errors.NotFoundf("model %q", absModelPath)
				return nil, nil, errors.Trace(err)
			}
			// Record the UUID and model for next time.
			modelUUID = model.UUID()
			modelUUIDs[f.ModelName] = modelUUID
			models[modelUUID] = model
		}

		// Record the filter and model details against the model UUID.
		filters := filtersPerModel[modelUUID]
		filter, err := makeOfferFilterFromParams(f)
		if err != nil {
			return nil, nil, errors.Trace(err)
		}
		filters = append(filters, filter)
		filtersPerModel[modelUUID] = filters
	}
	return models, filtersPerModel, nil
}