Class: Twilio::REST::Notify::V1::ServiceContext::UserContext::SegmentMembershipContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Notify::V1::ServiceContext::UserContext::SegmentMembershipContext
- Defined in:
- lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#delete ⇒ Boolean
Deletes the SegmentMembershipInstance.
-
#fetch ⇒ SegmentMembershipInstance
Fetch a SegmentMembershipInstance.
-
#initialize(version, service_sid, identity, segment) ⇒ SegmentMembershipContext
constructor
Initialize the SegmentMembershipContext.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, service_sid, identity, segment) ⇒ SegmentMembershipContext
Initialize the SegmentMembershipContext
110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 110 def initialize(version, service_sid, identity, segment) super(version) # Path Solution @solution = { service_sid: service_sid, identity: identity, segment: segment, } @uri = "/Services/#{@solution[:service_sid]}/Users/#{@solution[:identity]}/SegmentMemberships/#{@solution[:segment]}" end |
Instance Method Details
#delete ⇒ Boolean
Deletes the SegmentMembershipInstance
125 126 127 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 125 def delete @version.delete('delete', @uri) end |
#fetch ⇒ SegmentMembershipInstance
Fetch a SegmentMembershipInstance
132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 132 def fetch params = Twilio::Values.of({}) payload = @version.fetch( 'GET', @uri, params, ) SegmentMembershipInstance.new( @version, payload, service_sid: @solution[:service_sid], identity: @solution[:identity], segment: @solution[:segment], ) end |
#to_s ⇒ Object
Provide a user friendly representation
152 153 154 155 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 152 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Notify.V1.SegmentMembershipContext #{context}>" end |