##
#    This code was generated by
#    ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
#     |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
#     |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \
#
#    Twilio - Chat
#    This is the public Twilio REST API.
#
#    NOTE: This class is auto generated by OpenAPI Generator.
#    https://openapi-generator.tech
#    Do not edit the class manually.
#

module Twilio
    module REST
        class Chat
            class V2 < Version
                ##
                # Initialize the V2 version of Chat
                def initialize(domain)
                    super
                    @version = 'v2'
                    @credentials = nil
                    @services = nil
                end

                ##
                # @param [String] sid The SID of the Credential resource to fetch.
                # @return [Twilio::REST::Chat::V2::CredentialContext] if sid was passed.
                # @return [Twilio::REST::Chat::V2::CredentialList]
                def credentials(sid=:unset)
                    if sid.nil?
                        raise ArgumentError, 'sid cannot be nil'
                    end
                    if sid == :unset
                        @credentials ||= CredentialList.new self
                    else
                        CredentialContext.new(self, sid)
                    end
                end
                ##
                # @param [String] sid The SID of the Service resource to fetch.
                # @return [Twilio::REST::Chat::V2::ServiceContext] if sid was passed.
                # @return [Twilio::REST::Chat::V2::ServiceList]
                def services(sid=:unset)
                    if sid.nil?
                        raise ArgumentError, 'sid cannot be nil'
                    end
                    if sid == :unset
                        @services ||= ServiceList.new self
                    else
                        ServiceContext.new(self, sid)
                    end
                end
                ##
                # Provide a user friendly representation
                def to_s
                    '<Twilio::REST::Chat::V2>';
                end
            end
        end
    end
end
