smsapi

package
v0.0.0-...-ef8e1bd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExpireTimeSeconds = ExpireTimeUnit("seconds")
	ExpireTimeMinutes = ExpireTimeUnit("minutes")
	ExpireTimeHours   = ExpireTimeUnit("hours")
	ExpireTimeDays    = ExpireTimeUnit("days")
)
View Source
const (
	Version        = "1.2.2"
	Name           = "smsapi-go"
	BaseUrlPl      = "https://api.smsapi.pl/"
	BaseUrlCom     = "https://api.smsapi.com/"
	DefaultTimeout = 30 * time.Second
)
View Source
const (
	ContentTypeJson            = ContentType("application/json")
	ContentTypeXFormUrlencoded = ContentType("application/x-www-form-urlencoded")
)
View Source
const (
	DateLayout = "2006-01-02"
)
View Source
const DefaultPageSize = 100
View Source
const SMILTemplate = `` /* 337-byte string literal not displayed */

Variables

View Source
var NoMoreResults = errors.New("no more results")

Functions

This section is empty.

Types

type BearerAuth

type BearerAuth struct {
	AccessToken string
}

func (*BearerAuth) String

func (a *BearerAuth) String() string

type BlackListPhoneNumber

type BlackListPhoneNumber struct {
	Id          string     `json:"id,omitempty"`
	PhoneNumber string     `json:"phone_number,omitempty"`
	ExpireAt    *Date      `json:"expire_at,omitempty"`
	CreatedAt   *Timestamp `json:"created_at,omitempty"`
}

type BlacklistApi

type BlacklistApi struct {
	// contains filtered or unexported fields
}

func (*BlacklistApi) AddPhoneNumber

func (blacklistApi *BlacklistApi) AddPhoneNumber(ctx context.Context, phoneNumber string, expireAt *Date) (*BlackListPhoneNumber, error)

func (*BlacklistApi) DeleteAllPhoneNumbers

func (blacklistApi *BlacklistApi) DeleteAllPhoneNumbers(ctx context.Context) error

func (*BlacklistApi) DeletePhoneNumber

func (blacklistApi *BlacklistApi) DeletePhoneNumber(ctx context.Context, id string) error

func (*BlacklistApi) GetPageIterator

func (*BlacklistApi) GetPhoneNumbers

type BlacklistPhoneNumberCollection

type BlacklistPhoneNumberCollection struct {
	CollectionMeta
	Collection []*BlackListPhoneNumber `json:"collection"`
}

type BlacklistPhoneNumbersCollectionFilters

type BlacklistPhoneNumbersCollectionFilters struct {
	PaginationFilters
	Query string `url:"q,omitempty"`
}

type BlacklistPhoneNumbersCollectionIterator

type BlacklistPhoneNumbersCollectionIterator struct {
	// contains filtered or unexported fields
}

func (*BlacklistPhoneNumbersCollectionIterator) Next

type ClickResponse

type ClickResponse struct {
	Name        string `json:"name"`
	ShortUrl    string `json:"short_url"`
	PhoneNumber string `json:"phone_number"`
	Suffix      string `json:"suffix"`
	DateHit     string `json:"date_hit"`
	Os          string `json:"os"`
	Browser     string `json:"browser"`
	Device      string `json:"device"`
}

type ClicksCollectionFilters

type ClicksCollectionFilters struct {
	DateFrom string   `url:"date_from,omitempty"`
	DateTo   string   `url:"date_to,omitempty"`
	LinkIds  []string `url:"links,omitempty"`
}

type ClicksCollectionResponse

type ClicksCollectionResponse struct {
	Size       int              `json:"size"`
	Collection []*ClickResponse `json:"collection"`
}

type ClicksReportResponse

type ClicksReportResponse struct {
	ReportUrl string `json:"link"`
}

type Client

type Client struct {
	BaseUrl *url.URL
	Auth    *BearerAuth

	Sms       *SmsApi
	Profile   *ProfileApi
	Subusers  *SubusersApi
	Contacts  *ContactsApi
	ShortUrl  *ShortUrlApi
	Hlr       *HlrApi
	Sender    *SenderApi
	Blacklist *BlacklistApi

	Mms *MmsApi
	Vms *VmsApi
	// contains filtered or unexported fields
}

func NewClient

func NewClient(apiUrl string, accessToken string, httpClient *http.Client) *Client

