api_v1

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Affiliated_organizations

type Affiliated_organizations struct {
	Address_1           string `json:"address_1"`
	Address_2           string `json:"address_2"`
	Address_3           string `json:"address_3"`
	Address_4           string `json:"address_4"`
	City                string `json:"city"`
	Country             string `json:"country"`
	Country_display     string `json:"country_display"`
	Name                string `json:"name"`
	Ppb_city            string `json:"ppb_city"`
	Ppb_country         string `json:"ppb_country"`
	Ppb_country_display string `json:"ppb_country_display"`
	Ppb_state           string `json:"ppb_state"`
	Ppb_state_display   string `json:"ppb_state_display"`
	State               string `json:"state"`
	State_display       string `json:"state_display"`
	Url                 string `json:"url"`
	Zip                 string `json:"zip"`
}

type Client

type Client struct {
	Client_government_entity bool   `json:"client_government_entity"`
	Client_id                int    `json:"client_id"`
	Client_self_select       bool   `json:"client_self_select"`
	Country                  string `json:"country"`
	Country_display          string `json:"country_display"`
	Effective_date           string `json:"effective_date"`
	General_description      string `json:"general_description"`
	Id                       int    `json:"id"`
	Name                     string `json:"name"`
	Ppb_country              string `json:"ppb_country"`
	Ppb_country_display      string `json:"ppb_country_display"`
	Ppb_state                string `json:"ppb_state"`
	Ppb_state_display        string `json:"ppb_state_display"`
	State                    string `json:"state"`
	State_display            string `json:"state_display"`
	Url                      string `json:"url"`
}

type Clients

type Clients struct {
	Client_government_entity bool       `json:"client_government_entity"`
	Client_id                int        `json:"client_id"`
	Client_self_select       bool       `json:"client_self_select"`
	Country                  string     `json:"country"`
	Country_display          string     `json:"country_display"`
	Effective_date           string     `json:"effective_date"`
	General_description      string     `json:"general_description"`
	Id                       int        `json:"id"`
	Name                     string     `json:"name"`
	Ppb_country              string     `json:"ppb_country"`
	Ppb_country_display      string     `json:"ppb_country_display"`
	Ppb_state                string     `json:"ppb_state"`
	Ppb_state_display        string     `json:"ppb_state_display"`
	Registrant               Registrant `json:"registrant"`
	State                    string     `json:"state"`
	State_display            string     `json:"state_display"`
	Url                      string     `json:"url"`
}

func (Clients) Get_Fields

func (r Clients) Get_Fields() (bson.M, error)

func (Clients) Get_fuuid

func (r Clients) Get_fuuid() (string, string)

type CodeErr

type CodeErr struct {
	Code    int
	Message string
}

func (CodeErr) Error

func (ce CodeErr) Error() string

type Config_api

type Config_api struct {
	Authorization string
	Mongo_URI     string
	Database      string
	Collection    string
	// contains filtered or unexported fields
}

func (*Config_api) Close_mongo

func (c *Config_api) Close_mongo() error

func (*Config_api) Init_mongo

func (c *Config_api) Init_mongo() error

type Contribution_item

type Contribution_item struct {
	Amount                    string `json:"amount"`
	Contribution_type         string `json:"contribution_type"`
	Contribution_type_display string `json:"contribution_type_display"`
	Contributor_name          string `json:"contributor_name"`
	Date                      string `json:"date"`
	Honoree_name              string `json:"honoree_name"`
	Payee_name                string `json:"payee_name"`
}

type Conviction_disclosure

type Conviction_disclosure struct {
	Date        string   `json:"date"`
	Description string   `json:"description"`
	Lobbyist    Lobbyist `json:"lobbyist"`
}

type DBerror

type DBerror struct {
	Message string
	Code    int
}
type Response[T Result] interface {
	GetResults() []T
	GetNext() string
	GetPrevious() string
	GetCount() int
	Flush()
}

func (DBerror) Error

func (d DBerror) Error() string

type DataBaseProcess

type DataBaseProcess[T Result] interface {
	Retrieve(c Config_api) ([]T, error)
	Query_ingestion(c Config_api) error
}

type Foreign_entities

type Foreign_entities struct {
	Address              string `json:"address"`
	City                 string `json:"city"`
	Contribution         string `json:"contribution"`
	Country              string `json:"country"`
	Country_display      string `json:"country_display"`
	Name                 string `json:"name"`
	Ownership_percentage string `json:"ownership_percentage"`
	Ppb_city             string `json:"ppb_city"`
	Ppb_country          string `json:"ppb_country"`
	Ppb_country_display  string `json:"ppb_country_display"`
	Ppb_state            string `json:"ppb_state"`
	Ppb_state_display    string `json:"ppb_state_display"`
	State                string `json:"state"`
	State_display        string `json:"state_display"`
}

type Government_entities

type Government_entities struct {
	Id   int    `json:"id"`
	Name string `json:"name"`
}

type ListClients

type ListClients struct {
	Client_country     string // any
	Client_name        string // string
	Client_ppb_country string // any
	Client_ppb_state   string // any
	Client_state       string // any
	Id                 string // int
	Ordering           string // string
	Page               string // int
	Page_size          string // int
	Registrant_id      string // int
	Registrant_name    string // string
}

func (ListClients) Get

func (r ListClients) Get(c Config_api) ([]byte, error)

func (ListClients) Query_ingestion

func (r ListClients) Query_ingestion(c Config_api) error

func (ListClients) Retrieve

func (r ListClients) Retrieve(c Config_api) ([]Clients, error)

type ListContributionReports

type ListContributionReports struct {
	Contribution_amount_max,
	Contribution_amount_min string // float32
	Contribution_contributor,
	Contribution_date_after,
	Contribution_date_before,
	Contribution_honoree,
	Contribution_payee,
	Contribution_type,
	Filing_dt_posted_after,
	Filing_dt_posted_before,
	Filing_period,
	Filing_type,
	Filing_uuid,
	Filing_year string
	Lobbyist_exclude               string // bool
	Lobbyist_id                    string // int
	Lobbyist_name, Ordering        string
	Page, Page_size, Registrant_id string // int
	Registrant_name                string
}

func (ListContributionReports) Get

func (ListContributionReports) Query_ingestion

func (r ListContributionReports) Query_ingestion(c Config_api) error

func (ListContributionReports) Retrieve

type ListFilings

type ListFilings struct {
	Affiliated_organization_country          string // enum
	Affiliated_organization_listed_indicator string // bool
	Affiliated_organization_name             string // string
	Client_country                           string // enum
	Client_id                                string // int
	Client_name                              string // string
	Client_ppb_country                       string // enum
	Client_ppb_state                         string // enum
	Client_state                             string // enum
	Ciling_amount_reported_max               string // float
	Filing_amount_reported_min               string // float
	Filing_dt_posted_after                   string // string yyyy-mm-dd
	Filing_dt_posted_before                  string // string yyyy-mm-dd
	Filing_period                            string // enum
	Filing_specific_lobbying_issues          string // string
	Filing_type                              string // enum
	Filing_uuid                              string // string
	Filing_year                              string // enum
	Foreign_entity_country                   string // enum
	Foreign_entity_listed_indicator          string // bool
	Foreign_entity_name                      string // string
	Foreign_entity_ownership_percentage_max  string // string
	Foreign_entity_ownership_percentage_min  string // string
	Foreign_entity_ppb_country               string // enum
	Lobbyist_conviction_date_range_after     string // string yyyy-mm-dd
	Lobbyist_conviction_date_range_before    string // string yyyy-mm-dd
	Lobbyist_conviction_disclosure           string // string
	Lobbyist_conviction_disclosure_indicator string // bool
	Lobbyist_covered_position                string // string
	Lobbyist_covered_position_indicator      string // bool
	Lobbyist_id                              string // integer
	Lobbyist_name                            string // string
	Ordering                                 string // string
	Page                                     string // integer
	Page_size                                string // integer
	Registrant_country                       string // enum
	Registrant_id                            string // integer
	Registrant_name                          string // string
	Registrant_ppb_country                   string // enum
}

func (ListFilings) Get

func (r ListFilings) Get(c Config_api) ([]byte, error)

func (ListFilings) Query_ingestion

func (r ListFilings) Query_ingestion(c Config_api) error

func (ListFilings) Retrieve

func (r ListFilings) Retrieve(c Config_api) ([]Results_listFilings, error)

type ListLobbyists

type ListLobbyists struct {
	Id              string // int
	Lobbyist_name   string // string
	Ordering        string // string
	Page            string // int
	Page_size       string // int
	Registrant_id   string // int
	Registrant_name string // string
}

func (ListLobbyists) Get

func (r ListLobbyists) Get(c Config_api) ([]byte, error)

func (ListLobbyists) Query_ingestion

func (r ListLobbyists) Query_ingestion(c Config_api) error

func (ListLobbyists) Retrieve

type ListRegistrants

type ListRegistrants struct {
	Country           string // any
	Dt_updated_after  string // string date-time yyyy-mm-dd
	Dt_updated_before string // string date-time yyyy-mm-dd
	Id                string // int
	Ordering          string // string
	Page              string // int
	Page_size         string // int
	Ppb_country       string // any
	Registrant_name   string // string
	State             string // any
}

func (ListRegistrants) Get

func (r ListRegistrants) Get(c Config_api) ([]byte, error)

func (ListRegistrants) Query_ingestion

func (r ListRegistrants) Query_ingestion(c Config_api) error

func (ListRegistrants) Retrieve

func (r ListRegistrants) Retrieve(c Config_api) ([]Registrant, error)

type Lobbying_activities

type Lobbying_activities struct {
	Description                string                `json:"description"`
	Doreign_entity_issues      string                `json:"foreign_entity_issues"`
	General_issue_code         string                `json:"general_issue_code"`
	General_issue_code_display string                `json:"general_issue_code_display"`
	Government_entities        []Government_entities `json:"government_entities"`
	Lobbyists                  []Lobbyists           `json:"lobbyists"`
}

type Lobbyist

type Lobbyist struct {
	First_name     string `json:"first_name"`
	Id             int    `json:"id"`
	Last_name      string `json:"last_name"`
	Middle_name    string `json:"middle_name"`
	Nickname       string `json:"nickname"`
	Prefix         string `json:"prefix"`
	Prefix_display string `json:"prefix_display"`
	Suffix         string `json:"suffix"`
	Suffix_display string `json:"suffix_display"`
}

type Lobbyist_registration

type Lobbyist_registration struct {
	First_name     string     `json:"first_name"`
	Id             int        `json:"id"`
	Last_name      string     `json:"last_name"`
	Middle_name    string     `json:"middle_name"`
	Nickname       string     `json:"nickname"`
	Prefix         string     `json:"prefix"`
	Prefix_display string     `json:"prefix_display"`
	Registrant     Registrant `json:"registrant"`
	Suffix         string     `json:"suffix"`
	Suffix_display string     `json:"suffix_display"`
}

func (Lobbyist_registration) Get_Fields

func (r Lobbyist_registration) Get_Fields() (bson.M, error)

func (Lobbyist_registration) Get_fuuid

func (r Lobbyist_registration) Get_fuuid() (string, string)

type Lobbyists

type Lobbyists struct {
	Covered_position string   `json:"covered_position"`
	Lobbyist         Lobbyist `json:"lobbyist"`
	New              bool     `json:"new"`
}

type Registrant

type Registrant struct {
	Address_1           string `json:"address_1"`
	Address_2           string `json:"address_2"`
	Address_3           string `json:"address_3"`
	Address_4           string `json:"address_4"`
	City                string `json:"city"`
	Contact_name        string `json:"contact_name"`
	Contact_telephone   string `json:"contact_telephone"`
	Country             string `json:"country"`
	Country_display     string `json:"country_display"`
	Description         string `json:"description"`
	Dt_updated          string `json:"dt_updated"`
	House_registrant_id int    `json:"house_registrant_id"`
	Id                  int    `json:"id"`
	Name                string `json:"name"`
	Ppb_country         string `json:"ppb_country"`
	Ppb_country_display string `json:"ppb_country_display"`
	State               string `json:"state"`
	State_display       string `json:"state_display"`
	Url                 string `json:"url"`
	Zip                 string `json:"zip"`
}

func (Registrant) Get_Fields

func (r Registrant) Get_Fields() (bson.M, error)

func (Registrant) Get_fuuid

func (r Registrant) Get_fuuid() (string, string)

type Requests

type Requests interface {
	Get(c Config_api) ([]byte, error)
}

type Responses

type Responses[T Result] struct {
	Count    int    `json:"count"`
	Next     string `json:"next"`
	Previous string `json:"previous"`
	Results  []T    `json:"results"`
}

func (*Responses[T]) Flush

func (r *Responses[T]) Flush()

func (Responses[T]) GetCount

func (r Responses[T]) GetCount() int

func (Responses[T]) GetNext

func (r Responses[T]) GetNext() string

func (Responses[T]) GetPrevious

func (r Responses[T]) GetPrevious() string

func (Responses[T]) GetResults

func (r Responses[T]) GetResults() []T

type Result

type Result interface {
	Get_Fields() (bson.M, error)
	Get_fuuid() (string, string)
}

type Result_listContributionReports

