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
169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 169 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.
208 209 210 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 208 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
194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 194 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
239 240 241 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 239 def delete context.delete end |
#fetch ⇒ SegmentMembershipInstance
Fetch a SegmentMembershipInstance
246 247 248 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 246 def fetch context.fetch end |
#identity ⇒ String
Returns The identity.
220 221 222 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 220 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
259 260 261 262 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 259 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Notify.V1.SegmentMembershipInstance #{values}>" end |
#segment ⇒ String
Returns The segment.
226 227 228 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 226 def segment @properties['segment'] end |
#service_sid ⇒ String
Returns The service_sid.
214 215 216 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 214 def service_sid @properties['service_sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
252 253 254 255 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 252 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Notify.V1.SegmentMembershipInstance #{values}>" end |
#url ⇒ String
Returns The url.
232 233 234 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 232 def url @properties['url'] end |