Class: VitableConnect::Resources::Members

Inherits:
Object
  • Object
show all
Defined in:
lib/vitable_connect/resources/members.rb,
sig/vitable_connect/resources/members.rbs

Overview

Browse the members covered across your book and read a member's profile

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Members

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Members.

Parameters:



226
227
228
# File 'lib/vitable_connect/resources/members.rb', line 226

def initialize(client:)
  @client = client
end

Instance Method Details

#list(limit: nil, page: nil, search: nil, request_options: {}) ⇒ VitableConnect::Internal::PageNumberPage<VitableConnect::Models::MemberListResponse>

Retrieves a paginated list of the members in the authenticated organization's book — identity, contact details, and address. The book covers members reached through an employer in the organization's book as well as members of a group it owns. Supports free-text search (name, email, or exact member id).

Parameters:

  • limit (Integer)

    Items per page (default: 20, max: 100)

  • page (Integer)

    Page number (default: 1)

  • search (String)

    Case-insensitive search across member name and email; exact match on member id

  • request_options (VitableConnect::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/vitable_connect/resources/members.rb', line 46

def list(params = {})
  parsed, options = VitableConnect::MemberListParams.dump_request(params)
  query = VitableConnect::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "v2/members",
    query: query,
    page: VitableConnect::Internal::PageNumberPage,
    model: VitableConnect::Models::MemberListResponse,
    options: options
  )
end

#list_dependents(member_id, request_options: {}) ⇒ VitableConnect::Models::MemberListDependentsResponse

Lists a member's active legal dependents — name, relationship, date of birth, age, and sex at birth. Access is scoped to the authenticated principal; a member not visible to the caller returns a 404.

Parameters:

Returns:

See Also:



71
72
73
74
75
76
77
78
# File 'lib/vitable_connect/resources/members.rb', line 71

def list_dependents(member_id, params = {})
  @client.request(
    method: :get,
    path: ["v1/members/%1$s/dependents", member_id],
    model: VitableConnect::Models::MemberListDependentsResponse,
    options: params[:request_options]
  )
end

#list_employments(member_id, request_options: {}) ⇒ VitableConnect::Models::MemberListEmploymentsResponse

Lists a member's employment across every employer — the same employee record shape as the employer's employees list, plus the employer name. For an organization caller the rows are scoped to companies in that organization's book; a member (self/household) or Vitable Admin sees all employments. A member not visible to the caller returns a 404.

Parameters:

Returns:

See Also:



94
95
96
97
98
99
100
101
# File 'lib/vitable_connect/resources/members.rb', line 94

def list_employments(member_id, params = {})
  @client.request(
    method: :get,
    path: ["v1/members/%1$s/employments", member_id],
    model: VitableConnect::Models::MemberListEmploymentsResponse,
    options: params[:request_options]
  )
end

#list_enrollments(member_id, request_options: {}) ⇒ VitableConnect::Models::MemberListEnrollmentsResponse

Lists a member's benefit enrollments across every employer — benefit type and product, employer, carrier, plan, tier, employee deduction, employer contribution and total premium, the individual enrollment coverage boundary (coverage_end), the distinct benefit plan-year boundary (plan_year_coverage_end) used to determine whether the plan year itself has ended, whether a qualifying life event would currently be required for reissue under the product/open-enrollment rule, enrollment/open-enrollment window, and two statuses: election_status (what the member answered) and policy_status (what became of their coverage, null unless they enrolled). Every row includes a stable enrollment ID that can be used to target enrollment actions. The full list is returned across all states so the client derives active plans (effective and upcoming) and the enrollment history from those per-row statuses. For an organization caller the rows are scoped to companies in that organization's book; a member (self/household) or Vitable Admin sees all enrollments. A member not visible to the caller returns a 404.

Parameters:

Returns:

See Also:



127
128
129
130
131
132
133
134
# File 'lib/vitable_connect/resources/members.rb', line 127

