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