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.
- checksums.yaml +7 -0
- data/.rubocop.yml +50 -0
- data/.ruby-version +1 -0
- data/LICENSE.txt +21 -0
- data/README.md +78 -0
- data/Rakefile +17 -0
- data/lefthook.yml +9 -0
- data/lib/lobbying_disclosure_client/auth/login.rb +33 -0
- data/lib/lobbying_disclosure_client/auth/password/reset/confirm.rb +39 -0
- data/lib/lobbying_disclosure_client/auth/password/reset.rb +34 -0
- data/lib/lobbying_disclosure_client/auth/password.rb +9 -0
- data/lib/lobbying_disclosure_client/auth.rb +7 -0
- data/lib/lobbying_disclosure_client/client.rb +108 -0
- data/lib/lobbying_disclosure_client/enums/contribution_type.rb +16 -0
- data/lib/lobbying_disclosure_client/enums/country.rb +269 -0
- data/lib/lobbying_disclosure_client/enums/expenses_method.rb +14 -0
- data/lib/lobbying_disclosure_client/enums/filer_type.rb +13 -0
- data/lib/lobbying_disclosure_client/enums/filing_period.rb +17 -0
- data/lib/lobbying_disclosure_client/enums/filing_type.rb +61 -0
- data/lib/lobbying_disclosure_client/enums/general_issue_code.rb +90 -0
- data/lib/lobbying_disclosure_client/enums/prefix.rb +18 -0
- data/lib/lobbying_disclosure_client/enums/route.rb +103 -0
- data/lib/lobbying_disclosure_client/enums/state.rb +71 -0
- data/lib/lobbying_disclosure_client/enums/suffix.rb +34 -0
- data/lib/lobbying_disclosure_client/enums.rb +7 -0
- data/lib/lobbying_disclosure_client/errors/bad_request_error.rb +8 -0
- data/lib/lobbying_disclosure_client/errors/invalid_api_key_error.rb +8 -0
- data/lib/lobbying_disclosure_client/errors/not_found_error.rb +8 -0
- data/lib/lobbying_disclosure_client/errors/request_throttled_error.rb +26 -0
- data/lib/lobbying_disclosure_client/errors/unknown_error.rb +8 -0
- data/lib/lobbying_disclosure_client/errors/unsupported_http_method_error.rb +8 -0
- data/lib/lobbying_disclosure_client/errors.rb +7 -0
- data/lib/lobbying_disclosure_client/types/affiliated_organization.rb +26 -0
- data/lib/lobbying_disclosure_client/types/client.rb +42 -0
- data/lib/lobbying_disclosure_client/types/client_with_registrant.rb +43 -0
- data/lib/lobbying_disclosure_client/types/constant.rb +11 -0
- data/lib/lobbying_disclosure_client/types/contribution_item.rb +34 -0
- data/lib/lobbying_disclosure_client/types/contribution_report.rb +53 -0
- data/lib/lobbying_disclosure_client/types/conviction_disclosure.rb +29 -0
- data/lib/lobbying_disclosure_client/types/filing.rb +59 -0
- data/lib/lobbying_disclosure_client/types/foreign_entity.rb +41 -0
- data/lib/lobbying_disclosure_client/types/government_entity.rb +11 -0
- data/lib/lobbying_disclosure_client/types/lobbying_activity.rb +15 -0
- data/lib/lobbying_disclosure_client/types/lobbyist.rb +18 -0
- data/lib/lobbying_disclosure_client/types/lobbyist_for_lobbying_activity.rb +12 -0
- data/lib/lobbying_disclosure_client/types/lobbyist_with_registrant.rb +19 -0
- data/lib/lobbying_disclosure_client/types/registrant.rb +46 -0
- data/lib/lobbying_disclosure_client/types.rb +7 -0
- data/lib/lobbying_disclosure_client/util/constants_validator.rb +122 -0
- data/lib/lobbying_disclosure_client/util.rb +7 -0
- data/lib/lobbying_disclosure_client/v1/clients/list_clients.rb +49 -0
- data/lib/lobbying_disclosure_client/v1/clients/retrieve_client.rb +36 -0
- data/lib/lobbying_disclosure_client/v1/clients.rb +9 -0
- data/lib/lobbying_disclosure_client/v1/constants/contribution/list_contribution_item_types.rb +26 -0
- data/lib/lobbying_disclosure_client/v1/constants/contribution.rb +11 -0
- data/lib/lobbying_disclosure_client/v1/constants/filing/list_filing_types.rb +26 -0
- data/lib/lobbying_disclosure_client/v1/constants/filing/list_government_entities.rb +26 -0
- data/lib/lobbying_disclosure_client/v1/constants/filing/list_lobbying_activity_general_issues.rb +26 -0
- data/lib/lobbying_disclosure_client/v1/constants/filing.rb +11 -0
- data/lib/lobbying_disclosure_client/v1/constants/general/list_countries.rb +26 -0
- data/lib/lobbying_disclosure_client/v1/constants/general/list_states.rb +26 -0
- data/lib/lobbying_disclosure_client/v1/constants/general.rb +11 -0
- data/lib/lobbying_disclosure_client/v1/constants/lobbyist/list_lobbyist_prefixes.rb +26 -0
- data/lib/lobbying_disclosure_client/v1/constants/lobbyist/list_lobbyist_suffixes.rb +26 -0
- data/lib/lobbying_disclosure_client/v1/constants/lobbyist.rb +11 -0
- data/lib/lobbying_disclosure_client/v1/constants.rb +9 -0
- data/lib/lobbying_disclosure_client/v1/contribution_reports/list_contribution_reports.rb +60 -0
- data/lib/lobbying_disclosure_client/v1/contribution_reports/retrieve_contribution_report.rb +36 -0
- data/lib/lobbying_disclosure_client/v1/contribution_reports.rb +9 -0
- data/lib/lobbying_disclosure_client/v1/filings/list_filings.rb +77 -0
- data/lib/lobbying_disclosure_client/v1/filings/retrieve_filing.rb +36 -0
- data/lib/lobbying_disclosure_client/v1/filings.rb +9 -0
- data/lib/lobbying_disclosure_client/v1/lobbyists/list_lobbyists.rb +45 -0
- data/lib/lobbying_disclosure_client/v1/lobbyists/retrieve_lobbyist.rb +36 -0
- data/lib/lobbying_disclosure_client/v1/lobbyists.rb +9 -0
- data/lib/lobbying_disclosure_client/v1/registrants/list_registrants.rb +48 -0
- data/lib/lobbying_disclosure_client/v1/registrants/retrieve_registrant.rb +36 -0
- data/lib/lobbying_disclosure_client/v1/registrants.rb +9 -0
- data/lib/lobbying_disclosure_client/v1.rb +16 -0
- data/lib/lobbying_disclosure_client/version.rb +6 -0
- data/lib/lobbying_disclosure_client.rb +105 -0
- data/sorbet/config +4 -0
- data/sorbet/rbi/gems/.gitattributes +1 -0
- data/sorbet/rbi/gems/erubi@1.13.0.rbi +150 -0
- data/sorbet/rbi/gems/minitest-stub-const@0.6.rbi +72 -0
- data/sorbet/rbi/gems/minitest@5.20.0.rbi +1498 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
- data/sorbet/rbi/gems/parallel@1.26.2.rbi +291 -0
- data/sorbet/rbi/gems/prism@0.30.0.rbi +37863 -0
- data/sorbet/rbi/gems/rake@13.1.0.rbi +3220 -0
- data/sorbet/rbi/gems/rbi@0.1.14.rbi +3305 -0
- data/sorbet/rbi/gems/spoom@1.4.2.rbi +4932 -0
- data/sorbet/rbi/gems/tapioca@0.16.0.rbi +3543 -0
- data/sorbet/rbi/gems/thor@1.3.1.rbi +4319 -0
- data/sorbet/rbi/gems/vcr@6.3.1.rbi +3040 -0
- data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
- data/sorbet/rbi/gems/yard@0.9.36.rbi +18086 -0
- data/sorbet/rbi/shims/faraday.rbi +10 -0
- data/sorbet/tapioca/config.yml +13 -0
- data/sorbet/tapioca/require.rb +5 -0
- 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,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,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,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
|
data/lib/lobbying_disclosure_client/v1/constants/filing/list_lobbying_activity_general_issues.rb
ADDED
@@ -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,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,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,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
|