1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.chat.v1; 18 19import "google/api/field_behavior.proto"; 20import "google/chat/v1/membership.proto"; 21import "google/chat/v1/space.proto"; 22 23option csharp_namespace = "Google.Apps.Chat.V1"; 24option go_package = "cloud.google.com/go/chat/apiv1/chatpb;chatpb"; 25option java_multiple_files = true; 26option java_outer_classname = "SpaceSetupProto"; 27option java_package = "com.google.chat.v1"; 28option php_namespace = "Google\\Apps\\Chat\\V1"; 29option ruby_package = "Google::Apps::Chat::V1"; 30 31// Request to create a space and add specified users to it. 32message SetUpSpaceRequest { 33 // Required. The `Space.spaceType` field is required. 34 // 35 // To create a space, set `Space.spaceType` to `SPACE` and set 36 // `Space.displayName`. If you receive the error message `ALREADY_EXISTS` when 37 // setting up a space, try a different `displayName`. An existing space 38 // within the Google Workspace organization might already use this display 39 // name. 40 // 41 // To create a group chat, set `Space.spaceType` to 42 // `GROUP_CHAT`. Don't set `Space.displayName`. 43 // 44 // To create a 1:1 conversation between humans, 45 // set `Space.spaceType` to `DIRECT_MESSAGE` and set 46 // `Space.singleUserBotDm` to `false`. Don't set `Space.displayName` or 47 // `Space.spaceDetails`. 48 // 49 // To create an 1:1 conversation between a human and the calling Chat app, set 50 // `Space.spaceType` to `DIRECT_MESSAGE` and 51 // `Space.singleUserBotDm` to `true`. Don't set `Space.displayName` or 52 // `Space.spaceDetails`. 53 // 54 // If a `DIRECT_MESSAGE` space already exists, that space is returned instead 55 // of creating a new space. 56 Space space = 1 [(google.api.field_behavior) = REQUIRED]; 57 58 // Optional. A unique identifier for this request. 59 // A random UUID is recommended. 60 // Specifying an existing request ID returns the space created with that ID 61 // instead of creating a new space. 62 // Specifying an existing request ID from the same Chat app with a different 63 // authenticated user returns an error. 64 string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; 65 66 // Optional. The Google Chat users to invite to join the space. Omit the 67 // calling user, as they are added automatically. 68 // 69 // The set currently allows up to 20 memberships (in addition to the caller). 70 // 71 // The `Membership.member` field must contain a `user` with `name` populated 72 // (format: `users/{user}`) and `type` set to `User.Type.HUMAN`. You can only 73 // add human users when setting up a space (adding Chat apps is only supported 74 // for direct message setup with the calling app). You can also add members 75 // using the user's email as an alias for {user}. For example, the `user.name` 76 // can be `users/example@gmail.com`." To invite Gmail users or users from 77 // external Google Workspace domains, user's email must be used for 78 // `{user}`. 79 // 80 // Optional when setting `Space.spaceType` to `SPACE`. 81 // 82 // Required when setting `Space.spaceType` to `GROUP_CHAT`, along with at 83 // least two memberships. 84 // 85 // Required when setting `Space.spaceType` to `DIRECT_MESSAGE` with a human 86 // user, along with exactly one membership. 87 // 88 // Must be empty when creating a 1:1 conversation between a human and the 89 // calling Chat app (when setting `Space.spaceType` to 90 // `DIRECT_MESSAGE` and `Space.singleUserBotDm` to `true`). 91 repeated Membership memberships = 4 [(google.api.field_behavior) = OPTIONAL]; 92} 93