-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: Team is now renamed to PayingTeam. New Team added for non-paying related teams.
- Loading branch information
1 parent
6940e6d
commit bc5d5af
Showing
7 changed files
with
102 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package monta | ||
|
||
import ( | ||
"context" | ||
"net/url" | ||
) | ||
|
||
// ListTeamsRequest is the request input to the [Client.ListTeams] method. | ||
type ListTeamsRequest struct { | ||
PageFilters | ||
// Filter teams by partner external id. To filter only resources without PartnerExternalID use "". | ||
PartnerExternalID *string | ||
// If the team can be deleted. | ||
IncludeDeleted bool | ||
} | ||
|
||
// ListTeamsResponse is the response output from the [Client.ListTeams] method. | ||
type ListTeamsResponse struct { | ||
// Teams in the current page. | ||
Teams []*Team `json:"data"` | ||
// PageMeta with metadata about the current page. | ||
PageMeta PageMeta `json:"meta"` | ||
} | ||
|
||
// ListTeams to retrieve your teams. | ||
func (c *clientImpl) ListTeams( | ||
ctx context.Context, | ||
request *ListTeamsRequest, | ||
) (*ListTeamsResponse, error) { | ||
path := "/v1/teams" | ||
query := url.Values{} | ||
request.PageFilters.Apply(query) | ||
if request.PartnerExternalID != nil { | ||
query.Set("partnerExternalId", *request.PartnerExternalID) | ||
} | ||
if request.IncludeDeleted { | ||
query.Set("includeDeleted", "true") | ||
} | ||
return doGet[ListTeamsResponse](ctx, c, path, query) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package monta | ||
|
||
// Team of Monta users. | ||
type PayingTeam struct { | ||
// ID of the team. | ||
ID int64 `json:"id"` | ||
|
||
// Public name of the team. | ||
PublicName string `json:"publicName"` | ||
|
||
// External Id of this entity, managed by you. | ||
PartnerExternalID *string `json:"partnerExternalId"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,48 @@ | ||
package monta | ||
|
||
import "time" | ||
|
||
// Team of Monta users. | ||
type Team struct { | ||
// ID of the team. | ||
ID int64 `json:"id"` | ||
|
||
// Public name of the team. | ||
PublicName string `json:"publicName"` | ||
// Name of the team. | ||
Name string `json:"name"` | ||
|
||
// External Id of the team. | ||
ExternalID *string `json:"externalId"` | ||
|
||
// External Id of this entity, managed by you. | ||
PartnerExternalID *string `json:"partnerExternalId"` | ||
|
||
// Code to share with a user to join the team. | ||
JoinCode string `json:"joinCode"` | ||
|
||
// Company name for the given team. | ||
CompanyName *string `json:"companyName"` | ||
|
||
// Operator of the team. | ||
Operator Operator `json:"operator"` | ||
|
||
// Address of the team. | ||
Address Address `json:"address"` | ||
|
||
// Type of the team. | ||
Type *string `json:"type"` | ||
|
||
// Operator Id of the team. | ||
OperatorID int64 `json:"operatorId"` | ||
|
||
// When the team was blocked. | ||
BlockedAt *time.Time `json:"blockedAt"` | ||
|
||
// When the team was created. | ||
CreatedAt time.Time `json:"createdAt"` | ||
|
||
// When the team was last updated. | ||
UpdatedAt time.Time `json:"updatedAt"` | ||
|
||
// When the team was deleted. | ||
DeletedAt *time.Time `json:"deletedAt"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters