Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) Authenticate(ctx context.Context, username string, password string) error
- func (c *Client) BaseURL() string
- func (c *Client) Debug() bool
- func (c *Client) DeleteNfirsNotificationsID(ctx context.Context, id uint64) error
- func (c *Client) DeleteNfirsNotificationsIDApparatusesID(ctx context.Context, id uint64, apparatusID uint64) error
- func (c *Client) DeleteNfirsNotificationsNumberID(ctx context.Context, id string) error
- func (c *Client) DeleteNfirsNotificationsNumberIDApparatusesCodeID(ctx context.Context, id string, apparatusID string) error
- func (c *Client) GetApparatuses(ctx context.Context, input GetApparatusesRequest) (output GetApparatusesResponse, err error)
- func (c *Client) GetDispatches(ctx context.Context, input GetDispatchesRequest) (output GetDispatchesResponse, err error)
- func (c *Client) GetLogsSettings(ctx context.Context, input GetLogsSettingsRequest) (output GetLogsSettingsResponse, err error)
- func (c *Client) GetNfirsNotificationsDispatchNumberID(ctx context.Context, dispatchNumber string, ...) (output GetNfirsNotificationsDispatchNumberIDResponse, err error)
- func (c *Client) GetNfirsNotificationsID(ctx context.Context, id uint64) (output GetNfirsNotificationsIDResponse, err error)
- func (c *Client) GetStations(ctx context.Context, input GetStationsRequest) (output GetStationsResponse, err error)
- func (c *Client) HTTPClient() *http.Client
- func (c *Client) PostLogs(ctx context.Context, input PostLogsRequest) error
- func (c *Client) PostLogsBatch(ctx context.Context, input PostLogsBatchRequest) error
- func (c *Client) PostNfirsNotifications(ctx context.Context, input PostNfirsNotificationsRequest) (output PostNfirsNotificationsResponse, err error)
- func (c *Client) PostNfirsNotificationsIDApparatuses(ctx context.Context, id uint64, ...) (output PostNfirsNotificationsIDApparatusesResponse, err error)
- func (c *Client) PostNfirsNotificationsNumberIDApparatuses(ctx context.Context, id string, ...) error
- func (c *Client) PutNfirsNotificationsID(ctx context.Context, id uint64, input PutNfirsNotificationsIDRequest) error
- func (c *Client) PutNfirsNotificationsIDApparatusesID(ctx context.Context, id uint64, apparatusID uint64, ...) error
- func (c *Client) PutNfirsNotificationsNumberID(ctx context.Context, id string, input PutNfirsNotificationsNumberIDRequest) error
- func (c *Client) PutNfirsNotificationsNumberIDApparatusesCodeID(ctx context.Context, id string, apparatusID string, ...) error
- func (c *Client) Raw(ctx context.Context, method string, path string, input any, output any) error
- func (c *Client) Token() string
- type ClientConfig
- type ClientOption
- type ErrorResponse
- type GetApparatusesRequest
- type GetApparatusesResponse
- type GetApparatusesResponseApparatus
- type GetDispatchesRequest
- type GetDispatchesResponse
- type GetLogsSettingsRequest
- type GetLogsSettingsResponse
- type GetNfirsNotificationsDispatchNumberIDRequest
- type GetNfirsNotificationsDispatchNumberIDResponse
- type GetNfirsNotificationsIDResponse
- type GetStationsRequest
- type GetStationsResponse
- type GetStationsResponseStation
- type NfirsNotification
- type NfirsNotificationApparatus
- type PostAuthTokenRequest
- type PostAuthTokenResponse
- type PostLogsBatchRequest
- type PostLogsRequest
- type PostNfirsNotificationsIDApparatusesRequest
- type PostNfirsNotificationsIDApparatusesResponse
- type PostNfirsNotificationsNumberIDApparatusesRequest
- type PostNfirsNotificationsRequest
- type PostNfirsNotificationsResponse
- type PutNfirsNotificationsIDApparatusesIDRequest
- type PutNfirsNotificationsIDRequest
- type PutNfirsNotificationsNumberIDApparatusesCodeIDRequest
- type PutNfirsNotificationsNumberIDRequest
- type StringFloat64
- type StringUint64
- type Timestamp
Constants ¶
View Source
const BaseURL = "https://sizeup.firstduesizeup.com/fd-api"
BaseURL is the default base URL for the FirstDue API.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for the FirstDue API.
func NewClient ¶
func NewClient(opts ...ClientOption) *Client
NewClient returns a new client for the FirstDue API.
func (*Client) Authenticate ¶
func (*Client) DeleteNfirsNotificationsID ¶
func (*Client) DeleteNfirsNotificationsIDApparatusesID ¶
func (*Client) DeleteNfirsNotificationsNumberID ¶
func (*Client) DeleteNfirsNotificationsNumberIDApparatusesCodeID ¶
func (*Client) GetApparatuses ¶ added in v0.1.2
func (c *Client) GetApparatuses(ctx context.Context, input GetApparatusesRequest) (output GetApparatusesResponse, err error)
func (*Client) GetDispatches ¶
func (c *Client) GetDispatches(ctx context.Context, input GetDispatchesRequest) (output GetDispatchesResponse, err error)
func (*Client) GetLogsSettings ¶
func (c *Client) GetLogsSettings(ctx context.Context, input GetLogsSettingsRequest) (output GetLogsSettingsResponse, err error)
func (*Client) GetNfirsNotificationsDispatchNumberID ¶ added in v0.1.1
func (c *Client) GetNfirsNotificationsDispatchNumberID(ctx context.Context, dispatchNumber string, input GetNfirsNotificationsDispatchNumberIDRequest) (output GetNfirsNotificationsDispatchNumberIDResponse, err error)
func (*Client) GetNfirsNotificationsID ¶
func (*Client) GetStations ¶ added in v0.1.2
func (c *Client) GetStations(ctx context.Context, input GetStationsRequest) (output GetStationsResponse, err error)
func (*Client) HTTPClient ¶
func (*Client) PostLogs ¶
func (c *Client) PostLogs(ctx context.Context, input PostLogsRequest) error
func (*Client) PostLogsBatch ¶
func (c *Client) PostLogsBatch(ctx context.Context, input PostLogsBatchRequest) error
func (*Client) PostNfirsNotifications ¶
func (c *Client) PostNfirsNotifications(ctx context.Context, input PostNfirsNotificationsRequest) (output PostNfirsNotificationsResponse, err error)
func (*Client) PostNfirsNotificationsIDApparatuses ¶
func (c *Client) PostNfirsNotificationsIDApparatuses(ctx context.Context, id uint64, input PostNfirsNotificationsIDApparatusesRequest) (output PostNfirsNotificationsIDApparatusesResponse, err error)
func (*Client) PostNfirsNotificationsNumberIDApparatuses ¶
func (*Client) PutNfirsNotificationsID ¶
func (*Client) PutNfirsNotificationsIDApparatusesID ¶
func (*Client) PutNfirsNotificationsNumberID ¶
func (*Client) PutNfirsNotificationsNumberIDApparatusesCodeID ¶
type ClientConfig ¶ added in v0.1.1
type ClientOption ¶
type ClientOption func(*ClientConfig)
ClientOption is a function that configures a Client.
func WithBaseURL ¶ added in v0.1.1
func WithBaseURL(baseURL string) ClientOption
WithBaseURL sets the base URL for API requests.
func WithDebug ¶ added in v0.1.1
func WithDebug(debug bool) ClientOption
WithDebug sets the debug flag.
func WithHTTPClient ¶
func WithHTTPClient(httpClient *http.Client) ClientOption
WithHTTPClient sets the HTTP client to use for requests.
func WithToken ¶ added in v0.1.1
func WithToken(token string) ClientOption
WithToken sets the API "Bearer" token for authentication.
type ErrorResponse ¶
type GetApparatusesRequest ¶ added in v0.1.2
type GetApparatusesRequest struct {
}
type GetApparatusesResponse ¶ added in v0.1.2
type GetApparatusesResponse struct {
List []GetApparatusesResponseApparatus `json:"list"`
Total int `json:"total"`
}
type GetApparatusesResponseApparatus ¶ added in v0.1.2
type GetDispatchesRequest ¶
type GetDispatchesResponse ¶
type GetDispatchesResponse []struct {
ID int `json:"id"`
Type string `json:"type"`
Message string `json:"message"`
Address string `json:"address"`
Address2 string `json:"address2"`
City string `json:"city"`
StateCode string `json:"state_code"`
Latitude float64 `json:"latitude"`
Longitude float64 `json:"longitude"`
UnitCodes []string `json:"unit_codes"`
IncidentTypeCode string `json:"incident_type_code"`
StatusCode string `json:"status_code"`
XrefID string `json:"xref_id"`
CreatedAt Timestamp `json:"created_at"`
}
type GetLogsSettingsRequest ¶
type GetLogsSettingsRequest struct{}
type GetLogsSettingsResponse ¶
type GetLogsSettingsResponse struct {
IsFdapiConnectorLogEnabled bool `json:"is_fdapi_connector_log_enabled"`
}
type GetNfirsNotificationsDispatchNumberIDRequest ¶ added in v0.1.1
type GetNfirsNotificationsDispatchNumberIDRequest struct{}
type GetNfirsNotificationsDispatchNumberIDResponse ¶ added in v0.1.1
type GetNfirsNotificationsDispatchNumberIDResponse NfirsNotification
type GetNfirsNotificationsIDResponse ¶
type GetNfirsNotificationsIDResponse NfirsNotification
type GetStationsRequest ¶ added in v0.1.2
type GetStationsRequest struct {
}
type GetStationsResponse ¶ added in v0.1.2
type GetStationsResponse struct {
List []GetStationsResponseStation `json:"list"`
Total int `json:"total"`
}
type GetStationsResponseStation ¶ added in v0.1.2
type NfirsNotification ¶
type NfirsNotification struct {
ID uint64 `json:"id,omitempty"`
DispatchNumber string `json:"dispatch_number"`
IncidentNumber string `json:"incident_number"`
DispatchType string `json:"dispatch_type"`
DispatchIncidentTypeCode string `json:"dispatch_incident_type_code"`
AlarmAt Timestamp `json:"alarm_at"`
DispatchNotifiedAt Timestamp `json:"dispatch_notified_at"`
Alarms int `json:"alarms"`
CADPriority *string `json:"cad_priority"`
PlaceName *string `json:"place_name"`
BusinessName *string `json:"business_name"`
LocationInfo *string `json:"location_info"`
Venue *string `json:"venue"`
Address string `json:"address"`
Unit *string `json:"unit"`
CrossStreets string `json:"cross_streets"`
City string `json:"city"`
StateCode string `json:"state_code"`
ZipCode *string `json:"zip_code"`
Latitude *StringFloat64 `json:"latitude"`
Longitude *StringFloat64 `json:"longitude"`
Narratives *string `json:"narratives"`
ShiftName *string `json:"shift_name"`
NotificationType *string `json:"notification_type"`
AidTypeCode *int `json:"aid_type_code"`
AidFDIDNumber json.RawMessage `json:"aid_fdid_number"` // There seems to be a bug in the API. The in format is not the out format.
AidFDIDNumbers json.RawMessage `json:"aid_fdid_numbers"` // There seems to be a bug in the API. The in format is not the out format.
ControlledAt *Timestamp `json:"controlled_at"`
OfficerInCharge *string `json:"officer_in_charge"`
CallCompletedAt Timestamp `json:"call_completed_at"`
Zone *string `json:"zone"`
HouseNum *string `json:"house_num"`
PrefixDirection *string `json:"prefix_direction"`
StreetName *string `json:"street_name"`
StreetType *string `json:"street_type"`
SuffixDirection *string `json:"suffix_direction"`
EMSIncidentNumber *string `json:"ems_incident_number"`
EMSResponseNumber *string `json:"ems_response_number"`
Station *string `json:"station"`
EMDCardNumber *string `json:"emd_card_number"`
PSAPAnsweredAt *Timestamp `json:"psap_answered_at"`
}
type NfirsNotificationApparatus ¶
type NfirsNotificationApparatus struct {
UnitCode string `json:"unit_code"`
IsAid bool `json:"is_aid"`
DispatchAt Timestamp `json:"dispatch_at"`
ArriveAt Timestamp `json:"arrive_at"`
DispatchAcknowledgedAt Timestamp `json:"dispatch_acknowledged_at"`
EnrouteAt Timestamp `json:"enroute_at"`
ClearAt Timestamp `json:"clear_at"`
BackInServiceAt Timestamp `json:"back_in_service_at"`
CanceledAt Timestamp `json:"canceled_at"`
CanceledStageCode string `json:"canceled_stage_code"`
}
type PostAuthTokenRequest ¶
type PostAuthTokenResponse ¶
type PostLogsBatchRequest ¶
type PostLogsRequest ¶
type PostNfirsNotificationsIDApparatusesRequest ¶
type PostNfirsNotificationsIDApparatusesRequest NfirsNotificationApparatus
type PostNfirsNotificationsIDApparatusesResponse ¶
type PostNfirsNotificationsIDApparatusesResponse struct {
ID StringUint64 `json:"id"`
}
type PostNfirsNotificationsNumberIDApparatusesRequest ¶
type PostNfirsNotificationsNumberIDApparatusesRequest NfirsNotificationApparatus
type PostNfirsNotificationsRequest ¶
type PostNfirsNotificationsRequest NfirsNotification
type PostNfirsNotificationsResponse ¶
type PostNfirsNotificationsResponse struct {
ID StringUint64 `json:"id"`
}
type PutNfirsNotificationsIDApparatusesIDRequest ¶
type PutNfirsNotificationsIDApparatusesIDRequest NfirsNotificationApparatus
type PutNfirsNotificationsIDRequest ¶
type PutNfirsNotificationsIDRequest NfirsNotification
type PutNfirsNotificationsNumberIDApparatusesCodeIDRequest ¶
type PutNfirsNotificationsNumberIDApparatusesCodeIDRequest NfirsNotificationApparatus
type PutNfirsNotificationsNumberIDRequest ¶
type PutNfirsNotificationsNumberIDRequest NfirsNotification
type StringFloat64 ¶
type StringFloat64 float64
func (StringFloat64) MarshalJSON ¶
func (f StringFloat64) MarshalJSON() ([]byte, error)
func (*StringFloat64) UnmarshalJSON ¶
func (f *StringFloat64) UnmarshalJSON(data []byte) error
type StringUint64 ¶
type StringUint64 uint64
func (StringUint64) MarshalJSON ¶
func (n StringUint64) MarshalJSON() ([]byte, error)
func (*StringUint64) UnmarshalJSON ¶
func (n *StringUint64) UnmarshalJSON(data []byte) error
type Timestamp ¶
func (Timestamp) IsZero ¶
IsZero returns true if the timestamp is the zero value.
This is used for "omitempty" support in query parameters.
func (Timestamp) MarshalJSON ¶
func (*Timestamp) UnmarshalJSON ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.