def calendar_api_spec():
  """Fixture that provides a mock Google Calendar API spec for testing."""
  return {
      "kind": "discovery#restDescription",
      "id": "calendar:v3",
      "name": "calendar",
      "version": "v3",
      "title": "Google Calendar API",
      "description": "Accesses the Google Calendar API",
      "documentationLink": "https://developers.google.com/calendar/",
      "protocol": "rest",
      "rootUrl": "https://www.googleapis.com/",
      "servicePath": "calendar/v3/",
      "auth": {
          "oauth2": {
              "scopes": {
                  "https://www.googleapis.com/auth/calendar": {
                      "description": "Full access to Google Calendar"
                  },
                  "https://www.googleapis.com/auth/calendar.readonly": {
                      "description": "Read-only access to Google Calendar"
                  },
              }
          }
      },
      "schemas": {
          "Calendar": {
              "type": "object",
              "description": "A calendar resource",
              "properties": {
                  "id": {
                      "type": "string",
                      "description": "Calendar identifier",
                  },
                  "summary": {
                      "type": "string",
                      "description": "Calendar summary",
                      "required": True,
                  },
                  "timeZone": {
                      "type": "string",
                      "description": "Calendar timezone",
                  },
              },
          },
          "Event": {
              "type": "object",
              "description": "An event resource",
              "properties": {
                  "id": {"type": "string", "description": "Event identifier"},
                  "summary": {"type": "string", "description": "Event summary"},
                  "start": {"$ref": "EventDateTime"},
                  "end": {"$ref": "EventDateTime"},
                  "attendees": {
                      "type": "array",
                      "description": "Event attendees",
                      "items": {"$ref": "EventAttendee"},
                  },
              },
          },
          "EventDateTime": {
              "type": "object",
              "description": "Date/time for an event",
              "properties": {
                  "dateTime": {
                      "type": "string",
                      "format": "date-time",
                      "description": "Date/time in RFC3339 format",
                  },
                  "timeZone": {
                      "type": "string",
                      "description": "Timezone for the date/time",
                  },
              },
          },
          "EventAttendee": {
              "type": "object",
              "description": "An attendee of an event",
              "properties": {
                  "email": {"type": "string", "description": "Attendee email"},
                  "responseStatus": {
                      "type": "string",
                      "description": "Response status",
                      "enum": [
                          "needsAction",
                          "declined",
                          "tentative",
                          "accepted",
                      ],
                  },
              },
          },
      },
      "resources": {
          "calendars": {
              "methods": {
                  "get": {
                      "id": "calendar.calendars.get",
                      "flatPath": "calendars/{calendarId}",
                      "httpMethod": "GET",
                      "description": "Returns metadata for a calendar.",
                      "parameters": {
                          "calendarId": {
                              "type": "string",
                              "description": "Calendar identifier",
                              "required": True,
                              "location": "path",
                          }
                      },
                      "response": {"$ref": "Calendar"},
                      "scopes": [
                          "https://www.googleapis.com/auth/calendar",
                          "https://www.googleapis.com/auth/calendar.readonly",
                      ],
                  },
                  "insert": {
                      "id": "calendar.calendars.insert",
                      "path": "calendars",
                      "httpMethod": "POST",
                      "description": "Creates a secondary calendar.",
                      "request": {"$ref": "Calendar"},
                      "response": {"$ref": "Calendar"},
                      "scopes": ["https://www.googleapis.com/auth/calendar"],
                  },
              },
              "resources": {
                  "events": {
                      "methods": {
                          "list": {
                              "id": "calendar.events.list",
                              "flatPath": "calendars/{calendarId}/events",
                              "httpMethod": "GET",
                              "description": (
                                  "Returns events on the specified calendar."
                              ),
                              "parameters": {
                                  "calendarId": {
                                      "type": "string",
                                      "description": "Calendar identifier",
                                      "required": True,
                                      "location": "path",
                                  },
                                  "maxResults": {
                                      "type": "integer",
                                      "description": (
                                          "Maximum number of events returned"
                                      ),
                                      "format": "int32",
                                      "minimum": "1",
                                      "maximum": "2500",
                                      "default": "250",
                                      "location": "query",
                                  },
                                  "orderBy": {
                                      "type": "string",
                                      "description": (
                                          "Order of the events returned"
                                      ),
                                      "enum": ["startTime", "updated"],
                                      "location": "query",
                                  },
                              },
                              "response": {"$ref": "Events"},
                              "scopes": [
                                  "https://www.googleapis.com/auth/calendar",
                                  "https://www.googleapis.com/auth/calendar.readonly",
                              ],
                          }
                      }
                  }
              },
          }
      },
  }
Fixture that provides a mock Google Calendar API spec for testing.
tests/unittests/tools/google_api_tool/test_googleapi_to_openapi_converter.py