Skip to content

Commit

Permalink
Merge pull request #30 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 5.1.1
  • Loading branch information
andyone authored Mar 15, 2021
2 parents 7e6ac19 + 63f566b commit 51111c7
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ jobs:

env:
SRC_DIR: src/github.com/${{ github.repository }}
GO111MODULE: auto

strategy:
matrix:
go: [ '1.14.x', '1.15.x' ]
go: [ '1.15.x', '1.16.x' ]

steps:
- name: Set up Go
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Currently, this package support only getting data from API (_i.e., you cannot cr

### Installation

Make sure you have a working Go 1.14+ workspace (_[instructions](https://golang.org/doc/install)_), then:
Make sure you have a working Go 1.15+ workspace (_[instructions](https://golang.org/doc/install)_), then:

````
go get pkg.re/essentialkaos/go-confluence.v5
Expand Down
2 changes: 1 addition & 1 deletion api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package confluence

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2020 ESSENTIAL KAOS //
// Copyright (c) 2021 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
2 changes: 1 addition & 1 deletion confluence.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package confluence

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2020 ESSENTIAL KAOS //
// Copyright (c) 2021 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
25 changes: 19 additions & 6 deletions team_calandars.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package confluence

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2020 ESSENTIAL KAOS //
// Copyright (c) 2021 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down Expand Up @@ -62,8 +62,8 @@ type CalendarCollection struct {

// Calendar represents Team Calendars calendar
type Calendar struct {
UsersPermittedToView []string `json:"usersPermittedToView"`
UsersPermittedToEdit []string `json:"usersPermittedToEdit"`
UsersPermittedToView []*PermsUser `json:"usersPermittedToView"`
UsersPermittedToEdit []*PermsUser `json:"usersPermittedToEdit"`
GroupsPermittedToView []string `json:"groupsPermittedToView"`
GroupsPermittedToEdit []string `json:"groupsPermittedToEdit"`
Warnings []string `json:"warnings"`
Expand Down Expand Up @@ -161,6 +161,14 @@ type CalendarUser struct {
Email string `json:"email"`
}

// PermsUser represents Team Calendars permissions user
type PermsUser struct {
AvatarURL string `json:"avatarUrl"`
Name string `json:"name"`
DisplayName string `json:"fullName"`
Key string `json:"id"`
}

// ////////////////////////////////////////////////////////////////////////////////// //

var idValidationRegex = regexp.MustCompile(`^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`)
Expand Down Expand Up @@ -237,13 +245,18 @@ func (p CalendarEventsParameters) Validate() error {

// Validate validates parameters
func (p CalendarsParameters) Validate() error {
if p.CalendarContext == "" {
return errors.New("CalendarContext is mandatory and must be set")
}

if p.CalendarContext == CALENDAR_CONTEXT_MY {
return nil
}

switch {
case len(p.IncludeSubCalendarID) == 0:
return errors.New("IncludeSubCalendarID is mandatory and must be set")

case p.CalendarContext == "":
return errors.New("CalendarContext is mandatory and must be set")

case p.ViewingSpaceKey == "":
return errors.New("ViewingSpaceKey is mandatory and must be set")
}
Expand Down
2 changes: 1 addition & 1 deletion utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package confluence

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2020 ESSENTIAL KAOS //
// Copyright (c) 2021 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand Down
4 changes: 2 additions & 2 deletions version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package confluence

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2020 ESSENTIAL KAOS //
// Copyright (c) 2021 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand All @@ -12,7 +12,7 @@ const (
NAME = "Go-Confluence"

// VERSION is package version
VERSION = "5.1.0"
VERSION = "5.1.1"
)

// ////////////////////////////////////////////////////////////////////////////////// //

0 comments on commit 51111c7

Please sign in to comment.