Class: Twilio::REST::Webhooks::V1::RuleList::PostRule

Inherits:
Object
  • Object
show all
Defined in:
lib/twilio-ruby/rest/webhooks/v1/rule.rb,
lib/twilio-ruby/rest/webhooks/v1/rule.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ PostRule

Returns a new instance of PostRule.



58
59
60
61
62
63
64
65
# File 'lib/twilio-ruby/rest/webhooks/v1/rule.rb', line 58

def initialize(payload)
        @friendly_name = payload["friendly_name"]
        @description = payload["description"]
        @match_type = payload["match_type"]
        @settings = payload["settings"]
        @prefix = payload["prefix"]
        @value = payload["value"]
end

Instance Attribute Details

#description ⇒ Object

Parameters:

  • : (friendly_name) —

    [String] Human-readable name for the Rule (optional, defaults to blank)

  • : (description) —

    [String] Optional description of the Rule's purpose and usage

  • : (match_type) —

    [String]

  • : (settings) —

    [Array<RuleList.SettingReference>] Settings to apply with traffic distribution (percentages must sum to 100)

  • : (prefix) —

    [String] URL prefix to match, MUST be unique across all prefix match rules and MUST end with /.

  • : (value) —

    [String] Exact URL to match, MUST be unique across all exact match rules and MUST NOT end with /.



57
58
59
# File 'lib/twilio-ruby/rest/webhooks/v1/rule.rb', line 57

def description
  @description
end

#friendly_name ⇒ Object

Parameters:

  • : (friendly_name) —

    [String] Human-readable name for the Rule (optional, defaults to blank)

  • : (description) —

    [String] Optional description of the Rule's purpose and usage

  • : (match_type) —

    [String]

  • : (settings) —

    [Array<RuleList.SettingReference>] Settings to apply with traffic distribution (percentages must sum to 100)

  • : (prefix) —

    [String] URL prefix to match, MUST be unique across all prefix match rules and MUST end with /.

  • : (value) —

    [String] Exact URL to match, MUST be unique across all exact match rules and MUST NOT end with /.



57
58
59
# File 'lib/twilio-ruby/rest/webhooks/v1/rule.rb', line 57

def friendly_name
  @friendly_name
end

#match_type ⇒ Object

Parameters:

  • : (friendly_name) —

    [String] Human-readable name for the Rule (optional, defaults to blank)

  • : (description) —

    [String] Optional description of the Rule's purpose and usage

  • : (match_type) —

    [String]

  • : (settings) —

    [Array<RuleList.SettingReference>] Settings to apply with traffic distribution (percentages must sum to 100)

  • : (prefix) —

    [String] URL prefix to match, MUST be unique across all prefix match rules and MUST end with /.

  • : (value) —

    [String] Exact URL to match, MUST be unique across all exact match rules and MUST NOT end with /.



57
58
59
# File 'lib/twilio-ruby/rest/webhooks/v1/rule.rb', line 57

def match_type
  @match_type
end

#prefix ⇒ Object

Parameters:

  • : (friendly_name) —

    [String] Human-readable name for the Rule (optional, defaults to blank)

  • : (description) —

    [String] Optional description of the Rule's purpose and usage

  • : (match_type) —

    [String]

  • : (settings) —

    [Array<RuleList.SettingReference>] Settings to apply with traffic distribution (percentages must sum to 100)

  • : (prefix) —

    [String] URL prefix to match, MUST be unique across all prefix match rules and MUST end with /.

  • : (value) —

    [String] Exact URL to match, MUST be unique across all exact match rules and MUST NOT end with /.



57
58
59
# File 'lib/twilio-ruby/rest/webhooks/v1/rule.rb', line 57

def prefix
  @prefix
end

#settings ⇒ Object

Parameters:

  • : (friendly_name) —

    [String] Human-readable name for the Rule (optional, defaults to blank)

  • : (description) —

    [String] Optional description of the Rule's purpose and usage

  • : (match_type) —

    [String]

  • : (settings) —

    [Array<RuleList.SettingReference>] Settings to apply with traffic distribution (percentages must sum to 100)

  • : (prefix) —

    [String] URL prefix to match, MUST be unique across all prefix match rules and MUST end with /.

  • : (value) —

    [String] Exact URL to match, MUST be unique across all exact match rules and MUST NOT end with /.



57
58
59
# File 'lib/twilio-ruby/rest/webhooks/v1/rule.rb', line 57

def settings
  @settings
end

#value ⇒ Object

Parameters:

  • : (friendly_name) —

    [String] Human-readable name for the Rule (optional, defaults to blank)

  • : (description) —

    [String] Optional description of the Rule's purpose and usage

  • : (match_type) —

    [String]

  • : (settings) —

    [Array<RuleList.SettingReference>] Settings to apply with traffic distribution (percentages must sum to 100)

  • : (prefix) —

    [String] URL prefix to match, MUST be unique across all prefix match rules and MUST end with /.

  • : (value) —

    [String] Exact URL to match, MUST be unique across all exact match rules and MUST NOT end with /.



57
58
59
# File 'lib/twilio-ruby/rest/webhooks/v1/rule.rb', line 57

def value
  @value
end

Instance Method Details

#to_json(options = {}) ⇒ Object



66
67
68
69
70
71
72
73
74
75
# File 'lib/twilio-ruby/rest/webhooks/v1/rule.rb', line 66

def to_json(options = {})
{
        "friendlyName": @friendly_name,
        "description": @description,
        "matchType": @match_type,
        "settings": @settings,
        "prefix": @prefix,
        "value": @value,
}.to_json(options)
end