// NewMembersUnsuspendArg returns a new MembersUnsuspendArg instance
423944
func NewMembersUnsuspendArg(User *UserSelectorArg) *MembersUnsuspendArg {
	s := new(MembersUnsuspendArg)
	s.User = User
	return s
}
649306
func newPostMemberHandler(s platform.UserResourceMappingService, userService platform.UserService, resourceType platform.Resource, userType platform.UserType) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		ctx := r.Context()

		req, err := decodePostMemberRequest(ctx, r)
		if err != nil {
			EncodeError(ctx, err, w)
			return
		}

		user, err := userService.FindUserByID(ctx, req.MemberID)
		if err != nil {
			EncodeError(ctx, err, w)
			return
		}

		mapping := &platform.UserResourceMapping{
			ResourceID: req.ResourceID,
			Resource:   resourceType,
			UserID:     req.MemberID,
			UserType:   userType,
		}

		if err := s.CreateUserResourceMapping(ctx, mapping); err != nil {
			EncodeError(ctx, err, w)
			return
		}

		if err := encodeResponse(ctx, w, http.StatusCreated, newResourceUserResponse(user, userType)); err != nil {
			EncodeError(ctx, err, w)
			return
		}
	}
}
1296475
func NewMemberPermission(Action *MemberAction, Allow bool) *MemberPermission {
	s := new(MemberPermission)
	s.Action = Action
	s.Allow = Allow
	return s
}
100761
func (c *Client) AddMember(name string, peerAddrs string) ([]Member, error) {
	// Parse the peer address, required to add the client URL later to the list
	// of endpoints for this client. Parsing as a first operation to make sure that
	// if this fails no member addition is performed on the etcd cluster.
	parsedPeerAddrs, err := url.Parse(peerAddrs)
	if err != nil {
		return nil, errors.Wrapf(err, "error parsing peer address %s", peerAddrs)
	}

	cli, err := clientv3.New(clientv3.Config{
		Endpoints:   c.Endpoints,
		DialTimeout: 20 * time.Second,
		TLS:         c.TLS,
	})
	if err != nil {
		return nil, err
	}
	defer cli.Close()

	// Adds a new member to the cluster
	ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
	resp, err := cli.MemberAdd(ctx, []string{peerAddrs})
	cancel()
	if err != nil {
		return nil, err
	}

	// Returns the updated list of etcd members
	ret := []Member{}
	for _, m := range resp.Members {
		// fixes the entry for the joining member (that doesn't have a name set in the initialCluster returned by etcd)
		if m.Name == "" {
			ret = append(ret, Member{Name: name, PeerURL: m.PeerURLs[0]})
		} else {
			ret = append(ret, Member{Name: m.Name, PeerURL: m.PeerURLs[0]})
		}
	}

	// Add the new member client address to the list of endpoints
	c.Endpoints = append(c.Endpoints, GetClientURLByIP(parsedPeerAddrs.Hostname()))

	return ret, nil
}
1188102
func NewMemberSpaceLimitsChangeStatusType(Description string) *MemberSpaceLimitsChangeStatusType {
	s := new(MemberSpaceLimitsChangeStatusType)
	s.Description = Description
	return s
}
572688
func NewMemberAddNameDetails(NewValue *UserNameLogInfo) *MemberAddNameDetails {
	s := new(MemberAddNameDetails)
	s.NewValue = NewValue
	return s
}
889039
func NewMembershipInfo(AccessType *AccessLevel) *MembershipInfo {
	s := new(MembershipInfo)
	s.AccessType = AccessType
	s.IsInherited = false
	return s
}
992534
func NewMemberAddArg(MemberEmail string) *MemberAddArg {
	s := new(MemberAddArg)
	s.MemberEmail = MemberEmail
	s.SendWelcomeEmail = true
	s.Role = &AdminTier{Tagged: dropbox.Tagged{"member_only"}}
	return s
}
1095208
func NewMembersDataTransferArg(User *UserSelectorArg, TransferDestId *UserSelectorArg, TransferAdminId *UserSelectorArg) *MembersDataTransferArg {
	s := new(MembersDataTransferArg)
	s.User = User
	s.TransferDestId = TransferDestId
	s.TransferAdminId = TransferAdminId
	return s
}
959184
func NewMSPPeerGroup(mspID string, peerRetriever MSPPeerRetriever) PeerGroup {
	return &mspPeerGroup{
		mspID:         mspID,
		peerRetriever: peerRetriever,
	}
}
1075562
func NewMemberChangeNameType(Description string) *MemberChangeNameType {
	s := new(MemberChangeNameType)
	s.Description = Description
	return s
}
396661
func NewMemberRequestsChangePolicyDetails(NewValue *MemberRequestsPolicy) *MemberRequestsChangePolicyDetails {
	s := new(MemberRequestsChangePolicyDetails)
	s.NewValue = NewValue
	return s
}
185565
func NewAddMember(Member *MemberSelector) *AddMember {
	s := new(AddMember)
	s.Member = Member
	s.AccessLevel = &AccessLevel{Tagged: dropbox.Tagged{"viewer"}}
	return s
}
659997
func NewAddPaperDocUserMemberResult(Member *sharing.MemberSelector, Result *AddPaperDocUserResult) *AddPaperDocUserMemberResult {
	s := new(AddPaperDocUserMemberResult)
	s.Member = Member
	s.Result = Result
	return s
}
326835
func NewMembersDeactivateBaseArg(User *UserSelectorArg) *MembersDeactivateBaseArg {
	s := new(MembersDeactivateBaseArg)
	s.User = User
	return s
}
474582
func NewPaperDocChangeMemberRoleType(Description string) *PaperDocChangeMemberRoleType {
	s := new(PaperDocChangeMemberRoleType)
	s.Description = Description
	return s
}
70796
func NewMemberProfile(TeamMemberId string, Email string, EmailVerified bool, Status *TeamMemberStatus, Name *users.Name, MembershipType *TeamMembershipType) *MemberProfile {
	s := new(MemberProfile)
	s.TeamMemberId = TeamMemberId
	s.Email = Email
	s.EmailVerified = EmailVerified
	s.Status = Status
	s.Name = Name
	s.MembershipType = MembershipType
	return s
}