def list_enrollments(member_id, params = {})
  @client.request(
    method: :get,
    path: ["v1/members/%1$s/enrollments", member_id],
    model: VitableConnect::Models::MemberListEnrollmentsResponse,
    options: params[:request_options]
  )
end

#list_id_cards(member_id, request_options: {}) ⇒ VitableConnect::Models::MemberListIDCardsResponse

Lists a member's benefit ID cards — card type (medical, dental, vision, or rx), employer, plan, provider network, claims payer, carrier contact details, and the disclaimers printed on the card. Medical, dental and vision cards come from the member's active digital benefit cards; the rx card from the member's Ventegra pharmacy benefit (omitted when the member has no free-medication coverage), which carries no plan, network, or carrier details. Access is scoped to the authenticated principal, and an organization caller sees only cards from employers in its book; a member not visible to the caller returns a 404.

Parameters:

Returns:

See Also:



153
154
155
156
157
158
159
160
# File 'lib/vitable_connect/resources/members.rb', line 153

def list_id_cards(member_id, params = {})
  @client.request(
    method: :get,
    path: ["v1/members/%1$s/id-cards", member_id],
    model: VitableConnect::Models::MemberListIDCardsResponse,
    options: params[:request_options]
  )
end

#list_qualifying_life_events(member_id, limit: nil, page: nil, status: nil, request_options: {}) ⇒ VitableConnect::Internal::PageNumberPage<VitableConnect::Models::MemberListQualifyingLifeEventsResponse>

Lists a member's qualifying life events, including events already used for another enrollment. Returns all statuses by default; pass the status query param to filter to one (e.g. approved). Events are ordered newest submission first with stable paging. Custom text is present only when submitted and is otherwise null. A member not visible to the caller returns a 404. API keys and unbound access tokens have organization-wide access. Employer-bound tokens require employment at the bound employer, and employee-bound tokens require the exact employee-member relationship. Organization or scope mismatches return a 404 before pagination is validated.

Parameters:

Returns:

See Also:



187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/vitable_connect/resources/members.rb', line 187

def list_qualifying_life_events(member_id, params = {})
  parsed, options = VitableConnect::MemberListQualifyingLifeEventsParams.dump_request(params)
  query = VitableConnect::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: ["v1/members/%1$s/qualifying-life-events", member_id],
    query: query,
    page: VitableConnect::Internal::PageNumberPage,
    model: VitableConnect::Models::MemberListQualifyingLifeEventsResponse,
    options: options
  )
end

#retrieve(member_id, request_options: {}) ⇒ VitableConnect::Models::MemberRetrieveResponse

Retrieves a member's profile by ID — identity, demographics, address, contact details, tobacco status, and profile status. Access is scoped to the authenticated principal; a member not visible to the caller returns a 404.

Parameters:

Returns:

See Also:



19
20
21
22
23
24
25
26
# File 'lib/vitable_connect/resources/members.rb', line 19

def retrieve(member_id, params = {})
  @client.request(
    method: :get,
    path: ["v1/members/%1$s", member_id],
    model: VitableConnect::Models::MemberRetrieveResponse,
    options: params[:request_options]
  )
end

#retrieve_household(member_id, request_options: {}) ⇒ VitableConnect::Models::MemberRetrieveHouseholdResponse

Lists a member's household as a per-participant table — the account holder plus each active household member, with name, relationship, member type, date of birth, and household-admin flag. Access is scoped to the authenticated principal; a member not visible to the caller (or with no household) returns a 404.

Parameters:

Returns:

See Also:



214
215
216
217
218
219
220
221
# File 'lib/vitable_connect/resources/members.rb', line 214

def retrieve_household(member_id, params = {})
  @client.request(
    method: :get,
    path: ["v1/members/%1$s/household", member_id],
    model: VitableConnect::Models::MemberRetrieveHouseholdResponse,
    options: params[:request_options]
  )
end