1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987
|
// Copyright (c) Dropbox, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// Package file_properties : This namespace contains helpers for property and
// template metadata endpoints. These endpoints enable you to tag arbitrary
// key/value data to Dropbox files. The most basic unit in this namespace is
// the `PropertyField`. These fields encapsulate the actual key/value data.
// Fields are added to a Dropbox file using a `PropertyGroup`. Property groups
// contain a reference to a Dropbox file and a `PropertyGroupTemplate`. Property
// groups are uniquely identified by the combination of their associated Dropbox
// file and template. The `PropertyGroupTemplate` is a way of restricting the
// possible key names and value types of the data within a property group. The
// 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. 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 file_properties/templates/*_for_user endpoints, while
// team-owned templates are accessed via the team-auth
// file_properties/templates/*_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 (
"encoding/json"
"github.com/dropbox/dropbox-sdk-go-unofficial/v6/dropbox"
)
// AddPropertiesArg : has no documentation (yet)
type AddPropertiesArg struct {
// Path : A unique identifier for the file or folder.
Path string `json:"path"`
// PropertyGroups : The property groups which are to be added to a Dropbox
// file. No two groups in the input should refer to the same template.
PropertyGroups []*PropertyGroup `json:"property_groups"`
}
// NewAddPropertiesArg returns a new AddPropertiesArg instance
func NewAddPropertiesArg(Path string, PropertyGroups []*PropertyGroup) *AddPropertiesArg {
s := new(AddPropertiesArg)
s.Path = Path
s.PropertyGroups = PropertyGroups
return s
}
// TemplateError : has no documentation (yet)
type TemplateError struct {
dropbox.Tagged
// TemplateNotFound : Template does not exist for the given identifier.
TemplateNotFound string `json:"template_not_found,omitempty"`
}
// Valid tag values for TemplateError
const (
TemplateErrorTemplateNotFound = "template_not_found"
TemplateErrorRestrictedContent = "restricted_content"
TemplateErrorOther = "other"
)
// UnmarshalJSON deserializes into a TemplateError instance
func (u *TemplateError) UnmarshalJSON(body []byte) error {
type wrap struct {
dropbox.Tagged
// TemplateNotFound : Template does not exist for the given identifier.
TemplateNotFound string `json:"template_not_found,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 "template_not_found":
u.TemplateNotFound = w.TemplateNotFound
}
return nil
}
// PropertiesError : has no documentation (yet)
type PropertiesError struct {
dropbox.Tagged
// TemplateNotFound : Template does not exist for the given identifier.
TemplateNotFound string `json:"template_not_found,omitempty"`
// Path : has no documentation (yet)
Path *LookupError `json:"path,omitempty"`
}
// Valid tag values for PropertiesError
const (
PropertiesErrorTemplateNotFound = "template_not_found"
PropertiesErrorRestrictedContent = "restricted_content"
PropertiesErrorOther = "other"
PropertiesErrorPath = "path"
PropertiesErrorUnsupportedFolder = "unsupported_folder"
)
// UnmarshalJSON deserializes into a PropertiesError instance
func (u *PropertiesError) UnmarshalJSON(body []byte) error {
type wrap struct {
dropbox.Tagged
// TemplateNotFound : Template does not exist for the given identifier.
TemplateNotFound string `json:"template_not_found,omitempty"`
// Path : has no documentation (yet)
Path *LookupError `json:"path,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 "template_not_found":
u.TemplateNotFound = w.TemplateNotFound
case "path":
u.Path = w.Path
}
return nil
}
// InvalidPropertyGroupError : has no documentation (yet)
type InvalidPropertyGroupError struct {
dropbox.Tagged
// TemplateNotFound : Template does not exist for the given identifier.
TemplateNotFound string `json:"template_not_found,omitempty"`
// Path : has no documentation (yet)
Path *LookupError `json:"path,omitempty"`
}
// Valid tag values for InvalidPropertyGroupError
const (
InvalidPropertyGroupErrorTemplateNotFound = "template_not_found"
InvalidPropertyGroupErrorRestrictedContent = "restricted_content"
InvalidPropertyGroupErrorOther = "other"
InvalidPropertyGroupErrorPath = "path"
InvalidPropertyGroupErrorUnsupportedFolder = "unsupported_folder"
InvalidPropertyGroupErrorPropertyFieldTooLarge = "property_field_too_large"
InvalidPropertyGroupErrorDoesNotFitTemplate = "does_not_fit_template"
InvalidPropertyGroupErrorDuplicatePropertyGroups = "duplicate_property_groups"
)
// UnmarshalJSON deserializes into a InvalidPropertyGroupError instance
func (u *InvalidPropertyGroupError) UnmarshalJSON(body []byte) error {
type wrap struct {
dropbox.Tagged
// TemplateNotFound : Template does not exist for the given identifier.
TemplateNotFound string `json:"template_not_found,omitempty"`
// Path : has no documentation (yet)
Path *LookupError `json:"path,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 "template_not_found":
u.TemplateNotFound = w.TemplateNotFound
case "path":
u.Path = w.Path
}
return nil
}
// AddPropertiesError : has no documentation (yet)
type AddPropertiesError struct {
dropbox.Tagged
// TemplateNotFound : Template does not exist for the given identifier.
TemplateNotFound string `json:"template_not_found,omitempty"`
// Path : has no documentation (yet)
Path *LookupError `json:"path,omitempty"`
}
// Valid tag values for AddPropertiesError
const (
AddPropertiesErrorTemplateNotFound = "template_not_found"
AddPropertiesErrorRestrictedContent = "restricted_content"
AddPropertiesErrorOther = "other"
AddPropertiesErrorPath = "path"
AddPropertiesErrorUnsupportedFolder = "unsupported_folder"
AddPropertiesErrorPropertyFieldTooLarge = "property_field_too_large"
AddPropertiesErrorDoesNotFitTemplate = "does_not_fit_template"
AddPropertiesErrorDuplicatePropertyGroups = "duplicate_property_groups"
AddPropertiesErrorPropertyGroupAlreadyExists = "property_group_already_exists"
)
// UnmarshalJSON deserializes into a AddPropertiesError instance
func (u *AddPropertiesError) UnmarshalJSON(body []byte) error {
type wrap struct {
dropbox.Tagged
// TemplateNotFound : Template does not exist for the given identifier.
TemplateNotFound string `json:"template_not_found,omitempty"`
// Path : has no documentation (yet)
Path *LookupError `json:"path,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 "template_not_found":
u.TemplateNotFound = w.TemplateNotFound
case "path":
u.Path = w.Path
}
return nil
}
// PropertyGroupTemplate : Defines how a property group may be structured.
type PropertyGroupTemplate struct {
// Name : Display name for the template. Template names can be up to 256
// bytes.
Name string `json:"name"`
// Description : Description for the template. Template descriptions can be
// up to 1024 bytes.
Description string `json:"description"`
// Fields : Definitions of the property fields associated with this
// template. There can be up to 32 properties in a single template.
Fields []*PropertyFieldTemplate `json:"fields"`
}
// NewPropertyGroupTemplate returns a new PropertyGroupTemplate instance
func NewPropertyGroupTemplate(Name string, Description string, Fields []*PropertyFieldTemplate) *PropertyGroupTemplate {
s := new(PropertyGroupTemplate)
s.Name = Name
s.Description = Description
s.Fields = Fields
return s
}
// AddTemplateArg : has no documentation (yet)
type AddTemplateArg struct {
PropertyGroupTemplate
}
// NewAddTemplateArg returns a new AddTemplateArg instance
func NewAddTemplateArg(Name string, Description string, Fields []*PropertyFieldTemplate) *AddTemplateArg {
s := new(AddTemplateArg)
s.Name = Name
s.Description = Description
s.Fields = Fields
return s
}
// AddTemplateResult : has no documentation (yet)
type AddTemplateResult struct {
// TemplateId : An identifier for template added by See
// `templatesAddForUser` or `templatesAddForTeam`.
TemplateId string `json:"template_id"`
}
// NewAddTemplateResult returns a new AddTemplateResult instance
func NewAddTemplateResult(TemplateId string) *AddTemplateResult {
s := new(AddTemplateResult)
s.TemplateId = TemplateId
return s
}
// GetTemplateArg : has no documentation (yet)
type GetTemplateArg struct {
// TemplateId : An identifier for template added by route See
// `templatesAddForUser` or `templatesAddForTeam`.
TemplateId string `json:"template_id"`
}
// NewGetTemplateArg returns a new GetTemplateArg instance
func NewGetTemplateArg(TemplateId string) *GetTemplateArg {
s := new(GetTemplateArg)
s.TemplateId = TemplateId
return s
}
// GetTemplateResult : has no documentation (yet)
type GetTemplateResult struct {
PropertyGroupTemplate
}
// NewGetTemplateResult returns a new GetTemplateResult instance
func NewGetTemplateResult(Name string, Description string, Fields []*PropertyFieldTemplate) *GetTemplateResult {
s := new(GetTemplateResult)
s.Name = Name
s.Description = Description
s.Fields = Fields
return s
}
// ListTemplateResult : has no documentation (yet)
type ListTemplateResult struct {
// TemplateIds : List of identifiers for templates added by See
// `templatesAddForUser` or `templatesAddForTeam`.
TemplateIds []string `json:"template_ids"`
}
// NewListTemplateResult returns a new ListTemplateResult instance
func NewListTemplateResult(TemplateIds []string) *ListTemplateResult {
s := new(ListTemplateResult)
s.TemplateIds = TemplateIds
return s
}
// LogicalOperator : Logical operator to join search queries together.
type LogicalOperator struct {
dropbox.Tagged
}
// Valid tag values for LogicalOperator
const (
LogicalOperatorOrOperator = "or_operator"
LogicalOperatorOther = "other"
)
// LookUpPropertiesError : has no documentation (yet)
type LookUpPropertiesError struct {
dropbox.Tagged
}
// Valid tag values for LookUpPropertiesError
const (
LookUpPropertiesErrorPropertyGroupNotFound = "property_group_not_found"
LookUpPropertiesErrorOther = "other"
)
// LookupError : has no documentation (yet)
type LookupError struct {
dropbox.Tagged
// MalformedPath : has no documentation (yet)
MalformedPath string `json:"malformed_path,omitempty"`
}
// Valid tag values for LookupError
const (
LookupErrorMalformedPath = "malformed_path"
LookupErrorNotFound = "not_found"
LookupErrorNotFile = "not_file"
LookupErrorNotFolder = "not_folder"
LookupErrorRestrictedContent = "restricted_content"
LookupErrorOther = "other"
)
// UnmarshalJSON deserializes into a LookupError instance
func (u *LookupError) UnmarshalJSON(body []byte) error {
type wrap struct {
dropbox.Tagged
// MalformedPath : has no documentation (yet)
MalformedPath string `json:"malformed_path,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 "malformed_path":
u.MalformedPath = w.MalformedPath
}
return nil
}
// ModifyTemplateError : has no documentation (yet)
type ModifyTemplateError struct {
dropbox.Tagged
// TemplateNotFound : Template does not exist for the given identifier.
TemplateNotFound string `json:"template_not_found,omitempty"`
}
// Valid tag values for ModifyTemplateError
const (
ModifyTemplateErrorTemplateNotFound = "template_not_found"
ModifyTemplateErrorRestrictedContent = "restricted_content"
ModifyTemplateErrorOther = "other"
ModifyTemplateErrorConflictingPropertyNames = "conflicting_property_names"
ModifyTemplateErrorTooManyProperties = "too_many_properties"
ModifyTemplateErrorTooManyTemplates = "too_many_templates"
ModifyTemplateErrorTemplateAttributeTooLarge = "template_attribute_too_large"
)
// UnmarshalJSON deserializes into a ModifyTemplateError instance
func (u *ModifyTemplateError) UnmarshalJSON(body []byte) error {
type wrap struct {
dropbox.Tagged
// TemplateNotFound : Template does not exist for the given identifier.
TemplateNotFound string `json:"template_not_found,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 "template_not_found":
u.TemplateNotFound = w.TemplateNotFound
}
return nil
}
// OverwritePropertyGroupArg : has no documentation (yet)
type OverwritePropertyGroupArg struct {
// Path : A unique identifier for the file or folder.
Path string `json:"path"`
// PropertyGroups : The property groups "snapshot" updates to force apply.
// No two groups in the input should refer to the same template.
PropertyGroups []*PropertyGroup `json:"property_groups"`
}
// NewOverwritePropertyGroupArg returns a new OverwritePropertyGroupArg instance
func NewOverwritePropertyGroupArg(Path string, PropertyGroups []*PropertyGroup) *OverwritePropertyGroupArg {
s := new(OverwritePropertyGroupArg)
s.Path = Path
s.PropertyGroups = PropertyGroups
return s
}
// PropertiesSearchArg : has no documentation (yet)
type PropertiesSearchArg struct {
// Queries : Queries to search.
Queries []*PropertiesSearchQuery `json:"queries"`
// TemplateFilter : Filter results to contain only properties associated
// with these template IDs.
TemplateFilter *TemplateFilter `json:"template_filter"`
}
// NewPropertiesSearchArg returns a new PropertiesSearchArg instance
func NewPropertiesSearchArg(Queries []*PropertiesSearchQuery) *PropertiesSearchArg {
s := new(PropertiesSearchArg)
s.Queries = Queries
s.TemplateFilter = &TemplateFilter{Tagged: dropbox.Tagged{Tag: "filter_none"}}
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
// PropertyGroupLookup : has no documentation (yet)
PropertyGroupLookup *LookUpPropertiesError `json:"property_group_lookup,omitempty"`
}
// Valid tag values for PropertiesSearchError
const (
PropertiesSearchErrorPropertyGroupLookup = "property_group_lookup"
PropertiesSearchErrorOther = "other"
)
// UnmarshalJSON deserializes into a PropertiesSearchError instance
func (u *PropertiesSearchError) UnmarshalJSON(body []byte) error {
type wrap struct {
dropbox.Tagged
// PropertyGroupLookup : has no documentation (yet)
PropertyGroupLookup *LookUpPropertiesError `json:"property_group_lookup,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 "property_group_lookup":
u.PropertyGroupLookup = w.PropertyGroupLookup
}
return nil
}
// PropertiesSearchMatch : has no documentation (yet)
type PropertiesSearchMatch struct {
// Id : The ID for the matched file or folder.
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, IsDeleted bool, PropertyGroups []*PropertyGroup) *PropertiesSearchMatch {
s := new(PropertiesSearchMatch)
s.Id = Id
s.Path = Path
s.IsDeleted = IsDeleted
s.PropertyGroups = PropertyGroups
return s
}
// PropertiesSearchMode : has no documentation (yet)
type PropertiesSearchMode struct {
dropbox.Tagged
// FieldName : Search for a value associated with this field name.
FieldName string `json:"field_name,omitempty"`
}
// Valid tag values for PropertiesSearchMode
const (
PropertiesSearchModeFieldName = "field_name"
PropertiesSearchModeOther = "other"
)
// UnmarshalJSON deserializes into a PropertiesSearchMode instance
func (u *PropertiesSearchMode) UnmarshalJSON(body []byte) error {
type wrap struct {
dropbox.Tagged
// FieldName : Search for a value associated with this field name.
FieldName string `json:"field_name,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 "field_name":
u.FieldName = w.FieldName
}
return nil
}
// PropertiesSearchQuery : has no documentation (yet)
type PropertiesSearchQuery struct {
// Query : The property field value for which to search across templates.
Query string `json:"query"`
// Mode : The mode with which to perform the search.
Mode *PropertiesSearchMode `json:"mode"`
// LogicalOperator : The logical operator with which to append the query.
LogicalOperator *LogicalOperator `json:"logical_operator"`
}
// NewPropertiesSearchQuery returns a new PropertiesSearchQuery instance
func NewPropertiesSearchQuery(Query string, Mode *PropertiesSearchMode) *PropertiesSearchQuery {
s := new(PropertiesSearchQuery)
s.Query = Query
s.Mode = Mode
s.LogicalOperator = &LogicalOperator{Tagged: dropbox.Tagged{Tag: "or_operator"}}
return s
}
// PropertiesSearchResult : has no documentation (yet)
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
func NewPropertiesSearchResult(Matches []*PropertiesSearchMatch) *PropertiesSearchResult {
s := new(PropertiesSearchResult)
s.Matches = Matches
return s
}
// PropertyField : Raw key/value data to be associated with a Dropbox file.
// Property fields are added to Dropbox files as a `PropertyGroup`.
type PropertyField struct {
// Name : Key of the property field associated with a file and template.
// Keys can be up to 256 bytes.
Name string `json:"name"`
// Value : Value of the property field associated with a file and template.
// Values can be up to 1024 bytes.
Value string `json:"value"`
}
// NewPropertyField returns a new PropertyField instance
func NewPropertyField(Name string, Value string) *PropertyField {
s := new(PropertyField)
s.Name = Name
s.Value = Value
return s
}
// PropertyFieldTemplate : Defines how a single property field may be
// structured. Used exclusively by `PropertyGroupTemplate`.
type PropertyFieldTemplate struct {
// Name : Key of the property field being described. Property field keys can
// be up to 256 bytes.
Name string `json:"name"`
// Description : Description of the property field. Property field
// descriptions can be up to 1024 bytes.
Description string `json:"description"`
// Type : Data type of the value of this property field. This type will be
// enforced upon property creation and modifications.
Type *PropertyType `json:"type"`
}
// NewPropertyFieldTemplate returns a new PropertyFieldTemplate instance
func NewPropertyFieldTemplate(Name string, Description string, Type *PropertyType) *PropertyFieldTemplate {
s := new(PropertyFieldTemplate)
s.Name = Name
s.Description = Description
s.Type = Type
return s
}
// PropertyGroup : A subset of the property fields described by the
// corresponding `PropertyGroupTemplate`. Properties are always added to a
// Dropbox file as a `PropertyGroup`. The possible key names and value types in
// this group are defined by the corresponding `PropertyGroupTemplate`.
type PropertyGroup struct {
// TemplateId : A unique identifier for the associated template.
TemplateId string `json:"template_id"`
// Fields : The actual properties associated with the template. There can be
// up to 32 property types per template.
Fields []*PropertyField `json:"fields"`
}
// NewPropertyGroup returns a new PropertyGroup instance
func NewPropertyGroup(TemplateId string, Fields []*PropertyField) *PropertyGroup {
s := new(PropertyGroup)
s.TemplateId = TemplateId
s.Fields = Fields
return s
}
// PropertyGroupUpdate : has no documentation (yet)
type PropertyGroupUpdate struct {
// TemplateId : A unique identifier for a property template.
TemplateId string `json:"template_id"`
// AddOrUpdateFields : Property fields to update. If the property field
// already exists, it is updated. If the property field doesn't exist, the
// property group is added.
AddOrUpdateFields []*PropertyField `json:"add_or_update_fields,omitempty"`
// RemoveFields : Property fields to remove (by name), provided they exist.
RemoveFields []string `json:"remove_fields,omitempty"`
}
// NewPropertyGroupUpdate returns a new PropertyGroupUpdate instance
func NewPropertyGroupUpdate(TemplateId string) *PropertyGroupUpdate {
s := new(PropertyGroupUpdate)
s.TemplateId = TemplateId
return s
}
// PropertyType : Data type of the given property field added.
type PropertyType struct {
dropbox.Tagged
}
// Valid tag values for PropertyType
const (
PropertyTypeString = "string"
PropertyTypeOther = "other"
)
// RemovePropertiesArg : has no documentation (yet)
type RemovePropertiesArg struct {
// Path : A unique identifier for the file or folder.
Path string `json:"path"`
// PropertyTemplateIds : A list of identifiers for a template created by
// `templatesAddForUser` or `templatesAddForTeam`.
PropertyTemplateIds []string `json:"property_template_ids"`
}
// NewRemovePropertiesArg returns a new RemovePropertiesArg instance
func NewRemovePropertiesArg(Path string, PropertyTemplateIds []string) *RemovePropertiesArg {
s := new(RemovePropertiesArg)
s.Path = Path
s.PropertyTemplateIds = PropertyTemplateIds
return s
}
// RemovePropertiesError : has no documentation (yet)
type RemovePropertiesError struct {
dropbox.Tagged
// TemplateNotFound : Template does not exist for the given identifier.
TemplateNotFound string `json:"template_not_found,omitempty"`
// Path : has no documentation (yet)
Path *LookupError `json:"path,omitempty"`
// PropertyGroupLookup : has no documentation (yet)
PropertyGroupLookup *LookUpPropertiesError `json:"property_group_lookup,omitempty"`
}
// Valid tag values for RemovePropertiesError
const (
RemovePropertiesErrorTemplateNotFound = "template_not_found"
RemovePropertiesErrorRestrictedContent = "restricted_content"
RemovePropertiesErrorOther = "other"
RemovePropertiesErrorPath = "path"
RemovePropertiesErrorUnsupportedFolder = "unsupported_folder"
RemovePropertiesErrorPropertyGroupLookup = "property_group_lookup"
)
// UnmarshalJSON deserializes into a RemovePropertiesError instance
func (u *RemovePropertiesError) UnmarshalJSON(body []byte) error {
type wrap struct {
dropbox.Tagged
// TemplateNotFound : Template does not exist for the given identifier.
TemplateNotFound string `json:"template_not_found,omitempty"`
// Path : has no documentation (yet)
Path *LookupError `json:"path,omitempty"`
// PropertyGroupLookup : has no documentation (yet)
PropertyGroupLookup *LookUpPropertiesError `json:"property_group_lookup,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 "template_not_found":
u.TemplateNotFound = w.TemplateNotFound
case "path":
u.Path = w.Path
case "property_group_lookup":
u.PropertyGroupLookup = w.PropertyGroupLookup
}
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 []string `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":
u.FilterSome = w.FilterSome
}
return nil
}
// TemplateFilter : has no documentation (yet)
type TemplateFilter 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 TemplateFilter
const (
TemplateFilterFilterSome = "filter_some"
TemplateFilterOther = "other"
TemplateFilterFilterNone = "filter_none"
)
// UnmarshalJSON deserializes into a TemplateFilter instance
func (u *TemplateFilter) 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 []string `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":
u.FilterSome = w.FilterSome
}
return nil
}
// TemplateOwnerType : has no documentation (yet)
type TemplateOwnerType struct {
dropbox.Tagged
}
// Valid tag values for TemplateOwnerType
const (
TemplateOwnerTypeUser = "user"
TemplateOwnerTypeTeam = "team"
TemplateOwnerTypeOther = "other"
)
// UpdatePropertiesArg : has no documentation (yet)
type UpdatePropertiesArg struct {
// Path : A unique identifier for the file or folder.
Path string `json:"path"`
// UpdatePropertyGroups : The property groups "delta" updates to apply.
UpdatePropertyGroups []*PropertyGroupUpdate `json:"update_property_groups"`
}
// NewUpdatePropertiesArg returns a new UpdatePropertiesArg instance
func NewUpdatePropertiesArg(Path string, UpdatePropertyGroups []*PropertyGroupUpdate) *UpdatePropertiesArg {
s := new(UpdatePropertiesArg)
s.Path = Path
s.UpdatePropertyGroups = UpdatePropertyGroups
return s
}
// UpdatePropertiesError : has no documentation (yet)
type UpdatePropertiesError struct {
dropbox.Tagged
// TemplateNotFound : Template does not exist for the given identifier.
TemplateNotFound string `json:"template_not_found,omitempty"`
// Path : has no documentation (yet)
Path *LookupError `json:"path,omitempty"`
// PropertyGroupLookup : has no documentation (yet)
PropertyGroupLookup *LookUpPropertiesError `json:"property_group_lookup,omitempty"`
}
// Valid tag values for UpdatePropertiesError
const (
UpdatePropertiesErrorTemplateNotFound = "template_not_found"
UpdatePropertiesErrorRestrictedContent = "restricted_content"
UpdatePropertiesErrorOther = "other"
UpdatePropertiesErrorPath = "path"
UpdatePropertiesErrorUnsupportedFolder = "unsupported_folder"
UpdatePropertiesErrorPropertyFieldTooLarge = "property_field_too_large"
UpdatePropertiesErrorDoesNotFitTemplate = "does_not_fit_template"
UpdatePropertiesErrorDuplicatePropertyGroups = "duplicate_property_groups"
UpdatePropertiesErrorPropertyGroupLookup = "property_group_lookup"
)
// UnmarshalJSON deserializes into a UpdatePropertiesError instance
func (u *UpdatePropertiesError) UnmarshalJSON(body []byte) error {
type wrap struct {
dropbox.Tagged
// TemplateNotFound : Template does not exist for the given identifier.
TemplateNotFound string `json:"template_not_found,omitempty"`
// Path : has no documentation (yet)
Path *LookupError `json:"path,omitempty"`
// PropertyGroupLookup : has no documentation (yet)
PropertyGroupLookup *LookUpPropertiesError `json:"property_group_lookup,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 "template_not_found":
u.TemplateNotFound = w.TemplateNotFound
case "path":
u.Path = w.Path
case "property_group_lookup":
u.PropertyGroupLookup = w.PropertyGroupLookup
}
return nil
}
// UpdateTemplateArg : has no documentation (yet)
type UpdateTemplateArg struct {
// TemplateId : An identifier for template added by See
// `templatesAddForUser` or `templatesAddForTeam`.
TemplateId string `json:"template_id"`
// Name : A display name for the template. template names can be up to 256
// bytes.
Name string `json:"name,omitempty"`
// Description : Description for the new template. Template descriptions can
// be up to 1024 bytes.
Description string `json:"description,omitempty"`
// AddFields : Property field templates to be added to the group template.
// There can be up to 32 properties in a single template.
AddFields []*PropertyFieldTemplate `json:"add_fields,omitempty"`
}
// NewUpdateTemplateArg returns a new UpdateTemplateArg instance
func NewUpdateTemplateArg(TemplateId string) *UpdateTemplateArg {
s := new(UpdateTemplateArg)
s.TemplateId = TemplateId
return s
}
// UpdateTemplateResult : has no documentation (yet)
type UpdateTemplateResult struct {
// TemplateId : An identifier for template added by route See
// `templatesAddForUser` or `templatesAddForTeam`.
TemplateId string `json:"template_id"`
}
// NewUpdateTemplateResult returns a new UpdateTemplateResult instance
func NewUpdateTemplateResult(TemplateId string) *UpdateTemplateResult {
s := new(UpdateTemplateResult)
s.TemplateId = TemplateId
return s
}
|