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
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 160 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.
199 200 201 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 199 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
185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 185 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
230 231 232 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 230 def delete context.delete end |
#fetch ⇒ SegmentMembershipInstance
Fetch a SegmentMembershipInstance
237 238 239 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 237 def fetch context.fetch end |
#identity ⇒ String
Returns The identity.
211 212 213 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 211 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
250 251 252 253 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 250 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Notify.V1.SegmentMembershipInstance #{values}>" end |
#segment ⇒ String
Returns The segment.
217 218 219 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 217 def segment @properties['segment'] end |
#service_sid ⇒ String
Returns The service_sid.
205 206 207 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 205 def service_sid @properties['service_sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
243 244 245 246 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 243 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Notify.V1.SegmentMembershipInstance #{values}>" end |
#url ⇒ String
Returns The url.
223 224 225 |
# File 'lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb', line 223 def url @properties['url'] end |