1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 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
 92
 93
 94
 95
 96
 97
 98
 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
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
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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
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
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
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
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
// THIS IS A GENERATED FILE
// If anything in this file needs to be updated, it needs to be fixed in reso_dd_generator
use serde::{Deserialize, Serialize};

/// [ListingTerms Lookups](https://ddwiki.reso.org/display/DDW17/ListingTerms+Lookups)
#[derive(Debug, Clone, Eq, PartialEq)]
pub enum ListingTerms {
    /// "[1031 Exchange](https://ddwiki.reso.org/display/DDW17/1031+Exchange)": The seller is may be interested in a 1031 exchange as part of the sale.
    _1031Exchange,

    /// "[All Inclusive Trust Deed](https://ddwiki.reso.org/display/DDW17/All+Inclusive+Trust+Deed)": The property is under an all inclusive trust deed.
    AllInclusiveTrustDeed,

    /// "[Assumable](https://ddwiki.reso.org/pages/viewpage.action?pageId=29245384)": The seller is interested in assumable financing.
    Assumable,

    /// "[Cash](https://ddwiki.reso.org/pages/viewpage.action?pageId=29245385)": The seller would like a cash sale.
    Cash,

    /// "[Contract](https://ddwiki.reso.org/pages/viewpage.action?pageId=29245386)": The seller may be interested in an agreement to perform services, provide product, share of income, or some other agreement as the method of payment for the property.
    Contract,

    /// "[Conventional](https://ddwiki.reso.org/pages/viewpage.action?pageId=29245387)": The seller may accept a buyer using conventional financing to purchase the home.
    Conventional,

    /// "[Existing Bonds](https://ddwiki.reso.org/display/DDW17/Existing+Bonds)": The property for sale has existing bonds.
    ExistingBonds,

    /// "[FHA](https://ddwiki.reso.org/pages/viewpage.action?pageId=29245389)": The seller may accept a buyer with a loan from an approved provider that follows the guidelines of, and is insured by, the Federal Housing Administration.
    FHA,

    /// "[Land Use Fee](https://ddwiki.reso.org/display/DDW17/Land+Use+Fee)": The listed property has a land use fee.
    LandUseFee,

    /// "[Lease Back](https://ddwiki.reso.org/display/DDW17/Lease+Back)": The seller may be interested in the simultaneous sale of a property with a lease back to the seller, who then becomes the tenant.
    LeaseBack,

    /// "[Lease Option](https://ddwiki.reso.org/display/DDW17/Lease+Option)": The seller may be interested in selling as a lease option to the buyer.
    LeaseOption,

    /// "[Lease Purchase](https://ddwiki.reso.org/display/DDW17/Lease+Purchase)": The seller may be interested in selling as a lease purchase.
    LeasePurchase,

    /// "[Lien Release](https://ddwiki.reso.org/display/DDW17/Lien+Release)": The property for sale may require a lien release.
    LienRelease,

    /// "[Owner May Carry](https://ddwiki.reso.org/display/DDW17/Owner+May+Carry)": The seller may be interested in carrying the mortgage note.
    OwnerMayCarry,

    /// "[Owner Pay Points](https://ddwiki.reso.org/display/DDW17/Owner+Pay+Points)": The seller may carry points.
    OwnerPayPoints,

    /// "[Owner Will Carry](https://ddwiki.reso.org/display/DDW17/Owner+Will+Carry)": The seller will carry points.
    OwnerWillCarry,

    /// "[Private Financing Available](https://ddwiki.reso.org/display/DDW17/Private+Financing+Available)": Financing is provided by a private party.
    PrivateFinancingAvailable,

    /// "[Relocation Property](https://ddwiki.reso.org/display/DDW17/Relocation+Property)": The property for sale is a relocation property.
    RelocationProperty,

    /// "[Seller Equity Share](https://ddwiki.reso.org/display/DDW17/Seller+Equity+Share)": The seller may be interested in investing in an equity share.
    SellerEquityShare,

    /// "[Special Funding](https://ddwiki.reso.org/display/DDW17/Special+Funding)": The seller may be interested in a special funding arrangement.
    SpecialFunding,

    /// "[Submit](https://ddwiki.reso.org/display/DDW17/Submit)": Contact the listing agent for the listing terms.
    Submit,

    /// "[Trade](https://ddwiki.reso.org/display/DDW17/Trade)": The seller may be interested in a trade arrangement.
    Trade,

    /// "[Trust Conveyance](https://ddwiki.reso.org/display/DDW17/Trust+Conveyance)": A trust conveyance (to another trustee) may be involved in the sale of the property.
    TrustConveyance,

