lobbying_disclosure_client 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 443db2822b042a2ca0d0d0e1ee2f0a4013f8e707fca59befc559e149572d8205
4
- data.tar.gz: '028781104589d3694a4b22fe6dd612e99e9ae8b50aede4e1a3c7389ae97b4681'
3
+ metadata.gz: 9ef56bd4bb4f89141f44ded0eeccdd531005882e72af06fffad084b9ad62b3f0
4
+ data.tar.gz: 4cd03a84852857892ce05865f378ea1a79ae67d68b9ea04c9ca5cf6491beea02
5
5
  SHA512:
6
- metadata.gz: 4073fd1e091d6ffb15308a10fcfcb69c23b92f8b7f882d09aa49ab9932cf129e9b067a50393fca5ffe8a2b3e888a7fc89242b05102f1d1ab7ba1103e0b122bb8
7
- data.tar.gz: 8d2e685e8e48fd1e9e7fe7fc0d7a4763adbad7546d00c48a30140d9c254ced283bc09c2652a390ae6d75d615369476e630378d87aca141b047d2777c28397096
6
+ metadata.gz: 56f4f1ee68dd0d874483f734644ba70fd272dffc45f973e6b38c8799097760951bda9a5a693d69c075818bffee082cc015ad44f438c4b204d1c14fd6728ea8ad
7
+ data.tar.gz: 41003c572658ab2887540d25048620dd10a5d2443c6787fc6b9259c50be741c6ddf657afa826e15520a8f9a6c666060921b0de575120bf0d921b574426101fdb
data/.rubocop.yml CHANGED
@@ -24,7 +24,7 @@ Metrics/BlockLength:
24
24
  Naming/VariableNumber:
25
25
  Enabled: false
26
26
 
27
- RuboCopStyle/OptionalBooleanParameter:
27
+ Style/OptionalBooleanParameter:
28
28
  Enabled: false
29
29
 
30
30
  Metrics/CyclomaticComplexity:
@@ -39,6 +39,9 @@ Metrics/PerceivedComplexity:
39
39
  Layout/LineLength:
40
40
  Enabled: false
41
41
 
42
+ Style/IfUnlessModifier:
43
+ Enabled: false
44
+
42
45
  Sorbet/StrictSigil:
43
46
  Enabled: true
44
47
  Exclude:
@@ -4,6 +4,9 @@
4
4
  module LobbyingDisclosureClient
5
5
  module Enums
6
6
  class ContributionType < T::Enum
7
+ extend T::Sig
8
+ include LobbyingDisclosureClient::Interfaces::ValidatableEnum
9
+
7
10
  enums do
8
11
  Feca = new('feca')
9
12
  HonoraryExpenses = new('he')
@@ -11,6 +14,21 @@ module LobbyingDisclosureClient
11
14
  PresidentialLibraryExpenses = new('ple')
12
15
  PresidentialInauguralCommittee = new('pic')
13
16
  end
17
+
18
+ sig do
19
+ override.returns(String)
20
+ end
21
+ def name
22
+ case self
23
+ when Feca then 'FECA'
24
+ when HonoraryExpenses then 'Honorary Expenses'
25
+ when MeetingExpenses then 'Meeting Expenses'
26
+ when PresidentialLibraryExpenses then 'Presidential Library Expenses'
27
+ when PresidentialInauguralCommittee then 'Presidential Inaugural Committee'
28
+ else
29
+ T.absurd(self)
30
+ end
31
+ end
14
32
  end
15
33
  end
16
34
  end
@@ -4,6 +4,9 @@
4
4
  module LobbyingDisclosureClient
5
5
  module Enums
6
6
  class Country < T::Enum
7
+ extend T::Sig
8
+ include LobbyingDisclosureClient::Interfaces::ValidatableEnum
9
+
7
10
  enums do
8
11
  Us = new('US')
9
12
  Ca = new('CA')
@@ -264,6 +267,267 @@ module LobbyingDisclosureClient
264
267
  # but empirically it does get returned by other endpoints
265
268
  Blank = new('')
266
269
  end
