Class: ConnectWise::ServiceTemplate
- Inherits:
-
Object
- Object
- ConnectWise::ServiceTemplate
- Defined in:
- lib/connect_wise/models/service_template.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#_info ⇒ Object
Returns the value of attribute _info.
-
#agreement ⇒ Object
Returns the value of attribute agreement.
-
#assigned_by ⇒ Object
Returns the value of attribute assigned_by.
-
#assigned_notify_flag ⇒ Object
Returns the value of attribute assigned_notify_flag.
-
#attach_schedule_to_new_service_flag ⇒ Object
Returns the value of attribute attach_schedule_to_new_service_flag.
-
#bill_complete_flag ⇒ Object
Returns the value of attribute bill_complete_flag.
-
#bill_service_separately_flag ⇒ Object
Returns the value of attribute bill_service_separately_flag.
-
#bill_unapproved_time_and_expenses_flag ⇒ Object
Returns the value of attribute bill_unapproved_time_and_expenses_flag.
-
#billing_amount ⇒ Object
Returns the value of attribute billing_amount.
-
#billing_method ⇒ Object
Returns the value of attribute billing_method.
-
#board ⇒ Object
Returns the value of attribute board.
-
#company ⇒ Object
Returns the value of attribute company.
-
#contact ⇒ Object
Returns the value of attribute contact.
-
#department ⇒ Object
Returns the value of attribute department.
-
#email_cc ⇒ Object
Returns the value of attribute email_cc.
-
#email_cc_flag ⇒ Object
Returns the value of attribute email_cc_flag.
-
#email_contact_flag ⇒ Object
Returns the value of attribute email_contact_flag.
-
#email_resource_flag ⇒ Object
Returns the value of attribute email_resource_flag.
-
#expense_billable_flag ⇒ Object
Returns the value of attribute expense_billable_flag.
-
#expense_invoice_flag ⇒ Object
Returns the value of attribute expense_invoice_flag.
-
#hours_budget ⇒ Object
Returns the value of attribute hours_budget.
-
#id ⇒ Object
Returns the value of attribute id.
-
#impact ⇒ Object
Returns the value of attribute impact.
-
#internal_analysis ⇒ Object
Returns the value of attribute internal_analysis.
-
#item ⇒ Object
Returns the value of attribute item.
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
Returns the value of attribute name.
-
#override_flag ⇒ Object
Returns the value of attribute override_flag.
-
#priority ⇒ Object
Returns the value of attribute priority.
-
#problem ⇒ Object
Returns the value of attribute problem.
-
#product_invoice_flag ⇒ Object
Returns the value of attribute product_invoice_flag.
-
#purchase_order_number ⇒ Object
Returns the value of attribute purchase_order_number.
-
#reference ⇒ Object
Returns the value of attribute reference.
-
#restrict_downpayment_flag ⇒ Object
Returns the value of attribute restrict_downpayment_flag.
-
#schedule_days_before ⇒ Object
Returns the value of attribute schedule_days_before.
-
#service_days_before ⇒ Object
Returns the value of attribute service_days_before.
-
#service_location ⇒ Object
Returns the value of attribute service_location.
-
#severity ⇒ Object
Returns the value of attribute severity.
-
#site ⇒ Object
Returns the value of attribute site.
-
#source ⇒ Object
Returns the value of attribute source.
-
#status ⇒ Object
Returns the value of attribute status.
-
#subtype ⇒ Object
Returns the value of attribute subtype.
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#team ⇒ Object
Returns the value of attribute team.
-
#template_flag ⇒ Object
Returns the value of attribute template_flag.
-
#time_billable_flag ⇒ Object
Returns the value of attribute time_billable_flag.
-
#time_invoice_flag ⇒ Object
Returns the value of attribute time_invoice_flag.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
-
.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
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ServiceTemplate
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ ServiceTemplate
Initializes the object
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 215 216 217 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 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 |
# File 'lib/connect_wise/models/service_template.rb', line 180 def initialize(attributes = {}) raise ArgumentError, 'The input argument (attributes) must be a hash in `ConnectWise::ServiceTemplate` initialize method' unless attributes.is_a?(Hash) # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) do |(k, v), h| raise ArgumentError, "`#{k}` is not a valid attribute in `ConnectWise::ServiceTemplate`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect unless self.class.attribute_map.key?(k.to_sym) h[k.to_sym] = v end self.id = attributes[:id] if attributes.key?(:id) self.name = attributes[:name] if attributes.key?(:name) self.board = attributes[:board] if attributes.key?(:board) self.type = attributes[:type] if attributes.key?(:type) self.item = attributes[:item] if attributes.key?(:item) self.subtype = attributes[:subtype] if attributes.key?(:subtype) self.service_location = attributes[:service_location] if attributes.key?(:service_location) self.status = attributes[:status] if attributes.key?(:status) self.source = attributes[:source] if attributes.key?(:source) self.priority = attributes[:priority] if attributes.key?(:priority) self.team = attributes[:team] if attributes.key?(:team) self.company = attributes[:company] if attributes.key?(:company) self.contact = attributes[:contact] if attributes.key?(:contact) self.site = attributes[:site] if attributes.key?(:site) self.assigned_notify_flag = attributes[:assigned_notify_flag] if attributes.key?(:assigned_notify_flag) self.location = attributes[:location] if attributes.key?(:location) self.department = attributes[:department] if attributes.key?(:department) self.summary = attributes[:summary] if attributes.key?(:summary) self.problem = attributes[:problem] if attributes.key?(:problem) self.hours_budget = attributes[:hours_budget] if attributes.key?(:hours_budget) self.internal_analysis = attributes[:internal_analysis] if attributes.key?(:internal_analysis) self.time_billable_flag = attributes[:time_billable_flag] if attributes.key?(:time_billable_flag) self.expense_billable_flag = attributes[:expense_billable_flag] if attributes.key?(:expense_billable_flag) self.purchase_order_number = attributes[:purchase_order_number] if attributes.key?(:purchase_order_number) self.reference = attributes[:reference] if attributes.key?(:reference) self.bill_complete_flag = attributes[:bill_complete_flag] if attributes.key?(:bill_complete_flag) self.bill_service_separately_flag = attributes[:bill_service_separately_flag] if attributes.key?(:bill_service_separately_flag) self.billing_amount = attributes[:billing_amount] if attributes.key?(:billing_amount) self.bill_unapproved_time_and_expenses_flag = attributes[:bill_unapproved_time_and_expenses_flag] if attributes.key?(:bill_unapproved_time_and_expenses_flag) self.override_flag = attributes[:override_flag] if attributes.key?(:override_flag) self.time_invoice_flag = attributes[:time_invoice_flag] if attributes.key?(:time_invoice_flag) self.expense_invoice_flag = attributes[:expense_invoice_flag] if attributes.key?(:expense_invoice_flag) self.product_invoice_flag = attributes[:product_invoice_flag] if attributes.key?(:product_invoice_flag) self.agreement = attributes[:agreement] if attributes.key?(:agreement) self.billing_method = attributes[:billing_method] if attributes.key?(:billing_method) self.severity = attributes[:severity] if attributes.key?(:severity) self.impact = attributes[:impact] if attributes.key?(:impact) self.assigned_by = attributes[:assigned_by] if attributes.key?(:assigned_by) self.schedule_days_before = attributes[:schedule_days_before] if attributes.key?(:schedule_days_before) self.service_days_before = attributes[:service_days_before] if attributes.key?(:service_days_before) self.attach_schedule_to_new_service_flag = attributes[:attach_schedule_to_new_service_flag] if attributes.key?(:attach_schedule_to_new_service_flag) self.template_flag = attributes[:template_flag] if attributes.key?(:template_flag) self.email_contact_flag = attributes[:email_contact_flag] if attributes.key?(:email_contact_flag) self.email_resource_flag = attributes[:email_resource_flag] if attributes.key?(:email_resource_flag) self.email_cc_flag = attributes[:email_cc_flag] if attributes.key?(:email_cc_flag) self.email_cc = attributes[:email_cc] if attributes.key?(:email_cc) self.restrict_downpayment_flag = attributes[:restrict_downpayment_flag] if attributes.key?(:restrict_downpayment_flag) return unless attributes.key?(:_info) return unless (value = attributes[:_info]).is_a?(Hash) self._info = value end |
Instance Attribute Details
#_info ⇒ Object
Returns the value of attribute _info.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def _info @_info end |
#agreement ⇒ Object
Returns the value of attribute agreement.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def agreement @agreement end |
#assigned_by ⇒ Object
Returns the value of attribute assigned_by.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def assigned_by @assigned_by end |
#assigned_notify_flag ⇒ Object
Returns the value of attribute assigned_notify_flag.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def assigned_notify_flag @assigned_notify_flag end |
#attach_schedule_to_new_service_flag ⇒ Object
Returns the value of attribute attach_schedule_to_new_service_flag.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def attach_schedule_to_new_service_flag @attach_schedule_to_new_service_flag end |
#bill_complete_flag ⇒ Object
Returns the value of attribute bill_complete_flag.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def bill_complete_flag @bill_complete_flag end |
#bill_service_separately_flag ⇒ Object
Returns the value of attribute bill_service_separately_flag.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def bill_service_separately_flag @bill_service_separately_flag end |
#bill_unapproved_time_and_expenses_flag ⇒ Object
Returns the value of attribute bill_unapproved_time_and_expenses_flag.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def bill_unapproved_time_and_expenses_flag @bill_unapproved_time_and_expenses_flag end |
#billing_amount ⇒ Object
Returns the value of attribute billing_amount.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def billing_amount @billing_amount end |
#billing_method ⇒ Object
Returns the value of attribute billing_method.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def billing_method @billing_method end |
#board ⇒ Object
Returns the value of attribute board.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def board @board end |
#company ⇒ Object
Returns the value of attribute company.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def company @company end |
#contact ⇒ Object
Returns the value of attribute contact.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def contact @contact end |
#department ⇒ Object
Returns the value of attribute department.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def department @department end |
#email_cc ⇒ Object
Returns the value of attribute email_cc.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def email_cc @email_cc end |
#email_cc_flag ⇒ Object
Returns the value of attribute email_cc_flag.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def email_cc_flag @email_cc_flag end |
#email_contact_flag ⇒ Object
Returns the value of attribute email_contact_flag.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def email_contact_flag @email_contact_flag end |
#email_resource_flag ⇒ Object
Returns the value of attribute email_resource_flag.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def email_resource_flag @email_resource_flag end |
#expense_billable_flag ⇒ Object
Returns the value of attribute expense_billable_flag.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def expense_billable_flag @expense_billable_flag end |
#expense_invoice_flag ⇒ Object
Returns the value of attribute expense_invoice_flag.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def expense_invoice_flag @expense_invoice_flag end |
#hours_budget ⇒ Object
Returns the value of attribute hours_budget.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def hours_budget @hours_budget end |
#id ⇒ Object
Returns the value of attribute id.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def id @id end |
#impact ⇒ Object
Returns the value of attribute impact.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def impact @impact end |
#internal_analysis ⇒ Object
Returns the value of attribute internal_analysis.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def internal_analysis @internal_analysis end |
#item ⇒ Object
Returns the value of attribute item.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def item @item end |
#location ⇒ Object
Returns the value of attribute location.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def name @name end |
#override_flag ⇒ Object
Returns the value of attribute override_flag.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def override_flag @override_flag end |
#priority ⇒ Object
Returns the value of attribute priority.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def priority @priority end |
#problem ⇒ Object
Returns the value of attribute problem.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def problem @problem end |
#product_invoice_flag ⇒ Object
Returns the value of attribute product_invoice_flag.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def product_invoice_flag @product_invoice_flag end |
#purchase_order_number ⇒ Object
Returns the value of attribute purchase_order_number.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def purchase_order_number @purchase_order_number end |
#reference ⇒ Object
Returns the value of attribute reference.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def reference @reference end |
#restrict_downpayment_flag ⇒ Object
Returns the value of attribute restrict_downpayment_flag.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def restrict_downpayment_flag @restrict_downpayment_flag end |
#schedule_days_before ⇒ Object
Returns the value of attribute schedule_days_before.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def schedule_days_before @schedule_days_before end |
#service_days_before ⇒ Object
Returns the value of attribute service_days_before.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def service_days_before @service_days_before end |
#service_location ⇒ Object
Returns the value of attribute service_location.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def service_location @service_location end |
#severity ⇒ Object
Returns the value of attribute severity.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def severity @severity end |
#site ⇒ Object
Returns the value of attribute site.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def site @site end |
#source ⇒ Object
Returns the value of attribute source.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def source @source end |
#status ⇒ Object
Returns the value of attribute status.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def status @status end |
#subtype ⇒ Object
Returns the value of attribute subtype.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def subtype @subtype end |
#summary ⇒ Object
Returns the value of attribute summary.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def summary @summary end |
#team ⇒ Object
Returns the value of attribute team.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def team @team end |
#template_flag ⇒ Object
Returns the value of attribute template_flag.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def template_flag @template_flag end |
#time_billable_flag ⇒ Object
Returns the value of attribute time_billable_flag.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def time_billable_flag @time_billable_flag end |
#time_invoice_flag ⇒ Object
Returns the value of attribute time_invoice_flag.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def time_invoice_flag @time_invoice_flag end |
#type ⇒ Object
Returns the value of attribute type.
16 17 18 |
# File 'lib/connect_wise/models/service_template.rb', line 16 def type @type end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
94 95 96 |
# File 'lib/connect_wise/models/service_template.rb', line 94 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/connect_wise/models/service_template.rb', line 40 def self.attribute_map { id: :id, name: :name, board: :board, type: :type, item: :item, subtype: :subtype, service_location: :serviceLocation, status: :status, source: :source, priority: :priority, team: :team, company: :company, contact: :contact, site: :site, assigned_notify_flag: :assignedNotifyFlag, location: :location, department: :department, summary: :summary, problem: :problem, hours_budget: :hoursBudget, internal_analysis: :internalAnalysis, time_billable_flag: :timeBillableFlag, expense_billable_flag: :expenseBillableFlag, purchase_order_number: :purchaseOrderNumber, reference: :reference, bill_complete_flag: :billComplete_Flag, bill_service_separately_flag: :billServiceSeparatelyFlag, billing_amount: :billingAmount, bill_unapproved_time_and_expenses_flag: :billUnapprovedTimeAndExpensesFlag, override_flag: :overrideFlag, time_invoice_flag: :timeInvoiceFlag, expense_invoice_flag: :expenseInvoiceFlag, product_invoice_flag: :productInvoiceFlag, agreement: :agreement, billing_method: :billingMethod, severity: :severity, impact: :impact, assigned_by: :assignedBy, schedule_days_before: :scheduleDaysBefore, service_days_before: :serviceDaysBefore, attach_schedule_to_new_service_flag: :attachScheduleToNewServiceFlag, template_flag: :templateFlag, email_contact_flag: :emailContactFlag, email_resource_flag: :emailResourceFlag, email_cc_flag: :emailCCFlag, email_cc: :emailCC, restrict_downpayment_flag: :restrictDownpaymentFlag, _info: :_info } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
409 410 411 |
# File 'lib/connect_wise/models/service_template.rb', line 409 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
# File 'lib/connect_wise/models/service_template.rb', line 153 def self.openapi_nullable Set.new(%i[ assigned_notify_flag hours_budget time_billable_flag expense_billable_flag bill_complete_flag bill_service_separately_flag billing_amount bill_unapproved_time_and_expenses_flag override_flag time_invoice_flag expense_invoice_flag product_invoice_flag schedule_days_before service_days_before attach_schedule_to_new_service_flag template_flag email_contact_flag email_resource_flag email_cc_flag restrict_downpayment_flag ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 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 |
# File 'lib/connect_wise/models/service_template.rb', line 99 def self.openapi_types { id: :Integer, name: :String, board: :BoardReference, type: :ServiceTypeReference, item: :ServiceItemReference, subtype: :ServiceSubTypeReference, service_location: :ServiceLocationReference, status: :ServiceStatusReference, source: :ServiceSourceReference, priority: :PriorityReference, team: :ServiceTeamReference, company: :CompanyReference, contact: :ContactReference, site: :SiteReference, assigned_notify_flag: :Boolean, location: :SystemLocationReference, department: :SystemDepartmentReference, summary: :String, problem: :String, hours_budget: :Float, internal_analysis: :String, time_billable_flag: :Boolean, expense_billable_flag: :Boolean, purchase_order_number: :String, reference: :String, bill_complete_flag: :Boolean, bill_service_separately_flag: :Boolean, billing_amount: :Float, bill_unapproved_time_and_expenses_flag: :Boolean, override_flag: :Boolean, time_invoice_flag: :Boolean, expense_invoice_flag: :Boolean, product_invoice_flag: :Boolean, agreement: :AgreementReference, billing_method: :String, severity: :String, impact: :String, assigned_by: :MemberReference, schedule_days_before: :Integer, service_days_before: :Integer, attach_schedule_to_new_service_flag: :Boolean, template_flag: :Boolean, email_contact_flag: :Boolean, email_resource_flag: :Boolean, email_cc_flag: :Boolean, email_cc: :String, restrict_downpayment_flag: :Boolean, _info: :'Hash<String, String>' } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 |
# File 'lib/connect_wise/models/service_template.rb', line 340 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && name == other.name && board == other.board && type == other.type && item == other.item && subtype == other.subtype && service_location == other.service_location && status == other.status && source == other.source && priority == other.priority && team == other.team && company == other.company && contact == other.contact && site == other.site && assigned_notify_flag == other.assigned_notify_flag && location == other.location && department == other.department && summary == other.summary && problem == other.problem && hours_budget == other.hours_budget && internal_analysis == other.internal_analysis && time_billable_flag == other.time_billable_flag && expense_billable_flag == other.expense_billable_flag && purchase_order_number == other.purchase_order_number && reference == other.reference && bill_complete_flag == other.bill_complete_flag && bill_service_separately_flag == other.bill_service_separately_flag && billing_amount == other.billing_amount && bill_unapproved_time_and_expenses_flag == other.bill_unapproved_time_and_expenses_flag && override_flag == other.override_flag && time_invoice_flag == other.time_invoice_flag && expense_invoice_flag == other.expense_invoice_flag && product_invoice_flag == other.product_invoice_flag && agreement == other.agreement && billing_method == other.billing_method && severity == other.severity && impact == other.impact && assigned_by == other.assigned_by && schedule_days_before == other.schedule_days_before && service_days_before == other.service_days_before && attach_schedule_to_new_service_flag == other.attach_schedule_to_new_service_flag && template_flag == other.template_flag && email_contact_flag == other.email_contact_flag && email_resource_flag == other.email_resource_flag && email_cc_flag == other.email_cc_flag && email_cc == other.email_cc && restrict_downpayment_flag == other.restrict_downpayment_flag && _info == other._info end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 |
# File 'lib/connect_wise/models/service_template.rb', line 439 def _deserialize(type, value) case type.to_sym when :Time Time.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 # models (e.g. Pet) or oneOf klass = ConnectWise.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
510 511 512 513 514 515 516 517 518 519 520 521 522 |
# File 'lib/connect_wise/models/service_template.rb', line 510 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 |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 |
# File 'lib/connect_wise/models/service_template.rb', line 416 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) send("#{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 send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize(::Regexp.last_match(1), v) }) if attributes[self.class.attribute_map[key]].is_a?(Array) elsif !attributes[self.class.attribute_map[key]].nil? send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end |
#eql?(other) ⇒ Boolean
396 397 398 |
# File 'lib/connect_wise/models/service_template.rb', line 396 def eql?(other) self == other end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
402 403 404 |
# File 'lib/connect_wise/models/service_template.rb', line 402 def hash [id, name, board, type, item, subtype, service_location, status, source, priority, team, company, contact, site, assigned_notify_flag, location, department, summary, problem, hours_budget, internal_analysis, time_billable_flag, expense_billable_flag, purchase_order_number, reference, bill_complete_flag, bill_service_separately_flag, billing_amount, bill_unapproved_time_and_expenses_flag, override_flag, time_invoice_flag, expense_invoice_flag, product_invoice_flag, agreement, billing_method, severity, impact, assigned_by, schedule_days_before, service_days_before, attach_schedule_to_new_service_flag, template_flag, email_contact_flag, email_resource_flag, email_cc_flag, email_cc, restrict_downpayment_flag, _info].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
292 293 294 |
# File 'lib/connect_wise/models/service_template.rb', line 292 def list_invalid_properties [] end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
486 487 488 |
# File 'lib/connect_wise/models/service_template.rb', line 486 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
492 493 494 495 496 497 498 499 500 501 502 503 504 |
# File 'lib/connect_wise/models/service_template.rb', line 492 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = 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 |
#to_s ⇒ String
Returns the string representation of the object
480 481 482 |
# File 'lib/connect_wise/models/service_template.rb', line 480 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
298 299 300 301 302 303 304 305 306 307 308 309 |
# File 'lib/connect_wise/models/service_template.rb', line 298 def valid? billing_method_validator = EnumAttributeValidator.new('String', %w[ActualRates FixedFee NotToExceed OverrideRate]) return false unless billing_method_validator.valid?(@billing_method) severity_validator = EnumAttributeValidator.new('String', %w[Low Medium High]) return false unless severity_validator.valid?(@severity) impact_validator = EnumAttributeValidator.new('String', %w[Low Medium High]) return false unless impact_validator.valid?(@impact) true end |