Class: Telnyx::Resources::AuthenticationProviders

Inherits:
Object
  • Object
show all
Defined in:
lib/telnyx/resources/authentication_providers.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ AuthenticationProviders

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

Parameters:



148
149
150
# File 'lib/telnyx/resources/authentication_providers.rb', line 148

def initialize(client:)
  @client = client
end

Instance Method Details

#create(name:, settings:, short_name:, active: nil, settings_url: nil, request_options: {}) ⇒ Telnyx::Models::AuthenticationProviderCreateResponse

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

Creates an authentication provider.

Parameters:

  • name (String)

    The name associated with the authentication provider.

  • settings (Telnyx::Models::Settings)

    The settings associated with the authentication provider.

  • short_name (String)

    The short name associated with the authentication provider. This must be unique

  • active (Boolean)

    The active status of the authentication provider

  • settings_url (String)

    The URL for the identity provider metadata file to populate the settings automat

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

Returns:

See Also:



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

def create(params)
  parsed, options = Telnyx::AuthenticationProviderCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "authentication_providers",
    body: parsed,
    model: Telnyx::Models::AuthenticationProviderCreateResponse,
    options: options
  )
end

#delete(id, request_options: {}) ⇒ Telnyx::Models::AuthenticationProviderDeleteResponse

Deletes an existing authentication provider.

Parameters:

  • id (String)

    authentication provider ID

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

Returns:

See Also:



136
137
138
139
140
141
142
143
# File 'lib/telnyx/resources/authentication_providers.rb', line 136

def delete(id, params = {})
  @client.request(
    method: :delete,
    path: ["authentication_providers/%1$s", id],
    model: Telnyx::Models::AuthenticationProviderDeleteResponse,
    options: params[:request_options]
  )
end

#list(page_number: nil, page_size: nil, sort: nil, request_options: {}) ⇒ Telnyx::Internal::DefaultFlatPagination<Telnyx::Models::AuthenticationProvider>

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

Returns a list of your SSO authentication providers.

Parameters:

Returns:

See Also:



112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/telnyx/resources/authentication_providers.rb', line 112

def list(params = {})
  parsed, options = Telnyx::AuthenticationProviderListParams.dump_request(params)
  query = Telnyx::Internal::Util.encode_query_params(parsed)
  @client.request(
    method: :get,
    path: "authentication_providers",
    query: query.transform_keys(page_number: "page[number]", page_size: "page[size]"),
    page: Telnyx::Internal::DefaultFlatPagination,
    model: Telnyx::AuthenticationProvider,
    options: options
  )
end

#retrieve(id, request_options: {}) ⇒ Telnyx::Models::AuthenticationProviderRetrieveResponse

Retrieves the details of an existing authentication provider.

Parameters:

  • id (String)

    authentication provider ID

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

Returns:

See Also:



50
51
52
53
54
55
56
57
# File 'lib/telnyx/resources/authentication_providers.rb', line 50

def retrieve(id, params = {})
  @client.request(
    method: :get,
    path: ["authentication_providers/%1$s", id],
    model: Telnyx::Models::AuthenticationProviderRetrieveResponse,
    options: params[:request_options]
  )
end

#update(id, active: nil, name: nil, settings: nil, settings_url: nil, short_name: nil, request_options: {}) ⇒ Telnyx::Models::AuthenticationProviderUpdateResponse

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

Updates settings of an existing authentication provider.

Parameters:

  • id (String)

    Identifies the resource.

  • active (Boolean)

    The active status of the authentication provider

  • name (String)

    The name associated with the authentication provider.

  • settings (Telnyx::Models::Settings)

    The settings associated with the authentication provider.

  • settings_url (String)

    The URL for the identity provider metadata file to populate the settings automat

  • short_name (String)

    The short name associated with the authentication provider. This must be unique

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

Returns:

See Also:



83
84
85
86
87
88
89
90
91
92
# File 'lib/telnyx/resources/authentication_providers.rb', line 83

def update(id, params = {})
  parsed, options = Telnyx::AuthenticationProviderUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["authentication_providers/%1$s", id],
    body: parsed,
    model: Telnyx::Models::AuthenticationProviderUpdateResponse,
    options: options
  )
end