Class: CalendarApi::CalendarListApi

Inherits:
BaseApi
  • Object
show all
Defined in:
lib/calendar_api/apis/calendar_list_api.rb

Overview

CalendarListApi

Constant Summary

Constants inherited from BaseApi

BaseApi::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseApi

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseApi

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters

Constructor Details

This class inherits a constructor from CalendarApi::BaseApi

Instance Method Details

#list_calendar_list(max_results: 100, min_access_role: nil, page_token: nil, show_deleted: false, show_hidden: false, sync_token: nil) ⇒ ApiResponse

Returns the calendars on the user’s calendar list. Use the returned calendar IDs as the calendarId path parameter for event operations. returned on one result page. Default is 100, maximum allowed is 250. minimum access role for the user in the returned entries. result page to return. to include deleted calendar list entries in the result. Default is false. show hidden entries. Default is false. nextSyncToken field returned on the last page of a previous list request. Makes the result contain only entries that have changed since then.

Parameters:

  • max_results (Integer) (defaults to: 100)

    Optional parameter: Maximum number of entries

  • min_access_role (CalendarAccessRole) (defaults to: nil)

    Optional parameter: The

  • page_token (String) (defaults to: nil)

    Optional parameter: Token specifying which

  • show_deleted (TrueClass | FalseClass) (defaults to: false)

    Optional parameter: Whether

  • show_hidden (TrueClass | FalseClass) (defaults to: false)

    Optional parameter: Whether to

  • sync_token (String) (defaults to: nil)

    Optional parameter: Token obtained from the

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/calendar_api/apis/calendar_list_api.rb', line 26

def list_calendar_list(max_results: 100,
                       min_access_role: nil,
                       page_token: nil,
                       show_deleted: false,
                       show_hidden: false,
                       sync_token: nil)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/users/me/calendarList',
                                 Server::DEFAULT)
               .query_param(new_parameter(max_results, key: 'maxResults'))
               .query_param(new_parameter(min_access_role, key: 'minAccessRole'))
               .query_param(new_parameter(page_token, key: 'pageToken'))
               .query_param(new_parameter(show_deleted, key: 'showDeleted'))
               .query_param(new_parameter(show_hidden, key: 'showHidden'))
               .query_param(new_parameter(sync_token, key: 'syncToken'))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('oauth2')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(CalendarListResponse.method(:from_hash))
                .is_api_response(true)
                .local_error('400',
                             'Bad request — invalid parameters or request body.',
                             ErrorResponseError1Exception)
                .local_error('401',
                             'Authentication required or credentials are invalid.',
                             ErrorResponseError1Exception)
                .local_error('403',
                             'Insufficient permissions for the requested resource.',
                             ErrorResponseError1Exception)
                .local_error('404',
                             'The requested resource was not found.',
                             ErrorResponseError1Exception))
    .execute
end