You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

122 regels
4.1 KiB

  1. // Package additionalpropsobjs provides access to the Example API.
  2. //
  3. // Usage example:
  4. //
  5. // import "google.golang.org/api/additionalpropsobjs/v1"
  6. // ...
  7. // additionalpropsobjsService, err := additionalpropsobjs.New(oauthHttpClient)
  8. package additionalpropsobjs // import "google.golang.org/api/additionalpropsobjs/v1"
  9. import (
  10. "bytes"
  11. "encoding/json"
  12. "errors"
  13. "fmt"
  14. context "golang.org/x/net/context"
  15. ctxhttp "golang.org/x/net/context/ctxhttp"
  16. gensupport "google.golang.org/api/gensupport"
  17. googleapi "google.golang.org/api/googleapi"
  18. "io"
  19. "net/http"
  20. "net/url"
  21. "strconv"
  22. "strings"
  23. )
  24. // Always reference these packages, just in case the auto-generated code
  25. // below doesn't.
  26. var _ = bytes.NewBuffer
  27. var _ = strconv.Itoa
  28. var _ = fmt.Sprintf
  29. var _ = json.NewDecoder
  30. var _ = io.Copy
  31. var _ = url.Parse
  32. var _ = gensupport.MarshalJSON
  33. var _ = googleapi.Version
  34. var _ = errors.New
  35. var _ = strings.Replace
  36. var _ = context.Canceled
  37. var _ = ctxhttp.Do
  38. const apiId = "additionalpropsobjs:v1"
  39. const apiName = "additionalpropsobjs"
  40. const apiVersion = "v1"
  41. const basePath = "https://www.googleapis.com/discovery/v1/apis"
  42. func New(client *http.Client) (*Service, error) {
  43. if client == nil {
  44. return nil, errors.New("client is nil")
  45. }
  46. s := &Service{client: client, BasePath: basePath}
  47. return s, nil
  48. }
  49. type Service struct {
  50. client *http.Client
  51. BasePath string // API endpoint base URL
  52. UserAgent string // optional additional User-Agent fragment
  53. }
  54. func (s *Service) userAgent() string {
  55. if s.UserAgent == "" {
  56. return googleapi.UserAgent
  57. }
  58. return googleapi.UserAgent + " " + s.UserAgent
  59. }
  60. type Entity struct {
  61. // Properties: The entity's properties.
  62. Properties map[string]EntityProperties `json:"properties,omitempty"`
  63. // ForceSendFields is a list of field names (e.g. "Properties") to
  64. // unconditionally include in API requests. By default, fields with
  65. // empty values are omitted from API requests. However, any non-pointer,
  66. // non-interface field appearing in ForceSendFields will be sent to the
  67. // server regardless of whether the field is empty or not. This may be
  68. // used to include empty fields in Patch requests.
  69. ForceSendFields []string `json:"-"`
  70. // NullFields is a list of field names (e.g. "Properties") to include in
  71. // API requests with the JSON null value. By default, fields with empty
  72. // values are omitted from API requests. However, any field with an
  73. // empty value appearing in NullFields will be sent to the server as
  74. // null. It is an error if a field in this list has a non-empty value.
  75. // This may be used to include null fields in Patch requests.
  76. NullFields []string `json:"-"`
  77. }
  78. func (s *Entity) MarshalJSON() ([]byte, error) {
  79. type NoMethod Entity
  80. raw := NoMethod(*s)
  81. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  82. }
  83. type EntityProperties struct {
  84. // Name: The name of the property. Properties with names matching regex
  85. // "__.*__" are reserved. A reserved property name is forbidden in
  86. // certain documented contexts. The name cannot be "".
  87. Name string `json:"name,omitempty"`
  88. // ForceSendFields is a list of field names (e.g. "Name") to
  89. // unconditionally include in API requests. By default, fields with
  90. // empty values are omitted from API requests. However, any non-pointer,
  91. // non-interface field appearing in ForceSendFields will be sent to the
  92. // server regardless of whether the field is empty or not. This may be
  93. // used to include empty fields in Patch requests.
  94. ForceSendFields []string `json:"-"`
  95. // NullFields is a list of field names (e.g. "Name") to include in API
  96. // requests with the JSON null value. By default, fields with empty
  97. // values are omitted from API requests. However, any field with an
  98. // empty value appearing in NullFields will be sent to the server as
  99. // null. It is an error if a field in this list has a non-empty value.
  100. // This may be used to include null fields in Patch requests.
  101. NullFields []string `json:"-"`
  102. }
  103. func (s *EntityProperties) MarshalJSON() ([]byte, error) {
  104. type NoMethod EntityProperties
  105. raw := NoMethod(*s)
  106. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  107. }