1 // Copyright 2024 Google LLC. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Code generated file. DO NOT EDIT. 6 7 // Package groupssettings provides access to the Groups Settings API. 8 // 9 // For product documentation, see: https://developers.google.com/google-apps/groups-settings/get_started 10 // 11 // # Library status 12 // 13 // These client libraries are officially supported by Google. However, this 14 // library is considered complete and is in maintenance mode. This means 15 // that we will address critical bugs and security issues but will not add 16 // any new features. 17 // 18 // When possible, we recommend using our newer 19 // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) 20 // that are still actively being worked and iterated on. 21 // 22 // # Creating a client 23 // 24 // Usage example: 25 // 26 // import "google.golang.org/api/groupssettings/v1" 27 // ... 28 // ctx := context.Background() 29 // groupssettingsService, err := groupssettings.NewService(ctx) 30 // 31 // In this example, Google Application Default Credentials are used for 32 // authentication. For information on how to create and obtain Application 33 // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 34 // 35 // # Other authentication options 36 // 37 // To use an API key for authentication (note: some APIs do not support API 38 // keys), use [google.golang.org/api/option.WithAPIKey]: 39 // 40 // groupssettingsService, err := groupssettings.NewService(ctx, option.WithAPIKey("AIza...")) 41 // 42 // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth 43 // flow, use [google.golang.org/api/option.WithTokenSource]: 44 // 45 // config := &oauth2.Config{...} 46 // // ... 47 // token, err := config.Exchange(ctx, ...) 48 // groupssettingsService, err := groupssettings.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 49 // 50 // See [google.golang.org/api/option.ClientOption] for details on options. 51 package groupssettings // import "google.golang.org/api/groupssettings/v1" 52 53 import ( 54 "bytes" 55 "context" 56 "encoding/json" 57 "errors" 58 "fmt" 59 "io" 60 "net/http" 61 "net/url" 62 "strconv" 63 "strings" 64 65 googleapi "google.golang.org/api/googleapi" 66 internal "google.golang.org/api/internal" 67 gensupport "google.golang.org/api/internal/gensupport" 68 option "google.golang.org/api/option" 69 internaloption "google.golang.org/api/option/internaloption" 70 htransport "google.golang.org/api/transport/http" 71 ) 72 73 // Always reference these packages, just in case the auto-generated code 74 // below doesn't. 75 var _ = bytes.NewBuffer 76 var _ = strconv.Itoa 77 var _ = fmt.Sprintf 78 var _ = json.NewDecoder 79 var _ = io.Copy 80 var _ = url.Parse 81 var _ = gensupport.MarshalJSON 82 var _ = googleapi.Version 83 var _ = errors.New 84 var _ = strings.Replace 85 var _ = context.Canceled 86 var _ = internaloption.WithDefaultEndpoint 87 var _ = internal.Version 88 89 const apiId = "groupssettings:v1" 90 const apiName = "groupssettings" 91 const apiVersion = "v1" 92 const basePath = "https://www.googleapis.com/groups/v1/groups/" 93 const basePathTemplate = "https://www.UNIVERSE_DOMAIN/groups/v1/groups/" 94 95 // OAuth2 scopes used by this API. 96 const ( 97 // View and manage the settings of a G Suite group 98 AppsGroupsSettingsScope = "https://www.googleapis.com/auth/apps.groups.settings" 99 ) 100 101 // NewService creates a new Service. 102 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 103 scopesOption := internaloption.WithDefaultScopes( 104 "https://www.googleapis.com/auth/apps.groups.settings", 105 ) 106 // NOTE: prepend, so we don't override user-specified scopes. 107 opts = append([]option.ClientOption{scopesOption}, opts...) 108 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 109 opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate)) 110 opts = append(opts, internaloption.EnableNewAuthLibrary()) 111 client, endpoint, err := htransport.NewClient(ctx, opts...) 112 if err != nil { 113 return nil, err 114 } 115 s, err := New(client) 116 if err != nil { 117 return nil, err 118 } 119 if endpoint != "" { 120 s.BasePath = endpoint 121 } 122 return s, nil 123 } 124 125 // New creates a new Service. It uses the provided http.Client for requests. 126 // 127 // Deprecated: please use NewService instead. 128 // To provide a custom HTTP client, use option.WithHTTPClient. 129 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 130 func New(client *http.Client) (*Service, error) { 131 if client == nil { 132 return nil, errors.New("client is nil") 133 } 134 s := &Service{client: client, BasePath: basePath} 135 s.Groups = NewGroupsService(s) 136 return s, nil 137 } 138 139 type Service struct { 140 client *http.Client 141 BasePath string // API endpoint base URL 142 UserAgent string // optional additional User-Agent fragment 143 144 Groups *GroupsService 145 } 146 147 func (s *Service) userAgent() string { 148 if s.UserAgent == "" { 149 return googleapi.UserAgent 150 } 151 return googleapi.UserAgent + " " + s.UserAgent 152 } 153 154 func NewGroupsService(s *Service) *GroupsService { 155 rs := &GroupsService{s: s} 156 return rs 157 } 158 159 type GroupsService struct { 160 s *Service 161 } 162 163 // Groups: JSON template for Group resource 164 type Groups struct { 165 // AllowExternalMembers: Identifies whether members external to your 166 // organization can join the group. Possible values are: 167 // - true: G Suite users external to your organization can become members of 168 // this group. 169 // - false: Users not belonging to the organization are not allowed to become 170 // members of this group. 171 AllowExternalMembers string `json:"allowExternalMembers,omitempty"` 172 // AllowGoogleCommunication: Deprecated. Allows Google to contact administrator 173 // of the group. 174 // - true: Allow Google to contact managers of this group. Occasionally Google 175 // may send updates on the latest features, ask for input on new features, or 176 // ask for permission to highlight your group. 177 // - false: Google can not contact managers of this group. 178 AllowGoogleCommunication string `json:"allowGoogleCommunication,omitempty"` 179 // AllowWebPosting: Allows posting from web. Possible values are: 180 // - true: Allows any member to post to the group forum. 181 // - false: Members only use Gmail to communicate with the group. 182 AllowWebPosting string `json:"allowWebPosting,omitempty"` 183 // ArchiveOnly: Allows the group to be archived only. Possible values are: 184 // - true: Group is archived and the group is inactive. New messages to this 185 // group are rejected. The older archived messages are browseable and 186 // searchable. 187 // - If true, the whoCanPostMessage property is set to NONE_CAN_POST. 188 // - If reverted from true to false, whoCanPostMessages is set to 189 // ALL_MANAGERS_CAN_POST. 190 // - false: The group is active and can receive messages. 191 // - When false, updating whoCanPostMessage to NONE_CAN_POST, results in an 192 // error. 193 ArchiveOnly string `json:"archiveOnly,omitempty"` 194 // CustomFooterText: Set the content of custom footer text. The maximum number 195 // of characters is 1,000. 196 CustomFooterText string `json:"customFooterText,omitempty"` 197 // CustomReplyTo: An email address used when replying to a message if the 198 // replyTo property is set to REPLY_TO_CUSTOM. This address is defined by an 199 // account administrator. 200 // - When the group's ReplyTo property is set to REPLY_TO_CUSTOM, the 201 // customReplyTo property holds a custom email address used when replying to a 202 // message. 203 // - If the group's ReplyTo property is set to REPLY_TO_CUSTOM, the 204 // customReplyTo property must have a text value or an error is returned. 205 CustomReplyTo string `json:"customReplyTo,omitempty"` 206 // CustomRolesEnabledForSettingsToBeMerged: Specifies whether the group has a 207 // custom role that's included in one of the settings being merged. This field 208 // is read-only and update/patch requests to it are ignored. Possible values 209 // are: 210 // - true 211 // - false 212 CustomRolesEnabledForSettingsToBeMerged string `json:"customRolesEnabledForSettingsToBeMerged,omitempty"` 213 // DefaultMessageDenyNotificationText: When a message is rejected, this is text 214 // for the rejection notification sent to the message's author. By default, 215 // this property is empty and has no value in the API's response body. The 216 // maximum notification text size is 10,000 characters. Note: Requires 217 // sendMessageDenyNotification property to be true. 218 DefaultMessageDenyNotificationText string `json:"defaultMessageDenyNotificationText,omitempty"` 219 // DefaultSender: Default sender for members who can post messages as the 220 // group. Possible values are: - `DEFAULT_SELF`: By default messages will be 221 // sent from the user - `GROUP`: By default messages will be sent from the 222 // group 223 DefaultSender string `json:"default_sender,omitempty"` 224 // Description: Description of the group. This property value may be an empty 225 // string if no group description has been entered. If entered, the maximum 226 // group description is no more than 300 characters. 227 Description string `json:"description,omitempty"` 228 // Email: The group's email address. This property can be updated using the 229 // Directory API. Note: Only a group owner can change a group's email address. 230 // A group manager can't do this. 231 // When you change your group's address using the Directory API or the control 232 // panel, you are changing the address your subscribers use to send email and 233 // the web address people use to access your group. People can't reach your 234 // group by visiting the old address. 235 Email string `json:"email,omitempty"` 236 // EnableCollaborativeInbox: Specifies whether a collaborative inbox will 237 // remain turned on for the group. Possible values are: 238 // - true 239 // - false 240 EnableCollaborativeInbox string `json:"enableCollaborativeInbox,omitempty"` 241 // FavoriteRepliesOnTop: Indicates if favorite replies should be displayed 242 // above other replies. 243 // - true: Favorite replies will be displayed above other replies. 244 // - false: Favorite replies will not be displayed above other replies. 245 FavoriteRepliesOnTop string `json:"favoriteRepliesOnTop,omitempty"` 246 // IncludeCustomFooter: Whether to include custom footer. Possible values are: 247 // 248 // - true 249 // - false 250 IncludeCustomFooter string `json:"includeCustomFooter,omitempty"` 251 // IncludeInGlobalAddressList: Enables the group to be included in the Global 252 // Address List. For more information, see the help center. Possible values 253 // are: 254 // - true: Group is included in the Global Address List. 255 // - false: Group is not included in the Global Address List. 256 IncludeInGlobalAddressList string `json:"includeInGlobalAddressList,omitempty"` 257 // IsArchived: Allows the Group contents to be archived. Possible values are: 258 // 259 // - true: Archive messages sent to the group. 260 // - false: Do not keep an archive of messages sent to this group. If false, 261 // previously archived messages remain in the archive. 262 IsArchived string `json:"isArchived,omitempty"` 263 // Kind: The type of the resource. It is always groupsSettings#groups. 264 Kind string `json:"kind,omitempty"` 265 // MaxMessageBytes: Deprecated. The maximum size of a message is 25Mb. 266 MaxMessageBytes int64 `json:"maxMessageBytes,omitempty"` 267 // MembersCanPostAsTheGroup: Enables members to post messages as the group. 268 // Possible values are: 269 // - true: Group member can post messages using the group's email address 270 // instead of their own email address. Message appear to originate from the 271 // group itself. Note: When true, any message moderation settings on individual 272 // users or new members do not apply to posts made on behalf of the group. 273 // - false: Members can not post in behalf of the group's email address. 274 MembersCanPostAsTheGroup string `json:"membersCanPostAsTheGroup,omitempty"` 275 // MessageDisplayFont: Deprecated. The default message display font always has 276 // a value of "DEFAULT_FONT". 277 MessageDisplayFont string `json:"messageDisplayFont,omitempty"` 278 // MessageModerationLevel: Moderation level of incoming messages. Possible 279 // values are: 280 // - MODERATE_ALL_MESSAGES: All messages are sent to the group owner's email 281 // address for approval. If approved, the message is sent to the group. 282 // - MODERATE_NON_MEMBERS: All messages from non group members are sent to the 283 // group owner's email address for approval. If approved, the message is sent 284 // to the group. 285 // - MODERATE_NEW_MEMBERS: All messages from new members are sent to the group 286 // owner's email address for approval. If approved, the message is sent to the 287 // group. 288 // - MODERATE_NONE: No moderator approval is required. Messages are delivered 289 // directly to the group. Note: When the whoCanPostMessage is set to 290 // ANYONE_CAN_POST, we recommend the messageModerationLevel be set to 291 // MODERATE_NON_MEMBERS to protect the group from possible spam. 292 // When memberCanPostAsTheGroup is true, any message moderation settings on 293 // individual users or new members will not apply to posts made on behalf of 294 // the group. 295 MessageModerationLevel string `json:"messageModerationLevel,omitempty"` 296 // Name: Name of the group, which has a maximum size of 75 characters. 297 Name string `json:"name,omitempty"` 298 // PrimaryLanguage: The primary language for group. For a group's primary 299 // language use the language tags from the G Suite languages found at G Suite 300 // Email Settings API Email Language Tags. 301 PrimaryLanguage string `json:"primaryLanguage,omitempty"` 302 // ReplyTo: Specifies who receives the default reply. Possible values are: 303 // - REPLY_TO_CUSTOM: For replies to messages, use the group's custom email 304 // address. 305 // When the group's ReplyTo property is set to REPLY_TO_CUSTOM, the 306 // customReplyTo property holds the custom email address used when replying to 307 // a message. If the group's ReplyTo property is set to REPLY_TO_CUSTOM, the 308 // customReplyTo property must have a value. Otherwise an error is returned. 309 // 310 // - REPLY_TO_SENDER: The reply sent to author of message. 311 // - REPLY_TO_LIST: This reply message is sent to the group. 312 // - REPLY_TO_OWNER: The reply is sent to the owner(s) of the group. This does 313 // not include the group's managers. 314 // - REPLY_TO_IGNORE: Group users individually decide where the message reply 315 // is sent. 316 // - REPLY_TO_MANAGERS: This reply message is sent to the group's managers, 317 // which includes all managers and the group owner. 318 ReplyTo string `json:"replyTo,omitempty"` 319 // SendMessageDenyNotification: Allows a member to be notified if the member's 320 // message to the group is denied by the group owner. Possible values are: 321 // - true: When a message is rejected, send the deny message notification to 322 // the message author. 323 // The defaultMessageDenyNotificationText property is dependent on the 324 // sendMessageDenyNotification property being true. 325 // 326 // - false: When a message is rejected, no notification is sent. 327 SendMessageDenyNotification string `json:"sendMessageDenyNotification,omitempty"` 328 // ShowInGroupDirectory: Deprecated. This is merged into the new 329 // whoCanDiscoverGroup setting. Allows the group to be visible in the Groups 330 // Directory. Possible values are: 331 // - true: All groups in the account are listed in the Groups directory. 332 // - false: All groups in the account are not listed in the directory. 333 ShowInGroupDirectory string `json:"showInGroupDirectory,omitempty"` 334 // SpamModerationLevel: Specifies moderation levels for messages detected as 335 // spam. Possible values are: 336 // - ALLOW: Post the message to the group. 337 // - MODERATE: Send the message to the moderation queue. This is the default. 338 // 339 // - SILENTLY_MODERATE: Send the message to the moderation queue, but do not 340 // send notification to moderators. 341 // - REJECT: Immediately reject the message. 342 SpamModerationLevel string `json:"spamModerationLevel,omitempty"` 343 // WhoCanAdd: Deprecated. This is merged into the new whoCanModerateMembers 344 // setting. Permissions to add members. Possible values are: 345 // - ALL_MEMBERS_CAN_ADD: Managers and members can directly add new members. 346 // - ALL_MANAGERS_CAN_ADD: Only managers can directly add new members. this 347 // includes the group's owner. 348 // - ALL_OWNERS_CAN_ADD: Only owners can directly add new members. 349 // - NONE_CAN_ADD: No one can directly add new members. 350 WhoCanAdd string `json:"whoCanAdd,omitempty"` 351 // WhoCanAddReferences: Deprecated. This functionality is no longer supported 352 // in the Google Groups UI. The value is always "NONE". 353 WhoCanAddReferences string `json:"whoCanAddReferences,omitempty"` 354 // WhoCanApproveMembers: Specifies who can approve members who ask to join 355 // groups. This permission will be deprecated once it is merged into the new 356 // whoCanModerateMembers setting. Possible values are: 357 // - ALL_MEMBERS_CAN_APPROVE 358 // - ALL_MANAGERS_CAN_APPROVE 359 // - ALL_OWNERS_CAN_APPROVE 360 // - NONE_CAN_APPROVE 361 WhoCanApproveMembers string `json:"whoCanApproveMembers,omitempty"` 362 // WhoCanApproveMessages: Deprecated. This is merged into the new 363 // whoCanModerateContent setting. Specifies who can approve pending messages in 364 // the moderation queue. Possible values are: 365 // - ALL_MEMBERS 366 // - OWNERS_AND_MANAGERS 367 // - OWNERS_ONLY 368 // - NONE 369 WhoCanApproveMessages string `json:"whoCanApproveMessages,omitempty"` 370 // WhoCanAssignTopics: Deprecated. This is merged into the new 371 // whoCanAssistContent setting. Permission to assign topics in a forum to 372 // another user. Possible values are: 373 // - ALL_MEMBERS 374 // - OWNERS_AND_MANAGERS 375 // - MANAGERS_ONLY 376 // - OWNERS_ONLY 377 // - NONE 378 WhoCanAssignTopics string `json:"whoCanAssignTopics,omitempty"` 379 // WhoCanAssistContent: Specifies who can moderate metadata. Possible values 380 // are: 381 // - ALL_MEMBERS 382 // - OWNERS_AND_MANAGERS 383 // - MANAGERS_ONLY 384 // - OWNERS_ONLY 385 // - NONE 386 WhoCanAssistContent string `json:"whoCanAssistContent,omitempty"` 387 // WhoCanBanUsers: Specifies who can deny membership to users. This permission 388 // will be deprecated once it is merged into the new whoCanModerateMembers 389 // setting. Possible values are: 390 // - ALL_MEMBERS 391 // - OWNERS_AND_MANAGERS 392 // - OWNERS_ONLY 393 // - NONE 394 WhoCanBanUsers string `json:"whoCanBanUsers,omitempty"` 395 // WhoCanContactOwner: Permission to contact owner of the group via web UI. 396 // Possible values are: 397 // - ALL_IN_DOMAIN_CAN_CONTACT 398 // - ALL_MANAGERS_CAN_CONTACT 399 // - ALL_MEMBERS_CAN_CONTACT 400 // - ANYONE_CAN_CONTACT 401 // - ALL_OWNERS_CAN_CONTACT 402 WhoCanContactOwner string `json:"whoCanContactOwner,omitempty"` 403 // WhoCanDeleteAnyPost: Deprecated. This is merged into the new 404 // whoCanModerateContent setting. Specifies who can delete replies to topics. 405 // (Authors can always delete their own posts). Possible values are: 406 // - ALL_MEMBERS 407 // - OWNERS_AND_MANAGERS 408 // - OWNERS_ONLY 409 // - NONE 410 WhoCanDeleteAnyPost string `json:"whoCanDeleteAnyPost,omitempty"` 411 // WhoCanDeleteTopics: Deprecated. This is merged into the new 412 // whoCanModerateContent setting. Specifies who can delete topics. Possible 413 // values are: 414 // - ALL_MEMBERS 415 // - OWNERS_AND_MANAGERS 416 // - OWNERS_ONLY 417 // - NONE 418 WhoCanDeleteTopics string `json:"whoCanDeleteTopics,omitempty"` 419 // WhoCanDiscoverGroup: Specifies the set of users for whom this group is 420 // discoverable. Possible values are: 421 // - ANYONE_CAN_DISCOVER 422 // - ALL_IN_DOMAIN_CAN_DISCOVER 423 // - ALL_MEMBERS_CAN_DISCOVER 424 WhoCanDiscoverGroup string `json:"whoCanDiscoverGroup,omitempty"` 425 // WhoCanEnterFreeFormTags: Deprecated. This is merged into the new 426 // whoCanAssistContent setting. Permission to enter free form tags for topics 427 // in a forum. Possible values are: 428 // - ALL_MEMBERS 429 // - OWNERS_AND_MANAGERS 430 // - MANAGERS_ONLY 431 // - OWNERS_ONLY 432 // - NONE 433 WhoCanEnterFreeFormTags string `json:"whoCanEnterFreeFormTags,omitempty"` 434 // WhoCanHideAbuse: Deprecated. This is merged into the new 435 // whoCanModerateContent setting. Specifies who can hide posts by reporting 436 // them as abuse. Possible values are: 437 // - ALL_MEMBERS 438 // - OWNERS_AND_MANAGERS 439 // - OWNERS_ONLY 440 // - NONE 441 WhoCanHideAbuse string `json:"whoCanHideAbuse,omitempty"` 442 // WhoCanInvite: Deprecated. This is merged into the new whoCanModerateMembers 443 // setting. Permissions to invite new members. Possible values are: 444 // - ALL_MEMBERS_CAN_INVITE: Managers and members can invite a new member 445 // candidate. 446 // - ALL_MANAGERS_CAN_INVITE: Only managers can invite a new member. This 447 // includes the group's owner. 448 // - ALL_OWNERS_CAN_INVITE: Only owners can invite a new member. 449 // - NONE_CAN_INVITE: No one can invite a new member candidate. 450 WhoCanInvite string `json:"whoCanInvite,omitempty"` 451 // WhoCanJoin: Permission to join group. Possible values are: 452 // - ANYONE_CAN_JOIN: Anyone in the account domain can join. This includes 453 // accounts with multiple domains. 454 // - ALL_IN_DOMAIN_CAN_JOIN: Any Internet user who is outside your domain can 455 // access your Google Groups service and view the list of groups in your Groups 456 // directory. Warning: Group owners can add external addresses, outside of the 457 // domain to their groups. They can also allow people outside your domain to 458 // join their groups. If you later disable this option, any external addresses 459 // already added to users' groups remain in those groups. 460 // - INVITED_CAN_JOIN: Candidates for membership can be invited to join. 461 // - CAN_REQUEST_TO_JOIN: Non members can request an invitation to join. 462 WhoCanJoin string `json:"whoCanJoin,omitempty"` 463 // WhoCanLeaveGroup: Permission to leave the group. Possible values are: 464 // - ALL_MANAGERS_CAN_LEAVE 465 // - ALL_MEMBERS_CAN_LEAVE 466 // - NONE_CAN_LEAVE 467 WhoCanLeaveGroup string `json:"whoCanLeaveGroup,omitempty"` 468 // WhoCanLockTopics: Deprecated. This is merged into the new 469 // whoCanModerateContent setting. Specifies who can prevent users from posting 470 // replies to topics. Possible values are: 471 // - ALL_MEMBERS 472 // - OWNERS_AND_MANAGERS 473 // - OWNERS_ONLY 474 // - NONE 475 WhoCanLockTopics string `json:"whoCanLockTopics,omitempty"` 476 // WhoCanMakeTopicsSticky: Deprecated. This is merged into the new 477 // whoCanModerateContent setting. Specifies who can make topics appear at the 478 // top of the topic list. Possible values are: 479 // - ALL_MEMBERS 480 // - OWNERS_AND_MANAGERS 481 // - OWNERS_ONLY 482 // - NONE 483 WhoCanMakeTopicsSticky string `json:"whoCanMakeTopicsSticky,omitempty"` 484 // WhoCanMarkDuplicate: Deprecated. This is merged into the new 485 // whoCanAssistContent setting. Permission to mark a topic as a duplicate of 486 // another topic. Possible values are: 487 // - ALL_MEMBERS 488 // - OWNERS_AND_MANAGERS 489 // - MANAGERS_ONLY 490 // - OWNERS_ONLY 491 // - NONE 492 WhoCanMarkDuplicate string `json:"whoCanMarkDuplicate,omitempty"` 493 // WhoCanMarkFavoriteReplyOnAnyTopic: Deprecated. This is merged into the new 494 // whoCanAssistContent setting. Permission to mark any other user's post as a 495 // favorite reply. Possible values are: 496 // - ALL_MEMBERS 497 // - OWNERS_AND_MANAGERS 498 // - MANAGERS_ONLY 499 // - OWNERS_ONLY 500 // - NONE 501 WhoCanMarkFavoriteReplyOnAnyTopic string `json:"whoCanMarkFavoriteReplyOnAnyTopic,omitempty"` 502 // WhoCanMarkFavoriteReplyOnOwnTopic: Deprecated. This is merged into the new 503 // whoCanAssistContent setting. Permission to mark a post for a topic they 504 // started as a favorite reply. Possible values are: 505 // - ALL_MEMBERS 506 // - OWNERS_AND_MANAGERS 507 // - MANAGERS_ONLY 508 // - OWNERS_ONLY 509 // - NONE 510 WhoCanMarkFavoriteReplyOnOwnTopic string `json:"whoCanMarkFavoriteReplyOnOwnTopic,omitempty"` 511 // WhoCanMarkNoResponseNeeded: Deprecated. This is merged into the new 512 // whoCanAssistContent setting. Permission to mark a topic as not needing a 513 // response. Possible values are: 514 // - ALL_MEMBERS 515 // - OWNERS_AND_MANAGERS 516 // - MANAGERS_ONLY 517 // - OWNERS_ONLY 518 // - NONE 519 WhoCanMarkNoResponseNeeded string `json:"whoCanMarkNoResponseNeeded,omitempty"` 520 // WhoCanModerateContent: Specifies who can moderate content. Possible values 521 // are: 522 // - ALL_MEMBERS 523 // - OWNERS_AND_MANAGERS 524 // - OWNERS_ONLY 525 // - NONE 526 WhoCanModerateContent string `json:"whoCanModerateContent,omitempty"` 527 // WhoCanModerateMembers: Specifies who can manage members. Possible values 528 // are: 529 // - ALL_MEMBERS 530 // - OWNERS_AND_MANAGERS 531 // - OWNERS_ONLY 532 // - NONE 533 WhoCanModerateMembers string `json:"whoCanModerateMembers,omitempty"` 534 // WhoCanModifyMembers: Deprecated. This is merged into the new 535 // whoCanModerateMembers setting. Specifies who can change group members' 536 // roles. Possible values are: 537 // - ALL_MEMBERS 538 // - OWNERS_AND_MANAGERS 539 // - OWNERS_ONLY 540 // - NONE 541 WhoCanModifyMembers string `json:"whoCanModifyMembers,omitempty"` 542 // WhoCanModifyTagsAndCategories: Deprecated. This is merged into the new 543 // whoCanAssistContent setting. Permission to change tags and categories. 544 // Possible values are: 545 // - ALL_MEMBERS 546 // - OWNERS_AND_MANAGERS 547 // - MANAGERS_ONLY 548 // - OWNERS_ONLY 549 // - NONE 550 WhoCanModifyTagsAndCategories string `json:"whoCanModifyTagsAndCategories,omitempty"` 551 // WhoCanMoveTopicsIn: Deprecated. This is merged into the new 552 // whoCanModerateContent setting. Specifies who can move topics into the group 553 // or forum. Possible values are: 554 // - ALL_MEMBERS 555 // - OWNERS_AND_MANAGERS 556 // - OWNERS_ONLY 557 // - NONE 558 WhoCanMoveTopicsIn string `json:"whoCanMoveTopicsIn,omitempty"` 559 // WhoCanMoveTopicsOut: Deprecated. This is merged into the new 560 // whoCanModerateContent setting. Specifies who can move topics out of the 561 // group or forum. Possible values are: 562 // - ALL_MEMBERS 563 // - OWNERS_AND_MANAGERS 564 // - OWNERS_ONLY 565 // - NONE 566 WhoCanMoveTopicsOut string `json:"whoCanMoveTopicsOut,omitempty"` 567 // WhoCanPostAnnouncements: Deprecated. This is merged into the new 568 // whoCanModerateContent setting. Specifies who can post announcements, a 569 // special topic type. Possible values are: 570 // - ALL_MEMBERS 571 // - OWNERS_AND_MANAGERS 572 // - OWNERS_ONLY 573 // - NONE 574 WhoCanPostAnnouncements string `json:"whoCanPostAnnouncements,omitempty"` 575 // WhoCanPostMessage: Permissions to post messages. Possible values are: 576 // - NONE_CAN_POST: The group is disabled and archived. No one can post a 577 // message to this group. 578 // - When archiveOnly is false, updating whoCanPostMessage to NONE_CAN_POST, 579 // results in an error. 580 // - If archiveOnly is reverted from true to false, whoCanPostMessages is set 581 // to ALL_MANAGERS_CAN_POST. 582 // - ALL_MANAGERS_CAN_POST: Managers, including group owners, can post 583 // messages. 584 // - ALL_MEMBERS_CAN_POST: Any group member can post a message. 585 // - ALL_OWNERS_CAN_POST: Only group owners can post a message. 586 // - ALL_IN_DOMAIN_CAN_POST: Anyone in the account can post a message. 587 // - ANYONE_CAN_POST: Any Internet user who outside your account can access 588 // your Google Groups service and post a message. Note: When whoCanPostMessage 589 // is set to ANYONE_CAN_POST, we recommend the messageModerationLevel be set to 590 // MODERATE_NON_MEMBERS to protect the group from possible spam. 591 WhoCanPostMessage string `json:"whoCanPostMessage,omitempty"` 592 // WhoCanTakeTopics: Deprecated. This is merged into the new 593 // whoCanAssistContent setting. Permission to take topics in a forum. Possible 594 // values are: 595 // - ALL_MEMBERS 596 // - OWNERS_AND_MANAGERS 597 // - MANAGERS_ONLY 598 // - OWNERS_ONLY 599 // - NONE 600 WhoCanTakeTopics string `json:"whoCanTakeTopics,omitempty"` 601 // WhoCanUnassignTopic: Deprecated. This is merged into the new 602 // whoCanAssistContent setting. Permission to unassign any topic in a forum. 603 // Possible values are: 604 // - ALL_MEMBERS 605 // - OWNERS_AND_MANAGERS 606 // - MANAGERS_ONLY 607 // - OWNERS_ONLY 608 // - NONE 609 WhoCanUnassignTopic string `json:"whoCanUnassignTopic,omitempty"` 610 // WhoCanUnmarkFavoriteReplyOnAnyTopic: Deprecated. This is merged into the new 611 // whoCanAssistContent setting. Permission to unmark any post from a favorite 612 // reply. Possible values are: 613 // - ALL_MEMBERS 614 // - OWNERS_AND_MANAGERS 615 // - MANAGERS_ONLY 616 // - OWNERS_ONLY 617 // - NONE 618 WhoCanUnmarkFavoriteReplyOnAnyTopic string `json:"whoCanUnmarkFavoriteReplyOnAnyTopic,omitempty"` 619 // WhoCanViewGroup: Permissions to view group messages. Possible values are: 620 // 621 // - ANYONE_CAN_VIEW: Any Internet user can view the group's messages. 622 // - ALL_IN_DOMAIN_CAN_VIEW: Anyone in your account can view this group's 623 // messages. 624 // - ALL_MEMBERS_CAN_VIEW: All group members can view the group's messages. 625 // - ALL_MANAGERS_CAN_VIEW: Any group manager can view this group's messages. 626 WhoCanViewGroup string `json:"whoCanViewGroup,omitempty"` 627 // WhoCanViewMembership: Permissions to view membership. Possible values are: 628 // 629 // - ALL_IN_DOMAIN_CAN_VIEW: Anyone in the account can view the group members 630 // list. 631 // If a group already has external members, those members can still send email 632 // to this group. 633 // 634 // - ALL_MEMBERS_CAN_VIEW: The group members can view the group members list. 635 // 636 // - ALL_MANAGERS_CAN_VIEW: The group managers can view group members list. 637 WhoCanViewMembership string `json:"whoCanViewMembership,omitempty"` 638 639 // ServerResponse contains the HTTP response code and headers from the server. 640 googleapi.ServerResponse `json:"-"` 641 // ForceSendFields is a list of field names (e.g. "AllowExternalMembers") to 642 // unconditionally include in API requests. By default, fields with empty or 643 // default values are omitted from API requests. See 644 // https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more 645 // details. 646 ForceSendFields []string `json:"-"` 647 // NullFields is a list of field names (e.g. "AllowExternalMembers") to include 648 // in API requests with the JSON null value. By default, fields with empty 649 // values are omitted from API requests. See 650 // https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details. 651 NullFields []string `json:"-"` 652 } 653 654 func (s *Groups) MarshalJSON() ([]byte, error) { 655 type NoMethod Groups 656 return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields) 657 } 658 659 type GroupsGetCall struct { 660 s *Service 661 groupUniqueId string 662 urlParams_ gensupport.URLParams 663 ifNoneMatch_ string 664 ctx_ context.Context 665 header_ http.Header 666 } 667 668 // Get: Gets one resource by id. 669 // 670 // - groupUniqueId: The group's email address. 671 func (r *GroupsService) Get(groupUniqueId string) *GroupsGetCall { 672 c := &GroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 673 c.groupUniqueId = groupUniqueId 674 return c 675 } 676 677 // Fields allows partial responses to be retrieved. See 678 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 679 // details. 680 func (c *GroupsGetCall) Fields(s ...googleapi.Field) *GroupsGetCall { 681 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 682 return c 683 } 684 685 // IfNoneMatch sets an optional parameter which makes the operation fail if the 686 // object's ETag matches the given value. This is useful for getting updates 687 // only after the object has changed since the last request. 688 func (c *GroupsGetCall) IfNoneMatch(entityTag string) *GroupsGetCall { 689 c.ifNoneMatch_ = entityTag 690 return c 691 } 692 693 // Context sets the context to be used in this call's Do method. 694 func (c *GroupsGetCall) Context(ctx context.Context) *GroupsGetCall { 695 c.ctx_ = ctx 696 return c 697 } 698 699 // Header returns a http.Header that can be modified by the caller to add 700 // headers to the request. 701 func (c *GroupsGetCall) Header() http.Header { 702 if c.header_ == nil { 703 c.header_ = make(http.Header) 704 } 705 return c.header_ 706 } 707 708 func (c *GroupsGetCall) doRequest(alt string) (*http.Response, error) { 709 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_) 710 if c.ifNoneMatch_ != "" { 711 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 712 } 713 var body io.Reader = nil 714 c.urlParams_.Set("alt", alt) 715 c.urlParams_.Set("prettyPrint", "false") 716 urls := googleapi.ResolveRelative(c.s.BasePath, "{groupUniqueId}") 717 urls += "?" + c.urlParams_.Encode() 718 req, err := http.NewRequest("GET", urls, body) 719 if err != nil { 720 return nil, err 721 } 722 req.Header = reqHeaders 723 googleapi.Expand(req.URL, map[string]string{ 724 "groupUniqueId": c.groupUniqueId, 725 }) 726 return gensupport.SendRequest(c.ctx_, c.s.client, req) 727 } 728 729 // Do executes the "groupsSettings.groups.get" call. 730 // Any non-2xx status code is an error. Response headers are in either 731 // *Groups.ServerResponse.Header or (if a response was returned at all) in 732 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 733 // whether the returned error was because http.StatusNotModified was returned. 734 func (c *GroupsGetCall) Do(opts ...googleapi.CallOption) (*Groups, error) { 735 gensupport.SetOptions(c.urlParams_, opts...) 736 res, err := c.doRequest("json") 737 if res != nil && res.StatusCode == http.StatusNotModified { 738 if res.Body != nil { 739 res.Body.Close() 740 } 741 return nil, gensupport.WrapError(&googleapi.Error{ 742 Code: res.StatusCode, 743 Header: res.Header, 744 }) 745 } 746 if err != nil { 747 return nil, err 748 } 749 defer googleapi.CloseBody(res) 750 if err := googleapi.CheckResponse(res); err != nil { 751 return nil, gensupport.WrapError(err) 752 } 753 ret := &Groups{ 754 ServerResponse: googleapi.ServerResponse{ 755 Header: res.Header, 756 HTTPStatusCode: res.StatusCode, 757 }, 758 } 759 target := &ret 760 if err := gensupport.DecodeResponse(target, res); err != nil { 761 return nil, err 762 } 763 return ret, nil 764 } 765 766 type GroupsPatchCall struct { 767 s *Service 768 groupUniqueId string 769 groups *Groups 770 urlParams_ gensupport.URLParams 771 ctx_ context.Context 772 header_ http.Header 773 } 774 775 // Patch: Updates an existing resource. This method supports patch semantics. 776 // 777 // - groupUniqueId: The group's email address. 778 func (r *GroupsService) Patch(groupUniqueId string, groups *Groups) *GroupsPatchCall { 779 c := &GroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 780 c.groupUniqueId = groupUniqueId 781 c.groups = groups 782 return c 783 } 784 785 // Fields allows partial responses to be retrieved. See 786 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 787 // details. 788 func (c *GroupsPatchCall) Fields(s ...googleapi.Field) *GroupsPatchCall { 789 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 790 return c 791 } 792 793 // Context sets the context to be used in this call's Do method. 794 func (c *GroupsPatchCall) Context(ctx context.Context) *GroupsPatchCall { 795 c.ctx_ = ctx 796 return c 797 } 798 799 // Header returns a http.Header that can be modified by the caller to add 800 // headers to the request. 801 func (c *GroupsPatchCall) Header() http.Header { 802 if c.header_ == nil { 803 c.header_ = make(http.Header) 804 } 805 return c.header_ 806 } 807 808 func (c *GroupsPatchCall) doRequest(alt string) (*http.Response, error) { 809 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 810 var body io.Reader = nil 811 body, err := googleapi.WithoutDataWrapper.JSONReader(c.groups) 812 if err != nil { 813 return nil, err 814 } 815 c.urlParams_.Set("alt", alt) 816 c.urlParams_.Set("prettyPrint", "false") 817 urls := googleapi.ResolveRelative(c.s.BasePath, "{groupUniqueId}") 818 urls += "?" + c.urlParams_.Encode() 819 req, err := http.NewRequest("PATCH", urls, body) 820 if err != nil { 821 return nil, err 822 } 823 req.Header = reqHeaders 824 googleapi.Expand(req.URL, map[string]string{ 825 "groupUniqueId": c.groupUniqueId, 826 }) 827 return gensupport.SendRequest(c.ctx_, c.s.client, req) 828 } 829 830 // Do executes the "groupsSettings.groups.patch" call. 831 // Any non-2xx status code is an error. Response headers are in either 832 // *Groups.ServerResponse.Header or (if a response was returned at all) in 833 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 834 // whether the returned error was because http.StatusNotModified was returned. 835 func (c *GroupsPatchCall) Do(opts ...googleapi.CallOption) (*Groups, error) { 836 gensupport.SetOptions(c.urlParams_, opts...) 837 res, err := c.doRequest("json") 838 if res != nil && res.StatusCode == http.StatusNotModified { 839 if res.Body != nil { 840 res.Body.Close() 841 } 842 return nil, gensupport.WrapError(&googleapi.Error{ 843 Code: res.StatusCode, 844 Header: res.Header, 845 }) 846 } 847 if err != nil { 848 return nil, err 849 } 850 defer googleapi.CloseBody(res) 851 if err := googleapi.CheckResponse(res); err != nil { 852 return nil, gensupport.WrapError(err) 853 } 854 ret := &Groups{ 855 ServerResponse: googleapi.ServerResponse{ 856 Header: res.Header, 857 HTTPStatusCode: res.StatusCode, 858 }, 859 } 860 target := &ret 861 if err := gensupport.DecodeResponse(target, res); err != nil { 862 return nil, err 863 } 864 return ret, nil 865 } 866 867 type GroupsUpdateCall struct { 868 s *Service 869 groupUniqueId string 870 groups *Groups 871 urlParams_ gensupport.URLParams 872 ctx_ context.Context 873 header_ http.Header 874 } 875 876 // Update: Updates an existing resource. 877 // 878 // - groupUniqueId: The group's email address. 879 func (r *GroupsService) Update(groupUniqueId string, groups *Groups) *GroupsUpdateCall { 880 c := &GroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 881 c.groupUniqueId = groupUniqueId 882 c.groups = groups 883 return c 884 } 885 886 // Fields allows partial responses to be retrieved. See 887 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more 888 // details. 889 func (c *GroupsUpdateCall) Fields(s ...googleapi.Field) *GroupsUpdateCall { 890 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 891 return c 892 } 893 894 // Context sets the context to be used in this call's Do method. 895 func (c *GroupsUpdateCall) Context(ctx context.Context) *GroupsUpdateCall { 896 c.ctx_ = ctx 897 return c 898 } 899 900 // Header returns a http.Header that can be modified by the caller to add 901 // headers to the request. 902 func (c *GroupsUpdateCall) Header() http.Header { 903 if c.header_ == nil { 904 c.header_ = make(http.Header) 905 } 906 return c.header_ 907 } 908 909 func (c *GroupsUpdateCall) doRequest(alt string) (*http.Response, error) { 910 reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_) 911 var body io.Reader = nil 912 body, err := googleapi.WithoutDataWrapper.JSONReader(c.groups) 913 if err != nil { 914 return nil, err 915 } 916 c.urlParams_.Set("alt", alt) 917 c.urlParams_.Set("prettyPrint", "false") 918 urls := googleapi.ResolveRelative(c.s.BasePath, "{groupUniqueId}") 919 urls += "?" + c.urlParams_.Encode() 920 req, err := http.NewRequest("PUT", urls, body) 921 if err != nil { 922 return nil, err 923 } 924 req.Header = reqHeaders 925 googleapi.Expand(req.URL, map[string]string{ 926 "groupUniqueId": c.groupUniqueId, 927 }) 928 return gensupport.SendRequest(c.ctx_, c.s.client, req) 929 } 930 931 // Do executes the "groupsSettings.groups.update" call. 932 // Any non-2xx status code is an error. Response headers are in either 933 // *Groups.ServerResponse.Header or (if a response was returned at all) in 934 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 935 // whether the returned error was because http.StatusNotModified was returned. 936 func (c *GroupsUpdateCall) Do(opts ...googleapi.CallOption) (*Groups, error) { 937 gensupport.SetOptions(c.urlParams_, opts...) 938 res, err := c.doRequest("json") 939 if res != nil && res.StatusCode == http.StatusNotModified { 940 if res.Body != nil { 941 res.Body.Close() 942 } 943 return nil, gensupport.WrapError(&googleapi.Error{ 944 Code: res.StatusCode, 945 Header: res.Header, 946 }) 947 } 948 if err != nil { 949 return nil, err 950 } 951 defer googleapi.CloseBody(res) 952 if err := googleapi.CheckResponse(res); err != nil { 953 return nil, gensupport.WrapError(err) 954 } 955 ret := &Groups{ 956 ServerResponse: googleapi.ServerResponse{ 957 Header: res.Header, 958 HTTPStatusCode: res.StatusCode, 959 }, 960 } 961 target := &ret 962 if err := gensupport.DecodeResponse(target, res); err != nil { 963 return nil, err 964 } 965 return ret, nil 966 } 967