270
+
271
+ sig do
272
+ override.returns(String)
273
+ end
274
+ def name
275
+ case self
276
+ when Ad then 'Andorra'
277
+ when Ae then 'United Arab Emirates'
278
+ when Af then 'Afghanistan'
279
+ when Ag then 'Antigua and Barbuda'
280
+ when Ai then 'Anguilla'
281
+ when Al then 'Albania'
282
+ when Am then 'Armenia'
283
+ when Ao then 'Angola'
284
+ when Aq then 'Antarctica'
285
+ when Ar then 'Argentina'
286
+ when As then 'American Samoa'
287
+ when At then 'Austria'
288
+ when Au then 'Australia'
289
+ when Aw then 'Aruba'
290
+ when Ax then 'Åland Islands'
291
+ when Az then 'Azerbaijan'
292
+ when Ba then 'Bosnia and Herzegovina'
293
+ when Bb then 'Barbados'
294
+ when Bd then 'Bangladesh'
295
+ when Be then 'Belgium'
296
+ when Bf then 'Burkina Faso'
297
+ when Bg then 'Bulgaria'
298
+ when Bh then 'Bahrain'
299
+ when Bi then 'Burundi'
300
+ when Bj then 'Benin'
301
+ when Bl then 'Saint Barthélemy'
302
+ when Bm then 'Bermuda'
303
+ when Bn then 'Brunei'
304
+ when Bo then 'Bolivia'
305
+ when Bq then 'Bonaire, Sint Eustatius and Saba'
306
+ when Br then 'Brazil'
307
+ when Bs then 'Bahamas'
308
+ when Bt then 'Bhutan'
309
+ when Bv then 'Bouvet Island'
310
+ when Bw then 'Botswana'
311
+ when By then 'Belarus'
312
+ when Bz then 'Belize'
313
+ when Ca then 'Canada'
314
+ when Cc then 'Cocos (Keeling) Islands'
315
+ when Cd then 'Congo (the Democratic Republic of the)'
316
+ when Cf then 'Central African Republic'
317
+ when Cg then 'Congo'
318
+ when Ch then 'Switzerland'
319
+ when Ci then "Côte d'Ivoire"
320
+ when Ck then 'Cook Islands'
321
+ when Cl then 'Chile'
322
+ when Cm then 'Cameroon'
323
+ when Cn then 'China'
324
+ when Co then 'Colombia'
325
+ when Cr then 'Costa Rica'
326
+ when Cu then 'Cuba'
327
+ when Cv then 'Cabo Verde'
328
+ when Cw then 'Curaçao'
329
+ when Cx then 'Christmas Island'
330
+ when Cy then 'Cyprus'
331
+ when Cz then 'Czechia'
332
+ when De then 'Germany'
333
+ when Dj then 'Djibouti'
334
+ when Dk then 'Denmark'
335
+ when Dm then 'Dominica'
336
+ when Do then 'Dominican Republic'
337
+ when Dz then 'Algeria'
338
+ when Ec then 'Ecuador'
339
+ when Ee then 'Estonia'
340
+ when Eg then 'Egypt'
341
+ when Eh then 'Western Sahara'
342
+ when Er then 'Eritrea'
343
+ when Es then 'Spain'
344
+ when Et then 'Ethiopia'
345
+ when Fi then 'Finland'
346
+ when Fj then 'Fiji'
347
+ when Fk then 'Falkland Islands (Malvinas)'
348
+ when Fm then 'Micronesia (Federated States of)'
349
+ when Fo then 'Faroe Islands'
350
+ when Fr then 'France'
351
+ when Ga then 'Gabon'
352
+ when Gb then 'United Kingdom'
353
+ when Gd then 'Grenada'
354
+ when Ge then 'Georgia'
355
+ when Gf then 'French Guiana'
356
+ when Gg then 'Guernsey'
357
+ when Gh then 'Ghana'
358
+ when Gi then 'Gibraltar'
359
+ when Gl then 'Greenland'
360
+ when Gm then 'Gambia'
361
+ when Gn then 'Guinea'
362
+ when Gp then 'Guadeloupe'
363
+ when Gq then 'Equatorial Guinea'
364
+ when Gr then 'Greece'
365
+ when Gs then 'South Georgia and the South Sandwich Islands'
366
+ when Gt then 'Guatemala'
367
+ when Gu then 'Guam'
368
+ when Gw then 'Guinea-Bissau'
369
+ when Gy then 'Guyana'
370
+ when Hk then 'Hong Kong'
371
+ when Hm then 'Heard Island and McDonald Islands'
372
+ when Hn then 'Honduras'
373
+ when Hr then 'Croatia'
374
+ when Ht then 'Haiti'
375
+ when Hu then 'Hungary'
376
+ when Id then 'Indonesia'
377
+ when Ie then 'Ireland'
378
+ when Il then 'Israel'
379
+ when Im then 'Isle of Man'
380
+ when In then 'India'
381
+ when Io then 'British Indian Ocean Territory'
382
+ when Iq then 'Iraq'
383
+ when Ir then 'Iran'
384
+ when Is then 'Iceland'
385
+ when It then 'Italy'
386
+ when Je then 'Jersey'
387
+ when Jm then 'Jamaica'
388
+ when Jo then 'Jordan'
389
+ when Jp then 'Japan'
390
+ when Ke then 'Kenya'
391
+ when Kg then 'Kyrgyzstan'
392
+ when Kh then 'Cambodia'
393
+ when Ki then 'Kiribati'
394
+ when Km then 'Comoros'
395
+ when Kn then 'Saint Kitts and Nevis'
396
+ when Kp then 'North Korea'
397
+ when Kr then 'South Korea'
398
+ when Kw then 'Kuwait'
399
+ when Ky then 'Cayman Islands'
400
+ when Kz then 'Kazakhstan'
401
+ when La then 'Laos'
402
+ when Lb then 'Lebanon'
403
+ when Lc then 'Saint Lucia'
404
+ when Li then 'Liechtenstein'
405
+ when Lk then 'Sri Lanka'
406
+ when Lr then 'Liberia'
407
+ when Ls then 'Lesotho'
408
+ when Lt then 'Lithuania'
409
+ when Lu then 'Luxembourg'
410
+ when Lv then 'Latvia'
411
+ when Ly then 'Libya'
412
+ when Ma then 'Morocco'
413
+ when Mc then 'Monaco'
414
+ when Md then 'Moldova'
415
+ when Me then 'Montenegro'
416
+ when Mf then 'Saint Martin (French part)'
417
+ when Mg then 'Madagascar'
418
+ when Mh then 'Marshall Islands'
419
+ when Mk then 'North Macedonia'
420
+ when Ml then 'Mali'
421
+ when Mm then 'Myanmar'
422
+ when Mn then 'Mongolia'
423
+ when Mo then 'Macao'
424
+ when Mp then 'Northern Mariana Islands'
425
+ when Mq then 'Martinique'
426
+ when Mr then 'Mauritania'
427
+ when Ms then 'Montserrat'
428
+ when Mt then 'Malta'
429
+ when Mu then 'Mauritius'
430
+ when Mv then 'Maldives'
431
+ when Mw then 'Malawi'
432
+ when Mx then 'Mexico'
433
+ when My then 'Malaysia'
434
+ when Mz then 'Mozambique'
435
+ when Na then 'Namibia'
436
+ when Nc then 'New Caledonia'
437
+ when Ne then 'Niger'
438
+ when Nf then 'Norfolk Island'
439
+ when Ng then 'Nigeria'
440
+ when Ni then 'Nicaragua'
441
+ when Nl then 'Netherlands'
442
+ when No then 'Norway'
443
+ when Np then 'Nepal'
444
+ when Nr then 'Nauru'
445
+ when Nu then 'Niue'
446
+ when Nz then 'New Zealand'
447
+ when Om then 'Oman'
448
+ when Pa then 'Panama'
449
+ when Pe then 'Peru'
450
+ when Pf then 'French Polynesia'
451
+ when Pg then 'Papua New Guinea'
452
+ when Ph then 'Philippines'
453
+ when Pk then 'Pakistan'
454
+ when Pl then 'Poland'
455
+ when Pm then 'Saint Pierre and Miquelon'
456
+ when Pn then 'Pitcairn'
457
+ when Pr then 'Puerto Rico'
458
+ when Ps then 'Palestine, State of'
459
+ when Pt then 'Portugal'
460
+ when Pw then 'Palau'
461
+ when Py then 'Paraguay'
462
+ when Qa then 'Qatar'
463
+ when Re then 'Réunion'
464
+ when Ro then 'Romania'
465
+ when Rs then 'Serbia'
466
+ when Ru then 'Russia'
467
+ when Rw then 'Rwanda'
468
+ when Sa then 'Saudi Arabia'
469
+ when Sb then 'Solomon Islands'
470
+ when Sc then 'Seychelles'
471
+ when Sd then 'Sudan'
472
+ when Se then 'Sweden'
473
+ when Sg then 'Singapore'
474
+ when Sh then 'Saint Helena, Ascension and Tristan da Cunha'
475
+ when Si then 'Slovenia'
476
+ when Sj then 'Svalbard and Jan Mayen'
477
+ when Sk then 'Slovakia'
478
+ when Sl then 'Sierra Leone'
479
+ when Sm then 'San Marino'
480
+ when Sn then 'Senegal'
481
+ when So then 'Somalia'
482
+ when Sr then 'Suriname'
483
+ when Ss then 'South Sudan'
484
+ when St then 'Sao Tome and Principe'
485
+ when Sv then 'El Salvador'
486
+ when Sx then 'Sint Maarten (Dutch part)'
487
+ when Sy then 'Syria'
488
+ when Sz then 'Eswatini'
489
+ when Tc then 'Turks and Caicos Islands'
490
+ when Td then 'Chad'
491
+ when Tf then 'French Southern Territories'
492
+ when Tg then 'Togo'
493
+ when Th then 'Thailand'
494
+ when Tj then 'Tajikistan'
495
+ when Tk then 'Tokelau'
496
+ when Tl then 'Timor-Leste'
497
+ when Tm then 'Turkmenistan'
498
+ when Tn then 'Tunisia'
499
+ when To then 'Tonga'
500
+ when Tr then 'Türkiye'
501
+ when Tt then 'Trinidad and Tobago'
502
+ when Tv then 'Tuvalu'
503
+ when Tw then 'Taiwan'
504
+ when Tz then 'Tanzania'
505
+ when Ua then 'Ukraine'
506
+ when Ug then 'Uganda'
507
+ when Um then 'United States Minor Outlying Islands'
508
+ when Us then 'United States of America'
509
+ when Uy then 'Uruguay'
510
+ when Uz then 'Uzbekistan'
511
+ when Va then 'Holy See'
512
+ when Vc then 'Saint Vincent and the Grenadines'
513
+ when Ve then 'Venezuela'
514
+ when Vg then 'Virgin Islands (British)'
515
+ when Vi then 'Virgin Islands (U.S.)'
516
+ when Vn then 'Vietnam'
517
+ when Vu then 'Vanuatu'
518
+ when Wf then 'Wallis and Futuna'
519
+ when Ws then 'Samoa'
520
+ when Xk then 'Kosovo'
521
+ when Ye then 'Yemen'
522
+ when Yt then 'Mayotte'
523
+ when Za then 'South Africa'
524
+ when Zm then 'Zambia'
525
+ when Zw then 'Zimbabwe'
526
+ when ZeroZero, Blank then '* Undetermined'
527
+ else
528
+ T.absurd(self)
529
+ end
530
+ end
267
531
  end
