Class: Twilio::REST::Preview::TrustedComms::BusinessContext::InsightsList::ImpressionsRateContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

Instance Method Summary collapse

Constructor Details

#initialize(version, business_sid) ⇒ ImpressionsRateContext

Initialize the ImpressionsRateContext

Parameters:

  • version (Version)

    Version that contains the resource

  • business_sid (String)

    The unique SID identifier of the Business to filter by.



78
79
80
81
82
83
84
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb', line 78

def initialize(version, business_sid)
  super(version)

  # Path Solution
  @solution = {business_sid: business_sid, }
  @uri = "/Businesses/#{@solution[:business_sid]}/Insights/ImpressionsRate"
end

Instance Method Details

#fetch(brand_sid: :unset, branded_channel_sid: :unset, phone_number_sid: :unset, country: :unset, start: :unset, end_: :unset, interval: :unset) ⇒ ImpressionsRateInstance

Fetch the ImpressionsRateInstance

Parameters:

  • brand_sid (String) (defaults to: :unset)

    The unique SID identifier of the Brand to filter by.

  • branded_channel_sid (String) (defaults to: :unset)

    The unique SID identifier of the Branded Channel to filter by.

  • phone_number_sid (String) (defaults to: :unset)

    The unique SID identifier of the Phone Number to filter by.

  • country (String) (defaults to: :unset)

    The 2-letter ISO 3166 code of the Country to filter by.

  • start (Time) (defaults to: :unset)

    The start date that for this Impressions Rate, given in ISO 8601 format. Default value is 30 days ago.

  • end_ (Time) (defaults to: :unset)

    The end date that for this Impressions Rate, given in ISO 8601 format. Default value is current timestamp.

  • interval (impressions_rate.Intervals) (defaults to: :unset)

    The Interval of this Impressions Rate. One of ‘minute`, `hour`, `day`, `week` or `month`.

Returns:



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb', line 101

def fetch(brand_sid: :unset, branded_channel_sid: :unset, phone_number_sid: :unset, country: :unset, start: :unset, end_: :unset, interval: :unset)
  params = Twilio::Values.of({
      'BrandSid' => brand_sid,
      'BrandedChannelSid' => branded_channel_sid,
      'PhoneNumberSid' => phone_number_sid,
      'Country' => country,
      'Start' => Twilio.serialize_iso8601_datetime(start),
      'End' => Twilio.serialize_iso8601_datetime(end_),
      'Interval' => interval,
  })

  payload = @version.fetch('GET', @uri, params: params)

  ImpressionsRateInstance.new(@version, payload, business_sid: @solution[:business_sid], )
end

#inspectObject

Provide a detailed, user friendly representation



126
127
128
129
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb', line 126

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Preview.TrustedComms.ImpressionsRateContext #{context}>"
end

#to_sObject

Provide a user friendly representation



119
120
121
122
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb', line 119

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Preview.TrustedComms.ImpressionsRateContext #{context}>"
end