## # This code was generated by # ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ # | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ # | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ # # Bulk Messaging and Broadcast # Bulk Sending is a public Twilio REST API for 1:Many Message creation up to 100 recipients. Broadcast is a public Twilio REST API for 1:Many Message creation up to 10,000 recipients via file upload. # # NOTE: This class is auto generated by OpenAPI Generator. # https://openapi-generator.tech # Do not edit the class manually. # module Twilio module REST class PreviewMessaging < PreviewMessagingBase class V1 < Version class BroadcastList < ListResource ## # Initialize the BroadcastList # @param [Version] version Version that contains the resource # @return [BroadcastList] BroadcastList def initialize(version) super(version) # Path Solution @solution = { } @uri = "/Broadcasts" end ## # Create the BroadcastInstance # @param [String] x_twilio_request_key Idempotency key provided by the client # @return [BroadcastInstance] Created BroadcastInstance def create( x_twilio_request_key: :unset ) headers = Twilio::Values.of({ 'X-Twilio-Request-Key' => x_twilio_request_key, }) payload = @version.create('POST', @uri, headers: headers) BroadcastInstance.new( @version, payload, ) end # Provide a user friendly representation def to_s '#' end end class BroadcastPage < Page ## # Initialize the BroadcastPage # @param [Version] version Version that contains the resource # @param [Response] response Response from the API # @param [Hash] solution Path solution for the resource # @return [BroadcastPage] BroadcastPage def initialize(version, response, solution) super(version, response) # Path Solution @solution = solution end ## # Build an instance of BroadcastInstance # @param [Hash] payload Payload response from the API # @return [BroadcastInstance] BroadcastInstance def get_instance(payload) BroadcastInstance.new(@version, payload) end ## # Provide a user friendly representation def to_s '' end end class BroadcastInstance < InstanceResource ## # Initialize the BroadcastInstance # @param [Version] version Version that contains the resource # @param [Hash] payload payload that contains response from Twilio # @param [String] account_sid The SID of the # {Account}[https://www.twilio.com/docs/iam/api/account] that created this Broadcast # resource. # @param [String] sid The SID of the Call resource to fetch. # @return [BroadcastInstance] BroadcastInstance def initialize(version, payload ) super(version) # Marshaled Properties @properties = { 'broadcast_sid' => payload['broadcast_sid'], 'created_date' => Twilio.deserialize_iso8601_datetime(payload['created_date']), 'updated_date' => Twilio.deserialize_iso8601_datetime(payload['updated_date']), 'broadcast_status' => payload['broadcast_status'], 'execution_details' => payload['execution_details'], 'results_file' => payload['results_file'], } end ## # @return [String] Numeric ID indentifying individual Broadcast requests def broadcast_sid @properties['broadcast_sid'] end ## # @return [Time] Timestamp of when the Broadcast was created def created_date @properties['created_date'] end ## # @return [Time] Timestamp of when the Broadcast was last updated def updated_date @properties['updated_date'] end ## # @return [String] Status of the Broadcast request. Valid values are None, Pending-Upload, Uploaded, Queued, Executing, Execution-Failure, Execution-Completed, Cancelation-Requested, and Canceled def broadcast_status @properties['broadcast_status'] end ## # @return [MessagingV1BroadcastExecutionDetails] def execution_details @properties['execution_details'] end ## # @return [String] Path to a file detailing successful requests and errors from Broadcast execution def results_file @properties['results_file'] end ## # Provide a user friendly representation def to_s "" end ## # Provide a detailed, user friendly representation def inspect "" end end end end end end