Class: Shipeasy::Admin::Generated::SetI18nLabelResponse

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/shipeasy_admin/models/set_i18n_label_response.rb

Overview

Result of a one-shot set-and-publish.

Defined Under Namespace

Classes: EnumAttributeValidator

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 = {}) ⇒ SetI18nLabelResponse

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 131

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::SetI18nLabelResponse` 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 `Shipeasy::Admin::Generated::SetI18nLabelResponse`. 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?(:'ok')
    self.ok = attributes[:'ok']
  else
    self.ok = nil
  end

  if attributes.key?(:'profile')
    self.profile = attributes[:'profile']
  else
    self.profile = nil
  end

  if attributes.key?(:'profile_id')
    self.profile_id = attributes[:'profile_id']
  else
    self.profile_id = nil
  end

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

  if attributes.key?(:'value')
    self.value = attributes[:'value']
  else
    self.value = nil
  end

  if attributes.key?(:'published_at')
    self.published_at = attributes[:'published_at']
  else
    self.published_at = nil
  end

  if attributes.key?(:'version')
    self.version = attributes[:'version']
  else
    self.version = nil
  end

  if attributes.key?(:'key_count')
    self.key_count = attributes[:'key_count']
  else
    self.key_count = nil
  end

  if attributes.key?(:'changed')
    self.changed = attributes[:'changed']
  else
    self.changed = nil
  end

  if attributes.key?(:'purged')
    self.purged = attributes[:'purged']
  else
    self.purged = nil
  end

  if attributes.key?(:'kv_verified')
    self.kv_verified = attributes[:'kv_verified']
  else
    self.kv_verified = nil
  end

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

Instance Attribute Details

#changedObject

Whether the snapshot's contents actually changed since the last publish.



44
45
46
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 44

def changed
  @changed
end

#keyObject

The key that was set.



29
30
31
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 29

def key
  @key
end

#key_countObject

Number of keys in the published snapshot.



41
42
43
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 41

def key_count
  @key_count
end

#kv_verifiedObject

Whether a KV read-back confirmed the new version persisted.



50
51
52
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 50

def kv_verified
  @kv_verified
end

#okObject

Always true on success.



20
21
22
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 20

def ok
  @ok
end

#profileObject

Name of the profile that was published.



23
24
25
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 23

def profile
  @profile
end

#profile_idObject

Id of the profile that was published.



26
27
28
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 26

def profile_id
  @profile_id
end

#published_atObject

ISO-8601 timestamp of the publish.



35
36
37
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 35

def published_at
  @published_at
end

#purgedObject

CDN purge outcome: purged ok, skipped (no creds), or failed (edge still stale).



47
48
49
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 47

def purged
  @purged
end

#valueObject

The value that was stored.



32
33
34
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 32

def value
  @value
end

#versionObject

New KV snapshot version that was shipped.



38
39
40
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 38

def version
  @version
end

#warningObject

Human-readable caveat when the publish landed but is not fully live.



53
54
55
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 53

def warning
  @warning
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



96
97
98
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 96

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



101
102
103
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 101

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 78

def self.attribute_map
  {
    :'ok' => :'ok',
    :'profile' => :'profile',
    :'profile_id' => :'profile_id',
    :'key' => :'key',
    :'value' => :'value',
    :'published_at' => :'published_at',
    :'version' => :'version',
    :'key_count' => :'key_count',
    :'changed' => :'changed',
    :'purged' => :'purged',
    :'kv_verified' => :'kv_verified',
    :'warning' => :'warning'
  }
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



434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 434

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



124
125
126
127
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 124

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 106

def self.openapi_types
  {
    :'ok' => :'Boolean',
    :'profile' => :'String',
    :'profile_id' => :'String',
    :'key' => :'String',
    :'value' => :'String',
    :'published_at' => :'String',
    :'version' => :'String',
    :'key_count' => :'Float',
    :'changed' => :'Boolean',
    :'purged' => :'String',
    :'kv_verified' => :'Boolean',
    :'warning' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 402

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      ok == o.ok &&
      profile == o.profile &&
      profile_id == o.profile_id &&
      key == o.key &&
      value == o.value &&
      published_at == o.published_at &&
      version == o.version &&
      key_count == o.key_count &&
      changed == o.changed &&
      purged == o.purged &&
      kv_verified == o.kv_verified &&
      warning == o.warning
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


421
422
423
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 421

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



427
428
429
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 427

def hash
  [ok, profile, profile_id, key, value, published_at, version, key_count, changed, purged, kv_verified, warning].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 218

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @ok.nil?
    invalid_properties.push('invalid value for "ok", ok cannot be nil.')
  end

  if @profile.nil?
    invalid_properties.push('invalid value for "profile", profile cannot be nil.')
  end

  if @profile_id.nil?
    invalid_properties.push('invalid value for "profile_id", profile_id cannot be nil.')
  end

  if @key.nil?
    invalid_properties.push('invalid value for "key", key cannot be nil.')
  end

  if @value.nil?
    invalid_properties.push('invalid value for "value", value cannot be nil.')
  end

  if @published_at.nil?
    invalid_properties.push('invalid value for "published_at", published_at cannot be nil.')
  end

  if @version.nil?
    invalid_properties.push('invalid value for "version", version cannot be nil.')
  end

  if @key_count.nil?
    invalid_properties.push('invalid value for "key_count", key_count cannot be nil.')
  end

  if @changed.nil?
    invalid_properties.push('invalid value for "changed", changed cannot be nil.')
  end

  if @purged.nil?
    invalid_properties.push('invalid value for "purged", purged cannot be nil.')
  end

  if @kv_verified.nil?
    invalid_properties.push('invalid value for "kv_verified", kv_verified cannot be nil.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



456
457
458
459
460
461
462
463
464
465
466
467
468
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 456

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



270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/shipeasy_admin/models/set_i18n_label_response.rb', line 270

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @ok.nil?
  ok_validator = EnumAttributeValidator.new('Boolean', ["true"])
  return false unless ok_validator.valid?(@ok)
  return false if @profile.nil?
  return false if @profile_id.nil?
  return false if @key.nil?
  return false if @value.nil?
  return false if @published_at.nil?
  return false if @version.nil?
  return false if @key_count.nil?
  return false if @changed.nil?
  return false if @purged.nil?
  purged_validator = EnumAttributeValidator.new('String', ["purged", "skipped", "failed"])
  return false unless purged_validator.valid?(@purged)
  return false if @kv_verified.nil?
  true
end