odata.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package storage
  2. // Copyright 2017 Microsoft Corporation
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. // MetadataLevel determines if operations should return a paylod,
  16. // and it level of detail.
  17. type MetadataLevel string
  18. // This consts are meant to help with Odata supported operations
  19. const (
  20. OdataTypeSuffix = "@odata.type"
  21. // Types
  22. OdataBinary = "Edm.Binary"
  23. OdataDateTime = "Edm.DateTime"
  24. OdataDouble = "Edm.Double"
  25. OdataGUID = "Edm.Guid"
  26. OdataInt64 = "Edm.Int64"
  27. // Query options
  28. OdataFilter = "$filter"
  29. OdataOrderBy = "$orderby"
  30. OdataTop = "$top"
  31. OdataSkip = "$skip"
  32. OdataCount = "$count"
  33. OdataExpand = "$expand"
  34. OdataSelect = "$select"
  35. OdataSearch = "$search"
  36. EmptyPayload MetadataLevel = ""
  37. NoMetadata MetadataLevel = "application/json;odata=nometadata"
  38. MinimalMetadata MetadataLevel = "application/json;odata=minimalmetadata"
  39. FullMetadata MetadataLevel = "application/json;odata=fullmetadata"
  40. )