func NewInternationalClient

func NewInternationalClient(accessToken string, httpClient *http.Client) *Client

func NewPlClient

func NewPlClient(accessToken string, httpClient *http.Client) *Client

func (*Client) CheckError

func (client *Client) CheckError(r *http.Response) ([]byte, error)

func (*Client) Delete

func (client *Client) Delete(ctx context.Context, path string) error

func (*Client) Get

func (client *Client) Get(ctx context.Context, path string, result interface{}) error

func (*Client) LegacyGet

func (client *Client) LegacyGet(ctx context.Context, path string, result interface{}) error

func (*Client) LegacyPost

func (client *Client) LegacyPost(ctx context.Context, path string, result interface{}, data interface{}) error

func (*Client) NewJsonRequest

func (client *Client) NewJsonRequest(method, path string, body interface{}) (*http.Request, error)

func (*Client) NewRequest

func (client *Client) NewRequest(method, path string, buf io.Reader, contentType ContentType) (*http.Request, error)

func (*Client) NewUrlencodedRequest

func (client *Client) NewUrlencodedRequest(method, path string, body interface{}) (*http.Request, error)

func (*Client) Post

func (client *Client) Post(ctx context.Context, path string, result interface{}, data interface{}) error

func (*Client) Put

func (client *Client) Put(ctx context.Context, path string, result interface{}, data interface{}) error

func (*Client) Urlencoded

func (client *Client) Urlencoded(ctx context.Context, method, path string, result interface{}, data interface{}) error

type Collection

type Collection interface {
	GetSize() uint
}

type CollectionMeta

type CollectionMeta struct {
	Size uint `json:"Size"`
}

func (*CollectionMeta) GetSize

func (c *CollectionMeta) GetSize() uint

type Contact

type Contact struct {
	Id           string `json:"id,omitempty" url:"id,omitempty"`
	FirstName    string `json:"first_name,omitempty" url:"first_name,omitempty"`
	LastName     string `json:"last_name,omitempty" url:"last_name,omitempty"`
	PhoneNumber  string `json:"phone_number,omitempty" url:"phone_number,omitempty"`
	Email        string `json:"email,omitempty" url:"email,omitempty"`
	Gender       string `json:"gender,omitempty" url:"gender,omitempty"`
	BirthdayDate string `json:"birthday_date,omitempty" url:"birthday_date,omitempty"`
	Description  string `json:"description,omitempty" url:"description,omitempty"`
	City         string `json:"city,omitempty" url:"city,omitempty"`
	Source       string `json:"source,omitempty" url:"source,omitempty"`
	DateCreated  string `json:"date_created,omitempty" url:"date_created,omitempty"`
	DateUpdated  string `json:"date_updated,omitempty" url:"date_updated,omitempty"`
}

type ContactCollectionResponse

type ContactCollectionResponse struct {
	CollectionMeta
	Collection []*Contact `json:"collection"`
}

type ContactGroup

type ContactGroup struct {
	Id            string                     `json:"id,omitempty" url:"id,omitempty"`
	Name          string                     `json:"name,omitempty" url:"name,omitempty"`
	Description   string                     `json:"description,omitempty" url:"description,omitempty"`
	ContactsCount int                        `json:"contacts_count,omitempty" url:"contacts_count,omitempty"`
	DateCreated   string                     `json:"date_created,omitempty" url:"date_created,omitempty"`
	DateUpdated   string                     `json:"date_updated,omitempty" url:"date_updated,omitempty"`
	CreatedBy     string                     `json:"created_by,omitempty" url:"created_by,omitempty"`
	Idx           string                     `json:"idx,omitempty" url:"idx,omitempty"`
	Permissions   []*ContactGroupPermissions `json:"permissions,omitempty" url:"permissions,omitempty"`
}

type ContactGroupPermissions

type ContactGroupPermissions struct {
	GroupId  string `json:"group_id,omitempty"`
	Username string `json:"username,omitempty"`
	Write    bool   `json:"write,omitempty"`
	Read     bool   `json:"read,omitempty"`
	Send     bool   `json:"send,omitempty"`
}

type ContactGroupPermissionsCollectionResponse

type ContactGroupPermissionsCollectionResponse struct {
	Size       int                       `json:"size"`
	Collection []ContactGroupPermissions `json:"collection"`
}

type ContactGroupsCollectionResponse

