Class: Twilio::REST::Memory::V1::IdentityResolutionSettingContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/memory/v1/identity_resolution_setting.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, store_id) ⇒ IdentityResolutionSettingContext

Initialize the IdentityResolutionSettingContext

Parameters:

  • version (Version)

    Version that contains the resource

  • store_id (String)

    A unique Memory Store ID using Twilio Type ID (TTID) format



68
69
70
71
72
73
74
75
76
77
78
# File 'lib/twilio-ruby/rest/memory/v1/identity_resolution_setting.rb', line 68

def initialize(version, store_id)
    
    apiV1Version = ApiV1Version.new version.domain, version
    super(apiV1Version)

    # Path Solution
    @solution = { store_id: store_id,  }
    @uri = "/ControlPlane/Stores/#{@solution[:store_id]}/IdentityResolutionSettings"

    
end

Instance Method Details

#fetchIdentityResolutionSettingInstance

Fetch the IdentityResolutionSettingInstance

Returns:



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/twilio-ruby/rest/memory/v1/identity_resolution_setting.rb', line 82

def fetch

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.fetch('GET', @uri, headers: headers)
    IdentityResolutionSettingInstance.new(
        @version,
        payload,
        store_id: @solution[:store_id],
    )
end

#fetch_with_metadataIdentityResolutionSettingInstance

Fetch the IdentityResolutionSettingInstanceMetadata

Returns:



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/twilio-ruby/rest/memory/v1/identity_resolution_setting.rb', line 101

def 

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    response = @version.('GET', @uri, headers: headers)
    identity_resolution_setting_instance = IdentityResolutionSettingInstance.new(
        @version,
        response.body,
        store_id: @solution[:store_id],
    )
    IdentityResolutionSettingInstanceMetadata.new(
        @version,
        identity_resolution_setting_instance,
        response.headers,
        response.status_code
    )
end

#inspectObject

Provide a detailed, user friendly representation



187
188
189
190
# File 'lib/twilio-ruby/rest/memory/v1/identity_resolution_setting.rb', line 187

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

#to_sObject

Provide a user friendly representation



180
181
182
183
# File 'lib/twilio-ruby/rest/memory/v1/identity_resolution_setting.rb', line 180

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

#update(if_match: :unset, identity_resolution_settings_core: nil) ⇒ IdentityResolutionSettingInstance

Update the IdentityResolutionSettingInstance

Parameters:

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

    Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource’s current Entity Tag (ETag) matches the one provided, preventing accidental overwrites.

  • identity_resolution_settings_core (IdentityResolutionSettingsCore) (defaults to: nil)

Returns:



128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/twilio-ruby/rest/memory/v1/identity_resolution_setting.rb', line 128

def update(
  if_match: :unset,
  identity_resolution_settings_core: nil
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'If-Match' => if_match, })
    headers['Content-Type'] = 'application/json'
    
    
    
    
    payload = @version.update('PUT', @uri, headers: headers, data: identity_resolution_settings_core.to_json)
    IdentityResolutionSettingInstance.new(
        @version,
        payload,
        store_id: @solution[:store_id],
    )
end

#update_with_metadata(if_match: :unset, identity_resolution_settings_core: nil) ⇒ IdentityResolutionSettingInstance

Update the IdentityResolutionSettingInstanceMetadata

Parameters:

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

    Allows for optimistic concurrency control by making the request conditional. Server will only act if the resource’s current Entity Tag (ETag) matches the one provided, preventing accidental overwrites.

  • identity_resolution_settings_core (IdentityResolutionSettingsCore) (defaults to: nil)

Returns:



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/twilio-ruby/rest/memory/v1/identity_resolution_setting.rb', line 152

def (
  if_match: :unset,
identity_resolution_settings_core: nil
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'If-Match' => if_match, })
    headers['Content-Type'] = 'application/json'
    
    
    
    
    response = @version.('PUT', @uri, headers: headers, data: identity_resolution_settings_core.to_json)
    identity_resolution_setting_instance = IdentityResolutionSettingInstance.new(
        @version,
        response.body,
        store_id: @solution[:store_id],
    )
    IdentityResolutionSettingInstanceMetadata.new(
        @version,
        identity_resolution_setting_instance,
        response.headers,
        response.status_code
    )
end