civicinfo  v2
Public Member Functions | List of all members
google_civicinfo_api::ElectionsResource_VoterInfoQueryMethod Class Reference

#include <civic_info_service.h>

Inheritance diagram for google_civicinfo_api::ElectionsResource_VoterInfoQueryMethod:
google_civicinfo_api::CivicInfoServiceBaseRequest

Public Member Functions

 ElectionsResource_VoterInfoQueryMethod (const CivicInfoService *_service_, client::AuthorizationCredential *_credential_, const absl::string_view &address)
 
virtual ~ElectionsResource_VoterInfoQueryMethod ()
 
void clear_election_id ()
 
int64 get_election_id () const
 
void set_election_id (int64 value)
 
void clear_official_only ()
 
bool get_official_only () const
 
void set_official_only (bool value)
 
void clear_return_all_available_data ()
 
bool get_return_all_available_data () const
 
void set_return_all_available_data (bool value)
 
virtual util::Status AppendVariable (const StringPiece &variable_name, const client::UriTemplateConfig &config, string *target)
 
virtual util::Status AppendOptionalQueryParameters (string *target)
 
util::Status ExecuteAndParseResponse (VoterInfoResponse *data)
 
- Public Member Functions inherited from google_civicinfo_api::CivicInfoServiceBaseRequest
 CivicInfoServiceBaseRequest (const client::ClientService *service, client::AuthorizationCredential *credential, client::HttpRequest::HttpMethod method, const StringPiece &uri_template)
 
virtual ~CivicInfoServiceBaseRequest ()
 
void clear_alt ()
 
const string & get_alt () const
 
string * mutable_alt ()
 
void set_alt (const string &value)
 
void clear_fields ()
 
const string & get_fields () const
 
string * mutable_fields ()
 
void set_fields (const string &value)
 
void clear_key ()
 
const string & get_key () const
 
string * mutable_key ()
 
void set_key (const string &value)
 
void clear_oauth_token ()
 
const string & get_oauth_token () const
 
string * mutable_oauthToken ()
 
void set_oauth_token (const string &value)
 
void clear_pretty_print ()
 
bool get_pretty_print () const
 
void set_pretty_print (bool value)
 
void clear_quota_user ()
 
const string & get_quota_user () const
 
string * mutable_quotaUser ()
 
void set_quota_user (const string &value)
 
void clear_user_ip ()
 
const string & get_user_ip () const
 
string * mutable_userIp ()
 
void set_user_ip (const string &value)
 

Additional Inherited Members

- Protected Member Functions inherited from google_civicinfo_api::CivicInfoServiceBaseRequest
void AddJsonContentToRequest (const client::JsonCppData *content)
 

Detailed Description

Implements the voterInfoQuery method.

This class uses the Command Pattern. Construct an instance with the required parameters, then set any additional optional parameters by using the attribute setters. To invoke the method, call Execute.

No authorization scopes are required for this method.

Constructor & Destructor Documentation

◆ ElectionsResource_VoterInfoQueryMethod()

google_civicinfo_api::ElectionsResource_VoterInfoQueryMethod::ElectionsResource_VoterInfoQueryMethod ( const CivicInfoService _service_,
client::AuthorizationCredential *  _credential_,
const absl::string_view &  address 
)

The standard constructor takes all the required method parameters.

Parameters
[in]<em>service</em>The service instance to send to when executed.
[in]<em>credential</em>If not NULL, the credential to authorize with. In practice this is supplied by the user code that is creating the method instance.
[in]addressThe registered address of the voter to look up.

◆ ~ElectionsResource_VoterInfoQueryMethod()

google_civicinfo_api::ElectionsResource_VoterInfoQueryMethod::~ElectionsResource_VoterInfoQueryMethod ( )
virtual

Standard destructor.

Member Function Documentation

◆ AppendOptionalQueryParameters()

util::Status google_civicinfo_api::ElectionsResource_VoterInfoQueryMethod::AppendOptionalQueryParameters ( string *  target)
virtual

Appends the optional query parameters to the target URL.

Parameters
[in,out]targetThe URL string to append to.

Reimplemented from google_civicinfo_api::CivicInfoServiceBaseRequest.

◆ AppendVariable()

util::Status google_civicinfo_api::ElectionsResource_VoterInfoQueryMethod::AppendVariable ( const StringPiece &  variable_name,
const client::UriTemplateConfig &  config,
string *  target 
)
virtual

Appends variable value to the target string.

This is a helper function used to resolve templated variables in the URI.

Parameters
[in]variable_nameThe name of the templated variable.
[in]configA pass-through parameter used for lists and maps.
[in,out]targetThe string to append the value to.

Reimplemented from google_civicinfo_api::CivicInfoServiceBaseRequest.

◆ clear_election_id()

void google_civicinfo_api::ElectionsResource_VoterInfoQueryMethod::clear_election_id ( )
inline

Clears the 'electionId' attribute so it is no longer set.

◆ clear_official_only()

void google_civicinfo_api::ElectionsResource_VoterInfoQueryMethod::clear_official_only ( )
inline

Clears the 'officialOnly' attribute so it is no longer set.

◆ clear_return_all_available_data()

void google_civicinfo_api::ElectionsResource_VoterInfoQueryMethod::clear_return_all_available_data ( )
inline

Clears the 'returnAllAvailableData' attribute so it is no longer set.

◆ ExecuteAndParseResponse()

util::Status google_civicinfo_api::ElectionsResource_VoterInfoQueryMethod::ExecuteAndParseResponse ( VoterInfoResponse data)
inline

Executes the method and parses the response into a data object on success.

Parameters
[out]dataLoads from the response payload JSON data on success.
Returns
Success if an HTTP 2xx response was received. Otherwise the status indicates the reason for failure. Finer detail may be available from the underlying http_request to distinguish the transport_status from the overal HTTP request status.

◆ get_election_id()

int64 google_civicinfo_api::ElectionsResource_VoterInfoQueryMethod::get_election_id ( ) const
inline

Gets the optional 'electionId' attribute.

If the value is not set then the default value will be returned.

◆ get_official_only()

bool google_civicinfo_api::ElectionsResource_VoterInfoQueryMethod::get_official_only ( ) const
inline

Gets the optional 'officialOnly' attribute.

If the value is not set then the default value will be returned.

◆ get_return_all_available_data()

bool google_civicinfo_api::ElectionsResource_VoterInfoQueryMethod::get_return_all_available_data ( ) const
inline

Gets the optional 'returnAllAvailableData' attribute.

If the value is not set then the default value will be returned.

◆ set_election_id()

void google_civicinfo_api::ElectionsResource_VoterInfoQueryMethod::set_election_id ( int64  value)
inline

Sets the 'electionId' attribute.

Parameters
[in]valueThe unique ID of the election to look up. A list of election IDs can be obtained at https://www.googleapis.com/civicinfo/{version}/electionsIf no election ID is specified in the query and there is more than one election with data for the given voter, the additional elections are provided in the otherElections response field.

◆ set_official_only()

void google_civicinfo_api::ElectionsResource_VoterInfoQueryMethod::set_official_only ( bool  value)
inline

Sets the 'officialOnly' attribute.

Parameters
[in]valueIf set to true, only data from official state sources will be returned.

◆ set_return_all_available_data()

void google_civicinfo_api::ElectionsResource_VoterInfoQueryMethod::set_return_all_available_data ( bool  value)
inline

Sets the 'returnAllAvailableData' attribute.

Parameters
[in]valueIf set to true, the query will return the success codeand include any partial information when it is unable to determine a matching address or unable to determine the election for electionId=0 queries.

The documentation for this class was generated from the following files: