openapi-directory
Version:
Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS
1 lines • 23.7 kB
JSON
{"openapi":"3.0.0","info":{"contact":{"name":"Google","url":"https://google.com"},"description":"Enables bots to fetch information and perform actions in Hangouts Chat.","title":"Hangouts Chat","version":"v1","x-apiClientRegistration":{"url":"https://console.developers.google.com"},"x-logo":{"url":"https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png"},"x-origin":[{"converter":{"url":"https://github.com/lucybot/api-spec-converter","version":"2.7.18"},"format":"google","url":"https://chat.googleapis.com/$discovery/rest?version=v1","version":"v1"}],"x-preferred":true,"x-providerName":"googleapis.com","x-serviceName":"chat"},"externalDocs":{"url":"https://developers.google.com/hangouts/chat"},"tags":[{"name":"spaces"}],"paths":{"/v1/spaces":{"get":{"description":"Lists spaces the caller is a member of.","operationId":"chat.spaces.list","parameters":[{"description":"Requested page size. The value is capped at 1000.\nServer may return fewer results than requested.\nIf unspecified, server will default to 100.","in":"query","name":"pageSize","schema":{"type":"integer"}},{"description":"A token identifying a page of results the server should return.","in":"query","name":"pageToken","schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ListSpacesResponse"}}}}},"tags":["spaces"]},"parameters":[{"$ref":"#/components/parameters/_.xgafv"},{"$ref":"#/components/parameters/access_token"},{"$ref":"#/components/parameters/alt"},{"$ref":"#/components/parameters/callback"},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/key"},{"$ref":"#/components/parameters/oauth_token"},{"$ref":"#/components/parameters/prettyPrint"},{"$ref":"#/components/parameters/quotaUser"},{"$ref":"#/components/parameters/uploadType"},{"$ref":"#/components/parameters/upload_protocol"}]},"/v1/{name}":{"delete":{"description":"Deletes a message.","operationId":"chat.spaces.messages.delete","parameters":[{"description":"Required. Resource name of the message to be deleted, in the form\n\"spaces/*/messages/*\"\n\nExample: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4","in":"path","name":"name","required":true,"x-reservedExpansion":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Empty"}}}}},"tags":["spaces"]},"get":{"description":"Returns a message.","operationId":"chat.spaces.messages.get","parameters":[{"description":"Required. Resource name of the message to be retrieved, in the form\n\"spaces/*/messages/*\".\n\nExample: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4","in":"path","name":"name","required":true,"x-reservedExpansion":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Message"}}}}},"tags":["spaces"]},"parameters":[{"$ref":"#/components/parameters/_.xgafv"},{"$ref":"#/components/parameters/access_token"},{"$ref":"#/components/parameters/alt"},{"$ref":"#/components/parameters/callback"},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/key"},{"$ref":"#/components/parameters/oauth_token"},{"$ref":"#/components/parameters/prettyPrint"},{"$ref":"#/components/parameters/quotaUser"},{"$ref":"#/components/parameters/uploadType"},{"$ref":"#/components/parameters/upload_protocol"}],"put":{"description":"Updates a message.","operationId":"chat.spaces.messages.update","parameters":[{"description":"Resource name, in the form \"spaces/*/messages/*\".\n\nExample: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4","in":"path","name":"name","required":true,"x-reservedExpansion":true,"schema":{"type":"string"}},{"description":"Required. The field paths to be updated.\n\nCurrently supported field paths: \"text\", \"cards\".","in":"query","name":"updateMask","schema":{"type":"string"}}],"requestBody":{"$ref":"#/components/requestBodies/Message"},"responses":{"200":{"description":"Successful response","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Message"}}}}},"tags":["spaces"]}},"/v1/{parent}/members":{"get":{"description":"Lists human memberships in a space.","operationId":"chat.spaces.members.list","parameters":[{"description":"Requested page size. The value is capped at 1000.\nServer may return fewer results than requested.\nIf unspecified, server will default to 100.","in":"query","name":"pageSize","schema":{"type":"integer"}},{"description":"A token identifying a page of results the server should return.","in":"query","name":"pageToken","schema":{"type":"string"}},{"description":"Required. The resource name of the space for which membership list is to be\nfetched, in the form \"spaces/*\".\n\nExample: spaces/AAAAMpdlehY","in":"path","name":"parent","required":true,"x-reservedExpansion":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful response","content":{"*/*":{"schema":{"$ref":"#/components/schemas/ListMembershipsResponse"}}}}},"tags":["spaces"]},"parameters":[{"$ref":"#/components/parameters/_.xgafv"},{"$ref":"#/components/parameters/access_token"},{"$ref":"#/components/parameters/alt"},{"$ref":"#/components/parameters/callback"},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/key"},{"$ref":"#/components/parameters/oauth_token"},{"$ref":"#/components/parameters/prettyPrint"},{"$ref":"#/components/parameters/quotaUser"},{"$ref":"#/components/parameters/uploadType"},{"$ref":"#/components/parameters/upload_protocol"}]},"/v1/{parent}/messages":{"parameters":[{"$ref":"#/components/parameters/_.xgafv"},{"$ref":"#/components/parameters/access_token"},{"$ref":"#/components/parameters/alt"},{"$ref":"#/components/parameters/callback"},{"$ref":"#/components/parameters/fields"},{"$ref":"#/components/parameters/key"},{"$ref":"#/components/parameters/oauth_token"},{"$ref":"#/components/parameters/prettyPrint"},{"$ref":"#/components/parameters/quotaUser"},{"$ref":"#/components/parameters/uploadType"},{"$ref":"#/components/parameters/upload_protocol"}],"post":{"description":"Creates a message.","operationId":"chat.spaces.messages.create","parameters":[{"description":"Required. Space resource name, in the form \"spaces/*\".\nExample: spaces/AAAAMpdlehY","in":"path","name":"parent","required":true,"x-reservedExpansion":true,"schema":{"type":"string"}},{"description":"Opaque thread identifier string that can be specified to group messages\ninto a single thread. If this is the first message with a given thread\nidentifier, a new thread is created. Subsequent messages with the same\nthread identifier will be posted into the same thread. This relieves bots\nand webhooks from having to store the Hangouts Chat thread ID of a thread (created earlier by them) to post\nfurther updates to it.\n\nHas no effect if thread field,\ncorresponding to an existing thread, is set in message.","in":"query","name":"threadKey","schema":{"type":"string"}}],"requestBody":{"$ref":"#/components/requestBodies/Message"},"responses":{"200":{"description":"Successful response","content":{"*/*":{"schema":{"$ref":"#/components/schemas/Message"}}}}},"tags":["spaces"]}}},"servers":[{"url":"https://chat.googleapis.com/"}],"components":{"parameters":{"access_token":{"description":"OAuth access token.","in":"query","name":"access_token","schema":{"type":"string"}},"alt":{"description":"Data format for response.","in":"query","name":"alt","schema":{"type":"string","enum":["json","media","proto"],"default":"json"}},"callback":{"description":"JSONP","in":"query","name":"callback","schema":{"type":"string"}},"fields":{"description":"Selector specifying which fields to include in a partial response.","in":"query","name":"fields","schema":{"type":"string"}},"key":{"description":"API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.","in":"query","name":"key","schema":{"type":"string"}},"oauth_token":{"description":"OAuth 2.0 token for the current user.","in":"query","name":"oauth_token","schema":{"type":"string"}},"prettyPrint":{"description":"Returns response with indentations and line breaks.","in":"query","name":"prettyPrint","schema":{"type":"boolean","default":true}},"quotaUser":{"description":"Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.","in":"query","name":"quotaUser","schema":{"type":"string"}},"uploadType":{"description":"Legacy upload protocol for media (e.g. \"media\", \"multipart\").","in":"query","name":"uploadType","schema":{"type":"string"}},"upload_protocol":{"description":"Upload protocol for media (e.g. \"raw\", \"multipart\").","in":"query","name":"upload_protocol","schema":{"type":"string"}},"_.xgafv":{"description":"V1 error format.","in":"query","name":"$.xgafv","schema":{"type":"string","enum":["1","2"]}}},"requestBodies":{"Message":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}}},"schemas":{"ActionParameter":{"description":"List of string parameters to supply when the action method is invoked.\nFor example, consider three snooze buttons: snooze now, snooze 1 day,\nsnooze next week. You might use action method = snooze(), passing the\nsnooze type and snooze time in the list of string parameters.","properties":{"key":{"description":"The name of the parameter for the action script.","type":"string"},"value":{"description":"The value of the parameter.","type":"string"}},"type":"object"},"ActionResponse":{"description":"Parameters that a bot can use to configure how it's response is posted.","properties":{"type":{"description":"The type of bot response.","enum":["TYPE_UNSPECIFIED","NEW_MESSAGE","UPDATE_MESSAGE","REQUEST_CONFIG"],"type":"string"},"url":{"description":"URL for users to auth or config. (Only for REQUEST_CONFIG response types.)","type":"string"}},"type":"object"},"Annotation":{"description":"Annotations associated with the plain-text body of the message.\n\nExample plain-text message body:\n```\nHello @FooBot how are you!\"\n```\n\nThe corresponding annotations metadata:\n```\n\"annotations\":[{\n \"type\":\"USER_MENTION\",\n \"startIndex\":6,\n \"length\":7,\n \"userMention\": {\n \"user\": {\n \"name\":\"users/107946847022116401880\",\n \"displayName\":\"FooBot\",\n \"avatarUrl\":\"https://goo.gl/aeDtrS\",\n \"type\":\"BOT\"\n },\n \"type\":\"MENTION\"\n }\n}]\n```","properties":{"length":{"description":"Length of the substring in the plain-text message body this annotation\ncorresponds to.","format":"int32","type":"integer"},"startIndex":{"description":"Start index (0-based, inclusive) in the plain-text message body this\nannotation corresponds to.","format":"int32","type":"integer"},"type":{"description":"The type of this annotation.","enum":["ANNOTATION_TYPE_UNSPECIFIED","USER_MENTION"],"type":"string"},"userMention":{"$ref":"#/components/schemas/UserMentionMetadata"}},"type":"object"},"Button":{"description":"A button. Can be a text button or an image button.","properties":{"imageButton":{"$ref":"#/components/schemas/ImageButton"},"textButton":{"$ref":"#/components/schemas/TextButton"}},"type":"object"},"Card":{"description":"A card is a UI element that can contain UI widgets such as texts, images.","properties":{"cardActions":{"description":"The actions of this card.","items":{"$ref":"#/components/schemas/CardAction"},"type":"array"},"header":{"$ref":"#/components/schemas/CardHeader"},"name":{"description":"Name of the card.","type":"string"},"sections":{"description":"Sections are separated by a line divider.","items":{"$ref":"#/components/schemas/Section"},"type":"array"}},"type":"object"},"CardAction":{"description":"A card action is\nthe action associated with the card. For an invoice card, a\ntypical action would be: delete invoice, email invoice or open the\ninvoice in browser.","properties":{"actionLabel":{"description":"The label used to be displayed in the action menu item.","type":"string"},"onClick":{"$ref":"#/components/schemas/OnClick"}},"type":"object"},"CardHeader":{"properties":{"imageStyle":{"description":"The image's type (e.g. square border or circular border).","enum":["IMAGE_STYLE_UNSPECIFIED","IMAGE","AVATAR"],"type":"string"},"imageUrl":{"description":"The URL of the image in the card header.","type":"string"},"subtitle":{"description":"The subtitle of the card header.","type":"string"},"title":{"description":"The title must be specified. The header has a fixed height: if both a\ntitle and subtitle is specified, each will take up 1 line. If only the\ntitle is specified, it will take up both lines.","type":"string"}},"type":"object"},"DeprecatedEvent":{"description":"Hangouts Chat events.","properties":{"action":{"$ref":"#/components/schemas/FormAction"},"configCompleteRedirectUrl":{"description":"The URL the bot should redirect the user to after they have completed an\nauthorization or configuration flow outside of Hangouts Chat. See the\n[Authorizing access to 3p services guide](/hangouts/chat/how-tos/auth-3p)\nfor more information.","type":"string"},"eventTime":{"description":"The timestamp indicating when the event was dispatched.","format":"google-datetime","type":"string"},"message":{"$ref":"#/components/schemas/Message"},"space":{"$ref":"#/components/schemas/Space"},"threadKey":{"description":"The bot-defined key for the thread related to the event. See the\nthread_key field of the\n`spaces.message.create` request for more information.","type":"string"},"token":{"description":"A secret value that bots can use to verify if a request is from Google. The\ntoken is randomly generated by Google, remains static, and can be obtained\nfrom the Hangouts Chat API configuration page in the Cloud Console.\nDevelopers can revoke/regenerate it if needed from the same page.","type":"string"},"type":{"description":"The type of the event.","enum":["UNSPECIFIED","MESSAGE","ADDED_TO_SPACE","REMOVED_FROM_SPACE","CARD_CLICKED"],"type":"string"},"user":{"$ref":"#/components/schemas/User"}},"type":"object"},"Empty":{"description":"A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.","properties":{},"type":"object"},"FormAction":{"description":"A form action describes the behavior when the form is submitted.\nFor example, an Apps Script can be invoked to handle the form.","properties":{"actionMethodName":{"description":"Apps Script function to invoke when the containing element is\nclicked/activated.","type":"string"},"parameters":{"description":"List of action parameters.","items":{"$ref":"#/components/schemas/ActionParameter"},"type":"array"}},"type":"object"},"Image":{"description":"An image that is specified by a URL and can have an onclick action.","properties":{"aspectRatio":{"description":"The aspect ratio of this image (width/height).","format":"double","type":"number"},"imageUrl":{"description":"The URL of the image.","type":"string"},"onClick":{"$ref":"#/components/schemas/OnClick"}},"type":"object"},"ImageButton":{"description":"An image button with an onclick action.","properties":{"icon":{"description":"The icon specified by an enum that indices to an icon provided by Chat\nAPI.","enum":["ICON_UNSPECIFIED","AIRPLANE","BOOKMARK","BUS","CAR","CLOCK","CONFIRMATION_NUMBER_ICON","DOLLAR","DESCRIPTION","EMAIL","EVENT_PERFORMER","EVENT_SEAT","FLIGHT_ARRIVAL","FLIGHT_DEPARTURE","HOTEL","HOTEL_ROOM_TYPE","INVITE","MAP_PIN","MEMBERSHIP","MULTIPLE_PEOPLE","OFFER","PERSON","PHONE","RESTAURANT_ICON","SHOPPING_CART","STAR","STORE","TICKET","TRAIN","VIDEO_CAMERA","VIDEO_PLAY"],"type":"string"},"iconUrl":{"description":"The icon specified by a URL.","type":"string"},"name":{"description":"The name of this image_button which will be used for accessibility.\nDefault value will be provided if developers don't specify.","type":"string"},"onClick":{"$ref":"#/components/schemas/OnClick"}},"type":"object"},"KeyValue":{"description":"A UI element contains a key (label) and a value (content). And this\nelement may also contain some actions such as onclick button.","properties":{"bottomLabel":{"description":"The text of the bottom label. Formatted text supported.","type":"string"},"button":{"$ref":"#/components/schemas/Button"},"content":{"description":"The text of the content. Formatted text supported and always required.","type":"string"},"contentMultiline":{"description":"If the content should be multiline.","type":"boolean"},"icon":{"description":"An enum value that will be replaced by the Chat API with the\ncorresponding icon image.","enum":["ICON_UNSPECIFIED","AIRPLANE","BOOKMARK","BUS","CAR","CLOCK","CONFIRMATION_NUMBER_ICON","DOLLAR","DESCRIPTION","EMAIL","EVENT_PERFORMER","EVENT_SEAT","FLIGHT_ARRIVAL","FLIGHT_DEPARTURE","HOTEL","HOTEL_ROOM_TYPE","INVITE","MAP_PIN","MEMBERSHIP","MULTIPLE_PEOPLE","OFFER","PERSON","PHONE","RESTAURANT_ICON","SHOPPING_CART","STAR","STORE","TICKET","TRAIN","VIDEO_CAMERA","VIDEO_PLAY"],"type":"string"},"iconUrl":{"description":"The icon specified by a URL.","type":"string"},"onClick":{"$ref":"#/components/schemas/OnClick"},"topLabel":{"description":"The text of the top label. Formatted text supported.","type":"string"}},"type":"object"},"ListMembershipsResponse":{"properties":{"memberships":{"description":"List of memberships in the requested (or first) page.","items":{"$ref":"#/components/schemas/Membership"},"type":"array"},"nextPageToken":{"description":"Continuation token to retrieve the next page of results. It will be empty\nfor the last page of results.","type":"string"}},"type":"object"},"ListSpacesResponse":{"properties":{"nextPageToken":{"description":"Continuation token to retrieve the next page of results. It will be empty\nfor the last page of results. Tokens expire in an hour. An error is thrown\nif an expired token is passed.","type":"string"},"spaces":{"description":"List of spaces in the requested (or first) page.","items":{"$ref":"#/components/schemas/Space"},"type":"array"}},"type":"object"},"Membership":{"description":"Represents a membership relation in Hangouts Chat.","properties":{"createTime":{"description":"The creation time of the membership a.k.a the time at which the member\njoined the space, if applicable.","format":"google-datetime","type":"string"},"member":{"$ref":"#/components/schemas/User"},"name":{"description":"Resource name of the membership, in the form \"spaces/*/members/*\".\n\nExample: spaces/AAAAMpdlehY/members/105115627578887013105","type":"string"},"state":{"description":"State of the membership.","enum":["MEMBERSHIP_STATE_UNSPECIFIED","JOINED","INVITED","NOT_A_MEMBER"],"type":"string"}},"type":"object"},"Message":{"description":"A message in Hangouts Chat.","properties":{"actionResponse":{"$ref":"#/components/schemas/ActionResponse"},"annotations":{"description":"Output only. Annotations associated with the text in this message.","items":{"$ref":"#/components/schemas/Annotation"},"type":"array"},"argumentText":{"description":"Plain-text body of the message with all bot mentions stripped out.","type":"string"},"cards":{"description":"Rich, formatted and interactive cards that can be used to display UI\nelements such as: formatted texts, buttons, clickable images. Cards are\nnormally displayed below the plain-text body of the message.","items":{"$ref":"#/components/schemas/Card"},"type":"array"},"createTime":{"description":"Output only. The time at which the message was created in Hangouts Chat\nserver.","format":"google-datetime","type":"string"},"fallbackText":{"description":"A plain-text description of the message's cards, used when the actual cards\ncannot be displayed (e.g. mobile notifications).","type":"string"},"name":{"description":"Resource name, in the form \"spaces/*/messages/*\".\n\nExample: spaces/AAAAMpdlehY/messages/UMxbHmzDlr4.UMxbHmzDlr4","type":"string"},"previewText":{"description":"Text for generating preview chips. This text will not be displayed to the\nuser, but any links to images, web pages, videos, etc. included here will\ngenerate preview chips.","type":"string"},"sender":{"$ref":"#/components/schemas/User"},"space":{"$ref":"#/components/schemas/Space"},"text":{"description":"Plain-text body of the message.","type":"string"},"thread":{"$ref":"#/components/schemas/Thread"}},"type":"object"},"OnClick":{"description":"An onclick action (e.g. open a link).","properties":{"action":{"$ref":"#/components/schemas/FormAction"},"openLink":{"$ref":"#/components/schemas/OpenLink"}},"type":"object"},"OpenLink":{"description":"A link that opens a new window.","properties":{"url":{"description":"The URL to open.","type":"string"}},"type":"object"},"Section":{"description":"A section contains a collection of widgets that are rendered\n(vertically) in the order that they are specified. Across all platforms,\ncards have a narrow fixed width, so\nthere is currently no need for layout properties (e.g. float).","properties":{"header":{"description":"The header of the section, text formatted supported.","type":"string"},"widgets":{"description":"A section must contain at least 1 widget.","items":{"$ref":"#/components/schemas/WidgetMarkup"},"type":"array"}},"type":"object"},"Space":{"description":"A room or DM in Hangouts Chat.","properties":{"displayName":{"description":"Output only. The display name (only if the space is a room).","type":"string"},"name":{"description":"Resource name of the space, in the form \"spaces/*\".\n\nExample: spaces/AAAAMpdlehYs","type":"string"},"type":{"description":"Output only. The type of a space.","enum":["TYPE_UNSPECIFIED","ROOM","DM"],"type":"string"}},"type":"object"},"TextButton":{"description":"A button with text and onclick action.","properties":{"onClick":{"$ref":"#/components/schemas/OnClick"},"text":{"description":"The text of the button.","type":"string"}},"type":"object"},"TextParagraph":{"description":"A paragraph of text. Formatted text supported.","properties":{"text":{"type":"string"}},"type":"object"},"Thread":{"description":"A thread in Hangouts Chat.","properties":{"name":{"description":"Resource name, in the form \"spaces/*/threads/*\".\n\nExample: spaces/AAAAMpdlehY/threads/UMxbHmzDlr4","type":"string"}},"type":"object"},"User":{"description":"A user in Hangouts Chat.","properties":{"displayName":{"description":"The user's display name.","type":"string"},"name":{"description":"Resource name, in the format \"users/*\".","type":"string"},"type":{"description":"User type.","enum":["TYPE_UNSPECIFIED","HUMAN","BOT"],"type":"string"}},"type":"object"},"UserMentionMetadata":{"description":"Annotation metadata for user mentions (@).","properties":{"type":{"description":"The type of user mention.","enum":["TYPE_UNSPECIFIED","ADD","MENTION"],"type":"string"},"user":{"$ref":"#/components/schemas/User"}},"type":"object"},"WidgetMarkup":{"description":"A widget is a UI element that presents texts, images, etc.","properties":{"buttons":{"description":"A list of buttons. Buttons is also oneof data and only one of these\nfields should be set.","items":{"$ref":"#/components/schemas/Button"},"type":"array"},"image":{"$ref":"#/components/schemas/Image"},"keyValue":{"$ref":"#/components/schemas/KeyValue"},"textParagraph":{"$ref":"#/components/schemas/TextParagraph"}},"type":"object"}}}}