    /// "[Trust Deed](https://ddwiki.reso.org/pages/viewpage.action?pageId=29245405)": The seller may accept financing where title of the property is placed with a trustee who secures payment of the loan for a beneficiary.
    TrustDeed,

    /// "[USDA Loan](https://ddwiki.reso.org/display/DDW17/USDA+Loan)": The seller may accept a loan from an approved provider that follows the guidelines of, and is insured by, the US Department of Agriculture.
    USDALoan,

    /// "[VA Loan](https://ddwiki.reso.org/display/DDW17/VA+Loan)": The seller may accept a loan from an approved provider that follows the guidelines of, and is insured by, the US Department of Veteran's Affairs.
    VALoan,

    /// A value that was not defined by the enumeration
    OpenEnumeration(String),
}

impl crate::ResoEnumeration for ListingTerms {
    fn from_str(s: &str) -> ListingTerms {
        match s {
            "1031 Exchange" => ListingTerms::_1031Exchange,

            "All Inclusive Trust Deed" => ListingTerms::AllInclusiveTrustDeed,

            "Assumable" => ListingTerms::Assumable,

            "Cash" => ListingTerms::Cash,

            "Contract" => ListingTerms::Contract,

            "Conventional" => ListingTerms::Conventional,

            "Existing Bonds" => ListingTerms::ExistingBonds,

            "FHA" => ListingTerms::FHA,

            "Land Use Fee" => ListingTerms::LandUseFee,

            "Lease Back" => ListingTerms::LeaseBack,

            "Lease Option" => ListingTerms::LeaseOption,

            "Lease Purchase" => ListingTerms::LeasePurchase,

            "Lien Release" => ListingTerms::LienRelease,

            "Owner May Carry" => ListingTerms::OwnerMayCarry,

            "Owner Pay Points" => ListingTerms::OwnerPayPoints,

            "Owner Will Carry" => ListingTerms::OwnerWillCarry,

            "Private Financing Available" => ListingTerms::PrivateFinancingAvailable,

            "Relocation Property" => ListingTerms::RelocationProperty,

            "Seller Equity Share" => ListingTerms::SellerEquityShare,

            "Special Funding" => ListingTerms::SpecialFunding,

            "Submit" => ListingTerms::Submit,

            "Trade" => ListingTerms::Trade,

            "Trust Conveyance" => ListingTerms::TrustConveyance,

            "Trust Deed" => ListingTerms::TrustDeed,

            "USDA Loan" => ListingTerms::USDALoan,

            "VA Loan" => ListingTerms::VALoan,

            _ => ListingTerms::OpenEnumeration(s.into()),
        }
    }

    fn from_string(s: String) -> ListingTerms {
        match s.as_ref() {
            "1031 Exchange" => ListingTerms::_1031Exchange,

            "All Inclusive Trust Deed" => ListingTerms::AllInclusiveTrustDeed,

            "Assumable" => ListingTerms::Assumable,

            "Cash" => ListingTerms::Cash,

            "Contract" => ListingTerms::Contract,

            "Conventional" => ListingTerms::Conventional,

            "Existing Bonds" => ListingTerms::ExistingBonds,

            "FHA" => ListingTerms::FHA,

            "Land Use Fee" => ListingTerms::LandUseFee,

            "Lease Back" => ListingTerms::LeaseBack,

            "Lease Option" => ListingTerms::LeaseOption,

            "Lease Purchase" => ListingTerms::LeasePurchase,

            "Lien Release" => ListingTerms::LienRelease,

            "Owner May Carry" => ListingTerms::OwnerMayCarry,

            "Owner Pay Points" => ListingTerms::OwnerPayPoints,

            "Owner Will Carry" => ListingTerms::OwnerWillCarry,

            "Private Financing Available" => ListingTerms::PrivateFinancingAvailable,

            "Relocation Property" => ListingTerms::RelocationProperty,

            "Seller Equity Share" => ListingTerms::SellerEquityShare,

            "Special Funding" => ListingTerms::SpecialFunding,

            "Submit" => ListingTerms::Submit,

            "Trade" => ListingTerms::Trade,

            "Trust Conveyance" => ListingTerms::TrustConveyance,

            "Trust Deed" => ListingTerms::TrustDeed,

            "USDA Loan" => ListingTerms::USDALoan,

            "VA Loan" => ListingTerms::VALoan,

            _ => ListingTerms::OpenEnumeration(s),
        }
    }

