Class: Twilio::REST::Intelligence::V3::ConfigurationInstance

Inherits:
Twilio::REST::InstanceResource show all
Defined in:
lib/twilio-ruby/rest/intelligence/v3/configuration.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, id: nil) ⇒ ConfigurationInstance

Initialize the ConfigurationInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this Configuration resource.

  • sid (String)

    The SID of the Call resource to fetch.



911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 911

def initialize(version, payload , id: nil)
    
    apiV1Version = ApiV1Version.new version.domain, version
    super(apiV1Version)
    
    # Marshaled Properties
    @properties = { 
        'account_id' => payload['account_id'],
        'id' => payload['id'],
        'display_name' => payload['display_name'],
        'description' => payload['description'],
        'version' => payload['version'] == nil ? payload['version'] : payload['version'].to_i,
        'rules' => payload['rules'],
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'code' => payload['code'],
        'message' => payload['message'],
        'http_status_code' => payload['http_status_code'],
        'user_error' => payload['user_error'],
        'params' => payload['params'],
    }

    # Context
    @instance_context = nil
    @params = { 'id' => id  || @properties['id']  , }
end

Instance Method Details

#account_idString

Returns The ID of the Account that created the Intelligence Configuration.

Returns:

  • (String)

    The ID of the Account that created the Intelligence Configuration.



951
952
953
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 951

def 
    @properties['account_id']
end

#codeString

Returns Twilio-specific error code.

Returns:

  • (String)

    Twilio-specific error code



999
1000
1001
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 999

def code
    @properties['code']
end

#contextConfigurationContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



942
943
944
945
946
947
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 942

def context
    unless @instance_context
        @instance_context = ConfigurationContext.new(@version , @params['id'])
    end
    @instance_context
end

#date_createdTime

Returns Timestamp of when the Intelligence Configuration was created.

Returns:

  • (Time)

    Timestamp of when the Intelligence Configuration was created.



987
988
989
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 987

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns Timestamp of when the Intelligence Configuration was last updated.

Returns:

  • (Time)

    Timestamp of when the Intelligence Configuration was last updated.



993
994
995
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 993

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the ConfigurationInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



1030
1031
1032
1033
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 1030

def delete

    context.delete
end

#descriptionString

Returns The description of the Intelligence Configuration further explaining its purpose.

Returns:

  • (String)

    The description of the Intelligence Configuration further explaining its purpose.



969
970
971
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 969

def description
    @properties['description']
end

#display_nameString

Returns The display name of the Intelligence Configuration describing its purpose.

Returns:

  • (String)

    The display name of the Intelligence Configuration describing its purpose.



963
964
965
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 963

def display_name
    @properties['display_name']
end

#fetchConfigurationInstance

Fetch the ConfigurationInstance

Returns:



1038
1039
1040
1041
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 1038

def fetch

    context.fetch
end

#http_status_codeString

Returns HTTP response status code.

Returns:

  • (String)

    HTTP response status code



1011
1012
1013
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 1011

def http_status_code
    @properties['http_status_code']
end

#idString

Returns The unique identifier for the Intelligence Configuration. Assigned by Twilio (TTID).

Returns:

  • (String)

    The unique identifier for the Intelligence Configuration. Assigned by Twilio (TTID).



957
958
959
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 957

def id
    @properties['id']
end

#inspectObject

Provide a detailed, user friendly representation



1064
1065
1066
1067
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 1064

def inspect
    values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Intelligence.V3.ConfigurationInstance #{values}>"
end

#messageString

Returns A human readable error message.

Returns:

  • (String)

    A human readable error message



1005
1006
1007
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 1005

def message
    @properties['message']
end

#paramsHash<String, String>

Returns A map of parameters related to the error, for example, a ‘params.twilioErrorCodeUrl` might hold a URL or link to additional information.

Returns:

  • (Hash<String, String>)

    A map of parameters related to the error, for example, a ‘params.twilioErrorCodeUrl` might hold a URL or link to additional information



1023
1024
1025
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 1023

def params
    @properties['params']
end

#rulesArray<Rule>

Returns List of Intelligence Configuration Rules that govern when and how Language Operators run. Each Rule represents a bundle of Operators, Triggers, Context, and Actions to be executed by the Intelligence Configuration on a Conversation. A maximum of five (5) Rules are allowed per Intelligence Configuration.

Returns:

  • (Array<Rule>)

    List of Intelligence Configuration Rules that govern when and how Language Operators run. Each Rule represents a bundle of Operators, Triggers, Context, and Actions to be executed by the Intelligence Configuration on a Conversation. A maximum of five (5) Rules are allowed per Intelligence Configuration.



981
982
983
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 981

def rules
    @properties['rules']
end

#to_sObject

Provide a user friendly representation



1057
1058
1059
1060
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 1057

def to_s
    values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
    "<Twilio.Intelligence.V3.ConfigurationInstance #{values}>"
end

#update(update_configuration_request: nil) ⇒ ConfigurationInstance

Update the ConfigurationInstance

Parameters:

  • update_configuration_request (UpdateConfigurationRequest) (defaults to: nil)

Returns:



1047
1048
1049
1050
1051
1052
1053
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 1047

def update(update_configuration_request: nil
)

    context.update(
        update_configuration_request: update_configuration_request, 
    )
end

#user_errorBoolean

Returns Whether the error is a user error (true) or a system error (false).

Returns:

  • (Boolean)

    Whether the error is a user error (true) or a system error (false)



1017
1018
1019
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 1017

def user_error
    @properties['user_error']
end

#versionString

Returns The numeric version of the Intelligence Configuration. Automatically incremented with each update on the resource, used to ensure integrity when updating the Configuration.

Returns:

  • (String)

    The numeric version of the Intelligence Configuration. Automatically incremented with each update on the resource, used to ensure integrity when updating the Configuration.



975
976
977
# File 'lib/twilio-ruby/rest/intelligence/v3/configuration.rb', line 975

def version
    @properties['version']
end