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.
 
 
 

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