Class: Twilio::REST::Notify::V1::ServiceContext::UserContext::SegmentMembershipList
- Inherits:
-
ListResource
- Object
- ListResource
- Twilio::REST::Notify::V1::ServiceContext::UserContext::SegmentMembershipList
- 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
-
#create(segment: nil) ⇒ SegmentMembershipInstance
Retrieve a single page of SegmentMembershipInstance records from the API.
-
#initialize(version, service_sid: nil, identity: nil) ⇒ SegmentMembershipList
constructor
Initialize the SegmentMembershipList.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, service_sid: nil, identity: nil) ⇒ SegmentMembershipList
Initialize the SegmentMembershipList
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 22 def initialize(version, service_sid: nil, identity: nil) super(version) # Path Solution @solution = { service_sid: service_sid, identity: identity } @uri = "/Services/#{@solution[:service_sid]}/Users/#{@solution[:identity]}/SegmentMemberships" end |
Instance Method Details
#create(segment: nil) ⇒ SegmentMembershipInstance
Retrieve a single page of SegmentMembershipInstance records from the API. Request is executed immediately.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 38 def create(segment: nil) data = Twilio::Values.of({ 'Segment' => segment, }) payload = @version.create( 'POST', @uri, data: data ) SegmentMembershipInstance.new( @version, payload, service_sid: @solution[:service_sid], identity: @solution[:identity], ) end |
#to_s ⇒ Object
Provide a user friendly representation
59 60 61 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 59 def to_s '#<Twilio.Notify.V1.SegmentMembershipList>' end |