268
532
  end
269
533
  end
@@ -4,6 +4,9 @@
4
4
  module LobbyingDisclosureClient
5
5
  module Enums
6
6
  class FilingType < T::Enum
7
+ extend T::Sig
8
+ include LobbyingDisclosureClient::Interfaces::ValidatableEnum
9
+
7
10
  enums do
8
11
  Registration = new('RR')
9
12
  RegistrationAmendment = new('RA')
@@ -56,6 +59,66 @@ module LobbyingDisclosureClient
56
59
  YearEndTerminationAmendment = new('Y@')
57
60
  YearEndTerminationAmendmentNoActivity = new('Y@Y')
58
61
  end
62
+
63
+ sig do
64
+ override.returns(String)
65
+ end
66
+ def name
67
+ case self
68
+ when Registration then 'Registration'
69
+ when RegistrationAmendment then 'Registration - Amendment'
70
+ when FirstQuarterReport then '1st Quarter - Report'
71
+ when FirstQuarterReportNoActivity then '1st Quarter - Report (No Activity)'
72
+ when FirstQuarterTermination then '1st Quarter - Termination'
73
+ when FirstQuarterTerminationNoActivity then '1st Quarter - Termination (No Activity)'
74
+ when FirstQuarterAmendment then '1st Quarter - Amendment'
75
+ when FirstQuarterAmendmentNoActivity then '1st Quarter - Amendment (No Activity)'
76
+ when FirstQuarterTerminationAmendment then '1st Quarter - Termination Amendment'
77
+ when FirstQuarterTerminationAmendmentNoActivity then '1st Quarter - Termination Amendment (No Activity)'
78
+ when SecondQuarterReport then '2nd Quarter - Report'
79
+ when SecondQuarterReportNoActivity then '2nd Quarter - Report (No Activity)'
80
+ when SecondQuarterTermination then '2nd Quarter - Termination'
81
+ when SecondQuarterTerminationNoActivity then '2nd Quarter - Termination (No Activity)'
82
+ when SecondQuarterAmendment then '2nd Quarter - Amendment'
83
+ when SecondQuarterAmendmentNoActivity then '2nd Quarter - Amendment (No Activity)'
84
+ when SecondQuarterTerminationAmendment then '2nd Quarter - Termination Amendment'
85
+ when SecondQuarterTerminationAmendmentNoActivity then '2nd Quarter - Termination Amendment (No Activity)'
86
+ when ThirdQuarterReport then '3rd Quarter - Report'
87
+ when ThirdQuarterReportNoActivity then '3rd Quarter - Report (No Activity)'
88
+ when ThirdQuarterTermination then '3rd Quarter - Termination'
89
+ when ThirdQuarterTerminationNoActivity then '3rd Quarter - Termination (No Activity)'
90
+ when ThirdQuarterAmendment then '3rd Quarter - Amendment'
91
+ when ThirdQuarterAmendmentNoActivity then '3rd Quarter - Amendment (No Activity)'
92
+ when ThirdQuarterTerminationAmendment then '3rd Quarter - Termination Amendment'
93
+ when ThirdQuarterTerminationAmendmentNoActivity then '3rd Quarter - Termination Amendment (No Activity)'
94
+ when FourthQuarterReport then '4th Quarter - Report'
95
+ when FourthQuarterReportNoActivity then '4th Quarter - Report (No Activity)'
96
+ when FourthQuarterTermination then '4th Quarter - Termination'
97
+ when FourthQuarterTerminationNoActivity then '4th Quarter - Termination (No Activity)'
98
+ when FourthQuarterAmendment then '4th Quarter - Amendment'
99
+ when FourthQuarterAmendmentNoActivity then '4th Quarter - Amendment (No Activity)'
100
+ when FourthQuarterTerminationAmendment then '4th Quarter - Termination Amendment'
101
+ when FourthQuarterTerminationAmendmentNoActivity then '4th Quarter - Termination Amendment (No Activity)'
102
+ when MidYearReport then 'Mid-Year Report'
103
+ when MidYearReportNoActivity then 'Mid-Year Report (No Activity)'
104
+ when MidYearTermination then 'Mid-Year Termination'
105
+ when MidYearTerminationNoActivity then 'Mid-Year Termination (No Activity)'
106
+ when MidYearAmendment then 'Mid-Year Amendment'
107
+ when MidYearAmendmentNoActivity then 'Mid-Year Amendment (No Activity)'
108
+ when MidYearTerminationAmendment then 'Mid-Year Termination Amendment'
109
+ when MidYearTerminationAmendmentNoActivity then 'Mid-Year Termination Amendment (No Activity)'
110
+ when YearEndReport then 'Year-End Report'
111
+ when YearEndReportNoActivity then 'Year-End Report (No Activity)'
112
+ when YearEndTermination then 'Year-End Termination'
113
+ when YearEndTerminationNoActivity then 'Year-End Termination (No Activity)'
114
+ when YearEndAmendment then 'Year-End Amendment'
115
+ when YearEndAmendmentNoActivity then 'Year-End Amendment (No Activity)'
116
+ when YearEndTerminationAmendment then 'Year-End Termination Amendment'
117
+ when YearEndTerminationAmendmentNoActivity then 'Year-End Termination Amendment (No Activity)'
118
+ else
119
+ T.absurd(self)
120
+ end
121
+ end
59
122
  end