type ContactGroupsCollectionResponse struct {
	Size       int             `json:"size"`
	Collection []*ContactGroup `json:"collection"`
}

type ContactListFilters

type ContactListFilters struct {
	PaginationFilters

	Query        string   `url:"q,omitempty"`
	OrderBy      string   `url:"order_by,omitempty"`
	PhoneNumber  []string `url:"phone_number,omitempty"`
	Email        []string `url:"email,omitempty"`
	FirstName    []string `url:"first_name,omitempty"`
	LastName     []string `url:"last_name,omitempty"`
	GroupId      []string `url:"group_id,omitempty"`
	Gender       string   `url:"gender,omitempty"`
	BirthdayDate []string `url:"birthday_date,omitempty"`
}

type ContactsApi

type ContactsApi struct {
	// contains filtered or unexported fields
}

func (*ContactsApi) AddContactToGroup

func (contactsApi *ContactsApi) AddContactToGroup(ctx context.Context, groupId, contactId string) (*Contact, error)

func (*ContactsApi) AddContactsToGroup

func (contactsApi *ContactsApi) AddContactsToGroup(ctx context.Context, groupId string, filters *ContactListFilters) error

func (*ContactsApi) AddGroupPermissions

func (contactsApi *ContactsApi) AddGroupPermissions(ctx context.Context, groupId string, permissions *ContactGroupPermissions) (*ContactGroupPermissions, error)

func (*ContactsApi) AddUserGroupPermissions

func (contactsApi *ContactsApi) AddUserGroupPermissions(ctx context.Context, groupId, username string, permissions *ContactGroupPermissions) (*ContactGroupPermissions, error)

func (*ContactsApi) BindContactToGroup

func (contactsApi *ContactsApi) BindContactToGroup(ctx context.Context, contactId string, groupId string) (*ContactGroupsCollectionResponse, error)

func (*ContactsApi) CreateContact

func (contactsApi *ContactsApi) CreateContact(ctx context.Context, contact *Contact) (*Contact, error)

func (*ContactsApi) CreateCustomField

func (contactsApi *ContactsApi) CreateCustomField(ctx context.Context, name, type_ string) (*CustomField, error)

func (*ContactsApi) CreateGroup

func (contactsApi *ContactsApi) CreateGroup(ctx context.Context, group *ContactGroup) (*ContactGroup, error)

func (*ContactsApi) DeleteAllContacts

func (contactsApi *ContactsApi) DeleteAllContacts(ctx context.Context) error

func (*ContactsApi) DeleteAllGroup

func (contactsApi *ContactsApi) DeleteAllGroup(ctx context.Context) error

func (*ContactsApi) DeleteContact

func (contactsApi *ContactsApi) DeleteContact(ctx context.Context, id string) error

func (*ContactsApi) DeleteCustomField

func (contactsApi *ContactsApi) DeleteCustomField(ctx context.Context, fieldId string) error

func (*ContactsApi) DeleteGroup

func (contactsApi *ContactsApi) DeleteGroup(ctx context.Context, groupId string) error

func (*ContactsApi) GetContact

func (contactsApi *ContactsApi) GetContact(ctx context.Context, id string) (*Contact, error)

func (*ContactsApi) GetContactFromGroup

func (contactsApi *ContactsApi) GetContactFromGroup(ctx context.Context, groupId, contactId string) (*Contact, error)

func (*ContactsApi) GetContactGroup

func (contactsApi *ContactsApi) GetContactGroup(ctx context.Context, contactId string, groupId string) (*ContactGroup, error)

func (*ContactsApi) GetContactGroups

func (contactsApi *ContactsApi) GetContactGroups(ctx context.Context, id string) (*ContactGroupsCollectionResponse, error)

func (*ContactsApi) GetContacts

func (contactsApi *ContactsApi) GetContacts(ctx context.Context, filters *ContactListFilters) (*ContactCollectionResponse, error)

func (*ContactsApi) GetContactsPageIterator

func (contactsApi *ContactsApi) GetContactsPageIterator(ctx context.Context, filters *ContactListFilters) *ContactsCollectionIterator

func (*ContactsApi) GetCustomFields

func (contactsApi *ContactsApi) GetCustomFields(ctx context.Context) (*CustomFieldsCollectionResponse, error)

func (*ContactsApi) GetGroup

