lib/twilio-ruby/rest/messaging/v1/external_campaign.rb in twilio-ruby-5.77.0 vs lib/twilio-ruby/rest/messaging/v1/external_campaign.rb in twilio-ruby-6.0.0.pre.rc.1

- old
+ new

@@ -1,150 +1,161 @@ ## -# This code was generated by -# \ / _ _ _| _ _ -# | (_)\/(_)(_|\/| |(/_ v1.0.0 -# / / +# This code was generated by +# ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ +# | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ +# | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ # -# frozen_string_literal: true +# Twilio - Messaging +# This is the public Twilio REST API. +# +# NOTE: This class is auto generated by OpenAPI Generator. +# https://openapi-generator.tech +# Do not edit the class manually. +# + module Twilio - module REST - class Messaging < Domain - class V1 < Version - ## - # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. - class ExternalCampaignList < ListResource - ## - # Initialize the ExternalCampaignList - # @param [Version] version Version that contains the resource - # @return [ExternalCampaignList] ExternalCampaignList - def initialize(version) - super(version) + module REST + class Messaging < MessagingBase + class V1 < Version + class ExternalCampaignList < ListResource + ## + # Initialize the ExternalCampaignList + # @param [Version] version Version that contains the resource + # @return [ExternalCampaignList] ExternalCampaignList + def initialize(version) + super(version) + # Path Solution + @solution = { } + @uri = "/Services/PreregisteredUsa2p" + + end + ## + # Create the ExternalCampaignInstance + # @param [String] campaign_id ID of the preregistered campaign. + # @param [String] messaging_service_sid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services/api) that the resource is associated with. + # @return [ExternalCampaignInstance] Created ExternalCampaignInstance + def create( + campaign_id: nil, + messaging_service_sid: nil + ) - # Path Solution - @solution = {} - @uri = "/Services/PreregisteredUsa2p" - end + data = Twilio::Values.of({ + 'CampaignId' => campaign_id, + 'MessagingServiceSid' => messaging_service_sid, + }) - ## - # Create the ExternalCampaignInstance - # @param [String] campaign_id ID of the preregistered campaign. - # @param [String] messaging_service_sid The SID of the {Messaging - # Service}[https://www.twilio.com/docs/messaging/services/api] that the resource - # is associated with. - # @return [ExternalCampaignInstance] Created ExternalCampaignInstance - def create(campaign_id: nil, messaging_service_sid: nil) - data = Twilio::Values.of({ - 'CampaignId' => campaign_id, - 'MessagingServiceSid' => messaging_service_sid, - }) + payload = @version.create('POST', @uri, data: data) + ExternalCampaignInstance.new( + @version, + payload, + ) + end - payload = @version.create('POST', @uri, data: data) + - ExternalCampaignInstance.new(@version, payload, ) - end - ## - # Provide a user friendly representation - def to_s - '#<Twilio.Messaging.V1.ExternalCampaignList>' - end - end + # Provide a user friendly representation + def to_s + '#<Twilio.Messaging.V1.ExternalCampaignList>' + end + end - ## - # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. - class ExternalCampaignPage < Page - ## - # Initialize the ExternalCampaignPage - # @param [Version] version Version that contains the resource - # @param [Response] response Response from the API - # @param [Hash] solution Path solution for the resource - # @return [ExternalCampaignPage] ExternalCampaignPage - def initialize(version, response, solution) - super(version, response) + class ExternalCampaignPage < Page + ## + # Initialize the ExternalCampaignPage + # @param [Version] version Version that contains the resource + # @param [Response] response Response from the API + # @param [Hash] solution Path solution for the resource + # @return [ExternalCampaignPage] ExternalCampaignPage + def initialize(version, response, solution) + super(version, response) - # Path Solution - @solution = solution - end + # Path Solution + @solution = solution + end - ## - # Build an instance of ExternalCampaignInstance - # @param [Hash] payload Payload response from the API - # @return [ExternalCampaignInstance] ExternalCampaignInstance - def get_instance(payload) - ExternalCampaignInstance.new(@version, payload, ) - end + ## + # Build an instance of ExternalCampaignInstance + # @param [Hash] payload Payload response from the API + # @return [ExternalCampaignInstance] ExternalCampaignInstance + def get_instance(payload) + ExternalCampaignInstance.new(@version, payload) + end - ## - # Provide a user friendly representation - def to_s - '<Twilio.Messaging.V1.ExternalCampaignPage>' - end - end + ## + # Provide a user friendly representation + def to_s + '<Twilio.Messaging.V1.ExternalCampaignPage>' + end + end + class ExternalCampaignInstance < InstanceResource + ## + # Initialize the ExternalCampaignInstance + # @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 ExternalCampaign + # resource. + # @param [String] sid The SID of the Call resource to fetch. + # @return [ExternalCampaignInstance] ExternalCampaignInstance + def initialize(version, payload ) + super(version) + + # Marshaled Properties + @properties = { + 'sid' => payload['sid'], + 'account_sid' => payload['account_sid'], + 'campaign_id' => payload['campaign_id'], + 'messaging_service_sid' => payload['messaging_service_sid'], + 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), + } + end - ## - # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution. - class ExternalCampaignInstance < InstanceResource - ## - # Initialize the ExternalCampaignInstance - # @param [Version] version Version that contains the resource - # @param [Hash] payload payload that contains response from Twilio - # @return [ExternalCampaignInstance] ExternalCampaignInstance - def initialize(version, payload) - super(version) + + ## + # @return [String] The unique string that identifies a US A2P Compliance resource `QE2c6890da8086d771620e9b13fadeba0b`. + def sid + @properties['sid'] + end + + ## + # @return [String] The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the Campaign belongs to. + def account_sid + @properties['account_sid'] + end + + ## + # @return [String] ID of the preregistered campaign. + def campaign_id + @properties['campaign_id'] + end + + ## + # @return [String] The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services/api) that the resource is associated with. + def messaging_service_sid + @properties['messaging_service_sid'] + end + + ## + # @return [Time] The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + def date_created + @properties['date_created'] + end + + ## + # Provide a user friendly representation + def to_s + "<Twilio.Messaging.V1.ExternalCampaignInstance>" + end - # Marshaled Properties - @properties = { - 'sid' => payload['sid'], - 'account_sid' => payload['account_sid'], - 'campaign_id' => payload['campaign_id'], - 'messaging_service_sid' => payload['messaging_service_sid'], - 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), - } - end + ## + # Provide a detailed, user friendly representation + def inspect + "<Twilio.Messaging.V1.ExternalCampaignInstance>" + end + end - ## - # @return [String] The unique string that identifies a US A2P Compliance resource - def sid - @properties['sid'] - end - - ## - # @return [String] The SID of the Account that created the resource - def account_sid - @properties['account_sid'] - end - - ## - # @return [String] ID of the preregistered campaign. - def campaign_id - @properties['campaign_id'] - end - - ## - # @return [String] The SID of the Messaging Service the resource is associated with - def messaging_service_sid - @properties['messaging_service_sid'] - end - - ## - # @return [Time] The ISO 8601 date and time in GMT when the resource was created - def date_created - @properties['date_created'] - end - - ## - # Provide a user friendly representation - def to_s - "<Twilio.Messaging.V1.ExternalCampaignInstance>" - end - - ## - # Provide a detailed, user friendly representation - def inspect - "<Twilio.Messaging.V1.ExternalCampaignInstance>" - end + end end - end end - end -end \ No newline at end of file +end