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.
 
 
 

598 lines
21 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 additionalpropsobjs provides access to the Example API.
  6. //
  7. // Creating a client
  8. //
  9. // Usage example:
  10. //
  11. // import "google.golang.org/api/additionalpropsobjs/v1"
  12. // ...
  13. // ctx := context.Background()
  14. // additionalpropsobjsService, err := additionalpropsobjs.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. // additionalpropsobjsService, err := additionalpropsobjs.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. // additionalpropsobjsService, err := additionalpropsobjs.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 additionalpropsobjs // import "google.golang.org/api/additionalpropsobjs/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 = "additionalpropsobjs:v1"
  65. const apiName = "additionalpropsobjs"
  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 GeoJsonGeometry map[string]interface{}
  107. func (t GeoJsonGeometry) Type() string {
  108. return googleapi.VariantType(t)
  109. }
  110. func (t GeoJsonGeometry) GeometryCollection() (r GeoJsonGeometryCollection, ok bool) {
  111. if t.Type() != "GeometryCollection" {
  112. return r, false
  113. }
  114. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  115. return r, ok
  116. }
  117. func (t GeoJsonGeometry) LineString() (r GeoJsonLineString, ok bool) {
  118. if t.Type() != "LineString" {
  119. return r, false
  120. }
  121. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  122. return r, ok
  123. }
  124. func (t GeoJsonGeometry) MultiLineString() (r GeoJsonMultiLineString, ok bool) {
  125. if t.Type() != "MultiLineString" {
  126. return r, false
  127. }
  128. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  129. return r, ok
  130. }
  131. func (t GeoJsonGeometry) MultiPoint() (r GeoJsonMultiPoint, ok bool) {
  132. if t.Type() != "MultiPoint" {
  133. return r, false
  134. }
  135. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  136. return r, ok
  137. }
  138. func (t GeoJsonGeometry) MultiPolygon() (r GeoJsonMultiPolygon, ok bool) {
  139. if t.Type() != "MultiPolygon" {
  140. return r, false
  141. }
  142. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  143. return r, ok
  144. }
  145. func (t GeoJsonGeometry) Point() (r GeoJsonPoint, ok bool) {
  146. if t.Type() != "Point" {
  147. return r, false
  148. }
  149. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  150. return r, ok
  151. }
  152. func (t GeoJsonGeometry) Polygon() (r GeoJsonPolygon, ok bool) {
  153. if t.Type() != "Polygon" {
  154. return r, false
  155. }
  156. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  157. return r, ok
  158. }
  159. // GeoJsonGeometryCollection: A heterogenous collection of
  160. // GeoJsonGeometry objects.
  161. type GeoJsonGeometryCollection struct {
  162. // Geometries: An array of geometry objects. There must be at least 2
  163. // different types of geometries in the array.
  164. Geometries []GeoJsonGeometry `json:"geometries,omitempty"`
  165. // Type: Identifies this object as a GeoJsonGeometryCollection.
  166. //
  167. // Possible values:
  168. // "GeometryCollection"
  169. Type string `json:"type,omitempty"`
  170. // ForceSendFields is a list of field names (e.g. "Geometries") to
  171. // unconditionally include in API requests. By default, fields with
  172. // empty values are omitted from API requests. However, any non-pointer,
  173. // non-interface field appearing in ForceSendFields will be sent to the
  174. // server regardless of whether the field is empty or not. This may be
  175. // used to include empty fields in Patch requests.
  176. ForceSendFields []string `json:"-"`
  177. // NullFields is a list of field names (e.g. "Geometries") to include in
  178. // API requests with the JSON null value. By default, fields with empty
  179. // values are omitted from API requests. However, any field with an
  180. // empty value appearing in NullFields will be sent to the server as
  181. // null. It is an error if a field in this list has a non-empty value.
  182. // This may be used to include null fields in Patch requests.
  183. NullFields []string `json:"-"`
  184. }
  185. func (s *GeoJsonGeometryCollection) MarshalJSON() ([]byte, error) {
  186. type NoMethod GeoJsonGeometryCollection
  187. raw := NoMethod(*s)
  188. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  189. }
  190. type GeoJsonLineString struct {
  191. // Coordinates: An array of two or more positions, representing a line.
  192. Coordinates [][]float64 `json:"coordinates,omitempty"`
  193. // Type: Identifies this object as a GeoJsonLineString.
  194. //
  195. // Possible values:
  196. // "LineString"
  197. Type string `json:"type,omitempty"`
  198. // ForceSendFields is a list of field names (e.g. "Coordinates") to
  199. // unconditionally include in API requests. By default, fields with
  200. // empty values are omitted from API requests. However, any non-pointer,
  201. // non-interface field appearing in ForceSendFields will be sent to the
  202. // server regardless of whether the field is empty or not. This may be
  203. // used to include empty fields in Patch requests.
  204. ForceSendFields []string `json:"-"`
  205. // NullFields is a list of field names (e.g. "Coordinates") to include
  206. // in API requests with the JSON null value. By default, fields with
  207. // empty values are omitted from API requests. However, any field with
  208. // an empty value appearing in NullFields will be sent to the server as
  209. // null. It is an error if a field in this list has a non-empty value.
  210. // This may be used to include null fields in Patch requests.
  211. NullFields []string `json:"-"`
  212. }
  213. func (s *GeoJsonLineString) MarshalJSON() ([]byte, error) {
  214. type NoMethod GeoJsonLineString
  215. raw := NoMethod(*s)
  216. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  217. }
  218. // GeoJsonMultiLineString: Multi Line String
  219. type GeoJsonMultiLineString struct {
  220. // Coordinates: An array of at least two GeoJsonLineString coordinate
  221. // arrays.
  222. Coordinates [][][]float64 `json:"coordinates,omitempty"`
  223. // Type: Identifies this object as a GeoJsonMultiLineString.
  224. //
  225. // Possible values:
  226. // "MultiLineString"
  227. Type string `json:"type,omitempty"`
  228. // ForceSendFields is a list of field names (e.g. "Coordinates") to
  229. // unconditionally include in API requests. By default, fields with
  230. // empty values are omitted from API requests. However, any non-pointer,
  231. // non-interface field appearing in ForceSendFields will be sent to the
  232. // server regardless of whether the field is empty or not. This may be
  233. // used to include empty fields in Patch requests.
  234. ForceSendFields []string `json:"-"`
  235. // NullFields is a list of field names (e.g. "Coordinates") to include
  236. // in API requests with the JSON null value. By default, fields with
  237. // empty values are omitted from API requests. However, any field with
  238. // an empty value appearing in NullFields will be sent to the server as
  239. // null. It is an error if a field in this list has a non-empty value.
  240. // This may be used to include null fields in Patch requests.
  241. NullFields []string `json:"-"`
  242. }
  243. func (s *GeoJsonMultiLineString) MarshalJSON() ([]byte, error) {
  244. type NoMethod GeoJsonMultiLineString
  245. raw := NoMethod(*s)
  246. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  247. }
  248. type GeoJsonMultiPoint struct {
  249. // Coordinates: An array of at least two GeoJsonPoint coordinate arrays.
  250. Coordinates [][]float64 `json:"coordinates,omitempty"`
  251. // Type: Identifies this object as a GeoJsonMultiPoint.
  252. //
  253. // Possible values:
  254. // "MultiPoint"
  255. Type string `json:"type,omitempty"`
  256. // ForceSendFields is a list of field names (e.g. "Coordinates") to
  257. // unconditionally include in API requests. By default, fields with
  258. // empty values are omitted from API requests. However, any non-pointer,
  259. // non-interface field appearing in ForceSendFields will be sent to the
  260. // server regardless of whether the field is empty or not. This may be
  261. // used to include empty fields in Patch requests.
  262. ForceSendFields []string `json:"-"`
  263. // NullFields is a list of field names (e.g. "Coordinates") to include
  264. // in API requests with the JSON null value. By default, fields with
  265. // empty values are omitted from API requests. However, any field with
  266. // an empty value appearing in NullFields will be sent to the server as
  267. // null. It is an error if a field in this list has a non-empty value.
  268. // This may be used to include null fields in Patch requests.
  269. NullFields []string `json:"-"`
  270. }
  271. func (s *GeoJsonMultiPoint) MarshalJSON() ([]byte, error) {
  272. type NoMethod GeoJsonMultiPoint
  273. raw := NoMethod(*s)
  274. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  275. }
  276. type GeoJsonMultiPolygon struct {
  277. // Coordinates: An array of at least two GeoJsonPolygon coordinate
  278. // arrays.
  279. Coordinates [][][][]float64 `json:"coordinates,omitempty"`
  280. // Type: Identifies this object as a GeoJsonMultiPolygon.
  281. //
  282. // Possible values:
  283. // "MultiPolygon"
  284. Type string `json:"type,omitempty"`
  285. // ForceSendFields is a list of field names (e.g. "Coordinates") to
  286. // unconditionally include in API requests. By default, fields with
  287. // empty values are omitted from API requests. However, any non-pointer,
  288. // non-interface field appearing in ForceSendFields will be sent to the
  289. // server regardless of whether the field is empty or not. This may be
  290. // used to include empty fields in Patch requests.
  291. ForceSendFields []string `json:"-"`
  292. // NullFields is a list of field names (e.g. "Coordinates") to include
  293. // in API requests with the JSON null value. By default, fields with
  294. // empty values are omitted from API requests. However, any field with
  295. // an empty value appearing in NullFields will be sent to the server as
  296. // null. It is an error if a field in this list has a non-empty value.
  297. // This may be used to include null fields in Patch requests.
  298. NullFields []string `json:"-"`
  299. }
  300. func (s *GeoJsonMultiPolygon) MarshalJSON() ([]byte, error) {
  301. type NoMethod GeoJsonMultiPolygon
  302. raw := NoMethod(*s)
  303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  304. }
  305. type GeoJsonPoint struct {
  306. // Coordinates: A single GeoJsonPosition, specifying the location of the
  307. // point.
  308. Coordinates []float64 `json:"coordinates,omitempty"`
  309. // Type: Identifies this object as a GeoJsonPoint.
  310. //
  311. // Possible values:
  312. // "Point"
  313. Type string `json:"type,omitempty"`
  314. // ForceSendFields is a list of field names (e.g. "Coordinates") to
  315. // unconditionally include in API requests. By default, fields with
  316. // empty values are omitted from API requests. However, any non-pointer,
  317. // non-interface field appearing in ForceSendFields will be sent to the
  318. // server regardless of whether the field is empty or not. This may be
  319. // used to include empty fields in Patch requests.
  320. ForceSendFields []string `json:"-"`
  321. // NullFields is a list of field names (e.g. "Coordinates") to include
  322. // in API requests with the JSON null value. By default, fields with
  323. // empty values are omitted from API requests. However, any field with
  324. // an empty value appearing in NullFields will be sent to the server as
  325. // null. It is an error if a field in this list has a non-empty value.
  326. // This may be used to include null fields in Patch requests.
  327. NullFields []string `json:"-"`
  328. }
  329. func (s *GeoJsonPoint) MarshalJSON() ([]byte, error) {
  330. type NoMethod GeoJsonPoint
  331. raw := NoMethod(*s)
  332. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  333. }
  334. type GeoJsonPolygon struct {
  335. // Coordinates: An array of LinearRings, each of which is an array of
  336. // four or more GeoJsonPositions. The first and last coordinates in each
  337. // LinearRing must be the same. For polygons with multiple rings, the
  338. // first LinearRing is the external ring, with subsequent rings being
  339. // interior rings (i.e. hole). All LinearRings must contain
  340. // GeoJsonPositions in counter-clockwise order.
  341. Coordinates [][][]float64 `json:"coordinates,omitempty"`
  342. // Type: Identifies this object as a GeoJsonPolygon.
  343. //
  344. // Possible values:
  345. // "Polygon"
  346. Type string `json:"type,omitempty"`
  347. // ForceSendFields is a list of field names (e.g. "Coordinates") to
  348. // unconditionally include in API requests. By default, fields with
  349. // empty values are omitted from API requests. However, any non-pointer,
  350. // non-interface field appearing in ForceSendFields will be sent to the
  351. // server regardless of whether the field is empty or not. This may be
  352. // used to include empty fields in Patch requests.
  353. ForceSendFields []string `json:"-"`
  354. // NullFields is a list of field names (e.g. "Coordinates") to include
  355. // in API requests with the JSON null value. By default, fields with
  356. // empty values are omitted from API requests. However, any field with
  357. // an empty value appearing in NullFields will be sent to the server as
  358. // null. It is an error if a field in this list has a non-empty value.
  359. // This may be used to include null fields in Patch requests.
  360. NullFields []string `json:"-"`
  361. }
  362. func (s *GeoJsonPolygon) MarshalJSON() ([]byte, error) {
  363. type NoMethod GeoJsonPolygon
  364. raw := NoMethod(*s)
  365. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  366. }
  367. type MapFolder struct {
  368. Contents []MapItem `json:"contents,omitempty"`
  369. // DefaultViewport: An array of four numbers (west, south, east, north)
  370. // which defines the rectangular bounding box of the default viewport.
  371. // The numbers represent latitude and longitude in decimal degrees.
  372. DefaultViewport []float64 `json:"defaultViewport,omitempty"`
  373. // Expandable: The expandability setting of this MapFolder. If true, the
  374. // folder can be expanded.
  375. Expandable bool `json:"expandable,omitempty"`
  376. // Key: A user defined alias for this MapFolder, specific to this Map.
  377. Key string `json:"key,omitempty"`
  378. // Name: The name of this MapFolder.
  379. Name string `json:"name,omitempty"`
  380. // Type: Identifies this object as a MapFolder.
  381. //
  382. // Possible values:
  383. // "folder"
  384. Type string `json:"type,omitempty"`
  385. // Visibility: The visibility setting of this MapFolder. One of
  386. // "defaultOn" or "defaultOff".
  387. Visibility string `json:"visibility,omitempty"`
  388. // ForceSendFields is a list of field names (e.g. "Contents") to
  389. // unconditionally include in API requests. By default, fields with
  390. // empty values are omitted from API requests. However, any non-pointer,
  391. // non-interface field appearing in ForceSendFields will be sent to the
  392. // server regardless of whether the field is empty or not. This may be
  393. // used to include empty fields in Patch requests.
  394. ForceSendFields []string `json:"-"`
  395. // NullFields is a list of field names (e.g. "Contents") to include in
  396. // API requests with the JSON null value. By default, fields with empty
  397. // values are omitted from API requests. However, any field with an
  398. // empty value appearing in NullFields will be sent to the server as
  399. // null. It is an error if a field in this list has a non-empty value.
  400. // This may be used to include null fields in Patch requests.
  401. NullFields []string `json:"-"`
  402. }
  403. func (s *MapFolder) MarshalJSON() ([]byte, error) {
  404. type NoMethod MapFolder
  405. raw := NoMethod(*s)
  406. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  407. }
  408. type MapItem map[string]interface{}
  409. func (t MapItem) Type() string {
  410. return googleapi.VariantType(t)
  411. }
  412. func (t MapItem) Folder() (r MapFolder, ok bool) {
  413. if t.Type() != "Folder" {
  414. return r, false
  415. }
  416. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  417. return r, ok
  418. }
  419. func (t MapItem) KmlLink() (r MapKmlLink, ok bool) {
  420. if t.Type() != "KmlLink" {
  421. return r, false
  422. }
  423. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  424. return r, ok
  425. }
  426. func (t MapItem) Layer() (r MapLayer, ok bool) {
  427. if t.Type() != "Layer" {
  428. return r, false
  429. }
  430. ok = googleapi.ConvertVariant(map[string]interface{}(t), &r)
  431. return r, ok
  432. }
  433. type MapKmlLink struct {
  434. // DefaultViewport: An array of four numbers (west, south, east, north)
  435. // which defines the rectangular bounding box of the default viewport.
  436. // The numbers represent latitude and longitude in decimal degrees.
  437. DefaultViewport []float64 `json:"defaultViewport,omitempty"`
  438. // KmlUrl: The URL to the KML file represented by this MapKmlLink.
  439. KmlUrl string `json:"kmlUrl,omitempty"`
  440. // Name: The name of this MapKmlLink.
  441. Name string `json:"name,omitempty"`
  442. // Type: Identifies this object as a MapKmlLink.
  443. //
  444. // Possible values:
  445. // "kmlLink"
  446. Type string `json:"type,omitempty"`
  447. // Visibility: The visibility setting of this MapKmlLink. One of
  448. // "defaultOn" or "defaultOff".
  449. Visibility string `json:"visibility,omitempty"`
  450. // ForceSendFields is a list of field names (e.g. "DefaultViewport") to
  451. // unconditionally include in API requests. By default, fields with
  452. // empty values are omitted from API requests. However, any non-pointer,
  453. // non-interface field appearing in ForceSendFields will be sent to the
  454. // server regardless of whether the field is empty or not. This may be
  455. // used to include empty fields in Patch requests.
  456. ForceSendFields []string `json:"-"`
  457. // NullFields is a list of field names (e.g. "DefaultViewport") to
  458. // include in API requests with the JSON null value. By default, fields
  459. // with empty values are omitted from API requests. However, any field
  460. // with an empty value appearing in NullFields will be sent to the
  461. // server as null. It is an error if a field in this list has a
  462. // non-empty value. This may be used to include null fields in Patch
  463. // requests.
  464. NullFields []string `json:"-"`
  465. }
  466. func (s *MapKmlLink) MarshalJSON() ([]byte, error) {
  467. type NoMethod MapKmlLink
  468. raw := NoMethod(*s)
  469. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  470. }
  471. type MapLayer struct {
  472. // DefaultViewport: An array of four numbers (west, south, east, north)
  473. // which defines the rectangular bounding box of the default viewport.
  474. // The numbers represent latitude and longitude in decimal degrees.
  475. DefaultViewport []float64 `json:"defaultViewport,omitempty"`
  476. // Id: The ID of this MapLayer. This ID can be used to request more
  477. // details about the layer.
  478. Id string `json:"id,omitempty"`
  479. // Key: A user defined alias for this MapLayer, specific to this Map.
  480. Key string `json:"key,omitempty"`
  481. // Name: The name of this MapLayer.
  482. Name string `json:"name,omitempty"`
  483. // Type: Identifies this object as a MapLayer.
  484. //
  485. // Possible values:
  486. // "layer"
  487. Type string `json:"type,omitempty"`
  488. // Visibility: The visibility setting of this MapLayer. One of
  489. // "defaultOn" or "defaultOff".
  490. Visibility string `json:"visibility,omitempty"`
  491. // ForceSendFields is a list of field names (e.g. "DefaultViewport") to
  492. // unconditionally include in API requests. By default, fields with
  493. // empty values are omitted from API requests. However, any non-pointer,
  494. // non-interface field appearing in ForceSendFields will be sent to the
  495. // server regardless of whether the field is empty or not. This may be
  496. // used to include empty fields in Patch requests.
  497. ForceSendFields []string `json:"-"`
  498. // NullFields is a list of field names (e.g. "DefaultViewport") to
  499. // include in API requests with the JSON null value. By default, fields
  500. // with empty values are omitted from API requests. However, any field
  501. // with an empty value appearing in NullFields will be sent to the
  502. // server as null. It is an error if a field in this list has a
  503. // non-empty value. This may be used to include null fields in Patch
  504. // requests.
  505. NullFields []string `json:"-"`
  506. }
  507. func (s *MapLayer) MarshalJSON() ([]byte, error) {
  508. type NoMethod MapLayer
  509. raw := NoMethod(*s)
  510. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  511. }