func (contactsApi *ContactsApi) GetGroup(ctx context.Context, groupId string) (*ContactGroup, error)

func (*ContactsApi) GetGroupPermissions

func (contactsApi *ContactsApi) GetGroupPermissions(ctx context.Context, groupId string) (*ContactGroupPermissionsCollectionResponse, error)

func (*ContactsApi) GetGroups

func (contactsApi *ContactsApi) GetGroups(ctx context.Context) (*ContactGroupsCollectionResponse, error)

func (*ContactsApi) GetUserGroupPermissions

func (contactsApi *ContactsApi) GetUserGroupPermissions(ctx context.Context, groupId, username string) (*ContactGroupPermissions, error)

func (*ContactsApi) MoveContactsToGroup

func (contactsApi *ContactsApi) MoveContactsToGroup(ctx context.Context, groupId string, filters *ContactListFilters) error

func (*ContactsApi) RemoveContactFromGroup

func (contactsApi *ContactsApi) RemoveContactFromGroup(ctx context.Context, groupId, contactId string) error

func (*ContactsApi) RemoveContactsFromGroup

func (contactsApi *ContactsApi) RemoveContactsFromGroup(ctx context.Context, groupId string, filters *ContactListFilters) error

func (*ContactsApi) RemoveUserGroupPermissions

func (contactsApi *ContactsApi) RemoveUserGroupPermissions(ctx context.Context, groupId, username string) error

func (*ContactsApi) UnbindContactFromGroup

func (contactsApi *ContactsApi) UnbindContactFromGroup(ctx context.Context, contactId string, groupId string) error

func (*ContactsApi) UpdateContact

func (contactsApi *ContactsApi) UpdateContact(ctx context.Context, id string, contact *Contact) (*Contact, error)

func (*ContactsApi) UpdateCustomField

func (contactsApi *ContactsApi) UpdateCustomField(ctx context.Context, fieldId, name string) (*CustomField, error)

func (*ContactsApi) UpdateGroup

func (contactsApi *ContactsApi) UpdateGroup(ctx context.Context, groupId string, group *ContactGroup) (*ContactGroup, error)

type ContactsCollectionIterator

type ContactsCollectionIterator struct {
	// contains filtered or unexported fields
}

func (*ContactsCollectionIterator) Next

type ContentType

type ContentType string

type CustomField

type CustomField struct {
	Id   string `json:"id,omitempty" url:"id,omitempty"`
	Name string `json:"name,omitempty" url:"name,omitempty"`
	Type string `json:"type,omitempty" url:"type,omitempty"`
}

type CustomFieldsCollectionResponse

type CustomFieldsCollectionResponse struct {
	Size       int           `json:"size"`
	Collection []CustomField `json:"collection"`
}

type Date

type Date struct {
	Year  int
	Month time.Month
	Day   int
}

func NewDate

func NewDate(year, month, day int) *Date

func (Date) Equal

func (d Date) Equal(c Date) bool

func (Date) MarshalJSON

func (d Date) MarshalJSON() ([]byte, error)

func (*Date) String

func (d *Date) String() string

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(buf []byte) error

type ErrorResponse

type ErrorResponse struct {
	Status         int
	Code           int              `json:"error"`
	Message        string           `json:"message"`
	InvalidNumbers []*InvalidNumber `json:"invalid_numbers,omitempty"`
}

func (*ErrorResponse) Error

func (error *ErrorResponse) Error() string

type ExpireTimeUnit

type ExpireTimeUnit string

type Hlr

type Hlr struct {
	PhoneNumber string `json:"number"`
}

type HlrApi

type HlrApi struct {
	// contains filtered or unexported fields
}

func (*HlrApi) CheckNumber

func (hlrApi *HlrApi) CheckNumber(ctx context.Context, phonenumber string) (*HlrResponse, error)

type HlrResponse

type HlrResponse struct {
	Status string  `json:"status,omitempty"`
	Number string  `json:"number,omitempty"`
	Id     string  `json:"id,omitempty"`
	Price  float32 `json:"price,omitempty"`
}

type InvalidNumber

