当前位置: 首页>>代码示例>>Java>>正文


Java FreeBusyRequestItem类代码示例

本文整理汇总了Java中com.google.api.services.calendar.model.FreeBusyRequestItem的典型用法代码示例。如果您正苦于以下问题:Java FreeBusyRequestItem类的具体用法?Java FreeBusyRequestItem怎么用?Java FreeBusyRequestItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FreeBusyRequestItem类属于com.google.api.services.calendar.model包,在下文中一共展示了FreeBusyRequestItem类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testQuery

import com.google.api.services.calendar.model.FreeBusyRequestItem; //导入依赖的package包/类
@Test
public void testQuery() throws Exception {
    // using com.google.api.services.calendar.model.FreeBusyRequest message
    // body for single parameter "content"
    com.google.api.services.calendar.model.FreeBusyRequest request = new FreeBusyRequest();
    List<FreeBusyRequestItem> items = new ArrayList<FreeBusyRequestItem>();
    items.add(new FreeBusyRequestItem().setId(getCalendar().getId()));
    request.setItems(items);

    request.setTimeMin(DateTime.parseRfc3339("2014-11-10T20:45:30-00:00"));
    request.setTimeMax(DateTime.parseRfc3339("2014-11-10T21:45:30-00:00"));

    final com.google.api.services.calendar.model.FreeBusyResponse result = requestBody("direct://QUERY", request);

    assertNotNull("query result", result);
    LOG.debug("query: " + result);
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:18,代码来源:CalendarFreebusyIntegrationTest.java

示例2: makeFreeBusyRequest

import com.google.api.services.calendar.model.FreeBusyRequestItem; //导入依赖的package包/类
/**
 * Get a list of percentages of users who are free during a given time by
 * time interval
 * 
 * @param startTime
 *            - start time in question
 * @param endTime
 *            - end time in question
 * @param userEmails
 *            - list of emails you desire to retrieve free/busy data for
 * @return ordered list of percentages of users for the given list who are
 *         free
 * @throws IOException 
 */
public static FreeBusyResponse makeFreeBusyRequest(long startTimeMillis, long endTimeMillis,
		List<String> userEmails) throws IOException {

	// Build the calendar service
	com.google.api.services.calendar.Calendar service = GoogleCalendarUtils.makeCalendarServiceInstance();
	
	FreeBusyRequest request = new FreeBusyRequest();
	request.setTimeMin(new DateTime(startTimeMillis));
	request.setTimeMax(new DateTime(endTimeMillis));
	
	// Build request items
	List<FreeBusyRequestItem> requestItems = new ArrayList<FreeBusyRequestItem>();
	for(String email: userEmails){
		FreeBusyRequestItem item = new FreeBusyRequestItem();
		item.setId(email);
		requestItems.add(item);
	}
	request.setItems(requestItems);
	
	return service.freebusy().query(request).execute();
}
 
开发者ID:pschuette22,项目名称:Zeppa-AppEngine,代码行数:36,代码来源:GoogleCalendarService.java


注:本文中的com.google.api.services.calendar.model.FreeBusyRequestItem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。