    fn to_str(&self) -> &str {
        match self {
            ListingTerms::_1031Exchange => "1031 Exchange",

            ListingTerms::AllInclusiveTrustDeed => "All Inclusive Trust Deed",

            ListingTerms::Assumable => "Assumable",

            ListingTerms::Cash => "Cash",

            ListingTerms::Contract => "Contract",

            ListingTerms::Conventional => "Conventional",

            ListingTerms::ExistingBonds => "Existing Bonds",

            ListingTerms::FHA => "FHA",

            ListingTerms::LandUseFee => "Land Use Fee",

            ListingTerms::LeaseBack => "Lease Back",

            ListingTerms::LeaseOption => "Lease Option",

            ListingTerms::LeasePurchase => "Lease Purchase",

            ListingTerms::LienRelease => "Lien Release",

            ListingTerms::OwnerMayCarry => "Owner May Carry",

            ListingTerms::OwnerPayPoints => "Owner Pay Points",

            ListingTerms::OwnerWillCarry => "Owner Will Carry",

            ListingTerms::PrivateFinancingAvailable => "Private Financing Available",

            ListingTerms::RelocationProperty => "Relocation Property",

            ListingTerms::SellerEquityShare => "Seller Equity Share",

            ListingTerms::SpecialFunding => "Special Funding",

            ListingTerms::Submit => "Submit",

            ListingTerms::Trade => "Trade",

            ListingTerms::TrustConveyance => "Trust Conveyance",

            ListingTerms::TrustDeed => "Trust Deed",

            ListingTerms::USDALoan => "USDA Loan",

            ListingTerms::VALoan => "VA Loan",

            ListingTerms::OpenEnumeration(ref s) => s,
        }
    }

    fn into_string(self) -> String {
        match self {
            ListingTerms::_1031Exchange => "1031 Exchange".into(),

            ListingTerms::AllInclusiveTrustDeed => "All Inclusive Trust Deed".into(),

            ListingTerms::Assumable => "Assumable".into(),

            ListingTerms::Cash => "Cash".into(),

            ListingTerms::Contract => "Contract".into(),

            ListingTerms::Conventional => "Conventional".into(),

            ListingTerms::ExistingBonds => "Existing Bonds".into(),

            ListingTerms::FHA => "FHA".into(),

            ListingTerms::LandUseFee => "Land Use Fee".into(),

            ListingTerms::LeaseBack => "Lease Back".into(),

            ListingTerms::LeaseOption => "Lease Option".into(),

            ListingTerms::LeasePurchase => "Lease Purchase".into(),

            ListingTerms::LienRelease => "Lien Release".into(),

            ListingTerms::OwnerMayCarry => "Owner May Carry".into(),

            ListingTerms::OwnerPayPoints => "Owner Pay Points".into(),

            ListingTerms::OwnerWillCarry => "Owner Will Carry".into(),

            ListingTerms::PrivateFinancingAvailable => "Private Financing Available".into(),

            ListingTerms::RelocationProperty => "Relocation Property".into(),

            ListingTerms::SellerEquityShare => "Seller Equity Share".into(),

            ListingTerms::SpecialFunding => "Special Funding".into(),

            ListingTerms::Submit => "Submit".into(),

            ListingTerms::Trade => "Trade".into(),

            ListingTerms::TrustConveyance => "Trust Conveyance".into(),

            ListingTerms::TrustDeed => "Trust Deed".into(),

            ListingTerms::USDALoan => "USDA Loan".into(),

            ListingTerms::VALoan => "VA Loan".into(),

            ListingTerms::OpenEnumeration(s) => s,
        }
    }

    fn fallback_value(&self) -> Option<&str> {
        match self {
            ListingTerms::OpenEnumeration(ref s) => Some(s),
            _ => None,
        }
    }
}

impl From<String> for ListingTerms {
    fn from(s: String) -> ListingTerms {
        match s.as_ref() {
            "1031 Exchange" => ListingTerms::_1031Exchange,

            "All Inclusive Trust Deed" => ListingTerms::AllInclusiveTrustDeed,

            "Assumable" => ListingTerms::Assumable,

            "Cash" => ListingTerms::Cash,

            "Contract" => ListingTerms::Contract,

            "Conventional" => ListingTerms::Conventional,

            "Existing Bonds" => ListingTerms::ExistingBonds,

            "FHA" => ListingTerms::FHA,

            "Land Use Fee" => ListingTerms::LandUseFee,

            "Lease Back" => ListingTerms::LeaseBack,

            "Lease Option" => ListingTerms::LeaseOption,

            "Lease Purchase" => ListingTerms::LeasePurchase,

            "Lien Release" => ListingTerms::LienRelease,

            "Owner May Carry" => ListingTerms::OwnerMayCarry,

            "Owner Pay Points" => ListingTerms::OwnerPayPoints,

            "Owner Will Carry" => ListingTerms::OwnerWillCarry,

            "Private Financing Available" => ListingTerms::PrivateFinancingAvailable,

            "Relocation Property" => ListingTerms::RelocationProperty,

            "Seller Equity Share" => ListingTerms::SellerEquityShare,

            "Special Funding" => ListingTerms::SpecialFunding,

            "Submit" => ListingTerms::Submit,

            "Trade" => ListingTerms::Trade,

            "Trust Conveyance" => ListingTerms::TrustConveyance,

            "Trust Deed" => ListingTerms::TrustDeed,

            "USDA Loan" => ListingTerms::USDALoan,

            "VA Loan" => ListingTerms::VALoan,

            _ => ListingTerms::OpenEnumeration(s),
        }
    }
}