type InvalidNumber struct {
	Number          string `json:"number,omitempty"`
	SubmittedNumber string `json:"submitted_number,omitempty"`
	Message         string `json:"message,omitempty"`
}
type Link struct {
	Url         string         `json:"url" url:"url,omitempty"`
	Name        string         `json:"name" url:"name,omitempty"`
	ExpireTime  int            `json:"expire_time,omitempty" url:"expire_time,omitempty"`
	ExpireUnit  ExpireTimeUnit `json:"expire_unit,omitempty" url:"expire_unit,omitempty"`
	Description string         `json:"description" url:"description,omitempty"`
	Type        LinkType       `json:"type" url:"type,omitempty"`
}

type LinkResponse

type LinkResponse struct {
	Id          string     `json:"id"`
	Name        string     `json:"name"`
	Url         string     `json:"url"`
	ShortUrl    string     `json:"short_url"`
	Filename    string     `json:"filename"`
	Type        string     `json:"type"`
	Expire      *Timestamp `json:"expire"`
	Hits        int        `json:"hits"`
	HitsUnique  int        `json:"hits_unique"`
	Description string     `json:"description"`
}

type LinkType

type LinkType string

type LinksCollectionResponse

type LinksCollectionResponse struct {
	Size       int             `json:"size"`
	Collection []*LinkResponse `json:"collection"`
}

type MediaObject

type MediaObject struct {
	Source string
	Type   MediaObjectType
}

func NewImgMediaObject

func NewImgMediaObject(source string) *MediaObject

func NewTextMediaObject

func NewTextMediaObject(source string) *MediaObject

func NewVideoMediaObject

func NewVideoMediaObject(source string) *MediaObject

type MediaObjectType

type MediaObjectType string

type Mms

type Mms struct {
	To           string     `json:"to,omitempty"`
	Group        string     `json:"group,omitempty"`
	Subject      string     `json:"subject,omitempty"`
	Message      *SMIL      `json:"smil,omitempty"`
	Date         *Timestamp `json:"date,omitempty"`
	DateValidate string     `json:"date_validate,omitempty"`
	Idx          string     `json:"idx,omitempty"`
	CheckIdx     bool       `json:"check_idx,omitempty"`
	NotifyUrl    string     `json:"notify_url,omitempty"`
	Test         bool       `json:"test,omitempty"`
}

type MmsApi

type MmsApi struct {
	// contains filtered or unexported fields
}

func (*MmsApi) Get

func (mmsApi *MmsApi) Get(ctx context.Context, id string) (*MmsCollectionResponse, error)

func (*MmsApi) RemoveScheduled

func (mmsApi *MmsApi) RemoveScheduled(ctx context.Context, id string) (*MmsRemoveResponse, error)

func (*MmsApi) Schedule

func (mmsApi *MmsApi) Schedule(ctx context.Context, to, subject, image string, sendAt *Timestamp) (*MmsCollectionResponse, error)

func (*MmsApi) Send

func (mmsApi *MmsApi) Send(ctx context.Context, to, subject, image string) (*MmsCollectionResponse, error)

func (*MmsApi) SendRaw

func (mmsApi *MmsApi) SendRaw(ctx context.Context, mms *Mms) (*MmsCollectionResponse, error)

func (*MmsApi) SendToGroup

func (mmsApi *MmsApi) SendToGroup(ctx context.Context, group, subject, image string) (*MmsCollectionResponse, error)

type MmsCollectionResponse

type MmsCollectionResponse struct {
	Count int `json:"count"`

	Collection []*MmsResponse `json:"list"`
}

type MmsRemoveResponse

type MmsRemoveResponse struct {
	Count int `json:"count"`

	Collection []*struct {
		Id string `json:"id,omitempty"`
	} `json:"list"`
}

type MmsResponse

type MmsResponse struct {
	Id              string     `json:"id,omitempty"`
	Points          float32    `json:"points,omitempty"`
	Number          string     `json:"number,omitempty"`
	DateSent        *Timestamp `json:"date_sent,omitempty"`
	SubmittedNumber string     `json:"submitted_number,omitempty"`
	Status          string     `json:"status,omitempty"`
	Idx             string     `json:"idx,omitempty"`
	Error           string     `json:"error,omitempty"`
}

type PageIterator

type PageIterator struct {
	Client  *Client
	Context context.Context
	Filters url.Values
	Uri     string
	Size    uint
	Limit   uint
	Offset  uint
}

func NewPageIterator

func NewPageIterator(c *Client, ctx context.Context, uri string, v interface{}) *PageIterator

func (*PageIterator) Next

func (i *PageIterator) Next(result Collection) error

type PaginationFilters

