/* tslint:disable */ /* eslint-disable */ /** * Congress.gov API * The Congress.gov API provides programmatic access to legislative data from the United States Congress. This API enables developers to search, retrieve, and analyze legislative data including bills, resolutions, amendments, and congressional records. This is NOT the official congress.gov YAML and contains modifications. Currently only supports 8/100 API operations. Bill API: 0/16 Amendments API: 0/8 Summaries API: 0/3 Congress API: 0/3 Member API: 8/8 ✅ Committee API: 0/10 Committee Report API: 0/5 Committee Print API: 0/5 Committee Meeting API: 0/4 Hearing API: 0/4 Congressional Record API: 0/1 Daily Congressional Record API: 0/4 Bound Congressional Record API: 0/4 House Communication API: 0/4 House Requirement API: 0/3 Senate Communication API: 0/4 Nomination API: 0/7 Treaty API: 0/7 * * The version of the OpenAPI document: 0.1.8 * Contact: liudotjson@gmail.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from "./configuration"; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from "axios"; import globalAxios from "axios"; // URLSearchParams not necessarily used // @ts-ignore import { URL, URLSearchParams } from "url"; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, } from "./common"; import type { RequestArgs } from "./base"; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError, operationServerMap, } from "./base"; /** * Address information. * @export * @interface AddressInformation */ export interface AddressInformation { /** * City. * @type {string} * @memberof AddressInformation */ city?: string; /** * District. * @type {string} * @memberof AddressInformation */ district?: string; /** * Office address. * @type {string} * @memberof AddressInformation */ officeAddress?: string; /** * Phone number. * @type {string} * @memberof AddressInformation */ phoneNumber?: string; /** * Zip code. * @type {number} * @memberof AddressInformation */ zipCode?: number; } /** * The member\'s Biographical Directory picture. * @export * @interface BioguideDepiction */ export interface BioguideDepiction { /** * The source of the image. * @type {string} * @memberof BioguideDepiction */ attribution: string; /** * The image URL. * @type {string} * @memberof BioguideDepiction */ imageUrl: string; } /** * Chamber of Congress. * @export * @enum {string} */ export const Chamber = { HouseOfRepresentatives: "House of Representatives", Senate: "Senate", } as const; export type Chamber = (typeof Chamber)[keyof typeof Chamber]; /** * * @export * @interface CongressMemberDetails */ export interface CongressMemberDetails { /** * * @type {AddressInformation} * @memberof CongressMemberDetails */ addressInformation?: AddressInformation; /** * The member\'s Biographical Directory ID. * @type {string} * @memberof CongressMemberDetails */ bioguideId: string; /** * Year of birth. * @type {number} * @memberof CongressMemberDetails */ birthYear: number; /** * * @type {CosponsoredLegislation} * @memberof CongressMemberDetails */ cosponsoredLegislation?: CosponsoredLegislation; /** * Is the member currently serving. * @type {boolean} * @memberof CongressMemberDetails */ currentMember: boolean; /** * * @type {BioguideDepiction} * @memberof CongressMemberDetails */ depiction?: BioguideDepiction; /** * Direct order name. * @type {string} * @memberof CongressMemberDetails */ directOrderName: string; /** * District number. * @type {number} * @memberof CongressMemberDetails */ district?: number; /** * First name. * @type {string} * @memberof CongressMemberDetails */ firstName: string; /** * Honorific name. * @type {string} * @memberof CongressMemberDetails */ honorificName?: string; /** * Inverted order name. * @type {string} * @memberof CongressMemberDetails */ invertedOrderName: string; /** * Last name. * @type {string} * @memberof CongressMemberDetails */ lastName: string; /** * Leadership role. * @type {Array} * @memberof CongressMemberDetails */ leadership?: Array; /** * Middle name. * @type {string} * @memberof CongressMemberDetails */ middleName?: string; /** * Nick name. * @type {string} * @memberof CongressMemberDetails */ nickName?: string; /** * Official website URL. * @type {string} * @memberof CongressMemberDetails */ officialWebsiteUrl: string; /** * Party history. * @type {Array} * @memberof CongressMemberDetails */ partyHistory: Array; /** * * @type {SponsoredLegislation} * @memberof CongressMemberDetails */ sponsoredLegislation?: SponsoredLegislation; /** * State name. * @type {string} * @memberof CongressMemberDetails */ state: string; /** * Suffix name. * @type {string} * @memberof CongressMemberDetails */ suffixName?: string; /** * Detailed terms served. * @type {Array} * @memberof CongressMemberDetails */ terms: Array; /** * Time the record was last updated. Format: YYYY-MM-DDT00:00:00Z. * @type {string} * @memberof CongressMemberDetails */ updateDate: string; } /** * * @export * @interface CongressMemberDetailsResponse */ export interface CongressMemberDetailsResponse { /** * * @type {CongressMemberDetails} * @memberof CongressMemberDetailsResponse */ member: CongressMemberDetails; } /** * * @export * @interface CongressMemberListErrorResponse */ export interface CongressMemberListErrorResponse { /** * Error message. * @type {string} * @memberof CongressMemberListErrorResponse */ error: string; } /** * * @export * @interface CongressMemberListResponse */ export interface CongressMemberListResponse { /** * List of Congress members. * @type {Array} * @memberof CongressMemberListResponse */ members: Array; /** * * @type {Pagination} * @memberof CongressMemberListResponse */ pagination: Pagination; } /** * * @export * @interface CongressMemberOverview */ export interface CongressMemberOverview { /** * The member\'s Biographical Directory ID. * @type {string} * @memberof CongressMemberOverview */ bioguideId: string; /** * * @type {BioguideDepiction} * @memberof CongressMemberOverview */ depiction?: BioguideDepiction; /** * District number. * @type {number} * @memberof CongressMemberOverview */ district: number; /** * Congress member name. * @type {string} * @memberof CongressMemberOverview */ name: string; /** * Party name. * @type {string} * @memberof CongressMemberOverview */ partyName: string; /** * State name. * @type {string} * @memberof CongressMemberOverview */ state: string; /** * * @type {Terms} * @memberof CongressMemberOverview */ terms: Terms; /** * Time the record was last updated. Format: YYYY-MM-DDT00:00:00Z. * @type {string} * @memberof CongressMemberOverview */ updateDate: string; } /** * * @export * @interface CosponsoredLegislation */ export interface CosponsoredLegislation { /** * Total number of cosponsored legislation. * @type {number} * @memberof CosponsoredLegislation */ count?: number; } /** * Detailed term in Congress. * @export * @interface DetailedTermItem */ export interface DetailedTermItem { /** * * @type {Chamber} * @memberof DetailedTermItem */ chamber: Chamber; /** * Congress number. * @type {number} * @memberof DetailedTermItem */ congress: number; /** * District number. * @type {number} * @memberof DetailedTermItem */ district: number; /** * End year of the term. * @type {number} * @memberof DetailedTermItem */ endYear?: number; /** * * @type {MemberType} * @memberof DetailedTermItem */ memberType: MemberType; /** * Start year of the term. * @type {number} * @memberof DetailedTermItem */ startYear: number; /** * State code. * @type {string} * @memberof DetailedTermItem */ stateCode: string; /** * State name. * @type {string} * @memberof DetailedTermItem */ stateName: string; } /** * * @export * @interface ForbiddenError */ export interface ForbiddenError { /** * The specific error code indicating the type of error. * @type {string} * @memberof ForbiddenError */ code: ForbiddenErrorCodeEnum; /** * A human-readable message explaining the error. * @type {string} * @memberof ForbiddenError */ message: string; } export const ForbiddenErrorCodeEnum = { Invalid: "API_KEY_INVALID", Missing: "API_KEY_MISSING", } as const; export type ForbiddenErrorCodeEnum = (typeof ForbiddenErrorCodeEnum)[keyof typeof ForbiddenErrorCodeEnum]; /** * * @export * @interface ForbiddenErrorResponse */ export interface ForbiddenErrorResponse { /** * * @type {ForbiddenError} * @memberof ForbiddenErrorResponse */ error: ForbiddenError; } /** * * @export * @interface LeadershipRole */ export interface LeadershipRole { /** * Congress number. * @type {number} * @memberof LeadershipRole */ congress?: number; /** * Is the member currently serving. * @type {boolean} * @memberof LeadershipRole */ current?: boolean; /** * Leadership role type. * @type {string} * @memberof LeadershipRole */ type?: string; } /** * Latest action on the legislation. * @export * @interface LegislationLatestAction */ export interface LegislationLatestAction { /** * Date of the action. * @type {string} * @memberof LegislationLatestAction */ actionDate: string; /** * Time of the action. * @type {string} * @memberof LegislationLatestAction */ actionTime?: string; /** * Action text. * @type {string} * @memberof LegislationLatestAction */ text: string; } /** * Legislation overview. * @export * @interface LegislationOverview */ export interface LegislationOverview { /** * Congress number. * @type {number} * @memberof LegislationOverview */ congress: number; /** * Date the legislation was introduced. Format: YYYY-MM-DD. * @type {string} * @memberof LegislationOverview */ introducedDate: string; /** * * @type {LegislationLatestAction} * @memberof LegislationOverview */ latestAction?: LegislationLatestAction; /** * Legislation number. * @type {string} * @memberof LegislationOverview */ number: string; /** * * @type {PolicyArea} * @memberof LegislationOverview */ policyArea: PolicyArea; /** * Legislation title. * @type {string} * @memberof LegislationOverview */ title: string; /** * Legislation type. * @type {string} * @memberof LegislationOverview */ type: string; } /** * * @export * @interface MemberCosponsoredLegislationResponse */ export interface MemberCosponsoredLegislationResponse { /** * List of cosponsored legislation. * @type {Array} * @memberof MemberCosponsoredLegislationResponse */ cosponsoredLegislation: Array; /** * * @type {Pagination} * @memberof MemberCosponsoredLegislationResponse */ pagination: Pagination; } /** * * @export * @interface MemberSponsoredLegislationResponse */ export interface MemberSponsoredLegislationResponse { /** * List of sponsored legislation. * @type {Array} * @memberof MemberSponsoredLegislationResponse */ sponsoredLegislation: Array; /** * * @type {Pagination} * @memberof MemberSponsoredLegislationResponse */ pagination: Pagination; } /** * Member type. * @export * @enum {string} */ export const MemberType = { Representative: "Representative", Senator: "Senator", } as const; export type MemberType = (typeof MemberType)[keyof typeof MemberType]; /** * Pagination object. * @export * @interface Pagination */ export interface Pagination { /** * Total number of records. * @type {number} * @memberof Pagination */ count: number; /** * URL of the next page of records. * @type {string} * @memberof Pagination */ next?: string; /** * URL of the next page of records. * @type {string} * @memberof Pagination */ prev?: string; } /** * Historical party information. * @export * @interface PartyHistoryItem */ export interface PartyHistoryItem { /** * Party abbreviation. * @type {string} * @memberof PartyHistoryItem */ partyAbbreviation: string; /** * Party name. * @type {string} * @memberof PartyHistoryItem */ partyName: string; /** * Start year. * @type {number} * @memberof PartyHistoryItem */ startYear: number; /** * End year. * @type {number} * @memberof PartyHistoryItem */ endYear?: number; } /** * Policy area. * @export * @interface PolicyArea */ export interface PolicyArea { /** * Policy area name. * @type {string} * @memberof PolicyArea */ name: string; } /** * Error object. * @export * @interface RateLimitError */ export interface RateLimitError { /** * Error code. * @type {string} * @memberof RateLimitError */ code: RateLimitErrorCodeEnum; /** * Error message. * @type {string} * @memberof RateLimitError */ message: string; } export const RateLimitErrorCodeEnum = { OverRateLimit: "OVER_RATE_LIMIT", } as const; export type RateLimitErrorCodeEnum = (typeof RateLimitErrorCodeEnum)[keyof typeof RateLimitErrorCodeEnum]; /** * * @export * @interface RateLimitErrorResponse */ export interface RateLimitErrorResponse { /** * * @type {RateLimitError} * @memberof RateLimitErrorResponse */ error: RateLimitError; } /** * * @export * @interface ResourceNotFoundErrorResponse */ export interface ResourceNotFoundErrorResponse { /** * Error message. * @type {string} * @memberof ResourceNotFoundErrorResponse */ error: string; } /** * * @export * @interface SponsoredLegislation */ export interface SponsoredLegislation { /** * Total number of sponsored legislation. * @type {number} * @memberof SponsoredLegislation */ count?: number; } /** * Term in Congress. * @export * @interface TermItem */ export interface TermItem { /** * * @type {Chamber} * @memberof TermItem */ chamber: Chamber; /** * End year of the term. * @type {number} * @memberof TermItem */ endYear?: number; /** * Start year of the term. * @type {number} * @memberof TermItem */ startYear: number; } /** * Terms served. * @export * @interface Terms */ export interface Terms { /** * * @type {Array} * @memberof Terms */ item?: Array; } /** * CongressApi - axios parameter creator * @export */ export const CongressApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * Get a list of legislation cosponsored by a member. Supports query parameters for pagination. * @summary Returns a list of legislation cosponsored by a congressional member. * @param {string} bioguideId The member\'s Biographical Directory ID. * @param {number} [offset] The starting record returned. 0 is the first record. * @param {number} [limit] The number of records returned. The maximum limit is 250. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMemberCosponsoredLegislation: async ( bioguideId: string, offset?: number, limit?: number, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'bioguideId' is not null or undefined assertParamExists( "getMemberCosponsoredLegislation", "bioguideId", bioguideId, ); const localVarPath = `/member/{bioguideId}/cosponsored-legislation`.replace( `{${"bioguideId"}}`, encodeURIComponent(String(bioguideId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarQueryParameter, "api_key", configuration); if (offset !== undefined) { localVarQueryParameter["offset"] = offset; } if (limit !== undefined) { localVarQueryParameter["limit"] = limit; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get a member\'s details from their bioguideId. * @summary Returns details of a single congressional member. * @param {string} bioguideId The member\'s Biographical Directory ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMemberDetails: async ( bioguideId: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'bioguideId' is not null or undefined assertParamExists("getMemberDetails", "bioguideId", bioguideId); const localVarPath = `/member/{bioguideId}`.replace( `{${"bioguideId"}}`, encodeURIComponent(String(bioguideId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarQueryParameter, "api_key", configuration); setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get a list of legislation sponsored by a member. Supports query parameters for pagination. * @summary Returns a list of legislation sponsored by a congressional member. * @param {string} bioguideId The member\'s Biographical Directory ID. * @param {number} [offset] The starting record returned. 0 is the first record. * @param {number} [limit] The number of records returned. The maximum limit is 250. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMemberSponsoredLegislation: async ( bioguideId: string, offset?: number, limit?: number, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'bioguideId' is not null or undefined assertParamExists( "getMemberSponsoredLegislation", "bioguideId", bioguideId, ); const localVarPath = `/member/{bioguideId}/sponsored-legislation`.replace( `{${"bioguideId"}}`, encodeURIComponent(String(bioguideId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarQueryParameter, "api_key", configuration); if (offset !== undefined) { localVarQueryParameter["offset"] = offset; } if (limit !== undefined) { localVarQueryParameter["limit"] = limit; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get congress member list. Supports query parameters for pagination and filtering. * @summary Returns a list of congressional members. * @param {number} [offset] The starting record returned. 0 is the first record. * @param {number} [limit] The number of records returned. The maximum limit is 250. * @param {string} [fromDateTime] The starting timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {string} [toDateTime] The ending timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {boolean} [currentMember] The status of the member. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMembers: async ( offset?: number, limit?: number, fromDateTime?: string, toDateTime?: string, currentMember?: boolean, options: RawAxiosRequestConfig = {}, ): Promise => { const localVarPath = `/member`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarQueryParameter, "api_key", configuration); if (offset !== undefined) { localVarQueryParameter["offset"] = offset; } if (limit !== undefined) { localVarQueryParameter["limit"] = limit; } if (fromDateTime !== undefined) { localVarQueryParameter["fromDateTime"] = (fromDateTime as any) instanceof Date ? (fromDateTime as any).toISOString() : fromDateTime; } if (toDateTime !== undefined) { localVarQueryParameter["toDateTime"] = (toDateTime as any) instanceof Date ? (toDateTime as any).toISOString() : toDateTime; } if (currentMember !== undefined) { localVarQueryParameter["currentMember"] = currentMember; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get congress member list by congress number. Supports query parameters for filtering. * @summary Returns a list of congressional members by congress number. * @param {number} congress The member\'s congress number (e.g., 118 for the 118th Congress, 2023-2025) * @param {number} [offset] The starting record returned. 0 is the first record. * @param {number} [limit] The number of records returned. The maximum limit is 250. * @param {string} [fromDateTime] The starting timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {string} [toDateTime] The ending timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {boolean} [currentMember] The status of the member. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMembersByCongress: async ( congress: number, offset?: number, limit?: number, fromDateTime?: string, toDateTime?: string, currentMember?: boolean, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'congress' is not null or undefined assertParamExists("getMembersByCongress", "congress", congress); const localVarPath = `/member/congress/{congress}`.replace( `{${"congress"}}`, encodeURIComponent(String(congress)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarQueryParameter, "api_key", configuration); if (offset !== undefined) { localVarQueryParameter["offset"] = offset; } if (limit !== undefined) { localVarQueryParameter["limit"] = limit; } if (fromDateTime !== undefined) { localVarQueryParameter["fromDateTime"] = (fromDateTime as any) instanceof Date ? (fromDateTime as any).toISOString() : fromDateTime; } if (toDateTime !== undefined) { localVarQueryParameter["toDateTime"] = (toDateTime as any) instanceof Date ? (toDateTime as any).toISOString() : toDateTime; } if (currentMember !== undefined) { localVarQueryParameter["currentMember"] = currentMember; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get congress member list by congress number and state code and district. Supports query parameters for filtering. * @summary Returns a list of congressional members by congress number, state code, and district. * @param {number} congress The member\'s congress number (e.g., 118 for the 118th Congress, 2023-2025) * @param {string} stateCode The member\'s state code (pattern: ^[A-Z]{2}$). * @param {string} district The member\'s district number (pattern: ^\\d{2}$). * @param {number} [offset] The starting record returned. 0 is the first record. * @param {number} [limit] The number of records returned. The maximum limit is 250. * @param {string} [fromDateTime] The starting timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {string} [toDateTime] The ending timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {boolean} [currentMember] The status of the member. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMembersByCongressAndStateAndDistrict: async ( congress: number, stateCode: string, district: string, offset?: number, limit?: number, fromDateTime?: string, toDateTime?: string, currentMember?: boolean, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'congress' is not null or undefined assertParamExists( "getMembersByCongressAndStateAndDistrict", "congress", congress, ); // verify required parameter 'stateCode' is not null or undefined assertParamExists( "getMembersByCongressAndStateAndDistrict", "stateCode", stateCode, ); // verify required parameter 'district' is not null or undefined assertParamExists( "getMembersByCongressAndStateAndDistrict", "district", district, ); const localVarPath = `/member/congress/{congress}/{stateCode}/{district}` .replace(`{${"congress"}}`, encodeURIComponent(String(congress))) .replace(`{${"stateCode"}}`, encodeURIComponent(String(stateCode))) .replace(`{${"district"}}`, encodeURIComponent(String(district))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarQueryParameter, "api_key", configuration); if (offset !== undefined) { localVarQueryParameter["offset"] = offset; } if (limit !== undefined) { localVarQueryParameter["limit"] = limit; } if (fromDateTime !== undefined) { localVarQueryParameter["fromDateTime"] = (fromDateTime as any) instanceof Date ? (fromDateTime as any).toISOString() : fromDateTime; } if (toDateTime !== undefined) { localVarQueryParameter["toDateTime"] = (toDateTime as any) instanceof Date ? (toDateTime as any).toISOString() : toDateTime; } if (currentMember !== undefined) { localVarQueryParameter["currentMember"] = currentMember; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get congress member list by state code. Supports query parameters for filtering. * @summary Returns a list of congressional members by state code. * @param {string} stateCode The member\'s state code (pattern: ^[A-Z]{2}$). * @param {number} [offset] The starting record returned. 0 is the first record. * @param {number} [limit] The number of records returned. The maximum limit is 250. * @param {string} [fromDateTime] The starting timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {string} [toDateTime] The ending timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {boolean} [currentMember] The status of the member. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMembersByState: async ( stateCode: string, offset?: number, limit?: number, fromDateTime?: string, toDateTime?: string, currentMember?: boolean, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'stateCode' is not null or undefined assertParamExists("getMembersByState", "stateCode", stateCode); const localVarPath = `/member/{stateCode}`.replace( `{${"stateCode"}}`, encodeURIComponent(String(stateCode)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarQueryParameter, "api_key", configuration); if (offset !== undefined) { localVarQueryParameter["offset"] = offset; } if (limit !== undefined) { localVarQueryParameter["limit"] = limit; } if (fromDateTime !== undefined) { localVarQueryParameter["fromDateTime"] = (fromDateTime as any) instanceof Date ? (fromDateTime as any).toISOString() : fromDateTime; } if (toDateTime !== undefined) { localVarQueryParameter["toDateTime"] = (toDateTime as any) instanceof Date ? (toDateTime as any).toISOString() : toDateTime; } if (currentMember !== undefined) { localVarQueryParameter["currentMember"] = currentMember; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get congress member list by state code and district. Supports query parameters for filtering. * @summary Returns a list of congressional members by state code and district. * @param {string} stateCode The member\'s state code (pattern: ^[A-Z]{2}$). * @param {string} district The member\'s district number (pattern: ^\\d{2}$). * @param {number} [offset] The starting record returned. 0 is the first record. * @param {number} [limit] The number of records returned. The maximum limit is 250. * @param {string} [fromDateTime] The starting timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {string} [toDateTime] The ending timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {boolean} [currentMember] The status of the member. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMembersByStateAndDistrict: async ( stateCode: string, district: string, offset?: number, limit?: number, fromDateTime?: string, toDateTime?: string, currentMember?: boolean, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'stateCode' is not null or undefined assertParamExists("getMembersByStateAndDistrict", "stateCode", stateCode); // verify required parameter 'district' is not null or undefined assertParamExists("getMembersByStateAndDistrict", "district", district); const localVarPath = `/member/{stateCode}/{district}` .replace(`{${"stateCode"}}`, encodeURIComponent(String(stateCode))) .replace(`{${"district"}}`, encodeURIComponent(String(district))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: "GET", ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication ApiKeyAuth required await setApiKeyToObject(localVarQueryParameter, "api_key", configuration); if (offset !== undefined) { localVarQueryParameter["offset"] = offset; } if (limit !== undefined) { localVarQueryParameter["limit"] = limit; } if (fromDateTime !== undefined) { localVarQueryParameter["fromDateTime"] = (fromDateTime as any) instanceof Date ? (fromDateTime as any).toISOString() : fromDateTime; } if (toDateTime !== undefined) { localVarQueryParameter["toDateTime"] = (toDateTime as any) instanceof Date ? (toDateTime as any).toISOString() : toDateTime; } if (currentMember !== undefined) { localVarQueryParameter["currentMember"] = currentMember; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * CongressApi - functional programming interface * @export */ export const CongressApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = CongressApiAxiosParamCreator(configuration); return { /** * Get a list of legislation cosponsored by a member. Supports query parameters for pagination. * @summary Returns a list of legislation cosponsored by a congressional member. * @param {string} bioguideId The member\'s Biographical Directory ID. * @param {number} [offset] The starting record returned. 0 is the first record. * @param {number} [limit] The number of records returned. The maximum limit is 250. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getMemberCosponsoredLegislation( bioguideId: string, offset?: number, limit?: number, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getMemberCosponsoredLegislation( bioguideId, offset, limit, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap["CongressApi.getMemberCosponsoredLegislation"]?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * Get a member\'s details from their bioguideId. * @summary Returns details of a single congressional member. * @param {string} bioguideId The member\'s Biographical Directory ID. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getMemberDetails( bioguideId: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getMemberDetails(bioguideId, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap["CongressApi.getMemberDetails"]?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * Get a list of legislation sponsored by a member. Supports query parameters for pagination. * @summary Returns a list of legislation sponsored by a congressional member. * @param {string} bioguideId The member\'s Biographical Directory ID. * @param {number} [offset] The starting record returned. 0 is the first record. * @param {number} [limit] The number of records returned. The maximum limit is 250. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getMemberSponsoredLegislation( bioguideId: string, offset?: number, limit?: number, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getMemberSponsoredLegislation( bioguideId, offset, limit, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap["CongressApi.getMemberSponsoredLegislation"]?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * Get congress member list. Supports query parameters for pagination and filtering. * @summary Returns a list of congressional members. * @param {number} [offset] The starting record returned. 0 is the first record. * @param {number} [limit] The number of records returned. The maximum limit is 250. * @param {string} [fromDateTime] The starting timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {string} [toDateTime] The ending timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {boolean} [currentMember] The status of the member. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getMembers( offset?: number, limit?: number, fromDateTime?: string, toDateTime?: string, currentMember?: boolean, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getMembers( offset, limit, fromDateTime, toDateTime, currentMember, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap["CongressApi.getMembers"]?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * Get congress member list by congress number. Supports query parameters for filtering. * @summary Returns a list of congressional members by congress number. * @param {number} congress The member\'s congress number (e.g., 118 for the 118th Congress, 2023-2025) * @param {number} [offset] The starting record returned. 0 is the first record. * @param {number} [limit] The number of records returned. The maximum limit is 250. * @param {string} [fromDateTime] The starting timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {string} [toDateTime] The ending timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {boolean} [currentMember] The status of the member. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getMembersByCongress( congress: number, offset?: number, limit?: number, fromDateTime?: string, toDateTime?: string, currentMember?: boolean, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getMembersByCongress( congress, offset, limit, fromDateTime, toDateTime, currentMember, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap["CongressApi.getMembersByCongress"]?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * Get congress member list by congress number and state code and district. Supports query parameters for filtering. * @summary Returns a list of congressional members by congress number, state code, and district. * @param {number} congress The member\'s congress number (e.g., 118 for the 118th Congress, 2023-2025) * @param {string} stateCode The member\'s state code (pattern: ^[A-Z]{2}$). * @param {string} district The member\'s district number (pattern: ^\\d{2}$). * @param {number} [offset] The starting record returned. 0 is the first record. * @param {number} [limit] The number of records returned. The maximum limit is 250. * @param {string} [fromDateTime] The starting timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {string} [toDateTime] The ending timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {boolean} [currentMember] The status of the member. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getMembersByCongressAndStateAndDistrict( congress: number, stateCode: string, district: string, offset?: number, limit?: number, fromDateTime?: string, toDateTime?: string, currentMember?: boolean, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getMembersByCongressAndStateAndDistrict( congress, stateCode, district, offset, limit, fromDateTime, toDateTime, currentMember, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap[ "CongressApi.getMembersByCongressAndStateAndDistrict" ]?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * Get congress member list by state code. Supports query parameters for filtering. * @summary Returns a list of congressional members by state code. * @param {string} stateCode The member\'s state code (pattern: ^[A-Z]{2}$). * @param {number} [offset] The starting record returned. 0 is the first record. * @param {number} [limit] The number of records returned. The maximum limit is 250. * @param {string} [fromDateTime] The starting timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {string} [toDateTime] The ending timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {boolean} [currentMember] The status of the member. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getMembersByState( stateCode: string, offset?: number, limit?: number, fromDateTime?: string, toDateTime?: string, currentMember?: boolean, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getMembersByState( stateCode, offset, limit, fromDateTime, toDateTime, currentMember, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap["CongressApi.getMembersByState"]?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * Get congress member list by state code and district. Supports query parameters for filtering. * @summary Returns a list of congressional members by state code and district. * @param {string} stateCode The member\'s state code (pattern: ^[A-Z]{2}$). * @param {string} district The member\'s district number (pattern: ^\\d{2}$). * @param {number} [offset] The starting record returned. 0 is the first record. * @param {number} [limit] The number of records returned. The maximum limit is 250. * @param {string} [fromDateTime] The starting timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {string} [toDateTime] The ending timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @param {boolean} [currentMember] The status of the member. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getMembersByStateAndDistrict( stateCode: string, district: string, offset?: number, limit?: number, fromDateTime?: string, toDateTime?: string, currentMember?: boolean, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getMembersByStateAndDistrict( stateCode, district, offset, limit, fromDateTime, toDateTime, currentMember, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap["CongressApi.getMembersByStateAndDistrict"]?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * CongressApi - factory interface * @export */ export const CongressApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = CongressApiFp(configuration); return { /** * Get a list of legislation cosponsored by a member. Supports query parameters for pagination. * @summary Returns a list of legislation cosponsored by a congressional member. * @param {CongressApiGetMemberCosponsoredLegislationRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMemberCosponsoredLegislation( requestParameters: CongressApiGetMemberCosponsoredLegislationRequest, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getMemberCosponsoredLegislation( requestParameters.bioguideId, requestParameters.offset, requestParameters.limit, options, ) .then((request) => request(axios, basePath)); }, /** * Get a member\'s details from their bioguideId. * @summary Returns details of a single congressional member. * @param {CongressApiGetMemberDetailsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMemberDetails( requestParameters: CongressApiGetMemberDetailsRequest, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getMemberDetails(requestParameters.bioguideId, options) .then((request) => request(axios, basePath)); }, /** * Get a list of legislation sponsored by a member. Supports query parameters for pagination. * @summary Returns a list of legislation sponsored by a congressional member. * @param {CongressApiGetMemberSponsoredLegislationRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMemberSponsoredLegislation( requestParameters: CongressApiGetMemberSponsoredLegislationRequest, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getMemberSponsoredLegislation( requestParameters.bioguideId, requestParameters.offset, requestParameters.limit, options, ) .then((request) => request(axios, basePath)); }, /** * Get congress member list. Supports query parameters for pagination and filtering. * @summary Returns a list of congressional members. * @param {CongressApiGetMembersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMembers( requestParameters: CongressApiGetMembersRequest = {}, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getMembers( requestParameters.offset, requestParameters.limit, requestParameters.fromDateTime, requestParameters.toDateTime, requestParameters.currentMember, options, ) .then((request) => request(axios, basePath)); }, /** * Get congress member list by congress number. Supports query parameters for filtering. * @summary Returns a list of congressional members by congress number. * @param {CongressApiGetMembersByCongressRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMembersByCongress( requestParameters: CongressApiGetMembersByCongressRequest, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getMembersByCongress( requestParameters.congress, requestParameters.offset, requestParameters.limit, requestParameters.fromDateTime, requestParameters.toDateTime, requestParameters.currentMember, options, ) .then((request) => request(axios, basePath)); }, /** * Get congress member list by congress number and state code and district. Supports query parameters for filtering. * @summary Returns a list of congressional members by congress number, state code, and district. * @param {CongressApiGetMembersByCongressAndStateAndDistrictRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMembersByCongressAndStateAndDistrict( requestParameters: CongressApiGetMembersByCongressAndStateAndDistrictRequest, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getMembersByCongressAndStateAndDistrict( requestParameters.congress, requestParameters.stateCode, requestParameters.district, requestParameters.offset, requestParameters.limit, requestParameters.fromDateTime, requestParameters.toDateTime, requestParameters.currentMember, options, ) .then((request) => request(axios, basePath)); }, /** * Get congress member list by state code. Supports query parameters for filtering. * @summary Returns a list of congressional members by state code. * @param {CongressApiGetMembersByStateRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMembersByState( requestParameters: CongressApiGetMembersByStateRequest, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getMembersByState( requestParameters.stateCode, requestParameters.offset, requestParameters.limit, requestParameters.fromDateTime, requestParameters.toDateTime, requestParameters.currentMember, options, ) .then((request) => request(axios, basePath)); }, /** * Get congress member list by state code and district. Supports query parameters for filtering. * @summary Returns a list of congressional members by state code and district. * @param {CongressApiGetMembersByStateAndDistrictRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getMembersByStateAndDistrict( requestParameters: CongressApiGetMembersByStateAndDistrictRequest, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getMembersByStateAndDistrict( requestParameters.stateCode, requestParameters.district, requestParameters.offset, requestParameters.limit, requestParameters.fromDateTime, requestParameters.toDateTime, requestParameters.currentMember, options, ) .then((request) => request(axios, basePath)); }, }; }; /** * Request parameters for getMemberCosponsoredLegislation operation in CongressApi. * @export * @interface CongressApiGetMemberCosponsoredLegislationRequest */ export interface CongressApiGetMemberCosponsoredLegislationRequest { /** * The member\'s Biographical Directory ID. * @type {string} * @memberof CongressApiGetMemberCosponsoredLegislation */ readonly bioguideId: string; /** * The starting record returned. 0 is the first record. * @type {number} * @memberof CongressApiGetMemberCosponsoredLegislation */ readonly offset?: number; /** * The number of records returned. The maximum limit is 250. * @type {number} * @memberof CongressApiGetMemberCosponsoredLegislation */ readonly limit?: number; } /** * Request parameters for getMemberDetails operation in CongressApi. * @export * @interface CongressApiGetMemberDetailsRequest */ export interface CongressApiGetMemberDetailsRequest { /** * The member\'s Biographical Directory ID. * @type {string} * @memberof CongressApiGetMemberDetails */ readonly bioguideId: string; } /** * Request parameters for getMemberSponsoredLegislation operation in CongressApi. * @export * @interface CongressApiGetMemberSponsoredLegislationRequest */ export interface CongressApiGetMemberSponsoredLegislationRequest { /** * The member\'s Biographical Directory ID. * @type {string} * @memberof CongressApiGetMemberSponsoredLegislation */ readonly bioguideId: string; /** * The starting record returned. 0 is the first record. * @type {number} * @memberof CongressApiGetMemberSponsoredLegislation */ readonly offset?: number; /** * The number of records returned. The maximum limit is 250. * @type {number} * @memberof CongressApiGetMemberSponsoredLegislation */ readonly limit?: number; } /** * Request parameters for getMembers operation in CongressApi. * @export * @interface CongressApiGetMembersRequest */ export interface CongressApiGetMembersRequest { /** * The starting record returned. 0 is the first record. * @type {number} * @memberof CongressApiGetMembers */ readonly offset?: number; /** * The number of records returned. The maximum limit is 250. * @type {number} * @memberof CongressApiGetMembers */ readonly limit?: number; /** * The starting timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @type {string} * @memberof CongressApiGetMembers */ readonly fromDateTime?: string; /** * The ending timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @type {string} * @memberof CongressApiGetMembers */ readonly toDateTime?: string; /** * The status of the member. * @type {boolean} * @memberof CongressApiGetMembers */ readonly currentMember?: boolean; } /** * Request parameters for getMembersByCongress operation in CongressApi. * @export * @interface CongressApiGetMembersByCongressRequest */ export interface CongressApiGetMembersByCongressRequest { /** * The member\'s congress number (e.g., 118 for the 118th Congress, 2023-2025) * @type {number} * @memberof CongressApiGetMembersByCongress */ readonly congress: number; /** * The starting record returned. 0 is the first record. * @type {number} * @memberof CongressApiGetMembersByCongress */ readonly offset?: number; /** * The number of records returned. The maximum limit is 250. * @type {number} * @memberof CongressApiGetMembersByCongress */ readonly limit?: number; /** * The starting timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @type {string} * @memberof CongressApiGetMembersByCongress */ readonly fromDateTime?: string; /** * The ending timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @type {string} * @memberof CongressApiGetMembersByCongress */ readonly toDateTime?: string; /** * The status of the member. * @type {boolean} * @memberof CongressApiGetMembersByCongress */ readonly currentMember?: boolean; } /** * Request parameters for getMembersByCongressAndStateAndDistrict operation in CongressApi. * @export * @interface CongressApiGetMembersByCongressAndStateAndDistrictRequest */ export interface CongressApiGetMembersByCongressAndStateAndDistrictRequest { /** * The member\'s congress number (e.g., 118 for the 118th Congress, 2023-2025) * @type {number} * @memberof CongressApiGetMembersByCongressAndStateAndDistrict */ readonly congress: number; /** * The member\'s state code (pattern: ^[A-Z]{2}$). * @type {string} * @memberof CongressApiGetMembersByCongressAndStateAndDistrict */ readonly stateCode: string; /** * The member\'s district number (pattern: ^\\d{2}$). * @type {string} * @memberof CongressApiGetMembersByCongressAndStateAndDistrict */ readonly district: string; /** * The starting record returned. 0 is the first record. * @type {number} * @memberof CongressApiGetMembersByCongressAndStateAndDistrict */ readonly offset?: number; /** * The number of records returned. The maximum limit is 250. * @type {number} * @memberof CongressApiGetMembersByCongressAndStateAndDistrict */ readonly limit?: number; /** * The starting timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @type {string} * @memberof CongressApiGetMembersByCongressAndStateAndDistrict */ readonly fromDateTime?: string; /** * The ending timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @type {string} * @memberof CongressApiGetMembersByCongressAndStateAndDistrict */ readonly toDateTime?: string; /** * The status of the member. * @type {boolean} * @memberof CongressApiGetMembersByCongressAndStateAndDistrict */ readonly currentMember?: boolean; } /** * Request parameters for getMembersByState operation in CongressApi. * @export * @interface CongressApiGetMembersByStateRequest */ export interface CongressApiGetMembersByStateRequest { /** * The member\'s state code (pattern: ^[A-Z]{2}$). * @type {string} * @memberof CongressApiGetMembersByState */ readonly stateCode: string; /** * The starting record returned. 0 is the first record. * @type {number} * @memberof CongressApiGetMembersByState */ readonly offset?: number; /** * The number of records returned. The maximum limit is 250. * @type {number} * @memberof CongressApiGetMembersByState */ readonly limit?: number; /** * The starting timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @type {string} * @memberof CongressApiGetMembersByState */ readonly fromDateTime?: string; /** * The ending timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @type {string} * @memberof CongressApiGetMembersByState */ readonly toDateTime?: string; /** * The status of the member. * @type {boolean} * @memberof CongressApiGetMembersByState */ readonly currentMember?: boolean; } /** * Request parameters for getMembersByStateAndDistrict operation in CongressApi. * @export * @interface CongressApiGetMembersByStateAndDistrictRequest */ export interface CongressApiGetMembersByStateAndDistrictRequest { /** * The member\'s state code (pattern: ^[A-Z]{2}$). * @type {string} * @memberof CongressApiGetMembersByStateAndDistrict */ readonly stateCode: string; /** * The member\'s district number (pattern: ^\\d{2}$). * @type {string} * @memberof CongressApiGetMembersByStateAndDistrict */ readonly district: string; /** * The starting record returned. 0 is the first record. * @type {number} * @memberof CongressApiGetMembersByStateAndDistrict */ readonly offset?: number; /** * The number of records returned. The maximum limit is 250. * @type {number} * @memberof CongressApiGetMembersByStateAndDistrict */ readonly limit?: number; /** * The starting timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @type {string} * @memberof CongressApiGetMembersByStateAndDistrict */ readonly fromDateTime?: string; /** * The ending timestamp to filter by update date. Use format: YYYY-MM-DDT00:00:00Z. * @type {string} * @memberof CongressApiGetMembersByStateAndDistrict */ readonly toDateTime?: string; /** * The status of the member. * @type {boolean} * @memberof CongressApiGetMembersByStateAndDistrict */ readonly currentMember?: boolean; } /** * CongressApi - object-oriented interface * @export * @class CongressApi * @extends {BaseAPI} */ export class CongressApi extends BaseAPI { /** * Get a list of legislation cosponsored by a member. Supports query parameters for pagination. * @summary Returns a list of legislation cosponsored by a congressional member. * @param {CongressApiGetMemberCosponsoredLegislationRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CongressApi */ public getMemberCosponsoredLegislation( requestParameters: CongressApiGetMemberCosponsoredLegislationRequest, options?: RawAxiosRequestConfig, ) { return CongressApiFp(this.configuration) .getMemberCosponsoredLegislation( requestParameters.bioguideId, requestParameters.offset, requestParameters.limit, options, ) .then((request) => request(this.axios, this.basePath)); } /** * Get a member\'s details from their bioguideId. * @summary Returns details of a single congressional member. * @param {CongressApiGetMemberDetailsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CongressApi */ public getMemberDetails( requestParameters: CongressApiGetMemberDetailsRequest, options?: RawAxiosRequestConfig, ) { return CongressApiFp(this.configuration) .getMemberDetails(requestParameters.bioguideId, options) .then((request) => request(this.axios, this.basePath)); } /** * Get a list of legislation sponsored by a member. Supports query parameters for pagination. * @summary Returns a list of legislation sponsored by a congressional member. * @param {CongressApiGetMemberSponsoredLegislationRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CongressApi */ public getMemberSponsoredLegislation( requestParameters: CongressApiGetMemberSponsoredLegislationRequest, options?: RawAxiosRequestConfig, ) { return CongressApiFp(this.configuration) .getMemberSponsoredLegislation( requestParameters.bioguideId, requestParameters.offset, requestParameters.limit, options, ) .then((request) => request(this.axios, this.basePath)); } /** * Get congress member list. Supports query parameters for pagination and filtering. * @summary Returns a list of congressional members. * @param {CongressApiGetMembersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CongressApi */ public getMembers( requestParameters: CongressApiGetMembersRequest = {}, options?: RawAxiosRequestConfig, ) { return CongressApiFp(this.configuration) .getMembers( requestParameters.offset, requestParameters.limit, requestParameters.fromDateTime, requestParameters.toDateTime, requestParameters.currentMember, options, ) .then((request) => request(this.axios, this.basePath)); } /** * Get congress member list by congress number. Supports query parameters for filtering. * @summary Returns a list of congressional members by congress number. * @param {CongressApiGetMembersByCongressRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CongressApi */ public getMembersByCongress( requestParameters: CongressApiGetMembersByCongressRequest, options?: RawAxiosRequestConfig, ) { return CongressApiFp(this.configuration) .getMembersByCongress( requestParameters.congress, requestParameters.offset, requestParameters.limit, requestParameters.fromDateTime, requestParameters.toDateTime, requestParameters.currentMember, options, ) .then((request) => request(this.axios, this.basePath)); } /** * Get congress member list by congress number and state code and district. Supports query parameters for filtering. * @summary Returns a list of congressional members by congress number, state code, and district. * @param {CongressApiGetMembersByCongressAndStateAndDistrictRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CongressApi */ public getMembersByCongressAndStateAndDistrict( requestParameters: CongressApiGetMembersByCongressAndStateAndDistrictRequest, options?: RawAxiosRequestConfig, ) { return CongressApiFp(this.configuration) .getMembersByCongressAndStateAndDistrict( requestParameters.congress, requestParameters.stateCode, requestParameters.district, requestParameters.offset, requestParameters.limit, requestParameters.fromDateTime, requestParameters.toDateTime, requestParameters.currentMember, options, ) .then((request) => request(this.axios, this.basePath)); } /** * Get congress member list by state code. Supports query parameters for filtering. * @summary Returns a list of congressional members by state code. * @param {CongressApiGetMembersByStateRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CongressApi */ public getMembersByState( requestParameters: CongressApiGetMembersByStateRequest, options?: RawAxiosRequestConfig, ) { return CongressApiFp(this.configuration) .getMembersByState( requestParameters.stateCode, requestParameters.offset, requestParameters.limit, requestParameters.fromDateTime, requestParameters.toDateTime, requestParameters.currentMember, options, ) .then((request) => request(this.axios, this.basePath)); } /** * Get congress member list by state code and district. Supports query parameters for filtering. * @summary Returns a list of congressional members by state code and district. * @param {CongressApiGetMembersByStateAndDistrictRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof CongressApi */ public getMembersByStateAndDistrict( requestParameters: CongressApiGetMembersByStateAndDistrictRequest, options?: RawAxiosRequestConfig, ) { return CongressApiFp(this.configuration) .getMembersByStateAndDistrict( requestParameters.stateCode, requestParameters.district, requestParameters.offset, requestParameters.limit, requestParameters.fromDateTime, requestParameters.toDateTime, requestParameters.currentMember, options, ) .then((request) => request(this.axios, this.basePath)); } }