Class: Shipeasy::Admin::Generated::PublishI18nProfileResponse

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

Overview

Result of a profile-wide 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 = {}) ⇒ PublishI18nProfileResponse

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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
# File 'lib/shipeasy_admin/models/publish_i18n_profile_response.rb', line 122

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

  if attributes.key?(:'chunk')
    self.chunk = attributes[:'chunk']
  else
    self.chunk = 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.



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

def changed
  @changed
end

#chunkObject

Audit chunk label, or null when none was given.



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

def chunk
  @chunk
end

#key_countObject

Number of keys in the published snapshot.



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

def key_count
  @key_count
end

#kv_verifiedObject

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



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

def kv_verified
  @kv_verified
end

#okObject

Always true on success.



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

def ok
  @ok
end

#profile_idObject

Profile that was published.



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

def profile_id
  @profile_id
end

#published_atObject

ISO-8601 timestamp of the publish.



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

def published_at
  @published_at
end

#purgedObject

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



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

def purged
  @purged
end

#versionObject

New KV snapshot version that was shipped.



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

def version
  @version
end

#warningObject

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



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

def warning
  @warning
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



88
89
90
# File 'lib/shipeasy_admin/models/publish_i18n_profile_response.rb', line 88

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



93
94
95
# File 'lib/shipeasy_admin/models/publish_i18n_profile_response.rb', line 93

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/shipeasy_admin/models/publish_i18n_profile_response.rb', line 72

def self.attribute_map
  {
    :'ok' => :'ok',
    :'profile_id' => :'profile_id',
    :'chunk' => :'chunk',
    :'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



366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# File 'lib/shipeasy_admin/models/publish_i18n_profile_response.rb', line 366

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



114
115
116
117
118
# File 'lib/shipeasy_admin/models/publish_i18n_profile_response.rb', line 114

def self.openapi_nullable
  Set.new([
    :'chunk',
  ])
end

.openapi_typesObject

Attribute type mapping.



98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/shipeasy_admin/models/publish_i18n_profile_response.rb', line 98

def self.openapi_types
  {
    :'ok' => :'Boolean',
    :'profile_id' => :'String',
    :'chunk' => :'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



336
337
338
339
340
341
342
343
344
345
346
347
348
349
# File 'lib/shipeasy_admin/models/publish_i18n_profile_response.rb', line 336

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      ok == o.ok &&
      profile_id == o.profile_id &&
      chunk == o.chunk &&
      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


353
354
355
# File 'lib/shipeasy_admin/models/publish_i18n_profile_response.rb', line 353

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



359
360
361
# File 'lib/shipeasy_admin/models/publish_i18n_profile_response.rb', line 359

def hash
  [ok, profile_id, chunk, 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



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
# File 'lib/shipeasy_admin/models/publish_i18n_profile_response.rb', line 197

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_id.nil?
    invalid_properties.push('invalid value for "profile_id", profile_id 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



388
389
390
391
392
393
394
395
396
397
398
399
400
# File 'lib/shipeasy_admin/models/publish_i18n_profile_response.rb', line 388

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



237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'lib/shipeasy_admin/models/publish_i18n_profile_response.rb', line 237

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_id.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