Class: Twilio::REST::FlexApi::V1::ConfigurationContext

Inherits:
InstanceContext show all
Defined in:
lib/twilio-ruby/rest/flex_api/v1/configuration.rb

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ ConfigurationContext

Initialize the ConfigurationContext

Parameters:

  • version (Version)

    Version that contains the resource



48
49
50
51
52
53
54
55
56
# File 'lib/twilio-ruby/rest/flex_api/v1/configuration.rb', line 48

def initialize(version)
    super(version)

    # Path Solution
    @solution = {  }
    @uri = "/Configuration"

    
end

Instance Method Details

#fetch(ui_version: :unset) ⇒ ConfigurationInstance

Fetch the ConfigurationInstance

Parameters:

  • ui_version (String) (defaults to: :unset)

    The Pinned UI version of the Configuration resource to fetch.

Returns:



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/twilio-ruby/rest/flex_api/v1/configuration.rb', line 61

def fetch(
    ui_version: :unset
)

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

#inspectObject

Provide a detailed, user friendly representation



111
112
113
114
# File 'lib/twilio-ruby/rest/flex_api/v1/configuration.rb', line 111

def inspect
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.FlexApi.V1.ConfigurationContext #{context}>"
end

#to_sObject

Provide a user friendly representation



104
105
106
107
# File 'lib/twilio-ruby/rest/flex_api/v1/configuration.rb', line 104

def to_s
    context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
    "#<Twilio.FlexApi.V1.ConfigurationContext #{context}>"
end

#update(body: :unset) ⇒ ConfigurationInstance

Update the ConfigurationInstance

Parameters:

  • body (Object) (defaults to: :unset)

Returns:



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/twilio-ruby/rest/flex_api/v1/configuration.rb', line 85

def update(body: :unset
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    headers['Content-Type'] = 'application/json'
    
    
    
    
    payload = @version.update('POST', @uri, headers: headers, data: body.to_json)
    ConfigurationInstance.new(
        @version,
        payload,
    )
end