functions/private/Get-ChurchMembersWithCallings.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
function Get-ChurchMembersWithCallings {
    param (
        [psobject] $Session,
        [int] $UnitNumber
    )
    $params = @{
        Uri         = (Get-ChurchConfig -Action "MembersWithCallings") -f $UnitNumber
        WebSession  = $Session
        Method      = "Get"
        ContentType = "application/json"
    }
    $response = Invoke-ChurchWebRequest @params
    return $response.Content;
}

<#
[{
    mrn: "0000000000000",
    unitNumber: 000000,
    unitName: "Fake Ward",
    subOrgTypeId: 0000,
    subOrgId: 0000000,
    customSubOrgName: null,
    parentSubOrgId: null,
    positionTypeId: 0,
    positionId: 00000000,
    standardPosition: true,
    position: "Fake Calling",
    displaySequence: 0,
    activeCalender: "2001-01-01T00:00:00.000+0000",
    activeDate: "2001-01-01T00:00:00.000+0000",
    setApartCalender: null,
    setApartDate: null,
    leaderHomePhone: null,
    leaderWorkPhone: null,
    id: 2118705118,
    memberUnitNumber: 000000,
    memberUnitName: "Fake Ward",
    name: "Name, Fake",
    nameOrder: 1,
    birthDate: "18470101",
    phone: "000-000-0000",
    age: 0,
    outOfUnit: false,
    stake: false,
    district: false,
    organization: "Fake Organization",
    spokenName: "Fake Name",
    gender: "MALE",
    priesthood: "Fake Priesthod",
    email: "fakeemail@gmail.com",
    errors: { },
    sustainedDate: "2050-01-01T00:00:00.000+0000",
    subOrgType: "FAKE_ORG_TYPE",
    custom: false,
    setApart: false
}]
#>