type PaginationFilters struct {
	Offset uint `url:"offset,omitempty"`
	Limit  uint `url:"limit,omitempty"`
}

type ProfileApi

type ProfileApi struct {
	// contains filtered or unexported fields
}

func (*ProfileApi) Details

func (accountApi *ProfileApi) Details(ctx context.Context) (*ProfileDetailsResponse, error)

type ProfileDetailsResponse

type ProfileDetailsResponse struct {
	Name        string  `json:"name,omitempty"`
	Email       string  `json:"email,omitempty"`
	Username    string  `json:"username,omitempty"`
	PhoneNumber string  `json:"phone_number,omitempty"`
	PaymentType string  `json:"payment_type,omitempty"`
	UserType    string  `json:"user_type,omitempty"`
	Points      float32 `json:"points,omitempty"`
}

type SMIL

type SMIL struct {
	Items []*MediaObject
	// contains filtered or unexported fields
}

func NewSMIL

func NewSMIL() *SMIL

func (*SMIL) AddImage

func (s *SMIL) AddImage(image string)

func (*SMIL) AddText

func (s *SMIL) AddText(text string)

func (*SMIL) AddVideo

func (s *SMIL) AddVideo(video string)

func (*SMIL) GetMinifiedTplResult

func (s *SMIL) GetMinifiedTplResult() string

func (*SMIL) GetTplResult

func (s *SMIL) GetTplResult() string

func (SMIL) MarshalJSON

func (s SMIL) MarshalJSON() ([]byte, error)

func (*SMIL) String

func (s *SMIL) String() string

type Sender

type Sender struct {
	Name string `json:"sender"`
}

type SenderApi

type SenderApi struct {
	// contains filtered or unexported fields
}

func (*SenderApi) Activate

func (senderApi *SenderApi) Activate(ctx context.Context, name, code string) error

func (*SenderApi) Create

func (senderApi *SenderApi) Create(ctx context.Context, name string) (*SenderResponse, error)

func (*SenderApi) Delete

func (senderApi *SenderApi) Delete(ctx context.Context, name string) error

func (*SenderApi) Get

func (senderApi *SenderApi) Get(ctx context.Context, name string) (*SenderResponse, error)

func (*SenderApi) GetAll

func (senderApi *SenderApi) GetAll(ctx context.Context) (*SenderCollectionResponse, error)

func (*SenderApi) MakeDefault

func (senderApi *SenderApi) MakeDefault(ctx context.Context, name string) error

type SenderCollectionResponse

type SenderCollectionResponse struct {
	Size       int               `json:"size"`
	Collection []*SenderResponse `json:"collection"`
}

type SenderResponse

type SenderResponse struct {
	IsDefault bool   `json:"is_default"`
	Name      string `json:"sender"`
	Status    string `json:"status"`
	CreatedAt string `json:"created_at"`
}

type ShortUrlApi

type ShortUrlApi struct {
	// contains filtered or unexported fields
}
func (shortUrlApi *ShortUrlApi) CreateLink(ctx context.Context, targetUrl, name, description string) (*LinkResponse, error)

func (*ShortUrlApi) CreateLinkRaw

func (shortUrlApi *ShortUrlApi) CreateLinkRaw(ctx context.Context, link *Link) (*LinkResponse, error)

func (*ShortUrlApi) CreateReport

func (shortUrlApi *ShortUrlApi) CreateReport(ctx context.Context, filters *ClicksCollectionFilters) (*ClicksReportResponse, error)
func (shortUrlApi *ShortUrlApi) DeleteLink(ctx context.Context, id string) error

func (*ShortUrlApi) GetClicks

func (shortUrlApi *ShortUrlApi) GetClicks(ctx context.Context, filters *ClicksCollectionFilters) (*ClicksCollectionResponse, error)
func (shortUrlApi *ShortUrlApi) GetLink(ctx context.Context, id string) (*LinkResponse, error)
func (shortUrlApi *ShortUrlApi) GetLinks(ctx context.Context) (*LinksCollectionResponse, error)
func (shortUrlApi *ShortUrlApi) UpdateLink(ctx context.Context, id, targetUrl, name, description string) (*LinkResponse, error)

func (*ShortUrlApi) UpdateLinkRaw

func (shortUrlApi *ShortUrlApi) UpdateLinkRaw(ctx context.Context, id string, link *Link) (*LinkResponse, error)

