Example #1
0
            /// <summary>Updates an existing resource.</summary>
            /// <param name="GroupsBody">The body of the request.</param>
            /// <param name="GroupUniqueId">The resource ID</param>
            /// <param name="gShellServiceAccount">The optional email address the service account should impersonate.</param>
            public Google.Apis.Groupssettings.v1.Data.Groups Update(Google.Apis.Groupssettings.v1.Data.Groups GroupsBody, string GroupUniqueId)
            {
                var request = GetService().Groups.Update(GroupsBody, GroupUniqueId);



                return(request.Execute());
            }
Example #2
0
 /// <summary>Updates an existing resource.</summary>
 /// <param name="GroupsBody">The body of the request.</param>
 /// <param name="GroupUniqueId">The resource ID</param>
 public Google.Apis.Groupssettings.v1.Data.Groups Update(Google.Apis.Groupssettings.v1.Data.Groups GroupsBody, string GroupUniqueId)
 {
     return(mainBase.groups.Update(GroupsBody, GroupUniqueId));
 }
Example #3
0
        protected override void ProcessRecord()
        {
            if (ParameterSetName == "Params")
            {
                var body = new Data.Groups
                {
                    AllowExternalMembers =
                        AllowExternalMembers.HasValue ? AllowExternalMembers.Value.ToString().ToLower() : null,
                    AllowGoogleCommunication =
                        AllowGoogleCommunication.HasValue ? AllowGoogleCommunication.Value.ToString().ToLower() : null,
                    AllowWebPosting = AllowWebPosting.HasValue ? AllowWebPosting.Value.ToString().ToLower() : null,
                    ArchiveOnly     = ArchiveOnly.HasValue ? ArchiveOnly.Value.ToString().ToLower() : null,
                    CustomReplyTo   = CustomReplyTo,
                    DefaultMessageDenyNotificationText = DefaultMessageDenyNotificationText,
                    Description = Description,
                    Email       = Email,
                    IncludeInGlobalAddressList =
                        IncludeInGlobalAddressList.HasValue
                            ? IncludeInGlobalAddressList.Value.ToString().ToLower()
                            : null,
                    IsArchived               = IsArchived.HasValue ? IsArchived.Value.ToString().ToLower() : null,
                    Kind                     = "groupsSettings#groups",
                    MaxMessageBytes          = MaxMessageBytes,
                    MembersCanPostAsTheGroup =
                        MembersCanPostAsTheGroup.HasValue ? MembersCanPostAsTheGroup.Value.ToString().ToLower() : null,
                    MessageDisplayFont = MessageDisplayFont != null?MessageDisplayFont.ToString() : null,
                                             MessageModerationLevel =
                                                 MessageModerationLevel.HasValue ? MessageModerationLevel.Value.ToString() : null,
                                             Name            = Name,
                                             PrimaryLanguage =
                                                 PrimaryLanguage.HasValue
                            ? SetGEmailSettingsLanguageCommand.LookupLanguage(PrimaryLanguage.Value)
                            : null,
                                             ReplyTo = ReplyTo,
                                             SendMessageDenyNotification =
                                                 SendMessageDenyNotification.HasValue
                            ? SendMessageDenyNotification.Value.ToString().ToLower()
                            : null,
                                             ShowInGroupDirectory =
                                                 ShowInGroupDirectory.HasValue ? ShowInGroupDirectory.Value.ToString().ToLower() : null,
                                             SpamModerationLevel =
                                                 SpamModerationLevel.HasValue ? SpamModerationLevel.Value.ToString() : null,
                                             WhoCanAdd          = WhoCanAdd.HasValue ? WhoCanAdd.Value.ToString() : null,
                                             WhoCanContactOwner =
                                                 WhoCanContactOwner.HasValue ? WhoCanContactOwner.Value.ToString() : null,
                                             WhoCanInvite         = WhoCanInvite.HasValue ? WhoCanInvite.Value.ToString() : null,
                                             WhoCanJoin           = WhoCanJoin.HasValue ? WhoCanJoin.Value.ToString() : null,
                                             WhoCanLeaveGroup     = WhoCanLeaveGroup.HasValue ? WhoCanLeaveGroup.Value.ToString() : null,
                                             WhoCanPostMessage    = WhoCanPostMessage.HasValue ? WhoCanPostMessage.Value.ToString() : null,
                                             WhoCanViewGroup      = WhoCanViewGroup.HasValue ? WhoCanViewGroup.Value.ToString() : null,
                                             WhoCanViewMembership =
                                                 WhoCanViewMembership.HasValue ? WhoCanViewMembership.Value.ToString() : null
                };

                if (!AllowExternalMembers.HasValue &&
                    !AllowGoogleCommunication.HasValue &&
                    !AllowWebPosting.HasValue &&
                    !ArchiveOnly.HasValue &&
                    string.IsNullOrWhiteSpace(CustomReplyTo) &&
                    string.IsNullOrWhiteSpace(DefaultMessageDenyNotificationText) &&
                    string.IsNullOrWhiteSpace(Description) &&
                    string.IsNullOrWhiteSpace(Email) &&
                    !IncludeInGlobalAddressList.HasValue &&
                    !IsArchived.HasValue &&
                    !MaxMessageBytes.HasValue &&
                    !MembersCanPostAsTheGroup.HasValue &&
                    !MessageDisplayFont.HasValue &&
                    !MessageModerationLevel.HasValue &&
                    string.IsNullOrWhiteSpace(Name) &&
                    !PrimaryLanguage.HasValue &&
                    string.IsNullOrWhiteSpace(ReplyTo) &&
                    !SendMessageDenyNotification.HasValue &&
                    !ShowInGroupDirectory.HasValue &&
                    !SpamModerationLevel.HasValue &&
                    !WhoCanAdd.HasValue &&
                    !WhoCanContactOwner.HasValue &&
                    !WhoCanInvite.HasValue &&
                    !WhoCanJoin.HasValue &&
                    !WhoCanLeaveGroup.HasValue &&
                    !WhoCanPostMessage.HasValue &&
                    !WhoCanViewGroup.HasValue &&
                    !WhoCanViewMembership.HasValue)
                {
                    WriteError(new ErrorRecord(new Exception(
                                                   "Must supply at least one parameter for Set-GGroupsettings"),
                                               "", ErrorCategory.InvalidOperation, "GGroupsettings"));
                }

                if (ShouldProcess("Groups Settings", "Set-GGroupssettings"))
                {
                    WriteObject(groups.Patch(body, GroupUniqueId));
                }
            }
            else
            {
                if (ShouldProcess("Groups Settings", "Set-GGroupssettings"))
                {
                    WriteObject(groups.Patch(GroupsBody, GroupUniqueId));
                }
            }
        }