functions/private/Get-ChurchMemberList.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
function Get-ChurchMemberList {
    param (
        [psobject] $Session,
        [int] $UnitNumber
    )
    $params = @{
        Uri         = (Get-ChurchConfig -Action "MemberList") -f $UnitNumber
        WebSession  = $Session
        Method      = "Get"
        ContentType = "application/json"
    }
    $response = Invoke-ChurchWebRequest @params
    return $response.Content;
}

<#
[{
    nameFormats: {
        listPreferredLocal: "Name, Fake",
        givenPreferredLocal: "Fake",
        familyPreferredLocal: "Name"
    },
    uuid: "00000000-0000-0000-0000-000000000000",
    nameOrder: 1,
    age: 0,
    emails: null,
    phones: null,
    phoneNumber: null,
    priesthoodOffice: "NONE",
    membershipUnit: null,
    legacyCmisId: 000000000,
    sex: "F",
    unitOrgsCombined: [
    "00000000-0000-0000-0000-000000000000",
    "00000000-0000-0000-0000-000000000000"
    ],
    householdMember: {
        householdRole: "SPOUSE",
        household: {
            anchorPerson: {
                legacyCmisId: 000000000,
                uuid: "00000000-0000-0000-0000-000000000000"
            },
            uuid: "00000000-0000-0000-0000-000000000000",
            familyNameLocal: "Name",
            directoryPreferredLocal: "Name, Fake & Fake",
            address: {
                formattedLine1: "0000 W 0000 S",
                formattedLine2: "Fake City, Fake 00000",
                formattedLine3: null,
                formattedLine4: null,
                addressLines: [
                "0000 W 0000 S",
                "Fake City, Fake 00000"
                ]
            },
            emails: null,
            phones: null,
            unit: {
                parentUnit: null,
                uuid: null,
                unitNumber: 000000,
                nameLocal: "Fake Ward",
                unitType: null,
                children: null
            }
        },
        membershipUnitFlag: true
    },
    email: null,
    member: true,
    isOutOfUnitMember: false,
    nameFamilyPreferredLocal: "Name",
    unitNumber: 000000,
    nameGivenPreferredLocal: "Fake",
    houseHoldMemberNameForList: "Fake",
    isHead: true,
    personUuid: "00000000-0000-0000-0000-000000000000",
    nameListPreferredLocal: "Name, Fake",
    householdNameDirectoryLocal: "Name, Fake & Fake",
    isAdult: false,
    outOfUnitMember: false,
    householdUuid: "00000000-0000-0000-0000-000000000000",
    formattedAddress: "0000 W 0000 S<br/>Fake City, Fake 00000",
    householdEmail: null,
    isMember: true,
    priesthoodTeacherOrAbove: false,
    convert: false,
    youthBasedOnAge: false,
    isSpouse: true,
    isSingleAdult: false,
    householdPhoneNumber: null,
    householdRole: "SPOUSE",
    householdAnchorPersonUuid: "00000000-0000-0000-0000-000000000000",
    householdNameFamilyLocal: "Name",
    isProspectiveElder: false,
    isYoungSingleAdult: false,
    unitName: "Fake Ward",
    address: {
        formattedLine1: "0000 W 0000 S",
        formattedLine2: "Fake City, Fake 00000",
        formattedLine3: null,
        formattedLine4: null,
        addressLines: [
        "0000 W 0000 S",
        "Fake City, Fake 00000"
        ]
    },
    birth: {
        date: {
            date: "1870-01-01",
            calc: "1870-01-01",
            display: "01 Jan 1870"
        }
    },
    personStatusFlags: {
        member: true,
        convert: false,
        adult: false,
        singleAdult: false,
        youngSingleAdult: false,
        prospectiveElder: false
    }
}]
#>