##
# This code was generated by
# \ / _    _  _|   _  _
#  | (_)\/(_)(_|\/| |(/_  v1.0.0
#       /       /
#
# frozen_string_literal: true

module Twilio
  module REST
    class Api < Domain
      class V2010 < Version
        class AccountContext < InstanceContext
          class SipList < ListResource
            class DomainContext < InstanceContext
              class AuthTypesList < ListResource
                class AuthTypeCallsList < ListResource
                  ##
                  # Initialize the AuthTypeCallsList
                  # @param [Version] version Version that contains the resource
                  # @param [String] account_sid The SID of the
                  #   [Account](https://www.twilio.com/docs/api/rest/account) that created the
                  #   SipDomain resource.
                  # @param [String] domain_sid The unique string that that we created to identify
                  #   the SipDomain resource.
                  # @return [AuthTypeCallsList] AuthTypeCallsList
                  def initialize(version, account_sid: nil, domain_sid: nil)
                    super(version)

                    # Path Solution
                    @solution = {account_sid: account_sid, domain_sid: domain_sid}

                    # Components
                    @credential_list_mappings = nil
                    @ip_access_control_list_mappings = nil
                  end

                  ##
                  # Access the credential_list_mappings
                  # @param [String] sid The Twilio-provided string that uniquely identifies the
                  #   CredentialListMapping resource to fetch.
                  # @return [AuthCallsCredentialListMappingList]
                  # @return [AuthCallsCredentialListMappingContext] if sid was passed.
                  def credential_list_mappings(sid=:unset)
                    raise ArgumentError, 'sid cannot be nil' if sid.nil?

                    if sid != :unset
                      return AuthCallsCredentialListMappingContext.new(
                          @version,
                          @solution[:account_sid],
                          @solution[:domain_sid],
                          sid,
                      )
                    end

                      @credential_list_mappings ||= AuthCallsCredentialListMappingList.new(
                          @version,
                          account_sid: @solution[:account_sid],
                          domain_sid: @solution[:domain_sid],
                      )
                  end

                  ##
                  # Access the ip_access_control_list_mappings
                  # @param [String] sid The Twilio-provided string that uniquely identifies the
                  #   IpAccessControlListMapping resource to fetch.
                  # @return [AuthCallsIpAccessControlListMappingList]
                  # @return [AuthCallsIpAccessControlListMappingContext] if sid was passed.
                  def ip_access_control_list_mappings(sid=:unset)
                    raise ArgumentError, 'sid cannot be nil' if sid.nil?

                    if sid != :unset
                      return AuthCallsIpAccessControlListMappingContext.new(
                          @version,
                          @solution[:account_sid],
                          @solution[:domain_sid],
                          sid,
                      )
                    end

                      @ip_access_control_list_mappings ||= AuthCallsIpAccessControlListMappingList.new(
                          @version,
                          account_sid: @solution[:account_sid],
                          domain_sid: @solution[:domain_sid],
                      )
                  end

                  ##
                  # Provide a user friendly representation
                  def to_s
                    '#<Twilio.Api.V2010.AuthTypeCallsList>'
                  end
                end

                class AuthTypeCallsPage < Page
                  ##
                  # Initialize the AuthTypeCallsPage
                  # @param [Version] version Version that contains the resource
                  # @param [Response] response Response from the API
                  # @param [Hash] solution Path solution for the resource
                  # @return [AuthTypeCallsPage] AuthTypeCallsPage
                  def initialize(version, response, solution)
                    super(version, response)

                    # Path Solution
                    @solution = solution
                  end

                  ##
                  # Build an instance of AuthTypeCallsInstance
                  # @param [Hash] payload Payload response from the API
                  # @return [AuthTypeCallsInstance] AuthTypeCallsInstance
                  def get_instance(payload)
                    AuthTypeCallsInstance.new(
                        @version,
                        payload,
                        account_sid: @solution[:account_sid],
                        domain_sid: @solution[:domain_sid],
                    )
                  end

                  ##
                  # Provide a user friendly representation
                  def to_s
                    '<Twilio.Api.V2010.AuthTypeCallsPage>'
                  end
                end

                class AuthTypeCallsInstance < InstanceResource
                  ##
                  # Initialize the AuthTypeCallsInstance
                  # @param [Version] version Version that contains the resource
                  # @param [Hash] payload payload that contains response from Twilio
                  # @param [String] account_sid The SID of the
                  #   [Account](https://www.twilio.com/docs/api/rest/account) that created the
                  #   SipDomain resource.
                  # @param [String] domain_sid The unique string that that we created to identify
                  #   the SipDomain resource.
                  # @return [AuthTypeCallsInstance] AuthTypeCallsInstance
                  def initialize(version, payload, account_sid: nil, domain_sid: nil)
                    super(version)
                  end

                  ##
                  # Provide a user friendly representation
                  def to_s
                    "<Twilio.Api.V2010.AuthTypeCallsInstance>"
                  end

                  ##
                  # Provide a detailed, user friendly representation
                  def inspect
                    "<Twilio.Api.V2010.AuthTypeCallsInstance>"
                  end
                end
              end
            end
          end
        end
      end
    end
  end
end