Class: Shipeasy::Admin::Generated::ListI18nDraftsResponseInner
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Shipeasy::Admin::Generated::ListI18nDraftsResponseInner
- Defined in:
- lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb
Overview
One staged translation draft.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#created_at ⇒ Object
ISO-8601 timestamp of creation.
-
#created_by ⇒ Object
Actor email that created the draft.
-
#id ⇒ Object
Stable opaque draft id.
-
#name ⇒ Object
Draft name, e.g.
-
#profile_id ⇒ Object
Profile the draft targets.
-
#published_at ⇒ Object
ISO-8601 merge/publish timestamp, or
null. -
#source_profile_id ⇒ Object
Profile the draft was seeded from, or
null. -
#status ⇒ Object
Lifecycle state of the draft.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ListI18nDraftsResponseInner
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ ListI18nDraftsResponseInner
Initializes the object
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 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 113 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Shipeasy::Admin::Generated::ListI18nDraftsResponseInner` 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::ListI18nDraftsResponseInner`. 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?(:'id') self.id = attributes[:'id'] else self.id = nil end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'profile_id') self.profile_id = attributes[:'profile_id'] end if attributes.key?(:'source_profile_id') self.source_profile_id = attributes[:'source_profile_id'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'created_by') self.created_by = attributes[:'created_by'] end if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end if attributes.key?(:'published_at') self.published_at = attributes[:'published_at'] end end |
Instance Attribute Details
#created_at ⇒ Object
ISO-8601 timestamp of creation.
38 39 40 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 38 def created_at @created_at end |
#created_by ⇒ Object
Actor email that created the draft.
35 36 37 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 35 def created_by @created_by end |
#id ⇒ Object
Stable opaque draft id.
20 21 22 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 20 def id @id end |
#name ⇒ Object
Draft name, e.g. the target locale being staged.
23 24 25 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 23 def name @name end |
#profile_id ⇒ Object
Profile the draft targets.
26 27 28 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 26 def profile_id @profile_id end |
#published_at ⇒ Object
ISO-8601 merge/publish timestamp, or null.
41 42 43 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 41 def published_at @published_at end |
#source_profile_id ⇒ Object
Profile the draft was seeded from, or null.
29 30 31 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 29 def source_profile_id @source_profile_id end |
#status ⇒ Object
Lifecycle state of the draft.
32 33 34 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 32 def status @status end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
80 81 82 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 80 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
85 86 87 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 85 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 66 def self.attribute_map { :'id' => :'id', :'name' => :'name', :'profile_id' => :'profileId', :'source_profile_id' => :'sourceProfileId', :'status' => :'status', :'created_by' => :'createdBy', :'created_at' => :'createdAt', :'published_at' => :'publishedAt' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 234 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_nullable ⇒ Object
List of attributes with nullable: true
104 105 106 107 108 109 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 104 def self.openapi_nullable Set.new([ :'source_profile_id', :'published_at' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 90 def self.openapi_types { :'id' => :'String', :'name' => :'String', :'profile_id' => :'String', :'source_profile_id' => :'String', :'status' => :'String', :'created_by' => :'String', :'created_at' => :'String', :'published_at' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 206 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && name == o.name && profile_id == o.profile_id && source_profile_id == o.source_profile_id && status == o.status && created_by == o.created_by && created_at == o.created_at && published_at == o.published_at end |
#eql?(o) ⇒ Boolean
221 222 223 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 221 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
227 228 229 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 227 def hash [id, name, profile_id, source_profile_id, status, created_by, created_at, published_at].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
164 165 166 167 168 169 170 171 172 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 164 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 256 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
176 177 178 179 180 181 182 |
# File 'lib/shipeasy_admin/models/list_i18n_drafts_response_inner.rb', line 176 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? status_validator = EnumAttributeValidator.new('String', ["open", "merged", "abandoned"]) return false unless status_validator.valid?(@status) true end |