##
#    This code was generated by
#    ___ _ _ _ _ _    _ ____    ____ ____ _    ____ ____ _  _ ____ ____ ____ ___ __   __
#     |  | | | | |    | |  | __ |  | |__| | __ | __ |___ |\ | |___ |__/ |__|  | |  | |__/
#     |  |_|_| | |___ | |__|    |__| |  | |    |__] |___ | \| |___ |  \ |  |  | |__| |  \
#
#    Twilio - Marketplace
#    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 Marketplace < MarketplaceBase
            class V1 < Version
                class ModuleDataList < ListResource
                
                    ##
                    # Initialize the ModuleDataList
                    # @param [Version] version Version that contains the resource
                    # @return [ModuleDataList] ModuleDataList
                    def initialize(version)
                        super(version)
                        # Path Solution
                        @solution = {  }
                        @uri = "/Listings"
                        
                    end
                    ##
                    # Create the ModuleDataInstance
                    # @param [String] module_info A JSON object containing essential attributes that define a Listing.
                    # @param [String] configuration A JSON object for providing Listing-specific configuration. Contains button setup, notification URL, and more.
                    # @return [ModuleDataInstance] Created ModuleDataInstance
                    def create(
                        module_info: :unset, 
                        configuration: :unset
                    )

                        data = Twilio::Values.of({
                            'ModuleInfo' => module_info,
                            'Configuration' => configuration,
                        })

                        headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
                        
                        
                        
                        
                        
                        payload = @version.create('POST', @uri, data: data, headers: headers)
                        ModuleDataInstance.new(
                            @version,
                            payload,
                        )
                    end

                    ##
                    # Fetch the ModuleDataInstance
                    # @return [ModuleDataInstance] Fetched ModuleDataInstance
                    def fetch

                        headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
                        
                        
                        
                        
                        
                        payload = @version.fetch('GET', @uri, headers: headers)
                        ModuleDataInstance.new(
                            @version,
                            payload,
                        )
                    end

                


                    # Provide a user friendly representation
                    def to_s
                        '#<Twilio.Marketplace.V1.ModuleDataList>'
                    end
                end

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

                        # Path Solution
                        @solution = solution
                    end

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

                    ##
                    # Provide a user friendly representation
                    def to_s
                        '<Twilio.Marketplace.V1.ModuleDataPage>'
                    end
                end
                class ModuleDataInstance < InstanceResource
                    ##
                    # Initialize the ModuleDataInstance
                    # @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/iam/api/account] that created this ModuleData
                    #   resource.
                    # @param [String] sid The SID of the Call resource to fetch.
                    # @return [ModuleDataInstance] ModuleDataInstance
                    def initialize(version, payload )
                        super(version)
                        
                        # Marshaled Properties
                        @properties = { 
                            'url' => payload['url'],
                            'sid' => payload['sid'],
                            'description' => payload['description'],
                            'support' => payload['support'],
                            'policies' => payload['policies'],
                            'module_info' => payload['module_info'],
                            'documentation' => payload['documentation'],
                            'configuration' => payload['configuration'],
                            'pricing' => payload['pricing'],
                            'listings' => payload['listings'],
                        }
                    end

                    
                    ##
                    # @return [String] URL to query the subresource.
                    def url
                        @properties['url']
                    end
                    
                    ##
                    # @return [String] ModuleSid that identifies this Listing.
                    def sid
                        @properties['sid']
                    end
                    
                    ##
                    # @return [Hash] A JSON object describing the module and is displayed under the Description tab of the Module detail page. You can define the main body of the description, highlight key features or aspects of the module and if applicable, provide code samples for developers
                    def description
                        @properties['description']
                    end
                    
                    ##
                    # @return [Hash] A JSON object containing information on how customers can obtain support for the module. Use this parameter to provide details such as contact information and support description.
                    def support
                        @properties['support']
                    end
                    
                    ##
                    # @return [Hash] A JSON object describing the module's privacy and legal policies and is displayed under the Policies tab of the Module detail page. The maximum file size for Policies is 5MB
                    def policies
                        @properties['policies']
                    end
                    
                    ##
                    # @return [Hash] A JSON object containing essential attributes that define a module. This information is presented on the Module detail page in the Twilio Marketplace Catalog. You can pass the following attributes in the JSON object
                    def module_info
                        @properties['module_info']
                    end
                    
                    ##
                    # @return [Hash] A JSON object for providing comprehensive information, instructions, and resources related to the module
                    def documentation
                        @properties['documentation']
                    end
                    
                    ##
                    # @return [Hash] A JSON object for providing listing specific configuration. Contains button setup, notification url, among others.
                    def configuration
                        @properties['configuration']
                    end
                    
                    ##
                    # @return [Hash] A JSON object for providing Listing specific pricing information.
                    def pricing
                        @properties['pricing']
                    end
                    
                    ##
                    # @return [Array<Hash>] 
                    def listings
                        @properties['listings']
                    end
                    
                    ##
                    # Provide a user friendly representation
                    def to_s
                        "<Twilio.Marketplace.V1.ModuleDataInstance>"
                    end

                    ##
                    # Provide a detailed, user friendly representation
                    def inspect
                        "<Twilio.Marketplace.V1.ModuleDataInstance>"
                    end
                end

            end
        end
    end
end
