vendor: update github.com/dropbox/dropbox-sdk-go-unofficial to fix #1806

This commit is contained in:
Nick Craig-Wood 2017-12-05 09:12:15 +00:00
parent e00616b016
commit 5061aaaf46
22 changed files with 1394 additions and 462 deletions

4
Gopkg.lock generated
View File

@ -89,7 +89,7 @@
branch = "master"
name = "github.com/dropbox/dropbox-sdk-go-unofficial"
packages = ["dropbox","dropbox/async","dropbox/file_properties","dropbox/files"]
revision = "9a536e3b58ed271dc9d1f21681db990ca601a551"
revision = "9befe8c89b6e17667716dedd2f62327bae374bf2"
[[projects]]
name = "github.com/go-ini/ini"
@ -309,6 +309,6 @@
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "9d4dcfb143037fc27aa71f0eb309c9754ba348ff7585a39e575fba28265cac7d"
inputs-digest = "4dfe75b3ebfff3e7b40e2983d8c014f9e4d98fed08c3fe454f1dc890589e6960"
solver-name = "gps-cdcl"
solver-version = 1

View File

@ -1,3 +1,6 @@
# jetbrains
.idea
# swap
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]

View File

@ -99,7 +99,7 @@ func (dbx *apiImpl) TokenFromOauth1(arg *TokenFromOAuth1Arg) (res *TokenFromOAut
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -158,7 +158,7 @@ func (dbx *apiImpl) TokenRevoke() (err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -172,7 +172,7 @@ func (dbx *apiImpl) TokenRevoke() (err error) {
}
// New returns a Client implementation for this namespace
func New(c dropbox.Config) *apiImpl {
func New(c dropbox.Config) Client {
ctx := apiImpl(dropbox.NewContext(c))
return &ctx
}

View File

@ -27,26 +27,13 @@ import (
"github.com/dropbox/dropbox-sdk-go-unofficial/dropbox"
)
// InvalidPathRootError : has no documentation (yet)
type InvalidPathRootError struct {
// PathRoot : The latest path root id for user's team if the user is still
// in a team.
PathRoot string `json:"path_root,omitempty"`
}
// NewInvalidPathRootError returns a new InvalidPathRootError instance
func NewInvalidPathRootError() *InvalidPathRootError {
s := new(InvalidPathRootError)
return s
}
// PathRoot : has no documentation (yet)
type PathRoot struct {
dropbox.Tagged
// Team : Paths are relative to the given team directory. (This results in
// `PathRootError.invalid` if the user is not a member of the team
// associated with that path root id.).
Team string `json:"team,omitempty"`
// Root : Paths are relative to the authenticating user's root namespace
// (This results in `PathRootError.invalid_root` if the user's root
// namespace has changed.).
Root string `json:"root,omitempty"`
// NamespaceId : Paths are relative to given namespace id (This results in
// `PathRootError.no_permission` if you don't have access to this
// namespace.).
@ -56,9 +43,7 @@ type PathRoot struct {
// Valid tag values for PathRoot
const (
PathRootHome = "home"
PathRootMemberHome = "member_home"
PathRootTeam = "team"
PathRootUserHome = "user_home"
PathRootRoot = "root"
PathRootNamespaceId = "namespace_id"
PathRootOther = "other"
)
@ -75,8 +60,8 @@ func (u *PathRoot) UnmarshalJSON(body []byte) error {
}
u.Tag = w.Tag
switch u.Tag {
case "team":
err = json.Unmarshal(body, &u.Team)
case "root":
err = json.Unmarshal(body, &u.Root)
if err != nil {
return err
@ -94,14 +79,14 @@ func (u *PathRoot) UnmarshalJSON(body []byte) error {
// PathRootError : has no documentation (yet)
type PathRootError struct {
dropbox.Tagged
// Invalid : The path root id value in Dropbox-API-Path-Root header is no
// longer valid.
Invalid *InvalidPathRootError `json:"invalid,omitempty"`
// InvalidRoot : The root namespace id in Dropbox-API-Path-Root header is
// not valid. The value of this error is use's latest root info.
InvalidRoot IsRootInfo `json:"invalid_root,omitempty"`
}
// Valid tag values for PathRootError
const (
PathRootErrorInvalid = "invalid"
PathRootErrorInvalidRoot = "invalid_root"
PathRootErrorNoPermission = "no_permission"
PathRootErrorOther = "other"
)
@ -110,9 +95,9 @@ const (
func (u *PathRootError) UnmarshalJSON(body []byte) error {
type wrap struct {
dropbox.Tagged
// Invalid : The path root id value in Dropbox-API-Path-Root header is
// no longer valid.
Invalid json.RawMessage `json:"invalid,omitempty"`
// InvalidRoot : The root namespace id in Dropbox-API-Path-Root header
// is not valid. The value of this error is use's latest root info.
InvalidRoot json.RawMessage `json:"invalid_root,omitempty"`
}
var w wrap
var err error
@ -121,8 +106,8 @@ func (u *PathRootError) UnmarshalJSON(body []byte) error {
}
u.Tag = w.Tag
switch u.Tag {
case "invalid":
err = json.Unmarshal(body, &u.Invalid)
case "invalid_root":
u.InvalidRoot, err = IsRootInfoFromJSON(body)
if err != nil {
return err
@ -130,3 +115,121 @@ func (u *PathRootError) UnmarshalJSON(body []byte) error {
}
return nil
}
// RootInfo : Information about current user's root.
type RootInfo struct {
// RootNamespaceId : The namespace id for user's root namespace. It will be
// the namespace id of the shared team root if the user is member of a CDM
// team. Otherwise it will be same as `RootInfo.home_namespace_id`.
RootNamespaceId string `json:"root_namespace_id"`
// HomeNamespaceId : The namespace id for user's home namespace.
HomeNamespaceId string `json:"home_namespace_id"`
}
// NewRootInfo returns a new RootInfo instance
func NewRootInfo(RootNamespaceId string, HomeNamespaceId string) *RootInfo {
s := new(RootInfo)
s.RootNamespaceId = RootNamespaceId
s.HomeNamespaceId = HomeNamespaceId
return s
}
// IsRootInfo is the interface type for RootInfo and its subtypes
type IsRootInfo interface {
IsRootInfo()
}
// IsRootInfo implements the IsRootInfo interface
func (u *RootInfo) IsRootInfo() {}
type rootInfoUnion struct {
dropbox.Tagged
// Team : has no documentation (yet)
Team *TeamRootInfo `json:"team,omitempty"`
// User : has no documentation (yet)
User *UserRootInfo `json:"user,omitempty"`
}
// Valid tag values for RootInfo
const (
RootInfoTeam = "team"
RootInfoUser = "user"
)
// UnmarshalJSON deserializes into a rootInfoUnion instance
func (u *rootInfoUnion) UnmarshalJSON(body []byte) error {
type wrap struct {
dropbox.Tagged
// Team : has no documentation (yet)
Team json.RawMessage `json:"team,omitempty"`
// User : has no documentation (yet)
User json.RawMessage `json:"user,omitempty"`
}
var w wrap
var err error
if err = json.Unmarshal(body, &w); err != nil {
return err
}
u.Tag = w.Tag
switch u.Tag {
case "team":
err = json.Unmarshal(body, &u.Team)
if err != nil {
return err
}
case "user":
err = json.Unmarshal(body, &u.User)
if err != nil {
return err
}
}
return nil
}
// IsRootInfoFromJSON converts JSON to a concrete IsRootInfo instance
func IsRootInfoFromJSON(data []byte) (IsRootInfo, error) {
var t rootInfoUnion
if err := json.Unmarshal(data, &t); err != nil {
return nil, err
}
switch t.Tag {
case "team":
return t.Team, nil
case "user":
return t.User, nil
}
return nil, nil
}
// TeamRootInfo : Root info when user is member of a CDM team.
type TeamRootInfo struct {
RootInfo
// HomePath : The path for user's home directory under the shared team root.
HomePath string `json:"home_path"`
}
// NewTeamRootInfo returns a new TeamRootInfo instance
func NewTeamRootInfo(RootNamespaceId string, HomeNamespaceId string, HomePath string) *TeamRootInfo {
s := new(TeamRootInfo)
s.RootNamespaceId = RootNamespaceId
s.HomeNamespaceId = HomeNamespaceId
s.HomePath = HomePath
return s
}
// UserRootInfo : Root info when user is not member of a CDM team.
type UserRootInfo struct {
RootInfo
}
// NewUserRootInfo returns a new UserRootInfo instance
func NewUserRootInfo(RootNamespaceId string, HomeNamespaceId string) *UserRootInfo {
s := new(UserRootInfo)
s.RootNamespaceId = RootNamespaceId
s.HomeNamespaceId = HomeNamespaceId
return s
}

View File

@ -41,14 +41,17 @@ type Client interface {
// group, whereas `propertiesUpdate` will only delete fields that are
// explicitly marked for deletion.
PropertiesOverwrite(arg *OverwritePropertyGroupArg) (err error)
// PropertiesRemove : Remove the specified property group from the file. To
// remove specific property field key value pairs, see `propertiesUpdate`.
// To update a template, see `templatesUpdateForUser` or
// PropertiesRemove : Permanently removes the specified property group from
// the file. To remove specific property field key value pairs, see
// `propertiesUpdate`. To update a template, see `templatesUpdateForUser` or
// `templatesUpdateForTeam`. Templates can't be removed once created.
PropertiesRemove(arg *RemovePropertiesArg) (err error)
// PropertiesSearch : Search across property templates for particular
// property field values.
PropertiesSearch(arg *PropertiesSearchArg) (res *PropertiesSearchResult, err error)
// PropertiesSearchContinue : Once a cursor has been retrieved from
// `propertiesSearch`, use this to paginate through all search results.
PropertiesSearchContinue(arg *PropertiesSearchContinueArg) (res *PropertiesSearchResult, err error)
// PropertiesUpdate : Add, update or remove properties associated with the
// supplied file and templates. This endpoint should be used instead of
// `propertiesOverwrite` when property groups are being updated via a
@ -58,7 +61,8 @@ type Client interface {
// property group.
PropertiesUpdate(arg *UpdatePropertiesArg) (err error)
// TemplatesAddForTeam : Add a template associated with a team. See
// `propertiesAdd` to add properties to a file or folder.
// `propertiesAdd` to add properties to a file or folder. Note: this
// endpoint will create team-owned templates.
TemplatesAddForTeam(arg *AddTemplateArg) (res *AddTemplateResult, err error)
// TemplatesAddForUser : Add a template associated with a user. See
// `propertiesAdd` to add properties to a file. This endpoint can't be
@ -76,6 +80,14 @@ type Client interface {
// the schema of each template use `templatesGetForUser`. This endpoint
// can't be called on a team member or admin's behalf.
TemplatesListForUser() (res *ListTemplateResult, err error)
// TemplatesRemoveForTeam : Permanently removes the specified template
// created from `templatesAddForUser`. All properties associated with the
// template will also be removed. This action cannot be undone.
TemplatesRemoveForTeam(arg *RemoveTemplateArg) (err error)
// TemplatesRemoveForUser : Permanently removes the specified template
// created from `templatesAddForUser`. All properties associated with the
// template will also be removed. This action cannot be undone.
TemplatesRemoveForUser(arg *RemoveTemplateArg) (err error)
// TemplatesUpdateForTeam : Update a template associated with a team. This
// route can update the template name, the template description and add
// optional properties to templates.
@ -143,7 +155,7 @@ func (dbx *apiImpl) PropertiesAdd(arg *AddPropertiesArg) (err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -210,7 +222,7 @@ func (dbx *apiImpl) PropertiesOverwrite(arg *OverwritePropertyGroupArg) (err err
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -277,7 +289,7 @@ func (dbx *apiImpl) PropertiesRemove(arg *RemovePropertiesArg) (err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -349,7 +361,79 @@ func (dbx *apiImpl) PropertiesSearch(arg *PropertiesSearchArg) (res *PropertiesS
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
}
err = json.Unmarshal(body, &apiError)
if err != nil {
return
}
err = apiError
return
}
//PropertiesSearchContinueAPIError is an error-wrapper for the properties/search/continue route
type PropertiesSearchContinueAPIError struct {
dropbox.APIError
EndpointError *PropertiesSearchContinueError `json:"error"`
}
func (dbx *apiImpl) PropertiesSearchContinue(arg *PropertiesSearchContinueArg) (res *PropertiesSearchResult, err error) {
cli := dbx.Client
dbx.Config.LogDebug("arg: %v", arg)
b, err := json.Marshal(arg)
if err != nil {
return
}
headers := map[string]string{
"Content-Type": "application/json",
}
if dbx.Config.AsMemberID != "" {
headers["Dropbox-API-Select-User"] = dbx.Config.AsMemberID
}
req, err := (*dropbox.Context)(dbx).NewRequest("api", "rpc", true, "file_properties", "properties/search/continue", headers, bytes.NewReader(b))
if err != nil {
return
}
dbx.Config.LogInfo("req: %v", req)
resp, err := cli.Do(req)
if err != nil {
return
}
dbx.Config.LogInfo("resp: %v", resp)
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return
}
dbx.Config.LogDebug("body: %v", body)
if resp.StatusCode == http.StatusOK {
err = json.Unmarshal(body, &res)
if err != nil {
return
}
return
}
if resp.StatusCode == http.StatusConflict {
var apiError PropertiesSearchContinueAPIError
err = json.Unmarshal(body, &apiError)
if err != nil {
return
}
err = apiError
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -416,7 +500,7 @@ func (dbx *apiImpl) PropertiesUpdate(arg *UpdatePropertiesArg) (err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -485,7 +569,7 @@ func (dbx *apiImpl) TemplatesAddForTeam(arg *AddTemplateArg) (res *AddTemplateRe
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -557,7 +641,7 @@ func (dbx *apiImpl) TemplatesAddForUser(arg *AddTemplateArg) (res *AddTemplateRe
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -626,7 +710,7 @@ func (dbx *apiImpl) TemplatesGetForTeam(arg *GetTemplateArg) (res *GetTemplateRe
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -698,7 +782,7 @@ func (dbx *apiImpl) TemplatesGetForUser(arg *GetTemplateArg) (res *GetTemplateRe
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -759,7 +843,7 @@ func (dbx *apiImpl) TemplatesListForTeam() (res *ListTemplateResult, err error)
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -823,7 +907,138 @@ func (dbx *apiImpl) TemplatesListForUser() (res *ListTemplateResult, err error)
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
}
err = json.Unmarshal(body, &apiError)
if err != nil {
return
}
err = apiError
return
}
//TemplatesRemoveForTeamAPIError is an error-wrapper for the templates/remove_for_team route
type TemplatesRemoveForTeamAPIError struct {
dropbox.APIError
EndpointError *TemplateError `json:"error"`
}
func (dbx *apiImpl) TemplatesRemoveForTeam(arg *RemoveTemplateArg) (err error) {
cli := dbx.Client
dbx.Config.LogDebug("arg: %v", arg)
b, err := json.Marshal(arg)
if err != nil {
return
}
headers := map[string]string{
"Content-Type": "application/json",
}
req, err := (*dropbox.Context)(dbx).NewRequest("api", "rpc", true, "file_properties", "templates/remove_for_team", headers, bytes.NewReader(b))
if err != nil {
return
}
dbx.Config.LogInfo("req: %v", req)
resp, err := cli.Do(req)
if err != nil {
return
}
dbx.Config.LogInfo("resp: %v", resp)
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return
}
dbx.Config.LogDebug("body: %v", body)
if resp.StatusCode == http.StatusOK {
return
}
if resp.StatusCode == http.StatusConflict {
var apiError TemplatesRemoveForTeamAPIError
err = json.Unmarshal(body, &apiError)
if err != nil {
return
}
err = apiError
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
}
err = json.Unmarshal(body, &apiError)
if err != nil {
return
}
err = apiError
return
}
//TemplatesRemoveForUserAPIError is an error-wrapper for the templates/remove_for_user route
type TemplatesRemoveForUserAPIError struct {
dropbox.APIError
EndpointError *TemplateError `json:"error"`
}
func (dbx *apiImpl) TemplatesRemoveForUser(arg *RemoveTemplateArg) (err error) {
cli := dbx.Client
dbx.Config.LogDebug("arg: %v", arg)
b, err := json.Marshal(arg)
if err != nil {
return
}
headers := map[string]string{
"Content-Type": "application/json",
}
if dbx.Config.AsMemberID != "" {
headers["Dropbox-API-Select-User"] = dbx.Config.AsMemberID
}
req, err := (*dropbox.Context)(dbx).NewRequest("api", "rpc", true, "file_properties", "templates/remove_for_user", headers, bytes.NewReader(b))
if err != nil {
return
}
dbx.Config.LogInfo("req: %v", req)
resp, err := cli.Do(req)
if err != nil {
return
}
dbx.Config.LogInfo("resp: %v", resp)
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return
}
dbx.Config.LogDebug("body: %v", body)
if resp.StatusCode == http.StatusOK {
return
}
if resp.StatusCode == http.StatusConflict {
var apiError TemplatesRemoveForUserAPIError
err = json.Unmarshal(body, &apiError)
if err != nil {
return
}
err = apiError
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -892,7 +1107,7 @@ func (dbx *apiImpl) TemplatesUpdateForTeam(arg *UpdateTemplateArg) (res *UpdateT
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -964,7 +1179,7 @@ func (dbx *apiImpl) TemplatesUpdateForUser(arg *UpdateTemplateArg) (res *UpdateT
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -978,7 +1193,7 @@ func (dbx *apiImpl) TemplatesUpdateForUser(arg *UpdateTemplateArg) (res *UpdateT
}
// New returns a Client implementation for this namespace
func New(c dropbox.Config) *apiImpl {
func New(c dropbox.Config) Client {
ctx := apiImpl(dropbox.NewContext(c))
return &ctx
}

View File

@ -30,7 +30,18 @@
// possible key names and value types are explicitly enumerated using
// `PropertyFieldTemplate` objects. You can think of a property group template
// as a class definition for a particular key/value metadata object, and the
// property groups themselves as the instantiations of these objects.
// property groups themselves as the instantiations of these objects. Templates
// are owned either by a user/app pair or team/app pair. Templates and their
// associated properties can't be accessed by any app other than the app that
// created them, and even then, only when the app is linked with the owner of
// the template (either a user or team). User-owned templates are accessed via
// the user-auth template/*_for_user endpoints, while team-owned templates are
// accessed via the team-auth template/*_for_team endpoints. Properties
// associated with either type of template can be accessed via the user-auth
// properties/* endpoints. Finally, properties can be accessed from a number of
// endpoints that return metadata, including `files/get_metadata`, and
// `files/list_folder`. Properties can also be added during upload, using
// `files/upload`.
package file_properties
import (
@ -467,6 +478,31 @@ func NewPropertiesSearchArg(Queries []*PropertiesSearchQuery) *PropertiesSearchA
return s
}
// PropertiesSearchContinueArg : has no documentation (yet)
type PropertiesSearchContinueArg struct {
// Cursor : The cursor returned by your last call to `propertiesSearch` or
// `propertiesSearchContinue`.
Cursor string `json:"cursor"`
}
// NewPropertiesSearchContinueArg returns a new PropertiesSearchContinueArg instance
func NewPropertiesSearchContinueArg(Cursor string) *PropertiesSearchContinueArg {
s := new(PropertiesSearchContinueArg)
s.Cursor = Cursor
return s
}
// PropertiesSearchContinueError : has no documentation (yet)
type PropertiesSearchContinueError struct {
dropbox.Tagged
}
// Valid tag values for PropertiesSearchContinueError
const (
PropertiesSearchContinueErrorReset = "reset"
PropertiesSearchContinueErrorOther = "other"
)
// PropertiesSearchError : has no documentation (yet)
type PropertiesSearchError struct {
dropbox.Tagged
@ -510,15 +546,18 @@ type PropertiesSearchMatch struct {
Id string `json:"id"`
// Path : The path for the matched file or folder.
Path string `json:"path"`
// IsDeleted : Whether the file or folder is deleted.
IsDeleted bool `json:"is_deleted"`
// PropertyGroups : List of custom property groups associated with the file.
PropertyGroups []*PropertyGroup `json:"property_groups"`
}
// NewPropertiesSearchMatch returns a new PropertiesSearchMatch instance
func NewPropertiesSearchMatch(Id string, Path string, PropertyGroups []*PropertyGroup) *PropertiesSearchMatch {
func NewPropertiesSearchMatch(Id string, Path string, IsDeleted bool, PropertyGroups []*PropertyGroup) *PropertiesSearchMatch {
s := new(PropertiesSearchMatch)
s.Id = Id
s.Path = Path
s.IsDeleted = IsDeleted
s.PropertyGroups = PropertyGroups
return s
}
@ -581,6 +620,10 @@ func NewPropertiesSearchQuery(Query string, Mode *PropertiesSearchMode) *Propert
type PropertiesSearchResult struct {
// Matches : A list (possibly empty) of matches for the query.
Matches []*PropertiesSearchMatch `json:"matches"`
// Cursor : Pass the cursor into `propertiesSearchContinue` to continue to
// receive search results. Cursor will be null when there are no more
// results.
Cursor string `json:"cursor,omitempty"`
}
// NewPropertiesSearchResult returns a new PropertiesSearchResult instance
@ -758,6 +801,59 @@ func (u *RemovePropertiesError) UnmarshalJSON(body []byte) error {
return nil
}
// RemoveTemplateArg : has no documentation (yet)
type RemoveTemplateArg struct {
// TemplateId : An identifier for a template created by
// `templatesAddForUser` or `templatesAddForTeam`.
TemplateId string `json:"template_id"`
}
// NewRemoveTemplateArg returns a new RemoveTemplateArg instance
func NewRemoveTemplateArg(TemplateId string) *RemoveTemplateArg {
s := new(RemoveTemplateArg)
s.TemplateId = TemplateId
return s
}
// TemplateFilterBase : has no documentation (yet)
type TemplateFilterBase struct {
dropbox.Tagged
// FilterSome : Only templates with an ID in the supplied list will be
// returned (a subset of templates will be returned).
FilterSome []string `json:"filter_some,omitempty"`
}
// Valid tag values for TemplateFilterBase
const (
TemplateFilterBaseFilterSome = "filter_some"
TemplateFilterBaseOther = "other"
)
// UnmarshalJSON deserializes into a TemplateFilterBase instance
func (u *TemplateFilterBase) UnmarshalJSON(body []byte) error {
type wrap struct {
dropbox.Tagged
// FilterSome : Only templates with an ID in the supplied list will be
// returned (a subset of templates will be returned).
FilterSome json.RawMessage `json:"filter_some,omitempty"`
}
var w wrap
var err error
if err = json.Unmarshal(body, &w); err != nil {
return err
}
u.Tag = w.Tag
switch u.Tag {
case "filter_some":
err = json.Unmarshal(body, &u.FilterSome)
if err != nil {
return err
}
}
return nil
}
// TemplateFilter : has no documentation (yet)
type TemplateFilter struct {
dropbox.Tagged
@ -768,9 +864,9 @@ type TemplateFilter struct {
// Valid tag values for TemplateFilter
const (
TemplateFilterFilterNone = "filter_none"
TemplateFilterFilterSome = "filter_some"
TemplateFilterOther = "other"
TemplateFilterFilterNone = "filter_none"
)
// UnmarshalJSON deserializes into a TemplateFilter instance

View File

@ -104,7 +104,7 @@ func (dbx *apiImpl) Create(arg *CreateFileRequestArgs) (res *FileRequest, err er
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -176,7 +176,7 @@ func (dbx *apiImpl) Get(arg *GetFileRequestArgs) (res *FileRequest, err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -240,7 +240,7 @@ func (dbx *apiImpl) List() (res *ListFileRequestsResult, err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -312,7 +312,7 @@ func (dbx *apiImpl) Update(arg *UpdateFileRequestArgs) (res *FileRequest, err er
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -326,7 +326,7 @@ func (dbx *apiImpl) Update(arg *UpdateFileRequestArgs) (res *FileRequest, err er
}
// New returns a Client implementation for this namespace
func New(c dropbox.Config) *apiImpl {
func New(c dropbox.Config) Client {
ctx := apiImpl(dropbox.NewContext(c))
return &ctx
}

View File

@ -38,12 +38,14 @@ type Client interface {
// AlphaGetMetadata : Returns the metadata for a file or folder. This is an
// alpha endpoint compatible with the properties API. Note: Metadata for the
// root folder is unsupported.
// Deprecated: Use `GetMetadata` instead
AlphaGetMetadata(arg *AlphaGetMetadataArg) (res IsMetadata, err error)
// AlphaUpload : Create a new file with the contents provided in the
// request. Note that this endpoint is part of the properties API alpha and
// is slightly different from `upload`. Do not use this to upload a file
// larger than 150 MB. Instead, create an upload session with
// `uploadSessionStart`.
// Deprecated: Use `AlphaUpload` instead
AlphaUpload(arg *CommitInfoWithProperties, content io.Reader) (res *FileMetadata, err error)
// Copy : Copy a file or folder to a different location in the user's
// Dropbox. If the source path is a folder all its contents will be copied.
@ -280,6 +282,9 @@ type AlphaGetMetadataAPIError struct {
}
func (dbx *apiImpl) AlphaGetMetadata(arg *AlphaGetMetadataArg) (res IsMetadata, err error) {
log.Printf("WARNING: API `AlphaGetMetadata` is deprecated")
log.Printf("Use API `GetMetadata` instead")
cli := dbx.Client
dbx.Config.LogDebug("arg: %v", arg)
@ -343,7 +348,7 @@ func (dbx *apiImpl) AlphaGetMetadata(arg *AlphaGetMetadataArg) (res IsMetadata,
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -363,6 +368,9 @@ type AlphaUploadAPIError struct {
}
func (dbx *apiImpl) AlphaUpload(arg *CommitInfoWithProperties, content io.Reader) (res *FileMetadata, err error) {
log.Printf("WARNING: API `AlphaUpload` is deprecated")
log.Printf("Use API `AlphaUpload` instead")
cli := dbx.Client
dbx.Config.LogDebug("arg: %v", arg)
@ -416,7 +424,7 @@ func (dbx *apiImpl) AlphaUpload(arg *CommitInfoWithProperties, content io.Reader
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -502,7 +510,7 @@ func (dbx *apiImpl) Copy(arg *RelocationArg) (res IsMetadata, err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -574,7 +582,7 @@ func (dbx *apiImpl) CopyBatch(arg *RelocationBatchArg) (res *RelocationBatchLaun
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -646,7 +654,7 @@ func (dbx *apiImpl) CopyBatchCheck(arg *async.PollArg) (res *RelocationBatchJobS
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -718,7 +726,7 @@ func (dbx *apiImpl) CopyReferenceGet(arg *GetCopyReferenceArg) (res *GetCopyRefe
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -790,7 +798,7 @@ func (dbx *apiImpl) CopyReferenceSave(arg *SaveCopyReferenceArg) (res *SaveCopyR
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -862,7 +870,7 @@ func (dbx *apiImpl) CopyV2(arg *RelocationArg) (res *RelocationResult, err error
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -937,7 +945,7 @@ func (dbx *apiImpl) CreateFolder(arg *CreateFolderArg) (res *FolderMetadata, err
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1009,7 +1017,7 @@ func (dbx *apiImpl) CreateFolderV2(arg *CreateFolderArg) (res *CreateFolderResul
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1095,7 +1103,7 @@ func (dbx *apiImpl) Delete(arg *DeleteArg) (res IsMetadata, err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1167,7 +1175,7 @@ func (dbx *apiImpl) DeleteBatch(arg *DeleteBatchArg) (res *DeleteBatchLaunch, er
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1239,7 +1247,7 @@ func (dbx *apiImpl) DeleteBatchCheck(arg *async.PollArg) (res *DeleteBatchJobSta
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1311,7 +1319,7 @@ func (dbx *apiImpl) DeleteV2(arg *DeleteArg) (res *DeleteResult, err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1387,7 +1395,7 @@ func (dbx *apiImpl) Download(arg *DownloadArg) (res *FileMetadata, content io.Re
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1470,7 +1478,7 @@ func (dbx *apiImpl) GetMetadata(arg *GetMetadataArg) (res IsMetadata, err error)
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1543,7 +1551,7 @@ func (dbx *apiImpl) GetPreview(arg *PreviewArg) (res *FileMetadata, content io.R
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1615,7 +1623,7 @@ func (dbx *apiImpl) GetTemporaryLink(arg *GetTemporaryLinkArg) (res *GetTemporar
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1688,7 +1696,7 @@ func (dbx *apiImpl) GetThumbnail(arg *ThumbnailArg) (res *FileMetadata, content
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1760,7 +1768,7 @@ func (dbx *apiImpl) GetThumbnailBatch(arg *GetThumbnailBatchArg) (res *GetThumbn
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1832,7 +1840,7 @@ func (dbx *apiImpl) ListFolder(arg *ListFolderArg) (res *ListFolderResult, err e
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1904,7 +1912,7 @@ func (dbx *apiImpl) ListFolderContinue(arg *ListFolderContinueArg) (res *ListFol
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1976,7 +1984,7 @@ func (dbx *apiImpl) ListFolderGetLatestCursor(arg *ListFolderArg) (res *ListFold
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2045,7 +2053,7 @@ func (dbx *apiImpl) ListFolderLongpoll(arg *ListFolderLongpollArg) (res *ListFol
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2117,7 +2125,7 @@ func (dbx *apiImpl) ListRevisions(arg *ListRevisionsArg) (res *ListRevisionsResu
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2203,7 +2211,7 @@ func (dbx *apiImpl) Move(arg *RelocationArg) (res IsMetadata, err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2275,7 +2283,7 @@ func (dbx *apiImpl) MoveBatch(arg *RelocationBatchArg) (res *RelocationBatchLaun
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2347,7 +2355,7 @@ func (dbx *apiImpl) MoveBatchCheck(arg *async.PollArg) (res *RelocationBatchJobS
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2419,7 +2427,7 @@ func (dbx *apiImpl) MoveV2(arg *RelocationArg) (res *RelocationResult, err error
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2486,7 +2494,7 @@ func (dbx *apiImpl) PermanentlyDelete(arg *DeleteArg) (err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2555,7 +2563,7 @@ func (dbx *apiImpl) PropertiesAdd(arg *file_properties.AddPropertiesArg) (err er
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2624,7 +2632,7 @@ func (dbx *apiImpl) PropertiesOverwrite(arg *file_properties.OverwritePropertyGr
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2693,7 +2701,7 @@ func (dbx *apiImpl) PropertiesRemove(arg *file_properties.RemovePropertiesArg) (
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2767,7 +2775,7 @@ func (dbx *apiImpl) PropertiesTemplateGet(arg *file_properties.GetTemplateArg) (
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2833,7 +2841,7 @@ func (dbx *apiImpl) PropertiesTemplateList() (res *file_properties.ListTemplateR
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2902,7 +2910,7 @@ func (dbx *apiImpl) PropertiesUpdate(arg *file_properties.UpdatePropertiesArg) (
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2974,7 +2982,7 @@ func (dbx *apiImpl) Restore(arg *RestoreArg) (res *FileMetadata, err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3046,7 +3054,7 @@ func (dbx *apiImpl) SaveUrl(arg *SaveUrlArg) (res *SaveUrlResult, err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3118,7 +3126,7 @@ func (dbx *apiImpl) SaveUrlCheckJobStatus(arg *async.PollArg) (res *SaveUrlJobSt
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3190,7 +3198,7 @@ func (dbx *apiImpl) Search(arg *SearchArg) (res *SearchResult, err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3263,7 +3271,7 @@ func (dbx *apiImpl) Upload(arg *CommitInfo, content io.Reader) (res *FileMetadat
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3334,7 +3342,7 @@ func (dbx *apiImpl) UploadSessionAppend(arg *UploadSessionCursor, content io.Rea
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3402,7 +3410,7 @@ func (dbx *apiImpl) UploadSessionAppendV2(arg *UploadSessionAppendArg, content i
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3475,7 +3483,7 @@ func (dbx *apiImpl) UploadSessionFinish(arg *UploadSessionFinishArg, content io.
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3547,7 +3555,7 @@ func (dbx *apiImpl) UploadSessionFinishBatch(arg *UploadSessionFinishBatchArg) (
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3619,7 +3627,7 @@ func (dbx *apiImpl) UploadSessionFinishBatchCheck(arg *async.PollArg) (res *Uplo
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3692,7 +3700,7 @@ func (dbx *apiImpl) UploadSessionStart(arg *UploadSessionStartArg, content io.Re
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3706,7 +3714,7 @@ func (dbx *apiImpl) UploadSessionStart(arg *UploadSessionStartArg, content io.Re
}
// New returns a Client implementation for this namespace
func New(c dropbox.Config) *apiImpl {
func New(c dropbox.Config) Client {
ctx := apiImpl(dropbox.NewContext(c))
return &ctx
}

View File

@ -44,6 +44,10 @@ type GetMetadataArg struct {
// flag for each file indicating whether or not that file has any explicit
// members.
IncludeHasExplicitSharedMembers bool `json:"include_has_explicit_shared_members"`
// IncludePropertyGroups : If set to a valid list of template IDs,
// `FileMetadata.property_groups` is set if there exists property data
// associated with the file and each of the listed templates.
IncludePropertyGroups *file_properties.TemplateFilterBase `json:"include_property_groups,omitempty"`
}
// NewGetMetadataArg returns a new GetMetadataArg instance
@ -177,6 +181,8 @@ type CommitInfo struct {
// tells the clients that this modification shouldn't result in a user
// notification.
Mute bool `json:"mute"`
// PropertyGroups : List of custom properties to add to file.
PropertyGroups []*file_properties.PropertyGroup `json:"property_groups,omitempty"`
}
// NewCommitInfo returns a new CommitInfo instance
@ -192,8 +198,6 @@ func NewCommitInfo(Path string) *CommitInfo {
// CommitInfoWithProperties : has no documentation (yet)
type CommitInfoWithProperties struct {
CommitInfo
// PropertyGroups : List of custom properties to add to file.
PropertyGroups []*file_properties.PropertyGroup `json:"property_groups,omitempty"`
}
// NewCommitInfoWithProperties returns a new CommitInfoWithProperties instance
@ -848,7 +852,9 @@ type FolderMetadata struct {
// shared folder mount point.
SharingInfo *FolderSharingInfo `json:"sharing_info,omitempty"`
// PropertyGroups : Additional information if the file has custom properties
// with the property template specified.
// with the property template specified. Note that only properties
// associated with user-owned templates, not team-owned templates, can be
// attached to folders.
PropertyGroups []*file_properties.PropertyGroup `json:"property_groups,omitempty"`
}
@ -1172,6 +1178,10 @@ type ListFolderArg struct {
// present, `ListFolderArg.path` will be relative to root of the shared
// link. Only non-recursive mode is supported for shared link.
SharedLink *SharedLink `json:"shared_link,omitempty"`
// IncludePropertyGroups : If set to a valid list of template IDs,
// `FileMetadata.property_groups` is set if there exists property data
// associated with the file and each of the listed templates.
IncludePropertyGroups *file_properties.TemplateFilterBase `json:"include_property_groups,omitempty"`
}
// NewListFolderArg returns a new ListFolderArg instance
@ -1772,6 +1782,7 @@ const (
RelocationErrorTooManyFiles = "too_many_files"
RelocationErrorDuplicatedOrNestedPaths = "duplicated_or_nested_paths"
RelocationErrorCantTransferOwnership = "cant_transfer_ownership"
RelocationErrorInsufficientQuota = "insufficient_quota"
RelocationErrorOther = "other"
)
@ -1837,6 +1848,7 @@ const (
RelocationBatchErrorTooManyFiles = "too_many_files"
RelocationBatchErrorDuplicatedOrNestedPaths = "duplicated_or_nested_paths"
RelocationBatchErrorCantTransferOwnership = "cant_transfer_ownership"
RelocationBatchErrorInsufficientQuota = "insufficient_quota"
RelocationBatchErrorOther = "other"
RelocationBatchErrorTooManyWriteOperations = "too_many_write_operations"
)

View File

@ -153,7 +153,7 @@ func (dbx *apiImpl) DocsArchive(arg *RefPaperDoc) (err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -226,7 +226,7 @@ func (dbx *apiImpl) DocsCreate(arg *PaperDocCreateArgs, content io.Reader) (res
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -299,7 +299,7 @@ func (dbx *apiImpl) DocsDownload(arg *PaperDocExport) (res *PaperDocExportResult
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -371,7 +371,7 @@ func (dbx *apiImpl) DocsFolderUsersList(arg *ListUsersOnFolderArgs) (res *ListUs
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -443,7 +443,7 @@ func (dbx *apiImpl) DocsFolderUsersListContinue(arg *ListUsersOnFolderContinueAr
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -515,7 +515,7 @@ func (dbx *apiImpl) DocsGetFolderInfo(arg *RefPaperDoc) (res *FoldersContainingP
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -587,7 +587,7 @@ func (dbx *apiImpl) DocsList(arg *ListPaperDocsArgs) (res *ListPaperDocsResponse
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -659,7 +659,7 @@ func (dbx *apiImpl) DocsListContinue(arg *ListPaperDocsContinueArgs) (res *ListP
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -726,7 +726,7 @@ func (dbx *apiImpl) DocsPermanentlyDelete(arg *RefPaperDoc) (err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -798,7 +798,7 @@ func (dbx *apiImpl) DocsSharingPolicyGet(arg *RefPaperDoc) (res *SharingPolicy,
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -865,7 +865,7 @@ func (dbx *apiImpl) DocsSharingPolicySet(arg *PaperDocSharingPolicy) (err error)
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -938,7 +938,7 @@ func (dbx *apiImpl) DocsUpdate(arg *PaperDocUpdateArgs, content io.Reader) (res
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1010,7 +1010,7 @@ func (dbx *apiImpl) DocsUsersAdd(arg *AddPaperDocUser) (res []*AddPaperDocUserMe
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1082,7 +1082,7 @@ func (dbx *apiImpl) DocsUsersList(arg *ListUsersOnPaperDocArgs) (res *ListUsersO
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1154,7 +1154,7 @@ func (dbx *apiImpl) DocsUsersListContinue(arg *ListUsersOnPaperDocContinueArgs)
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1221,7 +1221,7 @@ func (dbx *apiImpl) DocsUsersRemove(arg *RemovePaperDocUser) (err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1235,7 +1235,7 @@ func (dbx *apiImpl) DocsUsersRemove(arg *RemovePaperDocUser) (err error) {
}
// New returns a Client implementation for this namespace
func New(c dropbox.Config) *apiImpl {
func New(c dropbox.Config) Client {
ctx := apiImpl(dropbox.NewContext(c))
return &ctx
}

View File

@ -35,8 +35,8 @@ const (
hostAPI = "api"
hostContent = "content"
hostNotify = "notify"
sdkVersion = "3.3.0"
specVersion = "318810d"
sdkVersion = "4.1.0"
specVersion = "5389e5b"
)
// Version returns the current SDK version and API Spec version

View File

@ -285,7 +285,7 @@ func (dbx *apiImpl) AddFileMember(arg *AddFileMemberArgs) (res []*FileMemberActi
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -352,7 +352,7 @@ func (dbx *apiImpl) AddFolderMember(arg *AddFolderMemberArg) (err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -427,7 +427,7 @@ func (dbx *apiImpl) ChangeFileMemberAccess(arg *ChangeFileMemberAccessArgs) (res
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -499,7 +499,7 @@ func (dbx *apiImpl) CheckJobStatus(arg *async.PollArg) (res *JobStatus, err erro
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -571,7 +571,7 @@ func (dbx *apiImpl) CheckRemoveMemberJobStatus(arg *async.PollArg) (res *RemoveM
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -643,7 +643,7 @@ func (dbx *apiImpl) CheckShareJobStatus(arg *async.PollArg) (res *ShareFolderJob
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -718,7 +718,7 @@ func (dbx *apiImpl) CreateSharedLink(arg *CreateSharedLinkArg) (res *PathLinkMet
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -798,7 +798,7 @@ func (dbx *apiImpl) CreateSharedLinkWithSettings(arg *CreateSharedLinkWithSettin
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -870,7 +870,7 @@ func (dbx *apiImpl) GetFileMetadata(arg *GetFileMetadataArg) (res *SharedFileMet
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -942,7 +942,7 @@ func (dbx *apiImpl) GetFileMetadataBatch(arg *GetFileMetadataBatchArg) (res []*G
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1014,7 +1014,7 @@ func (dbx *apiImpl) GetFolderMetadata(arg *GetMetadataArgs) (res *SharedFolderMe
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1095,7 +1095,7 @@ func (dbx *apiImpl) GetSharedLinkFile(arg *GetSharedLinkMetadataArg) (res IsShar
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1175,7 +1175,7 @@ func (dbx *apiImpl) GetSharedLinkMetadata(arg *GetSharedLinkMetadataArg) (res Is
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1250,7 +1250,7 @@ func (dbx *apiImpl) GetSharedLinks(arg *GetSharedLinksArg) (res *GetSharedLinksR
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1322,7 +1322,7 @@ func (dbx *apiImpl) ListFileMembers(arg *ListFileMembersArg) (res *SharedFileMem
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1394,7 +1394,7 @@ func (dbx *apiImpl) ListFileMembersBatch(arg *ListFileMembersBatchArg) (res []*L
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1466,7 +1466,7 @@ func (dbx *apiImpl) ListFileMembersContinue(arg *ListFileMembersContinueArg) (re
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1538,7 +1538,7 @@ func (dbx *apiImpl) ListFolderMembers(arg *ListFolderMembersArgs) (res *SharedFo
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1610,7 +1610,7 @@ func (dbx *apiImpl) ListFolderMembersContinue(arg *ListFolderMembersContinueArg)
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1682,7 +1682,7 @@ func (dbx *apiImpl) ListFolders(arg *ListFoldersArgs) (res *ListFoldersResult, e
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1754,7 +1754,7 @@ func (dbx *apiImpl) ListFoldersContinue(arg *ListFoldersContinueArg) (res *ListF
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1826,7 +1826,7 @@ func (dbx *apiImpl) ListMountableFolders(arg *ListFoldersArgs) (res *ListFolders
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1898,7 +1898,7 @@ func (dbx *apiImpl) ListMountableFoldersContinue(arg *ListFoldersContinueArg) (r
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1970,7 +1970,7 @@ func (dbx *apiImpl) ListReceivedFiles(arg *ListFilesArg) (res *ListFilesResult,
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2042,7 +2042,7 @@ func (dbx *apiImpl) ListReceivedFilesContinue(arg *ListFilesContinueArg) (res *L
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2114,7 +2114,7 @@ func (dbx *apiImpl) ListSharedLinks(arg *ListSharedLinksArg) (res *ListSharedLin
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2194,7 +2194,7 @@ func (dbx *apiImpl) ModifySharedLinkSettings(arg *ModifySharedLinkSettingsArgs)
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2266,7 +2266,7 @@ func (dbx *apiImpl) MountFolder(arg *MountFolderArg) (res *SharedFolderMetadata,
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2333,7 +2333,7 @@ func (dbx *apiImpl) RelinquishFileMembership(arg *RelinquishFileMembershipArg) (
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2405,7 +2405,7 @@ func (dbx *apiImpl) RelinquishFolderMembership(arg *RelinquishFolderMembershipAr
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2480,7 +2480,7 @@ func (dbx *apiImpl) RemoveFileMember(arg *RemoveFileMemberArg) (res *FileMemberA
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2552,7 +2552,7 @@ func (dbx *apiImpl) RemoveFileMember2(arg *RemoveFileMemberArg) (res *FileMember
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2624,7 +2624,7 @@ func (dbx *apiImpl) RemoveFolderMember(arg *RemoveFolderMemberArg) (res *async.L
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2691,7 +2691,7 @@ func (dbx *apiImpl) RevokeSharedLink(arg *RevokeSharedLinkArg) (err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2763,7 +2763,7 @@ func (dbx *apiImpl) ShareFolder(arg *ShareFolderArg) (res *ShareFolderLaunch, er
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2830,7 +2830,7 @@ func (dbx *apiImpl) TransferFolder(arg *TransferFolderArg) (err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2897,7 +2897,7 @@ func (dbx *apiImpl) UnmountFolder(arg *UnmountFolderArg) (err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2964,7 +2964,7 @@ func (dbx *apiImpl) UnshareFile(arg *UnshareFileArg) (err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3036,7 +3036,7 @@ func (dbx *apiImpl) UnshareFolder(arg *UnshareFolderArg) (res *async.LaunchEmpty
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3108,7 +3108,7 @@ func (dbx *apiImpl) UpdateFileMember(arg *UpdateFileMemberArgs) (res *MemberAcce
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3180,7 +3180,7 @@ func (dbx *apiImpl) UpdateFolderMember(arg *UpdateFolderMemberArg) (res *MemberA
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3252,7 +3252,7 @@ func (dbx *apiImpl) UpdateFolderPolicy(arg *UpdateFolderPolicyArg) (res *SharedF
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3266,7 +3266,7 @@ func (dbx *apiImpl) UpdateFolderPolicy(arg *UpdateFolderPolicyArg) (res *SharedF
}
// New returns a Client implementation for this namespace
func New(c dropbox.Config) *apiImpl {
func New(c dropbox.Config) Client {
ctx := apiImpl(dropbox.NewContext(c))
return &ctx
}

View File

@ -2976,6 +2976,7 @@ const (
RemoveFolderMemberErrorGroupAccess = "group_access"
RemoveFolderMemberErrorTeamFolder = "team_folder"
RemoveFolderMemberErrorNoPermission = "no_permission"
RemoveFolderMemberErrorTooManyFiles = "too_many_files"
RemoveFolderMemberErrorOther = "other"
)

View File

@ -118,6 +118,18 @@ type Client interface {
// LinkedAppsRevokeLinkedAppBatch : Revoke a list of linked applications of
// the team members.
LinkedAppsRevokeLinkedAppBatch(arg *RevokeLinkedApiAppBatchArg) (res *RevokeLinkedAppBatchResult, err error)
// MemberSpaceLimitsExcludedUsersAdd : Add users to member space limits
// excluded users list.
MemberSpaceLimitsExcludedUsersAdd(arg *ExcludedUsersUpdateArg) (res *ExcludedUsersUpdateResult, err error)
// MemberSpaceLimitsExcludedUsersList : List member space limits excluded
// users.
MemberSpaceLimitsExcludedUsersList(arg *ExcludedUsersListArg) (res *ExcludedUsersListResult, err error)
// MemberSpaceLimitsExcludedUsersListContinue : Continue listing member
// space limits excluded users.
MemberSpaceLimitsExcludedUsersListContinue(arg *ExcludedUsersListContinueArg) (res *ExcludedUsersListResult, err error)
// MemberSpaceLimitsExcludedUsersRemove : Remove users from member space
// limits excluded users list.
MemberSpaceLimitsExcludedUsersRemove(arg *ExcludedUsersUpdateArg) (res *ExcludedUsersUpdateResult, err error)
// MemberSpaceLimitsGetCustomQuota : Get users custom quota. Returns none as
// the custom quota if none was set. A maximum of 1000 members can be
// specified in a single call.
@ -126,7 +138,7 @@ type Client interface {
// of 1000 members can be specified in a single call.
MemberSpaceLimitsRemoveCustomQuota(arg *CustomQuotaUsersArg) (res []*RemoveCustomQuotaResult, err error)
// MemberSpaceLimitsSetCustomQuota : Set users custom quota. Custom quota
// has to be at least 25GB. A maximum of 1000 members can be specified in a
// has to be at least 15GB. A maximum of 1000 members can be specified in a
// single call.
MemberSpaceLimitsSetCustomQuota(arg *SetCustomQuotaArg) (res []*CustomQuotaResult, err error)
// MembersAdd : Adds members to a team. Permission : Team member management
@ -323,7 +335,7 @@ func (dbx *apiImpl) DevicesListMemberDevices(arg *ListMemberDevicesArg) (res *Li
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -392,7 +404,7 @@ func (dbx *apiImpl) DevicesListMembersDevices(arg *ListMembersDevicesArg) (res *
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -464,7 +476,7 @@ func (dbx *apiImpl) DevicesListTeamDevices(arg *ListTeamDevicesArg) (res *ListTe
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -528,7 +540,7 @@ func (dbx *apiImpl) DevicesRevokeDeviceSession(arg *RevokeDeviceSessionArg) (err
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -597,7 +609,7 @@ func (dbx *apiImpl) DevicesRevokeDeviceSessionBatch(arg *RevokeDeviceSessionBatc
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -666,7 +678,7 @@ func (dbx *apiImpl) FeaturesGetValues(arg *FeaturesGetValuesBatchArg) (res *Feat
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -727,7 +739,7 @@ func (dbx *apiImpl) GetInfo() (res *TeamGetInfoResult, err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -796,7 +808,7 @@ func (dbx *apiImpl) GroupsCreate(arg *GroupCreateArg) (res *GroupFullInfo, err e
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -865,7 +877,7 @@ func (dbx *apiImpl) GroupsDelete(arg *GroupSelector) (res *async.LaunchEmptyResu
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -934,7 +946,7 @@ func (dbx *apiImpl) GroupsGetInfo(arg *GroupsSelector) (res []*GroupsGetInfoItem
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1003,7 +1015,7 @@ func (dbx *apiImpl) GroupsJobStatusGet(arg *async.PollArg) (res *async.PollEmpty
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1072,7 +1084,7 @@ func (dbx *apiImpl) GroupsList(arg *GroupsListArg) (res *GroupsListResult, err e
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1141,7 +1153,7 @@ func (dbx *apiImpl) GroupsListContinue(arg *GroupsListContinueArg) (res *GroupsL
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1210,7 +1222,7 @@ func (dbx *apiImpl) GroupsMembersAdd(arg *GroupMembersAddArg) (res *GroupMembers
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1279,7 +1291,7 @@ func (dbx *apiImpl) GroupsMembersList(arg *GroupsMembersListArg) (res *GroupsMem
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1348,7 +1360,7 @@ func (dbx *apiImpl) GroupsMembersListContinue(arg *GroupsMembersListContinueArg)
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1417,7 +1429,7 @@ func (dbx *apiImpl) GroupsMembersRemove(arg *GroupMembersRemoveArg) (res *GroupM
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1486,7 +1498,7 @@ func (dbx *apiImpl) GroupsMembersSetAccessType(arg *GroupMembersSetAccessTypeArg
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1555,7 +1567,7 @@ func (dbx *apiImpl) GroupsUpdate(arg *GroupUpdateArgs) (res *GroupFullInfo, err
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1624,7 +1636,7 @@ func (dbx *apiImpl) LinkedAppsListMemberLinkedApps(arg *ListMemberAppsArg) (res
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1693,7 +1705,7 @@ func (dbx *apiImpl) LinkedAppsListMembersLinkedApps(arg *ListMembersAppsArg) (re
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1765,7 +1777,7 @@ func (dbx *apiImpl) LinkedAppsListTeamLinkedApps(arg *ListTeamAppsArg) (res *Lis
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1829,7 +1841,7 @@ func (dbx *apiImpl) LinkedAppsRevokeLinkedApp(arg *RevokeLinkedApiAppArg) (err e
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1898,7 +1910,283 @@ func (dbx *apiImpl) LinkedAppsRevokeLinkedAppBatch(arg *RevokeLinkedApiAppBatchA
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
}
err = json.Unmarshal(body, &apiError)
if err != nil {
return
}
err = apiError
return
}
//MemberSpaceLimitsExcludedUsersAddAPIError is an error-wrapper for the member_space_limits/excluded_users/add route
type MemberSpaceLimitsExcludedUsersAddAPIError struct {
dropbox.APIError
EndpointError *ExcludedUsersUpdateError `json:"error"`
}
func (dbx *apiImpl) MemberSpaceLimitsExcludedUsersAdd(arg *ExcludedUsersUpdateArg) (res *ExcludedUsersUpdateResult, err error) {
cli := dbx.Client
dbx.Config.LogDebug("arg: %v", arg)
b, err := json.Marshal(arg)
if err != nil {
return
}
headers := map[string]string{
"Content-Type": "application/json",
}
req, err := (*dropbox.Context)(dbx).NewRequest("api", "rpc", true, "team", "member_space_limits/excluded_users/add", headers, bytes.NewReader(b))
if err != nil {
return
}
dbx.Config.LogInfo("req: %v", req)
resp, err := cli.Do(req)
if err != nil {
return
}
dbx.Config.LogInfo("resp: %v", resp)
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return
}
dbx.Config.LogDebug("body: %v", body)
if resp.StatusCode == http.StatusOK {
err = json.Unmarshal(body, &res)
if err != nil {
return
}
return
}
if resp.StatusCode == http.StatusConflict {
var apiError MemberSpaceLimitsExcludedUsersAddAPIError
err = json.Unmarshal(body, &apiError)
if err != nil {
return
}
err = apiError
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
}
err = json.Unmarshal(body, &apiError)
if err != nil {
return
}
err = apiError
return
}
//MemberSpaceLimitsExcludedUsersListAPIError is an error-wrapper for the member_space_limits/excluded_users/list route
type MemberSpaceLimitsExcludedUsersListAPIError struct {
dropbox.APIError
EndpointError *ExcludedUsersListError `json:"error"`
}
func (dbx *apiImpl) MemberSpaceLimitsExcludedUsersList(arg *ExcludedUsersListArg) (res *ExcludedUsersListResult, err error) {
cli := dbx.Client
dbx.Config.LogDebug("arg: %v", arg)
b, err := json.Marshal(arg)
if err != nil {
return
}
headers := map[string]string{
"Content-Type": "application/json",
}
req, err := (*dropbox.Context)(dbx).NewRequest("api", "rpc", true, "team", "member_space_limits/excluded_users/list", headers, bytes.NewReader(b))
if err != nil {
return
}
dbx.Config.LogInfo("req: %v", req)
resp, err := cli.Do(req)
if err != nil {
return
}
dbx.Config.LogInfo("resp: %v", resp)
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return
}
dbx.Config.LogDebug("body: %v", body)
if resp.StatusCode == http.StatusOK {
err = json.Unmarshal(body, &res)
if err != nil {
return
}
return
}
if resp.StatusCode == http.StatusConflict {
var apiError MemberSpaceLimitsExcludedUsersListAPIError
err = json.Unmarshal(body, &apiError)
if err != nil {
return
}
err = apiError
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
}
err = json.Unmarshal(body, &apiError)
if err != nil {
return
}
err = apiError
return
}
//MemberSpaceLimitsExcludedUsersListContinueAPIError is an error-wrapper for the member_space_limits/excluded_users/list/continue route
type MemberSpaceLimitsExcludedUsersListContinueAPIError struct {
dropbox.APIError
EndpointError *ExcludedUsersListContinueError `json:"error"`
}
func (dbx *apiImpl) MemberSpaceLimitsExcludedUsersListContinue(arg *ExcludedUsersListContinueArg) (res *ExcludedUsersListResult, err error) {
cli := dbx.Client
dbx.Config.LogDebug("arg: %v", arg)
b, err := json.Marshal(arg)
if err != nil {
return
}
headers := map[string]string{
"Content-Type": "application/json",
}
req, err := (*dropbox.Context)(dbx).NewRequest("api", "rpc", true, "team", "member_space_limits/excluded_users/list/continue", headers, bytes.NewReader(b))
if err != nil {
return
}
dbx.Config.LogInfo("req: %v", req)
resp, err := cli.Do(req)
if err != nil {
return
}
dbx.Config.LogInfo("resp: %v", resp)
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return
}
dbx.Config.LogDebug("body: %v", body)
if resp.StatusCode == http.StatusOK {
err = json.Unmarshal(body, &res)
if err != nil {
return
}
return
}
if resp.StatusCode == http.StatusConflict {
var apiError MemberSpaceLimitsExcludedUsersListContinueAPIError
err = json.Unmarshal(body, &apiError)
if err != nil {
return
}
err = apiError
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
}
err = json.Unmarshal(body, &apiError)
if err != nil {
return
}
err = apiError
return
}
//MemberSpaceLimitsExcludedUsersRemoveAPIError is an error-wrapper for the member_space_limits/excluded_users/remove route
type MemberSpaceLimitsExcludedUsersRemoveAPIError struct {
dropbox.APIError
EndpointError *ExcludedUsersUpdateError `json:"error"`
}
func (dbx *apiImpl) MemberSpaceLimitsExcludedUsersRemove(arg *ExcludedUsersUpdateArg) (res *ExcludedUsersUpdateResult, err error) {
cli := dbx.Client
dbx.Config.LogDebug("arg: %v", arg)
b, err := json.Marshal(arg)
if err != nil {
return
}
headers := map[string]string{
"Content-Type": "application/json",
}
req, err := (*dropbox.Context)(dbx).NewRequest("api", "rpc", true, "team", "member_space_limits/excluded_users/remove", headers, bytes.NewReader(b))
if err != nil {
return
}
dbx.Config.LogInfo("req: %v", req)
resp, err := cli.Do(req)
if err != nil {
return
}
dbx.Config.LogInfo("resp: %v", resp)
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return
}
dbx.Config.LogDebug("body: %v", body)
if resp.StatusCode == http.StatusOK {
err = json.Unmarshal(body, &res)
if err != nil {
return
}
return
}
if resp.StatusCode == http.StatusConflict {
var apiError MemberSpaceLimitsExcludedUsersRemoveAPIError
err = json.Unmarshal(body, &apiError)
if err != nil {
return
}
err = apiError
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -1967,7 +2255,7 @@ func (dbx *apiImpl) MemberSpaceLimitsGetCustomQuota(arg *CustomQuotaUsersArg) (r
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2036,7 +2324,7 @@ func (dbx *apiImpl) MemberSpaceLimitsRemoveCustomQuota(arg *CustomQuotaUsersArg)
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2052,7 +2340,7 @@ func (dbx *apiImpl) MemberSpaceLimitsRemoveCustomQuota(arg *CustomQuotaUsersArg)
//MemberSpaceLimitsSetCustomQuotaAPIError is an error-wrapper for the member_space_limits/set_custom_quota route
type MemberSpaceLimitsSetCustomQuotaAPIError struct {
dropbox.APIError
EndpointError *CustomQuotaError `json:"error"`
EndpointError *SetCustomQuotaError `json:"error"`
}
func (dbx *apiImpl) MemberSpaceLimitsSetCustomQuota(arg *SetCustomQuotaArg) (res []*CustomQuotaResult, err error) {
@ -2105,7 +2393,7 @@ func (dbx *apiImpl) MemberSpaceLimitsSetCustomQuota(arg *SetCustomQuotaArg) (res
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2174,7 +2462,7 @@ func (dbx *apiImpl) MembersAdd(arg *MembersAddArg) (res *MembersAddLaunch, err e
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2243,7 +2531,7 @@ func (dbx *apiImpl) MembersAddJobStatusGet(arg *async.PollArg) (res *MembersAddJ
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2312,7 +2600,7 @@ func (dbx *apiImpl) MembersGetInfo(arg *MembersGetInfoArgs) (res []*MembersGetIn
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2381,7 +2669,7 @@ func (dbx *apiImpl) MembersList(arg *MembersListArg) (res *MembersListResult, er
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2450,7 +2738,7 @@ func (dbx *apiImpl) MembersListContinue(arg *MembersListContinueArg) (res *Membe
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2514,7 +2802,7 @@ func (dbx *apiImpl) MembersRecover(arg *MembersRecoverArg) (err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2583,7 +2871,7 @@ func (dbx *apiImpl) MembersRemove(arg *MembersRemoveArg) (res *async.LaunchEmpty
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2652,7 +2940,7 @@ func (dbx *apiImpl) MembersRemoveJobStatusGet(arg *async.PollArg) (res *async.Po
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2716,7 +3004,7 @@ func (dbx *apiImpl) MembersSendWelcomeEmail(arg *UserSelectorArg) (err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2785,7 +3073,7 @@ func (dbx *apiImpl) MembersSetAdminPermissions(arg *MembersSetPermissionsArg) (r
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2854,7 +3142,7 @@ func (dbx *apiImpl) MembersSetProfile(arg *MembersSetProfileArg) (res *TeamMembe
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2918,7 +3206,7 @@ func (dbx *apiImpl) MembersSuspend(arg *MembersDeactivateArg) (err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -2982,7 +3270,7 @@ func (dbx *apiImpl) MembersUnsuspend(arg *MembersUnsuspendArg) (err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3051,7 +3339,7 @@ func (dbx *apiImpl) NamespacesList(arg *TeamNamespacesListArg) (res *TeamNamespa
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3120,7 +3408,7 @@ func (dbx *apiImpl) NamespacesListContinue(arg *TeamNamespacesListContinueArg) (
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3191,7 +3479,7 @@ func (dbx *apiImpl) PropertiesTemplateAdd(arg *file_properties.AddTemplateArg) (
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3262,7 +3550,7 @@ func (dbx *apiImpl) PropertiesTemplateGet(arg *file_properties.GetTemplateArg) (
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3325,7 +3613,7 @@ func (dbx *apiImpl) PropertiesTemplateList() (res *file_properties.ListTemplateR
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3396,7 +3684,7 @@ func (dbx *apiImpl) PropertiesTemplateUpdate(arg *file_properties.UpdateTemplate
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3465,7 +3753,7 @@ func (dbx *apiImpl) ReportsGetActivity(arg *DateRange) (res *GetActivityReport,
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3534,7 +3822,7 @@ func (dbx *apiImpl) ReportsGetDevices(arg *DateRange) (res *GetDevicesReport, er
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3603,7 +3891,7 @@ func (dbx *apiImpl) ReportsGetMembership(arg *DateRange) (res *GetMembershipRepo
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3672,7 +3960,7 @@ func (dbx *apiImpl) ReportsGetStorage(arg *DateRange) (res *GetStorageReport, er
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3741,7 +4029,7 @@ func (dbx *apiImpl) TeamFolderActivate(arg *TeamFolderIdArg) (res *TeamFolderMet
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3810,7 +4098,7 @@ func (dbx *apiImpl) TeamFolderArchive(arg *TeamFolderArchiveArg) (res *TeamFolde
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3879,7 +4167,7 @@ func (dbx *apiImpl) TeamFolderArchiveCheck(arg *async.PollArg) (res *TeamFolderA
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -3948,7 +4236,7 @@ func (dbx *apiImpl) TeamFolderCreate(arg *TeamFolderCreateArg) (res *TeamFolderM
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -4017,7 +4305,7 @@ func (dbx *apiImpl) TeamFolderGetInfo(arg *TeamFolderIdListArg) (res []*TeamFold
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -4086,7 +4374,7 @@ func (dbx *apiImpl) TeamFolderList(arg *TeamFolderListArg) (res *TeamFolderListR
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -4155,7 +4443,7 @@ func (dbx *apiImpl) TeamFolderListContinue(arg *TeamFolderListContinueArg) (res
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -4219,7 +4507,7 @@ func (dbx *apiImpl) TeamFolderPermanentlyDelete(arg *TeamFolderIdArg) (err error
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -4288,7 +4576,7 @@ func (dbx *apiImpl) TeamFolderRename(arg *TeamFolderRenameArg) (res *TeamFolderM
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -4349,7 +4637,7 @@ func (dbx *apiImpl) TokenGetAuthenticatedAdmin() (res *TokenGetAuthenticatedAdmi
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -4363,7 +4651,7 @@ func (dbx *apiImpl) TokenGetAuthenticatedAdmin() (res *TokenGetAuthenticatedAdmi
}
// New returns a Client implementation for this namespace
func New(c dropbox.Config) *apiImpl {
func New(c dropbox.Config) Client {
ctx := apiImpl(dropbox.NewContext(c))
return &ctx
}

View File

@ -187,7 +187,7 @@ func (u *BaseTeamFolderError) UnmarshalJSON(body []byte) error {
return nil
}
// CustomQuotaError : Error returned by setting member custom quota.
// CustomQuotaError : Error returned when getting member custom quota.
type CustomQuotaError struct {
dropbox.Tagged
}
@ -377,6 +377,126 @@ func NewDevicesActive(Windows []uint64, Macos []uint64, Linux []uint64, Ios []ui
return s
}
// ExcludedUsersListArg : Excluded users list argument.
type ExcludedUsersListArg struct {
// Limit : Number of results to return per call.
Limit uint32 `json:"limit"`
}
// NewExcludedUsersListArg returns a new ExcludedUsersListArg instance
func NewExcludedUsersListArg() *ExcludedUsersListArg {
s := new(ExcludedUsersListArg)
s.Limit = 1000
return s
}
// ExcludedUsersListContinueArg : Excluded users list continue argument.
type ExcludedUsersListContinueArg struct {
// Cursor : Indicates from what point to get the next set of users.
Cursor string `json:"cursor"`
}
// NewExcludedUsersListContinueArg returns a new ExcludedUsersListContinueArg instance
func NewExcludedUsersListContinueArg(Cursor string) *ExcludedUsersListContinueArg {
s := new(ExcludedUsersListContinueArg)
s.Cursor = Cursor
return s
}
// ExcludedUsersListContinueError : Excluded users list continue error.
type ExcludedUsersListContinueError struct {
dropbox.Tagged
}
// Valid tag values for ExcludedUsersListContinueError
const (
ExcludedUsersListContinueErrorInvalidCursor = "invalid_cursor"
ExcludedUsersListContinueErrorOther = "other"
)
// ExcludedUsersListError : Excluded users list error.
type ExcludedUsersListError struct {
dropbox.Tagged
}
// Valid tag values for ExcludedUsersListError
const (
ExcludedUsersListErrorListError = "list_error"
ExcludedUsersListErrorOther = "other"
)
// ExcludedUsersListResult : Excluded users list result.
type ExcludedUsersListResult struct {
// Users : has no documentation (yet)
Users []*MemberProfile `json:"users"`
// Cursor : Pass the cursor into
// `memberSpaceLimitsExcludedUsersListContinue` to obtain additional
// excluded users.
Cursor string `json:"cursor,omitempty"`
// HasMore : Is true if there are additional excluded users that have not
// been returned yet. An additional call to
// `memberSpaceLimitsExcludedUsersListContinue` can retrieve them.
HasMore bool `json:"has_more"`
}
// NewExcludedUsersListResult returns a new ExcludedUsersListResult instance
func NewExcludedUsersListResult(Users []*MemberProfile, HasMore bool) *ExcludedUsersListResult {
s := new(ExcludedUsersListResult)
s.Users = Users
s.HasMore = HasMore
return s
}
// ExcludedUsersUpdateArg : Argument of excluded users update operation. Should
// include a list of users to add/remove (according to endpoint), Maximum size
// of the list is 1000 users.
type ExcludedUsersUpdateArg struct {
// Users : List of users to be added/removed.
Users []*UserSelectorArg `json:"users,omitempty"`
}
// NewExcludedUsersUpdateArg returns a new ExcludedUsersUpdateArg instance
func NewExcludedUsersUpdateArg() *ExcludedUsersUpdateArg {
s := new(ExcludedUsersUpdateArg)
return s
}
// ExcludedUsersUpdateError : Excluded users update error.
type ExcludedUsersUpdateError struct {
dropbox.Tagged
}
// Valid tag values for ExcludedUsersUpdateError
const (
ExcludedUsersUpdateErrorUsersNotInTeam = "users_not_in_team"
ExcludedUsersUpdateErrorTooManyUsers = "too_many_users"
ExcludedUsersUpdateErrorOther = "other"
)
// ExcludedUsersUpdateResult : Excluded users update result.
type ExcludedUsersUpdateResult struct {
// Status : Update status.
Status *ExcludedUsersUpdateStatus `json:"status"`
}
// NewExcludedUsersUpdateResult returns a new ExcludedUsersUpdateResult instance
func NewExcludedUsersUpdateResult(Status *ExcludedUsersUpdateStatus) *ExcludedUsersUpdateResult {
s := new(ExcludedUsersUpdateResult)
s.Status = Status
return s
}
// ExcludedUsersUpdateStatus : Excluded users update operation status.
type ExcludedUsersUpdateStatus struct {
dropbox.Tagged
}
// Valid tag values for ExcludedUsersUpdateStatus
const (
ExcludedUsersUpdateStatusSuccess = "success"
ExcludedUsersUpdateStatusOther = "other"
)
// Feature : A set of features that Dropbox for Business account support.
type Feature struct {
dropbox.Tagged
@ -386,6 +506,7 @@ type Feature struct {
const (
FeatureUploadApiRateLimit = "upload_api_rate_limit"
FeatureHasTeamSharedDropbox = "has_team_shared_dropbox"
FeatureHasTeamFileEvents = "has_team_file_events"
FeatureOther = "other"
)
@ -397,12 +518,15 @@ type FeatureValue struct {
UploadApiRateLimit *UploadApiRateLimitValue `json:"upload_api_rate_limit,omitempty"`
// HasTeamSharedDropbox : has no documentation (yet)
HasTeamSharedDropbox *HasTeamSharedDropboxValue `json:"has_team_shared_dropbox,omitempty"`
// HasTeamFileEvents : has no documentation (yet)
HasTeamFileEvents *HasTeamFileEventsValue `json:"has_team_file_events,omitempty"`
}
// Valid tag values for FeatureValue
const (
FeatureValueUploadApiRateLimit = "upload_api_rate_limit"
FeatureValueHasTeamSharedDropbox = "has_team_shared_dropbox"
FeatureValueHasTeamFileEvents = "has_team_file_events"
FeatureValueOther = "other"
)
@ -414,6 +538,8 @@ func (u *FeatureValue) UnmarshalJSON(body []byte) error {
UploadApiRateLimit json.RawMessage `json:"upload_api_rate_limit,omitempty"`
// HasTeamSharedDropbox : has no documentation (yet)
HasTeamSharedDropbox json.RawMessage `json:"has_team_shared_dropbox,omitempty"`
// HasTeamFileEvents : has no documentation (yet)
HasTeamFileEvents json.RawMessage `json:"has_team_file_events,omitempty"`
}
var w wrap
var err error
@ -431,6 +557,12 @@ func (u *FeatureValue) UnmarshalJSON(body []byte) error {
case "has_team_shared_dropbox":
err = json.Unmarshal(w.HasTeamSharedDropbox, &u.HasTeamSharedDropbox)
if err != nil {
return err
}
case "has_team_file_events":
err = json.Unmarshal(w.HasTeamFileEvents, &u.HasTeamFileEvents)
if err != nil {
return err
}
@ -1364,6 +1496,41 @@ func (u *GroupsSelector) UnmarshalJSON(body []byte) error {
return nil
}
// HasTeamFileEventsValue : The value for `Feature.has_team_file_events`.
type HasTeamFileEventsValue struct {
dropbox.Tagged
// Enabled : Does this team have file events.
Enabled bool `json:"enabled,omitempty"`
}
// Valid tag values for HasTeamFileEventsValue
const (
HasTeamFileEventsValueEnabled = "enabled"
HasTeamFileEventsValueOther = "other"
)
// UnmarshalJSON deserializes into a HasTeamFileEventsValue instance
func (u *HasTeamFileEventsValue) UnmarshalJSON(body []byte) error {
type wrap struct {
dropbox.Tagged
}
var w wrap
var err error
if err = json.Unmarshal(body, &w); err != nil {
return err
}
u.Tag = w.Tag
switch u.Tag {
case "enabled":
err = json.Unmarshal(body, &u.Enabled)
if err != nil {
return err
}
}
return nil
}
// HasTeamSharedDropboxValue : The value for `Feature.has_team_shared_dropbox`.
type HasTeamSharedDropboxValue struct {
dropbox.Tagged
@ -2869,6 +3036,18 @@ func NewSetCustomQuotaArg(UsersAndQuotas []*UserCustomQuotaArg) *SetCustomQuotaA
return s
}
// SetCustomQuotaError : Error returned when setting member custom quota.
type SetCustomQuotaError struct {
dropbox.Tagged
}
// Valid tag values for SetCustomQuotaError
const (
SetCustomQuotaErrorTooManyUsers = "too_many_users"
SetCustomQuotaErrorOther = "other"
SetCustomQuotaErrorSomeUsersAreExcluded = "some_users_are_excluded"
)
// StorageBucket : Describes the number of users in a specific storage bucket.
type StorageBucket struct {
// Bucket : The name of the storage bucket. For example, '1G' is a bucket of

View File

@ -96,7 +96,7 @@ func (dbx *apiImpl) GetEvents(arg *GetTeamEventsArg) (res *GetTeamEventsResult,
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -165,7 +165,7 @@ func (dbx *apiImpl) GetEventsContinue(arg *GetTeamEventsContinueArg) (res *GetTe
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -179,7 +179,7 @@ func (dbx *apiImpl) GetEventsContinue(arg *GetTeamEventsContinueArg) (res *GetTe
}
// New returns a Client implementation for this namespace
func New(c dropbox.Config) *apiImpl {
func New(c dropbox.Config) Client {
ctx := apiImpl(dropbox.NewContext(c))
return &ctx
}

View File

@ -554,11 +554,11 @@ type Certificate struct {
// Sha1Fingerprint : Certificate sha1 fingerprint.
Sha1Fingerprint string `json:"sha1_fingerprint"`
// CommonName : Certificate common name.
CommonName string `json:"common_name"`
CommonName string `json:"common_name,omitempty"`
}
// NewCertificate returns a new Certificate instance
func NewCertificate(Subject string, Issuer string, IssueDate string, ExpirationDate string, SerialNumber string, Sha1Fingerprint string, CommonName string) *Certificate {
func NewCertificate(Subject string, Issuer string, IssueDate string, ExpirationDate string, SerialNumber string, Sha1Fingerprint string) *Certificate {
s := new(Certificate)
s.Subject = Subject
s.Issuer = Issuer
@ -566,7 +566,6 @@ func NewCertificate(Subject string, Issuer string, IssueDate string, ExpirationD
s.ExpirationDate = ExpirationDate
s.SerialNumber = SerialNumber
s.Sha1Fingerprint = Sha1Fingerprint
s.CommonName = CommonName
return s
}
@ -1286,13 +1285,16 @@ func NewEmmCreateUsageReportDetails() *EmmCreateUsageReportDetails {
return s
}
// EmmLoginSuccessDetails : Signed in using the Dropbox EMM app.
type EmmLoginSuccessDetails struct {
// EmmErrorDetails : Failed to sign in via EMM.
type EmmErrorDetails struct {
// ErrorDetails : Error details.
ErrorDetails *FailureDetailsLogInfo `json:"error_details"`
}
// NewEmmLoginSuccessDetails returns a new EmmLoginSuccessDetails instance
func NewEmmLoginSuccessDetails() *EmmLoginSuccessDetails {
s := new(EmmLoginSuccessDetails)
// NewEmmErrorDetails returns a new EmmErrorDetails instance
func NewEmmErrorDetails(ErrorDetails *FailureDetailsLogInfo) *EmmErrorDetails {
s := new(EmmErrorDetails)
s.ErrorDetails = ErrorDetails
return s
}
@ -1534,10 +1536,10 @@ type EventDetails struct {
FileSaveCopyReferenceDetails *FileSaveCopyReferenceDetails `json:"file_save_copy_reference_details,omitempty"`
// FileRequestAddDeadlineDetails : Added a deadline to a file request.
FileRequestAddDeadlineDetails *FileRequestAddDeadlineDetails `json:"file_request_add_deadline_details,omitempty"`
// FileRequestChangeDetails : Change a file request.
FileRequestChangeDetails *FileRequestChangeDetails `json:"file_request_change_details,omitempty"`
// FileRequestChangeFolderDetails : Changed the file request folder.
FileRequestChangeFolderDetails *FileRequestChangeFolderDetails `json:"file_request_change_folder_details,omitempty"`
// FileRequestChangeTitleDetails : Change the file request title.
FileRequestChangeTitleDetails *FileRequestChangeTitleDetails `json:"file_request_change_title_details,omitempty"`
// FileRequestCloseDetails : Closed a file request.
FileRequestCloseDetails *FileRequestCloseDetails `json:"file_request_close_details,omitempty"`
// FileRequestCreateDetails : Created a file request.
@ -1571,14 +1573,14 @@ type EventDetails struct {
GroupRemoveMemberDetails *GroupRemoveMemberDetails `json:"group_remove_member_details,omitempty"`
// GroupRenameDetails : Renamed a group.
GroupRenameDetails *GroupRenameDetails `json:"group_rename_details,omitempty"`
// EmmLoginSuccessDetails : Signed in using the Dropbox EMM app.
EmmLoginSuccessDetails *EmmLoginSuccessDetails `json:"emm_login_success_details,omitempty"`
// EmmErrorDetails : Failed to sign in via EMM.
EmmErrorDetails *EmmErrorDetails `json:"emm_error_details,omitempty"`
// LoginFailDetails : Failed to sign in.
LoginFailDetails *LoginFailDetails `json:"login_fail_details,omitempty"`
// LoginSuccessDetails : Signed in.
LoginSuccessDetails *LoginSuccessDetails `json:"login_success_details,omitempty"`
// LogoutDetails : Signed out.
LogoutDetails *LogoutDetails `json:"logout_details,omitempty"`
// PasswordLoginFailDetails : Failed to sign in using a password.
PasswordLoginFailDetails *PasswordLoginFailDetails `json:"password_login_fail_details,omitempty"`
// PasswordLoginSuccessDetails : Signed in using a password.
PasswordLoginSuccessDetails *PasswordLoginSuccessDetails `json:"password_login_success_details,omitempty"`
// ResellerSupportSessionEndDetails : Ended reseller support session.
ResellerSupportSessionEndDetails *ResellerSupportSessionEndDetails `json:"reseller_support_session_end_details,omitempty"`
// ResellerSupportSessionStartDetails : Started reseller support session.
@ -1587,8 +1589,8 @@ type EventDetails struct {
SignInAsSessionEndDetails *SignInAsSessionEndDetails `json:"sign_in_as_session_end_details,omitempty"`
// SignInAsSessionStartDetails : Started admin sign-in-as session.
SignInAsSessionStartDetails *SignInAsSessionStartDetails `json:"sign_in_as_session_start_details,omitempty"`
// SsoLoginFailDetails : Failed to sign in using SSO.
SsoLoginFailDetails *SsoLoginFailDetails `json:"sso_login_fail_details,omitempty"`
// SsoErrorDetails : Failed to sign in via SSO.
SsoErrorDetails *SsoErrorDetails `json:"sso_error_details,omitempty"`
// MemberAddNameDetails : Set team member name when joining team.
MemberAddNameDetails *MemberAddNameDetails `json:"member_add_name_details,omitempty"`
// MemberChangeAdminRoleDetails : Change the admin role belonging to team
@ -1951,8 +1953,8 @@ type EventDetails struct {
// MemberSpaceLimitsAddExceptionDetails : Added an exception for one or more
// team members to bypass space limits imposed by policy.
MemberSpaceLimitsAddExceptionDetails *MemberSpaceLimitsAddExceptionDetails `json:"member_space_limits_add_exception_details,omitempty"`
// MemberSpaceLimitsChangePolicyDetails : Changed the storage limits applied
// to team members by policy.
// MemberSpaceLimitsChangePolicyDetails : Changed the team default limit
// level.
MemberSpaceLimitsChangePolicyDetails *MemberSpaceLimitsChangePolicyDetails `json:"member_space_limits_change_policy_details,omitempty"`
// MemberSpaceLimitsRemoveExceptionDetails : Removed an exception for one or
// more team members to bypass space limits imposed by policy.
@ -2120,8 +2122,8 @@ const (
EventDetailsFileRollbackChangesDetails = "file_rollback_changes_details"
EventDetailsFileSaveCopyReferenceDetails = "file_save_copy_reference_details"
EventDetailsFileRequestAddDeadlineDetails = "file_request_add_deadline_details"
EventDetailsFileRequestChangeDetails = "file_request_change_details"
EventDetailsFileRequestChangeFolderDetails = "file_request_change_folder_details"
EventDetailsFileRequestChangeTitleDetails = "file_request_change_title_details"
EventDetailsFileRequestCloseDetails = "file_request_close_details"
EventDetailsFileRequestCreateDetails = "file_request_create_details"
EventDetailsFileRequestReceiveFileDetails = "file_request_receive_file_details"
@ -2138,15 +2140,15 @@ const (
EventDetailsGroupRemoveExternalIdDetails = "group_remove_external_id_details"
EventDetailsGroupRemoveMemberDetails = "group_remove_member_details"
EventDetailsGroupRenameDetails = "group_rename_details"
EventDetailsEmmLoginSuccessDetails = "emm_login_success_details"
EventDetailsEmmErrorDetails = "emm_error_details"
EventDetailsLoginFailDetails = "login_fail_details"
EventDetailsLoginSuccessDetails = "login_success_details"
EventDetailsLogoutDetails = "logout_details"
EventDetailsPasswordLoginFailDetails = "password_login_fail_details"
EventDetailsPasswordLoginSuccessDetails = "password_login_success_details"
EventDetailsResellerSupportSessionEndDetails = "reseller_support_session_end_details"
EventDetailsResellerSupportSessionStartDetails = "reseller_support_session_start_details"
EventDetailsSignInAsSessionEndDetails = "sign_in_as_session_end_details"
EventDetailsSignInAsSessionStartDetails = "sign_in_as_session_start_details"
EventDetailsSsoLoginFailDetails = "sso_login_fail_details"
EventDetailsSsoErrorDetails = "sso_error_details"
EventDetailsMemberAddNameDetails = "member_add_name_details"
EventDetailsMemberChangeAdminRoleDetails = "member_change_admin_role_details"
EventDetailsMemberChangeEmailDetails = "member_change_email_details"
@ -2498,10 +2500,10 @@ func (u *EventDetails) UnmarshalJSON(body []byte) error {
FileSaveCopyReferenceDetails json.RawMessage `json:"file_save_copy_reference_details,omitempty"`
// FileRequestAddDeadlineDetails : Added a deadline to a file request.
FileRequestAddDeadlineDetails json.RawMessage `json:"file_request_add_deadline_details,omitempty"`
// FileRequestChangeDetails : Change a file request.
FileRequestChangeDetails json.RawMessage `json:"file_request_change_details,omitempty"`
// FileRequestChangeFolderDetails : Changed the file request folder.
FileRequestChangeFolderDetails json.RawMessage `json:"file_request_change_folder_details,omitempty"`
// FileRequestChangeTitleDetails : Change the file request title.
FileRequestChangeTitleDetails json.RawMessage `json:"file_request_change_title_details,omitempty"`
// FileRequestCloseDetails : Closed a file request.
FileRequestCloseDetails json.RawMessage `json:"file_request_close_details,omitempty"`
// FileRequestCreateDetails : Created a file request.
@ -2535,14 +2537,14 @@ func (u *EventDetails) UnmarshalJSON(body []byte) error {
GroupRemoveMemberDetails json.RawMessage `json:"group_remove_member_details,omitempty"`
// GroupRenameDetails : Renamed a group.
GroupRenameDetails json.RawMessage `json:"group_rename_details,omitempty"`
// EmmLoginSuccessDetails : Signed in using the Dropbox EMM app.
EmmLoginSuccessDetails json.RawMessage `json:"emm_login_success_details,omitempty"`
// EmmErrorDetails : Failed to sign in via EMM.
EmmErrorDetails json.RawMessage `json:"emm_error_details,omitempty"`
// LoginFailDetails : Failed to sign in.
LoginFailDetails json.RawMessage `json:"login_fail_details,omitempty"`
// LoginSuccessDetails : Signed in.
LoginSuccessDetails json.RawMessage `json:"login_success_details,omitempty"`
// LogoutDetails : Signed out.
LogoutDetails json.RawMessage `json:"logout_details,omitempty"`
// PasswordLoginFailDetails : Failed to sign in using a password.
PasswordLoginFailDetails json.RawMessage `json:"password_login_fail_details,omitempty"`
// PasswordLoginSuccessDetails : Signed in using a password.
PasswordLoginSuccessDetails json.RawMessage `json:"password_login_success_details,omitempty"`
// ResellerSupportSessionEndDetails : Ended reseller support session.
ResellerSupportSessionEndDetails json.RawMessage `json:"reseller_support_session_end_details,omitempty"`
// ResellerSupportSessionStartDetails : Started reseller support
@ -2552,8 +2554,8 @@ func (u *EventDetails) UnmarshalJSON(body []byte) error {
SignInAsSessionEndDetails json.RawMessage `json:"sign_in_as_session_end_details,omitempty"`
// SignInAsSessionStartDetails : Started admin sign-in-as session.
SignInAsSessionStartDetails json.RawMessage `json:"sign_in_as_session_start_details,omitempty"`
// SsoLoginFailDetails : Failed to sign in using SSO.
SsoLoginFailDetails json.RawMessage `json:"sso_login_fail_details,omitempty"`
// SsoErrorDetails : Failed to sign in via SSO.
SsoErrorDetails json.RawMessage `json:"sso_error_details,omitempty"`
// MemberAddNameDetails : Set team member name when joining team.
MemberAddNameDetails json.RawMessage `json:"member_add_name_details,omitempty"`
// MemberChangeAdminRoleDetails : Change the admin role belonging to
@ -2927,8 +2929,8 @@ func (u *EventDetails) UnmarshalJSON(body []byte) error {
// MemberSpaceLimitsAddExceptionDetails : Added an exception for one or
// more team members to bypass space limits imposed by policy.
MemberSpaceLimitsAddExceptionDetails json.RawMessage `json:"member_space_limits_add_exception_details,omitempty"`
// MemberSpaceLimitsChangePolicyDetails : Changed the storage limits
// applied to team members by policy.
// MemberSpaceLimitsChangePolicyDetails : Changed the team default limit
// level.
MemberSpaceLimitsChangePolicyDetails json.RawMessage `json:"member_space_limits_change_policy_details,omitempty"`
// MemberSpaceLimitsRemoveExceptionDetails : Removed an exception for
// one or more team members to bypass space limits imposed by policy.
@ -3429,14 +3431,14 @@ func (u *EventDetails) UnmarshalJSON(body []byte) error {
if err != nil {
return err
}
case "file_request_change_folder_details":
err = json.Unmarshal(body, &u.FileRequestChangeFolderDetails)
case "file_request_change_details":
err = json.Unmarshal(body, &u.FileRequestChangeDetails)
if err != nil {
return err
}
case "file_request_change_title_details":
err = json.Unmarshal(body, &u.FileRequestChangeTitleDetails)
case "file_request_change_folder_details":
err = json.Unmarshal(body, &u.FileRequestChangeFolderDetails)
if err != nil {
return err
@ -3537,8 +3539,20 @@ func (u *EventDetails) UnmarshalJSON(body []byte) error {
if err != nil {
return err
}
case "emm_login_success_details":
err = json.Unmarshal(body, &u.EmmLoginSuccessDetails)
case "emm_error_details":
err = json.Unmarshal(body, &u.EmmErrorDetails)
if err != nil {
return err
}
case "login_fail_details":
err = json.Unmarshal(body, &u.LoginFailDetails)
if err != nil {
return err
}
case "login_success_details":
err = json.Unmarshal(body, &u.LoginSuccessDetails)
if err != nil {
return err
@ -3546,18 +3560,6 @@ func (u *EventDetails) UnmarshalJSON(body []byte) error {
case "logout_details":
err = json.Unmarshal(body, &u.LogoutDetails)
if err != nil {
return err
}
case "password_login_fail_details":
err = json.Unmarshal(body, &u.PasswordLoginFailDetails)
if err != nil {
return err
}
case "password_login_success_details":
err = json.Unmarshal(body, &u.PasswordLoginSuccessDetails)
if err != nil {
return err
}
@ -3585,8 +3587,8 @@ func (u *EventDetails) UnmarshalJSON(body []byte) error {
if err != nil {
return err
}
case "sso_login_fail_details":
err = json.Unmarshal(body, &u.SsoLoginFailDetails)
case "sso_error_details":
err = json.Unmarshal(body, &u.SsoErrorDetails)
if err != nil {
return err
@ -4741,8 +4743,8 @@ const (
EventTypeFileRollbackChanges = "file_rollback_changes"
EventTypeFileSaveCopyReference = "file_save_copy_reference"
EventTypeFileRequestAddDeadline = "file_request_add_deadline"
EventTypeFileRequestChange = "file_request_change"
EventTypeFileRequestChangeFolder = "file_request_change_folder"
EventTypeFileRequestChangeTitle = "file_request_change_title"
EventTypeFileRequestClose = "file_request_close"
EventTypeFileRequestCreate = "file_request_create"
EventTypeFileRequestReceiveFile = "file_request_receive_file"
@ -4759,15 +4761,15 @@ const (
EventTypeGroupRemoveExternalId = "group_remove_external_id"
EventTypeGroupRemoveMember = "group_remove_member"
EventTypeGroupRename = "group_rename"
EventTypeEmmLoginSuccess = "emm_login_success"
EventTypeEmmError = "emm_error"
EventTypeLoginFail = "login_fail"
EventTypeLoginSuccess = "login_success"
EventTypeLogout = "logout"
EventTypePasswordLoginFail = "password_login_fail"
EventTypePasswordLoginSuccess = "password_login_success"
EventTypeResellerSupportSessionEnd = "reseller_support_session_end"
EventTypeResellerSupportSessionStart = "reseller_support_session_start"
EventTypeSignInAsSessionEnd = "sign_in_as_session_end"
EventTypeSignInAsSessionStart = "sign_in_as_session_start"
EventTypeSsoLoginFail = "sso_login_fail"
EventTypeSsoError = "sso_error"
EventTypeMemberAddName = "member_add_name"
EventTypeMemberChangeAdminRole = "member_change_admin_role"
EventTypeMemberChangeEmail = "member_change_email"
@ -4997,16 +4999,13 @@ func NewFailureDetailsLogInfo() *FailureDetailsLogInfo {
// FileAddCommentDetails : Added a file comment.
type FileAddCommentDetails struct {
// TargetAssetIndex : Target asset position in the Assets list.
TargetAssetIndex uint64 `json:"target_asset_index"`
// CommentText : Comment text. Might be missing due to historical data gap.
CommentText string `json:"comment_text,omitempty"`
}
// NewFileAddCommentDetails returns a new FileAddCommentDetails instance
func NewFileAddCommentDetails(TargetAssetIndex uint64) *FileAddCommentDetails {
func NewFileAddCommentDetails() *FileAddCommentDetails {
s := new(FileAddCommentDetails)
s.TargetAssetIndex = TargetAssetIndex
return s
}
@ -5023,8 +5022,6 @@ func NewFileAddDetails() *FileAddDetails {
// FileChangeCommentSubscriptionDetails : Subscribed to or unsubscribed from
// comment notifications for file.
type FileChangeCommentSubscriptionDetails struct {
// TargetAssetIndex : Target asset position in the Assets list.
TargetAssetIndex uint64 `json:"target_asset_index"`
// NewValue : New file comment subscription.
NewValue *FileCommentNotificationPolicy `json:"new_value"`
// PreviousValue : Previous file comment subscription. Might be missing due
@ -5033,9 +5030,8 @@ type FileChangeCommentSubscriptionDetails struct {
}
// NewFileChangeCommentSubscriptionDetails returns a new FileChangeCommentSubscriptionDetails instance
func NewFileChangeCommentSubscriptionDetails(TargetAssetIndex uint64, NewValue *FileCommentNotificationPolicy) *FileChangeCommentSubscriptionDetails {
func NewFileChangeCommentSubscriptionDetails(NewValue *FileCommentNotificationPolicy) *FileChangeCommentSubscriptionDetails {
s := new(FileChangeCommentSubscriptionDetails)
s.TargetAssetIndex = TargetAssetIndex
s.NewValue = NewValue
return s
}
@ -5096,16 +5092,13 @@ func NewFileCopyDetails(RelocateActionDetails []*RelocateAssetReferencesLogInfo)
// FileDeleteCommentDetails : Deleted a file comment.
type FileDeleteCommentDetails struct {
// TargetAssetIndex : Target asset position in the Assets list.
TargetAssetIndex uint64 `json:"target_asset_index"`
// CommentText : Comment text. Might be missing due to historical data gap.
CommentText string `json:"comment_text,omitempty"`
}
// NewFileDeleteCommentDetails returns a new FileDeleteCommentDetails instance
func NewFileDeleteCommentDetails(TargetAssetIndex uint64) *FileDeleteCommentDetails {
func NewFileDeleteCommentDetails() *FileDeleteCommentDetails {
s := new(FileDeleteCommentDetails)
s.TargetAssetIndex = TargetAssetIndex
return s
}
@ -5151,16 +5144,13 @@ func NewFileGetCopyReferenceDetails() *FileGetCopyReferenceDetails {
// FileLikeCommentDetails : Liked a file comment.
type FileLikeCommentDetails struct {
// TargetAssetIndex : Target asset position in the Assets list.
TargetAssetIndex uint64 `json:"target_asset_index"`
// CommentText : Comment text. Might be missing due to historical data gap.
CommentText string `json:"comment_text,omitempty"`
}
// NewFileLikeCommentDetails returns a new FileLikeCommentDetails instance
func NewFileLikeCommentDetails(TargetAssetIndex uint64) *FileLikeCommentDetails {
func NewFileLikeCommentDetails() *FileLikeCommentDetails {
s := new(FileLikeCommentDetails)
s.TargetAssetIndex = TargetAssetIndex
return s
}
@ -5241,6 +5231,9 @@ func NewFileRenameDetails(RelocateActionDetails []*RelocateAssetReferencesLogInf
// FileRequestAddDeadlineDetails : Added a deadline to a file request.
type FileRequestAddDeadlineDetails struct {
// FileRequestId : File request id. Might be missing due to historical data
// gap.
FileRequestId string `json:"file_request_id,omitempty"`
// RequestTitle : File request title.
RequestTitle string `json:"request_title,omitempty"`
}
@ -5251,8 +5244,30 @@ func NewFileRequestAddDeadlineDetails() *FileRequestAddDeadlineDetails {
return s
}
// FileRequestChangeDetails : Change a file request.
type FileRequestChangeDetails struct {
// FileRequestId : File request id. Might be missing due to historical data
// gap.
FileRequestId string `json:"file_request_id,omitempty"`
// PreviousDetails : Previous file request details. Might be missing due to
// historical data gap.
PreviousDetails *FileRequestDetails `json:"previous_details,omitempty"`
// NewDetails : New file request details.
NewDetails *FileRequestDetails `json:"new_details"`
}
// NewFileRequestChangeDetails returns a new FileRequestChangeDetails instance
func NewFileRequestChangeDetails(NewDetails *FileRequestDetails) *FileRequestChangeDetails {
s := new(FileRequestChangeDetails)
s.NewDetails = NewDetails
return s
}
// FileRequestChangeFolderDetails : Changed the file request folder.
type FileRequestChangeFolderDetails struct {
// FileRequestId : File request id. Might be missing due to historical data
// gap.
FileRequestId string `json:"file_request_id,omitempty"`
// RequestTitle : File request title.
RequestTitle string `json:"request_title,omitempty"`
}
@ -5263,22 +5278,14 @@ func NewFileRequestChangeFolderDetails() *FileRequestChangeFolderDetails {
return s
}
// FileRequestChangeTitleDetails : Change the file request title.
type FileRequestChangeTitleDetails struct {
// RequestTitle : File request title.
RequestTitle string `json:"request_title,omitempty"`
}
// NewFileRequestChangeTitleDetails returns a new FileRequestChangeTitleDetails instance
func NewFileRequestChangeTitleDetails() *FileRequestChangeTitleDetails {
s := new(FileRequestChangeTitleDetails)
return s
}
// FileRequestCloseDetails : Closed a file request.
type FileRequestCloseDetails struct {
// RequestTitle : File request title.
RequestTitle string `json:"request_title,omitempty"`
// FileRequestId : File request id. Might be missing due to historical data
// gap.
FileRequestId string `json:"file_request_id,omitempty"`
// PreviousDetails : Previous file request details. Might be missing due to
// historical data gap.
PreviousDetails *FileRequestDetails `json:"previous_details,omitempty"`
}
// NewFileRequestCloseDetails returns a new FileRequestCloseDetails instance
@ -5289,8 +5296,12 @@ func NewFileRequestCloseDetails() *FileRequestCloseDetails {
// FileRequestCreateDetails : Created a file request.
type FileRequestCreateDetails struct {
// RequestTitle : File request title.
RequestTitle string `json:"request_title,omitempty"`
// FileRequestId : File request id. Might be missing due to historical data
// gap.
FileRequestId string `json:"file_request_id,omitempty"`
// RequestDetails : File request details. Might be missing due to historical
// data gap.
RequestDetails *FileRequestDetails `json:"request_details,omitempty"`
}
// NewFileRequestCreateDetails returns a new FileRequestCreateDetails instance
@ -5299,8 +5310,29 @@ func NewFileRequestCreateDetails() *FileRequestCreateDetails {
return s
}
// FileRequestDetails : File request details
type FileRequestDetails struct {
// RequestTitle : File request title.
RequestTitle string `json:"request_title,omitempty"`
// AssetIndex : Asset position in the Assets list.
AssetIndex uint64 `json:"asset_index"`
// Deadline : File request deadline. Might be missing due to historical data
// gap.
Deadline time.Time `json:"deadline,omitempty"`
}
// NewFileRequestDetails returns a new FileRequestDetails instance
func NewFileRequestDetails(AssetIndex uint64) *FileRequestDetails {
s := new(FileRequestDetails)
s.AssetIndex = AssetIndex
return s
}
// FileRequestReceiveFileDetails : Received files for a file request.
type FileRequestReceiveFileDetails struct {
// FileRequestId : File request id. Might be missing due to historical data
// gap.
FileRequestId string `json:"file_request_id,omitempty"`
// RequestTitle : File request title.
RequestTitle string `json:"request_title,omitempty"`
// SubmittedFileNames : Submitted file names.
@ -5316,6 +5348,9 @@ func NewFileRequestReceiveFileDetails(SubmittedFileNames []string) *FileRequestR
// FileRequestRemoveDeadlineDetails : Removed the file request deadline.
type FileRequestRemoveDeadlineDetails struct {
// FileRequestId : File request id. Might be missing due to historical data
// gap.
FileRequestId string `json:"file_request_id,omitempty"`
// RequestTitle : File request title.
RequestTitle string `json:"request_title,omitempty"`
}
@ -5328,6 +5363,9 @@ func NewFileRequestRemoveDeadlineDetails() *FileRequestRemoveDeadlineDetails {
// FileRequestSendDetails : Sent file request to users via email.
type FileRequestSendDetails struct {
// FileRequestId : File request id. Might be missing due to historical data
// gap.
FileRequestId string `json:"file_request_id,omitempty"`
// RequestTitle : File request title.
RequestTitle string `json:"request_title,omitempty"`
}
@ -5389,16 +5427,13 @@ const (
// FileResolveCommentDetails : Resolved a file comment.
type FileResolveCommentDetails struct {
// TargetAssetIndex : Target asset position in the Assets list.
TargetAssetIndex uint64 `json:"target_asset_index"`
// CommentText : Comment text. Might be missing due to historical data gap.
CommentText string `json:"comment_text,omitempty"`
}
// NewFileResolveCommentDetails returns a new FileResolveCommentDetails instance
func NewFileResolveCommentDetails(TargetAssetIndex uint64) *FileResolveCommentDetails {
func NewFileResolveCommentDetails() *FileResolveCommentDetails {
s := new(FileResolveCommentDetails)
s.TargetAssetIndex = TargetAssetIndex
return s
}
@ -5447,31 +5482,25 @@ func NewFileSaveCopyReferenceDetails(RelocateActionDetails []*RelocateAssetRefer
// FileUnlikeCommentDetails : Unliked a file comment.
type FileUnlikeCommentDetails struct {
// TargetAssetIndex : Target asset position in the Assets list.
TargetAssetIndex uint64 `json:"target_asset_index"`
// CommentText : Comment text. Might be missing due to historical data gap.
CommentText string `json:"comment_text,omitempty"`
}
// NewFileUnlikeCommentDetails returns a new FileUnlikeCommentDetails instance
func NewFileUnlikeCommentDetails(TargetAssetIndex uint64) *FileUnlikeCommentDetails {
func NewFileUnlikeCommentDetails() *FileUnlikeCommentDetails {
s := new(FileUnlikeCommentDetails)
s.TargetAssetIndex = TargetAssetIndex
return s
}
// FileUnresolveCommentDetails : Unresolved a file comment.
type FileUnresolveCommentDetails struct {
// TargetAssetIndex : Target asset position in the Assets list.
TargetAssetIndex uint64 `json:"target_asset_index"`
// CommentText : Comment text. Might be missing due to historical data gap.
CommentText string `json:"comment_text,omitempty"`
}
// NewFileUnresolveCommentDetails returns a new FileUnresolveCommentDetails instance
func NewFileUnresolveCommentDetails(TargetAssetIndex uint64) *FileUnresolveCommentDetails {
func NewFileUnresolveCommentDetails() *FileUnresolveCommentDetails {
s := new(FileUnresolveCommentDetails)
s.TargetAssetIndex = TargetAssetIndex
return s
}
@ -5798,45 +5827,19 @@ func NewGroupRenameDetails(PreviousValue string, NewValue string) *GroupRenameDe
// GroupUserManagementChangePolicyDetails : Changed who can create groups.
type GroupUserManagementChangePolicyDetails struct {
// NewValue : New group users management policy.
NewValue *GroupUserManagementPolicy `json:"new_value"`
NewValue *team_policies.GroupCreation `json:"new_value"`
// PreviousValue : Previous group users management policy. Might be missing
// due to historical data gap.
PreviousValue *GroupUserManagementPolicy `json:"previous_value,omitempty"`
PreviousValue *team_policies.GroupCreation `json:"previous_value,omitempty"`
}
// NewGroupUserManagementChangePolicyDetails returns a new GroupUserManagementChangePolicyDetails instance
func NewGroupUserManagementChangePolicyDetails(NewValue *GroupUserManagementPolicy) *GroupUserManagementChangePolicyDetails {
func NewGroupUserManagementChangePolicyDetails(NewValue *team_policies.GroupCreation) *GroupUserManagementChangePolicyDetails {
s := new(GroupUserManagementChangePolicyDetails)
s.NewValue = NewValue
return s
}
// GroupUserManagementPolicy : has no documentation (yet)
type GroupUserManagementPolicy struct {
dropbox.Tagged
}
// Valid tag values for GroupUserManagementPolicy
const (
GroupUserManagementPolicyAdminsOnly = "admins_only"
GroupUserManagementPolicyAllUsers = "all_users"
GroupUserManagementPolicyOther = "other"
)
// HostLogInfo : Host details.
type HostLogInfo struct {
// HostId : Host ID. Might be missing due to historical data gap.
HostId uint64 `json:"host_id,omitempty"`
// HostName : Host name. Might be missing due to historical data gap.
HostName string `json:"host_name,omitempty"`
}
// NewHostLogInfo returns a new HostLogInfo instance
func NewHostLogInfo() *HostLogInfo {
s := new(HostLogInfo)
return s
}
// JoinTeamDetails : Additional information relevant when a new member joins the
// team.
type JoinTeamDetails struct {
@ -5870,6 +5873,54 @@ const (
LinkAudienceOther = "other"
)
// LoginFailDetails : Failed to sign in.
type LoginFailDetails struct {
// IsEmmManaged : Tells if the login device is EMM managed. Might be missing
// due to historical data gap.
IsEmmManaged bool `json:"is_emm_managed,omitempty"`
// LoginMethod : Login method.
LoginMethod *LoginMethod `json:"login_method"`
// ErrorDetails : Error details.
ErrorDetails *FailureDetailsLogInfo `json:"error_details"`
}
// NewLoginFailDetails returns a new LoginFailDetails instance
func NewLoginFailDetails(LoginMethod *LoginMethod, ErrorDetails *FailureDetailsLogInfo) *LoginFailDetails {
s := new(LoginFailDetails)
s.LoginMethod = LoginMethod
s.ErrorDetails = ErrorDetails
return s
}
// LoginMethod : has no documentation (yet)
type LoginMethod struct {
dropbox.Tagged
}
// Valid tag values for LoginMethod
const (
LoginMethodPassword = "password"
LoginMethodTwoFactorAuthentication = "two_factor_authentication"
LoginMethodSaml = "saml"
LoginMethodOther = "other"
)
// LoginSuccessDetails : Signed in.
type LoginSuccessDetails struct {
// IsEmmManaged : Tells if the login device is EMM managed. Might be missing
// due to historical data gap.
IsEmmManaged bool `json:"is_emm_managed,omitempty"`
// LoginMethod : Login method.
LoginMethod *LoginMethod `json:"login_method"`
}
// NewLoginSuccessDetails returns a new LoginSuccessDetails instance
func NewLoginSuccessDetails(LoginMethod *LoginMethod) *LoginSuccessDetails {
s := new(LoginSuccessDetails)
s.LoginMethod = LoginMethod
return s
}
// LogoutDetails : Signed out.
type LogoutDetails struct {
}
@ -6031,20 +6082,19 @@ func NewMemberSpaceLimitsAddExceptionDetails() *MemberSpaceLimitsAddExceptionDet
return s
}
// MemberSpaceLimitsChangePolicyDetails : Changed the storage limits applied to
// team members by policy.
// MemberSpaceLimitsChangePolicyDetails : Changed the team default limit level.
type MemberSpaceLimitsChangePolicyDetails struct {
// PreviousValue : Previous storage limits policy.
PreviousValue *SpaceLimitsLevel `json:"previous_value"`
// NewValue : New storage limits policy.
NewValue *SpaceLimitsLevel `json:"new_value"`
// PreviousValue : Previous team default limit value in bytes. Might be
// missing due to historical data gap.
PreviousValue uint64 `json:"previous_value,omitempty"`
// NewValue : New team default limit value in bytes. Might be missing due to
// historical data gap.
NewValue uint64 `json:"new_value,omitempty"`
}
// NewMemberSpaceLimitsChangePolicyDetails returns a new MemberSpaceLimitsChangePolicyDetails instance
func NewMemberSpaceLimitsChangePolicyDetails(PreviousValue *SpaceLimitsLevel, NewValue *SpaceLimitsLevel) *MemberSpaceLimitsChangePolicyDetails {
func NewMemberSpaceLimitsChangePolicyDetails() *MemberSpaceLimitsChangePolicyDetails {
s := new(MemberSpaceLimitsChangePolicyDetails)
s.PreviousValue = PreviousValue
s.NewValue = NewValue
return s
}
@ -6408,8 +6458,6 @@ func NewOpenNoteSharedDetails() *OpenNoteSharedDetails {
type OriginLogInfo struct {
// GeoLocation : Geographic location details.
GeoLocation *GeoLocationLogInfo `json:"geo_location,omitempty"`
// Host : Host details.
Host *HostLogInfo `json:"host,omitempty"`
// AccessMethod : The method that was used to perform the action.
AccessMethod *AccessMethodLogInfo `json:"access_method"`
}
@ -7157,29 +7205,6 @@ func NewPasswordChangeDetails() *PasswordChangeDetails {
return s
}
// PasswordLoginFailDetails : Failed to sign in using a password.
type PasswordLoginFailDetails struct {
// ErrorDetails : Login failure details.
ErrorDetails *FailureDetailsLogInfo `json:"error_details"`
}
// NewPasswordLoginFailDetails returns a new PasswordLoginFailDetails instance
func NewPasswordLoginFailDetails(ErrorDetails *FailureDetailsLogInfo) *PasswordLoginFailDetails {
s := new(PasswordLoginFailDetails)
s.ErrorDetails = ErrorDetails
return s
}
// PasswordLoginSuccessDetails : Signed in using a password.
type PasswordLoginSuccessDetails struct {
}
// NewPasswordLoginSuccessDetails returns a new PasswordLoginSuccessDetails instance
func NewPasswordLoginSuccessDetails() *PasswordLoginSuccessDetails {
s := new(PasswordLoginSuccessDetails)
return s
}
// PasswordResetAllDetails : Reset all team member passwords.
type PasswordResetAllDetails struct {
}
@ -7267,15 +7292,15 @@ func NewRelocateAssetReferencesLogInfo(SrcAssetIndex uint64, DestAssetIndex uint
type ResellerLogInfo struct {
// ResellerName : Reseller name.
ResellerName string `json:"reseller_name"`
// ResellerId : Reseller ID.
ResellerId string `json:"reseller_id"`
// ResellerEmail : Reseller email.
ResellerEmail string `json:"reseller_email"`
}
// NewResellerLogInfo returns a new ResellerLogInfo instance
func NewResellerLogInfo(ResellerName string, ResellerId string) *ResellerLogInfo {
func NewResellerLogInfo(ResellerName string, ResellerEmail string) *ResellerLogInfo {
s := new(ResellerLogInfo)
s.ResellerName = ResellerName
s.ResellerId = ResellerId
s.ResellerEmail = ResellerEmail
return s
}
@ -8499,14 +8524,13 @@ func NewSignInAsSessionStartDetails() *SignInAsSessionStartDetails {
// members.
type SmartSyncChangePolicyDetails struct {
// NewValue : New smart sync policy.
NewValue *SmartSyncPolicy `json:"new_value"`
// PreviousValue : Previous smart sync policy. Might be missing due to
// historical data gap.
PreviousValue *SmartSyncPolicy `json:"previous_value,omitempty"`
NewValue *team_policies.SmartSyncPolicy `json:"new_value"`
// PreviousValue : Previous smart sync policy.
PreviousValue *team_policies.SmartSyncPolicy `json:"previous_value,omitempty"`
}
// NewSmartSyncChangePolicyDetails returns a new SmartSyncChangePolicyDetails instance
func NewSmartSyncChangePolicyDetails(NewValue *SmartSyncPolicy) *SmartSyncChangePolicyDetails {
func NewSmartSyncChangePolicyDetails(NewValue *team_policies.SmartSyncPolicy) *SmartSyncChangePolicyDetails {
s := new(SmartSyncChangePolicyDetails)
s.NewValue = NewValue
return s
@ -8567,32 +8591,6 @@ const (
SmartSyncOptOutPolicyOther = "other"
)
// SmartSyncPolicy : has no documentation (yet)
type SmartSyncPolicy struct {
dropbox.Tagged
}
// Valid tag values for SmartSyncPolicy
const (
SmartSyncPolicyLocalOnly = "local_only"
SmartSyncPolicySynced = "synced"
SmartSyncPolicyOther = "other"
)
// SpaceLimitsLevel : has no documentation (yet)
type SpaceLimitsLevel struct {
dropbox.Tagged
}
// Valid tag values for SpaceLimitsLevel
const (
SpaceLimitsLevelGenerous = "generous"
SpaceLimitsLevelModerate = "moderate"
SpaceLimitsLevelNoLimit = "no_limit"
SpaceLimitsLevelStrict = "strict"
SpaceLimitsLevelOther = "other"
)
// SpaceLimitsStatus : has no documentation (yet)
type SpaceLimitsStatus struct {
dropbox.Tagged
@ -8647,7 +8645,8 @@ func NewSsoAddLogoutUrlDetails() *SsoAddLogoutUrlDetails {
// SsoChangeCertDetails : Changed the X.509 certificate for SSO.
type SsoChangeCertDetails struct {
// PreviousCertificateDetails : Previous SSO certificate details.
// PreviousCertificateDetails : Previous SSO certificate details. Might be
// missing due to historical data gap.
PreviousCertificateDetails *Certificate `json:"previous_certificate_details,omitempty"`
// NewCertificateDetails : New SSO certificate details.
NewCertificateDetails *Certificate `json:"new_certificate_details"`
@ -8724,15 +8723,15 @@ func NewSsoChangeSamlIdentityModeDetails(PreviousValue int64, NewValue int64) *S
return s
}
// SsoLoginFailDetails : Failed to sign in using SSO.
type SsoLoginFailDetails struct {
// ErrorDetails : Login failure details.
// SsoErrorDetails : Failed to sign in via SSO.
type SsoErrorDetails struct {
// ErrorDetails : Error details.
ErrorDetails *FailureDetailsLogInfo `json:"error_details"`
}
// NewSsoLoginFailDetails returns a new SsoLoginFailDetails instance
func NewSsoLoginFailDetails(ErrorDetails *FailureDetailsLogInfo) *SsoLoginFailDetails {
s := new(SsoLoginFailDetails)
// NewSsoErrorDetails returns a new SsoErrorDetails instance
func NewSsoErrorDetails(ErrorDetails *FailureDetailsLogInfo) *SsoErrorDetails {
s := new(SsoErrorDetails)
s.ErrorDetails = ErrorDetails
return s
}

View File

@ -36,6 +36,17 @@ const (
EmmStateOther = "other"
)
// GroupCreation : has no documentation (yet)
type GroupCreation struct {
dropbox.Tagged
}
// Valid tag values for GroupCreation
const (
GroupCreationAdminsAndMembers = "admins_and_members"
GroupCreationAdminsOnly = "admins_only"
)
// OfficeAddInPolicy : has no documentation (yet)
type OfficeAddInPolicy struct {
dropbox.Tagged
@ -138,6 +149,18 @@ const (
SharedLinkCreatePolicyOther = "other"
)
// SmartSyncPolicy : has no documentation (yet)
type SmartSyncPolicy struct {
dropbox.Tagged
}
// Valid tag values for SmartSyncPolicy
const (
SmartSyncPolicyLocal = "local"
SmartSyncPolicyOnDemand = "on_demand"
SmartSyncPolicyOther = "other"
)
// SsoPolicy : has no documentation (yet)
type SsoPolicy struct {
dropbox.Tagged

View File

@ -104,7 +104,7 @@ func (dbx *apiImpl) GetAccount(arg *GetAccountArg) (res *BasicAccount, err error
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -176,7 +176,7 @@ func (dbx *apiImpl) GetAccountBatch(arg *GetAccountBatchArg) (res []*BasicAccoun
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -240,7 +240,7 @@ func (dbx *apiImpl) GetCurrentAccount() (res *FullAccount, err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -304,7 +304,7 @@ func (dbx *apiImpl) GetSpaceUsage() (res *SpaceUsage, err error) {
return
}
var apiError dropbox.APIError
if resp.StatusCode == http.StatusBadRequest {
if resp.StatusCode == http.StatusBadRequest || resp.StatusCode == http.StatusInternalServerError {
apiError.ErrorSummary = string(body)
err = apiError
return
@ -318,7 +318,7 @@ func (dbx *apiImpl) GetSpaceUsage() (res *SpaceUsage, err error) {
}
// New returns a Client implementation for this namespace
func New(c dropbox.Config) *apiImpl {
func New(c dropbox.Config) Client {
ctx := apiImpl(dropbox.NewContext(c))
return &ctx
}

View File

@ -26,6 +26,7 @@ import (
"encoding/json"
"github.com/dropbox/dropbox-sdk-go-unofficial/dropbox"
"github.com/dropbox/dropbox-sdk-go-unofficial/dropbox/common"
"github.com/dropbox/dropbox-sdk-go-unofficial/dropbox/team_policies"
"github.com/dropbox/dropbox-sdk-go-unofficial/dropbox/users_common"
)
@ -107,10 +108,12 @@ type FullAccount struct {
IsPaired bool `json:"is_paired"`
// AccountType : What type of account this user has.
AccountType *users_common.AccountType `json:"account_type"`
// RootInfo : The root info for this account.
RootInfo common.IsRootInfo `json:"root_info"`
}
// NewFullAccount returns a new FullAccount instance
func NewFullAccount(AccountId string, Name *Name, Email string, EmailVerified bool, Disabled bool, Locale string, ReferralLink string, IsPaired bool, AccountType *users_common.AccountType) *FullAccount {
func NewFullAccount(AccountId string, Name *Name, Email string, EmailVerified bool, Disabled bool, Locale string, ReferralLink string, IsPaired bool, AccountType *users_common.AccountType, RootInfo common.IsRootInfo) *FullAccount {
s := new(FullAccount)
s.AccountId = AccountId
s.Name = Name
@ -121,6 +124,7 @@ func NewFullAccount(AccountId string, Name *Name, Email string, EmailVerified bo
s.ReferralLink = ReferralLink
s.IsPaired = IsPaired
s.AccountType = AccountType
s.RootInfo = RootInfo
return s
}

View File

@ -15,7 +15,7 @@ stone -v -a :all go_types.stoneg.py "$gen_dir" "$spec_dir"/*.stone
stone -v -a :all go_client.stoneg.py "$gen_dir" "$spec_dir"/*.stone
# Update SDK and API spec versions
sdk_version=${1:-"3.0.0"}
sdk_version=${1:-"4.0.0"}
pushd ${spec_dir}
spec_version=$(git rev-parse --short HEAD)
popd

View File

@ -40,7 +40,7 @@ class GoClientBackend(CodeBackend):
for route in namespace.routes:
self._generate_route(namespace, route)
self.emit('// New returns a Client implementation for this namespace')
with self.block('func New(c dropbox.Config) *apiImpl'):
with self.block('func New(c dropbox.Config) Client'):
self.emit('ctx := apiImpl(dropbox.NewContext(c))')
self.emit('return &ctx')
@ -192,7 +192,8 @@ class GoClientBackend(CodeBackend):
out('err = apiError')
out('return')
out('var apiError dropbox.APIError')
with self.block('if resp.StatusCode == http.StatusBadRequest'):
with self.block("if resp.StatusCode == http.StatusBadRequest || "
"resp.StatusCode == http.StatusInternalServerError"):
out('apiError.ErrorSummary = string(body)')
out('err = apiError')
out('return')