Retrieve TicketEvents

        :param include: list of objects to sideload. `Side-loading API Docs 
            <https://developer.zendesk.com/rest_api/docs/core/side_loading>`__.
        :param start_time: time to retrieve events from.
356657
def events(self, start_time, include=None):
        
        return self._query_zendesk(self.endpoint.events, 'ticket_event', start_time=start_time, include=include)
1191109
async def get_events(
        self, device_ids, group_ids=None, from_time=None, to_time=None, event_types=None
    ):
        """"""
        if to_time is None:
            to_time = datetime.utcnow()
        if from_time is None:
            from_time = to_time - timedelta(seconds=EVENT_INTERVAL)
        if event_types is None:
            event_types = ["allEvents"]

        get_params = []

        get_params.extend([("deviceId", value) for value in device_ids])
        if group_ids is not None:
            get_params.extend([("groupId", value) for value in group_ids])
        get_params.extend([("from", from_time.isoformat() + "Z")])
        get_params.extend([("to", to_time.isoformat() + "Z")])
        get_params.extend([("type", value) for value in event_types])

        data = await self.api("reports/events", get_params)

        if self.connected and self.authenticated:
            self._events = data
        else:
            self._events = self._events

        return self._events
525424
private static void getEvents(RestReportingEngineApi apiInstance) throws ApiException {
		
		
		String earliest = new DateTime(DateTimeZone.UTC).toString();
		//earliest = "2016-08-02T14:00:00.05Z";
		//Getting all the events after the time set by the "earliest" parameter. 
		List<JsonEvent> events= apiInstance.resourceRestReportingEngineFindEventsGET(earliest);
		
		for (JsonEvent e : events) {
			System.out.print(e.toString() + "\n");
		}
	}
164927
def get_events(self):
        """"""
        to_send = {'limit': 50}
        response = self._send_data('POST', 'admin', 'get-events', to_send)

        output = {'message': ""}
        for event in response['events']:
            desc = "Source IP: {ip}\n"
            desc += "Datetime: {time}\n"
            desc += "Indicator: {match}\n"
            desc += "Method: {method}\n"
            desc += "URL: {url}\n"
            desc += "Request Type: {type}\n"
            desc += "User-Agent: {userAgent}\n"
            desc += "Contact: {contact}\n"
            desc += "\n"
            output['message'] += desc.format(**event)

        return output
997303
def include_events(container)
      handlers = container.instance_variable_get '@event_handlers'
      return unless handlers

      @event_handlers ||= {}
      @event_handlers.merge!(handlers) { |_, old, new| old + new }
    end
1156785
function() {

    utils.doCallback('GetBookingSlotsStarted');

    var requestData = {
      url: '/bookings/groups',
      method: 'get',
      headers: {
        'Timekit-Timezone': customerTimezone
      }
    }

    // scope group booking slots by widget ID if possible
    if (getConfig().project_id) requestData.params = {
      search: 'project.id:' + getConfig().project_id
    }

    sdk
    .makeRequest(requestData)
    .then(function(response){

      var slots = response.data.map(function(item) {
        return {
          title: item.attributes.event_info.what,
          start: item.attributes.event_info.start,
          end: item.attributes.event_info.end,
          booking: item
        }
      })

      // Make sure to sort the slots chronologically,
      // otherwise FullCalendar might skip rendering some of them
      slots.sort(function(a, b) {
        return moment(a.start) - moment(b.start);
      })

      utils.doCallback('getBookingSlotsSuccessful', response);
      hideLoadingScreen();

      // Render available timeslots in FullCalendar
      if(slots.length > 0) renderCalendarEvents(slots);

      // Render test ribbon if enabled
      if (response.headers['timekit-testmode']) renderTestModeRibbon();

    }).catch(function(response){
      utils.doCallback('getBookingSlotsFailed', response);
      hideLoadingScreen();
      triggerError(['An error with Timekit Get Booking Slots occured', response]);
    });

  }
1129319
def get_event_times(self):
        
        times = []

        times.extend(self.Breaker.get_times())

        for model in self.__dict__['Event'].all_models:
            times.extend(self.__dict__[model].get_times())

        if times:
            times = sorted(list(set(times)))

        return times
776879
def start_time(self):
        
        resource_list = self.traffic_incident()
        start_time = namedtuple('start_time', 'start_time')
        if len(resource_list) == 1 and resource_list[0] is None:
            return None
        else:
            try:
                return [start_time(resource['start'])
                        for resource in resource_list]
            except (KeyError, TypeError):
                return [start_time(resource['StartTimeUTC'])
                        for resource in resource_list]