60
123
  end
61
124
  end
@@ -4,6 +4,9 @@
4
4
  module LobbyingDisclosureClient
5
5
  module Enums
6
6
  class GeneralIssueCode < T::Enum
7
+ extend T::Sig
8
+ include LobbyingDisclosureClient::Interfaces::ValidatableEnum
9
+
7
10
  enums do
8
11
  Acc = new('ACC')
9
12
  Adv = new('ADV')
@@ -85,6 +88,95 @@ module LobbyingDisclosureClient
85
88
  Was = new('WAS')
86
89
  Wel = new('WEL')
87
90
  end
91
+
92
+ sig do
93
+ override.returns(String)
94
+ end
95
+ def name
96
+ case self
97
+ when Acc then 'Accounting'
98
+ when Adv then 'Advertising'
99
+ when Aer then 'Aerospace'
100
+ when Agr then 'Agriculture'
101
+ when Alc then 'Alcohol and Drug Abuse'
102
+ when Ani then 'Animals'
103
+ when App then 'Apparel/Clothing Industry/Textiles'
104
+ when Art then 'Arts/Entertainment'
105
+ when Aut then 'Automotive Industry'
106
+ when Avi then 'Aviation/Airlines/Airports'
107
+ when Ban then 'Banking'
108
+ when Bnk then 'Bankruptcy'
109
+ when Bev then 'Beverage Industry'
110
+ when Bud then 'Budget/Appropriations'
111
+ when Civ then 'Civil Rights/Civil Liberties'
112
+ when Chm then 'Chemicals/Chemical Industry'
113
+ when Caw then 'Clean Air and Water (quality)'
114
+ when Cdt then 'Commodities (big ticket)'
115
+ when Com then 'Communications/Broadcasting/Radio/TV'
116
+ when Cpi then 'Computer Industry'
117
+ when Con then 'Constitution'
118
+ when Csp then 'Consumer Issues/Safety/Products'
119
+ when Cpt then 'Copyright/Patent/Trademark'
120
+ when Def then 'Defense'
121
+ when Dis then 'Disaster Planning/Emergencies'
122
+ when Doc then 'District of Columbia'
123
+ when Ecn then 'Economics/Economic Development'
124
+ when Edu then 'Education'
125
+ when Eng then 'Energy/Nuclear'
126
+ when Env then 'Environment/Superfund'
127
+ when Fam then 'Family issues/Abortion/Adoption'
128
+ when Fin then 'Financial Institutions/Investments/Securities'
129
+ when Fir then 'Firearms/Guns/Ammunition'
130
+ when Foo then 'Food Industry (safety, labeling, etc.)'
131
+ when For then 'Foreign Relations'
132
+ when Fue then 'Fuel/Gas/Oil'
133
+ when Gam then 'Gaming/Gambling/Casino'
134
+ when Gov then 'Government Issues'
135
+ when Hcr then 'Health Issues'
136
+ when Hom then 'Homeland Security'
137
+ when Hou then 'Housing'
138
+ when Imm then 'Immigration'
139
+ when Ind then 'Indian/Native American Affairs'
140
+ when Ins then 'Insurance'
141
+ when Int then 'Intelligence'
142
+ when Lbr then 'Labor Issues/Antitrust/Workplace'
143
+ when Law then 'Law Enforcement/Crime/Criminal Justice'
144
+ when Man then 'Manufacturing'
145
+ when Mar then 'Marine/Maritime/Boating/Fisheries'
146
+ when Mia then 'Media (information/publishing)'
147
+ when Med then 'Medical/Disease Research/Clinical Labs'
148
+ when Mmm then 'Medicare/Medicaid'
149
+ when Mon then 'Minting/Money/Gold Standard'
150
+ when Nat then 'Natural Resources'
151
+ when Pha then 'Pharmacy'
152
+ when Pos then 'Postal'
153
+ when Rrr then 'Railroads'
154
+ when Res then 'Real Estate/Land Use/Conservation'
155
+ when Rel then 'Religion'
156
+ when Ret then 'Retirement'
157
+ when Rod then 'Roads/Highway'
158
+ when Sci then 'Science/Technology'
159
+ when Smb then 'Small Business'
160
+ when Spo then 'Sports/Athletics'
161
+ when Tar then 'Tariff (miscellaneous tariff bills)'
162
+ when Tax then 'Taxation/Internal Revenue Code'
163
+ when Tec then 'Telecommunications'
164
+ when Tob then 'Tobacco'
165
+ when Tor then 'Torts'
166
+ when Trd then 'Trade (domestic/foreign)'
167
+ when Tra then 'Transportation'
168
+ when Tou then 'Travel/Tourism'
169
+ when Tru then 'Trucking/Shipping'
170
+ when Urb then 'Urban Development/Municipalities'
171
+ when Unm then 'Unemployment'
172
+ when Uti then 'Utilities'
173
+ when Vet then 'Veterans'
174
+ when Was then 'Waste (hazardous/solid/interstate/nuclear)'
175
+ when Wel then 'Welfare'
176
+ else
177
+ T.absurd(self)
178
+ end
179
+ end
88
180
  end
89
181
  end
90
182
  end
@@ -4,6 +4,9 @@
4
4
  module LobbyingDisclosureClient
5
5
  module Enums
6
6
  class Prefix < T::Enum
7
+ extend T::Sig
8
+ include LobbyingDisclosureClient::Interfaces::ValidatableEnum
9
+
7
10
  enums do
8
11
  Dr = new('dr')
9
12
  Mr = new('mr')
@@ -13,6 +16,23 @@ module LobbyingDisclosureClient
13
16
  Ptr = new('ptr')
14
17
  Rev = new('rev')
15
18
  end
19
+
20
+ sig do
21
+ override.returns(String)
22
+ end
23
+ def name
24
+ case self
25
+ when Dr then 'DR.'
26
+ when Mr then 'MR.'
27
+ when Mrs then 'MRS.'
28
+ when Ms then 'MS.'
29
+ when Mx then 'MX.'
30
+ when Ptr then 'PTR.'
31
+ when Rev then 'REV.'
32
+ else
33
+ T.absurd(self)
34
+ end
35
+ end
16
36
  end
17
37
  end
18
38
  end
@@ -4,6 +4,9 @@
4
4
  module LobbyingDisclosureClient
5
5
  module Enums
6
6
  class State < T::Enum
7
+ extend T::Sig
8
+ include LobbyingDisclosureClient::Interfaces::ValidatableEnum
9
+
7
10
  enums do
8
11
  Al = new('AL')
9
12
  Ak = new('AK')
@@ -66,6 +69,75 @@ module LobbyingDisclosureClient
66
69
  Pr = new('PR')
67
70
  Vi = new('VI')
68
71
  end
72
+
73
+ sig do
74
+ override.returns(String)
75
+ end
76
+ def name
77
+ case self
78
+ when Al then 'Alabama'
79
+ when Ak then 'Alaska'
80
+ when As then 'American Samoa'
81
+ when Az then 'Arizona'
82
+ when Ar then 'Arkansas'
83
+ when Aa then 'Armed Forces Americas'
84
+ when Ae then 'Armed Forces Europe'
85
+ when Ap then 'Armed Forces Pacific'
86
+ when Ca then 'California'
87
+ when Co then 'Colorado'
88
+ when Ct then 'Connecticut'
89
+ when De then 'Delaware'
90
+ when Dc then 'District of Columbia'
91
+ when Fl then 'Florida'
92
+ when Ga then 'Georgia'
93
+ when Gu then 'Guam'
94
+ when Hi then 'Hawaii'
95
+ when Id then 'Idaho'
96
+ when Il then 'Illinois'
97
+ when In then 'Indiana'
98
+ when Ia then 'Iowa'
99
+ when Ks then 'Kansas'
100
+ when Ky then 'Kentucky'
101
+ when La then 'Louisiana'
102
+ when Me then 'Maine'
103
+ when Md then 'Maryland'
104
+ when Ma then 'Massachusetts'
105
+ when Mi then 'Michigan'
106
+ when Mn then 'Minnesota'
107
+ when Ms then 'Mississippi'
108
+ when Mo then 'Missouri'
109
+ when Mt then 'Montana'
110
+ when Ne then 'Nebraska'
111
+ when Nv then 'Nevada'
112
+ when Nh then 'New Hampshire'
113
+ when Nj then 'New Jersey'
114
+ when Nm then 'New Mexico'
115
+ when Ny then 'New York'
116
+ when Nc then 'North Carolina'
117
+ when Nd then 'North Dakota'
118
+ when Mp then 'Northern Mariana Islands'
119
+ when Oh then 'Ohio'
120
+ when Ok then 'Oklahoma'
121
+ when Or then 'Oregon'
122
+ when Pa then 'Pennsylvania'
123
+ when Pr then 'Puerto Rico'
124
+ when Ri then 'Rhode Island'
125
+ when Sc then 'South Carolina'
126
+ when Sd then 'South Dakota'
127
+ when Tn then 'Tennessee'
128
+ when Tx then 'Texas'
129
+ when Ut then 'Utah'
130
+ when Vt then 'Vermont'
131
+ when Vi then 'Virgin Islands'
132
+ when Va then 'Virginia'
133
+ when Wa then 'Washington'
134
+ when Wv then 'West Virginia'
135
+ when Wi then 'Wisconsin'
136
+ when Wy then 'Wyoming'
137
+ else
138
+ T.absurd(self)
139
+ end
140
+ end
69
141
  end
70
142
  end
71
143
  end
@@ -4,6 +4,9 @@
4
4
  module LobbyingDisclosureClient
5
5
  module Enums
6
6
  class Suffix < T::Enum
7
+ extend T::Sig
8
+ include LobbyingDisclosureClient::Interfaces::ValidatableEnum
9
+
7
10
  enums do
8
11
  Jr = new('jr')
9
12
  Sr = new('sr')
@@ -29,6 +32,39 @@ module LobbyingDisclosureClient
29
32
  Pe = new('pe')
30
33
  Phd = new('phd')
31
34
  end
35
+
36
+ sig do
37
+ override.returns(String)
38
+ end
39
+ def name
40
+ case self
41
+ when Jr then 'JR'
42
+ when Sr then 'SR'
43
+ when I then 'I'
44
+ when Ii then 'II'
45
+ when Iii then 'III'
46
+ when Iv then 'IV'
47
+ when V then 'V'
48
+ when Cae then 'CAE'
49
+ when Dvm then 'DVM'
50
+ when Dmd then 'DMD'
51
+ when Dppd then 'DPPD'
52
+ when Edd then 'EDD'
53
+ when Esq then 'ESQ'
54
+ when Jd then 'JD'
55
+ when Md then 'MD'
56
+ when Ma then 'MA'
57
+ when Med then 'MED'
58
+ when Mhsa then 'MHSA'
59
+ when Mph then 'MPH'
60
+ when Od then 'OD'
61
+ when Pa then 'PA'
62
+ when Pe then 'PE'
63
+ when Phd then 'PHD'
64
+ else
65
+ T.absurd(self)
66
+ end
67
+ end
32
68
  end
33
69
  end
34
70
  end
@@ -0,0 +1,28 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ module Interfaces
6
+ module ListEndpointInput
7
+ extend T::Helpers
8
+ extend T::Sig
9
+
10
+ interface!
11
+
12
+ sig do
13
+ abstract.returns(T.nilable(String))
14
+ end
15
+ def ordering; end
16
+
17
+ sig do
18
+ abstract.returns(T.nilable(Integer))
19
+ end
20
+ def page; end
21
+
22
+ sig do
23
+ abstract.returns(T.nilable(Integer))
24
+ end
25
+ def page_size; end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,33 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ module Interfaces
6
+ module ListEndpointOutput
7
+ extend T::Generic
8
+ extend T::Sig
9
+
10
+ interface!
11
+
12
+ sig do
13
+ abstract.returns(Integer)
14
+ end
15
+ def count; end
16
+
17
+ sig do
18
+ abstract.returns(T.nilable(String))
19
+ end
20
+ def next; end
21
+
22
+ sig do
23
+ abstract.returns(T.nilable(String))
24
+ end
25
+ def previous; end
26
+
27
+ sig do
28
+ abstract.returns(T::Array[T.untyped])
29
+ end
30
+ def results; end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,18 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ module Interfaces
6
+ module ValidatableEnum
7
+ extend T::Generic
8
+ extend T::Sig
9
+
10
+ interface!
11
+
12
+ sig do
13
+ abstract.returns(String)
14
+ end
15
+ def name; end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,7 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ module Interfaces
6
+ end
7
+ end
@@ -32,7 +32,7 @@ module LobbyingDisclosureClient
32
32
  const :registrant_country, String
33
33
  const :registrant_different_address, T.nilable(T::Boolean)
34
34
  const :registrant_ppb_country, T.nilable(String)
35
- const :registrant_state, LobbyingDisclosureClient::Enums::State
35
+ const :registrant_state, T.nilable(LobbyingDisclosureClient::Enums::State)
36
36
  const :registrant_zip, T.nilable(String)
37
37
  const :termination_date, T.nilable(Date)
38
38
  const :url, String
@@ -92,11 +92,18 @@ module LobbyingDisclosureClient
92
92
 
93
93
  puts "Validating #{enum_klass.name} against the live API..."
94
94
 
95
+ api_result = api_klass.call
96
+
95
97
  serialized_enum_values = enum_klass.values.map(&:serialize)
96
- api_values = api_klass.call.map(&:value)
98
+ api_values = api_result.map(&:value)
97
99
 
98
100
  values_missing_from_enum = api_values - serialized_enum_values
99
101
  extra_values_in_enum = serialized_enum_values - api_values - (VALUES_RETURNED_BY_API_EMPIRICALLY_BUT_NOT_INCLUDED_IN_CONSTANTS_ENDPOINTS[enum_klass] || [])
102
+ values_where_human_readable_name_does_not_match_api = api_result.reject do |constant|
103
+ T.unsafe(
104
+ enum_klass.deserialize(constant.value)
105
+ ).name == constant.name
106
+ end
100
107
 
101
108
  unless values_missing_from_enum.empty?
102
109
  puts "Detected values in live API result that are missing from #{enum_klass.name}."
@@ -108,7 +115,12 @@ module LobbyingDisclosureClient
108
115
  extra_values_in_enum.map { |value| puts " - \"#{value}\"" }
109
116
  end
110
117
 
111
- if values_missing_from_enum.empty? && extra_values_in_enum.empty?
118
+ unless values_where_human_readable_name_does_not_match_api.empty?
119
+ puts "Detected values in #{enum_klass.name} where the human-readable name does match the live API result."
120
+ values_where_human_readable_name_does_not_match_api.map { |constant| puts " - \"#{constant.value}\" => \"#{constant.name}\"" }
121
+ end
122
+
123
+ if values_missing_from_enum.empty? && extra_values_in_enum.empty? && values_where_human_readable_name_does_not_match_api.empty?
112
124
  puts "#{enum_klass} passed validation 🏆\n\n"
113
125
  true
114
126
  else
@@ -8,6 +8,8 @@ module LobbyingDisclosureClient
8
8
  extend T::Sig
9
9
 
10
10
  class Input < T::Struct
11
+ include LobbyingDisclosureClient::Interfaces::ListEndpointInput
12
+
11
13
  const :client_country, T.nilable(LobbyingDisclosureClient::Enums::Country)
12
14
  const :client_name, T.nilable(String)
13
15
  const :client_ppb_country, T.nilable(LobbyingDisclosureClient::Enums::Country)
@@ -22,6 +24,8 @@ module LobbyingDisclosureClient
22
24
  end
23
25
 
24
26
  class Output < T::Struct
27
+ include LobbyingDisclosureClient::Interfaces::ListEndpointOutput
28
+
25
29
  const :count, Integer
26
30
  const :next, T.nilable(String)
