Class: Telnyx::Resources::Organizations::Users

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/organizations/users.rb,
lib/telnyx/resources/organizations/users/actions.rb

Defined Under Namespace

Classes: Actions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Users

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 Users.

Parameters:



107
108
109
110
# File 'lib/telnyx/resources/organizations/users.rb', line 107

def initialize(client:)
  @client = client
  @actions = Telnyx::Resources::Organizations::Users::Actions.new(client: client)
end

Instance Attribute Details

#actionsTelnyx::Resources::Organizations::Users::Actions (readonly)



8
9
10
# File 'lib/telnyx/resources/organizations/users.rb', line 8

def actions
  @actions
end

Instance Method Details

#get_groups_report(accept: nil, request_options: {}) ⇒ Telnyx::Models::Organizations::UserGetGroupsReportResponse

Some parameter documentations has been truncated, see Models::Organizations::UserGetGroupsReportParams for more details.

Returns a report of all users in your organization with their group memberships. This endpoint returns all users without pagination and always includes group information. The report can be retrieved in JSON or CSV format by sending specific content-type headers.

Parameters:

Returns:

See Also:



93
94
95
96
97
98
99
100
101
102
# File 'lib/telnyx/resources/organizations/users.rb', line 93

def get_groups_report(params = {})
  parsed, options = Telnyx::Organizations::UserGetGroupsReportParams.dump_request(params)
  @client.request(
    method: :get,
    path: "organizations/users/users_groups_report",
    headers: parsed.transform_keys(accept: "accept"),
    model: Telnyx::Models::Organizations::UserGetGroupsReportResponse,
    options: options
  )
end

#list(filter_email: nil, filter_user_status: nil, include_groups: nil, page_number: nil, page_size: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::Organizations::UserListResponse>

Some parameter documentations has been truncated, see Models::Organizations::UserListParams for more details.

Returns a list of the users in your organization.

Parameters:

  • filter_email (String)

    Filter by email address (partial match)

  • filter_user_status (Symbol, Telnyx::Models::Organizations::UserListParams::FilterUserStatus)

    Filter by user status

  • include_groups (Boolean)

    When set to true, includes the groups array for each user in the response. The g

  • page_number (Integer)

    The page number to load

  • page_size (Integer)

    The size of the page

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

Returns:

See Also:



59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/telnyx/resources/organizations/users.rb', line 59

def list(params = {})
  parsed, options = Telnyx::Organizations::UserListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "organizations/users",
    query: parsed.transform_keys(
      filter_email: "filter[email]",
      filter_user_status: "filter[user_status]",
      page_number: "page[number]",
      page_size: "page[size]"
    ),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::Models::Organizations::UserListResponse,
    options: options
  )
end

#retrieve(id, include_groups: nil, request_options: {}) ⇒ Telnyx::Models::Organizations::UserRetrieveResponse

Some parameter documentations has been truncated, see Models::Organizations::UserRetrieveParams for more details.

Returns a user in your organization.

Parameters:

  • id (String)

    Organization User ID

  • include_groups (Boolean)

    When set to true, includes the groups array for each user in the response. The g

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

Returns:

See Also:



26
27
28
29
30
31
32
33
34
35
# File 'lib/telnyx/resources/organizations/users.rb', line 26

def retrieve(id, params = {})
  parsed, options = Telnyx::Organizations::UserRetrieveParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["organizations/users/%1$s", id],
    query: parsed,
    model: Telnyx::Models::Organizations::UserRetrieveResponse,
    options: options
  )
end