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.



177
178
179
# File 'lib/google/apis/adsense_v2/classes.rb', line 177

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



153
154
155
# File 'lib/google/apis/adsense_v2/classes.rb', line 153

def content_ads_settings
  @content_ads_settings
end

#display_nameString

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

Returns:

  • (String)


158
159
160
# File 'lib/google/apis/adsense_v2/classes.rb', line 158

def display_name
  @display_name
end

#nameString

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

Returns:

  • (String)


164
165
166
# File 'lib/google/apis/adsense_v2/classes.rb', line 164

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)


170
171
172
# File 'lib/google/apis/adsense_v2/classes.rb', line 170

def reporting_dimension_id
  @reporting_dimension_id
end

#stateString

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

Returns:

  • (String)


175
176
177
# File 'lib/google/apis/adsense_v2/classes.rb', line 175

def state
  @state
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



182
183
184
185
186
187
188
# File 'lib/google/apis/adsense_v2/classes.rb', line 182

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