impl From<&str> for ListingTerms {
    fn from(s: &str) -> ListingTerms {
        match s {
            "1031 Exchange" => ListingTerms::_1031Exchange,

            "All Inclusive Trust Deed" => ListingTerms::AllInclusiveTrustDeed,

            "Assumable" => ListingTerms::Assumable,

            "Cash" => ListingTerms::Cash,

            "Contract" => ListingTerms::Contract,

            "Conventional" => ListingTerms::Conventional,

            "Existing Bonds" => ListingTerms::ExistingBonds,

            "FHA" => ListingTerms::FHA,

            "Land Use Fee" => ListingTerms::LandUseFee,

            "Lease Back" => ListingTerms::LeaseBack,

            "Lease Option" => ListingTerms::LeaseOption,

            "Lease Purchase" => ListingTerms::LeasePurchase,

            "Lien Release" => ListingTerms::LienRelease,

            "Owner May Carry" => ListingTerms::OwnerMayCarry,

            "Owner Pay Points" => ListingTerms::OwnerPayPoints,

            "Owner Will Carry" => ListingTerms::OwnerWillCarry,

            "Private Financing Available" => ListingTerms::PrivateFinancingAvailable,

            "Relocation Property" => ListingTerms::RelocationProperty,

            "Seller Equity Share" => ListingTerms::SellerEquityShare,

            "Special Funding" => ListingTerms::SpecialFunding,

            "Submit" => ListingTerms::Submit,

            "Trade" => ListingTerms::Trade,

            "Trust Conveyance" => ListingTerms::TrustConveyance,

            "Trust Deed" => ListingTerms::TrustDeed,

            "USDA Loan" => ListingTerms::USDALoan,

            "VA Loan" => ListingTerms::VALoan,

            _ => ListingTerms::OpenEnumeration(s.into()),
        }
    }
}

impl<'a> From<&'a ListingTerms> for &'a str {
    fn from(s: &'a ListingTerms) -> &'a str {
        match s {
            ListingTerms::_1031Exchange => "1031 Exchange",

            ListingTerms::AllInclusiveTrustDeed => "All Inclusive Trust Deed",

            ListingTerms::Assumable => "Assumable",

            ListingTerms::Cash => "Cash",

            ListingTerms::Contract => "Contract",

            ListingTerms::Conventional => "Conventional",

            ListingTerms::ExistingBonds => "Existing Bonds",

            ListingTerms::FHA => "FHA",

            ListingTerms::LandUseFee => "Land Use Fee",

            ListingTerms::LeaseBack => "Lease Back",

            ListingTerms::LeaseOption => "Lease Option",

            ListingTerms::LeasePurchase => "Lease Purchase",

            ListingTerms::LienRelease => "Lien Release",

            ListingTerms::OwnerMayCarry => "Owner May Carry",

            ListingTerms::OwnerPayPoints => "Owner Pay Points",

            ListingTerms::OwnerWillCarry => "Owner Will Carry",

            ListingTerms::PrivateFinancingAvailable => "Private Financing Available",

            ListingTerms::RelocationProperty => "Relocation Property",

            ListingTerms::SellerEquityShare => "Seller Equity Share",

            ListingTerms::SpecialFunding => "Special Funding",

            ListingTerms::Submit => "Submit",

            ListingTerms::Trade => "Trade",

            ListingTerms::TrustConveyance => "Trust Conveyance",

            ListingTerms::TrustDeed => "Trust Deed",

            ListingTerms::USDALoan => "USDA Loan",

            ListingTerms::VALoan => "VA Loan",

            ListingTerms::OpenEnumeration(s) => s,
        }
    }
}

impl Serialize for ListingTerms {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        serializer.serialize_str(self.into())
    }
}

impl<'de> Deserialize<'de> for ListingTerms {
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = String::deserialize(deserializer)?;
        Ok(From::from(s))
    }
}