Documentation ¶
Index ¶
- func Bool(v bool) *bool
- func CheckResponse(r *http.Response) error
- func Int(v int) *int
- func StreamToString(stream io.Reader) string
- func String(v string) *string
- func Stringify(message interface{}) string
- type Client
- type ClientOpt
- type ErrorResponse
- type GetLicensesQueryParams
- type GetOrganizationsQueryParams
- type GetPeopleQueryParams
- type GetRolesQueryParams
- type License
- type LicensesRoot
- type LicensesService
- type ListOptions
- type Membership
- type MembershipQueryParams
- type MembershipRequest
- type MembershipsService
- func (s *MembershipsService) DeleteMembership(membershipID string) (*Response, error)
- func (s *MembershipsService) Get(queryParams *MembershipQueryParams) ([]*Membership, *Response, error)
- func (s *MembershipsService) GetMembership(membershipID string) (*Membership, *Response, error)
- func (s *MembershipsService) Post(membershipRequest *MembershipRequest) (*Membership, *Response, error)
- func (s *MembershipsService) UpdateMembership(membershipID string, updateMembershipRequest *UpdateMembershipRequest) (*Membership, *Response, error)
- type Message
- type MessageQueryParams
- type MessageRequest
- type MessagesService
- func (s *MessagesService) DeleteMessage(messageID string) (*Response, error)
- func (s *MessagesService) Get(queryParams *MessageQueryParams) ([]*Message, *Response, error)
- func (s *MessagesService) GetMessage(messageID string) (*Message, *Response, error)
- func (s *MessagesService) Post(messageRequest *MessageRequest) (*Message, *Response, error)
- type Organization
- type OrganizationsService
- type PeopleService
- type Person
- type RequestCompletionCallback
- type Response
- type Role
- type RolesService
- type Room
- type RoomQueryParams
- type RoomRequest
- type RoomsService
- func (s *RoomsService) DeleteRoom(roomID string) (*Response, error)
- func (s *RoomsService) Get(queryParams *RoomQueryParams) ([]*Room, *Response, error)
- func (s *RoomsService) GetRoom(roomID string) (*Room, *Response, error)
- func (s *RoomsService) Post(roomRequest *RoomRequest) (*Room, *Response, error)
- func (s *RoomsService) UpdateRoom(roomID string, updateRoomRequest *UpdateRoomRequest) (*Room, *Response, error)
- type Team
- type TeamMembership
- type TeamMembershipQueryParams
- type TeamMembershipRequest
- type TeamMembershipsService
- func (s *TeamMembershipsService) DeleteTeamMembership(teamID string) (*Response, error)
- func (s *TeamMembershipsService) Get(queryParams *TeamMembershipQueryParams) ([]*TeamMembership, *Response, error)
- func (s *TeamMembershipsService) GetTeamMembership(teamID string) (*TeamMembership, *Response, error)
- func (s *TeamMembershipsService) Post(teamRequest *TeamMembershipRequest) (*TeamMembership, *Response, error)
- func (s *TeamMembershipsService) UpdateTeamMembership(teamID string, updateTeamMembershipRequest *UpdateTeamMembershipRequest) (*TeamMembership, *Response, error)
- type TeamQueryParams
- type TeamRequest
- type TeamsService
- func (s *TeamsService) DeleteTeam(teamID string) (*Response, error)
- func (s *TeamsService) Get(queryParams *TeamQueryParams) ([]*Team, *Response, error)
- func (s *TeamsService) GetTeam(teamID string) (*Team, *Response, error)
- func (s *TeamsService) Post(teamRequest *TeamRequest) (*Team, *Response, error)
- func (s *TeamsService) UpdateTeam(teamID string, updateTeamRequest *UpdateTeamRequest) (*Team, *Response, error)
- type Timestamp
- type UpdateMembershipRequest
- type UpdateRoomRequest
- type UpdateTeamMembershipRequest
- type UpdateTeamRequest
- type UpdateWebhookRequest
- type Webhook
- type WebhookQueryParams
- type WebhookRequest
- type WebhooksService
- func (s *WebhooksService) DeleteWebhook(webhookID string) (*Response, error)
- func (s *WebhooksService) Get(queryParams *WebhookQueryParams) ([]*Webhook, *Response, error)
- func (s *WebhooksService) GetWebhook(webhookID string) (*Webhook, *Response, error)
- func (s *WebhooksService) Post(webhookRequest *WebhookRequest) (*Webhook, *Response, error)
- func (s *WebhooksService) UpdateWebhook(webhookID string, updateWebhookRequest *UpdateWebhookRequest) (*Webhook, *Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func CheckResponse ¶
CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. API error responses are expected to have either no response body, or a JSON response body that maps to ErrorResponse. Any other response body will be silently ignored.
func Int ¶
Int is a helper routine that allocates a new int32 value to store v and returns a pointer to it, but unlike Int32 its argument value is an int.
func StreamToString ¶
StreamToString converts a reader to a string
Types ¶
type Client ¶
type Client struct { // Base URL for API requests. BaseURL *url.URL // User agent for client UserAgent string // Authorization is the authentication token Authorization string // Services used for communicating with the APIC-EM API Memberships *MembershipsService Messages *MessagesService People *PeopleService Rooms *RoomsService TeamMemberships *TeamMembershipsService Teams *TeamsService Webhooks *WebhooksService Organizations *OrganizationsService Licenses *LicensesService Roles *RolesService // contains filtered or unexported fields }
Client manages communication with Cisco Spark V1 API.
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response will be written to v, without attempting to decode it.
func (*Client) NewRequest ¶
NewRequest creates an API request. A relative URL can be provided in urlStr, which will be resolved to the BaseURL of the Client. Relative URLS should always be specified without a preceding slash. If specified, the value pointed to by body is JSON encoded and included in as the request body.
func (*Client) OnRequestCompleted ¶
func (c *Client) OnRequestCompleted(rc RequestCompletionCallback)
OnRequestCompleted sets the Cisco Spark API request completion callback
type ClientOpt ¶
ClientOpt are options for New.
func SetBaseURL ¶
SetBaseURL is a client option for setting the base URL.
func SetUserAgent ¶
SetUserAgent is a client option for setting the user agent.
type ErrorResponse ¶
type ErrorResponse struct { // HTTP response that caused this error HTTPResponse *http.Response Message string Errors []struct { Description string } TrackingID string }
An ErrorResponse reports the error caused by an API request
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type GetLicensesQueryParams ¶
type GetLicensesQueryParams struct { Max int `url:"max,omitempty"` OrgID string `url:"orgId,omitempty"` }
GetLicensesQueryParams ...
type GetOrganizationsQueryParams ¶
type GetOrganizationsQueryParams struct {
Max int `url:"max,omitempty"`
}
GetOrganizationsQueryParams ...
type GetPeopleQueryParams ¶
type GetPeopleQueryParams struct { Email string `url:"email,omitempty"` DisplayName string `url:"displayName,omitempty"` Max int `url:"max,omitempty"` }
GetPeopleQueryParams ...
type GetRolesQueryParams ¶
type GetRolesQueryParams struct {
Max int `url:"max,omitempty"`
}
GetRolesQueryParams ...
type License ¶
type License struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` TotalUnits int `json:"totalUnits,omitempty"` ConsumedUnits int `json:"consumedUnits,omitempty"` }
License represents the Spark Licenses
type LicensesRoot ¶
type LicensesRoot struct {
Licenses []*License `json:"items"`
}
type LicensesService ¶
type LicensesService service
LicensesService is an interface for interfacing with the Licenses endpoints of the Cisco Spark API
func (*LicensesService) Get ¶
func (s *LicensesService) Get(queryParams *GetLicensesQueryParams) ([]*License, *Response, error)
Get ....
func (*LicensesService) GetLicense ¶
func (s *LicensesService) GetLicense(LicenseID string) (*License, *Response, error)
GetLicense ....
type ListOptions ¶
type ListOptions struct { // For paginated result sets, page of results to retrieve. Page int `url:"page,omitempty"` // For paginated result sets, the number of results to include per page. PerPage int `url:"per_page,omitempty"` }
ListOptions specifies the optional parameters to various List methods that support pagination.
type Membership ¶
type Membership struct { ID string `json:"id,omitempty"` RoomID string `json:"roomId,omitempty"` PersonID string `json:"personId,omitempty"` PersonEmail string `json:"personEmail,omitempty"` Created string `json:"created,omitempty"` IsModerator bool `json:"isModerator,omitempty"` IsMonitor bool `json:"isMonitor,omitempty"` }
Membership ...
func (Membership) String ¶
func (r Membership) String() string
type MembershipQueryParams ¶
type MembershipQueryParams struct { RoomID string `url:"roomId,omitempty"` PersonID string `url:"personId,omitempty"` PersonEmail string `url:"personEmail,omitempty"` Max int `url:"max,omitempty"` }
MembershipQueryParams ...
type MembershipRequest ¶
type MembershipRequest struct { RoomID string `json:"roomId,omitempty"` PersonID string `json:"personId,omitempty"` PersonEmail string `json:"personEmail,omitempty"` IsModerator bool `json:"isModerator,omitempty"` }
MembershipRequest represents the Spark memberships
func (MembershipRequest) String ¶
func (r MembershipRequest) String() string
type MembershipsService ¶
type MembershipsService service
MembershipsService handles communication with the Memberships related methods of the Cisco Spark API.
func (*MembershipsService) DeleteMembership ¶
func (s *MembershipsService) DeleteMembership(membershipID string) (*Response, error)
DeleteMembership ....
func (*MembershipsService) Get ¶
func (s *MembershipsService) Get(queryParams *MembershipQueryParams) ([]*Membership, *Response, error)
Get ....
func (*MembershipsService) GetMembership ¶
func (s *MembershipsService) GetMembership(membershipID string) (*Membership, *Response, error)
GetMembership ....
func (*MembershipsService) Post ¶
func (s *MembershipsService) Post(membershipRequest *MembershipRequest) (*Membership, *Response, error)
Post ....
func (*MembershipsService) UpdateMembership ¶
func (s *MembershipsService) UpdateMembership(membershipID string, updateMembershipRequest *UpdateMembershipRequest) (*Membership, *Response, error)
UpdateMembership ....
type Message ¶
type Message struct { ID string `json:"id,omitempty"` RoomID string `json:"roomId,omitempty"` ToPersonEmail string `json:"toPersonEmail,omitempty"` ToPersonID string `json:"toPersonId,omitempty"` Text string `json:"text,omitempty"` PersonID string `json:"personId,omitempty"` PersonEmail string `json:"personEmail,omitempty"` Created string `json:"created,omitempty"` MarkDown string `json:"markdown,omitempty"` Files []string `json:"files,omitempty"` RoomType string `json:"roomType,omitempty"` MentionedPeople []string `json:"mentionedPeople,omitempty"` }
Message ...
type MessageQueryParams ¶
type MessageQueryParams struct { RoomID string `url:"roomId,omitempty"` Before string `url:"before,omitempty"` BeforeMessage string `url:"beforeMessage,omitempty"` Max int `url:"max,omitempty"` MentionedPeople string `url:"mentionedPeople,omitempty"` }
MessageQueryParams ...
type MessageRequest ¶
type MessageRequest struct { RoomID string `json:"roomId,omitempty"` Text string `json:"text,omitempty"` Files []string `json:"files,omitempty"` ToPersonID string `json:"toPersonId,omitempty"` ToPersonEmail string `json:"toPersonEmail,omitempty"` MarkDown string `json:"markdown,omitempty"` }
MessageRequest represents the Spark messages
func (MessageRequest) String ¶
func (r MessageRequest) String() string
type MessagesService ¶
type MessagesService service
MessagesService handles communication with the Messages related methods of the Cisco Spark API.
func (*MessagesService) DeleteMessage ¶
func (s *MessagesService) DeleteMessage(messageID string) (*Response, error)
DeleteMessage ....
func (*MessagesService) Get ¶
func (s *MessagesService) Get(queryParams *MessageQueryParams) ([]*Message, *Response, error)
Get ....
func (*MessagesService) GetMessage ¶
func (s *MessagesService) GetMessage(messageID string) (*Message, *Response, error)
GetMessage ....
func (*MessagesService) Post ¶
func (s *MessagesService) Post(messageRequest *MessageRequest) (*Message, *Response, error)
Post ....
type Organization ¶
type Organization struct { ID string `json:"id,omitempty"` DisplayName string `json:"displayName,omitempty"` Created string `json:"created,omitempty"` }
Organization represents the Spark organizations
func (Organization) String ¶
func (r Organization) String() string
type OrganizationsService ¶
type OrganizationsService service
organizationsService is an interface for interfacing with the organizations endpoints of the Cisco Spark API
func (*OrganizationsService) Get ¶
func (s *OrganizationsService) Get(queryParams *GetOrganizationsQueryParams) ([]*Organization, *Response, error)
Get ....
func (*OrganizationsService) GetOrganization ¶
func (s *OrganizationsService) GetOrganization(OrganizationID string) (*Organization, *Response, error)
GetOrganization ....
type PeopleService ¶
type PeopleService service
PeopleService is an interface for interfacing with the People endpoints of the Cisco Spark API
func (*PeopleService) Get ¶
func (s *PeopleService) Get(queryParams *GetPeopleQueryParams) ([]*Person, *Response, error)
Get ....
type Person ¶
type Person struct { ID string `json:"id,omitempty"` Emails []string `json:"emails,omitempty"` DisplayName string `json:"displayName,omitempty"` FirstName string `json:"firstName,omitempty"` LastName string `json:"lastName,omitempty"` Avatar string `json:"avatar,omitempty"` Created string `json:"created,omitempty"` OrgID string `json:"orgId,omitempty"` Roles []string `json:"roles,omitempty"` Licenses []string `json:"licenses,omitempty"` TimeZone string `json:"timezone,omitempty"` Status string `json:"status,omitempty"` NickName string `json:"nickName,omitempty"` Type string `json:"type,omitempty"` }
Person represents the Spark people
type RequestCompletionCallback ¶
RequestCompletionCallback defines the type of the request callback function
type Response ¶
Response is a Cisco Spark response. This wraps the standard http.Response returned from Cisco Spark.
type RolesService ¶
type RolesService service
rolesService is an interface for interfacing with the roles endpoints of the Cisco Spark API
func (*RolesService) Get ¶
func (s *RolesService) Get(queryParams *GetRolesQueryParams) ([]*Role, *Response, error)
Get ....
type Room ¶
type Room struct { ID string `json:"id,omitempty"` Title string `json:"title,omitempty"` Type string `json:"type,omitempty"` IsLocked bool `json:"isLocked,omitempty"` TeamID string `json:"teamId,omitempty"` LastActivity string `json:"lastActivity,omitempty"` Created string `json:"created,omitempty"` }
Room ...
type RoomQueryParams ¶
type RoomQueryParams struct { Max int `url:"max,omitempty"` TeamID string `url:"teamId,omitempty"` Type string `url:"type,omitempty"` }
RoomQueryParams ...
type RoomRequest ¶
type RoomRequest struct { TeamID string `json:"teamId,omitempty"` Title string `json:"title,omitempty"` }
RoomRequest represents the Spark rooms
func (RoomRequest) String ¶
func (r RoomRequest) String() string
type RoomsService ¶
type RoomsService service
RoomsService is an interface for interfacing with the Rooms endpoints of the Cisco Spark API
func (*RoomsService) DeleteRoom ¶
func (s *RoomsService) DeleteRoom(roomID string) (*Response, error)
DeleteRoom ....
func (*RoomsService) Get ¶
func (s *RoomsService) Get(queryParams *RoomQueryParams) ([]*Room, *Response, error)
Get ....
func (*RoomsService) GetRoom ¶
func (s *RoomsService) GetRoom(roomID string) (*Room, *Response, error)
GetRoom ....
func (*RoomsService) Post ¶
func (s *RoomsService) Post(roomRequest *RoomRequest) (*Room, *Response, error)
Post ....
func (*RoomsService) UpdateRoom ¶
func (s *RoomsService) UpdateRoom(roomID string, updateRoomRequest *UpdateRoomRequest) (*Room, *Response, error)
UpdateRoom ....
type Team ¶
type Team struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Created string `json:"created,omitempty"` }
Team ...
type TeamMembership ¶
type TeamMembership struct { ID string `json:"id,omitempty"` TeamID string `json:"teamId,omitempty"` PersonID string `json:"personId,omitempty"` PersonEmail string `json:"personEmail,omitempty"` IsModerator bool `json:"isModerator,omitempty"` Created string `json:"created,omitempty"` }
TeamMembership ...
func (TeamMembership) String ¶
func (r TeamMembership) String() string
type TeamMembershipQueryParams ¶
type TeamMembershipQueryParams struct { Max int `url:"max,omitempty"` TeamID string `url:"teamId,omitempty"` }
TeamMembershipQueryParams ...
type TeamMembershipRequest ¶
type TeamMembershipRequest struct { TeamID string `json:"teamId,omitempty"` PersonID string `json:"personId,omitempty"` PersonEmail string `json:"personEmail,omitempty"` IsModerator bool `json:"isModerator,omitempty"` }
TeamMembershipRequest represents the Spark teamMemberships
func (TeamMembershipRequest) String ¶
func (r TeamMembershipRequest) String() string
type TeamMembershipsService ¶
type TeamMembershipsService service
TeamMembershipsService is an interface for interfacing with the TeamMemberships endpoints of the Cisco Spark API
func (*TeamMembershipsService) DeleteTeamMembership ¶
func (s *TeamMembershipsService) DeleteTeamMembership(teamID string) (*Response, error)
DeleteTeamMembership ....
func (*TeamMembershipsService) Get ¶
func (s *TeamMembershipsService) Get(queryParams *TeamMembershipQueryParams) ([]*TeamMembership, *Response, error)
Get ....
func (*TeamMembershipsService) GetTeamMembership ¶
func (s *TeamMembershipsService) GetTeamMembership(teamID string) (*TeamMembership, *Response, error)
GetTeamMembership ....
func (*TeamMembershipsService) Post ¶
func (s *TeamMembershipsService) Post(teamRequest *TeamMembershipRequest) (*TeamMembership, *Response, error)
Post ....
func (*TeamMembershipsService) UpdateTeamMembership ¶
func (s *TeamMembershipsService) UpdateTeamMembership(teamID string, updateTeamMembershipRequest *UpdateTeamMembershipRequest) (*TeamMembership, *Response, error)
UpdateTeamMembership ....
type TeamQueryParams ¶
type TeamQueryParams struct {
Max int `url:"max,omitempty"`
}
TeamQueryParams ...
type TeamRequest ¶
type TeamRequest struct {
Name string `json:"name,omitempty"`
}
TeamRequest represents the Spark teams
func (TeamRequest) String ¶
func (r TeamRequest) String() string
type TeamsService ¶
type TeamsService service
TeamsService is an interface for interfacing with the Teams endpoints of the Cisco Spark API
func (*TeamsService) DeleteTeam ¶
func (s *TeamsService) DeleteTeam(teamID string) (*Response, error)
DeleteTeam ....
func (*TeamsService) Get ¶
func (s *TeamsService) Get(queryParams *TeamQueryParams) ([]*Team, *Response, error)
Get ....
func (*TeamsService) GetTeam ¶
func (s *TeamsService) GetTeam(teamID string) (*Team, *Response, error)
GetTeam ....
func (*TeamsService) Post ¶
func (s *TeamsService) Post(teamRequest *TeamRequest) (*Team, *Response, error)
Post ....
func (*TeamsService) UpdateTeam ¶
func (s *TeamsService) UpdateTeam(teamID string, updateTeamRequest *UpdateTeamRequest) (*Team, *Response, error)
UpdateTeam ....
type Timestamp ¶
Timestamp represents a time that can be unmarshalled from a JSON string formatted as either an RFC3339 or Unix timestamp. All exported methods of time.Time can be called on Timestamp.
func (*Timestamp) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface. Time is expected in RFC3339 or Unix format.
type UpdateMembershipRequest ¶
type UpdateMembershipRequest struct {
IsModerator bool `json:"isModerator,omitempty"`
}
UpdateMembershipRequest represents the Spark memberships
type UpdateRoomRequest ¶
type UpdateRoomRequest struct {
Title string `json:"title,omitempty"`
}
UpdateRoomRequest represents the Spark rooms
type UpdateTeamMembershipRequest ¶
type UpdateTeamMembershipRequest struct {
IsModerator bool `json:"isModerator,omitempty"`
}
UpdateTeamMembershipRequest represents the Spark teamMemberships
type UpdateTeamRequest ¶
type UpdateTeamRequest struct {
Name string `json:"name,omitempty"`
}
UpdateTeamRequest represents the Spark teams
type UpdateWebhookRequest ¶
type UpdateWebhookRequest struct { Name string `json:"name,omitempty"` TargetURL string `json:"targetUrl,omitempty"` }
UpdateWebhookRequest represents the Spark webhooks
type Webhook ¶
type Webhook struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` TargetURL string `json:"targetUrl,omitempty"` Resource string `json:"resource,omitempty"` Event string `json:"event,omitempty"` Filter string `json:"filter,omitempty"` Created string `json:"created,omitempty"` }
Webhook ...
type WebhookQueryParams ¶
type WebhookQueryParams struct {
Max int `url:"max,omitempty"`
}
WebhookQueryParams ...
type WebhookRequest ¶
type WebhookRequest struct { Name string `json:"name,omitempty"` TargetURL string `json:"targetUrl,omitempty"` Resource string `json:"resource,omitempty"` Event string `json:"event,omitempty"` Filter string `json:"filter,omitempty"` }
WebhookRequest represents the Spark webhooks
func (WebhookRequest) String ¶
func (r WebhookRequest) String() string
type WebhooksService ¶
type WebhooksService service
WebhooksService is an interface for interfacing with the Webhooks endpoints of the Cisco Spark API
func (*WebhooksService) DeleteWebhook ¶
func (s *WebhooksService) DeleteWebhook(webhookID string) (*Response, error)
DeleteWebhook ....
func (*WebhooksService) Get ¶
func (s *WebhooksService) Get(queryParams *WebhookQueryParams) ([]*Webhook, *Response, error)
Get ....
func (*WebhooksService) GetWebhook ¶
func (s *WebhooksService) GetWebhook(webhookID string) (*Webhook, *Response, error)
GetWebhook ....
func (*WebhooksService) Post ¶
func (s *WebhooksService) Post(webhookRequest *WebhookRequest) (*Webhook, *Response, error)
Post ....
func (*WebhooksService) UpdateWebhook ¶
func (s *WebhooksService) UpdateWebhook(webhookID string, updateWebhookRequest *UpdateWebhookRequest) (*Webhook, *Response, error)
UpdateWebhook ....