type Sms

type Sms struct {
	To      string `json:"to,omitempty"`
	Message string `json:"message,omitempty"`
	From    string `json:"from,omitempty"`

	Group           string     `json:"group,omitempty"`
	Flash           bool       `json:"flash,omitempty"`
	Fast            bool       `json:"fast,omitempty"`
	Test            bool       `json:"test,omitempty"`
	Encoding        string     `json:"encoding,omitempty"`
	Details         bool       `json:"details,omitempty"`
	Date            *Timestamp `json:"date,omitempty"`
	Datacoding      string     `json:"datacoding,omitempty"`
	Udh             string     `json:"udh,omitempty"`
	SkipForeign     bool       `json:"skip_foreign,omitempty"`
	AllowDuplicates bool       `json:"allow_duplicates,omitempty"`
	Idx             int        `json:"idx,omitempty"`
	CheckIdx        bool       `json:"check_idx,omitempty"`
	Nounicode       bool       `json:"nounicode,omitempty"`
	Normalize       bool       `json:"normalize,omitempty"`
	PartnerId       bool       `json:"partner_id,omitempty"`
	MaxParts        int        `json:"max_parts,omitempty"`
	ExpirationDate  int        `json:"expiration_date,omitempty"`
	DiscountGroup   string     `json:"discount_group,omitempty"`
	NotifyUrl       string     `json:"notify_url,omitempty"`

	Template      string `json:"template,omitempty"`
	MessageParam1 string `json:"param1,omitempty"`
	MessageParam2 string `json:"param2,omitempty"`
	MessageParam3 string `json:"param3,omitempty"`
	MessageParam4 string `json:"param4,omitempty"`
}

type SmsApi

type SmsApi struct {
	// contains filtered or unexported fields
}

func (*SmsApi) Get

func (smsApi *SmsApi) Get(ctx context.Context, id string) (*SmsResultCollection, error)

func (*SmsApi) RemoveScheduled

func (smsApi *SmsApi) RemoveScheduled(ctx context.Context, id string) (*SmsRemoveResult, error)

func (*SmsApi) Schedule

func (smsApi *SmsApi) Schedule(ctx context.Context, to, message string, from string, sendAt *Timestamp) (*SmsResultCollection, error)

func (*SmsApi) Send

func (smsApi *SmsApi) Send(ctx context.Context, to, message string, from string) (*SmsResultCollection, error)

func (*SmsApi) SendFlash

func (smsApi *SmsApi) SendFlash(ctx context.Context, to, message string, from string) (*SmsResultCollection, error)

func (*SmsApi) SendRaw

func (smsApi *SmsApi) SendRaw(ctx context.Context, sms *Sms) (*SmsResultCollection, error)

func (*SmsApi) SendToGroup

func (smsApi *SmsApi) SendToGroup(ctx context.Context, group, message string, from string) (*SmsResultCollection, error)

type SmsRemoveResult

type SmsRemoveResult struct {
	Count int `json:"count"`

	Collection []*struct {
		Id string `json:"id,omitempty"`
	} `json:"list"`
}

type SmsResponse

type SmsResponse struct {
	Id              string     `json:"id,omitempty"`
	Points          float32    `json:"points,omitempty"`
	Number          string     `json:"number,omitempty"`
	DateSent        *Timestamp `json:"date_sent,omitempty"`
	SubmittedNumber string     `json:"submitted_number,omitempty"`
	Status          string     `json:"status,omitempty"`
	Idx             string     `json:"idx,omitempty"`
	Error           string     `json:"error,omitempty"`
	Message         string     `json:"message,omitempty"`
	Length          int        `json:"length,omitempty"`
	Parts           int        `json:"parts,omitempty"`
}

type SmsResultCollection

type SmsResultCollection struct {
	Count int `json:"count"`

	Collection []*SmsResponse `json:"list"`
}

type SubusersApi

type SubusersApi struct {
	// contains filtered or unexported fields
}

func (*SubusersApi) CreateUser

func (accountApi *SubusersApi) CreateUser(ctx context.Context, user *User) (*UserResponse, error)

func (*SubusersApi) DeleteUser

func (accountApi *SubusersApi) DeleteUser(ctx context.Context, id string) error

func (*SubusersApi) GetUser

func (accountApi *SubusersApi) GetUser(ctx context.Context, id string) (*UserResponse, error)

func (*SubusersApi) ListUsers

func (accountApi *SubusersApi) ListUsers(ctx context.Context) (*UserCollectionResponse, error)

func (*SubusersApi) UpdateUser

func (accountApi *SubusersApi) UpdateUser(ctx context.Context, id string, user *User) (*UserResponse, error)

type Timestamp

type Timestamp struct {
	time.Time
}

func (Timestamp) Equal

func (t Timestamp) Equal(c Timestamp) bool

func (Timestamp) MarshalJSON

func (t Timestamp) MarshalJSON() ([]byte, error)

func (Timestamp) String

func (t Timestamp) String() string

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(buf []byte) error

type User

type User struct {
	Credentials *UserCredentials `json:"credentials"`
	Active      bool             `json:"active"`
	Description string           `json:"description"`
	Points      *UserPoints      `json:"points"`
}

type UserCollectionResponse

type UserCollectionResponse struct {
	Size       int             `json:"size"`
	Collection []*UserResponse `json:"collection"`
}

type UserCredentials

type UserCredentials struct {
	Username    string `json:"username,omitempty"`
	Password    string `json:"password,omitempty"`
	ApiPassword string `json:"api_password,omitempty"`
}

type UserPoints

type UserPoints struct {
	FromAccount float32 `json:"from_account,omitempty"`
	PerMonth    float32 `json:"per_month,omitempty"`
}

type UserResponse

type UserResponse struct {
	Id          string      `json:"id"`
	Username    string      `json:"username"`
	Active      bool        `json:"active"`
	Description string      `json:"description"`
	Points      *UserPoints `json:"points"`
}

type Vms

type Vms struct {
	To           string     `json:"to,omitempty"`
	Group        string     `json:"group,omitempty"`
	From         string     `json:"from,omitempty"`
	Tts          string     `json:"tts,omitempty"`
	File         string     `json:"file,omitempty"`
	TtsLector    string     `json:"tts_lector,omitempty"`
	Date         *Timestamp `json:"date,omitempty"`
	DateValidate string     `json:"date_validate,omitempty"`
	Try          string     `json:"try,omitempty"`
	Interval     string     `json:"interval,omitempty"`
	SkipGms      string     `json:"skip_gsm,omitempty"`
	Idx          string     `json:"idx,omitempty"`
	CheckIdx     string     `json:"check_idx,omitempty"`
	NotifyUrl    string     `json:"notify_url,omitempty"`
	Test         string     `json:"test,omitempty"`
}

type VmsApi

type VmsApi struct {
	// contains filtered or unexported fields
}

func (*VmsApi) Get

func (vmsApi *VmsApi) Get(ctx context.Context, id string) (*VmsCollectionResponse, error)

func (*VmsApi) RemoveScheduled

func (vmsApi *VmsApi) RemoveScheduled(ctx context.Context, id string) (*VmsRemoveResponse, error)

func (*VmsApi) Schedule

func (vmsApi *VmsApi) Schedule(ctx context.Context, to, message, from string, sendAt *Timestamp) (*VmsCollectionResponse, error)

func (*VmsApi) Send

func (vmsApi *VmsApi) Send(ctx context.Context, to, message, from string) (*VmsCollectionResponse, error)

func (*VmsApi) SendRaw

func (vmsApi *VmsApi) SendRaw(ctx context.Context, vms *Vms) (*VmsCollectionResponse, error)

func (*VmsApi) SendToGroup

func (vmsApi *VmsApi) SendToGroup(ctx context.Context, group, message, from string) (*VmsCollectionResponse, error)

type VmsCollectionResponse

type VmsCollectionResponse struct {
	Count int `json:"count"`

	Collection []*VmsResponse `json:"list"`
}

type VmsRemoveResponse

type VmsRemoveResponse struct {
	Count int `json:"count"`

	Collection []*struct {
		Id string `json:"id,omitempty"`
	} `json:"list"`
}

type VmsResponse

type VmsResponse struct {
	Id              string     `json:"id,omitempty"`
	Points          float32    `json:"points,omitempty"`
	Number          string     `json:"number,omitempty"`
	DateSent        *Timestamp `json:"date_sent,omitempty"`
	SubmittedNumber string     `json:"submitted_number,omitempty"`
	Status          string     `json:"status,omitempty"`
	Idx             string     `json:"idx,omitempty"`
	Error           string     `json:"error,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL