Class: Google::Apis::AdsenseV2::AdUnit

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/adsense_v2/classes.rb,
lib/google/apis/adsense_v2/representations.rb,
lib/google/apis/adsense_v2/representations.rb

Overview

Representation of an ad unit. An ad unit represents a saved ad unit with a specific set of ad settings that have been customized within an account.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ AdUnit

Returns a new instance of AdUnit.



222
223
224
# File 'lib/google/apis/adsense_v2/classes.rb', line 222

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#content_ads_settingsGoogle::Apis::AdsenseV2::ContentAdsSettings

Settings specific to content ads (AFC). Corresponds to the JSON property contentAdsSettings



197
198
199
# File 'lib/google/apis/adsense_v2/classes.rb', line 197

def content_ads_settings
  @content_ads_settings
end

#display_nameString

Required. Display name of the ad unit, as provided when the ad unit was created. Corresponds to the JSON property displayName

Returns:

  • (String)


203
204
205
# File 'lib/google/apis/adsense_v2/classes.rb', line 203

def display_name
  @display_name
end

#nameString

Output only. Resource name of the ad unit. Format: accounts/account/ adclients/adclient/adunits/adunit Corresponds to the JSON property name

Returns:

  • (String)


209
210
211
# File 'lib/google/apis/adsense_v2/classes.rb', line 209

def name
  @name
end

#reporting_dimension_idString

Output only. Unique ID of the ad unit as used in the AD_UNIT_ID reporting dimension. Corresponds to the JSON property reportingDimensionId

Returns:

  • (String)


215
216
217
# File 'lib/google/apis/adsense_v2/classes.rb', line 215

def reporting_dimension_id
  @reporting_dimension_id
end

#stateString

Required. State of the ad unit. Corresponds to the JSON property state

Returns:

  • (String)


220
221
222
# File 'lib/google/apis/adsense_v2/classes.rb', line 220

def state
  @state
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



227
228
229
230
231
232
233
# File 'lib/google/apis/adsense_v2/classes.rb', line 227

def update!(**args)
  @content_ads_settings = args[:content_ads_settings] if args.key?(:content_ads_settings)
  @display_name = args[:display_name] if args.key?(:display_name)
  @name = args[:name] if args.key?(:name)
  @reporting_dimension_id = args[:reporting_dimension_id] if args.key?(:reporting_dimension_id)
  @state = args[:state] if args.key?(:state)
end