Documentation ¶
Index ¶
- func Create(w rest.ResponseWriter, r *rest.Request)
- func Init() error
- func Search(w rest.ResponseWriter, r *rest.Request)
- func Services(w rest.ResponseWriter, r *rest.Request)
- type CreateRequest
- type CreateResponse
- type ErrorResponseJ
- type ErrorsResponseJ
- type SearchRequest
- type SearchResponse
- type SearchResponseReport
- type ServicesReq
- type ServicesResp
- type ServicesRespS
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Services ¶
func Services(w rest.ResponseWriter, r *rest.Request)
Services looks up the service providers and services for the specified location. The URL nust contain query parameters of either: LatitudeV and LongitudeV, or a city name.
Examples:
http;//xyz.com/api/services?lat=34.236144&lon=-118.604794 http;//xyz.com/api/services?city=san+jose
Types ¶
type CreateRequest ¶
type CreateRequest struct { MID structs.ServiceID `json:"service_code" xml:"service_code"` APIKey string `json:"api_key" xml:"api_key"` JurisdictionID string `json:"jurisdiction_id" xml:"jurisdiction_id"` Latitude string `json:"lat" xml:"lat"` Longitude string `json:"lng" xml:"lng"` FullAddress string `json:"address_string" xml:"address_string"` Email string `json:"email" xml:"email"` DeviceID string `json:"device_id" xml:"device_id"` AccountID string `json:"account_id" xml:"account_id"` FirstName string `json:"first_name" xml:"first_name"` LastName string `json:"last_name" xml:"last_name"` Phone string `json:"phone" xml:"phone"` Description string `json:"description" xml:"description"` MediaURL string `json:"media_url" xml:"media_url"` LatitudeV float64 // LongitudeV float64 // AreaID string // Address string `json:"address" xml:"address"` City string `json:"city" xml:"city"` State string `json:"state" xml:"state"` Zip string `json:"zip" xml:"zip"` DeviceType string `json:"device_type" xml:"device_type"` DeviceModel string `json:"device_model" xml:"device_model"` // contains filtered or unexported fields }
CreateRequest represents a new Report
func (CreateRequest) String ¶
func (r CreateRequest) String() string
String displays the contents of the CreateRequest type.
type CreateResponse ¶
type CreateResponse struct { ID *string `json:"service_request_id" xml:"service_request_id"` Notice *string `json:"service_notice" xml:"service_notice"` AccountID *string `json:"account_id" xml:"account_id"` }
CreateResponse is the response to creating or updating a report.
func (CreateResponse) String ¶
func (r CreateResponse) String() string
String displays the contents of the CreateRequest type.
type ErrorResponseJ ¶
type ErrorResponseJ struct { Code int `json:"code" xml:"code"` Description string `json:"description" xml:"description"` }
ErrorResponseJ represents an in individual error in an error response.
type ErrorsResponseJ ¶
type ErrorsResponseJ []*ErrorResponseJ
ErrorsResponseJ represents an error response. The error response contains one or more errors.
func (ErrorsResponseJ) String ¶
func (r ErrorsResponseJ) String() string
String displays the contents of the CreateRequest type.
type SearchRequest ¶
type SearchRequest struct { RID structs.ReportID `json:"reportID" xml:"reportID"` DeviceType string `json:"deviceType" xml:"deviceType"` DeviceID string `json:"deviceId" xml:"deviceId"` Latitude string `json:"lat" xml:"lat"` LatitudeV float64 // Longitude string `json:"lng" xml:"lng"` LongitudeV float64 // Radius string `json:"radius" xml:"radius"` RadiusV int // in meters Address string `json:"address" xml:"address"` City string `json:"city" xml:"city"` AreaID string // State string `json:"state" xml:"state"` Zip string `json:"zip" xml:"zip"` MaxResults string `json:"MaxResultsV" xml:"MaxResultsV"` MaxResultsV int // }
SearchRequest represents the Search request (Normal form).
func (SearchRequest) String ¶
func (r SearchRequest) String() string
String displays the contents of the SearchRequest custom type.
type SearchResponse ¶
type SearchResponse []SearchResponseReport
SearchResponse contains the search results.
func (SearchResponse) String ¶
func (r SearchResponse) String() string
Displays the SearchResponse custom type.
type SearchResponseReport ¶
type SearchResponseReport struct { RID structs.ReportID `xml:"service_request_id" json:"service_request_id"` Status *string `json:"status" xml:"status"` StatusNotes *string `json:"status_notes,omitempty" xml:"status_notes,omitempty"` ServiceName *string `json:"service_name" xml:"service_name"` ServiceCode *string `json:"service_code" xml:"service_code"` Description *string `json:"description" xml:"description"` AgencyResponsible *string `json:"agency_responsible,omitempty" xml:"agency_responsible,omitempty"` ServiceNotice *string `json:"service_notice,omitempty" xml:"service_notice,omitempty"` RequestedAt *string `json:"requested_datetime" xml:"requested_datetime"` UpdatedAt *string `json:"updated_datetime" xml:"updated_datetime"` ExpectedAt *string `json:"expected_datetime,omitempty" xml:"expected_datetime,omitempty"` Address *string `json:"address" xml:"address"` AddressID *string `json:"address_id" xml:"address_id"` ZipCode *string `json:"zipcode" xml:"zipcode"` Latitude *string `json:"lat" xml:"lat"` Longitude *string `json:"lng" xml:"lng"` MediaURL *string `json:"media_url" xml:"media_url"` }
SearchResponseReport represents a report.
func (SearchResponseReport) String ¶
func (r SearchResponseReport) String() string
Displays the the SearchResponseReport custom type.
type ServicesReq ¶
type ServicesReq struct { Latitude string `json:"lat" xml:"lat"` LatitudeV float64 // Longitude string `json:"lng" xml:"lng"` LongitudeV float64 // FullAddress string `json:"address_string" xml:"address_string"` Address string `json:"addr" xml:"addr"` City string `json:"city" xml:"city"` State string `json:"state" xml:"state"` Zip string `json:"zip" xml:"zip"` // contains filtered or unexported fields }
ServicesReq represents a request to .
func (ServicesReq) String ¶
func (r ServicesReq) String() string
Displays the contents of the Spec_Type custom type.
type ServicesResp ¶
type ServicesResp []*ServicesRespS
ServicesResp represents a list of services.
func (ServicesResp) String ¶
func (r ServicesResp) String() string
Displays the contents of the Spec_Type custom type.
type ServicesRespS ¶
type ServicesRespS struct { ID string `json:"service_code" xml:"service_code"` Name *string `json:"service_name" xml:"service_name"` Description *string `json:"description" xml:"description"` Metadata bool `json:"metadata" xml:"metadata"` Stype *string `json:"type" xml:"type"` Keywords *string `json:"keywords" xml:"keywords"` Group *string `json:"group" xml:"group"` }
ServicesRespS represents a service in a service list.
func (ServicesRespS) String ¶
func (r ServicesRespS) String() string
Displays the contents of the ServicesRespS custom type.
func (ServicesRespS) StringD ¶
func (r ServicesRespS) StringD() string
StringD displays the contents of the ServicesRespS custom type, including pointer values.