Documentation
¶
Index ¶
- Constants
- type APIClient
- func (ac *APIClient) ActivateSubscriber(imsi string) (*Subscriber, error)
- func (ac *APIClient) Auth(email, password string) error
- func (ac *APIClient) AuthWithAuthKey(authKeyID, authKey string) error
- func (ac *APIClient) CreateCoupon(options *CreatedCouponOptions) (*CreatedCoupon, error)
- func (ac *APIClient) CreateCredentialWithName(name string, options *CredentialOptions) (*CreatedCredential, 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) CreateOperatorWithRequest(req CreateOperatorRequest) 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) ListSessionEvents(imsi string, options *ListSessionEventsOptions) ([]SessionEvent, 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) RegisterPaymentMethodPayJP(pm *PaymentMethodInfoPayJP) error
- func (ac *APIClient) RegisterPaymentMethodWebPay(wp *PaymentMethodInfoWebPay) error
- func (ac *APIClient) RegisterSubscriber(imsi string, regOptions RegisterSubscriberOptions) (*Subscriber, error)
- func (ac *APIClient) SearchSubscribers(attrName string, attrValue string) ([]Subscriber, *PaginationKeys, error)
- func (ac *APIClient) SetSubscriberExpiredAt(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) UnsetSubscriberExpiredAt(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 Cell
- type ClientCerts
- type ConfigNamespace
- type CreateEventHandlerOptions
- type CreateOperatorRequest
- type CreatedCoupon
- type CreatedCouponOptions
- type CreatedCredential
- type CreatedSubscriber
- type CredentialOptions
- type Credentials
- type CustomHeader
- type EventHandler
- type EventHandlerActionType
- type EventHandlerRuleType
- type FunnelDestinationConfig
- type GenerateAPITokenResponse
- type GetSupportTokenResponse
- type Group
- type GroupConfig
- type IMEILock
- type ListEventHandlersOptions
- type ListGroupsOptions
- type ListSessionEventsOptions
- 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) SetExpiredAt(expiryTime time.Time) (*Subscriber, error)
- func (mc *MetadataClient) SetGroup(groupID string) (*Subscriber, error)
- func (mc *MetadataClient) SetVerbose(verbose bool)
- func (mc *MetadataClient) UnsetExpiredAt() (*Subscriber, error)
- func (mc *MetadataClient) UnsetGroup() (*Subscriber, error)
- func (mc *MetadataClient) UpdateSpeedClass(speedClass string) (*Subscriber, error)
- type MetadataClientOptions
- type Operator
- type PaginationKeys
- type PaymentMethodInfoPayJP
- type PaymentMethodInfoWebPay
- type Properties
- type RegisterSubscriberOptions
- type RuleConfig
- type SandboxGetSignupTokenResponse
- type SessionEvent
- 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) AuthWithAuthKey ¶
AuthWithAuthKey does the authentication process with auth key. Gets an API key and an API Token
func (*APIClient) CreateCoupon ¶
func (ac *APIClient) CreateCoupon(options *CreatedCouponOptions) (*CreatedCoupon, error)
CreateCoupon sends a request to create a brand-new coupon
func (*APIClient) CreateCredentialWithName ¶
func (ac *APIClient) CreateCredentialWithName(name string, options *CredentialOptions) (*CreatedCredential, error)
CreateCredential sends a request to create a brand-new credential
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. (This function exists because it predates the addition of the coverageTypes API parameter. The newer CreateOperatorWithRequest() supports all of the API parameters.)
func (*APIClient) CreateOperatorWithRequest ¶
func (ac *APIClient) CreateOperatorWithRequest(req CreateOperatorRequest) error
CreateOperatorWithRequest sends a request to create an operator, whose email, password, and coverageTypes properties are defined by req.
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 deletes 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) ListSessionEvents ¶
func (ac *APIClient) ListSessionEvents(imsi string, options *ListSessionEventsOptions) ([]SessionEvent, error)
ListSessionEvents returns the event history for the specified subscriber, including session creation, change, and deletion. If the total number of events does not fit in one page, a URL for accessing the next page is returned in the Link header of the response.
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) RegisterPaymentMethodPayJP ¶
func (ac *APIClient) RegisterPaymentMethodPayJP(pm *PaymentMethodInfoPayJP) error
RegisterPaymentMethodPayJP registers the specified payment method tokens as an active payment method
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) SearchSubscribers ¶
func (ac *APIClient) SearchSubscribers(attrName string, attrValue string) ([]Subscriber, *PaginationKeys, error)
SearchSubscribers Searches subscribers by specified attributes
func (*APIClient) SetSubscriberExpiredAt ¶
SetSubscriberExpiredAt 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) UnsetSubscriberExpiredAt ¶
func (ac *APIClient) UnsetSubscriberExpiredAt(imsi string) (*Subscriber, error)
UnsetSubscriberExpiredAt 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,omitempty"`
Password string `json:"password,omitempty"`
AuthKeyID string `json:"authKeyId,omitempty"`
AuthKey string `json:"authKey,omitempty"`
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 Cell ¶
type Cell struct {
RadioType string `json:"radioType"`
MCC int `json:"mcc"` // Mobile Country Code
MNC int `json:"mnc"` // Mobile Network Code
TAC int `json:"tac"` // Tracking Area Code
ECI int `json:"eci"` // E-UTRAN Cell Identifier
}
Cell keeps information about a cell
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 CreateOperatorRequest ¶
type CreateOperatorRequest struct {
Email string `json:"email"`
Password string `json:"password"`
CoverageTypes []string `json:"coverageTypes,omitempty"`
}
CreateOperatorRequest defines the email, password, and coverage type(s) of the operator to be created
func (*CreateOperatorRequest) JSON ¶
func (r *CreateOperatorRequest) JSON() string
JSON encodes a CreateOperatorRequest object
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 CreatedCredential ¶
type CreatedCredential struct {
CredentialID string `json:"credentialsId"`
Type string `json:"type"`
Description string `json:"description"`
Credentials Credentials `json:"credentials"`
CreateDateTime *TimestampMilli `json:"createDateTime"`
UpdateDateTime *TimestampMilli `json:"updateDateTime"`
LastUsedDateTime *TimestampMilli `json:"lastUsedDateTime"`
}
func (*CreatedCredential) String ¶
func (cc *CreatedCredential) String() 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 CredentialOptions ¶
type CredentialOptions struct {
Type string `json:"type"`
Description string `json:"description"`
Credentials Credentials `json:"credentials"`
}
func (*CredentialOptions) JSON ¶
func (o *CredentialOptions) JSON() string
JSON converts CredentialOptions into a JSON string
type Credentials ¶
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 = "MonthlyTrafficRule" // EventHandlerRuleTypeCumulativeTraffic is a rule type to invoke actions when cumulative data traffic for a subscriber exceeds the specified limit EventHandlerRuleTypeCumulativeTraffic EventHandlerRuleType = "CumulativeTrafficRule" // EventHandlerRuleTypeDailyTotalTraffic is a rule type to invoke actions when total data traffic for a day for all subscribers exceeds the specified limit EventHandlerRuleTypeDailyTotalTraffic EventHandlerRuleType = "DailyTotalTrafficRule" // EventHandlerRuleTypeMonthlyTotalTraffic is a rule type to invoke actions when total data traffic for a month for all subscribers exceeds the specified limit EventHandlerRuleTypeMonthlyTotalTraffic EventHandlerRuleType = "MonthlyTotalTrafficRule" // EventHandlerRuleTypeSubscriberStatusAttribute is a rule type to invoke actions when status of a subscriber has been changed EventHandlerRuleTypeSubscriberStatusAttribute EventHandlerRuleType = "SubscriberStatusAttributeRule" // EventHandlerRuleTypeSubscriberSpeedClassAttribute is a rule type to invoke actions when speed class of a subscriber has been changed EventHandlerRuleTypeSubscriberSpeedClassAttribute EventHandlerRuleType = "SubscriberSpeedClassAttributeRule" // EventHandlerRuleTypeSubscriberExpired is a rule type to invoke actions when a subscriber has been expired EventHandlerRuleTypeSubscriberExpired EventHandlerRuleType = "SubscriberExpiredRule" )
type FunnelDestinationConfig ¶
type FunnelDestinationConfig struct {
Provider string `json:"provider"`
Service string `json:"service"`
ResourceUrl string `json:"resourceUrl"`
}
FunnelDestinationConfig holds SORACOM Funnel Destination configurations
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 ListSessionEventsOptions ¶
type ListSessionEventsOptions struct {
From time.Time
To time.Time
Limit int
LastEvaluatedKey string
}
ListSessionEventsOptions holds options for APIClient.ListSessionEvents()
func (*ListSessionEventsOptions) String ¶
func (lse *ListSessionEventsOptions) 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) SetExpiredAt ¶
func (mc *MetadataClient) SetExpiredAt(expiryTime time.Time) (*Subscriber, error)
SetExpiredAt 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) SetVerbose ¶
func (mc *MetadataClient) SetVerbose(verbose bool)
SetVerbose sets if verbose output is enabled or not
func (*MetadataClient) UnsetExpiredAt ¶
func (mc *MetadataClient) UnsetExpiredAt() (*Subscriber, error)
UnsetExpiredAt 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 PaymentMethodInfoPayJP ¶
type PaymentMethodInfoPayJP struct {
PayJPToken string `json:"payJPToken"`
StripeToken string `json:"stripeToken"`
}
PaymentMethodInfoPayJP holds payment method tokens
func (*PaymentMethodInfoPayJP) JSON ¶
func (o *PaymentMethodInfoPayJP) JSON() string
JSON converts PaymentMethodInfoPayJP into a JSON string
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 SessionEvent ¶
type SessionEvent struct {
APN string `json:"apn"`
DNS0 string `json:"dns0"`
DNS1 string `json:"dns1"`
Event string `json:"event"`
GatewayPrivateIPAddress string `json:"gatewayPrivateIpAddress"`
GatewayPublicIPAddress string `json:"gatewayPublicIpAddress"`
IMEI string `json:"imei"`
IMSI string `json:"imsi"`
OperatorID string `json:"operatorId"`
Time int64 `json:"time"`
UEIPAddress string `json:"ueIpAddress"`
VPGID string `json:"vpgId"`
}
SessionEvent contains a session connect/disconnect event
type SessionStatus ¶
type SessionStatus struct {
DNSServers []string `json:"dnsServers"`
IMEI string `json:"imei"`
LastUpdatedAt *TimestampMilli `json:"lastUpdatedAt"`
Location *string `json:"location"`
Cell *Cell `json:"cell"`
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"`
CreatedAt *TimestampMilli `json:"createdAt"`
ExpiredAt *TimestampMilli `json:"expiredAt"`
ExpiryAction *string `json:"expiryAction,omitempty"`
GroupID *string `json:"groupId,omitempty"`
ICCID string `json:"iccid,omitempty"`
IMEILock *IMEILock `json:"imeiLock,omitempty"`
IMSI string `json:"imsi"`
IPAddress *string `json:"ipAddress,omitempty"`
LastModifiedAt *TimestampMilli `json:"lastModifiedAt"`
ModuleType string `json:"ModuleType"`
MSISDN string `json:"msisdn"`
OperatorID string `json:"operatorId"`
Plan int `json:"plan"`
SerialNumber string `json:"serialNumber"`
SessionStatus *SessionStatus `json:"sessionStatus"`
SpeedClass string `json:"speedClass"`
Status string `json:"status"`
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 ...