Class: Twilio::REST::Notify::V1::ServiceContext::UserContext::SegmentMembershipInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Notify::V1::ServiceContext::UserContext::SegmentMembershipInstance
- 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
-
#account_sid ⇒ String
The account_sid.
-
#context ⇒ SegmentMembershipContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#delete ⇒ Boolean
Deletes the SegmentMembershipInstance.
-
#fetch ⇒ SegmentMembershipInstance
Fetch a SegmentMembershipInstance.
-
#identity ⇒ String
The identity.
-
#initialize(version, payload, service_sid: nil, identity: nil, segment: nil) ⇒ SegmentMembershipInstance
constructor
Initialize the SegmentMembershipInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#segment ⇒ String
The segment.
-
#service_sid ⇒ String
The service_sid.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The url.
Constructor Details
#initialize(version, payload, service_sid: nil, identity: nil, segment: nil) ⇒ SegmentMembershipInstance
Initialize the SegmentMembershipInstance
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 162 def initialize(version, payload, service_sid: nil, identity: nil, segment: nil) super(version) # Marshaled Properties @properties = { 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], 'identity' => payload['identity'], 'segment' => payload['segment'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'service_sid' => service_sid, 'identity' => identity, 'segment' => segment || @properties['segment'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The account_sid.
201 202 203 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 201 def account_sid @properties['account_sid'] end |
#context ⇒ SegmentMembershipContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 187 def context unless @instance_context @instance_context = SegmentMembershipContext.new( @version, @params['service_sid'], @params['identity'], @params['segment'], ) end @instance_context end |
#delete ⇒ Boolean
Deletes the SegmentMembershipInstance
232 233 234 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 232 def delete context.delete end |
#fetch ⇒ SegmentMembershipInstance
Fetch a SegmentMembershipInstance
239 240 241 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 239 def fetch context.fetch end |
#identity ⇒ String
Returns The identity.
213 214 215 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 213 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
252 253 254 255 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 252 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Notify.V1.SegmentMembershipInstance #{values}>" end |
#segment ⇒ String
Returns The segment.
219 220 221 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 219 def segment @properties['segment'] end |
#service_sid ⇒ String
Returns The service_sid.
207 208 209 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 207 def service_sid @properties['service_sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
245 246 247 248 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 245 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Notify.V1.SegmentMembershipInstance #{values}>" end |
#url ⇒ String
Returns The url.
225 226 227 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 225 def url @properties['url'] end |