Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
go-gitlab
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
go-gitlab
Commits
537e392d
Commit
537e392d
authored
Aug 23, 2018
by
Sascha Andres
Committed by
Sander van Harmelen
Aug 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add microsoft teams integration (#452)
parent
f3bc634a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
0 deletions
+88
-0
services.go
services.go
+88
-0
No files found.
services.go
View file @
537e392d
...
@@ -513,3 +513,91 @@ func (s *ServicesService) DeleteJenkinsCIService(pid interface{}, options ...Opt
...
@@ -513,3 +513,91 @@ func (s *ServicesService) DeleteJenkinsCIService(pid interface{}, options ...Opt
return
s
.
client
.
Do
(
req
,
nil
)
return
s
.
client
.
Do
(
req
,
nil
)
}
}
// MicrosoftTeamsService represents Microsoft Teams service settings.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/services.html#microsoft-teams
type
MicrosoftTeamsService
struct
{
Service
Properties
*
MicrosoftTeamsServiceProperties
`json:"properties"`
}
// MicrosoftTeamsServiceProperties represents Microsoft Teams specific properties.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/services.html#microsoft-teams
type
MicrosoftTeamsServiceProperties
struct
{
WebHook
string
`json:"webhook"`
}
// GetMicrosoftTeamsService gets MicrosoftTeams service settings for a project.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/services.html#get-microsoft-teams-service-settings
func
(
s
*
ServicesService
)
GetMicrosoftTeamsService
(
pid
interface
{},
options
...
OptionFunc
)
(
*
MicrosoftTeamsService
,
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/services/microsoft-teams"
,
url
.
QueryEscape
(
project
))
req
,
err
:=
s
.
client
.
NewRequest
(
"GET"
,
u
,
nil
,
options
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
svc
:=
new
(
MicrosoftTeamsService
)
resp
,
err
:=
s
.
client
.
Do
(
req
,
svc
)
if
err
!=
nil
{
return
nil
,
resp
,
err
}
return
svc
,
resp
,
err
}
// SetMicrosoftTeamsServiceOptions represents the available SetMicrosoftTeamsService()
// options.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/services.html#create-edit-microsoft-teams-service
type
SetMicrosoftTeamsServiceOptions
struct
{
WebHook
*
string
`url:"webhook,omitempty" json:"webhook,omitempty"`
}
// SetMicrosoftTeamsService sets Microsoft Teams service for a project
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/services.html#create-edit-microsoft-teams-service
func
(
s
*
ServicesService
)
SetMicrosoftTeamsService
(
pid
interface
{},
opt
*
SetMicrosoftTeamsServiceOptions
,
options
...
OptionFunc
)
(
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/services/microsoft-teams"
,
url
.
QueryEscape
(
project
))
req
,
err
:=
s
.
client
.
NewRequest
(
"PUT"
,
u
,
opt
,
options
)
if
err
!=
nil
{
return
nil
,
err
}
return
s
.
client
.
Do
(
req
,
nil
)
}
// DeleteMicrosoftTeamsService deletes Microsoft Teams service for project.
//
// GitLab API docs:
// https://docs.gitlab.com/ce/api/services.html#delete-microsoft-teams-service
func
(
s
*
ServicesService
)
DeleteMicrosoftTeamsService
(
pid
interface
{},
options
...
OptionFunc
)
(
*
Response
,
error
)
{
project
,
err
:=
parseID
(
pid
)
if
err
!=
nil
{
return
nil
,
err
}
u
:=
fmt
.
Sprintf
(
"projects/%s/services/microsoft-teams"
,
url
.
QueryEscape
(
project
))
req
,
err
:=
s
.
client
.
NewRequest
(
"DELETE"
,
u
,
nil
,
options
)
if
err
!=
nil
{
return
nil
,
err
}
return
s
.
client
.
Do
(
req
,
nil
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment