class CrelateClient::PublicApiPlacementResponse
Attributes
Public Class Methods
Attribute mapping from ruby-style variable name to JSON key.
# File lib/crelate_client/models/public_api_placement_response.rb, line 70 def self.attribute_map { :'bill_date' => :'BillDate', :'bill_rate' => :'BillRate', :'bonus' => :'Bonus', :'commission' => :'Commission', :'created_by_id' => :'CreatedBy_Id', :'created_by_name' => :'CreatedBy_Name', :'discount' => :'Discount', :'end_date' => :'EndDate', :'fee' => :'Fee', :'fee_percent' => :'FeePercent', :'hourly_rate' => :'HourlyRate', :'id' => :'Id', :'job_open_date' => :'JobOpenDate', :'margin' => :'Margin', :'pay_rate' => :'PayRate', :'placed_contact_id' => :'PlacedContact_Id', :'placed_contact_name' => :'PlacedContact_Name', :'regarding_id' => :'Regarding_Id', :'regarding_title' => :'Regarding_Title', :'salary' => :'Salary', :'start_date' => :'StartDate', :'time_to_fill' => :'TimeToFill', :'total_hours' => :'TotalHours', :'value' => :'Value', :'_when' => :'When' } end
Initializes the object @param [Hash] attributes Model attributes in the form of hash
# File lib/crelate_client/models/public_api_placement_response.rb, line 133 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} if attributes.has_key?(:'BillDate') self.bill_date = attributes[:'BillDate'] end if attributes.has_key?(:'BillRate') self.bill_rate = attributes[:'BillRate'] end if attributes.has_key?(:'Bonus') self.bonus = attributes[:'Bonus'] end if attributes.has_key?(:'Commission') self.commission = attributes[:'Commission'] end if attributes.has_key?(:'CreatedBy_Id') self.created_by_id = attributes[:'CreatedBy_Id'] end if attributes.has_key?(:'CreatedBy_Name') self.created_by_name = attributes[:'CreatedBy_Name'] end if attributes.has_key?(:'Discount') self.discount = attributes[:'Discount'] end if attributes.has_key?(:'EndDate') self.end_date = attributes[:'EndDate'] end if attributes.has_key?(:'Fee') self.fee = attributes[:'Fee'] end if attributes.has_key?(:'FeePercent') self.fee_percent = attributes[:'FeePercent'] end if attributes.has_key?(:'HourlyRate') self.hourly_rate = attributes[:'HourlyRate'] end if attributes.has_key?(:'Id') self.id = attributes[:'Id'] end if attributes.has_key?(:'JobOpenDate') self.job_open_date = attributes[:'JobOpenDate'] end if attributes.has_key?(:'Margin') self.margin = attributes[:'Margin'] end if attributes.has_key?(:'PayRate') self.pay_rate = attributes[:'PayRate'] end if attributes.has_key?(:'PlacedContact_Id') self.placed_contact_id = attributes[:'PlacedContact_Id'] end if attributes.has_key?(:'PlacedContact_Name') self.placed_contact_name = attributes[:'PlacedContact_Name'] end if attributes.has_key?(:'Regarding_Id') self.regarding_id = attributes[:'Regarding_Id'] end if attributes.has_key?(:'Regarding_Title') self.regarding_title = attributes[:'Regarding_Title'] end if attributes.has_key?(:'Salary') self.salary = attributes[:'Salary'] end if attributes.has_key?(:'StartDate') self.start_date = attributes[:'StartDate'] end if attributes.has_key?(:'TimeToFill') self.time_to_fill = attributes[:'TimeToFill'] end if attributes.has_key?(:'TotalHours') self.total_hours = attributes[:'TotalHours'] end if attributes.has_key?(:'Value') self.value = attributes[:'Value'] end if attributes.has_key?(:'When') self._when = attributes[:'When'] end end
Attribute type mapping.
# File lib/crelate_client/models/public_api_placement_response.rb, line 101 def self.swagger_types { :'bill_date' => :'DateTime', :'bill_rate' => :'Float', :'bonus' => :'Float', :'commission' => :'Float', :'created_by_id' => :'String', :'created_by_name' => :'String', :'discount' => :'Float', :'end_date' => :'DateTime', :'fee' => :'Float', :'fee_percent' => :'Float', :'hourly_rate' => :'Float', :'id' => :'String', :'job_open_date' => :'DateTime', :'margin' => :'Float', :'pay_rate' => :'Float', :'placed_contact_id' => :'String', :'placed_contact_name' => :'String', :'regarding_id' => :'String', :'regarding_title' => :'String', :'salary' => :'Float', :'start_date' => :'DateTime', :'time_to_fill' => :'Float', :'total_hours' => :'Integer', :'value' => :'Float', :'_when' => :'DateTime' } end
Public Instance Methods
Checks equality by comparing each attribute. @param [Object] Object to be compared
# File lib/crelate_client/models/public_api_placement_response.rb, line 256 def ==(o) return true if self.equal?(o) self.class == o.class && bill_date == o.bill_date && bill_rate == o.bill_rate && bonus == o.bonus && commission == o.commission && created_by_id == o.created_by_id && created_by_name == o.created_by_name && discount == o.discount && end_date == o.end_date && fee == o.fee && fee_percent == o.fee_percent && hourly_rate == o.hourly_rate && id == o.id && job_open_date == o.job_open_date && margin == o.margin && pay_rate == o.pay_rate && placed_contact_id == o.placed_contact_id && placed_contact_name == o.placed_contact_name && regarding_id == o.regarding_id && regarding_title == o.regarding_title && salary == o.salary && start_date == o.start_date && time_to_fill == o.time_to_fill && total_hours == o.total_hours && value == o.value && _when == o._when end
Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data
# File lib/crelate_client/models/public_api_placement_response.rb, line 322 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model temp_model = CrelateClient.const_get(type).new temp_model.build_from_hash(value) end end
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash
# File lib/crelate_client/models/public_api_placement_response.rb, line 388 def _to_hash(value) if value.is_a?(Array) value.compact.map{ |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end
Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself
# File lib/crelate_client/models/public_api_placement_response.rb, line 301 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end
@see the `==` method @param [Object] Object to be compared
# File lib/crelate_client/models/public_api_placement_response.rb, line 288 def eql?(o) self == o end
Calculates hash code according to all attributes. @return [Fixnum] Hash code
# File lib/crelate_client/models/public_api_placement_response.rb, line 294 def hash [bill_date, bill_rate, bonus, commission, created_by_id, created_by_name, discount, end_date, fee, fee_percent, hourly_rate, id, job_open_date, margin, pay_rate, placed_contact_id, placed_contact_name, regarding_id, regarding_title, salary, start_date, time_to_fill, total_hours, value, _when].hash end
Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons
# File lib/crelate_client/models/public_api_placement_response.rb, line 243 def list_invalid_properties invalid_properties = Array.new return invalid_properties end
Returns the object in the form of hash @return [Hash] Returns the object in the form of hash
# File lib/crelate_client/models/public_api_placement_response.rb, line 374 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end
Returns the string representation of the object @return [String] String presentation of the object
# File lib/crelate_client/models/public_api_placement_response.rb, line 362 def to_s to_hash.to_s end
Check to see if the all the properties in the model are valid @return true if the model is valid
# File lib/crelate_client/models/public_api_placement_response.rb, line 250 def valid? return true end