Documentation ¶
Index ¶
- type CarrierInfo
- type CarrierStatus
- type CurrentCarrier
- type OriginalCarrier
- type Request
- func (r *Request) EvaluateNumberProfile(c *sa.Client, userID string, phoneNumber string) (*Response, error)
- func (r *Request) Post(c *sa.Client) (*Response, error)
- func (r *Request) Put(c *sa.Client) (*Response, error)
- func (r *Request) UpdateCurrentCarrier(c *sa.Client, userID string, phoneNumber string, carrierCode string, ...) (*Response, error)
- type Response
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CarrierInfo ¶
type CarrierInfo struct { CarrierCode string `json:"carrierCode,omitempty"` Carrier string `json:"carrier,omitempty"` CountryCode string `json:"countryCode,omitempty"` NetworkType string `json:"networkType,omitempty"` }
CarrierInfo : Struct for CarrierInfo used in put request to update CurrentCarrier
type CarrierStatus ¶
type CarrierStatus struct { Status string `json:"status,omitempty"` Reason interface{} `json:"reason,omitempty"` }
CarrierStatus :
Struct for CarrierStatus
type CurrentCarrier ¶
type CurrentCarrier struct { CarrierCode string `json:"carrierCode,omitempty"` Carrier string `json:"carrier,omitempty"` CountryCode string `json:"countryCode,omitempty"` NetworkType string `json:"networkType,omitempty"` CarrierStatus CarrierStatus `json:"carrierStatus,omitempty"` }
CurrentCarrier :
Struct for CurrentCarrier data.
type OriginalCarrier ¶
type OriginalCarrier struct { CarrierCode string `json:"carrierCode,omitempty"` Carrier string `json:"carrier,omitempty"` CountryCode string `json:"countryCode,omitempty"` NetworkType string `json:"networkType,omitempty"` CarrierStatus CarrierStatus `json:"carrierStatus,omitempty"` }
OriginalCarrier :
Struct for OriginalCarrier data.
type Request ¶
type Request struct { UserID string `json:"user_id"` PhoneNumber string `json:"phone_number"` CarrierInfo CarrierInfo `json:"carrierInfo,omitempty"` }
Request :
Request struct to build the required post and put parameters.
Fields:
[Required] UserID: the username that you want to evaluate the number on behalf of. [Required] PhoneNumber: the phone number of the user to be evaluated. CarrierInfo: Used in PUT operations to update the currentCarrier of the numberProfile.
func (*Request) EvaluateNumberProfile ¶
func (r *Request) EvaluateNumberProfile(c *sa.Client, userID string, phoneNumber string) (*Response, error)
EvaluateNumberProfile :
Helper function for posting to the numberprofile endpoint.
Parameters:
[Required] c: passing in the client containing authorization and host information. [Required] userID: the username that you want to evaluate the number on behalf of. [Required] phoneNumber: the phone number of the user to be evaluated.
Returns:
Response: Struct marshaled from the Json response from the API endpoints. Error: If an error is encountered, response will be nil and the error must be handled.
func (*Request) Post ¶
Post :
Executes a post to the numberprofile endpoint.
Parameters:
[Required] r: should have all required fields of the struct populated before using. [Required] c: passing in the client containing authorization and host information.
Returns:
Response: Struct marshaled from the Json response from the API endpoints. Error: If an error is encountered, response will be nil and the error must be handled.
func (*Request) Put ¶
Put :
Executes a put to the numberprofile endpoint.
Parameters:
[Required] r: should have all the required fields for the put type. [Required] c: passing in the client containing authorization and host information. [Required] endpoint: the endpoint for the put request.
Returns:
Response: Struct marshaled from the Json response from the API endpoints. Error: If an error is encountered, response will be nil and the error must be handled.
func (*Request) UpdateCurrentCarrier ¶
func (r *Request) UpdateCurrentCarrier(c *sa.Client, userID string, phoneNumber string, carrierCode string, carrier string, countryCode string, networkType string) (*Response, error)
UpdateCurrentCarrier :
Helper function for putting to the numberprofile endpoint.
Parameters:
[Required] c: passing in the client containing authorization and host information. [Required] userID: the username that you want to evaluate the number on behalf of. [Required] phoneNumber: the phone number of the user to be evaluated. [Required] carrierCode: the carrier code of the current carrier you wish to save. [Required] carrier: the carrier of the current carrier you wish to save. [Required] countryCode: the country code of the current carrier you wish to save. [Required] networkType: the network type of the current carrier you wish to save.
Returns:
Response: Struct marshaled from the Json response from the API endpoints. Error: If an error is encountered, response will be nil and the error must be handled.
type Response ¶
type Response struct { Status string `json:"status"` Message string `json:"message"` Result Result `json:"numberProfileResult,omitempty"` RawJSON string `json:"-"` HTTPResponse *http.Response `json:"-"` }
Response :
Response struct that will be populated after the request.
func (*Response) IsSignatureValid ¶ added in v1.1.0
IsSignatureValid :
Helper function to validate the SecureAuth Response signature in X-SA-SIGNATURE
Parameters:
[Required] r: response struct with HTTPResponse [Required] c: passing in the client with application id and key
Returns:
bool: if true, computed signature matches X-SA-SIGNATURE. if false, computed signature does not match. error: If an error is encountered, bool will be false and the error must be handled.
type Result ¶
type Result struct { ProviderRequestID string `json:"providerRequestId,omitempty"` InternationalFormat string `json:"internationalFormat,omitempty"` NationalFormat string `json:"nationalFormat,omitempty"` CountryPrefix string `json:"countryPrefix,omitempty"` CountryCode string `json:"countryCode,omitempty"` CountryCodeISO3 string `json:"countryCodeISO3,omitempty"` Country string `json:"country,omitempty"` PortedStatus string `json:"portedStatus,omitempty"` ValidNumber interface{} `json:"validNumber,omitempty"` Reachable interface{} `json:"reachable,omitempty"` RoamingInfo interface{} `json:"roamingInfo,omitempty"` CurrentCarrier CurrentCarrier `json:"currentCarrier,omitempty"` OriginalCarrier OriginalCarrier `json:"originalCarrier,omitempty"` IPInfo interface{} `json:"ipInfo,omitempty"` IPWarning interface{} `json:"ipWarning,omitempty"` }
Result :
Struct for NumberProfileResult data.
Click to show internal directories.
Click to hide internal directories.