lobbying_disclosure_client 0.0.1

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.
Files changed (101) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +50 -0
  3. data/.ruby-version +1 -0
  4. data/LICENSE.txt +21 -0
  5. data/README.md +78 -0
  6. data/Rakefile +17 -0
  7. data/lefthook.yml +9 -0
  8. data/lib/lobbying_disclosure_client/auth/login.rb +33 -0
  9. data/lib/lobbying_disclosure_client/auth/password/reset/confirm.rb +39 -0
  10. data/lib/lobbying_disclosure_client/auth/password/reset.rb +34 -0
  11. data/lib/lobbying_disclosure_client/auth/password.rb +9 -0
  12. data/lib/lobbying_disclosure_client/auth.rb +7 -0
  13. data/lib/lobbying_disclosure_client/client.rb +108 -0
  14. data/lib/lobbying_disclosure_client/enums/contribution_type.rb +16 -0
  15. data/lib/lobbying_disclosure_client/enums/country.rb +269 -0
  16. data/lib/lobbying_disclosure_client/enums/expenses_method.rb +14 -0
  17. data/lib/lobbying_disclosure_client/enums/filer_type.rb +13 -0
  18. data/lib/lobbying_disclosure_client/enums/filing_period.rb +17 -0
  19. data/lib/lobbying_disclosure_client/enums/filing_type.rb +61 -0
  20. data/lib/lobbying_disclosure_client/enums/general_issue_code.rb +90 -0
  21. data/lib/lobbying_disclosure_client/enums/prefix.rb +18 -0
  22. data/lib/lobbying_disclosure_client/enums/route.rb +103 -0
  23. data/lib/lobbying_disclosure_client/enums/state.rb +71 -0
  24. data/lib/lobbying_disclosure_client/enums/suffix.rb +34 -0
  25. data/lib/lobbying_disclosure_client/enums.rb +7 -0
  26. data/lib/lobbying_disclosure_client/errors/bad_request_error.rb +8 -0
  27. data/lib/lobbying_disclosure_client/errors/invalid_api_key_error.rb +8 -0
  28. data/lib/lobbying_disclosure_client/errors/not_found_error.rb +8 -0
  29. data/lib/lobbying_disclosure_client/errors/request_throttled_error.rb +26 -0
  30. data/lib/lobbying_disclosure_client/errors/unknown_error.rb +8 -0
  31. data/lib/lobbying_disclosure_client/errors/unsupported_http_method_error.rb +8 -0
  32. data/lib/lobbying_disclosure_client/errors.rb +7 -0
  33. data/lib/lobbying_disclosure_client/types/affiliated_organization.rb +26 -0
  34. data/lib/lobbying_disclosure_client/types/client.rb +42 -0
  35. data/lib/lobbying_disclosure_client/types/client_with_registrant.rb +43 -0
  36. data/lib/lobbying_disclosure_client/types/constant.rb +11 -0
  37. data/lib/lobbying_disclosure_client/types/contribution_item.rb +34 -0
  38. data/lib/lobbying_disclosure_client/types/contribution_report.rb +53 -0
  39. data/lib/lobbying_disclosure_client/types/conviction_disclosure.rb +29 -0
  40. data/lib/lobbying_disclosure_client/types/filing.rb +59 -0
  41. data/lib/lobbying_disclosure_client/types/foreign_entity.rb +41 -0
  42. data/lib/lobbying_disclosure_client/types/government_entity.rb +11 -0
  43. data/lib/lobbying_disclosure_client/types/lobbying_activity.rb +15 -0
  44. data/lib/lobbying_disclosure_client/types/lobbyist.rb +18 -0
  45. data/lib/lobbying_disclosure_client/types/lobbyist_for_lobbying_activity.rb +12 -0
  46. data/lib/lobbying_disclosure_client/types/lobbyist_with_registrant.rb +19 -0
  47. data/lib/lobbying_disclosure_client/types/registrant.rb +46 -0
  48. data/lib/lobbying_disclosure_client/types.rb +7 -0
  49. data/lib/lobbying_disclosure_client/util/constants_validator.rb +122 -0
  50. data/lib/lobbying_disclosure_client/util.rb +7 -0
  51. data/lib/lobbying_disclosure_client/v1/clients/list_clients.rb +49 -0
  52. data/lib/lobbying_disclosure_client/v1/clients/retrieve_client.rb +36 -0
  53. data/lib/lobbying_disclosure_client/v1/clients.rb +9 -0
  54. data/lib/lobbying_disclosure_client/v1/constants/contribution/list_contribution_item_types.rb +26 -0
  55. data/lib/lobbying_disclosure_client/v1/constants/contribution.rb +11 -0
  56. data/lib/lobbying_disclosure_client/v1/constants/filing/list_filing_types.rb +26 -0
  57. data/lib/lobbying_disclosure_client/v1/constants/filing/list_government_entities.rb +26 -0
  58. data/lib/lobbying_disclosure_client/v1/constants/filing/list_lobbying_activity_general_issues.rb +26 -0
  59. data/lib/lobbying_disclosure_client/v1/constants/filing.rb +11 -0
  60. data/lib/lobbying_disclosure_client/v1/constants/general/list_countries.rb +26 -0
  61. data/lib/lobbying_disclosure_client/v1/constants/general/list_states.rb +26 -0
  62. data/lib/lobbying_disclosure_client/v1/constants/general.rb +11 -0
  63. data/lib/lobbying_disclosure_client/v1/constants/lobbyist/list_lobbyist_prefixes.rb +26 -0
  64. data/lib/lobbying_disclosure_client/v1/constants/lobbyist/list_lobbyist_suffixes.rb +26 -0
  65. data/lib/lobbying_disclosure_client/v1/constants/lobbyist.rb +11 -0
  66. data/lib/lobbying_disclosure_client/v1/constants.rb +9 -0
  67. data/lib/lobbying_disclosure_client/v1/contribution_reports/list_contribution_reports.rb +60 -0
  68. data/lib/lobbying_disclosure_client/v1/contribution_reports/retrieve_contribution_report.rb +36 -0
  69. data/lib/lobbying_disclosure_client/v1/contribution_reports.rb +9 -0
  70. data/lib/lobbying_disclosure_client/v1/filings/list_filings.rb +77 -0
  71. data/lib/lobbying_disclosure_client/v1/filings/retrieve_filing.rb +36 -0
  72. data/lib/lobbying_disclosure_client/v1/filings.rb +9 -0
  73. data/lib/lobbying_disclosure_client/v1/lobbyists/list_lobbyists.rb +45 -0
  74. data/lib/lobbying_disclosure_client/v1/lobbyists/retrieve_lobbyist.rb +36 -0
  75. data/lib/lobbying_disclosure_client/v1/lobbyists.rb +9 -0
  76. data/lib/lobbying_disclosure_client/v1/registrants/list_registrants.rb +48 -0
  77. data/lib/lobbying_disclosure_client/v1/registrants/retrieve_registrant.rb +36 -0
  78. data/lib/lobbying_disclosure_client/v1/registrants.rb +9 -0
  79. data/lib/lobbying_disclosure_client/v1.rb +16 -0
  80. data/lib/lobbying_disclosure_client/version.rb +6 -0
  81. data/lib/lobbying_disclosure_client.rb +105 -0
  82. data/sorbet/config +4 -0
  83. data/sorbet/rbi/gems/.gitattributes +1 -0
  84. data/sorbet/rbi/gems/erubi@1.13.0.rbi +150 -0
  85. data/sorbet/rbi/gems/minitest-stub-const@0.6.rbi +72 -0
  86. data/sorbet/rbi/gems/minitest@5.20.0.rbi +1498 -0
  87. data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
  88. data/sorbet/rbi/gems/parallel@1.26.2.rbi +291 -0
  89. data/sorbet/rbi/gems/prism@0.30.0.rbi +37863 -0
  90. data/sorbet/rbi/gems/rake@13.1.0.rbi +3220 -0
  91. data/sorbet/rbi/gems/rbi@0.1.14.rbi +3305 -0
  92. data/sorbet/rbi/gems/spoom@1.4.2.rbi +4932 -0
  93. data/sorbet/rbi/gems/tapioca@0.16.0.rbi +3543 -0
  94. data/sorbet/rbi/gems/thor@1.3.1.rbi +4319 -0
  95. data/sorbet/rbi/gems/vcr@6.3.1.rbi +3040 -0
  96. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
  97. data/sorbet/rbi/gems/yard@0.9.36.rbi +18086 -0
  98. data/sorbet/rbi/shims/faraday.rbi +10 -0
  99. data/sorbet/tapioca/config.yml +13 -0
  100. data/sorbet/tapioca/require.rb +5 -0
  101. metadata +185 -0
@@ -0,0 +1,122 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ module Util
6
+ class ConstantsValidator
7
+ class InvalidEnumError < StandardError; end
8
+
9
+ class ItemToValidate < T::Struct
10
+ const :enum_klass, T.class_of(T::Enum)
11
+ const :api_klass, T.any(
12
+ T.class_of(LobbyingDisclosureClient::V1::Constants::Contribution::ListContributionItemTypes),
13
+ T.class_of(LobbyingDisclosureClient::V1::Constants::Filing::ListFilingTypes),
14
+ T.class_of(LobbyingDisclosureClient::V1::Constants::Filing::ListLobbyingActivityGeneralIssues),
15
+ T.class_of(LobbyingDisclosureClient::V1::Constants::General::ListCountries),
16
+ T.class_of(LobbyingDisclosureClient::V1::Constants::General::ListStates),
17
+ T.class_of(LobbyingDisclosureClient::V1::Constants::Lobbyist::ListLobbyistPrefixes),
18
+ T.class_of(LobbyingDisclosureClient::V1::Constants::Lobbyist::ListLobbyistSuffixes)
19
+ )
20
+ end
21
+
22
+ ITEMS_TO_VALIDATE = T.let(
23
+ [
24
+ ItemToValidate.new(
25
+ enum_klass: LobbyingDisclosureClient::Enums::ContributionType,
26
+ api_klass: LobbyingDisclosureClient::V1::Constants::Contribution::ListContributionItemTypes
27
+ ),
28
+ ItemToValidate.new(
29
+ enum_klass: LobbyingDisclosureClient::Enums::FilingType,
30
+ api_klass: LobbyingDisclosureClient::V1::Constants::Filing::ListFilingTypes
31
+ ),
32
+ ItemToValidate.new(
33
+ enum_klass: LobbyingDisclosureClient::Enums::GeneralIssueCode,
34
+ api_klass: LobbyingDisclosureClient::V1::Constants::Filing::ListLobbyingActivityGeneralIssues
35
+ ),
36
+ ItemToValidate.new(
37
+ enum_klass: LobbyingDisclosureClient::Enums::Country,
38
+ api_klass: LobbyingDisclosureClient::V1::Constants::General::ListCountries
39
+ ),
40
+ ItemToValidate.new(
41
+ enum_klass: LobbyingDisclosureClient::Enums::State,
42
+ api_klass: LobbyingDisclosureClient::V1::Constants::General::ListStates
43
+ ),
44
+ ItemToValidate.new(
45
+ enum_klass: LobbyingDisclosureClient::Enums::Prefix,
46
+ api_klass: LobbyingDisclosureClient::V1::Constants::Lobbyist::ListLobbyistPrefixes
47
+ ),
48
+ ItemToValidate.new(
49
+ enum_klass: LobbyingDisclosureClient::Enums::Suffix,
50
+ api_klass: LobbyingDisclosureClient::V1::Constants::Lobbyist::ListLobbyistSuffixes
51
+ )
52
+ ].freeze,
53
+ T::Array[ItemToValidate]
54
+ )
55
+
56
+ VALUES_RETURNED_BY_API_EMPIRICALLY_BUT_NOT_INCLUDED_IN_CONSTANTS_ENDPOINTS = T.let(
57
+ {
58
+ LobbyingDisclosureClient::Enums::Country => [
59
+ LobbyingDisclosureClient::Enums::Country::Blank.serialize
60
+ ]
61
+ }.freeze,
62
+ T::Hash[T.class_of(T::Enum), T::Array[String]]
63
+ )
64
+
65
+ class << self
66
+ extend T::Sig
67
+
68
+ sig { void }
69
+ def validate!
70
+ validation_results = ITEMS_TO_VALIDATE.map do |item_to_validate|
71
+ enum_is_in_sync_with_live_api_result?(item_to_validate)
72
+ end
73
+
74
+ if validation_results.all?
75
+ puts 'All enums passed validation 🏆🏆🏆'
76
+ else
77
+ puts 'Some enums failed validation ⛈️⛈️⛈️'
78
+ raise InvalidEnumError
79
+ end
80
+ end
81
+
82
+ private
83
+
84
+ sig do
85
+ params(
86
+ item_to_validate: ItemToValidate
87
+ ).returns(T::Boolean)
88
+ end
89
+ def enum_is_in_sync_with_live_api_result?(item_to_validate)
90
+ enum_klass = item_to_validate.enum_klass
91
+ api_klass = item_to_validate.api_klass
92
+
93
+ puts "Validating #{enum_klass.name} against the live API..."
94
+
95
+ serialized_enum_values = enum_klass.values.map(&:serialize)
96
+ api_values = api_klass.call.map(&:value)
97
+
98
+ values_missing_from_enum = api_values - serialized_enum_values
99
+ extra_values_in_enum = serialized_enum_values - api_values - (VALUES_RETURNED_BY_API_EMPIRICALLY_BUT_NOT_INCLUDED_IN_CONSTANTS_ENDPOINTS[enum_klass] || [])
100
+
101
+ unless values_missing_from_enum.empty?
102
+ puts "Detected values in live API result that are missing from #{enum_klass.name}."
103
+ values_missing_from_enum.map { |value| puts " - \"#{value}\"" }
104
+ end
105
+
106
+ unless extra_values_in_enum.empty?
107
+ puts "Detected values in #{enum_klass.name} that are not present in the live API result."
108
+ extra_values_in_enum.map { |value| puts " - \"#{value}\"" }
109
+ end
110
+
111
+ if values_missing_from_enum.empty? && extra_values_in_enum.empty?
112
+ puts "#{enum_klass} passed validation 🏆\n\n"
113
+ true
114
+ else
115
+ puts "#{enum_klass} failed validation ⛈️\n\n"
116
+ false
117
+ end
118
+ end
119
+ end
120
+ end
121
+ end
122
+ end
@@ -0,0 +1,7 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ module Util
6
+ end
7
+ end
@@ -0,0 +1,49 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ class V1
6
+ module Clients
7
+ class ListClients
8
+ extend T::Sig
9
+
10
+ class Input < T::Struct
11
+ const :client_country, T.nilable(LobbyingDisclosureClient::Enums::Country)
12
+ const :client_name, T.nilable(String)
13
+ const :client_ppb_country, T.nilable(LobbyingDisclosureClient::Enums::Country)
14
+ const :client_ppb_state, T.nilable(LobbyingDisclosureClient::Enums::State)
15
+ const :client_state, T.nilable(LobbyingDisclosureClient::Enums::State)
16
+ const :id, T.nilable(Integer)
17
+ const :ordering, T.nilable(String)
18
+ const :page, T.nilable(Integer)
19
+ const :page_size, T.nilable(Integer)
20
+ const :registrant_id, T.nilable(Integer)
21
+ const :registrant_name, T.nilable(String)
22
+ end
23
+
24
+ class Output < T::Struct
25
+ const :count, Integer
26
+ const :next, T.nilable(String)
27
+ const :previous, T.nilable(String)
28
+ const :results, T::Array[LobbyingDisclosureClient::Types::ClientWithRegistrant]
29
+ end
30
+
31
+ sig do
32
+ params(
33
+ input: Input
34
+ ).returns(Output)
35
+ end
36
+ def self.call(input:)
37
+ client = Client.new
38
+
39
+ Output.from_hash!(
40
+ client.get(
41
+ LobbyingDisclosureClient::Enums::Route::V1_Clients_ListClients,
42
+ query_params: input.serialize.compact
43
+ )
44
+ )
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,36 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ class V1
6
+ module Clients
7
+ class RetrieveClient
8
+ extend T::Sig
9
+
10
+ class Input < T::Struct
11
+ const :id, Integer
12
+ end
13
+
14
+ Output = T.type_alias do
15
+ LobbyingDisclosureClient::Types::ClientWithRegistrant
16
+ end
17
+
18
+ sig do
19
+ params(
20
+ input: Input
21
+ ).returns(Output)
22
+ end
23
+ def self.call(input:)
24
+ client = Client.new
25
+
26
+ LobbyingDisclosureClient::Types::ClientWithRegistrant.from_hash!(
27
+ client.get(
28
+ LobbyingDisclosureClient::Enums::Route::V1_Clients_RetrieveClient,
29
+ path_params: [input.id]
30
+ )
31
+ )
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,9 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ class V1
6
+ module Clients
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,26 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ class V1
6
+ module Constants
7
+ module Contribution
8
+ class ListContributionItemTypes
9
+ extend T::Sig
10
+
11
+ sig do
12
+ returns(T::Array[LobbyingDisclosureClient::Types::Constant])
13
+ end
14
+ def self.call
15
+ client = Client.new
16
+ client.get(
17
+ LobbyingDisclosureClient::Enums::Route::V1_Constants_Contribution_ItemTypes
18
+ ).map do |constant|
19
+ LobbyingDisclosureClient::Types::Constant.from_hash!(constant)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,11 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ class V1
6
+ module Constants
7
+ module Contribution
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,26 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ class V1
6
+ module Constants
7
+ module Filing
8
+ class ListFilingTypes
9
+ extend T::Sig
10
+
11
+ sig do
12
+ returns(T::Array[LobbyingDisclosureClient::Types::Constant])
13
+ end
14
+ def self.call
15
+ client = Client.new
16
+ client.get(
17
+ LobbyingDisclosureClient::Enums::Route::V1_Constants_Filing_ListFilingTypes
18
+ ).map do |constant|
19
+ LobbyingDisclosureClient::Types::Constant.from_hash!(constant)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ class V1
6
+ module Constants
7
+ module Filing
8
+ class ListGovernmentEntities
9
+ extend T::Sig
10
+
11
+ sig do
12
+ returns(T::Array[LobbyingDisclosureClient::Types::GovernmentEntity])
13
+ end
14
+ def self.call
15
+ client = Client.new
16
+ client.get(
17
+ LobbyingDisclosureClient::Enums::Route::V1_Constants_Filing_GovernmentEntities
18
+ ).map do |constant|
19
+ LobbyingDisclosureClient::Types::GovernmentEntity.from_hash!(constant)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ class V1
6
+ module Constants
7
+ module Filing
8
+ class ListLobbyingActivityGeneralIssues
9
+ extend T::Sig
10
+
11
+ sig do
12
+ returns(T::Array[LobbyingDisclosureClient::Types::Constant])
13
+ end
14
+ def self.call
15
+ client = Client.new
16
+ client.get(
17
+ LobbyingDisclosureClient::Enums::Route::V1_Constants_Filing_LobbyingActivityIssues
18
+ ).map do |constant|
19
+ LobbyingDisclosureClient::Types::Constant.from_hash!(constant)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,11 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ class V1
6
+ module Constants
7
+ module Filing
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,26 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ class V1
6
+ module Constants
7
+ module General
8
+ class ListCountries
9
+ extend T::Sig
10
+
11
+ sig do
12
+ returns(T::Array[LobbyingDisclosureClient::Types::Constant])
13
+ end
14
+ def self.call
15
+ client = Client.new
16
+ client.get(
17
+ LobbyingDisclosureClient::Enums::Route::V1_Constants_General_Countries
18
+ ).map do |constant|
19
+ LobbyingDisclosureClient::Types::Constant.from_hash!(constant)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ class V1
6
+ module Constants
7
+ module General
8
+ class ListStates
9
+ extend T::Sig
10
+
11
+ sig do
12
+ returns(T::Array[LobbyingDisclosureClient::Types::Constant])
13
+ end
14
+ def self.call
15
+ client = Client.new
16
+ client.get(
17
+ LobbyingDisclosureClient::Enums::Route::V1_Constants_General_States
18
+ ).map do |constant|
19
+ LobbyingDisclosureClient::Types::Constant.from_hash!(constant)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,11 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ class V1
6
+ module Constants
7
+ module General
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,26 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ class V1
6
+ module Constants
7
+ module Lobbyist
8
+ class ListLobbyistPrefixes
9
+ extend T::Sig
10
+
11
+ sig do
12
+ returns(T::Array[LobbyingDisclosureClient::Types::Constant])
13
+ end
14
+ def self.call
15
+ client = Client.new
16
+ client.get(
17
+ LobbyingDisclosureClient::Enums::Route::V1_Constants_Lobbyist_Prefixes
18
+ ).map do |constant|
19
+ LobbyingDisclosureClient::Types::Constant.from_hash!(constant)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ class V1
6
+ module Constants
7
+ module Lobbyist
8
+ class ListLobbyistSuffixes
9
+ extend T::Sig
10
+
11
+ sig do
12
+ returns(T::Array[LobbyingDisclosureClient::Types::Constant])
13
+ end
14
+ def self.call
15
+ client = Client.new
16
+ client.get(
17
+ LobbyingDisclosureClient::Enums::Route::V1_Constants_Lobbyist_Suffixes
18
+ ).map do |constant|
19
+ LobbyingDisclosureClient::Types::Constant.from_hash!(constant)
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,11 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ class V1
6
+ module Constants
7
+ module Lobbyist
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ class V1
6
+ module Constants
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,60 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ class V1
6
+ module ContributionReports
7
+ class ListContributionReports
8
+ extend T::Sig
9
+
10
+ class Input < T::Struct
11
+ const :contribution_amount_max, T.nilable(BigDecimal)
12
+ const :contribution_amount_min, T.nilable(BigDecimal)
13
+ const :contribution_contributor, T.nilable(String)
14
+ const :contribution_date_after, T.nilable(Date)
15
+ const :contribution_date_before, T.nilable(Date)
16
+ const :contribution_honoree, T.nilable(String)
17
+ const :contribution_payee, T.nilable(String)
18
+ const :contribution_type, T.nilable(LobbyingDisclosureClient::Enums::ContributionType)
19
+ const :filing_dt_posted_after, T.nilable(DateTime)
20
+ const :filing_dt_posted_before, T.nilable(DateTime)
21
+ const :filing_period, T.nilable(LobbyingDisclosureClient::Enums::FilingPeriod)
22
+ const :filing_type, T.nilable(LobbyingDisclosureClient::Enums::FilingType)
23
+ const :filing_uuid, T.nilable(String)
24
+ const :filing_year, T.nilable(Integer)
25
+ const :lobbyist_exclude, T.nilable(T::Boolean)
26
+ const :lobbyist_id, T.nilable(Integer)
27
+ const :lobbyist_name, T.nilable(String)
28
+ const :ordering, T.nilable(String)
29
+ const :page, T.nilable(Integer)
30
+ const :page_size, T.nilable(Integer)
31
+ const :registrant_id, T.nilable(Integer)
32
+ const :registrant_name, T.nilable(String)
33
+ end
34
+
35
+ class Output < T::Struct
36
+ const :count, Integer
37
+ const :next, T.nilable(String)
38
+ const :previous, T.nilable(String)
39
+ const :results, T::Array[LobbyingDisclosureClient::Types::ContributionReport]
40
+ end
41
+
42
+ sig do
43
+ params(
44
+ input: Input
45
+ ).returns(Output)
46
+ end
47
+ def self.call(input:)
48
+ client = Client.new
49
+
50
+ Output.from_hash!(
51
+ client.get(
52
+ LobbyingDisclosureClient::Enums::Route::V1_Contributions_ListContributionReports,
53
+ query_params: input.serialize.compact
54
+ )
55
+ )
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,36 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ class V1
6
+ module ContributionReports
7
+ class RetrieveContributionReport
8
+ extend T::Sig
9
+
10
+ class Input < T::Struct
11
+ const :filing_uuid, String
12
+ end
13
+
14
+ Output = T.type_alias do
15
+ LobbyingDisclosureClient::Types::ContributionReport
16
+ end
17
+
18
+ sig do
19
+ params(
20
+ input: Input
21
+ ).returns(Output)
22
+ end
23
+ def self.call(input:)
24
+ client = Client.new
25
+
26
+ LobbyingDisclosureClient::Types::ContributionReport.from_hash!(
27
+ client.get(
28
+ LobbyingDisclosureClient::Enums::Route::V1_Contributions_RetrieveContributionReport,
29
+ path_params: [input.filing_uuid]
30
+ )
31
+ )
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,9 @@
1
+ # typed: strict
2
+ # frozen_string_literal: true
3
+
4
+ module LobbyingDisclosureClient
5
+ class V1
6
+ module ContributionReports
7
+ end
8
+ end
9
+ end