Class: Twilio::REST::Memory::V1::BulkContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Memory::V1::BulkContext
- Defined in:
- lib/twilio-ruby/rest/memory/v1/bulk.rb
Instance Method Summary collapse
-
#initialize(version, store_id) ⇒ BulkContext
constructor
Initialize the BulkContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(update_profiles_bulk_request: nil) ⇒ BulkInstance
Update the BulkInstance.
-
#update_with_metadata(update_profiles_bulk_request: nil) ⇒ BulkInstance
Update the BulkInstanceMetadata.
Constructor Details
#initialize(version, store_id) ⇒ BulkContext
Initialize the BulkContext
78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/twilio-ruby/rest/memory/v1/bulk.rb', line 78 def initialize(version, store_id) apiV1Version = ApiV1Version.new version.domain, version super(apiV1Version) # Path Solution @solution = { store_id: store_id, } @uri = "/Stores/#{@solution[:store_id]}/Profiles/Bulk" end |
Instance Method Details
#inspect ⇒ Object
Provide a detailed, user friendly representation
147 148 149 150 |
# File 'lib/twilio-ruby/rest/memory/v1/bulk.rb', line 147 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Memory.V1.BulkContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
140 141 142 143 |
# File 'lib/twilio-ruby/rest/memory/v1/bulk.rb', line 140 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Memory.V1.BulkContext #{context}>" end |
#update(update_profiles_bulk_request: nil) ⇒ BulkInstance
Update the BulkInstance
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/twilio-ruby/rest/memory/v1/bulk.rb', line 93 def update(update_profiles_bulk_request: nil ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' payload = @version.update('PUT', @uri, headers: headers, data: update_profiles_bulk_request.to_json) BulkInstance.new( @version, payload, store_id: @solution[:store_id], ) end |
#update_with_metadata(update_profiles_bulk_request: nil) ⇒ BulkInstance
Update the BulkInstanceMetadata
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/twilio-ruby/rest/memory/v1/bulk.rb', line 114 def (update_profiles_bulk_request: nil ) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) headers['Content-Type'] = 'application/json' response = @version.('PUT', @uri, headers: headers, data: update_profiles_bulk_request.to_json) bulk_instance = BulkInstance.new( @version, response.body, store_id: @solution[:store_id], ) BulkInstanceMetadata.new( @version, bulk_instance, response.headers, response.status_code ) end |