Пример #1
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.squareMemberMid)
            {
                hashcode = (hashcode * 397) + SquareMemberMid.GetHashCode();
            }
            if (__isset.squareChatMid)
            {
                hashcode = (hashcode * 397) + SquareChatMid.GetHashCode();
            }
            if (__isset.revision)
            {
                hashcode = (hashcode * 397) + Revision.GetHashCode();
            }
            if (__isset.membershipState)
            {
                hashcode = (hashcode * 397) + MembershipState.GetHashCode();
            }
            if (__isset.notificationForMessage)
            {
                hashcode = (hashcode * 397) + NotificationForMessage.GetHashCode();
            }
        }
        return(hashcode);
    }
Пример #2
0
            public async Task <Membership> UpdateAsync(int id, int revision, MembershipState state, bool muted, CancellationToken cancellationToken)
            {
                var requestContent = new Dictionary <string, object> {
                    { "revision", revision }, { "state", state }, { "muted", muted }
                };

                return(await client.PatchAsync <Membership>(ServiceClient.BuildCommand("memberships", id), null, requestContent, cancellationToken).ConfigureAwait(false));
            }
Пример #3
0
    public override string ToString()
    {
        var  sb      = new StringBuilder("SquareChatMember(");
        bool __first = true;

        if (SquareMemberMid != null && __isset.squareMemberMid)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("SquareMemberMid: ");
            SquareMemberMid.ToString(sb);
        }
        if (SquareChatMid != null && __isset.squareChatMid)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("SquareChatMid: ");
            SquareChatMid.ToString(sb);
        }
        if (__isset.revision)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Revision: ");
            Revision.ToString(sb);
        }
        if (__isset.membershipState)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("MembershipState: ");
            MembershipState.ToString(sb);
        }
        if (__isset.notificationForMessage)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("NotificationForMessage: ");
            NotificationForMessage.ToString(sb);
        }
        sb.Append(")");
        return(sb.ToString());
    }
Пример #4
0
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.squareMemberMid)
            {
                hashcode = (hashcode * 397) + SquareMemberMid.GetHashCode();
            }
            if (__isset.squareMid)
            {
                hashcode = (hashcode * 397) + SquareMid.GetHashCode();
            }
            if (__isset.displayName)
            {
                hashcode = (hashcode * 397) + DisplayName.GetHashCode();
            }
            if (__isset.profileImageObsHash)
            {
                hashcode = (hashcode * 397) + ProfileImageObsHash.GetHashCode();
            }
            if (__isset.ableToReceiveMessage)
            {
                hashcode = (hashcode * 397) + AbleToReceiveMessage.GetHashCode();
            }
            if (__isset.membershipState)
            {
                hashcode = (hashcode * 397) + MembershipState.GetHashCode();
            }
            if (__isset.role)
            {
                hashcode = (hashcode * 397) + Role.GetHashCode();
            }
            if (__isset.revision)
            {
                hashcode = (hashcode * 397) + Revision.GetHashCode();
            }
            if (__isset.preference)
            {
                hashcode = (hashcode * 397) + Preference.GetHashCode();
            }
            if (__isset.joinMessage)
            {
                hashcode = (hashcode * 397) + JoinMessage.GetHashCode();
            }
        }
        return(hashcode);
    }
    public override int GetHashCode()
    {
        int hashcode = 157;

        unchecked {
            if (__isset.membershipState)
            {
                hashcode = (hashcode * 397) + MembershipState.GetHashCode();
            }
            if (__isset.memberRoles)
            {
                hashcode = (hashcode * 397) + TCollections.GetHashCode(MemberRoles);
            }
            if (__isset.displayName)
            {
                hashcode = (hashcode * 397) + DisplayName.GetHashCode();
            }
            if (__isset.ableToReceiveMessage)
            {
                hashcode = (hashcode * 397) + AbleToReceiveMessage.GetHashCode();
            }
            if (__isset.ableToReceiveFriendRequest)
            {
                hashcode = (hashcode * 397) + AbleToReceiveFriendRequest.GetHashCode();
            }
            if (__isset.chatMidToExcludeMembers)
            {
                hashcode = (hashcode * 397) + ChatMidToExcludeMembers.GetHashCode();
            }
            if (__isset.includingMe)
            {
                hashcode = (hashcode * 397) + IncludingMe.GetHashCode();
            }
        }
        return(hashcode);
    }
 public TeamMembershipDetails(TeamRole role, MembershipState state)
 {
     Role  = role;
     State = state;
 }
Пример #7
0
    public override string ToString()
    {
        var  sb      = new StringBuilder("SquareMember(");
        bool __first = true;

        if (SquareMemberMid != null && __isset.squareMemberMid)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("SquareMemberMid: ");
            SquareMemberMid.ToString(sb);
        }
        if (SquareMid != null && __isset.squareMid)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("SquareMid: ");
            SquareMid.ToString(sb);
        }
        if (DisplayName != null && __isset.displayName)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("DisplayName: ");
            DisplayName.ToString(sb);
        }
        if (ProfileImageObsHash != null && __isset.profileImageObsHash)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("ProfileImageObsHash: ");
            ProfileImageObsHash.ToString(sb);
        }
        if (__isset.ableToReceiveMessage)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("AbleToReceiveMessage: ");
            AbleToReceiveMessage.ToString(sb);
        }
        if (__isset.membershipState)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("MembershipState: ");
            MembershipState.ToString(sb);
        }
        if (__isset.role)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Role: ");
            Role.ToString(sb);
        }
        if (__isset.revision)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Revision: ");
            Revision.ToString(sb);
        }
        if (Preference != null && __isset.preference)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("Preference: ");
            Preference.ToString(sb);
        }
        if (JoinMessage != null && __isset.joinMessage)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("JoinMessage: ");
            JoinMessage.ToString(sb);
        }
        sb.Append(")");
        return(sb.ToString());
    }
    public override string ToString()
    {
        var  sb      = new StringBuilder("SquareMemberSearchOption(");
        bool __first = true;

        if (__isset.membershipState)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("MembershipState: ");
            MembershipState.ToString(sb);
        }
        if (MemberRoles != null && __isset.memberRoles)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("MemberRoles: ");
            MemberRoles.ToString(sb);
        }
        if (DisplayName != null && __isset.displayName)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("DisplayName: ");
            DisplayName.ToString(sb);
        }
        if (__isset.ableToReceiveMessage)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("AbleToReceiveMessage: ");
            AbleToReceiveMessage.ToString(sb);
        }
        if (__isset.ableToReceiveFriendRequest)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("AbleToReceiveFriendRequest: ");
            AbleToReceiveFriendRequest.ToString(sb);
        }
        if (ChatMidToExcludeMembers != null && __isset.chatMidToExcludeMembers)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("ChatMidToExcludeMembers: ");
            ChatMidToExcludeMembers.ToString(sb);
        }
        if (__isset.includingMe)
        {
            if (!__first)
            {
                sb.Append(", ");
            }
            __first = false;
            sb.Append("IncludingMe: ");
            IncludingMe.ToString(sb);
        }
        sb.Append(")");
        return(sb.ToString());
    }
Пример #9
0
 internal virtual MembershipState GetState()
 {
     state ??= MembershipState.NewState(this);
     return(state);
 }
Пример #10
0
 internal Membership ChangeState(MembershipState newState)
 {
     state        = newState;
     ModifiedDate = newState.ModifiedDate;
     return(this);
 }