Class: Twilio::REST::Webhooks::V1::SettingInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/webhooks/v1/setting.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, setting_id: nil) ⇒ SettingInstance

Initialize the SettingInstance

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 Setting resource.

  • sid (String) —

    The SID of the Call resource to fetch.



859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 859

def initialize(version, payload , setting_id: nil)
    
    apiV1Version = ApiV1Version.new version.domain, version
    super(apiV1Version)
    
    # Marshaled Properties
    @properties = { 
        'id' => payload['id'],
        'type' => payload['type'],
        'friendly_name' => payload['friendly_name'],
        'description' => payload['description'],
        'auth' => payload['auth'],
        'signature' => payload['signature'],
        'connection' => payload['connection'],
        'edge_zones' => payload['edge_zones'],
        'created_at' => Twilio.deserialize_iso8601_datetime(payload['created_at']),
        'updated_at' => Twilio.deserialize_iso8601_datetime(payload['updated_at']),
        'title' => payload['title'],
        'status' => payload['status'] == nil ? payload['status'] : payload['status'].to_i,
        'detail' => payload['detail'],
        'code' => payload['code'] == nil ? payload['code'] : payload['code'].to_i,
    }

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

Instance Method Details

#auth ⇒ AuthSetting

Returns:

  • (AuthSetting)


924
925
926
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 924

def auth
    @properties['auth']
end

#code ⇒ String

Returns:

  • (String)


978
979
980
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 978

def code
    @properties['code']
end

#connection ⇒ ConnectionSetting

Returns HTTP connection settings. If omitted, system defaults are applied.

Returns:

  • (ConnectionSetting) —

    HTTP connection settings. If omitted, system defaults are applied.



936
937
938
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 936

def connection
    @properties['connection']
end

#context ⇒ SettingContext

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

Returns:



891
892
893
894
895
896
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 891

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

#created_at ⇒ Time

Returns:

  • (Time)


948
949
950
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 948

def created_at
    @properties['created_at']
end

#delete ⇒ Boolean

Delete the SettingInstance

Returns:

  • (Boolean) —

    True if delete succeeds, false otherwise



985
986
987
988
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 985

def delete

    context.delete
end

#description ⇒ String

Returns Optional description of the Setting's purpose and usage.

Returns:

  • (String) —

    Optional description of the Setting's purpose and usage



918
919
920
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 918

def description
    @properties['description']
end

#detail ⇒ String

Returns:

  • (String)


972
973
974
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 972

def detail
    @properties['detail']
end

#edge_zones ⇒ EdgeZones

Returns Edge zone configuration for webhook delivery. When omitted, all zones are eligible and Twilio selects freely. When set, zones lists preferred zones in priority order.

Returns:

  • (EdgeZones) —

    Edge zone configuration for webhook delivery. When omitted, all zones are eligible and Twilio selects freely. When set, zones lists preferred zones in priority order.



942
943
944
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 942

def edge_zones
    @properties['edge_zones']
end

#fetch ⇒ SettingInstance

Fetch the SettingInstance

Returns:



993
994
995
996
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 993

def fetch

    context.fetch
end

#friendly_name ⇒ String

Returns Human-readable name.

Returns:

  • (String) —

    Human-readable name



912
913
914
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 912

def friendly_name
    @properties['friendly_name']
end

#id ⇒ String

Returns Unique Setting identifier (TypeID/TTID format).

Returns:

  • (String) —

    Unique Setting identifier (TypeID/TTID format)



900
901
902
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 900

def id
    @properties['id']
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



1019
1020
1021
1022
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 1019

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

#patch(patch_setting: nil) ⇒ SettingInstance

Patch the SettingInstance

Parameters:

  • patch_setting (PatchSetting) (defaults to: nil)

Returns:



1002
1003
1004
1005
1006
1007
1008
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 1002

def patch(patch_setting: nil
)

    context.patch(
        patch_setting: patch_setting, 
    )
end

#signature ⇒ SignatureSetting

Returns:

  • (SignatureSetting)


930
931
932
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 930

def signature
    @properties['signature']
end

#status ⇒ String

Returns:

  • (String)


966
967
968
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 966

def status
    @properties['status']
end

#title ⇒ String

Returns:

  • (String)


960
961
962
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 960

def title
    @properties['title']
end

#to_s ⇒ Object

Provide a user friendly representation



1012
1013
1014
1015
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 1012

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

#type ⇒ String

Returns Setting ownership (read-only): - system: Managed by Twilio - Twilio provides managed Settings to simplify your onboarding journey - Cannot be modified or deleted - Used for default account configuration - customer: Created by you - Can update friendlyName via PATCH - Can delete via DELETE (if not in use) - Core config (auth, signature) is immutable.

Returns:

  • (String) —

    Setting ownership (read-only): - system: Managed by Twilio - Twilio provides managed Settings to simplify your onboarding journey - Cannot be modified or deleted - Used for default account configuration - customer: Created by you - Can update friendlyName via PATCH - Can delete via DELETE (if not in use) - Core config (auth, signature) is immutable



906
907
908
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 906

def type
    @properties['type']
end

#updated_at ⇒ Time

Returns:

  • (Time)


954
955
956
# File 'lib/twilio-ruby/rest/webhooks/v1/setting.rb', line 954

def updated_at
    @properties['updated_at']
end