Documentation ¶
Index ¶
- Constants
- type APIClient
- func (ac *APIClient) ActivateSubscriber(imsi string) (*Subscriber, error)
- func (ac *APIClient) Auth(email, password string) error
- func (ac *APIClient) CreateCoupon(options *CreatedCouponOptions) (*CreatedCoupon, error)
- func (ac *APIClient) CreateEventHandler(options *CreateEventHandlerOptions) error
- func (ac *APIClient) CreateGroup(tags Tags) (*Group, error)
- func (ac *APIClient) CreateGroupWithName(name string) (*Group, error)
- func (ac *APIClient) CreateOperator(email, password string) error
- func (ac *APIClient) CreateSubscriber() (*CreatedSubscriber, error)
- func (ac *APIClient) DeactivateSubscriber(imsi string) (*Subscriber, error)
- func (ac *APIClient) DeleteEventHandler(handlerID string) error
- func (ac *APIClient) DeleteGroup(groupID string) error
- func (ac *APIClient) DeleteGroupConfiguration(groupID, namespace, name string) (*Group, error)
- func (ac *APIClient) DeleteGroupTag(groupID, tagName string) error
- func (ac *APIClient) DeleteSandboxOperator() error
- func (ac *APIClient) DeleteSubscriberTag(imsi string, tagName string) error
- func (ac *APIClient) DisableSubscriberTermination(imsi string) (*Subscriber, error)
- func (ac *APIClient) EnableSubscriberTermination(imsi string) (*Subscriber, error)
- func (ac *APIClient) ExportAirStats(from, to time.Time, period StatsPeriod) (*url.URL, error)
- func (ac *APIClient) ExportBeamStats(from, to time.Time, period StatsPeriod) (*url.URL, error)
- func (ac *APIClient) GenerateAPIToken(timeout int) (string, error)
- func (ac *APIClient) GetAirStats(imsi string, from, to time.Time, period StatsPeriod) ([]AirStats, error)
- func (ac *APIClient) GetBeamStats(imsi string, from, to time.Time, period StatsPeriod) ([]BeamStats, error)
- func (ac *APIClient) GetEventHandler(handlerID string) (*EventHandler, error)
- func (ac *APIClient) GetGroup(groupID string) (*Group, error)
- func (ac *APIClient) GetOperator(operatorID string) (*Operator, error)
- func (ac *APIClient) GetSignupToken(email, authKeyID, authKey string) (string, error)
- func (ac *APIClient) GetSubscriber(imsi string) (*Subscriber, error)
- func (ac *APIClient) GetSupportToken() (string, error)
- func (ac *APIClient) InsertAirStats(imsi string, stats AirStats) error
- func (ac *APIClient) InsertBeamStats(imsi string, stats BeamStats) error
- func (ac *APIClient) ListEventHandlers(options *ListEventHandlersOptions) ([]EventHandler, error)
- func (ac *APIClient) ListEventHandlersForSubscriber(imsi string) ([]EventHandler, error)
- func (ac *APIClient) ListGroups(options *ListGroupsOptions) ([]Group, *PaginationKeys, error)
- func (ac *APIClient) ListSubscribers(options *ListSubscribersOptions) ([]Subscriber, *PaginationKeys, error)
- func (ac *APIClient) ListSubscribersInGroup(groupID string, options *ListSubscribersInGroupOptions) ([]Subscriber, *PaginationKeys, error)
- func (ac *APIClient) PutSubscriberTags(imsi string, tags []Tag) (*Subscriber, error)
- func (ac *APIClient) RegisterPaymentMethodWebPay(wp *PaymentMethodInfoWebPay) error
- func (ac *APIClient) RegisterSubscriber(imsi string, regOptions RegisterSubscriberOptions) (*Subscriber, error)
- func (ac *APIClient) SetSubscriberExpiryTime(imsi string, expiryTime time.Time) (*Subscriber, error)
- func (ac *APIClient) SetSubscriberGroup(imsi, groupID string) (*Subscriber, error)
- func (ac *APIClient) SetVerbose(verbose bool)
- func (ac *APIClient) TerminateSubscriber(imsi string) (*Subscriber, error)
- func (ac *APIClient) UnsetSubscriberExpiryTime(imsi string) (*Subscriber, error)
- func (ac *APIClient) UnsetSubscriberGroup(imsi string) (*Subscriber, error)
- func (ac *APIClient) UpdateAirConfig(groupID string, airConfig *AirConfig) (*Group, error)
- func (ac *APIClient) UpdateBeamTCPConfig(groupID, entryPoint string, beamTCPConfig *BeamTCPConfig) (*Group, error)
- func (ac *APIClient) UpdateEventHandler(eh *EventHandler) error
- func (ac *APIClient) UpdateGroupConfigurations(groupID, namespace string, configurations []GroupConfig) (*Group, error)
- func (ac *APIClient) UpdateGroupTags(groupID string, tags []Tag) (*Group, error)
- func (ac *APIClient) UpdatePassword(currentPassword, newPassword string) error
- func (ac *APIClient) UpdateSubscriberSpeedClass(imsi, speedClass string) (*Subscriber, error)
- func (ac *APIClient) VerifyOperator(token string) error
- type APIClientOptions
- type APIError
- type ActionConfig
- type AirConfig
- type AirStats
- type AirStatsForSpeedClass
- type AuthKey
- type AuthRequest
- type AuthResponse
- type BeamHTTPConfig
- type BeamMQTTConfig
- type BeamStats
- type BeamStatsForType
- type BeamTCPConfig
- type BeamType
- type BeamUDPConfig
- type ClientCerts
- type ConfigNamespace
- type CreateEventHandlerOptions
- type CreatedCoupon
- type CreatedCouponOptions
- type CreatedSubscriber
- type CustomHeader
- type EventHandler
- type EventHandlerActionType
- type EventHandlerRuleType
- type GenerateAPITokenResponse
- type GetSupportTokenResponse
- type Group
- type GroupConfig
- type ListEventHandlersOptions
- type ListGroupsOptions
- type ListSubscribersInGroupOptions
- type ListSubscribersOptions
- type MetaData
- type MetadataClient
- func (mc *MetadataClient) DeleteTag(tagName string) error
- func (mc *MetadataClient) DisableTermination() (*Subscriber, error)
- func (mc *MetadataClient) EnableTermination() (*Subscriber, error)
- func (mc *MetadataClient) GetSubscriber() (*Subscriber, error)
- func (mc *MetadataClient) GetUserdata() (string, error)
- func (mc *MetadataClient) PutTags(tags []Tag) (*Subscriber, error)
- func (mc *MetadataClient) SetExpiryTime(expiryTime time.Time) (*Subscriber, error)
- func (mc *MetadataClient) SetGroup(groupID string) (*Subscriber, error)
- func (mc *MetadataClient) UnsetExpiryTime() (*Subscriber, error)
- func (mc *MetadataClient) UnsetGroup() (*Subscriber, error)
- func (mc *MetadataClient) UpdateSpeedClass(speedClass string) (*Subscriber, error)
- type MetadataClientOptions
- type Operator
- type PaginationKeys
- type PaymentMethodInfoWebPay
- type Properties
- type RegisterSubscriberOptions
- type RuleConfig
- type SandboxGetSignupTokenResponse
- type SessionStatus
- type SpeedClass
- type StatsPeriod
- type Subscriber
- type Tag
- type TagValueMatchMode
- type Tags
- type TimestampMilli
Constants ¶
const ( // BeamTypeInHTTP is ... BeamTypeInHTTP = "inHttp" // BeamTypeInMQTT is ... BeamTypeInMQTT = "inMqtt" // BeamTypeInTCP is ... BeamTypeInTCP = "inTcp" // BeamTypeInUDP is ... BeamTypeInUDP = "inUdp" // BeamTypeOutHTTP is ... BeamTypeOutHTTP = "outHttp" // BeamTypeOutHTTPS is ... BeamTypeOutHTTPS = "outHttps" // BeamTypeOutMQTT is ... BeamTypeOutMQTT = "outMqtt" // BeamTypeOutMQTTS is ... BeamTypeOutMQTTS = "outMqtts" // BeamTypeOutTCP is ... BeamTypeOutTCP = "outTcp" // BeamTypeOutTCPS is ... BeamTypeOutTCPS = "outTcps" // BeamTypeOutUDP is ... BeamTypeOutUDP = "outUdp" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient struct { APIKey string Token string OperatorID string // contains filtered or unexported fields }
APIClient provides an access to SORACOM REST API
func NewAPIClient ¶
func NewAPIClient(options *APIClientOptions) *APIClient
NewAPIClient creates an instance of APIClient
func (*APIClient) ActivateSubscriber ¶
func (ac *APIClient) ActivateSubscriber(imsi string) (*Subscriber, error)
ActivateSubscriber activates a subscriber.
func (*APIClient) CreateCoupon ¶
func (ac *APIClient) CreateCoupon(options *CreatedCouponOptions) (*CreatedCoupon, error)
CreateCoupon sends a request to create a brand-new coupon
func (*APIClient) CreateEventHandler ¶
func (ac *APIClient) CreateEventHandler(options *CreateEventHandlerOptions) error
CreateEventHandler creates an event handler
func (*APIClient) CreateGroup ¶
CreateGroup creates a group
func (*APIClient) CreateGroupWithName ¶
CreateGroupWithName creates a group with name
func (*APIClient) CreateOperator ¶
CreateOperator sends a request to create an operator with the specified email & password.
func (*APIClient) CreateSubscriber ¶
func (ac *APIClient) CreateSubscriber() (*CreatedSubscriber, error)
CreateSubscriber sends a request to create a brand-new subscriber
func (*APIClient) DeactivateSubscriber ¶
func (ac *APIClient) DeactivateSubscriber(imsi string) (*Subscriber, error)
DeactivateSubscriber deactivates a subscriber.
func (*APIClient) DeleteEventHandler ¶
DeleteEventHandler deletes the specified event handler
func (*APIClient) DeleteGroup ¶
DeleteGroup deletes a group
func (*APIClient) DeleteGroupConfiguration ¶
DeleteGroupConfiguration deletes a configuration for a group
func (*APIClient) DeleteGroupTag ¶
DeleteGroupTag deletes a tag for a group
func (*APIClient) DeleteSandboxOperator ¶
DeleteSandboxOperator delete a sandbox operator
func (*APIClient) DeleteSubscriberTag ¶
DeleteSubscriberTag deletes a tag on a subscriber
func (*APIClient) DisableSubscriberTermination ¶
func (ac *APIClient) DisableSubscriberTermination(imsi string) (*Subscriber, error)
DisableSubscriberTermination disables termination of a subscriber.
func (*APIClient) EnableSubscriberTermination ¶
func (ac *APIClient) EnableSubscriberTermination(imsi string) (*Subscriber, error)
EnableSubscriberTermination enables termination of a subscriber.
func (*APIClient) ExportAirStats ¶
ExportAirStats gets a URL to download a CSV file which contains stats of all Air SIMs for the operator for a specified period
func (*APIClient) ExportBeamStats ¶
ExportBeamStats gets a URL to download a CSV file which contains all stats of Beam for the operator for a specified period
func (*APIClient) GenerateAPIToken ¶
GenerateAPIToken generates an API token
func (*APIClient) GetAirStats ¶
func (ac *APIClient) GetAirStats(imsi string, from, to time.Time, period StatsPeriod) ([]AirStats, error)
GetAirStats gets stats of Air for a subscriber for a specified period
func (*APIClient) GetBeamStats ¶
func (ac *APIClient) GetBeamStats(imsi string, from, to time.Time, period StatsPeriod) ([]BeamStats, error)
GetBeamStats gets stats of Beam for a subscriber for a specified period
func (*APIClient) GetEventHandler ¶
func (ac *APIClient) GetEventHandler(handlerID string) (*EventHandler, error)
GetEventHandler gets the specified event handler
func (*APIClient) GetOperator ¶
GetOperator gets information about an operator specifed by operatorID.
func (*APIClient) GetSignupToken ¶
GetSignupToken retrieves token to complete signup (sandbox environment only)
func (*APIClient) GetSubscriber ¶
func (ac *APIClient) GetSubscriber(imsi string) (*Subscriber, error)
GetSubscriber gets information about a subscriber specifed by imsi.
func (*APIClient) GetSupportToken ¶
GetSupportToken retrieves a token for accessing to the support site
func (*APIClient) InsertAirStats ¶
InsertAirStats inserts a set of data communication stats with a timestamp for a subscriber
func (*APIClient) InsertBeamStats ¶
InsertBeamStats inserts a set of beam stats with a timestamp for a subscriber
func (*APIClient) ListEventHandlers ¶
func (ac *APIClient) ListEventHandlers(options *ListEventHandlersOptions) ([]EventHandler, error)
ListEventHandlers lists event handlers for the operator
func (*APIClient) ListEventHandlersForSubscriber ¶
func (ac *APIClient) ListEventHandlersForSubscriber(imsi string) ([]EventHandler, error)
ListEventHandlersForSubscriber creates an event handler with the specified options
func (*APIClient) ListGroups ¶
func (ac *APIClient) ListGroups(options *ListGroupsOptions) ([]Group, *PaginationKeys, error)
ListGroups lists groups for the operator
func (*APIClient) ListSubscribers ¶
func (ac *APIClient) ListSubscribers(options *ListSubscribersOptions) ([]Subscriber, *PaginationKeys, error)
ListSubscribers lists subscribers for the operator
func (*APIClient) ListSubscribersInGroup ¶
func (ac *APIClient) ListSubscribersInGroup(groupID string, options *ListSubscribersInGroupOptions) ([]Subscriber, *PaginationKeys, error)
ListSubscribersInGroup lists subscribers in a group
func (*APIClient) PutSubscriberTags ¶
func (ac *APIClient) PutSubscriberTags(imsi string, tags []Tag) (*Subscriber, error)
PutSubscriberTags puts tags on a subscriber
func (*APIClient) RegisterPaymentMethodWebPay ¶
func (ac *APIClient) RegisterPaymentMethodWebPay(wp *PaymentMethodInfoWebPay) error
RegisterPaymentMethodWebPay registers the specified WebPay information as an active payment method
func (*APIClient) RegisterSubscriber ¶
func (ac *APIClient) RegisterSubscriber(imsi string, regOptions RegisterSubscriberOptions) (*Subscriber, error)
RegisterSubscriber registers a subscriber.
func (*APIClient) SetSubscriberExpiryTime ¶
func (ac *APIClient) SetSubscriberExpiryTime(imsi string, expiryTime time.Time) (*Subscriber, error)
SetSubscriberExpiryTime sets expiration time of a subscriber.
func (*APIClient) SetSubscriberGroup ¶
func (ac *APIClient) SetSubscriberGroup(imsi, groupID string) (*Subscriber, error)
SetSubscriberGroup sets a group of a subscriber.
func (*APIClient) SetVerbose ¶
SetVerbose sets if verbose output is enabled or not
func (*APIClient) TerminateSubscriber ¶
func (ac *APIClient) TerminateSubscriber(imsi string) (*Subscriber, error)
TerminateSubscriber terminates a subscriber.
func (*APIClient) UnsetSubscriberExpiryTime ¶
func (ac *APIClient) UnsetSubscriberExpiryTime(imsi string) (*Subscriber, error)
UnsetSubscriberExpiryTime unsets expiration time of a subscriber.
func (*APIClient) UnsetSubscriberGroup ¶
func (ac *APIClient) UnsetSubscriberGroup(imsi string) (*Subscriber, error)
UnsetSubscriberGroup unsets group of a subscriber.
func (*APIClient) UpdateAirConfig ¶
UpdateAirConfig updates SORACOM Air configurations for a group
func (*APIClient) UpdateBeamTCPConfig ¶
func (ac *APIClient) UpdateBeamTCPConfig(groupID, entryPoint string, beamTCPConfig *BeamTCPConfig) (*Group, error)
UpdateBeamTCPConfig updates SORACOM Beam configurations for a group
func (*APIClient) UpdateEventHandler ¶
func (ac *APIClient) UpdateEventHandler(eh *EventHandler) error
UpdateEventHandler updates the specified event handler
func (*APIClient) UpdateGroupConfigurations ¶
func (ac *APIClient) UpdateGroupConfigurations(groupID, namespace string, configurations []GroupConfig) (*Group, error)
UpdateGroupConfigurations updates configurations for a group
func (*APIClient) UpdateGroupTags ¶
UpdateGroupTags updates tags a group
func (*APIClient) UpdatePassword ¶
UpdatePassword updates operator's password
func (*APIClient) UpdateSubscriberSpeedClass ¶
func (ac *APIClient) UpdateSubscriberSpeedClass(imsi, speedClass string) (*Subscriber, error)
UpdateSubscriberSpeedClass updates speed class of a subscriber.
func (*APIClient) VerifyOperator ¶
VerifyOperator sends a token to complete an operator creation process.
type APIClientOptions ¶
type APIClientOptions struct {
Endpoint string
}
APIClientOptions holds options for creating an APIClient
type APIError ¶
APIError represents an error ocurred while calling API
func NewAPIError ¶
NewAPIError creates an instance of APIError from http.Response
type ActionConfig ¶
type ActionConfig struct { Type EventHandlerActionType `json:"type"` Properties Properties `json:"properties"` }
ActionConfig contains an action to be invoked when a condition is satisfied
type AirConfig ¶
type AirConfig struct { UseCustomDNS bool `json:"useCustomDns"` DNSServers []string `json:"dnsServers"` MetaData MetaData `json:"metadata"` UserData string `json:"userdata"` }
AirConfig holds configuration parameters for SORACOM Air
type AirStats ¶
type AirStats struct { Date string `json:"date"` Unixtime uint64 `json:"unixtime"` Traffic map[SpeedClass]AirStatsForSpeedClass `json:"dataTrafficStatsMap"` }
AirStats holds a set of traffic information for each speed class
type AirStatsForSpeedClass ¶
type AirStatsForSpeedClass struct { UploadBytes uint64 `json:"uploadByteSizeTotal"` UploadPackets uint64 `json:"uploadPacketSizeTotal"` DownloadBytes uint64 `json:"downloadByteSizeTotal"` DownloadPackets uint64 `json:"downloadPacketSizeTotal"` }
AirStatsForSpeedClass holds Upload/Download Bytes/Packets for a speed class
type AuthRequest ¶
type AuthRequest struct { Email string `json:"email"` Password string `json:"password"` TokenTimeoutSeconds int `json:"tokenTimeoutSeconds"` }
AuthRequest contains parameters for /auth API
func (*AuthRequest) JSON ¶
func (ar *AuthRequest) JSON() string
JSON returns JSON representing AuthRequest
type AuthResponse ¶
type AuthResponse struct { APIKey string `json:"apiKey"` OperatorID string `json:"operatorId"` Token string `json:"token"` }
AuthResponse contains all values returned from /auth API
type BeamHTTPConfig ¶
type BeamHTTPConfig struct { Name string `json:"name"` Destination string `json:"destination"` Enabled bool `json:"enabled"` AddSubscriberHeader bool `json:"addSubscriberHeader"` AddSignature bool `json:"addSignature"` CustomHeaders map[string]CustomHeader `json:"customHeaders"` PSK string `json:"psk"` }
BeamHTTPConfig holds SORACOM Beam HTTP entry point configurations
type BeamMQTTConfig ¶
type BeamMQTTConfig struct { Name string `json:"name"` Destination string `json:"destination"` Enabled bool `json:"enabled"` AddSubscriberHeader bool `json:"addSubscriberHeader"` Username string `json:"username"` Password string `json:"password"` UseClientCertificates string `json:"useClientCert"` ClientCertificates map[string]ClientCerts `json:"clientCerts"` }
BeamMQTTConfig holds SORACOM Beam MQTT entry point configurations
type BeamStats ¶
type BeamStats struct { Date string `json:"date"` Unixtime uint64 `json:"unixtime"` Traffic map[BeamType]BeamStatsForType `json:"beamStatsMap"` }
BeamStats holds a set of traffic information for each speed class
type BeamStatsForType ¶
type BeamStatsForType struct {
Count uint64 `json:"count"`
}
BeamStatsForType holds Upload/Download Bytes/Packets for a speed class
type BeamTCPConfig ¶
type BeamTCPConfig struct { Name string `json:"name"` Destination string `json:"destination"` Enabled bool `json:"enabled"` AddSubscriberHeader bool `json:"addSubscriberHeader"` AddSignature bool `json:"addSignature"` PSK string `json:"psk"` }
BeamTCPConfig holds SORACOM Beam TCP entry point configurations
type BeamUDPConfig ¶
type BeamUDPConfig struct { Name string `json:"name"` Destination string `json:"destination"` Enabled bool `json:"enabled"` AddSubscriberHeader bool `json:"addSubscriberHeader"` AddSignature bool `json:"addSignature"` PSK string `json:"psk"` }
BeamUDPConfig holds SORACOM Beam UDP entry point configurations
type ClientCerts ¶
type ClientCerts struct { CA string `json:"ca"` Cert string `json:"cert"` PrivateKey string `json:"key"` }
ClientCerts consists of a CA certificate,
type ConfigNamespace ¶
type ConfigNamespace string
ConfigNamespace is a type of namespace of a configuration
type CreateEventHandlerOptions ¶
type CreateEventHandlerOptions struct { TargetImsi *string `json:"targetImsi"` TargetOperatorID *string `json:"targetOperatorId"` TargetTag *Tags `json:"targetTag"` TargetGroupID *string `json:"targetGroupId"` Name string `json:"name"` Description string `json:"description"` RuleConfig RuleConfig `json:"ruleConfig"` Status string `json:"status"` ActionConfigList []ActionConfig `json:"actionConfigList"` }
CreateEventHandlerOptions keeps information to create an event handler
func (*CreateEventHandlerOptions) JSON ¶
func (o *CreateEventHandlerOptions) JSON() string
JSON converts CreateEventhandlerOptions into a JSON string
type CreatedCoupon ¶
type CreatedCouponOptions ¶
type CreatedCouponOptions struct { Amount int `json:"amount"` ApplicableBillItemName string `json:"applicableBillItemName"` ExpiryYearMonth string `json:"expiryYearMonth"` }
func (*CreatedCouponOptions) JSON ¶
func (o *CreatedCouponOptions) JSON() string
JSON converts CreatedCouponOptions into a JSON string
type CreatedSubscriber ¶
type CreatedSubscriber struct { Imsi string `json:"imsi"` Msisdn string `json:"msisdn"` RegistrationSecret string `json:"registrationSecret"` }
CreatedSubscriber keeps information of a created subscriber
type CustomHeader ¶
type CustomHeader struct { Action string `json:"action"` Key string `json:"headerKey"` Value string `json:"headerValue"` }
CustomHeader holds Action, Key and Value for a custom header
type EventHandler ¶
type EventHandler struct { HandlerID string `json:"handlerId"` TargetImsi *string `json:"targetImsi"` TargetOperatorID *string `json:"targetOperatorId"` TargetTag *Tags `json:"targetTag"` TargetGroupID *string `json:"targetGroupId"` Name string `json:"name"` Description string `json:"description"` RuleConfig RuleConfig `json:"ruleConfig"` Status string `json:"status"` ActionConfigList []ActionConfig `json:"actionConfigList"` }
EventHandler keeps information about an event handler
func (*EventHandler) JSON ¶
func (o *EventHandler) JSON() string
JSON converts Eventhandler into a JSON string
type EventHandlerActionType ¶
type EventHandlerActionType string
EventHandlerActionType is a type of event hander's action
const ( // EventHandlerActionTypeUnspecified means that the type field in ActionConfigList has not been specified EventHandlerActionTypeUnspecified EventHandlerActionType = "" // EventHandlerActionTypeChangeSpeedClass indicates a type of action to be invoked to change speed class for a subscriber once a condition is satisfied EventHandlerActionTypeChangeSpeedClass EventHandlerActionType = "ChangeSpeedClassAction" // EventHandlerActionTypeSendMail indicates a type of action to be invoked to send an email once a condition is satisfied EventHandlerActionTypeSendMail EventHandlerActionType = "SendMailAction" // EventHandlerActionTypeInvokeAWSLambda indicates a type of action to be invoked to invoke AWS Lambda function once a condition is satisfied EventHandlerActionTypeInvokeAWSLambda EventHandlerActionType = "InvokeAWSLambdaAction" )
type EventHandlerRuleType ¶
type EventHandlerRuleType string
EventHandlerRuleType is a type of event hander's rule
const ( // EventHandlerRuleTypeUnspecified means that the type field in RuleConfig has not been specified EventHandlerRuleTypeUnspecified EventHandlerRuleType = "" // EventHandlerRuleTypeDailyTraffic is a rule type to invoke actions when data traffic for a day for a subscriber exceeds the specified limit EventHandlerRuleTypeDailyTraffic EventHandlerRuleType = "DailyTrafficRule" // EventHandlerRuleTypeMonthlyTraffic is a rule type to invoke actions when data traffic for a month for a subscriber exceeds the specified limit EventHandlerRuleTypeMonthlyTraffic EventHandlerRuleType = "MonthlyTraffic" // EventHandlerRuleTypeCumulativeTraffic is a rule type to invoke actions when cumulative data traffic for a subscriber exceeds the specified limit EventHandlerRuleTypeCumulativeTraffic EventHandlerRuleType = "CumulativeTraffic" // EventHandlerRuleTypeDailyTotalTraffic is a rule type to invoke actions when total data traffic for a day for all subscribers exceeds the specified limit EventHandlerRuleTypeDailyTotalTraffic EventHandlerRuleType = "DailyTotalTraffic" // EventHandlerRuleTypeMonthlyTotalTraffic is a rule type to invoke actions when total data traffic for a month for all subscribers exceeds the specified limit EventHandlerRuleTypeMonthlyTotalTraffic EventHandlerRuleType = "MonthlyTotalTraffic" // EventHandlerRuleTypeSubscriberStatusChanged is a rule type to invoke actions when status of a subscriber has been changed EventHandlerRuleTypeSubscriberStatusChanged EventHandlerRuleType = "SubscriberStatusChanged" // EventHandlerRuleTypeSubscriberSpeedClassChanged is a rule type to invoke actions when speed class of a subscriber has been changed EventHandlerRuleTypeSubscriberSpeedClassChanged EventHandlerRuleType = "SubscriberSpeedClassChanged" )
type GenerateAPITokenResponse ¶
type GenerateAPITokenResponse struct {
Token string `json:"token"`
}
GenerateAPITokenResponse contains all values returned from /operators/{operator_id}/token API
type GetSupportTokenResponse ¶
type GetSupportTokenResponse struct {
Token string `json:"token"`
}
GetSupportTokenResponse contains all values returned from /operators/{operator_id}/support/token API.
type Group ¶
type Group struct { Configuration map[ConfigNamespace]interface{} `json:"configuration"` CreatedTime *TimestampMilli `json:"createdTime"` GroupID string `json:"groupId"` LastModifiedTime *TimestampMilli `json:"lastModifiedTime"` OperatorID string `json:"operatorId"` Tags Tags `json:"tags"` }
Group keeps information about a group
type GroupConfig ¶
type GroupConfig struct { Key string `json:"key"` Value interface{} `json:"value"` }
GroupConfig holds a pair of a key and a value
type ListEventHandlersOptions ¶
type ListEventHandlersOptions struct {
Target string
}
ListEventHandlersOptions holds options for APIClient.ListEventHandlers()
func (*ListEventHandlersOptions) String ¶
func (leho *ListEventHandlersOptions) String() string
type ListGroupsOptions ¶
type ListGroupsOptions struct { TagName string TagValue string TagValueMatchMode TagValueMatchMode Limit int LastEvaluatedKey string }
ListGroupsOptions holds options for APIClient.ListGroups()
func (*ListGroupsOptions) String ¶
func (lso *ListGroupsOptions) String() string
type ListSubscribersInGroupOptions ¶
ListSubscribersInGroupOptions holds options for APIClient.ListSubscribersInGroup()
func (*ListSubscribersInGroupOptions) String ¶
func (lso *ListSubscribersInGroupOptions) String() string
type ListSubscribersOptions ¶
type ListSubscribersOptions struct { TagName string TagValue string TagValueMatchMode TagValueMatchMode StatusFilter string TypeFilter string Limit int LastEvaluatedKey string }
ListSubscribersOptions holds options for APIClient.ListSubscribers()
func (*ListSubscribersOptions) String ¶
func (lso *ListSubscribersOptions) String() string
type MetaData ¶
type MetaData struct { Enabled bool `json:"enabled"` ReadOnly bool `json:"readonly"` AllowOrigin string `json:"allowOrigin"` }
MetaData holds configuration for SORACOM Air Metadata
type MetadataClient ¶
type MetadataClient struct {
// contains filtered or unexported fields
}
MetadataClient provides an access to SORACOM Metadata Service APIs
func NewMetadataClient ¶
func NewMetadataClient(options *MetadataClientOptions) *MetadataClient
NewMetadataClient creates an instance of MetadataClient
func (*MetadataClient) DeleteTag ¶
func (mc *MetadataClient) DeleteTag(tagName string) error
DeleteTag deletes a tag on the calling subscriber
func (*MetadataClient) DisableTermination ¶
func (mc *MetadataClient) DisableTermination() (*Subscriber, error)
DisableTermination disables termination of the calling subscriber.
func (*MetadataClient) EnableTermination ¶
func (mc *MetadataClient) EnableTermination() (*Subscriber, error)
EnableTermination enables termination of the calling subscriber.
func (*MetadataClient) GetSubscriber ¶
func (mc *MetadataClient) GetSubscriber() (*Subscriber, error)
GetSubscriber gets metadata for the calling subscriber
func (*MetadataClient) GetUserdata ¶
func (mc *MetadataClient) GetUserdata() (string, error)
GetUserdata gets userdata for the calling subscriber's group
func (*MetadataClient) PutTags ¶
func (mc *MetadataClient) PutTags(tags []Tag) (*Subscriber, error)
PutTags puts tags on the calling subscriber
func (*MetadataClient) SetExpiryTime ¶
func (mc *MetadataClient) SetExpiryTime(expiryTime time.Time) (*Subscriber, error)
SetExpiryTime sets expiration time of the calling subscriber.
func (*MetadataClient) SetGroup ¶
func (mc *MetadataClient) SetGroup(groupID string) (*Subscriber, error)
SetGroup sets a group of the calling subscriber.
func (*MetadataClient) UnsetExpiryTime ¶
func (mc *MetadataClient) UnsetExpiryTime() (*Subscriber, error)
UnsetExpiryTime unsets expiration time of the calling subscriber.
func (*MetadataClient) UnsetGroup ¶
func (mc *MetadataClient) UnsetGroup() (*Subscriber, error)
UnsetGroup unsets group of the calling subscriber.
func (*MetadataClient) UpdateSpeedClass ¶
func (mc *MetadataClient) UpdateSpeedClass(speedClass string) (*Subscriber, error)
UpdateSpeedClass updates speed class of the calling subscriber.
type MetadataClientOptions ¶
type MetadataClientOptions struct {
Endpoint string
}
MetadataClientOptions holds options for creating an MetadataClient
type Operator ¶
type Operator struct { OperatorID string `json:"operatorId"` RootOperatorID *string `json:"rootOperatorId"` Email string `json:"email"` Description *string `json:"description"` CreateDate *time.Time `json:"createDate"` UpdateDate *time.Time `json:"updateDate"` }
Operator keeps information about an operator
type PaginationKeys ¶
PaginationKeys holds keys for pagination
type PaymentMethodInfoWebPay ¶
type PaymentMethodInfoWebPay struct { Cvc string `json:"cvc"` ExpireMonth int `json:"expireMonth"` ExpireYear int `json:"expireYear"` Name string `json:"name"` Number string `json:"number"` }
PaymentMethodInfoWebPay keeps information of an WebPay payment method
func (*PaymentMethodInfoWebPay) JSON ¶
func (o *PaymentMethodInfoWebPay) JSON() string
JSON converts PaymentMethodInfoWebPay into a JSON string
type Properties ¶
Properties is a map of property name and propaty value
type RegisterSubscriberOptions ¶
type RegisterSubscriberOptions struct { RegistrationSecret string `json:"registrationSecret"` GroupID string `json:"groupId"` Tags Tags `json:"tags"` }
RegisterSubscriberOptions keeps information for registering a subscriber
func (*RegisterSubscriberOptions) JSON ¶
func (rso *RegisterSubscriberOptions) JSON() string
JSON retunrs a JSON representing RegisterSubscriberOptions object
type RuleConfig ¶
type RuleConfig struct { Type EventHandlerRuleType `json:"type"` Properties Properties `json:"properties"` }
RuleConfig contains a condition to invoke actions
type SandboxGetSignupTokenResponse ¶
type SandboxGetSignupTokenResponse struct {
Token string `json:"token"`
}
SandboxGetSignupTokenResponse keeps information of a signup token
type SessionStatus ¶
type SessionStatus struct { DNSServers []string `json:"dnsServers"` Imei string `json:"imei"` LastUpdatedAt *TimestampMilli `json:"lastUpdatedAt"` Location *string `json:"location"` Online bool `json:"online"` UEIPAddress string `json:"ueIpAddress"` }
SessionStatus keeps information about a session
type SpeedClass ¶
type SpeedClass string
SpeedClass represents one of speed classes
const ( // SpeedClassS1Minimum is s1.minimum SpeedClassS1Minimum SpeedClass = "s1.minimum" // SpeedClassS1Slow is s1.slow SpeedClassS1Slow SpeedClass = "s1.slow" // SpeedClassS1Standard is s1.standard SpeedClassS1Standard SpeedClass = "s1.standard" // SpeedClassS1Fast is s1.fast SpeedClassS1Fast SpeedClass = "s1.fast" )
type StatsPeriod ¶
type StatsPeriod int
StatsPeriod is a period to gather stats
const ( // StatsPeriodUnspecified means no StatsPeriod is specified StatsPeriodUnspecified StatsPeriod = iota // StatsPeriodMonth means the period of gathering stats is 'month' StatsPeriodMonth // StatsPeriodDay means that the period of gathering stats is 'day' StatsPeriodDay // StatsPeriodMinutes means that the period of gathering stats is 'minutes' StatsPeriodMinutes )
func (StatsPeriod) Parse ¶
func (p StatsPeriod) Parse(s string) StatsPeriod
Parse parses the specified string and returns a StatsPeriod value represented by the string
func (StatsPeriod) String ¶
func (p StatsPeriod) String() string
type Subscriber ¶
type Subscriber struct { Apn string `json:"apn"` CreatedTime *TimestampMilli `json:"createdTime"` ExpiryTime *TimestampMilli `json:"expiryTime"` GroupID *string `json:"groupId"` Imsi string `json:"imsi"` IPAddress *string `json:"ipAddress"` LastModifiedTime *TimestampMilli `json:"lastModifiedTime"` ModuleType string `json:"ModuleType"` Msisdn string `json:"msisdn"` OperatorID string `json:"operatorId"` Plan int `json:"plan"` SessionStatus *SessionStatus `json:"sessionStatus"` Status string `json:"status"` SpeedClass string `json:"speedClass"` Tags Tags `json:"tags"` TerminationEnabled bool `json:"terminationEnabled"` }
Subscriber keeps information about a subscriber
type TagValueMatchMode ¶
type TagValueMatchMode int
TagValueMatchMode is one of MatchModeUnspecified, MatchModeExact or MatchModePrefix
const ( // MatchModeUnspecified is a value of TagValueMatchMode. // For list functions, they don't match tag values (i.e. list all items regardless of values of tags) if this value is specified. MatchModeUnspecified TagValueMatchMode = iota // MatchModeExact is a value of TagValueMatchMode. // For list functions, they do exact match for tag values if this value is specified. MatchModeExact // MatchModePrefix is a value of TagValueMatchMode. // For list functions, they do prefix match for tag values if this value is specified. MatchModePrefix )
func (TagValueMatchMode) Parse ¶
func (m TagValueMatchMode) Parse(s string) TagValueMatchMode
Parse parses a provided string and returns TagValueMatchMode
func (TagValueMatchMode) String ¶
func (m TagValueMatchMode) String() string
type TimestampMilli ¶
TimestampMilli is ...
func (*TimestampMilli) MarshalJSON ¶
func (t *TimestampMilli) MarshalJSON() ([]byte, error)
MarshalJSON is ...
func (*TimestampMilli) UnixMilli ¶
func (t *TimestampMilli) UnixMilli() int64
UnixMilli returns t as a Unix time, the number of milliseconds elapsed since January 1, 1970 UTC.
func (*TimestampMilli) UnmarshalJSON ¶
func (t *TimestampMilli) UnmarshalJSON(b []byte) error
UnmarshalJSON is ...