type Result_listContributionReports struct {
	Address_1                    string              `json:"address_1"`
	Address_2                    string              `json:"address_2"`
	City                         string              `json:"city"`
	Comments                     string              `json:"comments"`
	Contact_name                 string              `json:"contact_name"`
	Contribution_items           []Contribution_item `json:"contribution_items"`
	Country                      string              `json:"country"`
	Country_display              string              `json:"country_display"`
	Dt_posted                    string              `json:"dt_posted"`
	Filer_type                   string              `json:"filer_type"`
	Filer_type_display           string              `json:"filer_type_display"`
	Filing_document_content_type string              `json:"filing_document_content_type"`
	Filing_document_url          string              `json:"filing_document_url"`
	Filing_period                string              `json:"filing_period"`
	Filing_period_display        string              `json:"filing_period_display"`
	Filing_type                  string              `json:"filing_type"`
	Filing_type_display          string              `json:"filing_type_display"`
	Filing_uuid                  string              `json:"filing_uuid"`
	Filing_year                  int                 `json:"filing_year"`
	Lobbyist                     Lobbyist            `json:"lobbyist"`
	No_contributions             bool                `json:"no_contributions"`
	Pacs                         []string            `json:"pacs"`
	Registrant                   Registrant          `json:"registrant"`
	State                        string              `json:"state"`
	State_display                string              `json:"state_display"`
	Url                          string              `json:"url"`
	Zip                          string              `json:"zip"`
}

func (Result_listContributionReports) Get_Fields

func (r Result_listContributionReports) Get_Fields() (bson.M, error)

func (Result_listContributionReports) Get_fuuid

func (r Result_listContributionReports) Get_fuuid() (string, string)

type Results_listFilings

type Results_listFilings struct {
	Affiliated_organizations     []Affiliated_organizations `json:"affiliated_organizations"`
	Client                       Client                     `json:"client"`
	Conviction_disclosures       []Conviction_disclosure    `json:"conviction_disclosures"`
	Foreign_entities             []Foreign_entities         `json:"foreign_entities"`
	Lobbying_activities          []Lobbying_activities      `json:"lobbying_activities"`
	Registrant                   Registrant                 `json:"registrant"`
	Dt_posted                    string                     `json:"dt_posted"`
	Expenses                     string                     `json:"expenses"`
	Expenses_method              string                     `json:"expenses_method"`
	Expenses_method_display      string                     `json:"expenses_method_display"`
	Filing_document_content_type string                     `json:"filing_document_content_type"`
	Filing_document_url          string                     `json:"filing_document_url"`
	Filing_period                string                     `json:"filing_period"`
	Filing_period_display        string                     `json:"filing_period_display"`
	Filing_type                  string                     `json:"filing_type"`
	Filing_type_display          string                     `json:"filing_type_display"`
	Filing_uuid                  string                     `json:"filing_uuid"`
	Filing_year                  int                        `json:"filing_year"`
	Income                       string                     `json:"income"`
	Posted_by_name               string                     `json:"posted_by_name"`
	Registrant_address_1         string                     `json:"registrant_address_1"`
	Registrant_address_2         string                     `json:"registrant_address_2"`
	Registrant_city              string                     `json:"registrant_city"`
	Registrant_country           string                     `json:"registrant_country"`
	Registrant_different_address bool                       `json:"registrant_different_address"`
	Registrant_ppb_country       string                     `json:"registrant_ppb_country"`
	Registrant_state             string                     `json:"registrant_state"`
	Registrant_zip               string                     `json:"registrant_zip"`
	Termination_date             string                     `json:"termination_date"`
	Url                          string                     `json:"url"`
}

func (Results_listFilings) Get_Fields

func (r Results_listFilings) Get_Fields() (bson.M, error)

func (Results_listFilings) Get_fuuid

func (r Results_listFilings) Get_fuuid() (string, string)

type RetrieveClient

type RetrieveClient struct {
	Id string // int
}

func (RetrieveClient) Query_ingestion

func (r RetrieveClient) Query_ingestion(c Config_api) error

func (RetrieveClient) Retrieve

func (r RetrieveClient) Retrieve(c Config_api) ([]Clients, error)

type RetrieveContributionReport

type RetrieveContributionReport struct {
	Filing_uuid string
}

func (RetrieveContributionReport) Query_ingestion

func (r RetrieveContributionReport) Query_ingestion(c Config_api) error

func (RetrieveContributionReport) Retrieve

type RetrieveFiling

type RetrieveFiling struct {
	Filing_uuid string
}

func (RetrieveFiling) Query_ingestion

func (r RetrieveFiling) Query_ingestion(c Config_api) error

func (RetrieveFiling) Retrieve

type RetrieveLobbyist

type RetrieveLobbyist struct {
	Id string // int
}

func (RetrieveLobbyist) Query_ingestion

func (r RetrieveLobbyist) Query_ingestion(c Config_api) error

func (RetrieveLobbyist) Retrieve

type RetrieveRegistrant

type RetrieveRegistrant struct {
	Id string // int
}

func (RetrieveRegistrant) Query_ingestion

func (r RetrieveRegistrant) Query_ingestion(c Config_api) error

func (RetrieveRegistrant) Retrieve

func (r RetrieveRegistrant) Retrieve(c Config_api) ([]Registrant, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL