Documentation
¶
Index ¶
- type ApiService
- func (c *ApiService) FetchAlert(Sid string) (*MonitorV1AlertInstance, error)
- func (c *ApiService) FetchEvent(Sid string) (*MonitorV1Event, error)
- func (c *ApiService) ListAlert(params *ListAlertParams) ([]MonitorV1Alert, error)
- func (c *ApiService) ListEvent(params *ListEventParams) ([]MonitorV1Event, error)
- func (c *ApiService) PageAlert(params *ListAlertParams, pageToken, pageNumber string) (*ListAlertResponse, error)
- func (c *ApiService) PageEvent(params *ListEventParams, pageToken, pageNumber string) (*ListEventResponse, error)
- func (c *ApiService) StreamAlert(params *ListAlertParams) (chan MonitorV1Alert, chan error)
- func (c *ApiService) StreamEvent(params *ListEventParams) (chan MonitorV1Event, chan error)
- type ListAlertParams
- func (params *ListAlertParams) SetEndDate(EndDate time.Time) *ListAlertParams
- func (params *ListAlertParams) SetLimit(Limit int) *ListAlertParams
- func (params *ListAlertParams) SetLogLevel(LogLevel string) *ListAlertParams
- func (params *ListAlertParams) SetPageSize(PageSize int) *ListAlertParams
- func (params *ListAlertParams) SetStartDate(StartDate time.Time) *ListAlertParams
- type ListAlertResponse
- type ListAlertResponseMeta
- type ListEventParams
- func (params *ListEventParams) SetActorSid(ActorSid string) *ListEventParams
- func (params *ListEventParams) SetEndDate(EndDate time.Time) *ListEventParams
- func (params *ListEventParams) SetEventType(EventType string) *ListEventParams
- func (params *ListEventParams) SetLimit(Limit int) *ListEventParams
- func (params *ListEventParams) SetPageSize(PageSize int) *ListEventParams
- func (params *ListEventParams) SetResourceSid(ResourceSid string) *ListEventParams
- func (params *ListEventParams) SetSourceIpAddress(SourceIpAddress string) *ListEventParams
- func (params *ListEventParams) SetStartDate(StartDate time.Time) *ListEventParams
- type ListEventResponse
- type MonitorV1Alert
- type MonitorV1AlertInstance
- type MonitorV1Event
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiService ¶ added in v0.11.0
type ApiService struct {
// contains filtered or unexported fields
}
func NewApiService ¶ added in v0.11.0
func NewApiService(requestHandler *twilio.RequestHandler) *ApiService
func NewApiServiceWithClient ¶ added in v0.11.0
func NewApiServiceWithClient(client twilio.BaseClient) *ApiService
func (*ApiService) FetchAlert ¶ added in v0.11.0
func (c *ApiService) FetchAlert(Sid string) (*MonitorV1AlertInstance, error)
func (*ApiService) FetchEvent ¶ added in v0.11.0
func (c *ApiService) FetchEvent(Sid string) (*MonitorV1Event, error)
func (*ApiService) ListAlert ¶ added in v0.11.0
func (c *ApiService) ListAlert(params *ListAlertParams) ([]MonitorV1Alert, error)
Lists Alert records from the API as a list. Unlike stream, this operation is eager and loads 'limit' records into memory before returning.
func (*ApiService) ListEvent ¶ added in v0.11.0
func (c *ApiService) ListEvent(params *ListEventParams) ([]MonitorV1Event, error)
Lists Event records from the API as a list. Unlike stream, this operation is eager and loads 'limit' records into memory before returning.
func (*ApiService) PageAlert ¶ added in v0.13.0
func (c *ApiService) PageAlert(params *ListAlertParams, pageToken, pageNumber string) (*ListAlertResponse, error)
Retrieve a single page of Alert records from the API. Request is executed immediately.
func (*ApiService) PageEvent ¶ added in v0.13.0
func (c *ApiService) PageEvent(params *ListEventParams, pageToken, pageNumber string) (*ListEventResponse, error)
Retrieve a single page of Event records from the API. Request is executed immediately.
func (*ApiService) StreamAlert ¶ added in v0.13.0
func (c *ApiService) StreamAlert(params *ListAlertParams) (chan MonitorV1Alert, chan error)
Streams Alert records from the API as a channel stream. This operation lazily loads records as efficiently as possible until the limit is reached.
func (*ApiService) StreamEvent ¶ added in v0.13.0
func (c *ApiService) StreamEvent(params *ListEventParams) (chan MonitorV1Event, chan error)
Streams Event records from the API as a channel stream. This operation lazily loads records as efficiently as possible until the limit is reached.
type ListAlertParams ¶
type ListAlertParams struct {
// Only show alerts for this log-level. Can be: `error`, `warning`, `notice`, or `debug`.
LogLevel *string `json:"LogLevel,omitempty"`
// Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported.
StartDate *time.Time `json:"StartDate,omitempty"`
// Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported.
EndDate *time.Time `json:"EndDate,omitempty"`
// How many resources to return in each list page. The default is 50, and the maximum is 1000.
PageSize *int `json:"PageSize,omitempty"`
// Max number of records to return.
Limit *int `json:"limit,omitempty"`
}
Optional parameters for the method 'ListAlert'
func (*ListAlertParams) SetEndDate ¶
func (params *ListAlertParams) SetEndDate(EndDate time.Time) *ListAlertParams
func (*ListAlertParams) SetLimit ¶ added in v0.13.0
func (params *ListAlertParams) SetLimit(Limit int) *ListAlertParams
func (*ListAlertParams) SetLogLevel ¶
func (params *ListAlertParams) SetLogLevel(LogLevel string) *ListAlertParams
func (*ListAlertParams) SetPageSize ¶
func (params *ListAlertParams) SetPageSize(PageSize int) *ListAlertParams
func (*ListAlertParams) SetStartDate ¶
func (params *ListAlertParams) SetStartDate(StartDate time.Time) *ListAlertParams
type ListAlertResponse ¶
type ListAlertResponse struct {
Alerts []MonitorV1Alert `json:"alerts,omitempty"`
Meta ListAlertResponseMeta `json:"meta,omitempty"`
}
ListAlertResponse struct for ListAlertResponse
type ListAlertResponseMeta ¶
type ListAlertResponseMeta struct {
FirstPageUrl string `json:"first_page_url,omitempty"`
Key string `json:"key,omitempty"`
NextPageUrl *string `json:"next_page_url,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"page_size,omitempty"`
PreviousPageUrl *string `json:"previous_page_url,omitempty"`
Url string `json:"url,omitempty"`
}
ListAlertResponseMeta struct for ListAlertResponseMeta
type ListEventParams ¶
type ListEventParams struct {
// Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials.
ActorSid *string `json:"ActorSid,omitempty"`
// Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types).
EventType *string `json:"EventType,omitempty"`
// Only include events that refer to this resource. Useful for discovering the history of a specific resource.
ResourceSid *string `json:"ResourceSid,omitempty"`
// Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console.
SourceIpAddress *string `json:"SourceIpAddress,omitempty"`
// Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
StartDate *time.Time `json:"StartDate,omitempty"`
// Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
EndDate *time.Time `json:"EndDate,omitempty"`
// How many resources to return in each list page. The default is 50, and the maximum is 1000.
PageSize *int `json:"PageSize,omitempty"`
// Max number of records to return.
Limit *int `json:"limit,omitempty"`
}
Optional parameters for the method 'ListEvent'
func (*ListEventParams) SetActorSid ¶
func (params *ListEventParams) SetActorSid(ActorSid string) *ListEventParams
func (*ListEventParams) SetEndDate ¶
func (params *ListEventParams) SetEndDate(EndDate time.Time) *ListEventParams
func (*ListEventParams) SetEventType ¶
func (params *ListEventParams) SetEventType(EventType string) *ListEventParams
func (*ListEventParams) SetLimit ¶ added in v0.13.0
func (params *ListEventParams) SetLimit(Limit int) *ListEventParams
func (*ListEventParams) SetPageSize ¶
func (params *ListEventParams) SetPageSize(PageSize int) *ListEventParams
func (*ListEventParams) SetResourceSid ¶
func (params *ListEventParams) SetResourceSid(ResourceSid string) *ListEventParams
func (*ListEventParams) SetSourceIpAddress ¶
func (params *ListEventParams) SetSourceIpAddress(SourceIpAddress string) *ListEventParams
func (*ListEventParams) SetStartDate ¶
func (params *ListEventParams) SetStartDate(StartDate time.Time) *ListEventParams
type ListEventResponse ¶
type ListEventResponse struct {
Events []MonitorV1Event `json:"events,omitempty"`
Meta ListAlertResponseMeta `json:"meta,omitempty"`
}
ListEventResponse struct for ListEventResponse
type MonitorV1Alert ¶
type MonitorV1Alert struct {
// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Alert resource.
AccountSid *string `json:"account_sid,omitempty"`
// The text of the alert.
AlertText *string `json:"alert_text,omitempty"`
// The API version used when the alert was generated. Can be empty for events that don't have a specific API version.
ApiVersion *string `json:"api_version,omitempty"`
// The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
DateCreated *time.Time `json:"date_created,omitempty"`
// The date and time in GMT when the alert was generated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. Due to buffering, this can be different than `date_created`.
DateGenerated *time.Time `json:"date_generated,omitempty"`
// The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
DateUpdated *time.Time `json:"date_updated,omitempty"`
// The error code for the condition that generated the alert. See the [Error Dictionary](https://www.twilio.com/docs/api/errors) for possible causes and solutions to the error.
ErrorCode *string `json:"error_code,omitempty"`
// The log level. Can be: `error`, `warning`, `notice`, or `debug`.
LogLevel *string `json:"log_level,omitempty"`
// The URL of the page in our [Error Dictionary](https://www.twilio.com/docs/api/errors) with more information about the error condition.
MoreInfo *string `json:"more_info,omitempty"`
// The method used by the request that generated the alert. If the alert was generated by a request we made to your server, this is the method we used. If the alert was generated by a request from your application to our API, this is the method your application used.
RequestMethod *string `json:"request_method,omitempty"`
// The URL of the request that generated the alert. If the alert was generated by a request we made to your server, this is the URL on your server that generated the alert. If the alert was generated by a request from your application to our API, this is the URL of the resource requested.
RequestUrl *string `json:"request_url,omitempty"`
// The SID of the resource for which the alert was generated. For instance, if your server failed to respond to an HTTP request during the flow of a particular call, this value would be the SID of the server. This value is empty if the alert was not generated for a particular resource.
ResourceSid *string `json:"resource_sid,omitempty"`
// The unique string that we created to identify the Alert resource.
Sid *string `json:"sid,omitempty"`
// The absolute URL of the Alert resource.
Url *string `json:"url,omitempty"`
// The SID of the service or resource that generated the alert. Can be `null`.
ServiceSid *string `json:"service_sid,omitempty"`
}
MonitorV1Alert struct for MonitorV1Alert
type MonitorV1AlertInstance ¶
type MonitorV1AlertInstance struct {
// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Alert resource.
AccountSid *string `json:"account_sid,omitempty"`
// The text of the alert.
AlertText *string `json:"alert_text,omitempty"`
// The API version used when the alert was generated. Can be empty for events that don't have a specific API version.
ApiVersion *string `json:"api_version,omitempty"`
// The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
DateCreated *time.Time `json:"date_created,omitempty"`
// The date and time in GMT when the alert was generated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. Due to buffering, this can be different than `date_created`.
DateGenerated *time.Time `json:"date_generated,omitempty"`
// The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
DateUpdated *time.Time `json:"date_updated,omitempty"`
// The error code for the condition that generated the alert. See the [Error Dictionary](https://www.twilio.com/docs/api/errors) for possible causes and solutions to the error.
ErrorCode *string `json:"error_code,omitempty"`
// The log level. Can be: `error`, `warning`, `notice`, or `debug`.
LogLevel *string `json:"log_level,omitempty"`
// The URL of the page in our [Error Dictionary](https://www.twilio.com/docs/api/errors) with more information about the error condition.
MoreInfo *string `json:"more_info,omitempty"`
// The method used by the request that generated the alert. If the alert was generated by a request we made to your server, this is the method we used. If the alert was generated by a request from your application to our API, this is the method your application used.
RequestMethod *string `json:"request_method,omitempty"`
// The URL of the request that generated the alert. If the alert was generated by a request we made to your server, this is the URL on your server that generated the alert. If the alert was generated by a request from your application to our API, this is the URL of the resource requested.
RequestUrl *string `json:"request_url,omitempty"`
// The variables passed in the request that generated the alert. This value is only returned when a single Alert resource is fetched.
RequestVariables *string `json:"request_variables,omitempty"`
// The SID of the resource for which the alert was generated. For instance, if your server failed to respond to an HTTP request during the flow of a particular call, this value would be the SID of the server. This value is empty if the alert was not generated for a particular resource.
ResourceSid *string `json:"resource_sid,omitempty"`
// The response body of the request that generated the alert. This value is only returned when a single Alert resource is fetched.
ResponseBody *string `json:"response_body,omitempty"`
// The response headers of the request that generated the alert. This value is only returned when a single Alert resource is fetched.
ResponseHeaders *string `json:"response_headers,omitempty"`
// The unique string that we created to identify the Alert resource.
Sid *string `json:"sid,omitempty"`
// The absolute URL of the Alert resource.
Url *string `json:"url,omitempty"`
// The request headers of the request that generated the alert. This value is only returned when a single Alert resource is fetched.
RequestHeaders *string `json:"request_headers,omitempty"`
// The SID of the service or resource that generated the alert. Can be `null`.
ServiceSid *string `json:"service_sid,omitempty"`
}
MonitorV1AlertInstance struct for MonitorV1AlertInstance
type MonitorV1Event ¶
type MonitorV1Event struct {
// The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Event resource.
AccountSid *string `json:"account_sid,omitempty"`
// The SID of the actor that caused the event, if available. Can be `null`.
ActorSid *string `json:"actor_sid,omitempty"`
// The type of actor that caused the event. Can be: `user` for a change made by a logged-in user in the Twilio Console, `account` for an event caused by an API request by an authenticating Account, `twilio-admin` for an event caused by a Twilio employee, and so on.
ActorType *string `json:"actor_type,omitempty"`
// A description of the event. Can be `null`.
Description *string `json:"description,omitempty"`
// An object with additional data about the event. The contents depend on `event_type`. For example, event-types of the form `RESOURCE.updated`, this value contains a `resource_properties` dictionary that describes the previous and updated properties of the resource.
EventData *interface{} `json:"event_data,omitempty"`
// The date and time in GMT when the event was recorded specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
EventDate *time.Time `json:"event_date,omitempty"`
// The event's type. Event-types are typically in the form: `RESOURCE_TYPE.ACTION`, where `RESOURCE_TYPE` is the type of resource that was affected and `ACTION` is what happened to it. For example, `phone-number.created`. For a full list of all event-types, see the [Monitor Event Types](https://www.twilio.com/docs/usage/monitor-events#event-types).
EventType *string `json:"event_type,omitempty"`
// The SID of the resource that was affected.
ResourceSid *string `json:"resource_sid,omitempty"`
// The type of resource that was affected. For a full list of all resource-types, see the [Monitor Event Types](https://www.twilio.com/docs/usage/monitor-events#event-types).
ResourceType *string `json:"resource_type,omitempty"`
// The unique string that we created to identify the Event resource.
Sid *string `json:"sid,omitempty"`
// The originating system or interface that caused the event. Can be: `web` for events caused by user action in the Twilio Console, `api` for events caused by a request to our API, or `twilio` for events caused by an automated or internal Twilio system.
Source *string `json:"source,omitempty"`
// The IP address of the source, if the source is outside the Twilio cloud. This value is `null` for events with `source` of `twilio`
SourceIpAddress *string `json:"source_ip_address,omitempty"`
// The absolute URL of the resource that was affected. Can be `null`.
Url *string `json:"url,omitempty"`
// The absolute URLs of related resources.
Links *map[string]interface{} `json:"links,omitempty"`
}
MonitorV1Event struct for MonitorV1Event