Class: Twilio::REST::PreviewIam::Versionless::OrganizationContext::UserContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::PreviewIam::Versionless::OrganizationContext::UserContext
- Defined in:
- lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the UserInstance.
-
#fetch ⇒ UserInstance
Fetch the UserInstance.
-
#initialize(version, organization_sid, id) ⇒ UserContext
constructor
Initialize the UserContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(if_match: :unset, scim_user: nil) ⇒ UserInstance
Update the UserInstance.
Constructor Details
#initialize(version, organization_sid, id) ⇒ UserContext
Initialize the UserContext
225 226 227 228 229 230 231 232 233 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 225 def initialize(version, organization_sid, id) super(version) # Path Solution @solution = { organization_sid: organization_sid, id: id, } @uri = "/#{@solution[:organization_sid]}/scim/Users/#{@solution[:id]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the UserInstance
237 238 239 240 241 242 243 244 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 237 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Accept'] = '*/*' @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ UserInstance
Fetch the UserInstance
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 249 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Accept'] = 'application/scim+json' payload = @version.fetch('GET', @uri, headers: headers) UserInstance.new( @version, payload, organization_sid: @solution[:organization_sid], id: @solution[:id], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
300 301 302 303 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 300 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.PreviewIam.Versionless.UserContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
293 294 295 296 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 293 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.PreviewIam.Versionless.UserContext #{context}>" end |
#update(if_match: :unset, scim_user: nil) ⇒ UserInstance
Update the UserInstance
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/twilio-ruby/rest/preview_iam/versionless/organization/user.rb', line 271 def update( if_match: :unset,scim_user: nil ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', 'If-Match' => if_match, }) headers['Content-Type'] = 'application/scim+json' headers['Accept'] = 'application/scim+json' payload = @version.update('PUT', @uri, headers: headers, data: scim_user.to_json) UserInstance.new( @version, payload, organization_sid: @solution[:organization_sid], id: @solution[:id], ) end |