306056
def get_events(self):
        
        res = copy.copy(self.events)
        del self.events[:]
        return res
146901
def getEvents(self):
        
        caught_events = self._observer.caught_events
        self._observer.caught_events = []
        for event in caught_events:
            self._observer.activate_event(event["name"])
        return caught_events
599120
def refresh_events(self):
        
        now = datetime.datetime.now(tz=pytz.UTC)
        try:
            now, later = self.get_timerange_formatted(now)
            events_result = self.service.events().list(
                calendarId='primary',
                timeMin=now,
                timeMax=later,
                maxResults=10,
                singleEvents=True,
                orderBy='startTime',
                timeZone='utc'
            ).execute()
            self.events.clear()
            for event in events_result.get('items', []):
                self.events.append(GoogleCalendarEvent(event))
        except HttpError as e:
            if e.resp.status in (500, 503):
                self.logger.warn("GoogleCalendar received %s while retrieving events" % e.resp.status)
            else:
                raise
519794
def get(self, request):
        """"""
        # Heavily inspired by https://djangosnippets.org/snippets/2223/ and
        # the icalendar documentation
        calendar = Calendar()
        site = get_current_site(request)
        calendar.add('prodid', '-//%s Schedule//%s//' % (site.name, site.domain))
        calendar.add('version', '2.0')

        # Since we don't need to format anything here, we can just use a list
        # of schedule items
        for item in ScheduleItem.objects.all():
            sched_event = Event()
            sched_event.add('dtstamp', item.last_updated)
            sched_event.add('summary', item.get_title())
            sched_event.add('location', item.venue.name)
            sched_event.add('dtstart', item.get_start_datetime())
            sched_event.add('duration', datetime.timedelta(minutes=item.get_duration_minutes()))
            sched_event.add('class', 'PUBLIC')
            sched_event.add('uid', '%s@%s' % (item.pk, site.domain))
            calendar.add_component(sched_event)
        response = HttpResponse(calendar.to_ical(), content_type="text/calendar")
        response['Content-Disposition'] = 'attachment; filename=schedule.ics'
        return response
1249461
def _getEventsByDay(self, request, firstDay, lastDay):
        
        home = request.site.root_page
        return getAllEventsByDay(request, firstDay, lastDay, home=home)
1368487
def get_ticket(self, ticket_id):
        
        mask = """mask[id, title, assignedUser[firstName, lastName],status,
                  createDate,lastEditDate,updates[entry,editor],updateCount, priority]"""
        return self.ticket.getObject(id=ticket_id, mask=mask)
699164
def retrieve_records(self, timeperiod, include_running,
                         include_processed, include_noop, include_failed, include_disabled):
        
        resp = dict()
        resp.update(self._search_by_level(COLLECTION_JOB_HOURLY, timeperiod, include_running,
                                          include_processed, include_noop, include_failed, include_disabled))
        resp.update(self._search_by_level(COLLECTION_JOB_DAILY, timeperiod, include_running,
                                          include_processed, include_noop, include_failed, include_disabled))

        timeperiod = time_helper.cast_to_time_qualifier(QUALIFIER_MONTHLY, timeperiod)
        resp.update(self._search_by_level(COLLECTION_JOB_MONTHLY, timeperiod, include_running,
                                          include_processed, include_noop, include_failed, include_disabled))

        timeperiod = time_helper.cast_to_time_qualifier(QUALIFIER_YEARLY, timeperiod)
        resp.update(self._search_by_level(COLLECTION_JOB_YEARLY, timeperiod, include_running,
                                          include_processed, include_noop, include_failed, include_disabled))
        return resp
404530
def tickets_list(self, external_id=None, include=None, **kwargs):
        ""
        api_path = "/api/v2/tickets.json"
        api_query = {}
        if "query" in kwargs.keys():
            api_query.update(kwargs["query"])
            del kwargs["query"]
        if external_id:
            api_query.update({
                "external_id": external_id,
            })
        if include:
            api_query.update({
                "include": include,
            })
        return self.call(api_path, query=api_query, **kwargs)
1107731
def ticket_fields(self):
        
        if self.api and self.ticket_field_ids:
            return self.api._get_ticket_fields(self.ticket_field_ids)