# Calendar API . freebusy

## Instance Methods

Returns free/busy information for a set of calendars.

### Method Details

`query(body)`

    Returns free/busy information for a set of calendars.

    Args:
      body: object, The request body. (required)
        The object takes the form of:

    {
        "calendarExpansionMax": 42, # Maximal number of calendars for which FreeBusy information is to be provided. Optional.
        "groupExpansionMax": 42, # Maximal number of calendar identifiers to be provided for a single group. Optional. An error will be returned for a group with more members than this value.
        "timeMax": "A String", # The end of the interval for the query.
        "items": [ # List of calendars and/or groups to query.
          {
            "id": "A String", # The identifier of a calendar or a group.
          },
        ],
        "timeMin": "A String", # The start of the interval for the query.
        "timeZone": "UTC", # Time zone used in the response. Optional. The default is UTC.
      }

    Returns:
      An object of the form:

        {
        "timeMax": "A String", # The end of the interval.
        "kind": "calendar#freeBusy", # Type of the resource ("calendar#freeBusy").
        "calendars": { # List of free/busy information for calendars.
          "a_key": { # Free/busy expansions for a single calendar.
            "busy": [ # List of time ranges during which this calendar should be regarded as busy.
              {
                "start": "A String", # The (inclusive) start of the time period.
                "end": "A String", # The (exclusive) end of the time period.
              },
            ],
            "errors": [ # Optional error(s) (if computation for the calendar failed).
              {
                "domain": "A String", # Domain, or broad category, of the error.
                "reason": "A String", # Specific reason for the error. Some of the possible values are:
                    # - "groupTooBig" - The group of users requested is too large for a single query.
                    # - "tooManyCalendarsRequested" - The number of calendars requested is too large for a single query.
                    # - "notFound" - The requested resource was not found.
                    # - "internalError" - The API service has encountered an internal error.  Additional error types may be added in the future, so clients should gracefully handle additional error statuses not included in this list.
              },
            ],
          },
        },
        "timeMin": "A String", # The start of the interval.
        "groups": { # Expansion of groups.
          "a_key": { # List of calendars that are members of this group.
            "errors": [ # Optional error(s) (if computation for the group failed).
              {
                "domain": "A String", # Domain, or broad category, of the error.
                "reason": "A String", # Specific reason for the error. Some of the possible values are:
                    # - "groupTooBig" - The group of users requested is too large for a single query.
                    # - "tooManyCalendarsRequested" - The number of calendars requested is too large for a single query.
                    # - "notFound" - The requested resource was not found.
                    # - "internalError" - The API service has encountered an internal error.  Additional error types may be added in the future, so clients should gracefully handle additional error statuses not included in this list.
              },
            ],
            "calendars": [ # List of calendars' identifiers within a group.
              "A String",
            ],
          },
        },
      }