## # This code was generated by # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ # # Twilio - Intelligence # 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 Intelligence < IntelligenceBase class V2 < Version class OperatorAttachmentList < ListResource ## # Initialize the OperatorAttachmentList # @param [Version] version Version that contains the resource # @return [OperatorAttachmentList] OperatorAttachmentList def initialize(version) super(version) # Path Solution @solution = { } end # Provide a user friendly representation def to_s '#' end end class OperatorAttachmentContext < InstanceContext ## # Initialize the OperatorAttachmentContext # @param [Version] version Version that contains the resource # @param [String] service_sid The unique SID identifier of the Service. # @param [String] operator_sid The unique SID identifier of the Operator. Allows both Custom and Pre-built Operators. # @return [OperatorAttachmentContext] OperatorAttachmentContext def initialize(version, service_sid, operator_sid) super(version) # Path Solution @solution = { service_sid: service_sid, operator_sid: operator_sid, } @uri = "/Services/#{@solution[:service_sid]}/Operators/#{@solution[:operator_sid]}" end ## # Create the OperatorAttachmentInstance # @return [OperatorAttachmentInstance] Created OperatorAttachmentInstance def create payload = @version.create('POST', @uri) OperatorAttachmentInstance.new( @version, payload, service_sid: @solution[:service_sid], operator_sid: @solution[:operator_sid], ) end ## # Delete the OperatorAttachmentInstance # @return [Boolean] True if delete succeeds, false otherwise def delete @version.delete('DELETE', @uri) end ## # Provide a user friendly representation def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#" end ## # Provide a detailed, user friendly representation def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#" end end class OperatorAttachmentPage < Page ## # Initialize the OperatorAttachmentPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [OperatorAttachmentPage] OperatorAttachmentPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of OperatorAttachmentInstance # @param [Hash] payload Payload response from the API # @return [OperatorAttachmentInstance] OperatorAttachmentInstance def get_instance(payload) OperatorAttachmentInstance.new(@version, payload) end ## # Provide a user friendly representation def to_s '' end end class OperatorAttachmentInstance < InstanceResource ## # Initialize the OperatorAttachmentInstance # @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 OperatorAttachment # resource. # @param [String] sid The SID of the Call resource to fetch. # @return [OperatorAttachmentInstance] OperatorAttachmentInstance def initialize(version, payload , service_sid: nil, operator_sid: nil) super(version) # Marshaled Properties @properties = { 'service_sid' => payload['service_sid'], 'operator_sid' => payload['operator_sid'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'service_sid' => service_sid || @properties['service_sid'] ,'operator_sid' => operator_sid || @properties['operator_sid'] , } end ## # Generate an instance context for the instance, the context is capable of # performing various actions. All instance actions are proxied to the context # @return [OperatorAttachmentContext] CallContext for this CallInstance def context unless @instance_context @instance_context = OperatorAttachmentContext.new(@version , @params['service_sid'], @params['operator_sid']) end @instance_context end ## # @return [String] The unique SID identifier of the Service. def service_sid @properties['service_sid'] end ## # @return [String] The unique SID identifier of the Operator. def operator_sid @properties['operator_sid'] end ## # @return [String] The URL of this resource. def url @properties['url'] end ## # Create the OperatorAttachmentInstance # @return [OperatorAttachmentInstance] Created OperatorAttachmentInstance def create context.create end ## # Delete the OperatorAttachmentInstance # @return [Boolean] True if delete succeeds, false otherwise def delete context.delete end ## # Provide a user friendly representation def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "" end ## # Provide a detailed, user friendly representation def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "" end end end end end end