Class: Zernio::GetAdsSearchTerms200ResponseDataInner

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ GetAdsSearchTerms200ResponseDataInner

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 106

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetAdsSearchTerms200ResponseDataInner` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetAdsSearchTerms200ResponseDataInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'search_term')
    self.search_term = attributes[:'search_term']
  end

  if attributes.key?(:'status')
    self.status = attributes[:'status']
  end

  if attributes.key?(:'match_type')
    self.match_type = attributes[:'match_type']
  end

  if attributes.key?(:'campaign_id')
    self.campaign_id = attributes[:'campaign_id']
  end

  if attributes.key?(:'campaign_name')
    self.campaign_name = attributes[:'campaign_name']
  end

  if attributes.key?(:'ad_group_id')
    self.ad_group_id = attributes[:'ad_group_id']
  end

  if attributes.key?(:'ad_group_name')
    self.ad_group_name = attributes[:'ad_group_name']
  end

  if attributes.key?(:'impressions')
    self.impressions = attributes[:'impressions']
  end

  if attributes.key?(:'clicks')
    self.clicks = attributes[:'clicks']
  end

  if attributes.key?(:'cost_micros')
    self.cost_micros = attributes[:'cost_micros']
  end

  if attributes.key?(:'conversions')
    self.conversions = attributes[:'conversions']
  end

  if attributes.key?(:'conversions_value')
    self.conversions_value = attributes[:'conversions_value']
  end
end

Instance Attribute Details

#ad_group_idObject

Returns the value of attribute ad_group_id.



30
31
32
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 30

def ad_group_id
  @ad_group_id
end

#ad_group_nameObject

Returns the value of attribute ad_group_name.



32
33
34
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 32

def ad_group_name
  @ad_group_name
end

#campaign_idObject

Returns the value of attribute campaign_id.



26
27
28
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 26

def campaign_id
  @campaign_id
end

#campaign_nameObject

Returns the value of attribute campaign_name.



28
29
30
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 28

def campaign_name
  @campaign_name
end

#clicksObject

Returns the value of attribute clicks.



36
37
38
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 36

def clicks
  @clicks
end

#conversionsObject

Returns the value of attribute conversions.



41
42
43
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 41

def conversions
  @conversions
end

#conversions_valueObject

Returns the value of attribute conversions_value.



43
44
45
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 43

def conversions_value
  @conversions_value
end

#cost_microsObject

Cost in micros of the account currency (divide by 1,000,000).



39
40
41
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 39

def cost_micros
  @cost_micros
end

#impressionsObject

Returns the value of attribute impressions.



34
35
36
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 34

def impressions
  @impressions
end

#match_typeObject

How the term matched (BROAD, PHRASE, EXACT, NEAR_PHRASE, NEAR_EXACT).



24
25
26
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 24

def match_type
  @match_type
end

#search_termObject

Returns the value of attribute search_term.



18
19
20
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 18

def search_term
  @search_term
end

#statusObject

ADDED / EXCLUDED / ADDED_EXCLUDED / NONE — whether the term is already a keyword or a negative.



21
22
23
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 21

def status
  @status
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



64
65
66
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 64

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



69
70
71
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 69

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 46

def self.attribute_map
  {
    :'search_term' => :'searchTerm',
    :'status' => :'status',
    :'match_type' => :'matchType',
    :'campaign_id' => :'campaignId',
    :'campaign_name' => :'campaignName',
    :'ad_group_id' => :'adGroupId',
    :'ad_group_name' => :'adGroupName',
    :'impressions' => :'impressions',
    :'clicks' => :'clicks',
    :'cost_micros' => :'costMicros',
    :'conversions' => :'conversions',
    :'conversions_value' => :'conversionsValue'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 218

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



92
93
94
95
96
97
98
99
100
101
102
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 92

def self.openapi_nullable
  Set.new([
    :'search_term',
    :'status',
    :'match_type',
    :'campaign_id',
    :'campaign_name',
    :'ad_group_id',
    :'ad_group_name',
  ])
end

.openapi_typesObject

Attribute type mapping.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 74

def self.openapi_types
  {
    :'search_term' => :'String',
    :'status' => :'String',
    :'match_type' => :'String',
    :'campaign_id' => :'String',
    :'campaign_name' => :'String',
    :'ad_group_id' => :'String',
    :'ad_group_name' => :'String',
    :'impressions' => :'Integer',
    :'clicks' => :'Integer',
    :'cost_micros' => :'Integer',
    :'conversions' => :'Float',
    :'conversions_value' => :'Float'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 186

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      search_term == o.search_term &&
      status == o.status &&
      match_type == o.match_type &&
      campaign_id == o.campaign_id &&
      campaign_name == o.campaign_name &&
      ad_group_id == o.ad_group_id &&
      ad_group_name == o.ad_group_name &&
      impressions == o.impressions &&
      clicks == o.clicks &&
      cost_micros == o.cost_micros &&
      conversions == o.conversions &&
      conversions_value == o.conversions_value
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


205
206
207
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 205

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



211
212
213
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 211

def hash
  [search_term, status, match_type, campaign_id, campaign_name, ad_group_id, ad_group_name, impressions, clicks, cost_micros, conversions, conversions_value].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



171
172
173
174
175
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 171

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 240

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



179
180
181
182
# File 'lib/zernio-sdk/models/get_ads_search_terms200_response_data_inner.rb', line 179

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  true
end