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

Overview

Operations related to users in your organization

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:



111
112
113
114
# File 'lib/telnyx/resources/organizations/users.rb', line 111

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

Instance Attribute Details

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

Operations related to users in your organization



10
11
12
# File 'lib/telnyx/resources/organizations/users.rb', line 10

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:



97
98
99
100
101
102
103
104
105
106
# File 'lib/telnyx/resources/organizations/users.rb', line 97

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::OrganizationUser>

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:



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/telnyx/resources/organizations/users.rb', line 62

def list(params = {})
  parsed, options = Telnyx::Organizations::UserListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "organizations/users",
    query: query.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::Organizations::OrganizationUser,
    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:



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

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