27
31
  const :previous, T.nilable(String)
@@ -8,6 +8,8 @@ module LobbyingDisclosureClient
8
8
  extend T::Sig
9
9
 
10
10
  class Input < T::Struct
11
+ include LobbyingDisclosureClient::Interfaces::ListEndpointInput
12
+
11
13
  const :contribution_amount_max, T.nilable(BigDecimal)
12
14
  const :contribution_amount_min, T.nilable(BigDecimal)
13
15
  const :contribution_contributor, T.nilable(String)
@@ -33,6 +35,8 @@ module LobbyingDisclosureClient
33
35
  end
34
36
 
35
37
  class Output < T::Struct
38
+ include LobbyingDisclosureClient::Interfaces::ListEndpointOutput
39
+
36
40
  const :count, Integer
37
41
  const :next, T.nilable(String)
38
42
  const :previous, T.nilable(String)
@@ -8,6 +8,8 @@ module LobbyingDisclosureClient
8
8
  extend T::Sig
9
9
 
10
10
  class Input < T::Struct
11
+ include LobbyingDisclosureClient::Interfaces::ListEndpointInput
12
+
11
13
  const :affiliated_organization_country, T.nilable(LobbyingDisclosureClient::Enums::Country)
12
14
  const :affiliated_organization_listed_indicator, T.nilable(T::Boolean)
13
15
  const :affiliated_organization_name, T.nilable(String)
@@ -50,6 +52,8 @@ module LobbyingDisclosureClient
50
52
  end
51
53
 
52
54
  class Output < T::Struct
55
+ include LobbyingDisclosureClient::Interfaces::ListEndpointOutput
56
+
53
57
  const :count, Integer
54
58
  const :next, T.nilable(String)
55
59
  const :previous, T.nilable(String)
@@ -8,6 +8,8 @@ module LobbyingDisclosureClient
8
8
  extend T::Sig
9
9
 
10
10
  class Input < T::Struct
11
+ include LobbyingDisclosureClient::Interfaces::ListEndpointInput
12
+
11
13
  const :id, T.nilable(Integer)
12
14
  const :lobbyist_name, T.nilable(String)
13
15
  const :ordering, T.nilable(String)
@@ -18,6 +20,8 @@ module LobbyingDisclosureClient
18
20
  end
19
21
 
20
22
  class Output < T::Struct
23
+ include LobbyingDisclosureClient::Interfaces::ListEndpointOutput
24
+
21
25
  const :count, Integer
22
26
  const :next, T.nilable(String)
23
27
  const :previous, T.nilable(String)
@@ -8,6 +8,8 @@ module LobbyingDisclosureClient
8
8
  extend T::Sig
9
9
 
10
10
  class Input < T::Struct
11
+ include LobbyingDisclosureClient::Interfaces::ListEndpointInput
12
+
11
13
  const :country, T.nilable(LobbyingDisclosureClient::Enums::Country)
12
14
  const :dt_updated_after, T.nilable(DateTime)
13
15
  const :dt_updated_before, T.nilable(DateTime)
@@ -21,6 +23,8 @@ module LobbyingDisclosureClient
21
23
  end
22
24
 
23
25
  class Output < T::Struct
26
+ include LobbyingDisclosureClient::Interfaces::ListEndpointOutput
27
+
24
28
  const :count, Integer
25
29
  const :next, T.nilable(String)
26
30
  const :previous, T.nilable(String)
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module LobbyingDisclosureClient
5
- VERSION = '0.0.1'
5
+ VERSION = '0.0.3'
6
6
  end
@@ -13,6 +13,11 @@ require_relative 'lobbying_disclosure_client/auth/password/reset/confirm'
13
13
 
14
14
  require_relative 'lobbying_disclosure_client/client'
15
15
 
16
+ require_relative 'lobbying_disclosure_client/interfaces'
17
+ require_relative 'lobbying_disclosure_client/interfaces/list_endpoint_input'
18
+ require_relative 'lobbying_disclosure_client/interfaces/list_endpoint_output'
19
+ require_relative 'lobbying_disclosure_client/interfaces/validatable_enum'
20
+
16
21
  require_relative 'lobbying_disclosure_client/enums'
17
22
  require_relative 'lobbying_disclosure_client/enums/contribution_type'
18
23
  require_relative 'lobbying_disclosure_client/enums/country'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lobbying_disclosure_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Lee
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-21 00:00:00.000000000 Z
11
+ date: 2024-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bigdecimal
@@ -91,6 +91,10 @@ files:
91
91
  - lib/lobbying_disclosure_client/errors/request_throttled_error.rb
92
92
  - lib/lobbying_disclosure_client/errors/unknown_error.rb
93
93
  - lib/lobbying_disclosure_client/errors/unsupported_http_method_error.rb
94
+ - lib/lobbying_disclosure_client/interfaces.rb
95
+ - lib/lobbying_disclosure_client/interfaces/list_endpoint_input.rb
96
+ - lib/lobbying_disclosure_client/interfaces/list_endpoint_output.rb
97
+ - lib/lobbying_disclosure_client/interfaces/validatable_enum.rb
94
98
  - lib/lobbying_disclosure_client/types.rb
95
99
  - lib/lobbying_disclosure_client/types/affiliated_organization.rb
96
100
  - lib/lobbying_disclosure_client/types/client.rb