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
105 106 107 108 109 110 111 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 105 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
116 117 118 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 116 def delete @version.delete('delete', @uri) end |
#fetch ⇒ SegmentMembershipInstance
Fetch a SegmentMembershipInstance
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 123 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
143 144 145 146 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 143 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Notify.V1.SegmentMembershipContext #{context}>" end |