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.
 
 
 

177 lines
5.8 KiB

  1. // Copyright YEAR Google LLC.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated file. DO NOT EDIT.
  5. // Package mapofany provides access to the Example API.
  6. //
  7. // Creating a client
  8. //
  9. // Usage example:
  10. //
  11. // import "google.golang.org/api/mapofany/v1"
  12. // ...
  13. // ctx := context.Background()
  14. // mapofanyService, err := mapofany.NewService(ctx)
  15. //
  16. // In this example, Google Application Default Credentials are used for authentication.
  17. //
  18. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  19. //
  20. // Other authentication options
  21. //
  22. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  23. //
  24. // mapofanyService, err := mapofany.NewService(ctx, option.WithAPIKey("AIza..."))
  25. //
  26. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  27. //
  28. // config := &oauth2.Config{...}
  29. // // ...
  30. // token, err := config.Exchange(ctx, ...)
  31. // mapofanyService, err := mapofany.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  32. //
  33. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  34. package mapofany // import "google.golang.org/api/mapofany/v1"
  35. import (
  36. "bytes"
  37. "context"
  38. "encoding/json"
  39. "errors"
  40. "fmt"
  41. "io"
  42. "net/http"
  43. "net/url"
  44. "strconv"
  45. "strings"
  46. gensupport "google.golang.org/api/gensupport"
  47. googleapi "google.golang.org/api/googleapi"
  48. option "google.golang.org/api/option"
  49. htransport "google.golang.org/api/transport/http"
  50. )
  51. // Always reference these packages, just in case the auto-generated code
  52. // below doesn't.
  53. var _ = bytes.NewBuffer
  54. var _ = strconv.Itoa
  55. var _ = fmt.Sprintf
  56. var _ = json.NewDecoder
  57. var _ = io.Copy
  58. var _ = url.Parse
  59. var _ = gensupport.MarshalJSON
  60. var _ = googleapi.Version
  61. var _ = errors.New
  62. var _ = strings.Replace
  63. var _ = context.Canceled
  64. const apiId = "mapofany:v1"
  65. const apiName = "mapofany"
  66. const apiVersion = "v1"
  67. const basePath = "https://www.googleapis.com/discovery/v1/apis"
  68. // NewService creates a new Service.
  69. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  70. client, endpoint, err := htransport.NewClient(ctx, opts...)
  71. if err != nil {
  72. return nil, err
  73. }
  74. s, err := New(client)
  75. if err != nil {
  76. return nil, err
  77. }
  78. if endpoint != "" {
  79. s.BasePath = endpoint
  80. }
  81. return s, nil
  82. }
  83. // New creates a new Service. It uses the provided http.Client for requests.
  84. //
  85. // Deprecated: please use NewService instead.
  86. // To provide a custom HTTP client, use option.WithHTTPClient.
  87. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  88. func New(client *http.Client) (*Service, error) {
  89. if client == nil {
  90. return nil, errors.New("client is nil")
  91. }
  92. s := &Service{client: client, BasePath: basePath}
  93. return s, nil
  94. }
  95. type Service struct {
  96. client *http.Client
  97. BasePath string // API endpoint base URL
  98. UserAgent string // optional additional User-Agent fragment
  99. }
  100. func (s *Service) userAgent() string {
  101. if s.UserAgent == "" {
  102. return googleapi.UserAgent
  103. }
  104. return googleapi.UserAgent + " " + s.UserAgent
  105. }
  106. type JsonValue interface{}
  107. type TableDataInsertAllRequest struct {
  108. // Kind: The resource type of the response.
  109. Kind string `json:"kind,omitempty"`
  110. // Rows: The rows to insert.
  111. Rows []*TableDataInsertAllRequestRows `json:"rows,omitempty"`
  112. // ForceSendFields is a list of field names (e.g. "Kind") to
  113. // unconditionally include in API requests. By default, fields with
  114. // empty values are omitted from API requests. However, any non-pointer,
  115. // non-interface field appearing in ForceSendFields will be sent to the
  116. // server regardless of whether the field is empty or not. This may be
  117. // used to include empty fields in Patch requests.
  118. ForceSendFields []string `json:"-"`
  119. // NullFields is a list of field names (e.g. "Kind") to include in API
  120. // requests with the JSON null value. By default, fields with empty
  121. // values are omitted from API requests. However, any field with an
  122. // empty value appearing in NullFields will be sent to the server as
  123. // null. It is an error if a field in this list has a non-empty value.
  124. // This may be used to include null fields in Patch requests.
  125. NullFields []string `json:"-"`
  126. }
  127. func (s *TableDataInsertAllRequest) MarshalJSON() ([]byte, error) {
  128. type NoMethod TableDataInsertAllRequest
  129. raw := NoMethod(*s)
  130. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  131. }
  132. type TableDataInsertAllRequestRows struct {
  133. // Json: [Required] A JSON object that contains a row of data. The
  134. // object's properties and values must match the destination table's
  135. // schema.
  136. Json map[string]JsonValue `json:"json,omitempty"`
  137. // ForceSendFields is a list of field names (e.g. "Json") to
  138. // unconditionally include in API requests. By default, fields with
  139. // empty values are omitted from API requests. However, any non-pointer,
  140. // non-interface field appearing in ForceSendFields will be sent to the
  141. // server regardless of whether the field is empty or not. This may be
  142. // used to include empty fields in Patch requests.
  143. ForceSendFields []string `json:"-"`
  144. // NullFields is a list of field names (e.g. "Json") to include in API
  145. // requests with the JSON null value. By default, fields with empty
  146. // values are omitted from API requests. However, any field with an
  147. // empty value appearing in NullFields will be sent to the server as
  148. // null. It is an error if a field in this list has a non-empty value.
  149. // This may be used to include null fields in Patch requests.
  150. NullFields []string `json:"-"`
  151. }
  152. func (s *TableDataInsertAllRequestRows) MarshalJSON() ([]byte, error) {
  153. type NoMethod TableDataInsertAllRequestRows
  154. raw := NoMethod(*s)
  155. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  156. }