Class: Io::Flow::V0::Models::FieldValidationRequired

Inherits:
FieldValidationRule show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Indicates a field is required

Instance Attribute Summary collapse

Attributes inherited from FieldValidationRule

#discriminator

Instance Method Summary collapse

Methods inherited from FieldValidationRule

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ FieldValidationRequired

Returns a new instance of FieldValidationRequired.



43183
43184
43185
43186
43187
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43183

def initialize(incoming={})
  super(:discriminator => FieldValidationRule::Types::FIELD_VALIDATION_REQUIRED)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @placeholder = (x = opts.delete(:placeholder); x.nil? ? nil : HttpClient::Preconditions.assert_class('placeholder', x, String))
end

Instance Attribute Details

#placeholderObject (readonly)

Returns the value of attribute placeholder.



43181
43182
43183
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43181

def placeholder
  @placeholder
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



43193
43194
43195
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43193

def copy(incoming={})
  FieldValidationRequired.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#subtype_to_hashObject



43197
43198
43199
43200
43201
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43197

def subtype_to_hash
  {
    :placeholder => placeholder
  }
end

#to_jsonObject



43189
43190
43191
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 43189

def to_json
  JSON.dump(to_hash)
end