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

Inherits:
InstanceResource
  • 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, payload, business_sid: nil) ⇒ ImpressionsRateInstance

Initialize the ImpressionsRateInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • business_sid (String) (defaults to: nil)

    A 34 character string that uniquely identifies this Business.



142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb', line 142

def initialize(version, payload, business_sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'business_sid' => payload['business_sid'],
      'end_' => Twilio.deserialize_iso8601_datetime(payload['end']),
      'interval' => payload['interval'],
      'reports' => payload['reports'],
      'start' => Twilio.deserialize_iso8601_datetime(payload['start']),
      'url' => payload['url'],
  }

  # Context
  @instance_context = nil
  @params = {'business_sid' => business_sid, }
end

Instance Method Details

#account_sidString

Returns Account Sid.

Returns:

  • (String)

    Account Sid.



174
175
176
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb', line 174

def 
  @properties['account_sid']
end

#business_sidString

Returns Business Sid.

Returns:

  • (String)

    Business Sid.



180
181
182
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb', line 180

def business_sid
  @properties['business_sid']
end

#contextImpressionsRateContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



165
166
167
168
169
170
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb', line 165

def context
  unless @instance_context
    @instance_context = ImpressionsRateContext.new(@version, @params['business_sid'], )
  end
  @instance_context
end

#end_Time

Returns The end date that for this Impressions Rate.

Returns:

  • (Time)

    The end date that for this Impressions Rate.



186
187
188
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb', line 186

def end_
  @properties['end_']
end

#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:



229
230
231
232
233
234
235
236
237
238
239
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb', line 229

def fetch(brand_sid: :unset, branded_channel_sid: :unset, phone_number_sid: :unset, country: :unset, start: :unset, end_: :unset, interval: :unset)
  context.fetch(
      brand_sid: brand_sid,
      branded_channel_sid: branded_channel_sid,
      phone_number_sid: phone_number_sid,
      country: country,
      start: start,
      end_: end_,
      interval: interval,
  )
end

#inspectObject

Provide a detailed, user friendly representation



250
251
252
253
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb', line 250

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Preview.TrustedComms.ImpressionsRateInstance #{values}>"
end

#intervalimpressions_rate.Intervals

Returns The Interval of this Impressions Rate.

Returns:



192
193
194
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb', line 192

def interval
  @properties['interval']
end

#reportsHash

Returns Values of Impressions Rate per interval.

Returns:

  • (Hash)

    Values of Impressions Rate per interval.



198
199
200
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb', line 198

def reports
  @properties['reports']
end

#startTime

Returns The start date that for this Impressions Rate.

Returns:

  • (Time)

    The start date that for this Impressions Rate.



204
205
206
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb', line 204

def start
  @properties['start']
end

#to_sObject

Provide a user friendly representation



243
244
245
246
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb', line 243

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Preview.TrustedComms.ImpressionsRateInstance #{values}>"
end

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



210
211
212
# File 'lib/twilio-ruby/rest/preview/trusted_comms/business/insights/impressions_rate.rb', line 210

def url
  @properties['url']
end