// Path: src/main/java/org/springframework/social/google/api/calendar/PermissionRole.java
// @JsonSerialize(using = ApiEnumSerializer.class)
// @JsonDeserialize(using = PermissionRoleDeserializer.class)
// public enum PermissionRole {
//   /**
//    * "freeBusyReader" - Provides read access to free/busy information.
//    */
//   FREE_BUSY_READER,
// 
//   /**
//    * "reader" - Provides read access to the calendar.
//    * Private events will appear to users with reader access, but event details will be
//    * hidden.
//    */
//   READER,
// 
//   /**
//    * "writer" - Provides read and write access to the calendar.
//    * Private events will appear to users with writer access, and event details will be
//    * visible.
//    */
//   WRITER,
// 
//   /**
//    * "owner" - Provides ownership of the calendar.
//    * This role has all of the permissions of the writer role with the additional ability
//    * to see and manipulate ACLs.
//    */
//   OWNER
// }
// 
// Path: src/main/java/org/springframework/social/google/api/query/impl/ApiQueryBuilderImpl.java
// public class ApiQueryBuilderImpl<Q extends ApiQueryBuilder<?, T>, T extends ApiPage<?>>
//   extends QueryBuilderImpl<Q, T> implements ApiQueryBuilder<Q, T> {
// 
//   private final Class<T> type;
//   private final RestTemplate restTemplate;
// 
//   public ApiQueryBuilderImpl(final Class<T> type, final RestTemplate restTemplate) {
//     this.type = type;
//     this.restTemplate = restTemplate;
//   }
// 
//   public ApiQueryBuilderImpl(final String feedUrl, final Class<T> type, final RestTemplate restTemplate) {
//     super(feedUrl);
//     this.type = type;
//     this.restTemplate = restTemplate;
//   }
// 
//   @Override
//   public Q fromPage(final String pageToken) {
//     return appendQueryParam("pageToken", pageToken);
//   }
// 
//   @Override
//   public T getPage() {
//     try {
//       return restTemplate.getForObject(new URI(build()), type);
//     } catch (final URISyntaxException e) {
//       throw new IllegalStateException(e);
//     }
//   }
// }


import org.springframework.social.google.api.calendar.CalendarListQueryBuilder;
import org.springframework.social.google.api.calendar.CalendarPage;
import org.springframework.social.google.api.calendar.PermissionRole;
import org.springframework.social.google.api.impl.ApiEnumSerializer;
import org.springframework.social.google.api.query.impl.ApiQueryBuilderImpl;
import org.springframework.web.client.RestTemplate;
/**
 * Copyright 2011-2017 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.springframework.social.google.api.calendar.impl;


/**
 * {@link CalendarListQueryBuilder} implementation.
 *
 * @author Martin Wink
 */
public class CalendarListQueryBuilderImpl extends ApiQueryBuilderImpl<CalendarListQueryBuilder, CalendarPage>
  implements CalendarListQueryBuilder {
  public CalendarListQueryBuilderImpl(final String feedUrl, final Class<CalendarPage> type,
                                      final RestTemplate restTemplate) {
    super(feedUrl, type, restTemplate);
  }

  @Override
  public CalendarListQueryBuilder showDeleted(final boolean showDeleted) {
    return appendQueryParam("showDeleted", showDeleted);
  }

  @Override
  public CalendarListQueryBuilder showHidden(final boolean showHidden) {
    return appendQueryParam("showHidden", showHidden);
  }

// Path: src/main/java/org/springframework/social/google/api/calendar/PermissionRole.java
// @JsonSerialize(using = ApiEnumSerializer.class)
// @JsonDeserialize(using = PermissionRoleDeserializer.class)
// public enum PermissionRole {
//   /**
//    * "freeBusyReader" - Provides read access to free/busy information.
//    */
//   FREE_BUSY_READER,
// 
//   /**
//    * "reader" - Provides read access to the calendar.
//    * Private events will appear to users with reader access, but event details will be
//    * hidden.
//    */
//   READER,
// 
//   /**
//    * "writer" - Provides read and write access to the calendar.
//    * Private events will appear to users with writer access, and event details will be
//    * visible.
//    */
//   WRITER,
// 
//   /**
//    * "owner" - Provides ownership of the calendar.
//    * This role has all of the permissions of the writer role with the additional ability
//    * to see and manipulate ACLs.
//    */
//   OWNER
// }
// 
// Path: src/main/java/org/springframework/social/google/api/query/impl/ApiQueryBuilderImpl.java
// public class ApiQueryBuilderImpl<Q extends ApiQueryBuilder<?, T>, T extends ApiPage<?>>
//   extends QueryBuilderImpl<Q, T> implements ApiQueryBuilder<Q, T> {
// 
//   private final Class<T> type;
//   private final RestTemplate restTemplate;
// 
//   public ApiQueryBuilderImpl(final Class<T> type, final RestTemplate restTemplate) {
//     this.type = type;
//     this.restTemplate = restTemplate;
//   }
// 
//   public ApiQueryBuilderImpl(final String feedUrl, final Class<T> type, final RestTemplate restTemplate) {
//     super(feedUrl);
//     this.type = type;
//     this.restTemplate = restTemplate;
//   }
// 
//   @Override
//   public Q fromPage(final String pageToken) {
//     return appendQueryParam("pageToken", pageToken);
//   }
// 
//   @Override
//   public T getPage() {
//     try {
//       return restTemplate.getForObject(new URI(build()), type);
//     } catch (final URISyntaxException e) {
//       throw new IllegalStateException(e);
//     }
//   }
// }


// Path: src/main/java/org/springframework/social/google/api/calendar/impl/CalendarListQueryBuilderImpl.java
import org.springframework.social.google.api.calendar.CalendarListQueryBuilder;
import org.springframework.social.google.api.calendar.CalendarPage;
import org.springframework.social.google.api.calendar.PermissionRole;
import org.springframework.social.google.api.impl.ApiEnumSerializer;
import org.springframework.social.google.api.query.impl.ApiQueryBuilderImpl;
import org.springframework.web.client.RestTemplate;

/**
 * Copyright 2011-2017 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.springframework.social.google.api.calendar.impl;


/**
 * {@link CalendarListQueryBuilder} implementation.
 *
 * @author Martin Wink
 */
public class CalendarListQueryBuilderImpl extends ApiQueryBuilderImpl<CalendarListQueryBuilder, CalendarPage>
  implements CalendarListQueryBuilder {
  public CalendarListQueryBuilderImpl(final String feedUrl, final Class<CalendarPage> type,
                                      final RestTemplate restTemplate) {
    super(feedUrl, type, restTemplate);
  }

  @Override
  public CalendarListQueryBuilder showDeleted(final boolean showDeleted) {
    return appendQueryParam("showDeleted", showDeleted);
  }

  @Override
  public CalendarListQueryBuilder showHidden(final boolean showHidden) {
    return appendQueryParam("showHidden", showHidden);
  }

  @Override